vim-web 0.3.44-dev.25 → 0.3.44-dev.27
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/types/core-viewers/ultra/viewer/inputs/{inputKeyboard.d.ts → keyboardHandler.d.ts} +1 -1
- package/dist/types/core-viewers/ultra/viewer/inputs/{inputMouse.d.ts → mouseHandler.d.ts} +1 -1
- package/dist/types/core-viewers/ultra/viewer/inputs/{InputTouch.d.ts → touchHandler.d.ts} +1 -1
- package/dist/types/core-viewers/ultra/viewer/vim.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/inputs/inputHandler.d.ts +1 -0
- package/dist/vim-web.iife.js +29 -26
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +29 -26
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
- /package/dist/types/react-viewers/helpers/{inputs.d.ts → componentInputs.d.ts} +0 -0
package/dist/types/core-viewers/ultra/viewer/inputs/{inputKeyboard.d.ts → keyboardHandler.d.ts}
RENAMED
|
@@ -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
|
|
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
|
|
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
|
|
3
|
+
export declare class TouchHandler extends InputHandler {
|
|
4
4
|
private readonly _rpc;
|
|
5
5
|
private readonly _canvas;
|
|
6
6
|
private _lastTouchStartPosition;
|
|
@@ -76,7 +76,7 @@ export declare class Vim {
|
|
|
76
76
|
* @param nodes - The nodes to remove the highlight from.
|
|
77
77
|
* @param fallback - The state to revert the nodes to.
|
|
78
78
|
*/
|
|
79
|
-
removeHighlight(nodes: number[], fallback: NodeState): void;
|
|
79
|
+
removeHighlight(nodes: number[] | 'all', fallback: NodeState): void;
|
|
80
80
|
/**
|
|
81
81
|
* Retrieves the bounding box of the given nodes.
|
|
82
82
|
* @param nodes - The nodes to get the bounding box for.
|
package/dist/vim-web.iife.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
59775
|
-
this._inputsTouch = new
|
|
59776
|
-
this._keyboard = new
|
|
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();
|
|
@@ -60782,11 +60780,20 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
60782
60780
|
*/
|
|
60783
60781
|
removeHighlight(nodes, fallback) {
|
|
60784
60782
|
const toUpdate = [];
|
|
60785
|
-
|
|
60786
|
-
const state
|
|
60787
|
-
|
|
60788
|
-
|
|
60789
|
-
|
|
60783
|
+
if (nodes === "all") {
|
|
60784
|
+
for (const [node, state] of this._nodeStates.entries()) {
|
|
60785
|
+
if (state === "highlighted") {
|
|
60786
|
+
this._nodeStates.set(node, fallback);
|
|
60787
|
+
toUpdate.push(node);
|
|
60788
|
+
}
|
|
60789
|
+
}
|
|
60790
|
+
} else {
|
|
60791
|
+
for (const node of nodes) {
|
|
60792
|
+
const state = this._nodeStates.get(node);
|
|
60793
|
+
if (state === "highlighted") {
|
|
60794
|
+
this._nodeStates.set(node, fallback);
|
|
60795
|
+
toUpdate.push(node);
|
|
60796
|
+
}
|
|
60790
60797
|
}
|
|
60791
60798
|
}
|
|
60792
60799
|
if (toUpdate.length > 0) {
|
|
@@ -61019,7 +61026,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
61019
61026
|
* Cleans up resources by removing resize observer and clearing timeouts
|
|
61020
61027
|
*/
|
|
61021
61028
|
dispose() {
|
|
61022
|
-
console.log("Disposing Viewport");
|
|
61023
61029
|
this._clearTimeout();
|
|
61024
61030
|
this._observer.disconnect();
|
|
61025
61031
|
}
|
|
@@ -61302,7 +61308,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
61302
61308
|
* @returns Promise that resolves when the framing animation is complete
|
|
61303
61309
|
*/
|
|
61304
61310
|
async frameAll(blendTime = this._defaultBlendTime) {
|
|
61305
|
-
console.log("Camera.frameAll");
|
|
61306
61311
|
const segment = await this._rpc.RPCFrameAll(blendTime);
|
|
61307
61312
|
this._savedPosition = this._savedPosition ?? segment;
|
|
61308
61313
|
return segment;
|
|
@@ -61313,7 +61318,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
61313
61318
|
* @param blendTime - Duration of the camera animation in seconds (defaults to 0.5)
|
|
61314
61319
|
*/
|
|
61315
61320
|
async frameBox(box, blendTime = this._defaultBlendTime) {
|
|
61316
|
-
console.log("Camera.frameAll");
|
|
61317
61321
|
const segment = await this._rpc.RPCFrameBox(box, blendTime);
|
|
61318
61322
|
this._savedPosition = this._savedPosition ?? segment;
|
|
61319
61323
|
return segment;
|
|
@@ -75978,7 +75982,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75978
75982
|
}, []);
|
|
75979
75983
|
const reset = useActionRef(() => adapter.resetCamera(1));
|
|
75980
75984
|
const frameSelection2 = useAsyncFuncRef(async () => {
|
|
75981
|
-
console.log("frameSelection");
|
|
75982
75985
|
if (!adapter.hasSelection()) {
|
|
75983
75986
|
frameScene.call();
|
|
75984
75987
|
return;
|