@wandelbots/wandelbots-js-react-components 2.33.0-pr.feature-robot-precondition-list.372.56785bf → 2.33.0-pr.feature-robot-precondition-list.372.e4998c8
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/{AppTopBar.d.ts → AppHeader.d.ts} +4 -4
- package/dist/components/{AppTopBar.d.ts.map → AppHeader.d.ts.map} +1 -1
- package/dist/components/LogStore.d.ts +1 -0
- package/dist/components/LogStore.d.ts.map +1 -1
- package/dist/components/LogViewer.d.ts +21 -1
- package/dist/components/LogViewer.d.ts.map +1 -1
- package/dist/index.cjs +44 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3006 -2976
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/{AppTopBar.md → AppHeader.md} +5 -5
- package/src/components/{AppTopBar.tsx → AppHeader.tsx} +16 -5
- package/src/components/LogStore.ts +4 -0
- package/src/components/LogViewer.tsx +44 -1
- package/src/components/TabBar.tsx +1 -1
- package/src/index.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wandelbots/wandelbots-js-react-components",
|
|
3
|
-
"version": "2.33.0-pr.feature-robot-precondition-list.372.
|
|
3
|
+
"version": "2.33.0-pr.feature-robot-precondition-list.372.e4998c8",
|
|
4
4
|
"description": "React UI toolkit for building applications on top of the Wandelbots platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AppHeader Component
|
|
2
2
|
|
|
3
|
-
A navigation
|
|
3
|
+
A navigation header component that displays the current application's icon and name, with an optional dropdown menu for switching between different applications.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ A navigation bar component that displays the current application's icon and name
|
|
|
14
14
|
|
|
15
15
|
```tsx
|
|
16
16
|
import {
|
|
17
|
-
|
|
17
|
+
AppHeader,
|
|
18
18
|
type AppItem,
|
|
19
19
|
} from "@wandelbots/wandelbots-js-react-components"
|
|
20
20
|
import { Home, Settings, Person } from "@mui/icons-material"
|
|
@@ -36,7 +36,7 @@ const apps: AppItem[] = [
|
|
|
36
36
|
|
|
37
37
|
function MyApp() {
|
|
38
38
|
return (
|
|
39
|
-
<
|
|
39
|
+
<AppHeader
|
|
40
40
|
appIcon={<Person />}
|
|
41
41
|
appName="Robot Control Studio"
|
|
42
42
|
apps={apps}
|
|
@@ -48,7 +48,7 @@ function MyApp() {
|
|
|
48
48
|
|
|
49
49
|
## Props
|
|
50
50
|
|
|
51
|
-
###
|
|
51
|
+
### AppHeaderProps
|
|
52
52
|
|
|
53
53
|
- **appIcon** (`ReactNode`): Icon component for the current application
|
|
54
54
|
- **appName** (`string`): Display name of the current application
|
|
@@ -28,7 +28,7 @@ export type AppItem = {
|
|
|
28
28
|
onClick?: () => void
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export type
|
|
31
|
+
export type AppHeaderProps = {
|
|
32
32
|
/** Current app icon */
|
|
33
33
|
appIcon: ReactNode
|
|
34
34
|
/** Current app name */
|
|
@@ -42,11 +42,11 @@ export type AppTopBarProps = {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* A top navigation
|
|
45
|
+
* A top navigation header component that displays the current app and provides
|
|
46
46
|
* a dropdown menu to navigate to other apps.
|
|
47
47
|
*/
|
|
48
|
-
export const
|
|
49
|
-
observer((props:
|
|
48
|
+
export const AppHeader = externalizeComponent(
|
|
49
|
+
observer((props: AppHeaderProps) => {
|
|
50
50
|
const { appIcon, appName, apps = [], onAppSelect, sx } = props
|
|
51
51
|
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null)
|
|
52
52
|
const isMenuOpen = Boolean(anchorEl)
|
|
@@ -73,7 +73,18 @@ export const AppTopBar = externalizeComponent(
|
|
|
73
73
|
|
|
74
74
|
return (
|
|
75
75
|
<>
|
|
76
|
-
<AppBar
|
|
76
|
+
<AppBar
|
|
77
|
+
position="static"
|
|
78
|
+
sx={{
|
|
79
|
+
boxShadow: "none",
|
|
80
|
+
backgroundImage: "none",
|
|
81
|
+
"& .MuiAppBar-root": {
|
|
82
|
+
backgroundImage: "none",
|
|
83
|
+
backgroundColor: "transparent",
|
|
84
|
+
},
|
|
85
|
+
...sx,
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
77
88
|
<Toolbar sx={{ minHeight: "64px !important" }}>
|
|
78
89
|
{/* App Icon */}
|
|
79
90
|
<Box sx={{ mr: 2, display: "flex", alignItems: "center" }}>
|
|
@@ -17,7 +17,7 @@ import { observer } from "mobx-react-lite"
|
|
|
17
17
|
import { useEffect, useRef, useState } from "react"
|
|
18
18
|
import { externalizeComponent } from "../externalizeComponent"
|
|
19
19
|
|
|
20
|
-
export type LogLevel = "info" | "error" | "warning"
|
|
20
|
+
export type LogLevel = "info" | "error" | "warning" | "debug"
|
|
21
21
|
|
|
22
22
|
export type LogMessage = {
|
|
23
23
|
id: string
|
|
@@ -37,6 +37,46 @@ export type LogViewerProps = {
|
|
|
37
37
|
sx?: SxProps
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Utility function to create a log message
|
|
42
|
+
*/
|
|
43
|
+
export const createLogMessage = (
|
|
44
|
+
message: string,
|
|
45
|
+
level: LogLevel,
|
|
46
|
+
id?: string,
|
|
47
|
+
): LogMessage => ({
|
|
48
|
+
id: id || `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
49
|
+
timestamp: new Date(),
|
|
50
|
+
message,
|
|
51
|
+
level,
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Utility function to create a debug log message
|
|
56
|
+
*/
|
|
57
|
+
export const createDebugMessage = (message: string, id?: string): LogMessage =>
|
|
58
|
+
createLogMessage(message, "debug", id)
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Utility function to create an info log message
|
|
62
|
+
*/
|
|
63
|
+
export const createInfoMessage = (message: string, id?: string): LogMessage =>
|
|
64
|
+
createLogMessage(message, "info", id)
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Utility function to create a warning log message
|
|
68
|
+
*/
|
|
69
|
+
export const createWarningMessage = (
|
|
70
|
+
message: string,
|
|
71
|
+
id?: string,
|
|
72
|
+
): LogMessage => createLogMessage(message, "warning", id)
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Utility function to create an error log message
|
|
76
|
+
*/
|
|
77
|
+
export const createErrorMessage = (message: string, id?: string): LogMessage =>
|
|
78
|
+
createLogMessage(message, "error", id)
|
|
79
|
+
|
|
40
80
|
/**
|
|
41
81
|
* A log viewer component that displays timestamped log messages with different levels.
|
|
42
82
|
* Features a header with document icon and clear button, and scrollable message area.
|
|
@@ -79,6 +119,9 @@ export const LogViewer = externalizeComponent(
|
|
|
79
119
|
case "warning":
|
|
80
120
|
return theme.palette.warning.main
|
|
81
121
|
case "info":
|
|
122
|
+
return theme.palette.info.main
|
|
123
|
+
case "debug":
|
|
124
|
+
return theme.palette.text.disabled
|
|
82
125
|
default:
|
|
83
126
|
return theme.palette.text.secondary
|
|
84
127
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./components/3d-viewport/PresetEnvironment"
|
|
2
2
|
export * from "./components/3d-viewport/SafetyZonesRenderer"
|
|
3
3
|
export * from "./components/3d-viewport/TrajectoryRenderer"
|
|
4
|
-
export * from "./components/
|
|
4
|
+
export * from "./components/AppHeader"
|
|
5
5
|
export * from "./components/CycleTimer"
|
|
6
6
|
export * from "./components/DataGrid"
|
|
7
7
|
export * from "./components/jogging/JoggingCartesianAxisControl"
|