@pixldocs/canvas-renderer 0.5.181 → 0.5.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/dist/{index-DQBzPXXr.cjs → index-CUINpGhe.cjs} +9 -8
- package/dist/{index-DQBzPXXr.cjs.map → index-CUINpGhe.cjs.map} +1 -1
- package/dist/{index-Ck5VHk_Q.js → index-CcCXKYy6.js} +52 -51
- package/dist/{index-Ck5VHk_Q.js.map → index-CcCXKYy6.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +37 -37
- package/dist/previewBlur-D1laq3kn.cjs +104 -0
- package/dist/previewBlur-D1laq3kn.cjs.map +1 -0
- package/dist/previewBlur-ceEQYSVv.js +104 -0
- package/dist/previewBlur-ceEQYSVv.js.map +1 -0
- package/dist/{vectorPdfExport-DPng52xI.cjs → vectorPdfExport-0dwbE8Kn.cjs} +4 -4
- package/dist/{vectorPdfExport-DPng52xI.cjs.map → vectorPdfExport-0dwbE8Kn.cjs.map} +1 -1
- package/dist/{vectorPdfExport-KXmgWTkZ.js → vectorPdfExport-BpRBLtU-.js} +4 -4
- package/dist/{vectorPdfExport-KXmgWTkZ.js.map → vectorPdfExport-BpRBLtU-.js.map} +1 -1
- package/package.json +1 -1
- package/dist/previewBlur-BB8gxlmo.cjs +0 -51
- package/dist/previewBlur-BB8gxlmo.cjs.map +0 -1
- package/dist/previewBlur-Dj6dSSNO.js +0 -51
- package/dist/previewBlur-Dj6dSSNO.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-CUINpGhe.cjs");
|
|
4
4
|
exports.DEPLOYMENT_VERSION_MARKER = index.DEPLOYMENT_VERSION_MARKER;
|
|
5
5
|
exports.FONT_FALLBACK_DEVANAGARI = index.FONT_FALLBACK_DEVANAGARI;
|
|
6
6
|
exports.FONT_FALLBACK_MATH = index.FONT_FALLBACK_MATH;
|
package/dist/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { D, F,
|
|
1
|
+
import { D, F, q, s, t, P, u, v, w, x, y, z, B, C, E, G, H, I, J, K, L, M, d, N, O, Q, R, S, U, V, W, X, Y, Z, _, $, a0, a1, a2 } from "./index-CcCXKYy6.js";
|
|
2
2
|
export {
|
|
3
3
|
D as DEPLOYMENT_VERSION_MARKER,
|
|
4
4
|
F as FONT_FALLBACK_DEVANAGARI,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
q as FONT_FALLBACK_MATH,
|
|
6
|
+
s as FONT_FALLBACK_SYMBOLS,
|
|
7
|
+
t as FONT_FILES,
|
|
8
8
|
P as PACKAGE_VERSION,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
9
|
+
u as PixldocsPreview,
|
|
10
|
+
v as PixldocsRenderer,
|
|
11
|
+
w as applyThemeToConfig,
|
|
12
|
+
x as assemblePdfFromSvgs,
|
|
13
|
+
y as awaitFontsForConfig,
|
|
14
|
+
z as collectFontDescriptorsFromConfig,
|
|
15
|
+
B as collectFontsFromConfig,
|
|
16
|
+
C as collectImageUrls,
|
|
17
|
+
E as configHasAutoShrinkText,
|
|
18
|
+
G as dumpSvgTextDiagnostics,
|
|
19
|
+
H as embedFont,
|
|
20
|
+
I as embedFontsForConfig,
|
|
21
|
+
J as embedFontsInPdf,
|
|
22
|
+
K as ensureFontsForResolvedConfig,
|
|
23
|
+
L as extractFontFamiliesFromSvgs,
|
|
24
|
+
M as getEmbeddedJsPDFFontName,
|
|
25
|
+
d as getProxiedImageUrl,
|
|
26
|
+
N as getPublishedTemplate,
|
|
27
|
+
O as getTemplateForm,
|
|
28
|
+
Q as isBundledAssetUrl,
|
|
29
|
+
R as isFontAvailable,
|
|
30
|
+
S as isPrivateUrl,
|
|
31
|
+
U as listPublishedTemplates,
|
|
32
|
+
V as loadGoogleFontCSS,
|
|
33
|
+
W as normalizeFontFamily,
|
|
34
|
+
X as resolveFontWeight,
|
|
35
|
+
Y as resolveFromForm,
|
|
36
|
+
Z as resolveTemplateData,
|
|
37
|
+
_ as rewriteSvgFontsForJsPDF,
|
|
38
|
+
$ as setAutoShrinkDebug,
|
|
39
|
+
a0 as setBundledAssetPrefixes,
|
|
40
|
+
a1 as warmResolvedTemplateForPreview,
|
|
41
|
+
a2 as warmTemplateFromForm
|
|
42
42
|
};
|
|
43
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const index = require("./index-CUINpGhe.cjs");
|
|
4
|
+
const OVERLAY_ID_PREFIX = "__pb_";
|
|
5
|
+
function getNumber(v, fallback = 0) {
|
|
6
|
+
return typeof v === "number" && Number.isFinite(v) ? v : fallback;
|
|
7
|
+
}
|
|
8
|
+
function resolveSize(node, key) {
|
|
9
|
+
const v = node == null ? void 0 : node[key];
|
|
10
|
+
if (typeof v === "number" && Number.isFinite(v)) return v;
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
function collectOverlays(node, parentLeft, parentTop, inheritedBlur, extraBaseIds, extraExactIds, out) {
|
|
14
|
+
if (!node || typeof node !== "object") return;
|
|
15
|
+
const matchesBase = !!(extraBaseIds && typeof node.id === "string" && extraBaseIds.has(index.baseId(node.id)));
|
|
16
|
+
const matchesExact = !!(extraExactIds && typeof node.id === "string" && extraExactIds.has(node.id));
|
|
17
|
+
const isBlurred = inheritedBlur || node.previewBlur === true || matchesBase || matchesExact;
|
|
18
|
+
const absLeft = parentLeft + getNumber(node.left, 0);
|
|
19
|
+
const absTop = parentTop + getNumber(node.top, 0);
|
|
20
|
+
if (node.type === "group") {
|
|
21
|
+
const children = node.children || node.elements;
|
|
22
|
+
if (Array.isArray(children)) {
|
|
23
|
+
for (const child of children) {
|
|
24
|
+
collectOverlays(child, absLeft, absTop, isBlurred, extraBaseIds, extraExactIds, out);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (!isBlurred) return;
|
|
30
|
+
const scaleX = getNumber(node.scaleX, 1) || 1;
|
|
31
|
+
const scaleY = getNumber(node.scaleY, 1) || 1;
|
|
32
|
+
const w = Math.max(4, resolveSize(node, "width") * scaleX);
|
|
33
|
+
const h = Math.max(4, resolveSize(node, "height") * scaleY);
|
|
34
|
+
out.push({
|
|
35
|
+
left: absLeft,
|
|
36
|
+
top: absTop,
|
|
37
|
+
width: w,
|
|
38
|
+
height: h,
|
|
39
|
+
hintFill: typeof node.fill === "string" ? node.fill : void 0
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function parseColor(c) {
|
|
43
|
+
if (!c) return null;
|
|
44
|
+
const s = c.trim();
|
|
45
|
+
const hex = s.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);
|
|
46
|
+
if (hex) {
|
|
47
|
+
let h = hex[1];
|
|
48
|
+
if (h.length === 3) h = h.split("").map((x) => x + x).join("");
|
|
49
|
+
return {
|
|
50
|
+
r: parseInt(h.slice(0, 2), 16),
|
|
51
|
+
g: parseInt(h.slice(2, 4), 16),
|
|
52
|
+
b: parseInt(h.slice(4, 6), 16)
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const rgb = s.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
|
|
56
|
+
if (rgb) return { r: +rgb[1], g: +rgb[2], b: +rgb[3] };
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function buildOverlay(b, idx) {
|
|
60
|
+
const c = parseColor(b.hintFill);
|
|
61
|
+
const lum = c ? (0.299 * c.r + 0.587 * c.g + 0.114 * c.b) / 255 : 0.2;
|
|
62
|
+
const isLightGlass = lum < 0.5;
|
|
63
|
+
const baseFill = isLightGlass ? "rgba(245,245,245,0.68)" : "rgba(30,30,30,0.62)";
|
|
64
|
+
return {
|
|
65
|
+
id: `${OVERLAY_ID_PREFIX}${idx}`,
|
|
66
|
+
type: "shape",
|
|
67
|
+
shapeType: "rounded-rect",
|
|
68
|
+
left: b.left,
|
|
69
|
+
top: b.top,
|
|
70
|
+
width: b.width,
|
|
71
|
+
height: b.height,
|
|
72
|
+
cornerRadius: 0,
|
|
73
|
+
fill: baseFill,
|
|
74
|
+
stroke: "transparent",
|
|
75
|
+
strokeWidth: 0,
|
|
76
|
+
opacity: 1,
|
|
77
|
+
selectable: false,
|
|
78
|
+
locked: true,
|
|
79
|
+
visible: true,
|
|
80
|
+
scaleX: 1,
|
|
81
|
+
scaleY: 1
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function injectPreviewBlur(config, options) {
|
|
85
|
+
const cloned = typeof structuredClone === "function" ? structuredClone(config) : JSON.parse(JSON.stringify(config));
|
|
86
|
+
const extraBase = (options == null ? void 0 : options.extraElementBaseIds) && options.extraElementBaseIds.size > 0 ? options.extraElementBaseIds : void 0;
|
|
87
|
+
const extraExact = (options == null ? void 0 : options.extraElementExactIds) && options.extraElementExactIds.size > 0 ? options.extraElementExactIds : void 0;
|
|
88
|
+
let idx = 0;
|
|
89
|
+
for (const page of cloned.pages || []) {
|
|
90
|
+
const children = page.children || page.elements;
|
|
91
|
+
if (!Array.isArray(children)) continue;
|
|
92
|
+
const overlays = [];
|
|
93
|
+
for (const child of children) {
|
|
94
|
+
collectOverlays(child, 0, 0, false, extraBase, extraExact, overlays);
|
|
95
|
+
}
|
|
96
|
+
if (overlays.length === 0) continue;
|
|
97
|
+
for (const b of overlays) {
|
|
98
|
+
children.push(buildOverlay(b, idx++));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return cloned;
|
|
102
|
+
}
|
|
103
|
+
exports.injectPreviewBlur = injectPreviewBlur;
|
|
104
|
+
//# sourceMappingURL=previewBlur-D1laq3kn.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"previewBlur-D1laq3kn.cjs","sources":["../../../src/lib/previewBlur.ts"],"sourcesContent":["/**\n * Preview Blur (anti-screenshot) injector.\n *\n * Walks a TemplateConfig and, for every element marked `previewBlur: true`\n * (or whose id is in the provided extra sets), appends a translucent\n * \"frosted glass\" overlay rectangle at the element's absolute bounding\n * box. The overlay sits on top of the original element so the content is\n * obscured visually, but layout / text / colors underneath remain intact\n * (no destructive mutation of the source element).\n *\n * The original config is NOT mutated. Safe to chain after `injectWatermark`.\n */\n\nimport type { TemplateConfig, CanvasElement } from '@/types/editor';\nimport { baseId } from '@/lib/formSchema';\n\nconst OVERLAY_ID_PREFIX = '__pb_';\n\nexport function isPreviewBlurOverlay(id: string): boolean {\n return typeof id === 'string' && id.startsWith(OVERLAY_ID_PREFIX);\n}\n\ninterface OverlayBounds {\n left: number;\n top: number;\n width: number;\n height: number;\n /** Used to colour-tune overlay against dark text. */\n hintFill?: string;\n}\n\nfunction getNumber(v: unknown, fallback = 0): number {\n return typeof v === 'number' && Number.isFinite(v) ? v : fallback;\n}\n\nfunction resolveSize(node: any, key: 'width' | 'height'): number {\n const v = node?.[key];\n if (typeof v === 'number' && Number.isFinite(v)) return v;\n // 'auto' or other — fall back to a small minimum so the overlay still shows.\n return 0;\n}\n\n/**\n * Recursively walk a node tree, accumulate parent offsets, and collect\n * overlay rectangles for any node that should be blurred.\n */\nfunction collectOverlays(\n node: any,\n parentLeft: number,\n parentTop: number,\n inheritedBlur: boolean,\n extraBaseIds: Set<string> | undefined,\n extraExactIds: Set<string> | undefined,\n out: OverlayBounds[],\n): void {\n if (!node || typeof node !== 'object') return;\n\n const matchesBase = !!(\n extraBaseIds && typeof node.id === 'string' && extraBaseIds.has(baseId(node.id))\n );\n const matchesExact = !!(\n extraExactIds && typeof node.id === 'string' && extraExactIds.has(node.id)\n );\n const isBlurred = inheritedBlur || node.previewBlur === true || matchesBase || matchesExact;\n\n const absLeft = parentLeft + getNumber(node.left, 0);\n const absTop = parentTop + getNumber(node.top, 0);\n\n if (node.type === 'group') {\n // Groups themselves have no visual; descend so children can be matched\n // and so blur inherits from group → children when the group is flagged.\n const children = (node.children || node.elements) as any[] | undefined;\n if (Array.isArray(children)) {\n for (const child of children) {\n collectOverlays(child, absLeft, absTop, isBlurred, extraBaseIds, extraExactIds, out);\n }\n }\n return;\n }\n\n if (!isBlurred) return;\n\n const scaleX = getNumber(node.scaleX, 1) || 1;\n const scaleY = getNumber(node.scaleY, 1) || 1;\n const w = Math.max(4, resolveSize(node, 'width') * scaleX);\n const h = Math.max(4, resolveSize(node, 'height') * scaleY);\n\n out.push({\n left: absLeft,\n top: absTop,\n width: w,\n height: h,\n hintFill: typeof node.fill === 'string' ? node.fill : undefined,\n });\n}\n\n/** Parse a color to {r,g,b} (best-effort). */\nfunction parseColor(c: string | undefined): { r: number; g: number; b: number } | null {\n if (!c) return null;\n const s = c.trim();\n const hex = s.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);\n if (hex) {\n let h = hex[1];\n if (h.length === 3) h = h.split('').map((x) => x + x).join('');\n return {\n r: parseInt(h.slice(0, 2), 16),\n g: parseInt(h.slice(2, 4), 16),\n b: parseInt(h.slice(4, 6), 16),\n };\n }\n const rgb = s.match(/^rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)/i);\n if (rgb) return { r: +rgb[1], g: +rgb[2], b: +rgb[3] };\n return null;\n}\n\n/** Build a single frosted-glass overlay element. */\nfunction buildOverlay(b: OverlayBounds, idx: number): CanvasElement {\n // Pick a tint based on the underlying text color so the glass reads\n // naturally on both dark text and pale text.\n const c = parseColor(b.hintFill);\n const lum = c ? (0.299 * c.r + 0.587 * c.g + 0.114 * c.b) / 255 : 0.2;\n // Dark text → light glass; light text → dark glass.\n const isLightGlass = lum < 0.5;\n const baseFill = isLightGlass\n ? 'rgba(245,245,245,0.68)'\n : 'rgba(30,30,30,0.62)';\n\n return {\n id: `${OVERLAY_ID_PREFIX}${idx}`,\n type: 'shape',\n shapeType: 'rounded-rect',\n left: b.left,\n top: b.top,\n width: b.width,\n height: b.height,\n cornerRadius: 0,\n fill: baseFill,\n stroke: 'transparent',\n strokeWidth: 0,\n opacity: 1,\n selectable: false,\n locked: true,\n visible: true,\n scaleX: 1,\n scaleY: 1,\n } as unknown as CanvasElement;\n}\n\nexport function injectPreviewBlur(\n config: TemplateConfig,\n options?: {\n extraElementBaseIds?: Set<string>;\n extraElementExactIds?: Set<string>;\n },\n): TemplateConfig {\n const cloned: TemplateConfig =\n typeof structuredClone === 'function'\n ? structuredClone(config)\n : JSON.parse(JSON.stringify(config));\n\n const extraBase =\n options?.extraElementBaseIds && options.extraElementBaseIds.size > 0\n ? options.extraElementBaseIds\n : undefined;\n const extraExact =\n options?.extraElementExactIds && options.extraElementExactIds.size > 0\n ? options.extraElementExactIds\n : undefined;\n\n let idx = 0;\n for (const page of cloned.pages || []) {\n const children = ((page as any).children || (page as any).elements) as any[] | undefined;\n if (!Array.isArray(children)) continue;\n\n const overlays: OverlayBounds[] = [];\n for (const child of children) {\n collectOverlays(child, 0, 0, false, extraBase, extraExact, overlays);\n }\n if (overlays.length === 0) continue;\n\n // Append at the END of the page children so the glass renders on top.\n // (Watermark, when injected, is also appended at the end; running blur\n // AFTER watermark — as the use page does — keeps the glass above text\n // and BELOW the watermark grid, which is the desired anti-screenshot\n // layering.)\n for (const b of overlays) {\n children.push(buildOverlay(b, idx++));\n }\n }\n return cloned;\n}\n\nexport function hasAnyPreviewBlur(config: TemplateConfig): boolean {\n function walk(node: any): boolean {\n if (!node || typeof node !== 'object') return false;\n if (node.previewBlur === true) return true;\n const children = node.children || node.elements;\n if (Array.isArray(children)) {\n for (const c of children) if (walk(c)) return true;\n }\n return false;\n }\n for (const page of config.pages || []) if (walk(page)) return true;\n return false;\n}\n"],"names":["baseId"],"mappings":";;;AAgBA,MAAM,oBAAoB;AAe1B,SAAS,UAAU,GAAY,WAAW,GAAW;AACnD,SAAO,OAAO,MAAM,YAAY,OAAO,SAAS,CAAC,IAAI,IAAI;AAC3D;AAEA,SAAS,YAAY,MAAW,KAAiC;AAC/D,QAAM,IAAI,6BAAO;AACjB,MAAI,OAAO,MAAM,YAAY,OAAO,SAAS,CAAC,EAAG,QAAO;AAExD,SAAO;AACT;AAMA,SAAS,gBACP,MACA,YACA,WACA,eACA,cACA,eACA,KACM;AACN,MAAI,CAAC,QAAQ,OAAO,SAAS,SAAU;AAEvC,QAAM,cAAc,CAAC,EACnB,gBAAgB,OAAO,KAAK,OAAO,YAAY,aAAa,IAAIA,MAAAA,OAAO,KAAK,EAAE,CAAC;AAEjF,QAAM,eAAe,CAAC,EACpB,iBAAiB,OAAO,KAAK,OAAO,YAAY,cAAc,IAAI,KAAK,EAAE;AAE3E,QAAM,YAAY,iBAAiB,KAAK,gBAAgB,QAAQ,eAAe;AAE/E,QAAM,UAAU,aAAa,UAAU,KAAK,MAAM,CAAC;AACnD,QAAM,SAAS,YAAY,UAAU,KAAK,KAAK,CAAC;AAEhD,MAAI,KAAK,SAAS,SAAS;AAGzB,UAAM,WAAY,KAAK,YAAY,KAAK;AACxC,QAAI,MAAM,QAAQ,QAAQ,GAAG;AAC3B,iBAAW,SAAS,UAAU;AAC5B,wBAAgB,OAAO,SAAS,QAAQ,WAAW,cAAc,eAAe,GAAG;AAAA,MAC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";
|
|
2
|
+
const OVERLAY_ID_PREFIX = "__pb_";
|
|
3
|
+
function getNumber(v, fallback = 0) {
|
|
4
|
+
return typeof v === "number" && Number.isFinite(v) ? v : fallback;
|
|
5
|
+
}
|
|
6
|
+
function resolveSize(node, key) {
|
|
7
|
+
const v = node == null ? void 0 : node[key];
|
|
8
|
+
if (typeof v === "number" && Number.isFinite(v)) return v;
|
|
9
|
+
return 0;
|
|
10
|
+
}
|
|
11
|
+
function collectOverlays(node, parentLeft, parentTop, inheritedBlur, extraBaseIds, extraExactIds, out) {
|
|
12
|
+
if (!node || typeof node !== "object") return;
|
|
13
|
+
const matchesBase = !!(extraBaseIds && typeof node.id === "string" && extraBaseIds.has(baseId(node.id)));
|
|
14
|
+
const matchesExact = !!(extraExactIds && typeof node.id === "string" && extraExactIds.has(node.id));
|
|
15
|
+
const isBlurred = inheritedBlur || node.previewBlur === true || matchesBase || matchesExact;
|
|
16
|
+
const absLeft = parentLeft + getNumber(node.left, 0);
|
|
17
|
+
const absTop = parentTop + getNumber(node.top, 0);
|
|
18
|
+
if (node.type === "group") {
|
|
19
|
+
const children = node.children || node.elements;
|
|
20
|
+
if (Array.isArray(children)) {
|
|
21
|
+
for (const child of children) {
|
|
22
|
+
collectOverlays(child, absLeft, absTop, isBlurred, extraBaseIds, extraExactIds, out);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (!isBlurred) return;
|
|
28
|
+
const scaleX = getNumber(node.scaleX, 1) || 1;
|
|
29
|
+
const scaleY = getNumber(node.scaleY, 1) || 1;
|
|
30
|
+
const w = Math.max(4, resolveSize(node, "width") * scaleX);
|
|
31
|
+
const h = Math.max(4, resolveSize(node, "height") * scaleY);
|
|
32
|
+
out.push({
|
|
33
|
+
left: absLeft,
|
|
34
|
+
top: absTop,
|
|
35
|
+
width: w,
|
|
36
|
+
height: h,
|
|
37
|
+
hintFill: typeof node.fill === "string" ? node.fill : void 0
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function parseColor(c) {
|
|
41
|
+
if (!c) return null;
|
|
42
|
+
const s = c.trim();
|
|
43
|
+
const hex = s.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);
|
|
44
|
+
if (hex) {
|
|
45
|
+
let h = hex[1];
|
|
46
|
+
if (h.length === 3) h = h.split("").map((x) => x + x).join("");
|
|
47
|
+
return {
|
|
48
|
+
r: parseInt(h.slice(0, 2), 16),
|
|
49
|
+
g: parseInt(h.slice(2, 4), 16),
|
|
50
|
+
b: parseInt(h.slice(4, 6), 16)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const rgb = s.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
|
|
54
|
+
if (rgb) return { r: +rgb[1], g: +rgb[2], b: +rgb[3] };
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
function buildOverlay(b, idx) {
|
|
58
|
+
const c = parseColor(b.hintFill);
|
|
59
|
+
const lum = c ? (0.299 * c.r + 0.587 * c.g + 0.114 * c.b) / 255 : 0.2;
|
|
60
|
+
const isLightGlass = lum < 0.5;
|
|
61
|
+
const baseFill = isLightGlass ? "rgba(245,245,245,0.68)" : "rgba(30,30,30,0.62)";
|
|
62
|
+
return {
|
|
63
|
+
id: `${OVERLAY_ID_PREFIX}${idx}`,
|
|
64
|
+
type: "shape",
|
|
65
|
+
shapeType: "rounded-rect",
|
|
66
|
+
left: b.left,
|
|
67
|
+
top: b.top,
|
|
68
|
+
width: b.width,
|
|
69
|
+
height: b.height,
|
|
70
|
+
cornerRadius: 0,
|
|
71
|
+
fill: baseFill,
|
|
72
|
+
stroke: "transparent",
|
|
73
|
+
strokeWidth: 0,
|
|
74
|
+
opacity: 1,
|
|
75
|
+
selectable: false,
|
|
76
|
+
locked: true,
|
|
77
|
+
visible: true,
|
|
78
|
+
scaleX: 1,
|
|
79
|
+
scaleY: 1
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function injectPreviewBlur(config, options) {
|
|
83
|
+
const cloned = typeof structuredClone === "function" ? structuredClone(config) : JSON.parse(JSON.stringify(config));
|
|
84
|
+
const extraBase = (options == null ? void 0 : options.extraElementBaseIds) && options.extraElementBaseIds.size > 0 ? options.extraElementBaseIds : void 0;
|
|
85
|
+
const extraExact = (options == null ? void 0 : options.extraElementExactIds) && options.extraElementExactIds.size > 0 ? options.extraElementExactIds : void 0;
|
|
86
|
+
let idx = 0;
|
|
87
|
+
for (const page of cloned.pages || []) {
|
|
88
|
+
const children = page.children || page.elements;
|
|
89
|
+
if (!Array.isArray(children)) continue;
|
|
90
|
+
const overlays = [];
|
|
91
|
+
for (const child of children) {
|
|
92
|
+
collectOverlays(child, 0, 0, false, extraBase, extraExact, overlays);
|
|
93
|
+
}
|
|
94
|
+
if (overlays.length === 0) continue;
|
|
95
|
+
for (const b of overlays) {
|
|
96
|
+
children.push(buildOverlay(b, idx++));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return cloned;
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
injectPreviewBlur
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=previewBlur-ceEQYSVv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"previewBlur-ceEQYSVv.js","sources":["../../../src/lib/previewBlur.ts"],"sourcesContent":["/**\n * Preview Blur (anti-screenshot) injector.\n *\n * Walks a TemplateConfig and, for every element marked `previewBlur: true`\n * (or whose id is in the provided extra sets), appends a translucent\n * \"frosted glass\" overlay rectangle at the element's absolute bounding\n * box. The overlay sits on top of the original element so the content is\n * obscured visually, but layout / text / colors underneath remain intact\n * (no destructive mutation of the source element).\n *\n * The original config is NOT mutated. Safe to chain after `injectWatermark`.\n */\n\nimport type { TemplateConfig, CanvasElement } from '@/types/editor';\nimport { baseId } from '@/lib/formSchema';\n\nconst OVERLAY_ID_PREFIX = '__pb_';\n\nexport function isPreviewBlurOverlay(id: string): boolean {\n return typeof id === 'string' && id.startsWith(OVERLAY_ID_PREFIX);\n}\n\ninterface OverlayBounds {\n left: number;\n top: number;\n width: number;\n height: number;\n /** Used to colour-tune overlay against dark text. */\n hintFill?: string;\n}\n\nfunction getNumber(v: unknown, fallback = 0): number {\n return typeof v === 'number' && Number.isFinite(v) ? v : fallback;\n}\n\nfunction resolveSize(node: any, key: 'width' | 'height'): number {\n const v = node?.[key];\n if (typeof v === 'number' && Number.isFinite(v)) return v;\n // 'auto' or other — fall back to a small minimum so the overlay still shows.\n return 0;\n}\n\n/**\n * Recursively walk a node tree, accumulate parent offsets, and collect\n * overlay rectangles for any node that should be blurred.\n */\nfunction collectOverlays(\n node: any,\n parentLeft: number,\n parentTop: number,\n inheritedBlur: boolean,\n extraBaseIds: Set<string> | undefined,\n extraExactIds: Set<string> | undefined,\n out: OverlayBounds[],\n): void {\n if (!node || typeof node !== 'object') return;\n\n const matchesBase = !!(\n extraBaseIds && typeof node.id === 'string' && extraBaseIds.has(baseId(node.id))\n );\n const matchesExact = !!(\n extraExactIds && typeof node.id === 'string' && extraExactIds.has(node.id)\n );\n const isBlurred = inheritedBlur || node.previewBlur === true || matchesBase || matchesExact;\n\n const absLeft = parentLeft + getNumber(node.left, 0);\n const absTop = parentTop + getNumber(node.top, 0);\n\n if (node.type === 'group') {\n // Groups themselves have no visual; descend so children can be matched\n // and so blur inherits from group → children when the group is flagged.\n const children = (node.children || node.elements) as any[] | undefined;\n if (Array.isArray(children)) {\n for (const child of children) {\n collectOverlays(child, absLeft, absTop, isBlurred, extraBaseIds, extraExactIds, out);\n }\n }\n return;\n }\n\n if (!isBlurred) return;\n\n const scaleX = getNumber(node.scaleX, 1) || 1;\n const scaleY = getNumber(node.scaleY, 1) || 1;\n const w = Math.max(4, resolveSize(node, 'width') * scaleX);\n const h = Math.max(4, resolveSize(node, 'height') * scaleY);\n\n out.push({\n left: absLeft,\n top: absTop,\n width: w,\n height: h,\n hintFill: typeof node.fill === 'string' ? node.fill : undefined,\n });\n}\n\n/** Parse a color to {r,g,b} (best-effort). */\nfunction parseColor(c: string | undefined): { r: number; g: number; b: number } | null {\n if (!c) return null;\n const s = c.trim();\n const hex = s.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);\n if (hex) {\n let h = hex[1];\n if (h.length === 3) h = h.split('').map((x) => x + x).join('');\n return {\n r: parseInt(h.slice(0, 2), 16),\n g: parseInt(h.slice(2, 4), 16),\n b: parseInt(h.slice(4, 6), 16),\n };\n }\n const rgb = s.match(/^rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)/i);\n if (rgb) return { r: +rgb[1], g: +rgb[2], b: +rgb[3] };\n return null;\n}\n\n/** Build a single frosted-glass overlay element. */\nfunction buildOverlay(b: OverlayBounds, idx: number): CanvasElement {\n // Pick a tint based on the underlying text color so the glass reads\n // naturally on both dark text and pale text.\n const c = parseColor(b.hintFill);\n const lum = c ? (0.299 * c.r + 0.587 * c.g + 0.114 * c.b) / 255 : 0.2;\n // Dark text → light glass; light text → dark glass.\n const isLightGlass = lum < 0.5;\n const baseFill = isLightGlass\n ? 'rgba(245,245,245,0.68)'\n : 'rgba(30,30,30,0.62)';\n\n return {\n id: `${OVERLAY_ID_PREFIX}${idx}`,\n type: 'shape',\n shapeType: 'rounded-rect',\n left: b.left,\n top: b.top,\n width: b.width,\n height: b.height,\n cornerRadius: 0,\n fill: baseFill,\n stroke: 'transparent',\n strokeWidth: 0,\n opacity: 1,\n selectable: false,\n locked: true,\n visible: true,\n scaleX: 1,\n scaleY: 1,\n } as unknown as CanvasElement;\n}\n\nexport function injectPreviewBlur(\n config: TemplateConfig,\n options?: {\n extraElementBaseIds?: Set<string>;\n extraElementExactIds?: Set<string>;\n },\n): TemplateConfig {\n const cloned: TemplateConfig =\n typeof structuredClone === 'function'\n ? structuredClone(config)\n : JSON.parse(JSON.stringify(config));\n\n const extraBase =\n options?.extraElementBaseIds && options.extraElementBaseIds.size > 0\n ? options.extraElementBaseIds\n : undefined;\n const extraExact =\n options?.extraElementExactIds && options.extraElementExactIds.size > 0\n ? options.extraElementExactIds\n : undefined;\n\n let idx = 0;\n for (const page of cloned.pages || []) {\n const children = ((page as any).children || (page as any).elements) as any[] | undefined;\n if (!Array.isArray(children)) continue;\n\n const overlays: OverlayBounds[] = [];\n for (const child of children) {\n collectOverlays(child, 0, 0, false, extraBase, extraExact, overlays);\n }\n if (overlays.length === 0) continue;\n\n // Append at the END of the page children so the glass renders on top.\n // (Watermark, when injected, is also appended at the end; running blur\n // AFTER watermark — as the use page does — keeps the glass above text\n // and BELOW the watermark grid, which is the desired anti-screenshot\n // layering.)\n for (const b of overlays) {\n children.push(buildOverlay(b, idx++));\n }\n }\n return cloned;\n}\n\nexport function hasAnyPreviewBlur(config: TemplateConfig): boolean {\n function walk(node: any): boolean {\n if (!node || typeof node !== 'object') return false;\n if (node.previewBlur === true) return true;\n const children = node.children || node.elements;\n if (Array.isArray(children)) {\n for (const c of children) if (walk(c)) return true;\n }\n return false;\n }\n for (const page of config.pages || []) if (walk(page)) return true;\n return false;\n}\n"],"names":[],"mappings":";AAgBA,MAAM,oBAAoB;AAe1B,SAAS,UAAU,GAAY,WAAW,GAAW;AACnD,SAAO,OAAO,MAAM,YAAY,OAAO,SAAS,CAAC,IAAI,IAAI;AAC3D;AAEA,SAAS,YAAY,MAAW,KAAiC;AAC/D,QAAM,IAAI,6BAAO;AACjB,MAAI,OAAO,MAAM,YAAY,OAAO,SAAS,CAAC,EAAG,QAAO;AAExD,SAAO;AACT;AAMA,SAAS,gBACP,MACA,YACA,WACA,eACA,cACA,eACA,KACM;AACN,MAAI,CAAC,QAAQ,OAAO,SAAS,SAAU;AAEvC,QAAM,cAAc,CAAC,EACnB,gBAAgB,OAAO,KAAK,OAAO,YAAY,aAAa,IAAI,OAAO,KAAK,EAAE,CAAC;AAEjF,QAAM,eAAe,CAAC,EACpB,iBAAiB,OAAO,KAAK,OAAO,YAAY,cAAc,IAAI,KAAK,EA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AC,MAAM,QAAQ,QAAQ,EAAG;AAE9B,UAAM,WAA4B,CAAA;AAClC,eAAW,SAAS,UAAU;AAC5B,sBAAgB,OAAO,GAAG,GAAG,OAAO,WAAW,YAAY,QAAQ;AAAA,IACrE;AACA,QAAI,SAAS,WAAW,EAAG;AAO3B,eAAW,KAAK,UAAU;AACxB,eAAS,KAAK,aAAa,GAAG,KAAK,CAAC;AAAA,IACtC;AAAA,EACF;AACA,SAAO;AACT;"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jspdf = require("jspdf");
|
|
4
4
|
const svg2pdf_js = require("svg2pdf.js");
|
|
5
5
|
const fabric = require("fabric");
|
|
6
|
-
const index = require("./index-
|
|
6
|
+
const index = require("./index-CUINpGhe.cjs");
|
|
7
7
|
const pdfFonts = require("./pdfFonts-BTj2f465.cjs");
|
|
8
8
|
function _interopNamespaceDefault(e) {
|
|
9
9
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -2525,7 +2525,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
|
|
|
2525
2525
|
async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
|
|
2526
2526
|
if (!colorMap || Object.keys(colorMap).length === 0) return null;
|
|
2527
2527
|
try {
|
|
2528
|
-
const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-
|
|
2528
|
+
const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-CUINpGhe.cjs")).then((n) => n.canvasImageLoader);
|
|
2529
2529
|
return await getNormalizedSvgUrl(imageUrl, colorMap);
|
|
2530
2530
|
} catch {
|
|
2531
2531
|
return null;
|
|
@@ -3316,7 +3316,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
|
|
|
3316
3316
|
}
|
|
3317
3317
|
let fetchUrl = imageUrl;
|
|
3318
3318
|
if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
|
|
3319
|
-
const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-
|
|
3319
|
+
const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-CUINpGhe.cjs")).then((n) => n.canvasImageLoader);
|
|
3320
3320
|
if (isPrivateUrl(imageUrl)) return null;
|
|
3321
3321
|
const proxyUrl = new URL(`${index.API_URL}/image-proxy`);
|
|
3322
3322
|
proxyUrl.searchParams.set("url", imageUrl);
|
|
@@ -5310,4 +5310,4 @@ exports.exportMultiPagePdf = exportMultiPagePdf;
|
|
|
5310
5310
|
exports.logTextMeasurementDiagnostic = logTextMeasurementDiagnostic;
|
|
5311
5311
|
exports.preparePagesForExport = preparePagesForExport;
|
|
5312
5312
|
exports.rewriteSvgFontsForJsPDFWithSourceMeta = rewriteSvgFontsForJsPDFWithSourceMeta;
|
|
5313
|
-
//# sourceMappingURL=vectorPdfExport-
|
|
5313
|
+
//# sourceMappingURL=vectorPdfExport-0dwbE8Kn.cjs.map
|