@wandelbots/wandelbots-js-react-components 6.3.0 → 6.4.0-pr.chore-playground-tool-steps.664.4537d63
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/README.md +323 -120
- package/dist/3d.cjs +1 -1
- package/dist/3d.d.ts +5 -3
- package/dist/3d.js +24 -23
- package/dist/CurrentPoseBar/index.cjs +1 -0
- package/dist/CurrentPoseBar/index.d.ts +2 -0
- package/dist/CurrentPoseBar/index.js +5 -0
- package/dist/JoggingButtons/index.cjs +1 -0
- package/dist/JoggingButtons/index.d.ts +3 -0
- package/dist/JoggingButtons/index.js +5 -0
- package/dist/JoggingGizmo/index.cjs +1 -0
- package/dist/JoggingGizmo/index.d.ts +4 -0
- package/dist/JoggingGizmo/index.js +7 -0
- package/dist/JoggingJointSlider/index.cjs +1 -0
- package/dist/JoggingJointSlider/index.d.ts +2 -0
- package/dist/JoggingJointSlider/index.js +5 -0
- package/dist/RobotControlPanel/index.cjs +1 -0
- package/dist/RobotControlPanel/index.d.ts +2 -0
- package/dist/RobotControlPanel/index.js +5 -0
- package/dist/RobotHeader/index.cjs +1 -0
- package/dist/RobotHeader/index.d.ts +4 -0
- package/dist/RobotHeader/index.js +5 -0
- package/dist/SafetyBar/index.cjs +1 -1
- package/dist/SafetyBar/index.js +1 -1
- package/dist/chunks/CurrentPoseBar-CyHUWmjM.cjs +1 -0
- package/dist/chunks/CurrentPoseBar-zTZi68tY.js +505 -0
- package/dist/chunks/JoggingButtons-CXaozFVz.js +108 -0
- package/dist/chunks/JoggingButtons-CbL-5LMK.cjs +1 -0
- package/dist/chunks/JoggingGizmo-DGbFLWgT.cjs +1 -0
- package/dist/chunks/JoggingGizmo-SuS9MmL7.js +810 -0
- package/dist/chunks/JoggingGizmoOrientation-dzned4f4.cjs +1 -0
- package/dist/chunks/JoggingGizmoOrientation-x_crT_64.js +14 -0
- package/dist/chunks/JoggingJointSlider-CZ-k6XCa.js +406 -0
- package/dist/chunks/JoggingJointSlider-R3_A9Ppj.cjs +1 -0
- package/dist/chunks/Robot-D0ZqUCn3.cjs +1 -0
- package/dist/chunks/Robot-UoykZeYH.js +1272 -0
- package/dist/chunks/RobotControlPanel-BnMfmO41.js +822 -0
- package/dist/chunks/RobotControlPanel-BuDGcxPR.cjs +1 -0
- package/dist/chunks/RobotHeader-BZci9ahT.js +244 -0
- package/dist/chunks/RobotHeader-CqK0700U.cjs +1 -0
- package/dist/chunks/SafetyBar-Bbg-o8h9.cjs +1 -0
- package/dist/chunks/{SafetyBar-Cy9DiXp9.js → SafetyBar-Cuak4ffd.js} +11 -10
- package/dist/chunks/SmallSelect-BdD9uLKK.js +52 -0
- package/dist/chunks/SmallSelect-Dcsd7_6_.cjs +1 -0
- package/dist/chunks/TrajectoryExecutionStore-DPqfDcfn.js +3398 -0
- package/dist/chunks/TrajectoryExecutionStore-DV6mLEx9.cjs +3 -0
- package/dist/chunks/converters-C8I_A_tA.cjs +1 -0
- package/dist/chunks/converters-DpNB_WNQ.js +39 -0
- package/dist/chunks/externalizeComponent-BdxGBLIv.cjs +2 -0
- package/dist/chunks/externalizeComponent-_w2d1_pz.js +283 -0
- package/dist/chunks/holdSafety-BtoZ5We3.cjs +1 -0
- package/dist/chunks/holdSafety-Di1GZAWg.js +37 -0
- package/dist/chunks/joggingColors-CuT5u0H8.js +135 -0
- package/dist/chunks/joggingColors-ZDc_2UCp.cjs +1 -0
- package/dist/chunks/useEveryFrame-G_-ma1nC.js +142 -0
- package/dist/chunks/useEveryFrame-dmPPTKtT.cjs +1 -0
- package/dist/chunks/useSmoothedMotionState-COMJRcOt.js +214 -0
- package/dist/chunks/useSmoothedMotionState-Con0E5Bx.cjs +1 -0
- package/dist/components/AppHeader.d.ts +1 -1
- package/dist/components/currentPoseBar/CurrentPoseBar.d.ts +48 -0
- package/dist/components/currentPoseBar/OrientationFormatPopover.d.ts +19 -0
- package/dist/components/currentPoseBar/StreamStatus.d.ts +10 -0
- package/dist/components/currentPoseBar/orientation.d.ts +34 -0
- package/dist/components/currentPoseBar/poseValues.d.ts +15 -0
- package/dist/components/jogging/JoggingButtons.d.ts +16 -0
- package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +1 -1
- package/dist/components/jogging/JoggingJointTab.d.ts +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts +6 -3
- package/dist/components/jogging/JoggingStore.d.ts +96 -19
- package/dist/components/jogging/gizmo/JoggingGizmo.d.ts +43 -0
- package/dist/components/jogging/gizmo/JoggingGizmoOrientation.d.ts +26 -0
- package/dist/components/jogging/gizmo/RotationHandles.d.ts +7 -0
- package/dist/components/jogging/gizmo/RotationScene.d.ts +6 -0
- package/dist/components/jogging/gizmo/TranslationHandles.d.ts +6 -0
- package/dist/components/jogging/gizmo/TranslationScene.d.ts +6 -0
- package/dist/components/jogging/gizmo/arcGrabAreas.d.ts +58 -0
- package/dist/components/jogging/gizmo/arcs.d.ts +54 -0
- package/dist/components/jogging/gizmo/arrows.d.ts +63 -0
- package/dist/components/jogging/gizmo/gizmoShared.d.ts +125 -0
- package/dist/components/jogging/gizmo/gizmoView.d.ts +42 -0
- package/dist/components/jogging/gizmo/useGizmoTurn.d.ts +11 -0
- package/dist/components/jogging/holdSafety.d.ts +44 -0
- package/dist/components/jogging/jogError.d.ts +9 -0
- package/dist/components/jogging/jogHandle.d.ts +23 -0
- package/dist/components/jogging/joggingColors.d.ts +24 -0
- package/dist/components/jogging/joggingVelocity.d.ts +21 -0
- package/dist/components/jogging/joint/JoggingJointSlider.d.ts +52 -0
- package/dist/components/jogging/joint/JointSliderTrack.d.ts +27 -0
- package/dist/components/jogging/joint/jointJog.d.ts +55 -0
- package/dist/components/jogging/joint/useJointJogHold.d.ts +48 -0
- package/dist/components/jogging/useHold.d.ts +38 -0
- package/dist/components/jogging/useJogControls.d.ts +45 -0
- package/dist/components/robotControl/CartesianJogTab.d.ts +21 -0
- package/dist/components/robotControl/HoldToMoveButton.d.ts +25 -0
- package/dist/components/robotControl/JogArea.d.ts +22 -0
- package/dist/components/robotControl/JogModeToggle.d.ts +8 -0
- package/dist/components/robotControl/JointJogTab.d.ts +11 -0
- package/dist/components/robotControl/MoveToTab.d.ts +18 -0
- package/dist/components/robotControl/PanelSelect.d.ts +13 -0
- package/dist/components/robotControl/PoseField.d.ts +21 -0
- package/dist/components/robotControl/RobotControlPanel.d.ts +212 -0
- package/dist/components/robotControl/Section.d.ts +5 -0
- package/dist/components/robotControl/SmallSelect.d.ts +15 -0
- package/dist/components/robotControl/VelocityRow.d.ts +14 -0
- package/dist/components/robotControl/atPose.d.ts +8 -0
- package/dist/components/robotControl/poseText.d.ts +15 -0
- package/dist/components/robotControl/units.d.ts +16 -0
- package/dist/components/robotControl/useCopyText.d.ts +12 -0
- package/dist/components/robotControl/useEveryFrame.d.ts +6 -0
- package/dist/components/robotHeader/ActivationSwitch.d.ts +7 -0
- package/dist/components/robotHeader/AppNavigation.d.ts +15 -0
- package/dist/components/robotHeader/RobotHeader.d.ts +42 -0
- package/dist/components/robots/GenericRobot.d.ts +2 -1
- package/dist/components/robots/LinearAxis.d.ts +1 -1
- package/dist/components/robots/LinearAxisAnimator.d.ts +11 -2
- package/dist/components/robots/Robot.d.ts +1 -1
- package/dist/components/robots/robotModelLogic.d.ts +11 -9
- package/dist/components/utils/hooks.d.ts +1 -6
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +13 -18
- package/dist/core.js +37 -51
- package/dist/index.cjs +1 -1
- package/dist/index.js +58 -71
- package/dist/lib/ConnectedMotionGroup.d.ts +5 -7
- package/dist/lib/JoggerConnection.d.ts +137 -27
- package/dist/lib/MotionStreamConnection.d.ts +15 -6
- package/dist/lib/Pose3.d.ts +22 -0
- package/dist/lib/PoseTransformer.d.ts +25 -0
- package/dist/lib/TrajectoryExecutionStore.d.ts +129 -0
- package/dist/lib/connectionLogger.d.ts +9 -0
- package/dist/lib/incrementalCartesianMotion.d.ts +40 -0
- package/dist/lib/motionStateUpdate.d.ts +27 -0
- package/dist/lib/novaConnection.d.ts +23 -0
- package/dist/lib/planErrorTranslation.d.ts +8 -0
- package/dist/lib/rotation.d.ts +12 -0
- package/package.json +31 -66
- package/dist/Setup.d.ts +0 -11
- package/dist/chunks/MotionGroupVisualizer-DshWR1wY.js +0 -1653
- package/dist/chunks/MotionGroupVisualizer-eD7yFEcF.cjs +0 -1
- package/dist/chunks/SafetyBar-DPrv_OQA.cjs +0 -1
- package/dist/chunks/externalizeComponent-EDymnaGR.js +0 -268
- package/dist/chunks/externalizeComponent-OO4jcrz5.cjs +0 -2
- package/dist/chunks/theming-DfSy4-Ic.cjs +0 -4
- package/dist/chunks/theming-mF9Rt8SS.js +0 -5542
- package/dist/chunks/useSmoothedMotionState-DyDgSVYX.js +0 -478
- package/dist/chunks/useSmoothedMotionState-VYxEIyfr.cjs +0 -1
- package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +0 -11
- package/dist/components/AdornedTextField.d.ts +0 -7
- package/dist/components/CopyableText.d.ts +0 -6
- package/dist/components/CycleTimer/CycleTimer.d.ts +0 -3
- package/dist/components/CycleTimer/DefaultVariant.d.ts +0 -9
- package/dist/components/CycleTimer/SmallVariant.d.ts +0 -10
- package/dist/components/CycleTimer/index.d.ts +0 -27
- package/dist/components/CycleTimer/types.d.ts +0 -49
- package/dist/components/CycleTimer/useAnimations.d.ts +0 -14
- package/dist/components/CycleTimer/useTimerLogic.d.ts +0 -24
- package/dist/components/CycleTimer/utils.d.ts +0 -21
- package/dist/components/CycleTimer.d.ts +0 -3
- package/dist/components/DataGrid.d.ts +0 -66
- package/dist/components/LogPanel.d.ts +0 -38
- package/dist/components/LogStore.d.ts +0 -12
- package/dist/components/LogViewer.d.ts +0 -46
- package/dist/components/ProgramControl.d.ts +0 -55
- package/dist/components/ProgramStateIndicator.d.ts +0 -26
- package/dist/components/RobotCard.d.ts +0 -98
- package/dist/components/RobotListItem.d.ts +0 -34
- package/dist/components/RobotSetupReadinessIndicator.d.ts +0 -37
- package/dist/components/SelectableFab.d.ts +0 -7
- package/dist/components/TabBar.d.ts +0 -45
- package/dist/components/ThemeSelect.d.ts +0 -6
- package/dist/components/Timer/Timer.d.ts +0 -3
- package/dist/components/Timer/TimerDefaultVariant.d.ts +0 -9
- package/dist/components/Timer/TimerSmallVariant.d.ts +0 -10
- package/dist/components/Timer/index.d.ts +0 -19
- package/dist/components/Timer/types.d.ts +0 -35
- package/dist/components/Timer/useTimerAnimations.d.ts +0 -10
- package/dist/components/Timer/useTimerLogic.d.ts +0 -19
- package/dist/components/Timer/utils.d.ts +0 -17
- package/dist/components/Timer.d.ts +0 -3
- package/dist/components/TransparentOverlay.d.ts +0 -4
- package/dist/components/jogging/JoggingFreedriveTab.d.ts +0 -1
- package/dist/components/jogging/PoseCartesianValues.d.ts +0 -9
- package/dist/components/jogging/PoseJointValues.d.ts +0 -8
- package/dist/components/robots/AxisConfig.d.ts +0 -2
- package/dist/components/robots/manufacturerHomePositions.d.ts +0 -20
- package/dist/icons/DropdownArrowIcon.d.ts +0 -2
- package/dist/icons/index.d.ts +0 -12
- package/dist/lib/novaCompat.d.ts +0 -16
- package/dist/themes/createDarkTheme.d.ts +0 -7
- package/dist/themes/themeTypes.d.ts +0 -40
- package/dist/themes/theming.d.ts +0 -24
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Stack from "@mui/material/Stack";
|
|
2
2
|
import React, { type ReactNode } from "react";
|
|
3
|
-
import type { AxisControlComponentColors } from "
|
|
3
|
+
import type { AxisControlComponentColors } from "./joggingColors";
|
|
4
4
|
import type { JoggingDirection } from "./JoggingStore";
|
|
5
5
|
type JoggingCartesianAxisControlProps = {
|
|
6
6
|
colors?: AxisControlComponentColors;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { SxProps } from "@mui/material/styles";
|
|
2
|
-
import type {
|
|
2
|
+
import type { NovaConnection } from "../../lib/novaConnection";
|
|
3
3
|
import { JoggingStore } from "./JoggingStore";
|
|
4
4
|
export type JoggingPanelTabId = "cartesian" | "joint";
|
|
5
5
|
export type JoggingPanelProps = {
|
|
6
|
-
/**
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The base url of a deployed Nova instance, or a Nova client of the app.
|
|
8
|
+
* The panel reads only the url and the access token of the client.
|
|
9
|
+
*/
|
|
10
|
+
nova: NovaConnection;
|
|
8
11
|
/** Id of the motion group to move e.g. 0@ur5e */
|
|
9
12
|
motionGroupId: string;
|
|
10
13
|
/** Cell id on the Nova instance. Defaults to "cell". */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JointTypeEnum, type CoordinateSystem, type MotionGroupDescription, type RobotTcp } from "@wandelbots/nova-js/v2";
|
|
1
|
+
import { JointTypeEnum, type CoordinateSystem, type KinematicModel, type MotionGroupDescription, type Pose, type RobotTcp } from "@wandelbots/nova-js/v2";
|
|
2
2
|
import { type IReactionDisposer } from "mobx";
|
|
3
3
|
import type { JoggerConnection } from "../../lib/JoggerConnection";
|
|
4
4
|
declare const discreteIncrementOptions: {
|
|
@@ -25,6 +25,10 @@ export type IncrementJogInProgress = {
|
|
|
25
25
|
axis: JoggingAxis;
|
|
26
26
|
};
|
|
27
27
|
type TabType = "cartesian" | "joint" | "debug";
|
|
28
|
+
type JoggingTab = {
|
|
29
|
+
id: TabType;
|
|
30
|
+
label: string;
|
|
31
|
+
};
|
|
28
32
|
export type CartesianMotionType = "translate" | "rotate";
|
|
29
33
|
export declare class JoggingStore {
|
|
30
34
|
readonly jogger: JoggerConnection;
|
|
@@ -38,9 +42,17 @@ export declare class JoggingStore {
|
|
|
38
42
|
/** Block jogging UI interactions when connection is taken by another jogger */
|
|
39
43
|
blocked: boolean;
|
|
40
44
|
/**
|
|
41
|
-
* Id of selected coordinate system from among those defined on the API side
|
|
45
|
+
* Id of selected coordinate system from among those defined on the API side.
|
|
46
|
+
* The cartesian values are shown in it ("Values relative to"), see
|
|
47
|
+
* {@link JoggingStore.tcpPoseInSelectedCoordSystem}.
|
|
42
48
|
*/
|
|
43
49
|
selectedCoordSystemId: string;
|
|
50
|
+
/**
|
|
51
|
+
* Id of the coordinate system whose axes the jog buttons move along unless
|
|
52
|
+
* in tool orientation ("Move relative to"). Starts at the first coordinate
|
|
53
|
+
* system, like {@link JoggingStore.selectedCoordSystemId}.
|
|
54
|
+
*/
|
|
55
|
+
jogCoordSystemId: string;
|
|
44
56
|
/** Id of selected tool center point from among the options available on the robot */
|
|
45
57
|
selectedTcpId: string;
|
|
46
58
|
/** Whether a TCP change request is currently in flight */
|
|
@@ -67,13 +79,32 @@ export declare class JoggingStore {
|
|
|
67
79
|
* with the information about the motion
|
|
68
80
|
*/
|
|
69
81
|
incrementJogInProgress: IncrementJogInProgress | null;
|
|
70
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Human-readable message from the most recent jogging/trajectory error
|
|
84
|
+
* (e.g. a collision that stopped an incremental jog). The state stream
|
|
85
|
+
* itself resets to a normal state (e.g. "Ready") as soon as the motion
|
|
86
|
+
* stops, so this is latched here to stay visible until the next jog
|
|
87
|
+
* attempt is made.
|
|
88
|
+
*/
|
|
89
|
+
lastJogError: string | null;
|
|
90
|
+
/**
|
|
91
|
+
* Awaited by {@link JoggingStore.activate} before the jogger claims the
|
|
92
|
+
* robot for a jog, e.g. to end another motion that holds the controller's
|
|
93
|
+
* execution session. When it rejects, the jog does not start.
|
|
94
|
+
*/
|
|
95
|
+
onBeforeActivate: (() => void | Promise<void>) | null;
|
|
96
|
+
/**
|
|
97
|
+
* How fast the robot goes when doing cartesian translate and prismatic joint
|
|
98
|
+
* jogging in mm/s. Starts at 10 % of the motion group's T1 max (the lowest
|
|
99
|
+
* manual TCP velocity limit it reports, at most 250 mm/s), so 25 mm/s for
|
|
100
|
+
* most robots, and is overwritten by the slider.
|
|
101
|
+
*/
|
|
71
102
|
translationVelocityMmPerSec: number;
|
|
72
|
-
/** How fast the robot goes when doing cartesian or joint rotation jogging in °/s */
|
|
103
|
+
/** How fast the robot goes when doing cartesian or joint rotation jogging in °/s. Starts at 5 °/s. */
|
|
73
104
|
rotationVelocityDegPerSec: number;
|
|
74
|
-
/** Minimum translation velocity user can choose on the velocity slider in
|
|
105
|
+
/** Minimum translation velocity user can choose on the velocity slider in mm/s */
|
|
75
106
|
minTranslationVelocityMmPerSec: number;
|
|
76
|
-
/** Maximum translation velocity user can choose on the velocity slider in
|
|
107
|
+
/** Maximum translation velocity user can choose on the velocity slider in mm/s */
|
|
77
108
|
maxTranslationVelocityMmPerSec: number;
|
|
78
109
|
/** Minimum rotation velocity user can choose on the velocity slider in °/s */
|
|
79
110
|
minRotationVelocityDegPerSec: number;
|
|
@@ -110,26 +141,47 @@ export declare class JoggingStore {
|
|
|
110
141
|
* from the backend
|
|
111
142
|
*/
|
|
112
143
|
static loadFor(jogger: JoggerConnection): Promise<JoggingStore>;
|
|
144
|
+
/**
|
|
145
|
+
* Make a jogging store from data that was loaded before: the coordinate
|
|
146
|
+
* systems of the controller, the description and the kinematic model of the
|
|
147
|
+
* motion group. An app that loads them once for several stores uses this
|
|
148
|
+
* instead of {@link JoggingStore.loadFor}.
|
|
149
|
+
*/
|
|
150
|
+
static create(jogger: JoggerConnection, data: {
|
|
151
|
+
coordinateSystems: CoordinateSystem[];
|
|
152
|
+
description: MotionGroupDescription;
|
|
153
|
+
kinematicModel: KinematicModel;
|
|
154
|
+
}): JoggingStore;
|
|
113
155
|
constructor(jogger: JoggerConnection, coordSystems: CoordinateSystem[], motionGroupDescription: MotionGroupDescription, tcps: RobotTcp[], inverseSolverValue: string | null | undefined);
|
|
114
156
|
dispose(): void;
|
|
115
157
|
get coordSystemCountByName(): import("lodash").Dictionary<number>;
|
|
116
158
|
deactivate(): Promise<void>;
|
|
117
|
-
/**
|
|
159
|
+
/**
|
|
160
|
+
* Activate the jogger with current settings. Resolves when the jogging
|
|
161
|
+
* websocket is initialized, or when the jogging was stopped before that
|
|
162
|
+
* (`deactivate`).
|
|
163
|
+
*/
|
|
118
164
|
activate(): Promise<JoggerConnection>;
|
|
119
165
|
loadFromLocalStorage(): void;
|
|
120
166
|
saveToLocalStorage(): void;
|
|
121
167
|
get isLocked(): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Translation key for a friendlier version of
|
|
170
|
+
* {@link JoggingStore.lastJogError}, if the raw backend message is
|
|
171
|
+
* recognized. `null` when there's no latched error or the message isn't one
|
|
172
|
+
* we have a friendlier version for (in which case the raw message should be
|
|
173
|
+
* shown as-is).
|
|
174
|
+
*/
|
|
175
|
+
get lastJogErrorTranslationKey(): string | null;
|
|
122
176
|
get localStorageSave(): {
|
|
123
177
|
selectedTabId: TabType;
|
|
124
178
|
selectedCoordSystemId: string;
|
|
179
|
+
jogCoordSystemId: string;
|
|
125
180
|
selectedOrientation: string;
|
|
126
181
|
selectedIncrementId: string;
|
|
127
182
|
selectedCartesianMotionType: CartesianMotionType;
|
|
128
183
|
};
|
|
129
|
-
get tabs():
|
|
130
|
-
id: TabType;
|
|
131
|
-
label: string;
|
|
132
|
-
}[];
|
|
184
|
+
get tabs(): [JoggingTab, ...JoggingTab[]];
|
|
133
185
|
get incrementOptions(): readonly [{
|
|
134
186
|
readonly id: "continuous";
|
|
135
187
|
}, ...{
|
|
@@ -149,14 +201,8 @@ export declare class JoggingStore {
|
|
|
149
201
|
} | {
|
|
150
202
|
readonly id: "continuous";
|
|
151
203
|
}>;
|
|
152
|
-
get tabsById(): import("lodash").Dictionary<
|
|
153
|
-
|
|
154
|
-
label: string;
|
|
155
|
-
}>;
|
|
156
|
-
get currentTab(): {
|
|
157
|
-
id: TabType;
|
|
158
|
-
label: string;
|
|
159
|
-
};
|
|
204
|
+
get tabsById(): import("lodash").Dictionary<JoggingTab>;
|
|
205
|
+
get currentTab(): JoggingTab;
|
|
160
206
|
get tabIndex(): number;
|
|
161
207
|
get coordSystemsById(): import("lodash").Dictionary<CoordinateSystem>;
|
|
162
208
|
/**
|
|
@@ -165,7 +211,27 @@ export declare class JoggingStore {
|
|
|
165
211
|
* selected coordinate system.
|
|
166
212
|
*/
|
|
167
213
|
get activeCoordSystemId(): string;
|
|
214
|
+
/** The coordinate system to jog along, resolved relative to world */
|
|
215
|
+
get jogCoordSystem(): CoordinateSystem;
|
|
216
|
+
/**
|
|
217
|
+
* The streamed TCP pose (its readout, see
|
|
218
|
+
* {@link MotionStreamConnection.readoutState}) expressed in the selected
|
|
219
|
+
* coordinate system, for values that show what a pose field in that
|
|
220
|
+
* coordinate system shows.
|
|
221
|
+
*/
|
|
222
|
+
get tcpPoseInSelectedCoordSystem(): Pose | undefined;
|
|
168
223
|
get tcpsById(): import("lodash").Dictionary<RobotTcp>;
|
|
224
|
+
/**
|
|
225
|
+
* The streamed TCP pose (its readout) as the pose of a TCP, relative to a
|
|
226
|
+
* coordinate system: for a pose display with a TCP and frame of its own,
|
|
227
|
+
* like CurrentPoseBar. Undefined without a pose, or for an unknown TCP or
|
|
228
|
+
* coordinate system.
|
|
229
|
+
*/
|
|
230
|
+
tcpPoseIn(tcpId: string, coordinateSystemId: string): Pose | undefined;
|
|
231
|
+
/**
|
|
232
|
+
* The step of the selected increment, or undefined for continuous jogging.
|
|
233
|
+
* In tool orientation, a step moves along the tool's axes.
|
|
234
|
+
*/
|
|
169
235
|
get activeDiscreteIncrement(): {
|
|
170
236
|
id: string;
|
|
171
237
|
mm: number;
|
|
@@ -198,8 +264,19 @@ export declare class JoggingStore {
|
|
|
198
264
|
requestTcpChange(tcpId: string): Promise<void>;
|
|
199
265
|
private waitForTcpConfirmation;
|
|
200
266
|
setSelectedOrientation(orientation: OrientationId): void;
|
|
267
|
+
/** "Move relative to" the selected TCP: jog along its own axes */
|
|
268
|
+
setMoveRelativeToSelectedTcp(): void;
|
|
269
|
+
/** "Move relative to" a coordinate system: jog along its axes */
|
|
270
|
+
setMoveRelativeToCoordSystem(coordSystemId: string): void;
|
|
201
271
|
setSelectedIncrementId(id: IncrementOptionId): void;
|
|
202
272
|
setCurrentIncrementJog(incrementJog: IncrementJogInProgress | null): void;
|
|
273
|
+
setLastJogError(message: string | null): void;
|
|
274
|
+
/**
|
|
275
|
+
* Set the selected velocity in mm/s or °/s, from the slider or a velocity
|
|
276
|
+
* text field. Values outside the slider range (and values that are not a
|
|
277
|
+
* finite number) are ignored; a text field reports them to the user
|
|
278
|
+
* instead of applying them.
|
|
279
|
+
*/
|
|
203
280
|
setVelocityFromSlider(velocity: number, useDegree: boolean): void;
|
|
204
281
|
setSelectedCartesianMotionType(type: CartesianMotionType): void;
|
|
205
282
|
lock(id: string): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { Quaternion } from "three";
|
|
3
|
+
import { type JogControlsProps } from "../useJogControls";
|
|
4
|
+
/**
|
|
5
|
+
* Props of {@link JoggingGizmo}
|
|
6
|
+
*/
|
|
7
|
+
export type JoggingGizmoProps = JogControlsProps & {
|
|
8
|
+
/**
|
|
9
|
+
* NOVA's axes as the camera of the app's 3D view sees them, read every
|
|
10
|
+
* animation frame. Fill it with a {@link JoggingGizmoOrientation} inside
|
|
11
|
+
* the app's 3D scene. Start it empty (`useRef<Quaternion | null>(null)`):
|
|
12
|
+
* until a first orientation arrives, the gizmo stays disabled rather than
|
|
13
|
+
* point its arrows a way the 3D view does not.
|
|
14
|
+
*/
|
|
15
|
+
orientation: RefObject<Quaternion | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Orientation of the frame the handles jog along, in NOVA's coordinates
|
|
18
|
+
* (those of the group that {@link JoggingGizmoOrientation} sits in).
|
|
19
|
+
* Defaults to NOVA's world frame.
|
|
20
|
+
*
|
|
21
|
+
* A frame that turns, such as the tool's, can be a function: the gizmo
|
|
22
|
+
* calls it every animation frame, so it turns with the tool without
|
|
23
|
+
* re-rendering React.
|
|
24
|
+
*/
|
|
25
|
+
frameQuaternion?: Quaternion | (() => Quaternion);
|
|
26
|
+
/** Side of the square the gizmo takes, in px. Defaults to 200. */
|
|
27
|
+
size?: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Jogging by a gizmo drawn in the jog frame's axes as the camera sees them:
|
|
31
|
+
* the handle that points right on screen moves the robot right on screen, and
|
|
32
|
+
* orbiting the scene turns the gizmo with it.
|
|
33
|
+
*
|
|
34
|
+
* `motion` picks the handles. To translate, each axis is an arrow with a
|
|
35
|
+
* handle per direction, grabbed anywhere along its half of the axis. To rotate, each axis has a circle
|
|
36
|
+
* about it with an arc per direction, whose arrowhead shows the way it
|
|
37
|
+
* turns, grabbed anywhere along the arc. A handle is held to jog.
|
|
38
|
+
*
|
|
39
|
+
* The gizmo is drawn in 3D; the handles are laid over it as buttons, so it
|
|
40
|
+
* works from the keyboard and tests can find a handle by its name. It draws
|
|
41
|
+
* only when it turns or its state changes, not every frame.
|
|
42
|
+
*/
|
|
43
|
+
export declare const JoggingGizmo: ({ orientation, frameQuaternion, motion, onJogStart, onJogStop, activeHandle, disabled: disabledByApp, size, }: JoggingGizmoProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import { Quaternion } from "three";
|
|
3
|
+
/**
|
|
4
|
+
* Props of {@link JoggingGizmoOrientation}
|
|
5
|
+
*/
|
|
6
|
+
export type JoggingGizmoOrientationProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Receives NOVA's axes as the camera sees them; pass the same ref to the
|
|
9
|
+
* gizmo as its `orientation`. It may start empty (`null`).
|
|
10
|
+
*/
|
|
11
|
+
target: RefObject<Quaternion | null>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Goes anywhere inside the app's 3D scene and tells a {@link JoggingGizmo}
|
|
15
|
+
* how NOVA's axes look from the scene's camera, every frame the scene
|
|
16
|
+
* renders. The gizmo turns them on to its own jog frame (`frameQuaternion`).
|
|
17
|
+
* Writes into `target` instead of setting state, so orbiting does not
|
|
18
|
+
* re-render React.
|
|
19
|
+
*
|
|
20
|
+
* It follows the camera's up. In a scene that is Y up, like that of this
|
|
21
|
+
* library's robots, it translates NOVA's axes (Z up): NOVA's Z is the
|
|
22
|
+
* scene's Y. In a scene that is Z up like NOVA's world, whose camera has Z
|
|
23
|
+
* up, it takes NOVA's axes as they are. Where it sits in the scene does not
|
|
24
|
+
* matter.
|
|
25
|
+
*/
|
|
26
|
+
export declare function JoggingGizmoOrientation({ target, }: JoggingGizmoOrientationProps): null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type GizmoHandlesProps } from "./gizmoShared";
|
|
2
|
+
/**
|
|
3
|
+
* The rotation handles: a round button on each arrowhead, which the keyboard
|
|
4
|
+
* reaches and which names the handle, and a band along its arc, so it can be
|
|
5
|
+
* grabbed anywhere along it
|
|
6
|
+
*/
|
|
7
|
+
export declare function RotationHandles(props: GizmoHandlesProps): import("react/jsx-runtime").JSX.Element[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type GizmoSceneProps } from "./gizmoShared";
|
|
2
|
+
/**
|
|
3
|
+
* The rotation gizmo's arcs, turned by `orientation` whenever it turns. Also
|
|
4
|
+
* lays the grab bands and arrowhead circles over them.
|
|
5
|
+
*/
|
|
6
|
+
export declare function RotationScene({ orientation, lit, disabled, size, radius, overlay, }: GizmoSceneProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type GizmoHandlesProps } from "./gizmoShared";
|
|
2
|
+
/**
|
|
3
|
+
* The translation handles: a button per direction, a bar along its half of
|
|
4
|
+
* the axis, so it can be grabbed anywhere along it. And the axis labels.
|
|
5
|
+
*/
|
|
6
|
+
export declare function TranslationHandles(props: GizmoHandlesProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type GizmoSceneProps } from "./gizmoShared";
|
|
2
|
+
/**
|
|
3
|
+
* The translation gizmo's arrows, turned by `orientation` whenever it turns.
|
|
4
|
+
* Also lays the grab bars and labels over them.
|
|
5
|
+
*/
|
|
6
|
+
export declare function TranslationScene({ orientation, lit, disabled, size, radius, overlay, }: GizmoSceneProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ProjectedJogArc } from "./arcs";
|
|
2
|
+
/** The px measures that {@link arcGrabAreasOf} lays the grab areas out by */
|
|
3
|
+
export type JogArcGrabSizes = {
|
|
4
|
+
/** Px per gizmo radius */
|
|
5
|
+
radiusPx: number;
|
|
6
|
+
/** Width of the band along an arc, and diameter of its arrowhead's circle */
|
|
7
|
+
gripPx: number;
|
|
8
|
+
/** How far the band reaches past both ends of the arc as drawn */
|
|
9
|
+
beyondTipPx: number;
|
|
10
|
+
/** Length of an arrowhead, in gizmo radii: it reaches half of it past the arc */
|
|
11
|
+
headLength: number;
|
|
12
|
+
};
|
|
13
|
+
/** Where a rotation handle can be grabbed: a band along its arc and a circle on its arrowhead */
|
|
14
|
+
export type JogArcGrabArea = {
|
|
15
|
+
/**
|
|
16
|
+
* The whole band, as a polygon in px from the gizmo center, y pointing
|
|
17
|
+
* down: where the handle shows as hovered or held
|
|
18
|
+
*/
|
|
19
|
+
band: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
}[];
|
|
23
|
+
/**
|
|
24
|
+
* The band in its two halves, which take the presses, each with a layer of
|
|
25
|
+
* its own: the X and Y arcs of a direction meet halfway, right above or
|
|
26
|
+
* below the center, and which of them is nearer flips there
|
|
27
|
+
*/
|
|
28
|
+
halves: {
|
|
29
|
+
polygon: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
}[];
|
|
33
|
+
layer: number;
|
|
34
|
+
}[];
|
|
35
|
+
/** Center of the arrowhead's circle, in px from the gizmo center */
|
|
36
|
+
head: {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
};
|
|
40
|
+
/** Where grab areas overlap, the one with the higher layer is on top */
|
|
41
|
+
headLayer: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Where each of `arcs` can be grabbed, in the same order: a band along the
|
|
45
|
+
* arc, from its start to past its arrowhead, and a circle on the arrowhead.
|
|
46
|
+
* `null` where a press could not tell which way the handle turns. So a press
|
|
47
|
+
* turns the way the arc drawn there points, never another one:
|
|
48
|
+
*
|
|
49
|
+
* - An axis seen (almost) edge on, where the near and far sides of its circle
|
|
50
|
+
* lie within a grip of each other, draws its arcs over each other with
|
|
51
|
+
* their arrowheads pointing the same way: neither is grabbed.
|
|
52
|
+
* - Where two arcs come within a grip of each other, the one drawn nearer
|
|
53
|
+
* there lies on top.
|
|
54
|
+
* - An arrowhead is the obvious thing to grab: its circle lies above every
|
|
55
|
+
* band, also where another arc passes over it. Of two arrowheads drawn
|
|
56
|
+
* over each other, the nearer lies on top.
|
|
57
|
+
*/
|
|
58
|
+
export declare function arcGrabAreasOf(arcs: readonly ProjectedJogArc[], { radiusPx, gripPx, beyondTipPx, headLength }: JogArcGrabSizes): (JogArcGrabArea | null)[];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type Quaternion, Vector3 } from "three";
|
|
2
|
+
import { type JogAxis, type JogDirection } from "../jogHandle";
|
|
3
|
+
/** Radius of the circles, in gizmo radii: an arrow of the translation gizmo is 1 long */
|
|
4
|
+
export declare const ARC_RADIUS = 0.8;
|
|
5
|
+
/** Where the + arc starts on its circle, in radians */
|
|
6
|
+
export declare const ARC_START = 0.45;
|
|
7
|
+
/** How far an arc reaches around its circle, in radians */
|
|
8
|
+
export declare const ARC_SWEEP = 2.25;
|
|
9
|
+
/**
|
|
10
|
+
* The plane of each axis's circle: angle 0 lies along the first vector, a
|
|
11
|
+
* quarter turn along the second. Their cross product is the axis, so a
|
|
12
|
+
* growing angle turns the positive way about it (right-hand rule).
|
|
13
|
+
*/
|
|
14
|
+
export declare const ARC_BASIS: Record<JogAxis, readonly [Vector3, Vector3]>;
|
|
15
|
+
/**
|
|
16
|
+
* Where the arc of `direction` starts and ends on its circle, and where its
|
|
17
|
+
* arrowhead sits, in radians. The − arc is the + arc half a turn on, with its
|
|
18
|
+
* arrowhead at its start, pointing back: the two arrowheads sit beside each
|
|
19
|
+
* other and point apart.
|
|
20
|
+
*/
|
|
21
|
+
export declare function arcAngles(direction: JogDirection): {
|
|
22
|
+
start: number;
|
|
23
|
+
end: number;
|
|
24
|
+
head: number;
|
|
25
|
+
};
|
|
26
|
+
/** A rotation handle's arc where the gizmo draws it */
|
|
27
|
+
export type ProjectedJogArc = {
|
|
28
|
+
axis: JogAxis;
|
|
29
|
+
direction: JogDirection;
|
|
30
|
+
/**
|
|
31
|
+
* Points along the arc from its start to its end: in gizmo radii from the
|
|
32
|
+
* center, y pointing down as on screen, depth toward the viewer
|
|
33
|
+
*/
|
|
34
|
+
points: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
depth: number;
|
|
38
|
+
}[];
|
|
39
|
+
/** The arrowhead, and the way it points on screen (a unit vector, or 0 when it points at the viewer) */
|
|
40
|
+
head: {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
depth: number;
|
|
44
|
+
dx: number;
|
|
45
|
+
dy: number;
|
|
46
|
+
};
|
|
47
|
+
/** How open the circle looks: 1 seen face on, 0 edge on */
|
|
48
|
+
openness: number;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Where the arcs of a gizmo turned by `frameInCamera` appear, each with
|
|
52
|
+
* `samples` + 1 points
|
|
53
|
+
*/
|
|
54
|
+
export declare function projectJogArcs(frameInCamera: Quaternion, samples?: number): ProjectedJogArc[];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Quaternion } from "three";
|
|
2
|
+
import { type JogAxis, type JogDirection } from "../jogHandle";
|
|
3
|
+
/** A jog handle where the gizmo draws it */
|
|
4
|
+
export type ProjectedJogHandle = {
|
|
5
|
+
axis: JogAxis;
|
|
6
|
+
direction: JogDirection;
|
|
7
|
+
/** Screen position of the arrow tip, in gizmo radii from the center */
|
|
8
|
+
x: number;
|
|
9
|
+
/** Like `x`, pointing down as on screen */
|
|
10
|
+
y: number;
|
|
11
|
+
/** Toward the viewer is positive; nearer handles are drawn on top */
|
|
12
|
+
depth: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Where the six handles of a gizmo turned by `frameInCamera` appear. three.js
|
|
16
|
+
* cameras look down −Z with +Y up, so a view-space vector lands on screen at
|
|
17
|
+
* (x, −y); z only decides what is in front.
|
|
18
|
+
*/
|
|
19
|
+
export declare function projectJogHandles(frameInCamera: Quaternion): ProjectedJogHandle[];
|
|
20
|
+
/** Where a handle can be grabbed: a bar along its arrow */
|
|
21
|
+
export type JogGrabArea = {
|
|
22
|
+
/** Start of the bar, in px from the gizmo center, y pointing down */
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
/** Length of the bar in px */
|
|
26
|
+
length: number;
|
|
27
|
+
/** Direction of the bar on screen, in radians, y pointing down */
|
|
28
|
+
angle: number;
|
|
29
|
+
/** Where two bars overlap, the one with the higher layer is on top */
|
|
30
|
+
layer: number;
|
|
31
|
+
};
|
|
32
|
+
/** The px measures that {@link grabAreasOf} lays the grab areas out by */
|
|
33
|
+
export type JogGrabSizes = {
|
|
34
|
+
/** Px per gizmo radius: the length on screen of an arrow across the screen */
|
|
35
|
+
radiusPx: number;
|
|
36
|
+
/** Thickness of a grab bar */
|
|
37
|
+
gripPx: number;
|
|
38
|
+
/** The center, which no handle owns, reaches this far out */
|
|
39
|
+
innerPx: number;
|
|
40
|
+
/** How far a bar reaches past its arrow's tip */
|
|
41
|
+
beyondTipPx: number;
|
|
42
|
+
/** An arrow shorter than this on screen points too nearly at or away from the viewer to grab */
|
|
43
|
+
minTipPx: number;
|
|
44
|
+
/** The arrowhead's share of an arrow's length */
|
|
45
|
+
headLength: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Where each of `handles` can be grabbed, in the same order: a bar along its
|
|
49
|
+
* arrow, from beside the center to past the tip, or `null` where a press
|
|
50
|
+
* could not tell it from another handle. So a press jogs along the arrow that
|
|
51
|
+
* is drawn there, never along another one:
|
|
52
|
+
*
|
|
53
|
+
* - The center belongs to no handle, and no bar reaches across it.
|
|
54
|
+
* - An arrow shorter than `minTipPx` on screen points (almost) at or away
|
|
55
|
+
* from the viewer, where its two halves look the same: neither is grabbed.
|
|
56
|
+
* - Two arrows that point the same way on screen share the line: the shorter
|
|
57
|
+
* bar ends and the longer begins halfway between the shorter tip and the
|
|
58
|
+
* longer arrowhead, so each arrowhead stays on its own bar. Where the two
|
|
59
|
+
* arrowheads are drawn over each other, only the nearer is grabbed.
|
|
60
|
+
* - Where bars still overlap, close to the center, the nearer handle is on
|
|
61
|
+
* top.
|
|
62
|
+
*/
|
|
63
|
+
export declare function grabAreasOf(handles: readonly ProjectedJogHandle[], sizes: JogGrabSizes): (JogGrabArea | null)[];
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { type Theme } from "@mui/material/styles";
|
|
2
|
+
import type { RefObject } from "react";
|
|
3
|
+
import { type Quaternion, Vector3 } from "three";
|
|
4
|
+
import { type JogAxis, type JogHandle } from "../jogHandle";
|
|
5
|
+
import type { useJogControls } from "../useJogControls";
|
|
6
|
+
import type { JogArcGrabSizes } from "./arcGrabAreas";
|
|
7
|
+
import type { JogGrabSizes } from "./arrows";
|
|
8
|
+
export declare const UP: Vector3;
|
|
9
|
+
/** Length of an arrowhead, in gizmo radii: an arrow is 1 long */
|
|
10
|
+
export declare const ARROW_HEAD_LENGTH = 0.26;
|
|
11
|
+
/** Radius of an arrowhead's base, in gizmo radii */
|
|
12
|
+
export declare const ARROW_HEAD_RADIUS = 0.1;
|
|
13
|
+
/**
|
|
14
|
+
* The color of an axis: the button color of that axis in the cartesian
|
|
15
|
+
* jogging tab, so a gizmo and the jog buttons always agree
|
|
16
|
+
*/
|
|
17
|
+
export declare function axisColor(axis: JogAxis): string;
|
|
18
|
+
/**
|
|
19
|
+
* The px measures of a gizmo `size` px wide, in proportion to it, so that a
|
|
20
|
+
* small gizmo looks like a large one, only smaller: the halo of a held or
|
|
21
|
+
* hovered handle, its grab bar and the room around the gizmo
|
|
22
|
+
*/
|
|
23
|
+
export declare function gizmoMeasures(size: number): {
|
|
24
|
+
/** Room around the gizmo for the labels, arrowheads and grab bars */
|
|
25
|
+
marginPx: number;
|
|
26
|
+
/** Thickness of a handle's grab bar, which shows as its halo */
|
|
27
|
+
gripPx: number;
|
|
28
|
+
grab: {
|
|
29
|
+
innerPx: number;
|
|
30
|
+
beyondTipPx: number;
|
|
31
|
+
minTipPx: number;
|
|
32
|
+
};
|
|
33
|
+
/** The axis labels, which stay readable on a small gizmo */
|
|
34
|
+
labelFontPx: number;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The gizmo radius, in px, that fits a `width` × `height` canvas whichever
|
|
38
|
+
* way the gizmo is turned, keeping `marginPx` free for the labels and grab
|
|
39
|
+
* areas around the tips. At least 1, so an unmeasured canvas still draws.
|
|
40
|
+
*/
|
|
41
|
+
export declare function fitGizmoRadiusPx(width: number, height: number, marginPx: number): number;
|
|
42
|
+
/**
|
|
43
|
+
* The measures that the grab areas of a gizmo `size` px wide are laid out
|
|
44
|
+
* by, with `radiusPx` px per gizmo radius
|
|
45
|
+
*/
|
|
46
|
+
export declare function gizmoGrabSizes(size: number, radiusPx: number): JogGrabSizes;
|
|
47
|
+
/**
|
|
48
|
+
* The measures that the grab areas of the rotation arcs of a gizmo `size` px
|
|
49
|
+
* wide are laid out by, with `radiusPx` px per gizmo radius
|
|
50
|
+
*/
|
|
51
|
+
export declare function gizmoArcGrabSizes(size: number, radiusPx: number): JogArcGrabSizes;
|
|
52
|
+
/**
|
|
53
|
+
* The elements laid over the gizmo, by key. The 3D scene places them every
|
|
54
|
+
* frame the gizmo turns, directly, so that orbiting does not re-render React.
|
|
55
|
+
*/
|
|
56
|
+
export type GizmoOverlay = Map<string, Element>;
|
|
57
|
+
/** A ref callback that registers an overlay element under `key` */
|
|
58
|
+
export declare function overlayRef(overlay: RefObject<GizmoOverlay>, key: string): (node: Element | null) => void;
|
|
59
|
+
export declare const handleKey: (handle: JogHandle) => string;
|
|
60
|
+
export declare const labelKey: (axis: JogAxis) => string;
|
|
61
|
+
/** A band takes presses in two halves: see JogArcGrabArea */
|
|
62
|
+
export declare const HALVES: readonly [0, 1];
|
|
63
|
+
export declare const halfKey: (handle: JogHandle, half: number) => string;
|
|
64
|
+
export declare const haloKey: (handle: JogHandle) => string;
|
|
65
|
+
export declare const focusKey: (handle: JogHandle) => string;
|
|
66
|
+
/** A clip path that shows nothing and takes no press */
|
|
67
|
+
export declare const NOWHERE = "polygon(0 0, 0 0, 0 0)";
|
|
68
|
+
/** What the 3D half of a gizmo (inside the canvas) gets */
|
|
69
|
+
export type GizmoSceneProps = {
|
|
70
|
+
orientation: RefObject<Quaternion | null>;
|
|
71
|
+
/** The handle to draw highlighted: held, active or hovered */
|
|
72
|
+
lit: JogHandle | null;
|
|
73
|
+
disabled: boolean;
|
|
74
|
+
/** Side of the gizmo, in px */
|
|
75
|
+
size: number;
|
|
76
|
+
/** Px per gizmo unit */
|
|
77
|
+
radius: number;
|
|
78
|
+
overlay: RefObject<GizmoOverlay>;
|
|
79
|
+
};
|
|
80
|
+
/** What the handle half of a gizmo (laid over the canvas) gets */
|
|
81
|
+
export type GizmoHandlesProps = {
|
|
82
|
+
/** Whether a handle shows as pressed: held or shown as active */
|
|
83
|
+
isPressed: (handle: JogHandle) => boolean;
|
|
84
|
+
/** The handle the pointer is over */
|
|
85
|
+
hovered: JogHandle | null;
|
|
86
|
+
disabled: boolean;
|
|
87
|
+
size: number;
|
|
88
|
+
onHover: (handle: JogHandle | null) => void;
|
|
89
|
+
handlersFor: ReturnType<typeof useJogControls>["handlersFor"];
|
|
90
|
+
/** The accessible name of a handle, e.g. "Jog X+" */
|
|
91
|
+
label: (handle: JogHandle) => string;
|
|
92
|
+
overlay: RefObject<GizmoOverlay>;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* How a handle shows: pressed while it is held or shown as active, lit
|
|
96
|
+
* (highlighted) while it is pressed or hovered
|
|
97
|
+
*/
|
|
98
|
+
export declare function handleState(handle: JogHandle, { isPressed, hovered, disabled, }: Pick<GizmoHandlesProps, "isPressed" | "hovered" | "disabled">): {
|
|
99
|
+
pressed: boolean;
|
|
100
|
+
lit: boolean;
|
|
101
|
+
};
|
|
102
|
+
/** The highlight of a handle's grab area, stronger while it is pressed */
|
|
103
|
+
export declare function highlightOf(color: string, { pressed, lit }: ReturnType<typeof handleState>): string;
|
|
104
|
+
/** What each element that grabs a handle gets: hover, and press and hold */
|
|
105
|
+
export declare function gripProps(handle: JogHandle, { onHover, handlersFor }: Pick<GizmoHandlesProps, "onHover" | "handlersFor">): {
|
|
106
|
+
onPointerDown: (event: import("react").PointerEvent<Element>) => void;
|
|
107
|
+
onPointerMove: (event: import("react").PointerEvent<Element>) => void;
|
|
108
|
+
onPointerUp: () => void;
|
|
109
|
+
onPointerCancel: () => void;
|
|
110
|
+
onLostPointerCapture: () => void;
|
|
111
|
+
onKeyDown: (event: import("react").KeyboardEvent<Element>) => void;
|
|
112
|
+
onKeyUp: (event: import("react").KeyboardEvent<Element>) => void;
|
|
113
|
+
onBlur: (_event: import("react").FocusEvent<Element>) => void;
|
|
114
|
+
onContextMenu: typeof import("../holdSafety").preventContextMenu;
|
|
115
|
+
onPointerEnter: () => void;
|
|
116
|
+
onPointerLeave: () => void;
|
|
117
|
+
};
|
|
118
|
+
/** The styles of each element that grabs a handle: no browser gesture on it */
|
|
119
|
+
export declare const gripStyle: (disabled: boolean) => {
|
|
120
|
+
readonly cursor: "default" | "pointer";
|
|
121
|
+
readonly touchAction: "none";
|
|
122
|
+
readonly userSelect: "none";
|
|
123
|
+
};
|
|
124
|
+
/** The keyboard's focus outline, in the theme's primary color */
|
|
125
|
+
export declare const focusOutline: (theme: Theme) => string;
|