@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/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-_ogxqALr.cjs");
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;
@@ -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, 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-Xg0sHfrw.js";
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
- q as FONT_FALLBACK_MATH,
6
- s as FONT_FALLBACK_SYMBOLS,
7
- t as FONT_FILES,
5
+ o as FONT_FALLBACK_MATH,
6
+ q as FONT_FALLBACK_SYMBOLS,
7
+ s as FONT_FILES,
8
8
  P as PACKAGE_VERSION,
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
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-_ogxqALr.cjs");
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-_ogxqALr.cjs")).then((n) => n.canvasImageLoader);
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-_ogxqALr.cjs")).then((n) => n.canvasImageLoader);
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-Dh3el4F0.cjs.map
5313
+ //# sourceMappingURL=vectorPdfExport-B2Cf-9eT.cjs.map