@wandelbots/wandelbots-js-react-components 1.17.5 → 1.17.7

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.5",
3
+ "version": "1.17.7",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1,4 +1,5 @@
1
1
  import { Stack } from "@mui/material"
2
+ import { omit } from "lodash-es"
2
3
  import React from "react"
3
4
 
4
5
  export const TransparentOverlay = (
@@ -17,8 +18,9 @@ export const TransparentOverlay = (
17
18
  backgroundColor: "rgba(0, 0, 0, 0.6)",
18
19
  backdropFilter: "blur(1px)",
19
20
  zIndex: 100,
21
+ ...(props.sx || {}),
20
22
  }}
21
- {...props}
23
+ {...omit(props, "sx")}
22
24
  />
23
25
  )
24
26
  }
@@ -13,7 +13,11 @@ export const JoggingActivationRequired = observer(
13
13
  function renderOverlay() {
14
14
  if (store.activationState === "inactive" && !store.activationError) {
15
15
  return (
16
- <TransparentOverlay>
16
+ <TransparentOverlay
17
+ sx={{
18
+ borderRadius: "6px",
19
+ }}
20
+ >
17
21
  <Button
18
22
  color="primary"
19
23
  variant="contained"
@@ -37,7 +41,7 @@ export const JoggingActivationRequired = observer(
37
41
  }
38
42
 
39
43
  return (
40
- <Stack sx={{ position: "relative" }}>
44
+ <Stack sx={{ position: "relative", padding: "6px" }}>
41
45
  {renderOverlay()}
42
46
  {children}
43
47
  </Stack>
@@ -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,17 +145,20 @@ 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"
160
+ marginLeft="auto"
161
+ marginRight="auto"
158
162
  marginTop="16px"
159
163
  gap="12px"
160
164
  >
@@ -252,11 +256,16 @@ export const JoggingCartesianTab = observer(
252
256
  </JoggingActivationRequired>
253
257
  </Stack>
254
258
 
255
- {/* Show message if joint limits reached */}
256
- <JoggingJointLimitDetector store={store} />
259
+ <Stack>
260
+ {/* Show message if joint limits reached */}
261
+ <JoggingJointLimitDetector store={store} />
262
+
263
+ {/* Velocity slider */}
264
+ <JoggingVelocitySlider store={store} />
257
265
 
258
- {/* Velocity slider */}
259
- <JoggingVelocitySlider store={store} />
266
+ {/* Custom content */}
267
+ {children}
268
+ </Stack>
260
269
  </Stack>
261
270
  )
262
271
  },
@@ -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" />
@@ -1,16 +1,16 @@
1
1
  import {
2
- Stack,
3
- MenuItem,
4
2
  InputLabel,
3
+ MenuItem,
5
4
  Select,
6
- ToggleButtonGroup,
5
+ Stack,
7
6
  ToggleButton,
7
+ ToggleButtonGroup,
8
8
  } from "@mui/material"
9
9
  import { observer } from "mobx-react-lite"
10
- import type { IncrementOptionId, JoggingStore } from "./JoggingStore"
11
10
  import { useTranslation } from "react-i18next"
12
11
  import OrientationCoordSysIcon from "../../icons/orientation-coord-system.svg"
13
12
  import OrientationToolIcon from "../../icons/orientation-tool.svg"
13
+ import type { IncrementOptionId, JoggingStore } from "./JoggingStore"
14
14
 
15
15
  export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
16
16
  const { t } = useTranslation()
@@ -30,7 +30,7 @@ export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
30
30
  alignItems={"center"}
31
31
  spacing={2}
32
32
  sx={{
33
- padding: "8px 16px",
33
+ padding: "6px 16px",
34
34
  "& label": {
35
35
  opacity: 0.7,
36
36
  fontSize: "12px",
@@ -83,7 +83,7 @@ export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
83
83
  alignItems={"center"}
84
84
  spacing={2}
85
85
  sx={{
86
- padding: "8px 16px",
86
+ padding: "6px 16px",
87
87
  "& label": {
88
88
  opacity: 0.7,
89
89
  fontSize: "12px",
@@ -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
  }