vim-web 0.3.44-dev.70 → 0.3.44-dev.71
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 +15 -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 +1 -1
- package/dist/types/react-viewers/panels/index.d.ts +2 -2
- package/dist/types/react-viewers/panels/isolationPanel.d.ts +5 -0
- package/dist/types/react-viewers/panels/sectionBoxPanel.d.ts +3 -2
- package/dist/types/react-viewers/webgl/viewerRef.d.ts +3 -0
- package/dist/types/react-viewers/webgl/viewerState.d.ts +1 -1
- package/dist/vim-web.iife.js +290 -195
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +291 -196
- 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,15 @@
|
|
|
1
|
+
import { StateRef } from "../helpers/reactUtils";
|
|
2
|
+
import { GenericEntryType } from "./genericField";
|
|
3
|
+
export interface GenericPanelProps {
|
|
4
|
+
showPanel: StateRef<boolean>;
|
|
5
|
+
header?: React.ReactNode;
|
|
6
|
+
entries: GenericEntryType[];
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
anchorElement: HTMLElement | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const GenericPanel: import("react").ForwardRefExoticComponent<GenericPanelProps & import("react").RefAttributes<GenericPanelRef>>;
|
|
11
|
+
export type GenericPanelRef = Customizer<GenericEntryType[]>;
|
|
12
|
+
export interface Customizer<TData> {
|
|
13
|
+
customize(fn: (entries: TData) => TData): any;
|
|
14
|
+
}
|
|
15
|
+
export declare function useCustomizer<TData>(baseEntries: TData, ref: React.Ref<Customizer<TData>>): TData;
|
|
@@ -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
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as ContextMenu from './contextMenu';
|
|
2
2
|
export type * from './axesPanel';
|
|
3
|
-
export type * from '
|
|
3
|
+
export type * from '../generic/genericPanel';
|
|
4
4
|
export type * from './help';
|
|
5
5
|
export type * from './loadingBox';
|
|
6
6
|
export type * from './logo';
|
|
@@ -8,7 +8,7 @@ export type * from './messageBox';
|
|
|
8
8
|
export type * from './modal';
|
|
9
9
|
export type * from './overlay';
|
|
10
10
|
export type * from './performance';
|
|
11
|
-
export type * from './
|
|
11
|
+
export type * from './isolationPanel';
|
|
12
12
|
export type * from './restOfScreen';
|
|
13
13
|
export type * from './sectionBoxPanel';
|
|
14
14
|
export type * from './toast';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IsolationRef } from "../state/sharedIsolation";
|
|
2
|
+
import { GenericPanelRef } from "../generic/genericPanel";
|
|
3
|
+
export declare const IsolationPanel: import("react").ForwardRefExoticComponent<{
|
|
4
|
+
state: IsolationRef;
|
|
5
|
+
} & import("react").RefAttributes<GenericPanelRef>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SectionBoxRef } from "../state/sectionBoxState";
|
|
2
|
-
|
|
2
|
+
import { GenericPanelRef } from "../generic/genericPanel";
|
|
3
|
+
export declare const SectionBoxPanel: import("react").ForwardRefExoticComponent<{
|
|
3
4
|
state: SectionBoxRef;
|
|
4
|
-
}
|
|
5
|
+
} & import("react").RefAttributes<GenericPanelRef>>;
|
|
@@ -12,6 +12,7 @@ import { ComponentLoader } from './loading';
|
|
|
12
12
|
import { ModalRef } from '../panels/modal';
|
|
13
13
|
import { SectionBoxRef } from '../state/sectionBoxState';
|
|
14
14
|
import { IsolationRef } from '../state/sharedIsolation';
|
|
15
|
+
import { GenericPanelRef } from '../panels';
|
|
15
16
|
/**
|
|
16
17
|
* Settings API managing settings applied to the viewer.
|
|
17
18
|
*/
|
|
@@ -91,6 +92,8 @@ export type ViewerRef = {
|
|
|
91
92
|
* API To interact with the BIM info panel.
|
|
92
93
|
*/
|
|
93
94
|
bimInfo: BimInfoPanelRef;
|
|
95
|
+
isolationPanel: GenericPanelRef;
|
|
96
|
+
sectionBoxPanel: GenericPanelRef;
|
|
94
97
|
/**
|
|
95
98
|
* Cleans up and releases resources used by the viewer.
|
|
96
99
|
*/
|
|
@@ -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[]>;
|