@files-preview-app/preview-file 1.3.11 → 1.3.12

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/vue.d.cts CHANGED
@@ -34,10 +34,10 @@ declare const FilePreview: vue.DefineComponent<vue.ExtractPropTypes<{
34
34
  onLoading?: ((...args: any[]) => any) | undefined;
35
35
  onLoaded?: ((...args: any[]) => any) | undefined;
36
36
  onError?: ((...args: any[]) => any) | undefined;
37
- "onPage-change"?: ((...args: any[]) => any) | undefined;
38
- "onZoom-change"?: ((...args: any[]) => any) | undefined;
39
37
  onRotate?: ((...args: any[]) => any) | undefined;
40
38
  onDestroy?: ((...args: any[]) => any) | undefined;
39
+ "onPage-change"?: ((...args: any[]) => any) | undefined;
40
+ "onZoom-change"?: ((...args: any[]) => any) | undefined;
41
41
  }>, {
42
42
  plugins: PreviewPlugin[];
43
43
  options: PreviewViewerOptions;
package/dist/vue.d.ts CHANGED
@@ -34,10 +34,10 @@ declare const FilePreview: vue.DefineComponent<vue.ExtractPropTypes<{
34
34
  onLoading?: ((...args: any[]) => any) | undefined;
35
35
  onLoaded?: ((...args: any[]) => any) | undefined;
36
36
  onError?: ((...args: any[]) => any) | undefined;
37
- "onPage-change"?: ((...args: any[]) => any) | undefined;
38
- "onZoom-change"?: ((...args: any[]) => any) | undefined;
39
37
  onRotate?: ((...args: any[]) => any) | undefined;
40
38
  onDestroy?: ((...args: any[]) => any) | undefined;
39
+ "onPage-change"?: ((...args: any[]) => any) | undefined;
40
+ "onZoom-change"?: ((...args: any[]) => any) | undefined;
41
41
  }>, {
42
42
  plugins: PreviewPlugin[];
43
43
  options: PreviewViewerOptions;
package/dist/vue.js CHANGED
@@ -6034,6 +6034,16 @@ var ThreeDPlugin = class {
6034
6034
  type: "button",
6035
6035
  group: "actions",
6036
6036
  execute: () => instance.download?.()
6037
+ },
6038
+ {
6039
+ id: "open-window",
6040
+ icon: "open-window",
6041
+ label: "Open in Separate Full Window",
6042
+ type: "button",
6043
+ group: "actions",
6044
+ execute: () => {
6045
+ instance.openInSeparateWindow?.();
6046
+ }
6037
6047
  }
6038
6048
  ];
6039
6049
  }
@@ -6104,12 +6114,21 @@ var ThreeDPlugin = class {
6104
6114
  });
6105
6115
  meshGroup.add(obj);
6106
6116
  }
6117
+ const initialBox = new THREE.Box3().setFromObject(meshGroup);
6118
+ const center = initialBox.getCenter(new THREE.Vector3());
6119
+ meshGroup.position.sub(center);
6107
6120
  scene.add(meshGroup);
6108
6121
  const box = new THREE.Box3().setFromObject(meshGroup);
6109
- const sphere = box.getBoundingSphere(new THREE.Sphere());
6110
- const radius = Math.max(sphere.radius, 10);
6122
+ const size = box.getSize(new THREE.Vector3());
6123
+ const maxDim = Math.max(size.x, size.y, size.z) || 10;
6124
+ grid.position.y = -size.y / 2;
6125
+ const gridScale = Math.max(0.1, maxDim / 50);
6126
+ grid.scale.set(gridScale, 1, gridScale);
6127
+ const fovRad = camera.fov * (Math.PI / 180);
6128
+ let cameraDistance = maxDim / 2 / Math.tan(fovRad / 2);
6129
+ cameraDistance = Math.max(cameraDistance * 1.5, 2);
6111
6130
  const fitCamera = () => {
6112
- camera.position.set(radius * 1.5, radius * 1.2, radius * 2);
6131
+ camera.position.set(cameraDistance * 0.8, cameraDistance * 0.6, cameraDistance);
6113
6132
  camera.lookAt(0, 0, 0);
6114
6133
  controls.target.set(0, 0, 0);
6115
6134
  controls.update();
@@ -6155,6 +6174,7 @@ var ThreeDPlugin = class {
6155
6174
  controls.update();
6156
6175
  },
6157
6176
  fitToPage: fitCamera,
6177
+ fitToWidth: fitCamera,
6158
6178
  resetZoom: fitCamera,
6159
6179
  rotateCW: () => {
6160
6180
  isWireframe = !isWireframe;