@pixldocs/canvas-renderer 0.5.459 → 0.5.460
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-B306IfvT.js} +26 -14
- package/dist/index-B306IfvT.js.map +1 -0
- package/dist/{index-HqxKxsb3.cjs → index-CtJvkbzV.cjs} +26 -14
- package/dist/index-CtJvkbzV.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-CpKSMd8E.cjs → vectorPdfExport-B5Xxp9RH.cjs} +4 -4
- package/dist/{vectorPdfExport-CpKSMd8E.cjs.map → vectorPdfExport-B5Xxp9RH.cjs.map} +1 -1
- package/dist/{vectorPdfExport-De64EUqT.js → vectorPdfExport-CWiNW81v.js} +4 -4
- package/dist/{vectorPdfExport-De64EUqT.js.map → vectorPdfExport-CWiNW81v.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BzvyPXLB.js.map +0 -1
- package/dist/index-HqxKxsb3.cjs.map +0 -1
|
@@ -21092,10 +21092,19 @@ function applyTextCase(text, textCase) {
|
|
|
21092
21092
|
function hasInlineFormattingMarkers(value) {
|
|
21093
21093
|
return /\*\*[\s\S]+?\*\*|__[\s\S]+?__|~~[\s\S]+?~~|==[\s\S]+?==|\[(?:c|bg)=[^\]]+\][\s\S]+?\[\/(?:c|bg)\]|(^|[^*])\*[^*\n]+?\*/i.test(value);
|
|
21094
21094
|
}
|
|
21095
|
-
function setInTree(nodes, elementId, targetProperty, value) {
|
|
21095
|
+
function setInTree(nodes, elementId, targetProperty, value, svgColorKey) {
|
|
21096
21096
|
for (const node of nodes) {
|
|
21097
21097
|
if (node.id === elementId) {
|
|
21098
|
-
if (
|
|
21098
|
+
if (svgColorKey) {
|
|
21099
|
+
const next = { ...node.svgColorMap || {} };
|
|
21100
|
+
const v = typeof value === "string" ? value.trim() : "";
|
|
21101
|
+
if (!v || v.toLowerCase() === String(svgColorKey).toLowerCase()) {
|
|
21102
|
+
delete next[svgColorKey];
|
|
21103
|
+
} else {
|
|
21104
|
+
next[svgColorKey] = v;
|
|
21105
|
+
}
|
|
21106
|
+
node.svgColorMap = Object.keys(next).length > 0 ? next : void 0;
|
|
21107
|
+
} else if (targetProperty === "link") {
|
|
21099
21108
|
node.linkConfig = { ...node.linkConfig || {}, url: String(value ?? "") };
|
|
21100
21109
|
} else if (targetProperty.startsWith("smartProp:") && node.smartElementType) {
|
|
21101
21110
|
const propKey = targetProperty.slice("smartProp:".length);
|
|
@@ -21157,7 +21166,7 @@ function setInTree(nodes, elementId, targetProperty, value) {
|
|
|
21157
21166
|
return true;
|
|
21158
21167
|
}
|
|
21159
21168
|
if (node.children && Array.isArray(node.children)) {
|
|
21160
|
-
if (setInTree(node.children, elementId, targetProperty, value)) return true;
|
|
21169
|
+
if (setInTree(node.children, elementId, targetProperty, value, svgColorKey)) return true;
|
|
21161
21170
|
}
|
|
21162
21171
|
}
|
|
21163
21172
|
return false;
|
|
@@ -21793,7 +21802,7 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21793
21802
|
}
|
|
21794
21803
|
return void 0;
|
|
21795
21804
|
}
|
|
21796
|
-
const applyValue = (elementId, targetProperty, value, fieldKey) => {
|
|
21805
|
+
const applyValue = (elementId, targetProperty, value, fieldKey, svgColorKey) => {
|
|
21797
21806
|
var _a3;
|
|
21798
21807
|
const isTextLike = targetProperty === "text" || targetProperty === "content";
|
|
21799
21808
|
const isImageLike = targetProperty === "src" || targetProperty === "imageUrl";
|
|
@@ -21835,7 +21844,7 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21835
21844
|
}
|
|
21836
21845
|
}
|
|
21837
21846
|
for (const page of pages) {
|
|
21838
|
-
if (page.children && setInTree(page.children, elementId, targetProperty, effectiveValue)) return true;
|
|
21847
|
+
if (page.children && setInTree(page.children, elementId, targetProperty, effectiveValue, svgColorKey)) return true;
|
|
21839
21848
|
}
|
|
21840
21849
|
return false;
|
|
21841
21850
|
};
|
|
@@ -21904,7 +21913,8 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21904
21913
|
}
|
|
21905
21914
|
if (!elementIds || elementIds.length === 0) continue;
|
|
21906
21915
|
const targetProperty = mapping.targetProperty || "text";
|
|
21907
|
-
|
|
21916
|
+
const mSvgColorKey = mapping.svgColorKey;
|
|
21917
|
+
for (const elementId of elementIds) applyValue(elementId, targetProperty, value, key, mSvgColorKey);
|
|
21908
21918
|
}
|
|
21909
21919
|
}
|
|
21910
21920
|
}
|
|
@@ -21949,7 +21959,8 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21949
21959
|
}
|
|
21950
21960
|
if (elementIds.size === 0) continue;
|
|
21951
21961
|
const targetProperty = mapping.targetProperty || "text";
|
|
21952
|
-
|
|
21962
|
+
const mSvgColorKey = mapping.svgColorKey;
|
|
21963
|
+
for (const elementId of elementIds) applyValue(elementId, targetProperty, value, key, mSvgColorKey);
|
|
21953
21964
|
}
|
|
21954
21965
|
}
|
|
21955
21966
|
}
|
|
@@ -21959,7 +21970,7 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21959
21970
|
for (const m of mappings) {
|
|
21960
21971
|
if (repeatableKeySet.has(m.field_key)) continue;
|
|
21961
21972
|
const value = formValues[m.field_key];
|
|
21962
|
-
applyValue(m.element_id, m.target_property, value, m.field_key);
|
|
21973
|
+
applyValue(m.element_id, m.target_property, value, m.field_key, m.svg_color_key);
|
|
21963
21974
|
}
|
|
21964
21975
|
if ((repeatablePagesFromSchema == null ? void 0 : repeatablePagesFromSchema.length) && (dynamicFields == null ? void 0 : dynamicFields.length)) {
|
|
21965
21976
|
const findInPage = (page, originalId) => {
|
|
@@ -21994,10 +22005,11 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
21994
22005
|
for (const m of field.mappings ?? []) {
|
|
21995
22006
|
const originalId = m.elementId;
|
|
21996
22007
|
const targetProperty = m.targetProperty || "text";
|
|
22008
|
+
const mSvgColorKey = m.svgColorKey;
|
|
21997
22009
|
if (!originalId) continue;
|
|
21998
22010
|
const resolvedId = findInPage(page, originalId);
|
|
21999
22011
|
if (!resolvedId) continue;
|
|
22000
|
-
if (page.children) setInTree(page.children, resolvedId, targetProperty, value);
|
|
22012
|
+
if (page.children) setInTree(page.children, resolvedId, targetProperty, value, mSvgColorKey);
|
|
22001
22013
|
}
|
|
22002
22014
|
}
|
|
22003
22015
|
}
|
|
@@ -26227,9 +26239,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
26227
26239
|
}
|
|
26228
26240
|
return svgString;
|
|
26229
26241
|
}
|
|
26230
|
-
const resolvedPackageVersion = "0.5.
|
|
26242
|
+
const resolvedPackageVersion = "0.5.460";
|
|
26231
26243
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
26232
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
26244
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.460";
|
|
26233
26245
|
const roundParityValue = (value) => {
|
|
26234
26246
|
if (typeof value !== "number") return value;
|
|
26235
26247
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -27043,7 +27055,7 @@ class PixldocsRenderer {
|
|
|
27043
27055
|
await this.waitForCanvasScene(container, cloned, i);
|
|
27044
27056
|
}
|
|
27045
27057
|
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-
|
|
27058
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-B5Xxp9RH.cjs"));
|
|
27047
27059
|
const prepared = preparePagesForExport(
|
|
27048
27060
|
cloned.pages,
|
|
27049
27061
|
canvasWidth,
|
|
@@ -29363,7 +29375,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
29363
29375
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
29364
29376
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
29365
29377
|
try {
|
|
29366
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
29378
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-B5Xxp9RH.cjs"));
|
|
29367
29379
|
try {
|
|
29368
29380
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
29369
29381
|
} catch {
|
|
@@ -29677,4 +29689,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
29677
29689
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
29678
29690
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
29679
29691
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
29680
|
-
//# sourceMappingURL=index-
|
|
29692
|
+
//# sourceMappingURL=index-CtJvkbzV.cjs.map
|