@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
|
@@ -14389,79 +14389,22 @@ const PageCanvas = react.forwardRef(
|
|
|
14389
14389
|
setDrilledGroupBounds(null);
|
|
14390
14390
|
drilledGroupIdRef.current = null;
|
|
14391
14391
|
const groupSelectionId = (isActiveSelection && activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.__pixldocsGroupSelection : void 0) ?? groupToMove.id;
|
|
14392
|
-
const
|
|
14393
|
-
|
|
14394
|
-
|
|
14395
|
-
|
|
14396
|
-
|
|
14397
|
-
|
|
14398
|
-
|
|
14399
|
-
|
|
14400
|
-
|
|
14401
|
-
|
|
14402
|
-
skipSelectionClearOnDiscardRef.current = false;
|
|
14403
|
-
}
|
|
14404
|
-
} catch {
|
|
14405
|
-
}
|
|
14406
|
-
const pageAfterMove = ((_j = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _j.children) ?? [];
|
|
14407
|
-
const groupAfterMove = findNodeById(pageAfterMove, groupToMove.id);
|
|
14408
|
-
const memberIdsAfterMove = groupAfterMove && isGroup(groupAfterMove) ? getAllElementIds(groupAfterMove.children ?? []) : targetObjects.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__");
|
|
14409
|
-
preservedGroupMemberIds = memberIdsAfterMove;
|
|
14410
|
-
const reselectionObjects = memberIdsAfterMove.map((id) => targetObjects.find((obj) => getObjectId(obj) === id) ?? fabricCanvas.getObjects().find((obj) => getObjectId(obj) === id)).filter((obj) => !!obj);
|
|
14411
|
-
for (const obj of reselectionObjects) {
|
|
14412
|
-
const id = getObjectId(obj);
|
|
14413
|
-
const node = id ? findNodeById(pageAfterMove, id) : null;
|
|
14414
|
-
if (!node) continue;
|
|
14415
|
-
const abs = getAbsoluteBounds(node, pageAfterMove, pageBoundsOptions);
|
|
14416
|
-
const bounds = getNodeBounds(node, pageAfterMove, pageBoundsOptions);
|
|
14417
|
-
const __prevLeft = obj.left;
|
|
14418
|
-
const __prevTop = obj.top;
|
|
14419
|
-
const useCenterAnchor = obj instanceof fabric__namespace.Group && obj.__cropGroup || obj instanceof fabric__namespace.FabricImage && (obj.originX === "center" || obj.originY === "center");
|
|
14420
|
-
const nextPoint = new fabric__namespace.Point(
|
|
14421
|
-
useCenterAnchor ? abs.left + Math.max(1, bounds.width) / 2 : abs.left,
|
|
14422
|
-
useCenterAnchor ? abs.top + Math.max(1, bounds.height) / 2 : abs.top
|
|
14423
|
-
);
|
|
14424
|
-
if (typeof obj.setXY === "function") {
|
|
14425
|
-
obj.setXY(nextPoint, useCenterAnchor ? "center" : "left", useCenterAnchor ? "center" : "top");
|
|
14426
|
-
} else {
|
|
14427
|
-
obj.set({ left: nextPoint.x, top: nextPoint.y });
|
|
14428
|
-
}
|
|
14429
|
-
obj.setCoords();
|
|
14430
|
-
if (shouldLogGroupMove()) {
|
|
14431
|
-
console.log("[GRP-MOVE] rebake-member", {
|
|
14432
|
-
id,
|
|
14433
|
-
nodeType: node.type,
|
|
14434
|
-
storeAbs: abs,
|
|
14435
|
-
bounds,
|
|
14436
|
-
origin: { x: obj.originX, y: obj.originY },
|
|
14437
|
-
prev: { left: __prevLeft, top: __prevTop },
|
|
14438
|
-
after: { left: obj.left, top: obj.top }
|
|
14439
|
-
});
|
|
14440
|
-
}
|
|
14441
|
-
}
|
|
14442
|
-
const bakedSelection = reselectionObjects.length > 1 ? new fabric__namespace.ActiveSelection(reselectionObjects, { canvas: fabricCanvas }) : activeObj;
|
|
14443
|
-
restoreGroupSelectionVisualState(bakedSelection, groupSelectionId);
|
|
14444
|
-
fabricCanvas.setActiveObject(bakedSelection);
|
|
14445
|
-
if (!(bakedSelection instanceof fabric__namespace.ActiveSelection && bakedSelection.getObjects().every((obj) => !(obj instanceof fabric__namespace.Group)))) {
|
|
14446
|
-
bakedSelection.setCoords();
|
|
14447
|
-
}
|
|
14392
|
+
const pageAfterMove = ((_j = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _j.children) ?? [];
|
|
14393
|
+
const groupAfterMove = findNodeById(pageAfterMove, groupToMove.id);
|
|
14394
|
+
const preservedGroupMemberIds = groupAfterMove && isGroup(groupAfterMove) ? getAllElementIds(groupAfterMove.children ?? []) : selectedElementIds;
|
|
14395
|
+
if (activeObj instanceof fabric__namespace.ActiveSelection) {
|
|
14396
|
+
restoreGroupSelectionVisualState(activeObj, groupSelectionId);
|
|
14397
|
+
preserveActiveSelectionAfterTransformRef.current = {
|
|
14398
|
+
memberIds: preservedGroupMemberIds,
|
|
14399
|
+
groupSelectionId,
|
|
14400
|
+
expiresAt: Date.now() + 1200
|
|
14401
|
+
};
|
|
14448
14402
|
}
|
|
14449
14403
|
selectElements([groupSelectionId], false, false);
|
|
14450
14404
|
fabricCanvas.requestRenderAll();
|
|
14451
14405
|
elementsRef.current = getCurrentElements();
|
|
14452
|
-
for (const obj of targetObjects.length ? targetObjects : activeObjects) {
|
|
14453
|
-
const objId = getObjectId(obj);
|
|
14454
|
-
if (objId && objId !== "__background__") {
|
|
14455
|
-
justModifiedIdsRef.current.add(objId);
|
|
14456
|
-
modifiedIdsThisRound.add(objId);
|
|
14457
|
-
}
|
|
14458
|
-
}
|
|
14459
|
-
setTimeout(() => modifiedIdsThisRound.forEach((id) => justModifiedIdsRef.current.delete(id)), 150);
|
|
14460
14406
|
groupSelectionTransformStartRef.current = null;
|
|
14461
|
-
|
|
14462
|
-
memberIds: preservedGroupMemberIds,
|
|
14463
|
-
groupSelectionId
|
|
14464
|
-
});
|
|
14407
|
+
activeSelectionMoveStartRef.current = null;
|
|
14465
14408
|
unlockEditsSoon();
|
|
14466
14409
|
return;
|
|
14467
14410
|
}
|
|
@@ -15120,7 +15063,8 @@ const PageCanvas = react.forwardRef(
|
|
|
15120
15063
|
const replacementById = !activeStillOnCanvas && activeId ? fc.getObjects().find((o) => getObjectId(o) === activeId) ?? null : null;
|
|
15121
15064
|
const restoreTarget = activeStillOnCanvas ? activeBeforeSync : replacementById;
|
|
15122
15065
|
const isActiveTextBeingEdited = activeId && editingTextIdRef.current === activeId && activeBeforeSync instanceof fabric__namespace.Textbox;
|
|
15123
|
-
|
|
15066
|
+
const keepLiveLogicalActiveSelection = !!((activeSelectionSnapshot == null ? void 0 : activeSelectionSnapshot.groupSelectionId) && activeBeforeSync instanceof fabric__namespace.ActiveSelection && fc.getActiveObject() === activeBeforeSync && activeBeforeSync.__pixldocsGroupSelection === activeSelectionSnapshot.groupSelectionId && activeSelectionSnapshot.memberIds.length > 1);
|
|
15067
|
+
if (!skipRestoreSelection && activeSelectionSnapshot && !isActiveTextBeingEdited && !shouldSkipUpdates2 && !needsLooseLogicalGroupPositionSync && !keepLiveLogicalActiveSelection) {
|
|
15124
15068
|
const freshMembers = activeSelectionSnapshot.memberIds.map((id) => fc.getObjects().find((o) => getObjectId(o) === id)).filter((o) => !!o);
|
|
15125
15069
|
if (freshMembers.length > 1) {
|
|
15126
15070
|
isSyncingSelectionToFabricRef.current = true;
|
|
@@ -16240,7 +16184,6 @@ const PageCanvas = react.forwardRef(
|
|
|
16240
16184
|
});
|
|
16241
16185
|
if (isPureSingleGroupSelection) {
|
|
16242
16186
|
active.hasBorders = true;
|
|
16243
|
-
active.setCoords();
|
|
16244
16187
|
applyWarpAwareSelectionBorders(active);
|
|
16245
16188
|
}
|
|
16246
16189
|
}
|
|
@@ -23887,9 +23830,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23887
23830
|
}
|
|
23888
23831
|
return svgString;
|
|
23889
23832
|
}
|
|
23890
|
-
const resolvedPackageVersion = "0.5.
|
|
23833
|
+
const resolvedPackageVersion = "0.5.281";
|
|
23891
23834
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23892
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23835
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.281";
|
|
23893
23836
|
const roundParityValue = (value) => {
|
|
23894
23837
|
if (typeof value !== "number") return value;
|
|
23895
23838
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24703,7 +24646,7 @@ class PixldocsRenderer {
|
|
|
24703
24646
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24704
24647
|
}
|
|
24705
24648
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24706
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
24649
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CyvVvmOr.cjs"));
|
|
24707
24650
|
const prepared = preparePagesForExport(
|
|
24708
24651
|
cloned.pages,
|
|
24709
24652
|
canvasWidth,
|
|
@@ -27023,7 +26966,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27023
26966
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27024
26967
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27025
26968
|
try {
|
|
27026
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26969
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CyvVvmOr.cjs"));
|
|
27027
26970
|
try {
|
|
27028
26971
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27029
26972
|
} catch {
|
|
@@ -27420,4 +27363,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
27420
27363
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
27421
27364
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
27422
27365
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
27423
|
-
//# sourceMappingURL=index-
|
|
27366
|
+
//# sourceMappingURL=index-m0_zL8dr.cjs.map
|