vim-web 0.3.44-dev.70 → 0.3.44-dev.72
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/react-viewers/generic/genericField.d.ts +26 -0
- package/dist/types/react-viewers/generic/genericPanel.d.ts +12 -0
- package/dist/types/react-viewers/generic/index.d.ts +2 -0
- package/dist/types/react-viewers/helpers/customizer.d.ts +4 -0
- package/dist/types/react-viewers/helpers/index.d.ts +6 -9
- package/dist/types/react-viewers/helpers/layout.d.ts +24 -0
- package/dist/types/react-viewers/index.d.ts +2 -1
- package/dist/types/react-viewers/panels/contextMenu.d.ts +2 -2
- package/dist/types/react-viewers/panels/index.d.ts +1 -2
- package/dist/types/react-viewers/panels/isolationPanel.d.ts +5 -0
- package/dist/types/react-viewers/panels/modal.d.ts +2 -2
- package/dist/types/react-viewers/panels/sectionBoxPanel.d.ts +3 -2
- package/dist/types/react-viewers/state/controlBarState.d.ts +2 -2
- package/dist/types/react-viewers/ultra/modal.d.ts +3 -3
- package/dist/types/react-viewers/ultra/viewerRef.d.ts +11 -2
- package/dist/types/react-viewers/webgl/loading.d.ts +2 -2
- package/dist/types/react-viewers/webgl/viewerRef.d.ts +11 -2
- package/dist/types/react-viewers/webgl/viewerState.d.ts +1 -1
- package/dist/vim-web.iife.js +304 -201
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +305 -202
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/react-viewers/panels/genericPanel.d.ts +0 -26
- package/dist/types/react-viewers/panels/renderSettingsPanel.d.ts +0 -4
- /package/dist/types/react-viewers/{components → generic}/inputNumber.d.ts +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StateRef } from "../helpers/reactUtils";
|
|
3
|
+
interface BaseGenericEntry {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GenericTextEntry extends BaseGenericEntry {
|
|
8
|
+
type: "text";
|
|
9
|
+
state: StateRef<string>;
|
|
10
|
+
}
|
|
11
|
+
export interface GenericNumberEntry extends BaseGenericEntry {
|
|
12
|
+
type: "number";
|
|
13
|
+
state: StateRef<number>;
|
|
14
|
+
}
|
|
15
|
+
export interface GenericBoolEntry extends BaseGenericEntry {
|
|
16
|
+
type: "bool";
|
|
17
|
+
state: StateRef<boolean>;
|
|
18
|
+
}
|
|
19
|
+
export type GenericEntryType = GenericTextEntry | GenericBoolEntry | GenericNumberEntry;
|
|
20
|
+
/**
|
|
21
|
+
* Renders a panel field based on its type.
|
|
22
|
+
* @param field - The panel field to render.
|
|
23
|
+
* @returns The rendered field element.
|
|
24
|
+
*/
|
|
25
|
+
export declare function GenericEntry(field: GenericEntryType): React.ReactNode;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StateRef } from "../helpers/reactUtils";
|
|
2
|
+
import { GenericEntryType } from "./genericField";
|
|
3
|
+
import { Customizer } from "../helpers/customizer";
|
|
4
|
+
export interface GenericPanelProps {
|
|
5
|
+
showPanel: StateRef<boolean>;
|
|
6
|
+
header?: React.ReactNode;
|
|
7
|
+
entries: GenericEntryType[];
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
anchorElement: HTMLElement | null;
|
|
10
|
+
}
|
|
11
|
+
export type GenericPanelHandle = Customizer<GenericEntryType[]>;
|
|
12
|
+
export declare const GenericPanel: import("react").ForwardRefExoticComponent<GenericPanelProps & import("react").RefAttributes<GenericPanelHandle>>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './cursor';
|
|
3
|
-
export * from './data';
|
|
1
|
+
export * as ReactUtils from './reactUtils';
|
|
4
2
|
export * from './deferredPromise';
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './requestResult';
|
|
10
|
-
export * from './utils';
|
|
3
|
+
export type * from './cursor';
|
|
4
|
+
export type * from './data';
|
|
5
|
+
export type * from './element';
|
|
6
|
+
export type * from './loadRequest';
|
|
7
|
+
export type * from './requestResult';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Computes a position for a floating element relative to a target, with smart fallback
|
|
3
|
+
* if it overflows the top or sides of the screen.
|
|
4
|
+
*
|
|
5
|
+
* @param originRect - The bounding rect of the origin element.
|
|
6
|
+
* @param panelRect - The bounding rect of the panel to position.
|
|
7
|
+
* @returns The top-left position for the panel.
|
|
8
|
+
*/
|
|
9
|
+
export declare function computeFloatingPosition(originRect: DOMRect, panelRect: DOMRect): {
|
|
10
|
+
top: number;
|
|
11
|
+
left: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Tracks and computes the screen position of a floating panel relative to a given anchor element.
|
|
15
|
+
*
|
|
16
|
+
* @param panelRef - Ref to the panel element to position
|
|
17
|
+
* @param anchorElement - The element the panel should be positioned relative to
|
|
18
|
+
* @param enabled - Whether the positioning logic is active
|
|
19
|
+
* @returns The top-left screen position for the panel
|
|
20
|
+
*/
|
|
21
|
+
export declare function useFloatingPanelPosition(panelRef: React.RefObject<HTMLElement>, anchorElement: HTMLElement | null, enabled: boolean): {
|
|
22
|
+
top: number;
|
|
23
|
+
left: number;
|
|
24
|
+
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { CameraRef } from '../state/cameraState';
|
|
6
6
|
import { TreeActionRef } from '../bim/bimTree';
|
|
7
|
-
import {
|
|
7
|
+
import { ModalHandle } from './modal';
|
|
8
8
|
import { IsolationRef } from '../state/sharedIsolation';
|
|
9
9
|
import * as Core from '../../core-viewers';
|
|
10
10
|
type ClickCallback = React.MouseEvent<HTMLDivElement, MouseEvent>;
|
|
@@ -76,7 +76,7 @@ export declare const VimContextMenuMemo: React.MemoExoticComponent<typeof Contex
|
|
|
76
76
|
export declare function ContextMenu(props: {
|
|
77
77
|
viewer: Core.Webgl.Viewer;
|
|
78
78
|
camera: CameraRef;
|
|
79
|
-
modal:
|
|
79
|
+
modal: ModalHandle;
|
|
80
80
|
isolation: IsolationRef;
|
|
81
81
|
selection: Core.Webgl.Element3D[];
|
|
82
82
|
customization?: (e: ContextMenuElement[]) => ContextMenuElement[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * as ContextMenu from './contextMenu';
|
|
2
2
|
export type * from './axesPanel';
|
|
3
|
-
export type * from './genericPanel';
|
|
4
3
|
export type * from './help';
|
|
5
4
|
export type * from './loadingBox';
|
|
6
5
|
export type * from './logo';
|
|
@@ -8,7 +7,7 @@ export type * from './messageBox';
|
|
|
8
7
|
export type * from './modal';
|
|
9
8
|
export type * from './overlay';
|
|
10
9
|
export type * from './performance';
|
|
11
|
-
export type * from './
|
|
10
|
+
export type * from './isolationPanel';
|
|
12
11
|
export type * from './restOfScreen';
|
|
13
12
|
export type * from './sectionBoxPanel';
|
|
14
13
|
export type * from './toast';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IsolationRef } from "../state/sharedIsolation";
|
|
2
|
+
import { GenericPanelHandle } from "../generic/genericPanel";
|
|
3
|
+
export declare const IsolationPanel: import("react").ForwardRefExoticComponent<{
|
|
4
|
+
state: IsolationRef;
|
|
5
|
+
} & import("react").RefAttributes<GenericPanelHandle>>;
|
|
@@ -7,7 +7,7 @@ export type ModalPropsTyped = (MessageBoxPropsTyped | LoadingBoxPropsTyped | Hel
|
|
|
7
7
|
canClose?: boolean;
|
|
8
8
|
onClose?: () => void;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
10
|
+
export type ModalHandle = {
|
|
11
11
|
getActiveState(): ModalPropsTyped | undefined;
|
|
12
12
|
loading(content: LoadingBoxProps | undefined): void;
|
|
13
13
|
message(content: MessageBoxProps | undefined): void;
|
|
@@ -15,4 +15,4 @@ export type ModalRef = {
|
|
|
15
15
|
};
|
|
16
16
|
export declare const Modal: React.ForwardRefExoticComponent<{
|
|
17
17
|
canFollowLinks: boolean;
|
|
18
|
-
} & React.RefAttributes<
|
|
18
|
+
} & React.RefAttributes<ModalHandle>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SectionBoxRef } from "../state/sectionBoxState";
|
|
2
|
-
|
|
2
|
+
import { GenericPanelHandle } from "../generic/genericPanel";
|
|
3
|
+
export declare const SectionBoxPanel: import("react").ForwardRefExoticComponent<{
|
|
3
4
|
state: SectionBoxRef;
|
|
4
|
-
}
|
|
5
|
+
} & import("react").RefAttributes<GenericPanelHandle>>;
|
|
@@ -6,7 +6,7 @@ import { SideState } from './sideState';
|
|
|
6
6
|
import * as Icons from '../icons';
|
|
7
7
|
import { SectionBoxRef } from './sectionBoxState';
|
|
8
8
|
import { getMeasureState } from './measureState';
|
|
9
|
-
import {
|
|
9
|
+
import { ModalHandle } from '../panels/modal';
|
|
10
10
|
import { IsolationRef } from './sharedIsolation';
|
|
11
11
|
import * as ControlBar from '../controlbar';
|
|
12
12
|
/**
|
|
@@ -32,7 +32,7 @@ export declare function controlBarSelection(isolation: IsolationRef): ControlBar
|
|
|
32
32
|
/**
|
|
33
33
|
* Combines all control bar sections into one control bar.
|
|
34
34
|
*/
|
|
35
|
-
export declare function useControlBar(viewer: Core.Webgl.Viewer, camera: CameraRef, modal:
|
|
35
|
+
export declare function useControlBar(viewer: Core.Webgl.Viewer, camera: CameraRef, modal: ModalHandle, side: SideState, cursor: CursorManager, settings: Settings, section: SectionBoxRef, isolationRef: IsolationRef, customization: ControlBar.ControlBarCustomization | undefined): (ControlBar.IControlBarSection | {
|
|
36
36
|
id: string;
|
|
37
37
|
enable: () => boolean;
|
|
38
38
|
style: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModalHandle } from "../panels/modal";
|
|
2
2
|
import * as Core from '../../core-viewers';
|
|
3
3
|
import { RefObject } from "react";
|
|
4
|
-
export declare function updateModal(modal: RefObject<
|
|
5
|
-
export declare function updateProgress(request: Core.Ultra.ILoadRequest, modal:
|
|
4
|
+
export declare function updateModal(modal: RefObject<ModalHandle>, state: Core.Ultra.ClientState): void;
|
|
5
|
+
export declare function updateProgress(request: Core.Ultra.ILoadRequest, modal: ModalHandle): Promise<void>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as Core from '../../core-viewers/ultra';
|
|
2
|
-
import {
|
|
2
|
+
import { ModalHandle } from '../panels/modal';
|
|
3
3
|
import { CameraRef } from '../state/cameraState';
|
|
4
4
|
import { SectionBoxRef } from '../state/sectionBoxState';
|
|
5
5
|
import { IsolationRef } from '../state/sharedIsolation';
|
|
6
6
|
import { ControlBarRef } from '../controlbar';
|
|
7
|
+
import { GenericPanelHandle } from '../generic/';
|
|
7
8
|
export type ViewerRef = {
|
|
8
9
|
/**
|
|
9
10
|
* The Vim viewer instance associated with the viewer.
|
|
@@ -12,7 +13,7 @@ export type ViewerRef = {
|
|
|
12
13
|
/**
|
|
13
14
|
* API to manage the modal dialog.
|
|
14
15
|
*/
|
|
15
|
-
modal:
|
|
16
|
+
modal: ModalHandle;
|
|
16
17
|
/**
|
|
17
18
|
* API to manage the section box.
|
|
18
19
|
*/
|
|
@@ -26,6 +27,14 @@ export type ViewerRef = {
|
|
|
26
27
|
*/
|
|
27
28
|
camera: CameraRef;
|
|
28
29
|
isolation: IsolationRef;
|
|
30
|
+
/**
|
|
31
|
+
* API to interact with the isolation panel.
|
|
32
|
+
*/
|
|
33
|
+
isolationPanel: GenericPanelHandle;
|
|
34
|
+
/**
|
|
35
|
+
* API to interact with the isolation panel.
|
|
36
|
+
*/
|
|
37
|
+
sectionBoxPanel: GenericPanelHandle;
|
|
29
38
|
/**
|
|
30
39
|
* Disposes of the viewer and its resources.
|
|
31
40
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as Core from '../../core-viewers';
|
|
5
5
|
import { LoadRequest } from '../helpers/loadRequest';
|
|
6
|
-
import {
|
|
6
|
+
import { ModalHandle } from '../panels/modal';
|
|
7
7
|
type AddSettings = {
|
|
8
8
|
/**
|
|
9
9
|
* Controls whether to frame the camera on a vim everytime it is updated.
|
|
@@ -28,7 +28,7 @@ export type LoadingError = {
|
|
|
28
28
|
export declare class ComponentLoader {
|
|
29
29
|
private _viewer;
|
|
30
30
|
private _modal;
|
|
31
|
-
constructor(viewer: Core.Webgl.Viewer, modal: React.RefObject<
|
|
31
|
+
constructor(viewer: Core.Webgl.Viewer, modal: React.RefObject<ModalHandle>);
|
|
32
32
|
/**
|
|
33
33
|
* Event emitter for progress updates.
|
|
34
34
|
*/
|
|
@@ -9,9 +9,10 @@ import { Container } from '../container';
|
|
|
9
9
|
import { BimInfoPanelRef } from '../bim/bimInfoData';
|
|
10
10
|
import { ControlBarRef } from '../controlbar';
|
|
11
11
|
import { ComponentLoader } from './loading';
|
|
12
|
-
import {
|
|
12
|
+
import { ModalHandle } from '../panels/modal';
|
|
13
13
|
import { SectionBoxRef } from '../state/sectionBoxState';
|
|
14
14
|
import { IsolationRef } from '../state/sharedIsolation';
|
|
15
|
+
import { GenericPanelHandle } from '../generic';
|
|
15
16
|
/**
|
|
16
17
|
* Settings API managing settings applied to the viewer.
|
|
17
18
|
*/
|
|
@@ -82,7 +83,7 @@ export type ViewerRef = {
|
|
|
82
83
|
/**
|
|
83
84
|
* Message API to interact with the loading box.
|
|
84
85
|
*/
|
|
85
|
-
modal:
|
|
86
|
+
modal: ModalHandle;
|
|
86
87
|
/**
|
|
87
88
|
* Camera API to interact with the viewer camera at a higher level.
|
|
88
89
|
*/
|
|
@@ -91,6 +92,14 @@ export type ViewerRef = {
|
|
|
91
92
|
* API To interact with the BIM info panel.
|
|
92
93
|
*/
|
|
93
94
|
bimInfo: BimInfoPanelRef;
|
|
95
|
+
/**
|
|
96
|
+
* API to interact with the isolation panel.
|
|
97
|
+
*/
|
|
98
|
+
isolationPanel: GenericPanelHandle;
|
|
99
|
+
/**
|
|
100
|
+
* API to interact with the isolation panel.
|
|
101
|
+
*/
|
|
102
|
+
sectionBoxPanel: GenericPanelHandle;
|
|
94
103
|
/**
|
|
95
104
|
* Cleans up and releases resources used by the viewer.
|
|
96
105
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as Core from '../../core-viewers';
|
|
5
5
|
import { AugmentedElement } from '../helpers/element';
|
|
6
|
-
import { StateRef } from '../helpers';
|
|
6
|
+
import { StateRef } from '../helpers/reactUtils';
|
|
7
7
|
export type ViewerState = {
|
|
8
8
|
vim: StateRef<Core.Webgl.Vim>;
|
|
9
9
|
selection: StateRef<Core.Webgl.Element3D[]>;
|