@pixldocs/canvas-renderer 0.5.333 → 0.5.334

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
  }
@@ -24501,9 +24521,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24501
24521
  }
24502
24522
  return svgString;
24503
24523
  }
24504
- const resolvedPackageVersion = "0.5.333";
24524
+ const resolvedPackageVersion = "0.5.334";
24505
24525
  const PACKAGE_VERSION = resolvedPackageVersion;
24506
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.333";
24526
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.334";
24507
24527
  const roundParityValue = (value) => {
24508
24528
  if (typeof value !== "number") return value;
24509
24529
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25317,7 +25337,7 @@ class PixldocsRenderer {
25317
25337
  await this.waitForCanvasScene(container, cloned, i);
25318
25338
  }
25319
25339
  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");
25340
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CESWzne5.js");
25321
25341
  const prepared = preparePagesForExport(
25322
25342
  cloned.pages,
25323
25343
  canvasWidth,
@@ -27637,7 +27657,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27637
27657
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27638
27658
  sanitizeSvgTreeForPdf(svgToDraw);
27639
27659
  try {
27640
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BSV5NYSE.js");
27660
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CESWzne5.js");
27641
27661
  try {
27642
27662
  await logTextMeasurementDiagnostic(svgToDraw);
27643
27663
  } catch {
@@ -28037,4 +28057,4 @@ export {
28037
28057
  buildTeaserBlurFlatKeys as y,
28038
28058
  collectFontDescriptorsFromConfig as z
28039
28059
  };
28040
- //# sourceMappingURL=index-CAdMLx_E.js.map
28060
+ //# sourceMappingURL=index-DDQNmmRg.js.map