@wandelbots/wandelbots-js-react-components 1.17.6 → 1.17.8

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.17.6",
3
+ "version": "1.17.8",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -16,7 +16,7 @@ export const TransparentOverlay = (
16
16
  justifyContent="center"
17
17
  sx={{
18
18
  backgroundColor: "rgba(0, 0, 0, 0.6)",
19
- backdropFilter: "blur(1px)",
19
+ backdropFilter: "blur(2px)",
20
20
  zIndex: 100,
21
21
  ...(props.sx || {}),
22
22
  }}
@@ -1,7 +1,7 @@
1
+ import { Typography, useTheme } from "@mui/material"
1
2
  import Slider from "@mui/material/Slider"
2
3
  import isNumber from "lodash-es/isNumber"
3
4
  import { observer } from "mobx-react-lite"
4
- import { Typography, useTheme } from "@mui/material"
5
5
 
6
6
  type VelocitySliderProps = {
7
7
  min: number
@@ -6,6 +6,7 @@ import {
6
6
  } from "@mui/material"
7
7
  import { degreesToRadians, radiansToDegrees } from "@wandelbots/wandelbots-js"
8
8
  import { observer } from "mobx-react-lite"
9
+ import type { ReactNode } from "react"
9
10
  import { useTranslation } from "react-i18next"
10
11
  import XAxisIcon from "../../icons/axis-x.svg"
11
12
  import YAxisIcon from "../../icons/axis-y.svg"
@@ -27,7 +28,7 @@ type JoggingCartesianOpts = {
27
28
  }
28
29
 
29
30
  export const JoggingCartesianTab = observer(
30
- ({ store }: { store: JoggingStore }) => {
31
+ ({ store, children }: { store: JoggingStore; children?: ReactNode }) => {
31
32
  const { t } = useTranslation()
32
33
 
33
34
  function onMotionTypeChange(
@@ -144,18 +145,22 @@ export const JoggingCartesianTab = observer(
144
145
  }
145
146
 
146
147
  return (
147
- <Stack>
148
- {/* Show Wandelscript string for the current coords */}
149
- <JoggingCartesianValues store={store} />
148
+ <Stack flexGrow={1} justifyContent="space-between">
149
+ <Stack>
150
+ {/* Show Wandelscript string for the current coords */}
151
+ <JoggingCartesianValues store={store} />
150
152
 
151
- {/* Jogging options */}
152
- <JoggingOptions store={store} />
153
+ {/* Jogging options */}
154
+ <JoggingOptions store={store} />
155
+ </Stack>
153
156
 
154
157
  <Stack
155
158
  width="80%"
156
159
  maxWidth="296px"
157
- margin="auto"
158
- marginTop="16px"
160
+ marginLeft="auto"
161
+ marginRight="auto"
162
+ marginTop="8px"
163
+ marginBottom="8px"
159
164
  gap="12px"
160
165
  >
161
166
  {/* Translate or rotate toggle */}
@@ -172,91 +177,104 @@ export const JoggingCartesianTab = observer(
172
177
  {t("Jogging.Cartesian.Rotation.bt")}
173
178
  </ToggleButton>
174
179
  </ToggleButtonGroup>
180
+ </Stack>
175
181
 
176
- <JoggingActivationRequired store={store}>
182
+ <JoggingActivationRequired store={store}>
183
+ <Stack
184
+ width="80%"
185
+ maxWidth="296px"
186
+ marginLeft="auto"
187
+ marginRight="auto"
188
+ marginTop="8px"
189
+ marginBottom="8px"
190
+ gap="12px"
191
+ >
177
192
  {/* Cartesian translate jogging */}
178
- <Stack gap="12px">
179
- {store.selectedCartesianMotionType === "translate" &&
180
- axisList.map((axis) => (
181
- <JoggingCartesianAxisControl
182
- key={axis.id}
183
- color={axis.color}
184
- disabled={store.isLocked}
185
- label={
186
- <>
187
- {axis.icon}
188
- <Typography
189
- sx={{
190
- fontSize: "24px",
191
- color: "white",
192
- }}
193
- >
194
- {axis.id.toUpperCase()}
195
- </Typography>
196
- </>
197
- }
198
- getDisplayedValue={() =>
199
- formatMM(
200
- store.jogger.motionStream.rapidlyChangingMotionState
201
- .tcp_pose?.position[axis.id] || 0,
202
- )
203
- }
204
- startJogging={(direction: "-" | "+") =>
205
- startCartesianJogging({
206
- axis: axis.id,
207
- motionType: "translate",
208
- direction,
209
- })
210
- }
211
- stopJogging={stopJogging}
212
- />
213
- ))}
193
+ {store.selectedCartesianMotionType === "translate" &&
194
+ axisList.map((axis) => (
195
+ <JoggingCartesianAxisControl
196
+ key={axis.id}
197
+ color={axis.color}
198
+ disabled={store.isLocked}
199
+ label={
200
+ <>
201
+ {axis.icon}
202
+ <Typography
203
+ sx={{
204
+ fontSize: "24px",
205
+ color: "white",
206
+ }}
207
+ >
208
+ {axis.id.toUpperCase()}
209
+ </Typography>
210
+ </>
211
+ }
212
+ getDisplayedValue={() =>
213
+ formatMM(
214
+ store.jogger.motionStream.rapidlyChangingMotionState
215
+ .tcp_pose?.position[axis.id] || 0,
216
+ )
217
+ }
218
+ startJogging={(direction: "-" | "+") =>
219
+ startCartesianJogging({
220
+ axis: axis.id,
221
+ motionType: "translate",
222
+ direction,
223
+ })
224
+ }
225
+ stopJogging={stopJogging}
226
+ />
227
+ ))}
214
228
 
215
- {/* Cartesian rotate jogging */}
216
- {store.selectedCartesianMotionType === "rotate" &&
217
- axisList.map((axis) => (
218
- <JoggingCartesianAxisControl
219
- key={axis.id}
220
- color={axis.color}
221
- disabled={store.isLocked}
222
- label={
223
- <>
224
- <RotationIcon />
225
- <Typography
226
- sx={{
227
- fontSize: "24px",
228
- color: "white",
229
- }}
230
- >
231
- {axis.id.toUpperCase()}
232
- </Typography>
233
- </>
234
- }
235
- getDisplayedValue={() =>
236
- formatDegrees(
237
- store.jogger.motionStream.rapidlyChangingMotionState
238
- .tcp_pose?.orientation?.[axis.id] || 0,
239
- )
240
- }
241
- startJogging={(direction: "-" | "+") =>
242
- startCartesianJogging({
243
- axis: axis.id,
244
- motionType: "rotate",
245
- direction,
246
- })
247
- }
248
- stopJogging={stopJogging}
249
- />
250
- ))}
251
- </Stack>
252
- </JoggingActivationRequired>
253
- </Stack>
229
+ {/* Cartesian rotate jogging */}
230
+ {store.selectedCartesianMotionType === "rotate" &&
231
+ axisList.map((axis) => (
232
+ <JoggingCartesianAxisControl
233
+ key={axis.id}
234
+ color={axis.color}
235
+ disabled={store.isLocked}
236
+ label={
237
+ <>
238
+ <RotationIcon />
239
+ <Typography
240
+ sx={{
241
+ fontSize: "24px",
242
+ color: "white",
243
+ }}
244
+ >
245
+ {axis.id.toUpperCase()}
246
+ </Typography>
247
+ </>
248
+ }
249
+ getDisplayedValue={() =>
250
+ formatDegrees(
251
+ store.jogger.motionStream.rapidlyChangingMotionState
252
+ .tcp_pose?.orientation?.[axis.id] || 0,
253
+ )
254
+ }
255
+ startJogging={(direction: "-" | "+") =>
256
+ startCartesianJogging({
257
+ axis: axis.id,
258
+ motionType: "rotate",
259
+ direction,
260
+ })
261
+ }
262
+ stopJogging={stopJogging}
263
+ />
264
+ ))}
265
+ </Stack>
266
+ </JoggingActivationRequired>
267
+
268
+ <Stack>
269
+ {/* Show message if joint limits reached */}
270
+ <JoggingJointLimitDetector store={store} />
254
271
 
255
- {/* Show message if joint limits reached */}
256
- <JoggingJointLimitDetector store={store} />
272
+ {/* Velocity slider */}
273
+ <JoggingVelocitySlider store={store} />
257
274
 
258
- {/* Velocity slider */}
259
- <JoggingVelocitySlider store={store} />
275
+ {/* Custom content */}
276
+ {children}
277
+ </Stack>
260
278
  </Stack>
261
279
  )
262
280
  },
@@ -1,6 +1,7 @@
1
1
  import { Stack, Typography } from "@mui/material"
2
2
  import { radiansToDegrees } from "@wandelbots/wandelbots-js"
3
3
  import { observer } from "mobx-react-lite"
4
+ import type { ReactNode } from "react"
4
5
  import { JoggingActivationRequired } from "./JoggingActivationRequired"
5
6
  import { JoggingJointLimitDetector } from "./JoggingJointLimitDetector"
6
7
  import { JoggingJointRotationControl } from "./JoggingJointRotationControl"
@@ -9,7 +10,7 @@ import type { JoggingStore } from "./JoggingStore"
9
10
  import { JoggingVelocitySlider } from "./JoggingVelocitySlider"
10
11
 
11
12
  export const JoggingJointTab = observer(
12
- ({ store }: { store: JoggingStore }) => {
13
+ ({ store, children }: { store: JoggingStore; children: ReactNode }) => {
13
14
  async function startJointJogging(opts: {
14
15
  joint: number
15
16
  direction: "-" | "+"
@@ -26,7 +27,7 @@ export const JoggingJointTab = observer(
26
27
  }
27
28
 
28
29
  return (
29
- <Stack>
30
+ <Stack flexGrow={1} justifyContent="space-between">
30
31
  <JoggingJointValues store={store} />
31
32
 
32
33
  <Stack marginTop="0.8rem" />
@@ -151,15 +151,13 @@ const JoggingPanelInner = observer(
151
151
  if (store.currentTab.id === "cartesian") {
152
152
  return (
153
153
  <>
154
- <JoggingCartesianTab store={store} />
155
- {children}
154
+ <JoggingCartesianTab store={store}>{children}</JoggingCartesianTab>
156
155
  </>
157
156
  )
158
157
  } else if (store.currentTab.id === "joint") {
159
158
  return (
160
159
  <>
161
- <JoggingJointTab store={store} />
162
- {children}
160
+ <JoggingJointTab store={store}>{children}</JoggingJointTab>
163
161
  </>
164
162
  )
165
163
  }