@pixldocs/canvas-renderer 0.5.459 → 0.5.461
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-BzvyPXLB.js → index-COG7WTYO.js} +30 -16
- package/dist/index-COG7WTYO.js.map +1 -0
- package/dist/{index-HqxKxsb3.cjs → index-D1sMo2it.cjs} +30 -16
- package/dist/index-D1sMo2it.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-De64EUqT.js → vectorPdfExport-Bn1wgD8Q.js} +4 -4
- package/dist/{vectorPdfExport-De64EUqT.js.map → vectorPdfExport-Bn1wgD8Q.js.map} +1 -1
- package/dist/{vectorPdfExport-CpKSMd8E.cjs → vectorPdfExport-C7mmAR68.cjs} +4 -4
- package/dist/{vectorPdfExport-CpKSMd8E.cjs.map → vectorPdfExport-C7mmAR68.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BzvyPXLB.js.map +0 -1
- package/dist/index-HqxKxsb3.cjs.map +0 -1
|
@@ -17114,13 +17114,15 @@ const PageCanvas = react.forwardRef(
|
|
|
17114
17114
|
}
|
|
17115
17115
|
updateElement(elementId, {
|
|
17116
17116
|
text: newText,
|
|
17117
|
-
...typeof nextHeight === "number" && nextHeight > 0 && { height: nextHeight }
|
|
17117
|
+
...typeof nextHeight === "number" && nextHeight > 0 && { height: nextHeight },
|
|
17118
|
+
...target.styles && Object.keys(target.styles).length > 0 ? { styles: JSON.parse(JSON.stringify(target.styles)) } : {}
|
|
17118
17119
|
});
|
|
17119
17120
|
} else {
|
|
17120
17121
|
updateElement(elementId, {
|
|
17121
17122
|
text: newText,
|
|
17122
17123
|
...fabricHeight > 0 && { height: fabricHeight },
|
|
17123
|
-
...fabricWidth > 0 && { width: fabricWidth }
|
|
17124
|
+
...fabricWidth > 0 && { width: fabricWidth },
|
|
17125
|
+
...target.styles && Object.keys(target.styles).length > 0 ? { styles: JSON.parse(JSON.stringify(target.styles)) } : {}
|
|
17124
17126
|
});
|
|
17125
17127
|
}
|
|
17126
17128
|
commitHistory2();
|
|
@@ -21092,10 +21094,19 @@ function applyTextCase(text, textCase) {
|
|
|
21092
21094
|
function hasInlineFormattingMarkers(value) {
|
|
21093
21095
|
return /\*\*[\s\S]+?\*\*|__[\s\S]+?__|~~[\s\S]+?~~|==[\s\S]+?==|\[(?:c|bg)=[^\]]+\][\s\S]+?\[\/(?:c|bg)\]|(^|[^*])\*[^*\n]+?\*/i.test(value);
|
|
21094
21096
|
}
|
|
21095
|
-
function setInTree(nodes, elementId, targetProperty, value) {
|
|
21097
|
+
function setInTree(nodes, elementId, targetProperty, value, svgColorKey) {
|
|
21096
21098
|
for (const node of nodes) {
|
|
21097
21099
|
if (node.id === elementId) {
|
|
21098
|
-
if (
|
|
21100
|
+
if (svgColorKey) {
|
|
21101
|
+
const next = { ...node.svgColorMap || {} };
|
|
21102
|
+
const v = typeof value === "string" ? value.trim() : "";
|
|
21103
|
+
if (!v || v.toLowerCase() === String(svgColorKey).toLowerCase()) {
|
|
21104
|
+
delete next[svgColorKey];
|
|
21105
|
+
} else {
|
|
21106
|
+
next[svgColorKey] = v;
|
|
21107
|
+
}
|
|
21108
|
+
node.svgColorMap = Object.keys(next).length > 0 ? next : void 0;
|
|
21109
|
+
} else if (targetProperty === "link") {
|
|
21099
21110
|
node.linkConfig = { ...node.linkConfig || {}, url: String(value ?? "") };
|
|
21100
21111
|
} else if (targetProperty.startsWith("smartProp:") && node.smartElementType) {
|
|
21101
21112
|
const propKey = targetProperty.slice("smartProp:".length);
|
|
@@ -21157,7 +21168,7 @@ function setInTree(nodes, elementId, targetProperty, value) {
|
|
|
21157
21168
|
return true;
|
|
21158
21169
|
}
|
|
21159
21170
|
if (node.children && Array.isArray(node.children)) {
|
|
21160
|
-
if (setInTree(node.children, elementId, targetProperty, value)) return true;
|
|
21171
|
+
if (setInTree(node.children, elementId, targetProperty, value, svgColorKey)) return true;
|
|
21161
21172
|
}
|
|
21162
21173
|
}
|
|
21163
21174
|
return false;
|
|
@@ -21793,7 +21804,7 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21793
21804
|
}
|
|
21794
21805
|
return void 0;
|
|
21795
21806
|
}
|
|
21796
|
-
const applyValue = (elementId, targetProperty, value, fieldKey) => {
|
|
21807
|
+
const applyValue = (elementId, targetProperty, value, fieldKey, svgColorKey) => {
|
|
21797
21808
|
var _a3;
|
|
21798
21809
|
const isTextLike = targetProperty === "text" || targetProperty === "content";
|
|
21799
21810
|
const isImageLike = targetProperty === "src" || targetProperty === "imageUrl";
|
|
@@ -21835,7 +21846,7 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21835
21846
|
}
|
|
21836
21847
|
}
|
|
21837
21848
|
for (const page of pages) {
|
|
21838
|
-
if (page.children && setInTree(page.children, elementId, targetProperty, effectiveValue)) return true;
|
|
21849
|
+
if (page.children && setInTree(page.children, elementId, targetProperty, effectiveValue, svgColorKey)) return true;
|
|
21839
21850
|
}
|
|
21840
21851
|
return false;
|
|
21841
21852
|
};
|
|
@@ -21904,7 +21915,8 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21904
21915
|
}
|
|
21905
21916
|
if (!elementIds || elementIds.length === 0) continue;
|
|
21906
21917
|
const targetProperty = mapping.targetProperty || "text";
|
|
21907
|
-
|
|
21918
|
+
const mSvgColorKey = mapping.svgColorKey;
|
|
21919
|
+
for (const elementId of elementIds) applyValue(elementId, targetProperty, value, key, mSvgColorKey);
|
|
21908
21920
|
}
|
|
21909
21921
|
}
|
|
21910
21922
|
}
|
|
@@ -21949,7 +21961,8 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21949
21961
|
}
|
|
21950
21962
|
if (elementIds.size === 0) continue;
|
|
21951
21963
|
const targetProperty = mapping.targetProperty || "text";
|
|
21952
|
-
|
|
21964
|
+
const mSvgColorKey = mapping.svgColorKey;
|
|
21965
|
+
for (const elementId of elementIds) applyValue(elementId, targetProperty, value, key, mSvgColorKey);
|
|
21953
21966
|
}
|
|
21954
21967
|
}
|
|
21955
21968
|
}
|
|
@@ -21959,7 +21972,7 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21959
21972
|
for (const m of mappings) {
|
|
21960
21973
|
if (repeatableKeySet.has(m.field_key)) continue;
|
|
21961
21974
|
const value = formValues[m.field_key];
|
|
21962
|
-
applyValue(m.element_id, m.target_property, value, m.field_key);
|
|
21975
|
+
applyValue(m.element_id, m.target_property, value, m.field_key, m.svg_color_key);
|
|
21963
21976
|
}
|
|
21964
21977
|
if ((repeatablePagesFromSchema == null ? void 0 : repeatablePagesFromSchema.length) && (dynamicFields == null ? void 0 : dynamicFields.length)) {
|
|
21965
21978
|
const findInPage = (page, originalId) => {
|
|
@@ -21994,10 +22007,11 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21994
22007
|
for (const m of field.mappings ?? []) {
|
|
21995
22008
|
const originalId = m.elementId;
|
|
21996
22009
|
const targetProperty = m.targetProperty || "text";
|
|
22010
|
+
const mSvgColorKey = m.svgColorKey;
|
|
21997
22011
|
if (!originalId) continue;
|
|
21998
22012
|
const resolvedId = findInPage(page, originalId);
|
|
21999
22013
|
if (!resolvedId) continue;
|
|
22000
|
-
if (page.children) setInTree(page.children, resolvedId, targetProperty, value);
|
|
22014
|
+
if (page.children) setInTree(page.children, resolvedId, targetProperty, value, mSvgColorKey);
|
|
22001
22015
|
}
|
|
22002
22016
|
}
|
|
22003
22017
|
}
|
|
@@ -26227,9 +26241,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
26227
26241
|
}
|
|
26228
26242
|
return svgString;
|
|
26229
26243
|
}
|
|
26230
|
-
const resolvedPackageVersion = "0.5.
|
|
26244
|
+
const resolvedPackageVersion = "0.5.461";
|
|
26231
26245
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
26232
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
26246
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.461";
|
|
26233
26247
|
const roundParityValue = (value) => {
|
|
26234
26248
|
if (typeof value !== "number") return value;
|
|
26235
26249
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -27043,7 +27057,7 @@ class PixldocsRenderer {
|
|
|
27043
27057
|
await this.waitForCanvasScene(container, cloned, i);
|
|
27044
27058
|
}
|
|
27045
27059
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
27046
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
27060
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-C7mmAR68.cjs"));
|
|
27047
27061
|
const prepared = preparePagesForExport(
|
|
27048
27062
|
cloned.pages,
|
|
27049
27063
|
canvasWidth,
|
|
@@ -29363,7 +29377,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
29363
29377
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
29364
29378
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
29365
29379
|
try {
|
|
29366
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
29380
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-C7mmAR68.cjs"));
|
|
29367
29381
|
try {
|
|
29368
29382
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
29369
29383
|
} catch {
|
|
@@ -29677,4 +29691,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
29677
29691
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
29678
29692
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
29679
29693
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
29680
|
-
//# sourceMappingURL=index-
|
|
29694
|
+
//# sourceMappingURL=index-D1sMo2it.cjs.map
|