@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.
@@ -13619,10 +13619,30 @@ const PageCanvas = react.forwardRef(
13619
13619
  fabricCanvas.on("selection:cleared", () => {
13620
13620
  });
13621
13621
  fabricCanvas.on("object:scaling", (e) => {
13622
- var _a2, _b2, _c, _d, _e, _f;
13622
+ var _a2, _b2, _c, _d, _e, _f, _g, _h;
13623
13623
  if (!isActiveRef.current) return;
13624
13624
  const t = e.target;
13625
13625
  if (t) lastResizeScaleTargetRef.current = t;
13626
+ try {
13627
+ const transformDbg = e.transform;
13628
+ const cornerDbg = (transformDbg == null ? void 0 : transformDbg.corner) || "";
13629
+ const children = t instanceof fabric__namespace.Group || t instanceof fabric__namespace.ActiveSelection ? t.getObjects() : [];
13630
+ logGroupImageResizeDebug("scaling-entry", {
13631
+ time: Math.round(performance.now()),
13632
+ corner: cornerDbg,
13633
+ targetType: t == null ? void 0 : t.type,
13634
+ targetCtor: (_a2 = t == null ? void 0 : t.constructor) == null ? void 0 : _a2.name,
13635
+ isActiveSelection: t instanceof fabric__namespace.ActiveSelection,
13636
+ isGroup: t instanceof fabric__namespace.Group,
13637
+ isCropGroup: !!(t && (t.__cropGroup || ((_b2 = t._ct) == null ? void 0 : _b2.isCropGroup))),
13638
+ childCount: children.length,
13639
+ childTypes: children.map((c) => c == null ? void 0 : c.type),
13640
+ hasImageChild: children.some((c) => isGroupResizeImageLikeObject(c)),
13641
+ target: t ? summarizeFabricObjectForResizeDebug(t) : null
13642
+ });
13643
+ } catch (err) {
13644
+ console.warn("[Pixldocs][group-image-side-resize] scaling-entry log failed", err);
13645
+ }
13626
13646
  prepareGroupSelectionTransformStart(t);
13627
13647
  markTransforming(t);
13628
13648
  didTransformRef.current = true;
@@ -13786,7 +13806,7 @@ const PageCanvas = react.forwardRef(
13786
13806
  time: Math.round(performance.now()),
13787
13807
  corner,
13788
13808
  groupSelectionId: obj.__pixldocsGroupSelection,
13789
- currentTransformAction: (_a2 = fabricCanvas._currentTransform) == null ? void 0 : _a2.action,
13809
+ currentTransformAction: (_c = fabricCanvas._currentTransform) == null ? void 0 : _c.action,
13790
13810
  selection: summarizeFabricObjectForResizeDebug(obj),
13791
13811
  textChildren: obj.getObjects().filter((child) => child instanceof fabric__namespace.Textbox).map((child) => summarizeFabricObjectForResizeDebug(child))
13792
13812
  };
@@ -13818,13 +13838,13 @@ const PageCanvas = react.forwardRef(
13818
13838
  children: obj.getObjects().map((child) => summarizeFabricObjectForResizeDebug(child))
13819
13839
  });
13820
13840
  }
13821
- if ((isXSide || shouldPinNonTextChildren) && ((_b2 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _b2.selection) !== obj) {
13841
+ if ((isXSide || shouldPinNonTextChildren) && ((_d = groupShiftReflowSnapshotRef.current) == null ? void 0 : _d.selection) !== obj) {
13822
13842
  groupShiftReflowSnapshotRef.current = null;
13823
13843
  const logicalGroupId = obj.__pixldocsGroupSelection;
13824
13844
  if (logicalGroupId) {
13825
13845
  try {
13826
13846
  const state = useEditorStore.getState();
13827
- const pageChildren2 = ((_c = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
13847
+ const pageChildren2 = ((_e = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
13828
13848
  const groupNode = findNodeById(pageChildren2, logicalGroupId);
13829
13849
  if (groupNode && isGroup(groupNode) && !isStackLayoutMode(groupNode.layoutMode)) {
13830
13850
  const entries = obj.getObjects().map((c) => ({
@@ -13921,7 +13941,7 @@ const PageCanvas = react.forwardRef(
13921
13941
  else child._set("top", entry.top0 * sAxis);
13922
13942
  };
13923
13943
  for (const child of obj.getObjects()) {
13924
- if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_d = child._ct) == null ? void 0 : _d.isCropGroup))) {
13944
+ if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_f = child._ct) == null ? void 0 : _f.isCropGroup))) {
13925
13945
  const beforeImageChildResize = shouldDebugGroupImageResize ? summarizeFabricObjectForResizeDebug(child) : null;
13926
13946
  const ct = child.__cropData;
13927
13947
  if (ct) {
@@ -14033,7 +14053,7 @@ const PageCanvas = react.forwardRef(
14033
14053
  didReflowTextChild = true;
14034
14054
  }
14035
14055
  }
14036
- if (isXSide && !shouldPinNonTextChildren && ((_e = groupShiftReflowSnapshotRef.current) == null ? void 0 : _e.selection) === obj) {
14056
+ if (isXSide && !shouldPinNonTextChildren && ((_g = groupShiftReflowSnapshotRef.current) == null ? void 0 : _g.selection) === obj) {
14037
14057
  const snap = groupShiftReflowSnapshotRef.current;
14038
14058
  const anchorEntry = snap.children[0];
14039
14059
  const anchorTopLive = anchorEntry.obj.top ?? 0;
@@ -14215,7 +14235,7 @@ const PageCanvas = react.forwardRef(
14215
14235
  setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
14216
14236
  if (drilledGroupIdRef.current) {
14217
14237
  try {
14218
- (_f = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _f.call(fabricCanvas);
14238
+ (_h = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _h.call(fabricCanvas);
14219
14239
  } catch {
14220
14240
  }
14221
14241
  }
@@ -24519,9 +24539,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24519
24539
  }
24520
24540
  return svgString;
24521
24541
  }
24522
- const resolvedPackageVersion = "0.5.333";
24542
+ const resolvedPackageVersion = "0.5.334";
24523
24543
  const PACKAGE_VERSION = resolvedPackageVersion;
24524
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.333";
24544
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.334";
24525
24545
  const roundParityValue = (value) => {
24526
24546
  if (typeof value !== "number") return value;
24527
24547
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25335,7 +25355,7 @@ class PixldocsRenderer {
25335
25355
  await this.waitForCanvasScene(container, cloned, i);
25336
25356
  }
25337
25357
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25338
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-Cc-1U0NL.cjs"));
25358
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-9OekmGZH.cjs"));
25339
25359
  const prepared = preparePagesForExport(
25340
25360
  cloned.pages,
25341
25361
  canvasWidth,
@@ -27655,7 +27675,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27655
27675
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27656
27676
  sanitizeSvgTreeForPdf(svgToDraw);
27657
27677
  try {
27658
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-Cc-1U0NL.cjs"));
27678
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-9OekmGZH.cjs"));
27659
27679
  try {
27660
27680
  await logTextMeasurementDiagnostic(svgToDraw);
27661
27681
  } catch {
@@ -28052,4 +28072,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
28052
28072
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
28053
28073
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
28054
28074
  exports.warmTemplateFromForm = warmTemplateFromForm;
28055
- //# sourceMappingURL=index-k8mzlqgs.cjs.map
28075
+ //# sourceMappingURL=index-CBVpyFeT.cjs.map