@pixldocs/canvas-renderer 0.5.478 → 0.5.480

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.
@@ -895,7 +895,11 @@ function resolveStackGroupEffectivePositions(group, pageChildren, options) {
895
895
  const crossPadEnd = isVertical ? padRight : padBottom;
896
896
  crossContainer = maxCross + crossPad0 + crossPadEnd;
897
897
  }
898
- if (align !== "start" && crossContainer != null && kids.length > 0) {
898
+ const anyChildOverride = kids.some((c) => {
899
+ const v = c.alignSelf;
900
+ return typeof v === "string" && v !== "auto";
901
+ });
902
+ if ((align !== "start" || anyChildOverride) && crossContainer != null && kids.length > 0) {
899
903
  const crossPad0 = isVertical ? padLeft : padTop;
900
904
  const crossPadEnd = isVertical ? padRight : padBottom;
901
905
  const innerCross = Math.max(0, crossContainer - crossPad0 - crossPadEnd);
@@ -904,10 +908,13 @@ function resolveStackGroupEffectivePositions(group, pageChildren, options) {
904
908
  if (!pos) continue;
905
909
  const sz = sizes.get(child.id);
906
910
  const childCross = isVertical ? sz.width : sz.height;
911
+ const selfRaw = child.alignSelf;
912
+ const effective = selfRaw && selfRaw !== "auto" ? selfRaw : align;
913
+ if (effective === "start") continue;
907
914
  let crossPos;
908
- if (align === "stretch") {
915
+ if (effective === "stretch") {
909
916
  crossPos = crossPad0;
910
- } else if (align === "center") {
917
+ } else if (effective === "center") {
911
918
  crossPos = crossPad0 + (innerCross - childCross) / 2;
912
919
  } else {
913
920
  crossPos = crossPad0 + (innerCross - childCross);
@@ -1011,10 +1018,14 @@ function groupBoundsFromChildren(group, pageChildren, options) {
1011
1018
  if (isStack) {
1012
1019
  const padRight = group.paddingRight ?? 0;
1013
1020
  const padBottom = group.paddingBottom ?? 0;
1014
- return {
1015
- width: Math.max(1, maxX + padRight),
1016
- height: Math.max(1, maxY + padBottom)
1017
- };
1021
+ const contentW = Math.max(1, maxX + padRight);
1022
+ const contentH = Math.max(1, maxY + padBottom);
1023
+ if (group.hugContent === false) {
1024
+ const storedW = typeof group.width === "number" && group.width > 0 ? group.width : contentW;
1025
+ const storedH = typeof group.height === "number" && group.height > 0 ? group.height : contentH;
1026
+ return { width: Math.max(1, storedW), height: Math.max(1, storedH) };
1027
+ }
1028
+ return { width: contentW, height: contentH };
1018
1029
  }
1019
1030
  return {
1020
1031
  width: Math.max(1, maxX - minX),
@@ -26373,9 +26384,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
26373
26384
  }
26374
26385
  return svgString;
26375
26386
  }
26376
- const resolvedPackageVersion = "0.5.478";
26387
+ const resolvedPackageVersion = "0.5.480";
26377
26388
  const PACKAGE_VERSION = resolvedPackageVersion;
26378
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.478";
26389
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.480";
26379
26390
  const roundParityValue = (value) => {
26380
26391
  if (typeof value !== "number") return value;
26381
26392
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -27189,7 +27200,7 @@ class PixldocsRenderer {
27189
27200
  await this.waitForCanvasScene(container, cloned, i);
27190
27201
  }
27191
27202
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
27192
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-B19SgYHz.cjs"));
27203
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-8y-rUG9Q.cjs"));
27193
27204
  const prepared = preparePagesForExport(
27194
27205
  cloned.pages,
27195
27206
  canvasWidth,
@@ -29509,7 +29520,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
29509
29520
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
29510
29521
  sanitizeSvgTreeForPdf(svgToDraw);
29511
29522
  try {
29512
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-B19SgYHz.cjs"));
29523
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-8y-rUG9Q.cjs"));
29513
29524
  try {
29514
29525
  await logTextMeasurementDiagnostic(svgToDraw);
29515
29526
  } catch {
@@ -29823,4 +29834,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
29823
29834
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
29824
29835
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
29825
29836
  exports.warmTemplateFromForm = warmTemplateFromForm;
29826
- //# sourceMappingURL=index-DfgZSWwY.cjs.map
29837
+ //# sourceMappingURL=index-BvNexoyT.cjs.map