@wandelbots/wandelbots-js-react-components 2.33.0-pr.feature-robot-precondition-list.372.cb78a22 → 2.33.0-pr.feature-robot-precondition-list.372.3ad6c62
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/LogPanel.d.ts +0 -16
- package/dist/components/LogPanel.d.ts.map +1 -1
- package/dist/components/LogViewer.d.ts.map +1 -1
- package/dist/index.cjs +34 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +733 -725
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/LogPanel.tsx +0 -16
- package/src/components/LogViewer.tsx +30 -16
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.3ad6c62",
|
|
4
4
|
"description": "React UI toolkit for building applications on top of the Wandelbots platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -21,7 +21,6 @@ export type LogPanelProps = {
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```tsx
|
|
24
|
-
* // Simple usage with automatic state management
|
|
25
24
|
* function MyComponent() {
|
|
26
25
|
* const [logStore, setLogStore] = useState<LogStore>()
|
|
27
26
|
*
|
|
@@ -38,21 +37,6 @@ export type LogPanelProps = {
|
|
|
38
37
|
* logStore?.addError("Something went wrong")
|
|
39
38
|
* logStore?.addWarning("Warning message")
|
|
40
39
|
* ```
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```tsx
|
|
44
|
-
* // Usage with external store for shared state
|
|
45
|
-
* function MyApp() {
|
|
46
|
-
* const logStore = useMemo(() => new LogStore(), [])
|
|
47
|
-
*
|
|
48
|
-
* return (
|
|
49
|
-
* <div>
|
|
50
|
-
* <LogPanel store={logStore} height={300} />
|
|
51
|
-
* <SomeOtherComponent onError={(msg) => logStore.addError(msg)} />
|
|
52
|
-
* </div>
|
|
53
|
-
* )
|
|
54
|
-
* }
|
|
55
|
-
* ```
|
|
56
40
|
*/
|
|
57
41
|
export const LogPanel = externalizeComponent(
|
|
58
42
|
observer((props: LogPanelProps) => {
|
|
@@ -5,7 +5,14 @@ import {
|
|
|
5
5
|
ExpandMore,
|
|
6
6
|
} from "@mui/icons-material"
|
|
7
7
|
import type { SxProps } from "@mui/material"
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
Box,
|
|
10
|
+
Button,
|
|
11
|
+
IconButton,
|
|
12
|
+
Paper,
|
|
13
|
+
Typography,
|
|
14
|
+
useTheme,
|
|
15
|
+
} from "@mui/material"
|
|
9
16
|
import { observer } from "mobx-react-lite"
|
|
10
17
|
import { useEffect, useRef, useState } from "react"
|
|
11
18
|
import { externalizeComponent } from "../externalizeComponent"
|
|
@@ -37,6 +44,7 @@ export type LogViewerProps = {
|
|
|
37
44
|
export const LogViewer = externalizeComponent(
|
|
38
45
|
observer((props: LogViewerProps) => {
|
|
39
46
|
const { messages = [], onClear, height = 400, sx } = props
|
|
47
|
+
const theme = useTheme()
|
|
40
48
|
const scrollContainerRef = useRef<HTMLDivElement>(null)
|
|
41
49
|
|
|
42
50
|
// Auto-scroll to bottom when new messages are added
|
|
@@ -67,12 +75,12 @@ export const LogViewer = externalizeComponent(
|
|
|
67
75
|
const getMessageColor = (level: LogLevel) => {
|
|
68
76
|
switch (level) {
|
|
69
77
|
case "error":
|
|
70
|
-
return
|
|
78
|
+
return theme.palette.error.main
|
|
71
79
|
case "warning":
|
|
72
|
-
return
|
|
80
|
+
return theme.palette.warning.main
|
|
73
81
|
case "info":
|
|
74
82
|
default:
|
|
75
|
-
return
|
|
83
|
+
return theme.palette.text.secondary
|
|
76
84
|
}
|
|
77
85
|
}
|
|
78
86
|
|
|
@@ -109,7 +117,7 @@ export const LogViewer = externalizeComponent(
|
|
|
109
117
|
fontFamily: "monospace",
|
|
110
118
|
flexDirection: "column",
|
|
111
119
|
"&:hover": {
|
|
112
|
-
backgroundColor:
|
|
120
|
+
backgroundColor: theme.palette.action.hover,
|
|
113
121
|
},
|
|
114
122
|
borderRadius: "4px",
|
|
115
123
|
padding: "2px 4px",
|
|
@@ -125,7 +133,7 @@ export const LogViewer = externalizeComponent(
|
|
|
125
133
|
fontSize: "12px",
|
|
126
134
|
lineHeight: "18px",
|
|
127
135
|
letterSpacing: "0.4px",
|
|
128
|
-
color:
|
|
136
|
+
color: theme.palette.text.disabled,
|
|
129
137
|
whiteSpace: "nowrap",
|
|
130
138
|
flexShrink: 0,
|
|
131
139
|
}}
|
|
@@ -168,9 +176,9 @@ export const LogViewer = externalizeComponent(
|
|
|
168
176
|
onClick={handleCopy}
|
|
169
177
|
sx={{
|
|
170
178
|
padding: "2px",
|
|
171
|
-
color:
|
|
179
|
+
color: theme.palette.text.secondary,
|
|
172
180
|
"&:hover": {
|
|
173
|
-
backgroundColor:
|
|
181
|
+
backgroundColor: theme.palette.action.hover,
|
|
174
182
|
},
|
|
175
183
|
}}
|
|
176
184
|
title={copyTooltip ? "Copied!" : "Copy message"}
|
|
@@ -184,9 +192,9 @@ export const LogViewer = externalizeComponent(
|
|
|
184
192
|
onClick={() => setIsExpanded(!isExpanded)}
|
|
185
193
|
sx={{
|
|
186
194
|
padding: "2px",
|
|
187
|
-
color:
|
|
195
|
+
color: theme.palette.text.secondary,
|
|
188
196
|
"&:hover": {
|
|
189
|
-
backgroundColor:
|
|
197
|
+
backgroundColor: theme.palette.action.hover,
|
|
190
198
|
},
|
|
191
199
|
}}
|
|
192
200
|
title={isExpanded ? "Collapse" : "Expand"}
|
|
@@ -207,7 +215,9 @@ export const LogViewer = externalizeComponent(
|
|
|
207
215
|
return (
|
|
208
216
|
<Paper
|
|
209
217
|
sx={{
|
|
210
|
-
|
|
218
|
+
backgroundColor:
|
|
219
|
+
theme.palette.backgroundPaperElevation?.[2] || "#171927",
|
|
220
|
+
backgroundImage: "none", // Override any gradient from elevation
|
|
211
221
|
height,
|
|
212
222
|
display: "flex",
|
|
213
223
|
flexDirection: "column",
|
|
@@ -226,7 +236,11 @@ export const LogViewer = externalizeComponent(
|
|
|
226
236
|
>
|
|
227
237
|
<Box sx={{ display: "flex", alignItems: "center", gap: 1 }}>
|
|
228
238
|
<DocumentIcon
|
|
229
|
-
sx={{
|
|
239
|
+
sx={{
|
|
240
|
+
fontSize: 16,
|
|
241
|
+
color: theme.palette.action.active,
|
|
242
|
+
opacity: 0.56,
|
|
243
|
+
}}
|
|
230
244
|
/>
|
|
231
245
|
<Typography
|
|
232
246
|
sx={{
|
|
@@ -234,7 +248,7 @@ export const LogViewer = externalizeComponent(
|
|
|
234
248
|
fontSize: "14px",
|
|
235
249
|
lineHeight: "143%",
|
|
236
250
|
letterSpacing: "0.17px",
|
|
237
|
-
color:
|
|
251
|
+
color: theme.palette.text.primary,
|
|
238
252
|
}}
|
|
239
253
|
>
|
|
240
254
|
Log
|
|
@@ -248,12 +262,12 @@ export const LogViewer = externalizeComponent(
|
|
|
248
262
|
fontSize: "13px",
|
|
249
263
|
lineHeight: "22px",
|
|
250
264
|
letterSpacing: "0.46px",
|
|
251
|
-
color:
|
|
265
|
+
color: theme.palette.primary.main,
|
|
252
266
|
textTransform: "none",
|
|
253
267
|
minWidth: "auto",
|
|
254
268
|
padding: "4px 8px",
|
|
255
269
|
"&:hover": {
|
|
256
|
-
backgroundColor: "
|
|
270
|
+
backgroundColor: theme.palette.primary.main + "14", // 8% opacity
|
|
257
271
|
},
|
|
258
272
|
}}
|
|
259
273
|
>
|
|
@@ -276,7 +290,7 @@ export const LogViewer = externalizeComponent(
|
|
|
276
290
|
{messages.length === 0 ? (
|
|
277
291
|
<Typography
|
|
278
292
|
sx={{
|
|
279
|
-
color:
|
|
293
|
+
color: theme.palette.text.disabled,
|
|
280
294
|
fontSize: "12px",
|
|
281
295
|
fontStyle: "italic",
|
|
282
296
|
textAlign: "center",
|