@wandelbots/wandelbots-js-react-components 6.4.0-pr.feat-robot-control-panel.656.3fd0ce9 → 6.4.0-pr.feat-robot-control-panel.656.3cbb3cf

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 CHANGED
@@ -261,6 +261,8 @@ const [active, setActive] = useState<number | null>(null)
261
261
  - Velocities and step sizes are in NOVA's units: mm and mm/s to translate, rad and rad/s to rotate. The panel shows mm/s and °/s.
262
262
  - `tcp` and `jogFrame` show a select each, filled by the app. Without `increments`, there is no Continuous/Increment toggle. Without `gizmoOrientation` (from a `JoggingGizmoOrientation` in the app's 3D scene), it jogs with buttons only.
263
263
  - `onJogStop` also comes when the tab, the mode or the view changes while a control is held: the jog of that press must not go on.
264
+ - `disabled` turns off every control: nothing may move. `jogDisabled` turns off only the jogging of Translate, Rotate and Joint, e.g. while a trajectory moves the robot; Move to stays usable, so a move of its own does not end when the app locks jogging during it.
265
+ - The panel keeps its tab, jog mode and step size itself. An app that keeps them in its own store (to remember them, or because its jogging depends on them) gives `tab`, `jogMode` and `increments.step`, and gets `onTabChange`, `onJogModeChange` and `increments.onStepChange`; each also works alone, to follow a choice without keeping it.
264
266
  - `joints` gives the Joint tab: the joints' values and limits (rad, or mm with `linear`), their names, the joint velocity, and `onJogStart(index, direction)` and `onJogStop`. The panel jogs one joint at a time; the turn-around of a slider brings `onJogStop` and `onJogStart` in the same event, as described for `JoggingJointSlider`. Without `joints`, there is no Joint tab.
265
267
  - `moveTo` gives the Move to tab. The panel keeps the typed text `(x, y, z, rx, ry, rz)` (mm, rotation vector in rad: the format RobotPad copies and pastes) and reports each change as a pose, or null, in `onTargetChange`: the app plans the move then, and gives back `planning` and an `error` (e.g. out of reach). Holding the button calls `onMoveStart(pose)`, the release `onMoveStop`: the app starts and pauses its trajectory. `getCurrentPose` fills in "Use current pose", and `frame` is the "Relative to" select. It moves with `velocity.translate`. Without `moveTo`, there is no Move to tab.
266
268
 
package/dist/3d.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./chunks/Robot-DTcBHpnd.cjs"),t=require("./chunks/JoggingGizmo-B7JRrD75.cjs"),i=require("./chunks/JoggingGizmoOrientation-DDn9aNpX.cjs"),r=require("./chunks/RobotControlPanel-DZdIM3Wa.cjs"),e=require("./chunks/useSmoothedMotionState-Con0E5Bx.cjs");exports.CollisionSceneRenderer=o.CollisionSceneRenderer;exports.JointLimitGizmo=o.JointLimitGizmo;exports.LinearAxis=o.LinearAxis;exports.MotionGroupVisualizer=o.MotionGroupVisualizer;exports.MotionGroupVisualizerExact=o.MotionGroupVisualizerExact;exports.PresetEnvironment=o.PresetEnvironment;exports.Robot=o.Robot;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedLinearAxisExact=o.SupportedLinearAxisExact;exports.SupportedRobot=o.SupportedRobot;exports.SupportedRobotExact=o.SupportedRobotExact;exports.TrajectoryRenderer=o.TrajectoryRenderer;exports.defaultGetModel=o.defaultGetModel;exports.JoggingGizmo=t.JoggingGizmo;exports.JoggingGizmoOrientation=i.JoggingGizmoOrientation;exports.RobotControlPanel=r.RobotControlPanel;exports.ValueInterpolator=e.ValueInterpolator;exports.useSmoothedMotionState=e.useSmoothedMotionState;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./chunks/Robot-DTcBHpnd.cjs"),t=require("./chunks/JoggingGizmo-B7JRrD75.cjs"),i=require("./chunks/JoggingGizmoOrientation-DDn9aNpX.cjs"),r=require("./chunks/RobotControlPanel-COV4Pvv2.cjs"),e=require("./chunks/useSmoothedMotionState-Con0E5Bx.cjs");exports.CollisionSceneRenderer=o.CollisionSceneRenderer;exports.JointLimitGizmo=o.JointLimitGizmo;exports.LinearAxis=o.LinearAxis;exports.MotionGroupVisualizer=o.MotionGroupVisualizer;exports.MotionGroupVisualizerExact=o.MotionGroupVisualizerExact;exports.PresetEnvironment=o.PresetEnvironment;exports.Robot=o.Robot;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedLinearAxisExact=o.SupportedLinearAxisExact;exports.SupportedRobot=o.SupportedRobot;exports.SupportedRobotExact=o.SupportedRobotExact;exports.TrajectoryRenderer=o.TrajectoryRenderer;exports.defaultGetModel=o.defaultGetModel;exports.JoggingGizmo=t.JoggingGizmo;exports.JoggingGizmoOrientation=i.JoggingGizmoOrientation;exports.RobotControlPanel=r.RobotControlPanel;exports.ValueInterpolator=e.ValueInterpolator;exports.useSmoothedMotionState=e.useSmoothedMotionState;
package/dist/3d.d.ts CHANGED
@@ -7,7 +7,7 @@ export { JoggingGizmo, type JoggingGizmoProps, } from "./components/jogging/gizm
7
7
  export { JoggingGizmoOrientation, type JoggingGizmoOrientationProps, } from "./components/jogging/gizmo/JoggingGizmoOrientation";
8
8
  export type { JogAxis, JogDirection, JogHandle, } from "./components/jogging/jogHandle";
9
9
  export type { JogControlsProps } from "./components/jogging/useJogControls";
10
- export { type JogMotion, RobotControlPanel, type RobotControlIncrements, type RobotControlJoint, type RobotControlJoints, type RobotControlMoveTo, type RobotControlOption, type RobotControlPanelProps, type RobotControlPose, type RobotControlSelect, type RobotControlVelocity, } from "./components/robotControl/RobotControlPanel";
10
+ export { type JogMotion, RobotControlPanel, type RobotControlIncrements, type RobotControlJogMode, type RobotControlJoint, type RobotControlJoints, type RobotControlMoveTo, type RobotControlOption, type RobotControlPanelProps, type RobotControlPose, type RobotControlSelect, type RobotControlTab, type RobotControlVelocity, } from "./components/robotControl/RobotControlPanel";
11
11
  export * from "./components/robots/LinearAxis";
12
12
  export * from "./components/robots/MotionGroupVisualizer";
13
13
  export * from "./components/robots/Robot";
package/dist/3d.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { C as a, J as r, L as t, M as s, a as i, P as n, R as p, S as d, b as m, c as u, d as x, e as l, T as R, f as S } from "./chunks/Robot-CAei2Ekp.js";
2
2
  import { J as c } from "./chunks/JoggingGizmo-B2e8sWhW.js";
3
3
  import { J as G } from "./chunks/JoggingGizmoOrientation-CxuMt9pY.js";
4
- import { R as b } from "./chunks/RobotControlPanel-CY59YPmA.js";
4
+ import { R as b } from "./chunks/RobotControlPanel-hSv5MsAe.js";
5
5
  import { V as L, a as M } from "./chunks/useSmoothedMotionState-COMJRcOt.js";
6
6
  export {
7
7
  a as CollisionSceneRenderer,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControlPanel-DZdIM3Wa.cjs");exports.RobotControlPanel=o.RobotControlPanel;exports.default=o.RobotControlPanel;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControlPanel-COV4Pvv2.cjs");exports.RobotControlPanel=o.RobotControlPanel;exports.default=o.RobotControlPanel;
@@ -1,2 +1,2 @@
1
- export { type JogMotion, RobotControlPanel, RobotControlPanel as default, type RobotControlIncrements, type RobotControlJoint, type RobotControlJoints, type RobotControlMoveTo, type RobotControlOption, type RobotControlPanelProps, type RobotControlPose, type RobotControlSelect, type RobotControlVelocity, } from "../components/robotControl/RobotControlPanel";
1
+ export { type JogMotion, RobotControlPanel, RobotControlPanel as default, type RobotControlIncrements, type RobotControlJogMode, type RobotControlJoint, type RobotControlJoints, type RobotControlMoveTo, type RobotControlOption, type RobotControlPanelProps, type RobotControlPose, type RobotControlSelect, type RobotControlTab, type RobotControlVelocity, } from "../components/robotControl/RobotControlPanel";
2
2
  export type { JogAxis, JogDirection, JogHandle, } from "../components/jogging/jogHandle";
@@ -1,4 +1,4 @@
1
- import { R as t, R as e } from "../chunks/RobotControlPanel-CY59YPmA.js";
1
+ import { R as t, R as e } from "../chunks/RobotControlPanel-hSv5MsAe.js";
2
2
  export {
3
3
  t as RobotControlPanel,
4
4
  e as default
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),W=require("@mui/material/IconButton"),h=require("@mui/material/Stack"),k=require("@mui/material/Tab"),D=require("@mui/material/Tabs"),w=require("@mui/material/Typography"),L=require("@wandelbots/icons/CloseFilled"),f=require("react"),S=require("react-i18next"),Q=require("./externalizeComponent-Cr89LZ90.cjs"),V=require("@mui/material/Divider"),G=require("@mui/material/Tooltip"),Y=require("@wandelbots/icons/Jog"),K=require("@wandelbots/icons/ViewModuleFilled"),Z=require("./JoggingGizmo-B7JRrD75.cjs"),tt=require("./JoggingButtons-Bd3AO1Z3.cjs"),et=require("@mui/material/styles"),N=require("@mui/material/ToggleButton"),ot=require("@mui/material/ToggleButtonGroup"),nt=require("@mui/material/Box"),rt=require("@mui/material/MenuItem"),I=require("@wandelbots/mui"),lt=require("@mui/material/Slider"),at=require("./JoggingJointSlider-BZVhL4ls.cjs"),st=require("@wandelbots/icons/Pose"),it=require("./joggingColors-ZDc_2UCp.cjs");function ut({view:t,onViewChange:o,mode:n,controls:l,gizmoOrientation:s,gizmoFrameQuaternion:u}){const{t:a}=S.useTranslation(),r=t==="gizmo"&&s!==void 0,i=a(r?n==="increment"?"RobotControl.JogArea.Hint.ClickHandle.lb":"RobotControl.JogArea.Hint.HoldHandle.lb":n==="increment"?"RobotControl.JogArea.Hint.ClickButton.lb":"RobotControl.JogArea.Hint.HoldButton.lb"),d=a(r?"RobotControl.JogArea.ShowButtons.bt":"RobotControl.JogArea.ShowGizmo.bt");return e.jsxs(h,{"data-testid":"jog-area",sx:{position:"relative",alignItems:"center",gap:"16px"},children:[s&&e.jsx(G,{title:d,placement:"left",children:e.jsx(W,{"aria-label":d,onClick:()=>o(r?"buttons":"gizmo"),size:"small",sx:c=>{var p;return{position:"absolute",top:0,right:0,zIndex:1,borderRadius:"8px",border:`1px solid ${c.palette.divider}`,background:(p=c.palette.backgroundPaperElevation)==null?void 0:p[11]}},children:r?e.jsx(K.ViewModuleFilled,{}):e.jsx(Y.Jog,{})})}),r?e.jsx(Z.JoggingGizmo,{...l,orientation:s,frameQuaternion:u,size:180}):e.jsx(tt.JoggingButtons,{...l}),e.jsx(w,{variant:"body2",color:"text.secondary",textAlign:"center",children:i})]})}const ct=et.styled(ot)(({theme:t})=>{var o;return{gap:"4px","& .MuiToggleButton-root":{border:"none",borderRadius:"8px",padding:"6px 16px",textTransform:"none",fontSize:"14px",color:t.palette.text.secondary},"& .MuiToggleButton-root.Mui-selected":{color:t.palette.text.primary,background:(o=t.palette.backgroundPaperElevation)==null?void 0:o[11]}}});function dt({value:t,onChange:o,disabled:n}){const{t:l}=S.useTranslation();return e.jsxs(ct,{exclusive:!0,value:t,disabled:n,"aria-label":l("RobotControl.JogMode.lb"),onChange:(s,u)=>{u!==null&&o(u)},children:[e.jsx(N,{value:"continuous",children:l("RobotControl.JogMode.Continuous.bt")}),e.jsx(N,{value:"increment",children:l("RobotControl.JogMode.Increment.bt")})]})}function _(t,o){var n;return((n=t.find(l=>l.id===o))==null?void 0:n.label)??String(o)}function O(t){return t.map(o=>e.jsx(rt,{value:o.id,children:o.label},o.id))}function z({label:t,options:o,value:n,onChange:l,disabled:s}){const u=f.useId();return e.jsx(I.AdornedSelect,{label:t,labelId:u,value:n,disabled:s,renderValue:a=>_(o,a),onChange:a=>l(String(a.target.value)),children:O(o)})}function xt({label:t,options:o,value:n,onChange:l,disabled:s}){const u=f.useId();return e.jsxs(h,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[e.jsx(w,{id:u,variant:"body2",color:"text.secondary",children:t}),e.jsx(nt,{sx:{width:"calc((100% - 12px) / 2)",flexShrink:0},children:e.jsx(I.AdornedSelect,{labelId:u,adornedSize:"small",value:n,disabled:s,renderValue:a=>_(o,a),onChange:a=>l(String(a.target.value)),children:O(o)})})]})}function M({children:t}){return e.jsx(h,{sx:{padding:"16px 20px",gap:"16px"},children:t})}function bt(t){return t*180/Math.PI}function pt(t){return t*Math.PI/180}function H(t,o){return t==="rotate"?bt(o):o}function gt(t,o){return t==="rotate"?pt(o):o}function ht(t,o){const n=String(Number(H(t,o).toFixed(2)));return t==="rotate"?`${n}°`:`${n} mm`}function ft(t,o){const n=Math.round(H(t,o));return t==="rotate"?`${n}°/s`:`${n} mm/s`}function F({motion:t,velocity:o,onChange:n,disabled:l}){const{t:s}=S.useTranslation(),u=f.useId(),a=r=>H(t,r);return e.jsxs(h,{gap:"4px",children:[e.jsxs(h,{direction:"row",sx:{justifyContent:"space-between"},children:[e.jsx(w,{id:u,variant:"body2",color:"text.secondary",children:s("RobotControl.Velocity.lb")}),e.jsx(w,{variant:"body2",color:"text.primary",sx:{fontVariantNumeric:"tabular-nums"},children:ft(t,o.value)})]}),e.jsx(lt,{"aria-labelledby":u,size:"small",value:Math.round(a(o.value)),min:Math.ceil(a(o.min)),max:Math.floor(a(o.max)),disabled:l,onChange:(r,i)=>{typeof i=="number"&&n(gt(t,i))},sx:r=>{var i;return{height:4,"& .MuiSlider-rail":{opacity:.38},"& .MuiSlider-thumb":{width:16,height:16,border:`3px solid ${r.palette.primary.main}`,backgroundColor:(i=r.palette.backgroundPaperElevation)==null?void 0:i[5]}}}})]})}function vt({motion:t,settings:o,onSettingsChange:n,disabled:l=!1,tcp:s,jogFrame:u,velocity:a,onVelocityChange:r,onJogStart:i,onJogStop:d,increments:c,gizmoOrientation:p,gizmoFrameQuaternion:v}){const{t:x}=S.useTranslation(),j=c?o.mode:"continuous",J=(c==null?void 0:c.steps[t])??[],R=Math.min(o.step[t],J.length-1),m=J[R],C=f.useRef(!1);function A(b,y){if(j==="increment"){c&&m!==void 0&&c.onStep(t,b,y,m);return}C.current=!0,i(t,b,y)}function B(){C.current&&(C.current=!1,d())}return e.jsxs(e.Fragment,{children:[(s||u)&&e.jsxs(e.Fragment,{children:[e.jsx(M,{children:e.jsxs(h,{direction:"row",sx:{gap:"12px"},children:[s&&e.jsx(z,{label:x("RobotControl.Tcp.lb"),...s,disabled:l}),u&&e.jsx(z,{label:x("RobotControl.JogFrame.lb"),...u,disabled:l})]})}),e.jsx(V,{sx:{marginX:"20px"}})]}),e.jsxs(M,{children:[c&&e.jsx(dt,{value:j,onChange:b=>n({...o,mode:b}),disabled:l}),e.jsx(F,{motion:t,velocity:a[t],onChange:b=>r(t,b),disabled:l}),j==="increment"&&m!==void 0&&e.jsx(xt,{label:x("RobotControl.StepSize.lb"),value:String(R),options:J.map((b,y)=>({id:String(y),label:ht(t,b)})),onChange:b=>n({...o,step:{...o.step,[t]:Number(b)}}),disabled:l})]}),e.jsx(V,{sx:{marginX:"20px"}}),e.jsx(M,{children:e.jsx(ut,{view:o.view,onViewChange:b=>n({...o,view:b}),mode:j,controls:{motion:t,onJogStart:A,onJogStop:B,activeHandle:j==="increment"?c==null?void 0:c.running:null,disabled:l},gizmoOrientation:p,gizmoFrameQuaternion:v},j)})]})}function jt({joints:t,disabled:o}){const n=f.useRef(null),[l,s]=f.useState(null);function u(r,i){n.current!==null&&n.current!==r||(n.current=r,s(r),t.onJogStart(r,i))}function a(r){n.current===r&&(n.current=null,s(null),t.onJogStop())}return e.jsxs(e.Fragment,{children:[e.jsx(M,{children:e.jsx(h,{sx:{gap:"8px",paddingX:"4px"},children:t.joints.map((r,i)=>e.jsx(at.JoggingJointSlider,{label:`J${i+1}`,name:r.name,value:r.value,min:r.min,max:r.max,linear:t.linear,onJogStart:d=>u(i,d),onJogStop:()=>a(i),disabled:o||l!==null&&l!==i},i))})}),e.jsx(V,{sx:{marginX:"20px"}}),e.jsx(M,{children:e.jsx(F,{motion:t.linear?"translate":"rotate",velocity:t.velocity,onChange:t.onVelocityChange,disabled:o})})]})}const mt="move";function Ct({onMoveStart:t,onMoveStop:o,disabled:n,disabledReason:l,loading:s}){const{t:u}=S.useTranslation(),{held:a,handlersFor:r}=it.useHold({onStart:t,onStop:o,disabled:n||s,isSame:()=>!0}),i=n?l??"":u("RobotControl.MoveTo.HoldToMove.lb");return e.jsx(G,{title:i,placement:"top",children:e.jsx("span",{style:{display:"block"},children:e.jsx(I.PrimaryButton,{fullWidth:!0,disabled:n,loading:s,"aria-pressed":a!==null,...r(mt),sx:{touchAction:"none",userSelect:"none"},children:u("RobotControl.MoveTo.MoveToPose.bt")})})})}const Tt=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;function St(t){const o=(n,l)=>Number.parseFloat(n.toFixed(l));return`(${[...t.position.map(n=>o(n,1)),...t.orientation.map(n=>o(n,4))].join(", ")})`}function $(t){let o=t.trim();const n=o.startsWith("("),l=o.endsWith(")");if(n!==l||(n&&(o=o.slice(1,-1)),o.trim()===""))return null;const s=[];for(const p of o.split(",")){const v=p.trim();if(!Tt.test(v))return null;const x=Number(v);if(!Number.isFinite(x))return null;s.push(x)}if(s.length!==6)return null;const[u,a,r,i,d,c]=s;return{position:[u,a,r],orientation:[i,d,c]}}function Rt({moveTo:t,text:o,onTextChange:n,tcp:l,velocity:s,onVelocityChange:u,disabled:a}){const{t:r}=S.useTranslation(),i=$(o),c=o.trim()!==""&&i===null?r("RobotControl.MoveTo.InvalidPose.lb"):t.error??void 0;function p(x){n(x),t.onTargetChange($(x))}function v(){const x=t.getCurrentPose();x&&p(St(x))}return e.jsxs(M,{children:[l&&e.jsx(z,{label:r("RobotControl.Tcp.lb"),...l,disabled:a}),e.jsxs(h,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",gap:1},children:[e.jsx(w,{variant:"body1",color:"text.primary",children:r("RobotControl.MoveTo.TargetPose.lb")}),e.jsx(I.SecondaryButton,{startIcon:e.jsx(st.Pose,{}),onClick:v,disabled:a,children:r("RobotControl.MoveTo.UseCurrentPose.bt")})]}),e.jsxs(h,{sx:{gap:"8px"},children:[t.frame&&e.jsx(z,{label:r("RobotControl.MoveTo.RelativeTo.lb"),...t.frame,disabled:a}),e.jsx(I.AdornedTextField,{label:r("RobotControl.MoveTo.Coordinates.lb"),value:o,onChange:x=>p(x.target.value),disabled:a,error:!!c,helperText:c,fullWidth:!0,autoComplete:"off",slotProps:{htmlInput:{spellCheck:!1}},sx:{"& input":{fontVariantNumeric:"tabular-nums"}}})]}),e.jsx(F,{motion:"translate",velocity:s,onChange:u,disabled:a}),e.jsx(Ct,{onMoveStart:()=>{i&&t.onMoveStart(i)},onMoveStop:t.onMoveStop,disabled:a||i===null||!!t.error,disabledReason:t.error??(i?void 0:r("RobotControl.MoveTo.EnterPose.lb")),loading:t.planning??!1})]})}const yt=Q.externalizeComponent(({onClose:t,sx:o,joints:n,moveTo:l,jogDisabled:s=!1,tab:u,onTabChange:a,jogMode:r,onJogModeChange:i,...d})=>{const{t:c}=S.useTranslation(),p=d.disabled??!1,[v,x]=f.useState("translate"),[j,J]=f.useState({mode:"continuous",view:"gizmo",step:{translate:0,rotate:0}}),R=u??v,m=R==="joint"&&!n||R==="moveTo"&&!l?"translate":R,C=Mt(j,r,d.increments),[A,B]=f.useState(""),b=c("RobotControl.Title.ti");function y(g){x(g),a==null||a(g)}function U(g){var T,P,X;J(g),g.mode!==C.mode&&(i==null||i(g.mode));for(const q of["translate","rotate"]){const E=(T=d.increments)==null?void 0:T.steps[q][g.step[q]];g.step[q]!==C.step[q]&&E!==void 0&&((X=(P=d.increments)==null?void 0:P.onStepChange)==null||X.call(P,q,E))}}return e.jsxs(h,{"data-testid":"robot-control-panel",sx:[g=>{var T;return{minHeight:0,overflow:"hidden",borderRadius:"16px",background:(T=g.palette.backgroundPaperElevation)==null?void 0:T[5]}},...Array.isArray(o)?o:[o]],children:[e.jsxs(h,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",padding:"20px 20px 8px"},children:[e.jsx(w,{component:"h2",color:"text.primary",sx:{fontSize:"20px"},children:b}),t&&e.jsx(W,{"aria-label":c("RobotControl.Close.bt"),onClick:t,size:"small",children:e.jsx(L.CloseFilled,{})})]}),e.jsxs(D,{value:m,onChange:(g,T)=>y(T),"aria-label":b,variant:"scrollable",scrollButtons:!1,sx:{marginX:"20px",borderBottom:1,borderColor:"divider",background:"transparent"},children:[e.jsx(k,{value:"translate",label:c("RobotControl.Tab.Translate.bt"),sx:{minWidth:0,paddingX:"12px",textTransform:"none"}}),e.jsx(k,{value:"rotate",label:c("RobotControl.Tab.Rotate.bt"),sx:{minWidth:0,paddingX:"12px",textTransform:"none"}}),n&&e.jsx(k,{value:"joint",label:c("RobotControl.Tab.Joint.bt"),sx:{minWidth:0,paddingX:"12px",textTransform:"none"}}),l&&e.jsx(k,{value:"moveTo",label:c("RobotControl.Tab.MoveTo.bt"),sx:{minWidth:0,paddingX:"12px",textTransform:"none"}})]}),e.jsx(h,{sx:{flexGrow:1,overflowY:"auto",overflowX:"hidden"},children:m==="joint"&&n?e.jsx(jt,{joints:n,disabled:p||s}):m==="moveTo"&&l?e.jsx(Rt,{moveTo:l,text:A,onTextChange:B,tcp:d.tcp,velocity:d.velocity.translate,onVelocityChange:g=>d.onVelocityChange("translate",g),disabled:p}):e.jsx(vt,{...d,disabled:p||s,motion:m==="rotate"?"rotate":"translate",settings:C,onSettingsChange:U})})]})});function Mt(t,o,n){const l=s=>{var r;const u=(r=n==null?void 0:n.step)==null?void 0:r[s];if(u===void 0)return t.step[s];const a=n==null?void 0:n.steps[s].findIndex(i=>Math.abs(i-u)<=1e-9*Math.max(1,Math.abs(i)));return a===void 0||a<0?t.step[s]:a};return{...t,mode:o??t.mode,step:{translate:l("translate"),rotate:l("rotate")}}}exports.RobotControlPanel=yt;