@wandelbots/wandelbots-js-react-components 6.3.0 → 6.4.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.
- package/README.md +185 -124
- package/dist/3d.cjs +1 -1
- package/dist/3d.d.ts +0 -3
- package/dist/3d.js +16 -21
- package/dist/SafetyBar/index.cjs +1 -1
- package/dist/SafetyBar/index.js +1 -1
- package/dist/chunks/ConnectedMotionGroup-BewSDQvD.cjs +4 -0
- package/dist/chunks/ConnectedMotionGroup-D6-4wBkk.js +2654 -0
- package/dist/chunks/Robot-C0uICTOn.js +1271 -0
- package/dist/chunks/Robot-D6RUDXEz.cjs +1 -0
- package/dist/chunks/{SafetyBar-Cy9DiXp9.js → SafetyBar-C2-H1ifP.js} +1 -1
- package/dist/chunks/{SafetyBar-DPrv_OQA.cjs → SafetyBar-Cq_WsuK2.cjs} +1 -1
- package/dist/chunks/externalizeComponent-Bue3-Wra.cjs +2 -0
- package/dist/chunks/{externalizeComponent-EDymnaGR.js → externalizeComponent-C0cVcPE2.js} +29 -107
- package/dist/chunks/useSmoothedMotionState-COMJRcOt.js +214 -0
- package/dist/chunks/useSmoothedMotionState-Con0E5Bx.cjs +1 -0
- package/dist/components/AppHeader.d.ts +1 -1
- package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +1 -1
- package/dist/components/jogging/JoggingJointTab.d.ts +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts +6 -3
- package/dist/components/jogging/JoggingStore.d.ts +5 -1
- package/dist/components/jogging/joggingColors.d.ts +18 -0
- package/dist/components/robots/GenericRobot.d.ts +2 -1
- package/dist/components/robots/LinearAxis.d.ts +1 -1
- package/dist/components/robots/LinearAxisAnimator.d.ts +11 -2
- package/dist/components/robots/Robot.d.ts +1 -1
- package/dist/components/robots/robotModelLogic.d.ts +11 -9
- package/dist/components/utils/hooks.d.ts +1 -6
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +3 -18
- package/dist/core.js +27 -54
- package/dist/index.cjs +1 -1
- package/dist/index.js +39 -71
- package/dist/lib/ConnectedMotionGroup.d.ts +5 -7
- package/dist/lib/JoggerConnection.d.ts +29 -5
- package/dist/lib/MotionStreamConnection.d.ts +4 -6
- package/dist/lib/novaConnection.d.ts +23 -0
- package/package.json +31 -66
- package/dist/Setup.d.ts +0 -11
- package/dist/chunks/MotionGroupVisualizer-DshWR1wY.js +0 -1653
- package/dist/chunks/MotionGroupVisualizer-eD7yFEcF.cjs +0 -1
- package/dist/chunks/externalizeComponent-OO4jcrz5.cjs +0 -2
- package/dist/chunks/theming-DfSy4-Ic.cjs +0 -4
- package/dist/chunks/theming-mF9Rt8SS.js +0 -5542
- package/dist/chunks/useSmoothedMotionState-DyDgSVYX.js +0 -478
- package/dist/chunks/useSmoothedMotionState-VYxEIyfr.cjs +0 -1
- package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +0 -11
- package/dist/components/AdornedTextField.d.ts +0 -7
- package/dist/components/CopyableText.d.ts +0 -6
- package/dist/components/CycleTimer/CycleTimer.d.ts +0 -3
- package/dist/components/CycleTimer/DefaultVariant.d.ts +0 -9
- package/dist/components/CycleTimer/SmallVariant.d.ts +0 -10
- package/dist/components/CycleTimer/index.d.ts +0 -27
- package/dist/components/CycleTimer/types.d.ts +0 -49
- package/dist/components/CycleTimer/useAnimations.d.ts +0 -14
- package/dist/components/CycleTimer/useTimerLogic.d.ts +0 -24
- package/dist/components/CycleTimer/utils.d.ts +0 -21
- package/dist/components/CycleTimer.d.ts +0 -3
- package/dist/components/DataGrid.d.ts +0 -66
- package/dist/components/LogPanel.d.ts +0 -38
- package/dist/components/LogStore.d.ts +0 -12
- package/dist/components/LogViewer.d.ts +0 -46
- package/dist/components/ProgramControl.d.ts +0 -55
- package/dist/components/ProgramStateIndicator.d.ts +0 -26
- package/dist/components/RobotCard.d.ts +0 -98
- package/dist/components/RobotListItem.d.ts +0 -34
- package/dist/components/RobotSetupReadinessIndicator.d.ts +0 -37
- package/dist/components/SelectableFab.d.ts +0 -7
- package/dist/components/TabBar.d.ts +0 -45
- package/dist/components/ThemeSelect.d.ts +0 -6
- package/dist/components/Timer/Timer.d.ts +0 -3
- package/dist/components/Timer/TimerDefaultVariant.d.ts +0 -9
- package/dist/components/Timer/TimerSmallVariant.d.ts +0 -10
- package/dist/components/Timer/index.d.ts +0 -19
- package/dist/components/Timer/types.d.ts +0 -35
- package/dist/components/Timer/useTimerAnimations.d.ts +0 -10
- package/dist/components/Timer/useTimerLogic.d.ts +0 -19
- package/dist/components/Timer/utils.d.ts +0 -17
- package/dist/components/Timer.d.ts +0 -3
- package/dist/components/TransparentOverlay.d.ts +0 -4
- package/dist/components/jogging/JoggingFreedriveTab.d.ts +0 -1
- package/dist/components/jogging/PoseCartesianValues.d.ts +0 -9
- package/dist/components/jogging/PoseJointValues.d.ts +0 -8
- package/dist/components/robots/AxisConfig.d.ts +0 -2
- package/dist/components/robots/manufacturerHomePositions.d.ts +0 -20
- package/dist/icons/DropdownArrowIcon.d.ts +0 -2
- package/dist/icons/index.d.ts +0 -12
- package/dist/lib/novaCompat.d.ts +0 -16
- package/dist/themes/createDarkTheme.d.ts +0 -7
- package/dist/themes/themeTypes.d.ts +0 -40
- package/dist/themes/theming.d.ts +0 -24
|
@@ -1,478 +0,0 @@
|
|
|
1
|
-
import { jsx as g, jsxs as M } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme as O } from "@mui/material/styles";
|
|
3
|
-
import w from "@mui/material/Chip";
|
|
4
|
-
import F from "@mui/material/Typography";
|
|
5
|
-
import { observer as R } from "mobx-react-lite";
|
|
6
|
-
import { useTranslation as V } from "react-i18next";
|
|
7
|
-
import { e as x } from "./externalizeComponent-EDymnaGR.js";
|
|
8
|
-
import Y from "@mui/icons-material/Pause";
|
|
9
|
-
import S from "@mui/icons-material/PlayArrow";
|
|
10
|
-
import P from "@mui/icons-material/Stop";
|
|
11
|
-
import A from "@mui/material/Box";
|
|
12
|
-
import D from "@mui/material/Button";
|
|
13
|
-
import { reaction as U, autorun as N, observable as L, runInAction as C } from "mobx";
|
|
14
|
-
import b, { useEffect as _, useState as G, useRef as I } from "react";
|
|
15
|
-
var d = /* @__PURE__ */ ((t) => (t.IDLE = "idle", t.PREPARING = "preparing", t.STARTING = "starting", t.RUNNING = "running", t.PAUSING = "pausing", t.PAUSED = "paused", t.STOPPING = "stopping", t.COMPLETED = "completed", t.FAILED = "failed", t.STOPPED = "stopped", t.ERROR = "error", t))(d || {});
|
|
16
|
-
const et = x(
|
|
17
|
-
R(
|
|
18
|
-
({
|
|
19
|
-
state: t,
|
|
20
|
-
onRun: e,
|
|
21
|
-
onPause: i,
|
|
22
|
-
onStop: s,
|
|
23
|
-
onReset: o,
|
|
24
|
-
requiresManualReset: r = !1,
|
|
25
|
-
variant: a = "with_pause",
|
|
26
|
-
className: p
|
|
27
|
-
}) => {
|
|
28
|
-
const u = O(), { t: m } = V(), l = () => {
|
|
29
|
-
const n = {
|
|
30
|
-
run: {
|
|
31
|
-
enabled: t === "idle" || t === "stopped" || t === "paused" || t === "completed" || t === "failed" || t === "error",
|
|
32
|
-
label: m(t === "paused" ? "ProgramControl.Resume.bt" : t === "error" || t === "failed" ? "ProgramControl.Retry.bt" : "ProgramControl.Start.bt"),
|
|
33
|
-
color: u.palette.success.main,
|
|
34
|
-
onClick: e
|
|
35
|
-
},
|
|
36
|
-
pause: {
|
|
37
|
-
enabled: t === "running",
|
|
38
|
-
label: m("ProgramControl.Pause.bt"),
|
|
39
|
-
color: "#FFFFFF33",
|
|
40
|
-
onClick: i || (() => {
|
|
41
|
-
})
|
|
42
|
-
},
|
|
43
|
-
stop: {
|
|
44
|
-
enabled: t === "preparing" || t === "starting" || t === "running" || t === "pausing" || t === "paused",
|
|
45
|
-
label: m("ProgramControl.Stop.bt"),
|
|
46
|
-
color: u.palette.error.main,
|
|
47
|
-
onClick: s
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
return a === "without_pause" ? [n.run, n.stop] : [n.run, n.pause, n.stop];
|
|
51
|
-
}, h = (n) => {
|
|
52
|
-
const c = { sx: { fontSize: "55px" } };
|
|
53
|
-
if (a === "without_pause")
|
|
54
|
-
return n === 0 ? /* @__PURE__ */ g(S, { ...c }) : /* @__PURE__ */ g(P, { ...c });
|
|
55
|
-
switch (n) {
|
|
56
|
-
case 0:
|
|
57
|
-
return /* @__PURE__ */ g(S, { ...c });
|
|
58
|
-
case 1:
|
|
59
|
-
return /* @__PURE__ */ g(Y, { ...c });
|
|
60
|
-
case 2:
|
|
61
|
-
return /* @__PURE__ */ g(P, { ...c });
|
|
62
|
-
default:
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
}, T = l();
|
|
66
|
-
return /* @__PURE__ */ g(
|
|
67
|
-
A,
|
|
68
|
-
{
|
|
69
|
-
className: p,
|
|
70
|
-
sx: {
|
|
71
|
-
display: "flex",
|
|
72
|
-
flexDirection: "column",
|
|
73
|
-
alignItems: "center",
|
|
74
|
-
gap: 2
|
|
75
|
-
},
|
|
76
|
-
children: /* @__PURE__ */ g(
|
|
77
|
-
A,
|
|
78
|
-
{
|
|
79
|
-
sx: {
|
|
80
|
-
display: "flex",
|
|
81
|
-
gap: "40px",
|
|
82
|
-
flexWrap: "wrap",
|
|
83
|
-
justifyContent: "center",
|
|
84
|
-
alignItems: "center"
|
|
85
|
-
},
|
|
86
|
-
children: T.map((n, c) => /* @__PURE__ */ M(
|
|
87
|
-
A,
|
|
88
|
-
{
|
|
89
|
-
sx: {
|
|
90
|
-
display: "flex",
|
|
91
|
-
flexDirection: "column",
|
|
92
|
-
alignItems: "center",
|
|
93
|
-
gap: 1
|
|
94
|
-
},
|
|
95
|
-
children: [
|
|
96
|
-
/* @__PURE__ */ g(
|
|
97
|
-
D,
|
|
98
|
-
{
|
|
99
|
-
variant: "contained",
|
|
100
|
-
disabled: !n.enabled || t === "preparing" || t === "starting" || t === "pausing" || t === "stopping" && !r,
|
|
101
|
-
onClick: n.onClick,
|
|
102
|
-
sx: {
|
|
103
|
-
width: "88px",
|
|
104
|
-
height: "88px",
|
|
105
|
-
borderRadius: "88px",
|
|
106
|
-
backgroundColor: n.color,
|
|
107
|
-
opacity: n.enabled && t !== "preparing" && t !== "starting" && t !== "pausing" && !(t === "stopping" && !r) ? 1 : 0.3,
|
|
108
|
-
"&:hover": {
|
|
109
|
-
backgroundColor: n.color,
|
|
110
|
-
opacity: n.enabled && t !== "preparing" && t !== "starting" && t !== "pausing" && !(t === "stopping" && !r) ? 0.8 : 0.3
|
|
111
|
-
},
|
|
112
|
-
"&:disabled": {
|
|
113
|
-
backgroundColor: n.color,
|
|
114
|
-
opacity: 0.3
|
|
115
|
-
},
|
|
116
|
-
minWidth: "88px",
|
|
117
|
-
flexShrink: 0
|
|
118
|
-
},
|
|
119
|
-
children: h(c)
|
|
120
|
-
}
|
|
121
|
-
),
|
|
122
|
-
/* @__PURE__ */ g(
|
|
123
|
-
F,
|
|
124
|
-
{
|
|
125
|
-
variant: "body1",
|
|
126
|
-
sx: {
|
|
127
|
-
color: n.enabled && t !== "preparing" && t !== "starting" && t !== "pausing" && !(t === "stopping" && !r) ? n.color : u.palette.text.disabled,
|
|
128
|
-
textAlign: "center",
|
|
129
|
-
opacity: n.enabled && t !== "preparing" && t !== "starting" && t !== "pausing" && !(t === "stopping" && !r) ? 1 : 0.3
|
|
130
|
-
},
|
|
131
|
-
children: n.label
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
]
|
|
135
|
-
},
|
|
136
|
-
n.label
|
|
137
|
-
))
|
|
138
|
-
}
|
|
139
|
-
)
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
)
|
|
144
|
-
), rt = x(
|
|
145
|
-
R(
|
|
146
|
-
({
|
|
147
|
-
programState: t,
|
|
148
|
-
safetyState: e,
|
|
149
|
-
operationMode: i,
|
|
150
|
-
className: s
|
|
151
|
-
}) => {
|
|
152
|
-
const o = O(), { t: r } = V(), a = () => {
|
|
153
|
-
if (e === "SAFETY_STATE_DEVICE_EMERGENCY_STOP" || e === "SAFETY_STATE_ROBOT_EMERGENCY_STOP" || e === "SAFETY_STATE_STOP_0" || e === "SAFETY_STATE_STOP_1" || e === "SAFETY_STATE_STOP_2" || e === "SAFETY_STATE_PROTECTIVE_STOP" || e === "SAFETY_STATE_STOP" || e === "SAFETY_STATE_REDUCED" || e === "SAFETY_STATE_MASTERING" || e === "SAFETY_STATE_CONFIRM_SAFETY" || e === "SAFETY_STATE_OPERATOR_SAFETY" || e === "SAFETY_STATE_RECOVERY" || e === "SAFETY_STATE_VIOLATION")
|
|
154
|
-
return {
|
|
155
|
-
label: r("ProgramStateIndicator.EStop.lb"),
|
|
156
|
-
color: o.palette.error.main
|
|
157
|
-
};
|
|
158
|
-
if (e === "SAFETY_STATE_UNKNOWN" || e === "SAFETY_STATE_FAULT")
|
|
159
|
-
return {
|
|
160
|
-
label: r("ProgramStateIndicator.Error.lb"),
|
|
161
|
-
color: o.palette.error.main
|
|
162
|
-
};
|
|
163
|
-
if (e === "SAFETY_STATE_NORMAL")
|
|
164
|
-
switch (t) {
|
|
165
|
-
case d.PREPARING:
|
|
166
|
-
return {
|
|
167
|
-
label: r("ProgramStateIndicator.Preparing.lb"),
|
|
168
|
-
color: o.palette.warning.main
|
|
169
|
-
};
|
|
170
|
-
case d.STARTING:
|
|
171
|
-
return {
|
|
172
|
-
label: r("ProgramStateIndicator.Starting.lb"),
|
|
173
|
-
color: o.palette.warning.main
|
|
174
|
-
};
|
|
175
|
-
case d.RUNNING:
|
|
176
|
-
return {
|
|
177
|
-
label: r("ProgramStateIndicator.Running.lb"),
|
|
178
|
-
color: o.palette.success.main
|
|
179
|
-
};
|
|
180
|
-
case d.PAUSING:
|
|
181
|
-
return {
|
|
182
|
-
label: r("ProgramStateIndicator.Pausing.lb"),
|
|
183
|
-
color: o.palette.warning.main
|
|
184
|
-
};
|
|
185
|
-
case d.PAUSED:
|
|
186
|
-
return {
|
|
187
|
-
label: r("ProgramStateIndicator.Paused.lb"),
|
|
188
|
-
color: o.palette.grey[600]
|
|
189
|
-
};
|
|
190
|
-
case d.STOPPING:
|
|
191
|
-
return {
|
|
192
|
-
label: r("ProgramStateIndicator.Stopping.lb"),
|
|
193
|
-
color: o.palette.warning.main
|
|
194
|
-
};
|
|
195
|
-
case d.COMPLETED:
|
|
196
|
-
return {
|
|
197
|
-
label: r("ProgramStateIndicator.Completed.lb"),
|
|
198
|
-
color: o.palette.success.main
|
|
199
|
-
};
|
|
200
|
-
case d.FAILED:
|
|
201
|
-
return {
|
|
202
|
-
label: r("ProgramStateIndicator.Failed.lb"),
|
|
203
|
-
color: o.palette.error.main
|
|
204
|
-
};
|
|
205
|
-
case d.STOPPED:
|
|
206
|
-
return {
|
|
207
|
-
label: r("ProgramStateIndicator.Stopped.lb"),
|
|
208
|
-
color: o.palette.warning.main
|
|
209
|
-
};
|
|
210
|
-
case d.ERROR:
|
|
211
|
-
return {
|
|
212
|
-
label: r("ProgramStateIndicator.Error.lb"),
|
|
213
|
-
color: o.palette.error.main
|
|
214
|
-
};
|
|
215
|
-
default:
|
|
216
|
-
return {
|
|
217
|
-
label: r("ProgramStateIndicator.Ready.lb"),
|
|
218
|
-
color: o.palette.success.main
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
return {
|
|
222
|
-
label: r("ProgramStateIndicator.Idle.lb"),
|
|
223
|
-
color: o.palette.grey[600]
|
|
224
|
-
};
|
|
225
|
-
}, { label: p, color: u } = a(), l = `${p} / ${(() => {
|
|
226
|
-
switch (i) {
|
|
227
|
-
case "OPERATION_MODE_AUTO":
|
|
228
|
-
return r("ProgramStateIndicator.Auto.lb");
|
|
229
|
-
case "OPERATION_MODE_MANUAL":
|
|
230
|
-
return r("ProgramStateIndicator.Manual.lb");
|
|
231
|
-
case "OPERATION_MODE_MANUAL_T1":
|
|
232
|
-
return r("ProgramStateIndicator.ManualT1.lb");
|
|
233
|
-
case "OPERATION_MODE_MANUAL_T2":
|
|
234
|
-
return r("ProgramStateIndicator.ManualT2.lb");
|
|
235
|
-
default:
|
|
236
|
-
return r("ProgramStateIndicator.Auto.lb");
|
|
237
|
-
}
|
|
238
|
-
})()}`;
|
|
239
|
-
return /* @__PURE__ */ g(
|
|
240
|
-
w,
|
|
241
|
-
{
|
|
242
|
-
className: s,
|
|
243
|
-
label: /* @__PURE__ */ g(
|
|
244
|
-
F,
|
|
245
|
-
{
|
|
246
|
-
variant: "body2",
|
|
247
|
-
sx: {
|
|
248
|
-
fontSize: "0.75rem",
|
|
249
|
-
// Smaller than body2
|
|
250
|
-
lineHeight: 1.2
|
|
251
|
-
},
|
|
252
|
-
children: l
|
|
253
|
-
}
|
|
254
|
-
),
|
|
255
|
-
variant: "filled",
|
|
256
|
-
sx: {
|
|
257
|
-
backgroundColor: u,
|
|
258
|
-
color: o.palette.getContrastText(u),
|
|
259
|
-
fontWeight: 500,
|
|
260
|
-
height: "auto",
|
|
261
|
-
"& .MuiChip-label": {
|
|
262
|
-
paddingX: 1.5,
|
|
263
|
-
paddingY: 0.5
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
|
-
)
|
|
270
|
-
);
|
|
271
|
-
function E(t) {
|
|
272
|
-
_(t, []);
|
|
273
|
-
}
|
|
274
|
-
function nt(t) {
|
|
275
|
-
E(() => N(t));
|
|
276
|
-
}
|
|
277
|
-
function ot(t, e, i) {
|
|
278
|
-
E(() => U(t, e, i));
|
|
279
|
-
}
|
|
280
|
-
function it(t) {
|
|
281
|
-
return E(() => {
|
|
282
|
-
let e;
|
|
283
|
-
function i() {
|
|
284
|
-
t(), e = requestAnimationFrame(i);
|
|
285
|
-
}
|
|
286
|
-
return e = requestAnimationFrame(i), () => {
|
|
287
|
-
cancelAnimationFrame(e);
|
|
288
|
-
};
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
class v {
|
|
292
|
-
constructor(e = [], i = {}) {
|
|
293
|
-
this.currentValues = [], this.targetValues = [], this.previousTargetValues = [], this.targetUpdateTime = 0, this.animationId = null, this.updateCount = 0, this.velocities = [], this.animate = () => {
|
|
294
|
-
this.update(0.016666666666666666) ? this.animationId = null : this.animationId = requestAnimationFrame(this.animate);
|
|
295
|
-
}, this.options = {
|
|
296
|
-
tension: 120,
|
|
297
|
-
friction: 20,
|
|
298
|
-
threshold: 1e-3,
|
|
299
|
-
onChange: () => {
|
|
300
|
-
},
|
|
301
|
-
onComplete: () => {
|
|
302
|
-
},
|
|
303
|
-
...i
|
|
304
|
-
}, this.currentValues = [...e], this.targetValues = [...e], this.previousTargetValues = [...e], this.velocities = new Array(e.length).fill(0), this.targetUpdateTime = performance.now(), this.updateCount = 0;
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Update interpolation using spring physics
|
|
308
|
-
*
|
|
309
|
-
* Call this method every frame for smooth animation. In React Three Fiber,
|
|
310
|
-
* call from within useFrame callback with the provided delta time.
|
|
311
|
-
*
|
|
312
|
-
* @param delta - Time elapsed since last update in seconds (e.g., 1/60 ≈ 0.0167 for 60fps)
|
|
313
|
-
* @returns true when interpolation is complete (all values reached their targets)
|
|
314
|
-
*/
|
|
315
|
-
update(e = 1 / 60) {
|
|
316
|
-
let i = !1, s = !0;
|
|
317
|
-
this.updateCount++;
|
|
318
|
-
const o = Math.min(e, 1 / 15), r = this.updateCount === 1 ? 0.7 : 1;
|
|
319
|
-
for (let a = 0; a < this.currentValues.length; a++) {
|
|
320
|
-
const p = this.currentValues[a], u = this.targetValues[a], m = this.velocities[a], l = u - p, h = l * this.options.tension * r, T = m * this.options.friction, n = h - T, c = m + n * o, f = p + c * o;
|
|
321
|
-
Math.abs(l) < this.options.threshold && Math.abs(c) < this.options.threshold * 10 ? this.currentValues[a] !== u && (this.currentValues[a] = u, this.velocities[a] = 0, i = !0) : (s = !1, this.currentValues[a] = f, this.velocities[a] = c, i = !0);
|
|
322
|
-
}
|
|
323
|
-
return i && this.options.onChange(this.currentValues), s && this.options.onComplete(this.currentValues), s;
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Set new target values for the interpolation to move towards
|
|
327
|
-
*
|
|
328
|
-
* Includes smart blending for very rapid target updates (faster than 120fps)
|
|
329
|
-
* to prevent jarring movements when targets change frequently.
|
|
330
|
-
*/
|
|
331
|
-
setTarget(e) {
|
|
332
|
-
const i = performance.now(), s = i - this.targetUpdateTime;
|
|
333
|
-
this.previousTargetValues = [...this.targetValues], this.targetValues = [...e], this.targetUpdateTime = i, this.updateCount = 0;
|
|
334
|
-
const o = this.previousTargetValues.every(
|
|
335
|
-
(r, a) => r === this.currentValues[a]
|
|
336
|
-
);
|
|
337
|
-
if (s < 8 && s > 0 && this.previousTargetValues.length > 0 && !o) {
|
|
338
|
-
const r = Math.min(s / 8, 1);
|
|
339
|
-
for (let a = 0; a < this.targetValues.length; a++) {
|
|
340
|
-
const p = this.previousTargetValues[a] || 0, u = e[a] || 0;
|
|
341
|
-
Math.abs(u - p) > 0.1 && (this.targetValues[a] = p + (u - p) * r);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
for (; this.currentValues.length < e.length; )
|
|
345
|
-
this.currentValues.push(e[this.currentValues.length]), this.velocities.push(0);
|
|
346
|
-
this.currentValues.length > e.length && (this.currentValues = this.currentValues.slice(0, e.length), this.velocities = this.velocities.slice(0, e.length));
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* Get a copy of all current interpolated values
|
|
350
|
-
*/
|
|
351
|
-
getCurrentValues() {
|
|
352
|
-
return [...this.currentValues];
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* Get a single interpolated value by its array index
|
|
356
|
-
*/
|
|
357
|
-
getValue(e) {
|
|
358
|
-
return this.currentValues[e] ?? 0;
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* Check if automatic interpolation is currently running
|
|
362
|
-
*
|
|
363
|
-
* This only tracks auto-interpolation started with startAutoInterpolation().
|
|
364
|
-
* Manual update() calls are not tracked by this method.
|
|
365
|
-
*/
|
|
366
|
-
isInterpolating() {
|
|
367
|
-
return this.animationId !== null;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Stop automatic interpolation if it's running
|
|
371
|
-
*
|
|
372
|
-
* This cancels the internal animation frame loop but does not affect
|
|
373
|
-
* manual update() calls.
|
|
374
|
-
*/
|
|
375
|
-
stop() {
|
|
376
|
-
this.animationId !== null && (cancelAnimationFrame(this.animationId), this.animationId = null);
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
* Instantly set values without interpolation
|
|
380
|
-
*/
|
|
381
|
-
setImmediate(e) {
|
|
382
|
-
this.stop(), this.currentValues = [...e], this.targetValues = [...e], this.previousTargetValues = [...e], this.velocities = new Array(e.length).fill(0), this.targetUpdateTime = performance.now(), this.updateCount = 0, this.options.onChange(this.currentValues);
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Update interpolation options
|
|
386
|
-
*/
|
|
387
|
-
updateOptions(e) {
|
|
388
|
-
this.options = { ...this.options, ...e };
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Start automatic interpolation with an animation loop
|
|
392
|
-
*
|
|
393
|
-
* This begins a requestAnimationFrame loop that calls update() automatically.
|
|
394
|
-
* For React Three Fiber components, prefer using manual update() calls
|
|
395
|
-
* within useFrame hooks instead.
|
|
396
|
-
*/
|
|
397
|
-
startAutoInterpolation() {
|
|
398
|
-
this.startInterpolation();
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* Clean up all resources and stop any running animations
|
|
402
|
-
*
|
|
403
|
-
* This cancels any active animation frames and resets internal state.
|
|
404
|
-
* Call this when the component unmounts or is no longer needed.
|
|
405
|
-
*/
|
|
406
|
-
destroy() {
|
|
407
|
-
this.stop();
|
|
408
|
-
}
|
|
409
|
-
startInterpolation() {
|
|
410
|
-
this.animationId === null && this.animate();
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
function at(t = [], e = {}) {
|
|
414
|
-
const i = b.useRef(null);
|
|
415
|
-
return i.current || (i.current = new v(t, e)), b.useEffect(() => {
|
|
416
|
-
var s;
|
|
417
|
-
(s = i.current) == null || s.updateOptions(e);
|
|
418
|
-
}, [e]), b.useEffect(() => () => {
|
|
419
|
-
var s;
|
|
420
|
-
(s = i.current) == null || s.destroy();
|
|
421
|
-
}, []), [i.current];
|
|
422
|
-
}
|
|
423
|
-
function st(t, e) {
|
|
424
|
-
const [i] = G(
|
|
425
|
-
() => L({ ...t })
|
|
426
|
-
), s = I(null), o = I(null), r = I(0);
|
|
427
|
-
function a() {
|
|
428
|
-
o.current !== null && (cancelAnimationFrame(o.current), o.current = null);
|
|
429
|
-
}
|
|
430
|
-
function p() {
|
|
431
|
-
const l = s.current;
|
|
432
|
-
if (!l) return;
|
|
433
|
-
const h = performance.now(), T = (h - r.current) / 1e3;
|
|
434
|
-
r.current = h;
|
|
435
|
-
const n = l.update(T);
|
|
436
|
-
C(() => {
|
|
437
|
-
i.joint_position = l.getCurrentValues();
|
|
438
|
-
}), o.current = n ? null : requestAnimationFrame(p);
|
|
439
|
-
}
|
|
440
|
-
function u() {
|
|
441
|
-
o.current === null && (r.current = performance.now(), o.current = requestAnimationFrame(p));
|
|
442
|
-
}
|
|
443
|
-
function m(l) {
|
|
444
|
-
var T;
|
|
445
|
-
const h = l.joint_position.filter(
|
|
446
|
-
(n) => n !== void 0
|
|
447
|
-
);
|
|
448
|
-
(T = s.current) == null || T.setTarget(h), C(() => {
|
|
449
|
-
const n = l, c = i;
|
|
450
|
-
for (const f of Object.keys(n))
|
|
451
|
-
f !== "joint_position" && c[f] !== n[f] && (c[f] = n[f]);
|
|
452
|
-
}), u();
|
|
453
|
-
}
|
|
454
|
-
return E(() => {
|
|
455
|
-
const l = t.joint_position.filter(
|
|
456
|
-
(h) => h !== void 0
|
|
457
|
-
);
|
|
458
|
-
return s.current = new v(l, e), () => {
|
|
459
|
-
var h;
|
|
460
|
-
a(), (h = s.current) == null || h.destroy();
|
|
461
|
-
};
|
|
462
|
-
}), _(() => {
|
|
463
|
-
var l;
|
|
464
|
-
e && ((l = s.current) == null || l.updateOptions(e));
|
|
465
|
-
}, [e]), _(() => N(() => m(t)), [t]), i;
|
|
466
|
-
}
|
|
467
|
-
export {
|
|
468
|
-
et as P,
|
|
469
|
-
v as V,
|
|
470
|
-
d as a,
|
|
471
|
-
rt as b,
|
|
472
|
-
nt as c,
|
|
473
|
-
at as d,
|
|
474
|
-
E as e,
|
|
475
|
-
ot as f,
|
|
476
|
-
st as g,
|
|
477
|
-
it as u
|
|
478
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const g=require("react/jsx-runtime"),C=require("@mui/material/styles"),V=require("@mui/material/Chip"),x=require("@mui/material/Typography"),O=require("mobx-react-lite"),R=require("react-i18next"),F=require("./externalizeComponent-OO4jcrz5.cjs"),N=require("@mui/icons-material/Pause"),_=require("@mui/icons-material/PlayArrow"),P=require("@mui/icons-material/Stop"),f=require("@mui/material/Box"),v=require("@mui/material/Button"),b=require("mobx"),T=require("react");var m=(e=>(e.IDLE="idle",e.PREPARING="preparing",e.STARTING="starting",e.RUNNING="running",e.PAUSING="pausing",e.PAUSED="paused",e.STOPPING="stopping",e.COMPLETED="completed",e.FAILED="failed",e.STOPPED="stopped",e.ERROR="error",e))(m||{});const M=F.externalizeComponent(O.observer(({state:e,onRun:t,onPause:i,onStop:s,onReset:o,requiresManualReset:r=!1,variant:a="with_pause",className:p})=>{const u=C.useTheme(),{t:d}=R.useTranslation(),l=()=>{const n={run:{enabled:e==="idle"||e==="stopped"||e==="paused"||e==="completed"||e==="failed"||e==="error",label:d(e==="paused"?"ProgramControl.Resume.bt":e==="error"||e==="failed"?"ProgramControl.Retry.bt":"ProgramControl.Start.bt"),color:u.palette.success.main,onClick:t},pause:{enabled:e==="running",label:d("ProgramControl.Pause.bt"),color:"#FFFFFF33",onClick:i||(()=>{})},stop:{enabled:e==="preparing"||e==="starting"||e==="running"||e==="pausing"||e==="paused",label:d("ProgramControl.Stop.bt"),color:u.palette.error.main,onClick:s}};return a==="without_pause"?[n.run,n.stop]:[n.run,n.pause,n.stop]},h=n=>{const c={sx:{fontSize:"55px"}};if(a==="without_pause")return n===0?g.jsx(_,{...c}):g.jsx(P,{...c});switch(n){case 0:return g.jsx(_,{...c});case 1:return g.jsx(N,{...c});case 2:return g.jsx(P,{...c});default:return null}},A=l();return g.jsx(f,{className:p,sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:g.jsx(f,{sx:{display:"flex",gap:"40px",flexWrap:"wrap",justifyContent:"center",alignItems:"center"},children:A.map((n,c)=>g.jsxs(f,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:[g.jsx(v,{variant:"contained",disabled:!n.enabled||e==="preparing"||e==="starting"||e==="pausing"||e==="stopping"&&!r,onClick:n.onClick,sx:{width:"88px",height:"88px",borderRadius:"88px",backgroundColor:n.color,opacity:n.enabled&&e!=="preparing"&&e!=="starting"&&e!=="pausing"&&!(e==="stopping"&&!r)?1:.3,"&:hover":{backgroundColor:n.color,opacity:n.enabled&&e!=="preparing"&&e!=="starting"&&e!=="pausing"&&!(e==="stopping"&&!r)?.8:.3},"&:disabled":{backgroundColor:n.color,opacity:.3},minWidth:"88px",flexShrink:0},children:h(c)}),g.jsx(x,{variant:"body1",sx:{color:n.enabled&&e!=="preparing"&&e!=="starting"&&e!=="pausing"&&!(e==="stopping"&&!r)?n.color:u.palette.text.disabled,textAlign:"center",opacity:n.enabled&&e!=="preparing"&&e!=="starting"&&e!=="pausing"&&!(e==="stopping"&&!r)?1:.3},children:n.label})]},n.label))})})})),w=F.externalizeComponent(O.observer(({programState:e,safetyState:t,operationMode:i,className:s})=>{const o=C.useTheme(),{t:r}=R.useTranslation(),a=()=>{if(t==="SAFETY_STATE_DEVICE_EMERGENCY_STOP"||t==="SAFETY_STATE_ROBOT_EMERGENCY_STOP"||t==="SAFETY_STATE_STOP_0"||t==="SAFETY_STATE_STOP_1"||t==="SAFETY_STATE_STOP_2"||t==="SAFETY_STATE_PROTECTIVE_STOP"||t==="SAFETY_STATE_STOP"||t==="SAFETY_STATE_REDUCED"||t==="SAFETY_STATE_MASTERING"||t==="SAFETY_STATE_CONFIRM_SAFETY"||t==="SAFETY_STATE_OPERATOR_SAFETY"||t==="SAFETY_STATE_RECOVERY"||t==="SAFETY_STATE_VIOLATION")return{label:r("ProgramStateIndicator.EStop.lb"),color:o.palette.error.main};if(t==="SAFETY_STATE_UNKNOWN"||t==="SAFETY_STATE_FAULT")return{label:r("ProgramStateIndicator.Error.lb"),color:o.palette.error.main};if(t==="SAFETY_STATE_NORMAL")switch(e){case m.PREPARING:return{label:r("ProgramStateIndicator.Preparing.lb"),color:o.palette.warning.main};case m.STARTING:return{label:r("ProgramStateIndicator.Starting.lb"),color:o.palette.warning.main};case m.RUNNING:return{label:r("ProgramStateIndicator.Running.lb"),color:o.palette.success.main};case m.PAUSING:return{label:r("ProgramStateIndicator.Pausing.lb"),color:o.palette.warning.main};case m.PAUSED:return{label:r("ProgramStateIndicator.Paused.lb"),color:o.palette.grey[600]};case m.STOPPING:return{label:r("ProgramStateIndicator.Stopping.lb"),color:o.palette.warning.main};case m.COMPLETED:return{label:r("ProgramStateIndicator.Completed.lb"),color:o.palette.success.main};case m.FAILED:return{label:r("ProgramStateIndicator.Failed.lb"),color:o.palette.error.main};case m.STOPPED:return{label:r("ProgramStateIndicator.Stopped.lb"),color:o.palette.warning.main};case m.ERROR:return{label:r("ProgramStateIndicator.Error.lb"),color:o.palette.error.main};default:return{label:r("ProgramStateIndicator.Ready.lb"),color:o.palette.success.main}}return{label:r("ProgramStateIndicator.Idle.lb"),color:o.palette.grey[600]}},{label:p,color:u}=a(),l=`${p} / ${(()=>{switch(i){case"OPERATION_MODE_AUTO":return r("ProgramStateIndicator.Auto.lb");case"OPERATION_MODE_MANUAL":return r("ProgramStateIndicator.Manual.lb");case"OPERATION_MODE_MANUAL_T1":return r("ProgramStateIndicator.ManualT1.lb");case"OPERATION_MODE_MANUAL_T2":return r("ProgramStateIndicator.ManualT2.lb");default:return r("ProgramStateIndicator.Auto.lb")}})()}`;return g.jsx(V,{className:s,label:g.jsx(x,{variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2},children:l}),variant:"filled",sx:{backgroundColor:u,color:o.palette.getContrastText(u),fontWeight:500,height:"auto","& .MuiChip-label":{paddingX:1.5,paddingY:.5}}})}));function I(e){T.useEffect(e,[])}function Y(e){I(()=>b.autorun(e))}function j(e,t,i){I(()=>b.reaction(e,t,i))}function D(e){return I(()=>{let t;function i(){e(),t=requestAnimationFrame(i)}return t=requestAnimationFrame(i),()=>{cancelAnimationFrame(t)}})}class S{constructor(t=[],i={}){this.currentValues=[],this.targetValues=[],this.previousTargetValues=[],this.targetUpdateTime=0,this.animationId=null,this.updateCount=0,this.velocities=[],this.animate=()=>{this.update(.016666666666666666)?this.animationId=null:this.animationId=requestAnimationFrame(this.animate)},this.options={tension:120,friction:20,threshold:.001,onChange:()=>{},onComplete:()=>{},...i},this.currentValues=[...t],this.targetValues=[...t],this.previousTargetValues=[...t],this.velocities=new Array(t.length).fill(0),this.targetUpdateTime=performance.now(),this.updateCount=0}update(t=1/60){let i=!1,s=!0;this.updateCount++;const o=Math.min(t,1/15),r=this.updateCount===1?.7:1;for(let a=0;a<this.currentValues.length;a++){const p=this.currentValues[a],u=this.targetValues[a],d=this.velocities[a],l=u-p,h=l*this.options.tension*r,A=d*this.options.friction,n=h-A,c=d+n*o,E=p+c*o;Math.abs(l)<this.options.threshold&&Math.abs(c)<this.options.threshold*10?this.currentValues[a]!==u&&(this.currentValues[a]=u,this.velocities[a]=0,i=!0):(s=!1,this.currentValues[a]=E,this.velocities[a]=c,i=!0)}return i&&this.options.onChange(this.currentValues),s&&this.options.onComplete(this.currentValues),s}setTarget(t){const i=performance.now(),s=i-this.targetUpdateTime;this.previousTargetValues=[...this.targetValues],this.targetValues=[...t],this.targetUpdateTime=i,this.updateCount=0;const o=this.previousTargetValues.every((r,a)=>r===this.currentValues[a]);if(s<8&&s>0&&this.previousTargetValues.length>0&&!o){const r=Math.min(s/8,1);for(let a=0;a<this.targetValues.length;a++){const p=this.previousTargetValues[a]||0,u=t[a]||0;Math.abs(u-p)>.1&&(this.targetValues[a]=p+(u-p)*r)}}for(;this.currentValues.length<t.length;)this.currentValues.push(t[this.currentValues.length]),this.velocities.push(0);this.currentValues.length>t.length&&(this.currentValues=this.currentValues.slice(0,t.length),this.velocities=this.velocities.slice(0,t.length))}getCurrentValues(){return[...this.currentValues]}getValue(t){return this.currentValues[t]??0}isInterpolating(){return this.animationId!==null}stop(){this.animationId!==null&&(cancelAnimationFrame(this.animationId),this.animationId=null)}setImmediate(t){this.stop(),this.currentValues=[...t],this.targetValues=[...t],this.previousTargetValues=[...t],this.velocities=new Array(t.length).fill(0),this.targetUpdateTime=performance.now(),this.updateCount=0,this.options.onChange(this.currentValues)}updateOptions(t){this.options={...this.options,...t}}startAutoInterpolation(){this.startInterpolation()}destroy(){this.stop()}startInterpolation(){this.animationId===null&&this.animate()}}function U(e=[],t={}){const i=T.useRef(null);return i.current||(i.current=new S(e,t)),T.useEffect(()=>{var s;(s=i.current)==null||s.updateOptions(t)},[t]),T.useEffect(()=>()=>{var s;(s=i.current)==null||s.destroy()},[]),[i.current]}function L(e,t){const[i]=T.useState(()=>b.observable({...e})),s=T.useRef(null),o=T.useRef(null),r=T.useRef(0);function a(){o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}function p(){const l=s.current;if(!l)return;const h=performance.now(),A=(h-r.current)/1e3;r.current=h;const n=l.update(A);b.runInAction(()=>{i.joint_position=l.getCurrentValues()}),o.current=n?null:requestAnimationFrame(p)}function u(){o.current===null&&(r.current=performance.now(),o.current=requestAnimationFrame(p))}function d(l){var A;const h=l.joint_position.filter(n=>n!==void 0);(A=s.current)==null||A.setTarget(h),b.runInAction(()=>{const n=l,c=i;for(const E of Object.keys(n))E!=="joint_position"&&c[E]!==n[E]&&(c[E]=n[E])}),u()}return I(()=>{const l=e.joint_position.filter(h=>h!==void 0);return s.current=new S(l,t),()=>{var h;a(),(h=s.current)==null||h.destroy()}}),T.useEffect(()=>{var l;t&&((l=s.current)==null||l.updateOptions(t))},[t]),T.useEffect(()=>b.autorun(()=>d(e)),[e]),i}exports.ProgramControl=M;exports.ProgramState=m;exports.ProgramStateIndicator=w;exports.ValueInterpolator=S;exports.useAnimationFrame=D;exports.useAutorun=Y;exports.useInterpolation=U;exports.useMounted=I;exports.useReaction=j;exports.useSmoothedMotionState=L;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CoordinateSystem } from "@wandelbots/nova-js/v2";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
3
|
-
/**
|
|
4
|
-
* Applies a API coordinate system transformation to
|
|
5
|
-
* all react-three child components.
|
|
6
|
-
*/
|
|
7
|
-
export declare const CoordinateSystemTransform: ({ coordinateSystem, children, }: {
|
|
8
|
-
coordinateSystem?: CoordinateSystem;
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default CoordinateSystemTransform;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { TextFieldProps } from "@mui/material/TextField";
|
|
2
|
-
type AdornedTextFieldSize = "small" | "medium";
|
|
3
|
-
type AdornedTextFieldProps = TextFieldProps & {
|
|
4
|
-
adornedSize?: AdornedTextFieldSize;
|
|
5
|
-
};
|
|
6
|
-
export declare const AdornedTextField: ({ adornedSize, ...props }: AdornedTextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AnimationState, TimerState } from "./types";
|
|
2
|
-
interface DefaultVariantProps {
|
|
3
|
-
timerState: TimerState;
|
|
4
|
-
animationState: AnimationState;
|
|
5
|
-
hasError: boolean;
|
|
6
|
-
className?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const DefaultVariant: ({ timerState, animationState, hasError, className, }: DefaultVariantProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AnimationState, TimerState } from "./types";
|
|
2
|
-
interface SmallVariantProps {
|
|
3
|
-
timerState: TimerState;
|
|
4
|
-
animationState: AnimationState;
|
|
5
|
-
hasError: boolean;
|
|
6
|
-
compact: boolean;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const SmallVariant: ({ timerState, animationState, hasError, compact, className, }: SmallVariantProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { CycleTimerProps } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* A circular gauge timer component for cycle-specific timing operations
|
|
4
|
-
*
|
|
5
|
-
* Features:
|
|
6
|
-
* - Custom SVG circular gauge with 264px diameter and 40px thickness
|
|
7
|
-
* - Multiple states: idle, measuring, measured, countdown, success
|
|
8
|
-
* - Idle state: shows "Waiting for program cycle" with transparent inner circle
|
|
9
|
-
* - Measuring state: counts up with "Cycle Time" / "measuring..." labels
|
|
10
|
-
* - Measured state: shows final time with "Cycle Time" / "determined" labels in pulsating green
|
|
11
|
-
* - Countdown mode: shows remaining time prominently, counts down to zero
|
|
12
|
-
* - Success state: brief green flash after cycle completion
|
|
13
|
-
* - Displays appropriate labels based on state
|
|
14
|
-
* - Automatically counts down and triggers callback when reaching zero
|
|
15
|
-
* - Full timer control: start, pause, resume functionality
|
|
16
|
-
* - Support for starting with elapsed time (resume mid-cycle)
|
|
17
|
-
* - Error state support: pauses timer and shows error styling (red color)
|
|
18
|
-
* - Smooth fade transitions between different text states
|
|
19
|
-
* - Pulsating text animation for completed measuring state
|
|
20
|
-
* - Fully localized with i18next
|
|
21
|
-
* - Material-UI theming integration
|
|
22
|
-
* - Small variant with animated progress icon (gauge border only) next to text
|
|
23
|
-
*/
|
|
24
|
-
export declare const CycleTimer: (({ onCycleComplete, onCycleEnd, onMeasuringComplete, autoStart, variant, compact, className, hasError, }: CycleTimerProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
25
|
-
displayName: string;
|
|
26
|
-
};
|
|
27
|
-
export default CycleTimer;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export type CycleTimerState = "idle" | "measuring" | "measured" | "countdown" | "success";
|
|
2
|
-
export interface CycleTimerControls {
|
|
3
|
-
startNewCycle: (maxTimeSeconds: number, elapsedSeconds?: number) => void;
|
|
4
|
-
startMeasuring: (elapsedSeconds?: number) => void;
|
|
5
|
-
setIdle: () => void;
|
|
6
|
-
completeMeasuring: () => void;
|
|
7
|
-
pause: () => void;
|
|
8
|
-
resume: () => void;
|
|
9
|
-
isPaused: () => boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface CycleTimerProps {
|
|
12
|
-
/**
|
|
13
|
-
* Callback that receives the timer control functions
|
|
14
|
-
*/
|
|
15
|
-
onCycleComplete: (controls: CycleTimerControls) => void;
|
|
16
|
-
/** Callback fired when a cycle actually completes (reaches zero) */
|
|
17
|
-
onCycleEnd?: () => void;
|
|
18
|
-
/** Callback fired when measuring cycle completes */
|
|
19
|
-
onMeasuringComplete?: () => void;
|
|
20
|
-
/** Whether the timer should start automatically when maxTime is set */
|
|
21
|
-
autoStart?: boolean;
|
|
22
|
-
/** Visual variant of the timer */
|
|
23
|
-
variant?: "default" | "small";
|
|
24
|
-
/** For small variant: whether to show remaining time details (compact hides them) */
|
|
25
|
-
compact?: boolean;
|
|
26
|
-
/** Additional CSS classes */
|
|
27
|
-
className?: string;
|
|
28
|
-
/** Whether the timer is in an error state (pauses timer and shows error styling) */
|
|
29
|
-
hasError?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface TimerState {
|
|
32
|
-
currentState: CycleTimerState;
|
|
33
|
-
remainingTime: number;
|
|
34
|
-
maxTime: number | null;
|
|
35
|
-
isRunning: boolean;
|
|
36
|
-
isPausedState: boolean;
|
|
37
|
-
currentProgress: number;
|
|
38
|
-
wasRunningBeforeError: boolean;
|
|
39
|
-
}
|
|
40
|
-
export interface AnimationState {
|
|
41
|
-
showPauseAnimation: boolean;
|
|
42
|
-
showErrorAnimation: boolean;
|
|
43
|
-
showPulsatingText: boolean;
|
|
44
|
-
pulsatingFinished: boolean;
|
|
45
|
-
showLabels: boolean;
|
|
46
|
-
showMainText: boolean;
|
|
47
|
-
showIdlePulsating: boolean;
|
|
48
|
-
idleDotsCount: number;
|
|
49
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { AnimationState } from "./types";
|
|
2
|
-
export declare const useAnimations: () => {
|
|
3
|
-
animationState: AnimationState;
|
|
4
|
-
triggerPauseAnimation: () => void;
|
|
5
|
-
triggerErrorAnimation: () => void;
|
|
6
|
-
clearErrorAnimation: () => void;
|
|
7
|
-
startPulsatingAnimation: (onComplete?: () => void) => void;
|
|
8
|
-
stopPulsatingAnimation: () => void;
|
|
9
|
-
startIdleAnimations: () => void;
|
|
10
|
-
stopIdleAnimations: () => void;
|
|
11
|
-
triggerFadeTransition: () => void;
|
|
12
|
-
setInitialAnimationState: () => void;
|
|
13
|
-
cleanup: () => void;
|
|
14
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { TimerState } from "./types";
|
|
2
|
-
interface UseTimerLogicProps {
|
|
3
|
-
autoStart: boolean;
|
|
4
|
-
onCycleEnd?: () => void;
|
|
5
|
-
onMeasuringComplete?: () => void;
|
|
6
|
-
hasError: boolean;
|
|
7
|
-
onPauseAnimation: () => void;
|
|
8
|
-
onErrorAnimation: () => void;
|
|
9
|
-
onClearErrorAnimation: () => void;
|
|
10
|
-
onStartPulsating: (onComplete?: () => void) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const useTimerLogic: ({ autoStart, onCycleEnd, onMeasuringComplete, hasError, onPauseAnimation, onErrorAnimation, onClearErrorAnimation, onStartPulsating, }: UseTimerLogicProps) => {
|
|
13
|
-
timerState: TimerState;
|
|
14
|
-
controls: {
|
|
15
|
-
startNewCycle: (maxTimeSeconds: number, elapsedSeconds?: number) => void;
|
|
16
|
-
startMeasuring: (elapsedSeconds?: number) => void;
|
|
17
|
-
setIdle: () => void;
|
|
18
|
-
completeMeasuring: () => void;
|
|
19
|
-
pause: () => void;
|
|
20
|
-
resume: () => void;
|
|
21
|
-
isPaused: () => boolean;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export {};
|