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/dist/vim-web.js CHANGED
@@ -188,11 +188,12 @@ function requireRetriableRequest() {
188
188
  Object.defineProperty(retriableRequest, "__esModule", { value: true });
189
189
  retriableRequest.RetriableRequest = void 0;
190
190
  class RetriableRequest {
191
- constructor(url, headers, range2, responseType) {
191
+ constructor(url, headers, range2, responseType, maxTries) {
192
192
  this.url = url;
193
193
  this.headers = headers ?? {};
194
194
  this.range = range2;
195
195
  this.responseType = responseType;
196
+ this.maxTries = maxTries ?? 999;
196
197
  }
197
198
  abort() {
198
199
  var _a2;
@@ -266,9 +267,9 @@ function requireRemoteBuffer() {
266
267
  this._active.clear();
267
268
  this._queue.length = 0;
268
269
  }
269
- async http(range2, label) {
270
+ async http(range2, label, maxTries) {
270
271
  const rangeStr = range2 ? `bytes=${range2.start}-${range2.end - 1}` : void 0;
271
- const request2 = new retriableRequest_1.RetriableRequest(this.url, this.headers, rangeStr, "arraybuffer");
272
+ const request2 = new retriableRequest_1.RetriableRequest(this.url, this.headers, rangeStr, "arraybuffer", maxTries);
272
273
  request2.msg = range2 ? `${label} : [${range2.start}, ${range2.end}] of ${this.url}` : `${label} of ${this.url}`;
273
274
  this.enqueue(request2);
274
275
  return new Promise((resolve, reject) => {
@@ -277,13 +278,18 @@ function requireRemoteBuffer() {
277
278
  this._tracker.update(label, e);
278
279
  };
279
280
  request2.onLoad = (result) => {
280
- this._tracker.end(label);
281
+ this.end(request2, label);
281
282
  resolve(result);
282
- this.end(request2);
283
283
  };
284
284
  request2.onError = () => {
285
285
  this._tracker.fail(label);
286
- this.retry(request2);
286
+ request2.maxTries -= 1;
287
+ if (request2.maxTries <= 0) {
288
+ this.end(request2, label);
289
+ reject(new Error("Max tries exceeded: " + request2.msg));
290
+ } else {
291
+ this.retry(request2);
292
+ }
287
293
  };
288
294
  });
289
295
  }
@@ -296,8 +302,9 @@ function requireRemoteBuffer() {
296
302
  this.maxConcurency = Math.max(1, this.maxConcurency - 1);
297
303
  setTimeout(() => this.enqueue(request2), 2e3);
298
304
  }
299
- end(request2) {
305
+ end(request2, label) {
300
306
  this.logs.log("Finished " + request2.msg);
307
+ this._tracker.end(label);
301
308
  this._active.delete(request2);
302
309
  this.next();
303
310
  }
@@ -4961,7 +4968,8 @@ function requireBfast() {
4961
4968
  * Downloads and parse header from remote.
4962
4969
  */
4963
4970
  async requestHeader() {
4964
- const buffer = await this.request(new Range(0, 32), "Header");
4971
+ const tries = this.offset === 0 ? 3 : 999;
4972
+ const buffer = await this.request(new Range(0, 32), "Header", tries);
4965
4973
  if (!buffer)
4966
4974
  throw new Error("Could not get BFAST Header");
4967
4975
  const result = BFastHeader.createFromBuffer(buffer);
@@ -4972,8 +4980,8 @@ function requireBfast() {
4972
4980
  * @param range range to get, or get full resource if undefined
4973
4981
  * @param label label for logs
4974
4982
  */
4975
- async request(range2, label) {
4976
- const buffer = this.local(range2, label) ?? await this.remote(range2, label) ?? await this.remote(void 0, label);
4983
+ async request(range2, label, maxTries) {
4984
+ const buffer = this.local(range2, label) ?? await this.remote(range2, label, maxTries) ?? await this.remote(void 0, label, maxTries);
4977
4985
  if (!buffer) {
4978
4986
  throw new Error(`Could not load vim at ${this.source}`);
4979
4987
  }
@@ -4995,11 +5003,11 @@ function requireBfast() {
4995
5003
  /**
4996
5004
  * returns requested range from remote.
4997
5005
  */
4998
- async remote(range2, label) {
5006
+ async remote(range2, label, maxTries = -1) {
4999
5007
  if (!(this.source instanceof remoteBuffer_1.RemoteBuffer))
5000
5008
  return void 0;
5001
5009
  const r = range2 == null ? void 0 : range2.offset(this.offset);
5002
- const buffer = await this.source.http(r, `${this.name}.${label}`);
5010
+ const buffer = await this.source.http(r, `${this.name}.${label}`, maxTries);
5003
5011
  if (range2 && ((buffer == null ? void 0 : buffer.byteLength) ?? 0) < range2.length) {
5004
5012
  console.log("Range request request failed.");
5005
5013
  return void 0;
@@ -5952,85 +5960,6 @@ function requireRemoteVimx() {
5952
5960
  remoteVimx.RemoteVimx = RemoteVimx;
5953
5961
  return remoteVimx;
5954
5962
  }
5955
- var requester = {};
5956
- var hasRequiredRequester;
5957
- function requireRequester() {
5958
- if (hasRequiredRequester) return requester;
5959
- hasRequiredRequester = 1;
5960
- Object.defineProperty(requester, "__esModule", { value: true });
5961
- requester.Requester = void 0;
5962
- const logging_1 = requireLogging$1();
5963
- const retriableRequest_1 = requireRetriableRequest();
5964
- const requestTracker_1 = requireRequestTracker();
5965
- class Requester {
5966
- constructor(verbose = false) {
5967
- this.maxConcurency = 10;
5968
- this._queue = [];
5969
- this._active = /* @__PURE__ */ new Set();
5970
- this._logs = verbose ? new logging_1.DefaultLog() : new logging_1.NoLog();
5971
- this._tracker = new requestTracker_1.RequestTracker(void 0, this._logs);
5972
- this._tracker.onUpdate = (p) => {
5973
- var _a2;
5974
- return (_a2 = this.onProgress) == null ? void 0 : _a2.call(this, p);
5975
- };
5976
- }
5977
- abort() {
5978
- this._active.forEach((request2) => {
5979
- request2.abort();
5980
- });
5981
- this._active.clear();
5982
- this._queue.length = 0;
5983
- }
5984
- async http(url, headers = {}, label) {
5985
- const request2 = new retriableRequest_1.RetriableRequest(url, headers, void 0, "arraybuffer");
5986
- request2.msg = url;
5987
- this.enqueue(request2);
5988
- return new Promise((resolve, reject) => {
5989
- this._tracker.start(label);
5990
- request2.onProgress = (e) => {
5991
- this._tracker.update(label, e);
5992
- };
5993
- request2.onLoad = (result) => {
5994
- this._tracker.end(label);
5995
- resolve(result);
5996
- this.end(request2);
5997
- };
5998
- request2.onError = () => {
5999
- this._tracker.fail(label);
6000
- this.retry(request2);
6001
- };
6002
- });
6003
- }
6004
- enqueue(xhr) {
6005
- this._queue.push(xhr);
6006
- this.next();
6007
- }
6008
- retry(xhr) {
6009
- this._active.delete(xhr);
6010
- this.maxConcurency = Math.max(1, this.maxConcurency - 1);
6011
- setTimeout(() => this.enqueue(xhr), 2e3);
6012
- }
6013
- end(xhr) {
6014
- this._active.delete(xhr);
6015
- this.next();
6016
- }
6017
- next() {
6018
- if (this._queue.length === 0) {
6019
- return;
6020
- }
6021
- if (this._active.size >= this.maxConcurency) {
6022
- return;
6023
- }
6024
- const next = this._queue[0];
6025
- this._queue.shift();
6026
- this._active.add(next);
6027
- next.send();
6028
- this._logs.log("Starting " + next.msg);
6029
- }
6030
- }
6031
- requester.Requester = Requester;
6032
- return requester;
6033
- }
6034
5963
  var objectModel = {};
6035
5964
  var entityTable = {};
6036
5965
  var hasRequiredEntityTable;
@@ -8820,6 +8749,7 @@ function requireObjectModel() {
8820
8749
  table.getHostIndex(index2).then((v) => result.hostIndex = v),
8821
8750
  table.getFromRoomIndex(index2).then((v) => result.fromRoomIndex = v),
8822
8751
  table.getToRoomIndex(index2).then((v) => result.toRoomIndex = v),
8752
+ table.getSuperComponentIndex(index2).then((v) => result.superComponentIndex = v),
8823
8753
  table.getElementIndex(index2).then((v) => result.elementIndex = v)
8824
8754
  ]);
8825
8755
  return result;
@@ -8872,6 +8802,7 @@ function requireObjectModel() {
8872
8802
  let hostIndex;
8873
8803
  let fromRoomIndex;
8874
8804
  let toRoomIndex;
8805
+ let superComponentIndex;
8875
8806
  let elementIndex;
8876
8807
  await Promise.all([
8877
8808
  (async () => {
@@ -8955,6 +8886,9 @@ function requireObjectModel() {
8955
8886
  (async () => {
8956
8887
  toRoomIndex = await localTable.getNumberArray("index:Vim.Room:ToRoom");
8957
8888
  })(),
8889
+ (async () => {
8890
+ superComponentIndex = await localTable.getNumberArray("index:Vim.Element:SuperComponent");
8891
+ })(),
8958
8892
  (async () => {
8959
8893
  elementIndex = await localTable.getNumberArray("index:Vim.Element:Element");
8960
8894
  })()
@@ -8991,6 +8925,7 @@ function requireObjectModel() {
8991
8925
  hostIndex: hostIndex ? hostIndex[i] : void 0,
8992
8926
  fromRoomIndex: fromRoomIndex ? fromRoomIndex[i] : void 0,
8993
8927
  toRoomIndex: toRoomIndex ? toRoomIndex[i] : void 0,
8928
+ superComponentIndex: superComponentIndex ? superComponentIndex[i] : void 0,
8994
8929
  elementIndex: elementIndex ? elementIndex[i] : void 0
8995
8930
  });
8996
8931
  }
@@ -9190,6 +9125,20 @@ function requireObjectModel() {
9190
9125
  }
9191
9126
  return await ((_a2 = this.document.room) == null ? void 0 : _a2.get(index2));
9192
9127
  }
9128
+ async getSuperComponentIndex(familyInstanceIndex) {
9129
+ return await this.entityTable.getNumber(familyInstanceIndex, "index:Vim.Element:SuperComponent");
9130
+ }
9131
+ async getAllSuperComponentIndex() {
9132
+ return await this.entityTable.getNumberArray("index:Vim.Element:SuperComponent");
9133
+ }
9134
+ async getSuperComponent(familyInstanceIndex) {
9135
+ var _a2;
9136
+ const index2 = await this.getSuperComponentIndex(familyInstanceIndex);
9137
+ if (index2 === void 0) {
9138
+ return void 0;
9139
+ }
9140
+ return await ((_a2 = this.document.element) == null ? void 0 : _a2.get(index2));
9141
+ }
9193
9142
  async getElementIndex(familyInstanceIndex) {
9194
9143
  return await this.entityTable.getNumber(familyInstanceIndex, "index:Vim.Element:Element");
9195
9144
  }
@@ -13362,7 +13311,6 @@ function requireDist$3() {
13362
13311
  __exportStar(requireG3dScene(), exports);
13363
13312
  __exportStar(requireRemoteBuffer(), exports);
13364
13313
  __exportStar(requireRequestTracker(), exports);
13365
- __exportStar(requireRequester(), exports);
13366
13314
  __exportStar(requireRemoteValue(), exports);
13367
13315
  __exportStar(requireVimHeader(), exports);
13368
13316
  __exportStar(requireObjectModel(), exports);
@@ -47922,13 +47870,12 @@ class StandardMaterial {
47922
47870
  #endif
47923
47871
  `
47924
47872
  );
47925
- console.log(shader.vertexShader);
47926
- console.log(shader.fragmentShader);
47927
47873
  };
47928
47874
  }
47929
47875
  }
47930
47876
  function createMaskMaterial() {
47931
47877
  return new ShaderMaterial({
47878
+ side: DoubleSide,
47932
47879
  uniforms: {},
47933
47880
  clipping: true,
47934
47881
  vertexShader: `
@@ -53644,7 +53591,7 @@ class GizmoOrbit {
53644
53591
  onUpdate() {
53645
53592
  this.updateScale();
53646
53593
  this.setPosition(this._camera.target);
53647
- this.show(true);
53594
+ this.show(this._inputs.pointerActive === "orbit");
53648
53595
  }
53649
53596
  /**
53650
53597
  * Determines whether the orbit gizmo is enabled.
@@ -53666,6 +53613,7 @@ class GizmoOrbit {
53666
53613
  }
53667
53614
  clearTimeout(this._timeout);
53668
53615
  this._gizmos.visible = show;
53616
+ this._renderer.needsUpdate = true;
53669
53617
  if (show) {
53670
53618
  this._timeout = setTimeout(() => {
53671
53619
  this._gizmos.visible = false;
@@ -61358,7 +61306,7 @@ class VimCollection {
61358
61306
  const defaultRenderSettings = {
61359
61307
  ...defaultSceneSettings,
61360
61308
  lockIblRotation: true,
61361
- ghostColor: new RGBA(0.7, 0.62, 0.66, 5e-3)
61309
+ ghostColor: new RGBA(14 / 255, 14 / 255, 14 / 255, 1 / 255)
61362
61310
  };
61363
61311
  class Renderer2 {
61364
61312
  /**
@@ -75820,7 +75768,7 @@ function body(url) {
75820
75768
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: vcRoboto, children: [
75821
75769
  mainText(/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
75822
75770
  "Oops, it appears that there’s an ",
75823
- bold("error starting a stream on the VIM Ulta Server"),
75771
+ bold("error starting a stream on the VIM Ultra Server"),
75824
75772
  ". Please check the following conditions to get back up and running quickly."
75825
75773
  ] })),
75826
75774
  subTitle("Troubleshooting tips:"),