@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.cjs CHANGED
@@ -6247,8 +6247,7 @@ var ThreeDPlugin = class {
6247
6247
  scrollWrapper.style.width = "max-content";
6248
6248
  scrollWrapper.style.height = "max-content";
6249
6249
  scrollWrapper.style.display = "flex";
6250
- scrollWrapper.style.flexDirection = "column";
6251
- scrollWrapper.style.alignItems = "center";
6250
+ scrollWrapper.style.alignItems = "flex-start";
6252
6251
  scrollWrapper.style.justifyContent = "flex-start";
6253
6252
  scrollWrapper.style.boxSizing = "border-box";
6254
6253
  const sizer = document.createElement("div");
@@ -6258,7 +6257,7 @@ var ThreeDPlugin = class {
6258
6257
  sizer.style.display = "flex";
6259
6258
  sizer.style.justifyContent = "center";
6260
6259
  sizer.style.alignItems = "center";
6261
- sizer.style.margin = "auto 0";
6260
+ sizer.style.margin = "auto";
6262
6261
  const scene = new THREE__namespace.Scene();
6263
6262
  scene.background = new THREE__namespace.Color(1973796);
6264
6263
  const camera = new THREE__namespace.PerspectiveCamera(45, baseW / baseH, 0.1, 2e3);
@@ -6346,7 +6345,9 @@ var ThreeDPlugin = class {
6346
6345
  const boxH = Math.round(baseH * currentZoom);
6347
6346
  sizer.style.width = `${boxW}px`;
6348
6347
  sizer.style.height = `${boxH}px`;
6349
- sizer.style.margin = boxH < container.clientHeight ? "auto 0" : "0";
6348
+ const marginV = boxH < container.clientHeight ? "auto" : "0";
6349
+ const marginH = boxW < container.clientWidth ? "auto" : "0";
6350
+ sizer.style.margin = `${marginV} ${marginH}`;
6350
6351
  renderer.domElement.style.width = `${boxW}px`;
6351
6352
  renderer.domElement.style.height = `${boxH}px`;
6352
6353
  renderer.domElement.style.maxWidth = "none";
@@ -6399,6 +6400,12 @@ var ThreeDPlugin = class {
6399
6400
  }
6400
6401
  applyZoom();
6401
6402
  },
6403
+ getZoom: () => currentZoom,
6404
+ setZoom: (level) => {
6405
+ isUserZoomed = level !== 1;
6406
+ currentZoom = Math.max(0.2, Math.min(5, level));
6407
+ applyZoom();
6408
+ },
6402
6409
  fitToPage: () => {
6403
6410
  isUserZoomed = false;
6404
6411
  currentZoom = 1;