@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
|
@@ -19981,6 +19981,53 @@ async function getTemplateForm(options) {
|
|
|
19981
19981
|
initialSectionState
|
|
19982
19982
|
};
|
|
19983
19983
|
}
|
|
19984
|
+
async function resolveForRender(input) {
|
|
19985
|
+
var _a2;
|
|
19986
|
+
const {
|
|
19987
|
+
templateConfig,
|
|
19988
|
+
templateId,
|
|
19989
|
+
formSchemaId,
|
|
19990
|
+
sectionState,
|
|
19991
|
+
flatFormData,
|
|
19992
|
+
themeId,
|
|
19993
|
+
prefetched,
|
|
19994
|
+
supabaseUrl,
|
|
19995
|
+
supabaseAnonKey
|
|
19996
|
+
} = input;
|
|
19997
|
+
if (templateConfig) {
|
|
19998
|
+
return {
|
|
19999
|
+
config: templateConfig,
|
|
20000
|
+
templateName: templateConfig.name || "Untitled",
|
|
20001
|
+
templateId
|
|
20002
|
+
};
|
|
20003
|
+
}
|
|
20004
|
+
if (!templateId) {
|
|
20005
|
+
throw new Error("[resolveForRender] templateId is required when templateConfig is not provided");
|
|
20006
|
+
}
|
|
20007
|
+
const hasSectionState = !!sectionState && Object.keys(sectionState).length > 0;
|
|
20008
|
+
if (formSchemaId || hasSectionState || ((_a2 = prefetched == null ? void 0 : prefetched.templateRow) == null ? void 0 : _a2.config)) {
|
|
20009
|
+
return resolveFromForm({
|
|
20010
|
+
templateId,
|
|
20011
|
+
formSchemaId,
|
|
20012
|
+
// CRITICAL: only forward sectionState when it is *actually* V2 state.
|
|
20013
|
+
// Forwarding flatFormData here would make resolveFromForm think it has
|
|
20014
|
+
// V2 data and skip the flat-key apply path — the exact bug that left
|
|
20015
|
+
// dynamic text stale on staging /use-package PDFs.
|
|
20016
|
+
sectionState: hasSectionState ? sectionState : void 0,
|
|
20017
|
+
flatFormData,
|
|
20018
|
+
themeId,
|
|
20019
|
+
supabaseUrl,
|
|
20020
|
+
supabaseAnonKey,
|
|
20021
|
+
prefetched
|
|
20022
|
+
});
|
|
20023
|
+
}
|
|
20024
|
+
return resolveTemplateData({
|
|
20025
|
+
templateId,
|
|
20026
|
+
formData: flatFormData ?? {},
|
|
20027
|
+
supabaseUrl,
|
|
20028
|
+
supabaseAnonKey
|
|
20029
|
+
});
|
|
20030
|
+
}
|
|
19984
20031
|
const OVERLAY_ID_PREFIX = "__pb_";
|
|
19985
20032
|
function getNumber(v, fallback = 0) {
|
|
19986
20033
|
return typeof v === "number" && Number.isFinite(v) ? v : fallback;
|
|
@@ -21056,9 +21103,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
21056
21103
|
}
|
|
21057
21104
|
return svgString;
|
|
21058
21105
|
}
|
|
21059
|
-
const resolvedPackageVersion = "0.5.
|
|
21106
|
+
const resolvedPackageVersion = "0.5.233";
|
|
21060
21107
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
21061
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
21108
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.233";
|
|
21062
21109
|
const roundParityValue = (value) => {
|
|
21063
21110
|
if (typeof value !== "number") return value;
|
|
21064
21111
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -21802,7 +21849,7 @@ class PixldocsRenderer {
|
|
|
21802
21849
|
await this.waitForCanvasScene(container, cloned, i);
|
|
21803
21850
|
}
|
|
21804
21851
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
21805
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
21852
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DTCd5GSf.cjs"));
|
|
21806
21853
|
const prepared = preparePagesForExport(
|
|
21807
21854
|
cloned.pages,
|
|
21808
21855
|
canvasWidth,
|
|
@@ -24122,7 +24169,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
24122
24169
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
24123
24170
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
24124
24171
|
try {
|
|
24125
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
24172
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DTCd5GSf.cjs"));
|
|
24126
24173
|
try {
|
|
24127
24174
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
24128
24175
|
} catch {
|
|
@@ -24511,6 +24558,7 @@ exports.parseTextMarkdown = parseTextMarkdown;
|
|
|
24511
24558
|
exports.renderSmartElementToSvg = renderSmartElementToSvg;
|
|
24512
24559
|
exports.resolveBlurElementExactIdsFromFlatFormKeys = resolveBlurElementExactIdsFromFlatFormKeys;
|
|
24513
24560
|
exports.resolveFontWeight = resolveFontWeight;
|
|
24561
|
+
exports.resolveForRender = resolveForRender;
|
|
24514
24562
|
exports.resolveFromForm = resolveFromForm;
|
|
24515
24563
|
exports.resolveTemplateData = resolveTemplateData;
|
|
24516
24564
|
exports.rewriteSvgFontsForJsPDF = rewriteSvgFontsForJsPDF;
|
|
@@ -24518,4 +24566,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
24518
24566
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
24519
24567
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
24520
24568
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
24521
|
-
//# sourceMappingURL=index-
|
|
24569
|
+
//# sourceMappingURL=index-3rzFNy2Z.cjs.map
|