@pixldocs/canvas-renderer 0.5.275 → 0.5.276

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.
@@ -13890,9 +13890,23 @@ const PageCanvas = forwardRef(
13890
13890
  });
13891
13891
  let cropGroupSaveTimer = null;
13892
13892
  fabricCanvas.on("object:modified", (e) => {
13893
- var _a2, _b2, _c, _d, _e, _f, _g, _h;
13893
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
13894
13894
  try {
13895
13895
  dragStarted = false;
13896
+ if (typeof window !== "undefined" && window.__pixldocsDebugGroupMove) {
13897
+ const t = e.target;
13898
+ console.log("[GRP-MOVE] object:modified fired", {
13899
+ targetType: (_a2 = t == null ? void 0 : t.constructor) == null ? void 0 : _a2.name,
13900
+ isActiveSelection: t instanceof fabric.ActiveSelection,
13901
+ groupSelectionId: t ? t.__pixldocsGroupSelection : null,
13902
+ memberIds: t instanceof fabric.ActiveSelection ? t.getObjects().map((o) => getObjectId(o)) : [getObjectId(t)],
13903
+ targetLeft: t == null ? void 0 : t.left,
13904
+ targetTop: t == null ? void 0 : t.top,
13905
+ scaleX: t == null ? void 0 : t.scaleX,
13906
+ scaleY: t == null ? void 0 : t.scaleY,
13907
+ angle: t == null ? void 0 : t.angle
13908
+ });
13909
+ }
13896
13910
  setGuides([]);
13897
13911
  setGroupOverlayLiveBoundsRef.current(null);
13898
13912
  objectResizeActiveSnapRef.current = null;
@@ -13934,7 +13948,7 @@ const PageCanvas = forwardRef(
13934
13948
  const active = fabricCanvas.getActiveObject();
13935
13949
  const activeId = active ? getObjectId(active) : null;
13936
13950
  if (active && activeId && activeId !== "__background__" && !(active instanceof fabric.Group)) {
13937
- const pageChildrenForParent = ((_a2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _a2.children) ?? [];
13951
+ const pageChildrenForParent = ((_b2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _b2.children) ?? [];
13938
13952
  const parentGroup = findParentGroup(pageChildrenForParent, activeId);
13939
13953
  if (parentGroup && isGroup(parentGroup) && parentGroup.backgroundColor) {
13940
13954
  let fabricSectionGroup = active.group && active.group instanceof fabric.Group ? active.group : null;
@@ -14016,7 +14030,7 @@ const PageCanvas = forwardRef(
14016
14030
  useEditorStore.getState().reflowStackGroupInPage(pageId, groupId);
14017
14031
  }
14018
14032
  const stateAfter = useEditorStore.getState();
14019
- const pageAfter = ((_b2 = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _b2.children) ?? [];
14033
+ const pageAfter = ((_c = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
14020
14034
  const groupNodeAfter = findNodeById(pageAfter, groupId);
14021
14035
  if (groupNodeAfter) {
14022
14036
  const abs = getAbsoluteBounds(groupNodeAfter, pageAfter);
@@ -14078,7 +14092,7 @@ const PageCanvas = forwardRef(
14078
14092
  }
14079
14093
  if (active && active instanceof fabric.Group && active.__docuforgeSectionGroup && getObjectId(active)) {
14080
14094
  const groupId = getObjectId(active);
14081
- const pageChildrenSec = ((_c = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
14095
+ const pageChildrenSec = ((_d = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _d.children) ?? [];
14082
14096
  const modifiedTarget2 = e == null ? void 0 : e.target;
14083
14097
  const resizeScaleTarget = lastResizeScaleTargetRef.current;
14084
14098
  lastResizeScaleTargetRef.current = null;
@@ -14109,7 +14123,7 @@ const PageCanvas = forwardRef(
14109
14123
  const node = findNodeById(pageChildrenSec, groupId);
14110
14124
  if (isChildModified && node && !groupMoved) {
14111
14125
  const stateAfter = useEditorStore.getState();
14112
- const pageAfter = ((_d = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _d.children) ?? [];
14126
+ const pageAfter = ((_e = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
14113
14127
  const groupNodeAfter = findNodeById(pageAfter, groupId);
14114
14128
  if (groupNodeAfter) {
14115
14129
  const abs = getAbsoluteBounds(groupNodeAfter, pageAfter);
@@ -14125,7 +14139,7 @@ const PageCanvas = forwardRef(
14125
14139
  }
14126
14140
  if (active && active instanceof fabric.Group && !(active instanceof fabric.ActiveSelection) && getObjectId(active)) {
14127
14141
  const groupId = getObjectId(active);
14128
- const pageChildren3 = ((_e = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
14142
+ const pageChildren3 = ((_f = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _f.children) ?? [];
14129
14143
  const w = (active.width ?? 0) * (active.scaleX ?? 1);
14130
14144
  const h = (active.height ?? 0) * (active.scaleY ?? 1);
14131
14145
  const centerX = active.left ?? 0;
@@ -14147,7 +14161,7 @@ const PageCanvas = forwardRef(
14147
14161
  }
14148
14162
  const activeObj = fabricCanvas.getActiveObject();
14149
14163
  let activeObjects = fabricCanvas.getActiveObjects();
14150
- const activeSelectionMoveStart = activeObj instanceof fabric.ActiveSelection && ((_f = activeSelectionMoveStartRef.current) == null ? void 0 : _f.selection) === activeObj ? activeSelectionMoveStartRef.current : null;
14164
+ const activeSelectionMoveStart = activeObj instanceof fabric.ActiveSelection && ((_g = activeSelectionMoveStartRef.current) == null ? void 0 : _g.selection) === activeObj ? activeSelectionMoveStartRef.current : null;
14151
14165
  const activeSelectionDelta = activeObj instanceof fabric.ActiveSelection && activeSelectionMoveStart ? (() => {
14152
14166
  const rect = activeObj.getBoundingRect();
14153
14167
  return {
@@ -14238,6 +14252,22 @@ const PageCanvas = forwardRef(
14238
14252
  return memberIds.every((mid) => selectedSet.has(mid));
14239
14253
  })();
14240
14254
  const groupToMove = candidateIsStack || allMembersSelected ? candidateGroup : null;
14255
+ if (typeof window !== "undefined" && window.__pixldocsDebugGroupMove) {
14256
+ console.log("[GRP-MOVE] entry", {
14257
+ selectedElementIds,
14258
+ isActiveSelection,
14259
+ activeSelectionGroupId: activeObj instanceof fabric.ActiveSelection ? activeObj.__pixldocsGroupSelection : null,
14260
+ parentGroupIds: parentGroups.map((g) => g.id),
14261
+ sameDirectParent,
14262
+ commonAncestorId: commonAncestor == null ? void 0 : commonAncestor.id,
14263
+ candidateGroupId: candidateGroup == null ? void 0 : candidateGroup.id,
14264
+ candidateIsStack,
14265
+ allMembersSelected,
14266
+ groupToMoveId: (groupToMove == null ? void 0 : groupToMove.id) ?? null,
14267
+ activeSelectionHadTransform,
14268
+ selectedLogicalGroupIds
14269
+ });
14270
+ }
14241
14271
  if (groupToMove) {
14242
14272
  const activeGroupSelectionId = activeObj instanceof fabric.ActiveSelection ? activeObj.__pixldocsGroupSelection : void 0;
14243
14273
  const transformStart = activeGroupSelectionId === groupToMove.id ? groupSelectionTransformStartRef.current : null;
@@ -14331,7 +14361,7 @@ const PageCanvas = forwardRef(
14331
14361
  }
14332
14362
  } catch {
14333
14363
  }
14334
- const pageAfterMove = ((_g = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _g.children) ?? [];
14364
+ const pageAfterMove = ((_h = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _h.children) ?? [];
14335
14365
  const groupAfterMove = findNodeById(pageAfterMove, groupToMove.id);
14336
14366
  const memberIdsAfterMove = groupAfterMove && isGroup(groupAfterMove) ? getAllElementIds(groupAfterMove.children ?? []) : targetObjects.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__");
14337
14367
  preservedGroupMemberIds = memberIdsAfterMove;
@@ -14646,7 +14676,7 @@ const PageCanvas = forwardRef(
14646
14676
  updateElement(objId, elementUpdate, { recordHistory: false, skipLayoutRecalc: true });
14647
14677
  obj.setCoords();
14648
14678
  }
14649
- const pageChildrenForReflow = ((_h = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _h.children) ?? [];
14679
+ const pageChildrenForReflow = ((_i = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _i.children) ?? [];
14650
14680
  const stackGroupsToReflow = /* @__PURE__ */ new Set();
14651
14681
  for (const id of modifiedIdsThisRound) {
14652
14682
  const parent = findParentGroup(pageChildrenForReflow, id);
@@ -23807,9 +23837,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23807
23837
  }
23808
23838
  return svgString;
23809
23839
  }
23810
- const resolvedPackageVersion = "0.5.275";
23840
+ const resolvedPackageVersion = "0.5.276";
23811
23841
  const PACKAGE_VERSION = resolvedPackageVersion;
23812
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.275";
23842
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.276";
23813
23843
  const roundParityValue = (value) => {
23814
23844
  if (typeof value !== "number") return value;
23815
23845
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24623,7 +24653,7 @@ class PixldocsRenderer {
24623
24653
  await this.waitForCanvasScene(container, cloned, i);
24624
24654
  }
24625
24655
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24626
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CZa1TypE.js");
24656
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-C9akdCtS.js");
24627
24657
  const prepared = preparePagesForExport(
24628
24658
  cloned.pages,
24629
24659
  canvasWidth,
@@ -26943,7 +26973,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
26943
26973
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
26944
26974
  sanitizeSvgTreeForPdf(svgToDraw);
26945
26975
  try {
26946
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CZa1TypE.js");
26976
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-C9akdCtS.js");
26947
26977
  try {
26948
26978
  await logTextMeasurementDiagnostic(svgToDraw);
26949
26979
  } catch {
@@ -27343,4 +27373,4 @@ export {
27343
27373
  buildTeaserBlurFlatKeys as y,
27344
27374
  collectFontDescriptorsFromConfig as z
27345
27375
  };
27346
- //# sourceMappingURL=index-Cs7F2355.js.map
27376
+ //# sourceMappingURL=index-CszEZlZ7.js.map