@wandelbots/wandelbots-js-react-components 1.10.3 → 1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wandelbots/wandelbots-js-react-components",
3
- "version": "1.10.3",
3
+ "version": "1.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,
@@ -1,7 +1,7 @@
1
1
  // TODO implement this as part of theme?
2
2
 
3
3
  import { Select, useTheme, type SxProps } from "@mui/material"
4
- import { defaultsDeep } from "lodash-es"
4
+ import defaultsDeep from "lodash-es/defaultsDeep"
5
5
 
6
6
  type ThemeSelectProps = {
7
7
  kind: "filled" | "outlined" | "text"
@@ -1,5 +1,5 @@
1
1
  import Slider from "@mui/material/Slider"
2
- import { isNumber } from "lodash-es"
2
+ import isNumber from "lodash-es/isNumber"
3
3
  import { observer } from "mobx-react-lite"
4
4
  import { Stack, Typography, useTheme } from "@mui/material"
5
5
 
@@ -1,7 +1,7 @@
1
1
  import { Typography } from "@mui/material"
2
2
  import { useTranslation } from "react-i18next"
3
3
  import { useState } from "react"
4
- import { isEqual } from "lodash-es"
4
+ import isEqual from "lodash-es/isEqual"
5
5
  import { useAnimationFrame } from "../utils/hooks"
6
6
  import type { JoggingStore } from "./JoggingStore"
7
7
 
@@ -5,7 +5,7 @@ import ChevronLeft from "@mui/icons-material/ChevronLeft"
5
5
  import ChevronRight from "@mui/icons-material/ChevronRight"
6
6
  import { useAnimationFrame } from "../utils/hooks"
7
7
  import { useState } from "react"
8
- import { throttle } from "lodash-es"
8
+ import throttle from "lodash-es/throttle"
9
9
  import { useTranslation } from "react-i18next"
10
10
 
11
11
  type JoggingJointRotationControlProps = {
@@ -1,4 +1,5 @@
1
- import { keyBy, uniqueId } from "lodash-es"
1
+ import keyBy from "lodash-es/keyBy"
2
+ import uniqueId from "lodash-es/uniqueId"
2
3
  import { autorun, makeAutoObservable, type IReactionDisposer } from "mobx"
3
4
  import type {
4
5
  CoordinateSystem,
@@ -0,0 +1,86 @@
1
+ import {
2
+ Button,
3
+ Dialog,
4
+ DialogActions,
5
+ DialogContent,
6
+ DialogTitle,
7
+ Stack,
8
+ Typography,
9
+ } from "@mui/material"
10
+ import { observer } from "mobx-react-lite"
11
+
12
+ function getBaseUrl(): string {
13
+ const currentUrl = window.location.href
14
+ return currentUrl.substring(
15
+ 0,
16
+ currentUrl.indexOf("/", currentUrl.indexOf("//") + 2),
17
+ )
18
+ }
19
+
20
+ export const NoMotionGroupModal = observer((baseUrl: string = getBaseUrl()) => {
21
+ return (
22
+ <Dialog
23
+ aria-labelledby="no-motion-group-modal-title"
24
+ open={true}
25
+ fullWidth
26
+ sx={{
27
+ "& .MuiModal-backdrop": {
28
+ backdropFilter: "blur(10px)",
29
+ },
30
+ "& .MuiDialog-paper": {
31
+ "::before": {
32
+ content: '""',
33
+ height: "8px",
34
+ width: "100%",
35
+ background: "linear-gradient(90deg, #FF0E65 0%, #47D3FF 100%)",
36
+ },
37
+ background: "#101629",
38
+ },
39
+ }}
40
+ >
41
+ <DialogTitle id="no-motion-group-modal-title">
42
+ No motion group found
43
+ </DialogTitle>
44
+
45
+ <DialogContent
46
+ sx={{
47
+ marginTop: "3rem",
48
+ marginBottom: "1.5rem",
49
+ textAlign: "center",
50
+ }}
51
+ >
52
+ <Typography color="#fff">Found no devices to connect to.</Typography>
53
+ <Typography color="#fff">
54
+ Please ensure a motion group has been created.
55
+ </Typography>
56
+ </DialogContent>
57
+
58
+ <DialogActions>
59
+ <Stack width="100%" maxWidth="300px" margin="auto" marginBottom="2rem">
60
+ <Button
61
+ href={`${baseUrl}/settings`}
62
+ variant="contained"
63
+ sx={{
64
+ borderRadius: "8px",
65
+ width: "100%",
66
+ }}
67
+ >
68
+ Go to settings app
69
+ </Button>
70
+ <Button
71
+ href={`${baseUrl}`}
72
+ variant="text"
73
+ sx={{
74
+ marginTop: "1rem",
75
+ color: "#fff",
76
+ textDecoration: "underline",
77
+ fontSize: "0.75rem",
78
+ }}
79
+ >
80
+ Back to Homescreen
81
+ </Button>
82
+ </Stack>
83
+ </DialogActions>
84
+ </Dialog>
85
+ )
86
+ })
package/src/index.ts CHANGED
@@ -37,5 +37,9 @@ export type * from "./components/VelocitySlider"
37
37
  import { VelocitySlider as VS } from "./components/VelocitySlider"
38
38
  export const VelocitySlider = externalizeComponent(VS)
39
39
 
40
+ export type * from "./components/modal/NoMotionGroupModal"
41
+ import { NoMotionGroupModal as NMGM } from "./components/modal/NoMotionGroupModal"
42
+ export const NoMotionGroupModal = externalizeComponent(NMGM)
43
+
40
44
  export * from "./components/utils/hooks"
41
45
  export * from "./components/robots/AxisConfig"
@@ -2,7 +2,7 @@
2
2
 
3
3
  import type { Theme } from "@mui/material/styles"
4
4
  import { createTheme } from "@mui/material/styles"
5
- import { defaultsDeep } from "lodash-es"
5
+ import defaultsDeep from "lodash-es/defaultsDeep"
6
6
 
7
7
  /**
8
8
  * The palette of named colors we pick from for