@pixldocs/canvas-renderer 0.5.318 → 0.5.320
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-CjatPuQ6.js → index-BwDF94FE.js} +13 -40
- package/dist/index-BwDF94FE.js.map +1 -0
- package/dist/{index-CjYAXB7l.cjs → index-wHNXUueq.cjs} +13 -40
- package/dist/index-wHNXUueq.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-56Aw1H7k.js → vectorPdfExport-B1wohdgq.js} +4 -4
- package/dist/{vectorPdfExport-56Aw1H7k.js.map → vectorPdfExport-B1wohdgq.js.map} +1 -1
- package/dist/{vectorPdfExport-DM_wkrZm.cjs → vectorPdfExport-BFpf44ad.cjs} +4 -4
- package/dist/{vectorPdfExport-DM_wkrZm.cjs.map → vectorPdfExport-BFpf44ad.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-CjYAXB7l.cjs.map +0 -1
- package/dist/index-CjatPuQ6.js.map +0 -1
|
@@ -11186,19 +11186,9 @@ function applyWarpAwareSelectionBorders(selection) {
|
|
|
11186
11186
|
const first = worldAngles[0] ?? 0;
|
|
11187
11187
|
const ALL_SAME_TOL_DEG = 2;
|
|
11188
11188
|
const allSame = Math.abs(first) > 0.5 && worldAngles.every((a) => angleDelta(a, first) <= ALL_SAME_TOL_DEG);
|
|
11189
|
-
const anyRotated = worldAngles.some((a) => Math.abs(a) > 0.5);
|
|
11190
11189
|
let targetAngle = null;
|
|
11191
11190
|
if (allSame) {
|
|
11192
11191
|
targetAngle = first;
|
|
11193
|
-
} else if (anyRotated) {
|
|
11194
|
-
const rad = (d) => d * Math.PI / 180;
|
|
11195
|
-
const deg = (r) => r * 180 / Math.PI;
|
|
11196
|
-
let sx = 0, sy = 0;
|
|
11197
|
-
for (const a of worldAngles) {
|
|
11198
|
-
sx += Math.cos(rad(a));
|
|
11199
|
-
sy += Math.sin(rad(a));
|
|
11200
|
-
}
|
|
11201
|
-
targetAngle = norm(deg(Math.atan2(sy, sx)));
|
|
11202
11192
|
}
|
|
11203
11193
|
if (targetAngle != null) {
|
|
11204
11194
|
const restoreKidsFromWorld = () => {
|
|
@@ -11225,7 +11215,6 @@ function applyWarpAwareSelectionBorders(selection) {
|
|
|
11225
11215
|
selection.setCoords();
|
|
11226
11216
|
selection.dirty = true;
|
|
11227
11217
|
selection.__pixldocsAlignedAngle = targetAngle;
|
|
11228
|
-
if (!allSame) selection.__pixldocsMixedRotation = true;
|
|
11229
11218
|
}
|
|
11230
11219
|
}
|
|
11231
11220
|
}
|
|
@@ -13570,25 +13559,10 @@ const PageCanvas = forwardRef(
|
|
|
13570
13559
|
fabricCanvas.on("selection:cleared", () => {
|
|
13571
13560
|
});
|
|
13572
13561
|
fabricCanvas.on("object:scaling", (e) => {
|
|
13573
|
-
var _a2, _b2, _c, _d, _e, _f
|
|
13562
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
13574
13563
|
if (!isActiveRef.current) return;
|
|
13575
13564
|
const t = e.target;
|
|
13576
13565
|
if (t) lastResizeScaleTargetRef.current = t;
|
|
13577
|
-
try {
|
|
13578
|
-
const isNativeGroup = t instanceof fabric.Group && !(t instanceof fabric.ActiveSelection) && !t.__docuforgeSectionGroup && !t.__cropGroup && !((_a2 = t._ct) == null ? void 0 : _a2.isCropGroup) && !t.__smartController;
|
|
13579
|
-
if (t instanceof fabric.ActiveSelection || isNativeGroup) {
|
|
13580
|
-
const isRotated = !!t.__pixldocsMixedRotation || Math.abs(((t.angle ?? 0) % 360 + 360) % 360) > 0.5;
|
|
13581
|
-
if (isRotated) {
|
|
13582
|
-
const corner2 = (_b2 = e.transform) == null ? void 0 : _b2.corner;
|
|
13583
|
-
if (corner2 === "ml" || corner2 === "mr") {
|
|
13584
|
-
t.scaleY = t.scaleX;
|
|
13585
|
-
} else if (corner2 === "mt" || corner2 === "mb") {
|
|
13586
|
-
t.scaleX = t.scaleY;
|
|
13587
|
-
}
|
|
13588
|
-
}
|
|
13589
|
-
}
|
|
13590
|
-
} catch {
|
|
13591
|
-
}
|
|
13592
13566
|
prepareGroupSelectionTransformStart(t);
|
|
13593
13567
|
markTransforming(t);
|
|
13594
13568
|
didTransformRef.current = true;
|
|
@@ -13752,24 +13726,23 @@ const PageCanvas = forwardRef(
|
|
|
13752
13726
|
time: Math.round(performance.now()),
|
|
13753
13727
|
corner,
|
|
13754
13728
|
groupSelectionId: obj.__pixldocsGroupSelection,
|
|
13755
|
-
currentTransformAction: (
|
|
13729
|
+
currentTransformAction: (_a2 = fabricCanvas._currentTransform) == null ? void 0 : _a2.action,
|
|
13756
13730
|
selection: summarizeFabricObjectForResizeDebug(obj),
|
|
13757
13731
|
textChildren: obj.getObjects().filter((child) => child instanceof fabric.Textbox).map((child) => summarizeFabricObjectForResizeDebug(child))
|
|
13758
13732
|
};
|
|
13759
13733
|
}
|
|
13760
13734
|
}
|
|
13761
|
-
|
|
13762
|
-
if (obj instanceof fabric.ActiveSelection && !_asRotatedForReflow && (corner === "ml" || corner === "mr" || corner === "mt" || corner === "mb")) {
|
|
13735
|
+
if (obj instanceof fabric.ActiveSelection && (corner === "ml" || corner === "mr" || corner === "mt" || corner === "mb")) {
|
|
13763
13736
|
const isXSide = corner === "ml" || corner === "mr";
|
|
13764
13737
|
const sAxis = isXSide ? Math.abs(obj.scaleX ?? 1) : Math.abs(obj.scaleY ?? 1);
|
|
13765
13738
|
if (sAxis > 1e-3) {
|
|
13766
|
-
if (isXSide && ((
|
|
13739
|
+
if (isXSide && ((_b2 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _b2.selection) !== obj) {
|
|
13767
13740
|
groupShiftReflowSnapshotRef.current = null;
|
|
13768
13741
|
const logicalGroupId = obj.__pixldocsGroupSelection;
|
|
13769
13742
|
if (logicalGroupId) {
|
|
13770
13743
|
try {
|
|
13771
13744
|
const state = useEditorStore.getState();
|
|
13772
|
-
const pageChildren2 = ((
|
|
13745
|
+
const pageChildren2 = ((_c = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
|
|
13773
13746
|
const groupNode = findNodeById(pageChildren2, logicalGroupId);
|
|
13774
13747
|
if (groupNode && isGroup(groupNode) && !isStackLayoutMode(groupNode.layoutMode)) {
|
|
13775
13748
|
const entries = obj.getObjects().map((c) => ({
|
|
@@ -13799,7 +13772,7 @@ const PageCanvas = forwardRef(
|
|
|
13799
13772
|
const asRect0 = obj.getBoundingRect();
|
|
13800
13773
|
let didReflowTextChild = false;
|
|
13801
13774
|
for (const child of obj.getObjects()) {
|
|
13802
|
-
if (child instanceof fabric.Group && (child.__cropGroup || ((
|
|
13775
|
+
if (child instanceof fabric.Group && (child.__cropGroup || ((_d = child._ct) == null ? void 0 : _d.isCropGroup))) {
|
|
13803
13776
|
const ct = child.__cropData;
|
|
13804
13777
|
if (!ct) continue;
|
|
13805
13778
|
if (isXSide) {
|
|
@@ -13904,7 +13877,7 @@ const PageCanvas = forwardRef(
|
|
|
13904
13877
|
didReflowTextChild = true;
|
|
13905
13878
|
}
|
|
13906
13879
|
}
|
|
13907
|
-
if (isXSide && ((
|
|
13880
|
+
if (isXSide && ((_e = groupShiftReflowSnapshotRef.current) == null ? void 0 : _e.selection) === obj) {
|
|
13908
13881
|
const snap = groupShiftReflowSnapshotRef.current;
|
|
13909
13882
|
const anchorEntry = snap.children[0];
|
|
13910
13883
|
const anchorTopLive = anchorEntry.obj.top ?? 0;
|
|
@@ -14060,7 +14033,7 @@ const PageCanvas = forwardRef(
|
|
|
14060
14033
|
setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
|
|
14061
14034
|
if (drilledGroupIdRef.current) {
|
|
14062
14035
|
try {
|
|
14063
|
-
(
|
|
14036
|
+
(_f = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _f.call(fabricCanvas);
|
|
14064
14037
|
} catch {
|
|
14065
14038
|
}
|
|
14066
14039
|
}
|
|
@@ -24290,9 +24263,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24290
24263
|
}
|
|
24291
24264
|
return svgString;
|
|
24292
24265
|
}
|
|
24293
|
-
const resolvedPackageVersion = "0.5.
|
|
24266
|
+
const resolvedPackageVersion = "0.5.320";
|
|
24294
24267
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24295
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24268
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.320";
|
|
24296
24269
|
const roundParityValue = (value) => {
|
|
24297
24270
|
if (typeof value !== "number") return value;
|
|
24298
24271
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25106,7 +25079,7 @@ class PixldocsRenderer {
|
|
|
25106
25079
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25107
25080
|
}
|
|
25108
25081
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25109
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
25082
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-B1wohdgq.js");
|
|
25110
25083
|
const prepared = preparePagesForExport(
|
|
25111
25084
|
cloned.pages,
|
|
25112
25085
|
canvasWidth,
|
|
@@ -27426,7 +27399,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27426
27399
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27427
27400
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27428
27401
|
try {
|
|
27429
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
27402
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-B1wohdgq.js");
|
|
27430
27403
|
try {
|
|
27431
27404
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27432
27405
|
} catch {
|
|
@@ -27826,4 +27799,4 @@ export {
|
|
|
27826
27799
|
buildTeaserBlurFlatKeys as y,
|
|
27827
27800
|
collectFontDescriptorsFromConfig as z
|
|
27828
27801
|
};
|
|
27829
|
-
//# sourceMappingURL=index-
|
|
27802
|
+
//# sourceMappingURL=index-BwDF94FE.js.map
|