@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
|
@@ -11679,6 +11679,12 @@ const applyTransformPreservingFlip = (obj, matrix) => {
|
|
|
11679
11679
|
}
|
|
11680
11680
|
obj.set({ scaleX: sx, scaleY: sy, flipX, flipY });
|
|
11681
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
|
+
};
|
|
11682
11688
|
function applyWarpAwareSelectionBorders(selection) {
|
|
11683
11689
|
var _a2;
|
|
11684
11690
|
if (selection.__pixldocsOrigASHasBorders !== void 0) {
|
|
@@ -11869,6 +11875,7 @@ const PageCanvas = react.forwardRef(
|
|
|
11869
11875
|
const selectAllTextOnEditingEnterRef = react.useRef(null);
|
|
11870
11876
|
const suppressedTextEditObjectsRef = react.useRef([]);
|
|
11871
11877
|
const suppressTextDoubleClickUntilRef = react.useRef(0);
|
|
11878
|
+
const cropGroupActivatedAtRef = react.useRef(/* @__PURE__ */ new WeakMap());
|
|
11872
11879
|
const syncLockedRef = react.useRef(false);
|
|
11873
11880
|
const editLockRef = react.useRef(false);
|
|
11874
11881
|
const editLockCountRef = react.useRef(0);
|
|
@@ -16470,6 +16477,10 @@ const PageCanvas = react.forwardRef(
|
|
|
16470
16477
|
const isLineObj = obj instanceof fabric__namespace.Line;
|
|
16471
16478
|
const isAutoShrinkText = (sourceElement == null ? void 0 : sourceElement.type) === "text" && sourceElement.overflowPolicy === "auto-shrink";
|
|
16472
16479
|
const autoShrinkStoredHeight = isAutoShrinkText ? sourceElement.height : void 0;
|
|
16480
|
+
const persistedFlipX = (sourceElement == null ? void 0 : sourceElement.flipX) ?? obj.flipX ?? false;
|
|
16481
|
+
const persistedFlipY = (sourceElement == null ? void 0 : sourceElement.flipY) ?? obj.flipY ?? false;
|
|
16482
|
+
const cleanTransformMatrix = toggleLogicalFlipInMatrix(finalAbsoluteMatrix, persistedFlipX, persistedFlipY);
|
|
16483
|
+
const persistedDecomposed = fabric__namespace.util.qrDecompose(cleanTransformMatrix);
|
|
16473
16484
|
const elementUpdate = {
|
|
16474
16485
|
left: storePos.left,
|
|
16475
16486
|
top: storePos.top,
|
|
@@ -16478,11 +16489,13 @@ const PageCanvas = react.forwardRef(
|
|
|
16478
16489
|
// so finalWidth already reflects the new width chosen by the user.
|
|
16479
16490
|
width: finalWidth,
|
|
16480
16491
|
height: isLineObj ? 0 : isAutoShrinkText ? typeof autoShrinkStoredHeight === "number" ? autoShrinkStoredHeight : finalHeight : finalHeight,
|
|
16481
|
-
angle:
|
|
16482
|
-
skewX: isLineObj ? 0 :
|
|
16483
|
-
skewY: isLineObj ? 0 :
|
|
16492
|
+
angle: persistedDecomposed.angle,
|
|
16493
|
+
skewX: isLineObj ? 0 : persistedDecomposed.skewX,
|
|
16494
|
+
skewY: isLineObj ? 0 : persistedDecomposed.skewY,
|
|
16484
16495
|
scaleX: finalScaleX,
|
|
16485
16496
|
scaleY: finalScaleY,
|
|
16497
|
+
flipX: persistedFlipX,
|
|
16498
|
+
flipY: persistedFlipY,
|
|
16486
16499
|
transformMatrix: finalAbsoluteMatrix
|
|
16487
16500
|
};
|
|
16488
16501
|
if (obj instanceof fabric__namespace.Textbox) {
|
|
@@ -16532,15 +16545,19 @@ const PageCanvas = react.forwardRef(
|
|
|
16532
16545
|
elementUpdate.scaleY = 1;
|
|
16533
16546
|
elementUpdate.skewX = 0;
|
|
16534
16547
|
elementUpdate.skewY = 0;
|
|
16535
|
-
elementUpdate.transformMatrix =
|
|
16536
|
-
|
|
16537
|
-
|
|
16538
|
-
|
|
16539
|
-
|
|
16540
|
-
|
|
16541
|
-
|
|
16542
|
-
|
|
16543
|
-
|
|
16548
|
+
elementUpdate.transformMatrix = toggleLogicalFlipInMatrix(
|
|
16549
|
+
fabric__namespace.util.composeMatrix({
|
|
16550
|
+
translateX: cx,
|
|
16551
|
+
translateY: cy,
|
|
16552
|
+
angle: cleanAngle,
|
|
16553
|
+
scaleX: 1,
|
|
16554
|
+
scaleY: 1,
|
|
16555
|
+
skewX: 0,
|
|
16556
|
+
skewY: 0
|
|
16557
|
+
}),
|
|
16558
|
+
elementUpdate.flipX,
|
|
16559
|
+
elementUpdate.flipY
|
|
16560
|
+
);
|
|
16544
16561
|
} catch {
|
|
16545
16562
|
}
|
|
16546
16563
|
}
|
|
@@ -16574,15 +16591,19 @@ const PageCanvas = react.forwardRef(
|
|
|
16574
16591
|
elementUpdate.scaleY = 1;
|
|
16575
16592
|
elementUpdate.skewX = 0;
|
|
16576
16593
|
elementUpdate.skewY = 0;
|
|
16577
|
-
elementUpdate.transformMatrix =
|
|
16578
|
-
|
|
16579
|
-
|
|
16580
|
-
|
|
16581
|
-
|
|
16582
|
-
|
|
16583
|
-
|
|
16584
|
-
|
|
16585
|
-
|
|
16594
|
+
elementUpdate.transformMatrix = toggleLogicalFlipInMatrix(
|
|
16595
|
+
fabric__namespace.util.composeMatrix({
|
|
16596
|
+
translateX: cx,
|
|
16597
|
+
translateY: cy,
|
|
16598
|
+
angle: cleanAngleI,
|
|
16599
|
+
scaleX: 1,
|
|
16600
|
+
scaleY: 1,
|
|
16601
|
+
skewX: 0,
|
|
16602
|
+
skewY: 0
|
|
16603
|
+
}),
|
|
16604
|
+
elementUpdate.flipX,
|
|
16605
|
+
elementUpdate.flipY
|
|
16606
|
+
);
|
|
16586
16607
|
} catch {
|
|
16587
16608
|
}
|
|
16588
16609
|
}
|
|
@@ -16813,6 +16834,14 @@ const PageCanvas = react.forwardRef(
|
|
|
16813
16834
|
obj.setCoords();
|
|
16814
16835
|
}
|
|
16815
16836
|
});
|
|
16837
|
+
const recordCropGroupActivation = () => {
|
|
16838
|
+
const active = fabricCanvas.getActiveObject();
|
|
16839
|
+
if (active && active instanceof fabric__namespace.Group && active.__cropGroup) {
|
|
16840
|
+
cropGroupActivatedAtRef.current.set(active, Date.now());
|
|
16841
|
+
}
|
|
16842
|
+
};
|
|
16843
|
+
fabricCanvas.on("selection:created", recordCropGroupActivation);
|
|
16844
|
+
fabricCanvas.on("selection:updated", recordCropGroupActivation);
|
|
16816
16845
|
fabricCanvas.on("mouse:dblclick", (e) => {
|
|
16817
16846
|
var _a2, _b2, _c2;
|
|
16818
16847
|
if (!isActiveRef.current || !allowEditing) return;
|
|
@@ -16842,6 +16871,10 @@ const PageCanvas = react.forwardRef(
|
|
|
16842
16871
|
}
|
|
16843
16872
|
return;
|
|
16844
16873
|
}
|
|
16874
|
+
const activatedAt = cropGroupActivatedAtRef.current.get(target) ?? 0;
|
|
16875
|
+
if (Date.now() - activatedAt < 400) {
|
|
16876
|
+
return;
|
|
16877
|
+
}
|
|
16845
16878
|
}
|
|
16846
16879
|
if (innerImg && !isPlaceholder && !isCropGroupInCropMode(target)) {
|
|
16847
16880
|
enterCropMode(target);
|
|
@@ -25869,9 +25902,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
25869
25902
|
}
|
|
25870
25903
|
return svgString;
|
|
25871
25904
|
}
|
|
25872
|
-
const resolvedPackageVersion = "0.5.
|
|
25905
|
+
const resolvedPackageVersion = "0.5.442";
|
|
25873
25906
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
25874
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
25907
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.442";
|
|
25875
25908
|
const roundParityValue = (value) => {
|
|
25876
25909
|
if (typeof value !== "number") return value;
|
|
25877
25910
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -26685,7 +26718,7 @@ class PixldocsRenderer {
|
|
|
26685
26718
|
await this.waitForCanvasScene(container, cloned, i);
|
|
26686
26719
|
}
|
|
26687
26720
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
26688
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26721
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-m9l318xa.cjs"));
|
|
26689
26722
|
const prepared = preparePagesForExport(
|
|
26690
26723
|
cloned.pages,
|
|
26691
26724
|
canvasWidth,
|
|
@@ -29005,7 +29038,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
29005
29038
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
29006
29039
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
29007
29040
|
try {
|
|
29008
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
29041
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-m9l318xa.cjs"));
|
|
29009
29042
|
try {
|
|
29010
29043
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
29011
29044
|
} catch {
|
|
@@ -29402,4 +29435,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
29402
29435
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
29403
29436
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
29404
29437
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
29405
|
-
//# sourceMappingURL=index-
|
|
29438
|
+
//# sourceMappingURL=index-SGFlXODe.cjs.map
|