@wandelbots/wandelbots-js-react-components 1.19.2 → 1.20.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/LoadingButton.d.ts +1 -1
- package/dist/components/SelectableFab.d.ts +7 -0
- package/dist/components/SelectableFab.d.ts.map +1 -0
- package/dist/components/VelocitySlider.d.ts.map +1 -1
- package/dist/components/jogging/JoggingActivationRequired.d.ts.map +1 -1
- package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +3 -2
- package/dist/components/jogging/JoggingCartesianAxisControl.d.ts.map +1 -1
- package/dist/components/jogging/JoggingCartesianTab.d.ts +2 -3
- package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingOptions.d.ts.map +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
- package/dist/index.cjs +29 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15008 -14844
- package/dist/index.js.map +1 -1
- package/dist/themes/createDarkTheme.d.ts +3 -0
- package/dist/themes/createDarkTheme.d.ts.map +1 -0
- package/dist/themes/createLightTheme.d.ts +2 -0
- package/dist/themes/createLightTheme.d.ts.map +1 -0
- package/dist/themes/themeTypes.d.ts +74 -0
- package/dist/themes/themeTypes.d.ts.map +1 -0
- package/dist/themes/theming.d.ts +0 -30
- package/dist/themes/theming.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/SelectableFab.tsx +47 -0
- package/src/components/VelocitySlider.tsx +1 -0
- package/src/components/jogging/JoggingActivationRequired.tsx +4 -3
- package/src/components/jogging/JoggingCartesianAxisControl.tsx +41 -28
- package/src/components/jogging/JoggingCartesianTab.tsx +16 -8
- package/src/components/jogging/JoggingOptions.tsx +10 -4
- package/src/components/jogging/JoggingPanel.tsx +15 -18
- package/src/index.ts +9 -7
- package/src/themes/createDarkTheme.ts +223 -0
- package/src/themes/createLightTheme.ts +8 -0
- package/src/themes/themeTypes.ts +79 -0
- package/src/themes/theming.ts +3 -153
- package/src/themes/themeTypes.d.ts +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDarkTheme.d.ts","sourceRoot":"","sources":["../../src/themes/createDarkTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,eAAe,CAAA;AAEvD,wBAAgB,eAAe,IAAI,KAAK,CA4NvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLightTheme.d.ts","sourceRoot":"","sources":["../../src/themes/createLightTheme.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,kCAK/B"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
type NovaColorPaletteExtension = {
|
|
2
|
+
paletteExt?: {
|
|
3
|
+
primary?: {
|
|
4
|
+
hover?: string;
|
|
5
|
+
selected?: string;
|
|
6
|
+
focus?: string;
|
|
7
|
+
focusVisible?: string;
|
|
8
|
+
outlineBorder?: string;
|
|
9
|
+
};
|
|
10
|
+
secondary?: {
|
|
11
|
+
tonal?: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export interface AxisControlComponentColors {
|
|
16
|
+
color?: string;
|
|
17
|
+
borderColor?: string;
|
|
18
|
+
backgroundColor?: string;
|
|
19
|
+
buttonBackgroundColor?: string;
|
|
20
|
+
}
|
|
21
|
+
interface NovaComponentsExtension {
|
|
22
|
+
componentsExt?: {
|
|
23
|
+
JoggingCartesian?: {
|
|
24
|
+
Axis?: {
|
|
25
|
+
X?: AxisControlComponentColors;
|
|
26
|
+
Y?: AxisControlComponentColors;
|
|
27
|
+
Z?: AxisControlComponentColors;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
interface BackgroundPaperElevation {
|
|
33
|
+
0?: string;
|
|
34
|
+
1?: string;
|
|
35
|
+
2?: string;
|
|
36
|
+
3?: string;
|
|
37
|
+
4?: string;
|
|
38
|
+
5?: string;
|
|
39
|
+
6?: string;
|
|
40
|
+
7?: string;
|
|
41
|
+
8?: string;
|
|
42
|
+
9?: string;
|
|
43
|
+
10?: string;
|
|
44
|
+
11?: string;
|
|
45
|
+
12?: string;
|
|
46
|
+
13?: string;
|
|
47
|
+
14?: string;
|
|
48
|
+
15?: string;
|
|
49
|
+
16?: string;
|
|
50
|
+
17?: string;
|
|
51
|
+
18?: string;
|
|
52
|
+
19?: string;
|
|
53
|
+
20?: string;
|
|
54
|
+
21?: string;
|
|
55
|
+
22?: string;
|
|
56
|
+
23?: string;
|
|
57
|
+
24?: string;
|
|
58
|
+
}
|
|
59
|
+
declare module "@mui/material/styles" {
|
|
60
|
+
interface Palette {
|
|
61
|
+
tertiary: Palette["primary"];
|
|
62
|
+
backgroundPaperElevation?: BackgroundPaperElevation;
|
|
63
|
+
}
|
|
64
|
+
interface PaletteOptions {
|
|
65
|
+
tertiary?: PaletteOptions["primary"];
|
|
66
|
+
backgroundPaperElevation?: BackgroundPaperElevation;
|
|
67
|
+
}
|
|
68
|
+
interface Theme extends NovaComponentsExtension, NovaColorPaletteExtension {
|
|
69
|
+
}
|
|
70
|
+
interface ThemeOptions extends NovaComponentsExtension, NovaColorPaletteExtension {
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=themeTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeTypes.d.ts","sourceRoot":"","sources":["../../src/themes/themeTypes.ts"],"names":[],"mappings":"AAAA,KAAK,yBAAyB,GAAG;IAC/B,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE;YACR,KAAK,CAAC,EAAE,MAAM,CAAA;YACd,QAAQ,CAAC,EAAE,MAAM,CAAA;YACjB,KAAK,CAAC,EAAE,MAAM,CAAA;YACd,YAAY,CAAC,EAAE,MAAM,CAAA;YACrB,aAAa,CAAC,EAAE,MAAM,CAAA;SACvB,CAAA;QACD,SAAS,CAAC,EAAE;YACV,KAAK,CAAC,EAAE,MAAM,CAAA;SACf,CAAA;KACF,CAAA;CACF,CAAA;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAA;CAC/B;AAED,UAAU,uBAAuB;IAC/B,aAAa,CAAC,EAAE;QACd,gBAAgB,CAAC,EAAE;YACjB,IAAI,CAAC,EAAE;gBACL,CAAC,CAAC,EAAE,0BAA0B,CAAA;gBAC9B,CAAC,CAAC,EAAE,0BAA0B,CAAA;gBAC9B,CAAC,CAAC,EAAE,0BAA0B,CAAA;aAC/B,CAAA;SACF,CAAA;KACF,CAAA;CACF;AAED,UAAU,wBAAwB;IAChC,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,OAAO;QACf,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;QAC5B,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;KACpD;IAED,UAAU,cAAc;QACtB,QAAQ,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;QACpC,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;KACpD;IAED,UAAU,KAAM,SAAQ,uBAAuB,EAAE,yBAAyB;KAAG;IAE7E,UAAU,YACR,SAAQ,uBAAuB,EAC7B,yBAAyB;KAAG;CACjC"}
|
package/dist/themes/theming.d.ts
CHANGED
|
@@ -1,34 +1,4 @@
|
|
|
1
1
|
import type { Theme, ThemeOptions } from "@mui/material/styles";
|
|
2
|
-
/**
|
|
3
|
-
* Settings used to construct the Nova default theme.
|
|
4
|
-
* The dark theme is the default and defines the structure of the
|
|
5
|
-
* settings.
|
|
6
|
-
*/
|
|
7
|
-
export declare const novaDarkSettings: {
|
|
8
|
-
mode: "dark" | "light";
|
|
9
|
-
colors: {
|
|
10
|
-
primary: string;
|
|
11
|
-
textDefault: string;
|
|
12
|
-
textSubtle: string;
|
|
13
|
-
background: {
|
|
14
|
-
default: string;
|
|
15
|
-
panel: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export type NovaThemeSettings = typeof novaDarkSettings;
|
|
20
|
-
export declare const novaLightSettings: {
|
|
21
|
-
mode: "light";
|
|
22
|
-
colors: {
|
|
23
|
-
primary: string;
|
|
24
|
-
textDefault: string;
|
|
25
|
-
textSubtle: string;
|
|
26
|
-
background: {
|
|
27
|
-
default: string;
|
|
28
|
-
panel: string;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
2
|
/**
|
|
33
3
|
* Create the default Wandelbots Nova Material UI theme, overriding
|
|
34
4
|
* any defaults with the provided theme options.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theming.d.ts","sourceRoot":"","sources":["../../src/themes/theming.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"theming.d.ts","sourceRoot":"","sources":["../../src/themes/theming.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAI/D;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,GAAG,KAAK,CAW5D"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Fab, styled, type FabProps } from "@mui/material"
|
|
2
|
+
|
|
3
|
+
const StyledSelectableFab = styled(Fab, {
|
|
4
|
+
shouldForwardProp: (prop) => prop !== "selected",
|
|
5
|
+
})<CodeFabProps>(({ theme }) => ({
|
|
6
|
+
borderRadius: "20px",
|
|
7
|
+
|
|
8
|
+
"&:hover": {
|
|
9
|
+
background: theme.palette.backgroundPaperElevation?.[7],
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
variants: [
|
|
13
|
+
{
|
|
14
|
+
props: ({ selected }) => !selected,
|
|
15
|
+
style: {
|
|
16
|
+
background: theme.palette.backgroundPaperElevation?.[0],
|
|
17
|
+
color: theme.palette.action.disabled,
|
|
18
|
+
"> img": {
|
|
19
|
+
opacity: 0.4,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
props: ({ selected }) => selected,
|
|
25
|
+
style: {
|
|
26
|
+
background: theme.palette.backgroundPaperElevation?.[11],
|
|
27
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
28
|
+
color: theme.palette.primary.contrastText,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
}))
|
|
33
|
+
|
|
34
|
+
type CodeFabProps = {
|
|
35
|
+
selected?: boolean
|
|
36
|
+
} & Omit<FabProps, "variant" | "color">
|
|
37
|
+
|
|
38
|
+
export function SelectableFab({ selected, ...props }: CodeFabProps) {
|
|
39
|
+
return (
|
|
40
|
+
<StyledSelectableFab
|
|
41
|
+
selected={selected}
|
|
42
|
+
{...props}
|
|
43
|
+
color={"secondary"}
|
|
44
|
+
variant="circular"
|
|
45
|
+
/>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, Stack } from "@mui/material"
|
|
1
|
+
import { Button, Stack, useTheme } from "@mui/material"
|
|
2
2
|
import { observer } from "mobx-react-lite"
|
|
3
3
|
import type React from "react"
|
|
4
4
|
import { useTranslation } from "react-i18next"
|
|
@@ -9,6 +9,7 @@ import type { JoggingStore } from "./JoggingStore"
|
|
|
9
9
|
export const JoggingActivationRequired = observer(
|
|
10
10
|
({ store, children }: { store: JoggingStore; children: React.ReactNode }) => {
|
|
11
11
|
const { t } = useTranslation()
|
|
12
|
+
const theme = useTheme()
|
|
12
13
|
|
|
13
14
|
function renderOverlay() {
|
|
14
15
|
if (store.activationState === "inactive" && !store.activationError) {
|
|
@@ -16,7 +17,7 @@ export const JoggingActivationRequired = observer(
|
|
|
16
17
|
<TransparentOverlay
|
|
17
18
|
sx={{
|
|
18
19
|
borderRadius: "6px",
|
|
19
|
-
backgroundColor:
|
|
20
|
+
backgroundColor: `color-mix(in srgb, ${theme.palette.backgroundPaperElevation?.[5]}, transparent)`,
|
|
20
21
|
}}
|
|
21
22
|
>
|
|
22
23
|
<Button
|
|
@@ -33,7 +34,7 @@ export const JoggingActivationRequired = observer(
|
|
|
33
34
|
return (
|
|
34
35
|
<TransparentOverlay
|
|
35
36
|
sx={{
|
|
36
|
-
backgroundColor:
|
|
37
|
+
backgroundColor: `color-mix(in srgb, ${theme.palette.backgroundPaperElevation?.[5]}, transparent)`,
|
|
37
38
|
}}
|
|
38
39
|
>
|
|
39
40
|
<LoadingCover
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Add, Remove } from "@mui/icons-material"
|
|
2
|
+
import { IconButton, Typography } from "@mui/material"
|
|
2
3
|
import Stack from "@mui/material/Stack"
|
|
3
4
|
import { observer } from "mobx-react-lite"
|
|
4
5
|
import { useRef, type ReactNode } from "react"
|
|
5
|
-
import { useAnimationFrame } from "../utils/hooks"
|
|
6
6
|
import { externalizeComponent } from "../../externalizeComponent"
|
|
7
|
+
import type { AxisControlComponentColors } from "../../themes/themeTypes"
|
|
8
|
+
import { useAnimationFrame } from "../utils/hooks"
|
|
7
9
|
|
|
8
10
|
type JoggingCartesianAxisControlProps = {
|
|
9
|
-
|
|
11
|
+
colors?: AxisControlComponentColors
|
|
10
12
|
label: ReactNode
|
|
11
13
|
getDisplayedValue: () => string
|
|
12
14
|
startJogging: (direction: "-" | "+") => void
|
|
@@ -17,7 +19,7 @@ type JoggingCartesianAxisControlProps = {
|
|
|
17
19
|
export const JoggingCartesianAxisControl = externalizeComponent(
|
|
18
20
|
observer(
|
|
19
21
|
({
|
|
20
|
-
|
|
22
|
+
colors,
|
|
21
23
|
label,
|
|
22
24
|
getDisplayedValue,
|
|
23
25
|
startJogging,
|
|
@@ -35,8 +37,6 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
35
37
|
|
|
36
38
|
const valueContainerRef = useRef<HTMLParagraphElement>(null)
|
|
37
39
|
|
|
38
|
-
color = color || "#F14D42"
|
|
39
|
-
|
|
40
40
|
function onPointerDownMinus(ev: React.PointerEvent) {
|
|
41
41
|
// Stop right click from triggering jog
|
|
42
42
|
if (ev.button === 0) startJogging("-")
|
|
@@ -46,35 +46,46 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
46
46
|
if (ev.button === 0) startJogging("+")
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
if (!colors) {
|
|
50
|
+
colors = {
|
|
51
|
+
color: "#fff",
|
|
52
|
+
backgroundColor: "#000",
|
|
53
|
+
borderColor: "#000",
|
|
54
|
+
buttonBackgroundColor: "#000",
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
49
58
|
return (
|
|
50
|
-
<Stack height="72px" direction="row" {...rest}>
|
|
51
|
-
<
|
|
59
|
+
<Stack height="72px" direction="row" justifyContent="center" {...rest}>
|
|
60
|
+
<IconButton
|
|
52
61
|
onPointerDown={onPointerDownMinus}
|
|
53
62
|
onPointerUp={stopJogging}
|
|
54
63
|
onPointerOut={stopJogging}
|
|
55
64
|
disabled={disabled}
|
|
65
|
+
size="large"
|
|
56
66
|
sx={{
|
|
57
|
-
width: "
|
|
58
|
-
backgroundColor:
|
|
59
|
-
color:
|
|
67
|
+
width: "55px",
|
|
68
|
+
backgroundColor: colors.buttonBackgroundColor,
|
|
69
|
+
color: colors.color,
|
|
60
70
|
alignContent: "center",
|
|
61
71
|
fontSize: "37px",
|
|
62
72
|
borderRadius: "16px 0px 0px 16px",
|
|
63
|
-
|
|
73
|
+
borderLeft: `2px solid ${colors.borderColor ?? "#fff"}`,
|
|
74
|
+
borderBottom: `2px solid ${colors.borderColor ?? "#fff"}`,
|
|
75
|
+
borderTop: `2px solid ${colors.borderColor ?? "#fff"}`,
|
|
64
76
|
":hover": {
|
|
65
|
-
|
|
66
|
-
backgroundColor: color,
|
|
77
|
+
backgroundColor: colors.buttonBackgroundColor,
|
|
67
78
|
},
|
|
68
79
|
}}
|
|
69
80
|
>
|
|
70
|
-
|
|
71
|
-
</
|
|
81
|
+
<Remove />
|
|
82
|
+
</IconButton>
|
|
72
83
|
|
|
73
84
|
<Stack
|
|
74
85
|
spacing="6px"
|
|
75
86
|
sx={{
|
|
76
|
-
width: "
|
|
77
|
-
backgroundColor:
|
|
87
|
+
width: "150px",
|
|
88
|
+
backgroundColor: colors.backgroundColor,
|
|
78
89
|
alignItems: "center",
|
|
79
90
|
justifyContent: "center",
|
|
80
91
|
opacity: "0.9",
|
|
@@ -94,7 +105,7 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
94
105
|
height="22px"
|
|
95
106
|
sx={{
|
|
96
107
|
fontSize: "15px",
|
|
97
|
-
color:
|
|
108
|
+
color: colors.color,
|
|
98
109
|
}}
|
|
99
110
|
ref={valueContainerRef}
|
|
100
111
|
>
|
|
@@ -102,27 +113,29 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
102
113
|
</Typography>
|
|
103
114
|
</Stack>
|
|
104
115
|
|
|
105
|
-
<
|
|
116
|
+
<IconButton
|
|
106
117
|
onPointerDown={onPointerDownPlus}
|
|
107
118
|
onPointerUp={stopJogging}
|
|
108
119
|
onPointerOut={stopJogging}
|
|
109
120
|
disabled={disabled}
|
|
121
|
+
size="large"
|
|
110
122
|
sx={{
|
|
111
|
-
width: "
|
|
112
|
-
backgroundColor:
|
|
113
|
-
color:
|
|
123
|
+
width: "55px",
|
|
124
|
+
backgroundColor: colors.buttonBackgroundColor,
|
|
125
|
+
color: colors.color,
|
|
114
126
|
alignContent: "center",
|
|
115
127
|
fontSize: "37px",
|
|
116
128
|
borderRadius: "0px 16px 16px 0px",
|
|
117
|
-
|
|
129
|
+
borderRight: `2px solid ${colors.borderColor ?? "#fff"}`,
|
|
130
|
+
borderBottom: `2px solid ${colors.borderColor ?? "#fff"}`,
|
|
131
|
+
borderTop: `2px solid ${colors.borderColor ?? "#fff"}`,
|
|
118
132
|
":hover": {
|
|
119
|
-
|
|
120
|
-
backgroundColor: color,
|
|
133
|
+
backgroundColor: colors.buttonBackgroundColor,
|
|
121
134
|
},
|
|
122
135
|
}}
|
|
123
136
|
>
|
|
124
|
-
|
|
125
|
-
</
|
|
137
|
+
<Add />
|
|
138
|
+
</IconButton>
|
|
126
139
|
</Stack>
|
|
127
140
|
)
|
|
128
141
|
},
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
ToggleButton,
|
|
4
4
|
ToggleButtonGroup,
|
|
5
5
|
Typography,
|
|
6
|
+
useTheme,
|
|
6
7
|
} from "@mui/material"
|
|
7
8
|
import { degreesToRadians, radiansToDegrees } from "@wandelbots/wandelbots-js"
|
|
8
9
|
import { observer } from "mobx-react-lite"
|
|
9
|
-
import type { ReactNode } from "react"
|
|
10
10
|
import { useTranslation } from "react-i18next"
|
|
11
11
|
import XAxisIcon from "../../icons/axis-x.svg"
|
|
12
12
|
import YAxisIcon from "../../icons/axis-y.svg"
|
|
@@ -28,8 +28,15 @@ type JoggingCartesianOpts = {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export const JoggingCartesianTab = observer(
|
|
31
|
-
({
|
|
31
|
+
({
|
|
32
|
+
store,
|
|
33
|
+
children,
|
|
34
|
+
}: {
|
|
35
|
+
store: JoggingStore
|
|
36
|
+
children?: React.ReactNode
|
|
37
|
+
}) => {
|
|
32
38
|
const { t } = useTranslation()
|
|
39
|
+
const theme = useTheme()
|
|
33
40
|
|
|
34
41
|
function onMotionTypeChange(
|
|
35
42
|
_event: React.MouseEvent<HTMLElement>,
|
|
@@ -119,17 +126,17 @@ export const JoggingCartesianTab = observer(
|
|
|
119
126
|
const axisList = [
|
|
120
127
|
{
|
|
121
128
|
id: "x",
|
|
122
|
-
|
|
129
|
+
colors: theme.componentsExt?.JoggingCartesian?.Axis?.X,
|
|
123
130
|
icon: <XAxisIcon />,
|
|
124
131
|
},
|
|
125
132
|
{
|
|
126
133
|
id: "y",
|
|
127
|
-
|
|
134
|
+
colors: theme.componentsExt?.JoggingCartesian?.Axis?.Y,
|
|
128
135
|
icon: <YAxisIcon />,
|
|
129
136
|
},
|
|
130
137
|
{
|
|
131
138
|
id: "z",
|
|
132
|
-
|
|
139
|
+
colors: theme.componentsExt?.JoggingCartesian?.Axis?.Z,
|
|
133
140
|
icon: <ZAxisIcon />,
|
|
134
141
|
},
|
|
135
142
|
] as const
|
|
@@ -145,7 +152,7 @@ export const JoggingCartesianTab = observer(
|
|
|
145
152
|
}
|
|
146
153
|
|
|
147
154
|
return (
|
|
148
|
-
<Stack flexGrow={1}
|
|
155
|
+
<Stack flexGrow={1} gap={4}>
|
|
149
156
|
<Stack>
|
|
150
157
|
{/* Show Wandelscript string for the current coords */}
|
|
151
158
|
<JoggingCartesianValues store={store} />
|
|
@@ -169,6 +176,7 @@ export const JoggingCartesianTab = observer(
|
|
|
169
176
|
onChange={onMotionTypeChange}
|
|
170
177
|
exclusive
|
|
171
178
|
aria-label={t("Jogging.Cartesian.MotionType.lb")}
|
|
179
|
+
sx={{ justifyContent: "center" }}
|
|
172
180
|
>
|
|
173
181
|
<ToggleButton value="translate">
|
|
174
182
|
{t("Jogging.Cartesian.Translation.bt")}
|
|
@@ -194,7 +202,7 @@ export const JoggingCartesianTab = observer(
|
|
|
194
202
|
axisList.map((axis) => (
|
|
195
203
|
<JoggingCartesianAxisControl
|
|
196
204
|
key={axis.id}
|
|
197
|
-
|
|
205
|
+
colors={axis.colors}
|
|
198
206
|
disabled={store.isLocked}
|
|
199
207
|
label={
|
|
200
208
|
<>
|
|
@@ -231,7 +239,7 @@ export const JoggingCartesianTab = observer(
|
|
|
231
239
|
axisList.map((axis) => (
|
|
232
240
|
<JoggingCartesianAxisControl
|
|
233
241
|
key={axis.id}
|
|
234
|
-
|
|
242
|
+
colors={axis.colors}
|
|
235
243
|
disabled={store.isLocked}
|
|
236
244
|
label={
|
|
237
245
|
<>
|
|
@@ -44,6 +44,8 @@ export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
|
|
|
44
44
|
<Select
|
|
45
45
|
labelId="jogging-coord-select"
|
|
46
46
|
value={store.selectedCoordSystemId}
|
|
47
|
+
size="small"
|
|
48
|
+
variant="filled"
|
|
47
49
|
displayEmpty={true}
|
|
48
50
|
onChange={(event) => {
|
|
49
51
|
store.setSelectedCoordSystemId(event.target.value as string)
|
|
@@ -64,6 +66,8 @@ export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
|
|
|
64
66
|
<Select
|
|
65
67
|
labelId="jogging-tcp-select"
|
|
66
68
|
value={store.selectedTcpId}
|
|
69
|
+
size="small"
|
|
70
|
+
variant="filled"
|
|
67
71
|
onChange={(event) => {
|
|
68
72
|
store.setSelectedTcpId(event.target.value as string)
|
|
69
73
|
}}
|
|
@@ -92,7 +96,7 @@ export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
|
|
|
92
96
|
}}
|
|
93
97
|
>
|
|
94
98
|
{/* Orientation */}
|
|
95
|
-
<Stack width="
|
|
99
|
+
<Stack width="50%">
|
|
96
100
|
<InputLabel id="orientation-select">
|
|
97
101
|
{t("Jogging.Cartesian.Orientation.lb")}
|
|
98
102
|
</InputLabel>
|
|
@@ -103,20 +107,22 @@ export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
|
|
|
103
107
|
aria-labelledby="orientation-select"
|
|
104
108
|
disabled={store.isLocked}
|
|
105
109
|
>
|
|
106
|
-
<ToggleButton value="coordsys">
|
|
110
|
+
<ToggleButton value="coordsys" sx={{ flexGrow: 1 }}>
|
|
107
111
|
<OrientationCoordSysIcon />
|
|
108
112
|
</ToggleButton>
|
|
109
|
-
<ToggleButton value="tool">
|
|
113
|
+
<ToggleButton value="tool" sx={{ flexGrow: 1 }}>
|
|
110
114
|
<OrientationToolIcon />
|
|
111
115
|
</ToggleButton>
|
|
112
116
|
</ToggleButtonGroup>
|
|
113
117
|
</Stack>
|
|
114
118
|
|
|
115
119
|
{/* Increment selection */}
|
|
116
|
-
<Stack width="
|
|
120
|
+
<Stack width="50%">
|
|
117
121
|
<InputLabel id="jogging-increment-select">{"Increment"}</InputLabel>
|
|
118
122
|
<Select
|
|
119
123
|
labelId="jogging-increment-select"
|
|
124
|
+
size="small"
|
|
125
|
+
variant="filled"
|
|
120
126
|
value={store.activeDiscreteIncrement?.id || "continuous"}
|
|
121
127
|
onChange={(event) => {
|
|
122
128
|
store.setSelectedIncrementId(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Paper, Stack, Tab, Tabs } from "@mui/material"
|
|
1
|
+
import { Paper, Stack, Tab, Tabs, useTheme } from "@mui/material"
|
|
2
2
|
import { NovaClient } from "@wandelbots/wandelbots-js"
|
|
3
3
|
import { isString } from "lodash-es"
|
|
4
4
|
import { runInAction } from "mobx"
|
|
@@ -29,6 +29,8 @@ export type JoggingPanelProps = {
|
|
|
29
29
|
*/
|
|
30
30
|
export const JoggingPanel = externalizeComponent(
|
|
31
31
|
observer((props: JoggingPanelProps) => {
|
|
32
|
+
const theme = useTheme()
|
|
33
|
+
|
|
32
34
|
const nova = isString(props.nova)
|
|
33
35
|
? new NovaClient({ instanceUrl: props.nova })
|
|
34
36
|
: props.nova
|
|
@@ -86,22 +88,13 @@ export const JoggingPanel = externalizeComponent(
|
|
|
86
88
|
height: "100%",
|
|
87
89
|
}}
|
|
88
90
|
>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
{state.
|
|
95
|
-
|
|
96
|
-
{props.children}
|
|
97
|
-
</JoggingPanelInner>
|
|
98
|
-
) : (
|
|
99
|
-
<LoadingCover
|
|
100
|
-
message="Loading jogging"
|
|
101
|
-
error={state.loadingError}
|
|
102
|
-
/>
|
|
103
|
-
)}
|
|
104
|
-
</Paper>
|
|
91
|
+
{state.joggingStore ? (
|
|
92
|
+
<JoggingPanelInner store={state.joggingStore}>
|
|
93
|
+
{props.children}
|
|
94
|
+
</JoggingPanelInner>
|
|
95
|
+
) : (
|
|
96
|
+
<LoadingCover message="Loading jogging" error={state.loadingError} />
|
|
97
|
+
)}
|
|
105
98
|
</Stack>
|
|
106
99
|
)
|
|
107
100
|
}),
|
|
@@ -166,7 +159,11 @@ const JoggingPanelInner = observer(
|
|
|
166
159
|
return (
|
|
167
160
|
<Stack flexGrow={1} height="100%">
|
|
168
161
|
{/* Tab selection */}
|
|
169
|
-
<Tabs
|
|
162
|
+
<Tabs
|
|
163
|
+
value={store.tabIndex}
|
|
164
|
+
onChange={store.onTabChange}
|
|
165
|
+
variant="fullWidth"
|
|
166
|
+
>
|
|
170
167
|
{store.tabs.map((tab) => (
|
|
171
168
|
<Tab
|
|
172
169
|
key={tab.id}
|
package/src/index.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
export * from "./components/wandelscript-editor/WandelscriptEditor"
|
|
2
|
-
export * from "./components/robots/SupportedRobot"
|
|
3
|
-
export * from "./components/robots/Robot"
|
|
4
1
|
export * from "./components/3d-viewport/PresetEnvironment"
|
|
5
2
|
export * from "./components/3d-viewport/SafetyZonesRenderer"
|
|
6
3
|
export * from "./components/jogging/JoggingCartesianAxisControl"
|
|
7
4
|
export * from "./components/jogging/JoggingJointRotationControl"
|
|
8
|
-
export type { JoggingStore } from "./components/jogging/JoggingStore"
|
|
9
5
|
export * from "./components/jogging/JoggingPanel"
|
|
10
|
-
export
|
|
6
|
+
export type { JoggingStore } from "./components/jogging/JoggingStore"
|
|
7
|
+
export * from "./components/LoadingCover"
|
|
11
8
|
export * from "./components/modal/NoMotionGroupModal"
|
|
12
|
-
export * from "./components/utils/hooks"
|
|
13
9
|
export * from "./components/robots/AxisConfig"
|
|
14
|
-
export * from "./components/
|
|
10
|
+
export * from "./components/robots/Robot"
|
|
11
|
+
export * from "./components/robots/SupportedRobot"
|
|
12
|
+
export * from "./components/SelectableFab"
|
|
13
|
+
export * from "./components/utils/hooks"
|
|
14
|
+
export * from "./components/VelocitySlider"
|
|
15
|
+
export * from "./components/wandelscript-editor/WandelscriptEditor"
|
|
16
|
+
export * from "./themes/themeTypes"
|
|
15
17
|
export { createNovaMuiTheme } from "./themes/theming"
|