@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/react.js CHANGED
@@ -6214,8 +6214,7 @@ var ThreeDPlugin = class {
6214
6214
  scrollWrapper.style.width = "max-content";
6215
6215
  scrollWrapper.style.height = "max-content";
6216
6216
  scrollWrapper.style.display = "flex";
6217
- scrollWrapper.style.flexDirection = "column";
6218
- scrollWrapper.style.alignItems = "center";
6217
+ scrollWrapper.style.alignItems = "flex-start";
6219
6218
  scrollWrapper.style.justifyContent = "flex-start";
6220
6219
  scrollWrapper.style.boxSizing = "border-box";
6221
6220
  const sizer = document.createElement("div");
@@ -6225,7 +6224,7 @@ var ThreeDPlugin = class {
6225
6224
  sizer.style.display = "flex";
6226
6225
  sizer.style.justifyContent = "center";
6227
6226
  sizer.style.alignItems = "center";
6228
- sizer.style.margin = "auto 0";
6227
+ sizer.style.margin = "auto";
6229
6228
  const scene = new THREE.Scene();
6230
6229
  scene.background = new THREE.Color(1973796);
6231
6230
  const camera = new THREE.PerspectiveCamera(45, baseW / baseH, 0.1, 2e3);
@@ -6313,7 +6312,9 @@ var ThreeDPlugin = class {
6313
6312
  const boxH = Math.round(baseH * currentZoom);
6314
6313
  sizer.style.width = `${boxW}px`;
6315
6314
  sizer.style.height = `${boxH}px`;
6316
- sizer.style.margin = boxH < container.clientHeight ? "auto 0" : "0";
6315
+ const marginV = boxH < container.clientHeight ? "auto" : "0";
6316
+ const marginH = boxW < container.clientWidth ? "auto" : "0";
6317
+ sizer.style.margin = `${marginV} ${marginH}`;
6317
6318
  renderer.domElement.style.width = `${boxW}px`;
6318
6319
  renderer.domElement.style.height = `${boxH}px`;
6319
6320
  renderer.domElement.style.maxWidth = "none";
@@ -6366,6 +6367,12 @@ var ThreeDPlugin = class {
6366
6367
  }
6367
6368
  applyZoom();
6368
6369
  },
6370
+ getZoom: () => currentZoom,
6371
+ setZoom: (level) => {
6372
+ isUserZoomed = level !== 1;
6373
+ currentZoom = Math.max(0.2, Math.min(5, level));
6374
+ applyZoom();
6375
+ },
6369
6376
  fitToPage: () => {
6370
6377
  isUserZoomed = false;
6371
6378
  currentZoom = 1;