@pixldocs/canvas-renderer 0.5.186 → 0.5.188
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 +84 -0
- package/dist/{index-_ogxqALr.cjs → index-0rk-MRGy.cjs} +193 -15
- package/dist/index-0rk-MRGy.cjs.map +1 -0
- package/dist/{index-Xg0sHfrw.js → index-CjZZhQH6.js} +236 -58
- package/dist/index-CjZZhQH6.js.map +1 -0
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +31 -0
- package/dist/index.js +40 -37
- package/dist/{vectorPdfExport-Dh3el4F0.cjs → vectorPdfExport-B2Cf-9eT.cjs} +4 -4
- package/dist/{vectorPdfExport-Dh3el4F0.cjs.map → vectorPdfExport-B2Cf-9eT.cjs.map} +1 -1
- package/dist/{vectorPdfExport-v3mr9nks.js → vectorPdfExport-CSh0zFox.js} +4 -4
- package/dist/{vectorPdfExport-v3mr9nks.js.map → vectorPdfExport-CSh0zFox.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-Xg0sHfrw.js.map +0 -1
- package/dist/index-_ogxqALr.cjs.map +0 -1
- package/dist/previewBlur-CDBjIIjX.js +0 -104
- package/dist/previewBlur-CDBjIIjX.js.map +0 -1
- package/dist/previewBlur-D2aWUrre.cjs +0 -104
- package/dist/previewBlur-D2aWUrre.cjs.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-0rk-MRGy.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;
|
|
@@ -26,12 +26,15 @@ exports.getEmbeddedJsPDFFontName = index.getEmbeddedJsPDFFontName;
|
|
|
26
26
|
exports.getProxiedImageUrl = index.getProxiedImageUrl;
|
|
27
27
|
exports.getPublishedTemplate = index.getPublishedTemplate;
|
|
28
28
|
exports.getTemplateForm = index.getTemplateForm;
|
|
29
|
+
exports.hasAnyPreviewBlur = index.hasAnyPreviewBlur;
|
|
30
|
+
exports.injectPreviewBlur = index.injectPreviewBlur;
|
|
29
31
|
exports.isBundledAssetUrl = index.isBundledAssetUrl;
|
|
30
32
|
exports.isFontAvailable = index.isFontAvailable;
|
|
31
33
|
exports.isPrivateUrl = index.isPrivateUrl;
|
|
32
34
|
exports.listPublishedTemplates = index.listPublishedTemplates;
|
|
33
35
|
exports.loadGoogleFontCSS = index.loadGoogleFontCSS;
|
|
34
36
|
exports.normalizeFontFamily = index.normalizeFontFamily;
|
|
37
|
+
exports.resolveBlurElementExactIdsFromFlatFormKeys = index.resolveBlurElementExactIdsFromFlatFormKeys;
|
|
35
38
|
exports.resolveFontWeight = index.resolveFontWeight;
|
|
36
39
|
exports.resolveFromForm = index.resolveFromForm;
|
|
37
40
|
exports.resolveTemplateData = index.resolveTemplateData;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { FormConfig } from '../../../src/lib/formsApi';
|
|
2
2
|
import { getProxiedImageUrl } from '../../../src/lib/canvasImageLoader';
|
|
3
|
+
import { hasAnyPreviewBlur } from '../../../src/lib/previewBlur';
|
|
3
4
|
import { InferredSection } from '../../../src/lib/inferFormSchemaFromTemplate';
|
|
5
|
+
import { injectPreviewBlur } from '../../../src/lib/previewBlur';
|
|
4
6
|
import { isBundledAssetUrl } from '../../../src/lib/canvasImageLoader';
|
|
5
7
|
import { isPrivateUrl } from '../../../src/lib/canvasImageLoader';
|
|
6
8
|
import { jsPDF } from 'jspdf';
|
|
7
9
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
10
|
+
import { resolveBlurElementExactIdsFromFlatFormKeys } from '../../../src/lib/previewBlur';
|
|
11
|
+
import { ResolveBlurOptions } from '../../../src/lib/previewBlur';
|
|
8
12
|
import { SectionFormState } from '../../../src/lib/inferFormSchemaFromTemplate';
|
|
9
13
|
import { setBundledAssetPrefixes } from '../../../src/lib/canvasImageLoader';
|
|
10
14
|
import { SmartElementProps } from '../../../shared/smart-elements/types';
|
|
@@ -253,8 +257,12 @@ export declare interface GetTemplateFormOptions {
|
|
|
253
257
|
supabaseAnonKey: string;
|
|
254
258
|
}
|
|
255
259
|
|
|
260
|
+
export { hasAnyPreviewBlur }
|
|
261
|
+
|
|
256
262
|
export { InferredSection }
|
|
257
263
|
|
|
264
|
+
export { injectPreviewBlur }
|
|
265
|
+
|
|
258
266
|
export { isBundledAssetUrl }
|
|
259
267
|
|
|
260
268
|
/** Check if a font is in our local mapping */
|
|
@@ -415,6 +423,25 @@ declare interface PixldocsPreviewBaseProps {
|
|
|
415
423
|
blurFieldIds?: string[];
|
|
416
424
|
/** Exact element-id matches (no base-id stripping). */
|
|
417
425
|
blurElementExactIds?: string[];
|
|
426
|
+
/**
|
|
427
|
+
* Flat form-keys (the same keys you'd build for
|
|
428
|
+
* `applyFormDataToConfig` — e.g.
|
|
429
|
+
* `field_<treeNodeId>_<entryIdx1>_<fieldKey>` or the nested variant)
|
|
430
|
+
* to apply the live frosted-glass overlay to. The package walks
|
|
431
|
+
* `config.__cloneIdMap` for you and resolves each key to its cloned
|
|
432
|
+
* element ids across every page / repeatable entry.
|
|
433
|
+
*
|
|
434
|
+
* By default only keys ending in `_value` are honoured (the typical
|
|
435
|
+
* "blur biodata row values, keep labels sharp" pattern). Pass
|
|
436
|
+
* `blurFlatFormKeyOptions={{ bindings: 'all' }}` to opt out.
|
|
437
|
+
*
|
|
438
|
+
* For watermarked PNG/PDF exports, call
|
|
439
|
+
* `resolveBlurElementExactIdsFromFlatFormKeys(config, keys)` and feed
|
|
440
|
+
* the result to `injectPreviewBlur(config, { extraElementExactIds })`.
|
|
441
|
+
*/
|
|
442
|
+
blurFlatFormKeys?: string[];
|
|
443
|
+
/** Tuning knobs for `blurFlatFormKeys` resolution. */
|
|
444
|
+
blurFlatFormKeyOptions?: ResolveBlurOptions;
|
|
418
445
|
}
|
|
419
446
|
|
|
420
447
|
/** Mode 1: Pre-resolved config */
|
|
@@ -660,6 +687,10 @@ export declare interface RenderResult {
|
|
|
660
687
|
pixelHeight: number;
|
|
661
688
|
}
|
|
662
689
|
|
|
690
|
+
export { resolveBlurElementExactIdsFromFlatFormKeys }
|
|
691
|
+
|
|
692
|
+
export { ResolveBlurOptions }
|
|
693
|
+
|
|
663
694
|
export declare interface ResolvedTemplate {
|
|
664
695
|
config: TemplateConfig;
|
|
665
696
|
templateName: string;
|
package/dist/index.js
CHANGED
|
@@ -1,43 +1,46 @@
|
|
|
1
|
-
import { D, F, q, s,
|
|
1
|
+
import { D, F, o, q, s, P, t, u, v, w, x, y, z, B, C, E, G, H, I, J, K, L, b, M, N, O, Q, R, S, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4 } from "./index-CjZZhQH6.js";
|
|
2
2
|
export {
|
|
3
3
|
D as DEPLOYMENT_VERSION_MARKER,
|
|
4
4
|
F as FONT_FALLBACK_DEVANAGARI,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
o as FONT_FALLBACK_MATH,
|
|
6
|
+
q as FONT_FALLBACK_SYMBOLS,
|
|
7
|
+
s 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
|
+
t as PixldocsPreview,
|
|
10
|
+
u as PixldocsRenderer,
|
|
11
|
+
v as applyThemeToConfig,
|
|
12
|
+
w as assemblePdfFromSvgs,
|
|
13
|
+
x as awaitFontsForConfig,
|
|
14
|
+
y as collectFontDescriptorsFromConfig,
|
|
15
|
+
z as collectFontsFromConfig,
|
|
16
|
+
B as collectImageUrls,
|
|
17
|
+
C as configHasAutoShrinkText,
|
|
18
|
+
E as dumpSvgTextDiagnostics,
|
|
19
|
+
G as embedFont,
|
|
20
|
+
H as embedFontsForConfig,
|
|
21
|
+
I as embedFontsInPdf,
|
|
22
|
+
J as ensureFontsForResolvedConfig,
|
|
23
|
+
K as extractFontFamiliesFromSvgs,
|
|
24
|
+
L as getEmbeddedJsPDFFontName,
|
|
25
|
+
b as getProxiedImageUrl,
|
|
26
|
+
M as getPublishedTemplate,
|
|
27
|
+
N as getTemplateForm,
|
|
28
|
+
O as hasAnyPreviewBlur,
|
|
29
|
+
Q as injectPreviewBlur,
|
|
30
|
+
R as isBundledAssetUrl,
|
|
31
|
+
S as isFontAvailable,
|
|
32
|
+
U as isPrivateUrl,
|
|
33
|
+
V as listPublishedTemplates,
|
|
34
|
+
W as loadGoogleFontCSS,
|
|
35
|
+
X as normalizeFontFamily,
|
|
36
|
+
Y as resolveBlurElementExactIdsFromFlatFormKeys,
|
|
37
|
+
Z as resolveFontWeight,
|
|
38
|
+
_ as resolveFromForm,
|
|
39
|
+
$ as resolveTemplateData,
|
|
40
|
+
a0 as rewriteSvgFontsForJsPDF,
|
|
41
|
+
a1 as setAutoShrinkDebug,
|
|
42
|
+
a2 as setBundledAssetPrefixes,
|
|
43
|
+
a3 as warmResolvedTemplateForPreview,
|
|
44
|
+
a4 as warmTemplateFromForm
|
|
42
45
|
};
|
|
43
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -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-0rk-MRGy.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-0rk-MRGy.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-0rk-MRGy.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-B2Cf-9eT.cjs.map
|