@vertexvis/viewer-toolkit-react 0.0.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.
- package/dist/bundle.cjs.js +2525 -0
- package/dist/bundle.cjs.js.map +1 -0
- package/dist/bundle.esm.js +2479 -0
- package/dist/bundle.esm.js.map +1 -0
- package/dist/components/box-selection/__tests__/box-selection-button.spec.d.ts +1 -0
- package/dist/components/box-selection/__tests__/box-selection-tool.spec.d.ts +1 -0
- package/dist/components/box-selection/box-selection-button.d.ts +1 -0
- package/dist/components/box-selection/box-selection-tool.d.ts +1 -0
- package/dist/components/common/__tests__/slider.spec.d.ts +1 -0
- package/dist/components/common/popup-button.d.ts +14 -0
- package/dist/components/common/slider.d.ts +10 -0
- package/dist/components/context-menu/__tests__/scene-tree-context-menu.spec.d.ts +1 -0
- package/dist/components/context-menu/__tests__/viewer-context-menu.spec.d.ts +1 -0
- package/dist/components/context-menu/context-menu.d.ts +13 -0
- package/dist/components/context-menu/default-scene-tree-context-menu.d.ts +1 -0
- package/dist/components/context-menu/default-viewer-context-menu.d.ts +1 -0
- package/dist/components/context-menu/menu-items/fit-selected-menu-item.d.ts +1 -0
- package/dist/components/context-menu/menu-items/fly-to-menu-item.d.ts +1 -0
- package/dist/components/context-menu/menu-items/hide-all-menu-item.d.ts +1 -0
- package/dist/components/context-menu/menu-items/hide-part-menu-item.d.ts +1 -0
- package/dist/components/context-menu/menu-items/hide-selected-menu-item.d.ts +1 -0
- package/dist/components/context-menu/menu-items/show-all-menu-item.d.ts +1 -0
- package/dist/components/context-menu/menu-items/show-only-menu-item.d.ts +1 -0
- package/dist/components/context-menu/menu-items/show-only-selected-menu-item.d.ts +1 -0
- package/dist/components/context-menu/scene-tree-context-menu.d.ts +5 -0
- package/dist/components/context-menu/viewer-context-menu.d.ts +5 -0
- package/dist/components/scene-tree/__tests__/vertex-scene-tree-table-layout.spec.d.ts +1 -0
- package/dist/components/scene-tree/__tests__/vertex-scene-tree.spec.d.ts +1 -0
- package/dist/components/scene-tree/vertex-scene-tree-table-layout.d.ts +3 -0
- package/dist/components/scene-tree/vertex-scene-tree.d.ts +14 -0
- package/dist/components/toolbar/__tests__/toolbar.spec.d.ts +1 -0
- package/dist/components/toolbar/cross-section/__tests__/cross-section-alignment-popover-menu.spec.d.ts +1 -0
- package/dist/components/toolbar/cross-section/__tests__/cross-section-axis-popover-menu.spec.d.ts +1 -0
- package/dist/components/toolbar/cross-section/__tests__/cross-section-offset-stepper.spec.d.ts +1 -0
- package/dist/components/toolbar/cross-section/__tests__/cross-section.spec.d.ts +1 -0
- package/dist/components/toolbar/cross-section/cross-section-alignment-popover-menu.d.ts +1 -0
- package/dist/components/toolbar/cross-section/cross-section-axis-popover-menu.d.ts +1 -0
- package/dist/components/toolbar/cross-section/cross-section-offset-stepper.d.ts +9 -0
- package/dist/components/toolbar/cross-section/cross-section-popup-menu.d.ts +6 -0
- package/dist/components/toolbar/cross-section/cross-section.d.ts +8 -0
- package/dist/components/toolbar/default-toolbar.d.ts +1 -0
- package/dist/components/toolbar/fit-all.d.ts +1 -0
- package/dist/components/toolbar/pan.d.ts +1 -0
- package/dist/components/toolbar/rotate.d.ts +1 -0
- package/dist/components/toolbar/toolbar-divider.d.ts +1 -0
- package/dist/components/toolbar/toolbar.d.ts +5 -0
- package/dist/components/toolbar/zoom.d.ts +1 -0
- package/dist/components/viewer/__tests__/vertex-viewer-view-cube.spec.d.ts +1 -0
- package/dist/components/viewer/__tests__/vertex-viewer.spec.d.ts +1 -0
- package/dist/components/viewer/vertex-viewer-view-cube.d.ts +7 -0
- package/dist/components/viewer/vertex-viewer.d.ts +9 -0
- package/dist/events-listener.d.ts +7 -0
- package/dist/index.css +7 -0
- package/dist/index.d.ts +28 -0
- package/dist/root.d.ts +9 -0
- package/dist/state/box-selection/actions.d.ts +7 -0
- package/dist/state/box-selection/box-selection.d.ts +3 -0
- package/dist/state/box-selection/index.d.ts +2 -0
- package/dist/state/config/config.d.ts +2 -0
- package/dist/state/config/index.d.ts +1 -0
- package/dist/state/context-menu/actions.d.ts +13 -0
- package/dist/state/context-menu/backdrop.d.ts +2 -0
- package/dist/state/context-menu/context-menu.d.ts +13 -0
- package/dist/state/context-menu/index.d.ts +3 -0
- package/dist/state/cross-section/__tests__/actions.spec.d.ts +1 -0
- package/dist/state/cross-section/actions.d.ts +24 -0
- package/dist/state/cross-section/cross-section.d.ts +30 -0
- package/dist/state/cross-section/index.d.ts +2 -0
- package/dist/state/hits/__tests__/hits.spec.d.ts +1 -0
- package/dist/state/hits/actions.d.ts +6 -0
- package/dist/state/hits/event-state.d.ts +9 -0
- package/dist/state/hits/hits.d.ts +17 -0
- package/dist/state/hits/index.d.ts +3 -0
- package/dist/state/keybinding/__tests__/long-press.spec.d.ts +1 -0
- package/dist/state/keybinding/index.d.ts +3 -0
- package/dist/state/keybinding/keybinding.d.ts +151 -0
- package/dist/state/keybinding/long-press.d.ts +7 -0
- package/dist/state/keybinding/targets.d.ts +2 -0
- package/dist/state/performance/index.d.ts +1 -0
- package/dist/state/performance/types.d.ts +37 -0
- package/dist/state/scene-tree/columns/columns.d.ts +16 -0
- package/dist/state/scene-tree/columns/index.d.ts +1 -0
- package/dist/state/scene-tree/core/__tests__/actions.spec.d.ts +1 -0
- package/dist/state/scene-tree/core/actions.d.ts +9 -0
- package/dist/state/scene-tree/core/core.d.ts +5 -0
- package/dist/state/scene-tree/core/index.d.ts +2 -0
- package/dist/state/scene-tree/index.d.ts +1 -0
- package/dist/state/scene-tree/types.d.ts +14 -0
- package/dist/state/selection/__tests__/actions.spec.d.ts +1 -0
- package/dist/state/selection/actions.d.ts +25 -0
- package/dist/state/selection/event-state.d.ts +8 -0
- package/dist/state/selection/index.d.ts +3 -0
- package/dist/state/selection/selection.d.ts +16 -0
- package/dist/state/viewer/camera/actions.d.ts +7 -0
- package/dist/state/viewer/camera/index.d.ts +1 -0
- package/dist/state/viewer/core/core.d.ts +5 -0
- package/dist/state/viewer/core/index.d.ts +1 -0
- package/dist/state/viewer/frame/actions.d.ts +5 -0
- package/dist/state/viewer/index.d.ts +3 -0
- package/dist/state/viewer/scene/actions.d.ts +14 -0
- package/dist/state/viewer/scene/index.d.ts +2 -0
- package/dist/state/viewer/scene/item-operations.d.ts +11 -0
- package/dist/state/viewer/scene/scene.d.ts +6 -0
- package/dist/testing/__setup__/mocks.d.ts +4 -0
- package/dist/testing/additional-hooks-wrapper.d.ts +19 -0
- package/dist/testing/react.d.ts +13 -0
- package/dist/testing/recoil-observer.d.ts +6 -0
- package/dist/testing/recoil-state.d.ts +5 -0
- package/dist/testing/recoil-wrapper.d.ts +21 -0
- package/dist/testing/viewer.d.ts +72 -0
- package/dist/util/camera/__tests__/camera.spec.d.ts +1 -0
- package/dist/util/camera/camera.d.ts +3 -0
- package/dist/util/cross-section/__tests__/interaction-handler.spec.d.ts +1 -0
- package/dist/util/cross-section/__tests__/section-plane.spec.d.ts +1 -0
- package/dist/util/cross-section/interaction-handler.d.ts +10 -0
- package/dist/util/cross-section/section-plane.d.ts +61 -0
- package/dist/util/dom/elements.d.ts +1 -0
- package/dist/util/geometry/__tests__/bounding-box.spec.d.ts +1 -0
- package/dist/util/geometry/__tests__/vector3.spec.d.ts +1 -0
- package/dist/util/geometry/bounding-box.d.ts +4 -0
- package/dist/util/geometry/vector3.d.ts +2 -0
- package/dist/util/logging/__tests__/logger.spec.d.ts +1 -0
- package/dist/util/logging/logger.d.ts +8 -0
- package/dist/util/measurement/units.d.ts +57 -0
- package/dist/util/recoil/__tests__/actions.spec.d.ts +1 -0
- package/dist/util/recoil/actions.d.ts +86 -0
- package/dist/util/recoil/reducer.d.ts +9 -0
- package/dist/util/recoil/synchronized-prop.d.ts +2 -0
- package/dist/util/refs/callback-ref.d.ts +10 -0
- package/dist/util/refs/recoil-ref.d.ts +6 -0
- package/dist/util/scene-tree/customization.d.ts +3 -0
- package/dist/util/sdk-mapping/__tests__/config.spec.d.ts +1 -0
- package/dist/util/sdk-mapping/config.d.ts +2 -0
- package/package.json +80 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EventTargetPredicate } from "@state/keybinding/targets";
|
|
3
|
+
export interface StackKeyBinding {
|
|
4
|
+
/**
|
|
5
|
+
* The ID of this stack based key binding.
|
|
6
|
+
* This ID will be used to match existing actions
|
|
7
|
+
* on the stack prior to pushing, so it's expected
|
|
8
|
+
* to be unique to the action. E.g. "CancelMeasurement"
|
|
9
|
+
* versus a UUID.
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* The key binding that will execute the provided
|
|
14
|
+
* function.
|
|
15
|
+
*
|
|
16
|
+
* Supports using a "+" to combine keys, and "||"
|
|
17
|
+
* to indicate multiple options.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* "Shift+ArrowLeft" -> shift and left arrow pressed
|
|
21
|
+
* "Shift||ArrowLeft" -> shift or left arrow pressed
|
|
22
|
+
*/
|
|
23
|
+
keyBind: string;
|
|
24
|
+
/**
|
|
25
|
+
* The function to invoke when the `keyBind` matches.
|
|
26
|
+
*/
|
|
27
|
+
fn: VoidFunction;
|
|
28
|
+
/**
|
|
29
|
+
* A predicate that indicates whether to re-add this
|
|
30
|
+
* key binding when the dependency list changes.
|
|
31
|
+
* Always re-adds if not specified.
|
|
32
|
+
*/
|
|
33
|
+
addPredicate?: () => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* A predicate that indicates whether to cancel this
|
|
36
|
+
* key binding when the dependency list changes.
|
|
37
|
+
* Never cancels if not specified.
|
|
38
|
+
*/
|
|
39
|
+
cancelPredicate?: () => boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface ApplyKeyBinding {
|
|
42
|
+
/**
|
|
43
|
+
* The key binding that will execute the provided
|
|
44
|
+
* function.
|
|
45
|
+
*
|
|
46
|
+
* Supports using a "+" to combine keys, and "||"
|
|
47
|
+
* to indicate multiple options.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* "Shift+ArrowLeft" -> shift and left arrow pressed
|
|
51
|
+
* "Shift||ArrowLeft" -> shift or left arrow pressed
|
|
52
|
+
*
|
|
53
|
+
* Can be set to undefined to disable the binding.
|
|
54
|
+
*/
|
|
55
|
+
keyBind?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Whether this key binding should repeat
|
|
58
|
+
*/
|
|
59
|
+
repeat?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The function to invoke when the `keyBind` matches.
|
|
62
|
+
* This function should be memoized to avoid infinite rerenders.
|
|
63
|
+
*/
|
|
64
|
+
fn: VoidFunction;
|
|
65
|
+
/**
|
|
66
|
+
* An optional function that is invoked when the `keyBind` no longer
|
|
67
|
+
* matches.
|
|
68
|
+
* This function should be memoized to avoid infinite rerenders.
|
|
69
|
+
*/
|
|
70
|
+
off?: VoidFunction;
|
|
71
|
+
}
|
|
72
|
+
interface StateApplyKeyBinding extends ApplyKeyBinding {
|
|
73
|
+
id: string;
|
|
74
|
+
active: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface KeyBindingState {
|
|
77
|
+
applyBindings: StateApplyKeyBinding[];
|
|
78
|
+
bindings: Record<string, StackKeyBinding[]>;
|
|
79
|
+
pressed: Record<string, boolean>;
|
|
80
|
+
lastPressed?: string;
|
|
81
|
+
}
|
|
82
|
+
export declare const keyBindings: import("recoil").RecoilState<KeyBindingState>;
|
|
83
|
+
export type KeyBindingAction = {
|
|
84
|
+
type: 'push-key-binding';
|
|
85
|
+
binding: StackKeyBinding;
|
|
86
|
+
} | {
|
|
87
|
+
type: 'remove-key-binding';
|
|
88
|
+
binding: StackKeyBinding;
|
|
89
|
+
} | {
|
|
90
|
+
type: 'add-apply-key-binding';
|
|
91
|
+
binding: StateApplyKeyBinding;
|
|
92
|
+
} | {
|
|
93
|
+
type: 'remove-apply-key-binding';
|
|
94
|
+
id: string;
|
|
95
|
+
} | {
|
|
96
|
+
type: 'set-key-pressed';
|
|
97
|
+
key: string;
|
|
98
|
+
pressed: boolean;
|
|
99
|
+
};
|
|
100
|
+
export declare function reducer(state: KeyBindingState, action: KeyBindingAction): KeyBindingState;
|
|
101
|
+
/**
|
|
102
|
+
* A readonly view of the current key state.
|
|
103
|
+
*/
|
|
104
|
+
export declare const useKeyBindingReadonlyState: () => KeyBindingState;
|
|
105
|
+
/**
|
|
106
|
+
* Depends on `useKeyBindings`.
|
|
107
|
+
*
|
|
108
|
+
* Adds a global key binding. Any key binding
|
|
109
|
+
* added this way will listen to global state for pressed
|
|
110
|
+
* keys, and executed whenever the key state matches the
|
|
111
|
+
* provided `keyBind`.
|
|
112
|
+
*
|
|
113
|
+
* @param binding - The `ApplyKeyBinding` to add.
|
|
114
|
+
*/
|
|
115
|
+
export declare const useApplyKeyBinding: (binding: ApplyKeyBinding) => void;
|
|
116
|
+
/**
|
|
117
|
+
* Depends on `useKeyBindings`.
|
|
118
|
+
*
|
|
119
|
+
* Adds a stack-based key binding. Any key binding
|
|
120
|
+
* added this way will be added to an existing (or new)
|
|
121
|
+
* stack for the specified `keyBind`.
|
|
122
|
+
*
|
|
123
|
+
* Provided `binding`s will be added and cancelled based
|
|
124
|
+
* on the specified `addPredicate` and `cancelPredicate`
|
|
125
|
+
* respectively. These predicates are evaluated any time
|
|
126
|
+
* that the `deps` array changes.
|
|
127
|
+
*
|
|
128
|
+
* @param binding - The `StackKeyBinding` to add.
|
|
129
|
+
* @param deps (optional) - The React dependency list.
|
|
130
|
+
*/
|
|
131
|
+
export declare const useStackKeyBinding: (binding: StackKeyBinding, deps?: React.DependencyList) => void;
|
|
132
|
+
export interface UseKeyBindingsProps {
|
|
133
|
+
/**
|
|
134
|
+
* The interval at which to repeat apply keyBinds that have been
|
|
135
|
+
* created with `repeat` set to `true`.
|
|
136
|
+
*/
|
|
137
|
+
keydownRepeatInterval?: number;
|
|
138
|
+
/**
|
|
139
|
+
* A predicate that indicates whether a keydown should be ignored
|
|
140
|
+
* based on the event target. Defaults to any `input` like elements.
|
|
141
|
+
*/
|
|
142
|
+
keydownIgnorePredicate?: EventTargetPredicate;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Enables key binding usage.
|
|
146
|
+
*
|
|
147
|
+
* This hook must appear in the tree for `useStackKeyBinding`
|
|
148
|
+
* or `useApplyKeyBinding` to work.
|
|
149
|
+
*/
|
|
150
|
+
export declare const useKeyBindings: ({ keydownRepeatInterval, keydownIgnorePredicate, }?: UseKeyBindingsProps) => void;
|
|
151
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface Measure {
|
|
2
|
+
name: string;
|
|
3
|
+
duration: number;
|
|
4
|
+
startTime: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const SCENE_ALTERATION_PERFORMANCE = "Scene Alteration Performance";
|
|
7
|
+
export declare enum SceneAlterationPerformanceType {
|
|
8
|
+
HIDE_ITEM = "Hide Item",
|
|
9
|
+
SHOW_ONLY_SELECTED = "Show Only Selected",
|
|
10
|
+
HIDE_SELECTED = "Hide Selected",
|
|
11
|
+
SHOW_ONLY_ITEM = "Show Only Item",
|
|
12
|
+
SHOW_ALL = "Show All",
|
|
13
|
+
HIDE_ALL = "Hide All",
|
|
14
|
+
SELECT_FILTERED_ITEMS = "Select Filtered Items",
|
|
15
|
+
INVERT_SELECTION = "Invert Selection",
|
|
16
|
+
CLEAR_ALL_TRANSFORMS = "Clear All Transforms",
|
|
17
|
+
CLEAR_SELECTED_TRANSFORMS = "Clear Selected Transforms",
|
|
18
|
+
CLEAR_SELECTION = "Clear Selection",
|
|
19
|
+
DESELECTING_ITEMS = "Deselecting Items",
|
|
20
|
+
SELECTING_ITEMS = "Selecting Items",
|
|
21
|
+
SELECTING_ONLY_ITEM = "Selecting Only Item",
|
|
22
|
+
SELECTING_ANCESTOR = "Selecting Ancestor",
|
|
23
|
+
APPLY_MATERIAL_OVERRIDE_TO_ALL = "Apply Material Override To All",
|
|
24
|
+
APPLY_MATERIAL_OVERRIDE_TO_SELECTION = "Apply Material Override To Selection",
|
|
25
|
+
CLEAR_ALL_MATERIAL_OVERRIDES = "Clear All Material Overrides",
|
|
26
|
+
CLEAR_SELECTED_MATERIAL_OVERRIDES = "Clear Selected Material Overrides",
|
|
27
|
+
SET_PHANTOM_ALL = "Set Phantom All",
|
|
28
|
+
SET_PHANTOM_SELECTED_ITEMS = "Set Phantom Selected Items",
|
|
29
|
+
CLEAR_PHANTOM_ALL = "Clear Phantom All",
|
|
30
|
+
CLEAR_PHANTOM_SELECTED_ITEMS = "Clear Phantom Selected Items",
|
|
31
|
+
SET_PHANTOM_NON_SELECTED_ITEMS = "Set Phantom Non Selected Items",
|
|
32
|
+
RESTORE_PHANTOM_OVERRIDES = "Restore Phantom Overrides",
|
|
33
|
+
SET_ITEM_AS_END_ITEM = "Set Item as End Item",
|
|
34
|
+
UNSET_ITEM_AS_END_ITEM = "Unset Item as End Item",
|
|
35
|
+
SHOW_ANNOTATION = "Show Annotation",
|
|
36
|
+
HIDE_ANNOTATION = "Hide Annotation"
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const DEFAULT_NAME_COLUMN: DefaultColumn;
|
|
2
|
+
interface ActiveColumn {
|
|
3
|
+
initialWidth?: number;
|
|
4
|
+
minWidth?: number;
|
|
5
|
+
label: string;
|
|
6
|
+
binding: string;
|
|
7
|
+
}
|
|
8
|
+
interface DefaultColumn extends ActiveColumn {
|
|
9
|
+
metadataKeyName: string;
|
|
10
|
+
}
|
|
11
|
+
export interface UseSceneTreeColumnsProps {
|
|
12
|
+
sceneTreeElement: HTMLVertexSceneTreeElement | null;
|
|
13
|
+
}
|
|
14
|
+
export declare const sceneTreeColumnsActiveColumns: import("recoil").RecoilValueReadOnly<Record<string, ActiveColumn>>;
|
|
15
|
+
export declare const sceneTreeColumnsActiveColumnNames: import("recoil").RecoilValueReadOnly<string[]>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './columns';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SceneTreeOperationHandler } from '@vertexvis/viewer/dist/types/components/scene-tree/lib/handlers';
|
|
2
|
+
export interface UseSceneTreeActions {
|
|
3
|
+
toggleSelection: SceneTreeOperationHandler;
|
|
4
|
+
toggleExpansion: SceneTreeOperationHandler;
|
|
5
|
+
toggleVisibility: SceneTreeOperationHandler;
|
|
6
|
+
flyToRow: (rowClientY: number) => Promise<void>;
|
|
7
|
+
setContextMenuItem: (rowClientY: number) => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare function useSceneTreeActions(): UseSceneTreeActions;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SceneTreeController } from '@vertexvis/viewer';
|
|
2
|
+
export declare const sceneTreeLoaderVisible: import("recoil").RecoilState<boolean>;
|
|
3
|
+
export declare const sceneTreeElement: import("recoil").RecoilState<HTMLVertexSceneTreeElement | null | undefined>;
|
|
4
|
+
export declare const sceneTreeWidth: import("recoil").RecoilState<number | undefined>;
|
|
5
|
+
export declare const sceneTreeController: import("recoil").RecoilValueReadOnly<SceneTreeController | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum AssemblyFontFace {
|
|
2
|
+
'ROBOTO' = "ROBOTO",
|
|
3
|
+
'ROBOTO_MONO' = "ROBOTO_MONO"
|
|
4
|
+
}
|
|
5
|
+
export interface AssemblyFont {
|
|
6
|
+
fontFace: AssemblyFontFace;
|
|
7
|
+
color: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AssemblyBackgroundColors {
|
|
10
|
+
defaultColor: string;
|
|
11
|
+
depthColors: Record<number, string>;
|
|
12
|
+
hovered: string;
|
|
13
|
+
selected: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UUID } from '@vertexvis/utils';
|
|
2
|
+
import { SelectionItem } from './selection';
|
|
3
|
+
export interface SelectOptions {
|
|
4
|
+
clear?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface ClearAndSelectOptions {
|
|
7
|
+
ignoreAncestorSelection?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface SyncSelectionOptions {
|
|
10
|
+
selected: boolean;
|
|
11
|
+
multiSelect?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface UseSelectionActions {
|
|
14
|
+
select: (item: SelectionItem, options?: SelectOptions) => void | Promise<void>;
|
|
15
|
+
toggleSelection: (item: SelectionItem) => void | Promise<void>;
|
|
16
|
+
clearAndSelect: (item: SelectionItem, options?: ClearAndSelectOptions) => void | Promise<void>;
|
|
17
|
+
selectCurrentHit: VoidFunction;
|
|
18
|
+
syncSelection: (item: SelectionItem, options: SyncSelectionOptions) => void | Promise<void>;
|
|
19
|
+
deselect: (id: UUID.UUID) => void | Promise<void>;
|
|
20
|
+
clearSelection: () => Promise<void>;
|
|
21
|
+
resetSelectionState: () => Promise<void>;
|
|
22
|
+
toggleLastSelectWasMultiSelect: (multiSelection: boolean) => void | Promise<void>;
|
|
23
|
+
selectForModelViewsPanel: (item?: SelectionItem) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function useSelectionActions(): UseSelectionActions;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UUID } from '@vertexvis/utils';
|
|
2
|
+
import { SelectionItem } from './selection';
|
|
3
|
+
export interface SelectionState {
|
|
4
|
+
selectedItemIds: UUID.UUID[];
|
|
5
|
+
lastSelected?: SelectionItem;
|
|
6
|
+
highestSelectedAncestorId?: UUID.UUID;
|
|
7
|
+
}
|
|
8
|
+
export declare const selectionState: import("recoil").RecoilValueReadOnly<SelectionState>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { UUID } from '@vertexvis/utils';
|
|
2
|
+
import type { SceneViewSummary } from '@vertexvis/viewer/dist/types/lib/types';
|
|
3
|
+
export interface SelectionItem {
|
|
4
|
+
id: UUID.UUID;
|
|
5
|
+
metadata?: unknown[];
|
|
6
|
+
ancestors?: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare const selectionSelectedItems: (param: string) => import("recoil").RecoilState<SelectionItem | undefined>;
|
|
9
|
+
export declare const selectionSelectedItemIds: import("recoil").RecoilState<string[]>;
|
|
10
|
+
export declare const selectionLastSelected: import("recoil").RecoilState<SelectionItem | undefined>;
|
|
11
|
+
export declare const selectionLastSelectionFromViewer: import("recoil").RecoilState<boolean>;
|
|
12
|
+
export declare const selectionLastSelectWasMultiSelect: import("recoil").RecoilState<boolean>;
|
|
13
|
+
export declare const selectionHighestSelectedAncestor: import("recoil").RecoilValueReadOnly<string | undefined>;
|
|
14
|
+
export declare const selectionPreviousVisibleSummary: import("recoil").RecoilState<SceneViewSummary.ItemSetSummary | undefined>;
|
|
15
|
+
export declare const selectionVisibleSummary: import("recoil").RecoilState<SceneViewSummary.ItemSetSummary | undefined>;
|
|
16
|
+
export declare const selectionVisibleCount: import("recoil").RecoilValueReadOnly<number>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BoundingBox } from '@vertexvis/geometry';
|
|
2
|
+
export declare const DEFAULT_CAMERA_ANIMATION_DURATION = 500;
|
|
3
|
+
export interface UseViewerCameraActions {
|
|
4
|
+
flyToById(id: string, animationMs?: number): Promise<void>;
|
|
5
|
+
flyToByBoundingBox(boundingBox: BoundingBox.BoundingBox, animationMs?: number): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare function useViewerCameraActions(): UseViewerCameraActions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './actions';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BaseInteractionHandler, InteractionType } from '@vertexvis/viewer/dist/types/lib/interactions/baseInteractionHandler';
|
|
2
|
+
export declare const viewerElement: import("recoil").RecoilState<HTMLVertexViewerElement | null | undefined>;
|
|
3
|
+
export declare const viewerInitialSceneReady: import("recoil").RecoilState<boolean>;
|
|
4
|
+
export declare const viewerBaseInteractionHandlerProvider: import("recoil").RecoilState<Promise<BaseInteractionHandler | undefined>>;
|
|
5
|
+
export declare const viewerPrimaryInteractionType: import("recoil").RecoilState<InteractionType>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './core';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SceneAlterationPerformanceType } from '@state/performance';
|
|
2
|
+
import { UUID } from '@vertexvis/utils';
|
|
3
|
+
import type { SceneItemOperationsBuilder } from '@vertexvis/viewer/dist/types/lib/scenes/index';
|
|
4
|
+
import type { SceneItemQueryExecutor } from '@vertexvis/viewer/dist/types/lib/scenes/queries';
|
|
5
|
+
export type ViewerSceneTransform = (op: SceneItemQueryExecutor) => SceneItemOperationsBuilder;
|
|
6
|
+
export type ViewerSceneItemsTransform = (...ids: UUID.UUID[]) => (op: SceneItemQueryExecutor) => SceneItemOperationsBuilder;
|
|
7
|
+
export interface UseViewerSceneActions {
|
|
8
|
+
executeWithCorrelationId: (alterationType: SceneAlterationPerformanceType, correlationId: UUID.UUID, ...transforms: ViewerSceneTransform[]) => Promise<void>;
|
|
9
|
+
execute: (alterationType: SceneAlterationPerformanceType, ...transforms: ViewerSceneTransform[]) => Promise<void>;
|
|
10
|
+
selectItemsTransform: ViewerSceneItemsTransform;
|
|
11
|
+
deselectItemsTransform: ViewerSceneItemsTransform;
|
|
12
|
+
clearSelectionTransform: ViewerSceneTransform;
|
|
13
|
+
}
|
|
14
|
+
export declare function useViewerSceneActions(): UseViewerSceneActions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SceneItemOperationsBuilder, TerminalItemOperationBuilder } from '@vertexvis/viewer/dist/types/lib/scenes';
|
|
2
|
+
export interface SceneItemOperationsProps {
|
|
3
|
+
viewerElement: HTMLVertexViewerElement | null;
|
|
4
|
+
}
|
|
5
|
+
export interface SceneItemOperations {
|
|
6
|
+
sceneItemsOperation: (f: (builder: SceneItemOperationsBuilder) => TerminalItemOperationBuilder, ids?: string[]) => Promise<void>;
|
|
7
|
+
showOnlySelected: () => Promise<void>;
|
|
8
|
+
showOnlyItem: (id: string) => Promise<void>;
|
|
9
|
+
hideSelected: () => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare function useSceneItemsOperations({ viewerElement }: SceneItemOperationsProps): SceneItemOperations;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BoundingBox } from '@vertexvis/geometry';
|
|
2
|
+
import type { Scene } from '@vertexvis/viewer';
|
|
3
|
+
import type { FrameScene } from '@vertexvis/viewer/dist/types/lib/types';
|
|
4
|
+
export declare const viewerSceneProvider: import("recoil").RecoilValueReadOnly<() => Promise<Scene | undefined>>;
|
|
5
|
+
export declare const viewerFrameScene: import("recoil").RecoilState<FrameScene | undefined>;
|
|
6
|
+
export declare const viewerSceneVisibleBoundingBox: import("recoil").RecoilValueReadOnly<BoundingBox.BoundingBox | undefined>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AdditionalHooksWrapperProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
hooks: VoidFunction;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A small wrapper component that allows for rendering
|
|
8
|
+
* of arbitrary hooks, provided by the `hooks` prop. This
|
|
9
|
+
* allows for "global" hooks to be included when testing
|
|
10
|
+
* a smaller component.
|
|
11
|
+
*
|
|
12
|
+
* Example rendering with keybindings present:
|
|
13
|
+
*
|
|
14
|
+
* <AdditionalHooksWrapper hooks={() => useKeyBindings()}>
|
|
15
|
+
* <BoxSelectionEnableTool />
|
|
16
|
+
* </AdditionalHooksWrapper>
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export declare function AdditionalHooksWrapper({ children, hooks, }: AdditionalHooksWrapperProps): JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface DefinedRefObject<T> extends React.RefObject<T> {
|
|
2
|
+
current: T;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Filters out any props (provided as {...props} when mocking elements)
|
|
6
|
+
* that are not supported to reduce the amount of error logging during tests.
|
|
7
|
+
*/
|
|
8
|
+
export declare function filterAttributes(props: Record<string, unknown>, additionalSupportedKeys?: string[]): Record<string, unknown>;
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves an attribute from an element that has been mocked in the
|
|
11
|
+
* `mocks.tsx` setup file.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getTestAttribute(element: HTMLElement, attribute: string): string | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MutableSnapshot } from 'recoil';
|
|
2
|
+
import { ViewerRefMock } from './viewer';
|
|
3
|
+
export declare const initializeViewerElementProvider: (snapshot: MutableSnapshot, viewerRefMock: ViewerRefMock) => void;
|
|
4
|
+
export declare const initializeViewerSceneCamera: (snapshot: MutableSnapshot, viewerRefMock: ViewerRefMock) => void;
|
|
5
|
+
export declare const initializeViewerProviders: (snapshot: MutableSnapshot, viewerRefMock: ViewerRefMock) => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MutableSnapshot } from 'recoil';
|
|
3
|
+
interface Props extends Record<string, unknown> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
initializeState?: (snapshot: MutableSnapshot) => void;
|
|
6
|
+
}
|
|
7
|
+
interface ObservableProps extends Props {
|
|
8
|
+
observers?: React.ReactElement[];
|
|
9
|
+
}
|
|
10
|
+
interface RenderHookOptions<T> {
|
|
11
|
+
wrapper: (props: T) => React.ReactElement<T>;
|
|
12
|
+
}
|
|
13
|
+
export declare const ObservableRecoilWrapper: ({ children, initializeState, observers, }: ObservableProps) => React.ReactElement<ObservableProps>;
|
|
14
|
+
export declare const RecoilWrapper: ({ children, initializeState, }: Props) => React.ReactElement<Props>;
|
|
15
|
+
export declare const renderHookOptions: {
|
|
16
|
+
wrapper: ({ children, initializeState, }: Props) => React.ReactElement<Props>;
|
|
17
|
+
};
|
|
18
|
+
export type ObservableRenderHookOptions = RenderHookOptions<ObservableProps>;
|
|
19
|
+
export declare const createObservableRenderHookOptionsWithInitialState: (initializeState?: (snapshot: MutableSnapshot) => void, ...observers: React.ReactElement[]) => ObservableRenderHookOptions;
|
|
20
|
+
export declare const createObservableRenderHookOptions: (...observers: React.ReactElement[]) => ObservableRenderHookOptions;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { BoundingBox, Vector3 } from '@vertexvis/geometry';
|
|
2
|
+
import type { SceneItemOperationsBuilder } from '@vertexvis/viewer/dist/types/lib/scenes';
|
|
3
|
+
import type { RootQuery } from '@vertexvis/viewer/dist/types/lib/scenes/queries';
|
|
4
|
+
import { DefinedRefObject } from './react';
|
|
5
|
+
export declare const boundingBox: BoundingBox.BoundingBox;
|
|
6
|
+
export interface ViewerRefMock {
|
|
7
|
+
ref: DefinedRefObject<HTMLVertexViewerElement>;
|
|
8
|
+
items: jest.Mock;
|
|
9
|
+
raycaster: jest.Mock;
|
|
10
|
+
hitItems: jest.Mock;
|
|
11
|
+
crossSectioning: CrossSectioningMockObject;
|
|
12
|
+
applySceneViewState: jest.Mock;
|
|
13
|
+
applyPartialSceneViewState: jest.Mock;
|
|
14
|
+
camera: CameraMockObject;
|
|
15
|
+
viewport: ViewportMockObject;
|
|
16
|
+
execute: jest.Mock;
|
|
17
|
+
where: jest.Mock;
|
|
18
|
+
reset: jest.Mock;
|
|
19
|
+
query: RootQuery;
|
|
20
|
+
op: Pick<SceneItemOperationsBuilder, 'show' | 'hide' | 'select' | 'deselect' | 'materialOverride' | 'clearMaterialOverrides' | 'transform' | 'clearTransforms' | 'setPhantom' | 'clearPhantom'>;
|
|
21
|
+
setPrimaryInteractionType: jest.Mock;
|
|
22
|
+
getPrimaryInteractionType: jest.Mock;
|
|
23
|
+
}
|
|
24
|
+
export interface ViewportMockObject {
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
transformWorldToViewport: jest.Mock;
|
|
28
|
+
}
|
|
29
|
+
export interface CameraMockObject {
|
|
30
|
+
root: jest.Mock;
|
|
31
|
+
viewAll: jest.Mock;
|
|
32
|
+
fitToBoundingBox: jest.Mock;
|
|
33
|
+
distanceToBoundingBoxCenter: jest.Mock;
|
|
34
|
+
flyTo: jest.Mock;
|
|
35
|
+
moveBy: jest.Mock;
|
|
36
|
+
render: jest.Mock;
|
|
37
|
+
rotateAroundAxis: jest.Mock;
|
|
38
|
+
rotateAroundAxisAtPoint: jest.Mock;
|
|
39
|
+
alignTo: jest.Mock;
|
|
40
|
+
update: jest.Mock;
|
|
41
|
+
viewVector: Vector3.Vector3;
|
|
42
|
+
position: Vector3.Vector3;
|
|
43
|
+
up: Vector3.Vector3;
|
|
44
|
+
lookAt: Vector3.Vector3;
|
|
45
|
+
fovY: number;
|
|
46
|
+
aspectRatio: number;
|
|
47
|
+
near: number;
|
|
48
|
+
far: number;
|
|
49
|
+
}
|
|
50
|
+
export interface CrossSectioningMockObject {
|
|
51
|
+
root: jest.Mock;
|
|
52
|
+
update: jest.Mock;
|
|
53
|
+
current: jest.Mock;
|
|
54
|
+
}
|
|
55
|
+
export interface MockHit {
|
|
56
|
+
itemId: {
|
|
57
|
+
hex: string;
|
|
58
|
+
};
|
|
59
|
+
hitNormal?: Vector3.Vector3;
|
|
60
|
+
hitPosition?: Vector3.Vector3;
|
|
61
|
+
hitPoint?: Vector3.Vector3;
|
|
62
|
+
ancestors?: Array<{
|
|
63
|
+
itemId: {
|
|
64
|
+
hex: string;
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
export interface ViewerRefMockInitializationProps {
|
|
69
|
+
hits?: MockHit[];
|
|
70
|
+
}
|
|
71
|
+
export declare const notWithSelected: jest.Mock<any, any>;
|
|
72
|
+
export declare function createViewerRefMock(hits?: MockHit[], frame?: unknown): ViewerRefMock;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InteractionHandler } from '@vertexvis/viewer';
|
|
2
|
+
import type { InteractionApi } from '@vertexvis/viewer/dist/types/lib/interactions/interactionApi';
|
|
3
|
+
export declare class CrossSectionInteractionHandler implements InteractionHandler {
|
|
4
|
+
private api?;
|
|
5
|
+
private interactionStarted;
|
|
6
|
+
initialize(element: HTMLElement, api: InteractionApi): void;
|
|
7
|
+
dispose(): void;
|
|
8
|
+
beginInteraction(): Promise<void>;
|
|
9
|
+
endInteraction(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Hit } from '@state/hits';
|
|
2
|
+
import { BoundingBox, Vector3 } from '@vertexvis/geometry';
|
|
3
|
+
import type { Camera } from '@vertexvis/viewer/dist/types/lib/scenes';
|
|
4
|
+
export interface OffsetRange {
|
|
5
|
+
min: number;
|
|
6
|
+
max: number;
|
|
7
|
+
}
|
|
8
|
+
export interface CrossSectionPlane {
|
|
9
|
+
normal: Vector3.Vector3;
|
|
10
|
+
offset: number;
|
|
11
|
+
}
|
|
12
|
+
export type CrossSectionPlaneAxes = CustomCrossSectionPlaneAxes | DefaultCrossSectionPlaneAxes;
|
|
13
|
+
interface CustomCrossSectionPlaneAxes {
|
|
14
|
+
x: Vector3.Vector3;
|
|
15
|
+
y?: Vector3.Vector3;
|
|
16
|
+
z?: Vector3.Vector3;
|
|
17
|
+
}
|
|
18
|
+
interface DefaultCrossSectionPlaneAxes {
|
|
19
|
+
x: Vector3.Vector3;
|
|
20
|
+
y: Vector3.Vector3;
|
|
21
|
+
z: Vector3.Vector3;
|
|
22
|
+
}
|
|
23
|
+
export type Axis = 'x' | 'y' | 'z';
|
|
24
|
+
export type CrossSectionAlignment = 'global' | 'surface' | 'part';
|
|
25
|
+
export declare const create: (normal: Vector3.Vector3, offset?: number) => CrossSectionPlane;
|
|
26
|
+
export declare const isEqual: (plane: CrossSectionPlane, other: CrossSectionPlane) => boolean;
|
|
27
|
+
export declare const forAxis: (axis: Axis, offset: number) => CrossSectionPlane;
|
|
28
|
+
export declare const x: (offset: number) => CrossSectionPlane;
|
|
29
|
+
export declare const y: (offset: number) => CrossSectionPlane;
|
|
30
|
+
export declare const z: (offset: number) => CrossSectionPlane;
|
|
31
|
+
export declare const getAxis: (axis: Axis, axes: CrossSectionPlaneAxes) => Vector3.Vector3;
|
|
32
|
+
export declare const defaultAxes: DefaultCrossSectionPlaneAxes;
|
|
33
|
+
export declare const xAxis: (axes: CrossSectionPlaneAxes) => Vector3.Vector3;
|
|
34
|
+
export declare const yAxis: (axes: CrossSectionPlaneAxes) => Vector3.Vector3;
|
|
35
|
+
export declare const zAxis: (axes: CrossSectionPlaneAxes) => Vector3.Vector3;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the active axis of a plane based on the normal values
|
|
38
|
+
*/
|
|
39
|
+
export declare const axis: (plane: CrossSectionPlane, xAxis: Vector3.Vector3, yAxis: Vector3.Vector3, zAxis: Vector3.Vector3) => Axis | undefined;
|
|
40
|
+
export declare const isNegativeNormal: (plane: CrossSectionPlane) => boolean | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Returns an updated section plane where the normal of the section plane is
|
|
43
|
+
* faced towards the given vector. The effect is the internal of the cross
|
|
44
|
+
* section is visible from the given vector.
|
|
45
|
+
*/
|
|
46
|
+
export declare const towardsVector: (vector: Vector3.Vector3, plane: CrossSectionPlane) => CrossSectionPlane;
|
|
47
|
+
/**
|
|
48
|
+
* Returns an updated section plane where the normal of the section plane is
|
|
49
|
+
* faced towards given camera's view vector. The effect is the user sees the
|
|
50
|
+
* internal of the cross section.
|
|
51
|
+
*/
|
|
52
|
+
export declare const towardsCamera: (camera: Camera, plane: CrossSectionPlane) => CrossSectionPlane;
|
|
53
|
+
/**
|
|
54
|
+
* Reverses the direction of the section plane's normal to point in the opposite
|
|
55
|
+
* direction.
|
|
56
|
+
*/
|
|
57
|
+
export declare const invert: (plane: CrossSectionPlane) => CrossSectionPlane;
|
|
58
|
+
export declare const fromHit: (hit: Hit, camera: Camera) => CrossSectionPlane;
|
|
59
|
+
export declare const toAxis: (axis: Axis, axes: CrossSectionPlaneAxes, camera: Camera, boundingBox?: BoundingBox.BoundingBox, position?: Vector3.Vector3) => CrossSectionPlane;
|
|
60
|
+
export declare function axesFromPlane(plane: CrossSectionPlane): CrossSectionPlaneAxes;
|
|
61
|
+
export {};
|