@zerohive/hive-viewer 2.0.5 → 2.0.6

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.
package/dist/index.cjs CHANGED
@@ -585,12 +585,14 @@ function getDefaultPlacementSize(kind, aspectRatio = DEFAULT_SIGNATURE_ASPECT_RA
585
585
  clampAspectRatio(aspectRatio)
586
586
  );
587
587
  const effectiveSurfaceAspectRatio = clamp(surfaceAspectRatio, 0.45, 2.8);
588
+ const isScrollableDocumentSurface = kind === "document" && surfaceAspectRatio < 0.6;
588
589
  const heightTarget = kind === "sheet" ? 0.11 : kind === "slide" ? 0.135 : kind === "image" ? 0.14 : 0.115;
589
590
  const widthMin = kind === "sheet" ? 0.2 : kind === "slide" ? 0.22 : kind === "image" ? 0.24 : 0.22;
590
- const widthMax = kind === "sheet" ? 0.38 : kind === "slide" ? 0.44 : kind === "image" ? 0.48 : 0.4;
591
+ const widthMax = kind === "sheet" ? 0.38 : kind === "slide" ? 0.44 : kind === "image" ? 0.48 : isScrollableDocumentSurface ? 0.3 : 0.4;
591
592
  const heightMax = kind === "sheet" ? 0.18 : kind === "slide" ? 0.2 : kind === "image" ? 0.22 : 0.19;
593
+ const widthTarget = isScrollableDocumentSurface ? 0.24 : null;
592
594
  const width = clamp(
593
- heightTarget * effectiveAspectRatio / effectiveSurfaceAspectRatio,
595
+ widthTarget ?? heightTarget * effectiveAspectRatio / effectiveSurfaceAspectRatio,
594
596
  widthMin,
595
597
  widthMax
596
598
  );