@wandelbots/wandelbots-js-react-components 6.3.0 → 6.4.0

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 (91) hide show
  1. package/README.md +185 -124
  2. package/dist/3d.cjs +1 -1
  3. package/dist/3d.d.ts +0 -3
  4. package/dist/3d.js +16 -21
  5. package/dist/SafetyBar/index.cjs +1 -1
  6. package/dist/SafetyBar/index.js +1 -1
  7. package/dist/chunks/ConnectedMotionGroup-BewSDQvD.cjs +4 -0
  8. package/dist/chunks/ConnectedMotionGroup-D6-4wBkk.js +2654 -0
  9. package/dist/chunks/Robot-C0uICTOn.js +1271 -0
  10. package/dist/chunks/Robot-D6RUDXEz.cjs +1 -0
  11. package/dist/chunks/{SafetyBar-Cy9DiXp9.js → SafetyBar-C2-H1ifP.js} +1 -1
  12. package/dist/chunks/{SafetyBar-DPrv_OQA.cjs → SafetyBar-Cq_WsuK2.cjs} +1 -1
  13. package/dist/chunks/externalizeComponent-Bue3-Wra.cjs +2 -0
  14. package/dist/chunks/{externalizeComponent-EDymnaGR.js → externalizeComponent-C0cVcPE2.js} +29 -107
  15. package/dist/chunks/useSmoothedMotionState-COMJRcOt.js +214 -0
  16. package/dist/chunks/useSmoothedMotionState-Con0E5Bx.cjs +1 -0
  17. package/dist/components/AppHeader.d.ts +1 -1
  18. package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +1 -1
  19. package/dist/components/jogging/JoggingJointTab.d.ts +1 -1
  20. package/dist/components/jogging/JoggingPanel.d.ts +6 -3
  21. package/dist/components/jogging/JoggingStore.d.ts +5 -1
  22. package/dist/components/jogging/joggingColors.d.ts +18 -0
  23. package/dist/components/robots/GenericRobot.d.ts +2 -1
  24. package/dist/components/robots/LinearAxis.d.ts +1 -1
  25. package/dist/components/robots/LinearAxisAnimator.d.ts +11 -2
  26. package/dist/components/robots/Robot.d.ts +1 -1
  27. package/dist/components/robots/robotModelLogic.d.ts +11 -9
  28. package/dist/components/utils/hooks.d.ts +1 -6
  29. package/dist/core.cjs +1 -1
  30. package/dist/core.d.ts +3 -18
  31. package/dist/core.js +27 -54
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.js +39 -71
  34. package/dist/lib/ConnectedMotionGroup.d.ts +5 -7
  35. package/dist/lib/JoggerConnection.d.ts +29 -5
  36. package/dist/lib/MotionStreamConnection.d.ts +4 -6
  37. package/dist/lib/novaConnection.d.ts +23 -0
  38. package/package.json +31 -66
  39. package/dist/Setup.d.ts +0 -11
  40. package/dist/chunks/MotionGroupVisualizer-DshWR1wY.js +0 -1653
  41. package/dist/chunks/MotionGroupVisualizer-eD7yFEcF.cjs +0 -1
  42. package/dist/chunks/externalizeComponent-OO4jcrz5.cjs +0 -2
  43. package/dist/chunks/theming-DfSy4-Ic.cjs +0 -4
  44. package/dist/chunks/theming-mF9Rt8SS.js +0 -5542
  45. package/dist/chunks/useSmoothedMotionState-DyDgSVYX.js +0 -478
  46. package/dist/chunks/useSmoothedMotionState-VYxEIyfr.cjs +0 -1
  47. package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +0 -11
  48. package/dist/components/AdornedTextField.d.ts +0 -7
  49. package/dist/components/CopyableText.d.ts +0 -6
  50. package/dist/components/CycleTimer/CycleTimer.d.ts +0 -3
  51. package/dist/components/CycleTimer/DefaultVariant.d.ts +0 -9
  52. package/dist/components/CycleTimer/SmallVariant.d.ts +0 -10
  53. package/dist/components/CycleTimer/index.d.ts +0 -27
  54. package/dist/components/CycleTimer/types.d.ts +0 -49
  55. package/dist/components/CycleTimer/useAnimations.d.ts +0 -14
  56. package/dist/components/CycleTimer/useTimerLogic.d.ts +0 -24
  57. package/dist/components/CycleTimer/utils.d.ts +0 -21
  58. package/dist/components/CycleTimer.d.ts +0 -3
  59. package/dist/components/DataGrid.d.ts +0 -66
  60. package/dist/components/LogPanel.d.ts +0 -38
  61. package/dist/components/LogStore.d.ts +0 -12
  62. package/dist/components/LogViewer.d.ts +0 -46
  63. package/dist/components/ProgramControl.d.ts +0 -55
  64. package/dist/components/ProgramStateIndicator.d.ts +0 -26
  65. package/dist/components/RobotCard.d.ts +0 -98
  66. package/dist/components/RobotListItem.d.ts +0 -34
  67. package/dist/components/RobotSetupReadinessIndicator.d.ts +0 -37
  68. package/dist/components/SelectableFab.d.ts +0 -7
  69. package/dist/components/TabBar.d.ts +0 -45
  70. package/dist/components/ThemeSelect.d.ts +0 -6
  71. package/dist/components/Timer/Timer.d.ts +0 -3
  72. package/dist/components/Timer/TimerDefaultVariant.d.ts +0 -9
  73. package/dist/components/Timer/TimerSmallVariant.d.ts +0 -10
  74. package/dist/components/Timer/index.d.ts +0 -19
  75. package/dist/components/Timer/types.d.ts +0 -35
  76. package/dist/components/Timer/useTimerAnimations.d.ts +0 -10
  77. package/dist/components/Timer/useTimerLogic.d.ts +0 -19
  78. package/dist/components/Timer/utils.d.ts +0 -17
  79. package/dist/components/Timer.d.ts +0 -3
  80. package/dist/components/TransparentOverlay.d.ts +0 -4
  81. package/dist/components/jogging/JoggingFreedriveTab.d.ts +0 -1
  82. package/dist/components/jogging/PoseCartesianValues.d.ts +0 -9
  83. package/dist/components/jogging/PoseJointValues.d.ts +0 -8
  84. package/dist/components/robots/AxisConfig.d.ts +0 -2
  85. package/dist/components/robots/manufacturerHomePositions.d.ts +0 -20
  86. package/dist/icons/DropdownArrowIcon.d.ts +0 -2
  87. package/dist/icons/index.d.ts +0 -12
  88. package/dist/lib/novaCompat.d.ts +0 -16
  89. package/dist/themes/createDarkTheme.d.ts +0 -7
  90. package/dist/themes/themeTypes.d.ts +0 -40
  91. package/dist/themes/theming.d.ts +0 -24
@@ -1,10 +1,13 @@
1
1
  import type { SxProps } from "@mui/material/styles";
2
- import type { AnyNovaClient } from "../../lib/novaCompat";
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
- /** Either an existing Nova client or the base url of a deployed Nova instance */
7
- nova: AnyNovaClient | string;
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". */
@@ -114,7 +114,11 @@ export declare class JoggingStore {
114
114
  dispose(): void;
115
115
  get coordSystemCountByName(): import("lodash").Dictionary<number>;
116
116
  deactivate(): Promise<void>;
117
- /** Activate the jogger with current settings */
117
+ /**
118
+ * Activate the jogger with current settings. Resolves when the jogging
119
+ * websocket is initialized, or when the jogging was stopped before that
120
+ * (`deactivate`).
121
+ */
118
122
  activate(): Promise<JoggerConnection>;
119
123
  loadFromLocalStorage(): void;
120
124
  saveToLocalStorage(): void;
@@ -0,0 +1,18 @@
1
+ export interface AxisControlComponentColors {
2
+ color?: string;
3
+ borderColor?: string;
4
+ backgroundColor?: string;
5
+ buttonBackgroundColor?: {
6
+ default?: string;
7
+ pressed?: string;
8
+ disabled?: string;
9
+ hovered?: string;
10
+ };
11
+ labelColor?: string;
12
+ }
13
+ /** Colors of the X, Y and Z axis controls of the cartesian jogging tab */
14
+ export declare const cartesianAxisColors: Record<"X" | "Y" | "Z", AxisControlComponentColors>;
15
+ /** Color of the arrows of the joint jogging controls */
16
+ export declare const jointArrowColor = "rgba(255, 255, 255, 1)";
17
+ /** Color of the velocity legend of the velocity slider */
18
+ export declare const velocitySliderLegendColor = "rgba(255, 255, 255, 1)";
@@ -5,7 +5,8 @@ export type RobotModelProps = {
5
5
  modelURL: string | Promise<string>;
6
6
  /**
7
7
  * Called after a robot model has been loaded and
8
- * rendered into the threejs scene
8
+ * rendered into the threejs scene, when the components above it
9
+ * (RobotAnimator, LinearAxisAnimator) have mounted
9
10
  */
10
11
  postModelRender?: () => void;
11
12
  flangeRef?: React.Ref<Group>;
@@ -15,7 +15,7 @@ export type LinearAxisProps = {
15
15
  *
16
16
  * @param {LinearAxisProps} props - The properties for the LinearAxis component.
17
17
  * @param {ConnectedMotionGroup} props.connectedMotionGroup - The connected motion group containing motion state and parameters.
18
- * @param {Function} [props.getModel=defaultGetModel] - Optional function to get the model URL. Defaults to defaultGetModel.
18
+ * @param {Function} [props.getModel] - Optional function to get the model URL. Defaults to defaultGetModel with the connection of the connected motion group (its URL and access token).
19
19
  * @param {Object} props - Additional properties passed to the underlying component.
20
20
  *
21
21
  * @returns {JSX.Element} The rendered SupportedLinearAxis or DHLinearAxis component.
@@ -1,6 +1,15 @@
1
1
  import type { DHParameter, MotionGroupState } from "@wandelbots/nova-js/v2";
2
2
  import type React from "react";
3
3
  import type { Object3D, Quaternion } from "three";
4
+ export type LinearAxisAnimatorHandle = {
5
+ /**
6
+ * Re-scan the linear axis group for joints and re-apply the current
7
+ * position. Must be called whenever the (async-loaded) model mounts its
8
+ * meshes into the scene, since the group ref callback only fires when the
9
+ * outer group itself mounts — not when its children appear later.
10
+ */
11
+ recollectJoints: () => void;
12
+ };
4
13
  type LinearAxisAnimatorProps = {
5
14
  rapidlyChangingMotionState: MotionGroupState;
6
15
  dhParameters: DHParameter[];
@@ -16,5 +25,5 @@ type LinearAxisAnimatorProps = {
16
25
  * given. If damped/spring transitions are desired, run the motion state
17
26
  * through {@link useSmoothedMotionState} before passing it here.
18
27
  */
19
- export default function LinearAxisAnimator({ rapidlyChangingMotionState, dhParameters, chainOffsetPosition, chainOffsetQuaternion, onTranslationChanged, children, }: LinearAxisAnimatorProps): import("react/jsx-runtime").JSX.Element;
20
- export {};
28
+ declare const LinearAxisAnimator: React.ForwardRefExoticComponent<LinearAxisAnimatorProps & React.RefAttributes<LinearAxisAnimatorHandle>>;
29
+ export default LinearAxisAnimator;
@@ -15,7 +15,7 @@ export type RobotProps = {
15
15
  *
16
16
  * @param {RobotProps} props - The properties for the Robot component.
17
17
  * @param {ConnectedMotionGroup} props.connectedMotionGroup - The connected motion group containing motion state and parameters.
18
- * @param {Function} [props.getModel=defaultGetModel] - Optional function to get the model URL. Defaults to defaultGetModel.
18
+ * @param {Function} [props.getModel] - Optional function to get the model URL. Defaults to defaultGetModel with the connection of the connected motion group (its URL and access token).
19
19
  * @param {Object} props - Additional properties passed to the SupportedRobot component.
20
20
  *
21
21
  * @returns {JSX.Element} The rendered SupportedRobot component.
@@ -1,16 +1,18 @@
1
1
  import type { Object3D } from "three";
2
2
  import type { GLTF } from "three-stdlib";
3
+ import { type NovaConnection } from "../../lib/novaConnection";
3
4
  /**
4
- * Revoke a cached model's object URL to prevent memory leaks.
5
- * Call this when a component unmounts or no longer needs the model.
5
+ * Downloads the GLB model of a motion group model from a NOVA instance and
6
+ * returns an object URL for it. Each model downloads once per instance; after
7
+ * a failed download, the next call downloads it again.
8
+ *
9
+ * @param modelFromController - The motion group model, e.g. `UniversalRobots_UR5e`
10
+ * @param connection - The NOVA instance: its base URL, or a NOVA client of the
11
+ * app (see `NovaConnection`), which also gives the access token of a cloud
12
+ * instance. `Robot` and `LinearAxis` pass the connection of their
13
+ * `ConnectedMotionGroup`.
6
14
  */
7
- export declare function revokeModelUrl(modelFromController: string): Promise<void>;
8
- /**
9
- * Revoke all cached model object URLs and clear the cache.
10
- * Useful for cleanup on app teardown.
11
- */
12
- export declare function revokeAllModelUrls(): Promise<void>;
13
- export declare function defaultGetModel(modelFromController: string, instanceUrlProp?: string): Promise<string>;
15
+ export declare function defaultGetModel(modelFromController: string, connection?: NovaConnection): Promise<string>;
14
16
  /**
15
17
  * Finds all the joint groups in a GLTF tree, as identified
16
18
  * by the _Jxx name ending convention.
@@ -1,4 +1,4 @@
1
- import { autorun, reaction } from "mobx";
1
+ import { autorun } from "mobx";
2
2
  import { type EffectCallback } from "react";
3
3
  /**
4
4
  * Run code once on component mount. Shorthand for useEffect(effect, []).
@@ -9,11 +9,6 @@ export declare function useMounted(effect: EffectCallback): void;
9
9
  * clean it up when the component unmounts.
10
10
  */
11
11
  export declare function useAutorun(view: Parameters<typeof autorun>[0]): void;
12
- /**
13
- * Initialize a mobx reaction watcher on component mount, and
14
- * clean it up when the component unmounts.
15
- */
16
- export declare function useReaction<T>(expression: Parameters<typeof reaction<T>>[0], effect: Parameters<typeof reaction<T>>[1], opts?: Parameters<typeof reaction<T>>[2]): void;
17
12
  /**
18
13
  * Run a callback on every animation frame. Cleans up
19
14
  * after component unmount.
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/theming-DfSy4-Ic.cjs"),o=require("./chunks/useSmoothedMotionState-VYxEIyfr.cjs"),t=require("./chunks/externalizeComponent-OO4jcrz5.cjs"),a=require("./chunks/SafetyBar-DPrv_OQA.cjs");exports.AdornedTextField=e.AdornedTextField;exports.AppHeader=e.AppHeader;exports.ConnectedMotionGroup=e.ConnectedMotionGroup;exports.CycleTimer=e.CycleTimer;exports.JoggerConnection=e.JoggerConnection;exports.JoggingCartesianAxisControl=e.JoggingCartesianAxisControl;exports.JoggingJointValueControl=e.JoggingJointValueControl;exports.JoggingPanel=e.JoggingPanel;exports.JoggingStore=e.JoggingStore;exports.LoadingCover=e.LoadingCover;exports.LoadingErrorMessage=e.LoadingErrorMessage;exports.LogPanel=e.LogPanel;exports.LogStore=e.LogStore;exports.LogViewer=e.LogViewer;exports.MotionStreamConnection=e.MotionStreamConnection;exports.NoMotionGroupModal=e.NoMotionGroupModal;exports.PoseCartesianValues=e.PoseCartesianValues;exports.PoseJointValues=e.PoseJointValues;exports.RobotListItem=e.RobotListItem;exports.RobotSetupReadinessIndicator=e.RobotSetupReadinessIndicator;exports.RobotSetupReadinessState=e.RobotSetupReadinessState;exports.SelectableFab=e.SelectableFab;exports.TabBar=e.TabBar;exports.Timer=e.Timer;exports.VelocitySlider=e.VelocitySlider;exports.VelocitySliderLabel=e.VelocitySliderLabel;exports.WandelbotsDataGrid=e.WandelbotsDataGrid;exports.createDebugMessage=e.createDebugMessage;exports.createErrorMessage=e.createErrorMessage;exports.createInfoMessage=e.createInfoMessage;exports.createLogMessage=e.createLogMessage;exports.createNovaMuiTheme=e.createNovaMuiTheme;exports.createNovaTheme=e.createNovaTheme;exports.createWarningMessage=e.createWarningMessage;exports.jointValuesEqual=e.jointValuesEqual;exports.poseEqual=e.poseEqual;exports.tcpMotionEqual=e.tcpMotionEqual;exports.unwrapRotationVector=e.unwrapRotationVector;exports.ProgramControl=o.ProgramControl;exports.ProgramState=o.ProgramState;exports.ProgramStateIndicator=o.ProgramStateIndicator;exports.ValueInterpolator=o.ValueInterpolator;exports.useAnimationFrame=o.useAnimationFrame;exports.useAutorun=o.useAutorun;exports.useInterpolation=o.useInterpolation;exports.useMounted=o.useMounted;exports.useReaction=o.useReaction;exports.useSmoothedMotionState=o.useSmoothedMotionState;exports.i18n=t.i18n;exports.SafetyBar=a.SafetyBar;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@wandelbots/mui");const o=require("./chunks/ConnectedMotionGroup-BewSDQvD.cjs"),e=require("./chunks/useSmoothedMotionState-Con0E5Bx.cjs"),t=require("./chunks/externalizeComponent-Bue3-Wra.cjs"),n=require("./chunks/SafetyBar-Cq_WsuK2.cjs");exports.AppHeader=o.AppHeader;exports.ConnectedMotionGroup=o.ConnectedMotionGroup;exports.JoggerConnection=o.JoggerConnection;exports.JoggingCartesianAxisControl=o.JoggingCartesianAxisControl;exports.JoggingJointValueControl=o.JoggingJointValueControl;exports.JoggingPanel=o.JoggingPanel;exports.JoggingStore=o.JoggingStore;exports.LoadingCover=o.LoadingCover;exports.LoadingErrorMessage=o.LoadingErrorMessage;exports.MotionStreamConnection=o.MotionStreamConnection;exports.NoMotionGroupModal=o.NoMotionGroupModal;exports.VelocitySlider=o.VelocitySlider;exports.VelocitySliderLabel=o.VelocitySliderLabel;exports.jointValuesEqual=o.jointValuesEqual;exports.poseEqual=o.poseEqual;exports.tcpMotionEqual=o.tcpMotionEqual;exports.unwrapRotationVector=o.unwrapRotationVector;exports.ValueInterpolator=e.ValueInterpolator;exports.useInterpolation=e.useInterpolation;exports.useSmoothedMotionState=e.useSmoothedMotionState;exports.i18n=t.i18n;exports.SafetyBar=n.SafetyBar;
package/dist/core.d.ts CHANGED
@@ -1,26 +1,12 @@
1
- export * from "./components/AdornedTextField";
1
+ import "@wandelbots/mui";
2
2
  export * from "./components/AppHeader";
3
- export * from "./components/CycleTimer";
4
- export * from "./components/DataGrid";
5
3
  export * from "./components/jogging/JoggingCartesianAxisControl";
4
+ export type { AxisControlComponentColors } from "./components/jogging/joggingColors";
6
5
  export * from "./components/jogging/JoggingJointValueControl";
7
6
  export * from "./components/jogging/JoggingPanel";
8
7
  export { JoggingStore } from "./components/jogging/JoggingStore";
9
- export * from "./components/jogging/PoseCartesianValues";
10
- export * from "./components/jogging/PoseJointValues";
11
8
  export * from "./components/LoadingCover";
12
- export * from "./components/LogPanel";
13
- export { LogStore } from "./components/LogStore";
14
- export * from "./components/LogViewer";
15
9
  export * from "./components/modal/NoMotionGroupModal";
16
- export * from "./components/ProgramControl";
17
- export * from "./components/ProgramStateIndicator";
18
- export * from "./components/RobotListItem";
19
- export * from "./components/RobotSetupReadinessIndicator";
20
- export * from "./components/SelectableFab";
21
- export * from "./components/TabBar";
22
- export * from "./components/Timer";
23
- export * from "./components/utils/hooks";
24
10
  export * from "./components/utils/interpolation";
25
11
  export * from "./components/utils/useSmoothedMotionState";
26
12
  export * from "./components/VelocitySlider";
@@ -29,6 +15,5 @@ export * from "./lib/ConnectedMotionGroup";
29
15
  export * from "./lib/JoggerConnection";
30
16
  export * from "./lib/motionStateUpdate";
31
17
  export * from "./lib/MotionStreamConnection";
18
+ export type { NovaConnection } from "./lib/novaConnection";
32
19
  export * from "./SafetyBar";
33
- export * from "./themes/themeTypes";
34
- export { createNovaTheme, createNovaMuiTheme } from "./themes/theming";
package/dist/core.js CHANGED
@@ -1,56 +1,29 @@
1
- import { A as o, a as s, C as t, b as r, J as n, c as i, d as g, e as l, f as u, L as c, g as d, h as m, i as p, j as S, M, N as b, P as C, k as V, R as L, l as P, m as f, S as J, T as R, n as x, V as T, o as A, W as I, p as y, q as E, r as h, s as q, t as v, u as N, v as w, w as F, x as G, y as W, z as j } from "./chunks/theming-mF9Rt8SS.js";
2
- import { P as D, a as k, b as z, V as H, u as K, c as O, d as Q, e as U, f as X, g as Y } from "./chunks/useSmoothedMotionState-DyDgSVYX.js";
3
- import { i as _ } from "./chunks/externalizeComponent-EDymnaGR.js";
4
- import { S as aa } from "./chunks/SafetyBar-Cy9DiXp9.js";
1
+ import "@wandelbots/mui";
2
+ import { A as t, C as n, J as r, a as s, b as i, c as g, d as l, L as p, e as u, M as d, N as c, V as C, f as M, j as S, p as V, t as m, u as J } from "./chunks/ConnectedMotionGroup-D6-4wBkk.js";
3
+ import { V as x, u as E, a as L } from "./chunks/useSmoothedMotionState-COMJRcOt.js";
4
+ import { i as y } from "./chunks/externalizeComponent-C0cVcPE2.js";
5
+ import { S as b } from "./chunks/SafetyBar-C2-H1ifP.js";
5
6
  export {
6
- o as AdornedTextField,
7
- s as AppHeader,
8
- t as ConnectedMotionGroup,
9
- r as CycleTimer,
10
- n as JoggerConnection,
11
- i as JoggingCartesianAxisControl,
12
- g as JoggingJointValueControl,
13
- l as JoggingPanel,
14
- u as JoggingStore,
15
- c as LoadingCover,
16
- d as LoadingErrorMessage,
17
- m as LogPanel,
18
- p as LogStore,
19
- S as LogViewer,
20
- M as MotionStreamConnection,
21
- b as NoMotionGroupModal,
22
- C as PoseCartesianValues,
23
- V as PoseJointValues,
24
- D as ProgramControl,
25
- k as ProgramState,
26
- z as ProgramStateIndicator,
27
- L as RobotListItem,
28
- P as RobotSetupReadinessIndicator,
29
- f as RobotSetupReadinessState,
30
- aa as SafetyBar,
31
- J as SelectableFab,
32
- R as TabBar,
33
- x as Timer,
34
- H as ValueInterpolator,
35
- T as VelocitySlider,
36
- A as VelocitySliderLabel,
37
- I as WandelbotsDataGrid,
38
- y as createDebugMessage,
39
- E as createErrorMessage,
40
- h as createInfoMessage,
41
- q as createLogMessage,
42
- v as createNovaMuiTheme,
43
- N as createNovaTheme,
44
- w as createWarningMessage,
45
- _ as i18n,
46
- F as jointValuesEqual,
47
- G as poseEqual,
48
- W as tcpMotionEqual,
49
- j as unwrapRotationVector,
50
- K as useAnimationFrame,
51
- O as useAutorun,
52
- Q as useInterpolation,
53
- U as useMounted,
54
- X as useReaction,
55
- Y as useSmoothedMotionState
7
+ t as AppHeader,
8
+ n as ConnectedMotionGroup,
9
+ r as JoggerConnection,
10
+ s as JoggingCartesianAxisControl,
11
+ i as JoggingJointValueControl,
12
+ g as JoggingPanel,
13
+ l as JoggingStore,
14
+ p as LoadingCover,
15
+ u as LoadingErrorMessage,
16
+ d as MotionStreamConnection,
17
+ c as NoMotionGroupModal,
18
+ b as SafetyBar,
19
+ x as ValueInterpolator,
20
+ C as VelocitySlider,
21
+ M as VelocitySliderLabel,
22
+ y as i18n,
23
+ S as jointValuesEqual,
24
+ V as poseEqual,
25
+ m as tcpMotionEqual,
26
+ J as unwrapRotationVector,
27
+ E as useInterpolation,
28
+ L as useSmoothedMotionState
56
29
  };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./chunks/MotionGroupVisualizer-eD7yFEcF.cjs"),t=require("./chunks/useSmoothedMotionState-VYxEIyfr.cjs"),e=require("./chunks/theming-DfSy4-Ic.cjs"),r=require("./chunks/externalizeComponent-OO4jcrz5.cjs"),a=require("./chunks/SafetyBar-DPrv_OQA.cjs");exports.CollisionSceneRenderer=o.CollisionSceneRenderer;exports.JointLimitGizmo=o.JointLimitGizmo;exports.LinearAxis=o.LinearAxis;exports.MANUFACTURER_HOME_CONFIGS=o.MANUFACTURER_HOME_CONFIGS;exports.MotionGroupVisualizer=o.MotionGroupVisualizer;exports.MotionGroupVisualizerExact=o.MotionGroupVisualizerExact;exports.PresetEnvironment=o.PresetEnvironment;exports.Robot=o.Robot;exports.RobotCard=o.RobotCard;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedLinearAxisExact=o.SupportedLinearAxisExact;exports.SupportedRobot=o.SupportedRobot;exports.SupportedRobotExact=o.SupportedRobotExact;exports.TrajectoryRenderer=o.TrajectoryRenderer;exports.defaultAxisConfig=o.defaultAxisConfig;exports.defaultGetModel=o.defaultGetModel;exports.extractManufacturer=o.extractManufacturer;exports.getDefaultHomeConfig=o.getDefaultHomeConfig;exports.ProgramControl=t.ProgramControl;exports.ProgramState=t.ProgramState;exports.ProgramStateIndicator=t.ProgramStateIndicator;exports.ValueInterpolator=t.ValueInterpolator;exports.useAnimationFrame=t.useAnimationFrame;exports.useAutorun=t.useAutorun;exports.useInterpolation=t.useInterpolation;exports.useMounted=t.useMounted;exports.useReaction=t.useReaction;exports.useSmoothedMotionState=t.useSmoothedMotionState;exports.AdornedTextField=e.AdornedTextField;exports.AppHeader=e.AppHeader;exports.ConnectedMotionGroup=e.ConnectedMotionGroup;exports.CycleTimer=e.CycleTimer;exports.JoggerConnection=e.JoggerConnection;exports.JoggingCartesianAxisControl=e.JoggingCartesianAxisControl;exports.JoggingJointValueControl=e.JoggingJointValueControl;exports.JoggingPanel=e.JoggingPanel;exports.JoggingStore=e.JoggingStore;exports.LoadingCover=e.LoadingCover;exports.LoadingErrorMessage=e.LoadingErrorMessage;exports.LogPanel=e.LogPanel;exports.LogStore=e.LogStore;exports.LogViewer=e.LogViewer;exports.MotionStreamConnection=e.MotionStreamConnection;exports.NoMotionGroupModal=e.NoMotionGroupModal;exports.PoseCartesianValues=e.PoseCartesianValues;exports.PoseJointValues=e.PoseJointValues;exports.RobotListItem=e.RobotListItem;exports.RobotSetupReadinessIndicator=e.RobotSetupReadinessIndicator;exports.RobotSetupReadinessState=e.RobotSetupReadinessState;exports.SelectableFab=e.SelectableFab;exports.TabBar=e.TabBar;exports.Timer=e.Timer;exports.VelocitySlider=e.VelocitySlider;exports.VelocitySliderLabel=e.VelocitySliderLabel;exports.WandelbotsDataGrid=e.WandelbotsDataGrid;exports.createDebugMessage=e.createDebugMessage;exports.createErrorMessage=e.createErrorMessage;exports.createInfoMessage=e.createInfoMessage;exports.createLogMessage=e.createLogMessage;exports.createNovaMuiTheme=e.createNovaMuiTheme;exports.createNovaTheme=e.createNovaTheme;exports.createWarningMessage=e.createWarningMessage;exports.jointValuesEqual=e.jointValuesEqual;exports.poseEqual=e.poseEqual;exports.tcpMotionEqual=e.tcpMotionEqual;exports.unwrapRotationVector=e.unwrapRotationVector;exports.i18n=r.i18n;exports.SafetyBar=a.SafetyBar;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Robot-D6RUDXEz.cjs"),t=require("./chunks/useSmoothedMotionState-Con0E5Bx.cjs");require("@wandelbots/mui");const o=require("./chunks/ConnectedMotionGroup-BewSDQvD.cjs"),n=require("./chunks/externalizeComponent-Bue3-Wra.cjs"),r=require("./chunks/SafetyBar-Cq_WsuK2.cjs");exports.CollisionSceneRenderer=e.CollisionSceneRenderer;exports.JointLimitGizmo=e.JointLimitGizmo;exports.LinearAxis=e.LinearAxis;exports.MotionGroupVisualizer=e.MotionGroupVisualizer;exports.MotionGroupVisualizerExact=e.MotionGroupVisualizerExact;exports.PresetEnvironment=e.PresetEnvironment;exports.Robot=e.Robot;exports.SafetyZonesRenderer=e.SafetyZonesRenderer;exports.SupportedLinearAxis=e.SupportedLinearAxis;exports.SupportedLinearAxisExact=e.SupportedLinearAxisExact;exports.SupportedRobot=e.SupportedRobot;exports.SupportedRobotExact=e.SupportedRobotExact;exports.TrajectoryRenderer=e.TrajectoryRenderer;exports.defaultGetModel=e.defaultGetModel;exports.ValueInterpolator=t.ValueInterpolator;exports.useInterpolation=t.useInterpolation;exports.useSmoothedMotionState=t.useSmoothedMotionState;exports.AppHeader=o.AppHeader;exports.ConnectedMotionGroup=o.ConnectedMotionGroup;exports.JoggerConnection=o.JoggerConnection;exports.JoggingCartesianAxisControl=o.JoggingCartesianAxisControl;exports.JoggingJointValueControl=o.JoggingJointValueControl;exports.JoggingPanel=o.JoggingPanel;exports.JoggingStore=o.JoggingStore;exports.LoadingCover=o.LoadingCover;exports.LoadingErrorMessage=o.LoadingErrorMessage;exports.MotionStreamConnection=o.MotionStreamConnection;exports.NoMotionGroupModal=o.NoMotionGroupModal;exports.VelocitySlider=o.VelocitySlider;exports.VelocitySliderLabel=o.VelocitySliderLabel;exports.jointValuesEqual=o.jointValuesEqual;exports.poseEqual=o.poseEqual;exports.tcpMotionEqual=o.tcpMotionEqual;exports.unwrapRotationVector=o.unwrapRotationVector;exports.i18n=n.i18n;exports.SafetyBar=r.SafetyBar;
package/dist/index.js CHANGED
@@ -1,76 +1,44 @@
1
- import { C as o, J as s, L as t, M as r, a as n, b as i, P as u, R as g, c as l, S as d, d as c, e as p, f as S, g as m, T as M, h as C, i as R, j as f, k as b } from "./chunks/MotionGroupVisualizer-DshWR1wY.js";
2
- import { P as L, a as V, b as A, V as E, u as P, c as J, d as T, e as G, f as y, g as I } from "./chunks/useSmoothedMotionState-DyDgSVYX.js";
3
- import { A as h, a as v, C as F, b as j, J as q, c as z, d as w, e as D, f as H, L as W, g as k, h as B, i as O, j as U, M as _, N as Z, P as K, k as Q, R as X, l as Y, m as $, S as aa, T as ea, n as oa, V as sa, o as ta, W as ra, p as na, q as ia, r as ua, s as ga, t as la, u as da, v as ca, w as pa, x as Sa, y as ma, z as Ma } from "./chunks/theming-mF9Rt8SS.js";
4
- import { i as Ra } from "./chunks/externalizeComponent-EDymnaGR.js";
5
- import { S as ba } from "./chunks/SafetyBar-Cy9DiXp9.js";
1
+ import { C as t, J as r, L as s, M as n, a as i, P as p, R as l, S as u, b as d, c as g, d as S, e as c, T as x, f as M } from "./chunks/Robot-C0uICTOn.js";
2
+ import { V as f, u as C, a as V } from "./chunks/useSmoothedMotionState-COMJRcOt.js";
3
+ import "@wandelbots/mui";
4
+ import { A as L, C as E, J as R, a as b, b as A, c as G, d as y, L as j, e as q, M as z, N as P, V as v, f as I, j as N, p as T, t as h, u as w } from "./chunks/ConnectedMotionGroup-D6-4wBkk.js";
5
+ import { i as H } from "./chunks/externalizeComponent-C0cVcPE2.js";
6
+ import { S as k } from "./chunks/SafetyBar-C2-H1ifP.js";
6
7
  export {
7
- h as AdornedTextField,
8
- v as AppHeader,
9
- o as CollisionSceneRenderer,
10
- F as ConnectedMotionGroup,
11
- j as CycleTimer,
12
- q as JoggerConnection,
13
- z as JoggingCartesianAxisControl,
14
- w as JoggingJointValueControl,
15
- D as JoggingPanel,
16
- H as JoggingStore,
17
- s as JointLimitGizmo,
18
- t as LinearAxis,
19
- W as LoadingCover,
20
- k as LoadingErrorMessage,
21
- B as LogPanel,
22
- O as LogStore,
23
- U as LogViewer,
24
- r as MANUFACTURER_HOME_CONFIGS,
8
+ L as AppHeader,
9
+ t as CollisionSceneRenderer,
10
+ E as ConnectedMotionGroup,
11
+ R as JoggerConnection,
12
+ b as JoggingCartesianAxisControl,
13
+ A as JoggingJointValueControl,
14
+ G as JoggingPanel,
15
+ y as JoggingStore,
16
+ r as JointLimitGizmo,
17
+ s as LinearAxis,
18
+ j as LoadingCover,
19
+ q as LoadingErrorMessage,
25
20
  n as MotionGroupVisualizer,
26
21
  i as MotionGroupVisualizerExact,
27
- _ as MotionStreamConnection,
28
- Z as NoMotionGroupModal,
29
- K as PoseCartesianValues,
30
- Q as PoseJointValues,
31
- u as PresetEnvironment,
32
- L as ProgramControl,
33
- V as ProgramState,
34
- A as ProgramStateIndicator,
35
- g as Robot,
36
- l as RobotCard,
37
- X as RobotListItem,
38
- Y as RobotSetupReadinessIndicator,
39
- $ as RobotSetupReadinessState,
40
- ba as SafetyBar,
41
- d as SafetyZonesRenderer,
42
- aa as SelectableFab,
43
- c as SupportedLinearAxis,
44
- p as SupportedLinearAxisExact,
22
+ z as MotionStreamConnection,
23
+ P as NoMotionGroupModal,
24
+ p as PresetEnvironment,
25
+ l as Robot,
26
+ k as SafetyBar,
27
+ u as SafetyZonesRenderer,
28
+ d as SupportedLinearAxis,
29
+ g as SupportedLinearAxisExact,
45
30
  S as SupportedRobot,
46
- m as SupportedRobotExact,
47
- ea as TabBar,
48
- oa as Timer,
49
- M as TrajectoryRenderer,
50
- E as ValueInterpolator,
51
- sa as VelocitySlider,
52
- ta as VelocitySliderLabel,
53
- ra as WandelbotsDataGrid,
54
- na as createDebugMessage,
55
- ia as createErrorMessage,
56
- ua as createInfoMessage,
57
- ga as createLogMessage,
58
- la as createNovaMuiTheme,
59
- da as createNovaTheme,
60
- ca as createWarningMessage,
61
- C as defaultAxisConfig,
62
- R as defaultGetModel,
63
- f as extractManufacturer,
64
- b as getDefaultHomeConfig,
65
- Ra as i18n,
66
- pa as jointValuesEqual,
67
- Sa as poseEqual,
68
- ma as tcpMotionEqual,
69
- Ma as unwrapRotationVector,
70
- P as useAnimationFrame,
71
- J as useAutorun,
72
- T as useInterpolation,
73
- G as useMounted,
74
- y as useReaction,
75
- I as useSmoothedMotionState
31
+ c as SupportedRobotExact,
32
+ x as TrajectoryRenderer,
33
+ f as ValueInterpolator,
34
+ v as VelocitySlider,
35
+ I as VelocitySliderLabel,
36
+ M as defaultGetModel,
37
+ H as i18n,
38
+ N as jointValuesEqual,
39
+ T as poseEqual,
40
+ h as tcpMotionEqual,
41
+ w as unwrapRotationVector,
42
+ C as useInterpolation,
43
+ V as useSmoothedMotionState
76
44
  };
@@ -1,8 +1,8 @@
1
1
  import { type AutoReconnectingWebsocket } from "@wandelbots/nova-js";
2
- import type { MotionGroupDescription, MotionGroupState, Nova, RobotControllerState } from "@wandelbots/nova-js/v2";
2
+ import type { MotionGroupDescription, MotionGroupState, RobotControllerState } from "@wandelbots/nova-js/v2";
3
3
  import * as THREE from "three";
4
4
  import type { Vector3Simple } from "./JoggerConnection";
5
- import { type AnyNovaClient } from "./novaCompat";
5
+ import { type NovaConnection } from "./novaConnection";
6
6
  export type RobotTcpLike = {
7
7
  id: string;
8
8
  readable_name: string;
@@ -31,8 +31,8 @@ export declare class ConnectedMotionGroup {
31
31
  readonly initialControllerState: RobotControllerState;
32
32
  readonly controllerStateSocket: AutoReconnectingWebsocket;
33
33
  readonly cellId: string;
34
- static connectMultiple(nova: AnyNovaClient, motionGroupIds: string[], options?: ConnectedMotionGroupOptions): Promise<ConnectedMotionGroup[]>;
35
- static connect(novaClient: AnyNovaClient, motionGroupId: string, options?: ConnectedMotionGroupOptions): Promise<ConnectedMotionGroup>;
34
+ static connectMultiple(connection: NovaConnection, motionGroupIds: string[], options?: ConnectedMotionGroupOptions): Promise<ConnectedMotionGroup[]>;
35
+ static connect(connection: NovaConnection, motionGroupId: string, options?: ConnectedMotionGroupOptions): Promise<ConnectedMotionGroup>;
36
36
  connectedJoggingSocket: WebSocket | null;
37
37
  planData: any | null;
38
38
  joggingVelocity: number;
@@ -43,9 +43,7 @@ export declare class ConnectedMotionGroup {
43
43
  * movement controls in the UI should only be enabled in the "active" state
44
44
  */
45
45
  activationState: "inactive" | "activating" | "deactivating" | "active";
46
- /** Normalized instance-level Nova client (see `asNovaInstance`) */
47
- readonly nova: Nova;
48
- constructor(nova: AnyNovaClient, controller: RobotControllerState, motionGroup: MotionGroupState, initialMotionState: MotionGroupState, motionStateSocket: AutoReconnectingWebsocket, isVirtual: boolean, tcps: RobotTcpLike[], description: MotionGroupDescription, initialControllerState: RobotControllerState, controllerStateSocket: AutoReconnectingWebsocket, cellId?: string);
46
+ constructor(connection: NovaConnection, controller: RobotControllerState, motionGroup: MotionGroupState, initialMotionState: MotionGroupState, motionStateSocket: AutoReconnectingWebsocket, isVirtual: boolean, tcps: RobotTcpLike[], description: MotionGroupDescription, initialControllerState: RobotControllerState, controllerStateSocket: AutoReconnectingWebsocket, cellId?: string);
49
47
  get motionGroupId(): string;
50
48
  get controllerId(): string;
51
49
  get modelFromController(): string;
@@ -1,7 +1,7 @@
1
1
  import { type AutoReconnectingWebsocket } from "@wandelbots/nova-js";
2
2
  import { type Pose } from "@wandelbots/nova-js/v2";
3
3
  import { MotionStreamConnection } from "./MotionStreamConnection";
4
- import type { AnyNovaClient } from "./novaCompat";
4
+ import type { NovaConnection } from "./novaConnection";
5
5
  export type Vector3Simple = [number, number, number];
6
6
  export type JoggerConnectionOptions = {
7
7
  mode?: JoggerMode;
@@ -35,10 +35,18 @@ export declare class JoggerConnection {
35
35
  orientation: JoggerOrientation;
36
36
  onError?: (err: unknown) => void;
37
37
  onBlocked?: () => void;
38
+ /**
39
+ * Whether the jogger opened its motion stream itself (in `open()`): then
40
+ * `dispose()` closes it too. A motion stream given to the constructor
41
+ * belongs to the caller.
42
+ */
43
+ private ownsMotionStream;
44
+ /** Ends a jogging initialization that still waits for NOVA */
45
+ private endJoggingInit?;
38
46
  /**
39
47
  * Initialize the jogging connection using jogging endpoint or trajectory endpoint depending on the selected mode.
40
48
  *
41
- * @param nova - The Nova client instance
49
+ * @param connection - The base URL of a NOVA instance, or a NOVA client of the app (see `NovaConnection`)
42
50
  * @param motionGroupId - The ID of the motion group to connect to
43
51
  * @param options - Configuration options for the jogger connection
44
52
  * @param options.mode - The jogging mode to initialize:
@@ -50,19 +58,35 @@ export declare class JoggerConnection {
50
58
  * //param options.coordinateSystem - Coordinate system for jogging commands (default: "world"). Please note: Currently not implemented
51
59
  * @param options.orientation - If set to "tool", jogging TcpVelocityRequest will use `use_tool_coordinate_system` option (default: "coordsys")
52
60
  * @param options.onError - Error handler for websocket errors
53
- * @returns Promise resolving to initialized JoggerConnection instance
61
+ * @returns Promise resolving to initialized JoggerConnection instance. Its
62
+ * `dispose()` also closes the motion stream that this function opens.
54
63
  */
55
- static open(nova: AnyNovaClient, motionGroupId: string, options?: JoggerConnectionOptions): Promise<JoggerConnection>;
64
+ static open(connection: NovaConnection, motionGroupId: string, options?: JoggerConnectionOptions): Promise<JoggerConnection>;
56
65
  constructor(motionStream: MotionStreamConnection, options?: JoggerConnectionOptions | undefined);
57
66
  getDefaultTcp(motionStream: MotionStreamConnection): string | undefined;
58
67
  setOptions(options: Partial<JoggerConnectionOptions>): Promise<void>;
59
68
  get motionGroupId(): string;
60
- get nova(): import("@wandelbots/nova-js/v2").Nova;
61
69
  get cellId(): string;
62
70
  get numJoints(): number;
63
71
  stop(): Promise<void>;
72
+ /**
73
+ * Dispose the jogger, closing all open websockets: the jogging websockets,
74
+ * and the motion stream if the jogger opened it (in `open()`). A motion
75
+ * stream given to the constructor stays open: its caller closes it.
76
+ */
64
77
  dispose(): Promise<void[]>;
78
+ /** Closes the jogging and trajectory websockets */
79
+ private closeJoggingSockets;
65
80
  setJoggingMode(mode: JoggerMode, skipReinitializeIfSameMode?: boolean): Promise<void>;
81
+ /**
82
+ * Opens the continuous jogging websocket and initializes it; called by
83
+ * `setJoggingMode("jogging")`. The promise settles once:
84
+ * - it resolves when NOVA confirms the initialization (INITIALIZE_RECEIVED),
85
+ * when the jogger closes the websocket before that (`setJoggingMode`,
86
+ * `dispose`), or when an error message goes to `onBlocked` or `onError`;
87
+ * - it rejects on an error message without such a handler, and when NOVA
88
+ * does not confirm the initialization within `timeout` milliseconds.
89
+ */
66
90
  initializeJoggingWebsocket(): Promise<void>;
67
91
  /**
68
92
  * Jogging: Start rotation of a single robot joint at the specified velocity
@@ -1,6 +1,6 @@
1
1
  import { type AutoReconnectingWebsocket } from "@wandelbots/nova-js";
2
- import type { MotionGroupDescription, MotionGroupState, Nova, RobotControllerState } from "@wandelbots/nova-js/v2";
3
- import { type AnyNovaClient } from "./novaCompat";
2
+ import type { MotionGroupDescription, MotionGroupState, RobotControllerState } from "@wandelbots/nova-js/v2";
3
+ import { type NovaConnection } from "./novaConnection";
4
4
  /**
5
5
  * Store representing the current state of a connected motion group.
6
6
  */
@@ -15,11 +15,9 @@ export declare class MotionStreamConnection {
15
15
  readonly initialMotionState: MotionGroupState;
16
16
  readonly motionStateSocket: AutoReconnectingWebsocket;
17
17
  readonly cellId: string;
18
- static open(novaClient: AnyNovaClient, motionGroupId: string, options?: MotionStreamConnectionOptions): Promise<MotionStreamConnection>;
18
+ static open(connection: NovaConnection, motionGroupId: string, options?: MotionStreamConnectionOptions): Promise<MotionStreamConnection>;
19
19
  rapidlyChangingMotionState: MotionGroupState;
20
- /** Normalized instance-level Nova client (see `asNovaInstance`) */
21
- readonly nova: Nova;
22
- constructor(nova: AnyNovaClient, controller: RobotControllerState, motionGroup: MotionGroupState, description: MotionGroupDescription, initialMotionState: MotionGroupState, motionStateSocket: AutoReconnectingWebsocket, cellId?: string);
20
+ constructor(connection: NovaConnection, controller: RobotControllerState, motionGroup: MotionGroupState, description: MotionGroupDescription, initialMotionState: MotionGroupState, motionStateSocket: AutoReconnectingWebsocket, cellId?: string);
23
21
  get motionGroupId(): string;
24
22
  get controllerId(): string;
25
23
  get joints(): {
@@ -0,0 +1,23 @@
1
+ import { Nova } from "@wandelbots/nova-js/v2";
2
+ /**
3
+ * How the library connects to a NOVA instance: the base URL of the
4
+ * instance, or a NOVA client of the app (`Nova` of `@wandelbots/nova-js`,
5
+ * also of another version than the library's).
6
+ *
7
+ * The library reads only the URL and the access token of the app's client,
8
+ * and connects with its own client of its own nova-js version. So a newer
9
+ * or older nova-js in the app does not change the library.
10
+ */
11
+ export type NovaConnection = string | {
12
+ readonly config: {
13
+ readonly instanceUrl: string;
14
+ readonly accessToken?: string;
15
+ /** The cell of the cell-scoped `NovaClient` of older nova-js versions */
16
+ readonly cellId?: string;
17
+ };
18
+ readonly accessToken?: string | null;
19
+ };
20
+ /** The library's own NOVA client for a connection */
21
+ export declare function createNovaClient(connection: NovaConnection): Nova;
22
+ /** The cell of a cell-scoped client of an older nova-js version, if any */
23
+ export declare function cellIdOf(connection: NovaConnection): string | undefined;