@pixldocs/canvas-renderer 0.5.231 → 0.5.232
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-BbgFuxwu.cjs → index-BqnHjSp9.cjs} +54 -5
- package/dist/{index-BbgFuxwu.cjs.map → index-BqnHjSp9.cjs.map} +1 -1
- package/dist/{index-YHIa8GZv.js → index-DlrTh8y7.js} +62 -13
- package/dist/{index-YHIa8GZv.js.map → index-DlrTh8y7.js.map} +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +50 -0
- package/dist/index.js +9 -8
- package/dist/{vectorPdfExport-ByHidrM_.js → vectorPdfExport-BcNEn5nI.js} +4 -4
- package/dist/{vectorPdfExport-ByHidrM_.js.map → vectorPdfExport-BcNEn5nI.js.map} +1 -1
- package/dist/{vectorPdfExport-Dwv5vpcI.cjs → vectorPdfExport-HZtiPy3x.cjs} +4 -4
- package/dist/{vectorPdfExport-Dwv5vpcI.cjs.map → vectorPdfExport-HZtiPy3x.cjs.map} +1 -1
- package/package.json +1 -1
|
@@ -19963,6 +19963,54 @@ async function getTemplateForm(options) {
|
|
|
19963
19963
|
initialSectionState
|
|
19964
19964
|
};
|
|
19965
19965
|
}
|
|
19966
|
+
async function resolveForRender(input) {
|
|
19967
|
+
var _a2;
|
|
19968
|
+
const {
|
|
19969
|
+
templateConfig,
|
|
19970
|
+
templateId,
|
|
19971
|
+
formSchemaId,
|
|
19972
|
+
sectionState,
|
|
19973
|
+
flatFormData,
|
|
19974
|
+
themeId,
|
|
19975
|
+
watermark,
|
|
19976
|
+
prefetched,
|
|
19977
|
+
supabaseUrl,
|
|
19978
|
+
supabaseAnonKey
|
|
19979
|
+
} = input;
|
|
19980
|
+
if (templateConfig) {
|
|
19981
|
+
return {
|
|
19982
|
+
config: templateConfig,
|
|
19983
|
+
templateName: templateConfig.name || "Untitled",
|
|
19984
|
+
templateId
|
|
19985
|
+
};
|
|
19986
|
+
}
|
|
19987
|
+
if (!templateId) {
|
|
19988
|
+
throw new Error("[resolveForRender] templateId is required when templateConfig is not provided");
|
|
19989
|
+
}
|
|
19990
|
+
const hasSectionState = !!sectionState && Object.keys(sectionState).length > 0;
|
|
19991
|
+
if (formSchemaId || hasSectionState || ((_a2 = prefetched == null ? void 0 : prefetched.templateRow) == null ? void 0 : _a2.config)) {
|
|
19992
|
+
return resolveFromForm({
|
|
19993
|
+
templateId,
|
|
19994
|
+
formSchemaId,
|
|
19995
|
+
// CRITICAL: only forward sectionState when it is *actually* V2 state.
|
|
19996
|
+
// Forwarding flatFormData here would make resolveFromForm think it has
|
|
19997
|
+
// V2 data and skip the flat-key apply path — the exact bug that left
|
|
19998
|
+
// dynamic text stale on staging /use-package PDFs.
|
|
19999
|
+
sectionState: hasSectionState ? sectionState : void 0,
|
|
20000
|
+
flatFormData,
|
|
20001
|
+
themeId,
|
|
20002
|
+
supabaseUrl,
|
|
20003
|
+
supabaseAnonKey,
|
|
20004
|
+
prefetched
|
|
20005
|
+
});
|
|
20006
|
+
}
|
|
20007
|
+
return resolveTemplateData({
|
|
20008
|
+
templateId,
|
|
20009
|
+
formData: flatFormData ?? {},
|
|
20010
|
+
supabaseUrl,
|
|
20011
|
+
supabaseAnonKey
|
|
20012
|
+
});
|
|
20013
|
+
}
|
|
19966
20014
|
const OVERLAY_ID_PREFIX = "__pb_";
|
|
19967
20015
|
function getNumber(v, fallback = 0) {
|
|
19968
20016
|
return typeof v === "number" && Number.isFinite(v) ? v : fallback;
|
|
@@ -21038,9 +21086,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
21038
21086
|
}
|
|
21039
21087
|
return svgString;
|
|
21040
21088
|
}
|
|
21041
|
-
const resolvedPackageVersion = "0.5.
|
|
21089
|
+
const resolvedPackageVersion = "0.5.232";
|
|
21042
21090
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
21043
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
21091
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.232";
|
|
21044
21092
|
const roundParityValue = (value) => {
|
|
21045
21093
|
if (typeof value !== "number") return value;
|
|
21046
21094
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -21784,7 +21832,7 @@ class PixldocsRenderer {
|
|
|
21784
21832
|
await this.waitForCanvasScene(container, cloned, i);
|
|
21785
21833
|
}
|
|
21786
21834
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
21787
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
21835
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BcNEn5nI.js");
|
|
21788
21836
|
const prepared = preparePagesForExport(
|
|
21789
21837
|
cloned.pages,
|
|
21790
21838
|
canvasWidth,
|
|
@@ -24104,7 +24152,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
24104
24152
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
24105
24153
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
24106
24154
|
try {
|
|
24107
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
24155
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BcNEn5nI.js");
|
|
24108
24156
|
try {
|
|
24109
24157
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
24110
24158
|
} catch {
|
|
@@ -24441,7 +24489,7 @@ function setAutoShrinkDebug(enabled) {
|
|
|
24441
24489
|
}
|
|
24442
24490
|
}
|
|
24443
24491
|
export {
|
|
24444
|
-
|
|
24492
|
+
resolveForRender as $,
|
|
24445
24493
|
API_URL as A,
|
|
24446
24494
|
collectFontsFromConfig as B,
|
|
24447
24495
|
collectImageUrls as C,
|
|
@@ -24470,13 +24518,14 @@ export {
|
|
|
24470
24518
|
resolveBlurElementExactIdsFromFlatFormKeys as Z,
|
|
24471
24519
|
resolveFontWeight as _,
|
|
24472
24520
|
getAbsoluteBounds as a,
|
|
24473
|
-
|
|
24474
|
-
|
|
24475
|
-
|
|
24476
|
-
|
|
24477
|
-
|
|
24478
|
-
|
|
24479
|
-
|
|
24521
|
+
resolveFromForm as a0,
|
|
24522
|
+
resolveTemplateData as a1,
|
|
24523
|
+
rewriteSvgFontsForJsPDF as a2,
|
|
24524
|
+
setAutoShrinkDebug as a3,
|
|
24525
|
+
setBundledAssetPrefixes as a4,
|
|
24526
|
+
warmResolvedTemplateForPreview as a5,
|
|
24527
|
+
warmTemplateFromForm as a6,
|
|
24528
|
+
canvasImageLoader as a7,
|
|
24480
24529
|
getProxiedImageUrl as b,
|
|
24481
24530
|
captureFabricCanvasSvgForPdf as c,
|
|
24482
24531
|
getImageProxyFetchOptions as d,
|
|
@@ -24503,4 +24552,4 @@ export {
|
|
|
24503
24552
|
buildTeaserBlurFlatKeys as y,
|
|
24504
24553
|
collectFontDescriptorsFromConfig as z
|
|
24505
24554
|
};
|
|
24506
|
-
//# sourceMappingURL=index-
|
|
24555
|
+
//# sourceMappingURL=index-DlrTh8y7.js.map
|