vim-web 0.3.44-dev.2 → 0.3.44-dev.21
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/style.css +38 -1
- package/dist/types/core-viewers/ultra/index.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/camera.d.ts +2 -1
- package/dist/types/core-viewers/ultra/viewer/inputs/inputMouse.d.ts +6 -5
- package/dist/types/core-viewers/ultra/viewer/marshal.d.ts +0 -1
- package/dist/types/core-viewers/ultra/viewer/rpcClient.d.ts +1 -0
- package/dist/types/core-viewers/ultra/viewer/rpcSafeClient.d.ts +1 -0
- package/dist/types/core-viewers/ultra/viewer/sectionBox.d.ts +2 -5
- package/dist/types/core-viewers/ultra/viewer/selection.d.ts +2 -0
- package/dist/types/core-viewers/ultra/viewer/viewer.d.ts +2 -0
- package/dist/types/core-viewers/ultra/viewer/vimCollection.d.ts +4 -0
- package/dist/types/core-viewers/webgl/utils/threeUtils.d.ts +3 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/gizmos.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBox.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxHandle.d.ts +2 -0
- package/dist/types/react-viewers/bim/bimPanel.d.ts +3 -3
- package/dist/types/react-viewers/bim/bimTree.d.ts +2 -2
- package/dist/types/react-viewers/controlbar/controlBar.d.ts +6 -44
- package/dist/types/react-viewers/controlbar/controlBarButton.d.ts +3 -1
- package/dist/types/react-viewers/controlbar/controlBarIds.d.ts +29 -0
- package/dist/types/react-viewers/controlbar/controlBarSection.d.ts +2 -1
- package/dist/types/react-viewers/helpers/inputs.d.ts +2 -2
- package/dist/types/react-viewers/helpers/isolation.d.ts +2 -2
- package/dist/types/react-viewers/helpers/reactUtils.d.ts +39 -0
- package/dist/types/react-viewers/index.d.ts +4 -0
- package/dist/types/react-viewers/panels/axesPanel.d.ts +2 -2
- package/dist/types/react-viewers/panels/contextMenu.d.ts +2 -2
- package/dist/types/react-viewers/panels/icons.d.ts +7 -0
- package/dist/types/react-viewers/panels/sectionBoxPanel.d.ts +4 -0
- package/dist/types/react-viewers/state/cameraState.d.ts +22 -0
- package/dist/types/react-viewers/state/controlBarState.d.ts +64 -0
- package/dist/types/react-viewers/state/sectionBoxState.d.ts +30 -0
- package/dist/types/react-viewers/ultra/index.d.ts +1 -0
- package/dist/types/react-viewers/ultra/ultraCameraState.d.ts +2 -0
- package/dist/types/react-viewers/ultra/ultraComponent.d.ts +1 -7
- package/dist/types/react-viewers/ultra/ultraComponentRef.d.ts +36 -0
- package/dist/types/react-viewers/ultra/ultraControlBarState.d.ts +19 -0
- package/dist/types/react-viewers/ultra/ultraModal.d.ts +4 -0
- package/dist/types/react-viewers/ultra/ultraSectionBoxState.d.ts +3 -0
- package/dist/types/react-viewers/webgl/index.d.ts +0 -1
- package/dist/types/react-viewers/webgl/webglCameraState.d.ts +2 -0
- package/dist/types/react-viewers/webgl/webglComponentRef.d.ts +7 -2
- package/dist/types/react-viewers/webgl/webglSectionBoxState.d.ts +3 -0
- package/dist/vim-web.iife.js +999 -424
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +1000 -425
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/react-viewers/controlbar/controlBarCommands.d.ts +0 -4
- package/dist/types/react-viewers/controlbar/sectionBoxState.d.ts +0 -15
- package/dist/types/react-viewers/helpers/camera.d.ts +0 -37
- /package/dist/types/react-viewers/{controlbar → panels}/restOfScreen.d.ts +0 -0
- /package/dist/types/react-viewers/{controlbar → state}/fullScreenState.d.ts +0 -0
- /package/dist/types/react-viewers/{controlbar → state}/measureState.d.ts +0 -0
- /package/dist/types/react-viewers/{controlbar → state}/pointerState.d.ts +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as VIM from '../../core-viewers/webgl/index';
|
|
2
|
+
import { CameraRef } from './cameraState';
|
|
3
|
+
import { CursorManager } from '../helpers/cursor';
|
|
4
|
+
import { Isolation } from '../helpers/isolation';
|
|
5
|
+
import { ComponentSettings } from '../settings/settings';
|
|
6
|
+
import { SideState } from '../sidePanel/sideState';
|
|
7
|
+
import * as Icons from '../panels/icons';
|
|
8
|
+
import { SectionBoxRef } from './sectionBoxState';
|
|
9
|
+
import { ModalRef } from '../panels/modal';
|
|
10
|
+
import * as ControlBar from '../controlbar/controlBar';
|
|
11
|
+
/**
|
|
12
|
+
* Returns a control bar section for the section box.
|
|
13
|
+
*/
|
|
14
|
+
export declare function controlBarSectionBox(section: SectionBoxRef, hasSelection: boolean): ControlBar.IControlBarSection;
|
|
15
|
+
export declare function controlBarCamera(camera: CameraRef): {
|
|
16
|
+
id: string;
|
|
17
|
+
enable: () => boolean;
|
|
18
|
+
style: string;
|
|
19
|
+
buttons: {
|
|
20
|
+
id: string;
|
|
21
|
+
tip: string;
|
|
22
|
+
isOn: () => boolean;
|
|
23
|
+
action: () => void;
|
|
24
|
+
icon: typeof Icons.autoCamera;
|
|
25
|
+
style: typeof ControlBar.buttonDefaultStyle;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Combines all control bar sections into one control bar.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useControlBar(viewer: VIM.Viewer, camera: CameraRef, modal: ModalRef, side: SideState, isolation: Isolation, cursor: CursorManager, settings: ComponentSettings, section: SectionBoxRef, customization: ControlBar.ControlBarCustomization | undefined): (ControlBar.IControlBarSection | {
|
|
32
|
+
id: string;
|
|
33
|
+
enable: () => boolean;
|
|
34
|
+
style: string;
|
|
35
|
+
buttons: ({
|
|
36
|
+
id: string;
|
|
37
|
+
enabled: () => boolean;
|
|
38
|
+
tip: string;
|
|
39
|
+
action: () => void;
|
|
40
|
+
icon: typeof Icons.toggleIsolation;
|
|
41
|
+
style: typeof ControlBar.buttonDefaultStyle;
|
|
42
|
+
isOn?: undefined;
|
|
43
|
+
} | {
|
|
44
|
+
id: string;
|
|
45
|
+
enabled: () => boolean;
|
|
46
|
+
isOn: () => boolean;
|
|
47
|
+
tip: string;
|
|
48
|
+
action: () => void;
|
|
49
|
+
icon: typeof Icons.measure;
|
|
50
|
+
style: typeof ControlBar.buttonDefaultStyle;
|
|
51
|
+
})[];
|
|
52
|
+
} | {
|
|
53
|
+
id: string;
|
|
54
|
+
enable: () => boolean;
|
|
55
|
+
style: string;
|
|
56
|
+
buttons: {
|
|
57
|
+
id: string;
|
|
58
|
+
tip: string;
|
|
59
|
+
isOn: () => boolean;
|
|
60
|
+
action: () => void;
|
|
61
|
+
icon: typeof Icons.autoCamera;
|
|
62
|
+
style: typeof ControlBar.buttonDefaultStyle;
|
|
63
|
+
}[];
|
|
64
|
+
})[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { ISignal } from 'ste-signals';
|
|
3
|
+
import { ArgActionRef, AsyncFuncRef, StateRef } from '../helpers/reactUtils';
|
|
4
|
+
export type Offsets = {
|
|
5
|
+
topOffset: string;
|
|
6
|
+
sideOffset: string;
|
|
7
|
+
bottomOffset: string;
|
|
8
|
+
};
|
|
9
|
+
export type OffsetField = keyof Offsets;
|
|
10
|
+
export interface SectionBoxRef {
|
|
11
|
+
enable: StateRef<boolean>;
|
|
12
|
+
visible: StateRef<boolean>;
|
|
13
|
+
auto: StateRef<boolean>;
|
|
14
|
+
sectionSelection: AsyncFuncRef<void>;
|
|
15
|
+
sectionReset: AsyncFuncRef<void>;
|
|
16
|
+
section: ArgActionRef<THREE.Box3>;
|
|
17
|
+
showOffsetPanel: StateRef<boolean>;
|
|
18
|
+
topOffset: StateRef<string>;
|
|
19
|
+
sideOffset: StateRef<string>;
|
|
20
|
+
bottomOffset: StateRef<string>;
|
|
21
|
+
}
|
|
22
|
+
export interface SectionBoxAdapter {
|
|
23
|
+
setVisible: (visible: boolean) => void;
|
|
24
|
+
getBox: () => THREE.Box3;
|
|
25
|
+
fitBox: (box: THREE.Box3) => void;
|
|
26
|
+
getSelectionBox: () => Promise<THREE.Box3 | undefined>;
|
|
27
|
+
getRendererBox: () => Promise<THREE.Box3>;
|
|
28
|
+
onSelectionChanged: ISignal;
|
|
29
|
+
}
|
|
30
|
+
export declare function useSectionBox(adapter: SectionBoxAdapter): SectionBoxRef;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import * as Ultra from '../../core-viewers/ultra/index';
|
|
2
2
|
import { Container } from '../container';
|
|
3
|
-
import {
|
|
4
|
-
export type UltraComponentRef = {
|
|
5
|
-
viewer: Ultra.Viewer;
|
|
6
|
-
modal: ModalRef;
|
|
7
|
-
dispose: () => void;
|
|
8
|
-
load(url: Ultra.VimSource): Ultra.ILoadRequest;
|
|
9
|
-
};
|
|
3
|
+
import { UltraComponentRef } from './ultraComponentRef';
|
|
10
4
|
/**
|
|
11
5
|
* Creates a UI container along with a VIM.Viewer and its associated React component.
|
|
12
6
|
* @param container An optional container object. If none is provided, a container will be created.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as Ultra from '../../core-viewers/ultra';
|
|
2
|
+
import { ModalRef } from '../panels/modal';
|
|
3
|
+
import { CameraRef } from '../state/cameraState';
|
|
4
|
+
import { SectionBoxRef } from '../state/sectionBoxState';
|
|
5
|
+
import { ControlBarRef } from '../webgl/webglComponentRef';
|
|
6
|
+
export type UltraComponentRef = {
|
|
7
|
+
/**
|
|
8
|
+
* The Vim viewer instance associated with the component.
|
|
9
|
+
*/
|
|
10
|
+
viewer: Ultra.Viewer;
|
|
11
|
+
/**
|
|
12
|
+
* API to manage the modal dialog.
|
|
13
|
+
*/
|
|
14
|
+
modal: ModalRef;
|
|
15
|
+
/**
|
|
16
|
+
* API to manage the section box.
|
|
17
|
+
*/
|
|
18
|
+
sectionBox: SectionBoxRef;
|
|
19
|
+
/**
|
|
20
|
+
* API to customize the control.
|
|
21
|
+
*/
|
|
22
|
+
controlBar: ControlBarRef;
|
|
23
|
+
/**
|
|
24
|
+
* Camera API to interact with the viewer camera at a higher level.
|
|
25
|
+
*/
|
|
26
|
+
camera: CameraRef;
|
|
27
|
+
/**
|
|
28
|
+
* Disposes of the component and its resources.
|
|
29
|
+
*/
|
|
30
|
+
dispose: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Loads a file into the viewer.
|
|
33
|
+
* @param url The URL of the file to load.
|
|
34
|
+
*/
|
|
35
|
+
load(url: Ultra.VimSource): Ultra.ILoadRequest;
|
|
36
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ControlBarCustomization } from '../controlbar/controlBar';
|
|
2
|
+
import { SectionBoxRef } from '../state/sectionBoxState';
|
|
3
|
+
import * as Ultra from '../../core-viewers/ultra/index';
|
|
4
|
+
import { CameraRef } from '../state/cameraState';
|
|
5
|
+
export { buttonDefaultStyle, buttonBlueStyle } from '../controlbar/controlBarButton';
|
|
6
|
+
export { sectionDefaultStyle, sectionBlueStyle } from '../controlbar/controlBarSection';
|
|
7
|
+
export declare function useUltraControlBar(viewer: Ultra.Viewer, section: SectionBoxRef, camera: CameraRef, customization: ControlBarCustomization | undefined): (import("../controlbar/controlBarSection").IControlBarSection | {
|
|
8
|
+
id: string;
|
|
9
|
+
enable: () => boolean;
|
|
10
|
+
style: string;
|
|
11
|
+
buttons: {
|
|
12
|
+
id: string;
|
|
13
|
+
tip: string;
|
|
14
|
+
isOn: () => boolean;
|
|
15
|
+
action: () => void;
|
|
16
|
+
icon: typeof import("../panels/icons").autoCamera;
|
|
17
|
+
style: typeof import("../controlbar/controlBarButton").buttonDefaultStyle;
|
|
18
|
+
}[];
|
|
19
|
+
})[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ModalRef } from "../panels/modal";
|
|
2
|
+
import * as Ultra from '../../core-viewers/ultra/index';
|
|
3
|
+
export declare function updateModal(modal: ModalRef, state: Ultra.ClientState): void;
|
|
4
|
+
export declare function updateProgress(request: Ultra.ILoadRequest, modal: ModalRef): Promise<void>;
|
|
@@ -5,12 +5,13 @@ import * as VIM from '../../core-viewers/webgl/index';
|
|
|
5
5
|
import { ContextMenuCustomization } from '../panels/contextMenu';
|
|
6
6
|
import { ComponentSettings } from '../settings/settings';
|
|
7
7
|
import { Isolation } from '../helpers/isolation';
|
|
8
|
-
import {
|
|
8
|
+
import { CameraRef } from '../state/cameraState';
|
|
9
9
|
import { Container } from '../container';
|
|
10
10
|
import { BimInfoPanelRef } from '../bim/bimInfoData';
|
|
11
11
|
import { ControlBarCustomization } from '../controlbar/controlBar';
|
|
12
12
|
import { ComponentLoader } from './webglLoading';
|
|
13
13
|
import { ModalRef } from '../panels/modal';
|
|
14
|
+
import { SectionBoxRef } from '../state/sectionBoxState';
|
|
14
15
|
/**
|
|
15
16
|
* Settings API managing settings applied to the component.
|
|
16
17
|
*/
|
|
@@ -82,6 +83,10 @@ export type VimComponentRef = {
|
|
|
82
83
|
* Isolation API managing isolation state in the component.
|
|
83
84
|
*/
|
|
84
85
|
isolation: Isolation;
|
|
86
|
+
/**
|
|
87
|
+
* Section box API managing the section box in the component.
|
|
88
|
+
*/
|
|
89
|
+
sectionBox: SectionBoxRef;
|
|
85
90
|
/**
|
|
86
91
|
* Context menu API managing the content and behavior of the context menu.
|
|
87
92
|
*/
|
|
@@ -101,7 +106,7 @@ export type VimComponentRef = {
|
|
|
101
106
|
/**
|
|
102
107
|
* Camera API to interact with the viewer camera at a higher level.
|
|
103
108
|
*/
|
|
104
|
-
camera:
|
|
109
|
+
camera: CameraRef;
|
|
105
110
|
/**
|
|
106
111
|
* API To interact with the BIM info panel.
|
|
107
112
|
*/
|