vim-web 0.3.44-dev.26 → 0.3.44-dev.28

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/README.md CHANGED
@@ -11,11 +11,11 @@ https://www.npmjs.com/package/vim-web
11
11
 
12
12
  ### WebGL Viewer
13
13
  - **[Small - Residence](https://vimaec.github.io/vim-web/webgl)**
14
- - **[Medium - Medical Tower](https://vimaec.github.io/vim-web/webgl?vim=https://vim.azureedge.net/samples/Medical_Tower.vim)**
14
+ - **[Medium - Medical Tower](https://vimaec.github.io/vim-web/webgl?vim=https://storage.cdn.vimaec.com/samples/Medical_Tower.vim)**
15
15
 
16
16
  ### Ultra Viewer
17
17
  - **[Small - Residence](https://vimaec.github.io/vim-web/ultra)**
18
- - **[Medium - Medical Tower](https://vimaec.github.io/vim-web/ultra?vim=https://vim.azureedge.net/samples/Medical_Tower.vim)**
18
+ - **[Medium - Medical Tower](https://vimaec.github.io/vim-web/ultra?vim=https://storage.cdn.vimaec.com/samples/Medical_Tower.vim)**
19
19
 
20
20
  Find detailed camera controls here: [Camera Controls](https://docs.vimaec.com/docs/vim-cloud/webgl-navigation-and-controls-guide).
21
21
 
package/dist/style.css CHANGED
@@ -733,6 +733,9 @@ video:where(.vim-component,.vim-component *) {
733
733
  .vc-top-1 {
734
734
  top: 0.25rem;
735
735
  }
736
+ .vc-top-10 {
737
+ top: 2.5rem;
738
+ }
736
739
  .vc-top-4 {
737
740
  top: 1rem;
738
741
  }
@@ -982,6 +985,9 @@ video:where(.vim-component,.vim-component *) {
982
985
  .vc-justify-evenly {
983
986
  justify-content: space-evenly;
984
987
  }
988
+ .vc-gap-1 {
989
+ gap: 0.25rem;
990
+ }
985
991
  .vc-gap-2 {
986
992
  gap: 0.5rem;
987
993
  }
@@ -7,3 +7,4 @@ export * from './viewer/color';
7
7
  export type { ILoadRequest, VimRequestErrorType } from './viewer/loadRequest';
8
8
  export type { ClientState, ConnectionSettings } from './viewer/socketClient';
9
9
  export type { VimSource } from './viewer/rpcSafeClient';
10
+ export type { SectionBoxState } from './viewer/marshal';
@@ -3,7 +3,7 @@ import { RpcSafeClient } from "../rpcSafeClient";
3
3
  import { ViewerSelection } from "../selection";
4
4
  import { InputHandler } from "./inputHandler";
5
5
  import { Inputs } from "./inputs";
6
- export declare class InputKeyboard extends InputHandler {
6
+ export declare class KeyboardHandler extends InputHandler {
7
7
  private readonly _rpc;
8
8
  private readonly _selection;
9
9
  private _camera;
@@ -2,7 +2,7 @@ import { InputHandler } from "./inputHandler";
2
2
  import { RpcSafeClient } from "../rpcSafeClient";
3
3
  import { ViewerSelection } from "../selection";
4
4
  import { ICamera } from "../camera";
5
- export declare class InputMouse extends InputHandler {
5
+ export declare class MouseHandler extends InputHandler {
6
6
  private readonly _rpc;
7
7
  private readonly _canvas;
8
8
  private _lastMouseDownPosition;
@@ -1,6 +1,6 @@
1
1
  import { InputHandler } from "./inputHandler";
2
2
  import { RpcSafeClient } from "../rpcSafeClient";
3
- export declare class InputTouch extends InputHandler {
3
+ export declare class TouchHandler extends InputHandler {
4
4
  private readonly _rpc;
5
5
  private readonly _canvas;
6
6
  private _lastTouchStartPosition;
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { Viewer } from '../viewer';
5
5
  /**
6
+ * TODO: Use the same code for ULTRA and webgl.
6
7
  * Base class for various input handlers.
7
8
  * It provides convenience to register to and unregister from events.
8
9
  */
@@ -1,3 +1,3 @@
1
1
  import * as Ultra from '../../../core-viewers/ultra';
2
2
  export declare function getErrorMessage(state: Ultra.ClientState): import("../..").MessageBoxProps;
3
- export declare function getRequestErrorMessage(source: Ultra.VimSource, error: Ultra.VimRequestErrorType): import("../..").MessageBoxProps;
3
+ export declare function getRequestErrorMessage(serverUrl: string, source: Ultra.VimSource, error: Ultra.VimRequestErrorType): import("../..").MessageBoxProps;
@@ -1,2 +1,3 @@
1
1
  export declare const support = "https://docs.vimaec.com";
2
+ export declare const supportUltra = "https://docs.vimaec.com/docs/vim-for-windows/configuring-vim-ultra";
2
3
  export declare const supportControls = "https://docs.vimaec.com/docs/vim-cloud/webgl-navigation-and-controls-guide";
@@ -51298,7 +51298,7 @@ void main() {
51298
51298
  KEY_Z: 90
51299
51299
  };
51300
51300
  const KeySet = new Set(Object.values(KEYS));
51301
- class KeyboardHandler extends InputHandler$1 {
51301
+ let KeyboardHandler$1 = class KeyboardHandler extends InputHandler$1 {
51302
51302
  constructor() {
51303
51303
  super(...arguments);
51304
51304
  // Settings
@@ -51404,7 +51404,7 @@ void main() {
51404
51404
  this.camera.localVelocity = move;
51405
51405
  }
51406
51406
  }
51407
- }
51407
+ };
51408
51408
  class SimpleInstanceSubmesh {
51409
51409
  constructor(mesh, index2) {
51410
51410
  __publicField(this, "mesh");
@@ -51653,7 +51653,7 @@ void main() {
51653
51653
  return this.raycast.object;
51654
51654
  }
51655
51655
  }
51656
- class TouchHandler extends InputHandler$1 {
51656
+ let TouchHandler$1 = class TouchHandler extends InputHandler$1 {
51657
51657
  constructor(viewer) {
51658
51658
  super(viewer);
51659
51659
  __publicField(this, "TAP_DURATION_MS", 500);
@@ -51806,8 +51806,8 @@ void main() {
51806
51806
  average(p1, p2) {
51807
51807
  return p1.clone().lerp(p2, 0.5);
51808
51808
  }
51809
- }
51810
- class MouseHandler extends InputHandler$1 {
51809
+ };
51810
+ let MouseHandler$1 = class MouseHandler extends InputHandler$1 {
51811
51811
  constructor(viewer) {
51812
51812
  super(viewer);
51813
51813
  __publicField(this, "_idleDelayMs", 150);
@@ -51907,7 +51907,6 @@ void main() {
51907
51907
  this.inputs.pointerOverride = void 0;
51908
51908
  });
51909
51909
  __publicField(this, "onDoubleClick", (event) => {
51910
- console.log("Double click");
51911
51910
  event.stopImmediatePropagation();
51912
51911
  this.onMouseClick(
51913
51912
  new Vector2(event.offsetX, event.offsetY),
@@ -52060,7 +52059,7 @@ void main() {
52060
52059
  this.gizmoRect.setCorners(this._downPosition, this._lastPosition);
52061
52060
  }
52062
52061
  }
52063
- }
52062
+ };
52064
52063
  var dist = {};
52065
52064
  var SimpleEventDispatcher = {};
52066
52065
  var hasRequiredSimpleEventDispatcher;
@@ -52330,9 +52329,9 @@ void main() {
52330
52329
  this.touch.unregister();
52331
52330
  });
52332
52331
  this._viewer = viewer;
52333
- this.keyboard = new KeyboardHandler(viewer);
52334
- this.mouse = new MouseHandler(viewer);
52335
- this.touch = new TouchHandler(viewer);
52332
+ this.keyboard = new KeyboardHandler$1(viewer);
52333
+ this.mouse = new MouseHandler$1(viewer);
52334
+ this.touch = new TouchHandler$1(viewer);
52336
52335
  this._scheme = new DefaultInputScheme(viewer);
52337
52336
  this.pointerActive = viewer.settings.camera.controls.orbit ? "orbit" : "look";
52338
52337
  this._pointerFallback = viewer.settings.camera.controls.orbit ? "look" : "orbit";
@@ -54898,7 +54897,6 @@ void main() {
54898
54897
  * Disposes all resources.
54899
54898
  */
54900
54899
  dispose() {
54901
- console.log("dispose");
54902
54900
  if (this._animId !== void 0) cancelAnimationFrame(this._animId);
54903
54901
  this._html.div.remove();
54904
54902
  this._viewer.renderer.remove(this._group);
@@ -57663,7 +57661,7 @@ void main() {
57663
57661
  }
57664
57662
  }
57665
57663
  }
57666
- class InputMouse extends InputHandler {
57664
+ class MouseHandler extends InputHandler {
57667
57665
  constructor(canvas, rpc, selection, camera2) {
57668
57666
  super();
57669
57667
  __publicField(this, "_rpc");
@@ -57760,7 +57758,7 @@ void main() {
57760
57758
  );
57761
57759
  }
57762
57760
  }
57763
- class InputTouch extends InputHandler {
57761
+ class TouchHandler extends InputHandler {
57764
57762
  constructor(canvas, rpc) {
57765
57763
  super();
57766
57764
  __publicField(this, "_rpc");
@@ -59689,7 +59687,7 @@ void main() {
59689
59687
  "Control",
59690
59688
  "Shift"
59691
59689
  ]);
59692
- class InputKeyboard extends InputHandler {
59690
+ class KeyboardHandler extends InputHandler {
59693
59691
  constructor(rpc, selection, camera2, inputs) {
59694
59692
  super();
59695
59693
  __publicField(this, "_rpc");
@@ -59771,9 +59769,9 @@ void main() {
59771
59769
  this._canvas = canvas;
59772
59770
  this._rpc = rpc;
59773
59771
  this._renderer = renderer;
59774
- this._inputsMouse = new InputMouse(this._canvas, this._rpc, selection, camera2);
59775
- this._inputsTouch = new InputTouch(this._canvas, this._rpc);
59776
- this._keyboard = new InputKeyboard(this._rpc, selection, camera2, this);
59772
+ this._inputsMouse = new MouseHandler(this._canvas, this._rpc, selection, camera2);
59773
+ this._inputsTouch = new TouchHandler(this._canvas, this._rpc);
59774
+ this._keyboard = new KeyboardHandler(this._rpc, selection, camera2, this);
59777
59775
  }
59778
59776
  onConnect() {
59779
59777
  this.register();
@@ -61028,7 +61026,6 @@ Averrage Date/Second ${avgDataRatePS} kb
61028
61026
  * Cleans up resources by removing resize observer and clearing timeouts
61029
61027
  */
61030
61028
  dispose() {
61031
- console.log("Disposing Viewport");
61032
61029
  this._clearTimeout();
61033
61030
  this._observer.disconnect();
61034
61031
  }
@@ -61311,7 +61308,6 @@ Averrage Date/Second ${avgDataRatePS} kb
61311
61308
  * @returns Promise that resolves when the framing animation is complete
61312
61309
  */
61313
61310
  async frameAll(blendTime = this._defaultBlendTime) {
61314
- console.log("Camera.frameAll");
61315
61311
  const segment = await this._rpc.RPCFrameAll(blendTime);
61316
61312
  this._savedPosition = this._savedPosition ?? segment;
61317
61313
  return segment;
@@ -61322,7 +61318,6 @@ Averrage Date/Second ${avgDataRatePS} kb
61322
61318
  * @param blendTime - Duration of the camera animation in seconds (defaults to 0.5)
61323
61319
  */
61324
61320
  async frameBox(box, blendTime = this._defaultBlendTime) {
61325
- console.log("Camera.frameAll");
61326
61321
  const segment = await this._rpc.RPCFrameBox(box, blendTime);
61327
61322
  this._savedPosition = this._savedPosition ?? segment;
61328
61323
  return segment;
@@ -61809,9 +61804,9 @@ Averrage Date/Second ${avgDataRatePS} kb
61809
61804
  }
61810
61805
  class SectionBox {
61811
61806
  constructor(rpc) {
61812
- __publicField(this, "_visible", true);
61813
- __publicField(this, "_interactible", true);
61814
- __publicField(this, "_clip", true);
61807
+ __publicField(this, "_visible", false);
61808
+ __publicField(this, "_interactible", false);
61809
+ __publicField(this, "_clip", false);
61815
61810
  __publicField(this, "_box", new Box3());
61816
61811
  __publicField(this, "_rpc");
61817
61812
  __publicField(this, "_interval");
@@ -75877,13 +75872,14 @@ Averrage Date/Second ${avgDataRatePS} kb
75877
75872
  const bottomOffset = useStateRef("1");
75878
75873
  const boxRef = React2.useRef(adapter.getBox());
75879
75874
  React2.useEffect(() => {
75880
- adapter.setClip(true);
75881
75875
  adapter.setVisible(false);
75876
+ adapter.setClip(false);
75882
75877
  return adapter.onSelectionChanged.sub(() => {
75883
75878
  if (auto.get() && enable.get()) sectionSelection.call();
75884
75879
  });
75885
75880
  }, []);
75886
75881
  enable.useOnChange((v) => {
75882
+ adapter.setClip(v);
75887
75883
  visible2.set(v);
75888
75884
  showOffsetPanel.set(false);
75889
75885
  if (v && auto.get()) {
@@ -75987,7 +75983,6 @@ Averrage Date/Second ${avgDataRatePS} kb
75987
75983
  }, []);
75988
75984
  const reset = useActionRef(() => adapter.resetCamera(1));
75989
75985
  const frameSelection2 = useAsyncFuncRef(async () => {
75990
- console.log("frameSelection");
75991
75986
  if (!adapter.hasSelection()) {
75992
75987
  frameScene.call();
75993
75988
  return;
@@ -76269,11 +76264,13 @@ Averrage Date/Second ${avgDataRatePS} kb
76269
76264
  vcRoboto
76270
76265
  }, Symbol.toStringTag, { value: "Module" }));
76271
76266
  const support = "https://docs.vimaec.com";
76267
+ const supportUltra = "https://docs.vimaec.com/docs/vim-for-windows/configuring-vim-ultra";
76272
76268
  const supportControls = "https://docs.vimaec.com/docs/vim-cloud/webgl-navigation-and-controls-guide";
76273
76269
  const urls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
76274
76270
  __proto__: null,
76275
76271
  support,
76276
- supportControls
76272
+ supportControls,
76273
+ supportUltra
76277
76274
  }, Symbol.toStringTag, { value: "Module" }));
76278
76275
  function fileOpeningError(url) {
76279
76276
  return {
@@ -76319,12 +76316,12 @@ Averrage Date/Second ${avgDataRatePS} kb
76319
76316
  }
76320
76317
  return {
76321
76318
  title: "File Downloading Error",
76322
- body: body$4(server, authToken, server),
76319
+ body: body$4(url, authToken, server),
76323
76320
  footer: footer(support),
76324
76321
  canClose: false
76325
76322
  };
76326
76323
  }
76327
- function body$4(url, server, authToken) {
76324
+ function body$4(url, authToken, server) {
76328
76325
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: vcRoboto, children: [
76329
76326
  mainText(/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
76330
76327
  "Oops, it appears that there’s an ",
@@ -76389,7 +76386,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76389
76386
  /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
76390
76387
  "Ensure that VIM Ultra",
76391
76388
  " ",
76392
- link(support, "process is running"),
76389
+ link(supportUltra, "process is running"),
76393
76390
  " ",
76394
76391
  "at ",
76395
76392
  detailText(url)
@@ -76471,7 +76468,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76471
76468
  return serverStreamError(state.serverUrl);
76472
76469
  }
76473
76470
  }
76474
- function getRequestErrorMessage(source, error) {
76471
+ function getRequestErrorMessage(serverUrl, source, error) {
76475
76472
  console.log(error);
76476
76473
  switch (error) {
76477
76474
  case "loadingError":
@@ -76479,7 +76476,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76479
76476
  case "downloadingError":
76480
76477
  case "unknown":
76481
76478
  case "cancelled":
76482
- return serverFileDownloadingError(source.url);
76479
+ return serverFileDownloadingError(source.url, source.authToken, serverUrl);
76483
76480
  case "serverDisconnected":
76484
76481
  return serverConnectionError(source.url);
76485
76482
  }
@@ -76625,7 +76622,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76625
76622
  void request2.getResult().then(
76626
76623
  (result) => {
76627
76624
  if (result.isError) {
76628
- modal.message(getRequestErrorMessage(source, result.error));
76625
+ modal.message(getRequestErrorMessage(viewer.serverUrl, source, result.error));
76629
76626
  return;
76630
76627
  }
76631
76628
  if (result.isSuccess) {