@gamelearn/arcade-components 0.2.0 → 0.4.0
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/arcade-render/background/scene-elements/index.js +4 -2
- package/dist/components/arcade-render/element/AnimateElement.js +9 -15
- package/dist/components/arcade-render/element/index.js +15 -5
- package/dist/components/arcade-render/elements-list/index.js +4 -2
- package/dist/components/arcade-render/light/useLight.js +1 -0
- package/dist/components/arcade-render/loading/Loading.js +3 -4
- package/dist/components/arcade-render/loading/LoadingLogic.js +4 -31
- package/dist/components/arcade-render/scene/index.js +8 -8
- package/dist/components/conversational-pro-component/components/scene/Panel.js +0 -8
- package/dist/components/hacker-puzzle-component/components/Area/index.js +150 -0
- package/dist/components/hacker-puzzle-component/components/Feedback/index.js +72 -0
- package/dist/components/hacker-puzzle-component/components/KonvaMapper/index.js +230 -0
- package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +429 -0
- package/dist/components/{pikachu-component → hanged-puzzle-component}/index.js +2 -2
- package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +54 -0
- package/dist/components/hanged-puzzle-component/utils.js +36 -0
- package/dist/components/image-click-puzzle-component/components/ImageClickPuzzleComponent.js +23 -0
- package/dist/components/image-click-puzzle-component/index.js +13 -0
- package/dist/components/image-click-puzzle-component/mocks/mockForStory.js +423 -0
- package/dist/components/image-click-wrapper-component/components/Area/index.js +150 -0
- package/dist/components/image-click-wrapper-component/components/Feedback/index.js +51 -0
- package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +351 -0
- package/dist/components/image-click-wrapper-component/components/KonvaMapper/index.js +230 -0
- package/dist/components/image-click-wrapper-component/index.js +13 -0
- package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +307 -0
- package/dist/components/index.js +16 -0
- package/dist/helpers/useGLB.js +9 -22
- package/package.json +16 -3
- package/dist/components/pikachu-component/components/PikachuComponent.js +0 -24
- package/dist/components/pikachu-component/mocks/mockForStory.js +0 -15
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.mockProps4 = exports.mockProps3 = exports.mockProps2 = exports.mockProps = void 0;
|
|
7
|
+
|
|
8
|
+
var emitEvent = function emitEvent() {
|
|
9
|
+
console.log('Emit event called');
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
var soundActions = [function (sound) {
|
|
13
|
+
console.log('PlaySound called :', sound);
|
|
14
|
+
}, function () {}];
|
|
15
|
+
var mockProps = {
|
|
16
|
+
emitEvent: emitEvent,
|
|
17
|
+
disableExit: function disableExit() {},
|
|
18
|
+
setResolveAction: function setResolveAction() {},
|
|
19
|
+
soundActions: soundActions,
|
|
20
|
+
transitionEffects: null,
|
|
21
|
+
audioId: '',
|
|
22
|
+
itemOrder: 1,
|
|
23
|
+
info: {
|
|
24
|
+
hint: {
|
|
25
|
+
active: true,
|
|
26
|
+
desc: 'hint',
|
|
27
|
+
rewards: []
|
|
28
|
+
},
|
|
29
|
+
resolve: {
|
|
30
|
+
rewards: []
|
|
31
|
+
},
|
|
32
|
+
solution: {
|
|
33
|
+
right: {
|
|
34
|
+
desc: 'correctSolution',
|
|
35
|
+
desc_labelId: 'alfalfa01',
|
|
36
|
+
rewards: []
|
|
37
|
+
},
|
|
38
|
+
wrong: {
|
|
39
|
+
desc: 'wrongSolution',
|
|
40
|
+
desc_labelId: 'fabada01',
|
|
41
|
+
rewards: [{
|
|
42
|
+
id: 'grade',
|
|
43
|
+
name: 'grade',
|
|
44
|
+
points: -17,
|
|
45
|
+
type: 'grade'
|
|
46
|
+
}]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
instructions: 'instructions'
|
|
50
|
+
},
|
|
51
|
+
image: {
|
|
52
|
+
imgName: 'gato5.jpg',
|
|
53
|
+
img: {
|
|
54
|
+
url: 'https://min.gamelearn.io/css-resources/gamelearn/resources/image-click.jpg',
|
|
55
|
+
imgName: 'gato5.jpg',
|
|
56
|
+
resourceId: '6007f80eac41ad001120f135'
|
|
57
|
+
},
|
|
58
|
+
width: 1280,
|
|
59
|
+
height: 720
|
|
60
|
+
},
|
|
61
|
+
areas: [{
|
|
62
|
+
id: '1601910616179',
|
|
63
|
+
name: 'a',
|
|
64
|
+
x: 0,
|
|
65
|
+
y: 0,
|
|
66
|
+
draggable: true,
|
|
67
|
+
points: [74.1584158415841, 423.99133663366337, 229.20792079207916, 366.96163366336634, 516.1386138613861, 482.8032178217822, 644.4554455445544, 710.9220297029703, 56.33663366336629, 712.7042079207921],
|
|
68
|
+
strokeWidth: 2,
|
|
69
|
+
stroke: '#44d7ab',
|
|
70
|
+
fill: 'rgba(68, 215, 171, 0.56)',
|
|
71
|
+
closed: true
|
|
72
|
+
}, {
|
|
73
|
+
id: '1601910626254',
|
|
74
|
+
name: 'b',
|
|
75
|
+
x: 0,
|
|
76
|
+
y: 0,
|
|
77
|
+
draggable: true,
|
|
78
|
+
points: [607.0297029702971, 343.79331683168317, 783.4653465346535, 388.3477722772277, 865.4455445544554, 539.8329207920792, 1138.118811881188, 593.2982673267327, 1262.871287128713, 358.0507425742574, 1262.871287128713, 46.16955445544554, 1193.3663366336634, 12.308168316831683, 1018.7128712871288, 19.43688118811881, 746.0396039603961, 213.69430693069307, 555.3465346534654, 268.94183168316835],
|
|
79
|
+
strokeWidth: 2,
|
|
80
|
+
stroke: '#44d7ab',
|
|
81
|
+
fill: 'rgba(68, 215, 171, 0.56)',
|
|
82
|
+
closed: true
|
|
83
|
+
}],
|
|
84
|
+
badAreas: [],
|
|
85
|
+
hasClickOrder: true,
|
|
86
|
+
hasHighlights: true
|
|
87
|
+
};
|
|
88
|
+
exports.mockProps = mockProps;
|
|
89
|
+
var mockProps2 = {
|
|
90
|
+
emitEvent: emitEvent,
|
|
91
|
+
disableExit: function disableExit() {},
|
|
92
|
+
setResolveAction: function setResolveAction() {},
|
|
93
|
+
transitionEffects: null,
|
|
94
|
+
audioId: '',
|
|
95
|
+
itemOrder: 1,
|
|
96
|
+
info: {
|
|
97
|
+
hint: {
|
|
98
|
+
active: true,
|
|
99
|
+
desc: 'hint',
|
|
100
|
+
rewards: []
|
|
101
|
+
},
|
|
102
|
+
resolve: {
|
|
103
|
+
rewards: []
|
|
104
|
+
},
|
|
105
|
+
solution: {
|
|
106
|
+
right: {
|
|
107
|
+
desc: 'correctSolution',
|
|
108
|
+
desc_labelId: 'alfalfa01',
|
|
109
|
+
rewards: []
|
|
110
|
+
},
|
|
111
|
+
wrong: {
|
|
112
|
+
desc: 'wrongSolution',
|
|
113
|
+
desc_labelId: 'fabada01',
|
|
114
|
+
rewards: [{
|
|
115
|
+
id: 'grade',
|
|
116
|
+
name: 'grade',
|
|
117
|
+
points: -17,
|
|
118
|
+
type: 'grade'
|
|
119
|
+
}]
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
instructions: 'instructions'
|
|
123
|
+
},
|
|
124
|
+
image: {
|
|
125
|
+
imgName: 'gato5.jpg',
|
|
126
|
+
img: {
|
|
127
|
+
url: 'https://min.gamelearn.io/css-resources/gamelearn/resources/image-click.jpg',
|
|
128
|
+
imgName: 'gato5.jpg',
|
|
129
|
+
resourceId: '6007f80eac41ad001120f135'
|
|
130
|
+
},
|
|
131
|
+
width: 1280,
|
|
132
|
+
height: 720
|
|
133
|
+
},
|
|
134
|
+
areas: [{
|
|
135
|
+
id: '1601910616179',
|
|
136
|
+
name: 'a',
|
|
137
|
+
x: 0,
|
|
138
|
+
y: 0,
|
|
139
|
+
draggable: true,
|
|
140
|
+
points: [74.1584158415841, 423.99133663366337, 229.20792079207916, 366.96163366336634, 516.1386138613861, 482.8032178217822, 644.4554455445544, 710.9220297029703, 56.33663366336629, 712.7042079207921],
|
|
141
|
+
strokeWidth: 2,
|
|
142
|
+
stroke: '#44d7ab',
|
|
143
|
+
fill: 'rgba(68, 215, 171, 0.56)',
|
|
144
|
+
closed: true
|
|
145
|
+
}, {
|
|
146
|
+
id: '1601910626254',
|
|
147
|
+
name: 'b',
|
|
148
|
+
x: 0,
|
|
149
|
+
y: 0,
|
|
150
|
+
draggable: true,
|
|
151
|
+
points: [607.0297029702971, 343.79331683168317, 783.4653465346535, 388.3477722772277, 865.4455445544554, 539.8329207920792, 1138.118811881188, 593.2982673267327, 1262.871287128713, 358.0507425742574, 1262.871287128713, 46.16955445544554, 1193.3663366336634, 12.308168316831683, 1018.7128712871288, 19.43688118811881, 746.0396039603961, 213.69430693069307, 555.3465346534654, 268.94183168316835],
|
|
152
|
+
strokeWidth: 2,
|
|
153
|
+
stroke: '#44d7ab',
|
|
154
|
+
fill: 'rgba(68, 215, 171, 0.56)',
|
|
155
|
+
closed: true
|
|
156
|
+
}],
|
|
157
|
+
badAreas: [],
|
|
158
|
+
hasClickOrder: true,
|
|
159
|
+
hasHighlights: false
|
|
160
|
+
};
|
|
161
|
+
exports.mockProps2 = mockProps2;
|
|
162
|
+
var mockProps3 = {
|
|
163
|
+
emitEvent: emitEvent,
|
|
164
|
+
disableExit: function disableExit() {},
|
|
165
|
+
setResolveAction: function setResolveAction() {},
|
|
166
|
+
transitionEffects: null,
|
|
167
|
+
audioId: '',
|
|
168
|
+
itemOrder: 1,
|
|
169
|
+
info: {
|
|
170
|
+
hint: {
|
|
171
|
+
active: true,
|
|
172
|
+
desc: 'hint',
|
|
173
|
+
rewards: []
|
|
174
|
+
},
|
|
175
|
+
resolve: {
|
|
176
|
+
rewards: []
|
|
177
|
+
},
|
|
178
|
+
solution: {
|
|
179
|
+
right: {
|
|
180
|
+
desc: 'correctSolution',
|
|
181
|
+
desc_labelId: 'alfalfa01',
|
|
182
|
+
rewards: []
|
|
183
|
+
},
|
|
184
|
+
wrong: {
|
|
185
|
+
desc: 'wrongSolution',
|
|
186
|
+
desc_labelId: 'fabada01',
|
|
187
|
+
rewards: [{
|
|
188
|
+
id: 'grade',
|
|
189
|
+
name: 'grade',
|
|
190
|
+
points: -17,
|
|
191
|
+
type: 'grade'
|
|
192
|
+
}]
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
instructions: 'instructions'
|
|
196
|
+
},
|
|
197
|
+
image: {
|
|
198
|
+
imgName: 'gato5.jpg',
|
|
199
|
+
img: {
|
|
200
|
+
url: 'https://min.gamelearn.io/css-resources/gamelearn/resources/image-click.jpg',
|
|
201
|
+
imgName: 'gato5.jpg',
|
|
202
|
+
resourceId: '6007f80eac41ad001120f135'
|
|
203
|
+
},
|
|
204
|
+
width: 1280,
|
|
205
|
+
height: 720
|
|
206
|
+
},
|
|
207
|
+
areas: [{
|
|
208
|
+
id: '1601910616179',
|
|
209
|
+
name: 'a',
|
|
210
|
+
x: 0,
|
|
211
|
+
y: 0,
|
|
212
|
+
draggable: true,
|
|
213
|
+
points: [74.1584158415841, 423.99133663366337, 229.20792079207916, 366.96163366336634, 516.1386138613861, 482.8032178217822, 644.4554455445544, 710.9220297029703, 56.33663366336629, 712.7042079207921],
|
|
214
|
+
strokeWidth: 2,
|
|
215
|
+
stroke: '#44d7ab',
|
|
216
|
+
fill: 'rgba(68, 215, 171, 0.56)',
|
|
217
|
+
closed: true
|
|
218
|
+
}, {
|
|
219
|
+
id: '1601910626254',
|
|
220
|
+
name: 'b',
|
|
221
|
+
x: 0,
|
|
222
|
+
y: 0,
|
|
223
|
+
draggable: true,
|
|
224
|
+
points: [607.0297029702971, 343.79331683168317, 783.4653465346535, 388.3477722772277, 865.4455445544554, 539.8329207920792, 1138.118811881188, 593.2982673267327, 1262.871287128713, 358.0507425742574, 1262.871287128713, 46.16955445544554, 1193.3663366336634, 12.308168316831683, 1018.7128712871288, 19.43688118811881, 746.0396039603961, 213.69430693069307, 555.3465346534654, 268.94183168316835],
|
|
225
|
+
strokeWidth: 2,
|
|
226
|
+
stroke: '#44d7ab',
|
|
227
|
+
fill: 'rgba(68, 215, 171, 0.56)',
|
|
228
|
+
closed: true
|
|
229
|
+
}],
|
|
230
|
+
badAreas: [],
|
|
231
|
+
hasClickOrder: false,
|
|
232
|
+
hasHighlights: true
|
|
233
|
+
};
|
|
234
|
+
exports.mockProps3 = mockProps3;
|
|
235
|
+
var mockProps4 = {
|
|
236
|
+
emitEvent: emitEvent,
|
|
237
|
+
disableExit: function disableExit() {},
|
|
238
|
+
setResolveAction: function setResolveAction() {},
|
|
239
|
+
transitionEffects: null,
|
|
240
|
+
audioId: '',
|
|
241
|
+
itemOrder: 1,
|
|
242
|
+
info: {
|
|
243
|
+
hint: {
|
|
244
|
+
active: true,
|
|
245
|
+
desc: 'hint',
|
|
246
|
+
rewards: []
|
|
247
|
+
},
|
|
248
|
+
resolve: {
|
|
249
|
+
rewards: []
|
|
250
|
+
},
|
|
251
|
+
solution: {
|
|
252
|
+
right: {
|
|
253
|
+
desc: 'correctSolution',
|
|
254
|
+
desc_labelId: 'alfalfa01',
|
|
255
|
+
rewards: []
|
|
256
|
+
},
|
|
257
|
+
wrong: {
|
|
258
|
+
desc: 'wrongSolution',
|
|
259
|
+
desc_labelId: 'fabada01',
|
|
260
|
+
rewards: [{
|
|
261
|
+
id: 'grade',
|
|
262
|
+
name: 'grade',
|
|
263
|
+
points: -17,
|
|
264
|
+
type: 'grade'
|
|
265
|
+
}]
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
instructions: 'instructions'
|
|
269
|
+
},
|
|
270
|
+
image: {
|
|
271
|
+
imgName: 'gato5.jpg',
|
|
272
|
+
img: {
|
|
273
|
+
url: 'https://min.gamelearn.io/css-resources/gamelearn/resources/image-click.jpg',
|
|
274
|
+
imgName: 'gato5.jpg',
|
|
275
|
+
resourceId: '6007f80eac41ad001120f135'
|
|
276
|
+
},
|
|
277
|
+
width: 1280,
|
|
278
|
+
height: 720
|
|
279
|
+
},
|
|
280
|
+
areas: [{
|
|
281
|
+
id: '1601910616179',
|
|
282
|
+
name: 'a',
|
|
283
|
+
x: 0,
|
|
284
|
+
y: 0,
|
|
285
|
+
draggable: true,
|
|
286
|
+
points: [74.1584158415841, 423.99133663366337, 229.20792079207916, 366.96163366336634, 516.1386138613861, 482.8032178217822, 644.4554455445544, 710.9220297029703, 56.33663366336629, 712.7042079207921],
|
|
287
|
+
strokeWidth: 2,
|
|
288
|
+
stroke: '#44d7ab',
|
|
289
|
+
fill: 'rgba(68, 215, 171, 0.56)',
|
|
290
|
+
closed: true
|
|
291
|
+
}, {
|
|
292
|
+
id: '1601910626254',
|
|
293
|
+
name: 'b',
|
|
294
|
+
x: 0,
|
|
295
|
+
y: 0,
|
|
296
|
+
draggable: true,
|
|
297
|
+
points: [607.0297029702971, 343.79331683168317, 783.4653465346535, 388.3477722772277, 865.4455445544554, 539.8329207920792, 1138.118811881188, 593.2982673267327, 1262.871287128713, 358.0507425742574, 1262.871287128713, 46.16955445544554, 1193.3663366336634, 12.308168316831683, 1018.7128712871288, 19.43688118811881, 746.0396039603961, 213.69430693069307, 555.3465346534654, 268.94183168316835],
|
|
298
|
+
strokeWidth: 2,
|
|
299
|
+
stroke: '#44d7ab',
|
|
300
|
+
fill: 'rgba(68, 215, 171, 0.56)',
|
|
301
|
+
closed: true
|
|
302
|
+
}],
|
|
303
|
+
badAreas: [],
|
|
304
|
+
hasClickOrder: false,
|
|
305
|
+
hasHighlights: false
|
|
306
|
+
};
|
|
307
|
+
exports.mockProps4 = mockProps4;
|
package/dist/components/index.js
CHANGED
|
@@ -113,12 +113,24 @@ Object.defineProperty(exports, "KeyboardPuzzleComponent", {
|
|
|
113
113
|
return _keyboardPuzzleComponent.default;
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
|
+
Object.defineProperty(exports, "ImageClickPuzzleComponent", {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
get: function get() {
|
|
119
|
+
return _imageClickPuzzleComponent.default;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
116
122
|
Object.defineProperty(exports, "CrackerPuzzleComponent", {
|
|
117
123
|
enumerable: true,
|
|
118
124
|
get: function get() {
|
|
119
125
|
return _crackerPuzzleComponent.default;
|
|
120
126
|
}
|
|
121
127
|
});
|
|
128
|
+
Object.defineProperty(exports, "HangedPuzzleComponent", {
|
|
129
|
+
enumerable: true,
|
|
130
|
+
get: function get() {
|
|
131
|
+
return _hangedPuzzleComponent.default;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
122
134
|
|
|
123
135
|
var _scene = _interopRequireDefault(require("./arcade-render/scene"));
|
|
124
136
|
|
|
@@ -154,8 +166,12 @@ var _loginPuzzleComponent = _interopRequireDefault(require("./login-puzzle-compo
|
|
|
154
166
|
|
|
155
167
|
var _keyboardPuzzleComponent = _interopRequireDefault(require("./keyboard-puzzle-component"));
|
|
156
168
|
|
|
169
|
+
var _imageClickPuzzleComponent = _interopRequireDefault(require("./image-click-puzzle-component"));
|
|
170
|
+
|
|
157
171
|
var _crackerPuzzleComponent = _interopRequireDefault(require("./cracker-puzzle-component"));
|
|
158
172
|
|
|
173
|
+
var _hangedPuzzleComponent = _interopRequireDefault(require("./hanged-puzzle-component"));
|
|
174
|
+
|
|
159
175
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
160
176
|
|
|
161
177
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/dist/helpers/useGLB.js
CHANGED
|
@@ -13,40 +13,27 @@ var _DRACOLoader = require("three/examples/jsm/loaders/DRACOLoader");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
// We need this to reuse GLTF and DRACO loaders for Arcade working
|
|
16
|
+
// We need this to reuse GLTF and DRACO loaders for Arcade working
|
|
17
17
|
// in Mobile devices, drei.useGLTF instances new loaders every time is
|
|
18
18
|
// used
|
|
19
19
|
var dracoDecoderPath = 'https://www.gstatic.com/draco/versioned/decoders/1.4.1/'; // TODO: Maybe download those files to statics.gamelearn
|
|
20
20
|
|
|
21
|
-
var whiteImage = new Image();
|
|
22
|
-
whiteImage.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=';
|
|
23
21
|
var dracoLoader = new _DRACOLoader.DRACOLoader();
|
|
24
22
|
var gltfLoader = new _GLTFLoader.GLTFLoader();
|
|
25
23
|
dracoLoader.setDecoderPath(dracoDecoderPath);
|
|
26
24
|
gltfLoader.setDRACOLoader(dracoLoader);
|
|
27
25
|
|
|
28
|
-
var treatGeometry = function treatGeometry(res) {
|
|
29
|
-
res.scene.traverse(function (obj) {
|
|
30
|
-
if (obj.isMesh || obj.isSkinnedMesh) {
|
|
31
|
-
var keys = Object.keys(obj.material);
|
|
32
|
-
keys.forEach(function (key) {
|
|
33
|
-
var value = obj.material[key];
|
|
34
|
-
|
|
35
|
-
if (value && value.isTexture) {
|
|
36
|
-
obj.material[key].image = whiteImage;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
obj.material.needsUpdate = true;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
|
|
44
26
|
var fetchGlb = function fetchGlb(originalUrl) {
|
|
45
|
-
var
|
|
46
|
-
var url =
|
|
27
|
+
var takeGeometry = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
28
|
+
var url = originalUrl;
|
|
29
|
+
|
|
30
|
+
if (takeGeometry) {
|
|
31
|
+
var isTexturableObject = url.includes('/character/') || url.includes('/object/');
|
|
32
|
+
url = isTexturableObject ? url.replace('.glb', '.geometry.glb') : url;
|
|
33
|
+
}
|
|
34
|
+
|
|
47
35
|
return new Promise(function (resolve, reject) {
|
|
48
36
|
gltfLoader.load(url, function (result) {
|
|
49
|
-
treatGeometry(result);
|
|
50
37
|
resolve(result);
|
|
51
38
|
}, null, function (error) {
|
|
52
39
|
return reject(error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamelearn/arcade-components",
|
|
3
|
-
"
|
|
3
|
+
"license": "Gamelearn",
|
|
4
|
+
"version": "0.4.0",
|
|
4
5
|
"main": "dist/index.js",
|
|
5
6
|
"files": [
|
|
6
7
|
"dist",
|
|
@@ -11,13 +12,15 @@
|
|
|
11
12
|
"url": "https://github.com/gamelearn/arcade-components"
|
|
12
13
|
},
|
|
13
14
|
"dependencies": {
|
|
14
|
-
"@react-three/drei": "
|
|
15
|
+
"@react-three/drei": "^5.1.6",
|
|
15
16
|
"@react-three/fiber": "6.0.16",
|
|
16
17
|
"@testing-library/jest-dom": "5.11.4",
|
|
17
18
|
"@testing-library/react": "11.1.0",
|
|
18
19
|
"@testing-library/user-event": "12.1.10",
|
|
19
20
|
"hls.js": "0.12.4",
|
|
21
|
+
"konva": "^7.2.5",
|
|
20
22
|
"prop-types": "15.7.2",
|
|
23
|
+
"react-konva": "^17.0.2-0",
|
|
21
24
|
"react-pdf": "5.2.0",
|
|
22
25
|
"react-promise-suspense": "0.3.3",
|
|
23
26
|
"react-typist": "^2.0.5",
|
|
@@ -33,7 +36,9 @@
|
|
|
33
36
|
"eject": "react-scripts eject",
|
|
34
37
|
"storybook": "start-storybook -p 6006 -s public",
|
|
35
38
|
"build-storybook": "build-storybook -s public",
|
|
36
|
-
"generate": "plop"
|
|
39
|
+
"generate": "plop",
|
|
40
|
+
"postinstall": "husky install",
|
|
41
|
+
"pre-commit": "lint-staged"
|
|
37
42
|
},
|
|
38
43
|
"browserslist": {
|
|
39
44
|
"production": [
|
|
@@ -52,6 +57,7 @@
|
|
|
52
57
|
"@babel/preset-env": "7.12.11",
|
|
53
58
|
"@babel/preset-react": "7.12.10",
|
|
54
59
|
"@gamelearn/ui-components-core": "5.10.1",
|
|
60
|
+
"@gamelearn/version": "^1.0.3",
|
|
55
61
|
"@react-three/test-renderer": "6.0.6",
|
|
56
62
|
"@storybook/addon-actions": "6.1.11",
|
|
57
63
|
"@storybook/addon-essentials": "6.1.11",
|
|
@@ -61,6 +67,8 @@
|
|
|
61
67
|
"@storybook/react": "6.1.11",
|
|
62
68
|
"babel-loader": "8.2.2",
|
|
63
69
|
"cross-env": "7.0.3",
|
|
70
|
+
"husky": "^6.0.0",
|
|
71
|
+
"lint-staged": "^11.0.0",
|
|
64
72
|
"plop": "^2.7.4",
|
|
65
73
|
"react": "0.0.0-experimental-27659559e",
|
|
66
74
|
"react-dom": "0.0.0-experimental-27659559e",
|
|
@@ -71,5 +79,10 @@
|
|
|
71
79
|
"moduleNameMapper": {
|
|
72
80
|
"^react-pdf$": "react-pdf/dist/umd/entry.jest"
|
|
73
81
|
}
|
|
82
|
+
},
|
|
83
|
+
"lint-staged": {
|
|
84
|
+
"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
|
|
85
|
+
"prettier --write"
|
|
86
|
+
]
|
|
74
87
|
}
|
|
75
88
|
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
13
|
-
|
|
14
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
-
|
|
16
|
-
var PikachuComponent = function PikachuComponent(_ref) {
|
|
17
|
-
var emitEvent = _ref.emitEvent,
|
|
18
|
-
props = _objectWithoutProperties(_ref, ["emitEvent"]);
|
|
19
|
-
|
|
20
|
-
return /*#__PURE__*/React.createElement("div", null, "Pikachu Component");
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var _default = PikachuComponent;
|
|
24
|
-
exports.default = _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.mockProps = void 0;
|
|
7
|
-
|
|
8
|
-
var emitEvent = function emitEvent() {
|
|
9
|
-
console.log('Emit event called');
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
var mockProps = {
|
|
13
|
-
emitEvent: emitEvent
|
|
14
|
-
};
|
|
15
|
-
exports.mockProps = mockProps;
|