@gamelearn/arcade-components 0.6.1 → 0.6.3
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/cards-selector-puzzle-component/components/Board/index.js +195 -0
- package/dist/components/cards-selector-puzzle-component/components/Card/index.js +134 -0
- package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +164 -0
- package/dist/components/cards-selector-puzzle-component/components/Feedback/index.js +35 -0
- package/dist/components/cards-selector-puzzle-component/index.js +13 -0
- package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +159 -0
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +1 -1
- package/dist/components/decision-component/components/DecisionBody.js +2 -2
- package/dist/components/frame-click-puzzle-component/components/Counter/index.js +29 -0
- package/dist/components/frame-click-puzzle-component/components/CurrentFramePuzzle.js +121 -0
- package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +174 -0
- package/dist/components/frame-click-puzzle-component/components/PlayButton/index.js +76 -0
- package/dist/components/frame-click-puzzle-component/components/Tooltip/index.js +28 -0
- package/dist/components/frame-click-puzzle-component/index.js +13 -0
- package/dist/components/frame-click-puzzle-component/mocks/mockForStory.js +164 -0
- package/dist/components/image-click-puzzle-component/mocks/mockForStory.js +7 -0
- package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +11 -60
- package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +3 -0
- package/dist/components/index.js +8 -0
- package/package.json +3 -3
|
@@ -0,0 +1,164 @@
|
|
|
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 soundActions = [function (sound) {
|
|
13
|
+
console.log('PlaySound called :', sound);
|
|
14
|
+
}, function () {}];
|
|
15
|
+
var mockProps = {
|
|
16
|
+
nodeId: 'xxas',
|
|
17
|
+
description: 'Dale al arma',
|
|
18
|
+
isFrame: true,
|
|
19
|
+
showFrames: true,
|
|
20
|
+
setInfo: function setInfo() {},
|
|
21
|
+
emitEvent: emitEvent,
|
|
22
|
+
soundActions: soundActions,
|
|
23
|
+
disableExit: function disableExit() {},
|
|
24
|
+
setResolveAction: function setResolveAction() {},
|
|
25
|
+
list: [{
|
|
26
|
+
info: {
|
|
27
|
+
hint: {
|
|
28
|
+
active: true,
|
|
29
|
+
desc: 'hint',
|
|
30
|
+
rewards: []
|
|
31
|
+
},
|
|
32
|
+
resolve: {
|
|
33
|
+
rewards: []
|
|
34
|
+
},
|
|
35
|
+
solution: {
|
|
36
|
+
right: {
|
|
37
|
+
desc: 'Estupendo',
|
|
38
|
+
desc_labelId: 'alfalfa01',
|
|
39
|
+
rewards: []
|
|
40
|
+
},
|
|
41
|
+
wrong: {
|
|
42
|
+
desc: 'BUUUU',
|
|
43
|
+
desc_labelId: 'fabada01',
|
|
44
|
+
rewards: [{
|
|
45
|
+
id: 'grade',
|
|
46
|
+
name: 'grade',
|
|
47
|
+
points: -17,
|
|
48
|
+
type: 'grade'
|
|
49
|
+
}]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
instructions: 'instructions'
|
|
53
|
+
},
|
|
54
|
+
itemOrder: 1,
|
|
55
|
+
image: {
|
|
56
|
+
imgName: 'Paz-Vizla-Concept.png',
|
|
57
|
+
img: {
|
|
58
|
+
url: 'https://gl-lms-storage.s3-eu-west-1.amazonaws.com/development/clients/58dccfba26561500117caf53/image/609a9b30901f3e001247c031/Paz-Vizla-Concept.png',
|
|
59
|
+
imgName: 'Paz-Vizla-Concept.png',
|
|
60
|
+
resourceId: '609a9b30901f3e001247c031'
|
|
61
|
+
},
|
|
62
|
+
width: 1920,
|
|
63
|
+
height: 1097
|
|
64
|
+
},
|
|
65
|
+
areas: [{
|
|
66
|
+
name: 'Uno',
|
|
67
|
+
x: 0,
|
|
68
|
+
y: 0,
|
|
69
|
+
fill: 'rgba(255, 255, 255, 0.1)',
|
|
70
|
+
draggable: true,
|
|
71
|
+
points: [1150.0742574257429, 217.48228650990103, 1570.95297029703, 65.42288056930694, 1704.0049504950498, 195.7595142326733, 1576.383663366337, 421.13327660891093, 1247.8267326732675, 510.73971225247533],
|
|
72
|
+
stroke: 'rgb(101,154,93)',
|
|
73
|
+
closed: true
|
|
74
|
+
}],
|
|
75
|
+
badAreas: [{
|
|
76
|
+
id: 'AllArea',
|
|
77
|
+
name: 'BadArea',
|
|
78
|
+
x: 0,
|
|
79
|
+
y: 0,
|
|
80
|
+
fill: 'rgba(255, 255, 255, 0.1)',
|
|
81
|
+
draggable: true,
|
|
82
|
+
points: [0, 0, 1920, 0, 1920, 1097, 0, 1097, 0, 0],
|
|
83
|
+
stroke: '#ff634d',
|
|
84
|
+
strokeWidth: 2,
|
|
85
|
+
closed: true
|
|
86
|
+
}],
|
|
87
|
+
hasClickOrder: false,
|
|
88
|
+
hasHighlights: true
|
|
89
|
+
}, {
|
|
90
|
+
info: {
|
|
91
|
+
hint: {
|
|
92
|
+
active: true,
|
|
93
|
+
desc: 'hint',
|
|
94
|
+
rewards: []
|
|
95
|
+
},
|
|
96
|
+
resolve: {
|
|
97
|
+
rewards: []
|
|
98
|
+
},
|
|
99
|
+
solution: {
|
|
100
|
+
right: {
|
|
101
|
+
desc: 'Estupendo',
|
|
102
|
+
desc_labelId: 'alfalfa01',
|
|
103
|
+
rewards: []
|
|
104
|
+
},
|
|
105
|
+
wrong: {
|
|
106
|
+
desc: 'BUUUU',
|
|
107
|
+
desc_labelId: 'fabada01',
|
|
108
|
+
rewards: [{
|
|
109
|
+
id: 'grade',
|
|
110
|
+
name: 'grade',
|
|
111
|
+
points: -17,
|
|
112
|
+
type: 'grade'
|
|
113
|
+
}]
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
instructions: 'instructions'
|
|
117
|
+
},
|
|
118
|
+
itemOrder: 2,
|
|
119
|
+
image: {
|
|
120
|
+
imgName: 'pablo-carpio-slave2.jpeg',
|
|
121
|
+
img: {
|
|
122
|
+
url: 'https://gl-lms-storage.s3-eu-west-1.amazonaws.com/development/clients/58dccfba26561500117caf53/image/609e3d358782ea00116a7eee/pablo-carpio-slave2.jpeg',
|
|
123
|
+
imgName: 'Paz-Vizla-Concept.png',
|
|
124
|
+
resourceId: '609e3d358782ea00116a7eee'
|
|
125
|
+
},
|
|
126
|
+
width: 1920,
|
|
127
|
+
height: 1099
|
|
128
|
+
},
|
|
129
|
+
areas: [{
|
|
130
|
+
name: 'Uno',
|
|
131
|
+
x: 0,
|
|
132
|
+
y: 0,
|
|
133
|
+
fill: 'rgba(68, 215, 171, 0.56)',
|
|
134
|
+
draggable: true,
|
|
135
|
+
points: [1305.4777227722775, 606.8812654702971, 1455.094059405941, 593.2797803217823, 1463.2549504950498, 941.4778001237626, 1346.282178217822, 1012.2055228960397, 1275.5544554455448, 906.1139387376239],
|
|
136
|
+
stroke: 'rgb(101,154,93)',
|
|
137
|
+
closed: true
|
|
138
|
+
}, {
|
|
139
|
+
name: 'Dos',
|
|
140
|
+
x: 0,
|
|
141
|
+
y: 0,
|
|
142
|
+
fill: 'rgba(68, 215, 171, 0.56)',
|
|
143
|
+
draggable: true,
|
|
144
|
+
points: [171.1138613861387, 506.23027537128723, 312.5693069306932, 519.8317605198021, 304.4084158415843, 593.2797803217823, 157.51237623762387, 585.1188892326734],
|
|
145
|
+
stroke: 'rgb(101,154,93)',
|
|
146
|
+
closed: true
|
|
147
|
+
}],
|
|
148
|
+
badAreas: [{
|
|
149
|
+
id: 'AllArea',
|
|
150
|
+
name: 'BadArea',
|
|
151
|
+
x: 0,
|
|
152
|
+
y: 0,
|
|
153
|
+
fill: 'rgba(255, 255, 255, 0.1)',
|
|
154
|
+
draggable: true,
|
|
155
|
+
points: [0, 0, 1920, 0, 1920, 1099, 0, 1099, 0, 0],
|
|
156
|
+
stroke: '#ff634d',
|
|
157
|
+
strokeWidth: 2,
|
|
158
|
+
closed: true
|
|
159
|
+
}],
|
|
160
|
+
hasClickOrder: true,
|
|
161
|
+
hasHighlights: true
|
|
162
|
+
}]
|
|
163
|
+
};
|
|
164
|
+
exports.mockProps = mockProps;
|
|
@@ -9,8 +9,12 @@ var emitEvent = function emitEvent() {
|
|
|
9
9
|
console.log('Emit event called');
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
var soundActions = [function (sound) {
|
|
13
|
+
console.log('PlaySound called :', sound);
|
|
14
|
+
}, function () {}];
|
|
12
15
|
var mockProps = {
|
|
13
16
|
emitEvent: emitEvent,
|
|
17
|
+
soundActions: soundActions,
|
|
14
18
|
disableExit: function disableExit() {},
|
|
15
19
|
setResolveAction: function setResolveAction() {},
|
|
16
20
|
info: {
|
|
@@ -114,6 +118,7 @@ var mockProps = {
|
|
|
114
118
|
exports.mockProps = mockProps;
|
|
115
119
|
var mockProps2 = {
|
|
116
120
|
emitEvent: emitEvent,
|
|
121
|
+
soundActions: soundActions,
|
|
117
122
|
disableExit: function disableExit() {},
|
|
118
123
|
setResolveAction: function setResolveAction() {},
|
|
119
124
|
info: {
|
|
@@ -217,6 +222,7 @@ var mockProps2 = {
|
|
|
217
222
|
exports.mockProps2 = mockProps2;
|
|
218
223
|
var mockProps3 = {
|
|
219
224
|
emitEvent: emitEvent,
|
|
225
|
+
soundActions: soundActions,
|
|
220
226
|
disableExit: function disableExit() {},
|
|
221
227
|
setResolveAction: function setResolveAction() {},
|
|
222
228
|
info: {
|
|
@@ -320,6 +326,7 @@ var mockProps3 = {
|
|
|
320
326
|
exports.mockProps3 = mockProps3;
|
|
321
327
|
var mockProps4 = {
|
|
322
328
|
emitEvent: emitEvent,
|
|
329
|
+
soundActions: soundActions,
|
|
323
330
|
disableExit: function disableExit() {},
|
|
324
331
|
setResolveAction: function setResolveAction() {},
|
|
325
332
|
info: {
|
package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js
CHANGED
|
@@ -9,8 +9,6 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
12
|
var _KonvaMapper = _interopRequireDefault(require("./KonvaMapper"));
|
|
15
13
|
|
|
16
14
|
var _Feedback = _interopRequireDefault(require("./Feedback"));
|
|
@@ -230,6 +228,16 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
|
|
|
230
228
|
}
|
|
231
229
|
};
|
|
232
230
|
|
|
231
|
+
var handleOncloseWrongFeedback = (0, _react.useCallback)(function () {
|
|
232
|
+
setShowWrongFeedback(false);
|
|
233
|
+
!!emitEvent && emitEvent({
|
|
234
|
+
type: 'addPoints',
|
|
235
|
+
payload: solution.wrong.rewards,
|
|
236
|
+
finish: false
|
|
237
|
+
});
|
|
238
|
+
console.log('solution.wrong.rewards', solution.wrong.rewards);
|
|
239
|
+
}, [emitEvent, solution]);
|
|
240
|
+
|
|
233
241
|
var handleAreaClick = function handleAreaClick(area) {
|
|
234
242
|
if (!clickedZones.some(function (zone) {
|
|
235
243
|
return zone.index === area.index;
|
|
@@ -262,14 +270,7 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
|
|
|
262
270
|
className: className
|
|
263
271
|
}, showWrongFeedback ? /*#__PURE__*/_react.default.createElement(FailedMessage, {
|
|
264
272
|
playSound: playSound,
|
|
265
|
-
onClose:
|
|
266
|
-
setShowWrongFeedback(false);
|
|
267
|
-
emitEvent({
|
|
268
|
-
type: 'addPoints',
|
|
269
|
-
payload: info.solution.wrong.rewards,
|
|
270
|
-
finish: false
|
|
271
|
-
});
|
|
272
|
-
},
|
|
273
|
+
onClose: handleOncloseWrongFeedback,
|
|
273
274
|
text: info.solution.wrong.desc
|
|
274
275
|
}) : null, completed ? /*#__PURE__*/_react.default.createElement(CompletedMessage, {
|
|
275
276
|
playSound: playSound,
|
|
@@ -311,55 +312,5 @@ ImageClickWrapperComponent.defaultProps = {
|
|
|
311
312
|
isLast: true,
|
|
312
313
|
emitAreaClick: function emitAreaClick() {}
|
|
313
314
|
};
|
|
314
|
-
ImageClickWrapperComponent.propTypes = {
|
|
315
|
-
hideContinue: _propTypes.default.bool,
|
|
316
|
-
className: _propTypes.default.string,
|
|
317
|
-
isLast: _propTypes.default.bool,
|
|
318
|
-
list: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
319
|
-
info: _propTypes.default.shape({
|
|
320
|
-
instructions: _propTypes.default.string,
|
|
321
|
-
solution: _propTypes.default.shape({
|
|
322
|
-
title: _propTypes.default.string,
|
|
323
|
-
right: _propTypes.default.shape({
|
|
324
|
-
rewards: _propTypes.default.arrayOf(_propTypes.default.shape({})),
|
|
325
|
-
desc: _propTypes.default.string
|
|
326
|
-
}),
|
|
327
|
-
wrong: _propTypes.default.shape({
|
|
328
|
-
rewards: _propTypes.default.arrayOf(_propTypes.default.shape({})),
|
|
329
|
-
desc_labelId: _propTypes.default.string,
|
|
330
|
-
desc: _propTypes.default.string
|
|
331
|
-
})
|
|
332
|
-
}),
|
|
333
|
-
hint: _propTypes.default.shape({}),
|
|
334
|
-
title: _propTypes.default.string,
|
|
335
|
-
resolve: _propTypes.default.shape({})
|
|
336
|
-
}),
|
|
337
|
-
image: _propTypes.default.shape({
|
|
338
|
-
img: _propTypes.default.shape({
|
|
339
|
-
imgName: _propTypes.default.string,
|
|
340
|
-
imgUurlrl: _propTypes.default.string
|
|
341
|
-
}),
|
|
342
|
-
imgId: _propTypes.default.string,
|
|
343
|
-
width: _propTypes.default.number,
|
|
344
|
-
height: _propTypes.default.number
|
|
345
|
-
}),
|
|
346
|
-
areas: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
347
|
-
id: _propTypes.default.string,
|
|
348
|
-
name: _propTypes.default.string,
|
|
349
|
-
shape: _propTypes.default.oneOf(['poly', 'rect', 'circle']),
|
|
350
|
-
points: _propTypes.default.array
|
|
351
|
-
})).isRequired,
|
|
352
|
-
badAreas: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
353
|
-
id: _propTypes.default.string,
|
|
354
|
-
name: _propTypes.default.string,
|
|
355
|
-
shape: _propTypes.default.oneOf(['poly', 'rect', 'circle']),
|
|
356
|
-
points: _propTypes.default.array
|
|
357
|
-
}))
|
|
358
|
-
})),
|
|
359
|
-
defaultCompleted: _propTypes.default.bool,
|
|
360
|
-
hasClickOrder: _propTypes.default.bool,
|
|
361
|
-
hasHighlights: _propTypes.default.bool,
|
|
362
|
-
hasImageReview: _propTypes.default.bool
|
|
363
|
-
};
|
|
364
315
|
var _default = ImageClickWrapperComponent;
|
|
365
316
|
exports.default = _default;
|
|
@@ -88,6 +88,7 @@ var mockProps = {
|
|
|
88
88
|
exports.mockProps = mockProps;
|
|
89
89
|
var mockProps2 = {
|
|
90
90
|
emitEvent: emitEvent,
|
|
91
|
+
soundActions: soundActions,
|
|
91
92
|
disableExit: function disableExit() {},
|
|
92
93
|
setResolveAction: function setResolveAction() {},
|
|
93
94
|
transitionEffects: null,
|
|
@@ -161,6 +162,7 @@ var mockProps2 = {
|
|
|
161
162
|
exports.mockProps2 = mockProps2;
|
|
162
163
|
var mockProps3 = {
|
|
163
164
|
emitEvent: emitEvent,
|
|
165
|
+
soundActions: soundActions,
|
|
164
166
|
disableExit: function disableExit() {},
|
|
165
167
|
setResolveAction: function setResolveAction() {},
|
|
166
168
|
transitionEffects: null,
|
|
@@ -234,6 +236,7 @@ var mockProps3 = {
|
|
|
234
236
|
exports.mockProps3 = mockProps3;
|
|
235
237
|
var mockProps4 = {
|
|
236
238
|
emitEvent: emitEvent,
|
|
239
|
+
soundActions: soundActions,
|
|
237
240
|
disableExit: function disableExit() {},
|
|
238
241
|
setResolveAction: function setResolveAction() {},
|
|
239
242
|
transitionEffects: null,
|
package/dist/components/index.js
CHANGED
|
@@ -143,6 +143,12 @@ Object.defineProperty(exports, "WebBuilderPuzzleComponent", {
|
|
|
143
143
|
return _webBuilderPuzzleComponent.default;
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
|
+
Object.defineProperty(exports, "CardsSelectorPuzzleComponent", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: function get() {
|
|
149
|
+
return _cardsSelectorPuzzleComponent.default;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
146
152
|
Object.defineProperty(exports, "WriterPuzzleComponent", {
|
|
147
153
|
enumerable: true,
|
|
148
154
|
get: function get() {
|
|
@@ -206,6 +212,8 @@ var _chainedImageClickPuzzleComponent = _interopRequireDefault(require("./chaine
|
|
|
206
212
|
|
|
207
213
|
var _webBuilderPuzzleComponent = _interopRequireDefault(require("./web-builder-puzzle-component"));
|
|
208
214
|
|
|
215
|
+
var _cardsSelectorPuzzleComponent = _interopRequireDefault(require("./cards-selector-puzzle-component"));
|
|
216
|
+
|
|
209
217
|
var _writerPuzzleComponent = _interopRequireDefault(require("./writer-puzzle-component"));
|
|
210
218
|
|
|
211
219
|
var _terminalPuzzleComponent = _interopRequireDefault(require("./terminal-puzzle-component"));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamelearn/arcade-components",
|
|
3
3
|
"license": "Gamelearn",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.3",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@babel/cli": "7.12.10",
|
|
57
57
|
"@babel/preset-env": "7.12.11",
|
|
58
58
|
"@babel/preset-react": "7.12.10",
|
|
59
|
-
"@gamelearn/ui-components-core": "5.
|
|
59
|
+
"@gamelearn/ui-components-core": "5.18.0",
|
|
60
60
|
"@react-three/test-renderer": "6.0.6",
|
|
61
61
|
"@storybook/addon-actions": "6.1.11",
|
|
62
62
|
"@storybook/addon-essentials": "6.1.11",
|
|
@@ -77,4 +77,4 @@
|
|
|
77
77
|
"^react-pdf$": "react-pdf/dist/umd/entry.jest"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
}
|
|
80
|
+
}
|