@constructor-io/constructorio-ui-quizzes 1.12.1 → 1.12.3

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/lib/cjs/utils.js CHANGED
@@ -114,11 +114,16 @@ const resetQuizSessionStorageState = (quizStateKey) => () => {
114
114
  exports.resetQuizSessionStorageState = resetQuizSessionStorageState;
115
115
  const logger = (action) => {
116
116
  var _a;
117
- if ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.LOGGER) {
118
- console.group(`%cAction:%c ${action.type}`, 'color: red; font-weight: bold;', 'color: green; font-weight: lighter;');
119
- console.log('%c type:', 'color: #9E9E9E; font-weight: 700;', action.type);
120
- console.log('%c payload:', 'color: #00A7F7; font-weight: 700;', action.payload);
121
- console.groupEnd();
117
+ try {
118
+ if (typeof process !== 'undefined' && ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.LOGGER)) {
119
+ console.group(`%cAction:%c ${action.type}`, 'color: red; font-weight: bold;', 'color: green; font-weight: lighter;');
120
+ console.log('%c type:', 'color: #9E9E9E; font-weight: 700;', action.type);
121
+ console.log('%c payload:', 'color: #00A7F7; font-weight: 700;', action.payload);
122
+ console.groupEnd();
123
+ }
124
+ }
125
+ catch (error) {
126
+ // process variable is not available and logger should not be active
122
127
  }
123
128
  };
124
129
  exports.logger = logger;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '1.12.1';
3
+ exports.default = '1.12.3';
package/lib/mjs/utils.js CHANGED
@@ -98,11 +98,16 @@ export const resetQuizSessionStorageState = (quizStateKey) => () => {
98
98
  window?.sessionStorage?.removeItem(quizStateKey);
99
99
  };
100
100
  export const logger = (action) => {
101
- if (process?.env?.LOGGER) {
102
- console.group(`%cAction:%c ${action.type}`, 'color: red; font-weight: bold;', 'color: green; font-weight: lighter;');
103
- console.log('%c type:', 'color: #9E9E9E; font-weight: 700;', action.type);
104
- console.log('%c payload:', 'color: #00A7F7; font-weight: 700;', action.payload);
105
- console.groupEnd();
101
+ try {
102
+ if (typeof process !== 'undefined' && process?.env?.LOGGER) {
103
+ console.group(`%cAction:%c ${action.type}`, 'color: red; font-weight: bold;', 'color: green; font-weight: lighter;');
104
+ console.log('%c type:', 'color: #9E9E9E; font-weight: 700;', action.type);
105
+ console.log('%c payload:', 'color: #00A7F7; font-weight: 700;', action.payload);
106
+ console.groupEnd();
107
+ }
108
+ }
109
+ catch (error) {
110
+ // process variable is not available and logger should not be active
106
111
  }
107
112
  };
108
113
  // Function to emulate pausing between interactions
@@ -1 +1 @@
1
- export default '1.12.1';
1
+ export default '1.12.3';
@@ -1,2 +1,2 @@
1
- declare const _default: "1.12.1";
1
+ declare const _default: "1.12.3";
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-ui-quizzes",
3
- "version": "1.12.1",
3
+ "version": "1.12.3",
4
4
  "description": "Constructor.io Quizzes UI library for web applications",
5
5
  "author": "constructor.io",
6
6
  "license": "MIT",