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