@pixldocs/canvas-renderer 0.5.317 → 0.5.318

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.
@@ -13570,15 +13570,16 @@ const PageCanvas = forwardRef(
13570
13570
  fabricCanvas.on("selection:cleared", () => {
13571
13571
  });
13572
13572
  fabricCanvas.on("object:scaling", (e) => {
13573
- var _a2, _b2, _c, _d, _e, _f, _g;
13573
+ var _a2, _b2, _c, _d, _e, _f, _g, _h;
13574
13574
  if (!isActiveRef.current) return;
13575
13575
  const t = e.target;
13576
13576
  if (t) lastResizeScaleTargetRef.current = t;
13577
13577
  try {
13578
- if (t instanceof fabric.ActiveSelection) {
13578
+ const isNativeGroup = t instanceof fabric.Group && !(t instanceof fabric.ActiveSelection) && !t.__docuforgeSectionGroup && !t.__cropGroup && !((_a2 = t._ct) == null ? void 0 : _a2.isCropGroup) && !t.__smartController;
13579
+ if (t instanceof fabric.ActiveSelection || isNativeGroup) {
13579
13580
  const isRotated = !!t.__pixldocsMixedRotation || Math.abs(((t.angle ?? 0) % 360 + 360) % 360) > 0.5;
13580
13581
  if (isRotated) {
13581
- const corner2 = (_a2 = e.transform) == null ? void 0 : _a2.corner;
13582
+ const corner2 = (_b2 = e.transform) == null ? void 0 : _b2.corner;
13582
13583
  if (corner2 === "ml" || corner2 === "mr") {
13583
13584
  t.scaleY = t.scaleX;
13584
13585
  } else if (corner2 === "mt" || corner2 === "mb") {
@@ -13751,7 +13752,7 @@ const PageCanvas = forwardRef(
13751
13752
  time: Math.round(performance.now()),
13752
13753
  corner,
13753
13754
  groupSelectionId: obj.__pixldocsGroupSelection,
13754
- currentTransformAction: (_b2 = fabricCanvas._currentTransform) == null ? void 0 : _b2.action,
13755
+ currentTransformAction: (_c = fabricCanvas._currentTransform) == null ? void 0 : _c.action,
13755
13756
  selection: summarizeFabricObjectForResizeDebug(obj),
13756
13757
  textChildren: obj.getObjects().filter((child) => child instanceof fabric.Textbox).map((child) => summarizeFabricObjectForResizeDebug(child))
13757
13758
  };
@@ -13762,13 +13763,13 @@ const PageCanvas = forwardRef(
13762
13763
  const isXSide = corner === "ml" || corner === "mr";
13763
13764
  const sAxis = isXSide ? Math.abs(obj.scaleX ?? 1) : Math.abs(obj.scaleY ?? 1);
13764
13765
  if (sAxis > 1e-3) {
13765
- if (isXSide && ((_c = groupShiftReflowSnapshotRef.current) == null ? void 0 : _c.selection) !== obj) {
13766
+ if (isXSide && ((_d = groupShiftReflowSnapshotRef.current) == null ? void 0 : _d.selection) !== obj) {
13766
13767
  groupShiftReflowSnapshotRef.current = null;
13767
13768
  const logicalGroupId = obj.__pixldocsGroupSelection;
13768
13769
  if (logicalGroupId) {
13769
13770
  try {
13770
13771
  const state = useEditorStore.getState();
13771
- const pageChildren2 = ((_d = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _d.children) ?? [];
13772
+ const pageChildren2 = ((_e = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
13772
13773
  const groupNode = findNodeById(pageChildren2, logicalGroupId);
13773
13774
  if (groupNode && isGroup(groupNode) && !isStackLayoutMode(groupNode.layoutMode)) {
13774
13775
  const entries = obj.getObjects().map((c) => ({
@@ -13798,7 +13799,7 @@ const PageCanvas = forwardRef(
13798
13799
  const asRect0 = obj.getBoundingRect();
13799
13800
  let didReflowTextChild = false;
13800
13801
  for (const child of obj.getObjects()) {
13801
- if (child instanceof fabric.Group && (child.__cropGroup || ((_e = child._ct) == null ? void 0 : _e.isCropGroup))) {
13802
+ if (child instanceof fabric.Group && (child.__cropGroup || ((_f = child._ct) == null ? void 0 : _f.isCropGroup))) {
13802
13803
  const ct = child.__cropData;
13803
13804
  if (!ct) continue;
13804
13805
  if (isXSide) {
@@ -13903,7 +13904,7 @@ const PageCanvas = forwardRef(
13903
13904
  didReflowTextChild = true;
13904
13905
  }
13905
13906
  }
13906
- if (isXSide && ((_f = groupShiftReflowSnapshotRef.current) == null ? void 0 : _f.selection) === obj) {
13907
+ if (isXSide && ((_g = groupShiftReflowSnapshotRef.current) == null ? void 0 : _g.selection) === obj) {
13907
13908
  const snap = groupShiftReflowSnapshotRef.current;
13908
13909
  const anchorEntry = snap.children[0];
13909
13910
  const anchorTopLive = anchorEntry.obj.top ?? 0;
@@ -14059,7 +14060,7 @@ const PageCanvas = forwardRef(
14059
14060
  setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
14060
14061
  if (drilledGroupIdRef.current) {
14061
14062
  try {
14062
- (_g = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _g.call(fabricCanvas);
14063
+ (_h = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _h.call(fabricCanvas);
14063
14064
  } catch {
14064
14065
  }
14065
14066
  }
@@ -24289,9 +24290,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24289
24290
  }
24290
24291
  return svgString;
24291
24292
  }
24292
- const resolvedPackageVersion = "0.5.317";
24293
+ const resolvedPackageVersion = "0.5.318";
24293
24294
  const PACKAGE_VERSION = resolvedPackageVersion;
24294
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.317";
24295
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.318";
24295
24296
  const roundParityValue = (value) => {
24296
24297
  if (typeof value !== "number") return value;
24297
24298
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25105,7 +25106,7 @@ class PixldocsRenderer {
25105
25106
  await this.waitForCanvasScene(container, cloned, i);
25106
25107
  }
25107
25108
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25108
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CM-HtbmR.js");
25109
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-56Aw1H7k.js");
25109
25110
  const prepared = preparePagesForExport(
25110
25111
  cloned.pages,
25111
25112
  canvasWidth,
@@ -27425,7 +27426,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27425
27426
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27426
27427
  sanitizeSvgTreeForPdf(svgToDraw);
27427
27428
  try {
27428
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CM-HtbmR.js");
27429
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-56Aw1H7k.js");
27429
27430
  try {
27430
27431
  await logTextMeasurementDiagnostic(svgToDraw);
27431
27432
  } catch {
@@ -27825,4 +27826,4 @@ export {
27825
27826
  buildTeaserBlurFlatKeys as y,
27826
27827
  collectFontDescriptorsFromConfig as z
27827
27828
  };
27828
- //# sourceMappingURL=index-CXbCTms2.js.map
27829
+ //# sourceMappingURL=index-CjatPuQ6.js.map