vim-web 0.3.39 → 0.3.41
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 +2 -2
- package/dist/style.css +6 -0
- package/dist/types/core-viewers/ultra/index.d.ts +1 -0
- package/dist/types/core-viewers/ultra/viewer/logger.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/renderer.d.ts +3 -1
- package/dist/types/core-viewers/ultra/viewer/rpcClient.d.ts +1 -0
- package/dist/types/core-viewers/ultra/viewer/rpcSafeClient.d.ts +8 -3
- package/dist/types/core-viewers/ultra/viewer/viewer.d.ts +3 -3
- package/dist/types/core-viewers/ultra/viewer/viewport.d.ts +3 -1
- package/dist/types/core-viewers/ultra/viewer/vim.d.ts +4 -4
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxInputs.d.ts +1 -0
- package/dist/types/react-viewers/helpers/loadRequest.d.ts +1 -1
- package/dist/types/react-viewers/ultra/errors/serverFileDownloadingError.d.ts +1 -1
- package/dist/types/react-viewers/ultra/errors/ultraErrors.d.ts +1 -1
- package/dist/types/react-viewers/ultra/ultraComponent.d.ts +1 -1
- package/dist/types/react-viewers/webgl/webglLoading.d.ts +1 -1
- package/dist/vim-web.iife.js +147 -148
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +147 -148
- package/dist/vim-web.js.map +1 -1
- package/package.json +2 -2
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://
|
|
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://
|
|
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;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RGBA } from "../utils/math3d";
|
|
2
|
+
import { ILogger } from "./logger";
|
|
2
3
|
import { RpcSafeClient, SceneSettings } from "./rpcSafeClient";
|
|
3
4
|
import { ClientStreamError } from "./socketClient";
|
|
4
5
|
/**
|
|
@@ -32,6 +33,7 @@ export interface IRenderer {
|
|
|
32
33
|
*/
|
|
33
34
|
export declare class Renderer implements IRenderer {
|
|
34
35
|
private _rpc;
|
|
36
|
+
private _logger;
|
|
35
37
|
private _settings;
|
|
36
38
|
private _animationFrame;
|
|
37
39
|
private _updateLighting;
|
|
@@ -42,7 +44,7 @@ export declare class Renderer implements IRenderer {
|
|
|
42
44
|
* @param rpc - RPC client for communication with the rendering backend
|
|
43
45
|
* @param settings - Optional partial render settings to override defaults
|
|
44
46
|
*/
|
|
45
|
-
constructor(rpc: RpcSafeClient, settings?: Partial<RenderSettings>);
|
|
47
|
+
constructor(rpc: RpcSafeClient, logger: ILogger, settings?: Partial<RenderSettings>);
|
|
46
48
|
/**
|
|
47
49
|
* Validates the connection to the server by attempting to start a scene.
|
|
48
50
|
* @returns A promise that resolves to a ClientStreamError if the connection fails, or undefined if successful.
|
|
@@ -18,6 +18,7 @@ export declare const materialHandles: MaterialHandle[];
|
|
|
18
18
|
export declare class RpcClient {
|
|
19
19
|
private readonly _messenger;
|
|
20
20
|
get url(): string;
|
|
21
|
+
get connected(): boolean;
|
|
21
22
|
constructor(_messenger: SocketClient);
|
|
22
23
|
readonly API_VERSION = "5.0.0";
|
|
23
24
|
RPCAddNodeFlags(componentHandle: number, nodes: number[], flags: number): void;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Box3, RGBA, RGBA32, Segment, Vector2, Vector3 } from "../utils/math3d";
|
|
2
2
|
import { HitCheckResult } from "./marshal";
|
|
3
3
|
import { MaterialHandle, RpcClient } from "./rpcClient";
|
|
4
|
+
export type VimSource = {
|
|
5
|
+
url: string;
|
|
6
|
+
authToken?: string;
|
|
7
|
+
};
|
|
4
8
|
export type VimLoadingState = {
|
|
5
9
|
status: VimLoadingStatus;
|
|
6
10
|
progress: number;
|
|
@@ -34,6 +38,7 @@ export declare class RpcSafeClient {
|
|
|
34
38
|
private readonly rpc;
|
|
35
39
|
private readonly batchSize;
|
|
36
40
|
get url(): string;
|
|
41
|
+
get connected(): boolean;
|
|
37
42
|
constructor(rpc: RpcClient, batchSize?: number);
|
|
38
43
|
/*******************************************************************************
|
|
39
44
|
* SCENE MANAGEMENT METHODS
|
|
@@ -213,18 +218,18 @@ export declare class RpcSafeClient {
|
|
|
213
218
|
******************************************************************************/
|
|
214
219
|
/**
|
|
215
220
|
* Loads a VIM file from the local filesystem.
|
|
216
|
-
* @param
|
|
221
|
+
* @param source - The path to the VIM file (supports file:// protocol)
|
|
217
222
|
* @returns Promise resolving to the handle of the loaded VIM component
|
|
218
223
|
* @throws {Error} If the filename is invalid or empty
|
|
219
224
|
*/
|
|
220
|
-
RPCLoadVim(
|
|
225
|
+
RPCLoadVim(source: VimSource): Promise<number>;
|
|
221
226
|
/**
|
|
222
227
|
* Loads a VIM file from a remote URL.
|
|
223
228
|
* @param url - The URL of the VIM file to load
|
|
224
229
|
* @returns Promise resolving to the handle of the loaded VIM component
|
|
225
230
|
* @throws {Error} If the URL is invalid
|
|
226
231
|
*/
|
|
227
|
-
RPCLoadVimURL(
|
|
232
|
+
RPCLoadVimURL(source: VimSource): Promise<number>;
|
|
228
233
|
/**
|
|
229
234
|
* Retrieves the current loading state and progress of a VIM component.
|
|
230
235
|
* @param componentHandle - The handle of the VIM component
|
|
@@ -7,7 +7,7 @@ import { ILogger } from './logger';
|
|
|
7
7
|
import { IViewport } from './viewport';
|
|
8
8
|
import { ColorManager } from './colorManager';
|
|
9
9
|
import { ICamera } from './camera';
|
|
10
|
-
import { RpcSafeClient } from './rpcSafeClient';
|
|
10
|
+
import { RpcSafeClient, VimSource } from './rpcSafeClient';
|
|
11
11
|
import { ISimpleEvent } from 'ste-simple-events';
|
|
12
12
|
import { IReadonlyVimCollection } from './vimCollection';
|
|
13
13
|
import { IRenderer } from './renderer';
|
|
@@ -104,10 +104,10 @@ export declare class Viewer {
|
|
|
104
104
|
disconnect(): void;
|
|
105
105
|
/**
|
|
106
106
|
* Requests the server to load the given URL or file path.
|
|
107
|
-
* @param
|
|
107
|
+
* @param source - The path or URL to the VIM file.
|
|
108
108
|
* @returns A load request object that can be used to wait for the load to complete.
|
|
109
109
|
*/
|
|
110
|
-
loadVim(
|
|
110
|
+
loadVim(source: VimSource): ILoadRequest;
|
|
111
111
|
/**
|
|
112
112
|
* Unloads the given VIM from the viewer.
|
|
113
113
|
* @param vim - The VIM instance to unload.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ILogger } from "./logger";
|
|
1
2
|
import { RpcSafeClient } from "./rpcSafeClient";
|
|
2
3
|
/**
|
|
3
4
|
* Interface defining viewport functionality
|
|
@@ -15,6 +16,7 @@ export declare class Viewport {
|
|
|
15
16
|
/** The HTML canvas element used for rendering */
|
|
16
17
|
canvas: HTMLCanvasElement;
|
|
17
18
|
private _rpc;
|
|
19
|
+
private _logger;
|
|
18
20
|
private _observer;
|
|
19
21
|
private _clearTimeout;
|
|
20
22
|
/**
|
|
@@ -22,7 +24,7 @@ export declare class Viewport {
|
|
|
22
24
|
* @param canvas - The HTML canvas element to observe and manage
|
|
23
25
|
* @param rpc - RPC client for viewport communication
|
|
24
26
|
*/
|
|
25
|
-
constructor(canvas: HTMLCanvasElement, rpc: RpcSafeClient);
|
|
27
|
+
constructor(canvas: HTMLCanvasElement, rpc: RpcSafeClient, logger: ILogger);
|
|
26
28
|
/**
|
|
27
29
|
* Handles resize events for the canvas
|
|
28
30
|
* @private
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ColorHandle } from './color';
|
|
2
2
|
import { ColorManager } from './colorManager';
|
|
3
3
|
import { LoadRequest } from './loadRequest';
|
|
4
|
-
import { RpcSafeClient } from './rpcSafeClient';
|
|
4
|
+
import { RpcSafeClient, VimSource } from './rpcSafeClient';
|
|
5
5
|
import { ILogger } from './logger';
|
|
6
6
|
import { Box3 } from '../utils/math3d';
|
|
7
7
|
type NodeState = 'visible' | 'hidden' | 'ghosted' | 'highlighted';
|
|
8
8
|
export declare class Vim {
|
|
9
|
-
readonly source:
|
|
9
|
+
readonly source: VimSource;
|
|
10
10
|
private _handle;
|
|
11
11
|
private _request;
|
|
12
12
|
private readonly _rpc;
|
|
@@ -24,7 +24,7 @@ export declare class Vim {
|
|
|
24
24
|
* @param source - The source URL or file path of the Vim.
|
|
25
25
|
* @param logger - The logger for logging messages.
|
|
26
26
|
*/
|
|
27
|
-
constructor(rpc: RpcSafeClient, color: ColorManager, source:
|
|
27
|
+
constructor(rpc: RpcSafeClient, color: ColorManager, source: VimSource, logger: ILogger);
|
|
28
28
|
get handle(): number;
|
|
29
29
|
/**
|
|
30
30
|
* Indicates whether the Vim is connected.
|
|
@@ -44,7 +44,7 @@ export declare class Vim {
|
|
|
44
44
|
disconnect(): void;
|
|
45
45
|
/**
|
|
46
46
|
* Requests for the server to load the given URL or file path.
|
|
47
|
-
* @param
|
|
47
|
+
* @param source - The URL or file path to load.
|
|
48
48
|
* @param result - The load request object to update.
|
|
49
49
|
* @returns The updated load request.
|
|
50
50
|
*/
|
|
@@ -26,6 +26,7 @@ export declare class BoxInputs {
|
|
|
26
26
|
constructor(viewer: Viewer, cube: THREE.Object3D, box: THREE.Box3);
|
|
27
27
|
private reg;
|
|
28
28
|
register(): void;
|
|
29
|
+
onPointerLeave(event: PointerEvent): void;
|
|
29
30
|
capturePointer(pointerId: number): void;
|
|
30
31
|
releasePointer(): void;
|
|
31
32
|
unregister(): void;
|
|
@@ -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
|
|
19
|
+
constructor(callbacks: RequestCallbacks, source: VIM.RequestSource, settings?: VIM.VimPartialSettings);
|
|
20
20
|
private startRequest;
|
|
21
21
|
private onProgress;
|
|
22
22
|
private onSuccess;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MessageBoxProps } from '../../panels/messageBox';
|
|
2
|
-
export declare function serverFileDownloadingError(url: string, server?: string): MessageBoxProps;
|
|
2
|
+
export declare function serverFileDownloadingError(url: string, authToken?: string, server?: string): MessageBoxProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as Ultra from '../../../core-viewers/ultra';
|
|
2
2
|
export declare function getErrorMessage(state: Ultra.ClientState): import("../..").MessageBoxProps;
|
|
3
|
-
export declare function getRequestErrorMessage(
|
|
3
|
+
export declare function getRequestErrorMessage(source: Ultra.VimSource, error: Ultra.VimRequestErrorType): import("../..").MessageBoxProps;
|
|
@@ -5,7 +5,7 @@ export type UltraComponentRef = {
|
|
|
5
5
|
viewer: Ultra.Viewer;
|
|
6
6
|
modal: ModalRef;
|
|
7
7
|
dispose: () => void;
|
|
8
|
-
load(url:
|
|
8
|
+
load(url: Ultra.VimSource): Ultra.ILoadRequest;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Creates a UI container along with a VIM.Viewer and its associated React component.
|
|
@@ -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
|
|
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.
|