@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.
- package/README.md +14 -0
- package/dist/constructorio-ui-quizzes-bundled.js +13 -13
- package/lib/cjs/components/CioQuiz/actions.js +1 -0
- package/lib/cjs/components/CioQuiz/index.js +7 -5
- package/lib/cjs/components/CioQuiz/quizLocalReducer.js +9 -6
- package/lib/cjs/components/RedoButton/RedoButton.js +1 -1
- package/lib/cjs/components/ResultCard/ResultCard.js +1 -1
- package/lib/cjs/components/ResultContainer/ResultContainer.js +3 -1
- package/lib/cjs/components/ZeroResults/ZeroResults.js +1 -1
- package/lib/cjs/constants.js +4 -0
- package/lib/cjs/hooks/useQuiz.js +2 -1
- package/lib/cjs/hooks/useQuizEvents/index.js +1 -1
- package/lib/cjs/hooks/useQuizEvents/useQuizResetClick.js +3 -4
- package/lib/cjs/hooks/useQuizState/index.js +3 -2
- package/lib/cjs/hooks/useQuizState/useQuizApiState.js +8 -2
- package/lib/cjs/hooks/useQuizState/useQuizLocalState.js +6 -2
- package/lib/cjs/stories/Quiz/tests/mocks.js +1 -0
- package/lib/mjs/components/CioQuiz/actions.js +1 -0
- package/lib/mjs/components/CioQuiz/index.js +7 -5
- package/lib/mjs/components/CioQuiz/quizLocalReducer.js +12 -0
- package/lib/mjs/components/RedoButton/RedoButton.js +1 -1
- package/lib/mjs/components/ResultCard/ResultCard.js +1 -1
- package/lib/mjs/components/ResultContainer/ResultContainer.js +3 -1
- package/lib/mjs/components/ZeroResults/ZeroResults.js +1 -1
- package/lib/mjs/constants.js +4 -0
- package/lib/mjs/hooks/useQuiz.js +2 -1
- package/lib/mjs/hooks/useQuizEvents/index.js +1 -1
- package/lib/mjs/hooks/useQuizEvents/useQuizResetClick.js +3 -4
- package/lib/mjs/hooks/useQuizState/index.js +3 -2
- package/lib/mjs/hooks/useQuizState/useQuizApiState.js +8 -2
- package/lib/mjs/hooks/useQuizState/useQuizLocalState.js +5 -2
- package/lib/mjs/stories/Quiz/tests/mocks.js +1 -0
- package/lib/types/components/CioQuiz/actions.d.ts +3 -2
- package/lib/types/components/CioQuiz/quizLocalReducer.d.ts +1 -0
- package/lib/types/constants.d.ts +1 -1
- package/lib/types/hooks/useQuizEvents/useQuizResetClick.d.ts +1 -1
- package/lib/types/hooks/useQuizState/index.d.ts +1 -0
- package/lib/types/hooks/useQuizState/useQuizApiState.d.ts +1 -1
- package/lib/types/hooks/useQuizState/useQuizLocalState.d.ts +3 -1
- package/lib/types/types.d.ts +2 -0
- 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.
|