@wandelbots/wandelbots-js-react-components 1.33.1 → 1.33.2

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": "1.33.1",
3
+ "version": "1.33.2",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1,7 +1,7 @@
1
1
  import { IconButton, Typography, useTheme } from "@mui/material"
2
2
  import Stack from "@mui/material/Stack"
3
3
  import { observer } from "mobx-react-lite"
4
- import React, { useRef, useState, type ReactNode } from "react"
4
+ import React, { useEffect, useRef, useState, type ReactNode } from "react"
5
5
  import { externalizeComponent } from "../../externalizeComponent"
6
6
  import JogMinus from "../../icons/jog-minus.svg"
7
7
  import JogPlus from "../../icons/jog-plus.svg"
@@ -45,6 +45,14 @@ export const JoggingCartesianAxisControl = externalizeComponent(
45
45
  const [localActiveJoggingDirection, setLocalActiveJoggingDirection] =
46
46
  useState<JoggingDirection | null>(null)
47
47
 
48
+ // Trigger pointer "release" events because e.g. firefox does not trigger pointer events as soon as a component is disabled
49
+ useEffect(() => {
50
+ if (!disabled) {
51
+ return
52
+ }
53
+ onPointerUpOrOut()
54
+ }, [disabled])
55
+
48
56
  // Handle both controlled and uncontrolled states
49
57
  const showJoggingDirection =
50
58
  activeJoggingDirection || localActiveJoggingDirection
@@ -83,10 +91,10 @@ export const JoggingCartesianAxisControl = externalizeComponent(
83
91
  const sxAxisControlButtonDefault = {
84
92
  ...sxAxisControlButtonBase,
85
93
  backgroundColor: colors.buttonBackgroundColor?.default,
86
- "&:hover": {
94
+ ":hover": {
87
95
  backgroundColor: colors.buttonBackgroundColor?.hovered,
88
96
  },
89
- "&:active": {
97
+ ":active": {
90
98
  backgroundColor: colors.buttonBackgroundColor?.pressed,
91
99
  color: colors.backgroundColor,
92
100
  path: { fill: colors.backgroundColor },
@@ -250,6 +250,11 @@ export const JoggingCartesianTab = observer(
250
250
  key={axis.id}
251
251
  colors={axis.colors}
252
252
  disabled={store.isLocked}
253
+ activeJoggingDirection={
254
+ store.incrementJogInProgress?.axis === axis.id
255
+ ? store.incrementJogInProgress.direction
256
+ : undefined
257
+ }
253
258
  label={
254
259
  <>
255
260
  <RotationIcon />