@wandelbots/wandelbots-js-react-components 2.12.0 → 2.13.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.
- package/dist/components/safetyBar/ControllerTypeIndicator.d.ts +4 -1
- package/dist/components/safetyBar/ControllerTypeIndicator.d.ts.map +1 -1
- package/dist/components/safetyBar/IndicatorWithExplanation.d.ts +4 -2
- package/dist/components/safetyBar/IndicatorWithExplanation.d.ts.map +1 -1
- package/dist/components/safetyBar/OperationModeIndicator.d.ts +4 -1
- package/dist/components/safetyBar/OperationModeIndicator.d.ts.map +1 -1
- package/dist/components/safetyBar/SafetyBar.d.ts +3 -0
- package/dist/components/safetyBar/SafetyBar.d.ts.map +1 -1
- package/dist/components/safetyBar/SafetyStateIndicator.d.ts +4 -1
- package/dist/components/safetyBar/SafetyStateIndicator.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +110 -59
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/safetyBar/ControllerTypeIndicator.tsx +13 -2
- package/src/components/safetyBar/IndicatorWithExplanation.tsx +17 -8
- package/src/components/safetyBar/OperationModeIndicator.tsx +14 -2
- package/src/components/safetyBar/SafetyBar.tsx +15 -3
- package/src/components/safetyBar/SafetyStateIndicator.tsx +18 -2
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useTheme } from "@mui/material"
|
|
1
|
+
import { useTheme, type PopoverOrigin } from "@mui/material"
|
|
2
2
|
import { observer } from "mobx-react-lite"
|
|
3
3
|
import { Trans, useTranslation } from "react-i18next"
|
|
4
4
|
import ControllerTypePhysicalIcon from "./icons/controller-type-physical.svg"
|
|
@@ -8,10 +8,17 @@ import { IndicatorWithExplanation } from "./IndicatorWithExplanation"
|
|
|
8
8
|
interface ControllerTypeIndicatorProps {
|
|
9
9
|
isVirtual: boolean
|
|
10
10
|
motionGroupId: string
|
|
11
|
+
anchorOrigin?: PopoverOrigin
|
|
12
|
+
transformOrigin?: PopoverOrigin
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export const ControllerTypeIndicator = observer(
|
|
14
|
-
({
|
|
16
|
+
({
|
|
17
|
+
isVirtual,
|
|
18
|
+
motionGroupId,
|
|
19
|
+
anchorOrigin,
|
|
20
|
+
transformOrigin,
|
|
21
|
+
}: ControllerTypeIndicatorProps) => {
|
|
15
22
|
const theme = useTheme()
|
|
16
23
|
const { t } = useTranslation()
|
|
17
24
|
|
|
@@ -34,6 +41,8 @@ export const ControllerTypeIndicator = observer(
|
|
|
34
41
|
without special safety precautions.
|
|
35
42
|
</Trans>
|
|
36
43
|
}
|
|
44
|
+
anchorOrigin={anchorOrigin}
|
|
45
|
+
transformOrigin={transformOrigin}
|
|
37
46
|
/>
|
|
38
47
|
)
|
|
39
48
|
}
|
|
@@ -53,6 +62,8 @@ export const ControllerTypeIndicator = observer(
|
|
|
53
62
|
components={{ code: <code />, strong: <strong /> }}
|
|
54
63
|
/>
|
|
55
64
|
}
|
|
65
|
+
anchorOrigin={anchorOrigin}
|
|
66
|
+
transformOrigin={transformOrigin}
|
|
56
67
|
/>
|
|
57
68
|
)
|
|
58
69
|
},
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
Stack,
|
|
4
4
|
SvgIcon,
|
|
5
5
|
Typography,
|
|
6
|
+
type PopoverOrigin,
|
|
6
7
|
type TypographyProps,
|
|
7
8
|
} from "@mui/material"
|
|
8
9
|
import { observer, useLocalObservable } from "mobx-react-lite"
|
|
@@ -16,6 +17,8 @@ export type IndicatorWithExplanationProps = {
|
|
|
16
17
|
name: ReactNode
|
|
17
18
|
explanation: ReactNode
|
|
18
19
|
literalValue?: string
|
|
20
|
+
anchorOrigin?: PopoverOrigin
|
|
21
|
+
transformOrigin?: PopoverOrigin
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
export const IndicatorWithExplanation = observer(
|
|
@@ -27,6 +30,8 @@ export const IndicatorWithExplanation = observer(
|
|
|
27
30
|
name,
|
|
28
31
|
explanation,
|
|
29
32
|
literalValue,
|
|
33
|
+
anchorOrigin,
|
|
34
|
+
transformOrigin,
|
|
30
35
|
}: IndicatorWithExplanationProps) => {
|
|
31
36
|
const state = useLocalObservable(() => ({
|
|
32
37
|
anchorEl: null as HTMLElement | null,
|
|
@@ -69,14 +74,18 @@ export const IndicatorWithExplanation = observer(
|
|
|
69
74
|
}}
|
|
70
75
|
open={state.isPopoverOpen}
|
|
71
76
|
anchorEl={state.anchorEl}
|
|
72
|
-
anchorOrigin={
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
anchorOrigin={
|
|
78
|
+
anchorOrigin ?? {
|
|
79
|
+
vertical: "bottom",
|
|
80
|
+
horizontal: "left",
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
transformOrigin={
|
|
84
|
+
transformOrigin ?? {
|
|
85
|
+
vertical: "top",
|
|
86
|
+
horizontal: "left",
|
|
87
|
+
}
|
|
88
|
+
}
|
|
80
89
|
onClose={state.closePopover}
|
|
81
90
|
disableRestoreFocus
|
|
82
91
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useTheme } from "@mui/material"
|
|
1
|
+
import { useTheme, type PopoverOrigin } from "@mui/material"
|
|
2
2
|
import type { RobotControllerStateOperationModeEnum } from "@wandelbots/wandelbots-js"
|
|
3
3
|
import { observer } from "mobx-react-lite"
|
|
4
4
|
import { Trans, useTranslation } from "react-i18next"
|
|
@@ -9,10 +9,16 @@ import { IndicatorWithExplanation } from "./IndicatorWithExplanation"
|
|
|
9
9
|
|
|
10
10
|
interface OperationModeIndicatorProps {
|
|
11
11
|
operationMode: RobotControllerStateOperationModeEnum
|
|
12
|
+
anchorOrigin?: PopoverOrigin
|
|
13
|
+
transformOrigin?: PopoverOrigin
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export const OperationModeIndicator = observer(
|
|
15
|
-
({
|
|
17
|
+
({
|
|
18
|
+
operationMode,
|
|
19
|
+
anchorOrigin,
|
|
20
|
+
transformOrigin,
|
|
21
|
+
}: OperationModeIndicatorProps) => {
|
|
16
22
|
const { t } = useTranslation()
|
|
17
23
|
const theme = useTheme()
|
|
18
24
|
|
|
@@ -31,6 +37,8 @@ export const OperationModeIndicator = observer(
|
|
|
31
37
|
movement without manual confirmation is possible in this mode.
|
|
32
38
|
</Trans>
|
|
33
39
|
}
|
|
40
|
+
anchorOrigin={anchorOrigin}
|
|
41
|
+
transformOrigin={transformOrigin}
|
|
34
42
|
/>
|
|
35
43
|
)
|
|
36
44
|
case "OPERATION_MODE_MANUAL":
|
|
@@ -51,6 +59,8 @@ export const OperationModeIndicator = observer(
|
|
|
51
59
|
</Trans>
|
|
52
60
|
}
|
|
53
61
|
literalValue={operationMode}
|
|
62
|
+
anchorOrigin={anchorOrigin}
|
|
63
|
+
transformOrigin={transformOrigin}
|
|
54
64
|
/>
|
|
55
65
|
)
|
|
56
66
|
}
|
|
@@ -69,6 +79,8 @@ export const OperationModeIndicator = observer(
|
|
|
69
79
|
</Trans>
|
|
70
80
|
}
|
|
71
81
|
literalValue={operationMode}
|
|
82
|
+
anchorOrigin={anchorOrigin}
|
|
83
|
+
transformOrigin={transformOrigin}
|
|
72
84
|
/>
|
|
73
85
|
)
|
|
74
86
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Divider, Stack } from "@mui/material"
|
|
1
|
+
import { Divider, Stack, type PopoverOrigin } from "@mui/material"
|
|
2
2
|
import type {
|
|
3
3
|
RobotControllerStateOperationModeEnum,
|
|
4
4
|
RobotControllerStateSafetyStateEnum,
|
|
@@ -14,6 +14,8 @@ export interface SafetyBarProps {
|
|
|
14
14
|
motionGroupId: string
|
|
15
15
|
operationMode: RobotControllerStateOperationModeEnum
|
|
16
16
|
safetyState: RobotControllerStateSafetyStateEnum
|
|
17
|
+
anchorOrigin?: PopoverOrigin
|
|
18
|
+
transformOrigin?: PopoverOrigin
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
export const SafetyBar = externalizeComponent(
|
|
@@ -25,17 +27,27 @@ export const SafetyBar = externalizeComponent(
|
|
|
25
27
|
alignItems="center"
|
|
26
28
|
sx={{ height: "24px" }}
|
|
27
29
|
>
|
|
28
|
-
<SafetyStateIndicator
|
|
30
|
+
<SafetyStateIndicator
|
|
31
|
+
safetyState={props.safetyState}
|
|
32
|
+
anchorOrigin={props.anchorOrigin}
|
|
33
|
+
transformOrigin={props.transformOrigin}
|
|
34
|
+
/>
|
|
29
35
|
|
|
30
36
|
<Divider orientation="vertical" flexItem />
|
|
31
37
|
|
|
32
|
-
<OperationModeIndicator
|
|
38
|
+
<OperationModeIndicator
|
|
39
|
+
operationMode={props.operationMode}
|
|
40
|
+
anchorOrigin={props.anchorOrigin}
|
|
41
|
+
transformOrigin={props.transformOrigin}
|
|
42
|
+
/>
|
|
33
43
|
|
|
34
44
|
<Divider orientation="vertical" flexItem />
|
|
35
45
|
|
|
36
46
|
<ControllerTypeIndicator
|
|
37
47
|
isVirtual={props.isVirtual}
|
|
38
48
|
motionGroupId={props.motionGroupId}
|
|
49
|
+
anchorOrigin={props.anchorOrigin}
|
|
50
|
+
transformOrigin={props.transformOrigin}
|
|
39
51
|
/>
|
|
40
52
|
</Stack>
|
|
41
53
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useTheme } from "@mui/material"
|
|
1
|
+
import { useTheme, type PopoverOrigin } from "@mui/material"
|
|
2
2
|
import type { RobotControllerStateSafetyStateEnum } from "@wandelbots/wandelbots-js"
|
|
3
3
|
import { observer } from "mobx-react-lite"
|
|
4
4
|
import { Trans, useTranslation } from "react-i18next"
|
|
@@ -12,10 +12,16 @@ import { IndicatorWithExplanation } from "./IndicatorWithExplanation"
|
|
|
12
12
|
|
|
13
13
|
interface SafetyStateIndicatorProps {
|
|
14
14
|
safetyState: RobotControllerStateSafetyStateEnum
|
|
15
|
+
anchorOrigin?: PopoverOrigin
|
|
16
|
+
transformOrigin?: PopoverOrigin
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export const SafetyStateIndicator = observer(
|
|
18
|
-
({
|
|
20
|
+
({
|
|
21
|
+
safetyState,
|
|
22
|
+
anchorOrigin,
|
|
23
|
+
transformOrigin,
|
|
24
|
+
}: SafetyStateIndicatorProps) => {
|
|
19
25
|
const { t } = useTranslation()
|
|
20
26
|
const theme = useTheme()
|
|
21
27
|
|
|
@@ -35,6 +41,8 @@ export const SafetyStateIndicator = observer(
|
|
|
35
41
|
not prevented by this state.
|
|
36
42
|
</Trans>
|
|
37
43
|
}
|
|
44
|
+
anchorOrigin={anchorOrigin}
|
|
45
|
+
transformOrigin={transformOrigin}
|
|
38
46
|
/>
|
|
39
47
|
)
|
|
40
48
|
|
|
@@ -56,6 +64,8 @@ export const SafetyStateIndicator = observer(
|
|
|
56
64
|
</Trans>
|
|
57
65
|
}
|
|
58
66
|
literalValue={safetyState}
|
|
67
|
+
anchorOrigin={anchorOrigin}
|
|
68
|
+
transformOrigin={transformOrigin}
|
|
59
69
|
/>
|
|
60
70
|
)
|
|
61
71
|
|
|
@@ -79,6 +89,8 @@ export const SafetyStateIndicator = observer(
|
|
|
79
89
|
</Trans>
|
|
80
90
|
}
|
|
81
91
|
literalValue={safetyState}
|
|
92
|
+
anchorOrigin={anchorOrigin}
|
|
93
|
+
transformOrigin={transformOrigin}
|
|
82
94
|
/>
|
|
83
95
|
)
|
|
84
96
|
|
|
@@ -103,6 +115,8 @@ export const SafetyStateIndicator = observer(
|
|
|
103
115
|
</Trans>
|
|
104
116
|
}
|
|
105
117
|
literalValue={safetyState}
|
|
118
|
+
anchorOrigin={anchorOrigin}
|
|
119
|
+
transformOrigin={transformOrigin}
|
|
106
120
|
/>
|
|
107
121
|
)
|
|
108
122
|
|
|
@@ -122,6 +136,8 @@ export const SafetyStateIndicator = observer(
|
|
|
122
136
|
</Trans>
|
|
123
137
|
}
|
|
124
138
|
literalValue={safetyState}
|
|
139
|
+
anchorOrigin={anchorOrigin}
|
|
140
|
+
transformOrigin={transformOrigin}
|
|
125
141
|
/>
|
|
126
142
|
)
|
|
127
143
|
default:
|