@wandelbots/wandelbots-js-react-components 1.3.1 → 1.3.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 +18 -7
- package/src/components/3d-viewport/CoordinateSystemTransform.tsx +44 -0
- package/src/components/3d-viewport/PresetEnvironment.tsx +78 -0
- package/src/components/3d-viewport/SafetyZonesRenderer.tsx +54 -0
- package/src/components/LoadingButton.stories.tsx +61 -0
- package/src/components/LoadingButton.tsx +19 -0
- package/src/components/LoadingCover.tsx +75 -0
- package/src/components/ThemeSelect.tsx +49 -0
- package/src/components/VelocitySlider.stories.tsx +32 -0
- package/src/components/VelocitySlider.tsx +52 -0
- package/src/components/jogging/JoggingCartesianAxisControl.stories.tsx +41 -0
- package/src/components/jogging/JoggingCartesianAxisControl.tsx +127 -0
- package/src/components/jogging/JoggingCartesianTab.tsx +265 -0
- package/src/components/jogging/JoggingCartesianValues.tsx +45 -0
- package/src/components/jogging/JoggingFreedriveTab.tsx +9 -0
- package/src/components/jogging/JoggingJointLimitDetector.tsx +51 -0
- package/src/components/jogging/JoggingJointRotationControl.stories.tsx +38 -0
- package/src/components/jogging/JoggingJointRotationControl.tsx +197 -0
- package/src/components/jogging/JoggingJointTab.tsx +93 -0
- package/src/components/jogging/JoggingJointValues.tsx +45 -0
- package/src/components/jogging/JoggingOptions.tsx +96 -0
- package/src/components/jogging/JoggingPanel.stories.tsx +26 -0
- package/src/components/jogging/JoggingPanel.tsx +148 -0
- package/src/components/jogging/JoggingStore.tsx +294 -0
- package/src/components/jogging/JoggingVelocitySlider.tsx +56 -0
- package/src/components/robots/ABB_1200_07_7.tsx +123 -0
- package/src/components/robots/AxisConfig.ts +3 -0
- package/src/components/robots/DHRobot.tsx +129 -0
- package/src/components/robots/FANUC_ARC_Mate_100iD.tsx +187 -0
- package/src/components/robots/FANUC_ARC_Mate_120iD.tsx +187 -0
- package/src/components/robots/FANUC_CRX10iA.tsx +167 -0
- package/src/components/robots/FANUC_CRX25iA.tsx +167 -0
- package/src/components/robots/FANUC_CRX25iAL.tsx +178 -0
- package/src/components/robots/KUKA_KR210_R2700.tsx +291 -0
- package/src/components/robots/KUKA_KR270_R2700.tsx +244 -0
- package/src/components/robots/RobotAnimator.tsx +83 -0
- package/src/components/robots/SupportedRobot.tsx +131 -0
- package/src/components/robots/UniversalRobots_UR10.tsx +112 -0
- package/src/components/robots/UniversalRobots_UR10e.tsx +275 -0
- package/src/components/robots/UniversalRobots_UR3.tsx +112 -0
- package/src/components/robots/UniversalRobots_UR3e.tsx +112 -0
- package/src/components/robots/UniversalRobots_UR5.tsx +111 -0
- package/src/components/robots/UniversalRobots_UR5e.tsx +280 -0
- package/src/components/robots/Yaskawa_AR1440.tsx +152 -0
- package/src/components/robots/Yaskawa_AR1730.tsx +165 -0
- package/src/components/robots/Yaskawa_AR2010.tsx +159 -0
- package/src/components/robots/Yaskawa_AR3120.tsx +160 -0
- package/src/components/robots/Yaskawa_AR900.tsx +121 -0
- package/src/components/utils/converters.ts +23 -0
- package/src/components/utils/errorHandling.ts +30 -0
- package/src/components/utils/hooks.tsx +54 -0
- package/src/components/utils/robotTreeQuery.ts +27 -0
- package/src/components/wandelscript-editor/WandelscriptEditor.stories.tsx +45 -0
- package/src/components/wandelscript-editor/WandelscriptEditor.tsx +114 -0
- package/src/components/wandelscript-editor/wandelscript.tmLanguage.ts +62 -0
- package/src/declarations.d.ts +10 -0
- package/src/i18n/config.ts +27 -0
- package/src/i18n/locales/de/translations.json +12 -0
- package/src/i18n/locales/en/translations.json +12 -0
- package/src/icons/arrowForwardFilled.tsx +7 -0
- package/src/icons/axis-x.svg +3 -0
- package/src/icons/axis-y.svg +3 -0
- package/src/icons/axis-z.svg +3 -0
- package/src/icons/expandFilled.tsx +11 -0
- package/src/icons/home.tsx +12 -0
- package/src/icons/index.ts +6 -0
- package/src/icons/infoOutlined.tsx +10 -0
- package/src/icons/jogging.svg +3 -0
- package/src/icons/robot.svg +3 -0
- package/src/icons/robot.tsx +14 -0
- package/src/icons/rotation.svg +4 -0
- package/src/icons/wbLogo.tsx +21 -0
- package/src/index.ts +7 -0
- package/src/themes/color.tsx +74 -0
- package/src/themes/theme.ts +150 -0
- package/src/themes/wbTheme.stories.tsx +64 -0
- package/src/themes/wbTheme.ts +186 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { autorun, reaction } from "mobx"
|
|
2
|
+
import { useEffect, type EffectCallback } from "react"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Run code once on component mount. Shorthand for useEffect(effect, []).
|
|
6
|
+
*/
|
|
7
|
+
export function useMounted(effect: EffectCallback) {
|
|
8
|
+
useEffect(effect, [])
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Initialize a mobx autorun watcher on component mount, and
|
|
13
|
+
* clean it up when the component unmounts.
|
|
14
|
+
*/
|
|
15
|
+
export function useAutorun(view: Parameters<typeof autorun>[0]) {
|
|
16
|
+
useMounted(() => {
|
|
17
|
+
return autorun(view)
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Initialize a mobx reaction watcher on component mount, and
|
|
23
|
+
* clean it up when the component unmounts.
|
|
24
|
+
*/
|
|
25
|
+
export function useReaction<T>(
|
|
26
|
+
expression: Parameters<typeof reaction<T>>[0],
|
|
27
|
+
effect: Parameters<typeof reaction<T>>[1],
|
|
28
|
+
opts?: Parameters<typeof reaction<T>>[2],
|
|
29
|
+
) {
|
|
30
|
+
useMounted(() => {
|
|
31
|
+
return reaction(expression, effect, opts)
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Run a callback on every animation frame. Cleans up
|
|
37
|
+
* after component unmount.
|
|
38
|
+
*/
|
|
39
|
+
export function useAnimationFrame(callback: () => void) {
|
|
40
|
+
return useMounted(() => {
|
|
41
|
+
let frameId: number
|
|
42
|
+
|
|
43
|
+
function frame() {
|
|
44
|
+
callback()
|
|
45
|
+
frameId = requestAnimationFrame(frame)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
frameId = requestAnimationFrame(frame)
|
|
49
|
+
|
|
50
|
+
return () => {
|
|
51
|
+
cancelAnimationFrame(frameId)
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type * as THREE from "three"
|
|
2
|
+
|
|
3
|
+
export type RobotSceneJoint = THREE.Object3D
|
|
4
|
+
|
|
5
|
+
export const defaultJointNamePattern = "(^joint_[0-9]+$)|(_J[0-9]+$)"
|
|
6
|
+
|
|
7
|
+
export function getAllObjects(root: THREE.Object3D): THREE.Object3D[] {
|
|
8
|
+
if (root.children.length === 0) {
|
|
9
|
+
return [root]
|
|
10
|
+
}
|
|
11
|
+
return [root, ...root.children.flatMap((child) => getAllObjects(child))]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function isObjectAJointByName(name: string, jointNamePattern?: string) {
|
|
15
|
+
// e.g. abc_J05 => joint 5
|
|
16
|
+
// or joint_5 => joint 5
|
|
17
|
+
return new RegExp(jointNamePattern ?? defaultJointNamePattern).test(name)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function getAllJointsByName(
|
|
21
|
+
rootObject: THREE.Object3D,
|
|
22
|
+
jointNamePattern?: string,
|
|
23
|
+
): RobotSceneJoint[] {
|
|
24
|
+
return getAllObjects(rootObject).filter((object) =>
|
|
25
|
+
isObjectAJointByName(object.name, jointNamePattern),
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { WandelscriptEditor } from "./WandelscriptEditor";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WandelscriptEditor> = {
|
|
5
|
+
component: WandelscriptEditor,
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
|
|
9
|
+
const defaultCode = `start = [832, -452, 289] # The start position of the edge
|
|
10
|
+
end = [817, 168, 288] # The end position of the edge
|
|
11
|
+
point_a = [602, 163, -100] # Any point on the left plane (looking from start to end)
|
|
12
|
+
point_b = [1033, 173, -100] # Any point on the right plane (looking from start to end)
|
|
13
|
+
radius = 20 # the desired radius of the final edge
|
|
14
|
+
spacing = 10 # the distance between to zig-zag corners
|
|
15
|
+
|
|
16
|
+
n = int(distance(start, end) / spacing)
|
|
17
|
+
|
|
18
|
+
edge_poses = find_edge(start, end, point_a, start, end,point_b)
|
|
19
|
+
plane_orientations = {to_orientation(edge_poses[0]), to_orientation(edge_poses[1])}
|
|
20
|
+
center_rotation = interpolate(plane_orientations[0], plane_orientations[1], 0.5)
|
|
21
|
+
|
|
22
|
+
offset = [0, 0, -radius, 0, 0, 0]
|
|
23
|
+
offset_from_axis = center_rotation ::[0, 0, distance_from_corner(edge_poses[0], edge_poses[1], radius), 0, 0, 0]:: ~center_rotation
|
|
24
|
+
|
|
25
|
+
move via p2p() to to_pose(start)::offset_from_axis :: plane_orientations[0] :: offset
|
|
26
|
+
for i = 0..<int(n / 2) - 1:
|
|
27
|
+
a = interpolate(to_pose(start), to_pose(end),(2 * i + 1) / n ) ::offset_from_axis :: center_rotation :: offset
|
|
28
|
+
b = interpolate(to_pose(start), to_pose(end),(2 * i + 2) / n ) ::offset_from_axis :: plane_orientations[modulo(i + 1, 2)] :: offset
|
|
29
|
+
move via arc(a) to b
|
|
30
|
+
if i == 10:
|
|
31
|
+
test_pose = planned_pose()
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
export const Editor: StoryObj<typeof WandelscriptEditor> = {
|
|
35
|
+
args: {
|
|
36
|
+
code: defaultCode,
|
|
37
|
+
},
|
|
38
|
+
render: (props) => {
|
|
39
|
+
return (
|
|
40
|
+
<div style={{ height: "400px" }}>
|
|
41
|
+
<WandelscriptEditor {...props} />
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import Editor, { useMonaco, type Monaco } from "@monaco-editor/react"
|
|
2
|
+
import React, { useEffect } from "react"
|
|
3
|
+
import { createHighlighter, type BundledTheme } from "shiki"
|
|
4
|
+
import { shikiToMonaco } from "@shikijs/monaco"
|
|
5
|
+
|
|
6
|
+
import wandelscriptTextmateGrammar from "./wandelscript.tmLanguage"
|
|
7
|
+
import { useTheme } from "@mui/material"
|
|
8
|
+
import { editor } from "monaco-editor"
|
|
9
|
+
|
|
10
|
+
type WandelscriptEditorProps = {
|
|
11
|
+
/** The current Wandelscript content of the code editor (controlled component) */
|
|
12
|
+
code?: string
|
|
13
|
+
/** What to do when the user edits the code */
|
|
14
|
+
onChange?: (code: string|undefined, ev: editor.IModelContentChangedEvent) => void
|
|
15
|
+
/** Callback to further configure monaco on startup if needed */
|
|
16
|
+
monacoSetup?: (monaco: Monaco) => void
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const shikiTheme: BundledTheme = "dark-plus"
|
|
20
|
+
|
|
21
|
+
/** A Monaco (VSCode-style) embedded code editor with Wandelscript syntax highlighting */
|
|
22
|
+
export const WandelscriptEditor = (props: WandelscriptEditorProps) => {
|
|
23
|
+
const monaco = useMonaco()
|
|
24
|
+
const theme = useTheme()
|
|
25
|
+
|
|
26
|
+
async function setupEditor(monaco: Monaco) {
|
|
27
|
+
// Register and configure the Wandelscript language
|
|
28
|
+
monaco.languages.register({ id: "wandelscript" })
|
|
29
|
+
|
|
30
|
+
monaco.languages.setLanguageConfiguration("wandelscript", {
|
|
31
|
+
comments: {
|
|
32
|
+
lineComment: "#",
|
|
33
|
+
},
|
|
34
|
+
brackets: [
|
|
35
|
+
["(", ")"],
|
|
36
|
+
["[", "]"],
|
|
37
|
+
],
|
|
38
|
+
autoClosingPairs: [
|
|
39
|
+
{ open: "[", close: "]" },
|
|
40
|
+
{ open: "(", close: ")" },
|
|
41
|
+
],
|
|
42
|
+
surroundingPairs: [
|
|
43
|
+
{ open: "[", close: "]" },
|
|
44
|
+
{ open: "(", close: ")" },
|
|
45
|
+
],
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
// Monaco doesn't support TextMate grammar config directly, so we
|
|
49
|
+
// use Shiki as an intermediary
|
|
50
|
+
|
|
51
|
+
const highlighter = await createHighlighter({
|
|
52
|
+
// Our textmate grammar doesn't quite conform to the expected type
|
|
53
|
+
// here; I'm not sure what the missing properties mean exactly
|
|
54
|
+
langs: [wandelscriptTextmateGrammar as any],
|
|
55
|
+
themes: [shikiTheme],
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
shikiToMonaco(highlighter, monaco)
|
|
59
|
+
|
|
60
|
+
// Override the generated shiki theme to use shiki syntax highlighting
|
|
61
|
+
// but vscode colors
|
|
62
|
+
monaco.editor.defineTheme(shikiTheme, {
|
|
63
|
+
base: theme.palette.mode === "dark" ? "vs-dark" : "vs",
|
|
64
|
+
inherit: true,
|
|
65
|
+
rules: [],
|
|
66
|
+
colors: {
|
|
67
|
+
// "editor.background": colors.backgroundDefault,
|
|
68
|
+
// "editorLineNumber.foreground": "#797979",
|
|
69
|
+
// "editorLineNumber.activeForeground": "#e9e9e9",
|
|
70
|
+
},
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
if (props.monacoSetup) {
|
|
74
|
+
props.monacoSetup(monaco)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
// Define some custom keybindings
|
|
79
|
+
// monaco.editor.addCommand({
|
|
80
|
+
// id: "save",
|
|
81
|
+
// run: () => props.onSave ? props.onSave(monaco.editor.getModels()[0]!.getValue()) : null,
|
|
82
|
+
// })
|
|
83
|
+
|
|
84
|
+
// monaco.editor.addKeybindingRule({
|
|
85
|
+
// keybinding: monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS,
|
|
86
|
+
// command: "save",
|
|
87
|
+
// })
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (monaco) {
|
|
92
|
+
setupEditor(monaco)
|
|
93
|
+
}
|
|
94
|
+
}, [monaco])
|
|
95
|
+
|
|
96
|
+
if (!monaco) {
|
|
97
|
+
return null
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<Editor
|
|
102
|
+
value={props.code}
|
|
103
|
+
onChange={props.onChange}
|
|
104
|
+
defaultLanguage="wandelscript"
|
|
105
|
+
theme={shikiTheme}
|
|
106
|
+
options={{
|
|
107
|
+
minimap: { enabled: false },
|
|
108
|
+
wordWrap: "on",
|
|
109
|
+
automaticLayout: true,
|
|
110
|
+
// ...props.monacoOptions,
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
$schema:
|
|
3
|
+
"https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
4
|
+
name: "wandelscript",
|
|
5
|
+
patterns: [
|
|
6
|
+
{
|
|
7
|
+
include: "#keywords",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
include: "#strings",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
include: "#comments",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
include: "#functions",
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
repository: {
|
|
20
|
+
keywords: {
|
|
21
|
+
patterns: [
|
|
22
|
+
{
|
|
23
|
+
name: "keyword.control.flow.wandelscript",
|
|
24
|
+
match:
|
|
25
|
+
"\\b(move|via|to|interrupt|def|False|True|for|if|else|elif|while|return|switch|activate|deactivate|print)\\b",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
strings: {
|
|
30
|
+
name: "string.quoted.double.wandelscript",
|
|
31
|
+
begin: '"',
|
|
32
|
+
end: '"',
|
|
33
|
+
patterns: [
|
|
34
|
+
{
|
|
35
|
+
name: "constant.character.escape.wandelscript",
|
|
36
|
+
match: "\\\\.",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
comments: {
|
|
41
|
+
patterns: [
|
|
42
|
+
{
|
|
43
|
+
begin: "#",
|
|
44
|
+
beginCaptures: {
|
|
45
|
+
"0": { name: "punctuation.definition.comment.wandelscript" },
|
|
46
|
+
},
|
|
47
|
+
end: "$",
|
|
48
|
+
name: "comment.line.number-sign.wandelscript",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
functions: {
|
|
53
|
+
patterns: [
|
|
54
|
+
{
|
|
55
|
+
match: "[a-zA-Z_-]+\\(",
|
|
56
|
+
name: "entity.name.function.wandelscript",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
scopeName: "source.wandelscript",
|
|
62
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare module "*.glb" {
|
|
2
|
+
const content: string
|
|
3
|
+
export default content
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// Type for svg imports handled by vite config
|
|
7
|
+
declare module "*.svg" {
|
|
8
|
+
const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
|
|
9
|
+
export default content;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import deJSON from "./locales/de/translations.json"
|
|
2
|
+
import enJSON from "./locales/en/translations.json"
|
|
3
|
+
import i18next from "i18next"
|
|
4
|
+
import type { i18n } from "i18next"
|
|
5
|
+
import LanguageDetector from "i18next-browser-languagedetector"
|
|
6
|
+
import { initReactI18next } from "react-i18next"
|
|
7
|
+
|
|
8
|
+
const i18n: i18n = i18next.createInstance()
|
|
9
|
+
|
|
10
|
+
i18n
|
|
11
|
+
.use(LanguageDetector)
|
|
12
|
+
.use(initReactI18next)
|
|
13
|
+
.init({
|
|
14
|
+
supportedLngs: ["en", "de"],
|
|
15
|
+
resources: {
|
|
16
|
+
en: {
|
|
17
|
+
translations: enJSON,
|
|
18
|
+
},
|
|
19
|
+
de: {
|
|
20
|
+
translations: deJSON,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
ns: ["translations"],
|
|
24
|
+
defaultNS: "translations",
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
export default i18n
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Jogging.Cartesian.Translation.velocityMmPerSec.lb": "{{amount}} mm/s",
|
|
3
|
+
"Jogging.Cartesian.Rotation.velocityDegPerSec.lb": "{{amount}}°/s",
|
|
4
|
+
"Jogging.Velocity.lb": "Geschwindigkeit",
|
|
5
|
+
"General.degree.variable": "{{amount}}°",
|
|
6
|
+
"General.mm.variable": "{{amount}}mm",
|
|
7
|
+
"Jogging.Cartesian.MotionType.lb": "Bewegungstyp",
|
|
8
|
+
"Jogging.Cartesian.Translation.bt": "Translation",
|
|
9
|
+
"Jogging.Cartesian.Rotation.bt": "Rotation",
|
|
10
|
+
"Jogging.Joints.JointValues.lb": "Gelenkwerte",
|
|
11
|
+
"Jogging.Increment.Continuous.dd": "Fortlaufend"
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Jogging.Cartesian.Translation.velocityMmPerSec.lb": "{{amount}} mm/s",
|
|
3
|
+
"Jogging.Cartesian.Rotation.velocityDegPerSec.lb": "{{amount}}°/s",
|
|
4
|
+
"Jogging.Velocity.lb": "Velocity",
|
|
5
|
+
"General.degree.variable": "{{amount}}°",
|
|
6
|
+
"General.mm.variable": "{{amount}}mm",
|
|
7
|
+
"Jogging.Cartesian.MotionType.lb": "Motion type",
|
|
8
|
+
"Jogging.Cartesian.Translation.bt": "Translation",
|
|
9
|
+
"Jogging.Cartesian.Rotation.bt": "Rotation",
|
|
10
|
+
"Jogging.Joints.JointValues.lb": "Joint values",
|
|
11
|
+
"Jogging.Increment.Continuous.dd": "Continuous"
|
|
12
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="19" height="10" viewBox="0 0 19 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.13114 0.312406C5.48225 0.663519 5.48225 1.23278 5.13114 1.5839L3.06975 3.64528H15.5109L13.4496 1.58402C13.0985 1.2329 13.0985 0.66364 13.4496 0.312527C13.8007 -0.0385848 14.37 -0.0385848 14.7211 0.312527L18.3174 3.90884C18.6685 4.25996 18.6685 4.82922 18.3174 5.18033L14.7211 8.77665C14.37 9.12776 13.8007 9.12776 13.4496 8.77665C13.0985 8.42554 13.0985 7.85627 13.4496 7.50516L15.5113 5.44344H3.06954L5.13114 7.50504C5.48225 7.85615 5.48225 8.42542 5.13114 8.77653C4.78003 9.12764 4.21076 9.12764 3.85965 8.77653L0.263334 5.18021C-0.087778 4.8291 -0.087778 4.25983 0.263334 3.90872L3.85965 0.312406C4.21076 -0.0387058 4.78003 -0.0387058 5.13114 0.312406Z" fill="white"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="19" height="10" viewBox="0 0 19 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.13114 0.312406C5.48225 0.663519 5.48225 1.23278 5.13114 1.5839L3.06975 3.64528H15.5109L13.4496 1.58402C13.0985 1.2329 13.0985 0.66364 13.4496 0.312527C13.8007 -0.0385848 14.37 -0.0385848 14.7211 0.312527L18.3174 3.90884C18.6685 4.25996 18.6685 4.82922 18.3174 5.18033L14.7211 8.77665C14.37 9.12776 13.8007 9.12776 13.4496 8.77665C13.0985 8.42554 13.0985 7.85627 13.4496 7.50516L15.5113 5.44344H3.06954L5.13114 7.50504C5.48225 7.85615 5.48225 8.42542 5.13114 8.77653C4.78003 9.12764 4.21076 9.12764 3.85965 8.77653L0.263334 5.18021C-0.087778 4.8291 -0.087778 4.25983 0.263334 3.90872L3.85965 0.312406C4.21076 -0.0387058 4.78003 -0.0387058 5.13114 0.312406Z" fill="white"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="10" height="19" viewBox="0 0 10 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.52182 14.8114C9.87293 14.4603 9.87293 13.8911 9.52182 13.54C9.17071 13.1888 8.60144 13.1888 8.25033 13.54L6.18885 15.6014L6.18885 3.15999L8.25033 5.22147C8.60144 5.57258 9.17071 5.57258 9.52182 5.22147C9.87293 4.87036 9.87293 4.30109 9.52182 3.94998L5.9255 0.353666C5.57439 0.00255379 5.00513 0.00255378 4.65401 0.353666L1.0577 3.94998C0.706587 4.30109 0.706587 4.87036 1.0577 5.22147C1.40881 5.57258 1.97808 5.57258 2.32919 5.22147L4.3907 3.15996L4.3907 15.6015L2.32919 13.54C1.97808 13.1888 1.40881 13.1888 1.0577 13.54C0.706588 13.8911 0.706588 14.4603 1.0577 14.8114L4.65402 18.4078C5.00513 18.7589 5.57439 18.7589 5.92551 18.4078L9.52182 14.8114Z" fill="white"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function ExpandFilledIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<path
|
|
5
|
+
d="M16.59 8.29492L12 12.8749L7.41 8.29492L6 9.70492L12 15.7049L18 9.70492L16.59 8.29492Z"
|
|
6
|
+
fill="white"
|
|
7
|
+
fill-opacity="0.8"
|
|
8
|
+
/>
|
|
9
|
+
</svg>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function HomeIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<path
|
|
5
|
+
fill-rule="evenodd"
|
|
6
|
+
clip-rule="evenodd"
|
|
7
|
+
d="M5 22C3.34315 22 2 20.6569 2 19V11.9225C2 10.7074 2.55236 9.55811 3.50122 8.79902L12 2L20.4988 8.79902C21.4476 9.55811 22 10.7074 22 11.9225V19C22 20.6569 20.6569 22 19 22H5ZM20.5 11.9225V19C20.5 19.8284 19.8284 20.5 19 20.5H16V14C16 12.8954 15.1046 12 14 12H10C8.89543 12 8 12.8954 8 14V20.5H5C4.17157 20.5 3.5 19.8284 3.5 19V11.9225C3.5 11.163 3.84522 10.4448 4.43826 9.97033L12 3.92094L19.5617 9.97033C20.1548 10.4448 20.5 11.163 20.5 11.9225Z"
|
|
8
|
+
fill="white"
|
|
9
|
+
/>
|
|
10
|
+
</svg>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ArrowForwardFilledIcon } from "./arrowForwardFilled";
|
|
2
|
+
export { ExpandFilledIcon } from "./expandFilled";
|
|
3
|
+
export { HomeIcon } from "./home";
|
|
4
|
+
export { InfoOutlinedIcon } from "./infoOutlined";
|
|
5
|
+
export { RobotIcon } from "./robot";
|
|
6
|
+
export { WBLogoIcon } from "./wbLogo";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function InfoOutlinedIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<path
|
|
5
|
+
d="M11 7H13V9H11V7ZM11 11H13V17H11V11ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20Z"
|
|
6
|
+
fill="white"
|
|
7
|
+
/>
|
|
8
|
+
</svg>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9991 0.999878L15.4045 4.40529L14.1795 5.6303L12.8653 4.31611V8.16493H11.1329V4.31611L9.88895 5.56007L8.66394 4.33506L11.9991 0.999878ZM11.1329 15.6649H12.8653V19.684L14.1795 18.3699L15.4045 19.5949L11.9991 23.0003L8.59371 19.5949L9.81872 18.3699L11.1329 19.684V15.6649ZM4.31583 11.1337H8.16412V12.8662H4.31583L5.63003 14.1803L4.40502 15.4054L0.999603 11.9999L4.40502 8.59452L5.63003 9.81953L4.31583 11.1337ZM19.6838 12.8662H15.6641V11.1337H19.6838L18.3696 9.81953L19.5946 8.59452L23 11.9999L19.5946 15.4054L18.3696 14.1803L19.6838 12.8662Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.3587 14.2499V15.4937V17.1848H8.04982H12.298H13.9891V15.4937V13.663L10.1958 9.86972L9 8.67391L9.85854 7.81537L10.1958 7.47811L11.0543 6.61956L11.6194 7.18463L12.2502 7.81537L12.8152 8.38043L14.011 7.18463L14.5542 6.64146L15.75 5.44565L14.5542 4.24984L12.2502 1.94581L11.0543 0.75L9.85854 1.94581L3.44581 8.35854L2.25 9.55435L3.44581 10.7502L6.35862 13.663V14.2499H6.3587ZM8.04982 14.2499V15.4937H12.298V14.3635L7.80419 9.86972L6.60839 8.67391L7.80419 7.47811L9.85854 5.42376L9.86612 5.41618L9.32295 4.87301L4.64161 9.55435L7.5545 12.4672L8.04982 12.9626V13.076H10.1738L11.3478 14.2499H8.04982ZM11.0543 4.22795L10.7599 4.52241L10.2167 3.97924L11.0543 3.14161L13.3584 5.44565L12.8152 5.98882L12.2502 5.42376L11.0543 4.22795Z" fill="#38C6F4"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export function RobotIcon() {
|
|
4
|
+
return (
|
|
5
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<path
|
|
7
|
+
fill-rule="evenodd"
|
|
8
|
+
clip-rule="evenodd"
|
|
9
|
+
d="M8.47826 18.9999V21.2219V22.913H10.1694H16.961H18.6522V21.2219V18.2174L13.1958 12.761L12 11.5652L13.1958 10.3694L13.5433 10.0219L14.7391 8.82609L15.8911 9.9781L15.9349 10.0219L17.087 11.1739L18.2828 9.9781L19.8042 8.45668L21 7.26087L19.8042 6.06506L15.9349 2.19581L14.7391 1L13.5433 2.19581L4.19581 11.5433L3 12.7391L4.19581 13.9349L8.47817 18.2173V18.9999H8.47826ZM10.1694 18.9999V21.2219H16.961V18.9179L10.8042 12.761L9.60839 11.5652L10.8042 10.3694L13.5433 7.63028L13.5534 7.62018L12.032 6.09875L5.39161 12.7391L9.67407 17.0216L10.0872 17.4347H13.5651L15.1303 18.9999H10.1694ZM18.6084 7.26087L17.093 8.7763L13.2237 4.90705L14.7391 3.39161L18.6084 7.26087Z"
|
|
10
|
+
fill="white"
|
|
11
|
+
/>
|
|
12
|
+
</svg>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M18.5 12C18.5 8.68629 15.8137 6 12.5 6C9.18629 6 6.5 8.68629 6.5 12C6.5 15.3137 9.18629 18 12.5 18" stroke="white" stroke-width="1.5" stroke-linecap="round" fill="none"/>
|
|
3
|
+
<path d="M16.5 11L18.5 13.5L20.5 11" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type WBLogoProps = {
|
|
2
|
+
width?: number;
|
|
3
|
+
fillColor?: string;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export function WBLogoIcon({ width = 21, fillColor = "white" }: WBLogoProps) {
|
|
7
|
+
return (
|
|
8
|
+
<svg
|
|
9
|
+
width={`${width}`}
|
|
10
|
+
height={`${1.19 * width}`}
|
|
11
|
+
viewBox="0 0 21 25"
|
|
12
|
+
fill={fillColor}
|
|
13
|
+
style={{ transition: "fill 2s ease" }}
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
>
|
|
16
|
+
<path d="M0 8.25553V14.2168L17.0228 4.47097L14.4197 0L0 8.25553Z" />
|
|
17
|
+
<path d="M9.70299 11.6758L0 17.2112V23.1846L9.70299 17.6492V11.6758Z" />
|
|
18
|
+
<path d="M11.8886 19.4131L2.22571 24.993H15.5035V19.4131H11.8886Z" />
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./components/robots/SupportedRobot"
|
|
2
|
+
export * from "./components/robots/AxisConfig"
|
|
3
|
+
export * from "./components/3d-viewport/PresetEnvironment"
|
|
4
|
+
export * from "./components/3d-viewport/SafetyZonesRenderer"
|
|
5
|
+
export * from "./components/jogging/JoggingCartesianAxisControl"
|
|
6
|
+
export * from "./components/jogging/JoggingJointRotationControl"
|
|
7
|
+
export * from "./components/jogging/JoggingPanel"
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React, { ReactNode, useEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
export function ColorSection(props: { name: string; children: ReactNode }) {
|
|
4
|
+
return (
|
|
5
|
+
<>
|
|
6
|
+
<h2>{props.name}</h2>
|
|
7
|
+
<div
|
|
8
|
+
style={{
|
|
9
|
+
display: "grid",
|
|
10
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))",
|
|
11
|
+
gap: "20px",
|
|
12
|
+
}}
|
|
13
|
+
>
|
|
14
|
+
{props.children}
|
|
15
|
+
</div>
|
|
16
|
+
</>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function Color({ name, color }: { name: string; color: string }) {
|
|
21
|
+
const [showCopied, setShowCopied] = useState(false);
|
|
22
|
+
|
|
23
|
+
function handleClick(value: string) {
|
|
24
|
+
if (!navigator.clipboard) {
|
|
25
|
+
console.error("can't send value to clipboard");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
navigator.clipboard.writeText(value);
|
|
29
|
+
setShowCopied(true);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (showCopied) {
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
setShowCopied(false);
|
|
36
|
+
}, 2000);
|
|
37
|
+
}
|
|
38
|
+
}, [showCopied]);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<li
|
|
42
|
+
onClick={() => handleClick(color)}
|
|
43
|
+
style={{
|
|
44
|
+
borderRadius: "5px",
|
|
45
|
+
border: "1px solid lightgray",
|
|
46
|
+
padding: "5px",
|
|
47
|
+
listStyleType: "none",
|
|
48
|
+
width: "200px",
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
<span
|
|
52
|
+
style={{
|
|
53
|
+
backgroundColor: color,
|
|
54
|
+
display: "block",
|
|
55
|
+
height: "4em",
|
|
56
|
+
marginBottom: "0.3em",
|
|
57
|
+
borderRadius: "5px",
|
|
58
|
+
// border: "1px solid lightgray",
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
<span>{name}</span>
|
|
62
|
+
<br />
|
|
63
|
+
<span
|
|
64
|
+
style={{
|
|
65
|
+
color: "gray",
|
|
66
|
+
fontSize: "0.9em",
|
|
67
|
+
fontFamily: "monospace",
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
{showCopied ? "Copied ✔︎" : color}
|
|
71
|
+
</span>
|
|
72
|
+
</li>
|
|
73
|
+
);
|
|
74
|
+
}
|