@pixldocs/canvas-renderer 0.5.472 → 0.5.474
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-Dj1v0e7c.cjs → index-D2hncOO0.cjs} +33 -12
- package/dist/index-D2hncOO0.cjs.map +1 -0
- package/dist/{index-CHObHx1T.js → index-DsthQYTx.js} +33 -12
- package/dist/index-DsthQYTx.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-DkOHXPHf.cjs → vectorPdfExport-Cgw2jQ1F.cjs} +4 -4
- package/dist/{vectorPdfExport-DkOHXPHf.cjs.map → vectorPdfExport-Cgw2jQ1F.cjs.map} +1 -1
- package/dist/{vectorPdfExport-Xza25bm4.js → vectorPdfExport-auFctmty.js} +4 -4
- package/dist/{vectorPdfExport-Xza25bm4.js.map → vectorPdfExport-auFctmty.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-CHObHx1T.js.map +0 -1
- package/dist/index-Dj1v0e7c.cjs.map +0 -1
|
@@ -8530,6 +8530,25 @@ function buildRoundedRectPath2D(ctx, x, y, w, h, rTL, rTR, rBR, rBL) {
|
|
|
8530
8530
|
if (tl > 0) ctx.quadraticCurveTo(x, y, x + tl, y);
|
|
8531
8531
|
ctx.closePath();
|
|
8532
8532
|
}
|
|
8533
|
+
function buildRoundedRectPath2DObject(x, y, w, h, rTL, rTR, rBR, rBL) {
|
|
8534
|
+
const maxR = Math.min(w, h) / 2;
|
|
8535
|
+
const tl = Math.min(Math.max(0, rTL), maxR);
|
|
8536
|
+
const tr = Math.min(Math.max(0, rTR), maxR);
|
|
8537
|
+
const br = Math.min(Math.max(0, rBR), maxR);
|
|
8538
|
+
const bl = Math.min(Math.max(0, rBL), maxR);
|
|
8539
|
+
const p = new Path2D();
|
|
8540
|
+
p.moveTo(x + tl, y);
|
|
8541
|
+
p.lineTo(x + w - tr, y);
|
|
8542
|
+
if (tr > 0) p.quadraticCurveTo(x + w, y, x + w, y + tr);
|
|
8543
|
+
p.lineTo(x + w, y + h - br);
|
|
8544
|
+
if (br > 0) p.quadraticCurveTo(x + w, y + h, x + w - br, y + h);
|
|
8545
|
+
p.lineTo(x + bl, y + h);
|
|
8546
|
+
if (bl > 0) p.quadraticCurveTo(x, y + h, x, y + h - bl);
|
|
8547
|
+
p.lineTo(x, y + tl);
|
|
8548
|
+
if (tl > 0) p.quadraticCurveTo(x, y, x + tl, y);
|
|
8549
|
+
p.closePath();
|
|
8550
|
+
return p;
|
|
8551
|
+
}
|
|
8533
8552
|
function measureLineGlyphWidth(obj, lineIndex) {
|
|
8534
8553
|
var _a2, _b2, _c2, _d, _e, _f;
|
|
8535
8554
|
try {
|
|
@@ -8717,9 +8736,9 @@ function applyTextBackground(obj, cfg) {
|
|
|
8717
8736
|
ctx.transform(1, shearTransform.slope, 0, 1, 0, shearTransform.dy);
|
|
8718
8737
|
}
|
|
8719
8738
|
const rects = bgRectsForFill;
|
|
8739
|
+
const combined = new Path2D();
|
|
8720
8740
|
for (const r of rects) {
|
|
8721
|
-
|
|
8722
|
-
ctx,
|
|
8741
|
+
const sub = buildRoundedRectPath2DObject(
|
|
8723
8742
|
r.x,
|
|
8724
8743
|
r.y,
|
|
8725
8744
|
r.w,
|
|
@@ -8729,8 +8748,9 @@ function applyTextBackground(obj, cfg) {
|
|
|
8729
8748
|
bg.rxBR ?? 0,
|
|
8730
8749
|
bg.rxBL ?? 0
|
|
8731
8750
|
);
|
|
8732
|
-
|
|
8751
|
+
combined.addPath(sub);
|
|
8733
8752
|
}
|
|
8753
|
+
ctx.fill(combined);
|
|
8734
8754
|
}
|
|
8735
8755
|
ctx.restore();
|
|
8736
8756
|
}
|
|
@@ -9608,8 +9628,9 @@ function gradientToFabric(gradient, width, height) {
|
|
|
9608
9628
|
});
|
|
9609
9629
|
}
|
|
9610
9630
|
function applyInitialGradients(obj, element) {
|
|
9611
|
-
const
|
|
9612
|
-
const
|
|
9631
|
+
const isLine = element.type === "line";
|
|
9632
|
+
const w = typeof obj.width === "number" && obj.width > 0 ? obj.width : (Number(element.width) || 0) * (isLine ? Number(element.scaleX) || 1 : 1);
|
|
9633
|
+
const h = typeof obj.height === "number" && obj.height > 0 ? obj.height : isLine ? Math.max(Number(element.strokeWidth) || 0, 1) : Number(element.height) || 0;
|
|
9613
9634
|
if (w <= 0 || h <= 0) return;
|
|
9614
9635
|
const fg = element.fillGradient;
|
|
9615
9636
|
if (fg && isGradientConfig(fg)) {
|
|
@@ -19273,7 +19294,7 @@ const PageCanvas = forwardRef(
|
|
|
19273
19294
|
}
|
|
19274
19295
|
if (element.fillGradient && isGradientConfig(element.fillGradient)) {
|
|
19275
19296
|
const objWidth = typeof obj.width === "number" ? obj.width : rW;
|
|
19276
|
-
const objHeight = typeof obj.height === "number" ? obj.height : rH;
|
|
19297
|
+
const objHeight = isLine ? Math.max(typeof obj.height === "number" ? obj.height : 0, typeof element.strokeWidth === "number" ? element.strokeWidth : 0, 1) : typeof obj.height === "number" ? obj.height : rH;
|
|
19277
19298
|
if (objWidth > 0 && objHeight > 0) {
|
|
19278
19299
|
obj.set({
|
|
19279
19300
|
fill: gradientToFabric(element.fillGradient, objWidth, objHeight),
|
|
@@ -19289,7 +19310,7 @@ const PageCanvas = forwardRef(
|
|
|
19289
19310
|
}
|
|
19290
19311
|
if (element.strokeGradient && isGradientConfig(element.strokeGradient)) {
|
|
19291
19312
|
const objWidth = typeof obj.width === "number" ? obj.width : rW;
|
|
19292
|
-
const objHeight = typeof obj.height === "number" ? obj.height : rH;
|
|
19313
|
+
const objHeight = isLine ? Math.max(typeof obj.height === "number" ? obj.height : 0, typeof element.strokeWidth === "number" ? element.strokeWidth : 0, 1) : typeof obj.height === "number" ? obj.height : rH;
|
|
19293
19314
|
if (objWidth > 0 && objHeight > 0) {
|
|
19294
19315
|
obj.set({
|
|
19295
19316
|
stroke: gradientToFabric(element.strokeGradient, objWidth, objHeight),
|
|
@@ -26308,9 +26329,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
26308
26329
|
}
|
|
26309
26330
|
return svgString;
|
|
26310
26331
|
}
|
|
26311
|
-
const resolvedPackageVersion = "0.5.
|
|
26332
|
+
const resolvedPackageVersion = "0.5.474";
|
|
26312
26333
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
26313
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
26334
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.474";
|
|
26314
26335
|
const roundParityValue = (value) => {
|
|
26315
26336
|
if (typeof value !== "number") return value;
|
|
26316
26337
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -27124,7 +27145,7 @@ class PixldocsRenderer {
|
|
|
27124
27145
|
await this.waitForCanvasScene(container, cloned, i);
|
|
27125
27146
|
}
|
|
27126
27147
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
27127
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
27148
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-auFctmty.js");
|
|
27128
27149
|
const prepared = preparePagesForExport(
|
|
27129
27150
|
cloned.pages,
|
|
27130
27151
|
canvasWidth,
|
|
@@ -29444,7 +29465,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
29444
29465
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
29445
29466
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
29446
29467
|
try {
|
|
29447
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
29468
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-auFctmty.js");
|
|
29448
29469
|
try {
|
|
29449
29470
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
29450
29471
|
} catch {
|
|
@@ -29761,4 +29782,4 @@ export {
|
|
|
29761
29782
|
buildTeaserBlurFlatKeys as y,
|
|
29762
29783
|
collectFontDescriptorsFromConfig as z
|
|
29763
29784
|
};
|
|
29764
|
-
//# sourceMappingURL=index-
|
|
29785
|
+
//# sourceMappingURL=index-DsthQYTx.js.map
|