@wandelbots/wandelbots-js-react-components 2.10.3 → 2.11.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 (38) hide show
  1. package/dist/components/safetyBar/ControllerTypeIndicator.d.ts +9 -0
  2. package/dist/components/safetyBar/ControllerTypeIndicator.d.ts.map +1 -0
  3. package/dist/components/safetyBar/IndicatorWithExplanation.d.ts +15 -0
  4. package/dist/components/safetyBar/IndicatorWithExplanation.d.ts.map +1 -0
  5. package/dist/components/safetyBar/OperationModeIndicator.d.ts +9 -0
  6. package/dist/components/safetyBar/OperationModeIndicator.d.ts.map +1 -0
  7. package/dist/components/safetyBar/SafetyBar.d.ts +11 -0
  8. package/dist/components/safetyBar/SafetyBar.d.ts.map +1 -0
  9. package/dist/components/safetyBar/SafetyStateIndicator.d.ts +9 -0
  10. package/dist/components/safetyBar/SafetyStateIndicator.d.ts.map +1 -0
  11. package/dist/components/utils/errorHandling.d.ts +1 -0
  12. package/dist/components/utils/errorHandling.d.ts.map +1 -1
  13. package/dist/index.cjs +36 -35
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +4188 -3803
  18. package/dist/index.js.map +1 -1
  19. package/package.json +15 -16
  20. package/src/components/safetyBar/ControllerTypeIndicator.tsx +59 -0
  21. package/src/components/safetyBar/IndicatorWithExplanation.tsx +117 -0
  22. package/src/components/safetyBar/OperationModeIndicator.tsx +76 -0
  23. package/src/components/safetyBar/SafetyBar.tsx +43 -0
  24. package/src/components/safetyBar/SafetyStateIndicator.tsx +131 -0
  25. package/src/components/safetyBar/icons/controller-type-physical.svg +1 -0
  26. package/src/components/safetyBar/icons/controller-type-virtual.svg +1 -0
  27. package/src/components/safetyBar/icons/operation-mode-automatic.svg +1 -0
  28. package/src/components/safetyBar/icons/operation-mode-error.svg +1 -0
  29. package/src/components/safetyBar/icons/operation-mode-manual.svg +1 -0
  30. package/src/components/safetyBar/icons/safety-state-error.svg +1 -0
  31. package/src/components/safetyBar/icons/safety-state-estop.svg +1 -0
  32. package/src/components/safetyBar/icons/safety-state-manual-action-required.svg +1 -0
  33. package/src/components/safetyBar/icons/safety-state-normal.svg +1 -0
  34. package/src/components/safetyBar/icons/safety-state-stop.svg +1 -0
  35. package/src/components/utils/errorHandling.ts +4 -0
  36. package/src/i18n/locales/de/translations.json +27 -1
  37. package/src/i18n/locales/en/translations.json +27 -1
  38. package/src/index.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wandelbots/wandelbots-js-react-components",
3
- "version": "2.10.3",
3
+ "version": "2.11.0",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -55,16 +55,16 @@
55
55
  "@rollup/plugin-node-resolve": "^16.0.0",
56
56
  "@rollup/plugin-terser": "^0.4.4",
57
57
  "@rollup/plugin-typescript": "^12.1.2",
58
- "@storybook/addon-docs": "^8.5.8",
59
- "@storybook/addon-essentials": "^8.5.8",
60
- "@storybook/addon-interactions": "^8.5.8",
61
- "@storybook/blocks": "^8.5.8",
62
- "@storybook/react": "^8.5.8",
63
- "@storybook/csf-tools": "^8.5.8",
64
- "@storybook/react-vite": "^8.5.8",
65
- "@storybook/test": "^8.5.8",
58
+ "@storybook/addon-docs": "^8.6.2",
59
+ "@storybook/addon-essentials": "^8.6.2",
60
+ "@storybook/addon-interactions": "^8.6.2",
61
+ "@storybook/blocks": "^8.6.2",
62
+ "@storybook/react": "^8.6.2",
63
+ "@storybook/csf-tools": "^8.6.2",
64
+ "@storybook/react-vite": "^8.6.2",
65
+ "@storybook/test": "^8.6.2",
66
66
  "@storybook/test-runner": "^0.21.3",
67
- "@storybook/types": "^8.5.8",
67
+ "@storybook/types": "^8.6.2",
68
68
  "@svgr/rollup": "^8.1.0",
69
69
  "@types/lodash-es": "^4.17.12",
70
70
  "@types/react": "^18.3.12",
@@ -90,7 +90,7 @@
90
90
  "rollup-plugin-peer-deps-external": "^2.2.4",
91
91
  "rollup-plugin-postcss": "^4.0.2",
92
92
  "semantic-release": "^24.2.3",
93
- "storybook": "^8.5.8",
93
+ "storybook": "^8.6.2",
94
94
  "storybook-dark-mode": "^4.0.2",
95
95
  "storybook-preset-inline-svg": "^1.0.1",
96
96
  "ts-dedent": "^2.2.0",
@@ -100,10 +100,9 @@
100
100
  "vite-plugin-svgr": "^4.3.0",
101
101
  "vitest": "^3.0.7",
102
102
  "wait-on": "^8.0.2",
103
- "@wandelbots/wandelbots-js": "^1.16.0"
103
+ "@wandelbots/wandelbots-js": "^1.17.1"
104
104
  },
105
105
  "peerDependencies": {
106
- "@wandelbots/wandelbots-js": "^1.12.0",
107
106
  "@emotion/react": "^11.11.1",
108
107
  "@emotion/styled": "^11.11.0",
109
108
  "@mui/icons-material": "^6",
@@ -113,7 +112,7 @@
113
112
  "@react-three/fiber": "~8.18.0",
114
113
  "react": "~18.3.1",
115
114
  "react-dom": "~18.3.1",
116
- "three": ">=0.173",
115
+ "three": ">=0.174",
117
116
  "three-stdlib": ">=2"
118
117
  },
119
118
  "peerDependenciesMeta": {
@@ -123,13 +122,13 @@
123
122
  },
124
123
  "dependencies": {
125
124
  "@monaco-editor/react": "^4.7.0",
126
- "@shikijs/monaco": "^3.0.0",
125
+ "@shikijs/monaco": "^3.1.0",
127
126
  "i18next-browser-languagedetector": "^8.0.4",
128
127
  "lodash-es": "^4.17.21",
129
128
  "mobx": "^6.13.6",
130
129
  "mobx-react-lite": "^4.1.0",
131
130
  "react-error-boundary": "^5.0.0",
132
131
  "react-i18next": "^15.4.1",
133
- "shiki": "^3.0.0"
132
+ "shiki": "^3.1.0"
134
133
  }
135
134
  }
@@ -0,0 +1,59 @@
1
+ import { useTheme } from "@mui/material"
2
+ import { observer } from "mobx-react-lite"
3
+ import { Trans, useTranslation } from "react-i18next"
4
+ import ControllerTypePhysicalIcon from "./icons/controller-type-physical.svg"
5
+ import ControllerTypeVirtualIcon from "./icons/controller-type-virtual.svg"
6
+ import { IndicatorWithExplanation } from "./IndicatorWithExplanation"
7
+
8
+ interface ControllerTypeIndicatorProps {
9
+ isVirtual: boolean
10
+ motionGroupId: string
11
+ }
12
+
13
+ export const ControllerTypeIndicator = observer(
14
+ ({ isVirtual, motionGroupId }: ControllerTypeIndicatorProps) => {
15
+ const theme = useTheme()
16
+ const { t } = useTranslation()
17
+
18
+ if (isVirtual) {
19
+ return (
20
+ <IndicatorWithExplanation
21
+ id="motion-group-virtual"
22
+ icon={ControllerTypeVirtualIcon}
23
+ color={theme.palette.tertiary.main}
24
+ name={t("SafetyBar.ControllerType.Virtual.lb")}
25
+ explanation={
26
+ <Trans
27
+ i18nKey="SafetyBar.MotionGroup.Virtual.Explanation.lb"
28
+ values={{
29
+ motionGroupId,
30
+ }}
31
+ >
32
+ Motion group <code>{motionGroupId}</code> refers to a virtual
33
+ robot with no physical counterpart. It can be freely manipulated
34
+ without special safety precautions.
35
+ </Trans>
36
+ }
37
+ />
38
+ )
39
+ }
40
+
41
+ return (
42
+ <IndicatorWithExplanation
43
+ id="motion-group-physical"
44
+ icon={ControllerTypePhysicalIcon}
45
+ color={theme.palette.primary.main}
46
+ name={t("SafetyBar.ControllerType.Physical.lb")}
47
+ explanation={
48
+ <Trans
49
+ i18nKey="SafetyBar.MotionGroup.Physical.Explanation.lb"
50
+ values={{
51
+ motionGroupId,
52
+ }}
53
+ components={{ code: <code />, strong: <strong /> }}
54
+ />
55
+ }
56
+ />
57
+ )
58
+ },
59
+ )
@@ -0,0 +1,117 @@
1
+ import {
2
+ Popover,
3
+ Stack,
4
+ SvgIcon,
5
+ Typography,
6
+ type TypographyProps,
7
+ } from "@mui/material"
8
+ import { observer, useLocalObservable } from "mobx-react-lite"
9
+ import type { ElementType, ReactNode } from "react"
10
+
11
+ export type IndicatorWithExplanationProps = {
12
+ id: string
13
+ icon: ElementType
14
+ color: TypographyProps["color"]
15
+ title?: ReactNode
16
+ name: ReactNode
17
+ explanation: ReactNode
18
+ literalValue?: string
19
+ }
20
+
21
+ export const IndicatorWithExplanation = observer(
22
+ ({
23
+ id,
24
+ icon,
25
+ color,
26
+ title,
27
+ name,
28
+ explanation,
29
+ literalValue,
30
+ }: IndicatorWithExplanationProps) => {
31
+ const state = useLocalObservable(() => ({
32
+ anchorEl: null as HTMLElement | null,
33
+
34
+ get isPopoverOpen() {
35
+ return !!state.anchorEl
36
+ },
37
+
38
+ openPopover(event: React.MouseEvent<HTMLElement>) {
39
+ state.anchorEl = event.currentTarget
40
+ },
41
+
42
+ closePopover() {
43
+ state.anchorEl = null
44
+ },
45
+ }))
46
+
47
+ return (
48
+ <>
49
+ <Stack
50
+ aria-owns={state.isPopoverOpen ? id : undefined}
51
+ aria-haspopup="true"
52
+ onMouseEnter={state.openPopover}
53
+ onMouseLeave={state.closePopover}
54
+ sx={{
55
+ cursor: "pointer",
56
+ }}
57
+ >
58
+ <SvgIcon
59
+ component={icon}
60
+ sx={{
61
+ color,
62
+ }}
63
+ />
64
+ </Stack>
65
+ <Popover
66
+ id={id}
67
+ sx={{
68
+ pointerEvents: "none",
69
+ }}
70
+ open={state.isPopoverOpen}
71
+ anchorEl={state.anchorEl}
72
+ anchorOrigin={{
73
+ vertical: "bottom",
74
+ horizontal: "left",
75
+ }}
76
+ transformOrigin={{
77
+ vertical: "top",
78
+ horizontal: "left",
79
+ }}
80
+ onClose={state.closePopover}
81
+ disableRestoreFocus
82
+ >
83
+ <Stack
84
+ gap="1rem"
85
+ padding={2}
86
+ maxWidth="450px"
87
+ sx={{
88
+ wordWrap: "break-word",
89
+ }}
90
+ >
91
+ <div>
92
+ {title && (
93
+ <Typography component="span" fontSize="14px">
94
+ {`${title}: `}
95
+ </Typography>
96
+ )}
97
+ <Typography
98
+ component="span"
99
+ color={color}
100
+ fontWeight="bold"
101
+ fontSize="14px"
102
+ >
103
+ {name}
104
+ </Typography>
105
+ </div>
106
+
107
+ <Typography fontSize="14px">{explanation}</Typography>
108
+
109
+ {literalValue && (
110
+ <Typography fontSize="12px">{literalValue}</Typography>
111
+ )}
112
+ </Stack>
113
+ </Popover>
114
+ </>
115
+ )
116
+ },
117
+ )
@@ -0,0 +1,76 @@
1
+ import { useTheme } from "@mui/material"
2
+ import type { RobotControllerStateOperationModeEnum } from "@wandelbots/wandelbots-js"
3
+ import { observer } from "mobx-react-lite"
4
+ import { Trans, useTranslation } from "react-i18next"
5
+ import OperationModeAutomaticIcon from "./icons/operation-mode-automatic.svg"
6
+ import OperationModeErrorIcon from "./icons/operation-mode-error.svg"
7
+ import OperationModeManualIcon from "./icons/operation-mode-manual.svg"
8
+ import { IndicatorWithExplanation } from "./IndicatorWithExplanation"
9
+
10
+ interface OperationModeIndicatorProps {
11
+ operationMode: RobotControllerStateOperationModeEnum
12
+ }
13
+
14
+ export const OperationModeIndicator = observer(
15
+ ({ operationMode }: OperationModeIndicatorProps) => {
16
+ const { t } = useTranslation()
17
+ const theme = useTheme()
18
+
19
+ switch (operationMode) {
20
+ case "OPERATION_MODE_AUTO":
21
+ return (
22
+ <IndicatorWithExplanation
23
+ id="operation-mode-auto"
24
+ icon={OperationModeAutomaticIcon}
25
+ title={t("SafetyBar.OperationMode.ti")}
26
+ name={t("SafetyBar.OperationMode.Automatic.ti")}
27
+ color={"rgba(255, 255, 255, 0.57)"}
28
+ explanation={
29
+ <Trans i18nKey="SafetyBar.OperationMode.Auto.Explanation.lb">
30
+ The robot controller is in automatic operation mode. Automated
31
+ movement without manual confirmation is possible in this mode.
32
+ </Trans>
33
+ }
34
+ />
35
+ )
36
+ case "OPERATION_MODE_MANUAL":
37
+ case "OPERATION_MODE_MANUAL_T1":
38
+ case "OPERATION_MODE_MANUAL_T2": {
39
+ return (
40
+ <IndicatorWithExplanation
41
+ id="operation-mode-manual"
42
+ icon={OperationModeManualIcon}
43
+ color={theme.palette.warning.main}
44
+ title={t("SafetyBar.OperationMode.ti")}
45
+ name={t("SafetyBar.OperationMode.Manual.lb")}
46
+ explanation={
47
+ <Trans i18nKey="SafetyBar.OperationMode.Manual.Explanation.lb">
48
+ The robot controller is in manual operation mode. On a physical
49
+ robot, this generally indicates that an enabling switch must be
50
+ held for the robot to move successfully.
51
+ </Trans>
52
+ }
53
+ literalValue={operationMode}
54
+ />
55
+ )
56
+ }
57
+ default:
58
+ return (
59
+ <IndicatorWithExplanation
60
+ id="operation-mode-error"
61
+ icon={OperationModeErrorIcon}
62
+ color={theme.palette.warning.main}
63
+ title={t("SafetyBar.OperationMode.ti")}
64
+ name={t("SafetyBar.OperationMode.Error.lb")}
65
+ explanation={
66
+ <Trans i18nKey="SafetyBar.OperationMode.Error.Explanation.lb">
67
+ The robot controller has entered an unexpected operation mode.
68
+ Motion group movement may not be possible.
69
+ </Trans>
70
+ }
71
+ literalValue={operationMode}
72
+ />
73
+ )
74
+ }
75
+ },
76
+ )
@@ -0,0 +1,43 @@
1
+ import { Divider, Stack } from "@mui/material"
2
+ import type {
3
+ RobotControllerStateOperationModeEnum,
4
+ RobotControllerStateSafetyStateEnum,
5
+ } from "@wandelbots/wandelbots-js"
6
+ import { observer } from "mobx-react-lite"
7
+ import { externalizeComponent } from "../../externalizeComponent"
8
+ import { ControllerTypeIndicator } from "./ControllerTypeIndicator"
9
+ import { OperationModeIndicator } from "./OperationModeIndicator"
10
+ import { SafetyStateIndicator } from "./SafetyStateIndicator"
11
+
12
+ export interface SafetyBarProps {
13
+ isVirtual: boolean
14
+ motionGroupId: string
15
+ operationMode: RobotControllerStateOperationModeEnum
16
+ safetyState: RobotControllerStateSafetyStateEnum
17
+ }
18
+
19
+ export const SafetyBar = externalizeComponent(
20
+ observer((props: SafetyBarProps) => {
21
+ return (
22
+ <Stack
23
+ direction="row"
24
+ gap="8px"
25
+ alignItems="center"
26
+ sx={{ height: "24px" }}
27
+ >
28
+ <SafetyStateIndicator safetyState={props.safetyState} />
29
+
30
+ <Divider orientation="vertical" flexItem />
31
+
32
+ <OperationModeIndicator operationMode={props.operationMode} />
33
+
34
+ <Divider orientation="vertical" flexItem />
35
+
36
+ <ControllerTypeIndicator
37
+ isVirtual={props.isVirtual}
38
+ motionGroupId={props.motionGroupId}
39
+ />
40
+ </Stack>
41
+ )
42
+ }),
43
+ )
@@ -0,0 +1,131 @@
1
+ import { useTheme } from "@mui/material"
2
+ import type { RobotControllerStateSafetyStateEnum } from "@wandelbots/wandelbots-js"
3
+ import { observer } from "mobx-react-lite"
4
+ import { Trans, useTranslation } from "react-i18next"
5
+ import { assertUnreachable } from "../utils/errorHandling"
6
+ import SafetyStateErrorIcon from "./icons/safety-state-error.svg"
7
+ import SafetyStateEstopIcon from "./icons/safety-state-estop.svg"
8
+ import SafetyStateManualActionRequiredIcon from "./icons/safety-state-manual-action-required.svg"
9
+ import SafetyStateNormalIcon from "./icons/safety-state-normal.svg"
10
+ import SafetyStateStopIcon from "./icons/safety-state-stop.svg"
11
+ import { IndicatorWithExplanation } from "./IndicatorWithExplanation"
12
+
13
+ interface SafetyStateIndicatorProps {
14
+ safetyState: RobotControllerStateSafetyStateEnum
15
+ }
16
+
17
+ export const SafetyStateIndicator = observer(
18
+ ({ safetyState }: SafetyStateIndicatorProps) => {
19
+ const { t } = useTranslation()
20
+ const theme = useTheme()
21
+
22
+ switch (safetyState) {
23
+ // Normal state, robot can move
24
+ case "SAFETY_STATE_NORMAL":
25
+ return (
26
+ <IndicatorWithExplanation
27
+ id="safety-state-normal"
28
+ title={t("SafetyBar.SafetyState.ti")}
29
+ name={t("SafetyBar.SafetyState.Normal.lb")}
30
+ icon={SafetyStateNormalIcon}
31
+ color={"rgba(255, 255, 255, 0.57)"}
32
+ explanation={
33
+ <Trans i18nKey="SafetyBar.SafetyState.Normal.Explanation.lb">
34
+ The robot controller is in a normal safety state. Movement is
35
+ not prevented by this state.
36
+ </Trans>
37
+ }
38
+ />
39
+ )
40
+
41
+ // Estop
42
+ case "SAFETY_STATE_DEVICE_EMERGENCY_STOP":
43
+ case "SAFETY_STATE_ROBOT_EMERGENCY_STOP":
44
+ return (
45
+ <IndicatorWithExplanation
46
+ id="safety-state-estop"
47
+ title={t("SafetyBar.SafetyState.ti")}
48
+ name={t("SafetyBar.SafetyState.Estop.lb")}
49
+ icon={SafetyStateEstopIcon}
50
+ color={theme.palette.error.main}
51
+ explanation={
52
+ <Trans i18nKey="SafetyBar.StopState.Estop.Explanation.lb">
53
+ An emergency stop of the robot controller has been triggered.
54
+ Movement of the robot is no longer possible until the estop is
55
+ released.
56
+ </Trans>
57
+ }
58
+ literalValue={safetyState}
59
+ />
60
+ )
61
+
62
+ // General stop
63
+ case "SAFETY_STATE_STOP_0":
64
+ case "SAFETY_STATE_STOP_1":
65
+ case "SAFETY_STATE_STOP_2":
66
+ case "SAFETY_STATE_PROTECTIVE_STOP":
67
+ case "SAFETY_STATE_STOP":
68
+ return (
69
+ <IndicatorWithExplanation
70
+ id="safety-state-stop"
71
+ icon={SafetyStateStopIcon}
72
+ title={t("SafetyBar.SafetyState.ti")}
73
+ name={t("SafetyBar.SafetyState.Stop.lb")}
74
+ color={theme.palette.warning.main}
75
+ explanation={
76
+ <Trans i18nKey="SafetyBar.SafetyState.Stop.Explanation.lb">
77
+ The robot controller has entered a stop state. Movement is no
78
+ longer possible until the stop state is resolved.
79
+ </Trans>
80
+ }
81
+ literalValue={safetyState}
82
+ />
83
+ )
84
+
85
+ // Manual action required
86
+ case "SAFETY_STATE_REDUCED":
87
+ case "SAFETY_STATE_MASTERING":
88
+ case "SAFETY_STATE_CONFIRM_SAFETY":
89
+ case "SAFETY_STATE_OPERATOR_SAFETY":
90
+ case "SAFETY_STATE_RECOVERY":
91
+ case "SAFETY_STATE_VIOLATION":
92
+ return (
93
+ <IndicatorWithExplanation
94
+ id="safety-state-manual-action-required"
95
+ icon={SafetyStateManualActionRequiredIcon}
96
+ color={theme.palette.warning.main}
97
+ title={t("SafetyBar.SafetyState.ti")}
98
+ name={t("SafetyBar.SafetyState.ManualActionRequired.lb")}
99
+ explanation={
100
+ <Trans i18nKey="SafetyBar.SafetyState.ManualActionRequired.Explanation.lb">
101
+ The robot controller has entered a safety state requiring manual
102
+ action to resolve.
103
+ </Trans>
104
+ }
105
+ literalValue={safetyState}
106
+ />
107
+ )
108
+
109
+ // Error
110
+ case "SAFETY_STATE_UNKNOWN":
111
+ case "SAFETY_STATE_FAULT":
112
+ return (
113
+ <IndicatorWithExplanation
114
+ id="safety-state-error"
115
+ icon={SafetyStateErrorIcon}
116
+ color={theme.palette.error.main}
117
+ title={t("SafetyBar.SafetyState.ti")}
118
+ name={t("SafetyBar.SafetyState.Error.lb")}
119
+ explanation={
120
+ <Trans i18nKey="SafetyBar.SafetyState.Error.Explanation.lb">
121
+ The robot controller has entered an unexpected safety state.
122
+ </Trans>
123
+ }
124
+ literalValue={safetyState}
125
+ />
126
+ )
127
+ default:
128
+ assertUnreachable(safetyState, `Unknown safety state ${safetyState}`)
129
+ }
130
+ },
131
+ )
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M5.248 21c-.334 0-.619-.116-.853-.35a1.153 1.153 0 0 1-.351-.848c0-.333.117-.616.351-.85.234-.233.519-.35.853-.35H7.24L4.558 9.87a2.881 2.881 0 0 1-1.126-1.042A2.77 2.77 0 0 1 3 7.317c0-.793.28-1.467.838-2.023a2.774 2.774 0 0 1 2.033-.834 2.71 2.71 0 0 1 1.728.585c.494.389.832.887 1.014 1.493h3.58V5.239c0-.22.076-.406.226-.555a.76.76 0 0 1 .558-.224c.136 0 .263.035.381.104.118.07.209.167.273.292v.14l1.835-1.702a.979.979 0 0 1 .52-.279.881.881 0 0 1 .58.091l4.01 1.85a.74.74 0 0 1 .36.364.537.537 0 0 1-.002.474.592.592 0 0 1-.366.323.657.657 0 0 1-.477-.039l-3.858-1.774L13.76 6.59v1.454l2.473 2.233 3.858-1.774a.648.648 0 0 1 .485-.03.571.571 0 0 1 .358.314.513.513 0 0 1 .01.482.79.79 0 0 1-.367.357l-4.011 1.882a.881.881 0 0 1-.58.09.979.979 0 0 1-.52-.278L13.63 9.638v.14a.92.92 0 0 1-.273.275.665.665 0 0 1-.381.12.76.76 0 0 1-.558-.224.752.752 0 0 1-.225-.555V8.096h-3.58a2.82 2.82 0 0 1-.215.54 2.552 2.552 0 0 1-.323.479l5.139 9.488h2.673c.335 0 .62.116.854.35.234.233.35.516.35.849 0 .332-.116.615-.35.849a1.167 1.167 0 0 1-.854.349H5.248Zm.623-12.385c.362 0 .67-.126.924-.378a1.25 1.25 0 0 0 .38-.92 1.25 1.25 0 0 0-.38-.92 1.261 1.261 0 0 0-.924-.379 1.26 1.26 0 0 0-.925.379 1.25 1.25 0 0 0-.38.92c0 .36.127.667.38.92.254.252.562.378.925.378Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="m13.37 9.12 1.69 1.69 2.99-2.99-3.73-3.73-.95-.95-7.66 7.66-.95.95 3.99 3.99v3.44h7.55v-3.55l-4.72-4.72 1.79-1.79Zm-.91-2.99.91-.91 2.6 2.6-.91.91-2.6-2.6Zm-2.25 10.24h3.74l-1.34-1.34-.04-.04h-2.5l-3.25-3.25 4.59-4.59.92.92L9.5 10.9l5.33 5.33v1.48H10.2v-1.35l.01.01ZM2 2v4.99h1.41V3.4h3.58V2H2ZM22.21 2h-4.98v1.41h3.59v3.58h1.4V2h-.01ZM20.81 20.65h-3.58v1.4h4.98v-4.99h-1.4v3.59ZM3.4 17.06H2v4.98h4.99v-1.4H3.4v-3.58Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M15.306 2.768c0-.424.344-.768.768-.768h.406C19.53 2 22 4.551 22 7.699c0 3.237-2.51 5.587-5.31 5.703-.84 1.595-2.478 2.677-4.36 2.677a4.845 4.845 0 0 1-3.146-1.163c-.6 1.783 0 3.922 1.79 4.99 1.929 1.149 4.395.467 5.508-1.524l.212-.378a.75.75 0 1 1 1.308.732l-.231.414c-1.524 2.725-4.9 3.66-7.54 2.085-2.716-1.618-3.432-5.037-2.129-7.599a5.22 5.22 0 0 1-.73-2.677c0-2.192 1.335-4.063 3.212-4.793-1.195-1.427-3.29-1.96-5.08-.892-1.928 1.15-2.589 3.696-1.475 5.687l.231.413a.75.75 0 0 1-1.308.732l-.212-.377c-1.524-2.726-.62-6.211 2.02-7.785 2.716-1.619 5.943-.55 7.44 1.897l.13-.001c2.739 0 4.96 2.292 4.96 5.12 0 .284-.023.563-.066.834 1.795-.354 3.288-1.96 3.288-4.095 0-2.3-1.805-4.163-4.032-4.163h-.406a.768.768 0 0 1-.768-.768Zm.496 8.191c0 .286-.033.564-.094.831a3.62 3.62 0 0 1-.672 1.415 3.425 3.425 0 0 1-2.706 1.338 3.402 3.402 0 0 1-2.384-.98 3.598 3.598 0 0 1-.852-1.306 3.677 3.677 0 0 1-.235-1.298c0-1.623 1.046-2.994 2.48-3.435a3.37 3.37 0 0 1 1.522-.107c1.665.264 2.94 1.75 2.94 3.542Z" /></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z" fill="#fff" fill-opacity=".56"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.953 5.09a1.497 1.497 0 0 0-1.653-.518l-1.35.43a1.504 1.504 0 0 0-1.726-.376L2.858 6.97c-.736.321-1.06 1.155-.726 1.862.334.707 1.202 1.02 1.937.698l4.27-1.865 1.466 1.973v.402c0 .873-.627 1.63-1.512 1.827l-2.56.567c-1.329.295-2.27 1.431-2.27 2.74v.107c0 .26.22.469.489.469h11.117c1.329 0 2.618.435 3.656 1.233l1.665 1.28A1 1 0 0 0 22 17.47V11.062c0-.312-.108-.616-.308-.863l-3.415-4.218a1.5 1.5 0 0 0-1.618-.471l-.378.12-.866-.475a1.516 1.516 0 0 0-1.188-.114l-1.06.338-.214-.289Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M10.24 10.636 12 13.764l1.76-3.128h-3.52Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18.364 12a6.364 6.364 0 1 1-12.728 0 6.364 6.364 0 0 1 12.728 0ZM7.909 9.273 12 16.546l4.09-7.273H7.91Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-1.364 0a8.636 8.636 0 1 1-17.273 0 8.636 8.636 0 0 1 17.273 0Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.057 15.115c-1.681 0-3.111-.59-4.29-1.768C3.59 12.17 3 10.74 3 9.057c0-.29.021-.582.064-.876a4.1 4.1 0 0 1 .214-.844.78.78 0 0 1 .273-.36c.115-.077.244-.133.389-.168a.857.857 0 0 1 .437.008c.146.04.28.12.4.24l2.806 2.787 2.26-2.261-2.775-2.786a.903.903 0 0 1-.241-.405.875.875 0 0 1-.008-.442 1.13 1.13 0 0 1 .174-.389.82.82 0 0 1 .355-.273c.268-.107.548-.182.838-.224.29-.043.581-.064.871-.064 1.682 0 3.112.59 4.29 1.768 1.179 1.178 1.768 2.608 1.768 4.29 0 .444-.042.858-.126 1.241-.084.384-.21.755-.377 1.113l5.726 5.692A2.2 2.2 0 0 1 21 18.721a2.2 2.2 0 0 1-.662 1.617A2.2 2.2 0 0 1 18.72 21a2.173 2.173 0 0 1-1.617-.679l-5.692-5.709c-.372.161-.75.285-1.133.372-.383.087-.79.13-1.222.13Z" fill="#fff" fill-opacity=".56"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m10.6 13.8-2.15-2.15a.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275.948.948 0 0 0-.275.7c0 .283.092.517.275.7L9.9 15.9c.2.2.433.3.7.3.267 0 .5-.1.7-.3l5.65-5.65a.948.948 0 0 0 .275-.7.948.948 0 0 0-.275-.7.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275L10.6 13.8ZM12 22a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z" /></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M9 16h6c.283 0 .52-.096.713-.287A.968.968 0 0 0 16 15V9a.967.967 0 0 0-.287-.713A.968.968 0 0 0 15 8H9a.968.968 0 0 0-.713.287A.968.968 0 0 0 8 9v6c0 .283.096.52.287.713.192.191.43.287.713.287Zm3 6a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"/></svg>
@@ -17,6 +17,10 @@ export function makeShortErrorMessage(err: unknown) {
17
17
  }
18
18
  }
19
19
 
20
+ export function assertUnreachable(x: never, msg: string): never {
21
+ throw new Error(msg + ` ${JSON.stringify(x)}`)
22
+ }
23
+
20
24
  export function makeErrorMessage(err: unknown) {
21
25
  if (err instanceof AxiosError && err.code === "ERR_NETWORK") {
22
26
  return "Failed to connect to the server. Please check your internet connection."
@@ -12,5 +12,31 @@
12
12
  "Jogging.Cartesian.Orientation.lb": "Orientierung",
13
13
  "Jogging.JointLimitsReached.lb": "Gelenkgrenzen für Gelenk {{jointNumbers}} erreicht",
14
14
  "Jogging.Orientation.coordsys": "Base (Roboter)",
15
- "Jogging.Orientation.tool": "Tool"
15
+ "Jogging.Orientation.tool": "Tool",
16
+ "SafetyBar.ActivationToggle.Activate.bt": "Aktivieren",
17
+ "SafetyBar.ActivationToggle.Activated.bt": "Aktiviert",
18
+ "SafetyBar.ActivationToggle.Activating.bt": "Wird aktiviert…",
19
+ "SafetyBar.ActivationToggle.Deactivating.bt": "Wird deaktiviert…",
20
+ "SafetyBar.ControllerType.Physical.lb": "Physische Robotersteuerung",
21
+ "SafetyBar.ControllerType.Virtual.lb": "Virtuelle Robotersteuerung",
22
+ "SafetyBar.MotionGroup.Physical.Explanation.lb": "<code>{{motionGroupId}}</code> ist ein physische Robotersteuerung. Für die Bewegung dieses Roboters sind <strong>Sicherheitsmaßnahmen</strong> aktiv.",
23
+ "SafetyBar.MotionGroup.Virtual.Explanation.lb": "<1>{{motionGroupId}}</1> ist eine virtuelle Robotersteuerung ohne physisches Gegenstück. Der Roboter kann ohne Sicherheitsmaßnahmen bewegt werden.",
24
+ "SafetyBar.OperationMode.Auto.Explanation.lb": "Automatischer Betriebsmodus der Robotersteuerung aktiv. Automatisierte Bewegung ohne manuelle Bestätigung freigegeben.",
25
+ "SafetyBar.OperationMode.Automatic.ti": "Automatisch",
26
+ "SafetyBar.OperationMode.Error.Explanation.lb": "Fehler beim Abrufen des Betriebsmodus. Originalhandbediengerät des Roboters verwenden, um Fehler zu lösen.",
27
+ "SafetyBar.OperationMode.Error.lb": "Fehler",
28
+ "SafetyBar.OperationMode.Manual.Explanation.lb": "Die Robotersteuerung befindet sich im manuellen Betriebsmodus. \nBei einem physischen Roboter bedeutet dies im Allgemeinen, dass ein Freigabeschalter gedrückt werden muss, damit sich der Roboter erfolgreich bewegen kann.",
29
+ "SafetyBar.OperationMode.Manual.lb": "Manuell",
30
+ "SafetyBar.OperationMode.ti": "Betriebsmodus",
31
+ "SafetyBar.SafetyState.Error.Explanation.lb": "Die Robotersteuerung ist in einen unerwarteten Sicherheitszustand eingetreten.",
32
+ "SafetyBar.SafetyState.Error.lb": "Fehler",
33
+ "SafetyBar.SafetyState.Estop.lb": "NOT-AUS",
34
+ "SafetyBar.SafetyState.ManualActionRequired.Explanation.lb": "Die Robotersteuerung ist in einen Sicherheitszustand eingetreten, der manuelle Maßnahmen zur Behebung erfordert.",
35
+ "SafetyBar.SafetyState.ManualActionRequired.lb": "Aktion erforderlich",
36
+ "SafetyBar.SafetyState.Normal.Explanation.lb": "Die Robotersteuerung befindet sich in einem sicheren Zustand. Roboterbewegungen sind möglich.",
37
+ "SafetyBar.SafetyState.Normal.lb": "Sicher",
38
+ "SafetyBar.SafetyState.Stop.Explanation.lb": "Die Robotersteuerung ist in einen Stoppzustand übergegangen. Bis der Stoppzustand aufgelöst ist, ist keine Bewegung mehr möglich.",
39
+ "SafetyBar.SafetyState.Stop.lb": "Stopp",
40
+ "SafetyBar.SafetyState.ti": "Sicherheitszustand",
41
+ "SafetyBar.StopState.Estop.Explanation.lb": "NOT-AUS aktiviert. NOT-AUS freischalten, um Roboter zu bewegen."
16
42
  }
@@ -13,5 +13,31 @@
13
13
  "Jogging.Activating.lb": "Activating jogging",
14
14
  "Jogging.JointLimitsReached.lb": "Joint limit reached for joint {{jointNumbers}}",
15
15
  "Jogging.Orientation.coordsys": "Base",
16
- "Jogging.Orientation.tool": "Tool"
16
+ "Jogging.Orientation.tool": "Tool",
17
+ "SafetyBar.ActivationToggle.Activate.bt": "Activate",
18
+ "SafetyBar.ActivationToggle.Activated.bt": "Activated",
19
+ "SafetyBar.ActivationToggle.Activating.bt": "Activating",
20
+ "SafetyBar.ActivationToggle.Deactivating.bt": "Deactivating",
21
+ "SafetyBar.ControllerType.Physical.lb": "Physical controller",
22
+ "SafetyBar.ControllerType.Virtual.lb": "Virtual controller",
23
+ "SafetyBar.MotionGroup.Physical.Explanation.lb": "<code>{{motionGroupId}}</code> is a physical robot controller. <strong>Safety precautions</strong> are active for the movement of this robot.",
24
+ "SafetyBar.MotionGroup.Virtual.Explanation.lb": "<1>{{motionGroupId}}</1> is a virtual robot controller with no physical counterpart. It can be freely manipulated without safety precautions.",
25
+ "SafetyBar.OperationMode.Auto.Explanation.lb": "Automatic operation mode active. Automated movement without manual confirmation enabled.",
26
+ "SafetyBar.OperationMode.Automatic.ti": "Automatic",
27
+ "SafetyBar.OperationMode.Error.Explanation.lb": "Failed to get operation mode. Use the original control panel to resolve the error.",
28
+ "SafetyBar.OperationMode.Error.lb": "Error",
29
+ "SafetyBar.OperationMode.Manual.Explanation.lb": "The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully.",
30
+ "SafetyBar.OperationMode.Manual.lb": "Manual",
31
+ "SafetyBar.OperationMode.ti": "Operation mode",
32
+ "SafetyBar.SafetyState.Error.Explanation.lb": "The robot controller has entered an unexpected safety state.",
33
+ "SafetyBar.SafetyState.Error.lb": "Error",
34
+ "SafetyBar.SafetyState.Estop.lb": "E-Stop",
35
+ "SafetyBar.SafetyState.ManualActionRequired.Explanation.lb": "The robot controller has entered a safety state requiring manual action to resolve.",
36
+ "SafetyBar.SafetyState.ManualActionRequired.lb": "Action required",
37
+ "SafetyBar.SafetyState.Normal.Explanation.lb": "The robot controller is in a safe state. Robot movement is enabled.",
38
+ "SafetyBar.SafetyState.Normal.lb": "Safe",
39
+ "SafetyBar.SafetyState.Stop.Explanation.lb": "The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved.",
40
+ "SafetyBar.SafetyState.Stop.lb": "Stop",
41
+ "SafetyBar.SafetyState.ti": "Safety state",
42
+ "SafetyBar.StopState.Estop.Explanation.lb": "An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released."
17
43
  }
package/src/index.ts CHANGED
@@ -13,6 +13,7 @@ export * from "./components/robots/AxisConfig"
13
13
  export * from "./components/robots/Robot"
14
14
  export { defaultGetModel } from "./components/robots/robotModelLogic"
15
15
  export * from "./components/robots/SupportedRobot"
16
+ export * from "./components/safetyBar/SafetyBar"
16
17
  export * from "./components/SelectableFab"
17
18
  export * from "./components/utils/hooks"
18
19
  export * from "./components/VelocitySlider"