@gamelearn/arcade-components 0.19.3 → 0.19.5
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/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js +12 -4
- package/dist/components/frame-click-puzzle-component/components/CurrentFramePuzzle.js +10 -6
- package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +2 -1
- package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +3 -2
- package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +1 -1
- package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +1 -1
- package/package.json +1 -1
package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js
CHANGED
|
@@ -19,6 +19,12 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
19
19
|
|
|
20
20
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
21
|
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
25
|
+
|
|
26
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
+
|
|
22
28
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
23
29
|
|
|
24
30
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -112,15 +118,17 @@ var CurrentImageClickPuzzle = function CurrentImageClickPuzzle(_ref) {
|
|
|
112
118
|
|
|
113
119
|
var onResolve = function onResolve(resolve) {
|
|
114
120
|
playSound('score');
|
|
115
|
-
resolve(
|
|
121
|
+
resolve(puzzleId);
|
|
116
122
|
setTimeout(function () {
|
|
117
123
|
onComplete(info.resolve.rewards || [], false);
|
|
118
124
|
}, 2000);
|
|
119
125
|
};
|
|
120
126
|
|
|
121
127
|
(0, _react.useEffect)(function () {
|
|
122
|
-
setInfo(info)
|
|
123
|
-
|
|
128
|
+
setInfo(_objectSpread(_objectSpread({}, info), {}, {
|
|
129
|
+
hintId: puzzleId
|
|
130
|
+
}));
|
|
131
|
+
}, [info, setInfo, puzzleId]);
|
|
124
132
|
(0, _react.useEffect)(function () {
|
|
125
133
|
var timeout;
|
|
126
134
|
|
|
@@ -140,7 +148,7 @@ var CurrentImageClickPuzzle = function CurrentImageClickPuzzle(_ref) {
|
|
|
140
148
|
key: index
|
|
141
149
|
}, currentImageProps, {
|
|
142
150
|
puzzle: {
|
|
143
|
-
name:
|
|
151
|
+
name: puzzleId,
|
|
144
152
|
component: 'chained-image-click-puzzle'
|
|
145
153
|
},
|
|
146
154
|
emitFinish: onComplete,
|
|
@@ -55,16 +55,20 @@ var CurrentFramePuzzle = function CurrentFramePuzzle(_ref) {
|
|
|
55
55
|
description = _ref.description,
|
|
56
56
|
translateFromParent = _ref.translateFromParent,
|
|
57
57
|
onHidePuzzleButtons = _ref.onHidePuzzleButtons,
|
|
58
|
-
setInfo = _ref.setInfo
|
|
58
|
+
setInfo = _ref.setInfo,
|
|
59
|
+
nodeId = _ref.nodeId;
|
|
59
60
|
var props = list[index];
|
|
60
61
|
var info = props.info;
|
|
61
62
|
info.description = description;
|
|
63
|
+
var puzzleId = "frame-click-puzzle_".concat(index, "_").concat(nodeId);
|
|
62
64
|
(0, _react.useEffect)(function () {
|
|
63
65
|
puzzlesCompiledRef.current += 1;
|
|
64
66
|
}, [puzzlesCompiledRef]);
|
|
65
67
|
(0, _react.useEffect)(function () {
|
|
66
|
-
setInfo(info)
|
|
67
|
-
|
|
68
|
+
setInfo(_objectSpread(_objectSpread({}, info), {}, {
|
|
69
|
+
hintId: puzzleId
|
|
70
|
+
}));
|
|
71
|
+
}, [setInfo, info, puzzleId]);
|
|
68
72
|
var onComplete = (0, _react.useCallback)(function (rw) {
|
|
69
73
|
var emit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
70
74
|
|
|
@@ -85,7 +89,7 @@ var CurrentFramePuzzle = function CurrentFramePuzzle(_ref) {
|
|
|
85
89
|
}, [accRewards, framesCompleted, handleFinish, handleResolve, index, list.length, setFramesCompleted, setIndex, setRewards]);
|
|
86
90
|
|
|
87
91
|
var onResolve = function onResolve(resolve) {
|
|
88
|
-
resolve(
|
|
92
|
+
resolve(puzzleId);
|
|
89
93
|
setTimeout(function () {
|
|
90
94
|
onComplete([], false);
|
|
91
95
|
}, 2000);
|
|
@@ -96,7 +100,7 @@ var CurrentFramePuzzle = function CurrentFramePuzzle(_ref) {
|
|
|
96
100
|
};
|
|
97
101
|
|
|
98
102
|
(0, _react.useEffect)(function () {
|
|
99
|
-
if (
|
|
103
|
+
if (loadPuzzleStatus) {
|
|
100
104
|
setTimeout(function () {
|
|
101
105
|
onComplete([], false);
|
|
102
106
|
}, 2000);
|
|
@@ -107,7 +111,7 @@ var CurrentFramePuzzle = function CurrentFramePuzzle(_ref) {
|
|
|
107
111
|
}, _objectSpread({}, props), {
|
|
108
112
|
className: "puzzle-frame__canvas",
|
|
109
113
|
puzzle: {
|
|
110
|
-
name: "
|
|
114
|
+
name: "",
|
|
111
115
|
component: 'frame-click-puzzle'
|
|
112
116
|
},
|
|
113
117
|
emitFinish: onComplete,
|
package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js
CHANGED
|
@@ -149,7 +149,8 @@ var FrameImageClickComponent = function FrameImageClickComponent(_ref) {
|
|
|
149
149
|
disableExit: disableExit,
|
|
150
150
|
translateFromParent: translateFromParent,
|
|
151
151
|
onHidePuzzleButtons: onHidePuzzleButtons,
|
|
152
|
-
setInfo: setInfo
|
|
152
|
+
setInfo: setInfo,
|
|
153
|
+
nodeId: nodeId
|
|
153
154
|
};
|
|
154
155
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
155
156
|
className: "puzzle-frame"
|
package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js
CHANGED
|
@@ -103,6 +103,7 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
|
|
|
103
103
|
hideContinue = props.hideContinue,
|
|
104
104
|
className = props.className,
|
|
105
105
|
emitFinish = props.emitFinish,
|
|
106
|
+
emitResolve = props.emitResolve,
|
|
106
107
|
translateFromParent = props.translateFromParent;
|
|
107
108
|
|
|
108
109
|
var translate = function translate(id) {
|
|
@@ -199,10 +200,10 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
|
|
|
199
200
|
setDisableClick(true);
|
|
200
201
|
setFinished(true);
|
|
201
202
|
setTimeout(function () {
|
|
202
|
-
resolve();
|
|
203
|
+
emitResolve ? emitResolve(resolve) : resolve();
|
|
203
204
|
}, 4000);
|
|
204
205
|
});
|
|
205
|
-
}, [setResolveAction]);
|
|
206
|
+
}, [setResolveAction, emitResolve]);
|
|
206
207
|
(0, _react.useEffect)(function () {
|
|
207
208
|
if (finished) {
|
|
208
209
|
disableExit(true);
|
|
@@ -351,7 +351,7 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
351
351
|
} else {
|
|
352
352
|
parsedText.current = '';
|
|
353
353
|
}
|
|
354
|
-
}, [currentSlide, description, getnumberAllCorrectFragments,
|
|
354
|
+
}, [currentSlide, description, getnumberAllCorrectFragments, list, recursiveStuff, setInfo]);
|
|
355
355
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
356
356
|
className: "text-click text-click--".concat(styles),
|
|
357
357
|
style: feedbackData.show ? {
|
|
@@ -17,7 +17,7 @@ var emitEvent = function emitEvent(_ref) {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
var messages = {
|
|
20
|
-
fullText1: '<div><p><strong>Texto de prueba:</strong></p><p>Con <span data-text-id="text-click-0">un texto correcto normal</span></p><p>Con <span data-text-id="text-click-2">un texto incorrecto normal</span></p><p>Con un texto <span data-text-id="text-click-1">corr</span></p><p><span data-text-id="text-click-1">ecto partido</span></p></div>',
|
|
20
|
+
fullText1: '<div><p><span></span><strong>Texto de prueba:</strong></p><p>Con <span data-text-id="text-click-0">un texto correcto normal</span></p><p>Con <span data-text-id="text-click-2">un texto incorrecto normal</span></p><p>Con un texto <span data-text-id="text-click-1">corr</span></p><p><span data-text-id="text-click-1">ecto partido</span></p></div>',
|
|
21
21
|
fullText2: '<div><mark data-text-id="text-click-4">FRAGMENTO <strong>CORRECTO</strong> id4</mark> que <mark data-text-id="text-click-7">FRAGMENTO <strong>CORRECTO id7</strong> 4</mark> en <mark data-text-id="text-click-6">FRAGMENTO <strong>inCORRECTO id6</strong> 4</mark> asdf asdf asf <mark data-text-id="text-click-5">FRAGMENTO <strong>INCORRECTO id5</strong></mark></div>',
|
|
22
22
|
fullText3: '<div>Todo es incorrecto salvo <span data-text-id="text-click-8">alguna cosa</span></div>'
|
|
23
23
|
};
|