@pixldocs/canvas-renderer 0.5.270 → 0.5.271
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-CLq3CdA3.cjs → index-6188mLJ2.cjs} +29 -10
- package/dist/index-6188mLJ2.cjs.map +1 -0
- package/dist/{index-RDXGR8QW.js → index-BpY8sZ_v.js} +29 -10
- package/dist/index-BpY8sZ_v.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport--X5puWU1.js → vectorPdfExport-0BizqdiS.js} +4 -4
- package/dist/{vectorPdfExport--X5puWU1.js.map → vectorPdfExport-0BizqdiS.js.map} +1 -1
- package/dist/{vectorPdfExport-BpHyRyQS.cjs → vectorPdfExport-DjBUHamz.cjs} +4 -4
- package/dist/{vectorPdfExport-BpHyRyQS.cjs.map → vectorPdfExport-DjBUHamz.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-CLq3CdA3.cjs.map +0 -1
- package/dist/index-RDXGR8QW.js.map +0 -1
|
@@ -13888,7 +13888,7 @@ const PageCanvas = forwardRef(
|
|
|
13888
13888
|
});
|
|
13889
13889
|
let cropGroupSaveTimer = null;
|
|
13890
13890
|
fabricCanvas.on("object:modified", (e) => {
|
|
13891
|
-
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
13891
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h;
|
|
13892
13892
|
try {
|
|
13893
13893
|
dragStarted = false;
|
|
13894
13894
|
setGuides([]);
|
|
@@ -14304,6 +14304,7 @@ const PageCanvas = forwardRef(
|
|
|
14304
14304
|
drilledGroupIdRef.current = null;
|
|
14305
14305
|
const groupSelectionId = (isActiveSelection && activeObj instanceof fabric.ActiveSelection ? activeObj.__pixldocsGroupSelection : void 0) ?? groupToMove.id;
|
|
14306
14306
|
const targetObjects = isActiveSelection && activeObj instanceof fabric.ActiveSelection ? activeObj.getObjects() : activeObjects;
|
|
14307
|
+
let preservedGroupMemberIds = targetObjects.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__");
|
|
14307
14308
|
if (groupSelectionId && activeObj instanceof fabric.ActiveSelection) {
|
|
14308
14309
|
try {
|
|
14309
14310
|
skipSelectionClearOnDiscardRef.current = true;
|
|
@@ -14316,7 +14317,25 @@ const PageCanvas = forwardRef(
|
|
|
14316
14317
|
}
|
|
14317
14318
|
} catch {
|
|
14318
14319
|
}
|
|
14319
|
-
const
|
|
14320
|
+
const pageAfterMove = ((_g = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _g.children) ?? [];
|
|
14321
|
+
const groupAfterMove = findNodeById(pageAfterMove, groupToMove.id);
|
|
14322
|
+
const memberIdsAfterMove = groupAfterMove && isGroup(groupAfterMove) ? getAllElementIds(groupAfterMove.children ?? []) : targetObjects.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__");
|
|
14323
|
+
preservedGroupMemberIds = memberIdsAfterMove;
|
|
14324
|
+
const reselectionObjects = memberIdsAfterMove.map((id) => targetObjects.find((obj) => getObjectId(obj) === id) ?? fabricCanvas.getObjects().find((obj) => getObjectId(obj) === id)).filter((obj) => !!obj);
|
|
14325
|
+
for (const obj of reselectionObjects) {
|
|
14326
|
+
const id = getObjectId(obj);
|
|
14327
|
+
const node = id ? findNodeById(pageAfterMove, id) : null;
|
|
14328
|
+
if (!node) continue;
|
|
14329
|
+
const abs = getAbsoluteBounds(node, pageAfterMove, pageBoundsOptions);
|
|
14330
|
+
const bounds = getNodeBounds(node, pageAfterMove, pageBoundsOptions);
|
|
14331
|
+
if (obj instanceof fabric.Group && obj.__cropGroup || obj instanceof fabric.FabricImage && (obj.originX === "center" || obj.originY === "center")) {
|
|
14332
|
+
obj.set({ left: abs.left + Math.max(1, bounds.width) / 2, top: abs.top + Math.max(1, bounds.height) / 2 });
|
|
14333
|
+
} else {
|
|
14334
|
+
obj.set({ left: abs.left, top: abs.top });
|
|
14335
|
+
}
|
|
14336
|
+
obj.setCoords();
|
|
14337
|
+
}
|
|
14338
|
+
const bakedSelection = reselectionObjects.length > 1 ? new fabric.ActiveSelection(reselectionObjects, { canvas: fabricCanvas }) : activeObj;
|
|
14320
14339
|
restoreGroupSelectionVisualState(bakedSelection, groupSelectionId);
|
|
14321
14340
|
fabricCanvas.setActiveObject(bakedSelection);
|
|
14322
14341
|
bakedSelection.setCoords();
|
|
@@ -14324,7 +14343,7 @@ const PageCanvas = forwardRef(
|
|
|
14324
14343
|
selectElements([groupSelectionId], false, false);
|
|
14325
14344
|
fabricCanvas.requestRenderAll();
|
|
14326
14345
|
elementsRef.current = getCurrentElements();
|
|
14327
|
-
for (const obj of targetObjects) {
|
|
14346
|
+
for (const obj of targetObjects.length ? targetObjects : activeObjects) {
|
|
14328
14347
|
const objId = getObjectId(obj);
|
|
14329
14348
|
if (objId && objId !== "__background__") {
|
|
14330
14349
|
justModifiedIdsRef.current.add(objId);
|
|
@@ -14334,7 +14353,7 @@ const PageCanvas = forwardRef(
|
|
|
14334
14353
|
setTimeout(() => modifiedIdsThisRound.forEach((id) => justModifiedIdsRef.current.delete(id)), 150);
|
|
14335
14354
|
groupSelectionTransformStartRef.current = null;
|
|
14336
14355
|
restorePreservedGroupSelectionSoon({
|
|
14337
|
-
memberIds:
|
|
14356
|
+
memberIds: preservedGroupMemberIds,
|
|
14338
14357
|
groupSelectionId
|
|
14339
14358
|
});
|
|
14340
14359
|
unlockEditsSoon();
|
|
@@ -14598,7 +14617,7 @@ const PageCanvas = forwardRef(
|
|
|
14598
14617
|
updateElement(objId, elementUpdate, { recordHistory: false, skipLayoutRecalc: true });
|
|
14599
14618
|
obj.setCoords();
|
|
14600
14619
|
}
|
|
14601
|
-
const pageChildrenForReflow = ((
|
|
14620
|
+
const pageChildrenForReflow = ((_h = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _h.children) ?? [];
|
|
14602
14621
|
const stackGroupsToReflow = /* @__PURE__ */ new Set();
|
|
14603
14622
|
for (const id of modifiedIdsThisRound) {
|
|
14604
14623
|
const parent = findParentGroup(pageChildrenForReflow, id);
|
|
@@ -23678,9 +23697,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23678
23697
|
}
|
|
23679
23698
|
return svgString;
|
|
23680
23699
|
}
|
|
23681
|
-
const resolvedPackageVersion = "0.5.
|
|
23700
|
+
const resolvedPackageVersion = "0.5.271";
|
|
23682
23701
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23683
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23702
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.271";
|
|
23684
23703
|
const roundParityValue = (value) => {
|
|
23685
23704
|
if (typeof value !== "number") return value;
|
|
23686
23705
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24494,7 +24513,7 @@ class PixldocsRenderer {
|
|
|
24494
24513
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24495
24514
|
}
|
|
24496
24515
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24497
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport
|
|
24516
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-0BizqdiS.js");
|
|
24498
24517
|
const prepared = preparePagesForExport(
|
|
24499
24518
|
cloned.pages,
|
|
24500
24519
|
canvasWidth,
|
|
@@ -26814,7 +26833,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26814
26833
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26815
26834
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26816
26835
|
try {
|
|
26817
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport
|
|
26836
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-0BizqdiS.js");
|
|
26818
26837
|
try {
|
|
26819
26838
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26820
26839
|
} catch {
|
|
@@ -27214,4 +27233,4 @@ export {
|
|
|
27214
27233
|
buildTeaserBlurFlatKeys as y,
|
|
27215
27234
|
collectFontDescriptorsFromConfig as z
|
|
27216
27235
|
};
|
|
27217
|
-
//# sourceMappingURL=index-
|
|
27236
|
+
//# sourceMappingURL=index-BpY8sZ_v.js.map
|