@wandelbots/wandelbots-js-react-components 1.44.2 → 1.44.3-pr.fix-jogging-initial-lock-state.152.855e6db
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/jogging/JoggingJointRotationControl.d.ts.map +1 -1
- package/dist/components/jogging/JoggingStore.d.ts +2 -0
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +95 -75
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/jogging/JoggingJointRotationControl.tsx +10 -5
- package/src/components/jogging/JoggingPanel.tsx +3 -3
- package/src/components/jogging/JoggingStore.ts +10 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wandelbots/wandelbots-js-react-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "v1.44.3-pr.fix-jogging-initial-lock-state.152.855e6db",
|
|
4
4
|
"description": "React UI toolkit for building applications on top of the Wandelbots platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -74,9 +74,6 @@ export const JoggingJointRotationControl = externalizeComponent(
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
function onPointerOut(ev: React.PointerEvent) {
|
|
77
|
-
// Prevent subelements of button from stopping jogging
|
|
78
|
-
if (ev.target !== ev.currentTarget) return
|
|
79
|
-
|
|
80
77
|
state.stopJogging()
|
|
81
78
|
}
|
|
82
79
|
|
|
@@ -137,7 +134,11 @@ export const JoggingJointRotationControl = externalizeComponent(
|
|
|
137
134
|
...(state.activeJoggingDir === "-" ? pressedButtonStyle : {}),
|
|
138
135
|
}}
|
|
139
136
|
>
|
|
140
|
-
<ChevronLeft
|
|
137
|
+
<ChevronLeft
|
|
138
|
+
sx={{
|
|
139
|
+
"pointer-events": "none",
|
|
140
|
+
}}
|
|
141
|
+
/>
|
|
141
142
|
</IconButton>
|
|
142
143
|
|
|
143
144
|
<Stack
|
|
@@ -228,7 +229,11 @@ export const JoggingJointRotationControl = externalizeComponent(
|
|
|
228
229
|
...(state.activeJoggingDir === "+" ? pressedButtonStyle : {}),
|
|
229
230
|
}}
|
|
230
231
|
>
|
|
231
|
-
<ChevronRight
|
|
232
|
+
<ChevronRight
|
|
233
|
+
sx={{
|
|
234
|
+
"pointer-events": "none",
|
|
235
|
+
}}
|
|
236
|
+
/>
|
|
232
237
|
</IconButton>
|
|
233
238
|
</Stack>
|
|
234
239
|
)
|
|
@@ -84,11 +84,11 @@ export const JoggingPanel = externalizeComponent(
|
|
|
84
84
|
if (!store) return
|
|
85
85
|
|
|
86
86
|
if (props.locked) {
|
|
87
|
-
store.
|
|
87
|
+
store.lock("external")
|
|
88
88
|
} else {
|
|
89
|
-
store.
|
|
89
|
+
store.unlock("external")
|
|
90
90
|
}
|
|
91
|
-
}, [props.locked])
|
|
91
|
+
}, [state.joggingStore, props.locked])
|
|
92
92
|
|
|
93
93
|
return (
|
|
94
94
|
<Stack
|
|
@@ -463,15 +463,23 @@ export class JoggingStore {
|
|
|
463
463
|
this.selectedCartesianMotionType = type
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
+
lock(id: string) {
|
|
467
|
+
this.locks.add(id)
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
unlock(id: string) {
|
|
471
|
+
this.locks.delete(id)
|
|
472
|
+
}
|
|
473
|
+
|
|
466
474
|
/** Lock the UI until the given async callback resolves */
|
|
467
475
|
async withMotionLock(fn: () => Promise<void>) {
|
|
468
476
|
const lockId = uniqueId()
|
|
469
|
-
this.
|
|
477
|
+
this.lock(lockId)
|
|
470
478
|
|
|
471
479
|
try {
|
|
472
480
|
return await fn()
|
|
473
481
|
} finally {
|
|
474
|
-
this.
|
|
482
|
+
this.unlock(lockId)
|
|
475
483
|
}
|
|
476
484
|
}
|
|
477
485
|
}
|