@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
|
@@ -11663,6 +11663,28 @@ const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
|
|
|
11663
11663
|
};
|
|
11664
11664
|
return updates;
|
|
11665
11665
|
};
|
|
11666
|
+
const applyTransformPreservingFlip = (obj, matrix) => {
|
|
11667
|
+
fabric__namespace.util.applyTransformToObject(obj, matrix);
|
|
11668
|
+
let sx = obj.scaleX ?? 1;
|
|
11669
|
+
let sy = obj.scaleY ?? 1;
|
|
11670
|
+
let flipX = false;
|
|
11671
|
+
let flipY = false;
|
|
11672
|
+
if (sx < 0) {
|
|
11673
|
+
flipX = true;
|
|
11674
|
+
sx = -sx;
|
|
11675
|
+
}
|
|
11676
|
+
if (sy < 0) {
|
|
11677
|
+
flipY = true;
|
|
11678
|
+
sy = -sy;
|
|
11679
|
+
}
|
|
11680
|
+
obj.set({ scaleX: sx, scaleY: sy, flipX, flipY });
|
|
11681
|
+
};
|
|
11682
|
+
const toggleLogicalFlipInMatrix = (matrix, flipX, flipY) => {
|
|
11683
|
+
if (!flipX && !flipY) return matrix;
|
|
11684
|
+
const sx = flipX ? -1 : 1;
|
|
11685
|
+
const sy = flipY ? -1 : 1;
|
|
11686
|
+
return [matrix[0] * sx, matrix[1] * sx, matrix[2] * sy, matrix[3] * sy, matrix[4], matrix[5]];
|
|
11687
|
+
};
|
|
11666
11688
|
function applyWarpAwareSelectionBorders(selection) {
|
|
11667
11689
|
var _a2;
|
|
11668
11690
|
if (selection.__pixldocsOrigASHasBorders !== void 0) {
|
|
@@ -11760,7 +11782,7 @@ function applyWarpAwareSelectionBorders(selection) {
|
|
|
11760
11782
|
const savedLayout = k.layoutManager;
|
|
11761
11783
|
try {
|
|
11762
11784
|
if (savedLayout) k.layoutManager = void 0;
|
|
11763
|
-
|
|
11785
|
+
applyTransformPreservingFlip(k, localMatrix);
|
|
11764
11786
|
const decomposed = fabric__namespace.util.qrDecompose(
|
|
11765
11787
|
localMatrix
|
|
11766
11788
|
);
|
|
@@ -16454,6 +16476,10 @@ const PageCanvas = react.forwardRef(
|
|
|
16454
16476
|
const isLineObj = obj instanceof fabric__namespace.Line;
|
|
16455
16477
|
const isAutoShrinkText = (sourceElement == null ? void 0 : sourceElement.type) === "text" && sourceElement.overflowPolicy === "auto-shrink";
|
|
16456
16478
|
const autoShrinkStoredHeight = isAutoShrinkText ? sourceElement.height : void 0;
|
|
16479
|
+
const persistedFlipX = (sourceElement == null ? void 0 : sourceElement.flipX) ?? obj.flipX ?? false;
|
|
16480
|
+
const persistedFlipY = (sourceElement == null ? void 0 : sourceElement.flipY) ?? obj.flipY ?? false;
|
|
16481
|
+
const cleanTransformMatrix = toggleLogicalFlipInMatrix(finalAbsoluteMatrix, persistedFlipX, persistedFlipY);
|
|
16482
|
+
const persistedDecomposed = fabric__namespace.util.qrDecompose(cleanTransformMatrix);
|
|
16457
16483
|
const elementUpdate = {
|
|
16458
16484
|
left: storePos.left,
|
|
16459
16485
|
top: storePos.top,
|
|
@@ -16462,11 +16488,13 @@ const PageCanvas = react.forwardRef(
|
|
|
16462
16488
|
// so finalWidth already reflects the new width chosen by the user.
|
|
16463
16489
|
width: finalWidth,
|
|
16464
16490
|
height: isLineObj ? 0 : isAutoShrinkText ? typeof autoShrinkStoredHeight === "number" ? autoShrinkStoredHeight : finalHeight : finalHeight,
|
|
16465
|
-
angle:
|
|
16466
|
-
skewX: isLineObj ? 0 :
|
|
16467
|
-
skewY: isLineObj ? 0 :
|
|
16491
|
+
angle: persistedDecomposed.angle,
|
|
16492
|
+
skewX: isLineObj ? 0 : persistedDecomposed.skewX,
|
|
16493
|
+
skewY: isLineObj ? 0 : persistedDecomposed.skewY,
|
|
16468
16494
|
scaleX: finalScaleX,
|
|
16469
16495
|
scaleY: finalScaleY,
|
|
16496
|
+
flipX: persistedFlipX,
|
|
16497
|
+
flipY: persistedFlipY,
|
|
16470
16498
|
transformMatrix: finalAbsoluteMatrix
|
|
16471
16499
|
};
|
|
16472
16500
|
if (obj instanceof fabric__namespace.Textbox) {
|
|
@@ -16516,15 +16544,19 @@ const PageCanvas = react.forwardRef(
|
|
|
16516
16544
|
elementUpdate.scaleY = 1;
|
|
16517
16545
|
elementUpdate.skewX = 0;
|
|
16518
16546
|
elementUpdate.skewY = 0;
|
|
16519
|
-
elementUpdate.transformMatrix =
|
|
16520
|
-
|
|
16521
|
-
|
|
16522
|
-
|
|
16523
|
-
|
|
16524
|
-
|
|
16525
|
-
|
|
16526
|
-
|
|
16527
|
-
|
|
16547
|
+
elementUpdate.transformMatrix = toggleLogicalFlipInMatrix(
|
|
16548
|
+
fabric__namespace.util.composeMatrix({
|
|
16549
|
+
translateX: cx,
|
|
16550
|
+
translateY: cy,
|
|
16551
|
+
angle: cleanAngle,
|
|
16552
|
+
scaleX: 1,
|
|
16553
|
+
scaleY: 1,
|
|
16554
|
+
skewX: 0,
|
|
16555
|
+
skewY: 0
|
|
16556
|
+
}),
|
|
16557
|
+
elementUpdate.flipX,
|
|
16558
|
+
elementUpdate.flipY
|
|
16559
|
+
);
|
|
16528
16560
|
} catch {
|
|
16529
16561
|
}
|
|
16530
16562
|
}
|
|
@@ -16558,15 +16590,19 @@ const PageCanvas = react.forwardRef(
|
|
|
16558
16590
|
elementUpdate.scaleY = 1;
|
|
16559
16591
|
elementUpdate.skewX = 0;
|
|
16560
16592
|
elementUpdate.skewY = 0;
|
|
16561
|
-
elementUpdate.transformMatrix =
|
|
16562
|
-
|
|
16563
|
-
|
|
16564
|
-
|
|
16565
|
-
|
|
16566
|
-
|
|
16567
|
-
|
|
16568
|
-
|
|
16569
|
-
|
|
16593
|
+
elementUpdate.transformMatrix = toggleLogicalFlipInMatrix(
|
|
16594
|
+
fabric__namespace.util.composeMatrix({
|
|
16595
|
+
translateX: cx,
|
|
16596
|
+
translateY: cy,
|
|
16597
|
+
angle: cleanAngleI,
|
|
16598
|
+
scaleX: 1,
|
|
16599
|
+
scaleY: 1,
|
|
16600
|
+
skewX: 0,
|
|
16601
|
+
skewY: 0
|
|
16602
|
+
}),
|
|
16603
|
+
elementUpdate.flipX,
|
|
16604
|
+
elementUpdate.flipY
|
|
16605
|
+
);
|
|
16570
16606
|
} catch {
|
|
16571
16607
|
}
|
|
16572
16608
|
}
|
|
@@ -16793,7 +16829,7 @@ const PageCanvas = react.forwardRef(
|
|
|
16793
16829
|
if (!objId || objId === "__background__") continue;
|
|
16794
16830
|
const objOwnMatrix = obj.calcOwnMatrix();
|
|
16795
16831
|
const absoluteMatrix = fabric__namespace.util.multiplyTransformMatrices(selectionMatrix, objOwnMatrix);
|
|
16796
|
-
|
|
16832
|
+
applyTransformPreservingFlip(obj, absoluteMatrix);
|
|
16797
16833
|
obj.setCoords();
|
|
16798
16834
|
}
|
|
16799
16835
|
});
|
|
@@ -25853,9 +25889,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
25853
25889
|
}
|
|
25854
25890
|
return svgString;
|
|
25855
25891
|
}
|
|
25856
|
-
const resolvedPackageVersion = "0.5.
|
|
25892
|
+
const resolvedPackageVersion = "0.5.441";
|
|
25857
25893
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
25858
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
25894
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.441";
|
|
25859
25895
|
const roundParityValue = (value) => {
|
|
25860
25896
|
if (typeof value !== "number") return value;
|
|
25861
25897
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -26669,7 +26705,7 @@ class PixldocsRenderer {
|
|
|
26669
26705
|
await this.waitForCanvasScene(container, cloned, i);
|
|
26670
26706
|
}
|
|
26671
26707
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
26672
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26708
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BKPFy7-t.cjs"));
|
|
26673
26709
|
const prepared = preparePagesForExport(
|
|
26674
26710
|
cloned.pages,
|
|
26675
26711
|
canvasWidth,
|
|
@@ -28989,7 +29025,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
28989
29025
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
28990
29026
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
28991
29027
|
try {
|
|
28992
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
29028
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BKPFy7-t.cjs"));
|
|
28993
29029
|
try {
|
|
28994
29030
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
28995
29031
|
} catch {
|
|
@@ -29386,4 +29422,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
29386
29422
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
29387
29423
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
29388
29424
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
29389
|
-
//# sourceMappingURL=index-
|
|
29425
|
+
//# sourceMappingURL=index-BPlFxSU1.cjs.map
|