@pixldocs/canvas-renderer 0.5.440 → 0.5.442
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-H0u34DDY.js → index-DFHTSlHV.js} +59 -26
- package/dist/index-DFHTSlHV.js.map +1 -0
- package/dist/{index-hWZ5kvhb.cjs → index-SGFlXODe.cjs} +59 -26
- package/dist/index-SGFlXODe.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-BkFH66cH.js → vectorPdfExport-Hv54w3Cm.js} +4 -4
- package/dist/{vectorPdfExport-BkFH66cH.js.map → vectorPdfExport-Hv54w3Cm.js.map} +1 -1
- package/dist/{vectorPdfExport-CtvA0Dck.cjs → vectorPdfExport-m9l318xa.cjs} +4 -4
- package/dist/{vectorPdfExport-CtvA0Dck.cjs.map → vectorPdfExport-m9l318xa.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-H0u34DDY.js.map +0 -1
- package/dist/index-hWZ5kvhb.cjs.map +0 -1
|
@@ -11661,6 +11661,12 @@ const applyTransformPreservingFlip = (obj, matrix) => {
|
|
|
11661
11661
|
}
|
|
11662
11662
|
obj.set({ scaleX: sx, scaleY: sy, flipX, flipY });
|
|
11663
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
|
+
};
|
|
11664
11670
|
function applyWarpAwareSelectionBorders(selection) {
|
|
11665
11671
|
var _a2;
|
|
11666
11672
|
if (selection.__pixldocsOrigASHasBorders !== void 0) {
|
|
@@ -11851,6 +11857,7 @@ const PageCanvas = forwardRef(
|
|
|
11851
11857
|
const selectAllTextOnEditingEnterRef = useRef(null);
|
|
11852
11858
|
const suppressedTextEditObjectsRef = useRef([]);
|
|
11853
11859
|
const suppressTextDoubleClickUntilRef = useRef(0);
|
|
11860
|
+
const cropGroupActivatedAtRef = useRef(/* @__PURE__ */ new WeakMap());
|
|
11854
11861
|
const syncLockedRef = useRef(false);
|
|
11855
11862
|
const editLockRef = useRef(false);
|
|
11856
11863
|
const editLockCountRef = useRef(0);
|
|
@@ -16452,6 +16459,10 @@ const PageCanvas = forwardRef(
|
|
|
16452
16459
|
const isLineObj = obj instanceof fabric.Line;
|
|
16453
16460
|
const isAutoShrinkText = (sourceElement == null ? void 0 : sourceElement.type) === "text" && sourceElement.overflowPolicy === "auto-shrink";
|
|
16454
16461
|
const autoShrinkStoredHeight = isAutoShrinkText ? sourceElement.height : void 0;
|
|
16462
|
+
const persistedFlipX = (sourceElement == null ? void 0 : sourceElement.flipX) ?? obj.flipX ?? false;
|
|
16463
|
+
const persistedFlipY = (sourceElement == null ? void 0 : sourceElement.flipY) ?? obj.flipY ?? false;
|
|
16464
|
+
const cleanTransformMatrix = toggleLogicalFlipInMatrix(finalAbsoluteMatrix, persistedFlipX, persistedFlipY);
|
|
16465
|
+
const persistedDecomposed = fabric.util.qrDecompose(cleanTransformMatrix);
|
|
16455
16466
|
const elementUpdate = {
|
|
16456
16467
|
left: storePos.left,
|
|
16457
16468
|
top: storePos.top,
|
|
@@ -16460,11 +16471,13 @@ const PageCanvas = forwardRef(
|
|
|
16460
16471
|
// so finalWidth already reflects the new width chosen by the user.
|
|
16461
16472
|
width: finalWidth,
|
|
16462
16473
|
height: isLineObj ? 0 : isAutoShrinkText ? typeof autoShrinkStoredHeight === "number" ? autoShrinkStoredHeight : finalHeight : finalHeight,
|
|
16463
|
-
angle:
|
|
16464
|
-
skewX: isLineObj ? 0 :
|
|
16465
|
-
skewY: isLineObj ? 0 :
|
|
16474
|
+
angle: persistedDecomposed.angle,
|
|
16475
|
+
skewX: isLineObj ? 0 : persistedDecomposed.skewX,
|
|
16476
|
+
skewY: isLineObj ? 0 : persistedDecomposed.skewY,
|
|
16466
16477
|
scaleX: finalScaleX,
|
|
16467
16478
|
scaleY: finalScaleY,
|
|
16479
|
+
flipX: persistedFlipX,
|
|
16480
|
+
flipY: persistedFlipY,
|
|
16468
16481
|
transformMatrix: finalAbsoluteMatrix
|
|
16469
16482
|
};
|
|
16470
16483
|
if (obj instanceof fabric.Textbox) {
|
|
@@ -16514,15 +16527,19 @@ const PageCanvas = forwardRef(
|
|
|
16514
16527
|
elementUpdate.scaleY = 1;
|
|
16515
16528
|
elementUpdate.skewX = 0;
|
|
16516
16529
|
elementUpdate.skewY = 0;
|
|
16517
|
-
elementUpdate.transformMatrix =
|
|
16518
|
-
|
|
16519
|
-
|
|
16520
|
-
|
|
16521
|
-
|
|
16522
|
-
|
|
16523
|
-
|
|
16524
|
-
|
|
16525
|
-
|
|
16530
|
+
elementUpdate.transformMatrix = toggleLogicalFlipInMatrix(
|
|
16531
|
+
fabric.util.composeMatrix({
|
|
16532
|
+
translateX: cx,
|
|
16533
|
+
translateY: cy,
|
|
16534
|
+
angle: cleanAngle,
|
|
16535
|
+
scaleX: 1,
|
|
16536
|
+
scaleY: 1,
|
|
16537
|
+
skewX: 0,
|
|
16538
|
+
skewY: 0
|
|
16539
|
+
}),
|
|
16540
|
+
elementUpdate.flipX,
|
|
16541
|
+
elementUpdate.flipY
|
|
16542
|
+
);
|
|
16526
16543
|
} catch {
|
|
16527
16544
|
}
|
|
16528
16545
|
}
|
|
@@ -16556,15 +16573,19 @@ const PageCanvas = forwardRef(
|
|
|
16556
16573
|
elementUpdate.scaleY = 1;
|
|
16557
16574
|
elementUpdate.skewX = 0;
|
|
16558
16575
|
elementUpdate.skewY = 0;
|
|
16559
|
-
elementUpdate.transformMatrix =
|
|
16560
|
-
|
|
16561
|
-
|
|
16562
|
-
|
|
16563
|
-
|
|
16564
|
-
|
|
16565
|
-
|
|
16566
|
-
|
|
16567
|
-
|
|
16576
|
+
elementUpdate.transformMatrix = toggleLogicalFlipInMatrix(
|
|
16577
|
+
fabric.util.composeMatrix({
|
|
16578
|
+
translateX: cx,
|
|
16579
|
+
translateY: cy,
|
|
16580
|
+
angle: cleanAngleI,
|
|
16581
|
+
scaleX: 1,
|
|
16582
|
+
scaleY: 1,
|
|
16583
|
+
skewX: 0,
|
|
16584
|
+
skewY: 0
|
|
16585
|
+
}),
|
|
16586
|
+
elementUpdate.flipX,
|
|
16587
|
+
elementUpdate.flipY
|
|
16588
|
+
);
|
|
16568
16589
|
} catch {
|
|
16569
16590
|
}
|
|
16570
16591
|
}
|
|
@@ -16795,6 +16816,14 @@ const PageCanvas = forwardRef(
|
|
|
16795
16816
|
obj.setCoords();
|
|
16796
16817
|
}
|
|
16797
16818
|
});
|
|
16819
|
+
const recordCropGroupActivation = () => {
|
|
16820
|
+
const active = fabricCanvas.getActiveObject();
|
|
16821
|
+
if (active && active instanceof fabric.Group && active.__cropGroup) {
|
|
16822
|
+
cropGroupActivatedAtRef.current.set(active, Date.now());
|
|
16823
|
+
}
|
|
16824
|
+
};
|
|
16825
|
+
fabricCanvas.on("selection:created", recordCropGroupActivation);
|
|
16826
|
+
fabricCanvas.on("selection:updated", recordCropGroupActivation);
|
|
16798
16827
|
fabricCanvas.on("mouse:dblclick", (e) => {
|
|
16799
16828
|
var _a2, _b2, _c2;
|
|
16800
16829
|
if (!isActiveRef.current || !allowEditing) return;
|
|
@@ -16824,6 +16853,10 @@ const PageCanvas = forwardRef(
|
|
|
16824
16853
|
}
|
|
16825
16854
|
return;
|
|
16826
16855
|
}
|
|
16856
|
+
const activatedAt = cropGroupActivatedAtRef.current.get(target) ?? 0;
|
|
16857
|
+
if (Date.now() - activatedAt < 400) {
|
|
16858
|
+
return;
|
|
16859
|
+
}
|
|
16827
16860
|
}
|
|
16828
16861
|
if (innerImg && !isPlaceholder && !isCropGroupInCropMode(target)) {
|
|
16829
16862
|
enterCropMode(target);
|
|
@@ -25851,9 +25884,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
25851
25884
|
}
|
|
25852
25885
|
return svgString;
|
|
25853
25886
|
}
|
|
25854
|
-
const resolvedPackageVersion = "0.5.
|
|
25887
|
+
const resolvedPackageVersion = "0.5.442";
|
|
25855
25888
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
25856
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
25889
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.442";
|
|
25857
25890
|
const roundParityValue = (value) => {
|
|
25858
25891
|
if (typeof value !== "number") return value;
|
|
25859
25892
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -26667,7 +26700,7 @@ class PixldocsRenderer {
|
|
|
26667
26700
|
await this.waitForCanvasScene(container, cloned, i);
|
|
26668
26701
|
}
|
|
26669
26702
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
26670
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
26703
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Hv54w3Cm.js");
|
|
26671
26704
|
const prepared = preparePagesForExport(
|
|
26672
26705
|
cloned.pages,
|
|
26673
26706
|
canvasWidth,
|
|
@@ -28987,7 +29020,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
28987
29020
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
28988
29021
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
28989
29022
|
try {
|
|
28990
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
29023
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Hv54w3Cm.js");
|
|
28991
29024
|
try {
|
|
28992
29025
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
28993
29026
|
} catch {
|
|
@@ -29387,4 +29420,4 @@ export {
|
|
|
29387
29420
|
buildTeaserBlurFlatKeys as y,
|
|
29388
29421
|
collectFontDescriptorsFromConfig as z
|
|
29389
29422
|
};
|
|
29390
|
-
//# sourceMappingURL=index-
|
|
29423
|
+
//# sourceMappingURL=index-DFHTSlHV.js.map
|