@files-preview-app/preview-file 1.3.19 → 1.3.20

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
@@ -6328,8 +6328,7 @@ var ThreeDPlugin = class {
6328
6328
  scrollWrapper.style.width = "max-content";
6329
6329
  scrollWrapper.style.height = "max-content";
6330
6330
  scrollWrapper.style.display = "flex";
6331
- scrollWrapper.style.flexDirection = "column";
6332
- scrollWrapper.style.alignItems = "center";
6331
+ scrollWrapper.style.alignItems = "flex-start";
6333
6332
  scrollWrapper.style.justifyContent = "flex-start";
6334
6333
  scrollWrapper.style.boxSizing = "border-box";
6335
6334
  const sizer = document.createElement("div");
@@ -6339,7 +6338,7 @@ var ThreeDPlugin = class {
6339
6338
  sizer.style.display = "flex";
6340
6339
  sizer.style.justifyContent = "center";
6341
6340
  sizer.style.alignItems = "center";
6342
- sizer.style.margin = "auto 0";
6341
+ sizer.style.margin = "auto";
6343
6342
  const scene = new THREE__namespace.Scene();
6344
6343
  scene.background = new THREE__namespace.Color(1973796);
6345
6344
  const camera = new THREE__namespace.PerspectiveCamera(45, baseW / baseH, 0.1, 2e3);
@@ -6427,7 +6426,9 @@ var ThreeDPlugin = class {
6427
6426
  const boxH = Math.round(baseH * currentZoom);
6428
6427
  sizer.style.width = `${boxW}px`;
6429
6428
  sizer.style.height = `${boxH}px`;
6430
- sizer.style.margin = boxH < container.clientHeight ? "auto 0" : "0";
6429
+ const marginV = boxH < container.clientHeight ? "auto" : "0";
6430
+ const marginH = boxW < container.clientWidth ? "auto" : "0";
6431
+ sizer.style.margin = `${marginV} ${marginH}`;
6431
6432
  renderer.domElement.style.width = `${boxW}px`;
6432
6433
  renderer.domElement.style.height = `${boxH}px`;
6433
6434
  renderer.domElement.style.maxWidth = "none";
@@ -6480,6 +6481,12 @@ var ThreeDPlugin = class {
6480
6481
  }
6481
6482
  applyZoom();
6482
6483
  },
6484
+ getZoom: () => currentZoom,
6485
+ setZoom: (level) => {
6486
+ isUserZoomed = level !== 1;
6487
+ currentZoom = Math.max(0.2, Math.min(5, level));
6488
+ applyZoom();
6489
+ },
6483
6490
  fitToPage: () => {
6484
6491
  isUserZoomed = false;
6485
6492
  currentZoom = 1;