@pixldocs/canvas-renderer 0.5.486 → 0.5.488

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.
@@ -16013,7 +16013,9 @@ const PageCanvas = forwardRef(
16013
16013
  return !!(node && isGroup(node));
16014
16014
  });
16015
16015
  const activeSelectionHadTransform = activeObj instanceof fabric.ActiveSelection && (Math.abs((activeObj.scaleX ?? 1) - 1) > 0.01 || Math.abs((activeObj.scaleY ?? 1) - 1) > 0.01 || Math.abs((activeObj.angle ?? 0) % 360) > 0.01);
16016
- if (!anyCropGroup && activeSelectionDelta && !activeSelectionHadTransform && selectedLogicalGroupIds.length > 0) {
16016
+ const activeLogicalGroupSelectionId = activeObj instanceof fabric.ActiveSelection ? activeObj.__pixldocsGroupSelection : void 0;
16017
+ const isPureLogicalGroupMoveWithCrop = !!(anyCropGroup && activeLogicalGroupSelectionId && activeSelectionDelta && !activeSelectionHadTransform);
16018
+ if ((!anyCropGroup || isPureLogicalGroupMoveWithCrop) && activeSelectionDelta && !activeSelectionHadTransform && selectedLogicalGroupIds.length > 0) {
16017
16019
  const selectedStoreIds = useEditorStore.getState().canvas.selectedIds ?? [];
16018
16020
  const groupMemberIds = /* @__PURE__ */ new Set();
16019
16021
  selectedLogicalGroupIds.forEach((gid) => {
@@ -16053,7 +16055,7 @@ const PageCanvas = forwardRef(
16053
16055
  return;
16054
16056
  }
16055
16057
  }
16056
- if (selectedElementIds.length > 0 && !anyCropGroup) {
16058
+ if (selectedElementIds.length > 0 && (!anyCropGroup || isPureLogicalGroupMoveWithCrop)) {
16057
16059
  const firstObj = activeObjects[0];
16058
16060
  const firstId = getObjectId(firstObj);
16059
16061
  const parentGroups = selectedElementIds.map((id) => findParentGroup(pageChildren2, id)).filter((g) => g !== null);
@@ -16075,7 +16077,10 @@ const PageCanvas = forwardRef(
16075
16077
  const groupAbs = getAbsoluteBounds(groupToMove, pageChildren2);
16076
16078
  let movedGroupLeft = groupAbs.left;
16077
16079
  let movedGroupTop = groupAbs.top;
16078
- if (activeObj instanceof fabric.ActiveSelection && (transformStart == null ? void 0 : transformStart.groupId) === groupToMove.id) {
16080
+ if (activeObj instanceof fabric.ActiveSelection && activeLogicalGroupSelectionId === groupToMove.id && activeSelectionDelta && !activeSelectionHadTransform) {
16081
+ movedGroupLeft = groupAbs.left + activeSelectionDelta.x;
16082
+ movedGroupTop = groupAbs.top + activeSelectionDelta.y;
16083
+ } else if (activeObj instanceof fabric.ActiveSelection && (transformStart == null ? void 0 : transformStart.groupId) === groupToMove.id) {
16079
16084
  const live = lastLiveSelectionRectRef.current;
16080
16085
  const selectionRect = live && live.selection === activeObj ? { left: live.left, top: live.top } : activeObj.getBoundingRect();
16081
16086
  movedGroupLeft = transformStart.groupLeft + (selectionRect.left - transformStart.selectionLeft);
@@ -18963,7 +18968,8 @@ const PageCanvas = forwardRef(
18963
18968
  const splitByGrapheme = overflowPolicy === "auto-shrink" ? false : element.splitByGrapheme ?? element.wordWrap === "break-word";
18964
18969
  if (overflowPolicy === "auto-shrink") {
18965
18970
  const minBoxHForShrink = Math.max(0, Number(element.minBoxHeight) || 0);
18966
- const heightBound = Math.max(rH || 0, minBoxHForShrink);
18971
+ const elementHeight = typeof element.height === "number" ? element.height : 0;
18972
+ const heightBound = Math.max(elementHeight, minBoxHForShrink);
18967
18973
  while (fontSize > 1) {
18968
18974
  const testTextbox = new fabric.Textbox(text, {
18969
18975
  width: fixedWidth,
@@ -26417,9 +26423,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
26417
26423
  }
26418
26424
  return svgString;
26419
26425
  }
26420
- const resolvedPackageVersion = "0.5.486";
26426
+ const resolvedPackageVersion = "0.5.488";
26421
26427
  const PACKAGE_VERSION = resolvedPackageVersion;
26422
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.486";
26428
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.488";
26423
26429
  const roundParityValue = (value) => {
26424
26430
  if (typeof value !== "number") return value;
26425
26431
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -27233,7 +27239,7 @@ class PixldocsRenderer {
27233
27239
  await this.waitForCanvasScene(container, cloned, i);
27234
27240
  }
27235
27241
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
27236
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DnsSdLBw.js");
27242
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-jRSKADbv.js");
27237
27243
  const prepared = preparePagesForExport(
27238
27244
  cloned.pages,
27239
27245
  canvasWidth,
@@ -29553,7 +29559,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
29553
29559
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
29554
29560
  sanitizeSvgTreeForPdf(svgToDraw);
29555
29561
  try {
29556
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DnsSdLBw.js");
29562
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-jRSKADbv.js");
29557
29563
  try {
29558
29564
  await logTextMeasurementDiagnostic(svgToDraw);
29559
29565
  } catch {
@@ -29870,4 +29876,4 @@ export {
29870
29876
  buildTeaserBlurFlatKeys as y,
29871
29877
  collectFontDescriptorsFromConfig as z
29872
29878
  };
29873
- //# sourceMappingURL=index-CahlaWb5.js.map
29879
+ //# sourceMappingURL=index-D0tFaSTn.js.map