@pixldocs/canvas-renderer 0.5.279 → 0.5.281
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-mvcNnW-5.js → index-CcnLc5LI.js} +18 -75
- package/dist/index-CcnLc5LI.js.map +1 -0
- package/dist/{index-6-1e1Fh3.cjs → index-m0_zL8dr.cjs} +18 -75
- package/dist/index-m0_zL8dr.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-Bp8RGRa1.js → vectorPdfExport-CT_DagYd.js} +4 -4
- package/dist/{vectorPdfExport-Bp8RGRa1.js.map → vectorPdfExport-CT_DagYd.js.map} +1 -1
- package/dist/{vectorPdfExport-D8smkShg.cjs → vectorPdfExport-CyvVvmOr.cjs} +4 -4
- package/dist/{vectorPdfExport-D8smkShg.cjs.map → vectorPdfExport-CyvVvmOr.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-6-1e1Fh3.cjs.map +0 -1
- package/dist/index-mvcNnW-5.js.map +0 -1
|
@@ -14371,79 +14371,22 @@ const PageCanvas = forwardRef(
|
|
|
14371
14371
|
setDrilledGroupBounds(null);
|
|
14372
14372
|
drilledGroupIdRef.current = null;
|
|
14373
14373
|
const groupSelectionId = (isActiveSelection && activeObj instanceof fabric.ActiveSelection ? activeObj.__pixldocsGroupSelection : void 0) ?? groupToMove.id;
|
|
14374
|
-
const
|
|
14375
|
-
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
|
|
14384
|
-
skipSelectionClearOnDiscardRef.current = false;
|
|
14385
|
-
}
|
|
14386
|
-
} catch {
|
|
14387
|
-
}
|
|
14388
|
-
const pageAfterMove = ((_j = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _j.children) ?? [];
|
|
14389
|
-
const groupAfterMove = findNodeById(pageAfterMove, groupToMove.id);
|
|
14390
|
-
const memberIdsAfterMove = groupAfterMove && isGroup(groupAfterMove) ? getAllElementIds(groupAfterMove.children ?? []) : targetObjects.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__");
|
|
14391
|
-
preservedGroupMemberIds = memberIdsAfterMove;
|
|
14392
|
-
const reselectionObjects = memberIdsAfterMove.map((id) => targetObjects.find((obj) => getObjectId(obj) === id) ?? fabricCanvas.getObjects().find((obj) => getObjectId(obj) === id)).filter((obj) => !!obj);
|
|
14393
|
-
for (const obj of reselectionObjects) {
|
|
14394
|
-
const id = getObjectId(obj);
|
|
14395
|
-
const node = id ? findNodeById(pageAfterMove, id) : null;
|
|
14396
|
-
if (!node) continue;
|
|
14397
|
-
const abs = getAbsoluteBounds(node, pageAfterMove, pageBoundsOptions);
|
|
14398
|
-
const bounds = getNodeBounds(node, pageAfterMove, pageBoundsOptions);
|
|
14399
|
-
const __prevLeft = obj.left;
|
|
14400
|
-
const __prevTop = obj.top;
|
|
14401
|
-
const useCenterAnchor = obj instanceof fabric.Group && obj.__cropGroup || obj instanceof fabric.FabricImage && (obj.originX === "center" || obj.originY === "center");
|
|
14402
|
-
const nextPoint = new fabric.Point(
|
|
14403
|
-
useCenterAnchor ? abs.left + Math.max(1, bounds.width) / 2 : abs.left,
|
|
14404
|
-
useCenterAnchor ? abs.top + Math.max(1, bounds.height) / 2 : abs.top
|
|
14405
|
-
);
|
|
14406
|
-
if (typeof obj.setXY === "function") {
|
|
14407
|
-
obj.setXY(nextPoint, useCenterAnchor ? "center" : "left", useCenterAnchor ? "center" : "top");
|
|
14408
|
-
} else {
|
|
14409
|
-
obj.set({ left: nextPoint.x, top: nextPoint.y });
|
|
14410
|
-
}
|
|
14411
|
-
obj.setCoords();
|
|
14412
|
-
if (shouldLogGroupMove()) {
|
|
14413
|
-
console.log("[GRP-MOVE] rebake-member", {
|
|
14414
|
-
id,
|
|
14415
|
-
nodeType: node.type,
|
|
14416
|
-
storeAbs: abs,
|
|
14417
|
-
bounds,
|
|
14418
|
-
origin: { x: obj.originX, y: obj.originY },
|
|
14419
|
-
prev: { left: __prevLeft, top: __prevTop },
|
|
14420
|
-
after: { left: obj.left, top: obj.top }
|
|
14421
|
-
});
|
|
14422
|
-
}
|
|
14423
|
-
}
|
|
14424
|
-
const bakedSelection = reselectionObjects.length > 1 ? new fabric.ActiveSelection(reselectionObjects, { canvas: fabricCanvas }) : activeObj;
|
|
14425
|
-
restoreGroupSelectionVisualState(bakedSelection, groupSelectionId);
|
|
14426
|
-
fabricCanvas.setActiveObject(bakedSelection);
|
|
14427
|
-
if (!(bakedSelection instanceof fabric.ActiveSelection && bakedSelection.getObjects().every((obj) => !(obj instanceof fabric.Group)))) {
|
|
14428
|
-
bakedSelection.setCoords();
|
|
14429
|
-
}
|
|
14374
|
+
const pageAfterMove = ((_j = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _j.children) ?? [];
|
|
14375
|
+
const groupAfterMove = findNodeById(pageAfterMove, groupToMove.id);
|
|
14376
|
+
const preservedGroupMemberIds = groupAfterMove && isGroup(groupAfterMove) ? getAllElementIds(groupAfterMove.children ?? []) : selectedElementIds;
|
|
14377
|
+
if (activeObj instanceof fabric.ActiveSelection) {
|
|
14378
|
+
restoreGroupSelectionVisualState(activeObj, groupSelectionId);
|
|
14379
|
+
preserveActiveSelectionAfterTransformRef.current = {
|
|
14380
|
+
memberIds: preservedGroupMemberIds,
|
|
14381
|
+
groupSelectionId,
|
|
14382
|
+
expiresAt: Date.now() + 1200
|
|
14383
|
+
};
|
|
14430
14384
|
}
|
|
14431
14385
|
selectElements([groupSelectionId], false, false);
|
|
14432
14386
|
fabricCanvas.requestRenderAll();
|
|
14433
14387
|
elementsRef.current = getCurrentElements();
|
|
14434
|
-
for (const obj of targetObjects.length ? targetObjects : activeObjects) {
|
|
14435
|
-
const objId = getObjectId(obj);
|
|
14436
|
-
if (objId && objId !== "__background__") {
|
|
14437
|
-
justModifiedIdsRef.current.add(objId);
|
|
14438
|
-
modifiedIdsThisRound.add(objId);
|
|
14439
|
-
}
|
|
14440
|
-
}
|
|
14441
|
-
setTimeout(() => modifiedIdsThisRound.forEach((id) => justModifiedIdsRef.current.delete(id)), 150);
|
|
14442
14388
|
groupSelectionTransformStartRef.current = null;
|
|
14443
|
-
|
|
14444
|
-
memberIds: preservedGroupMemberIds,
|
|
14445
|
-
groupSelectionId
|
|
14446
|
-
});
|
|
14389
|
+
activeSelectionMoveStartRef.current = null;
|
|
14447
14390
|
unlockEditsSoon();
|
|
14448
14391
|
return;
|
|
14449
14392
|
}
|
|
@@ -15102,7 +15045,8 @@ const PageCanvas = forwardRef(
|
|
|
15102
15045
|
const replacementById = !activeStillOnCanvas && activeId ? fc.getObjects().find((o) => getObjectId(o) === activeId) ?? null : null;
|
|
15103
15046
|
const restoreTarget = activeStillOnCanvas ? activeBeforeSync : replacementById;
|
|
15104
15047
|
const isActiveTextBeingEdited = activeId && editingTextIdRef.current === activeId && activeBeforeSync instanceof fabric.Textbox;
|
|
15105
|
-
|
|
15048
|
+
const keepLiveLogicalActiveSelection = !!((activeSelectionSnapshot == null ? void 0 : activeSelectionSnapshot.groupSelectionId) && activeBeforeSync instanceof fabric.ActiveSelection && fc.getActiveObject() === activeBeforeSync && activeBeforeSync.__pixldocsGroupSelection === activeSelectionSnapshot.groupSelectionId && activeSelectionSnapshot.memberIds.length > 1);
|
|
15049
|
+
if (!skipRestoreSelection && activeSelectionSnapshot && !isActiveTextBeingEdited && !shouldSkipUpdates2 && !needsLooseLogicalGroupPositionSync && !keepLiveLogicalActiveSelection) {
|
|
15106
15050
|
const freshMembers = activeSelectionSnapshot.memberIds.map((id) => fc.getObjects().find((o) => getObjectId(o) === id)).filter((o) => !!o);
|
|
15107
15051
|
if (freshMembers.length > 1) {
|
|
15108
15052
|
isSyncingSelectionToFabricRef.current = true;
|
|
@@ -16222,7 +16166,6 @@ const PageCanvas = forwardRef(
|
|
|
16222
16166
|
});
|
|
16223
16167
|
if (isPureSingleGroupSelection) {
|
|
16224
16168
|
active.hasBorders = true;
|
|
16225
|
-
active.setCoords();
|
|
16226
16169
|
applyWarpAwareSelectionBorders(active);
|
|
16227
16170
|
}
|
|
16228
16171
|
}
|
|
@@ -23869,9 +23812,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23869
23812
|
}
|
|
23870
23813
|
return svgString;
|
|
23871
23814
|
}
|
|
23872
|
-
const resolvedPackageVersion = "0.5.
|
|
23815
|
+
const resolvedPackageVersion = "0.5.281";
|
|
23873
23816
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23874
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23817
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.281";
|
|
23875
23818
|
const roundParityValue = (value) => {
|
|
23876
23819
|
if (typeof value !== "number") return value;
|
|
23877
23820
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24685,7 +24628,7 @@ class PixldocsRenderer {
|
|
|
24685
24628
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24686
24629
|
}
|
|
24687
24630
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24688
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
24631
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CT_DagYd.js");
|
|
24689
24632
|
const prepared = preparePagesForExport(
|
|
24690
24633
|
cloned.pages,
|
|
24691
24634
|
canvasWidth,
|
|
@@ -27005,7 +26948,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27005
26948
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27006
26949
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27007
26950
|
try {
|
|
27008
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
26951
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CT_DagYd.js");
|
|
27009
26952
|
try {
|
|
27010
26953
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27011
26954
|
} catch {
|
|
@@ -27405,4 +27348,4 @@ export {
|
|
|
27405
27348
|
buildTeaserBlurFlatKeys as y,
|
|
27406
27349
|
collectFontDescriptorsFromConfig as z
|
|
27407
27350
|
};
|
|
27408
|
-
//# sourceMappingURL=index-
|
|
27351
|
+
//# sourceMappingURL=index-CcnLc5LI.js.map
|