@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.js CHANGED
@@ -6297,8 +6297,7 @@ var ThreeDPlugin = class {
6297
6297
  scrollWrapper.style.width = "max-content";
6298
6298
  scrollWrapper.style.height = "max-content";
6299
6299
  scrollWrapper.style.display = "flex";
6300
- scrollWrapper.style.flexDirection = "column";
6301
- scrollWrapper.style.alignItems = "center";
6300
+ scrollWrapper.style.alignItems = "flex-start";
6302
6301
  scrollWrapper.style.justifyContent = "flex-start";
6303
6302
  scrollWrapper.style.boxSizing = "border-box";
6304
6303
  const sizer = document.createElement("div");
@@ -6308,7 +6307,7 @@ var ThreeDPlugin = class {
6308
6307
  sizer.style.display = "flex";
6309
6308
  sizer.style.justifyContent = "center";
6310
6309
  sizer.style.alignItems = "center";
6311
- sizer.style.margin = "auto 0";
6310
+ sizer.style.margin = "auto";
6312
6311
  const scene = new THREE.Scene();
6313
6312
  scene.background = new THREE.Color(1973796);
6314
6313
  const camera = new THREE.PerspectiveCamera(45, baseW / baseH, 0.1, 2e3);
@@ -6396,7 +6395,9 @@ var ThreeDPlugin = class {
6396
6395
  const boxH = Math.round(baseH * currentZoom);
6397
6396
  sizer.style.width = `${boxW}px`;
6398
6397
  sizer.style.height = `${boxH}px`;
6399
- sizer.style.margin = boxH < container.clientHeight ? "auto 0" : "0";
6398
+ const marginV = boxH < container.clientHeight ? "auto" : "0";
6399
+ const marginH = boxW < container.clientWidth ? "auto" : "0";
6400
+ sizer.style.margin = `${marginV} ${marginH}`;
6400
6401
  renderer.domElement.style.width = `${boxW}px`;
6401
6402
  renderer.domElement.style.height = `${boxH}px`;
6402
6403
  renderer.domElement.style.maxWidth = "none";
@@ -6449,6 +6450,12 @@ var ThreeDPlugin = class {
6449
6450
  }
6450
6451
  applyZoom();
6451
6452
  },
6453
+ getZoom: () => currentZoom,
6454
+ setZoom: (level) => {
6455
+ isUserZoomed = level !== 1;
6456
+ currentZoom = Math.max(0.2, Math.min(5, level));
6457
+ applyZoom();
6458
+ },
6452
6459
  fitToPage: () => {
6453
6460
  isUserZoomed = false;
6454
6461
  currentZoom = 1;