@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.
@@ -17252,7 +17252,7 @@ const PageCanvas = react.forwardRef(
17252
17252
  visibilityUpdateInProgressRef.current = false;
17253
17253
  }
17254
17254
  doSyncRef.current = () => {
17255
- var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k;
17255
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
17256
17256
  const shouldSkipUpdates2 = syncLockedRef.current || editLockRef.current;
17257
17257
  const state = useEditorStore.getState();
17258
17258
  const elementsToSync = elements;
@@ -17631,6 +17631,15 @@ const PageCanvas = react.forwardRef(
17631
17631
  existingObj.clipPath = newClip;
17632
17632
  }
17633
17633
  }
17634
+ const elFit = element.imageFit ?? ((_h = element.style) == null ? void 0 : _h.imageFit);
17635
+ if (elFit === "contain") {
17636
+ ct.fit = "contain";
17637
+ ct.alignH = element.imageAlignH ?? "center";
17638
+ ct.alignV = element.imageAlignV ?? "middle";
17639
+ ct.containScale = Math.max(1, Math.min(3, Number(element.containScale ?? 1)));
17640
+ } else if (elFit) {
17641
+ ct.fit = elFit;
17642
+ }
17634
17643
  updateCoverLayout(existingObj);
17635
17644
  applyEdgeFadeFrameClipPath(existingObj, element, ct.frameW, ct.frameH, ct.shape || "rect", ct.rx || 0);
17636
17645
  if (allowEditing) {
@@ -17729,6 +17738,21 @@ const PageCanvas = react.forwardRef(
17729
17738
  flipY: element.flipY ?? false,
17730
17739
  opacity: isHidden ? 0 : element.opacity ?? 1
17731
17740
  });
17741
+ try {
17742
+ const ctSync = existingObj.__cropData;
17743
+ if (ctSync) {
17744
+ const elFitSync = element.imageFit ?? ((_i = element.style) == null ? void 0 : _i.imageFit);
17745
+ if (elFitSync === "contain") {
17746
+ ctSync.fit = "contain";
17747
+ ctSync.alignH = element.imageAlignH ?? "center";
17748
+ ctSync.alignV = element.imageAlignV ?? "middle";
17749
+ ctSync.containScale = Math.max(1, Math.min(3, Number(element.containScale ?? 1)));
17750
+ updateCoverLayout(existingObj);
17751
+ existingObj.dirty = true;
17752
+ }
17753
+ }
17754
+ } catch {
17755
+ }
17732
17756
  existingObj.setCoords();
17733
17757
  fc.requestRenderAll();
17734
17758
  if (wasJustModified) justModifiedIdsRef.current.delete(element.id);
@@ -17948,7 +17972,7 @@ const PageCanvas = react.forwardRef(
17948
17972
  fc.add(placeholder);
17949
17973
  fc.bringObjectToFront(placeholder);
17950
17974
  const activeObj = fc.getActiveObject();
17951
- if (activeObj && (((_h = activeObj._ct) == null ? void 0 : _h.isCropGroup) || activeObj.__cropGroup)) {
17975
+ if (activeObj && (((_j = activeObj._ct) == null ? void 0 : _j.isCropGroup) || activeObj.__cropGroup)) {
17952
17976
  fc.setActiveObject(activeObj);
17953
17977
  }
17954
17978
  placeholder.dirty = true;
@@ -17988,7 +18012,7 @@ const PageCanvas = react.forwardRef(
17988
18012
  fc.add(obj);
17989
18013
  fc.bringObjectToFront(obj);
17990
18014
  const activeObj = fc.getActiveObject();
17991
- if (activeObj && (((_i = activeObj._ct) == null ? void 0 : _i.isCropGroup) || activeObj.__cropGroup)) {
18015
+ if (activeObj && (((_k = activeObj._ct) == null ? void 0 : _k.isCropGroup) || activeObj.__cropGroup)) {
17992
18016
  fc.setActiveObject(activeObj);
17993
18017
  }
17994
18018
  obj.dirty = true;
@@ -18021,7 +18045,7 @@ const PageCanvas = react.forwardRef(
18021
18045
  isRebuildingRef.current = false;
18022
18046
  fc.requestRenderAll();
18023
18047
  if (activeBeforeSync && fc.getObjects().includes(activeBeforeSync)) {
18024
- const isCropGroup2 = ((_j = activeBeforeSync._ct) == null ? void 0 : _j.isCropGroup) || activeBeforeSync.__cropGroup;
18048
+ const isCropGroup2 = ((_l = activeBeforeSync._ct) == null ? void 0 : _l.isCropGroup) || activeBeforeSync.__cropGroup;
18025
18049
  if (isCropGroup2) {
18026
18050
  fc.setActiveObject(activeBeforeSync);
18027
18051
  fc.requestRenderAll();
@@ -18108,7 +18132,7 @@ const PageCanvas = react.forwardRef(
18108
18132
  }
18109
18133
  if (fc.__activeEditingGroupId) {
18110
18134
  try {
18111
- (_k = fc.__updateDrilledGroupOutline) == null ? void 0 : _k.call(fc);
18135
+ (_m = fc.__updateDrilledGroupOutline) == null ? void 0 : _m.call(fc);
18112
18136
  } catch {
18113
18137
  }
18114
18138
  }
@@ -26273,9 +26297,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
26273
26297
  }
26274
26298
  return svgString;
26275
26299
  }
26276
- const resolvedPackageVersion = "0.5.463";
26300
+ const resolvedPackageVersion = "0.5.464";
26277
26301
  const PACKAGE_VERSION = resolvedPackageVersion;
26278
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.463";
26302
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.464";
26279
26303
  const roundParityValue = (value) => {
26280
26304
  if (typeof value !== "number") return value;
26281
26305
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -27089,7 +27113,7 @@ class PixldocsRenderer {
27089
27113
  await this.waitForCanvasScene(container, cloned, i);
27090
27114
  }
27091
27115
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
27092
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DFhh1h5p.cjs"));
27116
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BlaglUx4.cjs"));
27093
27117
  const prepared = preparePagesForExport(
27094
27118
  cloned.pages,
27095
27119
  canvasWidth,
@@ -29409,7 +29433,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
29409
29433
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
29410
29434
  sanitizeSvgTreeForPdf(svgToDraw);
29411
29435
  try {
29412
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DFhh1h5p.cjs"));
29436
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BlaglUx4.cjs"));
29413
29437
  try {
29414
29438
  await logTextMeasurementDiagnostic(svgToDraw);
29415
29439
  } catch {
@@ -29723,4 +29747,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
29723
29747
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
29724
29748
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
29725
29749
  exports.warmTemplateFromForm = warmTemplateFromForm;
29726
- //# sourceMappingURL=index-kf9OkhGi.cjs.map
29750
+ //# sourceMappingURL=index-BFIEinvR.cjs.map