@pixldocs/canvas-renderer 0.5.318 → 0.5.319

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