@wandelbots/wandelbots-js-react-components 1.12.2 → 1.13.1
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/LoadingButton.d.ts +1 -1
- package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_GP50.d.ts +3 -0
- package/dist/components/robots/Yaskawa_GP50.d.ts.map +1 -0
- package/dist/components/wandelscript-editor/WandelscriptEditor.d.ts +2 -2
- package/dist/components/wandelscript-editor/WandelscriptEditor.d.ts.map +1 -1
- package/dist/index.cjs +28 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13873 -13534
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/robots/SupportedRobot.tsx +4 -0
- package/src/components/robots/Yaskawa_GP50.tsx +252 -0
- package/src/components/wandelscript-editor/WandelscriptEditor.tsx +28 -29
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ import { Yaskawa_AR1440 } from "./Yaskawa_AR1440"
|
|
|
11
11
|
import { Yaskawa_AR1730 } from "./Yaskawa_AR1730"
|
|
12
12
|
import { Yaskawa_AR2010 } from "./Yaskawa_AR2010"
|
|
13
13
|
import { Yaskawa_AR3120 } from "./Yaskawa_AR3120"
|
|
14
|
+
import { Yaskawa_GP50 } from "./Yaskawa_GP50"
|
|
14
15
|
import { FANUC_CRX10iA } from "./FANUC_CRX10iA"
|
|
15
16
|
import { FANUC_CRX20iAL } from "./FANUC_CRX20iAL"
|
|
16
17
|
import { FANUC_CRX25iA } from "./FANUC_CRX25iA"
|
|
@@ -205,6 +206,9 @@ export const SupportedRobot = externalizeComponent(
|
|
|
205
206
|
case "Yaskawa_AR3120":
|
|
206
207
|
Robot = Yaskawa_AR3120
|
|
207
208
|
break
|
|
209
|
+
case "Yaskawa_GP50":
|
|
210
|
+
Robot = Yaskawa_GP50
|
|
211
|
+
break
|
|
208
212
|
case "FANUC_CRX10iA":
|
|
209
213
|
Robot = FANUC_CRX10iA
|
|
210
214
|
break
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { useGLTF } from "@react-three/drei"
|
|
2
|
+
import type * as THREE from "three"
|
|
3
|
+
import type { RobotProps } from "./SupportedRobot"
|
|
4
|
+
import RobotAnimator from "./RobotAnimator"
|
|
5
|
+
import { animated } from "@react-spring/three"
|
|
6
|
+
|
|
7
|
+
export function Yaskawa_GP50({
|
|
8
|
+
modelURL,
|
|
9
|
+
rapidlyChangingMotionState,
|
|
10
|
+
...props
|
|
11
|
+
}: RobotProps) {
|
|
12
|
+
const gltf = useGLTF(modelURL) as any
|
|
13
|
+
|
|
14
|
+
const nodes = gltf.nodes
|
|
15
|
+
const materials = gltf.materials
|
|
16
|
+
const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
|
|
17
|
+
const rotationSign = [1, 1, 1, 1, 1, 1]
|
|
18
|
+
|
|
19
|
+
function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
|
|
20
|
+
jointObjects.forEach(
|
|
21
|
+
(object, index) =>
|
|
22
|
+
(object.rotation.y =
|
|
23
|
+
rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
<RobotAnimator
|
|
30
|
+
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
31
|
+
robotRootObjectName="Scene"
|
|
32
|
+
onRotationChanged={setRotation}
|
|
33
|
+
/>
|
|
34
|
+
<group {...props} dispose={null}>
|
|
35
|
+
<group name="Scene">
|
|
36
|
+
<group name="link_0">
|
|
37
|
+
<mesh
|
|
38
|
+
name="shape439"
|
|
39
|
+
castShadow
|
|
40
|
+
receiveShadow
|
|
41
|
+
geometry={nodes.shape439.geometry}
|
|
42
|
+
material={materials.yaskawa_blue}
|
|
43
|
+
/>
|
|
44
|
+
<mesh
|
|
45
|
+
name="shape439_1"
|
|
46
|
+
castShadow
|
|
47
|
+
receiveShadow
|
|
48
|
+
geometry={nodes.shape439_1.geometry}
|
|
49
|
+
material={materials.yaskawa_metalsilver}
|
|
50
|
+
/>
|
|
51
|
+
<mesh
|
|
52
|
+
name="shape439_2"
|
|
53
|
+
castShadow
|
|
54
|
+
receiveShadow
|
|
55
|
+
geometry={nodes.shape439_2.geometry}
|
|
56
|
+
material={materials.yaskawa_black}
|
|
57
|
+
/>
|
|
58
|
+
</group>
|
|
59
|
+
<animated.group name="YASKAWA_GP50_J00" position={[0, -0.54, 0]}>
|
|
60
|
+
<group name="link_1" position={[0, 0.54, 0]}>
|
|
61
|
+
<mesh
|
|
62
|
+
name="shape320"
|
|
63
|
+
castShadow
|
|
64
|
+
receiveShadow
|
|
65
|
+
geometry={nodes.shape320.geometry}
|
|
66
|
+
material={materials.yaskawa_blue}
|
|
67
|
+
/>
|
|
68
|
+
<mesh
|
|
69
|
+
name="shape320_1"
|
|
70
|
+
castShadow
|
|
71
|
+
receiveShadow
|
|
72
|
+
geometry={nodes.shape320_1.geometry}
|
|
73
|
+
material={materials.yaskawa_black}
|
|
74
|
+
/>
|
|
75
|
+
<mesh
|
|
76
|
+
name="shape320_2"
|
|
77
|
+
castShadow
|
|
78
|
+
receiveShadow
|
|
79
|
+
geometry={nodes.shape320_2.geometry}
|
|
80
|
+
material={materials.yaskawa_metalsilver}
|
|
81
|
+
/>
|
|
82
|
+
<mesh
|
|
83
|
+
name="shape320_3"
|
|
84
|
+
castShadow
|
|
85
|
+
receiveShadow
|
|
86
|
+
geometry={nodes.shape320_3.geometry}
|
|
87
|
+
material={materials.yaskawa_black}
|
|
88
|
+
/>
|
|
89
|
+
<mesh
|
|
90
|
+
name="shape320_4"
|
|
91
|
+
castShadow
|
|
92
|
+
receiveShadow
|
|
93
|
+
geometry={nodes.shape320_4.geometry}
|
|
94
|
+
material={materials.yaskawa_white}
|
|
95
|
+
/>
|
|
96
|
+
<mesh
|
|
97
|
+
name="shape320_5"
|
|
98
|
+
castShadow
|
|
99
|
+
receiveShadow
|
|
100
|
+
geometry={nodes.shape320_5.geometry}
|
|
101
|
+
material={materials.yaskawa_black}
|
|
102
|
+
/>
|
|
103
|
+
</group>
|
|
104
|
+
<animated.group
|
|
105
|
+
name="YASKAWA_GP50_J01"
|
|
106
|
+
position={[0.145, 0.54, 0]}
|
|
107
|
+
rotation={[-Math.PI / 2, -Math.PI / 2, 0]}
|
|
108
|
+
>
|
|
109
|
+
<group
|
|
110
|
+
name="link_2"
|
|
111
|
+
position={[0, 0, 0.145]}
|
|
112
|
+
rotation={[Math.PI / 2, 0, -Math.PI / 2]}
|
|
113
|
+
>
|
|
114
|
+
<mesh
|
|
115
|
+
name="shape440"
|
|
116
|
+
castShadow
|
|
117
|
+
receiveShadow
|
|
118
|
+
geometry={nodes.shape440.geometry}
|
|
119
|
+
material={materials.yaskawa_blue}
|
|
120
|
+
/>
|
|
121
|
+
<mesh
|
|
122
|
+
name="shape440_1"
|
|
123
|
+
castShadow
|
|
124
|
+
receiveShadow
|
|
125
|
+
geometry={nodes.shape440_1.geometry}
|
|
126
|
+
material={materials.yaskawa_white}
|
|
127
|
+
/>
|
|
128
|
+
<mesh
|
|
129
|
+
name="shape440_2"
|
|
130
|
+
castShadow
|
|
131
|
+
receiveShadow
|
|
132
|
+
geometry={nodes.shape440_2.geometry}
|
|
133
|
+
material={materials.yaskawa_metalsilver}
|
|
134
|
+
/>
|
|
135
|
+
<mesh
|
|
136
|
+
name="shape440_3"
|
|
137
|
+
castShadow
|
|
138
|
+
receiveShadow
|
|
139
|
+
geometry={nodes.shape440_3.geometry}
|
|
140
|
+
material={materials.yaskawa_black}
|
|
141
|
+
/>
|
|
142
|
+
</group>
|
|
143
|
+
<animated.group
|
|
144
|
+
name="YASKAWA_GP50_J02"
|
|
145
|
+
position={[0.87, 0, 0]}
|
|
146
|
+
rotation={[-Math.PI, 0, 0]}
|
|
147
|
+
>
|
|
148
|
+
<group
|
|
149
|
+
name="link_3"
|
|
150
|
+
position={[-0.87, 0, -0.145]}
|
|
151
|
+
rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
|
|
152
|
+
>
|
|
153
|
+
<mesh
|
|
154
|
+
name="shape341"
|
|
155
|
+
castShadow
|
|
156
|
+
receiveShadow
|
|
157
|
+
geometry={nodes.shape341.geometry}
|
|
158
|
+
material={materials.yaskawa_blue}
|
|
159
|
+
/>
|
|
160
|
+
<mesh
|
|
161
|
+
name="shape341_1"
|
|
162
|
+
castShadow
|
|
163
|
+
receiveShadow
|
|
164
|
+
geometry={nodes.shape341_1.geometry}
|
|
165
|
+
material={materials.yaskawa_white}
|
|
166
|
+
/>
|
|
167
|
+
<mesh
|
|
168
|
+
name="shape341_2"
|
|
169
|
+
castShadow
|
|
170
|
+
receiveShadow
|
|
171
|
+
geometry={nodes.shape341_2.geometry}
|
|
172
|
+
material={materials.yaskawa_black}
|
|
173
|
+
/>
|
|
174
|
+
<mesh
|
|
175
|
+
name="shape341_3"
|
|
176
|
+
castShadow
|
|
177
|
+
receiveShadow
|
|
178
|
+
geometry={nodes.shape341_3.geometry}
|
|
179
|
+
material={materials.yaskawa_black}
|
|
180
|
+
/>
|
|
181
|
+
<mesh
|
|
182
|
+
name="shape341_4"
|
|
183
|
+
castShadow
|
|
184
|
+
receiveShadow
|
|
185
|
+
geometry={nodes.shape341_4.geometry}
|
|
186
|
+
material={materials.yaskawa_metalsilver}
|
|
187
|
+
/>
|
|
188
|
+
<mesh
|
|
189
|
+
name="shape341_5"
|
|
190
|
+
castShadow
|
|
191
|
+
receiveShadow
|
|
192
|
+
geometry={nodes.shape341_5.geometry}
|
|
193
|
+
material={materials.yaskawa_metalsilver}
|
|
194
|
+
/>
|
|
195
|
+
</group>
|
|
196
|
+
<animated.group
|
|
197
|
+
name="YASKAWA_GP50_J03"
|
|
198
|
+
position={[0.21, 0, 0]}
|
|
199
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
200
|
+
>
|
|
201
|
+
<mesh
|
|
202
|
+
name="link_4"
|
|
203
|
+
castShadow
|
|
204
|
+
receiveShadow
|
|
205
|
+
geometry={nodes.link_4.geometry}
|
|
206
|
+
material={materials.yaskawa_blue}
|
|
207
|
+
position={[-1.08, 0.145, 0]}
|
|
208
|
+
rotation={[0, 0, -Math.PI / 2]}
|
|
209
|
+
/>
|
|
210
|
+
<animated.group
|
|
211
|
+
name="YASKAWA_GP50_J04"
|
|
212
|
+
position={[0, -1.025, 0]}
|
|
213
|
+
rotation={[Math.PI / 2, 0, 0]}
|
|
214
|
+
>
|
|
215
|
+
<mesh
|
|
216
|
+
name="link_5"
|
|
217
|
+
castShadow
|
|
218
|
+
receiveShadow
|
|
219
|
+
geometry={nodes.link_5.geometry}
|
|
220
|
+
material={materials.yaskawa_blue}
|
|
221
|
+
position={[-1.08, 0, -1.17]}
|
|
222
|
+
rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
|
|
223
|
+
/>
|
|
224
|
+
<animated.group
|
|
225
|
+
name="YASKAWA_GP50_J05"
|
|
226
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
227
|
+
>
|
|
228
|
+
<mesh
|
|
229
|
+
name="link_6"
|
|
230
|
+
castShadow
|
|
231
|
+
receiveShadow
|
|
232
|
+
geometry={nodes.link_6.geometry}
|
|
233
|
+
material={materials.yaskawa_metalsilver}
|
|
234
|
+
position={[-1.08, 1.17, 0]}
|
|
235
|
+
rotation={[0, 0, -Math.PI / 2]}
|
|
236
|
+
/>
|
|
237
|
+
<group
|
|
238
|
+
name="YASKAWA_GP50_FLG"
|
|
239
|
+
position={[0, -0.175, 0]}
|
|
240
|
+
rotation={[-Math.PI, 0, 0]}
|
|
241
|
+
/>
|
|
242
|
+
</animated.group>
|
|
243
|
+
</animated.group>
|
|
244
|
+
</animated.group>
|
|
245
|
+
</animated.group>
|
|
246
|
+
</animated.group>
|
|
247
|
+
</animated.group>
|
|
248
|
+
</group>
|
|
249
|
+
</group>
|
|
250
|
+
</>
|
|
251
|
+
)
|
|
252
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import type { Monaco } from "@monaco-editor/react"
|
|
2
|
+
import { lazy, Suspense, useRef, useState } from "react"
|
|
3
3
|
import type { BundledLanguage, HighlighterGeneric } from "shiki"
|
|
4
|
-
import {
|
|
5
|
-
import { shikiToMonaco } from "@shikijs/monaco"
|
|
4
|
+
import type { BundledTheme } from "shiki"
|
|
6
5
|
|
|
7
6
|
import wandelscriptTextmateGrammar from "./wandelscript.tmLanguage"
|
|
8
7
|
import { useTheme } from "@mui/material"
|
|
9
8
|
import type { editor } from "monaco-editor"
|
|
10
9
|
import { externalizeComponent } from "../../externalizeComponent"
|
|
10
|
+
import { LoadingCover } from "../LoadingCover"
|
|
11
11
|
|
|
12
12
|
type WandelscriptEditorProps = {
|
|
13
13
|
/** The current Wandelscript content of the code editor (controlled component) */
|
|
@@ -26,20 +26,24 @@ type WandelscriptEditorProps = {
|
|
|
26
26
|
/** A Monaco (VSCode-style) embedded code editor with Wandelscript syntax highlighting */
|
|
27
27
|
export const WandelscriptEditor = externalizeComponent(
|
|
28
28
|
(props: WandelscriptEditorProps) => {
|
|
29
|
-
const monaco = useMonaco()
|
|
30
29
|
const theme = useTheme()
|
|
31
30
|
const shikiHighlighterRef = useRef<HighlighterGeneric<
|
|
32
31
|
BundledLanguage,
|
|
33
32
|
BundledTheme
|
|
34
33
|
> | null>(null)
|
|
35
|
-
|
|
36
34
|
const [activeShikiTheme, setActiveShikiTheme] =
|
|
37
35
|
useState<BundledTheme>("dark-plus")
|
|
38
|
-
|
|
39
36
|
const targetShikiTheme =
|
|
40
37
|
theme.palette.mode === "dark" ? "dark-plus" : "light-plus"
|
|
41
38
|
|
|
39
|
+
const Editor = lazy(() => import("@monaco-editor/react"))
|
|
40
|
+
|
|
42
41
|
async function setupEditor(monaco: Monaco) {
|
|
42
|
+
const [{ createHighlighter }, { shikiToMonaco }] = await Promise.all([
|
|
43
|
+
import("shiki"),
|
|
44
|
+
import("@shikijs/monaco"),
|
|
45
|
+
])
|
|
46
|
+
|
|
43
47
|
// Register and configure the Wandelscript language
|
|
44
48
|
monaco.languages.register({ id: "wandelscript" })
|
|
45
49
|
|
|
@@ -99,29 +103,24 @@ export const WandelscriptEditor = externalizeComponent(
|
|
|
99
103
|
setActiveShikiTheme(targetShikiTheme)
|
|
100
104
|
}
|
|
101
105
|
|
|
102
|
-
useEffect(() => {
|
|
103
|
-
if (monaco) {
|
|
104
|
-
setupEditor(monaco)
|
|
105
|
-
}
|
|
106
|
-
}, [monaco, targetShikiTheme])
|
|
107
|
-
|
|
108
|
-
if (!monaco) {
|
|
109
|
-
return null
|
|
110
|
-
}
|
|
111
|
-
|
|
112
106
|
return (
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
107
|
+
<Suspense fallback={<LoadingCover />}>
|
|
108
|
+
<Editor
|
|
109
|
+
value={props.code}
|
|
110
|
+
onMount={(_editor, monaco) => {
|
|
111
|
+
setupEditor(monaco)
|
|
112
|
+
}}
|
|
113
|
+
onChange={props.onChange}
|
|
114
|
+
defaultLanguage="wandelscript"
|
|
115
|
+
theme={activeShikiTheme}
|
|
116
|
+
options={{
|
|
117
|
+
minimap: { enabled: false },
|
|
118
|
+
wordWrap: "on",
|
|
119
|
+
automaticLayout: true,
|
|
120
|
+
...props.monacoOptions,
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
</Suspense>
|
|
125
124
|
)
|
|
126
125
|
},
|
|
127
126
|
)
|