vim-web 0.3.44-dev.41 → 0.3.44-dev.44

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.
@@ -9,13 +9,14 @@ export interface CameraRef {
9
9
  reset: ActionRef;
10
10
  frameSelection: AsyncFuncRef<void>;
11
11
  frameScene: AsyncFuncRef<void>;
12
+ getSelectionBox: AsyncFuncRef<THREE.Box3 | undefined>;
13
+ getSceneBox: AsyncFuncRef<THREE.Box3 | undefined>;
12
14
  }
13
15
  interface ICameraAdapter {
14
16
  onSelectionChanged: ISignal;
15
17
  frameCamera: (box: THREE.Box3, duration: number) => void;
16
18
  resetCamera: (duration: number) => void;
17
- hasSelection: () => boolean;
18
- getSelectionBox: () => Promise<THREE.Box3>;
19
+ getSelectionBox: () => Promise<THREE.Box3 | undefined>;
19
20
  getSceneBox: () => Promise<THREE.Box3>;
20
21
  getSectionBox: () => THREE.Box3;
21
22
  isSectionBoxEnabled: () => boolean;
@@ -19,14 +19,16 @@ export interface SectionBoxRef {
19
19
  topOffset: StateRef<string>;
20
20
  sideOffset: StateRef<string>;
21
21
  bottomOffset: StateRef<string>;
22
+ getSelectionBox: AsyncFuncRef<THREE.Box3 | undefined>;
23
+ getSceneBox: AsyncFuncRef<THREE.Box3>;
22
24
  }
23
25
  export interface SectionBoxAdapter {
24
26
  setClip: (b: boolean) => void;
25
27
  setVisible: (visible: boolean) => void;
26
28
  getBox: () => THREE.Box3;
27
29
  setBox: (box: THREE.Box3) => void;
28
- getSelectionBox: () => Promise<THREE.Box3 | undefined>;
29
- getRendererBox: () => Promise<THREE.Box3>;
30
30
  onSelectionChanged: ISignal;
31
+ getSelectionBox: () => Promise<THREE.Box3 | undefined>;
32
+ getSceneBox: () => Promise<THREE.Box3>;
31
33
  }
32
34
  export declare function useSectionBox(adapter: SectionBoxAdapter): SectionBoxRef;
@@ -27968,8 +27968,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
27968
27968
  const times = [];
27969
27969
  const values = [];
27970
27970
  for (let j = 0; j < track.times.length; ++j) {
27971
- const frame = track.times[j] * fps;
27972
- if (frame < startFrame || frame >= endFrame) continue;
27971
+ const frame2 = track.times[j] * fps;
27972
+ if (frame2 < startFrame || frame2 >= endFrame) continue;
27973
27973
  times.push(track.times[j]);
27974
27974
  for (let k = 0; k < valueSize; ++k) {
27975
27975
  values.push(track.values[j * valueSize + k]);
@@ -34527,8 +34527,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
34527
34527
  let isAnimating = false;
34528
34528
  let animationLoop = null;
34529
34529
  let requestId = null;
34530
- function onAnimationFrame(time, frame) {
34531
- animationLoop(time, frame);
34530
+ function onAnimationFrame(time, frame2) {
34531
+ animationLoop(time, frame2);
34532
34532
  requestId = context.requestAnimationFrame(onAnimationFrame);
34533
34533
  }
34534
34534
  return {
@@ -37186,30 +37186,30 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
37186
37186
  function WebGLObjects(gl, geometries, attributes, info) {
37187
37187
  let updateMap = /* @__PURE__ */ new WeakMap();
37188
37188
  function update(object) {
37189
- const frame = info.render.frame;
37189
+ const frame2 = info.render.frame;
37190
37190
  const geometry = object.geometry;
37191
37191
  const buffergeometry = geometries.get(object, geometry);
37192
- if (updateMap.get(buffergeometry) !== frame) {
37192
+ if (updateMap.get(buffergeometry) !== frame2) {
37193
37193
  geometries.update(buffergeometry);
37194
- updateMap.set(buffergeometry, frame);
37194
+ updateMap.set(buffergeometry, frame2);
37195
37195
  }
37196
37196
  if (object.isInstancedMesh) {
37197
37197
  if (object.hasEventListener("dispose", onInstancedMeshDispose) === false) {
37198
37198
  object.addEventListener("dispose", onInstancedMeshDispose);
37199
37199
  }
37200
- if (updateMap.get(object) !== frame) {
37200
+ if (updateMap.get(object) !== frame2) {
37201
37201
  attributes.update(object.instanceMatrix, gl.ARRAY_BUFFER);
37202
37202
  if (object.instanceColor !== null) {
37203
37203
  attributes.update(object.instanceColor, gl.ARRAY_BUFFER);
37204
37204
  }
37205
- updateMap.set(object, frame);
37205
+ updateMap.set(object, frame2);
37206
37206
  }
37207
37207
  }
37208
37208
  if (object.isSkinnedMesh) {
37209
37209
  const skeleton = object.skeleton;
37210
- if (updateMap.get(skeleton) !== frame) {
37210
+ if (updateMap.get(skeleton) !== frame2) {
37211
37211
  skeleton.update();
37212
- updateMap.set(skeleton, frame);
37212
+ updateMap.set(skeleton, frame2);
37213
37213
  }
37214
37214
  }
37215
37215
  return buffergeometry;
@@ -41713,9 +41713,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
41713
41713
  return renderTarget.samples > 0 && extensions.has("WEBGL_multisampled_render_to_texture") === true && renderTargetProperties.__useRenderToTexture !== false;
41714
41714
  }
41715
41715
  function updateVideoTexture(texture) {
41716
- const frame = info.render.frame;
41717
- if (_videoTextures.get(texture) !== frame) {
41718
- _videoTextures.set(texture, frame);
41716
+ const frame2 = info.render.frame;
41717
+ if (_videoTextures.get(texture) !== frame2) {
41718
+ _videoTextures.set(texture, frame2);
41719
41719
  texture.update();
41720
41720
  }
41721
41721
  }
@@ -41957,18 +41957,18 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
41957
41957
  }
41958
41958
  return this;
41959
41959
  }
41960
- update(inputSource, frame, referenceSpace) {
41960
+ update(inputSource, frame2, referenceSpace) {
41961
41961
  let inputPose = null;
41962
41962
  let gripPose = null;
41963
41963
  let handPose = null;
41964
41964
  const targetRay = this._targetRay;
41965
41965
  const grip = this._grip;
41966
41966
  const hand = this._hand;
41967
- if (inputSource && frame.session.visibilityState !== "visible-blurred") {
41967
+ if (inputSource && frame2.session.visibilityState !== "visible-blurred") {
41968
41968
  if (hand && inputSource.hand) {
41969
41969
  handPose = true;
41970
41970
  for (const inputjoint of inputSource.hand.values()) {
41971
- const jointPose = frame.getJointPose(inputjoint, referenceSpace);
41971
+ const jointPose = frame2.getJointPose(inputjoint, referenceSpace);
41972
41972
  const joint = this._getHandJoint(hand, inputjoint);
41973
41973
  if (jointPose !== null) {
41974
41974
  joint.matrix.fromArray(jointPose.transform.matrix);
@@ -42000,7 +42000,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
42000
42000
  }
42001
42001
  } else {
42002
42002
  if (grip !== null && inputSource.gripSpace) {
42003
- gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
42003
+ gripPose = frame2.getPose(inputSource.gripSpace, referenceSpace);
42004
42004
  if (gripPose !== null) {
42005
42005
  grip.matrix.fromArray(gripPose.transform.matrix);
42006
42006
  grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
@@ -42021,7 +42021,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
42021
42021
  }
42022
42022
  }
42023
42023
  if (targetRay !== null) {
42024
- inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace);
42024
+ inputPose = frame2.getPose(inputSource.targetRaySpace, referenceSpace);
42025
42025
  if (inputPose === null && gripPose !== null) {
42026
42026
  inputPose = gripPose;
42027
42027
  }
@@ -42511,9 +42511,9 @@ void main() {
42511
42511
  return depthSensing.getMesh(cameraXR);
42512
42512
  };
42513
42513
  let onAnimationFrameCallback = null;
42514
- function onAnimationFrame(time, frame) {
42515
- pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
42516
- xrFrame = frame;
42514
+ function onAnimationFrame(time, frame2) {
42515
+ pose = frame2.getViewerPose(customReferenceSpace || referenceSpace);
42516
+ xrFrame = frame2;
42517
42517
  if (pose !== null) {
42518
42518
  const views = pose.views;
42519
42519
  if (glBaseLayer !== null) {
@@ -42574,12 +42574,12 @@ void main() {
42574
42574
  const inputSource = controllerInputSources[i2];
42575
42575
  const controller = controllers[i2];
42576
42576
  if (inputSource !== null && controller !== void 0) {
42577
- controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
42577
+ controller.update(inputSource, frame2, customReferenceSpace || referenceSpace);
42578
42578
  }
42579
42579
  }
42580
- if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
42581
- if (frame.detectedPlanes) {
42582
- scope.dispatchEvent({ type: "planesdetected", data: frame });
42580
+ if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame2);
42581
+ if (frame2.detectedPlanes) {
42582
+ scope.dispatchEvent({ type: "planesdetected", data: frame2 });
42583
42583
  }
42584
42584
  xrFrame = null;
42585
42585
  }
@@ -42922,10 +42922,10 @@ void main() {
42922
42922
  }
42923
42923
  const webglProgram = program.program;
42924
42924
  state.updateUBOMapping(uniformsGroup, webglProgram);
42925
- const frame = info.render.frame;
42926
- if (updateList[uniformsGroup.id] !== frame) {
42925
+ const frame2 = info.render.frame;
42926
+ if (updateList[uniformsGroup.id] !== frame2) {
42927
42927
  updateBufferData(uniformsGroup);
42928
- updateList[uniformsGroup.id] = frame;
42928
+ updateList[uniformsGroup.id] = frame2;
42929
42929
  }
42930
42930
  }
42931
42931
  function createBuffer(uniformsGroup) {
@@ -58306,10 +58306,10 @@ Averrage Date/Second ${avgDataRatePS} kb
58306
58306
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
58307
58307
  this.clear();
58308
58308
  }
58309
- draw(frame) {
58309
+ draw(frame2) {
58310
58310
  if (this.canvas !== null) {
58311
- this.canvas.width = frame.displayWidth;
58312
- this.canvas.height = frame.displayHeight;
58311
+ this.canvas.width = frame2.displayWidth;
58312
+ this.canvas.height = frame2.displayHeight;
58313
58313
  }
58314
58314
  const gl = this.ctx;
58315
58315
  if (gl !== null) {
@@ -58319,7 +58319,7 @@ Averrage Date/Second ${avgDataRatePS} kb
58319
58319
  gl.RGBA,
58320
58320
  gl.RGBA,
58321
58321
  gl.UNSIGNED_BYTE,
58322
- frame
58322
+ frame2
58323
58323
  );
58324
58324
  gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
58325
58325
  this.clear();
@@ -58441,11 +58441,11 @@ Averrage Date/Second ${avgDataRatePS} kb
58441
58441
  * to maintain decoder stability.
58442
58442
  * @param frame - The video frame message to be queued for decoding
58443
58443
  */
58444
- enqueue(frame) {
58445
- if (frame.header.frameType === 0 && this._queue.length > 0) {
58444
+ enqueue(frame2) {
58445
+ if (frame2.header.frameType === 0 && this._queue.length > 0) {
58446
58446
  this._queue.length = this._firstDecoded ? 0 : 1;
58447
58447
  }
58448
- this._queue.push(frame);
58448
+ this._queue.push(frame2);
58449
58449
  }
58450
58450
  /**
58451
58451
  * Processes and decodes all queued video frame messages.
@@ -58536,11 +58536,11 @@ Averrage Date/Second ${avgDataRatePS} kb
58536
58536
  * @param frame - The decoded video frame ready for rendering
58537
58537
  * @private
58538
58538
  */
58539
- renderFrame(frame) {
58539
+ renderFrame(frame2) {
58540
58540
  if (this._pendingFrame !== void 0) {
58541
58541
  this._pendingFrame.close();
58542
58542
  }
58543
- this._pendingFrame = frame;
58543
+ this._pendingFrame = frame2;
58544
58544
  }
58545
58545
  }
58546
58546
  class MaterialHandles {
@@ -61031,7 +61031,7 @@ Averrage Date/Second ${avgDataRatePS} kb
61031
61031
  const defaultRenderSettings = {
61032
61032
  ...defaultSceneSettings,
61033
61033
  lockIblRotation: true,
61034
- ghostColor: new RGBA(14 / 255, 14 / 255, 14 / 255, 1 / 255)
61034
+ ghostColor: new RGBA(1, 1, 1, 1 / 255)
61035
61035
  };
61036
61036
  class Renderer {
61037
61037
  /**
@@ -62026,9 +62026,9 @@ Averrage Date/Second ${avgDataRatePS} kb
62026
62026
  return "";
62027
62027
  }
62028
62028
  {
62029
- var frame = componentFrameCache.get(fn);
62030
- if (frame !== void 0) {
62031
- return frame;
62029
+ var frame2 = componentFrameCache.get(fn);
62030
+ if (frame2 !== void 0) {
62031
+ return frame2;
62032
62032
  }
62033
62033
  }
62034
62034
  var control;
@@ -75395,6 +75395,8 @@ Averrage Date/Second ${avgDataRatePS} kb
75395
75395
  const sideOffset = useStateRef("1");
75396
75396
  const bottomOffset = useStateRef("1");
75397
75397
  const boxRef = React2.useRef(adapter.getBox());
75398
+ const getSelectionBox = useAsyncFuncRef(adapter.getSelectionBox);
75399
+ const getSceneBox = useAsyncFuncRef(adapter.getSceneBox);
75398
75400
  React2.useEffect(() => {
75399
75401
  adapter.setVisible(false);
75400
75402
  adapter.setClip(false);
@@ -75409,7 +75411,7 @@ Averrage Date/Second ${avgDataRatePS} kb
75409
75411
  if (v && auto.get()) {
75410
75412
  sectionSelection.call();
75411
75413
  } else {
75412
- sectionReset.call();
75414
+ sectionScene.call();
75413
75415
  }
75414
75416
  });
75415
75417
  visible2.useValidate((v) => enable.get() && v);
@@ -75431,15 +75433,11 @@ Averrage Date/Second ${avgDataRatePS} kb
75431
75433
  adapter.setBox(newBox);
75432
75434
  });
75433
75435
  const sectionSelection = useFuncRef(async () => {
75434
- try {
75435
- const box = await adapter.getSelectionBox() ?? await adapter.getRendererBox();
75436
- sectionBox2.call(box);
75437
- } catch (e) {
75438
- console.error(e);
75439
- }
75436
+ const box = await getSelectionBox.call() ?? await getSceneBox.call();
75437
+ sectionBox2.call(box);
75440
75438
  });
75441
- const sectionReset = useFuncRef(async () => {
75442
- const box = await adapter.getRendererBox();
75439
+ const sectionScene = useFuncRef(async () => {
75440
+ const box = await getSceneBox.call();
75443
75441
  sectionBox2.call(box);
75444
75442
  });
75445
75443
  return {
@@ -75451,9 +75449,11 @@ Averrage Date/Second ${avgDataRatePS} kb
75451
75449
  sideOffset,
75452
75450
  bottomOffset,
75453
75451
  sectionSelection,
75454
- sectionReset,
75452
+ sectionReset: sectionScene,
75455
75453
  sectionBox: sectionBox2,
75456
- getBox: () => adapter.getBox()
75454
+ getBox: () => adapter.getBox(),
75455
+ getSceneBox,
75456
+ getSelectionBox
75457
75457
  };
75458
75458
  }
75459
75459
  const sanitize = (value, strict) => {
@@ -75488,7 +75488,7 @@ Averrage Date/Second ${avgDataRatePS} kb
75488
75488
  getBox: () => viewer.gizmos.sectionBox.getBox(),
75489
75489
  setBox: (box) => viewer.gizmos.sectionBox.setBox(box),
75490
75490
  getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
75491
- getRendererBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
75491
+ getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
75492
75492
  onSelectionChanged: viewer.selection.onValueChanged
75493
75493
  };
75494
75494
  return useSectionBox(vimAdapter);
@@ -75508,26 +75508,26 @@ Averrage Date/Second ${avgDataRatePS} kb
75508
75508
  });
75509
75509
  }, []);
75510
75510
  const reset = useActionRef(() => adapter.resetCamera(1));
75511
+ const getSelectionBox = useAsyncFuncRef(adapter.getSelectionBox);
75512
+ const getSceneBox = useAsyncFuncRef(adapter.getSceneBox);
75511
75513
  const frameSelection2 = useAsyncFuncRef(async () => {
75512
- if (!adapter.hasSelection()) {
75513
- frameScene.call();
75514
- return;
75515
- }
75516
- frameBox(adapter, () => adapter.getSelectionBox());
75514
+ const box = await getSelectionBox.call() ?? await getSceneBox.call();
75515
+ frame(adapter, box);
75517
75516
  });
75518
75517
  const frameScene = useAsyncFuncRef(async () => {
75519
- frameBox(adapter, () => adapter.getSceneBox());
75518
+ const box = await getSceneBox.call();
75519
+ frame(adapter, box);
75520
75520
  });
75521
75521
  return {
75522
+ getSelectionBox,
75523
+ getSceneBox,
75522
75524
  autoCamera: autoCamera2,
75523
75525
  reset,
75524
75526
  frameSelection: frameSelection2,
75525
75527
  frameScene
75526
75528
  };
75527
75529
  }
75528
- async function frameBox(adapter, getBox) {
75529
- const box = await getBox();
75530
- if (!box) return;
75530
+ function frame(adapter, box) {
75531
75531
  if (adapter.isSectionBoxEnabled()) {
75532
75532
  const section = adapter.getSectionBox();
75533
75533
  if (section) {
@@ -75544,7 +75544,6 @@ Averrage Date/Second ${avgDataRatePS} kb
75544
75544
  onSelectionChanged: viewer.selection.onValueChanged,
75545
75545
  frameCamera: (box, duration) => viewer.camera.lerp(duration).frame(box),
75546
75546
  resetCamera: (duration) => viewer.camera.lerp(duration).reset(),
75547
- hasSelection: () => viewer.selection.count > 0,
75548
75547
  getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
75549
75548
  getSectionBox: () => viewer.renderer.section.box,
75550
75549
  getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
@@ -76043,17 +76042,17 @@ Averrage Date/Second ${avgDataRatePS} kb
76043
76042
  },
76044
76043
  getBox: () => viewer.sectionBox.getBox(),
76045
76044
  setBox: (box) => viewer.sectionBox.fitBox(box),
76045
+ onSelectionChanged: viewer.selection.onValueChanged,
76046
76046
  getSelectionBox: () => viewer.selection.getBoundingBox(),
76047
- getRendererBox: () => viewer.renderer.getBoundingBox(),
76048
- onSelectionChanged: viewer.selection.onValueChanged
76047
+ getSceneBox: () => viewer.renderer.getBoundingBox()
76049
76048
  };
76050
76049
  return useSectionBox(ultraAdapter);
76051
76050
  }
76052
76051
  function useUltraControlBar(viewer, section, camera2, customization) {
76053
76052
  const sectionSectionBox = controlBarSectionBox(section, viewer.selection.count > 0);
76054
76053
  const sectionCamera = controlBarCamera(camera2);
76055
- const frame = frameSection(camera2);
76056
- let bar = [sectionCamera, frame, sectionSectionBox];
76054
+ const frame2 = frameSection(camera2);
76055
+ let bar = [sectionCamera, frame2, sectionSectionBox];
76057
76056
  bar = (customization == null ? void 0 : customization(bar)) ?? bar;
76058
76057
  return bar;
76059
76058
  }
@@ -76080,7 +76079,6 @@ Averrage Date/Second ${avgDataRatePS} kb
76080
76079
  onSelectionChanged: viewer.selection.onValueChanged,
76081
76080
  frameCamera: (box, duration) => void viewer.camera.frameBox(box, duration),
76082
76081
  resetCamera: (duration) => viewer.camera.restoreSavedPosition(duration),
76083
- hasSelection: () => viewer.selection.count > 0,
76084
76082
  getSelectionBox: () => viewer.selection.getBoundingBox(),
76085
76083
  getSceneBox: () => viewer.renderer.getBoundingBox(),
76086
76084
  getSectionBox: () => viewer.sectionBox.getBox(),