@gamelearn/arcade-components 0.23.0 → 0.23.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/image-click-wrapper-component/components/ImageClickWrapperComponent.js +1 -1
- package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +23 -1
- package/dist/components/konva-components/Area/index.js +19 -9
- package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +5 -3
- package/package.json +1 -1
package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js
CHANGED
|
@@ -301,7 +301,7 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
|
|
|
301
301
|
}) : null, /*#__PURE__*/_react.default.createElement(_KonvaMapper.default, {
|
|
302
302
|
completed: completed,
|
|
303
303
|
imageUrl: imageUrl,
|
|
304
|
-
areas: areasList,
|
|
304
|
+
areas: hasClickOnce && clickedZones.length ? [clickedZones[0]] : areasList,
|
|
305
305
|
badAreas: badAreasList,
|
|
306
306
|
clickedZones: clickedZones,
|
|
307
307
|
onClick: handleCorrectAreaClick,
|
|
@@ -8,7 +8,7 @@ exports.mockPropsOnce = exports.mockProps4 = exports.mockProps3 = exports.mockPr
|
|
|
8
8
|
var emitEvent = function emitEvent(_ref) {
|
|
9
9
|
var type = _ref.type,
|
|
10
10
|
payload = _ref.payload;
|
|
11
|
-
console.log('Emit event called', type);
|
|
11
|
+
console.log('Emit event called', type, payload);
|
|
12
12
|
|
|
13
13
|
if (type === 'translate') {
|
|
14
14
|
return payload;
|
|
@@ -417,6 +417,28 @@ var mockPropsOnce = {
|
|
|
417
417
|
closed: true
|
|
418
418
|
}],
|
|
419
419
|
badAreas: [],
|
|
420
|
+
specificFeedbacks: {
|
|
421
|
+
correctFeedbacks: [{
|
|
422
|
+
id: '1601910616179',
|
|
423
|
+
desc: 'specificFeedbacks 1 correcto',
|
|
424
|
+
rewards: [{
|
|
425
|
+
id: 'k2koxnkq',
|
|
426
|
+
name: 'Power',
|
|
427
|
+
points: 10,
|
|
428
|
+
type: 'score'
|
|
429
|
+
}]
|
|
430
|
+
}, {
|
|
431
|
+
id: '1601910626254',
|
|
432
|
+
desc: 'specificFeedbacks 2 correcto',
|
|
433
|
+
rewards: [{
|
|
434
|
+
id: 'k2koxnkq',
|
|
435
|
+
name: 'Ranger',
|
|
436
|
+
points: 10,
|
|
437
|
+
type: 'score'
|
|
438
|
+
}]
|
|
439
|
+
}],
|
|
440
|
+
wrongFeedbacks: []
|
|
441
|
+
},
|
|
420
442
|
hasClickOrder: false,
|
|
421
443
|
hasClickOnce: true,
|
|
422
444
|
hasHighlights: true
|
|
@@ -30,9 +30,11 @@ var Area = function Area(_ref) {
|
|
|
30
30
|
|
|
31
31
|
var mouseEnterArea = function mouseEnterArea() {
|
|
32
32
|
if (hasHighlights && !completed && !isClicked) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
areaRef.current.
|
|
33
|
+
var _areaRef$current, _areaRef$current2, _areaRef$current3;
|
|
34
|
+
|
|
35
|
+
(_areaRef$current = areaRef.current) === null || _areaRef$current === void 0 ? void 0 : _areaRef$current.setAttr('fill', 'rgba(130, 134, 142, 0.4)');
|
|
36
|
+
(_areaRef$current2 = areaRef.current) === null || _areaRef$current2 === void 0 ? void 0 : _areaRef$current2.setAttr('stroke', 'rgba(255, 255, 255, 0.3)');
|
|
37
|
+
(_areaRef$current3 = areaRef.current) === null || _areaRef$current3 === void 0 ? void 0 : _areaRef$current3.to({
|
|
36
38
|
duration: 0.25,
|
|
37
39
|
opacity: 1
|
|
38
40
|
});
|
|
@@ -41,7 +43,9 @@ var Area = function Area(_ref) {
|
|
|
41
43
|
|
|
42
44
|
var mouseLeaveArea = function mouseLeaveArea() {
|
|
43
45
|
if (hasHighlights && !completed && !isClicked) {
|
|
44
|
-
|
|
46
|
+
var _areaRef$current4;
|
|
47
|
+
|
|
48
|
+
(_areaRef$current4 = areaRef.current) === null || _areaRef$current4 === void 0 ? void 0 : _areaRef$current4.to({
|
|
45
49
|
duration: 0.25,
|
|
46
50
|
opacity: 0
|
|
47
51
|
});
|
|
@@ -51,13 +55,17 @@ var Area = function Area(_ref) {
|
|
|
51
55
|
(0, _react.useEffect)(function () {
|
|
52
56
|
if (completed && !finished) {
|
|
53
57
|
if (!isBad) {
|
|
54
|
-
|
|
58
|
+
var _areaRef$current5, _areaRef$current6;
|
|
59
|
+
|
|
60
|
+
(_areaRef$current5 = areaRef.current) === null || _areaRef$current5 === void 0 ? void 0 : _areaRef$current5.to({
|
|
55
61
|
duration: 0.25,
|
|
56
62
|
opacity: 1
|
|
57
63
|
});
|
|
58
|
-
areaRef.current.globalCompositeOperation('destination-out');
|
|
64
|
+
(_areaRef$current6 = areaRef.current) === null || _areaRef$current6 === void 0 ? void 0 : _areaRef$current6.globalCompositeOperation('destination-out');
|
|
59
65
|
} else {
|
|
60
|
-
|
|
66
|
+
var _areaRef$current7;
|
|
67
|
+
|
|
68
|
+
(_areaRef$current7 = areaRef.current) === null || _areaRef$current7 === void 0 ? void 0 : _areaRef$current7.to({
|
|
61
69
|
duration: 0.25,
|
|
62
70
|
opacity: 0
|
|
63
71
|
});
|
|
@@ -67,14 +75,16 @@ var Area = function Area(_ref) {
|
|
|
67
75
|
|
|
68
76
|
var clickArea = function clickArea() {
|
|
69
77
|
if (!completed) {
|
|
78
|
+
var _areaRef$current8, _areaRef$current9;
|
|
79
|
+
|
|
70
80
|
if (isBad) {
|
|
71
81
|
onClickOutside(area);
|
|
72
82
|
} else {
|
|
73
83
|
onClick(area);
|
|
74
84
|
}
|
|
75
85
|
|
|
76
|
-
areaRef.current.setAttr('fill', fillColor);
|
|
77
|
-
areaRef.current.setAttr('stroke', strokeColor);
|
|
86
|
+
(_areaRef$current8 = areaRef.current) === null || _areaRef$current8 === void 0 ? void 0 : _areaRef$current8.setAttr('fill', fillColor);
|
|
87
|
+
(_areaRef$current9 = areaRef.current) === null || _areaRef$current9 === void 0 ? void 0 : _areaRef$current9.setAttr('stroke', strokeColor);
|
|
78
88
|
}
|
|
79
89
|
};
|
|
80
90
|
|
|
@@ -13,7 +13,7 @@ var emitEvent = function emitEvent(_ref) {
|
|
|
13
13
|
return payload;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
console.log('Emit event called');
|
|
16
|
+
console.log('Emit event called:', type, 'payload:', payload);
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
var messages = {
|
|
@@ -260,7 +260,9 @@ exports.mockProps = mockProps;
|
|
|
260
260
|
var mockPropsOnce = {
|
|
261
261
|
emitEvent: emitEvent,
|
|
262
262
|
setResolveAction: function setResolveAction() {},
|
|
263
|
-
setShowPoints: function setShowPoints() {
|
|
263
|
+
setShowPoints: function setShowPoints(points) {
|
|
264
|
+
console.log('points', points);
|
|
265
|
+
},
|
|
264
266
|
showFrames: true,
|
|
265
267
|
soundActions: [function () {}, function () {}],
|
|
266
268
|
styles: 'chalkboard',
|
|
@@ -323,7 +325,7 @@ var mockPropsOnce = {
|
|
|
323
325
|
rewards: [{
|
|
324
326
|
id: 'k2koxnkq',
|
|
325
327
|
name: 'Power',
|
|
326
|
-
points:
|
|
328
|
+
points: 5,
|
|
327
329
|
type: 'score'
|
|
328
330
|
}]
|
|
329
331
|
}],
|