@pixldocs/canvas-renderer 0.5.453 → 0.5.455
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-B4ZctiMj.js → index-Bs4oHgQ2.js} +49 -9
- package/dist/index-Bs4oHgQ2.js.map +1 -0
- package/dist/{index-B8LHS1IK.cjs → index-CoBJQqYp.cjs} +49 -9
- package/dist/index-CoBJQqYp.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-B4XYT84_.cjs → vectorPdfExport-CErInEKs.cjs} +4 -4
- package/dist/{vectorPdfExport-B4XYT84_.cjs.map → vectorPdfExport-CErInEKs.cjs.map} +1 -1
- package/dist/{vectorPdfExport-DA8kyWb1.js → vectorPdfExport-Dl1_fD7e.js} +4 -4
- package/dist/{vectorPdfExport-DA8kyWb1.js.map → vectorPdfExport-Dl1_fD7e.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-B4ZctiMj.js.map +0 -1
- package/dist/index-B8LHS1IK.cjs.map +0 -1
|
@@ -20991,6 +20991,20 @@ function flattenSectionStateToFormData(sectionState, sections) {
|
|
|
20991
20991
|
}
|
|
20992
20992
|
return flat;
|
|
20993
20993
|
}
|
|
20994
|
+
function gradientSiblingForTarget(targetProperty) {
|
|
20995
|
+
switch (targetProperty) {
|
|
20996
|
+
case "fill":
|
|
20997
|
+
return "fillGradient";
|
|
20998
|
+
case "stroke":
|
|
20999
|
+
return "strokeGradient";
|
|
21000
|
+
case "textBgColor":
|
|
21001
|
+
return "textBgGradient";
|
|
21002
|
+
case "backgroundColor":
|
|
21003
|
+
return "backgroundGradient";
|
|
21004
|
+
default:
|
|
21005
|
+
return null;
|
|
21006
|
+
}
|
|
21007
|
+
}
|
|
20994
21008
|
const CLONE_SUFFIX = /_\d+$/;
|
|
20995
21009
|
function baseId(id) {
|
|
20996
21010
|
let s = id;
|
|
@@ -21063,6 +21077,9 @@ function applyTextCase(text, textCase) {
|
|
|
21063
21077
|
return text;
|
|
21064
21078
|
}
|
|
21065
21079
|
}
|
|
21080
|
+
function hasInlineFormattingMarkers(value) {
|
|
21081
|
+
return /\*\*[\s\S]+?\*\*|__[\s\S]+?__|~~[\s\S]+?~~|==[\s\S]+?==|\[(?:c|bg)=[^\]]+\][\s\S]+?\[\/(?:c|bg)\]|(^|[^*])\*[^*\n]+?\*/i.test(value);
|
|
21082
|
+
}
|
|
21066
21083
|
function setInTree(nodes, elementId, targetProperty, value) {
|
|
21067
21084
|
for (const node of nodes) {
|
|
21068
21085
|
if (node.id === elementId) {
|
|
@@ -21077,6 +21094,9 @@ function setInTree(nodes, elementId, targetProperty, value) {
|
|
|
21077
21094
|
} else if (targetProperty === "text" && node.type === "text" && typeof value === "string") {
|
|
21078
21095
|
const textVal = value === "" ? " " : value;
|
|
21079
21096
|
node[targetProperty] = applyTextCase(textVal, node.textCase);
|
|
21097
|
+
if (hasInlineFormattingMarkers(textVal)) {
|
|
21098
|
+
node.formattingEnabled = true;
|
|
21099
|
+
}
|
|
21080
21100
|
} else if ((targetProperty === "src" || targetProperty === "imageUrl") && node.type === "image") {
|
|
21081
21101
|
const previousSrc = String(node.src || node.imageUrl || "");
|
|
21082
21102
|
const nextSrc = String(value ?? "");
|
|
@@ -21091,7 +21111,18 @@ function setInTree(nodes, elementId, targetProperty, value) {
|
|
|
21091
21111
|
delete node.cropZoom;
|
|
21092
21112
|
}
|
|
21093
21113
|
} else {
|
|
21094
|
-
|
|
21114
|
+
const gradSibling = gradientSiblingForTarget(targetProperty);
|
|
21115
|
+
if (gradSibling) {
|
|
21116
|
+
if (isGradientConfig(value)) {
|
|
21117
|
+
node[gradSibling] = value;
|
|
21118
|
+
node[targetProperty] = targetProperty === "textBgColor" ? "transparent" : "";
|
|
21119
|
+
} else {
|
|
21120
|
+
if (gradSibling in node) delete node[gradSibling];
|
|
21121
|
+
node[targetProperty] = value;
|
|
21122
|
+
}
|
|
21123
|
+
} else {
|
|
21124
|
+
node[targetProperty] = value;
|
|
21125
|
+
}
|
|
21095
21126
|
}
|
|
21096
21127
|
if (targetProperty === "text" && node.type === "text") {
|
|
21097
21128
|
const overflowPolicy = String(node.overflowPolicy ?? "grow-and-push");
|
|
@@ -21763,10 +21794,19 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21763
21794
|
effectiveValue = formatTimeForDisplay(effectiveValue);
|
|
21764
21795
|
}
|
|
21765
21796
|
}
|
|
21766
|
-
if (elementId === PAGE_BACKGROUND_ELEMENT_ID && targetProperty === "backgroundColor"
|
|
21797
|
+
if (elementId === PAGE_BACKGROUND_ELEMENT_ID && targetProperty === "backgroundColor") {
|
|
21767
21798
|
if ((_a3 = pages[0]) == null ? void 0 : _a3.settings) {
|
|
21768
|
-
pages[0].settings
|
|
21769
|
-
|
|
21799
|
+
const settings = pages[0].settings;
|
|
21800
|
+
if (isGradientConfig(effectiveValue)) {
|
|
21801
|
+
settings.backgroundGradient = effectiveValue;
|
|
21802
|
+
settings.backgroundColor = "";
|
|
21803
|
+
return true;
|
|
21804
|
+
}
|
|
21805
|
+
if (typeof effectiveValue === "string") {
|
|
21806
|
+
if ("backgroundGradient" in settings) delete settings.backgroundGradient;
|
|
21807
|
+
settings.backgroundColor = effectiveValue;
|
|
21808
|
+
return true;
|
|
21809
|
+
}
|
|
21770
21810
|
}
|
|
21771
21811
|
}
|
|
21772
21812
|
for (const page of pages) {
|
|
@@ -26014,9 +26054,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
26014
26054
|
}
|
|
26015
26055
|
return svgString;
|
|
26016
26056
|
}
|
|
26017
|
-
const resolvedPackageVersion = "0.5.
|
|
26057
|
+
const resolvedPackageVersion = "0.5.455";
|
|
26018
26058
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
26019
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
26059
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.455";
|
|
26020
26060
|
const roundParityValue = (value) => {
|
|
26021
26061
|
if (typeof value !== "number") return value;
|
|
26022
26062
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -26830,7 +26870,7 @@ class PixldocsRenderer {
|
|
|
26830
26870
|
await this.waitForCanvasScene(container, cloned, i);
|
|
26831
26871
|
}
|
|
26832
26872
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
26833
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26873
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CErInEKs.cjs"));
|
|
26834
26874
|
const prepared = preparePagesForExport(
|
|
26835
26875
|
cloned.pages,
|
|
26836
26876
|
canvasWidth,
|
|
@@ -29150,7 +29190,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
29150
29190
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
29151
29191
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
29152
29192
|
try {
|
|
29153
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
29193
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CErInEKs.cjs"));
|
|
29154
29194
|
try {
|
|
29155
29195
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
29156
29196
|
} catch {
|
|
@@ -29547,4 +29587,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
29547
29587
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
29548
29588
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
29549
29589
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
29550
|
-
//# sourceMappingURL=index-
|
|
29590
|
+
//# sourceMappingURL=index-CoBJQqYp.cjs.map
|