vim-web 0.3.39-dev.8 → 0.3.40

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://storage.cdn.vimaec.com/samples/skanska.vim)**
14
+ - **[Medium - Medical Tower](https://vimaec.github.io/vim-web/webgl?vim=https://vim.azureedge.net/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://storage.cdn.vimaec.com/samples/skanska.vim)**
18
+ - **[Medium - Medical Tower](https://vimaec.github.io/vim-web/ultra?vim=https://vim.azureedge.net/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
@@ -1348,6 +1348,12 @@ video:where(.vim-component,.vim-component *) {
1348
1348
  --hidden-royal-blue: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%23284ea2' d='M154.271,63.406c22.243,5.762,39.382,17.586,48.956,25.494,9.186,7.587,17.187,16.341,22.527,24.648,6.176,9.606,6.247,14.405,6.247,14.452,0,4.764-5.566,18.577-22.079,34.01l16.973,16.972c18.185-17.247,29.106-36.602,29.106-50.982,0-30.946-57.308-92-128-92-13.307,0-26.139,2.165-38.205,5.884l42.099,42.099c2.731-10.572,11.479-18.722,22.376-20.577Z'/%3E%3Cpath fill='%23284ea2' d='M166.022,118.111l21.472,21.472c2.896-7.3,4.505-15.251,4.505-23.583,0-8.812-1.782-17.207-5.004-24.847-.07,12.971-8.957,23.853-20.974,26.958Z'/%3E%3Cpath fill='%23284ea2' d='M31.833,17.863c-4.687-4.686-12.284-4.686-16.971,0-4.686,4.687-4.686,12.285,0,16.971l29.92,29.92C17.38,84.825,0,110.966,0,128c0,32.943,57.308,92,128,92,21.088,0,40.972-5.269,58.51-13.52l37.657,37.657c4.687,4.686,12.284,4.686,16.971,0,4.686-4.687,4.686-12.285,0-16.971L31.833,17.863Zm96.167,178.137c-35.405,0-62.403-17.699-75.346-28.249-21.65-17.648-28.654-34.402-28.654-39.751,0-.047,.071-4.846,6.247-14.452,5.34-8.308,13.341-17.061,22.527-24.648,2.545-2.103,5.633-4.482,9.205-6.95l7.708,7.708c-3.643,8.034-5.686,16.946-5.686,26.343,0,35.346,28.654,64,64,64,9.397,0,18.31-2.043,26.345-5.684l13.936,13.936c-11.606,4.516-25.17,7.749-40.281,7.749Z'/%3E%3C/svg%3E%0A");
1349
1349
  }
1350
1350
 
1351
+ /* Removes the shadow of the arrow that was cutting text in the tooltip */
1352
+ .__react_component_tooltip::after,
1353
+ .__react_component_tooltip::before {
1354
+ content: none !important;
1355
+ }
1356
+
1351
1357
  .vim-component {
1352
1358
  font-family: 'Roboto', sans-serif;
1353
1359
  -webkit-font-smoothing: antialiased;
@@ -16,7 +16,7 @@ export declare class LoadRequest {
16
16
  private _progressPromise;
17
17
  private _isDone;
18
18
  private _completionPromise;
19
- constructor(callbacks: RequestCallbacks, source: VIM.RequestSource, settings: VIM.VimPartialSettings);
19
+ constructor(callbacks: RequestCallbacks, source: VIM.RequestSource, settings?: VIM.VimPartialSettings);
20
20
  private startRequest;
21
21
  private onProgress;
22
22
  private onSuccess;
@@ -55,7 +55,7 @@ export declare class ComponentLoader {
55
55
  * @param settings Settings to apply to vim file.
56
56
  * @returns A new load request instance to track progress and get result.
57
57
  */
58
- request(source: VIM.RequestSource, settings: VIM.VimPartialSettings): LoadRequest;
58
+ request(source: VIM.RequestSource, settings?: VIM.VimPartialSettings): LoadRequest;
59
59
  add(vim: VIM.Vim, settings?: AddSettings): void;
60
60
  /**
61
61
  * Removes the vim from the viewer and disposes it.
@@ -204,11 +204,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
204
204
  Object.defineProperty(retriableRequest, "__esModule", { value: true });
205
205
  retriableRequest.RetriableRequest = void 0;
206
206
  class RetriableRequest {
207
- constructor(url, headers, range2, responseType) {
207
+ constructor(url, headers, range2, responseType, maxTries) {
208
208
  this.url = url;
209
209
  this.headers = headers ?? {};
210
210
  this.range = range2;
211
211
  this.responseType = responseType;
212
+ this.maxTries = maxTries ?? 999;
212
213
  }
213
214
  abort() {
214
215
  var _a2;
@@ -282,9 +283,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
282
283
  this._active.clear();
283
284
  this._queue.length = 0;
284
285
  }
285
- async http(range2, label) {
286
+ async http(range2, label, maxTries) {
286
287
  const rangeStr = range2 ? `bytes=${range2.start}-${range2.end - 1}` : void 0;
287
- const request2 = new retriableRequest_1.RetriableRequest(this.url, this.headers, rangeStr, "arraybuffer");
288
+ const request2 = new retriableRequest_1.RetriableRequest(this.url, this.headers, rangeStr, "arraybuffer", maxTries);
288
289
  request2.msg = range2 ? `${label} : [${range2.start}, ${range2.end}] of ${this.url}` : `${label} of ${this.url}`;
289
290
  this.enqueue(request2);
290
291
  return new Promise((resolve, reject) => {
@@ -293,13 +294,18 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
293
294
  this._tracker.update(label, e);
294
295
  };
295
296
  request2.onLoad = (result) => {
296
- this._tracker.end(label);
297
+ this.end(request2, label);
297
298
  resolve(result);
298
- this.end(request2);
299
299
  };
300
300
  request2.onError = () => {
301
301
  this._tracker.fail(label);
302
- this.retry(request2);
302
+ request2.maxTries -= 1;
303
+ if (request2.maxTries <= 0) {
304
+ this.end(request2, label);
305
+ reject(new Error("Max tries exceeded: " + request2.msg));
306
+ } else {
307
+ this.retry(request2);
308
+ }
303
309
  };
304
310
  });
305
311
  }
@@ -312,8 +318,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
312
318
  this.maxConcurency = Math.max(1, this.maxConcurency - 1);
313
319
  setTimeout(() => this.enqueue(request2), 2e3);
314
320
  }
315
- end(request2) {
321
+ end(request2, label) {
316
322
  this.logs.log("Finished " + request2.msg);
323
+ this._tracker.end(label);
317
324
  this._active.delete(request2);
318
325
  this.next();
319
326
  }
@@ -4977,7 +4984,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4977
4984
  * Downloads and parse header from remote.
4978
4985
  */
4979
4986
  async requestHeader() {
4980
- const buffer = await this.request(new Range(0, 32), "Header");
4987
+ const tries = this.offset === 0 ? 3 : 999;
4988
+ const buffer = await this.request(new Range(0, 32), "Header", tries);
4981
4989
  if (!buffer)
4982
4990
  throw new Error("Could not get BFAST Header");
4983
4991
  const result = BFastHeader.createFromBuffer(buffer);
@@ -4988,8 +4996,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4988
4996
  * @param range range to get, or get full resource if undefined
4989
4997
  * @param label label for logs
4990
4998
  */
4991
- async request(range2, label) {
4992
- const buffer = this.local(range2, label) ?? await this.remote(range2, label) ?? await this.remote(void 0, label);
4999
+ async request(range2, label, maxTries) {
5000
+ const buffer = this.local(range2, label) ?? await this.remote(range2, label, maxTries) ?? await this.remote(void 0, label, maxTries);
4993
5001
  if (!buffer) {
4994
5002
  throw new Error(`Could not load vim at ${this.source}`);
4995
5003
  }
@@ -5011,11 +5019,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5011
5019
  /**
5012
5020
  * returns requested range from remote.
5013
5021
  */
5014
- async remote(range2, label) {
5022
+ async remote(range2, label, maxTries = -1) {
5015
5023
  if (!(this.source instanceof remoteBuffer_1.RemoteBuffer))
5016
5024
  return void 0;
5017
5025
  const r = range2 == null ? void 0 : range2.offset(this.offset);
5018
- const buffer = await this.source.http(r, `${this.name}.${label}`);
5026
+ const buffer = await this.source.http(r, `${this.name}.${label}`, maxTries);
5019
5027
  if (range2 && ((buffer == null ? void 0 : buffer.byteLength) ?? 0) < range2.length) {
5020
5028
  console.log("Range request request failed.");
5021
5029
  return void 0;
@@ -5968,85 +5976,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5968
5976
  remoteVimx.RemoteVimx = RemoteVimx;
5969
5977
  return remoteVimx;
5970
5978
  }
5971
- var requester = {};
5972
- var hasRequiredRequester;
5973
- function requireRequester() {
5974
- if (hasRequiredRequester) return requester;
5975
- hasRequiredRequester = 1;
5976
- Object.defineProperty(requester, "__esModule", { value: true });
5977
- requester.Requester = void 0;
5978
- const logging_1 = requireLogging$1();
5979
- const retriableRequest_1 = requireRetriableRequest();
5980
- const requestTracker_1 = requireRequestTracker();
5981
- class Requester {
5982
- constructor(verbose = false) {
5983
- this.maxConcurency = 10;
5984
- this._queue = [];
5985
- this._active = /* @__PURE__ */ new Set();
5986
- this._logs = verbose ? new logging_1.DefaultLog() : new logging_1.NoLog();
5987
- this._tracker = new requestTracker_1.RequestTracker(void 0, this._logs);
5988
- this._tracker.onUpdate = (p) => {
5989
- var _a2;
5990
- return (_a2 = this.onProgress) == null ? void 0 : _a2.call(this, p);
5991
- };
5992
- }
5993
- abort() {
5994
- this._active.forEach((request2) => {
5995
- request2.abort();
5996
- });
5997
- this._active.clear();
5998
- this._queue.length = 0;
5999
- }
6000
- async http(url, headers = {}, label) {
6001
- const request2 = new retriableRequest_1.RetriableRequest(url, headers, void 0, "arraybuffer");
6002
- request2.msg = url;
6003
- this.enqueue(request2);
6004
- return new Promise((resolve, reject) => {
6005
- this._tracker.start(label);
6006
- request2.onProgress = (e) => {
6007
- this._tracker.update(label, e);
6008
- };
6009
- request2.onLoad = (result) => {
6010
- this._tracker.end(label);
6011
- resolve(result);
6012
- this.end(request2);
6013
- };
6014
- request2.onError = () => {
6015
- this._tracker.fail(label);
6016
- this.retry(request2);
6017
- };
6018
- });
6019
- }
6020
- enqueue(xhr) {
6021
- this._queue.push(xhr);
6022
- this.next();
6023
- }
6024
- retry(xhr) {
6025
- this._active.delete(xhr);
6026
- this.maxConcurency = Math.max(1, this.maxConcurency - 1);
6027
- setTimeout(() => this.enqueue(xhr), 2e3);
6028
- }
6029
- end(xhr) {
6030
- this._active.delete(xhr);
6031
- this.next();
6032
- }
6033
- next() {
6034
- if (this._queue.length === 0) {
6035
- return;
6036
- }
6037
- if (this._active.size >= this.maxConcurency) {
6038
- return;
6039
- }
6040
- const next = this._queue[0];
6041
- this._queue.shift();
6042
- this._active.add(next);
6043
- next.send();
6044
- this._logs.log("Starting " + next.msg);
6045
- }
6046
- }
6047
- requester.Requester = Requester;
6048
- return requester;
6049
- }
6050
5979
  var objectModel = {};
6051
5980
  var entityTable = {};
6052
5981
  var hasRequiredEntityTable;
@@ -8836,6 +8765,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
8836
8765
  table.getHostIndex(index2).then((v) => result.hostIndex = v),
8837
8766
  table.getFromRoomIndex(index2).then((v) => result.fromRoomIndex = v),
8838
8767
  table.getToRoomIndex(index2).then((v) => result.toRoomIndex = v),
8768
+ table.getSuperComponentIndex(index2).then((v) => result.superComponentIndex = v),
8839
8769
  table.getElementIndex(index2).then((v) => result.elementIndex = v)
8840
8770
  ]);
8841
8771
  return result;
@@ -8888,6 +8818,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
8888
8818
  let hostIndex;
8889
8819
  let fromRoomIndex;
8890
8820
  let toRoomIndex;
8821
+ let superComponentIndex;
8891
8822
  let elementIndex;
8892
8823
  await Promise.all([
8893
8824
  (async () => {
@@ -8971,6 +8902,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
8971
8902
  (async () => {
8972
8903
  toRoomIndex = await localTable.getNumberArray("index:Vim.Room:ToRoom");
8973
8904
  })(),
8905
+ (async () => {
8906
+ superComponentIndex = await localTable.getNumberArray("index:Vim.Element:SuperComponent");
8907
+ })(),
8974
8908
  (async () => {
8975
8909
  elementIndex = await localTable.getNumberArray("index:Vim.Element:Element");
8976
8910
  })()
@@ -9007,6 +8941,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
9007
8941
  hostIndex: hostIndex ? hostIndex[i2] : void 0,
9008
8942
  fromRoomIndex: fromRoomIndex ? fromRoomIndex[i2] : void 0,
9009
8943
  toRoomIndex: toRoomIndex ? toRoomIndex[i2] : void 0,
8944
+ superComponentIndex: superComponentIndex ? superComponentIndex[i2] : void 0,
9010
8945
  elementIndex: elementIndex ? elementIndex[i2] : void 0
9011
8946
  });
9012
8947
  }
@@ -9206,6 +9141,20 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
9206
9141
  }
9207
9142
  return await ((_a2 = this.document.room) == null ? void 0 : _a2.get(index2));
9208
9143
  }
9144
+ async getSuperComponentIndex(familyInstanceIndex) {
9145
+ return await this.entityTable.getNumber(familyInstanceIndex, "index:Vim.Element:SuperComponent");
9146
+ }
9147
+ async getAllSuperComponentIndex() {
9148
+ return await this.entityTable.getNumberArray("index:Vim.Element:SuperComponent");
9149
+ }
9150
+ async getSuperComponent(familyInstanceIndex) {
9151
+ var _a2;
9152
+ const index2 = await this.getSuperComponentIndex(familyInstanceIndex);
9153
+ if (index2 === void 0) {
9154
+ return void 0;
9155
+ }
9156
+ return await ((_a2 = this.document.element) == null ? void 0 : _a2.get(index2));
9157
+ }
9209
9158
  async getElementIndex(familyInstanceIndex) {
9210
9159
  return await this.entityTable.getNumber(familyInstanceIndex, "index:Vim.Element:Element");
9211
9160
  }
@@ -13378,7 +13327,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
13378
13327
  __exportStar(requireG3dScene(), exports2);
13379
13328
  __exportStar(requireRemoteBuffer(), exports2);
13380
13329
  __exportStar(requireRequestTracker(), exports2);
13381
- __exportStar(requireRequester(), exports2);
13382
13330
  __exportStar(requireRemoteValue(), exports2);
13383
13331
  __exportStar(requireVimHeader(), exports2);
13384
13332
  __exportStar(requireObjectModel(), exports2);
@@ -47938,13 +47886,12 @@ void main() {
47938
47886
  #endif
47939
47887
  `
47940
47888
  );
47941
- console.log(shader.vertexShader);
47942
- console.log(shader.fragmentShader);
47943
47889
  };
47944
47890
  }
47945
47891
  }
47946
47892
  function createMaskMaterial() {
47947
47893
  return new ShaderMaterial({
47894
+ side: DoubleSide,
47948
47895
  uniforms: {},
47949
47896
  clipping: true,
47950
47897
  vertexShader: `
@@ -53660,7 +53607,7 @@ data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAAAXNSR0IArs
53660
53607
  onUpdate() {
53661
53608
  this.updateScale();
53662
53609
  this.setPosition(this._camera.target);
53663
- this.show(true);
53610
+ this.show(this._inputs.pointerActive === "orbit");
53664
53611
  }
53665
53612
  /**
53666
53613
  * Determines whether the orbit gizmo is enabled.
@@ -53682,6 +53629,7 @@ data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAAAXNSR0IArs
53682
53629
  }
53683
53630
  clearTimeout(this._timeout);
53684
53631
  this._gizmos.visible = show;
53632
+ this._renderer.needsUpdate = true;
53685
53633
  if (show) {
53686
53634
  this._timeout = setTimeout(() => {
53687
53635
  this._gizmos.visible = false;
@@ -61374,7 +61322,7 @@ Averrage Date/Second ${avgDataRatePS} kb
61374
61322
  const defaultRenderSettings = {
61375
61323
  ...defaultSceneSettings,
61376
61324
  lockIblRotation: true,
61377
- ghostColor: new RGBA(0.7, 0.62, 0.66, 5e-3)
61325
+ ghostColor: new RGBA(14 / 255, 14 / 255, 14 / 255, 1 / 255)
61378
61326
  };
61379
61327
  class Renderer {
61380
61328
  /**
@@ -75836,7 +75784,7 @@ Averrage Date/Second ${avgDataRatePS} kb
75836
75784
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: vcRoboto, children: [
75837
75785
  mainText(/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
75838
75786
  "Oops, it appears that there’s an ",
75839
- bold("error starting a stream on the VIM Ulta Server"),
75787
+ bold("error starting a stream on the VIM Ultra Server"),
75840
75788
  ". Please check the following conditions to get back up and running quickly."
75841
75789
  ] })),
75842
75790
  subTitle("Troubleshooting tips:"),