@pixldocs/canvas-renderer 0.5.439 → 0.5.441
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-C7_iudsO.js → index-0kscM6nx.js} +64 -28
- package/dist/index-0kscM6nx.js.map +1 -0
- package/dist/{index-CfAPR8q1.cjs → index-BPlFxSU1.cjs} +64 -28
- package/dist/index-BPlFxSU1.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-CTMHlR-q.cjs → vectorPdfExport-BKPFy7-t.cjs} +4 -4
- package/dist/{vectorPdfExport-CTMHlR-q.cjs.map → vectorPdfExport-BKPFy7-t.cjs.map} +1 -1
- package/dist/{vectorPdfExport-DNxCx3pQ.js → vectorPdfExport-DDz6_cPc.js} +4 -4
- package/dist/{vectorPdfExport-DNxCx3pQ.js.map → vectorPdfExport-DDz6_cPc.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-C7_iudsO.js.map +0 -1
- package/dist/index-CfAPR8q1.cjs.map +0 -1
|
@@ -11645,6 +11645,28 @@ const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
|
|
|
11645
11645
|
};
|
|
11646
11646
|
return updates;
|
|
11647
11647
|
};
|
|
11648
|
+
const applyTransformPreservingFlip = (obj, matrix) => {
|
|
11649
|
+
fabric.util.applyTransformToObject(obj, matrix);
|
|
11650
|
+
let sx = obj.scaleX ?? 1;
|
|
11651
|
+
let sy = obj.scaleY ?? 1;
|
|
11652
|
+
let flipX = false;
|
|
11653
|
+
let flipY = false;
|
|
11654
|
+
if (sx < 0) {
|
|
11655
|
+
flipX = true;
|
|
11656
|
+
sx = -sx;
|
|
11657
|
+
}
|
|
11658
|
+
if (sy < 0) {
|
|
11659
|
+
flipY = true;
|
|
11660
|
+
sy = -sy;
|
|
11661
|
+
}
|
|
11662
|
+
obj.set({ scaleX: sx, scaleY: sy, flipX, flipY });
|
|
11663
|
+
};
|
|
11664
|
+
const toggleLogicalFlipInMatrix = (matrix, flipX, flipY) => {
|
|
11665
|
+
if (!flipX && !flipY) return matrix;
|
|
11666
|
+
const sx = flipX ? -1 : 1;
|
|
11667
|
+
const sy = flipY ? -1 : 1;
|
|
11668
|
+
return [matrix[0] * sx, matrix[1] * sx, matrix[2] * sy, matrix[3] * sy, matrix[4], matrix[5]];
|
|
11669
|
+
};
|
|
11648
11670
|
function applyWarpAwareSelectionBorders(selection) {
|
|
11649
11671
|
var _a2;
|
|
11650
11672
|
if (selection.__pixldocsOrigASHasBorders !== void 0) {
|
|
@@ -11742,7 +11764,7 @@ function applyWarpAwareSelectionBorders(selection) {
|
|
|
11742
11764
|
const savedLayout = k.layoutManager;
|
|
11743
11765
|
try {
|
|
11744
11766
|
if (savedLayout) k.layoutManager = void 0;
|
|
11745
|
-
|
|
11767
|
+
applyTransformPreservingFlip(k, localMatrix);
|
|
11746
11768
|
const decomposed = fabric.util.qrDecompose(
|
|
11747
11769
|
localMatrix
|
|
11748
11770
|
);
|
|
@@ -16436,6 +16458,10 @@ const PageCanvas = forwardRef(
|
|
|
16436
16458
|
const isLineObj = obj instanceof fabric.Line;
|
|
16437
16459
|
const isAutoShrinkText = (sourceElement == null ? void 0 : sourceElement.type) === "text" && sourceElement.overflowPolicy === "auto-shrink";
|
|
16438
16460
|
const autoShrinkStoredHeight = isAutoShrinkText ? sourceElement.height : void 0;
|
|
16461
|
+
const persistedFlipX = (sourceElement == null ? void 0 : sourceElement.flipX) ?? obj.flipX ?? false;
|
|
16462
|
+
const persistedFlipY = (sourceElement == null ? void 0 : sourceElement.flipY) ?? obj.flipY ?? false;
|
|
16463
|
+
const cleanTransformMatrix = toggleLogicalFlipInMatrix(finalAbsoluteMatrix, persistedFlipX, persistedFlipY);
|
|
16464
|
+
const persistedDecomposed = fabric.util.qrDecompose(cleanTransformMatrix);
|
|
16439
16465
|
const elementUpdate = {
|
|
16440
16466
|
left: storePos.left,
|
|
16441
16467
|
top: storePos.top,
|
|
@@ -16444,11 +16470,13 @@ const PageCanvas = forwardRef(
|
|
|
16444
16470
|
// so finalWidth already reflects the new width chosen by the user.
|
|
16445
16471
|
width: finalWidth,
|
|
16446
16472
|
height: isLineObj ? 0 : isAutoShrinkText ? typeof autoShrinkStoredHeight === "number" ? autoShrinkStoredHeight : finalHeight : finalHeight,
|
|
16447
|
-
angle:
|
|
16448
|
-
skewX: isLineObj ? 0 :
|
|
16449
|
-
skewY: isLineObj ? 0 :
|
|
16473
|
+
angle: persistedDecomposed.angle,
|
|
16474
|
+
skewX: isLineObj ? 0 : persistedDecomposed.skewX,
|
|
16475
|
+
skewY: isLineObj ? 0 : persistedDecomposed.skewY,
|
|
16450
16476
|
scaleX: finalScaleX,
|
|
16451
16477
|
scaleY: finalScaleY,
|
|
16478
|
+
flipX: persistedFlipX,
|
|
16479
|
+
flipY: persistedFlipY,
|
|
16452
16480
|
transformMatrix: finalAbsoluteMatrix
|
|
16453
16481
|
};
|
|
16454
16482
|
if (obj instanceof fabric.Textbox) {
|
|
@@ -16498,15 +16526,19 @@ const PageCanvas = forwardRef(
|
|
|
16498
16526
|
elementUpdate.scaleY = 1;
|
|
16499
16527
|
elementUpdate.skewX = 0;
|
|
16500
16528
|
elementUpdate.skewY = 0;
|
|
16501
|
-
elementUpdate.transformMatrix =
|
|
16502
|
-
|
|
16503
|
-
|
|
16504
|
-
|
|
16505
|
-
|
|
16506
|
-
|
|
16507
|
-
|
|
16508
|
-
|
|
16509
|
-
|
|
16529
|
+
elementUpdate.transformMatrix = toggleLogicalFlipInMatrix(
|
|
16530
|
+
fabric.util.composeMatrix({
|
|
16531
|
+
translateX: cx,
|
|
16532
|
+
translateY: cy,
|
|
16533
|
+
angle: cleanAngle,
|
|
16534
|
+
scaleX: 1,
|
|
16535
|
+
scaleY: 1,
|
|
16536
|
+
skewX: 0,
|
|
16537
|
+
skewY: 0
|
|
16538
|
+
}),
|
|
16539
|
+
elementUpdate.flipX,
|
|
16540
|
+
elementUpdate.flipY
|
|
16541
|
+
);
|
|
16510
16542
|
} catch {
|
|
16511
16543
|
}
|
|
16512
16544
|
}
|
|
@@ -16540,15 +16572,19 @@ const PageCanvas = forwardRef(
|
|
|
16540
16572
|
elementUpdate.scaleY = 1;
|
|
16541
16573
|
elementUpdate.skewX = 0;
|
|
16542
16574
|
elementUpdate.skewY = 0;
|
|
16543
|
-
elementUpdate.transformMatrix =
|
|
16544
|
-
|
|
16545
|
-
|
|
16546
|
-
|
|
16547
|
-
|
|
16548
|
-
|
|
16549
|
-
|
|
16550
|
-
|
|
16551
|
-
|
|
16575
|
+
elementUpdate.transformMatrix = toggleLogicalFlipInMatrix(
|
|
16576
|
+
fabric.util.composeMatrix({
|
|
16577
|
+
translateX: cx,
|
|
16578
|
+
translateY: cy,
|
|
16579
|
+
angle: cleanAngleI,
|
|
16580
|
+
scaleX: 1,
|
|
16581
|
+
scaleY: 1,
|
|
16582
|
+
skewX: 0,
|
|
16583
|
+
skewY: 0
|
|
16584
|
+
}),
|
|
16585
|
+
elementUpdate.flipX,
|
|
16586
|
+
elementUpdate.flipY
|
|
16587
|
+
);
|
|
16552
16588
|
} catch {
|
|
16553
16589
|
}
|
|
16554
16590
|
}
|
|
@@ -16775,7 +16811,7 @@ const PageCanvas = forwardRef(
|
|
|
16775
16811
|
if (!objId || objId === "__background__") continue;
|
|
16776
16812
|
const objOwnMatrix = obj.calcOwnMatrix();
|
|
16777
16813
|
const absoluteMatrix = fabric.util.multiplyTransformMatrices(selectionMatrix, objOwnMatrix);
|
|
16778
|
-
|
|
16814
|
+
applyTransformPreservingFlip(obj, absoluteMatrix);
|
|
16779
16815
|
obj.setCoords();
|
|
16780
16816
|
}
|
|
16781
16817
|
});
|
|
@@ -25835,9 +25871,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
25835
25871
|
}
|
|
25836
25872
|
return svgString;
|
|
25837
25873
|
}
|
|
25838
|
-
const resolvedPackageVersion = "0.5.
|
|
25874
|
+
const resolvedPackageVersion = "0.5.441";
|
|
25839
25875
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
25840
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
25876
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.441";
|
|
25841
25877
|
const roundParityValue = (value) => {
|
|
25842
25878
|
if (typeof value !== "number") return value;
|
|
25843
25879
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -26651,7 +26687,7 @@ class PixldocsRenderer {
|
|
|
26651
26687
|
await this.waitForCanvasScene(container, cloned, i);
|
|
26652
26688
|
}
|
|
26653
26689
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
26654
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
26690
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DDz6_cPc.js");
|
|
26655
26691
|
const prepared = preparePagesForExport(
|
|
26656
26692
|
cloned.pages,
|
|
26657
26693
|
canvasWidth,
|
|
@@ -28971,7 +29007,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
28971
29007
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
28972
29008
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
28973
29009
|
try {
|
|
28974
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
29010
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DDz6_cPc.js");
|
|
28975
29011
|
try {
|
|
28976
29012
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
28977
29013
|
} catch {
|
|
@@ -29371,4 +29407,4 @@ export {
|
|
|
29371
29407
|
buildTeaserBlurFlatKeys as y,
|
|
29372
29408
|
collectFontDescriptorsFromConfig as z
|
|
29373
29409
|
};
|
|
29374
|
-
//# sourceMappingURL=index-
|
|
29410
|
+
//# sourceMappingURL=index-0kscM6nx.js.map
|