@constructor-io/constructorio-ui-quizzes 1.4.4 → 1.4.6

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 (41) hide show
  1. package/README.md +14 -0
  2. package/dist/constructorio-ui-quizzes-bundled.js +13 -13
  3. package/lib/cjs/components/CioQuiz/actions.js +1 -0
  4. package/lib/cjs/components/CioQuiz/index.js +7 -5
  5. package/lib/cjs/components/CioQuiz/quizLocalReducer.js +9 -6
  6. package/lib/cjs/components/RedoButton/RedoButton.js +1 -1
  7. package/lib/cjs/components/ResultCard/ResultCard.js +1 -1
  8. package/lib/cjs/components/ResultContainer/ResultContainer.js +3 -1
  9. package/lib/cjs/components/ZeroResults/ZeroResults.js +1 -1
  10. package/lib/cjs/constants.js +4 -0
  11. package/lib/cjs/hooks/useQuiz.js +2 -1
  12. package/lib/cjs/hooks/useQuizEvents/index.js +1 -1
  13. package/lib/cjs/hooks/useQuizEvents/useQuizResetClick.js +3 -4
  14. package/lib/cjs/hooks/useQuizState/index.js +3 -2
  15. package/lib/cjs/hooks/useQuizState/useQuizApiState.js +8 -2
  16. package/lib/cjs/hooks/useQuizState/useQuizLocalState.js +6 -2
  17. package/lib/cjs/stories/Quiz/tests/mocks.js +1 -0
  18. package/lib/mjs/components/CioQuiz/actions.js +1 -0
  19. package/lib/mjs/components/CioQuiz/index.js +7 -5
  20. package/lib/mjs/components/CioQuiz/quizLocalReducer.js +12 -0
  21. package/lib/mjs/components/RedoButton/RedoButton.js +1 -1
  22. package/lib/mjs/components/ResultCard/ResultCard.js +1 -1
  23. package/lib/mjs/components/ResultContainer/ResultContainer.js +3 -1
  24. package/lib/mjs/components/ZeroResults/ZeroResults.js +1 -1
  25. package/lib/mjs/constants.js +4 -0
  26. package/lib/mjs/hooks/useQuiz.js +2 -1
  27. package/lib/mjs/hooks/useQuizEvents/index.js +1 -1
  28. package/lib/mjs/hooks/useQuizEvents/useQuizResetClick.js +3 -4
  29. package/lib/mjs/hooks/useQuizState/index.js +3 -2
  30. package/lib/mjs/hooks/useQuizState/useQuizApiState.js +8 -2
  31. package/lib/mjs/hooks/useQuizState/useQuizLocalState.js +5 -2
  32. package/lib/mjs/stories/Quiz/tests/mocks.js +1 -0
  33. package/lib/types/components/CioQuiz/actions.d.ts +3 -2
  34. package/lib/types/components/CioQuiz/quizLocalReducer.d.ts +1 -0
  35. package/lib/types/constants.d.ts +1 -1
  36. package/lib/types/hooks/useQuizEvents/useQuizResetClick.d.ts +1 -1
  37. package/lib/types/hooks/useQuizState/index.d.ts +1 -0
  38. package/lib/types/hooks/useQuizState/useQuizApiState.d.ts +1 -1
  39. package/lib/types/hooks/useQuizState/useQuizLocalState.d.ts +3 -1
  40. package/lib/types/types.d.ts +2 -0
  41. package/package.json +5 -1
package/README.md CHANGED
@@ -82,6 +82,20 @@ import '@constructor-io/constructorio-ui-quizzes/styles.css';
82
82
 
83
83
  ### Known Issues
84
84
 
85
+ **Older Javascript environments**
86
+
87
+ The library provides two different builds. CommonJS (cjs) and ECMAScript Modules (mjs)
88
+
89
+ For ECMAScript Modules (mjs) build. The Javascript version is ESNext which might not be supported by your environment.
90
+ If that's the case and your environment is using an older Javascript version like ES6 (ES2015), you might get this error.
91
+
92
+ `Module parse failed: Unexpected token (15:32)
93
+ You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file`
94
+
95
+ To solve this you can import the CommonJS (cjs) build which supports ES6 (ES2015) syntax:
96
+
97
+ `import CioQuiz from '@constructor-io/constructorio-ui-quizzes/cjs'`
98
+
85
99
  **ESLint**
86
100
 
87
101
  There is a known issue with ESLint where it fails to resolve the paths exposed in the `exports` statement of NPM packages. If you are receiving the following error, you can safely disable ESLint using `// eslint-disable-line` for that line.