@pixldocs/canvas-renderer 0.5.342 → 0.5.344
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-AFV1WnF5.cjs → index-Byw3hiCQ.cjs} +21 -11
- package/dist/index-Byw3hiCQ.cjs.map +1 -0
- package/dist/{index-BQHFDZIZ.js → index-C-BVebqn.js} +21 -11
- package/dist/index-C-BVebqn.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-BW-Au2Xo.js → vectorPdfExport-C2_f1pzv.js} +4 -4
- package/dist/{vectorPdfExport-BW-Au2Xo.js.map → vectorPdfExport-C2_f1pzv.js.map} +1 -1
- package/dist/{vectorPdfExport-8iq2cL_r.cjs → vectorPdfExport-DslpfbFV.cjs} +4 -4
- package/dist/{vectorPdfExport-8iq2cL_r.cjs.map → vectorPdfExport-DslpfbFV.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-AFV1WnF5.cjs.map +0 -1
- package/dist/index-BQHFDZIZ.js.map +0 -1
|
@@ -13179,6 +13179,9 @@ const PageCanvas = forwardRef(
|
|
|
13179
13179
|
fabricCanvas.on("mouse:down:before", (opt) => {
|
|
13180
13180
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
13181
13181
|
const activeBeforeMouseDown = fabricCanvas.getActiveObject();
|
|
13182
|
+
if (activeBeforeMouseDown instanceof fabric.ActiveSelection && activeBeforeMouseDown.__pixldocsGroupSelection) {
|
|
13183
|
+
prepareGroupSelectionTransformStart(activeBeforeMouseDown);
|
|
13184
|
+
}
|
|
13182
13185
|
if (editLockRef.current) {
|
|
13183
13186
|
const active = fabricCanvas.getActiveObject();
|
|
13184
13187
|
if (active && (((_a2 = active._ct) == null ? void 0 : _a2.isCropGroup) || active.__cropGroup)) {
|
|
@@ -13278,6 +13281,7 @@ const PageCanvas = forwardRef(
|
|
|
13278
13281
|
restoreGroupSelectionVisualState(selection, parent.id);
|
|
13279
13282
|
fabricCanvas.setActiveObject(selection);
|
|
13280
13283
|
selection.setCoords();
|
|
13284
|
+
prepareGroupSelectionTransformStart(selection);
|
|
13281
13285
|
fabricCanvas._target = selection;
|
|
13282
13286
|
opt.target = selection;
|
|
13283
13287
|
pendingGroupPromotionRef.current = { groupId: parent.id, selection };
|
|
@@ -13320,6 +13324,7 @@ const PageCanvas = forwardRef(
|
|
|
13320
13324
|
restoreGroupSelectionVisualState(selection, parent.id);
|
|
13321
13325
|
fabricCanvas.setActiveObject(selection);
|
|
13322
13326
|
selection.setCoords();
|
|
13327
|
+
prepareGroupSelectionTransformStart(selection);
|
|
13323
13328
|
fabricCanvas._target = selection;
|
|
13324
13329
|
opt.target = selection;
|
|
13325
13330
|
pendingGroupPromotionRef.current = { groupId: parent.id, selection };
|
|
@@ -14877,9 +14882,9 @@ const PageCanvas = forwardRef(
|
|
|
14877
14882
|
let movedGroupLeft = groupAbs.left;
|
|
14878
14883
|
let movedGroupTop = groupAbs.top;
|
|
14879
14884
|
if (activeObj instanceof fabric.ActiveSelection && (transformStart == null ? void 0 : transformStart.groupId) === groupToMove.id) {
|
|
14880
|
-
const
|
|
14881
|
-
movedGroupLeft = transformStart.groupLeft + (
|
|
14882
|
-
movedGroupTop = transformStart.groupTop + (
|
|
14885
|
+
const selectionCenter = activeObj.getCenterPoint();
|
|
14886
|
+
movedGroupLeft = transformStart.groupLeft + (selectionCenter.x - transformStart.selectionCenterX);
|
|
14887
|
+
movedGroupTop = transformStart.groupTop + (selectionCenter.y - transformStart.selectionCenterY);
|
|
14883
14888
|
} else if (activeObj instanceof fabric.ActiveSelection && firstId && firstObj) {
|
|
14884
14889
|
const firstNode = findNodeById(pageChildren2, firstId);
|
|
14885
14890
|
if (firstNode) {
|
|
@@ -14919,13 +14924,17 @@ const PageCanvas = forwardRef(
|
|
|
14919
14924
|
const hadScale = isActiveSelection && activeObj && (hadResizeHandle || Math.abs((activeObj.scaleX ?? 1) - 1) > 0.01 || Math.abs((activeObj.scaleY ?? 1) - 1) > 0.01);
|
|
14920
14925
|
const startSelAngle = normalizeAngle((transformStart == null ? void 0 : transformStart.selectionAngle) ?? 0);
|
|
14921
14926
|
const currentSelAngle = isActiveSelection && activeObj ? normalizeAngle(activeObj.angle ?? 0) : 0;
|
|
14922
|
-
const
|
|
14927
|
+
const storedGroupAngle = normalizeAngle(Number(groupToMove.angle ?? 0));
|
|
14928
|
+
const effectiveStartAngle = transformStart ? startSelAngle : storedGroupAngle;
|
|
14929
|
+
const angleDelta = shortestAngleDelta(currentSelAngle, effectiveStartAngle);
|
|
14923
14930
|
const hadRotation = isActiveSelection && activeObj && angleDelta > 0.01;
|
|
14924
14931
|
if (activeGroupSelectionId === groupToMove.id && hadRotation && !hadScale && !activeSelectionResizeHandle && activeObj instanceof fabric.ActiveSelection) {
|
|
14925
14932
|
const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
|
|
14926
14933
|
const center = activeObj.getCenterPoint();
|
|
14927
|
-
const
|
|
14928
|
-
const
|
|
14934
|
+
const baseCenterX = (transformStart == null ? void 0 : transformStart.selectionCenterX) ?? groupAbs.left + groupAbs.width / 2;
|
|
14935
|
+
const baseCenterY = (transformStart == null ? void 0 : transformStart.selectionCenterY) ?? groupAbs.top + groupAbs.height / 2;
|
|
14936
|
+
const nextAbsLeft = groupAbs.left + (center.x - baseCenterX);
|
|
14937
|
+
const nextAbsTop = groupAbs.top + (center.y - baseCenterY);
|
|
14929
14938
|
const storePos = absoluteToStorePosition(nextAbsLeft, nextAbsTop, groupToMove.id, pageChildren2);
|
|
14930
14939
|
updateNodeStore(groupToMove.id, {
|
|
14931
14940
|
left: storePos.left,
|
|
@@ -15631,6 +15640,7 @@ const PageCanvas = forwardRef(
|
|
|
15631
15640
|
const activeObj = fabricCanvas.getActiveObject();
|
|
15632
15641
|
if (!(activeObj instanceof fabric.ActiveSelection)) return;
|
|
15633
15642
|
if (skipActiveSelectionBakeOnClearRef.current) return;
|
|
15643
|
+
if (activeObj.__pixldocsGroupSelection) return;
|
|
15634
15644
|
const selectionMatrix = activeObj.calcTransformMatrix();
|
|
15635
15645
|
for (const obj of deselected) {
|
|
15636
15646
|
const objId = getObjectId(obj);
|
|
@@ -24644,9 +24654,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24644
24654
|
}
|
|
24645
24655
|
return svgString;
|
|
24646
24656
|
}
|
|
24647
|
-
const resolvedPackageVersion = "0.5.
|
|
24657
|
+
const resolvedPackageVersion = "0.5.344";
|
|
24648
24658
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24649
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24659
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.344";
|
|
24650
24660
|
const roundParityValue = (value) => {
|
|
24651
24661
|
if (typeof value !== "number") return value;
|
|
24652
24662
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25460,7 +25470,7 @@ class PixldocsRenderer {
|
|
|
25460
25470
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25461
25471
|
}
|
|
25462
25472
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25463
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
25473
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-C2_f1pzv.js");
|
|
25464
25474
|
const prepared = preparePagesForExport(
|
|
25465
25475
|
cloned.pages,
|
|
25466
25476
|
canvasWidth,
|
|
@@ -27780,7 +27790,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27780
27790
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27781
27791
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27782
27792
|
try {
|
|
27783
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
27793
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-C2_f1pzv.js");
|
|
27784
27794
|
try {
|
|
27785
27795
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27786
27796
|
} catch {
|
|
@@ -28180,4 +28190,4 @@ export {
|
|
|
28180
28190
|
buildTeaserBlurFlatKeys as y,
|
|
28181
28191
|
collectFontDescriptorsFromConfig as z
|
|
28182
28192
|
};
|
|
28183
|
-
//# sourceMappingURL=index-
|
|
28193
|
+
//# sourceMappingURL=index-C-BVebqn.js.map
|