@wandelbots/wandelbots-js-react-components 2.33.0-pr.feature-robot-precondition-list.372.cb78a22 → 2.33.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.
Files changed (45) hide show
  1. package/dist/components/CycleTimer.d.ts.map +1 -1
  2. package/dist/components/ProgramControl.d.ts +1 -6
  3. package/dist/components/ProgramControl.d.ts.map +1 -1
  4. package/dist/components/ProgramStateIndicator.d.ts +1 -1
  5. package/dist/components/ProgramStateIndicator.d.ts.map +1 -1
  6. package/dist/components/robots/Robot.d.ts +2 -3
  7. package/dist/components/robots/Robot.d.ts.map +1 -1
  8. package/dist/index.cjs +48 -48
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.ts +0 -7
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +7196 -8357
  13. package/dist/index.js.map +1 -1
  14. package/package.json +1 -2
  15. package/src/components/CycleTimer.tsx +64 -43
  16. package/src/components/ProgramControl.tsx +10 -20
  17. package/src/components/ProgramStateIndicator.tsx +8 -20
  18. package/src/components/robots/Robot.tsx +2 -5
  19. package/src/i18n/locales/de/translations.json +1 -6
  20. package/src/i18n/locales/en/translations.json +1 -6
  21. package/src/index.ts +0 -7
  22. package/dist/components/DataGrid.d.ts +0 -61
  23. package/dist/components/DataGrid.d.ts.map +0 -1
  24. package/dist/components/LogPanel.d.ts +0 -54
  25. package/dist/components/LogPanel.d.ts.map +0 -1
  26. package/dist/components/LogStore.d.ts +0 -11
  27. package/dist/components/LogStore.d.ts.map +0 -1
  28. package/dist/components/LogViewer.d.ts +0 -26
  29. package/dist/components/LogViewer.d.ts.map +0 -1
  30. package/dist/components/RobotCard.d.ts +0 -84
  31. package/dist/components/RobotCard.d.ts.map +0 -1
  32. package/dist/components/RobotListItem.d.ts +0 -34
  33. package/dist/components/RobotListItem.d.ts.map +0 -1
  34. package/dist/components/RobotSetupReadinessIndicator.d.ts +0 -31
  35. package/dist/components/RobotSetupReadinessIndicator.d.ts.map +0 -1
  36. package/dist/components/RobotSetupReadinessIndicator.test.d.ts +0 -2
  37. package/dist/components/RobotSetupReadinessIndicator.test.d.ts.map +0 -1
  38. package/src/components/DataGrid.tsx +0 -454
  39. package/src/components/LogPanel.tsx +0 -85
  40. package/src/components/LogStore.ts +0 -40
  41. package/src/components/LogViewer.tsx +0 -297
  42. package/src/components/RobotCard.tsx +0 -576
  43. package/src/components/RobotListItem.tsx +0 -152
  44. package/src/components/RobotSetupReadinessIndicator.test.tsx +0 -60
  45. package/src/components/RobotSetupReadinessIndicator.tsx +0 -124
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.cb78a22",
3
+ "version": "2.33.0",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -139,7 +139,6 @@
139
139
  "dependencies": {
140
140
  "@monaco-editor/react": "^4.7.0",
141
141
  "@mui/x-charts": "^8.9.0",
142
- "@mui/x-data-grid": "^8.10.1",
143
142
  "@shikijs/monaco": "^3.1.0",
144
143
  "i18next-browser-languagedetector": "^8.0.4",
145
144
  "lodash-es": "^4.17.21",
@@ -301,56 +301,77 @@ export const CycleTimer = externalizeComponent(
301
301
  sx={{
302
302
  display: "flex",
303
303
  alignItems: "center",
304
- m: 0,
305
- gap: 1, // 8px gap between circle and text
304
+ gap: 0.125, // Minimal gap - 1px
306
305
  }}
307
306
  >
308
- {/* Animated progress ring icon */}
307
+ {/* Animated progress gauge icon */}
309
308
  <Box
310
309
  sx={{
311
- width: 20,
312
- height: 20,
310
+ position: "relative",
311
+ width: 40,
312
+ height: 40,
313
313
  display: "flex",
314
314
  alignItems: "center",
315
315
  justifyContent: "center",
316
- opacity: isPausedState ? 0.6 : 1,
317
- transition: "opacity 0.2s ease",
316
+ borderRadius: "50%",
317
+ overflow: "visible",
318
318
  }}
319
319
  >
320
- <svg
321
- width="20"
322
- height="20"
323
- viewBox="0 0 20 20"
324
- style={{ transform: "rotate(-90deg)" }}
325
- role="img"
326
- aria-label="Timer progress"
327
- >
328
- {/* Background ring */}
329
- <circle
330
- cx="10"
331
- cy="10"
332
- r="8"
333
- fill="none"
334
- stroke={theme.palette.success.main}
335
- strokeWidth="2"
336
- opacity={0.3}
337
- />
338
- {/* Progress ring */}
339
- <circle
340
- cx="10"
341
- cy="10"
342
- r="8"
343
- fill="none"
344
- stroke={theme.palette.success.main}
345
- strokeWidth="2"
346
- strokeLinecap="round"
347
- strokeDasharray={`${2 * Math.PI * 8}`}
348
- strokeDashoffset={`${2 * Math.PI * 8 * (1 - progressValue / 100)}`}
349
- style={{
350
- transition: "stroke-dashoffset 0.1s ease-out",
351
- }}
352
- />
353
- </svg>
320
+ <Gauge
321
+ width={40}
322
+ height={40}
323
+ value={progressValue}
324
+ valueMin={0}
325
+ valueMax={100}
326
+ innerRadius="70%"
327
+ outerRadius="95%"
328
+ skipAnimation={true}
329
+ sx={{
330
+ opacity: isPausedState ? 0.6 : 1,
331
+ transition: "opacity 0.2s ease",
332
+ [`& .MuiGauge-valueArc`]: {
333
+ fill: theme.palette.success.main,
334
+ },
335
+ [`& .MuiGauge-referenceArc`]: {
336
+ fill: theme.palette.success.main,
337
+ opacity: 0.3,
338
+ },
339
+ [`& .MuiGauge-valueText`]: {
340
+ display: "none",
341
+ },
342
+ [`& .MuiGauge-text`]: {
343
+ display: "none",
344
+ },
345
+ [`& text`]: {
346
+ display: "none",
347
+ },
348
+ // Hide any inner circle elements that might flash
349
+ [`& .MuiGauge-referenceArcBackground`]: {
350
+ display: "none",
351
+ },
352
+ [`& .MuiGauge-valueArcBackground`]: {
353
+ display: "none",
354
+ },
355
+ [`& circle`]: {
356
+ display: "none",
357
+ },
358
+ }}
359
+ />
360
+
361
+ {/* Inner circle overlay to prevent flashing */}
362
+ <Box
363
+ sx={{
364
+ position: "absolute",
365
+ top: "50%",
366
+ left: "50%",
367
+ transform: "translate(-50%, -50%)",
368
+ width: 13,
369
+ height: 13,
370
+ borderRadius: "50%",
371
+ backgroundColor: theme.palette.background?.paper || "white",
372
+ pointerEvents: "none",
373
+ }}
374
+ />
354
375
  </Box>
355
376
 
356
377
  {/* Timer text display */}
@@ -362,8 +383,8 @@ export const CycleTimer = externalizeComponent(
362
383
  }}
363
384
  >
364
385
  {compact
365
- ? // Compact mode: show remaining time with "min." suffix
366
- `${formatTime(remainingTime)} ${t("CycleTimer.Time.lb", { time: "" }).replace(/\s*$/, "")}`
386
+ ? // Compact mode: show only remaining time
387
+ formatTime(remainingTime)
367
388
  : // Full mode: show "remaining / of total min." format
368
389
  `${formatTime(remainingTime)} / ${t("CycleTimer.Time.lb", { time: formatTime(maxTime) })}`}
369
390
  </Typography>
@@ -4,12 +4,7 @@ import { observer } from "mobx-react-lite"
4
4
  import { useTranslation } from "react-i18next"
5
5
  import { externalizeComponent } from "../externalizeComponent"
6
6
 
7
- export enum ProgramState {
8
- IDLE = "idle",
9
- RUNNING = "running",
10
- PAUSED = "paused",
11
- STOPPING = "stopping",
12
- }
7
+ export type ProgramState = "idle" | "running" | "paused" | "stopping"
13
8
 
14
9
  export interface ProgramControlProps {
15
10
  /** The current state of the program control */
@@ -75,24 +70,22 @@ export const ProgramControl = externalizeComponent(
75
70
  const getButtonConfigs = (): ButtonConfig[] => {
76
71
  const baseConfigs: Record<string, ButtonConfig> = {
77
72
  run: {
78
- enabled:
79
- state === ProgramState.IDLE || state === ProgramState.PAUSED,
73
+ enabled: state === "idle" || state === "paused",
80
74
  label:
81
- state === ProgramState.PAUSED
75
+ state === "paused"
82
76
  ? t("ProgramControl.Resume.bt")
83
77
  : t("ProgramControl.Start.bt"),
84
78
  color: theme.palette.success.main,
85
79
  onClick: onRun,
86
80
  },
87
81
  pause: {
88
- enabled: state === ProgramState.RUNNING,
82
+ enabled: state === "running",
89
83
  label: t("ProgramControl.Pause.bt"),
90
84
  color: "#FFFFFF33",
91
85
  onClick: onPause || (() => {}),
92
86
  },
93
87
  stop: {
94
- enabled:
95
- state === ProgramState.RUNNING || state === ProgramState.PAUSED,
88
+ enabled: state === "running" || state === "paused",
96
89
  label: t("ProgramControl.Stop.bt"),
97
90
  color: theme.palette.error.main,
98
91
  onClick: onStop,
@@ -164,7 +157,7 @@ export const ProgramControl = externalizeComponent(
164
157
  variant="contained"
165
158
  disabled={
166
159
  !config.enabled ||
167
- (state === ProgramState.STOPPING && !requiresManualReset)
160
+ (state === "stopping" && !requiresManualReset)
168
161
  }
169
162
  onClick={config.onClick}
170
163
  sx={{
@@ -174,17 +167,14 @@ export const ProgramControl = externalizeComponent(
174
167
  backgroundColor: config.color,
175
168
  opacity:
176
169
  config.enabled &&
177
- !(state === ProgramState.STOPPING && !requiresManualReset)
170
+ !(state === "stopping" && !requiresManualReset)
178
171
  ? 1
179
172
  : 0.3,
180
173
  "&:hover": {
181
174
  backgroundColor: config.color,
182
175
  opacity:
183
176
  config.enabled &&
184
- !(
185
- state === ProgramState.STOPPING &&
186
- !requiresManualReset
187
- )
177
+ !(state === "stopping" && !requiresManualReset)
188
178
  ? 0.8
189
179
  : 0.3,
190
180
  },
@@ -204,13 +194,13 @@ export const ProgramControl = externalizeComponent(
204
194
  sx={{
205
195
  color:
206
196
  config.enabled &&
207
- !(state === ProgramState.STOPPING && !requiresManualReset)
197
+ !(state === "stopping" && !requiresManualReset)
208
198
  ? config.color
209
199
  : theme.palette.text.disabled,
210
200
  textAlign: "center",
211
201
  opacity:
212
202
  config.enabled &&
213
- !(state === ProgramState.STOPPING && !requiresManualReset)
203
+ !(state === "stopping" && !requiresManualReset)
214
204
  ? 1
215
205
  : 0.3,
216
206
  }}
@@ -1,4 +1,4 @@
1
- import { Chip, Typography, useTheme } from "@mui/material"
1
+ import { Chip, useTheme } from "@mui/material"
2
2
  import type {
3
3
  RobotControllerStateOperationModeEnum,
4
4
  RobotControllerStateSafetyStateEnum,
@@ -6,7 +6,7 @@ import type {
6
6
  import { observer } from "mobx-react-lite"
7
7
  import { useTranslation } from "react-i18next"
8
8
  import { externalizeComponent } from "../externalizeComponent"
9
- import { ProgramState } from "./ProgramControl"
9
+ import type { ProgramState } from "./ProgramControl"
10
10
 
11
11
  export interface ProgramStateIndicatorProps {
12
12
  /** The current state of the program */
@@ -77,22 +77,22 @@ export const ProgramStateIndicator = externalizeComponent(
77
77
  // For normal safety states, check program state
78
78
  if (safetyState === "SAFETY_STATE_NORMAL") {
79
79
  switch (programState) {
80
- case ProgramState.RUNNING:
80
+ case "running":
81
81
  return {
82
82
  label: t("ProgramStateIndicator.Running.lb"),
83
83
  color: theme.palette.success.main,
84
84
  }
85
- case ProgramState.PAUSED:
85
+ case "paused":
86
86
  return {
87
87
  label: t("ProgramStateIndicator.Paused.lb"),
88
88
  color: theme.palette.grey[600],
89
89
  }
90
- case ProgramState.STOPPING:
90
+ case "stopping":
91
91
  return {
92
92
  label: t("ProgramStateIndicator.Stopped.lb"),
93
93
  color: theme.palette.error.main,
94
94
  }
95
- case ProgramState.IDLE:
95
+ case "idle":
96
96
  default:
97
97
  return {
98
98
  label: t("ProgramStateIndicator.Ready.lb"),
@@ -131,26 +131,14 @@ export const ProgramStateIndicator = externalizeComponent(
131
131
  return (
132
132
  <Chip
133
133
  className={className}
134
- label={
135
- <Typography
136
- variant="body2"
137
- sx={{
138
- fontSize: "0.75rem", // Smaller than body2
139
- lineHeight: 1.2,
140
- }}
141
- >
142
- {fullLabel}
143
- </Typography>
144
- }
134
+ label={fullLabel}
145
135
  variant="filled"
146
136
  sx={{
147
137
  backgroundColor: color,
148
138
  color: theme.palette.getContrastText(color),
149
139
  fontWeight: 500,
150
- height: "auto",
151
140
  "& .MuiChip-label": {
152
- paddingX: 1.5,
153
- paddingY: 0.5,
141
+ paddingX: 2,
154
142
  },
155
143
  }}
156
144
  />
@@ -1,16 +1,15 @@
1
- import type { ThreeElements } from "@react-three/fiber"
1
+ import { type ThreeElements } from "@react-three/fiber"
2
2
 
3
3
  import type { ConnectedMotionGroup } from "@wandelbots/nova-js/v1"
4
4
  import type { Group } from "three"
5
- import { defaultGetModel } from "./robotModelLogic"
6
5
  import { SupportedRobot } from "./SupportedRobot"
6
+ import { defaultGetModel } from "./robotModelLogic"
7
7
 
8
8
  export type RobotProps = {
9
9
  connectedMotionGroup: ConnectedMotionGroup
10
10
  getModel?: (modelFromController: string) => string
11
11
  flangeRef?: React.Ref<Group>
12
12
  transparentColor?: string
13
- postModelRender?: () => void
14
13
  } & ThreeElements["group"]
15
14
 
16
15
  /**
@@ -29,7 +28,6 @@ export function Robot({
29
28
  getModel = defaultGetModel,
30
29
  flangeRef,
31
30
  transparentColor,
32
- postModelRender,
33
31
  ...props
34
32
  }: RobotProps) {
35
33
  if (!connectedMotionGroup.dhParameters) {
@@ -46,7 +44,6 @@ export function Robot({
46
44
  getModel={getModel}
47
45
  flangeRef={flangeRef}
48
46
  transparentColor={transparentColor}
49
- postModelRender={postModelRender}
50
47
  {...props}
51
48
  />
52
49
  )
@@ -61,10 +61,5 @@
61
61
  "ProgramStateIndicator.Auto.lb": "Auto",
62
62
  "ProgramStateIndicator.Manual.lb": "Manuell",
63
63
  "ProgramStateIndicator.ManualT1.lb": "Manuell T1",
64
- "ProgramStateIndicator.ManualT2.lb": "Manuell T2",
65
- "RobotSetupReadinessIndicator.Ready.lb": "Bereit",
66
- "RobotSetupReadinessIndicator.RobotDisconnected.lb": "Roboter getrennt",
67
- "RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb": "Voraussetzung nicht erfüllt",
68
- "RobotCard.Runtime.lb": "Laufzeit",
69
- "RobotCard.DriveToHome.bt": "Zur Home-Position fahren"
64
+ "ProgramStateIndicator.ManualT2.lb": "Manuell T2"
70
65
  }
@@ -62,10 +62,5 @@
62
62
  "ProgramStateIndicator.Auto.lb": "Auto",
63
63
  "ProgramStateIndicator.Manual.lb": "Manual",
64
64
  "ProgramStateIndicator.ManualT1.lb": "Manual T1",
65
- "ProgramStateIndicator.ManualT2.lb": "Manual T2",
66
- "RobotSetupReadinessIndicator.Ready.lb": "Ready",
67
- "RobotSetupReadinessIndicator.RobotDisconnected.lb": "Robot disconnected",
68
- "RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb": "Precondition not fulfilled",
69
- "RobotCard.Runtime.lb": "Runtime",
70
- "RobotCard.DriveToHome.bt": "Drive to Home"
65
+ "ProgramStateIndicator.ManualT2.lb": "Manual T2"
71
66
  }
package/src/index.ts CHANGED
@@ -2,7 +2,6 @@ export * from "./components/3d-viewport/PresetEnvironment"
2
2
  export * from "./components/3d-viewport/SafetyZonesRenderer"
3
3
  export * from "./components/3d-viewport/TrajectoryRenderer"
4
4
  export * from "./components/CycleTimer"
5
- export * from "./components/DataGrid"
6
5
  export * from "./components/jogging/JoggingCartesianAxisControl"
7
6
  export * from "./components/jogging/JoggingJointRotationControl"
8
7
  export * from "./components/jogging/JoggingPanel"
@@ -10,19 +9,13 @@ export { JoggingStore } from "./components/jogging/JoggingStore"
10
9
  export * from "./components/jogging/PoseCartesianValues"
11
10
  export * from "./components/jogging/PoseJointValues"
12
11
  export * from "./components/LoadingCover"
13
- export * from "./components/LogPanel"
14
- export { LogStore } from "./components/LogStore"
15
- export * from "./components/LogViewer"
16
12
  export * from "./components/modal/NoMotionGroupModal"
17
13
  export * from "./components/ProgramControl"
18
14
  export * from "./components/ProgramStateIndicator"
19
- export * from "./components/RobotCard"
20
- export * from "./components/RobotListItem"
21
15
  export * from "./components/robots/AxisConfig"
22
16
  export * from "./components/robots/Robot"
23
17
  export { defaultGetModel } from "./components/robots/robotModelLogic"
24
18
  export * from "./components/robots/SupportedRobot"
25
- export * from "./components/RobotSetupReadinessIndicator"
26
19
  export * from "./components/safetyBar/SafetyBar"
27
20
  export * from "./components/SelectableFab"
28
21
  export * from "./components/utils/hooks"
@@ -1,61 +0,0 @@
1
- import { type DataGridProps, type GridColDef, type GridRowParams } from "@mui/x-data-grid";
2
- export interface WandelbotsDataGridProps<T = Record<string, unknown>> {
3
- /**
4
- * Array of data items to display in the grid
5
- */
6
- data: T[];
7
- /**
8
- * Column definitions for the DataGrid
9
- */
10
- columns: GridColDef[];
11
- /**
12
- * Function to transform data items into DataGrid rows
13
- * Should return an object with an 'id' field and other fields matching column definitions
14
- */
15
- getRowData: (item: T) => Record<string, unknown> & {
16
- id: string | number;
17
- };
18
- /**
19
- * Callback when a row is clicked
20
- */
21
- onRowClick?: (item: T, params: GridRowParams) => void;
22
- /**
23
- * Currently selected item (for highlighting)
24
- */
25
- selectedItem?: T | null;
26
- /**
27
- * Function to get the ID of an item (used for selection highlighting)
28
- */
29
- getItemId?: (item: T) => string | number;
30
- /**
31
- * Title displayed in the toolbar
32
- */
33
- title?: string;
34
- /**
35
- * Show item count in title
36
- * @default true
37
- */
38
- showCount?: boolean;
39
- /**
40
- * Placeholder text for the search input
41
- * @default "Search"
42
- */
43
- searchPlaceholder?: string;
44
- /**
45
- * Additional DataGrid props to pass through
46
- */
47
- dataGridProps?: Partial<DataGridProps>;
48
- /**
49
- * Custom toolbar component to replace the default one
50
- */
51
- CustomToolbar?: React.ComponentType;
52
- /**
53
- * Select the first item by default
54
- * @default false
55
- */
56
- selectFirstByDefault?: boolean;
57
- }
58
- export declare const WandelbotsDataGrid: (<T>({ data, columns, getRowData, onRowClick, selectedItem, getItemId, title, showCount, searchPlaceholder, dataGridProps, CustomToolbar, selectFirstByDefault, }: WandelbotsDataGridProps<T>) => import("react/jsx-runtime").JSX.Element) & {
59
- displayName: string;
60
- };
61
- //# sourceMappingURL=DataGrid.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,UAAU,EACf,KAAK,aAAa,EAOnB,MAAM,kBAAkB,CAAA;AAKzB,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAClE;;OAEG;IACH,IAAI,EAAE,CAAC,EAAE,CAAA;IAET;;OAEG;IACH,OAAO,EAAE,UAAU,EAAE,CAAA;IAErB;;;OAGG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;IAE1E;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,aAAa,KAAK,IAAI,CAAA;IAErD;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAAA;IAExC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAEtC;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAEnC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,eAAO,MAAM,kBAAkB,IAE1B,CAAC,gKAaC,uBAAuB,CAAC,CAAC,CAAC;;CA6VhC,CAAA"}
@@ -1,54 +0,0 @@
1
- import type { SxProps } from "@mui/material";
2
- import { LogStore } from "./LogStore";
3
- export type LogPanelProps = {
4
- /** Log store instance to use, or create one automatically if not provided */
5
- store?: LogStore;
6
- /** Height of the component */
7
- height?: string | number;
8
- /** Additional styles */
9
- sx?: SxProps;
10
- /** Ref to the log store for external access */
11
- onStoreReady?: (store: LogStore) => void;
12
- };
13
- /**
14
- * A complete log panel component with built-in state management.
15
- *
16
- * @example
17
- * ```tsx
18
- * // Simple usage with automatic state management
19
- * function MyComponent() {
20
- * const [logStore, setLogStore] = useState<LogStore>()
21
- *
22
- * return (
23
- * <LogPanel
24
- * height={400}
25
- * onStoreReady={setLogStore}
26
- * />
27
- * )
28
- * }
29
- *
30
- * // Then use the store to add messages
31
- * logStore?.addInfo("Operation completed successfully")
32
- * logStore?.addError("Something went wrong")
33
- * logStore?.addWarning("Warning message")
34
- * ```
35
- *
36
- * @example
37
- * ```tsx
38
- * // Usage with external store for shared state
39
- * function MyApp() {
40
- * const logStore = useMemo(() => new LogStore(), [])
41
- *
42
- * return (
43
- * <div>
44
- * <LogPanel store={logStore} height={300} />
45
- * <SomeOtherComponent onError={(msg) => logStore.addError(msg)} />
46
- * </div>
47
- * )
48
- * }
49
- * ```
50
- */
51
- export declare const LogPanel: ((props: LogPanelProps) => import("react/jsx-runtime").JSX.Element) & {
52
- displayName: string;
53
- };
54
- //# sourceMappingURL=LogPanel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LogPanel.d.ts","sourceRoot":"","sources":["../../src/components/LogPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAI5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,MAAM,MAAM,aAAa,GAAG;IAC1B,6EAA6E;IAC7E,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,wBAAwB;IACxB,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,+CAA+C;IAC/C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAA;CACzC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,QAAQ,WACF,aAAa;;CA2B/B,CAAA"}
@@ -1,11 +0,0 @@
1
- import type { LogLevel, LogMessage } from "./LogViewer";
2
- export declare class LogStore {
3
- messages: LogMessage[];
4
- constructor();
5
- addMessage: (message: string, level?: LogLevel) => void;
6
- clearMessages: () => void;
7
- addInfo: (message: string) => void;
8
- addWarning: (message: string) => void;
9
- addError: (message: string) => void;
10
- }
11
- //# sourceMappingURL=LogStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LogStore.d.ts","sourceRoot":"","sources":["../../src/components/LogStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEvD,qBAAa,QAAQ;IACnB,QAAQ,EAAE,UAAU,EAAE,CAAK;;IAU3B,UAAU,GAAI,SAAS,MAAM,EAAE,QAAO,QAAiB,UAQtD;IAED,aAAa,aAEZ;IAED,OAAO,GAAI,SAAS,MAAM,UAEzB;IAED,UAAU,GAAI,SAAS,MAAM,UAE5B;IAED,QAAQ,GAAI,SAAS,MAAM,UAE1B;CACF"}
@@ -1,26 +0,0 @@
1
- import type { SxProps } from "@mui/material";
2
- export type LogLevel = "info" | "error" | "warning";
3
- export type LogMessage = {
4
- id: string;
5
- timestamp: Date;
6
- message: string;
7
- level: LogLevel;
8
- };
9
- export type LogViewerProps = {
10
- /** Log messages to display */
11
- messages: LogMessage[];
12
- /** Callback when clear button is clicked */
13
- onClear?: () => void;
14
- /** Height of the component */
15
- height?: string | number;
16
- /** Additional styles */
17
- sx?: SxProps;
18
- };
19
- /**
20
- * A log viewer component that displays timestamped log messages with different levels.
21
- * Features a header with document icon and clear button, and scrollable message area.
22
- */
23
- export declare const LogViewer: ((props: LogViewerProps) => import("react/jsx-runtime").JSX.Element) & {
24
- displayName: string;
25
- };
26
- //# sourceMappingURL=LogViewer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LogViewer.d.ts","sourceRoot":"","sources":["../../src/components/LogViewer.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAM5C,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;AAEnD,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,IAAI,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,8BAA8B;IAC9B,QAAQ,EAAE,UAAU,EAAE,CAAA;IACtB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,wBAAwB;IACxB,EAAE,CAAC,EAAE,OAAO,CAAA;CACb,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,WACH,cAAc;;CAmQhC,CAAA"}
@@ -1,84 +0,0 @@
1
- import type { ConnectedMotionGroup, RobotControllerStateOperationModeEnum, RobotControllerStateSafetyStateEnum } from "@wandelbots/nova-js/v1";
2
- import type { Group } from "three";
3
- import type { ProgramState } from "./ProgramControl";
4
- export interface RobotCardProps {
5
- /** Name of the robot displayed at the top */
6
- robotName: string;
7
- /** Current program state */
8
- programState: ProgramState;
9
- /** Current safety state of the robot controller */
10
- safetyState: RobotControllerStateSafetyStateEnum;
11
- /** Current operation mode of the robot controller */
12
- operationMode: RobotControllerStateOperationModeEnum;
13
- /** Whether the "Drive to Home" button should be enabled */
14
- driveToHomeEnabled?: boolean;
15
- /** Callback fired when "Drive to Home" button is pressed */
16
- onDriveToHomePress?: () => void;
17
- /** Callback fired when "Drive to Home" button is released */
18
- onDriveToHomeRelease?: () => void;
19
- /** Connected motion group for the robot */
20
- connectedMotionGroup: ConnectedMotionGroup;
21
- /** Custom robot component to render (optional, defaults to Robot) */
22
- robotComponent?: React.ComponentType<{
23
- connectedMotionGroup: ConnectedMotionGroup;
24
- flangeRef?: React.Ref<Group>;
25
- postModelRender?: () => void;
26
- transparentColor?: string;
27
- getModel?: (modelFromController: string) => string;
28
- }>;
29
- /** Custom cycle timer component (optional, defaults to CycleTimer) */
30
- cycleTimerComponent?: React.ComponentType<{
31
- variant?: "default" | "small";
32
- compact?: boolean;
33
- onCycleComplete: (controls: {
34
- startNewCycle: (maxTimeSeconds: number, elapsedSeconds?: number) => void;
35
- pause: () => void;
36
- resume: () => void;
37
- isPaused: () => boolean;
38
- }) => void;
39
- onCycleEnd?: () => void;
40
- autoStart?: boolean;
41
- className?: string;
42
- }>;
43
- /** Callback to receive cycle timer controls for external timer management */
44
- onCycleTimerReady?: (controls: {
45
- startNewCycle: (maxTimeSeconds: number, elapsedSeconds?: number) => void;
46
- pause: () => void;
47
- resume: () => void;
48
- isPaused: () => boolean;
49
- }) => void;
50
- /** Callback fired when a cycle completes (reaches zero) */
51
- onCycleEnd?: () => void;
52
- /** Whether the cycle timer should auto-start when a new cycle is set */
53
- cycleTimerAutoStart?: boolean;
54
- /** Additional CSS class name */
55
- className?: string;
56
- }
57
- /**
58
- * A responsive card component that displays a 3D robot with states and controls.
59
- * The card automatically adapts to its container's size and aspect ratio.
60
- *
61
- * Features:
62
- * - Fully responsive Material-UI Card that adapts to container dimensions
63
- * - Automatic layout switching based on aspect ratio:
64
- * - Portrait mode: Vertical layout with robot in center
65
- * - Landscape mode: Horizontal layout with robot on left, content on right (left-aligned)
66
- * - Responsive 3D robot rendering:
67
- * - Scales dynamically with container size
68
- * - Hides at very small sizes to preserve usability
69
- * - Adaptive margin based on available space
70
- * - Smart spacing and padding that reduces at smaller sizes
71
- * - Minimum size constraints for usability while maximizing content density
72
- * - Robot name displayed in Typography h6 at top-left
73
- * - Program state indicator below the name
74
- * - Auto-fitting 3D robot model that scales with container size
75
- * - Compact cycle time component with small variant
76
- * - Transparent gray divider line
77
- * - "Drive to Home" button with press-and-hold functionality
78
- * - Localization support via react-i18next
79
- * - Material-UI theming integration
80
- */
81
- export declare const RobotCard: (({ robotName, programState, safetyState, operationMode, driveToHomeEnabled, onDriveToHomePress, onDriveToHomeRelease, connectedMotionGroup, robotComponent: RobotComponent, cycleTimerComponent: CycleTimerComponent, onCycleTimerReady, onCycleEnd, cycleTimerAutoStart, className, }: RobotCardProps) => import("react/jsx-runtime").JSX.Element) & {
82
- displayName: string;
83
- };
84
- //# sourceMappingURL=RobotCard.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RobotCard.d.ts","sourceRoot":"","sources":["../../src/components/RobotCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACpB,qCAAqC,EACrC,mCAAmC,EACpC,MAAM,wBAAwB,CAAA;AAI/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAIlC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAuBpD,MAAM,WAAW,cAAc;IAC7B,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAA;IACjB,4BAA4B;IAC5B,YAAY,EAAE,YAAY,CAAA;IAC1B,mDAAmD;IACnD,WAAW,EAAE,mCAAmC,CAAA;IAChD,qDAAqD;IACrD,aAAa,EAAE,qCAAqC,CAAA;IACpD,2DAA2D;IAC3D,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC/B,6DAA6D;IAC7D,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAA;IACjC,2CAA2C;IAC3C,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,qEAAqE;IACrE,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACnC,oBAAoB,EAAE,oBAAoB,CAAA;QAC1C,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC5B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;QAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAA;QACzB,QAAQ,CAAC,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,CAAA;KACnD,CAAC,CAAA;IACF,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACxC,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;QAC7B,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,eAAe,EAAE,CAAC,QAAQ,EAAE;YAC1B,aAAa,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;YACxE,KAAK,EAAE,MAAM,IAAI,CAAA;YACjB,MAAM,EAAE,MAAM,IAAI,CAAA;YAClB,QAAQ,EAAE,MAAM,OAAO,CAAA;SACxB,KAAK,IAAI,CAAA;QACV,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;QACvB,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAC,CAAA;IACF,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE;QAC7B,aAAa,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;QACxE,KAAK,EAAE,MAAM,IAAI,CAAA;QACjB,MAAM,EAAE,MAAM,IAAI,CAAA;QAClB,QAAQ,EAAE,MAAM,OAAO,CAAA;KACxB,KAAK,IAAI,CAAA;IACV,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,wEAAwE;IACxE,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,SAAS,2RAiBf,cAAc;;CA0bpB,CAAA"}