@pixldocs/canvas-renderer 0.5.463 → 0.5.464

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.
@@ -17234,7 +17234,7 @@ const PageCanvas = forwardRef(
17234
17234
  visibilityUpdateInProgressRef.current = false;
17235
17235
  }
17236
17236
  doSyncRef.current = () => {
17237
- var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k;
17237
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
17238
17238
  const shouldSkipUpdates2 = syncLockedRef.current || editLockRef.current;
17239
17239
  const state = useEditorStore.getState();
17240
17240
  const elementsToSync = elements;
@@ -17613,6 +17613,15 @@ const PageCanvas = forwardRef(
17613
17613
  existingObj.clipPath = newClip;
17614
17614
  }
17615
17615
  }
17616
+ const elFit = element.imageFit ?? ((_h = element.style) == null ? void 0 : _h.imageFit);
17617
+ if (elFit === "contain") {
17618
+ ct.fit = "contain";
17619
+ ct.alignH = element.imageAlignH ?? "center";
17620
+ ct.alignV = element.imageAlignV ?? "middle";
17621
+ ct.containScale = Math.max(1, Math.min(3, Number(element.containScale ?? 1)));
17622
+ } else if (elFit) {
17623
+ ct.fit = elFit;
17624
+ }
17616
17625
  updateCoverLayout(existingObj);
17617
17626
  applyEdgeFadeFrameClipPath(existingObj, element, ct.frameW, ct.frameH, ct.shape || "rect", ct.rx || 0);
17618
17627
  if (allowEditing) {
@@ -17711,6 +17720,21 @@ const PageCanvas = forwardRef(
17711
17720
  flipY: element.flipY ?? false,
17712
17721
  opacity: isHidden ? 0 : element.opacity ?? 1
17713
17722
  });
17723
+ try {
17724
+ const ctSync = existingObj.__cropData;
17725
+ if (ctSync) {
17726
+ const elFitSync = element.imageFit ?? ((_i = element.style) == null ? void 0 : _i.imageFit);
17727
+ if (elFitSync === "contain") {
17728
+ ctSync.fit = "contain";
17729
+ ctSync.alignH = element.imageAlignH ?? "center";
17730
+ ctSync.alignV = element.imageAlignV ?? "middle";
17731
+ ctSync.containScale = Math.max(1, Math.min(3, Number(element.containScale ?? 1)));
17732
+ updateCoverLayout(existingObj);
17733
+ existingObj.dirty = true;
17734
+ }
17735
+ }
17736
+ } catch {
17737
+ }
17714
17738
  existingObj.setCoords();
17715
17739
  fc.requestRenderAll();
17716
17740
  if (wasJustModified) justModifiedIdsRef.current.delete(element.id);
@@ -17930,7 +17954,7 @@ const PageCanvas = forwardRef(
17930
17954
  fc.add(placeholder);
17931
17955
  fc.bringObjectToFront(placeholder);
17932
17956
  const activeObj = fc.getActiveObject();
17933
- if (activeObj && (((_h = activeObj._ct) == null ? void 0 : _h.isCropGroup) || activeObj.__cropGroup)) {
17957
+ if (activeObj && (((_j = activeObj._ct) == null ? void 0 : _j.isCropGroup) || activeObj.__cropGroup)) {
17934
17958
  fc.setActiveObject(activeObj);
17935
17959
  }
17936
17960
  placeholder.dirty = true;
@@ -17970,7 +17994,7 @@ const PageCanvas = forwardRef(
17970
17994
  fc.add(obj);
17971
17995
  fc.bringObjectToFront(obj);
17972
17996
  const activeObj = fc.getActiveObject();
17973
- if (activeObj && (((_i = activeObj._ct) == null ? void 0 : _i.isCropGroup) || activeObj.__cropGroup)) {
17997
+ if (activeObj && (((_k = activeObj._ct) == null ? void 0 : _k.isCropGroup) || activeObj.__cropGroup)) {
17974
17998
  fc.setActiveObject(activeObj);
17975
17999
  }
17976
18000
  obj.dirty = true;
@@ -18003,7 +18027,7 @@ const PageCanvas = forwardRef(
18003
18027
  isRebuildingRef.current = false;
18004
18028
  fc.requestRenderAll();
18005
18029
  if (activeBeforeSync && fc.getObjects().includes(activeBeforeSync)) {
18006
- const isCropGroup2 = ((_j = activeBeforeSync._ct) == null ? void 0 : _j.isCropGroup) || activeBeforeSync.__cropGroup;
18030
+ const isCropGroup2 = ((_l = activeBeforeSync._ct) == null ? void 0 : _l.isCropGroup) || activeBeforeSync.__cropGroup;
18007
18031
  if (isCropGroup2) {
18008
18032
  fc.setActiveObject(activeBeforeSync);
18009
18033
  fc.requestRenderAll();
@@ -18090,7 +18114,7 @@ const PageCanvas = forwardRef(
18090
18114
  }
18091
18115
  if (fc.__activeEditingGroupId) {
18092
18116
  try {
18093
- (_k = fc.__updateDrilledGroupOutline) == null ? void 0 : _k.call(fc);
18117
+ (_m = fc.__updateDrilledGroupOutline) == null ? void 0 : _m.call(fc);
18094
18118
  } catch {
18095
18119
  }
18096
18120
  }
@@ -26255,9 +26279,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
26255
26279
  }
26256
26280
  return svgString;
26257
26281
  }
26258
- const resolvedPackageVersion = "0.5.463";
26282
+ const resolvedPackageVersion = "0.5.464";
26259
26283
  const PACKAGE_VERSION = resolvedPackageVersion;
26260
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.463";
26284
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.464";
26261
26285
  const roundParityValue = (value) => {
26262
26286
  if (typeof value !== "number") return value;
26263
26287
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -27071,7 +27095,7 @@ class PixldocsRenderer {
27071
27095
  await this.waitForCanvasScene(container, cloned, i);
27072
27096
  }
27073
27097
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
27074
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BlCi6g1y.js");
27098
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-pt3O47hm.js");
27075
27099
  const prepared = preparePagesForExport(
27076
27100
  cloned.pages,
27077
27101
  canvasWidth,
@@ -29391,7 +29415,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
29391
29415
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
29392
29416
  sanitizeSvgTreeForPdf(svgToDraw);
29393
29417
  try {
29394
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BlCi6g1y.js");
29418
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-pt3O47hm.js");
29395
29419
  try {
29396
29420
  await logTextMeasurementDiagnostic(svgToDraw);
29397
29421
  } catch {
@@ -29708,4 +29732,4 @@ export {
29708
29732
  buildTeaserBlurFlatKeys as y,
29709
29733
  collectFontDescriptorsFromConfig as z
29710
29734
  };
29711
- //# sourceMappingURL=index-CJ3vY_6d.js.map
29735
+ //# sourceMappingURL=index-TvXdi5B9.js.map