@micromag/screen-quiz 0.4.27 → 0.4.30

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 (2) hide show
  1. package/es/index.js +11 -8
  2. package/package.json +16 -16
package/es/index.js CHANGED
@@ -1143,11 +1143,9 @@ function QuizMultipleScreen(_ref) {
1143
1143
  isCapture = _useScreenRenderConte.isCapture;
1144
1144
  var _usePlaybackContext = usePlaybackContext(),
1145
1145
  muted = _usePlaybackContext.muted;
1146
- var _usePlaybackMediaRef = usePlaybackMediaRef(current, true),
1147
- mediaRef = _usePlaybackMediaRef.ref,
1148
- _usePlaybackMediaRef$ = _usePlaybackMediaRef.isCurrent,
1149
- isCurrentMedia = _usePlaybackMediaRef$ === void 0 ? false : _usePlaybackMediaRef$;
1150
- console.log('isCurrentMedia', isCurrentMedia, mediaRef);
1146
+
1147
+ // console.log('isCurrentMedia', isCurrentMedia, mediaRef);
1148
+
1151
1149
  var _useViewerWebView = useViewerWebView(),
1152
1150
  openWebView = _useViewerWebView.open;
1153
1151
  var screenState = useScreenState();
@@ -1159,8 +1157,6 @@ function QuizMultipleScreen(_ref) {
1159
1157
  stateIndex = _ref3$2 === void 0 ? 0 : _ref3$2;
1160
1158
  var transitionPlaying = current;
1161
1159
  var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
1162
- var backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
1163
- var backgroundShouldLoad = current || active;
1164
1160
  var hasButtonText = isTextFilled(nextButton);
1165
1161
 
1166
1162
  // Call to Action
@@ -1363,6 +1359,13 @@ function QuizMultipleScreen(_ref) {
1363
1359
  finalBackground = questionBackground;
1364
1360
  backgroundKey = "question_".concat(questionIndex);
1365
1361
  }
1362
+ var _usePlaybackMediaRef = usePlaybackMediaRef(current, finalBackground !== null, backgroundKey),
1363
+ mediaRef = _usePlaybackMediaRef.ref,
1364
+ _usePlaybackMediaRef$ = _usePlaybackMediaRef.isCurrent,
1365
+ isCurrentMedia = _usePlaybackMediaRef$ === void 0 ? false : _usePlaybackMediaRef$;
1366
+ var backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
1367
+ var backgroundShouldLoad = current || active;
1368
+ console.log('finalBackground', finalBackground, backgroundPlaying, backgroundShouldLoad, isCurrentMedia);
1366
1369
 
1367
1370
  // Transition direction
1368
1371
  var lastQuestionIndexRef = useRef(questionIndex);
@@ -1663,7 +1666,7 @@ function QuizMultipleScreen(_ref) {
1663
1666
  top: 0,
1664
1667
  left: 0,
1665
1668
  width: '100%',
1666
- minHeight: '100%'
1669
+ minHeight: hasResult && currentAnsweredIndex !== null ? 0 : '100%'
1667
1670
  })
1668
1671
  }, item.element);
1669
1672
  }))), !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-quiz",
3
- "version": "0.4.27",
3
+ "version": "0.4.30",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -64,20 +64,20 @@
64
64
  "@fortawesome/fontawesome-svg-core": "^7.2.0",
65
65
  "@fortawesome/free-solid-svg-icons": "^7.2.0",
66
66
  "@fortawesome/react-fontawesome": "^3.2.0",
67
- "@micromag/core": "^0.4.27",
68
- "@micromag/data": "^0.4.27",
69
- "@micromag/element-background": "^0.4.27",
70
- "@micromag/element-button": "^0.4.27",
71
- "@micromag/element-container": "^0.4.27",
72
- "@micromag/element-footer": "^0.4.27",
73
- "@micromag/element-header": "^0.4.27",
74
- "@micromag/element-heading": "^0.4.27",
75
- "@micromag/element-keypad": "^0.4.27",
76
- "@micromag/element-layout": "^0.4.27",
77
- "@micromag/element-scroll": "^0.4.27",
78
- "@micromag/element-text": "^0.4.27",
79
- "@micromag/element-visual": "^0.4.27",
80
- "@micromag/transforms": "^0.4.27",
67
+ "@micromag/core": "^0.4.30",
68
+ "@micromag/data": "^0.4.30",
69
+ "@micromag/element-background": "^0.4.30",
70
+ "@micromag/element-button": "^0.4.30",
71
+ "@micromag/element-container": "^0.4.30",
72
+ "@micromag/element-footer": "^0.4.30",
73
+ "@micromag/element-header": "^0.4.30",
74
+ "@micromag/element-heading": "^0.4.30",
75
+ "@micromag/element-keypad": "^0.4.30",
76
+ "@micromag/element-layout": "^0.4.30",
77
+ "@micromag/element-scroll": "^0.4.30",
78
+ "@micromag/element-text": "^0.4.30",
79
+ "@micromag/element-visual": "^0.4.30",
80
+ "@micromag/transforms": "^0.4.30",
81
81
  "@react-spring/core": "^10.0.3",
82
82
  "@react-spring/web": "^10.0.3",
83
83
  "classnames": "^2.2.6",
@@ -89,6 +89,6 @@
89
89
  "access": "public",
90
90
  "registry": "https://registry.npmjs.org/"
91
91
  },
92
- "gitHead": "7541e15e6fe1950d19247a338aaad3d6943ac994",
92
+ "gitHead": "7df8ed5c6b5f3096a94f2bb952858e73227e12bb",
93
93
  "types": "es/index.d.ts"
94
94
  }