@pixldocs/canvas-renderer 0.5.333 → 0.5.335

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.
@@ -13601,10 +13601,30 @@ const PageCanvas = forwardRef(
13601
13601
  fabricCanvas.on("selection:cleared", () => {
13602
13602
  });
13603
13603
  fabricCanvas.on("object:scaling", (e) => {
13604
- var _a2, _b2, _c, _d, _e, _f;
13604
+ var _a2, _b2, _c, _d, _e, _f, _g, _h;
13605
13605
  if (!isActiveRef.current) return;
13606
13606
  const t = e.target;
13607
13607
  if (t) lastResizeScaleTargetRef.current = t;
13608
+ try {
13609
+ const transformDbg = e.transform;
13610
+ const cornerDbg = (transformDbg == null ? void 0 : transformDbg.corner) || "";
13611
+ const children = t instanceof fabric.Group || t instanceof fabric.ActiveSelection ? t.getObjects() : [];
13612
+ logGroupImageResizeDebug("scaling-entry", {
13613
+ time: Math.round(performance.now()),
13614
+ corner: cornerDbg,
13615
+ targetType: t == null ? void 0 : t.type,
13616
+ targetCtor: (_a2 = t == null ? void 0 : t.constructor) == null ? void 0 : _a2.name,
13617
+ isActiveSelection: t instanceof fabric.ActiveSelection,
13618
+ isGroup: t instanceof fabric.Group,
13619
+ isCropGroup: !!(t && (t.__cropGroup || ((_b2 = t._ct) == null ? void 0 : _b2.isCropGroup))),
13620
+ childCount: children.length,
13621
+ childTypes: children.map((c) => c == null ? void 0 : c.type),
13622
+ hasImageChild: children.some((c) => isGroupResizeImageLikeObject(c)),
13623
+ target: t ? summarizeFabricObjectForResizeDebug(t) : null
13624
+ });
13625
+ } catch (err) {
13626
+ console.warn("[Pixldocs][group-image-side-resize] scaling-entry log failed", err);
13627
+ }
13608
13628
  prepareGroupSelectionTransformStart(t);
13609
13629
  markTransforming(t);
13610
13630
  didTransformRef.current = true;
@@ -13768,7 +13788,7 @@ const PageCanvas = forwardRef(
13768
13788
  time: Math.round(performance.now()),
13769
13789
  corner,
13770
13790
  groupSelectionId: obj.__pixldocsGroupSelection,
13771
- currentTransformAction: (_a2 = fabricCanvas._currentTransform) == null ? void 0 : _a2.action,
13791
+ currentTransformAction: (_c = fabricCanvas._currentTransform) == null ? void 0 : _c.action,
13772
13792
  selection: summarizeFabricObjectForResizeDebug(obj),
13773
13793
  textChildren: obj.getObjects().filter((child) => child instanceof fabric.Textbox).map((child) => summarizeFabricObjectForResizeDebug(child))
13774
13794
  };
@@ -13800,13 +13820,13 @@ const PageCanvas = forwardRef(
13800
13820
  children: obj.getObjects().map((child) => summarizeFabricObjectForResizeDebug(child))
13801
13821
  });
13802
13822
  }
13803
- if ((isXSide || shouldPinNonTextChildren) && ((_b2 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _b2.selection) !== obj) {
13823
+ if ((isXSide || shouldPinNonTextChildren) && ((_d = groupShiftReflowSnapshotRef.current) == null ? void 0 : _d.selection) !== obj) {
13804
13824
  groupShiftReflowSnapshotRef.current = null;
13805
13825
  const logicalGroupId = obj.__pixldocsGroupSelection;
13806
13826
  if (logicalGroupId) {
13807
13827
  try {
13808
13828
  const state = useEditorStore.getState();
13809
- const pageChildren2 = ((_c = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
13829
+ const pageChildren2 = ((_e = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
13810
13830
  const groupNode = findNodeById(pageChildren2, logicalGroupId);
13811
13831
  if (groupNode && isGroup(groupNode) && !isStackLayoutMode(groupNode.layoutMode)) {
13812
13832
  const entries = obj.getObjects().map((c) => ({
@@ -13903,7 +13923,7 @@ const PageCanvas = forwardRef(
13903
13923
  else child._set("top", entry.top0 * sAxis);
13904
13924
  };
13905
13925
  for (const child of obj.getObjects()) {
13906
- if (child instanceof fabric.Group && (child.__cropGroup || ((_d = child._ct) == null ? void 0 : _d.isCropGroup))) {
13926
+ if (child instanceof fabric.Group && (child.__cropGroup || ((_f = child._ct) == null ? void 0 : _f.isCropGroup))) {
13907
13927
  const beforeImageChildResize = shouldDebugGroupImageResize ? summarizeFabricObjectForResizeDebug(child) : null;
13908
13928
  const ct = child.__cropData;
13909
13929
  if (ct) {
@@ -14015,7 +14035,7 @@ const PageCanvas = forwardRef(
14015
14035
  didReflowTextChild = true;
14016
14036
  }
14017
14037
  }
14018
- if (isXSide && !shouldPinNonTextChildren && ((_e = groupShiftReflowSnapshotRef.current) == null ? void 0 : _e.selection) === obj) {
14038
+ if (isXSide && !shouldPinNonTextChildren && ((_g = groupShiftReflowSnapshotRef.current) == null ? void 0 : _g.selection) === obj) {
14019
14039
  const snap = groupShiftReflowSnapshotRef.current;
14020
14040
  const anchorEntry = snap.children[0];
14021
14041
  const anchorTopLive = anchorEntry.obj.top ?? 0;
@@ -14197,7 +14217,7 @@ const PageCanvas = forwardRef(
14197
14217
  setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
14198
14218
  if (drilledGroupIdRef.current) {
14199
14219
  try {
14200
- (_f = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _f.call(fabricCanvas);
14220
+ (_h = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _h.call(fabricCanvas);
14201
14221
  } catch {
14202
14222
  }
14203
14223
  }
@@ -14748,7 +14768,7 @@ const PageCanvas = forwardRef(
14748
14768
  }
14749
14769
  }
14750
14770
  const isActiveSelectionSideResize = isActiveSelection && (activeSelectionResizeHandle === "ml" || activeSelectionResizeHandle === "mr" || activeSelectionResizeHandle === "mt" || activeSelectionResizeHandle === "mb");
14751
- if (selectedElementIds.length > 0 && !anyCropGroup) {
14771
+ if (selectedElementIds.length > 0) {
14752
14772
  const firstObj = activeObjects[0];
14753
14773
  const firstId = getObjectId(firstObj);
14754
14774
  const parentGroups = selectedElementIds.map((id) => findParentGroup(pageChildren2, id)).filter((g) => g !== null);
@@ -14847,6 +14867,8 @@ const PageCanvas = forwardRef(
14847
14867
  }
14848
14868
  setTimeout(() => modifiedIdsThisRound.forEach((id) => justModifiedIdsRef.current.delete(id)), 150);
14849
14869
  groupSelectionTransformStartRef.current = null;
14870
+ activeSelectionMoveStartRef.current = null;
14871
+ activeSelectionResizeHandleRef.current = null;
14850
14872
  const restoreSnapshot = {
14851
14873
  memberIds: targetObjects.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__"),
14852
14874
  groupSelectionId,
@@ -24501,9 +24523,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24501
24523
  }
24502
24524
  return svgString;
24503
24525
  }
24504
- const resolvedPackageVersion = "0.5.333";
24526
+ const resolvedPackageVersion = "0.5.335";
24505
24527
  const PACKAGE_VERSION = resolvedPackageVersion;
24506
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.333";
24528
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.335";
24507
24529
  const roundParityValue = (value) => {
24508
24530
  if (typeof value !== "number") return value;
24509
24531
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25317,7 +25339,7 @@ class PixldocsRenderer {
25317
25339
  await this.waitForCanvasScene(container, cloned, i);
25318
25340
  }
25319
25341
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25320
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BSV5NYSE.js");
25342
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-D2ai2jn2.js");
25321
25343
  const prepared = preparePagesForExport(
25322
25344
  cloned.pages,
25323
25345
  canvasWidth,
@@ -27637,7 +27659,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27637
27659
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27638
27660
  sanitizeSvgTreeForPdf(svgToDraw);
27639
27661
  try {
27640
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BSV5NYSE.js");
27662
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-D2ai2jn2.js");
27641
27663
  try {
27642
27664
  await logTextMeasurementDiagnostic(svgToDraw);
27643
27665
  } catch {
@@ -28037,4 +28059,4 @@ export {
28037
28059
  buildTeaserBlurFlatKeys as y,
28038
28060
  collectFontDescriptorsFromConfig as z
28039
28061
  };
28040
- //# sourceMappingURL=index-CAdMLx_E.js.map
28062
+ //# sourceMappingURL=index-DpMLP8sp.js.map