vim-web 0.6.0-dev.0 → 0.6.0-dev.1

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/vim-web.js CHANGED
@@ -74320,6 +74320,7 @@ class InsertableGeometry {
74320
74320
  if (this._computeBoundingBox) {
74321
74321
  this.geometry.computeBoundingBox();
74322
74322
  this.geometry.computeBoundingSphere();
74323
+ this.boundingBox = this.geometry.boundingBox;
74323
74324
  }
74324
74325
  }
74325
74326
  }
@@ -74376,7 +74377,9 @@ class InsertableMesh {
74376
74377
  this.geometry.insertFromG3d(g3d2, mesh);
74377
74378
  }
74378
74379
  update() {
74380
+ var _a3;
74379
74381
  this.geometry.update();
74382
+ (_a3 = this.vim) == null ? void 0 : _a3.scene.updateBox(this.geometry.boundingBox);
74380
74383
  }
74381
74384
  clearUpdate() {
74382
74385
  this.geometry.flushUpdate();
@@ -75134,13 +75137,14 @@ class LoadRequest4 {
75134
75137
  __publicField(this, "_callbacks");
75135
75138
  __publicField(this, "_onLoaded");
75136
75139
  __publicField(this, "_progressQueue", new AsyncQueue());
75140
+ __publicField(this, "_resultPromise");
75137
75141
  this._source = source;
75138
75142
  this._callbacks = callbacks;
75139
75143
  this._onLoaded = onLoaded;
75140
75144
  this._request = new LoadRequest$1(source, settings2, vimIndex);
75141
- this.trackRequest();
75145
+ this._resultPromise = this.trackAndGetResult();
75142
75146
  }
75143
- async trackRequest() {
75147
+ async trackAndGetResult() {
75144
75148
  var _a3;
75145
75149
  try {
75146
75150
  for await (const progress of this._request.getProgress()) {
@@ -75151,13 +75155,16 @@ class LoadRequest4 {
75151
75155
  if (result.isSuccess === false) {
75152
75156
  this._callbacks.onError({ url: this._source.url, error: result.error });
75153
75157
  } else {
75154
- (_a3 = this._onLoaded) == null ? void 0 : _a3.call(this, result.vim);
75158
+ await ((_a3 = this._onLoaded) == null ? void 0 : _a3.call(this, result.vim));
75155
75159
  this._callbacks.onDone();
75156
75160
  }
75161
+ this._progressQueue.close();
75162
+ return result;
75157
75163
  } catch (err) {
75158
75164
  this._callbacks.onError({ url: this._source.url, error: String(err) });
75165
+ this._progressQueue.close();
75166
+ throw err;
75159
75167
  }
75160
- this._progressQueue.close();
75161
75168
  }
75162
75169
  get isCompleted() {
75163
75170
  return this._request.isCompleted;
@@ -75166,7 +75173,7 @@ class LoadRequest4 {
75166
75173
  yield* this._progressQueue;
75167
75174
  }
75168
75175
  getResult() {
75169
- return this._request.getResult();
75176
+ return this._resultPromise;
75170
75177
  }
75171
75178
  abort() {
75172
75179
  this._request.abort();
@@ -75298,7 +75305,7 @@ class ComponentLoader {
75298
75305
  (vim) => this.initVim(vim, settings2, loadGeometry)
75299
75306
  );
75300
75307
  }
75301
- initVim(vim, settings2, loadGeometry) {
75308
+ async initVim(vim, settings2, loadGeometry) {
75302
75309
  this._viewer.add(vim);
75303
75310
  vim.onLoadingUpdate.subscribe(() => {
75304
75311
  this._viewer.gizmos.loading.visible = vim.isLoading;
@@ -75308,7 +75315,7 @@ class ComponentLoader {
75308
75315
  }
75309
75316
  });
75310
75317
  if (loadGeometry) {
75311
- void vim.loadAll();
75318
+ await vim.loadAll();
75312
75319
  }
75313
75320
  }
75314
75321
  }