@pixldocs/canvas-renderer 0.5.217 → 0.5.218
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-Ci5YA_Ps.js → index-CZk_GpIL.js} +9 -55
- package/dist/index-CZk_GpIL.js.map +1 -0
- package/dist/{index-CDrMSTDa.cjs → index-D3NJNdX_.cjs} +9 -55
- package/dist/index-D3NJNdX_.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-B8uqWQoW.cjs → vectorPdfExport-CoZ-RUqL.cjs} +5 -5
- package/dist/vectorPdfExport-CoZ-RUqL.cjs.map +1 -0
- package/dist/{vectorPdfExport-DJR9lwsV.js → vectorPdfExport-som_tmDY.js} +5 -5
- package/dist/vectorPdfExport-som_tmDY.js.map +1 -0
- package/package.json +1 -1
- package/dist/index-CDrMSTDa.cjs.map +0 -1
- package/dist/index-Ci5YA_Ps.js.map +0 -1
- package/dist/vectorPdfExport-B8uqWQoW.cjs.map +0 -1
- package/dist/vectorPdfExport-DJR9lwsV.js.map +0 -1
|
@@ -6919,13 +6919,7 @@ function readShadowStrength(element) {
|
|
|
6919
6919
|
return typeof raw === "number" && Number.isFinite(raw) ? Math.max(0, Math.min(100, raw)) : 100;
|
|
6920
6920
|
}
|
|
6921
6921
|
function resolveShadowSourceSpread(element) {
|
|
6922
|
-
|
|
6923
|
-
const blur = Math.max(0, Number(element.textShadowBlur ?? 0) || 0);
|
|
6924
|
-
const fontSize = Math.max(1, Number(element.fontSize ?? 16) || 16);
|
|
6925
|
-
if (blur <= 2) return 0;
|
|
6926
|
-
const blurRamp = Math.min(1, (blur - 2) / 4);
|
|
6927
|
-
const t = Math.max(0, (strength - 35) / 65);
|
|
6928
|
-
return Math.min(8, blur * 0.16, fontSize * 0.08) * t * t * blurRamp;
|
|
6922
|
+
return 0;
|
|
6929
6923
|
}
|
|
6930
6924
|
function resolveShadowAlpha(element) {
|
|
6931
6925
|
const s = readShadowStrength(element);
|
|
@@ -6948,7 +6942,7 @@ function applyTextShadow(textbox, element) {
|
|
|
6948
6942
|
}
|
|
6949
6943
|
obj.__pdShadowAlpha = canonicalShadow ? resolveShadowAlpha(element) : 1;
|
|
6950
6944
|
obj.__pdShadowBaseColor = canonicalShadow ? String(element.textShadowColor || "") : void 0;
|
|
6951
|
-
obj.__pdShadowSourceSpread = canonicalShadow ? resolveShadowSourceSpread(
|
|
6945
|
+
obj.__pdShadowSourceSpread = canonicalShadow ? resolveShadowSourceSpread() : 0;
|
|
6952
6946
|
textbox.set("shadow", canonicalShadow ?? null);
|
|
6953
6947
|
}
|
|
6954
6948
|
function applyAlphaMultiplier(c, mult) {
|
|
@@ -7232,8 +7226,6 @@ function applyTextBackground(obj, cfg) {
|
|
|
7232
7226
|
}
|
|
7233
7227
|
}
|
|
7234
7228
|
const suppressShadowOnText = bg && bg.shadowAffectsText === false;
|
|
7235
|
-
const dropShadowSpread = Math.max(0, Number(this.__pdShadowSourceSpread) || 0);
|
|
7236
|
-
const dropShadowActive = dropShadowSpread > 0 && !!this.shadow && !suppressShadowOnText && !blockShadowActive && !lineShadowActive;
|
|
7237
7229
|
if (suppressShadowOnText) {
|
|
7238
7230
|
ctx.save();
|
|
7239
7231
|
ctx.shadowColor = "transparent";
|
|
@@ -7242,44 +7234,6 @@ function applyTextBackground(obj, cfg) {
|
|
|
7242
7234
|
ctx.shadowOffsetY = 0;
|
|
7243
7235
|
originalRender(ctx);
|
|
7244
7236
|
ctx.restore();
|
|
7245
|
-
} else if (dropShadowActive) {
|
|
7246
|
-
const self = this;
|
|
7247
|
-
const shadow = self.shadow;
|
|
7248
|
-
const shadowColor = String((shadow == null ? void 0 : shadow.color) || this.__pdShadowBaseColor || "rgba(0,0,0,1)");
|
|
7249
|
-
const shadowBlur = Math.max(0, Number((shadow == null ? void 0 : shadow.blur) ?? 0) || 0);
|
|
7250
|
-
const shadowOffsetX = Number((shadow == null ? void 0 : shadow.offsetX) ?? 0) || 0;
|
|
7251
|
-
const shadowOffsetY = Number((shadow == null ? void 0 : shadow.offsetY) ?? 0) || 0;
|
|
7252
|
-
const origFill = self.fill;
|
|
7253
|
-
const origStroke = self.stroke;
|
|
7254
|
-
const origStrokeWidth = self.strokeWidth;
|
|
7255
|
-
const origStyles = self.styles;
|
|
7256
|
-
const origShadow = self.shadow;
|
|
7257
|
-
try {
|
|
7258
|
-
ctx.save();
|
|
7259
|
-
self.shadow = null;
|
|
7260
|
-
self.fill = shadowColor;
|
|
7261
|
-
self.styles = {};
|
|
7262
|
-
self.stroke = shadowColor;
|
|
7263
|
-
self.strokeWidth = dropShadowSpread;
|
|
7264
|
-
ctx.translate(shadowOffsetX, shadowOffsetY);
|
|
7265
|
-
if (shadowBlur > 0) ctx.filter = `blur(${shadowBlur / 2}px)`;
|
|
7266
|
-
ctx.lineJoin = "round";
|
|
7267
|
-
ctx.lineCap = "round";
|
|
7268
|
-
originalRender(ctx);
|
|
7269
|
-
ctx.restore();
|
|
7270
|
-
self.fill = origFill;
|
|
7271
|
-
self.stroke = origStroke;
|
|
7272
|
-
self.strokeWidth = origStrokeWidth;
|
|
7273
|
-
self.styles = origStyles;
|
|
7274
|
-
self.shadow = null;
|
|
7275
|
-
originalRender(ctx);
|
|
7276
|
-
} finally {
|
|
7277
|
-
self.fill = origFill;
|
|
7278
|
-
self.stroke = origStroke;
|
|
7279
|
-
self.strokeWidth = origStrokeWidth;
|
|
7280
|
-
self.styles = origStyles;
|
|
7281
|
-
self.shadow = origShadow;
|
|
7282
|
-
}
|
|
7283
7237
|
} else {
|
|
7284
7238
|
originalRender(ctx);
|
|
7285
7239
|
}
|
|
@@ -7361,7 +7315,7 @@ function applyTextBackground(obj, cfg) {
|
|
|
7361
7315
|
const oy = Number(shadow.offsetY ?? 0) || 0;
|
|
7362
7316
|
const blur = Math.max(0, Number(shadow.blur ?? 0));
|
|
7363
7317
|
const shadowColor = String(shadow.color);
|
|
7364
|
-
const sourceSpread =
|
|
7318
|
+
const sourceSpread = 0;
|
|
7365
7319
|
const pad = Math.max(16, Math.ceil((blur + sourceSpread) * 4) + Math.ceil(Math.max(Math.abs(ox), Math.abs(oy))) + 8);
|
|
7366
7320
|
const shadowBounds = unionBounds([
|
|
7367
7321
|
...rects,
|
|
@@ -19103,9 +19057,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
19103
19057
|
}
|
|
19104
19058
|
return svgString;
|
|
19105
19059
|
}
|
|
19106
|
-
const resolvedPackageVersion = "0.5.
|
|
19060
|
+
const resolvedPackageVersion = "0.5.218";
|
|
19107
19061
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
19108
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
19062
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.218";
|
|
19109
19063
|
const roundParityValue = (value) => {
|
|
19110
19064
|
if (typeof value !== "number") return value;
|
|
19111
19065
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -19797,7 +19751,7 @@ class PixldocsRenderer {
|
|
|
19797
19751
|
await this.waitForCanvasScene(container, cloned, i);
|
|
19798
19752
|
}
|
|
19799
19753
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
19800
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
19754
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CoZ-RUqL.cjs"));
|
|
19801
19755
|
const prepared = preparePagesForExport(
|
|
19802
19756
|
cloned.pages,
|
|
19803
19757
|
canvasWidth,
|
|
@@ -21739,7 +21693,7 @@ async function rasterizeShadowMarkers(svg) {
|
|
|
21739
21693
|
const by = parseFloat(marker.getAttribute("data-by") || "0");
|
|
21740
21694
|
const bw = parseFloat(marker.getAttribute("data-bw") || "0");
|
|
21741
21695
|
const bh = parseFloat(marker.getAttribute("data-bh") || "0");
|
|
21742
|
-
const spread =
|
|
21696
|
+
const spread = 0;
|
|
21743
21697
|
const alphaRaw = parseFloat(marker.getAttribute("data-alpha") || "1");
|
|
21744
21698
|
const shadowAlpha = Number.isFinite(alphaRaw) ? Math.max(0, Math.min(1, alphaRaw)) : 1;
|
|
21745
21699
|
if (!Number.isFinite(bw) || !Number.isFinite(bh) || bw <= 0 || bh <= 0) {
|
|
@@ -21987,7 +21941,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
21987
21941
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
21988
21942
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
21989
21943
|
try {
|
|
21990
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
21944
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CoZ-RUqL.cjs"));
|
|
21991
21945
|
try {
|
|
21992
21946
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
21993
21947
|
} catch {
|
|
@@ -22384,4 +22338,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
22384
22338
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
22385
22339
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
22386
22340
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
22387
|
-
//# sourceMappingURL=index-
|
|
22341
|
+
//# sourceMappingURL=index-D3NJNdX_.cjs.map
|