@wandelbots/wandelbots-js-react-components 1.13.2 → 1.13.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wandelbots/wandelbots-js-react-components",
3
- "version": "1.13.2",
3
+ "version": "1.13.4",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -76,7 +76,6 @@
76
76
  "storybook": "^8.2.9",
77
77
  "storybook-dark-mode": "^4.0.2",
78
78
  "storybook-preset-inline-svg": "^1.0.1",
79
- "tslib": "^2.6.3",
80
79
  "typescript": "^5.5.4",
81
80
  "vite": "^5.4.2",
82
81
  "vite-plugin-svgr": "^4.2.0",
@@ -63,7 +63,7 @@ export const JoggingCartesianTab = observer(
63
63
 
64
64
  async function connectJogger() {
65
65
  store.jogger.setJoggingMode(
66
- store.selectedDiscreteIncrement ? "increment" : "cartesian",
66
+ store.activeDiscreteIncrement ? "increment" : "cartesian",
67
67
  {
68
68
  tcpId: store.selectedTcpId,
69
69
  coordSystemId: store.activeCoordSystemId,
@@ -113,8 +113,8 @@ export const JoggingCartesianTab = observer(
113
113
 
114
114
  connectJogger()
115
115
 
116
- if (store.selectedDiscreteIncrement) {
117
- return runIncrementalCartesianJog(opts, store.selectedDiscreteIncrement)
116
+ if (store.activeDiscreteIncrement) {
117
+ return runIncrementalCartesianJog(opts, store.activeDiscreteIncrement)
118
118
  }
119
119
 
120
120
  if (opts.motionType === "translate") {
@@ -135,7 +135,7 @@ export const JoggingCartesianTab = observer(
135
135
  async function stopJogging() {
136
136
  if (store.isLocked) return
137
137
 
138
- if (store.selectedDiscreteIncrement) {
138
+ if (store.activeDiscreteIncrement) {
139
139
  return
140
140
  }
141
141
 
@@ -117,7 +117,7 @@ export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
117
117
  <InputLabel id="jogging-increment-select">{"Increment"}</InputLabel>
118
118
  <Select
119
119
  labelId="jogging-increment-select"
120
- value={store.selectedIncrementId}
120
+ value={store.activeDiscreteIncrement?.id || "continuous"}
121
121
  onChange={(event) => {
122
122
  store.setSelectedIncrementId(
123
123
  event.target.value as IncrementOptionId,
@@ -129,13 +129,15 @@ export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
129
129
  {t("Jogging.Increment.Continuous.dd")}
130
130
  </MenuItem>
131
131
 
132
- {store.discreteIncrementOptions.map((inc) => (
133
- <MenuItem key={inc.id} value={inc.id}>
134
- {store.currentMotionType === "translate"
135
- ? `${inc.mm}mm`
136
- : `${inc.degrees}°`}
137
- </MenuItem>
138
- ))}
132
+ {store.selectedOrientation === "tool"
133
+ ? null
134
+ : store.discreteIncrementOptions.map((inc) => (
135
+ <MenuItem key={inc.id} value={inc.id}>
136
+ {store.currentMotionType === "translate"
137
+ ? `${inc.mm}mm`
138
+ : `${inc.degrees}°`}
139
+ </MenuItem>
140
+ ))}
139
141
  </Select>
140
142
  </Stack>
141
143
  </Stack>
@@ -70,7 +70,7 @@ export const JoggingPanel = externalizeComponent(
70
70
  currentTab,
71
71
  selectedTcpId,
72
72
  activeCoordSystemId,
73
- selectedDiscreteIncrement,
73
+ activeDiscreteIncrement,
74
74
  } = state.joggingStore
75
75
 
76
76
  if (currentTab.id !== "cartesian" && currentTab.id !== "joint") return
@@ -80,7 +80,7 @@ export const JoggingPanel = externalizeComponent(
80
80
  coordSystemId: activeCoordSystemId,
81
81
  }
82
82
 
83
- if (selectedDiscreteIncrement && currentTab.id === "cartesian") {
83
+ if (activeDiscreteIncrement && currentTab.id === "cartesian") {
84
84
  state.joggingStore.jogger.setJoggingMode(
85
85
  "increment",
86
86
  cartesianJoggingOpts,
@@ -95,7 +95,7 @@ export const JoggingPanel = externalizeComponent(
95
95
  state.joggingStore?.currentTab,
96
96
  state.joggingStore?.selectedTcpId,
97
97
  state.joggingStore?.activeCoordSystemId,
98
- state.joggingStore?.selectedDiscreteIncrement,
98
+ state.joggingStore?.activeDiscreteIncrement,
99
99
  ])
100
100
 
101
101
  if (!state.joggingStore || state.loadingError) {
@@ -251,10 +251,10 @@ export class JoggingStore {
251
251
  return keyBy(this.tcps, (tcp) => tcp.id)
252
252
  }
253
253
 
254
- get selectedDiscreteIncrement() {
255
- return discreteIncrementOptions.find(
256
- (d) => d.id === this.selectedIncrementId,
257
- )
254
+ get activeDiscreteIncrement() {
255
+ return this.selectedOrientation === "tool"
256
+ ? undefined
257
+ : discreteIncrementOptions.find((d) => d.id === this.selectedIncrementId)
258
258
  }
259
259
 
260
260
  /** The selected rotation velocity converted to radians per second */
@@ -23,6 +23,8 @@ type WandelscriptEditorProps = {
23
23
  monacoSetup?: (monaco: Monaco) => void
24
24
  }
25
25
 
26
+ const Editor = lazy(() => import("@monaco-editor/react"))
27
+
26
28
  /** A Monaco (VSCode-style) embedded code editor with Wandelscript syntax highlighting */
27
29
  export const WandelscriptEditor = externalizeComponent(
28
30
  (props: WandelscriptEditorProps) => {
@@ -36,8 +38,6 @@ export const WandelscriptEditor = externalizeComponent(
36
38
  const targetShikiTheme =
37
39
  theme.palette.mode === "dark" ? "dark-plus" : "light-plus"
38
40
 
39
- const Editor = lazy(() => import("@monaco-editor/react"))
40
-
41
41
  async function setupEditor(monaco: Monaco) {
42
42
  const [{ createHighlighter }, { shikiToMonaco }] = await Promise.all([
43
43
  import("shiki"),