@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.
@@ -13588,15 +13588,16 @@ const PageCanvas = react.forwardRef(
13588
13588
  fabricCanvas.on("selection:cleared", () => {
13589
13589
  });
13590
13590
  fabricCanvas.on("object:scaling", (e) => {
13591
- var _a2, _b2, _c, _d, _e, _f, _g;
13591
+ var _a2, _b2, _c, _d, _e, _f, _g, _h;
13592
13592
  if (!isActiveRef.current) return;
13593
13593
  const t = e.target;
13594
13594
  if (t) lastResizeScaleTargetRef.current = t;
13595
13595
  try {
13596
- if (t instanceof fabric__namespace.ActiveSelection) {
13596
+ const isNativeGroup = t instanceof fabric__namespace.Group && !(t instanceof fabric__namespace.ActiveSelection) && !t.__docuforgeSectionGroup && !t.__cropGroup && !((_a2 = t._ct) == null ? void 0 : _a2.isCropGroup) && !t.__smartController;
13597
+ if (t instanceof fabric__namespace.ActiveSelection || isNativeGroup) {
13597
13598
  const isRotated = !!t.__pixldocsMixedRotation || Math.abs(((t.angle ?? 0) % 360 + 360) % 360) > 0.5;
13598
13599
  if (isRotated) {
13599
- const corner2 = (_a2 = e.transform) == null ? void 0 : _a2.corner;
13600
+ const corner2 = (_b2 = e.transform) == null ? void 0 : _b2.corner;
13600
13601
  if (corner2 === "ml" || corner2 === "mr") {
13601
13602
  t.scaleY = t.scaleX;
13602
13603
  } else if (corner2 === "mt" || corner2 === "mb") {
@@ -13769,7 +13770,7 @@ const PageCanvas = react.forwardRef(
13769
13770
  time: Math.round(performance.now()),
13770
13771
  corner,
13771
13772
  groupSelectionId: obj.__pixldocsGroupSelection,
13772
- currentTransformAction: (_b2 = fabricCanvas._currentTransform) == null ? void 0 : _b2.action,
13773
+ currentTransformAction: (_c = fabricCanvas._currentTransform) == null ? void 0 : _c.action,
13773
13774
  selection: summarizeFabricObjectForResizeDebug(obj),
13774
13775
  textChildren: obj.getObjects().filter((child) => child instanceof fabric__namespace.Textbox).map((child) => summarizeFabricObjectForResizeDebug(child))
13775
13776
  };
@@ -13780,13 +13781,13 @@ const PageCanvas = react.forwardRef(
13780
13781
  const isXSide = corner === "ml" || corner === "mr";
13781
13782
  const sAxis = isXSide ? Math.abs(obj.scaleX ?? 1) : Math.abs(obj.scaleY ?? 1);
13782
13783
  if (sAxis > 1e-3) {
13783
- if (isXSide && ((_c = groupShiftReflowSnapshotRef.current) == null ? void 0 : _c.selection) !== obj) {
13784
+ if (isXSide && ((_d = groupShiftReflowSnapshotRef.current) == null ? void 0 : _d.selection) !== obj) {
13784
13785
  groupShiftReflowSnapshotRef.current = null;
13785
13786
  const logicalGroupId = obj.__pixldocsGroupSelection;
13786
13787
  if (logicalGroupId) {
13787
13788
  try {
13788
13789
  const state = useEditorStore.getState();
13789
- const pageChildren2 = ((_d = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _d.children) ?? [];
13790
+ const pageChildren2 = ((_e = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
13790
13791
  const groupNode = findNodeById(pageChildren2, logicalGroupId);
13791
13792
  if (groupNode && isGroup(groupNode) && !isStackLayoutMode(groupNode.layoutMode)) {
13792
13793
  const entries = obj.getObjects().map((c) => ({
@@ -13816,7 +13817,7 @@ const PageCanvas = react.forwardRef(
13816
13817
  const asRect0 = obj.getBoundingRect();
13817
13818
  let didReflowTextChild = false;
13818
13819
  for (const child of obj.getObjects()) {
13819
- if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_e = child._ct) == null ? void 0 : _e.isCropGroup))) {
13820
+ if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_f = child._ct) == null ? void 0 : _f.isCropGroup))) {
13820
13821
  const ct = child.__cropData;
13821
13822
  if (!ct) continue;
13822
13823
  if (isXSide) {
@@ -13921,7 +13922,7 @@ const PageCanvas = react.forwardRef(
13921
13922
  didReflowTextChild = true;
13922
13923
  }
13923
13924
  }
13924
- if (isXSide && ((_f = groupShiftReflowSnapshotRef.current) == null ? void 0 : _f.selection) === obj) {
13925
+ if (isXSide && ((_g = groupShiftReflowSnapshotRef.current) == null ? void 0 : _g.selection) === obj) {
13925
13926
  const snap = groupShiftReflowSnapshotRef.current;
13926
13927
  const anchorEntry = snap.children[0];
13927
13928
  const anchorTopLive = anchorEntry.obj.top ?? 0;
@@ -14077,7 +14078,7 @@ const PageCanvas = react.forwardRef(
14077
14078
  setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
14078
14079
  if (drilledGroupIdRef.current) {
14079
14080
  try {
14080
- (_g = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _g.call(fabricCanvas);
14081
+ (_h = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _h.call(fabricCanvas);
14081
14082
  } catch {
14082
14083
  }
14083
14084
  }
@@ -24307,9 +24308,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24307
24308
  }
24308
24309
  return svgString;
24309
24310
  }
24310
- const resolvedPackageVersion = "0.5.317";
24311
+ const resolvedPackageVersion = "0.5.318";
24311
24312
  const PACKAGE_VERSION = resolvedPackageVersion;
24312
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.317";
24313
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.318";
24313
24314
  const roundParityValue = (value) => {
24314
24315
  if (typeof value !== "number") return value;
24315
24316
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25123,7 +25124,7 @@ class PixldocsRenderer {
25123
25124
  await this.waitForCanvasScene(container, cloned, i);
25124
25125
  }
25125
25126
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25126
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-Cbrzzq6K.cjs"));
25127
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DM_wkrZm.cjs"));
25127
25128
  const prepared = preparePagesForExport(
25128
25129
  cloned.pages,
25129
25130
  canvasWidth,
@@ -27443,7 +27444,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27443
27444
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27444
27445
  sanitizeSvgTreeForPdf(svgToDraw);
27445
27446
  try {
27446
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-Cbrzzq6K.cjs"));
27447
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DM_wkrZm.cjs"));
27447
27448
  try {
27448
27449
  await logTextMeasurementDiagnostic(svgToDraw);
27449
27450
  } catch {
@@ -27840,4 +27841,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27840
27841
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27841
27842
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27842
27843
  exports.warmTemplateFromForm = warmTemplateFromForm;
27843
- //# sourceMappingURL=index-Bx4Y_HmX.cjs.map
27844
+ //# sourceMappingURL=index-CjYAXB7l.cjs.map