@wandelbots/wandelbots-js-react-components 6.3.0 → 6.4.0-pr.chore-public-names.673.cb7ee37
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 +255 -122
- package/dist/3d.cjs +1 -1
- package/dist/3d.d.ts +7 -3
- package/dist/3d.js +20 -20
- package/dist/CurrentPoseBar/index.cjs +1 -0
- package/dist/CurrentPoseBar/index.d.ts +2 -0
- package/dist/CurrentPoseBar/index.js +5 -0
- package/dist/JoggingButtons/index.cjs +1 -0
- package/dist/JoggingButtons/index.d.ts +3 -0
- package/dist/JoggingButtons/index.js +5 -0
- package/dist/JoggingGizmo/index.cjs +1 -0
- package/dist/JoggingGizmo/index.d.ts +5 -0
- package/dist/JoggingGizmo/index.js +6 -0
- package/dist/JoggingJointSlider/index.cjs +1 -0
- package/dist/JoggingJointSlider/index.d.ts +2 -0
- package/dist/JoggingJointSlider/index.js +5 -0
- package/dist/SafetyBar/index.cjs +1 -1
- package/dist/SafetyBar/index.js +1 -1
- package/dist/chunks/ConnectedMotionGroup-D9JJSyXB.js +1822 -0
- package/dist/chunks/ConnectedMotionGroup-ir7Vf690.cjs +3 -0
- package/dist/chunks/CurrentPoseBar-Cbz4AO36.cjs +1 -0
- package/dist/chunks/CurrentPoseBar-CpwvWpEY.js +619 -0
- package/dist/chunks/JoggingButtons-i8FdMpCx.js +108 -0
- package/dist/chunks/JoggingButtons-paQCBXf4.cjs +1 -0
- package/dist/chunks/JoggingGizmoOrientation-CKZeLcMp.js +893 -0
- package/dist/chunks/JoggingGizmoOrientation-EPtBeAun.cjs +1 -0
- package/dist/chunks/JoggingJointSlider-DQhJOmcc.js +378 -0
- package/dist/chunks/JoggingJointSlider-YcEBMgF1.cjs +1 -0
- package/dist/chunks/Pose3-Ci1bxEvz.js +1373 -0
- package/dist/chunks/Pose3-DwMOSTKO.cjs +1 -0
- package/dist/chunks/SafetyBar-Be1c6Vz9.cjs +1 -0
- package/dist/chunks/{SafetyBar-Cy9DiXp9.js → SafetyBar-WXLP3Yi0.js} +34 -32
- package/dist/chunks/{externalizeComponent-EDymnaGR.js → externalizeComponent-7OVHUIUh.js} +84 -134
- package/dist/chunks/externalizeComponent-B0n_tR3v.cjs +2 -0
- package/dist/chunks/holdSafety-Cbej6-Kc.js +62 -0
- package/dist/chunks/holdSafety-TeMXlYQe.cjs +1 -0
- package/dist/chunks/joggingColors-BKRoSGQu.js +132 -0
- package/dist/chunks/joggingColors-BkPm75Hr.cjs +1 -0
- package/dist/chunks/json-3cqBD7UQ.js +18 -0
- package/dist/chunks/json-Bd6uGfgP.cjs +1 -0
- package/dist/chunks/loadRobotSession-Bt1-Brjp.js +3761 -0
- package/dist/chunks/loadRobotSession-DHVuK_pj.cjs +1 -0
- package/dist/chunks/novaConnection-BTSIgWd1.cjs +1 -0
- package/dist/chunks/novaConnection-J6_ohIQ0.js +14 -0
- package/dist/chunks/poseText-BXUaQWnK.cjs +1 -0
- package/dist/chunks/poseText-CtdXIeT_.js +41 -0
- package/dist/chunks/useSmoothedMotionState-C_Vo0py0.js +202 -0
- package/dist/chunks/useSmoothedMotionState-Ce9NjwBu.cjs +1 -0
- package/dist/components/AppHeader.d.ts +1 -1
- package/dist/components/VelocitySlider.d.ts +6 -1
- package/dist/components/currentPoseBar/CurrentPoseBar.d.ts +48 -0
- package/dist/components/currentPoseBar/OrientationFormatPopover.d.ts +19 -0
- package/dist/components/currentPoseBar/StreamStatus.d.ts +10 -0
- package/dist/components/currentPoseBar/orientation.d.ts +34 -0
- package/dist/components/currentPoseBar/poseValues.d.ts +15 -0
- package/dist/components/jogging/JoggingButtons.d.ts +18 -0
- package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +8 -2
- package/dist/components/jogging/JoggingCartesianTab.d.ts +3 -0
- package/dist/components/jogging/JoggingJointTab.d.ts +4 -1
- package/dist/components/jogging/JoggingJointValueControl.d.ts +7 -1
- package/dist/components/jogging/JoggingPanel.d.ts +6 -3
- package/dist/components/jogging/JoggingRefusedError.d.ts +24 -0
- package/dist/components/jogging/JoggingStore.d.ts +382 -40
- package/dist/components/jogging/gizmo/JoggingGizmo.d.ts +53 -0
- package/dist/components/jogging/gizmo/JoggingGizmoOrientation.d.ts +26 -0
- package/dist/components/jogging/gizmo/RotationHandles.d.ts +7 -0
- package/dist/components/jogging/gizmo/RotationScene.d.ts +6 -0
- package/dist/components/jogging/gizmo/TranslationHandles.d.ts +6 -0
- package/dist/components/jogging/gizmo/TranslationScene.d.ts +6 -0
- package/dist/components/jogging/gizmo/arcGrabAreas.d.ts +58 -0
- package/dist/components/jogging/gizmo/arcs.d.ts +54 -0
- package/dist/components/jogging/gizmo/arrows.d.ts +63 -0
- package/dist/components/jogging/gizmo/gizmoShared.d.ts +135 -0
- package/dist/components/jogging/gizmo/gizmoView.d.ts +42 -0
- package/dist/components/jogging/gizmo/useGizmoTurn.d.ts +11 -0
- package/dist/components/jogging/holdSafety.d.ts +82 -0
- package/dist/components/jogging/jogError.d.ts +9 -0
- package/dist/components/jogging/jogHandle.d.ts +23 -0
- package/dist/components/jogging/joggingColors.d.ts +30 -0
- package/dist/components/jogging/joggingVelocity.d.ts +21 -0
- package/dist/components/jogging/joint/JoggingJointSlider.d.ts +56 -0
- package/dist/components/jogging/joint/JointSliderTrack.d.ts +27 -0
- package/dist/components/jogging/joint/jointJog.d.ts +55 -0
- package/dist/components/jogging/joint/useJointJogHold.d.ts +43 -0
- package/dist/components/jogging/useHold.d.ts +42 -0
- package/dist/components/jogging/useJogControls.d.ts +44 -0
- package/dist/components/robotControl/PanelSelect.d.ts +13 -0
- package/dist/components/robotControl/SmallSelect.d.ts +15 -0
- package/dist/components/robotControl/poseText.d.ts +43 -0
- package/dist/components/robotControl/robotControlTypes.d.ts +36 -0
- package/dist/components/robotControl/useCopyText.d.ts +12 -0
- package/dist/components/robotControl/useEveryFrame.d.ts +6 -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/converters.d.ts +0 -2
- package/dist/components/utils/hooks.d.ts +1 -6
- package/dist/components/utils/json.d.ts +4 -0
- package/dist/components/utils/useSmoothedMotionState.d.ts +11 -2
- package/dist/components/utils/useWebGLRenderer.d.ts +32 -0
- package/dist/components/utils/webglSupport.d.ts +11 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +28 -20
- package/dist/core.js +57 -54
- package/dist/index.cjs +1 -1
- package/dist/index.js +73 -70
- package/dist/lib/ConnectedMotionGroup.d.ts +9 -8
- package/dist/lib/ControllerStateStream.d.ts +125 -0
- package/dist/lib/JoggerConnection.d.ts +172 -27
- package/dist/lib/MotionStreamConnection.d.ts +16 -6
- package/dist/lib/Pose3.d.ts +22 -0
- package/dist/lib/PoseTransformer.d.ts +44 -0
- package/dist/lib/TrajectoryExecutionStore.d.ts +260 -0
- package/dist/lib/connectionLogger.d.ts +9 -0
- package/dist/lib/controllerStateSource.d.ts +38 -0
- package/dist/lib/incrementalCartesianMotion.d.ts +40 -0
- package/dist/lib/motionGroupModelResources.d.ts +1 -0
- package/dist/lib/motionStateUpdate.d.ts +44 -0
- package/dist/lib/nats/natsControllerStateSource.d.ts +27 -0
- package/dist/lib/novaConnection.d.ts +23 -0
- package/dist/lib/planErrorTranslation.d.ts +8 -0
- package/dist/lib/poseMath.d.ts +51 -0
- package/dist/lib/robotSession/RobotActivation.d.ts +90 -0
- package/dist/lib/robotSession/RobotDescription.d.ts +84 -0
- package/dist/lib/robotSession/RobotLiveState.d.ts +65 -0
- package/dist/lib/robotSession/RobotLoadProgress.d.ts +72 -0
- package/dist/lib/robotSession/RobotSafety.d.ts +59 -0
- package/dist/lib/robotSession/RobotSession.d.ts +117 -0
- package/dist/lib/robotSession/RobotTargetPose.d.ts +116 -0
- package/dist/lib/robotSession/loadRobotResources.d.ts +46 -0
- package/dist/lib/robotSession/loadRobotSession.d.ts +81 -0
- package/dist/lib/robotSession/robotPose.d.ts +27 -0
- package/dist/lib/rotation.d.ts +12 -0
- package/dist/nats.cjs +1 -0
- package/dist/nats.d.ts +4 -0
- package/dist/nats.js +131 -0
- package/dist/session.cjs +1 -0
- package/dist/session.d.ts +22 -0
- package/dist/session.js +33 -0
- package/package.json +68 -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/SafetyBar-DPrv_OQA.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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useEffect as i } from "react";
|
|
2
|
+
function a(t) {
|
|
3
|
+
return t.button === 0 && !t.ctrlKey;
|
|
4
|
+
}
|
|
5
|
+
function c(t) {
|
|
6
|
+
return !t.repeat;
|
|
7
|
+
}
|
|
8
|
+
function f(t) {
|
|
9
|
+
return (t.buttons & 1) === 0;
|
|
10
|
+
}
|
|
11
|
+
function d(t, r) {
|
|
12
|
+
var n;
|
|
13
|
+
try {
|
|
14
|
+
(n = t.setPointerCapture) == null || n.call(t, r);
|
|
15
|
+
} catch {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function l(t, r) {
|
|
19
|
+
var n;
|
|
20
|
+
try {
|
|
21
|
+
(n = t.hasPointerCapture) != null && n.call(t, r) && t.releasePointerCapture(r);
|
|
22
|
+
} catch {
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function p(t, r = (n) => t.currentTarget.contains(n)) {
|
|
26
|
+
const n = t.currentTarget.getRootNode();
|
|
27
|
+
if (typeof n.elementFromPoint != "function") return !0;
|
|
28
|
+
const e = n.elementFromPoint(t.clientX, t.clientY);
|
|
29
|
+
return e !== null && r(e);
|
|
30
|
+
}
|
|
31
|
+
function y(t, r) {
|
|
32
|
+
const n = t.currentTarget.getBoundingClientRect();
|
|
33
|
+
return t.clientX >= n.left - r && t.clientX <= n.right + r && t.clientY >= n.top - r && t.clientY <= n.bottom + r;
|
|
34
|
+
}
|
|
35
|
+
function w(t) {
|
|
36
|
+
t.preventDefault();
|
|
37
|
+
}
|
|
38
|
+
function b(t, r, n) {
|
|
39
|
+
i(() => {
|
|
40
|
+
r && n();
|
|
41
|
+
}, [r, n]), i(() => () => n(), [n]), i(() => {
|
|
42
|
+
if (!t) return;
|
|
43
|
+
const e = () => {
|
|
44
|
+
document.visibilityState === "hidden" && n();
|
|
45
|
+
}, o = (u) => {
|
|
46
|
+
c(u) && n();
|
|
47
|
+
};
|
|
48
|
+
return window.addEventListener("blur", n), window.addEventListener("keydown", o, !0), document.addEventListener("visibilitychange", e), () => {
|
|
49
|
+
window.removeEventListener("blur", n), window.removeEventListener("keydown", o, !0), document.removeEventListener("visibilitychange", e);
|
|
50
|
+
};
|
|
51
|
+
}, [t, n]);
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
f as a,
|
|
55
|
+
y as b,
|
|
56
|
+
d as c,
|
|
57
|
+
p as i,
|
|
58
|
+
w as p,
|
|
59
|
+
l as r,
|
|
60
|
+
a as s,
|
|
61
|
+
b as u
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("react");function c(t){return t.button===0&&!t.ctrlKey}function s(t){return!t.repeat}function a(t){return(t.buttons&1)===0}function d(t,n){var e;try{(e=t.setPointerCapture)==null||e.call(t,n)}catch{}}function f(t,n){var e;try{(e=t.hasPointerCapture)!=null&&e.call(t,n)&&t.releasePointerCapture(n)}catch{}}function l(t,n=e=>t.currentTarget.contains(e)){const e=t.currentTarget.getRootNode();if(typeof e.elementFromPoint!="function")return!0;const r=e.elementFromPoint(t.clientX,t.clientY);return r!==null&&n(r)}function p(t,n){const e=t.currentTarget.getBoundingClientRect();return t.clientX>=e.left-n&&t.clientX<=e.right+n&&t.clientY>=e.top-n&&t.clientY<=e.bottom+n}function y(t){t.preventDefault()}function P(t,n,e){i.useEffect(()=>{n&&e()},[n,e]),i.useEffect(()=>()=>e(),[e]),i.useEffect(()=>{if(!t)return;const r=()=>{document.visibilityState==="hidden"&&e()},o=u=>{s(u)&&e()};return window.addEventListener("blur",e),window.addEventListener("keydown",o,!0),document.addEventListener("visibilitychange",r),()=>{window.removeEventListener("blur",e),window.removeEventListener("keydown",o,!0),document.removeEventListener("visibilitychange",r)}},[t,e])}exports.capturePointer=d;exports.isPointerOn=l;exports.isPointerWithin=p;exports.preventContextMenu=y;exports.primaryReleased=a;exports.releasePointer=f;exports.startsPointerHold=c;exports.useEndHoldWhenUnattended=P;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { useRef as p, useState as v, useCallback as d, useEffect as H } from "react";
|
|
2
|
+
import { useTranslation as h } from "react-i18next";
|
|
3
|
+
import { c as y, r as R, u as S, p as A, a as B, i as I, s as J } from "./holdSafety-Cbej6-Kc.js";
|
|
4
|
+
import { ColorsBlue400 as j, ColorsGreen400 as E, ColorsRed400 as O } from "@wandelbots/design-tokens";
|
|
5
|
+
const T = ["x", "y", "z"], U = ["-", "+"];
|
|
6
|
+
function x(n, t) {
|
|
7
|
+
return !!n && !!t && n.axis === t.axis && n.direction === t.direction;
|
|
8
|
+
}
|
|
9
|
+
function _(n, t = "translate") {
|
|
10
|
+
return t === "rotate" ? `R${n.axis}${n.direction}` : `${n.axis.toUpperCase()}${n.direction}`;
|
|
11
|
+
}
|
|
12
|
+
function $({
|
|
13
|
+
onStart: n,
|
|
14
|
+
onStop: t,
|
|
15
|
+
disabled: u = !1,
|
|
16
|
+
isSame: g
|
|
17
|
+
}) {
|
|
18
|
+
const l = p(null), [C, f] = v(null), s = p(null), c = p({ onStop: t, isSame: g });
|
|
19
|
+
c.current = { onStop: t, isSame: g };
|
|
20
|
+
const i = d(
|
|
21
|
+
(e, a, o) => {
|
|
22
|
+
u || l.current !== null || (l.current = e, s.current = { pointerId: a, element: o }, f(e), y(o, a), n(e));
|
|
23
|
+
},
|
|
24
|
+
[u, n]
|
|
25
|
+
), r = d((e) => {
|
|
26
|
+
const a = l.current;
|
|
27
|
+
if (a === null || e !== void 0 && !c.current.isSame(a, e)) return;
|
|
28
|
+
const o = s.current;
|
|
29
|
+
l.current = null, s.current = null, f(null), o && R(o.element, o.pointerId), c.current.onStop();
|
|
30
|
+
}, []), m = d(() => r(), [r]);
|
|
31
|
+
S(C !== null, u, m);
|
|
32
|
+
const k = d(
|
|
33
|
+
(e, a) => ({
|
|
34
|
+
onPointerDown: (o) => {
|
|
35
|
+
J(o) && i(e, o.pointerId, o.currentTarget);
|
|
36
|
+
},
|
|
37
|
+
onPointerMove: (o) => {
|
|
38
|
+
var P;
|
|
39
|
+
((P = s.current) == null ? void 0 : P.pointerId) === o.pointerId && (B(o) || !I(o, a)) && r(e);
|
|
40
|
+
},
|
|
41
|
+
// Only a pointer that could not be captured leaves for the browser
|
|
42
|
+
onPointerLeave: (o) => r(e),
|
|
43
|
+
onPointerUp: () => r(e),
|
|
44
|
+
onPointerCancel: () => r(e),
|
|
45
|
+
onLostPointerCapture: () => r(e),
|
|
46
|
+
onBlur: (o) => r(e),
|
|
47
|
+
onContextMenu: A
|
|
48
|
+
}),
|
|
49
|
+
[i, r]
|
|
50
|
+
);
|
|
51
|
+
return { held: C, handlersFor: k, stop: m };
|
|
52
|
+
}
|
|
53
|
+
function w({
|
|
54
|
+
motion: n = "translate",
|
|
55
|
+
onJogStart: t,
|
|
56
|
+
onJogStop: u,
|
|
57
|
+
activeHandle: g,
|
|
58
|
+
disabled: l = !1
|
|
59
|
+
}) {
|
|
60
|
+
const { t: C } = h(), f = d(
|
|
61
|
+
(r) => t(r.axis, r.direction),
|
|
62
|
+
[t]
|
|
63
|
+
), { held: s, handlersFor: c, stop: i } = $({
|
|
64
|
+
onStart: f,
|
|
65
|
+
onStop: u,
|
|
66
|
+
disabled: l,
|
|
67
|
+
isSame: x
|
|
68
|
+
});
|
|
69
|
+
return H(() => {
|
|
70
|
+
i();
|
|
71
|
+
}, [n, i]), {
|
|
72
|
+
held: s,
|
|
73
|
+
handlersFor: c,
|
|
74
|
+
/** The accessible name of a control, e.g. "Jog X+", or "Jog Rx+" rotating */
|
|
75
|
+
label: (r) => C("Jogging.Handle.lb", { handle: _(r, n) }),
|
|
76
|
+
/** Whether a control shows as pressed: while it is held or shown as active */
|
|
77
|
+
isPressed: (r) => x(s, r) || x(g, r)
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const b = "rgba(255, 255, 255, 1)", z = {
|
|
81
|
+
X: {
|
|
82
|
+
backgroundColor: "rgba(215, 66, 56, 1)",
|
|
83
|
+
borderColor: "rgba(215, 66, 56, 1)",
|
|
84
|
+
buttonBackgroundColor: {
|
|
85
|
+
default: "rgba(241, 77, 66, 1)",
|
|
86
|
+
pressed: "rgba(138, 41, 35, 1)",
|
|
87
|
+
hovered: "rgba(241, 77, 66, 1)",
|
|
88
|
+
disabled: "rgba(241, 77, 66, 1)"
|
|
89
|
+
},
|
|
90
|
+
color: "rgba(255, 198, 198, 1)",
|
|
91
|
+
labelColor: b
|
|
92
|
+
},
|
|
93
|
+
Y: {
|
|
94
|
+
backgroundColor: "rgba(20, 151, 108, 1)",
|
|
95
|
+
borderColor: "rgba(20, 151, 108, 1)",
|
|
96
|
+
buttonBackgroundColor: {
|
|
97
|
+
default: "rgba(28, 188, 135, 1)",
|
|
98
|
+
pressed: "rgba(11, 89, 63, 1)",
|
|
99
|
+
disabled: "rgba(28, 188, 135, 1)",
|
|
100
|
+
hovered: "rgba(28, 188, 135, 1)"
|
|
101
|
+
},
|
|
102
|
+
color: "rgba(215, 255, 242, 1)",
|
|
103
|
+
labelColor: b
|
|
104
|
+
},
|
|
105
|
+
Z: {
|
|
106
|
+
backgroundColor: "rgba(1, 87, 155, 1)",
|
|
107
|
+
borderColor: "rgba(1, 87, 155, 1)",
|
|
108
|
+
buttonBackgroundColor: {
|
|
109
|
+
default: "rgba(2, 136, 209, 1)",
|
|
110
|
+
pressed: "rgba(2, 64, 114, 1)",
|
|
111
|
+
disabled: "rgba(2, 136, 209, 1)",
|
|
112
|
+
hovered: "rgba(2, 136, 209, 1)"
|
|
113
|
+
},
|
|
114
|
+
color: "rgba(210, 239, 255, 1)",
|
|
115
|
+
labelColor: b
|
|
116
|
+
}
|
|
117
|
+
}, F = b, N = b, X = {
|
|
118
|
+
x: O,
|
|
119
|
+
y: E,
|
|
120
|
+
z: j
|
|
121
|
+
};
|
|
122
|
+
export {
|
|
123
|
+
T as J,
|
|
124
|
+
U as a,
|
|
125
|
+
_ as b,
|
|
126
|
+
z as c,
|
|
127
|
+
F as d,
|
|
128
|
+
x as i,
|
|
129
|
+
X as j,
|
|
130
|
+
w as u,
|
|
131
|
+
N as v
|
|
132
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react"),H=require("react-i18next"),u=require("./holdSafety-TeMXlYQe.cjs"),k=require("@wandelbots/design-tokens"),y=["x","y","z"],I=["-","+"];function x(e,t){return!!e&&!!t&&e.axis===t.axis&&e.direction===t.direction}function R(e,t="translate"){return t==="rotate"?`R${e.axis}${e.direction}`:`${e.axis.toUpperCase()}${e.direction}`}function J({onStart:e,onStop:t,disabled:i=!1,isSame:g}){const c=s.useRef(null),[f,p]=s.useState(null),l=s.useRef(null),d=s.useRef({onStop:t,isSame:g});d.current={onStop:t,isSame:g};const b=s.useCallback((n,a,o)=>{i||c.current!==null||(c.current=n,l.current={pointerId:a,element:o},p(n),u.capturePointer(o,a),e(n))},[i,e]),r=s.useCallback(n=>{const a=c.current;if(a===null||n!==void 0&&!d.current.isSame(a,n))return;const o=l.current;c.current=null,l.current=null,p(null),o&&u.releasePointer(o.element,o.pointerId),d.current.onStop()},[]),P=s.useCallback(()=>r(),[r]);u.useEndHoldWhenUnattended(f!==null,i,P);const A=s.useCallback((n,a)=>({onPointerDown:o=>{u.startsPointerHold(o)&&b(n,o.pointerId,o.currentTarget)},onPointerMove:o=>{var S;((S=l.current)==null?void 0:S.pointerId)===o.pointerId&&(u.primaryReleased(o)||!u.isPointerOn(o,a))&&r(n)},onPointerLeave:o=>r(n),onPointerUp:()=>r(n),onPointerCancel:()=>r(n),onLostPointerCapture:()=>r(n),onBlur:o=>r(n),onContextMenu:u.preventContextMenu}),[b,r]);return{held:f,handlersFor:A,stop:P}}function h({motion:e="translate",onJogStart:t,onJogStop:i,activeHandle:g,disabled:c=!1}){const{t:f}=H.useTranslation(),p=s.useCallback(r=>t(r.axis,r.direction),[t]),{held:l,handlersFor:d,stop:b}=J({onStart:p,onStop:i,disabled:c,isSame:x});return s.useEffect(()=>{b()},[e,b]),{held:l,handlersFor:d,label:r=>f("Jogging.Handle.lb",{handle:R(r,e)}),isPressed:r=>x(l,r)||x(g,r)}}const C="rgba(255, 255, 255, 1)",v={X:{backgroundColor:"rgba(215, 66, 56, 1)",borderColor:"rgba(215, 66, 56, 1)",buttonBackgroundColor:{default:"rgba(241, 77, 66, 1)",pressed:"rgba(138, 41, 35, 1)",hovered:"rgba(241, 77, 66, 1)",disabled:"rgba(241, 77, 66, 1)"},color:"rgba(255, 198, 198, 1)",labelColor:C},Y:{backgroundColor:"rgba(20, 151, 108, 1)",borderColor:"rgba(20, 151, 108, 1)",buttonBackgroundColor:{default:"rgba(28, 188, 135, 1)",pressed:"rgba(11, 89, 63, 1)",disabled:"rgba(28, 188, 135, 1)",hovered:"rgba(28, 188, 135, 1)"},color:"rgba(215, 255, 242, 1)",labelColor:C},Z:{backgroundColor:"rgba(1, 87, 155, 1)",borderColor:"rgba(1, 87, 155, 1)",buttonBackgroundColor:{default:"rgba(2, 136, 209, 1)",pressed:"rgba(2, 64, 114, 1)",disabled:"rgba(2, 136, 209, 1)",hovered:"rgba(2, 136, 209, 1)"},color:"rgba(210, 239, 255, 1)",labelColor:C}},O=C,j=C,E={x:k.ColorsRed400,y:k.ColorsGreen400,z:k.ColorsBlue400};exports.JOG_AXES=y;exports.JOG_DIRECTIONS=I;exports.cartesianAxisColors=v;exports.isSameJogHandle=x;exports.jogAxisColors=E;exports.jogHandleName=R;exports.jointArrowColor=O;exports.useJogControls=h;exports.velocitySliderLegendColor=j;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function t(r){try{return JSON.parse(r)}catch{return}}function n(r){try{return JSON.stringify(r)}catch{return}}exports.tryParseJson=t;exports.tryStringifyJson=n;
|