@wandelbots/wandelbots-js-react-components 1.16.1 → 1.16.2
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/LoadingCover.d.ts +4 -0
- package/dist/components/LoadingCover.d.ts.map +1 -1
- package/dist/index.cjs +19 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +976 -968
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/LoadingCover.tsx +13 -4
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { makeErrorMessage } from "./utils/errorHandling"
|
|
2
|
-
import { CircularProgress, Stack, useTheme } from "@mui/material"
|
|
2
|
+
import { capitalize, CircularProgress, Stack, useTheme } from "@mui/material"
|
|
3
|
+
import { lowerFirst } from "lodash-es"
|
|
3
4
|
import { useEffect, useState } from "react"
|
|
4
5
|
|
|
5
6
|
export const LoadingCover = (props: {
|
|
@@ -27,7 +28,10 @@ export const LoadingCover = (props: {
|
|
|
27
28
|
justifyContent="center"
|
|
28
29
|
>
|
|
29
30
|
{props.error ? (
|
|
30
|
-
<LoadingErrorMessage
|
|
31
|
+
<LoadingErrorMessage
|
|
32
|
+
loadingMessage={props.message}
|
|
33
|
+
error={props.error}
|
|
34
|
+
/>
|
|
31
35
|
) : (
|
|
32
36
|
<>
|
|
33
37
|
<CircularProgress sx={{ marginBottom: "24px" }} />
|
|
@@ -47,7 +51,10 @@ export const LoadingCover = (props: {
|
|
|
47
51
|
)
|
|
48
52
|
}
|
|
49
53
|
|
|
50
|
-
const LoadingErrorMessage = (props: {
|
|
54
|
+
export const LoadingErrorMessage = (props: {
|
|
55
|
+
loadingMessage?: string
|
|
56
|
+
error: unknown
|
|
57
|
+
}) => {
|
|
51
58
|
const errorMessage = makeErrorMessage(props.error)
|
|
52
59
|
const stack = props.error instanceof Error ? props.error.stack : null
|
|
53
60
|
const theme = useTheme()
|
|
@@ -67,7 +74,9 @@ const LoadingErrorMessage = (props: { message?: string; error: unknown }) => {
|
|
|
67
74
|
},
|
|
68
75
|
}}
|
|
69
76
|
>
|
|
70
|
-
{
|
|
77
|
+
{(props.loadingMessage
|
|
78
|
+
? `Error while ${lowerFirst(capitalize(props.loadingMessage))} - `
|
|
79
|
+
: "") + errorMessage}
|
|
71
80
|
<br />
|
|
72
81
|
{stack && <pre>{stack}</pre>}
|
|
73
82
|
</Stack>
|
package/src/index.ts
CHANGED
|
@@ -11,4 +11,5 @@ export * from "./components/VelocitySlider"
|
|
|
11
11
|
export * from "./components/modal/NoMotionGroupModal"
|
|
12
12
|
export * from "./components/utils/hooks"
|
|
13
13
|
export * from "./components/robots/AxisConfig"
|
|
14
|
+
export * from "./components/LoadingCover"
|
|
14
15
|
export { createNovaMuiTheme } from "./themes/theming"
|