@gamelearn/arcade-components 2.19.0 → 2.20.0-hotfix-GAT-5733
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/auto-evaluation-component/components/AutoEvaluation.js +16 -13
- package/dist/components/auto-evaluation-component/components/StartScreen.js +2 -5
- package/dist/components/cards-selector-puzzle-component/components/Card/index.js +4 -5
- package/dist/components/cartel-component/components/CartelComponent.js +10 -1
- package/dist/components/comic-component/components/ComicComponent.js +15 -13
- package/dist/components/comic-component/components/Slide.js +4 -2
- package/dist/components/comic-component/components/Vignette.js +6 -9
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +4 -2
- package/dist/components/decision-component/components/DecisionBody.js +4 -4
- package/dist/components/decision-component/components/Options.js +27 -21
- package/dist/components/dialog-component/components/DialogComponent.js +4 -2
- package/dist/components/feedback-component/components/FeedbackComponent.js +6 -4
- package/dist/components/image-component/components/ImageComponent.js +9 -1
- package/dist/components/inventory-item/components/InventoryItem.js +19 -8
- package/dist/components/pattern-component/components/PatternComponent.js +1 -0
- package/dist/components/pdf-component/components/PdfComponent.js +2 -1
- package/dist/components/pdf-component/components/PdfVisor.js +6 -2
- package/dist/components/referral-component/components/EmailPill.js +3 -5
- package/dist/components/referral-component/components/StepOne.js +14 -7
- package/dist/components/survey-component/components/ApplicableBox.js +3 -5
- package/dist/components/survey-component/components/OpinionBox.js +4 -7
- package/dist/components/survey-component/components/SurveyComponent.js +13 -5
- package/dist/components/survey-component/components/TextBox.js +8 -1
- package/dist/components/terminal-puzzle-component/components/Visor/index.js +2 -1
- package/dist/components/test-component/components/Container.js +4 -2
- package/dist/components/test-component/components/Questions.js +3 -5
- package/dist/components/url-component/components/UrlComponent.js +12 -6
- package/dist/components/video-component/components/VideoComponent.js +10 -1
- package/dist/components/video-visor/components/VideoControllers/ControlButtons.js +10 -9
- package/dist/components/video-visor/components/VideoControllers/FinishedVideoButtons.js +5 -12
- package/dist/components/video-visor/components/VideoControllers/SkipButton.js +5 -5
- package/dist/components/video-visor/components/VideoControllers/index.js +18 -12
- package/dist/components/video-visor/components/VideoVisor.js +12 -8
- package/package.json +2 -2
|
@@ -48,7 +48,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
48
48
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
49
|
|
|
50
50
|
var AutoEvaluation = function AutoEvaluation(_ref) {
|
|
51
|
-
var _questions$currentQue, _surveyData$current$q3;
|
|
51
|
+
var _questions$currentQue, _surveyData$current$q3, _surveyData$current$q4;
|
|
52
52
|
|
|
53
53
|
var description = _ref.description,
|
|
54
54
|
questions = _ref.questions,
|
|
@@ -96,6 +96,12 @@ var AutoEvaluation = function AutoEvaluation(_ref) {
|
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
+
var lostFocusWhenClickEnter = function lostFocusWhenClickEnter(e) {
|
|
100
|
+
if (e.keyCode === 13) {
|
|
101
|
+
e.target.blur();
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
99
105
|
var close = function close() {
|
|
100
106
|
play('click-ui');
|
|
101
107
|
emitEvent({
|
|
@@ -193,18 +199,18 @@ var AutoEvaluation = function AutoEvaluation(_ref) {
|
|
|
193
199
|
}, Array(11).fill(0).map(function (_, i) {
|
|
194
200
|
var _surveyData$current$q2;
|
|
195
201
|
|
|
196
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
202
|
+
return /*#__PURE__*/_react.default.createElement("button", {
|
|
197
203
|
key: "".concat(0 + i),
|
|
198
|
-
|
|
199
|
-
role: "button",
|
|
200
|
-
tabIndex: 0,
|
|
201
|
-
onKeyUp: function onKeyUp() {},
|
|
204
|
+
type: "button",
|
|
202
205
|
onTouchStart: function onTouchStart() {
|
|
203
206
|
setPointIsBeingTouched(i);
|
|
204
207
|
},
|
|
205
208
|
onTouchEnd: function onTouchEnd() {
|
|
206
209
|
setPointIsBeingTouched(null);
|
|
207
210
|
},
|
|
211
|
+
onKeyUp: function onKeyUp(e) {
|
|
212
|
+
lostFocusWhenClickEnter(e);
|
|
213
|
+
},
|
|
208
214
|
onClick: function onClick() {
|
|
209
215
|
handleNextQuestion(i, false);
|
|
210
216
|
},
|
|
@@ -219,7 +225,7 @@ var AutoEvaluation = function AutoEvaluation(_ref) {
|
|
|
219
225
|
onClick: function onClick() {
|
|
220
226
|
return handleNextQuestion(null, true);
|
|
221
227
|
},
|
|
222
|
-
"aria-label":
|
|
228
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('survey.next') : translate('survey.previous'),
|
|
223
229
|
className: "gat--btn__navigation ".concat(currentQuestion === 0 ? 'disabled' : '')
|
|
224
230
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
225
231
|
className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back',
|
|
@@ -230,7 +236,6 @@ var AutoEvaluation = function AutoEvaluation(_ref) {
|
|
|
230
236
|
setPhase('end');
|
|
231
237
|
play('click-ui');
|
|
232
238
|
},
|
|
233
|
-
"aria-label": "finish button",
|
|
234
239
|
className: "gat--btn gat--btn__primary auto-evaluation__button not-transition "
|
|
235
240
|
}, /*#__PURE__*/_react.default.createElement("span", null, translate('auto-evaluation.end'))) : /*#__PURE__*/_react.default.createElement("button", {
|
|
236
241
|
type: "button",
|
|
@@ -238,12 +243,10 @@ var AutoEvaluation = function AutoEvaluation(_ref) {
|
|
|
238
243
|
return handleNextQuestion(null, false);
|
|
239
244
|
},
|
|
240
245
|
disabled: ((_surveyData$current$q3 = surveyData.current.questions[currentQuestion]) === null || _surveyData$current$q3 === void 0 ? void 0 : _surveyData$current$q3.answer) === undefined,
|
|
241
|
-
"aria-label":
|
|
242
|
-
className: "gat--btn__navigation
|
|
246
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('survey.previous') : translate('survey.next'),
|
|
247
|
+
className: "gat--btn__navigation ".concat(((_surveyData$current$q4 = surveyData.current.questions[currentQuestion]) === null || _surveyData$current$q4 === void 0 ? void 0 : _surveyData$current$q4.answer) === undefined ? 'disabled' : '')
|
|
243
248
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
244
|
-
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
245
|
-
"aria-label": "navigation icon",
|
|
246
|
-
role: "img"
|
|
249
|
+
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
247
250
|
})))), phase === 'end' && /*#__PURE__*/_react.default.createElement(_EndScreen.default, {
|
|
248
251
|
onFinish: close,
|
|
249
252
|
translate: translate
|
|
@@ -28,11 +28,8 @@ var StartScreen = function StartScreen(_ref) {
|
|
|
28
28
|
}, /*#__PURE__*/_react.default.createElement("span", null, description)), /*#__PURE__*/_react.default.createElement("button", {
|
|
29
29
|
type: "button",
|
|
30
30
|
className: "gat--btn gat--btn__primary auto-evaluation__button auto-evaluation__button--start",
|
|
31
|
-
onClick: onNext
|
|
32
|
-
|
|
33
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
34
|
-
"aria-label": "start text"
|
|
35
|
-
}, translate('auto-evaluation.start'))));
|
|
31
|
+
onClick: onNext
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, translate('auto-evaluation.start'))));
|
|
36
33
|
};
|
|
37
34
|
|
|
38
35
|
var _default = StartScreen;
|
|
@@ -95,17 +95,16 @@ var Card = function Card(_ref) {
|
|
|
95
95
|
return null;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
99
|
-
|
|
100
|
-
tabIndex: 0,
|
|
98
|
+
return /*#__PURE__*/_react.default.createElement("button", {
|
|
99
|
+
type: "button",
|
|
101
100
|
order: card.order,
|
|
102
|
-
onKeyUp: function onKeyUp() {},
|
|
103
101
|
onClick: function onClick() {
|
|
104
102
|
if (!isEmpty() && canBeClicked()) {
|
|
105
103
|
handleClick(cardIndex);
|
|
106
104
|
}
|
|
107
105
|
},
|
|
108
|
-
className: "card-selector-item ".concat(isEmpty() ? 'card-selector-item--empty' : '')
|
|
106
|
+
className: "unset-button card-selector-item ".concat(isEmpty() ? 'card-selector-item--empty' : ''),
|
|
107
|
+
"aria-label": card.text ? card.text : null
|
|
109
108
|
}, renderImage(), renderText(), cardFeedbackContainer());
|
|
110
109
|
};
|
|
111
110
|
|
|
@@ -40,6 +40,14 @@ var CartelComponent = function CartelComponent(_ref) {
|
|
|
40
40
|
audioVolume = _ref.audioVolume,
|
|
41
41
|
pause = _ref.pause,
|
|
42
42
|
keyboardControl = _ref.keyboardControl;
|
|
43
|
+
|
|
44
|
+
var translate = function translate(id) {
|
|
45
|
+
return emitEvent({
|
|
46
|
+
type: 'translate',
|
|
47
|
+
payload: id
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
43
51
|
var resourceUrl = (img === null || img === void 0 ? void 0 : img.url) || 'https://min.gamelearn.io/css-resources/gamelearn/resources/conversation.jpg';
|
|
44
52
|
var textBox = (0, _react.useRef)();
|
|
45
53
|
var picture = (0, _react.useRef)();
|
|
@@ -129,7 +137,8 @@ var CartelComponent = function CartelComponent(_ref) {
|
|
|
129
137
|
className: "gat--btn__round gat--btn__close",
|
|
130
138
|
onClick: function onClick() {
|
|
131
139
|
return close();
|
|
132
|
-
}
|
|
140
|
+
},
|
|
141
|
+
"aria-label": translate('storylines.misc.closePiece')
|
|
133
142
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
134
143
|
className: "icon-close"
|
|
135
144
|
}))));
|
|
@@ -48,6 +48,13 @@ var ComicComponent = function ComicComponent(_ref) {
|
|
|
48
48
|
pause = _ref.pause,
|
|
49
49
|
keyboardControl = _ref.keyboardControl;
|
|
50
50
|
|
|
51
|
+
var translate = function translate(id) {
|
|
52
|
+
return emitEvent({
|
|
53
|
+
type: 'translate',
|
|
54
|
+
payload: id
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
51
58
|
var _useState = (0, _react.useState)(true),
|
|
52
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
53
60
|
started = _useState2[0],
|
|
@@ -175,27 +182,24 @@ var ComicComponent = function ComicComponent(_ref) {
|
|
|
175
182
|
soundActions: soundActions,
|
|
176
183
|
emitEvent: emitEvent,
|
|
177
184
|
role: "complementary",
|
|
178
|
-
"aria-hidden": "true"
|
|
185
|
+
"aria-hidden": "true",
|
|
186
|
+
translate: translate
|
|
179
187
|
}), slideCount > 0 && /*#__PURE__*/_react.default.createElement("button", {
|
|
180
188
|
type: "button",
|
|
181
189
|
className: "comic-control comic-control--left gat--btn__round",
|
|
182
190
|
"data-testid": "btn-bck",
|
|
183
191
|
onClick: handleManualBack,
|
|
184
|
-
"aria-label":
|
|
192
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('comic.next') : translate('comic.previous')
|
|
185
193
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
186
|
-
className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
|
|
187
|
-
role: "img",
|
|
188
|
-
"aria-label": "Icon Navigation Back"
|
|
194
|
+
className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
|
|
189
195
|
})), slideCount + 1 < slides.length && /*#__PURE__*/_react.default.createElement("button", {
|
|
190
196
|
type: "button",
|
|
191
197
|
className: "comic-control comic-control--right gat--btn__round",
|
|
192
198
|
"data-testid": "btn-nxt",
|
|
193
199
|
onClick: handleManualNext,
|
|
194
|
-
"aria-label":
|
|
200
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('comic.previous') : translate('comic.next')
|
|
195
201
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
196
|
-
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
197
|
-
role: "img",
|
|
198
|
-
"aria-label": "Icon Navigation Next"
|
|
202
|
+
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
199
203
|
})), slideCount + 1 >= slides.length && /*#__PURE__*/_react.default.createElement("div", {
|
|
200
204
|
className: "position--absolute top right",
|
|
201
205
|
role: "heading",
|
|
@@ -209,11 +213,9 @@ var ComicComponent = function ComicComponent(_ref) {
|
|
|
209
213
|
play('click-ui');
|
|
210
214
|
close();
|
|
211
215
|
},
|
|
212
|
-
"aria-label":
|
|
216
|
+
"aria-label": translate('storylines.misc.closePiece')
|
|
213
217
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
214
|
-
className: "icon-close"
|
|
215
|
-
role: "img",
|
|
216
|
-
"aria-label": "Icon Close"
|
|
218
|
+
className: "icon-close"
|
|
217
219
|
})))));
|
|
218
220
|
};
|
|
219
221
|
|
|
@@ -13,7 +13,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
13
13
|
|
|
14
14
|
var Slide = function Slide(_ref) {
|
|
15
15
|
var slide = _ref.slide,
|
|
16
|
-
transition = _ref.transition
|
|
16
|
+
transition = _ref.transition,
|
|
17
|
+
translate = _ref.translate;
|
|
17
18
|
var slideTransition = slide.transitionEffects || transition;
|
|
18
19
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
19
20
|
className: "comic--slide__item ".concat(slideTransition),
|
|
@@ -23,7 +24,8 @@ var Slide = function Slide(_ref) {
|
|
|
23
24
|
key: "Vignete ".concat(vignette.vignetteOrder),
|
|
24
25
|
vignette: vignette,
|
|
25
26
|
alias: slide.alias,
|
|
26
|
-
"aria-hidden": "true"
|
|
27
|
+
"aria-hidden": "true",
|
|
28
|
+
translate: translate
|
|
27
29
|
});
|
|
28
30
|
}));
|
|
29
31
|
};
|
|
@@ -29,7 +29,8 @@ var Vignette = function Vignette(_ref) {
|
|
|
29
29
|
var _vignette$textData;
|
|
30
30
|
|
|
31
31
|
var vignette = _ref.vignette,
|
|
32
|
-
alias = _ref.alias
|
|
32
|
+
alias = _ref.alias,
|
|
33
|
+
translate = _ref.translate;
|
|
33
34
|
var resource = vignette.img || {
|
|
34
35
|
url: 'https://min.gamelearn.io/css-resources/gamelearn/resources/conversation.jpg'
|
|
35
36
|
};
|
|
@@ -48,22 +49,18 @@ var Vignette = function Vignette(_ref) {
|
|
|
48
49
|
className: "comic--image"
|
|
49
50
|
}, resolvedIdImg && /*#__PURE__*/_react.default.createElement("img", {
|
|
50
51
|
src: resolvedIdImg,
|
|
51
|
-
alt: "comic pic"
|
|
52
|
-
"aria-label": "comic pic"
|
|
52
|
+
alt: "comic pic"
|
|
53
53
|
})), vignette !== null && vignette !== void 0 && (_vignette$textData = vignette.textData) !== null && _vignette$textData !== void 0 && _vignette$textData.text ? /*#__PURE__*/_react.default.createElement("div", {
|
|
54
54
|
className: "comic-collapsable ".concat(isCollapsed ? 'comic-collapsable--collapsed' : '')
|
|
55
55
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
56
56
|
onClick: toggleText,
|
|
57
57
|
type: "button",
|
|
58
58
|
className: "un-btn comic-collapsable__header comic-collapsable__toggle",
|
|
59
|
-
"aria-label":
|
|
59
|
+
"aria-label": translate('comic.toggleText')
|
|
60
60
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
61
|
-
className: "".concat(isCollapsed ? 'icon-up-arrow' : 'icon-down-arrow')
|
|
62
|
-
"aria-label": "toogle icon",
|
|
63
|
-
role: "img"
|
|
61
|
+
className: "".concat(isCollapsed ? 'icon-up-arrow' : 'icon-down-arrow')
|
|
64
62
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
-
className: "comic-collapsable__text"
|
|
66
|
-
"aria-label": "vignette text"
|
|
63
|
+
className: "comic-collapsable__text"
|
|
67
64
|
}, alias ? /*#__PURE__*/_react.default.createElement("b", null, alias, ": ") : null, vignette.textData.text)) : null);
|
|
68
65
|
};
|
|
69
66
|
|
package/dist/components/conversational-pro-component/components/ConversationalProComponent.js
CHANGED
|
@@ -512,13 +512,15 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
512
512
|
className: "gat--btn__round ".concat(disableBackButton ? 'disabled' : ''),
|
|
513
513
|
disabled: disableBackButton ? true : '',
|
|
514
514
|
type: "button",
|
|
515
|
-
onClick: manualClickBack
|
|
515
|
+
onClick: manualClickBack,
|
|
516
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('storylines.misc.forward') : translate('storylines.misc.rewind')
|
|
516
517
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
517
518
|
className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
|
|
518
519
|
})), /*#__PURE__*/_react.default.createElement("button", {
|
|
519
520
|
className: "gat--btn__round ".concat(automatic && isEndNode() ? 'glowing-animation' : ''),
|
|
520
521
|
type: "button",
|
|
521
|
-
onClick: manualClickNext
|
|
522
|
+
onClick: manualClickNext,
|
|
523
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('storylines.misc.rewind') : translate('storylines.misc.forward')
|
|
522
524
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
523
525
|
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
524
526
|
}))))));
|
|
@@ -72,7 +72,8 @@ var DecisionBody = function DecisionBody(_ref) {
|
|
|
72
72
|
selectChoice: (!required || branched) && selectedChoice.id !== undefined || required && !failed ? noop : choose,
|
|
73
73
|
options: options,
|
|
74
74
|
showingResults: showingResults,
|
|
75
|
-
simplifiedOptions: simplifiedOptions
|
|
75
|
+
simplifiedOptions: simplifiedOptions,
|
|
76
|
+
required: required
|
|
76
77
|
};
|
|
77
78
|
|
|
78
79
|
var BasicDecision = function BasicDecision(_ref2) {
|
|
@@ -111,9 +112,8 @@ var DecisionBody = function DecisionBody(_ref) {
|
|
|
111
112
|
className: "conversation--main__text"
|
|
112
113
|
}, question), /*#__PURE__*/_react.default.createElement(_Options.default, optionsProps)), /*#__PURE__*/_react.default.createElement("div", {
|
|
113
114
|
className: "conversation--controls conversation--controls--fixedbottom"
|
|
114
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
115
|
-
className: "gat--btn__round disabled"
|
|
116
|
-
type: "button"
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
116
|
+
className: "gat--btn__round disabled"
|
|
117
117
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
118
118
|
className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
|
|
119
119
|
})), /*#__PURE__*/_react.default.createElement("button", {
|
|
@@ -31,14 +31,15 @@ var Options = function Options(_ref) {
|
|
|
31
31
|
selectedChoice = _ref.selectedChoice,
|
|
32
32
|
selectChoice = _ref.selectChoice,
|
|
33
33
|
showingResults = _ref.showingResults,
|
|
34
|
-
simplifiedOptions = _ref.simplifiedOptions
|
|
34
|
+
simplifiedOptions = _ref.simplifiedOptions,
|
|
35
|
+
required = _ref.required;
|
|
35
36
|
|
|
36
37
|
var _useState = (0, _react.useState)(null),
|
|
37
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
38
39
|
neutralDecisionVisualEffect = _useState2[0],
|
|
39
40
|
setNeutralDecisionVisualEffect = _useState2[1];
|
|
40
41
|
|
|
41
|
-
var
|
|
42
|
+
var whenSelectOption = function whenSelectOption(option) {
|
|
42
43
|
if (!simplifiedOptions) {
|
|
43
44
|
selectChoice(option);
|
|
44
45
|
} else {
|
|
@@ -49,6 +50,22 @@ var Options = function Options(_ref) {
|
|
|
49
50
|
}
|
|
50
51
|
};
|
|
51
52
|
|
|
53
|
+
var disabledRadiosAfterAnswer = function disabledRadiosAfterAnswer(option) {
|
|
54
|
+
if (showingResults && selectedChoice.id === option.id) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (selectedChoice.right === true) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (showingResults && !required) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return false;
|
|
67
|
+
};
|
|
68
|
+
|
|
52
69
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, options && options.filter(function (option) {
|
|
53
70
|
return option.text;
|
|
54
71
|
}).map(function (option) {
|
|
@@ -56,28 +73,17 @@ var Options = function Options(_ref) {
|
|
|
56
73
|
key: option.id,
|
|
57
74
|
className: "".concat(inherited ? 'conversation--question' : 'radio', "\n ").concat(neutralDecisionVisualEffect === option.id ? 'radio-text-clicked' : '')
|
|
58
75
|
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
76
|
+
onChange: function onChange() {
|
|
77
|
+
whenSelectOption(option);
|
|
78
|
+
},
|
|
59
79
|
type: "radio",
|
|
80
|
+
id: option.text,
|
|
60
81
|
name: option.id,
|
|
61
|
-
defaultChecked: selectedChoice.id === option.id
|
|
62
|
-
|
|
82
|
+
defaultChecked: selectedChoice.id === option.id,
|
|
83
|
+
disabled: disabledRadiosAfterAnswer(option)
|
|
84
|
+
}), /*#__PURE__*/_react.default.createElement("label", {
|
|
63
85
|
className: "".concat(option.right ? 'radio-text-success' : 'radio-text-fail'),
|
|
64
|
-
|
|
65
|
-
selectChoice(option);
|
|
66
|
-
},
|
|
67
|
-
role: "button",
|
|
68
|
-
"aria-label": option.text,
|
|
69
|
-
tabIndex: 0,
|
|
70
|
-
onKeyUp: function onKeyUp() {},
|
|
71
|
-
htmlFor: option.id
|
|
72
|
-
}, option.text) : /*#__PURE__*/_react.default.createElement("label", {
|
|
73
|
-
htmlFor: option.id,
|
|
74
|
-
onClick: function onClick() {
|
|
75
|
-
selectChoiceFirstTime(option);
|
|
76
|
-
},
|
|
77
|
-
role: "button",
|
|
78
|
-
"aria-label": option.text,
|
|
79
|
-
tabIndex: 0,
|
|
80
|
-
onKeyUp: function onKeyUp() {}
|
|
86
|
+
htmlFor: option.text
|
|
81
87
|
}, option.text));
|
|
82
88
|
}));
|
|
83
89
|
};
|
|
@@ -839,14 +839,16 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
839
839
|
type: "button",
|
|
840
840
|
onClick: manualBackLine,
|
|
841
841
|
disabled: disableBackButton || !currentMessage.show,
|
|
842
|
-
className: "gat--btn__round ".concat(disableBackButton || !currentMessage.show ? 'disabled' : '')
|
|
842
|
+
className: "gat--btn__round ".concat(disableBackButton || !currentMessage.show ? 'disabled' : ''),
|
|
843
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('storylines.misc.forward') : translate('storylines.misc.rewind')
|
|
843
844
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
844
845
|
className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
|
|
845
846
|
})), /*#__PURE__*/_react.default.createElement("button", {
|
|
846
847
|
type: "button",
|
|
847
848
|
onClick: manualNextLine,
|
|
848
849
|
disabled: !currentMessage.show,
|
|
849
|
-
className: "gat--btn__round \n ".concat(!currentMessage.show ? 'disabled' : '', "\n ").concat(automatic && isEndNode() ? 'glowing-animation' : '')
|
|
850
|
+
className: "gat--btn__round \n ".concat(!currentMessage.show ? 'disabled' : '', "\n ").concat(automatic && isEndNode() ? 'glowing-animation' : ''),
|
|
851
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('storylines.misc.rewind') : translate('storylines.misc.forward')
|
|
850
852
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
851
853
|
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
852
854
|
})))));
|
|
@@ -83,14 +83,14 @@ var FeedbackComponent = function FeedbackComponent(_ref) {
|
|
|
83
83
|
|
|
84
84
|
var statusIcon = function statusIcon() {
|
|
85
85
|
if (success) {
|
|
86
|
-
return 'icon-
|
|
86
|
+
return 'icon-correct-thumb';
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
if (timeExpired) {
|
|
90
90
|
return 'icon-times-up';
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
return 'icon-
|
|
93
|
+
return 'icon-incorrect-thumb';
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
keyboardControl(null, text && functionOnClose && explain ? functionOnClose : null, text && functionOnClose && explain || functionOnClose && shortText ? functionOnClose : null);
|
|
@@ -112,7 +112,8 @@ var FeedbackComponent = function FeedbackComponent(_ref) {
|
|
|
112
112
|
className: "feedback-layer__closeX",
|
|
113
113
|
onClick: function onClick() {
|
|
114
114
|
return functionOnClose();
|
|
115
|
-
}
|
|
115
|
+
},
|
|
116
|
+
"aria-label": translate('storylines.misc.closePiece')
|
|
116
117
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
117
118
|
className: "icon-close"
|
|
118
119
|
})), shortText && /*#__PURE__*/_react.default.createElement("button", {
|
|
@@ -120,7 +121,8 @@ var FeedbackComponent = function FeedbackComponent(_ref) {
|
|
|
120
121
|
className: "feedback-layer__closeX",
|
|
121
122
|
onClick: function onClick() {
|
|
122
123
|
return functionOnClose();
|
|
123
|
-
}
|
|
124
|
+
},
|
|
125
|
+
"aria-label": translate('storylines.misc.closePiece')
|
|
124
126
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
125
127
|
className: "icon-close"
|
|
126
128
|
}))), !shortText && text !== '' && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -36,6 +36,13 @@ var ImageComponent = function ImageComponent(_ref) {
|
|
|
36
36
|
soundActions = _ref.soundActions,
|
|
37
37
|
keyboardControl = _ref.keyboardControl;
|
|
38
38
|
|
|
39
|
+
var translate = function translate(id) {
|
|
40
|
+
return emitEvent({
|
|
41
|
+
type: 'translate',
|
|
42
|
+
payload: id
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
|
|
39
46
|
var _useState = (0, _react.useState)(false),
|
|
40
47
|
_useState2 = _slicedToArray(_useState, 2),
|
|
41
48
|
saved = _useState2[0],
|
|
@@ -84,7 +91,8 @@ var ImageComponent = function ImageComponent(_ref) {
|
|
|
84
91
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
85
92
|
type: "button",
|
|
86
93
|
className: "gat--btn__round gat--btn__close",
|
|
87
|
-
onClick: close
|
|
94
|
+
onClick: close,
|
|
95
|
+
"aria-label": translate('storylines.misc.closePiece')
|
|
88
96
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
89
97
|
className: "icon-close"
|
|
90
98
|
}))) : null));
|
|
@@ -43,12 +43,20 @@ var InventoryItem = function InventoryItem(_ref) {
|
|
|
43
43
|
element = _ref.element,
|
|
44
44
|
onFinish = _ref.onFinish,
|
|
45
45
|
soundActions = _ref.soundActions,
|
|
46
|
-
keyboardControl = _ref.keyboardControl
|
|
46
|
+
keyboardControl = _ref.keyboardControl,
|
|
47
|
+
emitEvent = _ref.emitEvent;
|
|
47
48
|
var orbit = (0, _react.useRef)();
|
|
48
49
|
|
|
49
50
|
var _soundActions = _slicedToArray(soundActions, 1),
|
|
50
51
|
playSound = _soundActions[0];
|
|
51
52
|
|
|
53
|
+
var translate = function translate(id) {
|
|
54
|
+
return emitEvent({
|
|
55
|
+
type: 'translate',
|
|
56
|
+
payload: id
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
52
60
|
if (!element) {
|
|
53
61
|
onFinish();
|
|
54
62
|
return null;
|
|
@@ -84,20 +92,23 @@ var InventoryItem = function InventoryItem(_ref) {
|
|
|
84
92
|
dir: "auto"
|
|
85
93
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
86
94
|
className: "inventory-popup fadeIn--animation ".concat(description ? 'inventory-popup--withdescription' : '')
|
|
87
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
onKeyUp: function onKeyUp() {},
|
|
91
|
-
"aria-label": "close inventory popup",
|
|
95
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
96
|
+
type: "button",
|
|
97
|
+
"aria-label": translate('inventory.closeDetail'),
|
|
92
98
|
className: "inventory-popup__close",
|
|
93
99
|
onClick: function onClick() {
|
|
94
100
|
close();
|
|
95
101
|
}
|
|
96
102
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
97
103
|
className: "icon-close"
|
|
98
|
-
})), /*#__PURE__*/_react.default.createElement("
|
|
104
|
+
})), /*#__PURE__*/_react.default.createElement("h2", {
|
|
99
105
|
className: "inventory-popup__title"
|
|
100
|
-
}, name), description &&
|
|
106
|
+
}, name), description &&
|
|
107
|
+
/*#__PURE__*/
|
|
108
|
+
// more info here: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/717
|
|
109
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
110
|
+
_react.default.createElement("div", {
|
|
111
|
+
tabIndex: "0",
|
|
101
112
|
className: "inventory-popup__description"
|
|
102
113
|
}, description), /*#__PURE__*/_react.default.createElement("div", {
|
|
103
114
|
className: "inventory-popup__image"
|
|
@@ -72,6 +72,7 @@ var PatternComponent = function PatternComponent(_ref) {
|
|
|
72
72
|
className: "pattern__title"
|
|
73
73
|
}, translate('phone.pattern')), /*#__PURE__*/_react.default.createElement("button", {
|
|
74
74
|
type: "button",
|
|
75
|
+
"aria-label": translate('storylines.misc.closePiece'),
|
|
75
76
|
className: "pattern__close gat--btn__round gat--btn__close",
|
|
76
77
|
onClick: function onClick() {
|
|
77
78
|
return close();
|
|
@@ -134,7 +134,8 @@ var PdfComponent = function PdfComponent(_ref) {
|
|
|
134
134
|
onClick: function onClick() {
|
|
135
135
|
emitFinish();
|
|
136
136
|
play('click-ui');
|
|
137
|
-
}
|
|
137
|
+
},
|
|
138
|
+
"aria-label": translate('storylines.misc.closePiece')
|
|
138
139
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
139
140
|
className: "icon-close"
|
|
140
141
|
}))), url && /*#__PURE__*/_react.default.createElement(_PdfVisor.default, {
|
|
@@ -183,6 +183,8 @@ var PdfVisor = function PdfVisor(_ref) {
|
|
|
183
183
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
184
184
|
className: "pdf-box__scrollwrap"
|
|
185
185
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
186
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
187
|
+
tabIndex: "0",
|
|
186
188
|
onScroll: removeOverlay,
|
|
187
189
|
ref: scrollElement,
|
|
188
190
|
className: "pdf-box__scroll ".concat(overlay ? 'pdf-box__scroll--overlay' : '')
|
|
@@ -200,7 +202,8 @@ var PdfVisor = function PdfVisor(_ref) {
|
|
|
200
202
|
disabled: currentPage === 1,
|
|
201
203
|
onClick: function onClick() {
|
|
202
204
|
return turnPage(-1);
|
|
203
|
-
}
|
|
205
|
+
},
|
|
206
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('storylines.misc.nextPage') : translate('storylines.misc.previousPage')
|
|
204
207
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
205
208
|
className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
|
|
206
209
|
})), /*#__PURE__*/_react.default.createElement("button", {
|
|
@@ -209,7 +212,8 @@ var PdfVisor = function PdfVisor(_ref) {
|
|
|
209
212
|
disabled: currentPage === pages,
|
|
210
213
|
onClick: function onClick() {
|
|
211
214
|
return turnPage(1);
|
|
212
|
-
}
|
|
215
|
+
},
|
|
216
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('storylines.misc.previousPage') : translate('storylines.misc.nextPage')
|
|
213
217
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
214
218
|
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
215
219
|
})))));
|
|
@@ -18,12 +18,10 @@ var EmailPill = function EmailPill(_ref) {
|
|
|
18
18
|
className: "email-pill ".concat(error ? ' email-pill--error' : '')
|
|
19
19
|
}, /*#__PURE__*/_react.default.createElement("div", null, text), /*#__PURE__*/_react.default.createElement("div", {
|
|
20
20
|
className: "email-pill__delete"
|
|
21
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
22
|
-
|
|
23
|
-
role: "button",
|
|
24
|
-
onKeyUp: function onKeyUp() {},
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
22
|
+
type: "button",
|
|
25
23
|
onClick: handleClick,
|
|
26
|
-
className: "icon-close",
|
|
24
|
+
className: "icon-close unset-button",
|
|
27
25
|
"aria-label": "icon click"
|
|
28
26
|
})));
|
|
29
27
|
};
|
|
@@ -93,7 +93,7 @@ var StepOne = function StepOne(_ref) {
|
|
|
93
93
|
|
|
94
94
|
var handleKeyDown = function handleKeyDown(e) {
|
|
95
95
|
var inputValue = emailRef.current.value;
|
|
96
|
-
var eCodesWithPeriod = ['Space', 'Comma', 'Period', 'Enter'
|
|
96
|
+
var eCodesWithPeriod = ['Space', 'Comma', 'Period', 'Enter'];
|
|
97
97
|
var eCodesWithoutPeriod = ['Space', 'Comma', 'Enter', 'Tab'];
|
|
98
98
|
|
|
99
99
|
if (inputValue === '' && (eCodesWithPeriod.includes(e.code) || e.keyCode === '186' || e.key === 'Enter' || e.key === ' ')) {
|
|
@@ -147,10 +147,12 @@ var StepOne = function StepOne(_ref) {
|
|
|
147
147
|
className: "referrals-piece__faketextarea",
|
|
148
148
|
onKeyUp: function onKeyUp() {},
|
|
149
149
|
role: "button",
|
|
150
|
-
tabIndex:
|
|
151
|
-
onClick: focusInInput
|
|
150
|
+
tabIndex: "-1",
|
|
151
|
+
onClick: focusInInput,
|
|
152
|
+
"aria-labelledby": "list of emails"
|
|
152
153
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
153
|
-
className: "referrals-piece__scrollarea"
|
|
154
|
+
className: "referrals-piece__scrollarea",
|
|
155
|
+
id: "list of emails"
|
|
154
156
|
}, emailsPills && emailsPills.map(function (emailPill, emailPillIndex) {
|
|
155
157
|
return /*#__PURE__*/_react.default.createElement(_EmailPill.default, {
|
|
156
158
|
text: emailPill.text,
|
|
@@ -161,14 +163,19 @@ var StepOne = function StepOne(_ref) {
|
|
|
161
163
|
},
|
|
162
164
|
emailPillIndex: emailPillIndex
|
|
163
165
|
});
|
|
164
|
-
}), emailsPills.length <= 9 ? /*#__PURE__*/_react.default.createElement("input", {
|
|
166
|
+
}), emailsPills.length <= 9 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("input", {
|
|
167
|
+
id: "email",
|
|
165
168
|
ref: emailRef,
|
|
166
169
|
className: "referrals-piece__inputemail",
|
|
167
170
|
onChange: clearInput,
|
|
168
171
|
onKeyDown: handleKeyDown,
|
|
169
172
|
onBlur: handleKeyDown,
|
|
170
|
-
type: "email"
|
|
171
|
-
|
|
173
|
+
type: "email",
|
|
174
|
+
autoComplete: "off"
|
|
175
|
+
}), /*#__PURE__*/_react.default.createElement("label", {
|
|
176
|
+
className: "referrals-piece__emaillabel",
|
|
177
|
+
htmlFor: "email"
|
|
178
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, translate('puzzles.referrals.inviter.skipButton')))) : null)), /*#__PURE__*/_react.default.createElement("div", {
|
|
172
179
|
dir: (0, _LangIsRtl.default)() ? 'rtl' : 'auto',
|
|
173
180
|
className: "referrals-piece__footervalidation"
|
|
174
181
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -33,15 +33,13 @@ var ApplicableBox = function ApplicableBox(_ref) {
|
|
|
33
33
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
34
|
className: "survey--page__item"
|
|
35
35
|
}, OPTIONS.map(function (option, i) {
|
|
36
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
36
|
+
return /*#__PURE__*/_react.default.createElement("button", {
|
|
37
|
+
type: "button",
|
|
37
38
|
key: option,
|
|
38
39
|
onClick: function onClick() {
|
|
39
40
|
return select(option);
|
|
40
41
|
},
|
|
41
|
-
|
|
42
|
-
tabIndex: 0,
|
|
43
|
-
onKeyUp: function onKeyUp() {},
|
|
44
|
-
className: "survey--response__item ".concat(survey[id] === option ? 'selected' : '')
|
|
42
|
+
className: "unset-button survey--response__item ".concat(survey[id] === option ? 'selected' : '')
|
|
45
43
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
46
44
|
className: "survey--response__index"
|
|
47
45
|
}, LETTERS[i]), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -35,16 +35,13 @@ var OpinionBox = function OpinionBox(_ref) {
|
|
|
35
35
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
36
36
|
className: "survey--points"
|
|
37
37
|
}, OPINION_OPTIONS.map(function (option) {
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement("button", {
|
|
39
39
|
key: option,
|
|
40
|
-
|
|
41
|
-
role: "button",
|
|
42
|
-
onKeyUp: function onKeyUp() {},
|
|
43
|
-
tabIndex: 0,
|
|
44
|
-
"aria-label": option,
|
|
40
|
+
type: "button",
|
|
45
41
|
onClick: function onClick() {
|
|
46
42
|
return select(option);
|
|
47
|
-
}
|
|
43
|
+
},
|
|
44
|
+
className: "unset-button survey--points__item ".concat(survey[id] === option ? 'selected' : '')
|
|
48
45
|
}, option);
|
|
49
46
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
50
47
|
className: "survey--points__labels"
|
|
@@ -116,8 +116,11 @@ var SurveyComponent = function SurveyComponent(_ref) {
|
|
|
116
116
|
}, /*#__PURE__*/_react.default.createElement("span", null, translate('survey.numQuestion', {
|
|
117
117
|
init: page + 1,
|
|
118
118
|
page: PAGES.length
|
|
119
|
-
})), /*#__PURE__*/_react.default.createElement("span", null, translate('auto-evaluation.allQuestionsMandatory'))), /*#__PURE__*/_react.default.createElement("
|
|
120
|
-
className: "survey--questions__item"
|
|
119
|
+
})), /*#__PURE__*/_react.default.createElement("span", null, translate('auto-evaluation.allQuestionsMandatory'))), /*#__PURE__*/_react.default.createElement("label", {
|
|
120
|
+
className: "survey--questions__item",
|
|
121
|
+
htmlFor: translate("survey.question".concat(page + 1), {
|
|
122
|
+
ordinal: page + 1
|
|
123
|
+
})
|
|
121
124
|
}, translate("survey.question".concat(page + 1), {
|
|
122
125
|
ordinal: page + 1
|
|
123
126
|
})), /*#__PURE__*/_react.default.createElement(View, {
|
|
@@ -127,7 +130,10 @@ var SurveyComponent = function SurveyComponent(_ref) {
|
|
|
127
130
|
translate: translate,
|
|
128
131
|
changePage: function changePage(e) {
|
|
129
132
|
return _changePage(false, e);
|
|
130
|
-
}
|
|
133
|
+
},
|
|
134
|
+
literalLabel: translate("survey.question".concat(page + 1), {
|
|
135
|
+
ordinal: page + 1
|
|
136
|
+
})
|
|
131
137
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
132
138
|
className: "test--buttons next"
|
|
133
139
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
@@ -137,7 +143,8 @@ var SurveyComponent = function SurveyComponent(_ref) {
|
|
|
137
143
|
onClick: function onClick() {
|
|
138
144
|
return _changePage(true);
|
|
139
145
|
},
|
|
140
|
-
className: "gat--btn__navigation ".concat(page === 0 ? 'disabled' : '')
|
|
146
|
+
className: "gat--btn__navigation ".concat(page === 0 ? 'disabled' : ''),
|
|
147
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('survey.next') : translate('survey.previous')
|
|
141
148
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
142
149
|
className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
|
|
143
150
|
})), finished && page === PAGES.length - 1 ? /*#__PURE__*/_react.default.createElement("button", {
|
|
@@ -159,7 +166,8 @@ var SurveyComponent = function SurveyComponent(_ref) {
|
|
|
159
166
|
onClick: function onClick() {
|
|
160
167
|
return _changePage(false);
|
|
161
168
|
},
|
|
162
|
-
className: "gat--btn__navigation ".concat(!survey[PAGES[page].id] ? 'disabled' : '')
|
|
169
|
+
className: "gat--btn__navigation ".concat(!survey[PAGES[page].id] ? 'disabled' : ''),
|
|
170
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('survey.previous') : translate('survey.next')
|
|
163
171
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
164
172
|
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
165
173
|
})) : null))));
|
|
@@ -18,7 +18,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
18
18
|
var TextBox = function TextBox(_ref) {
|
|
19
19
|
var setSurveyData = _ref.setSurveyData,
|
|
20
20
|
survey = _ref.survey,
|
|
21
|
-
id = _ref.id
|
|
21
|
+
id = _ref.id,
|
|
22
|
+
literalLabel = _ref.literalLabel;
|
|
22
23
|
|
|
23
24
|
var writeText = function writeText(text) {
|
|
24
25
|
setSurveyData(_objectSpread(_objectSpread({}, survey), {}, _defineProperty({}, id, text)));
|
|
@@ -27,7 +28,13 @@ var TextBox = function TextBox(_ref) {
|
|
|
27
28
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
28
29
|
className: "survey--page__item"
|
|
29
30
|
}, /*#__PURE__*/_react.default.createElement("textarea", {
|
|
31
|
+
ref: function ref(inputElement) {
|
|
32
|
+
if (inputElement) {
|
|
33
|
+
inputElement.focus();
|
|
34
|
+
}
|
|
35
|
+
},
|
|
30
36
|
className: "survey--textarea",
|
|
37
|
+
id: literalLabel,
|
|
31
38
|
value: survey[id],
|
|
32
39
|
onChange: function onChange(event) {
|
|
33
40
|
return writeText(event.target.value);
|
|
@@ -154,7 +154,8 @@ var Container = function Container(_ref) {
|
|
|
154
154
|
return nextPage();
|
|
155
155
|
},
|
|
156
156
|
type: "button",
|
|
157
|
-
className: "gat--btn__navigation ".concat(!answered ? 'disabled' : '')
|
|
157
|
+
className: "gat--btn__navigation ".concat(!answered ? 'disabled' : ''),
|
|
158
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('survey.previous') : translate('survey.next')
|
|
158
159
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
159
160
|
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
160
161
|
})) : /*#__PURE__*/_react.default.createElement("button", {
|
|
@@ -167,7 +168,8 @@ var Container = function Container(_ref) {
|
|
|
167
168
|
}
|
|
168
169
|
},
|
|
169
170
|
type: "button",
|
|
170
|
-
className: "gat--btn__navigation ".concat(!answered ? 'disabled' : '')
|
|
171
|
+
className: "gat--btn__navigation ".concat(!answered ? 'disabled' : ''),
|
|
172
|
+
"aria-label": (0, _LangIsRtl.default)() ? translate('survey.previous') : translate('survey.next')
|
|
171
173
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
172
174
|
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
173
175
|
})))));
|
|
@@ -59,15 +59,13 @@ var Questions = function Questions(_ref) {
|
|
|
59
59
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
60
60
|
className: "test--questions__item"
|
|
61
61
|
}, /*#__PURE__*/_react.default.createElement("span", null, question.text)), filteredAnswers.map(function (answer, index) {
|
|
62
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
62
|
+
return /*#__PURE__*/_react.default.createElement("button", {
|
|
63
|
+
type: "button",
|
|
63
64
|
onClick: function onClick() {
|
|
64
65
|
return !disabled ? updateForm(answer, question.id, index) : null;
|
|
65
66
|
},
|
|
66
|
-
onKeyUp: function onKeyUp() {},
|
|
67
67
|
key: answer.text,
|
|
68
|
-
|
|
69
|
-
tabIndex: 0,
|
|
70
|
-
className: "test--response__item ".concat(disabled ? 'review' : '', " ").concat(getClass(answer))
|
|
68
|
+
className: "unset-button test--response__item ".concat(disabled ? 'review' : '', " ").concat(getClass(answer))
|
|
71
69
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
72
70
|
className: "test--response__index"
|
|
73
71
|
}, LABELS_INDEX[index]), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -37,6 +37,14 @@ var UrlComponent = function UrlComponent(_ref) {
|
|
|
37
37
|
documentType = _ref.documentType,
|
|
38
38
|
soundActions = _ref.soundActions,
|
|
39
39
|
keyboardControl = _ref.keyboardControl;
|
|
40
|
+
|
|
41
|
+
var translate = function translate(id) {
|
|
42
|
+
return emitEvent({
|
|
43
|
+
type: 'translate',
|
|
44
|
+
payload: id
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
40
48
|
var item = {
|
|
41
49
|
documentType: documentType,
|
|
42
50
|
name: nameLabel,
|
|
@@ -67,13 +75,11 @@ var UrlComponent = function UrlComponent(_ref) {
|
|
|
67
75
|
className: "popup--layer"
|
|
68
76
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
69
77
|
className: "popup popup--link"
|
|
70
|
-
}, !viewed && clicked ? /*#__PURE__*/_react.default.createElement("
|
|
71
|
-
className: "popup--close",
|
|
78
|
+
}, !viewed && clicked ? /*#__PURE__*/_react.default.createElement("button", {
|
|
79
|
+
className: "popup--close unset-button",
|
|
72
80
|
"data-testid": "close",
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
onKeyUp: function onKeyUp() {},
|
|
76
|
-
"aria-label": "link",
|
|
81
|
+
type: "button",
|
|
82
|
+
"aria-label": translate('storylines.misc.closePiece'),
|
|
77
83
|
onClick: function onClick() {
|
|
78
84
|
return close();
|
|
79
85
|
}
|
|
@@ -30,6 +30,14 @@ var VideoComponent = function VideoComponent(_ref) {
|
|
|
30
30
|
img = _ref.img,
|
|
31
31
|
imgIdLabel = _ref.imgId_labelId,
|
|
32
32
|
keyboardControl = _ref.keyboardControl;
|
|
33
|
+
|
|
34
|
+
var translate = function translate(id) {
|
|
35
|
+
return emitEvent({
|
|
36
|
+
type: 'translate',
|
|
37
|
+
payload: id
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
33
41
|
var url = document.url;
|
|
34
42
|
var item = (0, _react.useMemo)(function () {
|
|
35
43
|
return {
|
|
@@ -70,7 +78,8 @@ var VideoComponent = function VideoComponent(_ref) {
|
|
|
70
78
|
viewed: viewed,
|
|
71
79
|
endVideo: function endVideo() {
|
|
72
80
|
return _endVideo();
|
|
73
|
-
}
|
|
81
|
+
},
|
|
82
|
+
translate: translate
|
|
74
83
|
});
|
|
75
84
|
};
|
|
76
85
|
|
|
@@ -11,19 +11,20 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
11
11
|
|
|
12
12
|
var ControlButtons = function ControlButtons(_ref) {
|
|
13
13
|
var pauseVideo = _ref.pauseVideo,
|
|
14
|
-
paused = _ref.paused
|
|
15
|
-
|
|
14
|
+
paused = _ref.paused,
|
|
15
|
+
translate = _ref.translate;
|
|
16
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
16
17
|
className: "video--controls__buttons"
|
|
17
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
className: !paused ? 'icon-pause' : 'icon-play',
|
|
21
|
-
|
|
22
|
-
tabIndex: 0,
|
|
18
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
19
|
+
id: "playPause",
|
|
20
|
+
"aria-label": !paused ? translate('storylines.misc.pause') : translate('storylines.misc.play'),
|
|
21
|
+
className: !paused ? 'unset-button icon-pause' : 'unset-button icon-play',
|
|
22
|
+
type: "button",
|
|
23
23
|
onClick: function onClick() {
|
|
24
24
|
pauseVideo();
|
|
25
|
+
document.querySelector('#playPause').blur();
|
|
25
26
|
}
|
|
26
|
-
}))
|
|
27
|
+
}));
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
ControlButtons.defaultProps = {
|
|
@@ -11,23 +11,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
11
11
|
|
|
12
12
|
var FinishedVideoButtons = function FinishedVideoButtons(_ref) {
|
|
13
13
|
var restart = _ref.restart,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (!finished) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
|
|
14
|
+
translate = _ref.translate;
|
|
20
15
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
21
16
|
className: "video--extra__actions video--extra__actions--widthTransparencyLayer position--absolute z-index1"
|
|
22
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
23
|
-
|
|
24
|
-
"aria-label": "rewind video",
|
|
25
|
-
tabIndex: 0,
|
|
26
|
-
onKeyUp: function onKeyUp() {},
|
|
17
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
18
|
+
type: "button",
|
|
27
19
|
onClick: function onClick() {
|
|
28
20
|
restart();
|
|
29
21
|
},
|
|
30
|
-
className: "gat--btn gat--btn__secondary"
|
|
22
|
+
className: "gat--btn gat--btn__secondary",
|
|
23
|
+
"aria-label": translate('video.replay')
|
|
31
24
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
32
25
|
className: "icon-rewind"
|
|
33
26
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -14,14 +14,14 @@ var skipButton = function skipButton(_ref) {
|
|
|
14
14
|
mandatory = _ref.mandatory,
|
|
15
15
|
finished = _ref.finished,
|
|
16
16
|
skip = _ref.skip,
|
|
17
|
-
mandatoryHasBeenViewed = _ref.mandatoryHasBeenViewed
|
|
17
|
+
mandatoryHasBeenViewed = _ref.mandatoryHasBeenViewed,
|
|
18
|
+
translate = _ref.translate;
|
|
18
19
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, mandatory && viewed || !mandatory || finished || mandatoryHasBeenViewed ? /*#__PURE__*/_react.default.createElement("div", {
|
|
19
20
|
className: "position--absolute right top z-index1"
|
|
20
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
21
22
|
className: "gat--btn__round gat--btn__close",
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"aria-label": "close",
|
|
23
|
+
type: "button",
|
|
24
|
+
"aria-label": translate('storylines.misc.closePiece'),
|
|
25
25
|
onKeyUp: function onKeyUp() {},
|
|
26
26
|
onClick: function onClick() {
|
|
27
27
|
skip();
|
|
@@ -41,22 +41,27 @@ var VideoControllers = function VideoControllers(_ref) {
|
|
|
41
41
|
setVolume = _ref.setVolume,
|
|
42
42
|
setTimePoint = _ref.setTimePoint,
|
|
43
43
|
audioAnimation = _ref.audioAnimation,
|
|
44
|
-
mandatoryHasBeenViewed = _ref.mandatoryHasBeenViewed
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
finished: finished
|
|
49
|
-
}), /*#__PURE__*/_react.default.createElement(_FinishedVideoButtons.default, {
|
|
50
|
-
finished: finished,
|
|
51
|
-
restart: restart
|
|
52
|
-
}), /*#__PURE__*/_react.default.createElement(_SkipButton.default, {
|
|
44
|
+
mandatoryHasBeenViewed = _ref.mandatoryHasBeenViewed,
|
|
45
|
+
translate = _ref.translate,
|
|
46
|
+
visibility = _ref.visibility;
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_SkipButton.default, {
|
|
53
48
|
mandatory: mandatory,
|
|
54
49
|
finished: finished,
|
|
55
50
|
viewed: viewed,
|
|
56
51
|
skip: skip,
|
|
57
52
|
rewind: rewind,
|
|
58
|
-
mandatoryHasBeenViewed: mandatoryHasBeenViewed
|
|
53
|
+
mandatoryHasBeenViewed: mandatoryHasBeenViewed,
|
|
54
|
+
translate: translate
|
|
59
55
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
+
className: "video--controls-wrap ".concat(visibility ? 'video--controls-wrap--hidden' : '')
|
|
57
|
+
}, audioAnimation ? null : /*#__PURE__*/_react.default.createElement(_PlayInitButton.default, {
|
|
58
|
+
play: pause,
|
|
59
|
+
paused: paused,
|
|
60
|
+
finished: finished
|
|
61
|
+
}), finished ? /*#__PURE__*/_react.default.createElement(_FinishedVideoButtons.default, {
|
|
62
|
+
restart: restart,
|
|
63
|
+
translate: translate
|
|
64
|
+
}) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
60
65
|
className: "video--controls"
|
|
61
66
|
}, /*#__PURE__*/_react.default.createElement(_BufferBar.default, {
|
|
62
67
|
mandatory: mandatory,
|
|
@@ -75,13 +80,14 @@ var VideoControllers = function VideoControllers(_ref) {
|
|
|
75
80
|
className: "audio-animation ".concat(paused ? 'audio-animation--notAnimate ' : null)
|
|
76
81
|
})) : null, /*#__PURE__*/_react.default.createElement(_ControlButtons.default, {
|
|
77
82
|
paused: paused,
|
|
78
|
-
pauseVideo: pause
|
|
83
|
+
pauseVideo: pause,
|
|
84
|
+
translate: translate
|
|
79
85
|
}), /*#__PURE__*/_react.default.createElement(_VolumeBar.default, {
|
|
80
86
|
muted: muted,
|
|
81
87
|
mute: mute,
|
|
82
88
|
volume: volume,
|
|
83
89
|
setVolume: setVolume
|
|
84
|
-
}))));
|
|
90
|
+
})))));
|
|
85
91
|
};
|
|
86
92
|
|
|
87
93
|
VideoControllers.defaultProps = {
|
|
@@ -42,7 +42,8 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
42
42
|
viewed = _ref.viewed,
|
|
43
43
|
backgroundImage = _ref.backgroundImage,
|
|
44
44
|
soundActions = _ref.soundActions,
|
|
45
|
-
endVideo = _ref.endVideo
|
|
45
|
+
endVideo = _ref.endVideo,
|
|
46
|
+
translate = _ref.translate;
|
|
46
47
|
|
|
47
48
|
var _useState = (0, _react.useState)(false),
|
|
48
49
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -241,7 +242,8 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
241
242
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
242
243
|
className: "video ".concat(required && !mandatoryHasBeenViewed && !viewed ? 'forward-disabled' : ''),
|
|
243
244
|
style: isAudio ? configForAudio : null
|
|
244
|
-
}, !isEmbeddedVideo ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
245
|
+
}, !isEmbeddedVideo ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_VideoControllers.default, {
|
|
246
|
+
visibility: hiddenControls,
|
|
245
247
|
mandatoryHasBeenViewed: mandatoryHasBeenViewed,
|
|
246
248
|
audioAnimation: !!isAudio,
|
|
247
249
|
skip: endVideo,
|
|
@@ -261,7 +263,8 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
261
263
|
rewind: rewind,
|
|
262
264
|
pause: pause,
|
|
263
265
|
volumeState: volume,
|
|
264
|
-
setVolume: updateVolume
|
|
266
|
+
setVolume: updateVolume,
|
|
267
|
+
translate: translate
|
|
265
268
|
}), /*#__PURE__*/_react.default.createElement("video", _extends({
|
|
266
269
|
onMouseMove: function onMouseMove() {
|
|
267
270
|
return handleHideControls();
|
|
@@ -269,6 +272,9 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
269
272
|
onClick: function onClick() {
|
|
270
273
|
handleHideControls();
|
|
271
274
|
},
|
|
275
|
+
onFocus: function onFocus() {
|
|
276
|
+
handleHideControls();
|
|
277
|
+
},
|
|
272
278
|
onCanPlayThrough: onCanPlay,
|
|
273
279
|
onWaiting: onWaiting,
|
|
274
280
|
onEnded: onEnded,
|
|
@@ -290,11 +296,9 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
290
296
|
className: "popup-message"
|
|
291
297
|
}, /*#__PURE__*/_react.default.createElement("p", null, Math.floor(loadedPercentage))))) : null) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
292
298
|
className: "position--absolute right top z-index1"
|
|
293
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
onKeyUp: function onKeyUp() {},
|
|
297
|
-
"aria-label": "end video",
|
|
299
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
300
|
+
type: "button",
|
|
301
|
+
"aria-label": translate('storylines.misc.closePiece'),
|
|
298
302
|
className: "gat--btn__round gat--btn__close",
|
|
299
303
|
onClick: function onClick() {
|
|
300
304
|
playSound('click-ui');
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@gamelearn/arcade-components",
|
|
3
3
|
"author": "Gamelearn",
|
|
4
4
|
"license": "unlicense",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.20.0-hotfix-GAT-5733",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/runtime": "^7.18.6",
|
|
17
|
-
"@gamelearn/arcade-styles": "2.14.
|
|
17
|
+
"@gamelearn/arcade-styles": "2.14.8",
|
|
18
18
|
"@gamelearn/arcade-three-core": "1.17.2",
|
|
19
19
|
"@react-three/drei": "9.4.3",
|
|
20
20
|
"@react-three/fiber": "8.0.17",
|