@gamelearn/arcade-components 2.41.1 → 3.0.2
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/README.md +9 -6
- package/dist/arcade-components.cjs +274 -0
- package/dist/arcade-components.js +57929 -0
- package/package.json +74 -73
- package/dist/components/animation-component/components/AnimationComponent.js +0 -98
- package/dist/components/animation-component/index.js +0 -10
- package/dist/components/animation-component/mocks/mockForStory.js +0 -26
- package/dist/components/auto-evaluation-component/components/AutoEvaluation.js +0 -215
- package/dist/components/auto-evaluation-component/components/EndScreen.js +0 -43
- package/dist/components/auto-evaluation-component/components/StartScreen.js +0 -32
- package/dist/components/auto-evaluation-component/index.js +0 -10
- package/dist/components/auto-evaluation-component/mocks/mockForStory.js +0 -38
- package/dist/components/cards-selector-puzzle-component/components/Board/index.js +0 -159
- package/dist/components/cards-selector-puzzle-component/components/Card/index.js +0 -115
- package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +0 -289
- package/dist/components/cards-selector-puzzle-component/index.js +0 -10
- package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +0 -446
- package/dist/components/cartel-component/components/CartelComponent.js +0 -124
- package/dist/components/cartel-component/index.js +0 -10
- package/dist/components/chained-image-click-puzzle-component/components/ChainedImageClickPuzzleComponent.js +0 -80
- package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js +0 -182
- package/dist/components/chained-image-click-puzzle-component/index.js +0 -10
- package/dist/components/chained-image-click-puzzle-component/mocks/mockForStory.js +0 -413
- package/dist/components/comic-component/components/ComicComponent.js +0 -201
- package/dist/components/comic-component/components/Slide.js +0 -31
- package/dist/components/comic-component/components/Vignette.js +0 -70
- package/dist/components/comic-component/index.js +0 -10
- package/dist/components/comic-component/mocks/mockForStory.js +0 -314
- package/dist/components/conversational-component/components/ConversationalComponent.js +0 -101
- package/dist/components/conversational-component/index.js +0 -10
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +0 -543
- package/dist/components/conversational-pro-component/components/Message.js +0 -37
- package/dist/components/conversational-pro-component/components/Slot.js +0 -92
- package/dist/components/conversational-pro-component/components/SlotList.js +0 -162
- package/dist/components/conversational-pro-component/components/scene/Panel.js +0 -179
- package/dist/components/conversational-pro-component/components/scene/Panels.js +0 -46
- package/dist/components/conversational-pro-component/components/scene/index.js +0 -77
- package/dist/components/conversational-pro-component/index.js +0 -10
- package/dist/components/conversational-pro-component/mocks/mockForStory.js +0 -1529
- package/dist/components/cracker-puzzle-component/components/CrackerPuzzleComponent.js +0 -261
- package/dist/components/cracker-puzzle-component/components/DrawGrid/index.js +0 -33
- package/dist/components/cracker-puzzle-component/components/DrawItem/index.js +0 -48
- package/dist/components/cracker-puzzle-component/components/DrawRow/index.js +0 -43
- package/dist/components/cracker-puzzle-component/components/colors.js +0 -12
- package/dist/components/cracker-puzzle-component/components/helpers.js +0 -133
- package/dist/components/cracker-puzzle-component/index.js +0 -10
- package/dist/components/cracker-puzzle-component/mocks/mockForStory.js +0 -277
- package/dist/components/decision-component/components/DecisionBody.js +0 -116
- package/dist/components/decision-component/components/DecisionComponent.js +0 -248
- package/dist/components/decision-component/components/Feedback.js +0 -40
- package/dist/components/decision-component/components/Options.js +0 -74
- package/dist/components/decision-component/index.js +0 -10
- package/dist/components/decision-component/mocks/mockForStory.js +0 -166
- package/dist/components/dialog-component/components/BubbleWrapper.js +0 -39
- package/dist/components/dialog-component/components/DialogComponent.js +0 -779
- package/dist/components/dialog-component/components/DialogDecision.js +0 -44
- package/dist/components/dialog-component/components/SpeechBubbleComponent.js +0 -66
- package/dist/components/dialog-component/index.js +0 -10
- package/dist/components/dialog-component/mocks/mockForStory.js +0 -550
- package/dist/components/drag-item-puzzle-component/components/DragItemPuzzleComponent.js +0 -361
- package/dist/components/drag-item-puzzle-component/index.js +0 -10
- package/dist/components/drag-item-puzzle-component/mocks/mockForStory.js +0 -74
- package/dist/components/feedback-component/components/FeedbackComponent.js +0 -126
- package/dist/components/feedback-component/index.js +0 -10
- package/dist/components/feedback-component/mocks/mockForStory.js +0 -52
- package/dist/components/frame-click-puzzle-component/components/Counter/index.js +0 -24
- package/dist/components/frame-click-puzzle-component/components/CurrentFramePuzzle.js +0 -196
- package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +0 -178
- package/dist/components/frame-click-puzzle-component/components/Tooltip/index.js +0 -23
- package/dist/components/frame-click-puzzle-component/index.js +0 -10
- package/dist/components/frame-click-puzzle-component/mocks/mockForStory.js +0 -717
- package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +0 -255
- package/dist/components/hacker-puzzle-component/components/languages.js +0 -13
- package/dist/components/hacker-puzzle-component/index.js +0 -10
- package/dist/components/hacker-puzzle-component/mocks/mockForStory.js +0 -103
- package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +0 -488
- package/dist/components/hanged-puzzle-component/index.js +0 -10
- package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +0 -61
- package/dist/components/hanged-puzzle-component/utils.js +0 -64
- package/dist/components/image-click-puzzle-component/components/ImageClickPuzzleComponent.js +0 -40
- package/dist/components/image-click-puzzle-component/index.js +0 -10
- package/dist/components/image-click-puzzle-component/mocks/mockForStory.js +0 -427
- package/dist/components/image-click-wrapper-component/components/CountDown/index.js +0 -18
- package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +0 -472
- package/dist/components/image-click-wrapper-component/components/TimerDialog/index.js +0 -26
- package/dist/components/image-click-wrapper-component/index.js +0 -10
- package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +0 -432
- package/dist/components/image-component/components/ImageComponent.js +0 -83
- package/dist/components/image-component/index.js +0 -10
- package/dist/components/image-component/mocks/mockForStory.js +0 -52
- package/dist/components/index.js +0 -260
- package/dist/components/inventory-item/components/InventoryItem.js +0 -120
- package/dist/components/inventory-item/index.js +0 -10
- package/dist/components/inventory-item/mocks/mockForStory.js +0 -29
- package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +0 -275
- package/dist/components/keyboard-puzzle-component/index.js +0 -10
- package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +0 -40
- package/dist/components/konva-components/Area/index.js +0 -170
- package/dist/components/konva-components/KonvaMapper.js +0 -185
- package/dist/components/lectures-component/components/LectureButtons.js +0 -40
- package/dist/components/lectures-component/components/LecturesComponent.js +0 -157
- package/dist/components/lectures-component/index.js +0 -10
- package/dist/components/lectures-component/mocks/mockForStory.js +0 -39
- package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +0 -243
- package/dist/components/login-puzzle-component/index.js +0 -10
- package/dist/components/login-puzzle-component/mocks/mockForStory.js +0 -38
- package/dist/components/notice-component/components/NoticeComponent.js +0 -96
- package/dist/components/notice-component/index.js +0 -10
- package/dist/components/notice-component/mocks/mockForStory.js +0 -20
- package/dist/components/pattern-component/components/PatternComponent.js +0 -78
- package/dist/components/pattern-component/index.js +0 -10
- package/dist/components/pattern-component/mocks/mockForStory.js +0 -35
- package/dist/components/pdf-component/components/PdfComponent.js +0 -122
- package/dist/components/pdf-component/components/PdfVisor.js +0 -187
- package/dist/components/pdf-component/index.js +0 -20
- package/dist/components/pdf-component/mocks/mockForProps.js +0 -38
- package/dist/components/referral-component/components/EmailPill.js +0 -26
- package/dist/components/referral-component/components/ReferralComponent.js +0 -115
- package/dist/components/referral-component/components/StepOne.js +0 -170
- package/dist/components/referral-component/components/StepTwo.js +0 -57
- package/dist/components/referral-component/index.js +0 -10
- package/dist/components/referral-component/mocks/mockForStory.js +0 -40
- package/dist/components/survey-component/components/ApplicableBox.js +0 -49
- package/dist/components/survey-component/components/OpinionBox.js +0 -45
- package/dist/components/survey-component/components/SurveyComponent.js +0 -150
- package/dist/components/survey-component/components/TextBox.js +0 -40
- package/dist/components/survey-component/index.js +0 -10
- package/dist/components/survey-component/mocks/mockForStory.js +0 -14
- package/dist/components/terminal-puzzle-component/components/FilesGroup/Item.js +0 -28
- package/dist/components/terminal-puzzle-component/components/FilesGroup/index.js +0 -76
- package/dist/components/terminal-puzzle-component/components/Image/index.js +0 -22
- package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +0 -216
- package/dist/components/terminal-puzzle-component/components/Visor/index.js +0 -129
- package/dist/components/terminal-puzzle-component/components/utils/index.js +0 -26
- package/dist/components/terminal-puzzle-component/index.js +0 -10
- package/dist/components/terminal-puzzle-component/mocks/mockForStory.js +0 -188
- package/dist/components/test-component/components/Container.js +0 -211
- package/dist/components/test-component/components/Feedbacks.js +0 -48
- package/dist/components/test-component/components/Questions.js +0 -145
- package/dist/components/test-component/components/Results.js +0 -208
- package/dist/components/test-component/components/TestComponent.js +0 -302
- package/dist/components/test-component/index.js +0 -10
- package/dist/components/test-component/mocks/mockForStory.js +0 -113
- package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +0 -387
- package/dist/components/text-click-puzzle-component/index.js +0 -10
- package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +0 -485
- package/dist/components/text-click-puzzle-component/utils/index.js +0 -76
- package/dist/components/url-component/components/UrlComponent.js +0 -88
- package/dist/components/url-component/index.js +0 -10
- package/dist/components/url-component/mocks/mockForProps.js +0 -20
- package/dist/components/video-component/components/VideoComponent.js +0 -73
- package/dist/components/video-component/index.js +0 -10
- package/dist/components/video-component/mocks/mockForStory.js +0 -94
- package/dist/components/video-visor/components/VideoControllers/BufferBar.js +0 -108
- package/dist/components/video-visor/components/VideoControllers/ControlButtons.js +0 -31
- package/dist/components/video-visor/components/VideoControllers/FinishedVideoButtons.js +0 -32
- package/dist/components/video-visor/components/VideoControllers/PlayInitButton.js +0 -37
- package/dist/components/video-visor/components/VideoControllers/SkipButton.js +0 -37
- package/dist/components/video-visor/components/VideoControllers/Timer.js +0 -37
- package/dist/components/video-visor/components/VideoControllers/VolumeBar.js +0 -92
- package/dist/components/video-visor/components/VideoControllers/index.js +0 -122
- package/dist/components/video-visor/components/VideoVisor.js +0 -271
- package/dist/components/video-visor/index.js +0 -10
- package/dist/components/video-visor/mocks/mockForStory.js +0 -42
- package/dist/components/web-builder-puzzle-component/Popups/PopupColorComponent/index.js +0 -87
- package/dist/components/web-builder-puzzle-component/Popups/PopupImageComponent/index.js +0 -94
- package/dist/components/web-builder-puzzle-component/Popups/PopupTextComponent/index.js +0 -114
- package/dist/components/web-builder-puzzle-component/Popups/index.js +0 -27
- package/dist/components/web-builder-puzzle-component/Templates/Bank.js +0 -98
- package/dist/components/web-builder-puzzle-component/Templates/Facebook.js +0 -37
- package/dist/components/web-builder-puzzle-component/Templates/resourcePath.js +0 -9
- package/dist/components/web-builder-puzzle-component/components/EditButton/index.js +0 -28
- package/dist/components/web-builder-puzzle-component/components/Feedback/index.js +0 -41
- package/dist/components/web-builder-puzzle-component/components/PublishButton/index.js +0 -29
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/BankBody.js +0 -118
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/FacebookBody.js +0 -149
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/index.js +0 -25
- package/dist/components/web-builder-puzzle-component/components/WebBuilderFront/index.js +0 -89
- package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/BankHeader.js +0 -84
- package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/FacebookHeader.js +0 -38
- package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/index.js +0 -40
- package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +0 -302
- package/dist/components/web-builder-puzzle-component/components/WebBuilderTopBar/index.js +0 -30
- package/dist/components/web-builder-puzzle-component/index.js +0 -10
- package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +0 -27
- package/dist/components/writer-puzzle-component/components/ElectionComponent.js +0 -69
- package/dist/components/writer-puzzle-component/components/FeedbackComponent.js +0 -97
- package/dist/components/writer-puzzle-component/components/FeedbackElement.js +0 -32
- package/dist/components/writer-puzzle-component/components/FinishedTextComponent.js +0 -25
- package/dist/components/writer-puzzle-component/components/FixedComponent.js +0 -120
- package/dist/components/writer-puzzle-component/components/SingleElection.js +0 -85
- package/dist/components/writer-puzzle-component/components/WriterPuzzleComponent.js +0 -450
- package/dist/components/writer-puzzle-component/index.js +0 -10
- package/dist/components/writer-puzzle-component/mocks/mockForStory.js +0 -1194
- package/dist/components/zoom-test/components/ZoomTest.js +0 -73
- package/dist/components/zoom-test/index.js +0 -10
- package/dist/components/zoom-test/mocks/mockForStory.js +0 -21
- package/dist/helpers/LangIsRtl.js +0 -16
- package/dist/helpers/LightSet.js +0 -35
- package/dist/helpers/LodController.js +0 -28
- package/dist/helpers/deviceDetection.js +0 -21
- package/dist/helpers/drawLOD.js +0 -310
- package/dist/helpers/index.js +0 -268
- package/dist/helpers/lodStats.js +0 -55
- package/dist/helpers/mocker.js +0 -116
- package/dist/helpers/useEkho.js +0 -172
- package/dist/helpers/useGLB.js +0 -57
- package/dist/helpers/useStateMachine.js +0 -277
- package/dist/helpers/useTimeout.js +0 -32
- package/dist/helpers/useWindowSize.js +0 -44
- package/dist/index.js +0 -16
- package/dist/test/testSceneWrapper.js +0 -31
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.mockProps5 = exports.mockProps4 = exports.mockProps3 = exports.mockProps2 = exports.mockProps = void 0;
|
|
7
|
-
var _mocker = require("helpers/mocker");
|
|
8
|
-
var mockProps = {
|
|
9
|
-
emitEvent: _mocker.emitEvent,
|
|
10
|
-
soundActions: _mocker.soundActions,
|
|
11
|
-
keyboardControl: _mocker.keyboardControl,
|
|
12
|
-
disableExit: function disableExit() {},
|
|
13
|
-
setResolveAction: function setResolveAction() {},
|
|
14
|
-
velocity: 'slow',
|
|
15
|
-
difficulty: 'easy',
|
|
16
|
-
nodeTitle: 'gfhfgh',
|
|
17
|
-
password: 'me7nack',
|
|
18
|
-
info: {
|
|
19
|
-
solution: {
|
|
20
|
-
right: {
|
|
21
|
-
desc: 'completado',
|
|
22
|
-
rewards: [{
|
|
23
|
-
id: 'k49zf40n',
|
|
24
|
-
name: 'asd',
|
|
25
|
-
points: 4,
|
|
26
|
-
type: 'score'
|
|
27
|
-
}]
|
|
28
|
-
},
|
|
29
|
-
wrong: {
|
|
30
|
-
desc: 'cghcgh',
|
|
31
|
-
rewards: [{
|
|
32
|
-
id: 'k49zf40n',
|
|
33
|
-
name: 'asd',
|
|
34
|
-
points: 44,
|
|
35
|
-
type: 'score'
|
|
36
|
-
}]
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
hint: {
|
|
40
|
-
active: true,
|
|
41
|
-
desc: 'asdfas',
|
|
42
|
-
rewards: [{
|
|
43
|
-
id: 'k49zf40n',
|
|
44
|
-
name: 'asd',
|
|
45
|
-
points: 22,
|
|
46
|
-
type: 'score'
|
|
47
|
-
}]
|
|
48
|
-
},
|
|
49
|
-
resolve: {
|
|
50
|
-
rewards: [{
|
|
51
|
-
id: 'k49zf40n',
|
|
52
|
-
name: 'asd',
|
|
53
|
-
points: 55,
|
|
54
|
-
type: 'score'
|
|
55
|
-
}]
|
|
56
|
-
},
|
|
57
|
-
instructions: 'cghgfdhgch',
|
|
58
|
-
description: 'description'
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
exports.mockProps = mockProps;
|
|
62
|
-
var mockProps2 = {
|
|
63
|
-
emitEvent: _mocker.emitEvent,
|
|
64
|
-
soundActions: _mocker.soundActions,
|
|
65
|
-
keyboardControl: _mocker.keyboardControl,
|
|
66
|
-
disableExit: function disableExit() {},
|
|
67
|
-
setResolveAction: function setResolveAction() {},
|
|
68
|
-
velocity: 'fast',
|
|
69
|
-
difficulty: 'medium',
|
|
70
|
-
nodeTitle: 'gfhfgh',
|
|
71
|
-
password: 'Mi7nicK',
|
|
72
|
-
info: {
|
|
73
|
-
solution: {
|
|
74
|
-
right: {
|
|
75
|
-
desc: 'cghc',
|
|
76
|
-
rewards: [{
|
|
77
|
-
id: 'k49zf40n',
|
|
78
|
-
name: 'asd',
|
|
79
|
-
points: 4,
|
|
80
|
-
type: 'score'
|
|
81
|
-
}]
|
|
82
|
-
},
|
|
83
|
-
wrong: {
|
|
84
|
-
desc: 'cghcgh',
|
|
85
|
-
rewards: [{
|
|
86
|
-
id: 'k49zf40n',
|
|
87
|
-
name: 'asd',
|
|
88
|
-
points: 44,
|
|
89
|
-
type: 'score'
|
|
90
|
-
}]
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
hint: {
|
|
94
|
-
active: true,
|
|
95
|
-
desc: 'asdfas',
|
|
96
|
-
rewards: [{
|
|
97
|
-
id: 'k49zf40n',
|
|
98
|
-
name: 'asd',
|
|
99
|
-
points: 22,
|
|
100
|
-
type: 'score'
|
|
101
|
-
}]
|
|
102
|
-
},
|
|
103
|
-
resolve: {
|
|
104
|
-
rewards: [{
|
|
105
|
-
id: 'k49zf40n',
|
|
106
|
-
name: 'asd',
|
|
107
|
-
points: 55,
|
|
108
|
-
type: 'score'
|
|
109
|
-
}]
|
|
110
|
-
},
|
|
111
|
-
instructions: 'cghgfdhgch',
|
|
112
|
-
description: 'description'
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
exports.mockProps2 = mockProps2;
|
|
116
|
-
var mockProps3 = {
|
|
117
|
-
emitEvent: _mocker.emitEvent,
|
|
118
|
-
soundActions: _mocker.soundActions,
|
|
119
|
-
keyboardControl: _mocker.keyboardControl,
|
|
120
|
-
disableExit: function disableExit() {},
|
|
121
|
-
setResolveAction: function setResolveAction() {},
|
|
122
|
-
velocity: 'fastest',
|
|
123
|
-
difficulty: 'hard',
|
|
124
|
-
nodeTitle: 'gfhfgh',
|
|
125
|
-
password: 'Mi7nicK',
|
|
126
|
-
info: {
|
|
127
|
-
solution: {
|
|
128
|
-
right: {
|
|
129
|
-
desc: 'cghc',
|
|
130
|
-
rewards: [{
|
|
131
|
-
id: 'k49zf40n',
|
|
132
|
-
name: 'asd',
|
|
133
|
-
points: 4,
|
|
134
|
-
type: 'score'
|
|
135
|
-
}]
|
|
136
|
-
},
|
|
137
|
-
wrong: {
|
|
138
|
-
desc: 'cghcgh',
|
|
139
|
-
rewards: [{
|
|
140
|
-
id: 'k49zf40n',
|
|
141
|
-
name: 'asd',
|
|
142
|
-
points: 44,
|
|
143
|
-
type: 'score'
|
|
144
|
-
}]
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
hint: {
|
|
148
|
-
active: true,
|
|
149
|
-
desc: 'asdfas',
|
|
150
|
-
rewards: [{
|
|
151
|
-
id: 'k49zf40n',
|
|
152
|
-
name: 'asd',
|
|
153
|
-
points: 22,
|
|
154
|
-
type: 'score'
|
|
155
|
-
}]
|
|
156
|
-
},
|
|
157
|
-
resolve: {
|
|
158
|
-
rewards: [{
|
|
159
|
-
id: 'k49zf40n',
|
|
160
|
-
name: 'asd',
|
|
161
|
-
points: 55,
|
|
162
|
-
type: 'score'
|
|
163
|
-
}]
|
|
164
|
-
},
|
|
165
|
-
instructions: 'cghgfdhgch',
|
|
166
|
-
description: 'description'
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
exports.mockProps3 = mockProps3;
|
|
170
|
-
var mockProps4 = {
|
|
171
|
-
emitEvent: _mocker.emitEvent,
|
|
172
|
-
soundActions: _mocker.soundActions,
|
|
173
|
-
keyboardControl: _mocker.keyboardControl,
|
|
174
|
-
disableExit: function disableExit() {},
|
|
175
|
-
setResolveAction: function setResolveAction() {},
|
|
176
|
-
velocity: 'fastest',
|
|
177
|
-
difficulty: 'hard',
|
|
178
|
-
nodeTitle: 'gfhfgh',
|
|
179
|
-
password: 'oioioioioioioioioioioioioio',
|
|
180
|
-
info: {
|
|
181
|
-
solution: {
|
|
182
|
-
right: {
|
|
183
|
-
desc: 'cghc',
|
|
184
|
-
rewards: [{
|
|
185
|
-
id: 'k49zf40n',
|
|
186
|
-
name: 'asd',
|
|
187
|
-
points: 4,
|
|
188
|
-
type: 'score'
|
|
189
|
-
}]
|
|
190
|
-
},
|
|
191
|
-
wrong: {
|
|
192
|
-
desc: 'cghcgh',
|
|
193
|
-
rewards: [{
|
|
194
|
-
id: 'k49zf40n',
|
|
195
|
-
name: 'asd',
|
|
196
|
-
points: 44,
|
|
197
|
-
type: 'score'
|
|
198
|
-
}]
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
hint: {
|
|
202
|
-
active: true,
|
|
203
|
-
desc: 'asdfas',
|
|
204
|
-
rewards: [{
|
|
205
|
-
id: 'k49zf40n',
|
|
206
|
-
name: 'asd',
|
|
207
|
-
points: 22,
|
|
208
|
-
type: 'score'
|
|
209
|
-
}]
|
|
210
|
-
},
|
|
211
|
-
resolve: {
|
|
212
|
-
rewards: [{
|
|
213
|
-
id: 'k49zf40n',
|
|
214
|
-
name: 'asd',
|
|
215
|
-
points: 55,
|
|
216
|
-
type: 'score'
|
|
217
|
-
}]
|
|
218
|
-
},
|
|
219
|
-
instructions: 'cghgfdhgch',
|
|
220
|
-
description: 'description'
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
exports.mockProps4 = mockProps4;
|
|
224
|
-
var mockProps5 = {
|
|
225
|
-
emitEvent: _mocker.emitEvent,
|
|
226
|
-
soundActions: _mocker.soundActions,
|
|
227
|
-
keyboardControl: _mocker.keyboardControl,
|
|
228
|
-
disableExit: function disableExit() {},
|
|
229
|
-
setResolveAction: function setResolveAction() {},
|
|
230
|
-
velocity: 'slow',
|
|
231
|
-
difficulty: 'easy',
|
|
232
|
-
nodeTitle: 'gfhfgh',
|
|
233
|
-
password: 'a',
|
|
234
|
-
info: {
|
|
235
|
-
solution: {
|
|
236
|
-
right: {
|
|
237
|
-
desc: 'cghc',
|
|
238
|
-
rewards: [{
|
|
239
|
-
id: 'k49zf40n',
|
|
240
|
-
name: 'asd',
|
|
241
|
-
points: 4,
|
|
242
|
-
type: 'score'
|
|
243
|
-
}]
|
|
244
|
-
},
|
|
245
|
-
wrong: {
|
|
246
|
-
desc: 'cghcgh',
|
|
247
|
-
rewards: [{
|
|
248
|
-
id: 'k49zf40n',
|
|
249
|
-
name: 'asd',
|
|
250
|
-
points: 44,
|
|
251
|
-
type: 'score'
|
|
252
|
-
}]
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
hint: {
|
|
256
|
-
active: true,
|
|
257
|
-
desc: 'asdfas',
|
|
258
|
-
rewards: [{
|
|
259
|
-
id: 'k49zf40n',
|
|
260
|
-
name: 'asd',
|
|
261
|
-
points: 22,
|
|
262
|
-
type: 'score'
|
|
263
|
-
}]
|
|
264
|
-
},
|
|
265
|
-
resolve: {
|
|
266
|
-
rewards: [{
|
|
267
|
-
id: 'k49zf40n',
|
|
268
|
-
name: 'asd',
|
|
269
|
-
points: 55,
|
|
270
|
-
type: 'score'
|
|
271
|
-
}]
|
|
272
|
-
},
|
|
273
|
-
instructions: 'cghgfdhgch',
|
|
274
|
-
description: 'description'
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
exports.mockProps5 = mockProps5;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _Options = _interopRequireDefault(require("./Options"));
|
|
10
|
-
var _LangIsRtl = _interopRequireDefault(require("../../../helpers/LangIsRtl"));
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
18
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
19
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
-
var noop = function noop() {};
|
|
21
|
-
var DecisionBody = function DecisionBody(_ref) {
|
|
22
|
-
var options = _ref.options,
|
|
23
|
-
question = _ref.question,
|
|
24
|
-
inherited = _ref.inherited,
|
|
25
|
-
branched = _ref.branched,
|
|
26
|
-
changeOption = _ref.changeOption,
|
|
27
|
-
onNext = _ref.onNext,
|
|
28
|
-
failed = _ref.failed,
|
|
29
|
-
showingResults = _ref.showingResults,
|
|
30
|
-
currentSelectedChoice = _ref.currentSelectedChoice,
|
|
31
|
-
children = _ref.children,
|
|
32
|
-
translate = _ref.translate,
|
|
33
|
-
hasRewards = _ref.hasRewards,
|
|
34
|
-
inScene = _ref.inScene,
|
|
35
|
-
required = _ref.required,
|
|
36
|
-
simplifiedOptions = _ref.simplifiedOptions;
|
|
37
|
-
var _useState = (0, _react.useState)(currentSelectedChoice),
|
|
38
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
39
|
-
selectedChoice = _useState2[0],
|
|
40
|
-
selectChoice = _useState2[1];
|
|
41
|
-
var choose = function choose(option) {
|
|
42
|
-
selectChoice(option);
|
|
43
|
-
if (showingResults && failed) {
|
|
44
|
-
changeOption(option);
|
|
45
|
-
}
|
|
46
|
-
onNext(option);
|
|
47
|
-
};
|
|
48
|
-
var canNext = !showingResults && selectedChoice.id !== undefined || !failed;
|
|
49
|
-
var optionsProps = {
|
|
50
|
-
inherited: inherited,
|
|
51
|
-
selectedChoice: selectedChoice,
|
|
52
|
-
selectChoice: (!required || branched) && selectedChoice.id !== undefined || required && !failed ? noop : choose,
|
|
53
|
-
options: options,
|
|
54
|
-
showingResults: showingResults,
|
|
55
|
-
simplifiedOptions: simplifiedOptions,
|
|
56
|
-
required: required
|
|
57
|
-
};
|
|
58
|
-
var BasicDecision = function BasicDecision(_ref2) {
|
|
59
|
-
var defaultChildren = _ref2.children;
|
|
60
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
-
className: "popup popup__large popup__basicDecision ".concat(showingResults && currentSelectedChoice.feedback ? 'popup__feedback' : '')
|
|
62
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
63
|
-
className: "popup--info"
|
|
64
|
-
}, showingResults ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, defaultChildren, !currentSelectedChoice.feedback && hasRewards.length === 0 && /*#__PURE__*/_react.default.createElement("span", {
|
|
65
|
-
className: "popup--info__title"
|
|
66
|
-
}, question !== '' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, question)), !currentSelectedChoice.feedback && hasRewards.length > 0 && /*#__PURE__*/_react.default.createElement("span", {
|
|
67
|
-
className: "popup--info__title"
|
|
68
|
-
}, question)) : /*#__PURE__*/_react.default.createElement("span", {
|
|
69
|
-
className: "popup--info__title"
|
|
70
|
-
}, question)), /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
-
className: "popup__questions",
|
|
72
|
-
dir: "auto"
|
|
73
|
-
}, /*#__PURE__*/_react.default.createElement(_Options.default, optionsProps)), /*#__PURE__*/_react.default.createElement("div", {
|
|
74
|
-
className: "popup--buttons"
|
|
75
|
-
}, (required ? !failed : selectedChoice.id !== undefined) ? /*#__PURE__*/_react.default.createElement("button", {
|
|
76
|
-
type: "button",
|
|
77
|
-
className: "gat--btn__navigation ".concat(selectedChoice.id !== undefined ? '' : 'disabled'),
|
|
78
|
-
onClick: function onClick() {
|
|
79
|
-
return selectedChoice.id !== undefined && onNext(selectedChoice);
|
|
80
|
-
},
|
|
81
|
-
"aria-label": translate('storylines.misc.closePiece')
|
|
82
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
83
|
-
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
84
|
-
})) : null));
|
|
85
|
-
};
|
|
86
|
-
var ComplexDecision = function ComplexDecision() {
|
|
87
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
-
dir: "auto",
|
|
89
|
-
className: "conversation--body ".concat(inScene ? 'conversation--body--inScene' : '')
|
|
90
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
91
|
-
className: "conversation--message"
|
|
92
|
-
}, question !== '' && /*#__PURE__*/_react.default.createElement("span", {
|
|
93
|
-
className: "conversation--main__text"
|
|
94
|
-
}, question), /*#__PURE__*/_react.default.createElement(_Options.default, optionsProps)), /*#__PURE__*/_react.default.createElement("div", {
|
|
95
|
-
className: "conversation--controls conversation--controls--fixedbottom"
|
|
96
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
97
|
-
className: "gat--btn__round disabled"
|
|
98
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
99
|
-
className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
|
|
100
|
-
})), /*#__PURE__*/_react.default.createElement("button", {
|
|
101
|
-
className: "gat--btn__round ".concat(canNext ? '' : 'disabled'),
|
|
102
|
-
type: "button",
|
|
103
|
-
onClick: function onClick() {
|
|
104
|
-
return canNext && onNext(selectedChoice);
|
|
105
|
-
}
|
|
106
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
107
|
-
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
108
|
-
}))));
|
|
109
|
-
};
|
|
110
|
-
if (inherited) {
|
|
111
|
-
return /*#__PURE__*/_react.default.createElement(ComplexDecision, null);
|
|
112
|
-
}
|
|
113
|
-
return /*#__PURE__*/_react.default.createElement(BasicDecision, null, children);
|
|
114
|
-
};
|
|
115
|
-
var _default = DecisionBody;
|
|
116
|
-
exports.default = _default;
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _SlotList = _interopRequireDefault(require("../../conversational-pro-component/components/SlotList"));
|
|
10
|
-
var _DecisionBody = _interopRequireDefault(require("./DecisionBody"));
|
|
11
|
-
var _Feedback = _interopRequireDefault(require("./Feedback"));
|
|
12
|
-
var _excluded = ["emitEvent", "soundActions", "keyboardControl", "inScene"];
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
21
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
22
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
24
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
25
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
26
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
28
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
|
-
var DecisionComponent = function DecisionComponent(_ref) {
|
|
30
|
-
var emitEvent = _ref.emitEvent,
|
|
31
|
-
soundActions = _ref.soundActions,
|
|
32
|
-
keyboardControl = _ref.keyboardControl,
|
|
33
|
-
inScene = _ref.inScene,
|
|
34
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
-
var _props$inheritProps = props.inheritProps,
|
|
36
|
-
inheritProps = _props$inheritProps === void 0 ? {} : _props$inheritProps,
|
|
37
|
-
decisionNumber = props.decisionNumber,
|
|
38
|
-
required = props.required,
|
|
39
|
-
question = props.question,
|
|
40
|
-
onAddPoints = props.onAddPoints,
|
|
41
|
-
_onFinish = props.onFinish,
|
|
42
|
-
branched = props.branched,
|
|
43
|
-
simplifiedOptions = props.simplifiedOptions;
|
|
44
|
-
var inherited = Object.keys(inheritProps).length > 0;
|
|
45
|
-
var _useState = (0, _react.useState)('options'),
|
|
46
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
47
|
-
selectedView = _useState2[0],
|
|
48
|
-
selectView = _useState2[1];
|
|
49
|
-
var _useState3 = (0, _react.useState)({}),
|
|
50
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
51
|
-
resultChoice = _useState4[0],
|
|
52
|
-
setResultChoice = _useState4[1];
|
|
53
|
-
var _soundActions = _slicedToArray(soundActions, 1),
|
|
54
|
-
playSound = _soundActions[0];
|
|
55
|
-
var failed = required && !resultChoice.right;
|
|
56
|
-
var playCurrentAudio = function playCurrentAudio(option) {
|
|
57
|
-
var _option$audio;
|
|
58
|
-
if ((_option$audio = option.audio) !== null && _option$audio !== void 0 && _option$audio.url) {
|
|
59
|
-
playSound(option.audio.url, 'audio_file', false, option.audioVolume);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
var listProps = _objectSpread(_objectSpread({}, inheritProps), {}, {
|
|
63
|
-
slots: inheritProps.slots ? inheritProps.slots : inheritProps.characters,
|
|
64
|
-
currentMessage: {
|
|
65
|
-
position: null,
|
|
66
|
-
emotion: ''
|
|
67
|
-
},
|
|
68
|
-
emitEvent: emitEvent
|
|
69
|
-
});
|
|
70
|
-
if (inheritProps) {
|
|
71
|
-
if (inheritProps.flex && listProps.slots) {
|
|
72
|
-
listProps.characters = listProps.characters.filter(function (char) {
|
|
73
|
-
return listProps.slots.find(function (slot) {
|
|
74
|
-
return slot.uid === char.uid;
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
var emitGameData = function emitGameData(choice) {
|
|
80
|
-
emitEvent({
|
|
81
|
-
type: 'decisionJournal',
|
|
82
|
-
payload: {
|
|
83
|
-
choice: choice,
|
|
84
|
-
decisionNumber: decisionNumber
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
var onNext = function onNext(choice) {
|
|
89
|
-
if (!failed && selectedView === 'results') {
|
|
90
|
-
playSound('click-ui');
|
|
91
|
-
if (inherited) {
|
|
92
|
-
if (simplifiedOptions) {
|
|
93
|
-
if (_onFinish) {
|
|
94
|
-
emitGameData(choice);
|
|
95
|
-
_onFinish(choice, function () {
|
|
96
|
-
setResultChoice({});
|
|
97
|
-
selectView('options');
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
} else {
|
|
101
|
-
if (onAddPoints) {
|
|
102
|
-
onAddPoints(choice);
|
|
103
|
-
}
|
|
104
|
-
emitGameData(choice);
|
|
105
|
-
emitEvent({
|
|
106
|
-
type: 'addPoints',
|
|
107
|
-
payload: choice.rewards,
|
|
108
|
-
finish: false,
|
|
109
|
-
complex: true,
|
|
110
|
-
onFinish: function onFinish() {
|
|
111
|
-
if (_onFinish) {
|
|
112
|
-
_onFinish(choice, function () {
|
|
113
|
-
setResultChoice({});
|
|
114
|
-
selectView('options');
|
|
115
|
-
});
|
|
116
|
-
} else {
|
|
117
|
-
emitEvent({
|
|
118
|
-
type: 'success'
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
setResultChoice({});
|
|
122
|
-
selectView('options');
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
} else {
|
|
127
|
-
emitGameData(choice);
|
|
128
|
-
emitEvent({
|
|
129
|
-
type: 'addPoints',
|
|
130
|
-
payload: choice.rewards,
|
|
131
|
-
finish: true,
|
|
132
|
-
complex: true
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
} else if (Object.keys(choice).length > 0) {
|
|
136
|
-
playSound('click-ui');
|
|
137
|
-
if (!simplifiedOptions) {
|
|
138
|
-
if (choice.right) {
|
|
139
|
-
playSound('score');
|
|
140
|
-
} else {
|
|
141
|
-
playSound('fail');
|
|
142
|
-
if (!branched) {
|
|
143
|
-
if (inherited || required) {
|
|
144
|
-
emitGameData(choice);
|
|
145
|
-
emitEvent({
|
|
146
|
-
type: 'addPoints',
|
|
147
|
-
payload: choice.rewards,
|
|
148
|
-
finish: false,
|
|
149
|
-
complex: true
|
|
150
|
-
});
|
|
151
|
-
} else if (!required) {
|
|
152
|
-
setResultChoice({});
|
|
153
|
-
selectView('options');
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
setResultChoice(choice);
|
|
158
|
-
playCurrentAudio(choice);
|
|
159
|
-
selectView('results');
|
|
160
|
-
} else {
|
|
161
|
-
emitGameData(_objectSpread(_objectSpread({}, choice), {}, {
|
|
162
|
-
simplified: true
|
|
163
|
-
}));
|
|
164
|
-
_onFinish(choice, function () {
|
|
165
|
-
setResultChoice({});
|
|
166
|
-
selectView('options');
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
var bodyProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
172
|
-
selectView: selectView,
|
|
173
|
-
selectedView: selectedView,
|
|
174
|
-
emitEvent: emitEvent,
|
|
175
|
-
inherited: inherited,
|
|
176
|
-
branched: branched,
|
|
177
|
-
soundActions: soundActions,
|
|
178
|
-
showingResults: selectedView === 'results',
|
|
179
|
-
currentSelectedChoice: resultChoice,
|
|
180
|
-
hasRewards: resultChoice.rewards || [],
|
|
181
|
-
failed: failed,
|
|
182
|
-
inScene: inScene,
|
|
183
|
-
required: required,
|
|
184
|
-
simplifiedOptions: simplifiedOptions,
|
|
185
|
-
changeOption: function changeOption(option) {
|
|
186
|
-
playSound('click-ui');
|
|
187
|
-
setResultChoice(option);
|
|
188
|
-
selectView('options');
|
|
189
|
-
},
|
|
190
|
-
onNext: onNext,
|
|
191
|
-
translate: function translate(id) {
|
|
192
|
-
return emitEvent({
|
|
193
|
-
type: 'translate',
|
|
194
|
-
payload: id
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
keyboardControl(null, selectedView === 'results' && !failed ? function () {
|
|
199
|
-
onNext(resultChoice);
|
|
200
|
-
} : null);
|
|
201
|
-
var BackgroundWrapper = function BackgroundWrapper(_ref2) {
|
|
202
|
-
var children = _ref2.children;
|
|
203
|
-
if (!inherited) {
|
|
204
|
-
return children;
|
|
205
|
-
}
|
|
206
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
207
|
-
className: "conversation--layer \n ".concat(resultChoice.feedback ? '' : 'conversation--layer__defaultFeedback', " \n ").concat(selectedView === 'results' ? 'conversation--layer__feedback' : '')
|
|
208
|
-
}, children);
|
|
209
|
-
};
|
|
210
|
-
var PopupWrapper = function PopupWrapper(_ref3) {
|
|
211
|
-
var children = _ref3.children;
|
|
212
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
213
|
-
className: "popup--layer"
|
|
214
|
-
}, children);
|
|
215
|
-
};
|
|
216
|
-
var CharactersWrapper = function CharactersWrapper(_ref4) {
|
|
217
|
-
var _inheritProps$backgro, _inheritProps$backgro2;
|
|
218
|
-
var children = _ref4.children;
|
|
219
|
-
var style = {};
|
|
220
|
-
style = (_inheritProps$backgro = inheritProps.background) !== null && _inheritProps$backgro !== void 0 && _inheritProps$backgro.img ? {
|
|
221
|
-
backgroundImage: "url(\"".concat((_inheritProps$backgro2 = inheritProps.background.img) === null || _inheritProps$backgro2 === void 0 ? void 0 : _inheritProps$backgro2.url, "\")")
|
|
222
|
-
} : null;
|
|
223
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
224
|
-
className: "conversation ".concat(inScene ? 'conversation--inScene' : ''),
|
|
225
|
-
style: style
|
|
226
|
-
}, /*#__PURE__*/_react.default.createElement(_SlotList.default, listProps, children), /*#__PURE__*/_react.default.createElement(_DecisionBody.default, bodyProps));
|
|
227
|
-
};
|
|
228
|
-
var Body = function Body() {
|
|
229
|
-
return inherited ? /*#__PURE__*/_react.default.createElement(CharactersWrapper, null, selectedView === 'results' && resultChoice.feedback ? /*#__PURE__*/_react.default.createElement(_Feedback.default, {
|
|
230
|
-
question: question,
|
|
231
|
-
soundActions: soundActions,
|
|
232
|
-
inherited: inherited,
|
|
233
|
-
choice: resultChoice,
|
|
234
|
-
rewards: resultChoice.rewards || [],
|
|
235
|
-
emitEvent: emitEvent
|
|
236
|
-
}) : null) : /*#__PURE__*/_react.default.createElement(PopupWrapper, null, /*#__PURE__*/_react.default.createElement(_DecisionBody.default, bodyProps, /*#__PURE__*/_react.default.createElement(_Feedback.default, {
|
|
237
|
-
question: question,
|
|
238
|
-
soundActions: soundActions,
|
|
239
|
-
inherited: inherited,
|
|
240
|
-
choice: resultChoice,
|
|
241
|
-
rewards: resultChoice.rewards || [],
|
|
242
|
-
emitEvent: emitEvent
|
|
243
|
-
})));
|
|
244
|
-
};
|
|
245
|
-
return /*#__PURE__*/_react.default.createElement(BackgroundWrapper, null, /*#__PURE__*/_react.default.createElement(Body, null));
|
|
246
|
-
};
|
|
247
|
-
var _default = DecisionComponent;
|
|
248
|
-
exports.default = _default;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var FeedBack = function FeedBack(_ref) {
|
|
10
|
-
var choice = _ref.choice,
|
|
11
|
-
inherited = _ref.inherited,
|
|
12
|
-
question = _ref.question;
|
|
13
|
-
var Wrapper = function Wrapper(_ref2) {
|
|
14
|
-
var children = _ref2.children;
|
|
15
|
-
if (inherited) {
|
|
16
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
17
|
-
className: "conversation--feedback ".concat(!choice.feedback ? 'only--rewards' : '')
|
|
18
|
-
}, children);
|
|
19
|
-
}
|
|
20
|
-
if (!choice.feedback) {
|
|
21
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
-
className: "popup__basicDecision__only--rewards only--rewards"
|
|
23
|
-
}, children);
|
|
24
|
-
}
|
|
25
|
-
return children;
|
|
26
|
-
};
|
|
27
|
-
if (!choice.feedback) return null;
|
|
28
|
-
return /*#__PURE__*/_react.default.createElement(Wrapper, null, choice.feedback ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
29
|
-
className: "conversation--feedback__title"
|
|
30
|
-
}, question), /*#__PURE__*/_react.default.createElement("div", {
|
|
31
|
-
className: "conversation--feedback__text",
|
|
32
|
-
dir: "auto"
|
|
33
|
-
}, choice.right ? /*#__PURE__*/_react.default.createElement("span", {
|
|
34
|
-
className: "icon-check-circle-black color--success"
|
|
35
|
-
}) : /*#__PURE__*/_react.default.createElement("span", {
|
|
36
|
-
className: "icon-error-circle-black color--error"
|
|
37
|
-
}), /*#__PURE__*/_react.default.createElement("p", null, choice.feedback))) : null);
|
|
38
|
-
};
|
|
39
|
-
var _default = FeedBack;
|
|
40
|
-
exports.default = _default;
|