vim-web 0.5.0-dev.8 → 0.5.1

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.
Files changed (59) hide show
  1. package/dist/style.css +34 -7
  2. package/dist/types/core-viewers/shared/inputAdapter.d.ts +1 -0
  3. package/dist/types/core-viewers/shared/keyboardHandler.d.ts +1 -1
  4. package/dist/types/core-viewers/shared/mouseHandler.d.ts +3 -0
  5. package/dist/types/core-viewers/ultra/rpcClient.d.ts +5 -3
  6. package/dist/types/core-viewers/ultra/rpcSafeClient.d.ts +12 -1
  7. package/dist/types/core-viewers/ultra/viewer.d.ts +5 -0
  8. package/dist/types/core-viewers/ultra/viewport.d.ts +6 -0
  9. package/dist/types/core-viewers/ultra/vim.d.ts +3 -1
  10. package/dist/types/core-viewers/webgl/loader/mesh.d.ts +3 -1
  11. package/dist/types/core-viewers/webgl/loader/progressive/insertableMesh.d.ts +4 -2
  12. package/dist/types/core-viewers/webgl/loader/progressive/instancedMesh.d.ts +5 -0
  13. package/dist/types/core-viewers/webgl/loader/vim.d.ts +5 -0
  14. package/dist/types/core-viewers/webgl/viewer/gizmos/markers/gizmoMarker.d.ts +1 -0
  15. package/dist/types/core-viewers/webgl/viewer/rendering/renderer.d.ts +7 -0
  16. package/dist/types/core-viewers/webgl/viewer/viewer.d.ts +5 -0
  17. package/dist/types/core-viewers/webgl/viewer/viewport.d.ts +1 -1
  18. package/dist/types/react-viewers/bim/bimPanel.d.ts +3 -3
  19. package/dist/types/react-viewers/controlbar/controlBarIds.d.ts +32 -36
  20. package/dist/types/react-viewers/errors/errorStyle.d.ts +1 -1
  21. package/dist/types/react-viewers/helpers/reactUtils.d.ts +2 -1
  22. package/dist/types/react-viewers/helpers/utils.d.ts +8 -0
  23. package/dist/types/react-viewers/panels/axesPanel.d.ts +2 -1
  24. package/dist/types/react-viewers/panels/index.d.ts +1 -0
  25. package/dist/types/react-viewers/panels/isolationPanel.d.ts +2 -0
  26. package/dist/types/react-viewers/panels/messageBox.d.ts +2 -0
  27. package/dist/types/react-viewers/panels/sidePanel.d.ts +1 -1
  28. package/dist/types/react-viewers/settings/anySettings.d.ts +7 -0
  29. package/dist/types/react-viewers/settings/index.d.ts +1 -1
  30. package/dist/types/react-viewers/settings/settingsInputBox.d.ts +4 -0
  31. package/dist/types/react-viewers/settings/settingsItem.d.ts +30 -0
  32. package/dist/types/react-viewers/settings/settingsKeys.d.ts +46 -0
  33. package/dist/types/react-viewers/settings/settingsPanel.d.ts +5 -4
  34. package/dist/types/react-viewers/settings/settingsPanelContent.d.ts +6 -0
  35. package/dist/types/react-viewers/settings/settingsState.d.ts +11 -11
  36. package/dist/types/react-viewers/settings/settingsStorage.d.ts +3 -3
  37. package/dist/types/react-viewers/settings/settingsSubtitle.d.ts +2 -0
  38. package/dist/types/react-viewers/settings/settingsToggle.d.ts +11 -0
  39. package/dist/types/react-viewers/state/controlBarState.d.ts +41 -7
  40. package/dist/types/react-viewers/state/sharedIsolation.d.ts +2 -0
  41. package/dist/types/react-viewers/ultra/controlBar.d.ts +4 -1
  42. package/dist/types/react-viewers/ultra/index.d.ts +1 -0
  43. package/dist/types/react-viewers/ultra/settings.d.ts +13 -0
  44. package/dist/types/react-viewers/ultra/settingsPanel.d.ts +5 -0
  45. package/dist/types/react-viewers/ultra/viewer.d.ts +3 -1
  46. package/dist/types/react-viewers/ultra/viewerRef.d.ts +3 -0
  47. package/dist/types/react-viewers/urls.d.ts +0 -1
  48. package/dist/types/react-viewers/webgl/index.d.ts +1 -0
  49. package/dist/types/react-viewers/webgl/loading.d.ts +2 -2
  50. package/dist/types/react-viewers/webgl/settings.d.ts +36 -0
  51. package/dist/types/react-viewers/webgl/settingsPanel.d.ts +12 -0
  52. package/dist/types/react-viewers/webgl/viewer.d.ts +3 -3
  53. package/dist/types/react-viewers/webgl/viewerRef.d.ts +12 -5
  54. package/dist/vim-web.iife.js +1449 -765
  55. package/dist/vim-web.iife.js.map +1 -1
  56. package/dist/vim-web.js +1449 -765
  57. package/dist/vim-web.js.map +1 -1
  58. package/package.json +1 -1
  59. package/dist/types/react-viewers/settings/settings.d.ts +0 -61
@@ -0,0 +1,30 @@
1
+ import { AnySettings } from './anySettings';
2
+ import { UserBoolean } from './userBoolean';
3
+ export type SettingsCustomizer<T extends AnySettings> = (items: SettingsItem<T>[]) => SettingsItem<T>[];
4
+ export type SettingsItem<T extends AnySettings> = SettingsSubtitle | SettingsToggle<T> | SettingsBox<T> | SettingsElement;
5
+ export type BaseSettingsItem = {
6
+ type: string;
7
+ key: string;
8
+ };
9
+ export type SettingsSubtitle = BaseSettingsItem & {
10
+ type: 'subtitle';
11
+ title: string;
12
+ };
13
+ export type SettingsToggle<T extends AnySettings> = BaseSettingsItem & {
14
+ type: 'toggle';
15
+ label: string;
16
+ getter: (settings: T) => UserBoolean;
17
+ setter: (settings: T, b: boolean) => void;
18
+ };
19
+ export type SettingsBox<T extends AnySettings> = BaseSettingsItem & {
20
+ type: 'box';
21
+ label: string;
22
+ info: string;
23
+ transform: (value: number) => number;
24
+ getter: (settings: T) => number;
25
+ setter: (settings: T, b: number) => void;
26
+ };
27
+ export type SettingsElement = BaseSettingsItem & {
28
+ type: 'element';
29
+ element: JSX.Element;
30
+ };
@@ -0,0 +1,46 @@
1
+ export declare class SettingsPanelKeys {
2
+ static InputsSubtitle: string;
3
+ static InputsScrollSpeedBox: string;
4
+ static PanelsSubtitle: string;
5
+ static PanelsShowLogoToggle: string;
6
+ static PanelsShowBimTreeToggle: string;
7
+ static PanelsShowBimInfoToggle: string;
8
+ static PanelsShowAxesPanelToggle: string;
9
+ static PanelsShowPerformancePanelToggle: string;
10
+ static AxesSubtitle: string;
11
+ static AxesShowOrthographicButtonToggle: string;
12
+ static AxesShowResetCameraButtonToggle: string;
13
+ static ControlBarSubtitle: string;
14
+ static ControlBarShowControlBarToggle: string;
15
+ static ControlBarCursorsSubtitle: string;
16
+ static ControlBarCursorsShowOrbitButtonToggle: string;
17
+ static ControlBarCursorsShowLookAroundButtonToggle: string;
18
+ static ControlBarCursorsShowPanButtonToggle: string;
19
+ static ControlBarCursorsShowZoomButtonToggle: string;
20
+ static ControlBarCursorsShowZoomWindowButtonToggle: string;
21
+ static ControlBarToolsSubtitle: string;
22
+ static ControlBarToolsShowMeasuringModeButtonToggle: string;
23
+ static ControlBarCameraSubtitle: string;
24
+ static ControlBarAutoCamera: string;
25
+ static ControlBarFrameSelection: string;
26
+ static ControlBarFrameAll: string;
27
+ static ControlBarSectioningSubtitle: string;
28
+ static ControlBarSectioningEnable: string;
29
+ static ControlBarSectioningFitToSelection: string;
30
+ static ControlBarSectioningReset: string;
31
+ static ControlBarSectioningShow: string;
32
+ static ControlBarSectioningAuto: string;
33
+ static ControlBarSectioningSettings: string;
34
+ static ControlBarVisibilitySubtitle: string;
35
+ static ControlBarVisibilityClearSelection: string;
36
+ static ControlBarVisibilityShowAll: string;
37
+ static ControlBarVisibilityToggle: string;
38
+ static ControlBarVisibilityIsolate: string;
39
+ static ControlBarVisibilityAutoIsolate: string;
40
+ static ControlBarVisibilitySettings: string;
41
+ static ControlBarMiscSubtitle: string;
42
+ static ControlBarMiscShowProjectInspectorButtonToggle: string;
43
+ static ControlBarMiscShowSettingsButtonToggle: string;
44
+ static ControlBarMiscShowHelpButtonToggle: string;
45
+ static ControlBarMiscShowMaximiseButtonToggle: string;
46
+ }
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * @module viw-webgl-react
3
3
  */
4
- import * as Core from '../../core-viewers';
5
4
  import { SettingsState } from './settingsState';
5
+ import { SettingsItem } from './settingsItem';
6
+ import { AnySettings } from './anySettings';
6
7
  /**
7
8
  * JSX Component to interact with settings.
8
9
  * @param viewer current viewer
@@ -10,8 +11,8 @@ import { SettingsState } from './settingsState';
10
11
  * @param visible will return null if this is false.
11
12
  * @returns
12
13
  */
13
- export declare function SettingsPanel(props: {
14
- viewer: Core.Webgl.Viewer;
15
- settings: SettingsState;
14
+ export declare function SettingsPanel<T extends AnySettings>(props: {
15
+ content: SettingsItem<T>[];
16
+ settings: SettingsState<T>;
16
17
  visible: boolean;
17
18
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { SettingsItem } from './settingsItem';
2
+ import { AnySettings } from './anySettings';
3
+ export declare function getControlBarCursorSettings(): SettingsItem<AnySettings>[];
4
+ export declare function getControlBarCameraSettings(): SettingsItem<AnySettings>[];
5
+ export declare function getControlBarSectionBoxSettings(): SettingsItem<AnySettings>[];
6
+ export declare function getControlBarVisibilitySettings(): SettingsItem<AnySettings>[];
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * @module viw-webgl-react
3
3
  */
4
- import * as Core from '../../core-viewers';
5
- import { Settings, PartialSettings } from './settings';
6
- export type SettingsState = {
7
- value: Settings;
8
- update: (updater: (s: Settings) => void) => void;
9
- register: (action: (s: Settings) => void) => void;
4
+ import { StateRef } from '../helpers/reactUtils';
5
+ import { SettingsCustomizer } from './settingsItem';
6
+ import { AnySettings } from './anySettings';
7
+ import { RecursivePartial } from '../../utils';
8
+ export type SettingsState<T extends AnySettings> = {
9
+ value: T;
10
+ update: (updater: (s: T) => void) => void;
11
+ register: (action: (s: T) => void) => void;
12
+ customizer: StateRef<SettingsCustomizer<T>>;
10
13
  };
11
14
  /**
12
15
  * Returns a new state closure for settings.
13
16
  */
14
- export declare function useSettings(viewer: Core.Webgl.Viewer, value: PartialSettings): SettingsState;
15
- /**
16
- * Apply given vim viewer settings to the given viewer.
17
- */
18
- export declare function applySettings(viewer: Core.Webgl.Viewer, settings: Settings): void;
17
+ export declare function useSettings<T extends AnySettings>(value: RecursivePartial<T>, defaultSettings: T, applySettings?: (settings: T) => void): SettingsState<T>;
18
+ export declare function createSettings<T extends AnySettings>(settings: RecursivePartial<T>, defaultSettings: T): T;
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * @module viw-webgl-react
3
3
  */
4
- import { Settings, PartialSettings } from './settings';
4
+ import { AnySettings } from './anySettings';
5
5
  /**
6
6
  * Retrieves viewer settings from localStorage and applies permissions
7
7
  * @param settings - Partial viewer settings to apply permissions from
8
8
  * @returns The stored settings with applied permissions, or empty object if retrieval fails
9
9
  */
10
- export declare function getLocalSettings(settings?: PartialSettings): {};
10
+ export declare function getLocalSettings(settings?: Partial<AnySettings>): {};
11
11
  /**
12
12
  * Saves viewer settings to localStorage after removing permissions
13
13
  * @param value - Component settings to save
14
14
  */
15
- export declare function saveSettingsToLocal(value: Settings): void;
15
+ export declare function saveSettingsToLocal(value: AnySettings): void;
@@ -0,0 +1,2 @@
1
+ import { SettingsSubtitle } from './settingsItem';
2
+ export declare function renderSettingsSubtitle(item: SettingsSubtitle): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { SettingsToggle } from './settingsItem';
2
+ import { SettingsState } from './settingsState';
3
+ import { AnySettings } from './anySettings';
4
+ /**
5
+ * Renders a toggle (checkbox) UI element for a given SettingsToggle item.
6
+ * @param viewer The WebGL viewer instance (for future consistency).
7
+ * @param settings The current settings state object.
8
+ * @param item The SettingsToggle configuration.
9
+ * @returns JSX.Element | null
10
+ */
11
+ export declare function renderSettingsToggle(settings: SettingsState<AnySettings>, item: SettingsToggle<AnySettings>): JSX.Element | null;
@@ -1,7 +1,6 @@
1
1
  import * as Core from "../../core-viewers";
2
2
  import { CameraRef } from './cameraState';
3
3
  import { CursorManager } from '../helpers/cursor';
4
- import { Settings } from '../settings';
5
4
  import { SideState } from './sideState';
6
5
  import * as Icons from '../icons';
7
6
  import { SectionBoxRef } from './sectionBoxState';
@@ -9,11 +8,31 @@ import { getMeasureState } from './measureState';
9
8
  import { ModalHandle } from '../panels/modal';
10
9
  import { IsolationRef } from './sharedIsolation';
11
10
  import * as ControlBar from '../controlbar';
11
+ import { UserBoolean } from "../settings/userBoolean";
12
+ import { UltraSettings } from "../ultra/settings";
13
+ import { WebglSettings } from "../webgl/settings";
14
+ export type ControlBarSectionBoxSettings = {
15
+ sectioningEnable: UserBoolean;
16
+ sectioningFitToSelection: UserBoolean;
17
+ sectioningReset: UserBoolean;
18
+ sectioningShow: UserBoolean;
19
+ sectioningAuto: UserBoolean;
20
+ sectioningSettings: UserBoolean;
21
+ };
12
22
  /**
13
23
  * Returns a control bar section for the section box.
14
24
  */
15
- export declare function controlBarSectionBox(section: SectionBoxRef, hasSelection: boolean): ControlBar.IControlBarSection;
16
- export declare function controlBarMeasure(settings: Settings, measure: ReturnType<typeof getMeasureState>): {
25
+ export declare function controlBarSectionBox(section: SectionBoxRef, hasSelection: boolean, settings: ControlBarSectionBoxSettings): ControlBar.IControlBarSection;
26
+ export type ControlBarCursorSettings = {
27
+ cursorOrbit: UserBoolean;
28
+ cursorLookAround: UserBoolean;
29
+ cursorPan: UserBoolean;
30
+ cursorZoom: UserBoolean;
31
+ };
32
+ export type ControlBarMeasureSettings = {
33
+ measureEnable: UserBoolean;
34
+ };
35
+ export declare function controlBarMeasure(measure: ReturnType<typeof getMeasureState>, settings: ControlBarMeasureSettings): {
17
36
  id: string;
18
37
  enable: () => boolean;
19
38
  style: string;
@@ -27,12 +46,26 @@ export declare function controlBarMeasure(settings: Settings, measure: ReturnTyp
27
46
  style: typeof ControlBar.Style.buttonDefaultStyle;
28
47
  }[];
29
48
  };
30
- export declare function controlBarCamera(camera: CameraRef): ControlBar.IControlBarSection;
31
- export declare function controlBarSelection(isolation: IsolationRef): ControlBar.IControlBarSection;
49
+ export declare function controlBarMiscUltra(modal: ModalHandle, side: SideState, settings: UltraSettings): ControlBar.IControlBarSection;
50
+ export type ControlBarCameraSettings = {
51
+ cameraAuto: UserBoolean;
52
+ cameraFrameSelection: UserBoolean;
53
+ cameraFrameScene: UserBoolean;
54
+ };
55
+ export declare function controlBarCamera(camera: CameraRef, settings: ControlBarCameraSettings): ControlBar.IControlBarSection;
56
+ export type ControlBarVisibilitySettings = {
57
+ visibilityClearSelection: UserBoolean;
58
+ visibilityShowAll: UserBoolean;
59
+ visibilityToggle: UserBoolean;
60
+ visibilityIsolate: UserBoolean;
61
+ visibilityAutoIsolate: UserBoolean;
62
+ visibilitySettings: UserBoolean;
63
+ };
64
+ export declare function controlBarVisibility(isolation: IsolationRef, settings: ControlBarVisibilitySettings): ControlBar.IControlBarSection;
32
65
  /**
33
66
  * Combines all control bar sections into one control bar.
34
67
  */
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 | {
68
+ export declare function useControlBar(viewer: Core.Webgl.Viewer, camera: CameraRef, modal: ModalHandle, side: SideState, cursor: CursorManager, settings: WebglSettings, section: SectionBoxRef, isolationRef: IsolationRef, customization: ControlBar.ControlBarCustomization | undefined): (ControlBar.IControlBarSection | {
36
69
  id: string;
37
70
  enable: () => boolean;
38
71
  style: string;
@@ -51,4 +84,5 @@ export declare function useControlBar(viewer: Core.Webgl.Viewer, camera: CameraR
51
84
  * @param {Settings} settings - The viewer settings to check
52
85
  * @returns {boolean} True if any settings buttons are enabled
53
86
  */
54
- export declare function anyUiSettingButton(settings: Settings): boolean;
87
+ export declare function anyWebglMiscButton(settings: WebglSettings): boolean;
88
+ export declare function anyUltraMiscButton(settings: UltraSettings): boolean;
@@ -9,6 +9,7 @@ export interface IsolationRef {
9
9
  showPanel: StateRef<boolean>;
10
10
  showGhost: StateRef<boolean>;
11
11
  ghostOpacity: StateRef<number>;
12
+ transparency: StateRef<boolean>;
12
13
  showRooms: StateRef<boolean>;
13
14
  onAutoIsolate: FuncRef<void>;
14
15
  onVisibilityChange: FuncRef<void>;
@@ -32,6 +33,7 @@ export interface IsolationAdapter {
32
33
  showGhost(show: boolean): void;
33
34
  getGhostOpacity(): number;
34
35
  setGhostOpacity(opacity: number): void;
36
+ enableTransparency(enable: boolean): void;
35
37
  getShowRooms(): boolean;
36
38
  setShowRooms(show: boolean): void;
37
39
  }
@@ -1,6 +1,9 @@
1
1
  import * as Core from '../../core-viewers/ultra';
2
2
  import { ControlBarCustomization } from '../controlbar/controlBar';
3
+ import { ModalHandle } from '../panels';
3
4
  import { CameraRef } from '../state/cameraState';
4
5
  import { SectionBoxRef } from '../state/sectionBoxState';
5
6
  import { IsolationRef } from '../state/sharedIsolation';
6
- export declare function useUltraControlBar(viewer: Core.Viewer, section: SectionBoxRef, isolation: IsolationRef, camera: CameraRef, customization: ControlBarCustomization | undefined): import("../controlbar").IControlBarSection[];
7
+ import { SideState } from '../state/sideState';
8
+ import { UltraSettings } from './settings';
9
+ export declare function useUltraControlBar(viewer: Core.Viewer, section: SectionBoxRef, isolation: IsolationRef, camera: CameraRef, settings: UltraSettings, side: SideState, modal: ModalHandle, customization: ControlBarCustomization | undefined): import("../controlbar").IControlBarSection[];
@@ -1,2 +1,3 @@
1
1
  export * from './viewer';
2
2
  export * from './viewerRef';
3
+ export * from './settings';
@@ -0,0 +1,13 @@
1
+ import { RecursivePartial } from "../helpers/utils";
2
+ import { UserBoolean } from "../settings/userBoolean";
3
+ import { ControlBarCameraSettings, ControlBarCursorSettings, ControlBarSectionBoxSettings, ControlBarVisibilitySettings } from "../state/controlBarState";
4
+ export type PartialUltraSettings = RecursivePartial<UltraSettings>;
5
+ export type UltraSettings = {
6
+ ui: ControlBarCameraSettings & ControlBarCursorSettings & ControlBarSectionBoxSettings & ControlBarVisibilitySettings & {
7
+ panelLogo: UserBoolean;
8
+ panelControlBar: UserBoolean;
9
+ miscSettings: UserBoolean;
10
+ miscHelp: UserBoolean;
11
+ };
12
+ };
13
+ export declare function getDefaultUltraSettings(): UltraSettings;
@@ -0,0 +1,5 @@
1
+ import { Viewer } from "../../core-viewers/ultra";
2
+ import { SettingsItem } from "../settings/settingsItem";
3
+ import { UltraSettings } from "./settings";
4
+ export declare function getControlBarUltraSettings(): SettingsItem<UltraSettings>[];
5
+ export declare function getUltraSettingsContent(viewer: Viewer): SettingsItem<UltraSettings>[];
@@ -1,12 +1,13 @@
1
1
  import * as Core from '../../core-viewers';
2
2
  import { Container } from '../container';
3
3
  import { ViewerRef } from './viewerRef';
4
+ import { PartialUltraSettings } from './settings';
4
5
  /**
5
6
  * Creates a UI container along with a VIM.Viewer and its associated React viewer.
6
7
  * @param container An optional container object. If none is provided, a container will be created.
7
8
  * @returns An object containing the resulting container, reactRoot, and viewer.
8
9
  */
9
- export declare function createViewer(container?: Container | HTMLElement): Promise<ViewerRef>;
10
+ export declare function createViewer(container?: Container | HTMLElement, settings?: PartialUltraSettings): Promise<ViewerRef>;
10
11
  /**
11
12
  * Represents a React viewer providing UI for the Vim viewer.
12
13
  * @param container The container object containing root, gfx, and UI elements for the Vim viewer.
@@ -17,5 +18,6 @@ export declare function createViewer(container?: Container | HTMLElement): Promi
17
18
  export declare function Viewer(props: {
18
19
  container: Container;
19
20
  core: Core.Ultra.Viewer;
21
+ settings?: PartialUltraSettings;
20
22
  onMount: (viewer: ViewerRef) => void;
21
23
  }): import("react/jsx-runtime").JSX.Element;
@@ -5,6 +5,8 @@ import { SectionBoxRef } from '../state/sectionBoxState';
5
5
  import { IsolationRef } from '../state/sharedIsolation';
6
6
  import { ControlBarRef } from '../controlbar';
7
7
  import { GenericPanelHandle } from '../generic/';
8
+ import { SettingsRef } from '../webgl';
9
+ import { UltraSettings } from './settings';
8
10
  export type ViewerRef = {
9
11
  /**
10
12
  * The Vim viewer instance associated with the viewer.
@@ -27,6 +29,7 @@ export type ViewerRef = {
27
29
  */
28
30
  camera: CameraRef;
29
31
  isolation: IsolationRef;
32
+ settings: SettingsRef<UltraSettings>;
30
33
  /**
31
34
  * API to interact with the isolation panel.
32
35
  */
@@ -1,3 +1,2 @@
1
- export declare const support = "https://docs.vimaec.com";
2
1
  export declare const supportUltra = "https://docs.vimaec.com/docs/vim-for-windows/configuring-vim-ultra";
3
2
  export declare const supportControls = "https://docs.vimaec.com/docs/vim-cloud/webgl-navigation-and-controls-guide";
@@ -1,3 +1,4 @@
1
1
  export * from './viewer';
2
2
  export * from './viewerRef';
3
+ export * from './settings';
3
4
  export type * from './loading';
@@ -4,7 +4,7 @@
4
4
  import * as Core from '../../core-viewers';
5
5
  import { LoadRequest } from '../helpers/loadRequest';
6
6
  import { ModalHandle } from '../panels/modal';
7
- import { Settings } from '../settings';
7
+ import { WebglSettings } from './settings';
8
8
  type AddSettings = {
9
9
  /**
10
10
  * Controls whether to frame the camera on a vim everytime it is updated.
@@ -30,7 +30,7 @@ export declare class ComponentLoader {
30
30
  private _viewer;
31
31
  private _modal;
32
32
  private _addLink;
33
- constructor(viewer: Core.Webgl.Viewer, modal: React.RefObject<ModalHandle>, settings: Settings);
33
+ constructor(viewer: Core.Webgl.Viewer, modal: React.RefObject<ModalHandle>, settings: WebglSettings);
34
34
  /**
35
35
  * Event emitter for progress updates.
36
36
  */
@@ -0,0 +1,36 @@
1
+ import { RecursivePartial } from "../../utils";
2
+ import { UserBoolean } from "../settings/userBoolean";
3
+ import { ControlBarCameraSettings, ControlBarCursorSettings, ControlBarMeasureSettings, ControlBarSectionBoxSettings, ControlBarVisibilitySettings } from "../state/controlBarState";
4
+ export type PartialWebglSettings = RecursivePartial<WebglSettings>;
5
+ /**
6
+ * Complete settings configuration for the Vim viewer
7
+ * @interface Settings
8
+ */
9
+ export type WebglSettings = {
10
+ capacity: {
11
+ canFollowUrl: boolean;
12
+ canGoFullScreen: boolean;
13
+ canDownload: boolean;
14
+ canReadLocalStorage: boolean;
15
+ };
16
+ ui: ControlBarCameraSettings & ControlBarCursorSettings & ControlBarSectionBoxSettings & ControlBarVisibilitySettings & ControlBarMeasureSettings & {
17
+ panelLogo: UserBoolean;
18
+ panelBimTree: UserBoolean;
19
+ panelBimInfo: UserBoolean;
20
+ panelPerformance: UserBoolean;
21
+ panelAxes: UserBoolean;
22
+ panelControlBar: UserBoolean;
23
+ axesOrthographic: UserBoolean;
24
+ axesHome: UserBoolean;
25
+ miscProjectInspector: UserBoolean;
26
+ miscSettings: UserBoolean;
27
+ miscHelp: UserBoolean;
28
+ miscMaximise: UserBoolean;
29
+ };
30
+ };
31
+ /**
32
+ * Default settings configuration for the React Webgl Vim viewer
33
+ * @constant
34
+ * @type {WebglSettings}
35
+ */
36
+ export declare function getDefaultSettings(): WebglSettings;
@@ -0,0 +1,12 @@
1
+ import { Viewer } from "../../core-viewers/webgl";
2
+ import { SettingsItem } from "../settings/settingsItem";
3
+ import { WebglSettings } from "./settings";
4
+ export declare function getControlBarVariousSettings(): SettingsItem<WebglSettings>[];
5
+ export declare function getPanelsVisibilitySettings(): SettingsItem<WebglSettings>[];
6
+ export declare function getInputsSettings(viewer: Viewer): SettingsItem<WebglSettings>[];
7
+ export declare function getControlBarMeasureSettings(): SettingsItem<WebglSettings>[];
8
+ export declare function getWebglSettingsContent(viewer: Viewer): SettingsItem<WebglSettings>[];
9
+ /**
10
+ * Apply given vim viewer settings to the given viewer.
11
+ */
12
+ export declare function applyWebglSettings(settings: WebglSettings): void;
@@ -2,9 +2,9 @@
2
2
  * @module public-api
3
3
  */
4
4
  import * as Core from '../../core-viewers';
5
- import { PartialSettings } from '../settings';
6
5
  import { Container } from '../container';
7
6
  import { ViewerRef } from './viewerRef';
7
+ import { PartialWebglSettings } from './settings';
8
8
  /**
9
9
  * Creates a UI container along with a VIM.Viewer and its associated React viewer.
10
10
  * @param container An optional container object. If none is provided, a container will be created.
@@ -12,7 +12,7 @@ import { ViewerRef } from './viewerRef';
12
12
  * @param coreSettings Viewer settings.
13
13
  * @returns An object containing the resulting container, reactRoot, and viewer.
14
14
  */
15
- export declare function createViewer(container?: Container | HTMLElement, settings?: PartialSettings, coreSettings?: Core.Webgl.PartialViewerSettings): Promise<ViewerRef>;
15
+ export declare function createViewer(container?: Container | HTMLElement, settings?: PartialWebglSettings, coreSettings?: Core.Webgl.PartialViewerSettings): Promise<ViewerRef>;
16
16
  /**
17
17
  * Represents a React viewer providing UI for the Vim viewer.
18
18
  * @param container The container object containing root, gfx, and UI elements for the Vim viewer.
@@ -24,5 +24,5 @@ export declare function Viewer(props: {
24
24
  container: Container;
25
25
  viewer: Core.Webgl.Viewer;
26
26
  onMount: (viewer: ViewerRef) => void;
27
- settings?: PartialSettings;
27
+ settings?: PartialWebglSettings;
28
28
  }): import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as Core from '../../core-viewers';
5
5
  import { ContextMenuRef } from '../panels/contextMenu';
6
- import { Settings } from '../settings/settings';
6
+ import { AnySettings } from '../settings/anySettings';
7
7
  import { CameraRef } from '../state/cameraState';
8
8
  import { Container } from '../container';
9
9
  import { BimInfoPanelRef } from '../bim/bimInfoData';
@@ -13,20 +13,27 @@ import { ModalHandle } from '../panels/modal';
13
13
  import { SectionBoxRef } from '../state/sectionBoxState';
14
14
  import { IsolationRef } from '../state/sharedIsolation';
15
15
  import { GenericPanelHandle } from '../generic';
16
+ import { SettingsItem } from '../settings/settingsItem';
17
+ import { WebglSettings } from './settings';
16
18
  /**
17
19
  * Settings API managing settings applied to the viewer.
18
20
  */
19
- export type SettingsRef = {
21
+ export type SettingsRef<T extends AnySettings> = {
20
22
  /**
21
23
  * Allows updating settings by providing a callback function.
22
24
  * @param updater A function that updates the current settings.
23
25
  */
24
- update: (updater: (settings: Settings) => void) => void;
26
+ update: (updater: (settings: T) => void) => void;
25
27
  /**
26
28
  * Registers a callback function to be notified when settings are updated.
27
29
  * @param callback A function to be called when settings are updated, receiving the updated settings.
28
30
  */
29
- register: (callback: (settings: Settings) => void) => void;
31
+ register: (callback: (settings: T) => void) => void;
32
+ /**
33
+ * Customizes the settings panel by providing a customizer function.
34
+ * @param customizer A function that modifies the settings items.
35
+ */
36
+ customize: (customizer: (items: SettingsItem<T>[]) => SettingsItem<T>[]) => void;
30
37
  };
31
38
  /**
32
39
  * Reference to manage help message functionality in the viewer.
@@ -79,7 +86,7 @@ export type ViewerRef = {
79
86
  /**
80
87
  * Settings API managing settings applied to the viewer.
81
88
  */
82
- settings: SettingsRef;
89
+ settings: SettingsRef<WebglSettings>;
83
90
  /**
84
91
  * Message API to interact with the loading box.
85
92
  */