@pixldocs/canvas-renderer 0.5.293 → 0.5.295

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.
@@ -10996,6 +10996,7 @@ const scaleUpdateNumber = (updates, source, key, factor) => {
10996
10996
  if (Number.isFinite(value)) updates[key] = value * factor;
10997
10997
  };
10998
10998
  const GROUP_TEXT_RESIZE_DEBUG_PREFIX = "[Pixldocs][group-text-corner-resize]";
10999
+ const GROUP_TEXT_RESIZE_DEBUG_MAX_ENTRIES = 200;
10999
11000
  const isCornerResizeHandle = (handle) => handle === "tl" || handle === "tr" || handle === "bl" || handle === "br";
11000
11001
  const summarizeFabricObjectForResizeDebug = (obj) => {
11001
11002
  var _a2;
@@ -11028,9 +11029,32 @@ const summarizeFabricObjectForResizeDebug = (obj) => {
11028
11029
  const logGroupTextResizeDebug = (phase, payload) => {
11029
11030
  if (typeof console === "undefined") return;
11030
11031
  try {
11031
- console.groupCollapsed(`${GROUP_TEXT_RESIZE_DEBUG_PREFIX} ${phase}`);
11032
- console.log(payload);
11033
- console.groupEnd();
11032
+ const seen = /* @__PURE__ */ new WeakSet();
11033
+ const normalize = (value) => {
11034
+ if (value == null) return value;
11035
+ const valueType = typeof value;
11036
+ if (valueType === "number") return Number.isFinite(value) ? Math.round(value * 1e3) / 1e3 : String(value);
11037
+ if (valueType === "string" || valueType === "boolean") return value;
11038
+ if (valueType === "function") return `[Function ${value.name || "anonymous"}]`;
11039
+ if (Array.isArray(value)) return value.map((entry) => normalize(entry));
11040
+ if (valueType === "object") {
11041
+ if (seen.has(value)) return "[Circular]";
11042
+ seen.add(value);
11043
+ if (value instanceof fabric.FabricObject) return normalize(summarizeFabricObjectForResizeDebug(value));
11044
+ const output = {};
11045
+ Object.entries(value).forEach(([key, entry]) => {
11046
+ output[key] = normalize(entry);
11047
+ });
11048
+ return output;
11049
+ }
11050
+ return String(value);
11051
+ };
11052
+ const normalizedPayload = normalize(payload);
11053
+ const line = `${GROUP_TEXT_RESIZE_DEBUG_PREFIX} ${phase} ${JSON.stringify(normalizedPayload)}`;
11054
+ const debugWindow = window;
11055
+ debugWindow.__pixldocsGroupTextResizeLogs = Array.isArray(debugWindow.__pixldocsGroupTextResizeLogs) ? debugWindow.__pixldocsGroupTextResizeLogs.slice(-GROUP_TEXT_RESIZE_DEBUG_MAX_ENTRIES + 1) : [];
11056
+ debugWindow.__pixldocsGroupTextResizeLogs.push(line);
11057
+ console.log(line);
11034
11058
  } catch {
11035
11059
  console.log(GROUP_TEXT_RESIZE_DEBUG_PREFIX, phase, payload);
11036
11060
  }
@@ -14560,6 +14584,10 @@ const PageCanvas = forwardRef(
14560
14584
  obj.initDimensions();
14561
14585
  obj.setPositionByOrigin(preBakeCenter, "center", "center");
14562
14586
  obj.objectCaching = prevObjCaching;
14587
+ if (sx > 0 && sy > 0) {
14588
+ obj.set({ scaleX: 1 / sx, scaleY: 1 / sy });
14589
+ obj.setPositionByOrigin(preBakeCenter, "center", "center");
14590
+ }
14563
14591
  obj.dirty = true;
14564
14592
  if (activeObj) activeObj.dirty = true;
14565
14593
  finalWidth = bakedWidth;
@@ -23801,9 +23829,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23801
23829
  }
23802
23830
  return svgString;
23803
23831
  }
23804
- const resolvedPackageVersion = "0.5.293";
23832
+ const resolvedPackageVersion = "0.5.295";
23805
23833
  const PACKAGE_VERSION = resolvedPackageVersion;
23806
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.293";
23834
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.295";
23807
23835
  const roundParityValue = (value) => {
23808
23836
  if (typeof value !== "number") return value;
23809
23837
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24617,7 +24645,7 @@ class PixldocsRenderer {
24617
24645
  await this.waitForCanvasScene(container, cloned, i);
24618
24646
  }
24619
24647
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24620
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BtxsxKxp.js");
24648
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BLXRwisV.js");
24621
24649
  const prepared = preparePagesForExport(
24622
24650
  cloned.pages,
24623
24651
  canvasWidth,
@@ -26937,7 +26965,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
26937
26965
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
26938
26966
  sanitizeSvgTreeForPdf(svgToDraw);
26939
26967
  try {
26940
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BtxsxKxp.js");
26968
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BLXRwisV.js");
26941
26969
  try {
26942
26970
  await logTextMeasurementDiagnostic(svgToDraw);
26943
26971
  } catch {
@@ -27337,4 +27365,4 @@ export {
27337
27365
  buildTeaserBlurFlatKeys as y,
27338
27366
  collectFontDescriptorsFromConfig as z
27339
27367
  };
27340
- //# sourceMappingURL=index-CRNg3m2o.js.map
27368
+ //# sourceMappingURL=index-DmJeO8GF.js.map