@pixldocs/canvas-renderer 0.5.339 → 0.5.341
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-DFhDFJ4X.js → index-8AH1NCZZ.js} +57 -36
- package/dist/index-8AH1NCZZ.js.map +1 -0
- package/dist/{index-BLwO7N0h.cjs → index-Diz7LWkR.cjs} +57 -36
- package/dist/index-Diz7LWkR.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-GeBepP7g.js → vectorPdfExport-Bq49zb70.js} +4 -4
- package/dist/{vectorPdfExport-GeBepP7g.js.map → vectorPdfExport-Bq49zb70.js.map} +1 -1
- package/dist/{vectorPdfExport-Dh2REogs.cjs → vectorPdfExport-DFKAha9Z.cjs} +4 -4
- package/dist/{vectorPdfExport-Dh2REogs.cjs.map → vectorPdfExport-DFKAha9Z.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BLwO7N0h.cjs.map +0 -1
- package/dist/index-DFhDFJ4X.js.map +0 -1
|
@@ -11368,8 +11368,16 @@ const PageCanvas = react.forwardRef(
|
|
|
11368
11368
|
const pageChildren2 = ((_a2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _a2.children) ?? [];
|
|
11369
11369
|
const groupNode = findNodeById(pageChildren2, groupId);
|
|
11370
11370
|
const groupAngle = groupNode && isGroup(groupNode) ? Number(groupNode.angle ?? 0) : 0;
|
|
11371
|
+
const groupAbs = groupNode && isGroup(groupNode) ? getAbsoluteBounds(groupNode, pageChildren2) : null;
|
|
11371
11372
|
if (Number.isFinite(groupAngle) && Math.abs(groupAngle) > 0.01) {
|
|
11372
11373
|
selection.set({ angle: groupAngle, scaleX: 1, scaleY: 1, skewX: 0, skewY: 0 });
|
|
11374
|
+
if (groupAbs) {
|
|
11375
|
+
selection.setPositionByOrigin(
|
|
11376
|
+
new fabric__namespace.Point(groupAbs.left + groupAbs.width / 2, groupAbs.top + groupAbs.height / 2),
|
|
11377
|
+
"center",
|
|
11378
|
+
"center"
|
|
11379
|
+
);
|
|
11380
|
+
}
|
|
11373
11381
|
selection.setCoords();
|
|
11374
11382
|
}
|
|
11375
11383
|
} catch {
|
|
@@ -12840,13 +12848,18 @@ const PageCanvas = react.forwardRef(
|
|
|
12840
12848
|
if (!groupNode) return;
|
|
12841
12849
|
const groupAbs = getAbsoluteBounds(groupNode, pageChildren2);
|
|
12842
12850
|
const rect = active.getBoundingRect();
|
|
12851
|
+
const center = active.getCenterPoint();
|
|
12843
12852
|
groupSelectionTransformStartRef.current = {
|
|
12844
12853
|
groupId,
|
|
12845
12854
|
selection: active,
|
|
12846
12855
|
selectionLeft: rect.left,
|
|
12847
12856
|
selectionTop: rect.top,
|
|
12857
|
+
selectionCenterX: center.x,
|
|
12858
|
+
selectionCenterY: center.y,
|
|
12848
12859
|
groupLeft: groupAbs.left,
|
|
12849
12860
|
groupTop: groupAbs.top,
|
|
12861
|
+
groupWidth: groupAbs.width,
|
|
12862
|
+
groupHeight: groupAbs.height,
|
|
12850
12863
|
selectionAngle: ((active.angle ?? 0) % 360 + 360) % 360
|
|
12851
12864
|
};
|
|
12852
12865
|
};
|
|
@@ -14923,6 +14936,44 @@ const PageCanvas = react.forwardRef(
|
|
|
14923
14936
|
const currentSelAngle = isActiveSelection && activeObj ? normalizeAngle(activeObj.angle ?? 0) : 0;
|
|
14924
14937
|
const angleDelta = shortestAngleDelta(currentSelAngle, startSelAngle);
|
|
14925
14938
|
const hadRotation = isActiveSelection && activeObj && angleDelta > 0.01;
|
|
14939
|
+
if (activeGroupSelectionId === groupToMove.id && hadRotation && !hadScale && !activeSelectionResizeHandle && activeObj instanceof fabric__namespace.ActiveSelection) {
|
|
14940
|
+
const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
|
|
14941
|
+
const center = activeObj.getCenterPoint();
|
|
14942
|
+
const nextAbsLeft = center.x - groupAbs.width / 2;
|
|
14943
|
+
const nextAbsTop = center.y - groupAbs.height / 2;
|
|
14944
|
+
const storePos = absoluteToStorePosition(nextAbsLeft, nextAbsTop, groupToMove.id, pageChildren2);
|
|
14945
|
+
updateNodeStore(groupToMove.id, {
|
|
14946
|
+
left: storePos.left,
|
|
14947
|
+
top: storePos.top,
|
|
14948
|
+
angle: currentSelAngle
|
|
14949
|
+
}, { recordHistory: false, skipLayoutRecalc: true });
|
|
14950
|
+
commitHistoryStore();
|
|
14951
|
+
restoreGroupSelectionVisualState(activeObj, groupToMove.id);
|
|
14952
|
+
fabricCanvas.setActiveObject(activeObj);
|
|
14953
|
+
activeObj.setCoords();
|
|
14954
|
+
selectElements([groupToMove.id], false, false);
|
|
14955
|
+
fabricCanvas.requestRenderAll();
|
|
14956
|
+
elementsRef.current = getCurrentElements();
|
|
14957
|
+
const restoreSnapshot = {
|
|
14958
|
+
memberIds: activeObj.getObjects().map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__"),
|
|
14959
|
+
groupSelectionId: groupToMove.id,
|
|
14960
|
+
expiresAt: Date.now() + 1200
|
|
14961
|
+
};
|
|
14962
|
+
recentGroupSelectionRestoreRef.current = restoreSnapshot;
|
|
14963
|
+
activeObj.getObjects().forEach((obj) => {
|
|
14964
|
+
const objId = getObjectId(obj);
|
|
14965
|
+
if (objId && objId !== "__background__") {
|
|
14966
|
+
justModifiedIdsRef.current.add(objId);
|
|
14967
|
+
modifiedIdsThisRound.add(objId);
|
|
14968
|
+
}
|
|
14969
|
+
});
|
|
14970
|
+
setTimeout(() => modifiedIdsThisRound.forEach((id) => justModifiedIdsRef.current.delete(id)), 150);
|
|
14971
|
+
groupSelectionTransformStartRef.current = null;
|
|
14972
|
+
activeSelectionMoveStartRef.current = null;
|
|
14973
|
+
activeSelectionResizeHandleRef.current = null;
|
|
14974
|
+
unlockEditsSoon();
|
|
14975
|
+
return;
|
|
14976
|
+
}
|
|
14926
14977
|
if (!isActiveSelectionSideResize && !hadScale && !hadRotation && (Math.abs(deltaX) > 0.1 || Math.abs(deltaY) > 0.1)) {
|
|
14927
14978
|
const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
|
|
14928
14979
|
const newLeft = (groupToMove.left ?? 0) + deltaX;
|
|
@@ -14964,35 +15015,6 @@ const PageCanvas = react.forwardRef(
|
|
|
14964
15015
|
unlockEditsSoon();
|
|
14965
15016
|
return;
|
|
14966
15017
|
}
|
|
14967
|
-
if (activeGroupSelectionId === groupToMove.id && hadRotation && !hadScale && !activeSelectionResizeHandle && activeObj instanceof fabric__namespace.ActiveSelection) {
|
|
14968
|
-
const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
|
|
14969
|
-
const nextAngle = currentSelAngle;
|
|
14970
|
-
updateNodeStore(groupToMove.id, { angle: nextAngle }, { recordHistory: false, skipLayoutRecalc: true });
|
|
14971
|
-
commitHistoryStore();
|
|
14972
|
-
const groupSelectionId = activeGroupSelectionId;
|
|
14973
|
-
elementsRef.current = getCurrentElements();
|
|
14974
|
-
for (const obj of activeObjects) {
|
|
14975
|
-
const objId = getObjectId(obj);
|
|
14976
|
-
if (objId && objId !== "__background__") {
|
|
14977
|
-
justModifiedIdsRef.current.add(objId);
|
|
14978
|
-
modifiedIdsThisRound.add(objId);
|
|
14979
|
-
}
|
|
14980
|
-
}
|
|
14981
|
-
setTimeout(() => modifiedIdsThisRound.forEach((id) => justModifiedIdsRef.current.delete(id)), 150);
|
|
14982
|
-
groupSelectionTransformStartRef.current = null;
|
|
14983
|
-
activeSelectionMoveStartRef.current = null;
|
|
14984
|
-
activeSelectionResizeHandleRef.current = null;
|
|
14985
|
-
const rotateRestoreSnapshot = {
|
|
14986
|
-
memberIds: activeObjects.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__"),
|
|
14987
|
-
groupSelectionId,
|
|
14988
|
-
expiresAt: Date.now() + 1200
|
|
14989
|
-
};
|
|
14990
|
-
recentGroupSelectionRestoreRef.current = rotateRestoreSnapshot;
|
|
14991
|
-
preserveActiveSelectionAfterTransformRef.current = rotateRestoreSnapshot;
|
|
14992
|
-
fabricCanvas.requestRenderAll();
|
|
14993
|
-
unlockEditsSoon();
|
|
14994
|
-
return;
|
|
14995
|
-
}
|
|
14996
15018
|
}
|
|
14997
15019
|
}
|
|
14998
15020
|
const pendingCropGroupFrameBakes = [];
|
|
@@ -15508,8 +15530,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15508
15530
|
for (const gid of stackGroupsToReflow) {
|
|
15509
15531
|
useEditorStore.getState().reflowStackGroupInPage(pageId, gid);
|
|
15510
15532
|
}
|
|
15511
|
-
|
|
15512
|
-
if (activeObj instanceof fabric__namespace.ActiveSelection && activeObjects.length > 0 && shouldRebuildActiveSelectionAfterPersist) {
|
|
15533
|
+
if (activeObj instanceof fabric__namespace.ActiveSelection && activeObjects.length > 0) {
|
|
15513
15534
|
const wasGroupSel = activeObj.__pixldocsGroupSelection;
|
|
15514
15535
|
const membersToReselect = activeObjects.filter((o) => {
|
|
15515
15536
|
const oid = getObjectId(o);
|
|
@@ -24638,9 +24659,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24638
24659
|
}
|
|
24639
24660
|
return svgString;
|
|
24640
24661
|
}
|
|
24641
|
-
const resolvedPackageVersion = "0.5.
|
|
24662
|
+
const resolvedPackageVersion = "0.5.341";
|
|
24642
24663
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24643
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24664
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.341";
|
|
24644
24665
|
const roundParityValue = (value) => {
|
|
24645
24666
|
if (typeof value !== "number") return value;
|
|
24646
24667
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25454,7 +25475,7 @@ class PixldocsRenderer {
|
|
|
25454
25475
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25455
25476
|
}
|
|
25456
25477
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25457
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
25478
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DFKAha9Z.cjs"));
|
|
25458
25479
|
const prepared = preparePagesForExport(
|
|
25459
25480
|
cloned.pages,
|
|
25460
25481
|
canvasWidth,
|
|
@@ -27774,7 +27795,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27774
27795
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27775
27796
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27776
27797
|
try {
|
|
27777
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
27798
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DFKAha9Z.cjs"));
|
|
27778
27799
|
try {
|
|
27779
27800
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27780
27801
|
} catch {
|
|
@@ -28171,4 +28192,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
28171
28192
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
28172
28193
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
28173
28194
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
28174
|
-
//# sourceMappingURL=index-
|
|
28195
|
+
//# sourceMappingURL=index-Diz7LWkR.cjs.map
|