@pixldocs/canvas-renderer 0.5.269 → 0.5.270
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-V3Oyi5GA.cjs → index-CLq3CdA3.cjs} +27 -14
- package/dist/index-CLq3CdA3.cjs.map +1 -0
- package/dist/{index-CrV6Qgb-.js → index-RDXGR8QW.js} +27 -14
- package/dist/index-RDXGR8QW.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-BrPmmgsF.js → vectorPdfExport--X5puWU1.js} +4 -4
- package/dist/{vectorPdfExport-BrPmmgsF.js.map → vectorPdfExport--X5puWU1.js.map} +1 -1
- package/dist/{vectorPdfExport-xlycX5wM.cjs → vectorPdfExport-BpHyRyQS.cjs} +4 -4
- package/dist/{vectorPdfExport-xlycX5wM.cjs.map → vectorPdfExport-BpHyRyQS.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-CrV6Qgb-.js.map +0 -1
- package/dist/index-V3Oyi5GA.cjs.map +0 -1
|
@@ -10995,9 +10995,9 @@ const scaleUpdateNumber = (updates, source, key, factor) => {
|
|
|
10995
10995
|
const value = Number(source == null ? void 0 : source[key]);
|
|
10996
10996
|
if (Number.isFinite(value)) updates[key] = value * factor;
|
|
10997
10997
|
};
|
|
10998
|
-
const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
|
|
10999
|
-
const sx = Math.abs(obj.scaleX ?? 1) || 1;
|
|
11000
|
-
const sy = Math.abs(obj.scaleY ?? 1) || 1;
|
|
10998
|
+
const bakeTextboxScaleIntoTypography = (obj, sourceElement, scaleOverride) => {
|
|
10999
|
+
const sx = Math.abs((scaleOverride == null ? void 0 : scaleOverride.scaleX) ?? obj.scaleX ?? 1) || 1;
|
|
11000
|
+
const sy = Math.abs((scaleOverride == null ? void 0 : scaleOverride.scaleY) ?? obj.scaleY ?? 1) || 1;
|
|
11001
11001
|
if (Math.abs(sx - 1) < 1e-3 && Math.abs(sy - 1) < 1e-3) return null;
|
|
11002
11002
|
const isUniform = Math.abs(sx - sy) < 0.01;
|
|
11003
11003
|
const fontScale = isUniform ? (sx + sy) / 2 : Math.abs(sy - 1) > 1e-3 ? sy : 1;
|
|
@@ -11213,6 +11213,7 @@ const PageCanvas = forwardRef(
|
|
|
11213
11213
|
useRef(null);
|
|
11214
11214
|
const lastTextEditDimensionsRef = useRef(null);
|
|
11215
11215
|
const lastResizeScaleTargetRef = useRef(null);
|
|
11216
|
+
const lastResizeScaleCornerRef = useRef(null);
|
|
11216
11217
|
const preserveSelectionAfterTransformIdRef = useRef(null);
|
|
11217
11218
|
const groupSelectionTransformStartRef = useRef(null);
|
|
11218
11219
|
const activeSelectionMoveStartRef = useRef(null);
|
|
@@ -11540,6 +11541,7 @@ const PageCanvas = forwardRef(
|
|
|
11540
11541
|
fc.__isUserTransforming = true;
|
|
11541
11542
|
didTransformRef.current = true;
|
|
11542
11543
|
lastResizeScaleTargetRef.current = target;
|
|
11544
|
+
lastResizeScaleCornerRef.current = corner;
|
|
11543
11545
|
const targetId = getObjectId(target);
|
|
11544
11546
|
if (targetId && targetId !== "__background__") {
|
|
11545
11547
|
preserveSelectionAfterTransformIdRef.current = targetId;
|
|
@@ -13367,10 +13369,11 @@ const PageCanvas = forwardRef(
|
|
|
13367
13369
|
fabricCanvas.on("selection:cleared", () => {
|
|
13368
13370
|
});
|
|
13369
13371
|
fabricCanvas.on("object:scaling", (e) => {
|
|
13370
|
-
var _a2;
|
|
13372
|
+
var _a2, _b2;
|
|
13371
13373
|
if (!isActiveRef.current) return;
|
|
13372
13374
|
const t = e.target;
|
|
13373
13375
|
if (t) lastResizeScaleTargetRef.current = t;
|
|
13376
|
+
lastResizeScaleCornerRef.current = ((_a2 = e.transform) == null ? void 0 : _a2.corner) ?? null;
|
|
13374
13377
|
prepareGroupSelectionTransformStart(t);
|
|
13375
13378
|
markTransforming(t);
|
|
13376
13379
|
didTransformRef.current = true;
|
|
@@ -13688,16 +13691,17 @@ const PageCanvas = forwardRef(
|
|
|
13688
13691
|
setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
|
|
13689
13692
|
if (drilledGroupIdRef.current) {
|
|
13690
13693
|
try {
|
|
13691
|
-
(
|
|
13694
|
+
(_b2 = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _b2.call(fabricCanvas);
|
|
13692
13695
|
} catch {
|
|
13693
13696
|
}
|
|
13694
13697
|
}
|
|
13695
13698
|
});
|
|
13696
13699
|
fabricCanvas.on("object:resizing", (e) => {
|
|
13697
|
-
var _a2;
|
|
13700
|
+
var _a2, _b2;
|
|
13698
13701
|
if (!isActiveRef.current) return;
|
|
13699
13702
|
const t = e.target;
|
|
13700
13703
|
if (t) lastResizeScaleTargetRef.current = t;
|
|
13704
|
+
lastResizeScaleCornerRef.current = ((_a2 = e.transform) == null ? void 0 : _a2.corner) ?? null;
|
|
13701
13705
|
markTransforming(t);
|
|
13702
13706
|
didTransformRef.current = true;
|
|
13703
13707
|
const transformTargetId = t ? getObjectId(t) : null;
|
|
@@ -13773,7 +13777,7 @@ const PageCanvas = forwardRef(
|
|
|
13773
13777
|
setGuides(gridGuidesForTextResize.length ? [...scaleGuides, ...gridGuidesForTextResize] : scaleGuides);
|
|
13774
13778
|
if (drilledGroupIdRef.current) {
|
|
13775
13779
|
try {
|
|
13776
|
-
(
|
|
13780
|
+
(_b2 = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _b2.call(fabricCanvas);
|
|
13777
13781
|
} catch {
|
|
13778
13782
|
}
|
|
13779
13783
|
}
|
|
@@ -14500,6 +14504,8 @@ const PageCanvas = forwardRef(
|
|
|
14500
14504
|
} else if (obj instanceof fabric.Textbox && isActiveSelection && (Math.abs((decomposed.scaleX ?? 1) - 1) > 1e-3 || Math.abs((decomposed.scaleY ?? 1) - 1) > 1e-3)) {
|
|
14501
14505
|
const sx = Math.abs(decomposed.scaleX || 1);
|
|
14502
14506
|
const sy = Math.abs(decomposed.scaleY || 1);
|
|
14507
|
+
const lastCorner = lastResizeScaleCornerRef.current ?? "";
|
|
14508
|
+
const isCornerGroupScale = lastCorner === "tl" || lastCorner === "tr" || lastCorner === "bl" || lastCorner === "br";
|
|
14503
14509
|
const bakedWidth = Math.max(20, intrinsicWidth * sx);
|
|
14504
14510
|
const bakedHeight = Math.max(1, intrinsicHeight * sy);
|
|
14505
14511
|
finalWidth = bakedWidth;
|
|
@@ -14507,8 +14513,13 @@ const PageCanvas = forwardRef(
|
|
|
14507
14513
|
finalScaleX = 1;
|
|
14508
14514
|
finalScaleY = 1;
|
|
14509
14515
|
try {
|
|
14510
|
-
|
|
14511
|
-
|
|
14516
|
+
if (isCornerGroupScale) {
|
|
14517
|
+
bakeTextboxScaleIntoTypography(obj, sourceElement, { scaleX: sx, scaleY: sy });
|
|
14518
|
+
} else {
|
|
14519
|
+
obj.set({ width: bakedWidth, scaleX: 1, scaleY: 1 });
|
|
14520
|
+
obj.minBoxHeight = bakedHeight;
|
|
14521
|
+
obj.initDimensions();
|
|
14522
|
+
}
|
|
14512
14523
|
obj.setCoords();
|
|
14513
14524
|
} catch {
|
|
14514
14525
|
}
|
|
@@ -14649,10 +14660,12 @@ const PageCanvas = forwardRef(
|
|
|
14649
14660
|
}
|
|
14650
14661
|
groupSelectionTransformStartRef.current = null;
|
|
14651
14662
|
activeSelectionMoveStartRef.current = null;
|
|
14663
|
+
lastResizeScaleCornerRef.current = null;
|
|
14652
14664
|
setTimeout(() => modifiedIdsThisRound.forEach((id) => justModifiedIdsRef.current.delete(id)), 150);
|
|
14653
14665
|
commitHistory();
|
|
14654
14666
|
unlockEditsSoon();
|
|
14655
14667
|
} catch (e2) {
|
|
14668
|
+
lastResizeScaleCornerRef.current = null;
|
|
14656
14669
|
unlockEditsSoon();
|
|
14657
14670
|
}
|
|
14658
14671
|
});
|
|
@@ -23665,9 +23678,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23665
23678
|
}
|
|
23666
23679
|
return svgString;
|
|
23667
23680
|
}
|
|
23668
|
-
const resolvedPackageVersion = "0.5.
|
|
23681
|
+
const resolvedPackageVersion = "0.5.270";
|
|
23669
23682
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23670
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23683
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.270";
|
|
23671
23684
|
const roundParityValue = (value) => {
|
|
23672
23685
|
if (typeof value !== "number") return value;
|
|
23673
23686
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24481,7 +24494,7 @@ class PixldocsRenderer {
|
|
|
24481
24494
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24482
24495
|
}
|
|
24483
24496
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24484
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport
|
|
24497
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport--X5puWU1.js");
|
|
24485
24498
|
const prepared = preparePagesForExport(
|
|
24486
24499
|
cloned.pages,
|
|
24487
24500
|
canvasWidth,
|
|
@@ -26801,7 +26814,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26801
26814
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26802
26815
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26803
26816
|
try {
|
|
26804
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport
|
|
26817
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport--X5puWU1.js");
|
|
26805
26818
|
try {
|
|
26806
26819
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26807
26820
|
} catch {
|
|
@@ -27201,4 +27214,4 @@ export {
|
|
|
27201
27214
|
buildTeaserBlurFlatKeys as y,
|
|
27202
27215
|
collectFontDescriptorsFromConfig as z
|
|
27203
27216
|
};
|
|
27204
|
-
//# sourceMappingURL=index-
|
|
27217
|
+
//# sourceMappingURL=index-RDXGR8QW.js.map
|