@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.
Files changed (191) hide show
  1. package/README.md +323 -120
  2. package/dist/3d.cjs +1 -1
  3. package/dist/3d.d.ts +5 -3
  4. package/dist/3d.js +24 -23
  5. package/dist/CurrentPoseBar/index.cjs +1 -0
  6. package/dist/CurrentPoseBar/index.d.ts +2 -0
  7. package/dist/CurrentPoseBar/index.js +5 -0
  8. package/dist/JoggingButtons/index.cjs +1 -0
  9. package/dist/JoggingButtons/index.d.ts +3 -0
  10. package/dist/JoggingButtons/index.js +5 -0
  11. package/dist/JoggingGizmo/index.cjs +1 -0
  12. package/dist/JoggingGizmo/index.d.ts +4 -0
  13. package/dist/JoggingGizmo/index.js +7 -0
  14. package/dist/JoggingJointSlider/index.cjs +1 -0
  15. package/dist/JoggingJointSlider/index.d.ts +2 -0
  16. package/dist/JoggingJointSlider/index.js +5 -0
  17. package/dist/RobotControlPanel/index.cjs +1 -0
  18. package/dist/RobotControlPanel/index.d.ts +2 -0
  19. package/dist/RobotControlPanel/index.js +5 -0
  20. package/dist/RobotHeader/index.cjs +1 -0
  21. package/dist/RobotHeader/index.d.ts +4 -0
  22. package/dist/RobotHeader/index.js +5 -0
  23. package/dist/SafetyBar/index.cjs +1 -1
  24. package/dist/SafetyBar/index.js +1 -1
  25. package/dist/chunks/CurrentPoseBar-CyHUWmjM.cjs +1 -0
  26. package/dist/chunks/CurrentPoseBar-zTZi68tY.js +505 -0
  27. package/dist/chunks/JoggingButtons-CXaozFVz.js +108 -0
  28. package/dist/chunks/JoggingButtons-CbL-5LMK.cjs +1 -0
  29. package/dist/chunks/JoggingGizmo-DGbFLWgT.cjs +1 -0
  30. package/dist/chunks/JoggingGizmo-SuS9MmL7.js +810 -0
  31. package/dist/chunks/JoggingGizmoOrientation-dzned4f4.cjs +1 -0
  32. package/dist/chunks/JoggingGizmoOrientation-x_crT_64.js +14 -0
  33. package/dist/chunks/JoggingJointSlider-CZ-k6XCa.js +406 -0
  34. package/dist/chunks/JoggingJointSlider-R3_A9Ppj.cjs +1 -0
  35. package/dist/chunks/Robot-D0ZqUCn3.cjs +1 -0
  36. package/dist/chunks/Robot-UoykZeYH.js +1272 -0
  37. package/dist/chunks/RobotControlPanel-BnMfmO41.js +822 -0
  38. package/dist/chunks/RobotControlPanel-BuDGcxPR.cjs +1 -0
  39. package/dist/chunks/RobotHeader-BZci9ahT.js +244 -0
  40. package/dist/chunks/RobotHeader-CqK0700U.cjs +1 -0
  41. package/dist/chunks/SafetyBar-Bbg-o8h9.cjs +1 -0
  42. package/dist/chunks/{SafetyBar-Cy9DiXp9.js → SafetyBar-Cuak4ffd.js} +11 -10
  43. package/dist/chunks/SmallSelect-BdD9uLKK.js +52 -0
  44. package/dist/chunks/SmallSelect-Dcsd7_6_.cjs +1 -0
  45. package/dist/chunks/TrajectoryExecutionStore-DPqfDcfn.js +3398 -0
  46. package/dist/chunks/TrajectoryExecutionStore-DV6mLEx9.cjs +3 -0
  47. package/dist/chunks/converters-C8I_A_tA.cjs +1 -0
  48. package/dist/chunks/converters-DpNB_WNQ.js +39 -0
  49. package/dist/chunks/externalizeComponent-BdxGBLIv.cjs +2 -0
  50. package/dist/chunks/externalizeComponent-_w2d1_pz.js +283 -0
  51. package/dist/chunks/holdSafety-BtoZ5We3.cjs +1 -0
  52. package/dist/chunks/holdSafety-Di1GZAWg.js +37 -0
  53. package/dist/chunks/joggingColors-CuT5u0H8.js +135 -0
  54. package/dist/chunks/joggingColors-ZDc_2UCp.cjs +1 -0
  55. package/dist/chunks/useEveryFrame-G_-ma1nC.js +142 -0
  56. package/dist/chunks/useEveryFrame-dmPPTKtT.cjs +1 -0
  57. package/dist/chunks/useSmoothedMotionState-COMJRcOt.js +214 -0
  58. package/dist/chunks/useSmoothedMotionState-Con0E5Bx.cjs +1 -0
  59. package/dist/components/AppHeader.d.ts +1 -1
  60. package/dist/components/currentPoseBar/CurrentPoseBar.d.ts +48 -0
  61. package/dist/components/currentPoseBar/OrientationFormatPopover.d.ts +19 -0
  62. package/dist/components/currentPoseBar/StreamStatus.d.ts +10 -0
  63. package/dist/components/currentPoseBar/orientation.d.ts +34 -0
  64. package/dist/components/currentPoseBar/poseValues.d.ts +15 -0
  65. package/dist/components/jogging/JoggingButtons.d.ts +16 -0
  66. package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +1 -1
  67. package/dist/components/jogging/JoggingJointTab.d.ts +1 -1
  68. package/dist/components/jogging/JoggingPanel.d.ts +6 -3
  69. package/dist/components/jogging/JoggingStore.d.ts +96 -19
  70. package/dist/components/jogging/gizmo/JoggingGizmo.d.ts +43 -0
  71. package/dist/components/jogging/gizmo/JoggingGizmoOrientation.d.ts +26 -0
  72. package/dist/components/jogging/gizmo/RotationHandles.d.ts +7 -0
  73. package/dist/components/jogging/gizmo/RotationScene.d.ts +6 -0
  74. package/dist/components/jogging/gizmo/TranslationHandles.d.ts +6 -0
  75. package/dist/components/jogging/gizmo/TranslationScene.d.ts +6 -0
  76. package/dist/components/jogging/gizmo/arcGrabAreas.d.ts +58 -0
  77. package/dist/components/jogging/gizmo/arcs.d.ts +54 -0
  78. package/dist/components/jogging/gizmo/arrows.d.ts +63 -0
  79. package/dist/components/jogging/gizmo/gizmoShared.d.ts +125 -0
  80. package/dist/components/jogging/gizmo/gizmoView.d.ts +42 -0
  81. package/dist/components/jogging/gizmo/useGizmoTurn.d.ts +11 -0
  82. package/dist/components/jogging/holdSafety.d.ts +44 -0
  83. package/dist/components/jogging/jogError.d.ts +9 -0
  84. package/dist/components/jogging/jogHandle.d.ts +23 -0
  85. package/dist/components/jogging/joggingColors.d.ts +24 -0
  86. package/dist/components/jogging/joggingVelocity.d.ts +21 -0
  87. package/dist/components/jogging/joint/JoggingJointSlider.d.ts +52 -0
  88. package/dist/components/jogging/joint/JointSliderTrack.d.ts +27 -0
  89. package/dist/components/jogging/joint/jointJog.d.ts +55 -0
  90. package/dist/components/jogging/joint/useJointJogHold.d.ts +48 -0
  91. package/dist/components/jogging/useHold.d.ts +38 -0
  92. package/dist/components/jogging/useJogControls.d.ts +45 -0
  93. package/dist/components/robotControl/CartesianJogTab.d.ts +21 -0
  94. package/dist/components/robotControl/HoldToMoveButton.d.ts +25 -0
  95. package/dist/components/robotControl/JogArea.d.ts +22 -0
  96. package/dist/components/robotControl/JogModeToggle.d.ts +8 -0
  97. package/dist/components/robotControl/JointJogTab.d.ts +11 -0
  98. package/dist/components/robotControl/MoveToTab.d.ts +18 -0
  99. package/dist/components/robotControl/PanelSelect.d.ts +13 -0
  100. package/dist/components/robotControl/PoseField.d.ts +21 -0
  101. package/dist/components/robotControl/RobotControlPanel.d.ts +212 -0
  102. package/dist/components/robotControl/Section.d.ts +5 -0
  103. package/dist/components/robotControl/SmallSelect.d.ts +15 -0
  104. package/dist/components/robotControl/VelocityRow.d.ts +14 -0
  105. package/dist/components/robotControl/atPose.d.ts +8 -0
  106. package/dist/components/robotControl/poseText.d.ts +15 -0
  107. package/dist/components/robotControl/units.d.ts +16 -0
  108. package/dist/components/robotControl/useCopyText.d.ts +12 -0
  109. package/dist/components/robotControl/useEveryFrame.d.ts +6 -0
  110. package/dist/components/robotHeader/ActivationSwitch.d.ts +7 -0
  111. package/dist/components/robotHeader/AppNavigation.d.ts +15 -0
  112. package/dist/components/robotHeader/RobotHeader.d.ts +42 -0
  113. package/dist/components/robots/GenericRobot.d.ts +2 -1
  114. package/dist/components/robots/LinearAxis.d.ts +1 -1
  115. package/dist/components/robots/LinearAxisAnimator.d.ts +11 -2
  116. package/dist/components/robots/Robot.d.ts +1 -1
  117. package/dist/components/robots/robotModelLogic.d.ts +11 -9
  118. package/dist/components/utils/hooks.d.ts +1 -6
  119. package/dist/core.cjs +1 -1
  120. package/dist/core.d.ts +13 -18
  121. package/dist/core.js +37 -51
  122. package/dist/index.cjs +1 -1
  123. package/dist/index.js +58 -71
  124. package/dist/lib/ConnectedMotionGroup.d.ts +5 -7
  125. package/dist/lib/JoggerConnection.d.ts +137 -27
  126. package/dist/lib/MotionStreamConnection.d.ts +15 -6
  127. package/dist/lib/Pose3.d.ts +22 -0
  128. package/dist/lib/PoseTransformer.d.ts +25 -0
  129. package/dist/lib/TrajectoryExecutionStore.d.ts +129 -0
  130. package/dist/lib/connectionLogger.d.ts +9 -0
  131. package/dist/lib/incrementalCartesianMotion.d.ts +40 -0
  132. package/dist/lib/motionStateUpdate.d.ts +27 -0
  133. package/dist/lib/novaConnection.d.ts +23 -0
  134. package/dist/lib/planErrorTranslation.d.ts +8 -0
  135. package/dist/lib/rotation.d.ts +12 -0
  136. package/package.json +31 -66
  137. package/dist/Setup.d.ts +0 -11
  138. package/dist/chunks/MotionGroupVisualizer-DshWR1wY.js +0 -1653
  139. package/dist/chunks/MotionGroupVisualizer-eD7yFEcF.cjs +0 -1
  140. package/dist/chunks/SafetyBar-DPrv_OQA.cjs +0 -1
  141. package/dist/chunks/externalizeComponent-EDymnaGR.js +0 -268
  142. package/dist/chunks/externalizeComponent-OO4jcrz5.cjs +0 -2
  143. package/dist/chunks/theming-DfSy4-Ic.cjs +0 -4
  144. package/dist/chunks/theming-mF9Rt8SS.js +0 -5542
  145. package/dist/chunks/useSmoothedMotionState-DyDgSVYX.js +0 -478
  146. package/dist/chunks/useSmoothedMotionState-VYxEIyfr.cjs +0 -1
  147. package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +0 -11
  148. package/dist/components/AdornedTextField.d.ts +0 -7
  149. package/dist/components/CopyableText.d.ts +0 -6
  150. package/dist/components/CycleTimer/CycleTimer.d.ts +0 -3
  151. package/dist/components/CycleTimer/DefaultVariant.d.ts +0 -9
  152. package/dist/components/CycleTimer/SmallVariant.d.ts +0 -10
  153. package/dist/components/CycleTimer/index.d.ts +0 -27
  154. package/dist/components/CycleTimer/types.d.ts +0 -49
  155. package/dist/components/CycleTimer/useAnimations.d.ts +0 -14
  156. package/dist/components/CycleTimer/useTimerLogic.d.ts +0 -24
  157. package/dist/components/CycleTimer/utils.d.ts +0 -21
  158. package/dist/components/CycleTimer.d.ts +0 -3
  159. package/dist/components/DataGrid.d.ts +0 -66
  160. package/dist/components/LogPanel.d.ts +0 -38
  161. package/dist/components/LogStore.d.ts +0 -12
  162. package/dist/components/LogViewer.d.ts +0 -46
  163. package/dist/components/ProgramControl.d.ts +0 -55
  164. package/dist/components/ProgramStateIndicator.d.ts +0 -26
  165. package/dist/components/RobotCard.d.ts +0 -98
  166. package/dist/components/RobotListItem.d.ts +0 -34
  167. package/dist/components/RobotSetupReadinessIndicator.d.ts +0 -37
  168. package/dist/components/SelectableFab.d.ts +0 -7
  169. package/dist/components/TabBar.d.ts +0 -45
  170. package/dist/components/ThemeSelect.d.ts +0 -6
  171. package/dist/components/Timer/Timer.d.ts +0 -3
  172. package/dist/components/Timer/TimerDefaultVariant.d.ts +0 -9
  173. package/dist/components/Timer/TimerSmallVariant.d.ts +0 -10
  174. package/dist/components/Timer/index.d.ts +0 -19
  175. package/dist/components/Timer/types.d.ts +0 -35
  176. package/dist/components/Timer/useTimerAnimations.d.ts +0 -10
  177. package/dist/components/Timer/useTimerLogic.d.ts +0 -19
  178. package/dist/components/Timer/utils.d.ts +0 -17
  179. package/dist/components/Timer.d.ts +0 -3
  180. package/dist/components/TransparentOverlay.d.ts +0 -4
  181. package/dist/components/jogging/JoggingFreedriveTab.d.ts +0 -1
  182. package/dist/components/jogging/PoseCartesianValues.d.ts +0 -9
  183. package/dist/components/jogging/PoseJointValues.d.ts +0 -8
  184. package/dist/components/robots/AxisConfig.d.ts +0 -2
  185. package/dist/components/robots/manufacturerHomePositions.d.ts +0 -20
  186. package/dist/icons/DropdownArrowIcon.d.ts +0 -2
  187. package/dist/icons/index.d.ts +0 -12
  188. package/dist/lib/novaCompat.d.ts +0 -16
  189. package/dist/themes/createDarkTheme.d.ts +0 -7
  190. package/dist/themes/themeTypes.d.ts +0 -40
  191. package/dist/themes/theming.d.ts +0 -24
@@ -0,0 +1,42 @@
1
+ import { type Object3D, Quaternion, Vector3 } from "three";
2
+ import type { JogAxis } from "../jogHandle";
3
+ /** The unit vector along each axis */
4
+ export declare const UNIT_VECTOR: Record<JogAxis, Vector3>;
5
+ /**
6
+ * The jog frame as the camera sees it, `camera⁻¹ · frame`: what turns the
7
+ * gizmo so that the handle pointing right on screen moves the robot right on
8
+ * screen.
9
+ *
10
+ * Both are world orientations, so this works whichever axis is up in the
11
+ * scene.
12
+ */
13
+ export declare function jogFrameInCamera(cameraWorldQuaternion: Quaternion, frameWorldQuaternion: Quaternion, target?: Quaternion): Quaternion;
14
+ /**
15
+ * The dictionary from NOVA's axes to the 3D scene's: NOVA has Z up, the
16
+ * scene (as that of this library's robots) Y up. NOVA's X is the scene's X,
17
+ * its Y the scene's -Z, its Z the scene's Y. The teaching app's gizmo uses
18
+ * the same table.
19
+ */
20
+ export declare const NOVA_AXES_IN_SCENE: Quaternion;
21
+ /**
22
+ * NOVA's axes in the 3D scene of `camera`, by which way its camera has up. A
23
+ * scene that is Z up like NOVA's world (e.g. RobotPad's, whose camera's up is
24
+ * Z) has NOVA's axes as they are. A scene that is Y up (this library's
25
+ * robots, the teaching app) needs the dictionary.
26
+ */
27
+ export declare function novaAxesInScene(camera: Object3D): Quaternion;
28
+ /** NOVA's axes as `camera` sees them */
29
+ export declare function novaAxesSeenBy(camera: Object3D, target?: Quaternion): Quaternion;
30
+ /**
31
+ * The jog frame as the camera sees it: `view`, NOVA's axes as the camera
32
+ * sees them (see {@link novaAxesSeenBy}), turned by `frame`, the jog frame
33
+ * in NOVA's coordinates
34
+ */
35
+ export declare function jogFrameInView(view: Quaternion, frame: Quaternion, target?: Quaternion): Quaternion;
36
+ /**
37
+ * Whether `next` is a different rotation from `previous`, so the gizmo has to
38
+ * be drawn anew. A camera orientation computed afresh each frame differs in
39
+ * its last digits without turning, and a quaternion and its negation are the
40
+ * same rotation, so this compares rotations, not numbers.
41
+ */
42
+ export declare function hasTurned(previous: Quaternion | null, next: Quaternion): boolean;
@@ -0,0 +1,11 @@
1
+ import { type RefObject } from "react";
2
+ import type { Group, Quaternion } from "three";
3
+ /**
4
+ * Turns `group` with `orientation`, and has `place` lay the handles over it,
5
+ * whenever it turns. `place` returns whether it found every handle to place.
6
+ *
7
+ * The canvas draws on demand. Looking for a turn every animation frame costs
8
+ * a comparison of two rotations; drawing happens only after a turn or a new
9
+ * `layout` (e.g. a new size), and again until every handle is placed.
10
+ */
11
+ export declare function useGizmoTurn(orientation: RefObject<Quaternion | null>, group: RefObject<Group | null>, place: (orientation: Quaternion) => boolean, layout: string): void;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Whether a pointer press may start a hold: the primary button, and no Ctrl.
3
+ * On macOS a Ctrl+click is a primary press that opens the context menu, and
4
+ * the menu swallows the release.
5
+ */
6
+ export declare function startsPointerHold(event: {
7
+ button: number;
8
+ ctrlKey: boolean;
9
+ }): boolean;
10
+ /**
11
+ * Whether a key press may start a hold: not an auto-repeat, and no Cmd.
12
+ * macOS sends no key release for a key released while Cmd is held.
13
+ */
14
+ export declare function startsKeyHold(event: {
15
+ repeat: boolean;
16
+ metaKey: boolean;
17
+ }): boolean;
18
+ /**
19
+ * Whether a key press ends a running hold, by pointer or by key: any new
20
+ * press does, as the release of the held key may never come (Cmd pressed
21
+ * during it, on macOS). Only the auto-repeat of the held key goes on.
22
+ */
23
+ export declare function endsHold(event: {
24
+ repeat: boolean;
25
+ }): boolean;
26
+ /**
27
+ * Whether a move of the holding pointer shows that its primary button is up:
28
+ * its release never arrived, or it came while another button stays pressed,
29
+ * when the browser sends no pointerup until the last button is up
30
+ */
31
+ export declare function primaryReleased(event: {
32
+ buttons: number;
33
+ }): boolean;
34
+ /** The context menu of a control would swallow the release of a hold */
35
+ export declare function preventContextMenu(event: {
36
+ preventDefault: () => void;
37
+ }): void;
38
+ /**
39
+ * Ends a hold that the user can no longer end at the control: when the
40
+ * controls become disabled or unmount, and while `holding`, when the window
41
+ * loses focus or the tab is hidden (a release outside the page never reaches
42
+ * the control). `end` must be stable and do nothing when nothing is held.
43
+ */
44
+ export declare function useEndHoldWhenUnattended(holding: boolean, disabled: boolean, end: () => void): void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Pulls a short, human-readable message out of the various shapes a jogger
3
+ * error can arrive in (raw JSON strings from the continuous jogging socket,
4
+ * `InitializeMovementResponse`/`StartMovementResponse`-like objects, or
5
+ * those wrapped in a `{ result: ... }` envelope from the trajectory socket).
6
+ */
7
+ export declare function extractJogErrorMessage(err: unknown): string;
8
+ /** The translation key of a friendlier text for a raw jog error, or null */
9
+ export declare function getJogErrorTranslationKey(message: string): string | null;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * An axis of a cartesian jog
3
+ */
4
+ export type JogAxis = "x" | "y" | "z";
5
+ /**
6
+ * Which way along an axis
7
+ */
8
+ export type JogDirection = "+" | "-";
9
+ /**
10
+ * One jog control, e.g. +X
11
+ */
12
+ export type JogHandle = {
13
+ axis: JogAxis;
14
+ direction: JogDirection;
15
+ };
16
+ export declare const JOG_AXES: readonly JogAxis[];
17
+ export declare const JOG_DIRECTIONS: readonly JogDirection[];
18
+ export declare function isSameJogHandle(a: JogHandle | null | undefined, b: JogHandle | null | undefined): boolean;
19
+ /**
20
+ * How a handle is named on screen, as the jog buttons name it: X+, or Rx+
21
+ * when it rotates about X
22
+ */
23
+ export declare function jogHandleName(handle: JogHandle, motion?: "translate" | "rotate"): string;
@@ -0,0 +1,24 @@
1
+ import type { JogAxis } from "./jogHandle";
2
+ export interface AxisControlComponentColors {
3
+ color?: string;
4
+ borderColor?: string;
5
+ backgroundColor?: string;
6
+ buttonBackgroundColor?: {
7
+ default?: string;
8
+ pressed?: string;
9
+ disabled?: string;
10
+ hovered?: string;
11
+ };
12
+ labelColor?: string;
13
+ }
14
+ /** Colors of the X, Y and Z axis controls of the cartesian jogging tab */
15
+ export declare const cartesianAxisColors: Record<"X" | "Y" | "Z", AxisControlComponentColors>;
16
+ /** Color of the arrows of the joint jogging controls */
17
+ export declare const jointArrowColor = "rgba(255, 255, 255, 1)";
18
+ /** Color of the velocity legend of the velocity slider */
19
+ export declare const velocitySliderLegendColor = "rgba(255, 255, 255, 1)";
20
+ /**
21
+ * The color of each axis in the design system: red, green and blue 400, as
22
+ * the axis labels of JoggingButtons show them. New jogging parts use these.
23
+ */
24
+ export declare const jogAxisColors: Record<JogAxis, string>;
@@ -0,0 +1,21 @@
1
+ import type { OperationLimits } from "@wandelbots/nova-js/v2";
2
+ /**
3
+ * Default rotation jogging velocity in °/s, for cartesian TCP rotation and
4
+ * revolute joint jogging.
5
+ */
6
+ export declare const DEFAULT_ROTATION_VELOCITY_DEG_PER_SEC = 5;
7
+ /**
8
+ * Upper bound for the TCP velocity in manual reduced-speed mode (T1). ISO 10218-1
9
+ * limits the TCP to 250 mm/s there, and NOVA documents the same for manual mode.
10
+ */
11
+ export declare const T1_MAX_TCP_VELOCITY_MM_PER_SEC = 250;
12
+ /**
13
+ * Default cartesian translation jogging velocity in mm/s: 10 % of the motion
14
+ * group's T1 max. The T1 max is the lowest valid manual TCP velocity limit the
15
+ * controller reports, capped at {@link T1_MAX_TCP_VELOCITY_MM_PER_SEC}, so
16
+ * most robots start at 25 mm/s.
17
+ *
18
+ * `manual_limits` counts alongside `manual_t1_limits` because controllers
19
+ * without a separate T1 mode (e.g. Yaskawa) report their reduced speed there.
20
+ */
21
+ export declare function getDefaultTranslationVelocityMmPerSec(operationLimits: OperationLimits | undefined): number;
@@ -0,0 +1,52 @@
1
+ import type { JogDirection } from "../jogHandle";
2
+ /**
3
+ * Props of {@link JoggingJointSlider}
4
+ */
5
+ export type JoggingJointSliderProps = {
6
+ /** Short name of the joint, e.g. "J1" */
7
+ label: string;
8
+ /** What the joint is, e.g. "Base", shown after the label */
9
+ name?: string;
10
+ /** The joint's live position, in NOVA's units: radians, or mm for a linear axis */
11
+ value: number;
12
+ /**
13
+ * The joint's lower limit, the left end of the track. A revolute joint
14
+ * with one limit spans one turn from it, and without limits the turn it
15
+ * stands in. A linear axis needs both limits to be jogged with the slider:
16
+ * without them, it only shows its value.
17
+ */
18
+ min?: number;
19
+ /** The joint's upper limit, the right end of the track: see `min` */
20
+ max?: number;
21
+ /** A linear axis, in mm. Defaults to a revolute joint, in radians. */
22
+ linear?: boolean;
23
+ /** How a revolute joint is shown: in degrees (default) or radians */
24
+ angleUnit?: "deg" | "rad";
25
+ /**
26
+ * The slider was pressed: jog the joint in `direction` until `onJogStop`.
27
+ * The joint stops on its own once it gets to the goal, and starts again
28
+ * when the goal moves on, so one press can bring several starts and stops,
29
+ * always in turn.
30
+ *
31
+ * When the goal passes the joint, onJogStop and the onJogStart of the
32
+ * other way come in the same event. An app whose jog commands are
33
+ * asynchronous must apply them in that order, and must not tear down its
34
+ * jogging connection on that stop.
35
+ */
36
+ onJogStart: (direction: JogDirection) => void;
37
+ /** The joint must stop: it got to its goal, or the slider was let go */
38
+ onJogStop: () => void;
39
+ disabled?: boolean;
40
+ };
41
+ /**
42
+ * One joint as a slider across its limits, with the thumb at the joint's
43
+ * value and the limits below. Hovering the track shows the goal under the
44
+ * pointer; pressing there jogs the joint toward it until it gets there or
45
+ * the slider is let go. While held, the goal follows the pointer, and the
46
+ * joint turns around when the goal passes it. An arrow key held on the
47
+ * focused slider jogs toward that limit.
48
+ *
49
+ * An app shows one slider per joint. It moves nothing itself: onJogStart and
50
+ * onJogStop leave that to the app, which also keeps to one joint at a time.
51
+ */
52
+ export declare const JoggingJointSlider: ({ label, name, value, min, max, linear, angleUnit, onJogStart, onJogStop, disabled, }: JoggingJointSliderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import type { Ref } from "react";
2
+ export type JointSliderTrackProps = {
3
+ /** The rail, which the pointer is placed along */
4
+ railRef?: Ref<HTMLDivElement>;
5
+ /** Where the joint is along the track, 0 to 1; null to draw no thumb */
6
+ at: number | null;
7
+ /** Where the goal is along the track, 0 to 1; null for none */
8
+ goalAt: number | null;
9
+ /** Whether the slider is held: the goal is the jog's, not only hovered */
10
+ held: boolean;
11
+ /** Where the joint's zero is along the track, 0 to 1; null for none */
12
+ zeroAt: number | null;
13
+ /** The limits below the ends of the track, as shown; omitted for none */
14
+ limits?: {
15
+ min: string;
16
+ max: string;
17
+ };
18
+ disabled: boolean;
19
+ };
20
+ /**
21
+ * The drawing of a joint slider: the rail across the limits, the stretch to
22
+ * the goal, a mark at zero, the thumb at the joint, and the limits below.
23
+ *
24
+ * Positions change with every frame of motion: they go in `style`, not in
25
+ * `sx`, which would add a CSS rule for each new value and never remove it.
26
+ */
27
+ export declare function JointSliderTrack({ railRef, at, goalAt, held, zeroAt, limits, disabled, }: JointSliderTrackProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,55 @@
1
+ import type { JogDirection } from "../jogHandle";
2
+ /** A joint's limits as a slider takes them, in NOVA's units */
3
+ export type JointLimits = {
4
+ /** The lower limit, the left end of the track */
5
+ min?: number;
6
+ /** The upper limit, the right end of the track */
7
+ max?: number;
8
+ /** A linear axis, in mm; otherwise a revolute joint, in radians */
9
+ linear?: boolean;
10
+ };
11
+ /** The stretch of joint values a slider's track spans */
12
+ export type JointRange = {
13
+ min: number;
14
+ max: number;
15
+ };
16
+ /** How a joint's values are shown */
17
+ export type JointUnit = "deg" | "rad" | "mm";
18
+ /**
19
+ * The range a joint's track spans: its limits. A revolute joint with one
20
+ * limit spans one turn from it; without limits, the turn its `value` is in,
21
+ * so it can be jogged both ways wherever it stands. A linear axis without
22
+ * both limits has nothing to be placed in: no range.
23
+ */
24
+ export declare function jointSliderRange({ min, max, linear }: JointLimits, value: number): JointRange | null;
25
+ /** Where `value` sits along a track spanning `range`, from 0 to 1 */
26
+ export declare function fractionOf(value: number, range: JointRange): number;
27
+ /**
28
+ * The joint value at `fraction` of the way along a track spanning `range`.
29
+ * Past an end it is the limit, so a goal is never out of reach.
30
+ */
31
+ export declare function valueAt(fraction: number, range: JointRange): number;
32
+ /** Where the joint's zero sits along its track, or null when it lies outside */
33
+ export declare function zeroFraction(range: JointRange): number | null;
34
+ /**
35
+ * Which way to jog from `current` to reach `goal`, or null when the joint is
36
+ * within `deadband` of it already
37
+ */
38
+ export declare function directionToward(current: number, goal: number, deadband: number): JogDirection | null;
39
+ /**
40
+ * Whether a joint jogging in `direction` has got to `goal`: at it, or past it,
41
+ * as a jog overshoots a little before its stop lands
42
+ */
43
+ export declare function hasReachedGoal(current: number, goal: number, direction: JogDirection): boolean;
44
+ /** How a joint is shown: a linear axis in mm, a revolute joint in `angleUnit` */
45
+ export declare function jointUnit(linear: boolean, angleUnit: "deg" | "rad"): JointUnit;
46
+ /** A joint value in the unit it is shown in, e.g. degrees */
47
+ export declare function shownJointValue(value: number, unit: JointUnit): number;
48
+ /** A joint value as shown, e.g. "35.2°" */
49
+ export declare function formatJointValue(value: number, unit: JointUnit): string;
50
+ /**
51
+ * A joint limit as shown below its track, with its sign: whole in degrees and
52
+ * mm, e.g. "+185°", with two decimals in radians. Halves round away from
53
+ * zero, so symmetric limits stay symmetric.
54
+ */
55
+ export declare function formatJointLimit(value: number, unit: JointUnit): string;
@@ -0,0 +1,48 @@
1
+ import type { JogDirection } from "../jogHandle";
2
+ /** A held joint slider: its goal, and which way the joint jogs to it (null: there) */
3
+ export type JointHold = {
4
+ goal: number;
5
+ direction: JogDirection | null;
6
+ /**
7
+ * The goal the joint last stopped at, while it stands there: the pointer
8
+ * must move away from it to jog the joint again
9
+ */
10
+ settledAt: number | null;
11
+ /** What holds it: a pointer (by its id) or an arrow key (by its key) */
12
+ by: {
13
+ pointer: number;
14
+ } | {
15
+ key: string;
16
+ };
17
+ };
18
+ export type JointJogHoldOptions = {
19
+ /** The joint's live value */
20
+ value: number;
21
+ onJogStart: (direction: JogDirection) => void;
22
+ onJogStop: () => void;
23
+ disabled: boolean;
24
+ };
25
+ /**
26
+ * Holding a joint slider: the joint jogs toward the goal while the slider is
27
+ * held, and stops when it gets there (still held: a new goal jogs it on) or
28
+ * when the hold ends. One hold at a time: a second pointer or key is ignored.
29
+ *
30
+ * Every way a hold can end without a release reaching the slider stops it:
31
+ * becoming disabled, the window losing focus, the tab being hidden, unmount
32
+ * (shared with the other jog controls: see holdSafety).
33
+ * The hold is recorded before the app is called, so a failing onJogStart
34
+ * still gets its onJogStop.
35
+ */
36
+ export declare function useJointJogHold({ value, onJogStart, onJogStop, disabled, }: JointJogHoldOptions): {
37
+ hold: JointHold | null;
38
+ isHolding: () => boolean;
39
+ heldBy: () => {
40
+ pointer: number;
41
+ } | {
42
+ key: string;
43
+ } | null;
44
+ begin: (goal: number, deadband: number, by: JointHold["by"]) => boolean;
45
+ moveGoal: (goal: number, deadband: number) => void;
46
+ end: () => void;
47
+ endIfHeldBy: (match: (by: JointHold["by"]) => boolean) => void;
48
+ };
@@ -0,0 +1,38 @@
1
+ import { type FocusEvent, type KeyboardEvent, type PointerEvent } from "react";
2
+ import { preventContextMenu } from "./holdSafety";
3
+ export type HoldOptions<T> = {
4
+ /** A control was pressed: act on `target` until `onStop` */
5
+ onStart: (target: T) => void;
6
+ onStop: () => void;
7
+ disabled?: boolean;
8
+ /** Whether two targets are the same control */
9
+ isSame: (a: T, b: T) => boolean;
10
+ };
11
+ /**
12
+ * Press-and-hold for a set of controls that move the robot: the motion runs
13
+ * exactly as long as one control is held, by pointer or by Space/Enter.
14
+ *
15
+ * Only one runs at a time; pressing a second control while one is held does
16
+ * nothing. Every way a hold can end (release, cancel, lost pointer capture,
17
+ * a move with the primary button up, blur, another key pressed, the window
18
+ * losing focus, the tab being hidden, becoming disabled, unmount) stops it,
19
+ * and stops it once. Pointer capture keeps a drag off the control from
20
+ * leaving the robot moving. The controls can be any element, e.g. buttons or
21
+ * the handles of a gizmo. The safety rules are shared with the joint slider:
22
+ * see holdSafety.
23
+ */
24
+ export declare function useHold<T>({ onStart, onStop, disabled, isSame, }: HoldOptions<T>): {
25
+ held: T | null;
26
+ handlersFor: (target: T) => {
27
+ onPointerDown: (event: PointerEvent<Element>) => void;
28
+ onPointerMove: (event: PointerEvent<Element>) => void;
29
+ onPointerUp: () => void;
30
+ onPointerCancel: () => void;
31
+ onLostPointerCapture: () => void;
32
+ onKeyDown: (event: KeyboardEvent<Element>) => void;
33
+ onKeyUp: (event: KeyboardEvent<Element>) => void;
34
+ onBlur: (_event: FocusEvent<Element>) => void;
35
+ onContextMenu: typeof preventContextMenu;
36
+ };
37
+ stop: () => void;
38
+ };
@@ -0,0 +1,45 @@
1
+ import { type JogAxis, type JogDirection, type JogHandle } from "./jogHandle";
2
+ /**
3
+ * The props that every set of jog controls takes (JoggingGizmo,
4
+ * JoggingButtons), so an app wires them the same way and can show both
5
+ */
6
+ export type JogControlsProps = {
7
+ /**
8
+ * Whether the controls move the robot along the axes or turn it about
9
+ * them. Defaults to `"translate"`. A jog that runs when it changes stops.
10
+ */
11
+ motion?: "translate" | "rotate";
12
+ /**
13
+ * A control was pressed: jog along `axis` (or about it, in `"rotate"`
14
+ * motion) until `onJogStop`
15
+ */
16
+ onJogStart: (axis: JogAxis, direction: JogDirection) => void;
17
+ /** The held control was let go */
18
+ onJogStop: () => void;
19
+ /** Shows a control as pressed while it is not held, e.g. a running step */
20
+ activeHandle?: JogHandle | null;
21
+ disabled?: boolean;
22
+ };
23
+ /**
24
+ * Hold-to-jog for a set of jog controls, one per jog handle (e.g. X+): see
25
+ * {@link useHold} for how a hold starts and ends. A change of the motion also
26
+ * ends it: a translation must not go on as a rotation.
27
+ */
28
+ export declare function useJogControls({ motion, onJogStart, onJogStop, activeHandle, disabled, }: JogControlsProps): {
29
+ held: JogHandle | null;
30
+ handlersFor: (target: JogHandle) => {
31
+ onPointerDown: (event: import("react").PointerEvent<Element>) => void;
32
+ onPointerMove: (event: import("react").PointerEvent<Element>) => void;
33
+ onPointerUp: () => void;
34
+ onPointerCancel: () => void;
35
+ onLostPointerCapture: () => void;
36
+ onKeyDown: (event: import("react").KeyboardEvent<Element>) => void;
37
+ onKeyUp: (event: import("react").KeyboardEvent<Element>) => void;
38
+ onBlur: (_event: import("react").FocusEvent<Element>) => void;
39
+ onContextMenu: typeof import("./holdSafety").preventContextMenu;
40
+ };
41
+ /** The accessible name of a control, e.g. "Jog X+", or "Jog Rx+" rotating */
42
+ label: (handle: JogHandle) => string;
43
+ /** Whether a control shows as pressed: while it is held or shown as active */
44
+ isPressed: (handle: JogHandle) => boolean;
45
+ };
@@ -0,0 +1,21 @@
1
+ import { type JogView } from "./JogArea";
2
+ import { type JogMode } from "./JogModeToggle";
3
+ import type { JogMotion, RobotControlPanelProps } from "./RobotControlPanel";
4
+ /** The panel's settings of a jog tab, kept while the tabs change */
5
+ export type CartesianJogSettings = {
6
+ mode: JogMode;
7
+ view: JogView;
8
+ /** The chosen step size of each motion, as an index into its steps */
9
+ step: Record<JogMotion, number>;
10
+ };
11
+ type CartesianJogTabProps = Omit<RobotControlPanelProps, "onClose" | "joints"> & {
12
+ motion: JogMotion;
13
+ settings: CartesianJogSettings;
14
+ onSettingsChange: (settings: CartesianJogSettings) => void;
15
+ };
16
+ /**
17
+ * The Translate and Rotate tabs: the TCP and the frame to jog along, the
18
+ * jog mode, velocity and step size, and the gizmo or the buttons
19
+ */
20
+ export declare function CartesianJogTab({ motion, settings, onSettingsChange, disabled, tcp, jogFrame, velocity, onVelocityChange, onJogStart, onJogStop, increments, gizmoOrientation, gizmoFrameQuaternion, }: CartesianJogTabProps): import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -0,0 +1,25 @@
1
+ import { type RefObject } from "react";
2
+ import type { RobotControlMoveState } from "./RobotControlPanel";
3
+ type HoldToMoveButtonProps = {
4
+ state: RobotControlMoveState;
5
+ /** A target the app could plan */
6
+ ready: boolean;
7
+ /** The TCP stands at the target */
8
+ atPose: boolean;
9
+ disabled: boolean;
10
+ onMoveStart: () => void;
11
+ onMoveStop: () => void;
12
+ /** Gets the function that ends a hold, e.g. before the target goes */
13
+ stopRef?: RefObject<(() => void) | null>;
14
+ };
15
+ /**
16
+ * The Move to button, as RobotPad's: held for 200 ms while the move is
17
+ * planned, it starts it, and the release pauses it. It says Moving… and
18
+ * Stopping…, and cannot move to the pose the TCP stands at. Every other way
19
+ * a hold ends stops the move as well (the safety rules of every hold-to-jog
20
+ * control, see useHold). At the target the hold goes on, as in RobotPad,
21
+ * until the release: the hold sits on the wrapper, which keeps the pointer
22
+ * while the button turns off.
23
+ */
24
+ export declare function HoldToMoveButton({ state, ready, atPose, disabled, onMoveStart, onMoveStop, stopRef, }: HoldToMoveButtonProps): import("react/jsx-runtime").JSX.Element;
25
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { RefObject } from "react";
2
+ import type { Quaternion } from "three";
3
+ import type { JogControlsProps } from "../jogging/useJogControls";
4
+ import type { JogMode } from "./JogModeToggle";
5
+ /** Which jog controls the jog area shows */
6
+ export type JogView = "gizmo" | "buttons";
7
+ type JogAreaProps = {
8
+ view: JogView;
9
+ onViewChange: (view: JogView) => void;
10
+ mode: JogMode;
11
+ /** The props of the gizmo or the buttons, whichever is shown */
12
+ controls: JogControlsProps;
13
+ /** Without it, there is no gizmo: the buttons, and no switch */
14
+ gizmoOrientation?: RefObject<Quaternion | null>;
15
+ gizmoFrameQuaternion?: Quaternion | (() => Quaternion);
16
+ };
17
+ /**
18
+ * Where the jog controls go: the gizmo or the buttons, a switch between the
19
+ * two in the corner, and a hint saying how to jog with what is shown
20
+ */
21
+ export declare function JogArea({ view, onViewChange, mode, controls, gizmoOrientation, gizmoFrameQuaternion, }: JogAreaProps): import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -0,0 +1,8 @@
1
+ /** Jogging while a control is held, or one step per press */
2
+ export type JogMode = "continuous" | "increment";
3
+ /** Continuous or Increment jogging: one of the two is always selected */
4
+ export declare function JogModeToggle({ value, onChange, disabled, }: {
5
+ value: JogMode;
6
+ onChange: (value: JogMode) => void;
7
+ disabled: boolean;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { RobotControlJoints } from "./RobotControlPanel";
2
+ /**
3
+ * The Joint tab: a slider per joint across its limits, and the velocity.
4
+ * One joint jogs at a time: the jogging joint is kept in a ref, which
5
+ * changes at once, so a second finger on another slider in the same frame
6
+ * jogs nothing; the other sliders show as unavailable meanwhile.
7
+ */
8
+ export declare function JointJogTab({ joints, disabled, }: {
9
+ joints: RobotControlJoints;
10
+ disabled: boolean;
11
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import type { RobotControlMoveTo, RobotControlSelect, RobotControlVelocity } from "./RobotControlPanel";
2
+ type MoveToTabProps = {
3
+ moveTo: RobotControlMoveTo;
4
+ tcp?: RobotControlSelect;
5
+ velocity: RobotControlVelocity;
6
+ onVelocityChange: (value: number) => void;
7
+ disabled: boolean;
8
+ };
9
+ /**
10
+ * The Move to tab: the TCP, the target pose and the frame it is relative to,
11
+ * the velocity, and the Move to button, off until a typed pose is the
12
+ * target; Reset shows with a target. It works as RobotPad's pose field and its TargetPoseStore: the
13
+ * field shows the TCP's current pose until a typed pose is saved; a move
14
+ * that took the TCP there ends with the current pose shown again, once the
15
+ * button is let go; another tab shows it again as well.
16
+ */
17
+ export declare function MoveToTab({ moveTo, tcp, velocity, onVelocityChange, disabled, }: MoveToTabProps): import("react/jsx-runtime").JSX.Element;
18
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { RobotControlOption } from "./RobotControlPanel";
2
+ type SelectProps = {
3
+ label: string;
4
+ options: RobotControlOption[];
5
+ value: string;
6
+ onChange: (id: string) => void;
7
+ disabled: boolean;
8
+ };
9
+ /** A select of the panel with its label inside, e.g. the TCP */
10
+ export declare function PanelSelect({ label, options, value, onChange, disabled, }: SelectProps): import("react/jsx-runtime").JSX.Element;
11
+ /** A select with its label to the left of it, e.g. the step size */
12
+ export declare function InlineSelect({ label, options, value, onChange, disabled, }: SelectProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,21 @@
1
+ type PoseFieldProps = {
2
+ /** The text shown: the draft while editing, else the target or the live pose */
3
+ text: string;
4
+ editing: boolean;
5
+ onEdit: () => void;
6
+ onDraftChange: (text: string) => void;
7
+ onCancel: () => void;
8
+ onConfirm: () => void;
9
+ /** Whether the draft can be saved now */
10
+ canConfirm: boolean;
11
+ error: string | null;
12
+ /** No editing: the robot may not move */
13
+ disabled: boolean;
14
+ };
15
+ /**
16
+ * The coordinates field of the Move to tab, as RobotPad's EditablePoseField:
17
+ * it shows a pose to copy; Edit pose, or a click on it, makes it editable;
18
+ * Save pose edit (Enter) and Cancel (Escape) end the editing
19
+ */
20
+ export declare function PoseField({ text, editing, onEdit, onDraftChange, onCancel, onConfirm, canConfirm, error, disabled, }: PoseFieldProps): import("react/jsx-runtime").JSX.Element;
21
+ export {};