@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/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.56785bf",
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
- # AppTopBar Component
1
+ # AppHeader Component
2
2
 
3
- A navigation bar component that displays the current application's icon and name, with an optional dropdown menu for switching between different applications.
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
- AppTopBar,
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
- <AppTopBar
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
- ### AppTopBarProps
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 AppTopBarProps = {
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 bar component that displays the current app and provides
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 AppTopBar = externalizeComponent(
49
- observer((props: AppTopBarProps) => {
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 position="static" sx={sx}>
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" }}>
@@ -37,4 +37,8 @@ export class LogStore {
37
37
  addError = (message: string) => {
38
38
  this.addMessage(message, "error")
39
39
  }
40
+
41
+ addDebug = (message: string) => {
42
+ this.addMessage(message, "debug")
43
+ }
40
44
  }
@@ -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
  }
@@ -83,7 +83,7 @@ export const TabBar = externalizeComponent(
83
83
  display: "none", // Hide the default indicator
84
84
  },
85
85
  "& .MuiTabs-flexContainer": {
86
- gap: 4,
86
+ gap: 2,
87
87
  },
88
88
  }}
89
89
  >
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/AppTopBar"
4
+ export * from "./components/AppHeader"
5
5
  export * from "./components/CycleTimer"
6
6
  export * from "./components/DataGrid"
7
7
  export * from "./components/jogging/JoggingCartesianAxisControl"