@gamelearn/arcade-components 0.19.9 → 0.20.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/conversational-pro-component/components/scene/Panels.js +18 -12
- package/dist/components/decision-component/components/DecisionComponent.js +2 -1
- package/dist/components/image-component/components/ImageComponent.js +3 -3
- package/dist/components/video-component/components/VideoComponent.js +5 -5
- package/package.json +1 -1
|
@@ -17,19 +17,25 @@ var Panels = function Panels(_ref) {
|
|
|
17
17
|
activeIndex = _ref.activeIndex,
|
|
18
18
|
flex = _ref.flex,
|
|
19
19
|
lodSettings = _ref.lodSettings;
|
|
20
|
-
return
|
|
21
|
-
var
|
|
22
|
-
return
|
|
23
|
-
});
|
|
24
|
-
var currentSlot = !flex ? notFlexedPosition : index;
|
|
25
|
-
char.index = index;
|
|
26
|
-
char.slot = currentSlot;
|
|
27
|
-
return /*#__PURE__*/_react.default.createElement(_Panel.default, {
|
|
28
|
-
key: "".concat(char.uid, "_").concat(index),
|
|
29
|
-
character: char,
|
|
30
|
-
active: activeIndex === currentSlot,
|
|
31
|
-
lodSettings: lodSettings
|
|
20
|
+
return slots.map(function (slot, slotPosition) {
|
|
21
|
+
var characterPos = characters.findIndex(function (c) {
|
|
22
|
+
return c.uid === slot.uid;
|
|
32
23
|
});
|
|
24
|
+
|
|
25
|
+
if (characterPos >= 0) {
|
|
26
|
+
var currentPosition = !flex ? slotPosition : characterPos;
|
|
27
|
+
var currentCharacter = Object.assign({}, characters[characterPos]);
|
|
28
|
+
currentCharacter.index = characterPos;
|
|
29
|
+
currentCharacter.slot = slotPosition;
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_Panel.default, {
|
|
31
|
+
key: "".concat(currentCharacter.uid, "_").concat(slotPosition, "_").concat(characterPos),
|
|
32
|
+
character: currentCharacter,
|
|
33
|
+
active: activeIndex === currentPosition,
|
|
34
|
+
lodSettings: lodSettings
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return null;
|
|
33
39
|
});
|
|
34
40
|
};
|
|
35
41
|
|
|
@@ -135,9 +135,10 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
135
135
|
payload: rewards,
|
|
136
136
|
finish: !onFinish
|
|
137
137
|
});
|
|
138
|
+
setResultChoice({});
|
|
139
|
+
selectView('options');
|
|
138
140
|
|
|
139
141
|
if (onFinish) {
|
|
140
|
-
// audio stop
|
|
141
142
|
onFinish();
|
|
142
143
|
}
|
|
143
144
|
} else if (Object.keys(choice).length > 0) {
|
|
@@ -20,11 +20,11 @@ var ImageComponent = function ImageComponent(_ref) {
|
|
|
20
20
|
documentType = _ref.documentType,
|
|
21
21
|
visible = _ref.visible,
|
|
22
22
|
viewed = _ref.viewed,
|
|
23
|
-
|
|
23
|
+
imgId_labelId = _ref.imgId_labelId;
|
|
24
24
|
var imgUrl = img.url;
|
|
25
25
|
var close = (0, _react.useCallback)(function () {
|
|
26
26
|
var item = {
|
|
27
|
-
imgId:
|
|
27
|
+
imgId: imgId_labelId,
|
|
28
28
|
name: imgName,
|
|
29
29
|
imgName: imgName,
|
|
30
30
|
documentType: documentType,
|
|
@@ -34,7 +34,7 @@ var ImageComponent = function ImageComponent(_ref) {
|
|
|
34
34
|
type: 'finishMedia',
|
|
35
35
|
payload: item
|
|
36
36
|
});
|
|
37
|
-
}, [
|
|
37
|
+
}, [imgId_labelId, imgName, emitEvent, documentType]);
|
|
38
38
|
(0, _react.useEffect)(function () {
|
|
39
39
|
if (!visible) {
|
|
40
40
|
close();
|
|
@@ -22,24 +22,24 @@ var VideoComponent = function VideoComponent(_ref) {
|
|
|
22
22
|
name = _ref.name,
|
|
23
23
|
documentType = _ref.documentType,
|
|
24
24
|
document = _ref.document,
|
|
25
|
-
|
|
25
|
+
documentId_labelId = _ref.documentId_labelId,
|
|
26
26
|
required = _ref.required,
|
|
27
27
|
viewed = _ref.viewed,
|
|
28
28
|
visible = _ref.visible,
|
|
29
29
|
img = _ref.img,
|
|
30
|
-
|
|
30
|
+
imgId_labelId = _ref.imgId_labelId;
|
|
31
31
|
var url = document.url;
|
|
32
32
|
var item = (0, _react.useMemo)(function () {
|
|
33
33
|
return {
|
|
34
|
-
documentId:
|
|
35
|
-
imgId:
|
|
34
|
+
documentId: documentId_labelId,
|
|
35
|
+
imgId: imgId_labelId,
|
|
36
36
|
required: required,
|
|
37
37
|
name: name,
|
|
38
38
|
type: 'video',
|
|
39
39
|
viewed: viewed,
|
|
40
40
|
documentType: documentType
|
|
41
41
|
};
|
|
42
|
-
}, [
|
|
42
|
+
}, [documentId_labelId, imgId_labelId, required, name, viewed, documentType]);
|
|
43
43
|
|
|
44
44
|
var _endVideo = (0, _react.useCallback)(function () {
|
|
45
45
|
emitEvent({
|