vim-web 1.0.0-alpha.1 → 1.0.0-alpha.11

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/vim-web.d.ts CHANGED
@@ -3,8 +3,9 @@ export { THREE };
3
3
  import * as BIM from 'vim-format';
4
4
  import { IElement, VimHelpers, VimHeader, VimDocument } from 'vim-format';
5
5
  export { BIM };
6
+ import * as React from 'react';
7
+ import React__default, { ReactNode } from 'react';
6
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
- import React, { ReactNode } from 'react';
8
9
 
9
10
  /**
10
11
  * @module vim-loader
@@ -311,8 +312,8 @@ type ViewerSettings = {
311
312
  */
312
313
  background: {
313
314
  /**
314
- * Color of the cavas background
315
- * Default: THREE.Color('#96999f')
315
+ * Color of the canvas background.
316
+ * Default: #F0F0F0
316
317
  */
317
318
  color: THREE.Color;
318
319
  };
@@ -442,7 +443,11 @@ interface IScene {
442
443
  * A signal with no payload.
443
444
  * Subscribe to be notified when the signal fires.
444
445
  */
445
- interface ISignal {
446
+ interface ISignalHandler {
447
+ (ev: IEventManagement): void;
448
+ }
449
+
450
+ interface ISignal$1 {
446
451
  /** Number of active subscriptions. */
447
452
  readonly count: number;
448
453
  /** Subscribe to the signal. Returns a function that unsubscribes. */
@@ -520,6 +525,12 @@ interface IVim<T extends IVimElement> {
520
525
  * @returns The element corresponding to the element index, or undefined if not found.
521
526
  */
522
527
  getElementFromIndex(element: number): T | undefined;
528
+ /**
529
+ * Retrieves the element associated with the specified Revit unique ID string.
530
+ * @param uniqueId - The Revit unique ID string.
531
+ * @returns The element, or undefined if not found.
532
+ */
533
+ getElementFromUniqueId(uniqueId: string): T | undefined;
523
534
  /**
524
535
  * Retrieves all elements within the Vim.
525
536
  * @returns An array of all Vim objects.
@@ -561,7 +572,7 @@ interface ISelection<T extends IVimElement> {
561
572
  /** Returns true if at least one object is selected. */
562
573
  any(): boolean;
563
574
  /** Signal that fires whenever the selection changes. */
564
- readonly onSelectionChanged: ISignal;
575
+ readonly onSelectionChanged: ISignal$1;
565
576
  /** Replaces the entire selection with the given object. */
566
577
  select(object: T): void;
567
578
  /** Replaces the entire selection with the given objects. */
@@ -665,9 +676,13 @@ interface IElement3D extends ISelectable {
665
676
  readonly element: number;
666
677
  /** The unique element ID. */
667
678
  readonly elementId: bigint;
679
+ /** The Revit unique ID string. */
680
+ readonly elementUniqueId: string | undefined;
668
681
  /** The geometry instances associated with this element. */
669
682
  readonly instances: number[] | undefined;
670
- /** True if this element has associated geometry. */
683
+ /** True if this element has geometry definitions (instances). Always available after the vim is parsed, even before geometry is loaded. */
684
+ readonly hasGeometry: boolean;
685
+ /** True if this element has loaded mesh data. Only true after `vim.load()` has been called for a subset containing this element. */
671
686
  readonly hasMesh: boolean;
672
687
  /** True if this element is a room. */
673
688
  readonly isRoom: boolean;
@@ -728,6 +743,101 @@ interface ISubset {
728
743
  except(mode: SubsetFilter, filter: number[] | Set<number>): ISubset;
729
744
  /** Return a new subset including only instances matching the filter. */
730
745
  filter(mode: SubsetFilter, filter: number[] | Set<number>): ISubset;
746
+ /** Return a new subset including only instances whose element matches one of the given Revit unique IDs. */
747
+ filterByUniqueId(uniqueIds: string[] | Set<string>): ISubset;
748
+ /** Return a new subset excluding instances whose element matches one of the given Revit unique IDs. */
749
+ exceptByUniqueId(uniqueIds: string[] | Set<string>): ISubset;
750
+ }
751
+
752
+ /**
753
+ * Event handler type definition for subscription changes.
754
+ */
755
+ type SubscriptionChangeEventHandler = (count: number) => void;
756
+
757
+ /**
758
+ * Indicates the object implements generic subscriptions.
759
+ *
760
+ * @export
761
+ * @interface ISubscribable
762
+ * @template TEventHandler The type of events to handle.
763
+ */
764
+ interface ISubscribable<TEventHandler> {
765
+ /**
766
+ * Returns the number of subscriptions.
767
+ *
768
+ * @type {number}
769
+ * @memberOf ISubscribable
770
+ */
771
+ readonly count: number;
772
+ /**
773
+ * Subscribe to the event.
774
+ *
775
+ * @param {TEventHandler} fn The event handler that is called when the event is dispatched.
776
+ * @returns {() => void} function that unsubscribes the event handler from the event.
777
+ *
778
+ * @memberOf ISubscribable
779
+ */
780
+ subscribe(fn: TEventHandler): () => void;
781
+ /**
782
+ * Subscribe to the event.
783
+ * @param {TEventHandler} fn The event handler that is called when the event is dispatched.
784
+ * @returns A function that unsubscribes the event handler from the event.
785
+ *
786
+ * @memberOf ISubscribable
787
+ */
788
+ sub(fn: TEventHandler): () => void;
789
+ /**
790
+ * Unsubscribe from the event.
791
+ * @param {TEventHandler} fn The event handler that will be unsubsribed from the event.
792
+ *
793
+ * @memberOf ISubscribable
794
+ */
795
+ unsubscribe(fn: TEventHandler): void;
796
+ /**
797
+ * Unsubscribe from the event.
798
+ * @param {TEventHandler} fn The event handler that will be unsubsribed from the event.
799
+ *
800
+ * @memberOf ISubscribable
801
+ */
802
+ unsub(fn: TEventHandler): void;
803
+ /**
804
+ * Subscribes to the event only once.
805
+ * @param {TEventHandler} fn The event handler that is called when the event is dispatched.
806
+ * @returns A function that unsubscribes the event handler from the event.
807
+ *
808
+ * @memberOf ISubscribable
809
+ */
810
+ one(fn: TEventHandler): () => void;
811
+ /**
812
+ * Checks it the event has a subscription for the specified handler.
813
+ * @param {TEventHandler} fn The event handler.
814
+ *
815
+ * @memberOf ISubscribable
816
+ */
817
+ has(fn: TEventHandler): boolean;
818
+ /**
819
+ * Clears all the subscriptions.
820
+ *
821
+ * @memberOf ISubscribable
822
+ */
823
+ clear(): void;
824
+ /**
825
+ * Triggered when subscriptions are changed (added or removed).
826
+ *
827
+ * @type {ISubscribable<SubscriptionChangeEventHandler>}
828
+ * @memberOf ISubscribable
829
+ */
830
+ readonly onSubscriptionChange: ISubscribable<SubscriptionChangeEventHandler>;
831
+ }
832
+
833
+ /**
834
+ * Models a signal. This type of events has no arguments.
835
+ *
836
+ * @export
837
+ * @interface ISignal
838
+ * @extends {ISubscribable<ISignalHandler>}
839
+ */
840
+ interface ISignal extends ISubscribable<ISignalHandler> {
731
841
  }
732
842
 
733
843
  /**
@@ -790,6 +900,8 @@ interface IWebglVim extends IVim<IElement3D> {
790
900
  load(subset?: ISubset): Promise<void>;
791
901
  /** Removes all loaded geometry from the renderer (does NOT unload the vim from the viewer). */
792
902
  clear(): void;
903
+ /** Fires after `load(subset)` completes and new geometry is available. */
904
+ readonly onGeometryLoaded: ISignal;
793
905
  }
794
906
 
795
907
  interface ILoadSuccess<T> {
@@ -951,11 +1063,11 @@ interface IWebglCamera {
951
1063
  /**
952
1064
  * A signal that is dispatched when camera settings change.
953
1065
  */
954
- onSettingsChanged: ISignal;
1066
+ onSettingsChanged: ISignal$1;
955
1067
  /**
956
1068
  * A signal that is dispatched when camera moves.
957
1069
  */
958
- onMoved: ISignal;
1070
+ onMoved: ISignal$1;
959
1071
  /**
960
1072
  * True if the camera has moved this frame.
961
1073
  */
@@ -1139,7 +1251,7 @@ type MeasureStage = 'ready' | 'active' | 'done' | 'failed';
1139
1251
  */
1140
1252
  interface IWebglSectionBox {
1141
1253
  /** Dispatches when active, visible, or interactive change. */
1142
- readonly onStateChanged: ISignal;
1254
+ readonly onStateChanged: ISignal$1;
1143
1255
  /** Dispatches when the user finishes manipulating the box. */
1144
1256
  readonly onBoxConfirm: ISimpleEvent<THREE.Box3>;
1145
1257
  /** Dispatches boolean indicating pointer hover state on box handles. */
@@ -1276,9 +1388,9 @@ interface IWebglViewport {
1276
1388
  /** Triggers a resize to match parent dimensions. */
1277
1389
  resizeToParent(): void;
1278
1390
  /** Signal dispatched when the canvas is reparented. */
1279
- readonly onReparent: ISignal;
1391
+ readonly onReparent: ISignal$1;
1280
1392
  /** Signal dispatched when the canvas is resized. */
1281
- readonly onResize: ISignal;
1393
+ readonly onResize: ISignal$1;
1282
1394
  }
1283
1395
 
1284
1396
  /**
@@ -1505,13 +1617,13 @@ interface IInputHandler {
1505
1617
  /** Temporary pointer mode during drag (e.g., right-drag = LOOK). Read-only. */
1506
1618
  readonly pointerOverride: PointerMode | undefined;
1507
1619
  /** Fires when {@link pointerMode} or {@link pointerOverride} changes. */
1508
- readonly onPointerModeChanged: ISignal;
1620
+ readonly onPointerModeChanged: ISignal$1;
1509
1621
  /** WASD move speed. Exponential scale: actual speed = 1.25^moveSpeed. Range: [-10, +10]. */
1510
1622
  moveSpeed: number;
1511
1623
  /** Scroll wheel zoom speed. Higher = faster zoom per scroll tick. */
1512
1624
  scrollSpeed: number;
1513
1625
  /** Fires when any speed setting changes (moveSpeed, scrollSpeed). */
1514
- readonly onSettingsChanged: ISignal;
1626
+ readonly onSettingsChanged: ISignal$1;
1515
1627
  /** Fires when a right-click context menu should be shown. Payload is client-space position. */
1516
1628
  readonly onContextMenu: ISimpleEvent<THREE.Vector2 | undefined>;
1517
1629
  }
@@ -1569,9 +1681,9 @@ interface IWebglRenderer {
1569
1681
  /** Scale factor for outline/selection render target resolution (0-1). */
1570
1682
  outlineScale: number;
1571
1683
  /** Signal dispatched once per render frame if the scene was updated. */
1572
- readonly onSceneUpdated: ISignal;
1684
+ readonly onSceneUpdated: ISignal$1;
1573
1685
  /** Signal dispatched when bounding box is updated. */
1574
- readonly onBoxUpdated: ISignal;
1686
+ readonly onBoxUpdated: ISignal$1;
1575
1687
  /** Whether text rendering is enabled. */
1576
1688
  textEnabled: boolean;
1577
1689
  /** Instance count below which ghosted meshes are hidden entirely. */
@@ -1621,7 +1733,7 @@ interface IWebglViewer {
1621
1733
  readonly camera: IWebglCamera;
1622
1734
  readonly gizmos: IGizmos;
1623
1735
  /** Fires when a vim finishes loading and is added to the scene. */
1624
- readonly onVimLoaded: ISignal;
1736
+ readonly onVimLoaded: ISignal$1;
1625
1737
  /** All loaded VIM models. Auto-populated on load, auto-removed on unload. */
1626
1738
  readonly vims: IWebglVim[];
1627
1739
  /** Loads a VIM file. The resulting vim is added to `vims` on success. */
@@ -1696,7 +1808,7 @@ type VimLoadingState = {
1696
1808
  */
1697
1809
  status: VimLoadingStatus;
1698
1810
  /**
1699
- * Loading progress as a percentage from 0 to 100.
1811
+ * Loading progress as a fraction from 0 to 1.
1700
1812
  */
1701
1813
  progress: number;
1702
1814
  };
@@ -1956,7 +2068,7 @@ declare const defaultRenderSettings: RenderSettings;
1956
2068
  * Interface defining the basic renderer capabilities
1957
2069
  */
1958
2070
  interface IUltraRenderer {
1959
- onSceneUpdated: ISignal;
2071
+ onSceneUpdated: ISignal$1;
1960
2072
  ghostColor: THREE.Color;
1961
2073
  ghostOpacity: number;
1962
2074
  hdrScale: number;
@@ -1964,7 +2076,7 @@ interface IUltraRenderer {
1964
2076
  hdrBackgroundScale: number;
1965
2077
  hdrBackgroundSaturation: number;
1966
2078
  backgroundBlur: number;
1967
- backgroundColor: THREE.Color;
2079
+ background: THREE.Color;
1968
2080
  getBoundingBox(): Promise<THREE.Box3 | undefined>;
1969
2081
  }
1970
2082
 
@@ -1981,7 +2093,7 @@ interface IUltraRenderer {
1981
2093
  * ```
1982
2094
  */
1983
2095
  interface IUltraSectionBox {
1984
- readonly onUpdate: ISignal;
2096
+ readonly onUpdate: ISignal$1;
1985
2097
  visible: boolean;
1986
2098
  interactive: boolean;
1987
2099
  active: boolean;
@@ -2149,7 +2261,7 @@ declare namespace Core_Ultra {
2149
2261
 
2150
2262
  declare namespace Core {
2151
2263
  export { PointerMode, Core_Ultra as Ultra, Core_Webgl as Webgl, authHeaders };
2152
- export type { ClickHandler, ContextMenuHandler, DoubleClickHandler, DragCallback, DragHandler, IInputHandler, IKeyboardInput, ILoadError, ILoadRequest, ILoadSuccess, IMouseInput, IProgress, ISignal, ISimpleEvent, ITouchInput, IVim, IVimElement, LoadResult, MouseOverrides, MoveHandler, PinchHandler, PinchStartHandler, PointerButtonHandler, ProgressType, TapHandler, TouchOverrides, WheelHandler };
2264
+ export type { ClickHandler, ContextMenuHandler, DoubleClickHandler, DragCallback, DragHandler, IInputHandler, IKeyboardInput, ILoadError, ILoadRequest, ILoadSuccess, IMouseInput, IProgress, ISignal$1 as ISignal, ISimpleEvent, ITouchInput, IVim, IVimElement, LoadResult, MouseOverrides, MoveHandler, PinchHandler, PinchStartHandler, PointerButtonHandler, ProgressType, TapHandler, TouchOverrides, WheelHandler };
2153
2265
  }
2154
2266
 
2155
2267
  /**
@@ -2198,10 +2310,6 @@ interface StateRef<T> {
2198
2310
  * @param value - The new state value.
2199
2311
  */
2200
2312
  set(value: T): void;
2201
- /**
2202
- * Confirms the current state (potentially applying a confirmation transformation).
2203
- */
2204
- confirm(): void;
2205
2313
  onChange: ISimpleEvent<T>;
2206
2314
  }
2207
2315
  /**
@@ -2252,74 +2360,137 @@ interface FuncRef<TArg, TReturn> {
2252
2360
  }
2253
2361
 
2254
2362
  /**
2255
- * Controls the section box clipping volume.
2256
- * Shared between WebGL and Ultra viewers.
2257
- *
2258
- * @example
2259
- * viewer.sectionBox.active.set(true)
2260
- * viewer.sectionBox.sectionSelection.call() // Fit to selection
2261
- * viewer.sectionBox.sectionScene.call() // Fit to scene
2363
+ * A boolean setting that can be locked by the host application.
2364
+ * - `true` / `false` user-toggleable default value, shown in settings UI.
2365
+ * - `"AlwaysTrue"` / `"AlwaysFalse"` — locked value, hidden from settings UI.
2262
2366
  */
2263
- interface SectionBoxApi {
2264
- active: StateRef<boolean>;
2265
- visible: StateRef<boolean>;
2266
- auto: StateRef<boolean>;
2267
- sectionSelection: FuncRef<void, Promise<void>>;
2268
- sectionScene: FuncRef<void, Promise<void>>;
2269
- sectionBox: FuncRef<THREE.Box3, void>;
2270
- getBox: () => THREE.Box3;
2271
- showOffsetPanel: StateRef<boolean>;
2272
- topOffset: StateRef<number>;
2273
- sideOffset: StateRef<number>;
2274
- bottomOffset: StateRef<number>;
2275
- getSelectionBox: FuncRef<void, Promise<THREE.Box3 | undefined>>;
2276
- getSceneBox: FuncRef<void, Promise<THREE.Box3 | undefined>>;
2277
- }
2278
-
2367
+ type UserBoolean = boolean | 'AlwaysTrue' | 'AlwaysFalse';
2279
2368
  /**
2280
- * @module viw-webgl-react
2369
+ * Checks if a UserBoolean value is effectively true
2370
+ * @param {UserBoolean | boolean} value - The value to check
2371
+ * @returns {boolean} True if the value is true or 'AlwaysTrue'
2372
+ */
2373
+ declare function isTrue(value: UserBoolean | boolean): value is true | "AlwaysTrue";
2374
+ /**
2375
+ * Checks if a UserBoolean value is effectively false
2376
+ * @param {UserBoolean | boolean} value - The value to check
2377
+ * @returns {boolean} True if the value is false or 'AlwaysFalse'
2281
2378
  */
2379
+ declare function isFalse(value: UserBoolean | boolean): value is false | "AlwaysFalse";
2282
2380
 
2283
2381
  /**
2284
- * High-level framing controls for the React viewer.
2285
- * Provides semantic operations like "frame selection" and "frame scene".
2286
- *
2287
- * For low-level camera movement (orbit, pan, zoom, snap/lerp), use
2288
- * `viewer.core.camera` which exposes {@link IWebglCamera}.
2289
- *
2290
- * @example
2291
- * // Frame the current selection with animation
2292
- * viewer.framing.frameSelection.call()
2293
- *
2294
- * // For direct camera manipulation, use the core camera:
2295
- * viewer.core.camera.lerp(1).frame('all')
2296
- * viewer.core.camera.snap().set(position, target)
2382
+ * @module icons
2297
2383
  */
2298
- interface FramingApi {
2299
- /** When true, automatically frames the camera on the selection whenever it changes. */
2300
- autoCamera: StateRef<boolean>;
2301
- /** Resets the camera to its last saved position. */
2302
- reset: FuncRef<void, void>;
2303
- /** Frames the camera on the current selection (or scene if nothing selected). */
2304
- frameSelection: FuncRef<void, Promise<void>>;
2305
- /** Frames the camera to show all loaded geometry. */
2306
- frameScene: FuncRef<void, Promise<void>>;
2307
- /** Returns the bounding box of the current selection, or undefined if nothing selected. */
2308
- getSelectionBox: FuncRef<void, Promise<THREE.Box3 | undefined>>;
2309
- /** Returns the bounding box of all loaded geometry. */
2310
- getSceneBox: FuncRef<void, Promise<THREE.Box3 | undefined>>;
2384
+ /**
2385
+ * Common Icon Options.
2386
+ */
2387
+ type IconOptions = {
2388
+ height?: number | string;
2389
+ width?: number | string;
2390
+ fill?: string;
2391
+ className?: string;
2392
+ };
2393
+ declare function pointer({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2394
+ declare function filter({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2395
+ declare function slidersHoriz({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2396
+ declare function settings({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2397
+ declare function help({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2398
+ declare function trash({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2399
+ declare function checkmark({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2400
+ declare function undo({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2401
+ declare function closeIcon({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2402
+ declare function home({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2403
+ declare function fullScreen({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2404
+ declare function minimize({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2405
+ declare function treeView({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2406
+ declare function more({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2407
+ declare function collapse({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2408
+ declare function arrowLeft({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2409
+ declare function fullArrowLeft({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2410
+ declare function visible({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2411
+ declare function hidden({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2412
+ declare function frameScene({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2413
+ declare function autoCamera({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2414
+ declare function orbit({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2415
+ declare function look({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2416
+ declare function perspective({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2417
+ declare function orthographic({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2418
+ declare function camera({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2419
+ declare function pan({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2420
+ declare function zoom({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2421
+ declare function frameRect({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2422
+ declare function frameSelection({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2423
+ declare function showAll({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2424
+ declare function showSelection({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2425
+ declare function hideSelection({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2426
+ declare function isolateSelection({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2427
+ declare function autoIsolate({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2428
+ declare function toggleIsolation({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2429
+ declare function measure({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2430
+ declare function sectionBoxSettings({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2431
+ declare function sectionBoxAuto({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2432
+ declare function sectionBoxVisible({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2433
+ declare function sectionBox({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2434
+ declare function sectionBoxDisable({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2435
+ declare function sectionBoxClip({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2436
+ declare function sectionBoxIgnore({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2437
+ declare function sectionBoxReset({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2438
+ declare function sectionBoxShrink({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2439
+ declare function sectionBoxShrink2({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2440
+ declare function ghost({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2441
+ declare function ghostDead({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2442
+
2443
+ declare namespace React_Icons {
2444
+ export { arrowLeft, autoCamera, autoIsolate, camera, checkmark, closeIcon, collapse, filter, frameRect, frameScene, frameSelection, fullArrowLeft, fullScreen, ghost, ghostDead, help, hidden, hideSelection, home, isolateSelection, look, measure, minimize, more, orbit, orthographic, pan, perspective, pointer, sectionBox, sectionBoxAuto, sectionBoxClip, sectionBoxDisable, sectionBoxIgnore, sectionBoxReset, sectionBoxSettings, sectionBoxShrink, sectionBoxShrink2, sectionBoxVisible, settings, showAll, showSelection, slidersHoriz, toggleIsolation, trash, treeView, undo, visible, zoom };
2445
+ export type { IconOptions };
2311
2446
  }
2312
2447
 
2448
+ type MessageBoxProps = {
2449
+ title: string;
2450
+ body: string | JSX.Element;
2451
+ icon?: JSX.Element;
2452
+ footer?: string | JSX.Element;
2453
+ canClose?: boolean;
2454
+ minimize?: boolean;
2455
+ onClose?: () => void;
2456
+ };
2457
+ type MessageBoxPropsTyped = MessageBoxProps & {
2458
+ type: 'message';
2459
+ };
2460
+
2461
+ type ProgressMode = 'percent' | 'bytes';
2462
+ /**
2463
+ * Interface for message information displayed in the LoadingBox.
2464
+ * @property message - Optional main message text.
2465
+ * @property info - Optional additional information or tooltip text.
2466
+ * @property progress - The progress of an operation.
2467
+ */
2468
+ type LoadingBoxProps = {
2469
+ message?: string;
2470
+ progress?: number;
2471
+ mode?: ProgressMode;
2472
+ more?: ReactNode;
2473
+ };
2474
+ type LoadingBoxPropsTyped = LoadingBoxProps & {
2475
+ type: 'loading';
2476
+ };
2477
+
2313
2478
  /**
2314
2479
  * @module viw-webgl-react
2315
2480
  */
2481
+ type HelpPropsTyped = {
2482
+ type: 'help';
2483
+ };
2316
2484
 
2317
- type AugmentedElement = BIM.IElement & {
2318
- bimDocumentName: string;
2319
- categoryName: string;
2320
- familyTypeName: string;
2321
- levelName: string;
2322
- worksetName: string;
2485
+ type ModalProps = (MessageBoxPropsTyped | LoadingBoxPropsTyped | HelpPropsTyped) & {
2486
+ canClose?: boolean;
2487
+ onClose?: () => void;
2488
+ };
2489
+ type ModalApi = {
2490
+ getActiveState(): ModalProps | undefined;
2491
+ loading(content: LoadingBoxProps | undefined): void;
2492
+ message(content: MessageBoxProps | undefined): void;
2493
+ help(show: boolean): void;
2323
2494
  };
2324
2495
 
2325
2496
  type VisibilityStatus = 'all' | 'allButSelection' | 'onlySelection' | 'some' | 'none';
@@ -2387,54 +2558,236 @@ interface IsolationApi {
2387
2558
  showAll(): void;
2388
2559
  }
2389
2560
 
2390
- type MessageBoxProps = {
2391
- title: string;
2392
- body: string | JSX.Element;
2393
- icon?: JSX.Element;
2394
- footer?: string | JSX.Element;
2395
- canClose?: boolean;
2396
- minimize?: boolean;
2397
- onClose?: () => void;
2398
- };
2399
- type MessageBoxPropsTyped = MessageBoxProps & {
2400
- type: 'message';
2401
- };
2561
+ type ButtonVariant = 'default' | 'expand' | 'disabled' | 'disabled-default' | 'blue';
2562
+ type SectionVariant = 'default' | 'blue';
2563
+ declare const buttonDefaultStyle: ButtonVariant;
2564
+ declare const buttonExpandStyle: ButtonVariant;
2565
+ declare const buttonDisableStyle: ButtonVariant;
2566
+ declare const buttonDisableDefaultStyle: ButtonVariant;
2567
+ declare const buttonBlueStyle: ButtonVariant;
2568
+ declare const sectionDefaultStyle: SectionVariant;
2569
+ declare const sectionBlueStyle: SectionVariant;
2570
+ declare const sectionNoPadStyle: SectionVariant;
2402
2571
 
2403
- type ProgressMode = 'percent' | 'bytes';
2404
- /**
2405
- * Interface for message information displayed in the LoadingBox.
2406
- * @property message - Optional main message text.
2407
- * @property info - Optional additional information or tooltip text.
2408
- * @property progress - The progress of an operation.
2409
- */
2410
- type LoadingBoxProps = {
2411
- message?: string;
2412
- progress?: number;
2413
- mode?: ProgressMode;
2414
- more?: ReactNode;
2415
- };
2416
- type LoadingBoxPropsTyped = LoadingBoxProps & {
2417
- type: 'loading';
2418
- };
2572
+ declare namespace React_ControlBar_Style {
2573
+ export { buttonBlueStyle, buttonDefaultStyle, buttonDisableDefaultStyle, buttonDisableStyle, buttonExpandStyle, sectionBlueStyle, sectionDefaultStyle, sectionNoPadStyle };
2574
+ export type { ButtonVariant, SectionVariant };
2575
+ }
2419
2576
 
2420
- /**
2421
- * @module viw-webgl-react
2577
+ interface IControlBarButton {
2578
+ id: string;
2579
+ enabled?: (() => boolean) | undefined;
2580
+ tip: string;
2581
+ action: () => void;
2582
+ icon: (options?: IconOptions) => JSX.Element;
2583
+ isOn?: () => boolean;
2584
+ variant?: ButtonVariant;
2585
+ }
2586
+
2587
+ interface IControlBarSection {
2588
+ id: string;
2589
+ enable?: (() => boolean) | undefined;
2590
+ buttons: (IControlBarButton)[];
2591
+ variant?: SectionVariant;
2592
+ }
2593
+
2594
+ type PartialUltraSettings = RecursivePartial<UltraSettings>;
2595
+ /**
2596
+ * React UI feature toggles for the Ultra viewer, passed to `React.Ultra.createViewer(container, settings)`.
2597
+ * Controls which UI panels and toolbar buttons are shown.
2598
+ * Access at runtime via `viewer.ui.controlBar.set(false)`.
2599
+ *
2600
+ * @example
2601
+ * const viewer = await React.Ultra.createViewer(div, {
2602
+ * ui: { panelControlBar: true, miscHelp: false }
2603
+ * })
2422
2604
  */
2423
- type HelpPropsTyped = {
2424
- type: 'help';
2605
+ type UltraSettings = {
2606
+ capacity: CapacitySettings;
2607
+ isolation: IsolationSettings;
2608
+ sectionBox: SectionBoxSettings;
2609
+ cursor: CursorSettings;
2610
+ camera: CameraSettings;
2611
+ ui: ControlBarCameraSettings & ControlBarCursorSettings & ControlBarSectionBoxSettings & ControlBarVisibilitySettings & {
2612
+ panelLogo: UserBoolean;
2613
+ panelControlBar: UserBoolean;
2614
+ miscSettings: UserBoolean;
2615
+ miscHelp: UserBoolean;
2616
+ };
2425
2617
  };
2618
+ declare function getDefaultUltraSettings(): UltraSettings;
2426
2619
 
2427
- type ModalProps = (MessageBoxPropsTyped | LoadingBoxPropsTyped | HelpPropsTyped) & {
2428
- canClose?: boolean;
2429
- onClose?: () => void;
2620
+ type ControlBarSectionBoxSettings = {
2621
+ sectioningEnable: UserBoolean;
2622
+ sectioningFitToSelection: UserBoolean;
2623
+ sectioningReset: UserBoolean;
2624
+ sectioningShow: UserBoolean;
2625
+ sectioningAuto: UserBoolean;
2626
+ sectioningSettings: UserBoolean;
2430
2627
  };
2431
- type ModalApi = {
2432
- getActiveState(): ModalProps | undefined;
2433
- loading(content: LoadingBoxProps | undefined): void;
2434
- message(content: MessageBoxProps | undefined): void;
2435
- help(show: boolean): void;
2628
+ type ControlBarCursorSettings = {
2629
+ cursorOrbit: UserBoolean;
2630
+ cursorLookAround: UserBoolean;
2631
+ cursorPan: UserBoolean;
2632
+ cursorZoom: UserBoolean;
2633
+ };
2634
+ type ControlBarMeasureSettings = {
2635
+ measureEnable: UserBoolean;
2636
+ };
2637
+ type ControlBarCameraSettings = {
2638
+ cameraAuto: UserBoolean;
2639
+ cameraFrameSelection: UserBoolean;
2640
+ cameraFrameScene: UserBoolean;
2641
+ };
2642
+ type ControlBarVisibilitySettings = {
2643
+ visibilityClearSelection: UserBoolean;
2644
+ visibilityShowAll: UserBoolean;
2645
+ visibilityToggle: UserBoolean;
2646
+ visibilityIsolate: UserBoolean;
2647
+ visibilityAutoIsolate: UserBoolean;
2648
+ visibilitySettings: UserBoolean;
2649
+ };
2650
+
2651
+ type PartialWebglSettings = RecursivePartial<WebglSettings>;
2652
+ /**
2653
+ * React UI feature toggles, passed to `React.Webgl.createViewer(container, settings)`.
2654
+ * Controls which UI panels and toolbar buttons are shown.
2655
+ * Access at runtime via `viewer.ui.bimTree.set(false)`.
2656
+ * Not to be confused with {@link ViewerSettings} (renderer config) or {@link VimSettings} (per-model transform).
2657
+ *
2658
+ * @example
2659
+ * const viewer = await React.Webgl.createViewer(div, {
2660
+ * ui: { panelBimTree: false, miscHelp: false }
2661
+ * })
2662
+ */
2663
+ type IsolationSettings = {
2664
+ autoIsolate: boolean;
2665
+ showGhost: boolean;
2666
+ transparency: boolean;
2667
+ showRooms: boolean;
2668
+ };
2669
+ type SectionBoxSettings = {
2670
+ active: boolean;
2671
+ auto: boolean;
2672
+ topOffset: number;
2673
+ sideOffset: number;
2674
+ bottomOffset: number;
2675
+ };
2676
+ type CursorSettings = {
2677
+ default: PointerMode;
2678
+ };
2679
+ type CameraSettings = {
2680
+ autoCamera: boolean;
2681
+ };
2682
+ type CapacitySettings = {
2683
+ canFollowUrl: boolean;
2684
+ canGoFullScreen: boolean;
2685
+ canDownload: boolean;
2686
+ canReadLocalStorage: boolean;
2687
+ };
2688
+ type WebglSettings = {
2689
+ capacity: CapacitySettings;
2690
+ isolation: IsolationSettings;
2691
+ sectionBox: SectionBoxSettings;
2692
+ cursor: CursorSettings;
2693
+ camera: CameraSettings;
2694
+ ui: ControlBarCameraSettings & ControlBarCursorSettings & ControlBarSectionBoxSettings & ControlBarVisibilitySettings & ControlBarMeasureSettings & {
2695
+ panelLogo: UserBoolean;
2696
+ panelBimTree: UserBoolean;
2697
+ panelBimInfo: UserBoolean;
2698
+ panelPerformance: UserBoolean;
2699
+ panelAxes: UserBoolean;
2700
+ panelControlBar: UserBoolean;
2701
+ axesOrthographic: UserBoolean;
2702
+ axesHome: UserBoolean;
2703
+ miscProjectInspector: UserBoolean;
2704
+ miscSettings: UserBoolean;
2705
+ miscHelp: UserBoolean;
2706
+ miscMaximise: UserBoolean;
2707
+ };
2708
+ };
2709
+ /**
2710
+ * Default settings configuration for the React Webgl Vim viewer
2711
+ * @constant
2712
+ * @type {WebglSettings}
2713
+ */
2714
+ declare function getDefaultSettings(): WebglSettings;
2715
+
2716
+ /**
2717
+ * Controls the section box clipping volume.
2718
+ * Shared between WebGL and Ultra viewers.
2719
+ *
2720
+ * @example
2721
+ * viewer.sectionBox.active.set(true)
2722
+ * viewer.sectionBox.sectionSelection.call() // Fit to selection
2723
+ * viewer.sectionBox.sectionScene.call() // Fit to scene
2724
+ */
2725
+ interface SectionBoxApi {
2726
+ active: StateRef<boolean>;
2727
+ visible: StateRef<boolean>;
2728
+ auto: StateRef<boolean>;
2729
+ sectionSelection: FuncRef<void, Promise<void>>;
2730
+ sectionScene: FuncRef<void, Promise<void>>;
2731
+ sectionBox: FuncRef<THREE.Box3, void>;
2732
+ getBox: () => THREE.Box3;
2733
+ showOffsetPanel: StateRef<boolean>;
2734
+ topOffset: StateRef<number>;
2735
+ sideOffset: StateRef<number>;
2736
+ bottomOffset: StateRef<number>;
2737
+ getSelectionBox: FuncRef<void, Promise<THREE.Box3 | undefined>>;
2738
+ getSceneBox: FuncRef<void, Promise<THREE.Box3 | undefined>>;
2739
+ }
2740
+
2741
+ /**
2742
+ * @module viw-webgl-react
2743
+ */
2744
+
2745
+ /**
2746
+ * High-level framing controls for the React viewer.
2747
+ * Provides semantic operations like "frame selection" and "frame scene".
2748
+ *
2749
+ * For low-level camera movement (orbit, pan, zoom, snap/lerp), use
2750
+ * `viewer.core.camera` which exposes {@link IWebglCamera}.
2751
+ *
2752
+ * @example
2753
+ * // Frame the current selection with animation
2754
+ * viewer.framing.frameSelection.call()
2755
+ *
2756
+ * // For direct camera manipulation, use the core camera:
2757
+ * viewer.core.camera.lerp(1).frame('all')
2758
+ * viewer.core.camera.snap().set(position, target)
2759
+ */
2760
+ interface FramingApi {
2761
+ /** When true, automatically frames the camera on the selection whenever it changes. */
2762
+ autoCamera: StateRef<boolean>;
2763
+ /** Resets the camera to its last saved position. */
2764
+ reset: FuncRef<void, void>;
2765
+ /** Frames the camera on the current selection (or scene if nothing selected). */
2766
+ frameSelection: FuncRef<void, Promise<void>>;
2767
+ /** Frames the camera to show all loaded geometry. */
2768
+ frameScene: FuncRef<void, Promise<void>>;
2769
+ /** Returns the bounding box of the current selection, or undefined if nothing selected. */
2770
+ getSelectionBox: FuncRef<void, Promise<THREE.Box3 | undefined>>;
2771
+ /** Returns the bounding box of all loaded geometry. */
2772
+ getSceneBox: FuncRef<void, Promise<THREE.Box3 | undefined>>;
2773
+ }
2774
+
2775
+ /**
2776
+ * @module viw-webgl-react
2777
+ */
2778
+
2779
+ type AugmentedElement = BIM.IElement & {
2780
+ bimDocumentName: string;
2781
+ categoryName: string;
2782
+ familyTypeName: string;
2783
+ levelName: string;
2784
+ worksetName: string;
2436
2785
  };
2437
2786
 
2787
+ /**
2788
+ * @module viw-webgl-react
2789
+ */
2790
+
2438
2791
  /**
2439
2792
  * Reference to manage context menu functionality in the viewer.
2440
2793
  */
@@ -2453,7 +2806,7 @@ interface IContextMenuButton {
2453
2806
  id: string;
2454
2807
  label: string;
2455
2808
  keyboard?: string;
2456
- action: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
2809
+ action: (e: React__default.MouseEvent<HTMLDivElement, MouseEvent>) => void;
2457
2810
  enabled: boolean;
2458
2811
  }
2459
2812
  /**
@@ -2607,90 +2960,6 @@ type BimInfoPanelApi = {
2607
2960
  onRenderBodyEntryValue: DataRender<Entry>;
2608
2961
  };
2609
2962
 
2610
- /**
2611
- * @module icons
2612
- */
2613
- /**
2614
- * Common Icon Options.
2615
- */
2616
- type IconOptions = {
2617
- height?: number | string;
2618
- width?: number | string;
2619
- fill?: string;
2620
- className?: string;
2621
- };
2622
- declare function pointer({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2623
- declare function filter({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2624
- declare function slidersHoriz({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2625
- declare function settings({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2626
- declare function help({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2627
- declare function trash({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2628
- declare function checkmark({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2629
- declare function undo({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2630
- declare function closeIcon({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2631
- declare function home({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2632
- declare function fullScreen({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2633
- declare function minimize({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2634
- declare function treeView({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2635
- declare function more({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2636
- declare function collapse({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2637
- declare function arrowLeft({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2638
- declare function fullArrowLeft({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2639
- declare function visible({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2640
- declare function hidden({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2641
- declare function frameScene({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2642
- declare function autoCamera({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2643
- declare function orbit({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2644
- declare function look({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2645
- declare function perspective({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2646
- declare function orthographic({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2647
- declare function camera({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2648
- declare function pan({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2649
- declare function zoom({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2650
- declare function frameRect({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2651
- declare function frameSelection({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2652
- declare function showAll({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2653
- declare function showSelection({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2654
- declare function hideSelection({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2655
- declare function isolateSelection({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2656
- declare function autoIsolate({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2657
- declare function toggleIsolation({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2658
- declare function measure({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2659
- declare function sectionBoxSettings({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2660
- declare function sectionBoxAuto({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2661
- declare function sectionBoxVisible({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2662
- declare function sectionBox({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2663
- declare function sectionBoxDisable({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2664
- declare function sectionBoxClip({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2665
- declare function sectionBoxIgnore({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2666
- declare function sectionBoxReset({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2667
- declare function sectionBoxShrink({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2668
- declare function sectionBoxShrink2({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2669
- declare function ghost({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2670
- declare function ghostDead({ height, width, fill, className }?: IconOptions): react_jsx_runtime.JSX.Element;
2671
-
2672
- declare namespace React_Icons {
2673
- export { arrowLeft, autoCamera, autoIsolate, camera, checkmark, closeIcon, collapse, filter, frameRect, frameScene, frameSelection, fullArrowLeft, fullScreen, ghost, ghostDead, help, hidden, hideSelection, home, isolateSelection, look, measure, minimize, more, orbit, orthographic, pan, perspective, pointer, sectionBox, sectionBoxAuto, sectionBoxClip, sectionBoxDisable, sectionBoxIgnore, sectionBoxReset, sectionBoxSettings, sectionBoxShrink, sectionBoxShrink2, sectionBoxVisible, settings, showAll, showSelection, slidersHoriz, toggleIsolation, trash, treeView, undo, visible, zoom };
2674
- export type { IconOptions };
2675
- }
2676
-
2677
- interface IControlBarButton {
2678
- id: string;
2679
- enabled?: (() => boolean) | undefined;
2680
- tip: string;
2681
- action: () => void;
2682
- icon: (options?: IconOptions) => JSX.Element;
2683
- isOn?: () => boolean;
2684
- style?: (on: boolean) => string;
2685
- }
2686
-
2687
- interface IControlBarSection {
2688
- id: string;
2689
- enable?: (() => boolean) | undefined;
2690
- buttons: (IControlBarButton)[];
2691
- style?: string;
2692
- }
2693
-
2694
2963
  /**
2695
2964
  * Reference to manage control bar functionality in the viewer.
2696
2965
  */
@@ -2706,144 +2975,6 @@ type ControlBarApi = {
2706
2975
  */
2707
2976
  type ControlBarCustomization = (e: IControlBarSection[]) => IControlBarSection[];
2708
2977
 
2709
- /**
2710
- * A boolean setting that can be locked by the host application.
2711
- * - `true` / `false` — user-toggleable default value, shown in settings UI.
2712
- * - `"AlwaysTrue"` / `"AlwaysFalse"` — locked value, hidden from settings UI.
2713
- */
2714
- type UserBoolean = boolean | 'AlwaysTrue' | 'AlwaysFalse';
2715
- /**
2716
- * Checks if a UserBoolean value is effectively true
2717
- * @param {UserBoolean | boolean} value - The value to check
2718
- * @returns {boolean} True if the value is true or 'AlwaysTrue'
2719
- */
2720
- declare function isTrue(value: UserBoolean | boolean): value is true | "AlwaysTrue";
2721
- /**
2722
- * Checks if a UserBoolean value is effectively false
2723
- * @param {UserBoolean | boolean} value - The value to check
2724
- * @returns {boolean} True if the value is false or 'AlwaysFalse'
2725
- */
2726
- declare function isFalse(value: UserBoolean | boolean): value is false | "AlwaysFalse";
2727
-
2728
- declare const baseSectionStyle = "vc-flex vc-items-center vc-rounded-full vc-mb-2 vc-shadow-md";
2729
- declare const sectionDefaultStyle: string;
2730
- declare const sectionBlueStyle: string;
2731
- declare const sectionNoPadStyle: string;
2732
- declare const buttonBaseStyle = "vim-control-bar-button vc-rounded-full vc-items-center vc-justify-center vc-flex vc-transition-all hover:vc-scale-110";
2733
- declare function buttonDefaultStyle(on: boolean): string;
2734
- declare function buttonExpandStyle(on: boolean): string;
2735
- declare function buttonDisableStyle(on: boolean): string;
2736
- declare function buttonDisableDefaultStyle(on: boolean): string;
2737
- declare function buttonBlueStyle(on: boolean): string;
2738
-
2739
- declare namespace React_ControlBar_Style {
2740
- export {
2741
- baseSectionStyle,
2742
- buttonBaseStyle,
2743
- buttonBlueStyle,
2744
- buttonDefaultStyle,
2745
- buttonDisableDefaultStyle,
2746
- buttonDisableStyle,
2747
- buttonExpandStyle,
2748
- sectionBlueStyle,
2749
- sectionDefaultStyle,
2750
- sectionNoPadStyle,
2751
- };
2752
- }
2753
-
2754
- type PartialUltraSettings = RecursivePartial<UltraSettings>;
2755
- /**
2756
- * React UI feature toggles for the Ultra viewer, passed to `React.Ultra.createViewer(container, settings)`.
2757
- * Controls which UI panels and toolbar buttons are shown.
2758
- * Access at runtime via `viewer.settings.update(s => { s.ui.panelControlBar = false })`.
2759
- *
2760
- * @example
2761
- * const viewer = await React.Ultra.createViewer(div, {
2762
- * ui: { panelControlBar: true, miscHelp: false }
2763
- * })
2764
- */
2765
- type UltraSettings = {
2766
- ui: ControlBarCameraSettings & ControlBarCursorSettings & ControlBarSectionBoxSettings & ControlBarVisibilitySettings & {
2767
- panelLogo: UserBoolean;
2768
- panelControlBar: UserBoolean;
2769
- miscSettings: UserBoolean;
2770
- miscHelp: UserBoolean;
2771
- };
2772
- };
2773
- declare function getDefaultUltraSettings(): UltraSettings;
2774
-
2775
- type ControlBarSectionBoxSettings = {
2776
- sectioningEnable: UserBoolean;
2777
- sectioningFitToSelection: UserBoolean;
2778
- sectioningReset: UserBoolean;
2779
- sectioningShow: UserBoolean;
2780
- sectioningAuto: UserBoolean;
2781
- sectioningSettings: UserBoolean;
2782
- };
2783
- type ControlBarCursorSettings = {
2784
- cursorOrbit: UserBoolean;
2785
- cursorLookAround: UserBoolean;
2786
- cursorPan: UserBoolean;
2787
- cursorZoom: UserBoolean;
2788
- };
2789
- type ControlBarMeasureSettings = {
2790
- measureEnable: UserBoolean;
2791
- };
2792
- type ControlBarCameraSettings = {
2793
- cameraAuto: UserBoolean;
2794
- cameraFrameSelection: UserBoolean;
2795
- cameraFrameScene: UserBoolean;
2796
- };
2797
- type ControlBarVisibilitySettings = {
2798
- visibilityClearSelection: UserBoolean;
2799
- visibilityShowAll: UserBoolean;
2800
- visibilityToggle: UserBoolean;
2801
- visibilityIsolate: UserBoolean;
2802
- visibilityAutoIsolate: UserBoolean;
2803
- visibilitySettings: UserBoolean;
2804
- };
2805
-
2806
- type PartialWebglSettings = RecursivePartial<WebglSettings>;
2807
- /**
2808
- * React UI feature toggles, passed to `React.Webgl.createViewer(container, settings)`.
2809
- * Controls which UI panels and toolbar buttons are shown.
2810
- * Access at runtime via `viewer.settings.update(s => { s.ui.panelBimTree = false })`.
2811
- * Not to be confused with {@link ViewerSettings} (renderer config) or {@link VimSettings} (per-model transform).
2812
- *
2813
- * @example
2814
- * const viewer = await React.Webgl.createViewer(div, {
2815
- * ui: { panelBimTree: false, miscHelp: false }
2816
- * })
2817
- */
2818
- type WebglSettings = {
2819
- capacity: {
2820
- canFollowUrl: boolean;
2821
- canGoFullScreen: boolean;
2822
- canDownload: boolean;
2823
- canReadLocalStorage: boolean;
2824
- };
2825
- ui: ControlBarCameraSettings & ControlBarCursorSettings & ControlBarSectionBoxSettings & ControlBarVisibilitySettings & ControlBarMeasureSettings & {
2826
- panelLogo: UserBoolean;
2827
- panelBimTree: UserBoolean;
2828
- panelBimInfo: UserBoolean;
2829
- panelPerformance: UserBoolean;
2830
- panelAxes: UserBoolean;
2831
- panelControlBar: UserBoolean;
2832
- axesOrthographic: UserBoolean;
2833
- axesHome: UserBoolean;
2834
- miscProjectInspector: UserBoolean;
2835
- miscSettings: UserBoolean;
2836
- miscHelp: UserBoolean;
2837
- miscMaximise: UserBoolean;
2838
- };
2839
- };
2840
- /**
2841
- * Default settings configuration for the React Webgl Vim viewer
2842
- * @constant
2843
- * @type {WebglSettings}
2844
- */
2845
- declare function getDefaultSettings(): WebglSettings;
2846
-
2847
2978
  /**
2848
2979
  * @module viw-webgl-react
2849
2980
  */
@@ -2875,6 +3006,8 @@ interface GenericNumberEntry {
2875
3006
  min?: number;
2876
3007
  max?: number;
2877
3008
  step?: number;
3009
+ info?: string;
3010
+ transform?: (n: number) => number;
2878
3011
  }
2879
3012
  interface GenericBoolEntry {
2880
3013
  type: "bool";
@@ -2896,78 +3029,105 @@ interface GenericSelectEntry {
2896
3029
  }[];
2897
3030
  state: StateRef<string>;
2898
3031
  }
2899
- type GenericEntryType = GenericTextEntry | GenericBoolEntry | GenericNumberEntry | GenericSelectEntry;
2900
-
2901
- type GenericPanelApi = {
2902
- customize(fn: (entries: GenericEntryType[]) => GenericEntryType[]): void;
2903
- };
2904
-
2905
- /**
2906
- * @module viw-webgl-react
2907
- * Contains settings and type definitions for the Vim web viewer
2908
- */
2909
-
2910
- type AnySettings = WebglSettings | UltraSettings;
2911
-
2912
- type SettingsCustomization<T extends AnySettings> = (items: SettingsItem<T>[]) => SettingsItem<T>[];
2913
- type SettingsItem<T extends AnySettings> = SettingsSubtitle | SettingsToggle<T> | SettingsBox<T> | SettingsSelect<T> | SettingsElement;
2914
- type SettingsSubtitle = {
2915
- type: 'subtitle';
2916
- key: string;
2917
- title: string;
2918
- };
2919
- type SettingsToggle<T extends AnySettings> = {
2920
- type: 'toggle';
2921
- key: string;
3032
+ interface GenericSubtitleEntry {
3033
+ type: 'section';
3034
+ id: string;
2922
3035
  label: string;
2923
- getter: (settings: T) => UserBoolean;
2924
- setter: (settings: T, b: boolean) => void;
2925
- };
2926
- type SettingsBox<T extends AnySettings> = {
2927
- type: 'box';
2928
- key: string;
3036
+ }
3037
+ interface GenericGroupEntry {
3038
+ type: 'group';
3039
+ id: string;
2929
3040
  label: string;
2930
- info: string;
2931
- transform: (value: number) => number;
2932
- getter: (settings: T) => number;
2933
- setter: (settings: T, b: number) => void;
2934
- };
2935
- type SettingsSelect<T extends AnySettings> = {
2936
- type: 'select';
2937
- key: string;
3041
+ }
3042
+ interface GenericReadonlyEntry {
3043
+ type: 'readonly';
3044
+ id: string;
2938
3045
  label: string;
2939
- options: {
2940
- label: string;
2941
- value: string;
2942
- }[];
2943
- getter: (settings: T) => string;
2944
- setter: (settings: T, value: string) => void;
2945
- };
2946
- type SettingsElement = {
3046
+ value: string;
3047
+ visible?: () => boolean;
3048
+ renderValue?: () => React__default.ReactNode;
3049
+ }
3050
+ interface GenericElementEntry {
2947
3051
  type: 'element';
2948
- key: string;
3052
+ id: string;
2949
3053
  element: JSX.Element;
3054
+ }
3055
+ type GenericEntryType = GenericTextEntry | GenericBoolEntry | GenericNumberEntry | GenericSelectEntry | GenericSubtitleEntry | GenericGroupEntry | GenericReadonlyEntry | GenericElementEntry;
3056
+
3057
+ type GenericPanelApi = {
3058
+ customize(fn: (entries: GenericEntryType[]) => GenericEntryType[]): void;
2950
3059
  };
2951
3060
 
2952
3061
  /**
2953
- * Settings API managing settings applied to the viewer.
2954
- */
2955
- type SettingsApi<T extends AnySettings> = {
2956
- /**
2957
- * Allows updating settings by providing a callback function.
2958
- * @param updater A function that updates the current settings.
2959
- */
2960
- update: (updater: (settings: T) => void) => void;
2961
- /**
2962
- * Registers a callback function to be notified when settings are updated.
2963
- * @param callback A function to be called when settings are updated, receiving the updated settings.
2964
- */
2965
- register: (callback: (settings: T) => void) => void;
2966
- /**
2967
- * Customizes the settings panel by providing a customizer function.
2968
- * @param customizer A function that modifies the settings items.
2969
- */
2970
- customize: (customizer: (items: SettingsItem<T>[]) => SettingsItem<T>[]) => void;
3062
+ * Reactive UI visibility API for the WebGL viewer.
3063
+ * Each member is a `StateRef<boolean>` that can be read, written, and subscribed to.
3064
+ *
3065
+ * @example
3066
+ * viewer.ui.bimTree.set(false) // Hide BIM tree
3067
+ * viewer.ui.controlBar.get() // Read current state
3068
+ * viewer.ui.axes.onChange.subscribe(…) // Subscribe to changes
3069
+ */
3070
+ type WebglUiApi = {
3071
+ logo: StateRef<boolean>;
3072
+ controlBar: StateRef<boolean>;
3073
+ bimTree: StateRef<boolean>;
3074
+ bimInfo: StateRef<boolean>;
3075
+ axes: StateRef<boolean>;
3076
+ performance: StateRef<boolean>;
3077
+ axesOrthographic: StateRef<boolean>;
3078
+ axesHome: StateRef<boolean>;
3079
+ cursorOrbit: StateRef<boolean>;
3080
+ cursorLookAround: StateRef<boolean>;
3081
+ cursorPan: StateRef<boolean>;
3082
+ cursorZoom: StateRef<boolean>;
3083
+ cameraAuto: StateRef<boolean>;
3084
+ cameraFrameScene: StateRef<boolean>;
3085
+ cameraFrameSelection: StateRef<boolean>;
3086
+ sectioningEnable: StateRef<boolean>;
3087
+ sectioningFitToSelection: StateRef<boolean>;
3088
+ sectioningReset: StateRef<boolean>;
3089
+ sectioningShow: StateRef<boolean>;
3090
+ sectioningAuto: StateRef<boolean>;
3091
+ sectioningSettings: StateRef<boolean>;
3092
+ measureEnable: StateRef<boolean>;
3093
+ visibilityClearSelection: StateRef<boolean>;
3094
+ visibilityShowAll: StateRef<boolean>;
3095
+ visibilityToggle: StateRef<boolean>;
3096
+ visibilityIsolate: StateRef<boolean>;
3097
+ visibilityAutoIsolate: StateRef<boolean>;
3098
+ visibilitySettings: StateRef<boolean>;
3099
+ miscProjectInspector: StateRef<boolean>;
3100
+ miscSettings: StateRef<boolean>;
3101
+ miscHelp: StateRef<boolean>;
3102
+ miscMaximise: StateRef<boolean>;
3103
+ };
3104
+ /**
3105
+ * Reactive UI visibility API for the Ultra viewer.
3106
+ */
3107
+ type UltraUiApi = {
3108
+ logo: StateRef<boolean>;
3109
+ controlBar: StateRef<boolean>;
3110
+ cursorOrbit: StateRef<boolean>;
3111
+ cursorLookAround: StateRef<boolean>;
3112
+ cursorPan: StateRef<boolean>;
3113
+ cursorZoom: StateRef<boolean>;
3114
+ cameraAuto: StateRef<boolean>;
3115
+ cameraFrameScene: StateRef<boolean>;
3116
+ cameraFrameSelection: StateRef<boolean>;
3117
+ sectioningEnable: StateRef<boolean>;
3118
+ sectioningFitToSelection: StateRef<boolean>;
3119
+ sectioningReset: StateRef<boolean>;
3120
+ sectioningShow: StateRef<boolean>;
3121
+ sectioningAuto: StateRef<boolean>;
3122
+ sectioningSettings: StateRef<boolean>;
3123
+ visibilityClearSelection: StateRef<boolean>;
3124
+ visibilityShowAll: StateRef<boolean>;
3125
+ visibilityToggle: StateRef<boolean>;
3126
+ visibilityIsolate: StateRef<boolean>;
3127
+ visibilityAutoIsolate: StateRef<boolean>;
3128
+ visibilitySettings: StateRef<boolean>;
3129
+ miscSettings: StateRef<boolean>;
3130
+ miscHelp: StateRef<boolean>;
2971
3131
  };
2972
3132
 
2973
3133
  /**
@@ -3037,10 +3197,6 @@ type WebglViewerApi = {
3037
3197
  * Control bar API managing the content and behavior of the control bar.
3038
3198
  */
3039
3199
  controlBar: ControlBarApi;
3040
- /**
3041
- * Settings API managing settings applied to the viewer.
3042
- */
3043
- settings: SettingsApi<WebglSettings>;
3044
3200
  /**
3045
3201
  * Message API to interact with the loading box.
3046
3202
  */
@@ -3063,6 +3219,16 @@ type WebglViewerApi = {
3063
3219
  * API to interact with the section box panel.
3064
3220
  */
3065
3221
  sectionBoxPanel: GenericPanelApi;
3222
+ /**
3223
+ * Reactive UI visibility controls. Each key from the settings `ui` block
3224
+ * is a `StateRef<boolean>` that can be read, written, and subscribed to.
3225
+ *
3226
+ * @example
3227
+ * viewer.ui.bimTree.set(false) // Hide BIM tree
3228
+ * viewer.ui.controlBar.get() // Read current state
3229
+ * viewer.ui.axes.onChange.subscribe(…) // Subscribe to changes
3230
+ */
3231
+ ui: WebglUiApi;
3066
3232
  /**
3067
3233
  * Cleans up and releases resources used by the viewer.
3068
3234
  */
@@ -3076,10 +3242,10 @@ type WebglViewerApi = {
3076
3242
  * @param container An optional container or DOM element. If none is provided, one will be created.
3077
3243
  * @param settings React UI feature toggles (panels, buttons). See {@link WebglSettings}.
3078
3244
  * @param coreSettings Core renderer config (camera, materials, lighting). See {@link ViewerSettings}.
3079
- * @returns A promise resolving to the viewer API.
3245
+ * @returns The viewer API.
3080
3246
  *
3081
3247
  * @example
3082
- * const viewer = await React.Webgl.createViewer(document.getElementById('app'))
3248
+ * const viewer = React.Webgl.createViewer(document.getElementById('app'))
3083
3249
  * const vim = await viewer.load({ url: 'model.vim' }).getVim()
3084
3250
  * viewer.framing.frameScene.call()
3085
3251
  */
@@ -3091,12 +3257,11 @@ declare function createWebglViewer(container?: Container | HTMLElement, settings
3091
3257
  * @param onMount A callback function triggered when the viewer is mounted. Receives a reference to the Vim viewer.
3092
3258
  * @param settings Optional settings for configuring the Vim viewer's behavior.
3093
3259
  */
3094
- declare function WebglViewerComponent(props: {
3260
+ declare const WebglViewerComponent: React.ForwardRefExoticComponent<{
3095
3261
  container: Container;
3096
3262
  viewer: IWebglViewer;
3097
- onMount: (viewer: WebglViewerApi) => void;
3098
3263
  settings?: PartialWebglSettings;
3099
- }): react_jsx_runtime.JSX.Element;
3264
+ } & React.RefAttributes<WebglViewerApi>>;
3100
3265
 
3101
3266
  declare namespace React_Webgl {
3102
3267
  export { WebglViewerComponent as ViewerComponent, createWebglViewer as createViewer, getDefaultSettings };
@@ -3148,11 +3313,6 @@ type UltraViewerApi = {
3148
3313
  * @see {@link IsolationApi}
3149
3314
  */
3150
3315
  isolation: IsolationApi;
3151
- /**
3152
- * Settings API managing UI feature toggles applied to the viewer.
3153
- * Use `update()` to modify settings at runtime.
3154
- */
3155
- settings: SettingsApi<UltraSettings>;
3156
3316
  /**
3157
3317
  * API to interact with the isolation panel.
3158
3318
  */
@@ -3161,6 +3321,15 @@ type UltraViewerApi = {
3161
3321
  * API to interact with the section box panel.
3162
3322
  */
3163
3323
  sectionBoxPanel: GenericPanelApi;
3324
+ /**
3325
+ * Reactive UI visibility controls. Each key from the settings `ui` block
3326
+ * is a `StateRef<boolean>` that can be read, written, and subscribed to.
3327
+ *
3328
+ * @example
3329
+ * viewer.ui.logo.set(false) // Hide logo
3330
+ * viewer.ui.controlBar.get() // Read current state
3331
+ */
3332
+ ui: UltraUiApi;
3164
3333
  /**
3165
3334
  * Disposes of the viewer and its resources.
3166
3335
  */
@@ -3186,10 +3355,10 @@ type UltraViewerApi = {
3186
3355
  *
3187
3356
  * @param container An optional container or DOM element. If none is provided, one will be created.
3188
3357
  * @param settings React UI feature toggles (panels, buttons). See {@link UltraSettings}.
3189
- * @returns A promise resolving to the viewer API.
3358
+ * @returns The viewer API.
3190
3359
  *
3191
3360
  * @example
3192
- * const viewer = await React.Ultra.createViewer(document.getElementById('app'))
3361
+ * const viewer = React.Ultra.createViewer(document.getElementById('app'))
3193
3362
  * await viewer.core.connect({ url: 'wss://server:8080' })
3194
3363
  * viewer.load({ url: 'model.vim' })
3195
3364
  */
@@ -3201,12 +3370,11 @@ declare function createUltraViewer(container?: Container | HTMLElement, settings
3201
3370
  * @param onMount A callback function triggered when the viewer is mounted. Receives a reference to the Vim viewer.
3202
3371
  * @param settings Optional settings for configuring the Vim viewer's behavior.
3203
3372
  */
3204
- declare function UltraViewerComponent(props: {
3373
+ declare const UltraViewerComponent: React.ForwardRefExoticComponent<{
3205
3374
  container: Container;
3206
3375
  core: IUltraViewer;
3207
3376
  settings?: PartialUltraSettings;
3208
- onMount: (viewer: UltraViewerApi) => void;
3209
- }): react_jsx_runtime.JSX.Element;
3377
+ } & React.RefAttributes<UltraViewerApi>>;
3210
3378
 
3211
3379
  declare namespace React_Ultra {
3212
3380
  export { UltraViewerComponent as ViewerComponent, createUltraViewer as createViewer, getDefaultUltraSettings };
@@ -3253,18 +3421,13 @@ declare namespace React_ControlBar {
3253
3421
  export type { ControlBarApi, ControlBarCustomization, IControlBarButton, IControlBarSection };
3254
3422
  }
3255
3423
 
3424
+ type SettingsCustomization = (items: GenericEntryType[]) => GenericEntryType[];
3425
+
3256
3426
  declare namespace React_Settings {
3257
3427
  export { isFalse, isTrue };
3258
- export type { SettingsBox, SettingsCustomization, SettingsElement, SettingsItem, SettingsSubtitle, SettingsToggle, UserBoolean };
3428
+ export type { SettingsCustomization, GenericEntryType as SettingsItem, UserBoolean };
3259
3429
  }
3260
3430
 
3261
- declare const vcColorPrimary = "vc-text-[#212733]";
3262
- declare const vcColorSecondary = "vc-text-[#787C83]";
3263
- declare const vcColorLink = "vc-text-[#0590CC]";
3264
- declare const vcLink = "vc-text-[#0590CC] vc-underline";
3265
- declare const vcLabel = "vc-text-[#3F444F]";
3266
- declare const vcRoboto = "vc-font-['Roboto',sans-serif]";
3267
- declare function footer(): react_jsx_runtime.JSX.Element;
3268
3431
  declare function mainText(text: JSX.Element): react_jsx_runtime.JSX.Element;
3269
3432
  declare function detailText(text: string): react_jsx_runtime.JSX.Element;
3270
3433
  declare function bold(text: string): react_jsx_runtime.JSX.Element;
@@ -3273,6 +3436,7 @@ declare function dotList(elements: (JSX.Element | string)[]): react_jsx_runtime.
3273
3436
  declare function numList(elements: (JSX.Element | string)[]): react_jsx_runtime.JSX.Element;
3274
3437
  declare function bullet(label: string, value: string): react_jsx_runtime.JSX.Element;
3275
3438
  declare function link(url: string, text: string): react_jsx_runtime.JSX.Element;
3439
+ declare function footer(): react_jsx_runtime.JSX.Element;
3276
3440
 
3277
3441
  declare namespace React_Errors_Style {
3278
3442
  export {
@@ -3285,12 +3449,6 @@ declare namespace React_Errors_Style {
3285
3449
  mainText,
3286
3450
  numList,
3287
3451
  subTitle,
3288
- vcColorLink,
3289
- vcColorPrimary,
3290
- vcColorSecondary,
3291
- vcLabel,
3292
- vcLink,
3293
- vcRoboto,
3294
3452
  };
3295
3453
  }
3296
3454
 
@@ -3347,8 +3505,8 @@ type ViewerApi = WebglViewerApi | UltraViewerApi;
3347
3505
 
3348
3506
  declare namespace React {
3349
3507
  export { React_ContextMenu as ContextMenu, React_ControlBar as ControlBar, React_Errors as Errors, React_Icons as Icons, IsolationPanel, SectionBoxPanel, React_Settings as Settings, React_Ultra as Ultra, React_Webgl as Webgl, createContainer, createState };
3350
- export type { AugmentedElement, BimInfoPanelApi, Container, Data, DataCustomization, DataRender, Entry, FramingApi, FuncRef, GenericBoolEntry, GenericEntryType, GenericNumberEntry, GenericPanelApi, GenericTextEntry, Group, IsolationApi, LoadingBoxProps, MessageBoxProps, ModalApi, ModalProps, ProgressMode, Section, SectionBoxApi, SettingsApi, StateRef, ViewerApi, VisibilityStatus };
3508
+ export type { AugmentedElement, BimInfoPanelApi, Container, Data, DataCustomization, DataRender, Entry, FramingApi, FuncRef, GenericBoolEntry, GenericEntryType, GenericNumberEntry, GenericPanelApi, GenericTextEntry, Group, IsolationApi, LoadingBoxProps, MessageBoxProps, ModalApi, ModalProps, ProgressMode, Section, SectionBoxApi, StateRef, UltraUiApi, ViewerApi, VisibilityStatus, WebglUiApi };
3351
3509
  }
3352
3510
 
3353
3511
  export { Core as Core, React as React };
3354
- export type { ISignal, ISimpleEvent };
3512
+ export type { ISignal$1 as ISignal, ISimpleEvent };