@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.mjs CHANGED
@@ -519,12 +519,14 @@ function getDefaultPlacementSize(kind, aspectRatio = DEFAULT_SIGNATURE_ASPECT_RA
519
519
  clampAspectRatio(aspectRatio)
520
520
  );
521
521
  const effectiveSurfaceAspectRatio = clamp(surfaceAspectRatio, 0.45, 2.8);
522
+ const isScrollableDocumentSurface = kind === "document" && surfaceAspectRatio < 0.6;
522
523
  const heightTarget = kind === "sheet" ? 0.11 : kind === "slide" ? 0.135 : kind === "image" ? 0.14 : 0.115;
523
524
  const widthMin = kind === "sheet" ? 0.2 : kind === "slide" ? 0.22 : kind === "image" ? 0.24 : 0.22;
524
- const widthMax = kind === "sheet" ? 0.38 : kind === "slide" ? 0.44 : kind === "image" ? 0.48 : 0.4;
525
+ const widthMax = kind === "sheet" ? 0.38 : kind === "slide" ? 0.44 : kind === "image" ? 0.48 : isScrollableDocumentSurface ? 0.3 : 0.4;
525
526
  const heightMax = kind === "sheet" ? 0.18 : kind === "slide" ? 0.2 : kind === "image" ? 0.22 : 0.19;
527
+ const widthTarget = isScrollableDocumentSurface ? 0.24 : null;
526
528
  const width = clamp(
527
- heightTarget * effectiveAspectRatio / effectiveSurfaceAspectRatio,
529
+ widthTarget ?? heightTarget * effectiveAspectRatio / effectiveSurfaceAspectRatio,
528
530
  widthMin,
529
531
  widthMax
530
532
  );