@pixldocs/canvas-renderer 0.5.319 → 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-D75MmxRi.js → index-BwDF94FE.js} +13 -36
- package/dist/index-BwDF94FE.js.map +1 -0
- package/dist/{index-D0nU_guL.cjs → index-wHNXUueq.cjs} +13 -36
- package/dist/index-wHNXUueq.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-9kP7srXG.js → vectorPdfExport-B1wohdgq.js} +4 -4
- package/dist/{vectorPdfExport-9kP7srXG.js.map → vectorPdfExport-B1wohdgq.js.map} +1 -1
- package/dist/{vectorPdfExport-DPghmX4S.cjs → vectorPdfExport-BFpf44ad.cjs} +4 -4
- package/dist/{vectorPdfExport-DPghmX4S.cjs.map → vectorPdfExport-BFpf44ad.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-D0nU_guL.cjs.map +0 -1
- package/dist/index-D75MmxRi.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,21 +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
|
-
if (t instanceof fabric.ActiveSelection && t.__pixldocsMixedRotation) {
|
|
13579
|
-
const corner2 = (_a2 = e.transform) == null ? void 0 : _a2.corner;
|
|
13580
|
-
if (corner2 === "ml" || corner2 === "mr") {
|
|
13581
|
-
t.scaleY = t.scaleX;
|
|
13582
|
-
} else if (corner2 === "mt" || corner2 === "mb") {
|
|
13583
|
-
t.scaleX = t.scaleY;
|
|
13584
|
-
}
|
|
13585
|
-
}
|
|
13586
|
-
} catch {
|
|
13587
|
-
}
|
|
13588
13566
|
prepareGroupSelectionTransformStart(t);
|
|
13589
13567
|
markTransforming(t);
|
|
13590
13568
|
didTransformRef.current = true;
|
|
@@ -13748,24 +13726,23 @@ const PageCanvas = forwardRef(
|
|
|
13748
13726
|
time: Math.round(performance.now()),
|
|
13749
13727
|
corner,
|
|
13750
13728
|
groupSelectionId: obj.__pixldocsGroupSelection,
|
|
13751
|
-
currentTransformAction: (
|
|
13729
|
+
currentTransformAction: (_a2 = fabricCanvas._currentTransform) == null ? void 0 : _a2.action,
|
|
13752
13730
|
selection: summarizeFabricObjectForResizeDebug(obj),
|
|
13753
13731
|
textChildren: obj.getObjects().filter((child) => child instanceof fabric.Textbox).map((child) => summarizeFabricObjectForResizeDebug(child))
|
|
13754
13732
|
};
|
|
13755
13733
|
}
|
|
13756
13734
|
}
|
|
13757
|
-
|
|
13758
|
-
if (obj instanceof fabric.ActiveSelection && !_asMixedRotForReflow && (corner === "ml" || corner === "mr" || corner === "mt" || corner === "mb")) {
|
|
13735
|
+
if (obj instanceof fabric.ActiveSelection && (corner === "ml" || corner === "mr" || corner === "mt" || corner === "mb")) {
|
|
13759
13736
|
const isXSide = corner === "ml" || corner === "mr";
|
|
13760
13737
|
const sAxis = isXSide ? Math.abs(obj.scaleX ?? 1) : Math.abs(obj.scaleY ?? 1);
|
|
13761
13738
|
if (sAxis > 1e-3) {
|
|
13762
|
-
if (isXSide && ((
|
|
13739
|
+
if (isXSide && ((_b2 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _b2.selection) !== obj) {
|
|
13763
13740
|
groupShiftReflowSnapshotRef.current = null;
|
|
13764
13741
|
const logicalGroupId = obj.__pixldocsGroupSelection;
|
|
13765
13742
|
if (logicalGroupId) {
|
|
13766
13743
|
try {
|
|
13767
13744
|
const state = useEditorStore.getState();
|
|
13768
|
-
const pageChildren2 = ((
|
|
13745
|
+
const pageChildren2 = ((_c = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
|
|
13769
13746
|
const groupNode = findNodeById(pageChildren2, logicalGroupId);
|
|
13770
13747
|
if (groupNode && isGroup(groupNode) && !isStackLayoutMode(groupNode.layoutMode)) {
|
|
13771
13748
|
const entries = obj.getObjects().map((c) => ({
|
|
@@ -13795,7 +13772,7 @@ const PageCanvas = forwardRef(
|
|
|
13795
13772
|
const asRect0 = obj.getBoundingRect();
|
|
13796
13773
|
let didReflowTextChild = false;
|
|
13797
13774
|
for (const child of obj.getObjects()) {
|
|
13798
|
-
if (child instanceof fabric.Group && (child.__cropGroup || ((
|
|
13775
|
+
if (child instanceof fabric.Group && (child.__cropGroup || ((_d = child._ct) == null ? void 0 : _d.isCropGroup))) {
|
|
13799
13776
|
const ct = child.__cropData;
|
|
13800
13777
|
if (!ct) continue;
|
|
13801
13778
|
if (isXSide) {
|
|
@@ -13900,7 +13877,7 @@ const PageCanvas = forwardRef(
|
|
|
13900
13877
|
didReflowTextChild = true;
|
|
13901
13878
|
}
|
|
13902
13879
|
}
|
|
13903
|
-
if (isXSide && ((
|
|
13880
|
+
if (isXSide && ((_e = groupShiftReflowSnapshotRef.current) == null ? void 0 : _e.selection) === obj) {
|
|
13904
13881
|
const snap = groupShiftReflowSnapshotRef.current;
|
|
13905
13882
|
const anchorEntry = snap.children[0];
|
|
13906
13883
|
const anchorTopLive = anchorEntry.obj.top ?? 0;
|
|
@@ -14056,7 +14033,7 @@ const PageCanvas = forwardRef(
|
|
|
14056
14033
|
setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
|
|
14057
14034
|
if (drilledGroupIdRef.current) {
|
|
14058
14035
|
try {
|
|
14059
|
-
(
|
|
14036
|
+
(_f = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _f.call(fabricCanvas);
|
|
14060
14037
|
} catch {
|
|
14061
14038
|
}
|
|
14062
14039
|
}
|
|
@@ -24286,9 +24263,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24286
24263
|
}
|
|
24287
24264
|
return svgString;
|
|
24288
24265
|
}
|
|
24289
|
-
const resolvedPackageVersion = "0.5.
|
|
24266
|
+
const resolvedPackageVersion = "0.5.320";
|
|
24290
24267
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24291
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24268
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.320";
|
|
24292
24269
|
const roundParityValue = (value) => {
|
|
24293
24270
|
if (typeof value !== "number") return value;
|
|
24294
24271
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25102,7 +25079,7 @@ class PixldocsRenderer {
|
|
|
25102
25079
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25103
25080
|
}
|
|
25104
25081
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25105
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
25082
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-B1wohdgq.js");
|
|
25106
25083
|
const prepared = preparePagesForExport(
|
|
25107
25084
|
cloned.pages,
|
|
25108
25085
|
canvasWidth,
|
|
@@ -27422,7 +27399,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27422
27399
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27423
27400
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27424
27401
|
try {
|
|
27425
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
27402
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-B1wohdgq.js");
|
|
27426
27403
|
try {
|
|
27427
27404
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27428
27405
|
} catch {
|
|
@@ -27822,4 +27799,4 @@ export {
|
|
|
27822
27799
|
buildTeaserBlurFlatKeys as y,
|
|
27823
27800
|
collectFontDescriptorsFromConfig as z
|
|
27824
27801
|
};
|
|
27825
|
-
//# sourceMappingURL=index-
|
|
27802
|
+
//# sourceMappingURL=index-BwDF94FE.js.map
|