@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.
Files changed (212) hide show
  1. package/README.md +9 -6
  2. package/dist/arcade-components.cjs +274 -0
  3. package/dist/arcade-components.js +57929 -0
  4. package/package.json +74 -73
  5. package/dist/components/animation-component/components/AnimationComponent.js +0 -98
  6. package/dist/components/animation-component/index.js +0 -10
  7. package/dist/components/animation-component/mocks/mockForStory.js +0 -26
  8. package/dist/components/auto-evaluation-component/components/AutoEvaluation.js +0 -215
  9. package/dist/components/auto-evaluation-component/components/EndScreen.js +0 -43
  10. package/dist/components/auto-evaluation-component/components/StartScreen.js +0 -32
  11. package/dist/components/auto-evaluation-component/index.js +0 -10
  12. package/dist/components/auto-evaluation-component/mocks/mockForStory.js +0 -38
  13. package/dist/components/cards-selector-puzzle-component/components/Board/index.js +0 -159
  14. package/dist/components/cards-selector-puzzle-component/components/Card/index.js +0 -115
  15. package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +0 -289
  16. package/dist/components/cards-selector-puzzle-component/index.js +0 -10
  17. package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +0 -446
  18. package/dist/components/cartel-component/components/CartelComponent.js +0 -124
  19. package/dist/components/cartel-component/index.js +0 -10
  20. package/dist/components/chained-image-click-puzzle-component/components/ChainedImageClickPuzzleComponent.js +0 -80
  21. package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js +0 -182
  22. package/dist/components/chained-image-click-puzzle-component/index.js +0 -10
  23. package/dist/components/chained-image-click-puzzle-component/mocks/mockForStory.js +0 -413
  24. package/dist/components/comic-component/components/ComicComponent.js +0 -201
  25. package/dist/components/comic-component/components/Slide.js +0 -31
  26. package/dist/components/comic-component/components/Vignette.js +0 -70
  27. package/dist/components/comic-component/index.js +0 -10
  28. package/dist/components/comic-component/mocks/mockForStory.js +0 -314
  29. package/dist/components/conversational-component/components/ConversationalComponent.js +0 -101
  30. package/dist/components/conversational-component/index.js +0 -10
  31. package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +0 -543
  32. package/dist/components/conversational-pro-component/components/Message.js +0 -37
  33. package/dist/components/conversational-pro-component/components/Slot.js +0 -92
  34. package/dist/components/conversational-pro-component/components/SlotList.js +0 -162
  35. package/dist/components/conversational-pro-component/components/scene/Panel.js +0 -179
  36. package/dist/components/conversational-pro-component/components/scene/Panels.js +0 -46
  37. package/dist/components/conversational-pro-component/components/scene/index.js +0 -77
  38. package/dist/components/conversational-pro-component/index.js +0 -10
  39. package/dist/components/conversational-pro-component/mocks/mockForStory.js +0 -1529
  40. package/dist/components/cracker-puzzle-component/components/CrackerPuzzleComponent.js +0 -261
  41. package/dist/components/cracker-puzzle-component/components/DrawGrid/index.js +0 -33
  42. package/dist/components/cracker-puzzle-component/components/DrawItem/index.js +0 -48
  43. package/dist/components/cracker-puzzle-component/components/DrawRow/index.js +0 -43
  44. package/dist/components/cracker-puzzle-component/components/colors.js +0 -12
  45. package/dist/components/cracker-puzzle-component/components/helpers.js +0 -133
  46. package/dist/components/cracker-puzzle-component/index.js +0 -10
  47. package/dist/components/cracker-puzzle-component/mocks/mockForStory.js +0 -277
  48. package/dist/components/decision-component/components/DecisionBody.js +0 -116
  49. package/dist/components/decision-component/components/DecisionComponent.js +0 -248
  50. package/dist/components/decision-component/components/Feedback.js +0 -40
  51. package/dist/components/decision-component/components/Options.js +0 -74
  52. package/dist/components/decision-component/index.js +0 -10
  53. package/dist/components/decision-component/mocks/mockForStory.js +0 -166
  54. package/dist/components/dialog-component/components/BubbleWrapper.js +0 -39
  55. package/dist/components/dialog-component/components/DialogComponent.js +0 -779
  56. package/dist/components/dialog-component/components/DialogDecision.js +0 -44
  57. package/dist/components/dialog-component/components/SpeechBubbleComponent.js +0 -66
  58. package/dist/components/dialog-component/index.js +0 -10
  59. package/dist/components/dialog-component/mocks/mockForStory.js +0 -550
  60. package/dist/components/drag-item-puzzle-component/components/DragItemPuzzleComponent.js +0 -361
  61. package/dist/components/drag-item-puzzle-component/index.js +0 -10
  62. package/dist/components/drag-item-puzzle-component/mocks/mockForStory.js +0 -74
  63. package/dist/components/feedback-component/components/FeedbackComponent.js +0 -126
  64. package/dist/components/feedback-component/index.js +0 -10
  65. package/dist/components/feedback-component/mocks/mockForStory.js +0 -52
  66. package/dist/components/frame-click-puzzle-component/components/Counter/index.js +0 -24
  67. package/dist/components/frame-click-puzzle-component/components/CurrentFramePuzzle.js +0 -196
  68. package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +0 -178
  69. package/dist/components/frame-click-puzzle-component/components/Tooltip/index.js +0 -23
  70. package/dist/components/frame-click-puzzle-component/index.js +0 -10
  71. package/dist/components/frame-click-puzzle-component/mocks/mockForStory.js +0 -717
  72. package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +0 -255
  73. package/dist/components/hacker-puzzle-component/components/languages.js +0 -13
  74. package/dist/components/hacker-puzzle-component/index.js +0 -10
  75. package/dist/components/hacker-puzzle-component/mocks/mockForStory.js +0 -103
  76. package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +0 -488
  77. package/dist/components/hanged-puzzle-component/index.js +0 -10
  78. package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +0 -61
  79. package/dist/components/hanged-puzzle-component/utils.js +0 -64
  80. package/dist/components/image-click-puzzle-component/components/ImageClickPuzzleComponent.js +0 -40
  81. package/dist/components/image-click-puzzle-component/index.js +0 -10
  82. package/dist/components/image-click-puzzle-component/mocks/mockForStory.js +0 -427
  83. package/dist/components/image-click-wrapper-component/components/CountDown/index.js +0 -18
  84. package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +0 -472
  85. package/dist/components/image-click-wrapper-component/components/TimerDialog/index.js +0 -26
  86. package/dist/components/image-click-wrapper-component/index.js +0 -10
  87. package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +0 -432
  88. package/dist/components/image-component/components/ImageComponent.js +0 -83
  89. package/dist/components/image-component/index.js +0 -10
  90. package/dist/components/image-component/mocks/mockForStory.js +0 -52
  91. package/dist/components/index.js +0 -260
  92. package/dist/components/inventory-item/components/InventoryItem.js +0 -120
  93. package/dist/components/inventory-item/index.js +0 -10
  94. package/dist/components/inventory-item/mocks/mockForStory.js +0 -29
  95. package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +0 -275
  96. package/dist/components/keyboard-puzzle-component/index.js +0 -10
  97. package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +0 -40
  98. package/dist/components/konva-components/Area/index.js +0 -170
  99. package/dist/components/konva-components/KonvaMapper.js +0 -185
  100. package/dist/components/lectures-component/components/LectureButtons.js +0 -40
  101. package/dist/components/lectures-component/components/LecturesComponent.js +0 -157
  102. package/dist/components/lectures-component/index.js +0 -10
  103. package/dist/components/lectures-component/mocks/mockForStory.js +0 -39
  104. package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +0 -243
  105. package/dist/components/login-puzzle-component/index.js +0 -10
  106. package/dist/components/login-puzzle-component/mocks/mockForStory.js +0 -38
  107. package/dist/components/notice-component/components/NoticeComponent.js +0 -96
  108. package/dist/components/notice-component/index.js +0 -10
  109. package/dist/components/notice-component/mocks/mockForStory.js +0 -20
  110. package/dist/components/pattern-component/components/PatternComponent.js +0 -78
  111. package/dist/components/pattern-component/index.js +0 -10
  112. package/dist/components/pattern-component/mocks/mockForStory.js +0 -35
  113. package/dist/components/pdf-component/components/PdfComponent.js +0 -122
  114. package/dist/components/pdf-component/components/PdfVisor.js +0 -187
  115. package/dist/components/pdf-component/index.js +0 -20
  116. package/dist/components/pdf-component/mocks/mockForProps.js +0 -38
  117. package/dist/components/referral-component/components/EmailPill.js +0 -26
  118. package/dist/components/referral-component/components/ReferralComponent.js +0 -115
  119. package/dist/components/referral-component/components/StepOne.js +0 -170
  120. package/dist/components/referral-component/components/StepTwo.js +0 -57
  121. package/dist/components/referral-component/index.js +0 -10
  122. package/dist/components/referral-component/mocks/mockForStory.js +0 -40
  123. package/dist/components/survey-component/components/ApplicableBox.js +0 -49
  124. package/dist/components/survey-component/components/OpinionBox.js +0 -45
  125. package/dist/components/survey-component/components/SurveyComponent.js +0 -150
  126. package/dist/components/survey-component/components/TextBox.js +0 -40
  127. package/dist/components/survey-component/index.js +0 -10
  128. package/dist/components/survey-component/mocks/mockForStory.js +0 -14
  129. package/dist/components/terminal-puzzle-component/components/FilesGroup/Item.js +0 -28
  130. package/dist/components/terminal-puzzle-component/components/FilesGroup/index.js +0 -76
  131. package/dist/components/terminal-puzzle-component/components/Image/index.js +0 -22
  132. package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +0 -216
  133. package/dist/components/terminal-puzzle-component/components/Visor/index.js +0 -129
  134. package/dist/components/terminal-puzzle-component/components/utils/index.js +0 -26
  135. package/dist/components/terminal-puzzle-component/index.js +0 -10
  136. package/dist/components/terminal-puzzle-component/mocks/mockForStory.js +0 -188
  137. package/dist/components/test-component/components/Container.js +0 -211
  138. package/dist/components/test-component/components/Feedbacks.js +0 -48
  139. package/dist/components/test-component/components/Questions.js +0 -145
  140. package/dist/components/test-component/components/Results.js +0 -208
  141. package/dist/components/test-component/components/TestComponent.js +0 -302
  142. package/dist/components/test-component/index.js +0 -10
  143. package/dist/components/test-component/mocks/mockForStory.js +0 -113
  144. package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +0 -387
  145. package/dist/components/text-click-puzzle-component/index.js +0 -10
  146. package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +0 -485
  147. package/dist/components/text-click-puzzle-component/utils/index.js +0 -76
  148. package/dist/components/url-component/components/UrlComponent.js +0 -88
  149. package/dist/components/url-component/index.js +0 -10
  150. package/dist/components/url-component/mocks/mockForProps.js +0 -20
  151. package/dist/components/video-component/components/VideoComponent.js +0 -73
  152. package/dist/components/video-component/index.js +0 -10
  153. package/dist/components/video-component/mocks/mockForStory.js +0 -94
  154. package/dist/components/video-visor/components/VideoControllers/BufferBar.js +0 -108
  155. package/dist/components/video-visor/components/VideoControllers/ControlButtons.js +0 -31
  156. package/dist/components/video-visor/components/VideoControllers/FinishedVideoButtons.js +0 -32
  157. package/dist/components/video-visor/components/VideoControllers/PlayInitButton.js +0 -37
  158. package/dist/components/video-visor/components/VideoControllers/SkipButton.js +0 -37
  159. package/dist/components/video-visor/components/VideoControllers/Timer.js +0 -37
  160. package/dist/components/video-visor/components/VideoControllers/VolumeBar.js +0 -92
  161. package/dist/components/video-visor/components/VideoControllers/index.js +0 -122
  162. package/dist/components/video-visor/components/VideoVisor.js +0 -271
  163. package/dist/components/video-visor/index.js +0 -10
  164. package/dist/components/video-visor/mocks/mockForStory.js +0 -42
  165. package/dist/components/web-builder-puzzle-component/Popups/PopupColorComponent/index.js +0 -87
  166. package/dist/components/web-builder-puzzle-component/Popups/PopupImageComponent/index.js +0 -94
  167. package/dist/components/web-builder-puzzle-component/Popups/PopupTextComponent/index.js +0 -114
  168. package/dist/components/web-builder-puzzle-component/Popups/index.js +0 -27
  169. package/dist/components/web-builder-puzzle-component/Templates/Bank.js +0 -98
  170. package/dist/components/web-builder-puzzle-component/Templates/Facebook.js +0 -37
  171. package/dist/components/web-builder-puzzle-component/Templates/resourcePath.js +0 -9
  172. package/dist/components/web-builder-puzzle-component/components/EditButton/index.js +0 -28
  173. package/dist/components/web-builder-puzzle-component/components/Feedback/index.js +0 -41
  174. package/dist/components/web-builder-puzzle-component/components/PublishButton/index.js +0 -29
  175. package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/BankBody.js +0 -118
  176. package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/FacebookBody.js +0 -149
  177. package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/index.js +0 -25
  178. package/dist/components/web-builder-puzzle-component/components/WebBuilderFront/index.js +0 -89
  179. package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/BankHeader.js +0 -84
  180. package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/FacebookHeader.js +0 -38
  181. package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/index.js +0 -40
  182. package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +0 -302
  183. package/dist/components/web-builder-puzzle-component/components/WebBuilderTopBar/index.js +0 -30
  184. package/dist/components/web-builder-puzzle-component/index.js +0 -10
  185. package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +0 -27
  186. package/dist/components/writer-puzzle-component/components/ElectionComponent.js +0 -69
  187. package/dist/components/writer-puzzle-component/components/FeedbackComponent.js +0 -97
  188. package/dist/components/writer-puzzle-component/components/FeedbackElement.js +0 -32
  189. package/dist/components/writer-puzzle-component/components/FinishedTextComponent.js +0 -25
  190. package/dist/components/writer-puzzle-component/components/FixedComponent.js +0 -120
  191. package/dist/components/writer-puzzle-component/components/SingleElection.js +0 -85
  192. package/dist/components/writer-puzzle-component/components/WriterPuzzleComponent.js +0 -450
  193. package/dist/components/writer-puzzle-component/index.js +0 -10
  194. package/dist/components/writer-puzzle-component/mocks/mockForStory.js +0 -1194
  195. package/dist/components/zoom-test/components/ZoomTest.js +0 -73
  196. package/dist/components/zoom-test/index.js +0 -10
  197. package/dist/components/zoom-test/mocks/mockForStory.js +0 -21
  198. package/dist/helpers/LangIsRtl.js +0 -16
  199. package/dist/helpers/LightSet.js +0 -35
  200. package/dist/helpers/LodController.js +0 -28
  201. package/dist/helpers/deviceDetection.js +0 -21
  202. package/dist/helpers/drawLOD.js +0 -310
  203. package/dist/helpers/index.js +0 -268
  204. package/dist/helpers/lodStats.js +0 -55
  205. package/dist/helpers/mocker.js +0 -116
  206. package/dist/helpers/useEkho.js +0 -172
  207. package/dist/helpers/useGLB.js +0 -57
  208. package/dist/helpers/useStateMachine.js +0 -277
  209. package/dist/helpers/useTimeout.js +0 -32
  210. package/dist/helpers/useWindowSize.js +0 -44
  211. package/dist/index.js +0 -16
  212. package/dist/test/testSceneWrapper.js +0 -31
package/package.json CHANGED
@@ -2,57 +2,93 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "2.41.1",
6
- "main": "dist/index.js",
5
+ "version": "3.0.2",
6
+ "type": "module",
7
7
  "files": [
8
8
  "dist",
9
9
  "README.md"
10
10
  ],
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/gamelearn/arcade-components"
11
+ "main": "dist/arcade-components.cjs",
12
+ "module": "dist/arcade-components.js",
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/arcade-components.js",
16
+ "require": "./dist/arcade-components.cjs"
17
+ }
14
18
  },
15
19
  "dependencies": {
16
- "@babel/runtime": "^7.18.6",
17
- "@gamelearn/arcade-styles": "2.25.0",
18
- "@gamelearn/arcade-three-core": "1.24.3",
19
- "@react-three/a11y": "^3.0.0",
20
- "@react-three/drei": "9.4.3",
21
- "@react-three/fiber": "8.0.17",
22
- "@testing-library/jest-dom": "^5.16.4",
23
- "@testing-library/react": "^13.1.1",
24
- "@testing-library/user-event": "13.5.0",
25
- "global": "^4.4.0",
20
+ "@vitejs/plugin-react": "^4.2.1",
26
21
  "gsap": "^3.11.4",
27
22
  "hls.js": "0.12.4",
28
23
  "html-react-parser": "^1.4.0",
29
- "interactjs": "^1.10.11",
30
- "konva": "^7.2.5",
24
+ "konva": "9.3.0",
31
25
  "prop-types": "15.7.2",
32
- "react-konva": "^18.1.0",
33
- "react-konva-utils": "^0.3.0",
26
+ "react-konva": "18.2.10",
27
+ "react-konva-utils": "1.0.5",
34
28
  "react-pdf": "5.2.0",
35
- "react-promise-suspense": "0.3.3",
36
29
  "react-typist": "^2.0.5",
37
- "three": "0.139.2",
30
+ "vite": "4.5.0",
38
31
  "web-vitals": "0.2.4"
39
32
  },
33
+ "devDependencies": {
34
+ "@babel/preset-env": "^7.23.6",
35
+ "@babel/preset-react": "^7.23.3",
36
+ "@gamelearn/arcade-styles": "2.25.1",
37
+ "@gamelearn/arcade-three-core": "2.5.0",
38
+ "@gamelearn/version": "^1.3.1",
39
+ "@react-three/drei": "9.89.0",
40
+ "@react-three/fiber": "8.15.11",
41
+ "@react-three/test-renderer": "6.0.6",
42
+ "@testing-library/dom": "^9.3.3",
43
+ "@testing-library/jest-dom": "^6.1.5",
44
+ "@testing-library/react": "^14.1.2",
45
+ "@testing-library/user-event": "^14.5.1",
46
+ "cross-env": "7.0.3",
47
+ "eslint": "^8.52.0",
48
+ "eslint-config-prettier": "^8.3.0",
49
+ "eslint-config-standard": "^17.1.0",
50
+ "eslint-plugin-import": "^2.29.0",
51
+ "eslint-plugin-json-format": "^2.0.1",
52
+ "eslint-plugin-n": "^16.3.1",
53
+ "eslint-plugin-prettier": "5.0.0",
54
+ "eslint-plugin-promise": "^6.1.1",
55
+ "eslint-plugin-react": "^7.33.2",
56
+ "eslint-plugin-react-hooks": "^4.6.0",
57
+ "husky": "4.3.0",
58
+ "jest": "^29.7.0",
59
+ "jest-canvas-mock": "^2.5.2",
60
+ "jest-environment-jsdom": "^29.7.0",
61
+ "nodemon": "^2.0.13",
62
+ "plop": "^2.7.4",
63
+ "prettier": "^3.1.0",
64
+ "react": "18.0.0",
65
+ "react-dom": "18.0.0",
66
+ "standard-version": "^9.1.0",
67
+ "three": "0.159.0",
68
+ "vite-plugin-restart": "^0.4.0"
69
+ },
70
+ "peerDependencies": {
71
+ "@gamelearn/arcade-styles": ">=2.25.0",
72
+ "@gamelearn/arcade-three-core": ">=2.4.15",
73
+ "@react-three/drei": ">=9.92.5",
74
+ "@react-three/fiber": ">=8.15.12",
75
+ "react": ">=18.0",
76
+ "react-dom": ">=18.0",
77
+ "three": ">=0.159"
78
+ },
40
79
  "scripts": {
41
- "start": "npm run storybook",
42
- "clean": "rimraf dist",
43
- "watch": "npx nodemon -e js --ignore dist --exec \"yarn compile && yalc push --changed\"",
44
- "compile": "npm run clean && cross-env NODE_ENV=production babel src -d dist --ignore src/**/*.stories.js,src/**/*.test.js,src/setupTests.js",
45
- "test": "react-scripts test --watchAll=false",
46
- "test:watch": "react-scripts test",
47
- "eject": "react-scripts eject",
48
- "storybook": "start-storybook -p 6006 -s public",
49
- "build-storybook": "build-storybook -o build",
80
+ "build": "cross-env NODE_ENV=production vite build",
81
+ "build:dev": "cross-env NODE_ENV=development vite build",
82
+ "compile": "yarn build:dev && yalc push --changed",
83
+ "watch": "npx nodemon -e js,jsx --ignore dist --exec \"yarn compile && yalc push --changed\"",
84
+ "test": "jest --watchAll=false",
85
+ "test:watch": "jest",
50
86
  "generate": "plop",
51
- "lint": "npx eslint src --ext js,json",
52
- "lint:fix": "npx eslint src --ext js,json --fix",
53
- "lint:quiet": "npx eslint src --ext js,json --quiet",
54
- "publish-hotfix": "yarn compile && npm publish && npm run version-tag",
55
- "version-tag": "P_VER=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag v$P_VER && git push origin v$P_VER"
87
+ "lint": "eslint src --ext js,json",
88
+ "lint:fix": "eslint src --ext js,json --fix",
89
+ "lint:quiet": "eslint src --ext js,json --quiet",
90
+ "publish-hotfix": "yarn compile && yarn publish && yarn version-tag",
91
+ "version-tag": "cross-env P_VER=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag v$P_VER && git push origin v$P_VER"
56
92
  },
57
93
  "browserslist": {
58
94
  "production": [
@@ -66,44 +102,9 @@
66
102
  "last 1 safari version"
67
103
  ]
68
104
  },
69
- "devDependencies": {
70
- "@babel/cli": "7.12.10",
71
- "@babel/eslint-parser": "^7.15.8",
72
- "@babel/preset-env": "7.12.11",
73
- "@babel/preset-react": "7.12.10",
74
- "@gamelearn/version": "^1.3.1",
75
- "@react-three/test-renderer": "6.0.6",
76
- "@storybook/addon-actions": "6.1.11",
77
- "@storybook/addon-essentials": "6.1.11",
78
- "@storybook/addon-links": "6.1.11",
79
- "@storybook/addons": "^6.3.8",
80
- "@storybook/node-logger": "6.1.11",
81
- "@storybook/preset-create-react-app": "3.1.5",
82
- "@storybook/react": "6.1.11",
83
- "@storybook/theming": "^6.3.8",
84
- "babel-loader": "8.1.0",
85
- "cross-env": "7.0.3",
86
- "eslint-config-airbnb": "^18.2.1",
87
- "eslint-config-prettier": "^8.3.0",
88
- "eslint-plugin-json-format": "^2.0.1",
89
- "eslint-plugin-prettier": "^4.0.0",
90
- "husky": "4.3.0",
91
- "nodemon": "^2.0.13",
92
- "plop": "^2.7.4",
93
- "prettier": "^2.5.0",
94
- "react": "18.0.0",
95
- "react-dom": "18.0.0",
96
- "react-scripts": "4.0.1",
97
- "rimraf": "3.0.2"
98
- },
99
- "jest": {
100
- "transformIgnorePatterns": [
101
- "node_modules/(?!(three)/)"
102
- ],
103
- "moduleNameMapper": {
104
- "^react-pdf$": "react-pdf/dist/umd/entry.jest",
105
- "^react-konva-utils$": "react-pdf/dist/umd/entry.jest"
106
- }
105
+ "repository": {
106
+ "type": "git",
107
+ "url": "https://github.com/gamelearn/arcade-components"
107
108
  },
108
109
  "husky": {
109
110
  "hooks": {
@@ -1,98 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _fiber = require("@react-three/fiber");
9
- var _three = require("three");
10
- var _GLTFLoader = require("three/examples/jsm/loaders/GLTFLoader");
11
- var _helpers = require("../../../helpers");
12
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
- 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."); }
14
- 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); }
15
- 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; }
16
- 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; } }
17
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
- var AnimationComponent = function AnimationComponent(_ref) {
19
- var animation = _ref.animation,
20
- loopTimes = _ref.loopTimes,
21
- resource = _ref.resource,
22
- enableInteraction = _ref.enableInteraction,
23
- makeDefault = _ref.makeDefault,
24
- emitEvent = _ref.emitEvent;
25
- var _useState = (0, _react.useState)(false),
26
- _useState2 = _slicedToArray(_useState, 2),
27
- mounted = _useState2[0],
28
- setMounted = _useState2[1];
29
- var scene = (0, _fiber.useThree)(function (state) {
30
- return state.scene;
31
- });
32
- var loader = (0, _react.useMemo)(function () {
33
- return new _GLTFLoader.GLTFLoader();
34
- }, []);
35
- (0, _react.useEffect)(function () {
36
- setMounted(false);
37
- }, [resource.uid, animation === null || animation === void 0 ? void 0 : animation.url]);
38
- (0, _react.useEffect)(function () {
39
- if (!mounted) {
40
- var object;
41
- scene.traverseVisible(function (node) {
42
- if (resource.uid && node.uid === resource.uid && !object) {
43
- object = node;
44
- }
45
- });
46
- if (object && animation && object.skeletonId === animation.skeletonId) {
47
- if (makeDefault) {
48
- emitEvent({
49
- type: 'saveAnimation',
50
- payload: {
51
- uid: resource.uid,
52
- animation: animation.id,
53
- index: object.index
54
- }
55
- });
56
- emitEvent({
57
- type: 'success'
58
- });
59
- } else {
60
- var canInteract = enableInteraction;
61
- if (!canInteract) emitEvent({
62
- type: 'success'
63
- });
64
- loader.load(animation.url, function (gltf) {
65
- var mixer = object.userData.mixer;
66
- var defaultAnim = object.userData.defaultAnim;
67
- if (!object.userData.actionList) object.userData.actionList = {};
68
- var actionList = object.userData.actionList;
69
- if (!actionList.idle) {
70
- var action = mixer.existingAction(defaultAnim, object);
71
- actionList.idle = action;
72
- }
73
- var currentAction = mixer.clipAction(gltf.animations[0], object);
74
- currentAction.setLoop(_three.LoopRepeat, loopTimes);
75
- (0, _helpers.activateAction)(currentAction, 0);
76
- (0, _helpers.executeCrossFade)(actionList.idle, currentAction);
77
- var finishCallback = function finishCallback() {
78
- (0, _helpers.executeCrossFade)(currentAction, actionList.idle);
79
- if (canInteract) emitEvent({
80
- type: 'success'
81
- });
82
- mixer.removeEventListener('finished', finishCallback);
83
- };
84
- mixer.addEventListener('finished', finishCallback);
85
- setMounted(true);
86
- });
87
- }
88
- } else {
89
- emitEvent({
90
- type: 'success'
91
- });
92
- }
93
- }
94
- }, [scene, animation === null || animation === void 0 ? void 0 : animation.url, loopTimes, emitEvent, mounted, loader, resource.uid, makeDefault, animation, resource, enableInteraction]);
95
- return null;
96
- };
97
- var _default = AnimationComponent;
98
- exports.default = _default;
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _AnimationComponent = _interopRequireDefault(require("./components/AnimationComponent"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- var _default = _AnimationComponent.default;
10
- exports.default = _default;
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.mockProps = exports.default = void 0;
7
- /* eslint-disable no-console */
8
- /* eslint-disable max-len */
9
- var emitEvent = function emitEvent() {
10
- console.info('Emit event called');
11
- };
12
- var mockProps = {
13
- resource: {
14
- elementUid: 'snHJhg',
15
- uid: 'snHJhg'
16
- },
17
- loopTimes: 1,
18
- animation: {
19
- url: 'https://min.gamelearn.io/cooked.gl-lms-storage/clients/5981fca94d82290bcbe957fe/animation/5e467197d55361000f040196/standmale_2_breath.glb'
20
- },
21
- currentAnimation: '5e467197d55361000f040196',
22
- emitEvent: emitEvent
23
- };
24
- exports.mockProps = mockProps;
25
- var _default = mockProps;
26
- exports.default = _default;
@@ -1,215 +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 _EndScreen = _interopRequireDefault(require("./EndScreen"));
10
- var _StartScreen = _interopRequireDefault(require("./StartScreen"));
11
- var _LangIsRtl = _interopRequireDefault(require("../../../helpers/LangIsRtl"));
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- 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); }
14
- 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; }
15
- 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; }
16
- 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; }
17
- 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; }
18
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
19
- 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); }
20
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
21
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
22
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
23
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
24
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25
- 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."); }
26
- 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); }
27
- 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; }
28
- 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; } }
29
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
30
- var AutoEvaluation = function AutoEvaluation(_ref) {
31
- var _questions$currentQue, _surveyData$current$q3, _surveyData$current$q4;
32
- var description = _ref.description,
33
- questions = _ref.questions,
34
- type = _ref.type,
35
- emitEvent = _ref.emitEvent,
36
- soundActions = _ref.soundActions;
37
- var _useState = (0, _react.useState)(null),
38
- _useState2 = _slicedToArray(_useState, 2),
39
- pointIsBeingTouched = _useState2[0],
40
- setPointIsBeingTouched = _useState2[1];
41
- var _useState3 = (0, _react.useState)('start'),
42
- _useState4 = _slicedToArray(_useState3, 2),
43
- phase = _useState4[0],
44
- setPhase = _useState4[1];
45
- var _useState5 = (0, _react.useState)(false),
46
- _useState6 = _slicedToArray(_useState5, 2),
47
- finish = _useState6[0],
48
- setFinish = _useState6[1];
49
- var _useState7 = (0, _react.useState)(0),
50
- _useState8 = _slicedToArray(_useState7, 2),
51
- currentQuestion = _useState8[0],
52
- setCurrentQuestion = _useState8[1];
53
- var _useState9 = (0, _react.useState)({
54
- current: {
55
- questions: [],
56
- type: type
57
- }
58
- }),
59
- _useState10 = _slicedToArray(_useState9, 2),
60
- surveyData = _useState10[0],
61
- setSurveyData = _useState10[1];
62
- var _soundActions = _slicedToArray(soundActions, 1),
63
- play = _soundActions[0];
64
- var translate = function translate(id) {
65
- return emitEvent({
66
- type: 'translate',
67
- payload: id
68
- });
69
- };
70
- var lostFocusWhenClickEnter = function lostFocusWhenClickEnter(e) {
71
- if (e.keyCode === 13) {
72
- e.target.blur();
73
- }
74
- };
75
- var close = function close() {
76
- play('click-ui');
77
- emitEvent({
78
- type: 'saveSurveyPrePos',
79
- payload: surveyData.current
80
- });
81
- };
82
- (0, _react.useEffect)(function () {
83
- if (!questions.length && phase === 'questions') {
84
- setPhase('end');
85
- }
86
- }, [questions, phase]);
87
- var handleNextQuestion = function handleNextQuestion(optionSelected) {
88
- var _surveyData$current$q;
89
- var backward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
90
- var answer = optionSelected !== null ? optionSelected : (_surveyData$current$q = surveyData.current.questions.find(function (q) {
91
- return q.id === questions[currentQuestion].id;
92
- })) === null || _surveyData$current$q === void 0 ? void 0 : _surveyData$current$q.answer;
93
- play('click-ui');
94
- if (!backward) {
95
- var questionIndex = surveyData.current.questions.findIndex(function (q) {
96
- return q.id === questions[currentQuestion].id;
97
- });
98
- var updatedQuestions = _toConsumableArray(surveyData.current.questions);
99
- if (questionIndex > -1) {
100
- updatedQuestions.splice(questionIndex, 1, {
101
- id: questions[currentQuestion].id,
102
- answer: answer
103
- });
104
- } else {
105
- updatedQuestions.push({
106
- id: questions[currentQuestion].id,
107
- answer: answer
108
- });
109
- }
110
- setSurveyData(_objectSpread(_objectSpread({}, surveyData), {}, {
111
- current: _objectSpread(_objectSpread({}, surveyData.current), {}, {
112
- questions: updatedQuestions
113
- })
114
- }));
115
- if (currentQuestion === questions.length - 1) {
116
- setFinish(true);
117
- } else {
118
- setCurrentQuestion(currentQuestion + 1);
119
- setFinish(false);
120
- }
121
- } else {
122
- setCurrentQuestion(currentQuestion - 1);
123
- setFinish(false);
124
- }
125
- };
126
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
127
- className: "test--container__overlay",
128
- "aria-label": "test container overlay"
129
- }), /*#__PURE__*/_react.default.createElement("div", {
130
- className: "test--container",
131
- dir: "auto",
132
- "aria-label": "test container"
133
- }, phase === 'start' && /*#__PURE__*/_react.default.createElement(_StartScreen.default, {
134
- description: description,
135
- onNext: function onNext() {
136
- setPhase('questions');
137
- play('click-ui');
138
- },
139
- translate: translate
140
- }), phase === 'questions' && /*#__PURE__*/_react.default.createElement("div", {
141
- className: "survey--questions",
142
- "aria-label": "survey questions"
143
- }, /*#__PURE__*/_react.default.createElement("div", {
144
- className: "survey--questions__container",
145
- "aria-label": "survey questions container"
146
- }, /*#__PURE__*/_react.default.createElement("div", {
147
- className: "survey--questions__intertitle"
148
- }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("span", null, translate('auto-evaluation.question'), "\xA0", currentQuestion + 1, " ", translate('storylines.misc.of'), " ", questions.length)), /*#__PURE__*/_react.default.createElement("div", null, translate('auto-evaluation.allQuestionsMandatory'))), /*#__PURE__*/_react.default.createElement("div", {
149
- key: "".concat(questions[currentQuestion])
150
- }, /*#__PURE__*/_react.default.createElement("div", {
151
- className: "survey--questions__item",
152
- "aria-label": "survey questions item"
153
- }, (_questions$currentQue = questions[currentQuestion]) === null || _questions$currentQue === void 0 ? void 0 : _questions$currentQue.text), /*#__PURE__*/_react.default.createElement("div", {
154
- className: "survey--page__item",
155
- "aria-label": "survey page item"
156
- }, /*#__PURE__*/_react.default.createElement("div", {
157
- className: "survey--points",
158
- "aria-label": "survey points"
159
- }, Array(11).fill(0).map(function (_, i) {
160
- var _surveyData$current$q2;
161
- return /*#__PURE__*/_react.default.createElement("button", {
162
- key: "".concat(0 + i),
163
- type: "button",
164
- onTouchStart: function onTouchStart() {
165
- setPointIsBeingTouched(i);
166
- },
167
- onTouchEnd: function onTouchEnd() {
168
- setPointIsBeingTouched(null);
169
- },
170
- onKeyUp: function onKeyUp(e) {
171
- lostFocusWhenClickEnter(e);
172
- },
173
- onClick: function onClick() {
174
- handleNextQuestion(i, false);
175
- },
176
- className: "survey--points__item ".concat(((_surveyData$current$q2 = surveyData.current.questions[currentQuestion]) === null || _surveyData$current$q2 === void 0 ? void 0 : _surveyData$current$q2.answer) === i || pointIsBeingTouched === i ? 'selected' : '')
177
- }, i);
178
- }))))), /*#__PURE__*/_react.default.createElement("div", {
179
- className: "test--buttons next",
180
- "aria-label": "test buttons"
181
- }, /*#__PURE__*/_react.default.createElement("button", {
182
- type: "button",
183
- disabled: currentQuestion === 0,
184
- onClick: function onClick() {
185
- return handleNextQuestion(null, true);
186
- },
187
- "aria-label": (0, _LangIsRtl.default)() ? translate('survey.next') : translate('survey.previous'),
188
- className: "gat--btn__navigation ".concat(currentQuestion === 0 ? 'disabled' : '')
189
- }, /*#__PURE__*/_react.default.createElement("span", {
190
- className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back',
191
- "aria-label": "icon button"
192
- })), finish ? /*#__PURE__*/_react.default.createElement("button", {
193
- type: "button",
194
- onClick: function onClick() {
195
- setPhase('end');
196
- play('click-ui');
197
- },
198
- className: "gat--btn gat--btn__primary auto-evaluation__button not-transition "
199
- }, /*#__PURE__*/_react.default.createElement("span", null, translate('auto-evaluation.end'))) : /*#__PURE__*/_react.default.createElement("button", {
200
- type: "button",
201
- onClick: function onClick() {
202
- return handleNextQuestion(null, false);
203
- },
204
- disabled: ((_surveyData$current$q3 = surveyData.current.questions[currentQuestion]) === null || _surveyData$current$q3 === void 0 ? void 0 : _surveyData$current$q3.answer) === undefined,
205
- "aria-label": (0, _LangIsRtl.default)() ? translate('survey.previous') : translate('survey.next'),
206
- 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' : '')
207
- }, /*#__PURE__*/_react.default.createElement("span", {
208
- className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
209
- })))), phase === 'end' && /*#__PURE__*/_react.default.createElement(_EndScreen.default, {
210
- onFinish: close,
211
- translate: translate
212
- })));
213
- };
214
- var _default = AutoEvaluation;
215
- exports.default = _default;
@@ -1,43 +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
- 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); }
10
- 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; }
11
- var EndScreen = function EndScreen(_ref) {
12
- var onFinish = _ref.onFinish,
13
- translate = _ref.translate;
14
- // show this screen 2 seconds
15
- (0, _react.useEffect)(function () {
16
- var timeout;
17
- if (onFinish) {
18
- timeout = setTimeout(function () {
19
- onFinish();
20
- }, 2000);
21
- }
22
- return function () {
23
- if (timeout) clearTimeout(timeout);
24
- };
25
- }, [onFinish]);
26
- return /*#__PURE__*/_react.default.createElement("div", {
27
- className: "auto-evaluation__endscreen",
28
- "aria-label": "auto evaluation endscreen"
29
- }, /*#__PURE__*/_react.default.createElement("div", {
30
- className: "auto-evaluation__finishband",
31
- "aria-label": "auto evaluation finishband"
32
- }, /*#__PURE__*/_react.default.createElement("span", {
33
- className: "icon-check-laptop auto-evaluation__iconendscreen",
34
- "aria-label": "icon-check",
35
- role: "img"
36
- }), /*#__PURE__*/_react.default.createElement("span", {
37
- className: "auto-evaluation__thanks",
38
- "aria-label": "auto evaluation thanks",
39
- role: "contentinfo"
40
- }, translate('auto-evaluation.thanks'))));
41
- };
42
- var _default = EndScreen;
43
- exports.default = _default;
@@ -1,32 +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 StartScreen = function StartScreen(_ref) {
10
- var onNext = _ref.onNext,
11
- description = _ref.description,
12
- translate = _ref.translate;
13
- return /*#__PURE__*/_react.default.createElement("div", {
14
- className: "auto-evaluation__startscreen",
15
- role: "alertdialog",
16
- "aria-modal": "true",
17
- "aria-label": "ae start screen"
18
- }, /*#__PURE__*/_react.default.createElement("span", {
19
- className: "icon-happy-laptop auto-evaluation__starticon",
20
- "aria-label": "icon laptop",
21
- role: "img"
22
- }), /*#__PURE__*/_react.default.createElement("div", {
23
- className: "auto-evaluation__starttext",
24
- "aria-label": "desciption"
25
- }, /*#__PURE__*/_react.default.createElement("span", null, description)), /*#__PURE__*/_react.default.createElement("button", {
26
- type: "button",
27
- className: "gat--btn gat--btn__primary auto-evaluation__button auto-evaluation__button--start",
28
- onClick: onNext
29
- }, /*#__PURE__*/_react.default.createElement("span", null, translate('auto-evaluation.start'))));
30
- };
31
- var _default = StartScreen;
32
- exports.default = _default;
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _AutoEvaluation = _interopRequireDefault(require("./components/AutoEvaluation"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- var _default = _AutoEvaluation.default;
10
- exports.default = _default;