@micromag/screen-survey 0.3.251 → 0.3.262
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/assets/css/styles.css +1 -1
- package/es/index.js +85 -89
- package/lib/index.js +84 -88
- package/package.json +13 -13
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.micromag-screen-survey-container{position:relative;width:100%;height:100%;overflow:hidden}.micromag-screen-survey-disabled.micromag-screen-survey-container{overflow:hidden;pointer-events:none}.micromag-screen-survey-hidden.micromag-screen-survey-container{display:none;visibility:hidden}.micromag-screen-survey-placeholder.micromag-screen-survey-container .micromag-screen-survey-content{position:relative;padding:6px}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer,.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{margin:5px auto;border:2px dashed #343434;color:#343434}.micromag-screen-survey-container .micromag-screen-survey-question{margin-bottom:20px}.micromag-screen-survey-container .micromag-screen-survey-answers,.micromag-screen-survey-container .micromag-screen-survey-items{position:relative}.micromag-screen-survey-container .micromag-screen-survey-callToAction{position:absolute;bottom:0;left:0;width:100%;-webkit-transition:opacity .2s ease-out;-o-transition:opacity .2s ease-out;transition:opacity .2s ease-out}.micromag-screen-survey-container .micromag-screen-survey-callToAction a{padding:0}.micromag-screen-survey-container .micromag-screen-survey-callToAction.micromag-screen-survey-disabled{opacity:0;pointer-events:none}.micromag-screen-survey-container .micromag-screen-survey-item{padding:5px 0}.micromag-screen-survey-container .micromag-screen-survey-item:first-child .micromag-screen-survey-placeholderAnswer{width:80%}.micromag-screen-survey-container .micromag-screen-survey-item:last-child .micromag-screen-survey-placeholderAnswer{width:90%}.micromag-screen-survey-container .micromag-screen-survey-itemContent{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.micromag-screen-survey-container .micromag-screen-survey-resultBar{position:absolute;top:0;left:0;height:100%;background-color:hsla(0,0%,100%,.2)}.micromag-screen-survey-container .micromag-screen-survey-resultLabel{position:absolute;z-index:1;top:50%;right:0;width:4em;padding:0 8px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);color:#fff;text-align:right}.micromag-screen-survey-container .micromag-screen-survey-itemInner{width:100%}.micromag-screen-survey-container .micromag-screen-survey-button{display:-webkit-flex;display:-ms-flexbox;display:flex;position:relative;width:100%;padding:10px;overflow:hidden;-webkit-transition:opacity .5s ease-out;-o-transition:opacity .5s ease-out;transition:opacity .5s ease-out}.micromag-screen-survey-container .micromag-screen-survey-button:disabled{opacity:1;pointer-events:none}.micromag-screen-survey-container .micromag-screen-survey-itemLabel{width:100%}.micromag-screen-survey-container .micromag-screen-survey-itemLabel,.micromag-screen-survey-container .micromag-screen-survey-itemText{display:inline-block;-webkit-transition:margin-left .3s ease-out,-webkit-transform .3s ease-out;transition:margin-left .3s ease-out,-webkit-transform .3s ease-out;-o-transition:margin-left .3s ease-out,transform .3s ease-out;transition:margin-left .3s ease-out,transform .3s ease-out;transition:margin-left .3s ease-out,transform .3s ease-out,-webkit-transform .3s ease-out}.micromag-screen-survey-container .micromag-screen-survey-itemText{position:relative;z-index:1}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer,.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{width:100%;margin:0 auto}.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{height:75px}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer{height:50px}.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-button,.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-result,.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-resultLabel{opacity:1!important}.micromag-screen-survey-container.micromag-screen-survey-answered{line-height:1}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultContainer{padding-right:50px;padding-left:15px}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultContent{width:100%;opacity:1}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-button{border-color:rgba(0,0,0,0);background-color:rgba(0,0,0,0)}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-button,.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-result,.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultLabel{opacity:.6}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-itemLabel{margin-right:0;margin-left:0;text-align:left}.micromag-screen-survey-container.micromag-screen-survey-answered.micromag-screen-survey-withPercentage .micromag-screen-survey-itemText{-webkit-transform:translate(-2em);-ms-transform:translate(-2em);transform:translate(-2em)}.micromag-screen-survey-container.micromag-screen-survey-withPercentage .micromag-screen-survey-itemLabel{margin-right:2em;margin-left:2em}.micromag-screen-survey-container.micromag-screen-survey-isPlaceholder .micromag-screen-survey-layout{padding:10px}.micromag-screen-survey-container.micromag-screen-survey-isPlaceholder .micromag-screen-survey-item{padding:1px 0}
|
|
1
|
+
.micromag-screen-survey-container .micromag-screen-survey-background{position:absolute;top:0;left:0;width:100%;height:100%}.micromag-screen-survey-container{position:relative;width:100%;height:100%;overflow:hidden}.micromag-screen-survey-disabled.micromag-screen-survey-container{overflow:hidden;pointer-events:none}.micromag-screen-survey-hidden.micromag-screen-survey-container{display:none;visibility:hidden}.micromag-screen-survey-placeholder.micromag-screen-survey-container .micromag-screen-survey-content{position:relative;padding:6px}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer,.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{margin:5px auto;border:2px dashed #343434;color:#343434}.micromag-screen-survey-container .micromag-screen-survey-background{z-index:0}.micromag-screen-survey-container .micromag-screen-survey-content{z-index:1}.micromag-screen-survey-container .micromag-screen-survey-question{margin-bottom:20px}.micromag-screen-survey-container .micromag-screen-survey-answers,.micromag-screen-survey-container .micromag-screen-survey-items{position:relative}.micromag-screen-survey-container .micromag-screen-survey-callToAction{position:absolute;bottom:0;left:0;width:100%;-webkit-transition:opacity .2s ease-out;-o-transition:opacity .2s ease-out;transition:opacity .2s ease-out}.micromag-screen-survey-container .micromag-screen-survey-callToAction a{padding:0}.micromag-screen-survey-container .micromag-screen-survey-callToAction.micromag-screen-survey-disabled{opacity:0;pointer-events:none}.micromag-screen-survey-container .micromag-screen-survey-item{padding:5px 0}.micromag-screen-survey-container .micromag-screen-survey-item:first-child .micromag-screen-survey-placeholderAnswer{width:80%}.micromag-screen-survey-container .micromag-screen-survey-item:last-child .micromag-screen-survey-placeholderAnswer{width:90%}.micromag-screen-survey-container .micromag-screen-survey-itemContent{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.micromag-screen-survey-container .micromag-screen-survey-resultBar{position:absolute;top:0;left:0;height:100%;background-color:hsla(0,0%,100%,.2)}.micromag-screen-survey-container .micromag-screen-survey-resultLabel{position:absolute;z-index:1;top:50%;right:0;width:4em;padding:0 8px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);color:#fff;text-align:right}.micromag-screen-survey-container .micromag-screen-survey-itemInner{width:100%}.micromag-screen-survey-container .micromag-screen-survey-button{display:-webkit-flex;display:-ms-flexbox;display:flex;position:relative;width:100%;padding:10px;overflow:hidden;-webkit-transition:opacity .5s ease-out;-o-transition:opacity .5s ease-out;transition:opacity .5s ease-out}.micromag-screen-survey-container .micromag-screen-survey-button:disabled{opacity:1;pointer-events:none}.micromag-screen-survey-container .micromag-screen-survey-itemLabel{width:100%}.micromag-screen-survey-container .micromag-screen-survey-itemLabel,.micromag-screen-survey-container .micromag-screen-survey-itemText{display:inline-block;-webkit-transition:margin-left .3s ease-out,-webkit-transform .3s ease-out;transition:margin-left .3s ease-out,-webkit-transform .3s ease-out;-o-transition:margin-left .3s ease-out,transform .3s ease-out;transition:margin-left .3s ease-out,transform .3s ease-out;transition:margin-left .3s ease-out,transform .3s ease-out,-webkit-transform .3s ease-out}.micromag-screen-survey-container .micromag-screen-survey-itemText{position:relative;z-index:1}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer,.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{width:100%;margin:0 auto}.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{height:75px}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer{height:50px}.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-button,.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-result,.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-resultLabel{opacity:1!important}.micromag-screen-survey-container.micromag-screen-survey-answered{line-height:1}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultContainer{padding-right:50px;padding-left:15px}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultContent{width:100%;opacity:1}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-button{border-color:rgba(0,0,0,0);background-color:rgba(0,0,0,0)}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-button,.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-result,.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultLabel{opacity:.6}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-itemLabel{margin-right:0;margin-left:0;text-align:left}.micromag-screen-survey-container.micromag-screen-survey-answered.micromag-screen-survey-withPercentage .micromag-screen-survey-itemText{-webkit-transform:translate(-2em);-ms-transform:translate(-2em);transform:translate(-2em)}.micromag-screen-survey-container.micromag-screen-survey-withPercentage .micromag-screen-survey-itemLabel{margin-right:2em;margin-left:2em}.micromag-screen-survey-container.micromag-screen-survey-isPlaceholder .micromag-screen-survey-layout{padding:10px}.micromag-screen-survey-container.micromag-screen-survey-isPlaceholder .micromag-screen-survey-item{padding:1px 0}
|
package/es/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import React, { useState, useMemo, useCallback, useEffect } from 'react';
|
|
9
9
|
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
10
10
|
import { ScreenElement, Transitions } from '@micromag/core/components';
|
|
11
|
-
import {
|
|
11
|
+
import { useScreenSize, useScreenRenderContext, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef } from '@micromag/core/contexts';
|
|
12
12
|
import { useTrackScreenEvent, useDimensionObserver } from '@micromag/core/hooks';
|
|
13
13
|
import { isTextFilled, getLargestRemainderRound, getStyleFromColor } from '@micromag/core/utils';
|
|
14
14
|
import { useQuizCreate, useQuiz } from '@micromag/data';
|
|
@@ -21,7 +21,7 @@ import Layout, { Spacer } from '@micromag/element-layout';
|
|
|
21
21
|
import Scroll from '@micromag/element-scroll';
|
|
22
22
|
import Text from '@micromag/element-text';
|
|
23
23
|
|
|
24
|
-
var styles = {"container":"micromag-screen-survey-container","disabled":"micromag-screen-survey-disabled","hidden":"micromag-screen-survey-hidden","placeholder":"micromag-screen-survey-placeholder","content":"micromag-screen-survey-content","emptyAnswer":"micromag-screen-survey-emptyAnswer","emptyQuestion":"micromag-screen-survey-emptyQuestion","question":"micromag-screen-survey-question","answers":"micromag-screen-survey-answers","items":"micromag-screen-survey-items","callToAction":"micromag-screen-survey-callToAction","item":"micromag-screen-survey-item","placeholderAnswer":"micromag-screen-survey-placeholderAnswer","itemContent":"micromag-screen-survey-itemContent","resultBar":"micromag-screen-survey-resultBar","resultLabel":"micromag-screen-survey-resultLabel","itemInner":"micromag-screen-survey-itemInner","button":"micromag-screen-survey-button","itemLabel":"micromag-screen-survey-itemLabel","itemText":"micromag-screen-survey-itemText","userAnswer":"micromag-screen-survey-userAnswer","result":"micromag-screen-survey-result","answered":"micromag-screen-survey-answered","resultContainer":"micromag-screen-survey-resultContainer","resultContent":"micromag-screen-survey-resultContent","withPercentage":"micromag-screen-survey-withPercentage","isPlaceholder":"micromag-screen-survey-isPlaceholder","layout":"micromag-screen-survey-layout"};
|
|
24
|
+
var styles = {"container":"micromag-screen-survey-container","background":"micromag-screen-survey-background","disabled":"micromag-screen-survey-disabled","hidden":"micromag-screen-survey-hidden","placeholder":"micromag-screen-survey-placeholder","content":"micromag-screen-survey-content","emptyAnswer":"micromag-screen-survey-emptyAnswer","emptyQuestion":"micromag-screen-survey-emptyQuestion","question":"micromag-screen-survey-question","answers":"micromag-screen-survey-answers","items":"micromag-screen-survey-items","callToAction":"micromag-screen-survey-callToAction","item":"micromag-screen-survey-item","placeholderAnswer":"micromag-screen-survey-placeholderAnswer","itemContent":"micromag-screen-survey-itemContent","resultBar":"micromag-screen-survey-resultBar","resultLabel":"micromag-screen-survey-resultLabel","itemInner":"micromag-screen-survey-itemInner","button":"micromag-screen-survey-button","itemLabel":"micromag-screen-survey-itemLabel","itemText":"micromag-screen-survey-itemText","userAnswer":"micromag-screen-survey-userAnswer","result":"micromag-screen-survey-result","answered":"micromag-screen-survey-answered","resultContainer":"micromag-screen-survey-resultContainer","resultContent":"micromag-screen-survey-resultContent","withPercentage":"micromag-screen-survey-withPercentage","isPlaceholder":"micromag-screen-survey-isPlaceholder","layout":"micromag-screen-survey-layout"};
|
|
25
25
|
|
|
26
26
|
var propTypes = {
|
|
27
27
|
id: PropTypes.string,
|
|
@@ -71,7 +71,7 @@ var defaultProps = {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
var SurveyScreen = function SurveyScreen(_ref) {
|
|
74
|
-
var
|
|
74
|
+
var _ref19;
|
|
75
75
|
|
|
76
76
|
var id = _ref.id,
|
|
77
77
|
layout = _ref.layout,
|
|
@@ -93,12 +93,6 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
93
93
|
type = _ref.type,
|
|
94
94
|
className = _ref.className;
|
|
95
95
|
var screenId = id || 'screen-id';
|
|
96
|
-
var visitor = useVisitor();
|
|
97
|
-
|
|
98
|
-
var _ref2 = visitor || {},
|
|
99
|
-
_ref2$id = _ref2.id,
|
|
100
|
-
visitorId = _ref2$id === void 0 ? null : _ref2$id;
|
|
101
|
-
|
|
102
96
|
var trackScreenEvent = useTrackScreenEvent(type);
|
|
103
97
|
|
|
104
98
|
var _useScreenSize = useScreenSize(),
|
|
@@ -107,8 +101,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
107
101
|
resolution = _useScreenSize.resolution;
|
|
108
102
|
|
|
109
103
|
var _useQuizCreate = useQuizCreate({
|
|
110
|
-
screenId: screenId
|
|
111
|
-
visitorId: visitorId
|
|
104
|
+
screenId: screenId
|
|
112
105
|
}),
|
|
113
106
|
submitQuiz = _useQuizCreate.create;
|
|
114
107
|
|
|
@@ -143,18 +136,18 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
143
136
|
allQuizAnswers = _useQuiz$quiz === void 0 ? [] : _useQuiz$quiz;
|
|
144
137
|
|
|
145
138
|
var quizAnswers = allQuizAnswers.filter(function (item) {
|
|
146
|
-
var
|
|
147
|
-
|
|
148
|
-
choice =
|
|
139
|
+
var _ref2 = item || {},
|
|
140
|
+
_ref2$choice = _ref2.choice,
|
|
141
|
+
choice = _ref2$choice === void 0 ? null : _ref2$choice;
|
|
149
142
|
|
|
150
143
|
var answersBody = answers.map(function (answer) {
|
|
151
|
-
var
|
|
152
|
-
|
|
153
|
-
label =
|
|
144
|
+
var _ref3 = answer || {},
|
|
145
|
+
_ref3$label = _ref3.label,
|
|
146
|
+
label = _ref3$label === void 0 ? null : _ref3$label;
|
|
154
147
|
|
|
155
|
-
var
|
|
156
|
-
|
|
157
|
-
body =
|
|
148
|
+
var _ref4 = label || {},
|
|
149
|
+
_ref4$body = _ref4.body,
|
|
150
|
+
body = _ref4$body === void 0 ? null : _ref4$body;
|
|
158
151
|
|
|
159
152
|
return body;
|
|
160
153
|
}).filter(function (body) {
|
|
@@ -180,25 +173,25 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
180
173
|
|
|
181
174
|
var answered = userAnswerIndex !== null;
|
|
182
175
|
var quizAnswersComputed = useMemo(function () {
|
|
183
|
-
var total = answers !== null ? (quizAnswers || []).reduce(function (points,
|
|
184
|
-
var
|
|
185
|
-
count =
|
|
176
|
+
var total = answers !== null ? (quizAnswers || []).reduce(function (points, _ref5) {
|
|
177
|
+
var _ref5$count = _ref5.count,
|
|
178
|
+
count = _ref5$count === void 0 ? 0 : _ref5$count;
|
|
186
179
|
return points + parseInt(count, 10);
|
|
187
180
|
}, userAnswerIndex !== null && userAnswerIndex > -1 ? 1 : 0) : 0;
|
|
188
181
|
var computed = answers !== null ? (answers || []).reduce(function (answersTotal, ans, i) {
|
|
189
|
-
var
|
|
190
|
-
|
|
191
|
-
label =
|
|
182
|
+
var _ref6 = ans || {},
|
|
183
|
+
_ref6$label = _ref6.label,
|
|
184
|
+
label = _ref6$label === void 0 ? {} : _ref6$label;
|
|
192
185
|
|
|
193
|
-
var
|
|
194
|
-
|
|
195
|
-
body =
|
|
186
|
+
var _ref7 = label || {},
|
|
187
|
+
_ref7$body = _ref7.body,
|
|
188
|
+
body = _ref7$body === void 0 ? null : _ref7$body;
|
|
196
189
|
|
|
197
|
-
var
|
|
190
|
+
var _ref8 = quizAnswers.find(function (qa) {
|
|
198
191
|
return qa.choice === body;
|
|
199
192
|
}) || {},
|
|
200
|
-
|
|
201
|
-
count =
|
|
193
|
+
_ref8$count = _ref8.count,
|
|
194
|
+
count = _ref8$count === void 0 ? 0 : _ref8$count;
|
|
202
195
|
|
|
203
196
|
var countWithUser = i === userAnswerIndex ? count + 1 : count;
|
|
204
197
|
|
|
@@ -248,9 +241,9 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
248
241
|
}
|
|
249
242
|
}, [isEdit, current, userAnswerIndex, setUserAnswerIndex]); // Call to Action
|
|
250
243
|
|
|
251
|
-
var
|
|
252
|
-
|
|
253
|
-
hasCallToAction =
|
|
244
|
+
var _ref9 = callToAction || {},
|
|
245
|
+
_ref9$active = _ref9.active,
|
|
246
|
+
hasCallToAction = _ref9$active === void 0 ? false : _ref9$active;
|
|
254
247
|
|
|
255
248
|
var _useDimensionObserver = useDimensionObserver(),
|
|
256
249
|
callToActionRef = _useDimensionObserver.ref,
|
|
@@ -264,8 +257,8 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
264
257
|
scrolledBottom = _useState4[0],
|
|
265
258
|
setScrolledBottom = _useState4[1];
|
|
266
259
|
|
|
267
|
-
var onScrolledBottom = useCallback(function (
|
|
268
|
-
var initial =
|
|
260
|
+
var onScrolledBottom = useCallback(function (_ref10) {
|
|
261
|
+
var initial = _ref10.initial;
|
|
269
262
|
|
|
270
263
|
if (initial) {
|
|
271
264
|
trackScreenEvent('scroll', 'Screen');
|
|
@@ -305,13 +298,13 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
305
298
|
|
|
306
299
|
var finalTransitionDuration = showInstantAnswer ? 0 : "".concat(resultTransitionDuration, "ms");
|
|
307
300
|
|
|
308
|
-
var
|
|
309
|
-
|
|
310
|
-
resultsBarColor =
|
|
311
|
-
|
|
312
|
-
resultsTextColor =
|
|
313
|
-
|
|
314
|
-
resultsPercentageTextStyle =
|
|
301
|
+
var _ref11 = resultsStyle || {},
|
|
302
|
+
_ref11$barColor = _ref11.barColor,
|
|
303
|
+
resultsBarColor = _ref11$barColor === void 0 ? null : _ref11$barColor,
|
|
304
|
+
_ref11$textColor = _ref11.textColor,
|
|
305
|
+
resultsTextColor = _ref11$textColor === void 0 ? null : _ref11$textColor,
|
|
306
|
+
_ref11$percentageText = _ref11.percentageTextStyle,
|
|
307
|
+
resultsPercentageTextStyle = _ref11$percentageText === void 0 ? null : _ref11$percentageText;
|
|
315
308
|
|
|
316
309
|
items.push( /*#__PURE__*/React.createElement("div", {
|
|
317
310
|
key: "answers",
|
|
@@ -321,38 +314,38 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
321
314
|
}, (isPlaceholder ? _toConsumableArray(new Array(3)) : answers).map(function (answer, answerIndex) {
|
|
322
315
|
var hasAnswer = answer !== null;
|
|
323
316
|
|
|
324
|
-
var
|
|
325
|
-
|
|
326
|
-
label =
|
|
327
|
-
|
|
328
|
-
answerButtonStyle =
|
|
329
|
-
|
|
330
|
-
answerButtonTextStyle =
|
|
331
|
-
|
|
332
|
-
answerResultStyle =
|
|
333
|
-
|
|
334
|
-
var
|
|
335
|
-
|
|
336
|
-
answerResultBarColor =
|
|
337
|
-
answerResultTextColor =
|
|
338
|
-
|
|
339
|
-
answerResultPercentageTextStyle =
|
|
340
|
-
|
|
341
|
-
var
|
|
342
|
-
|
|
343
|
-
body =
|
|
344
|
-
|
|
345
|
-
var
|
|
346
|
-
|
|
347
|
-
percent =
|
|
348
|
-
|
|
349
|
-
var
|
|
350
|
-
|
|
351
|
-
textStyle =
|
|
352
|
-
|
|
353
|
-
var
|
|
354
|
-
|
|
355
|
-
labelColor =
|
|
317
|
+
var _ref12 = answer || {},
|
|
318
|
+
_ref12$label = _ref12.label,
|
|
319
|
+
label = _ref12$label === void 0 ? null : _ref12$label,
|
|
320
|
+
_ref12$buttonStyle = _ref12.buttonStyle,
|
|
321
|
+
answerButtonStyle = _ref12$buttonStyle === void 0 ? null : _ref12$buttonStyle,
|
|
322
|
+
_ref12$textStyle = _ref12.textStyle,
|
|
323
|
+
answerButtonTextStyle = _ref12$textStyle === void 0 ? null : _ref12$textStyle,
|
|
324
|
+
_ref12$resultStyle = _ref12.resultStyle,
|
|
325
|
+
answerResultStyle = _ref12$resultStyle === void 0 ? null : _ref12$resultStyle;
|
|
326
|
+
|
|
327
|
+
var _ref13 = answerResultStyle || {},
|
|
328
|
+
_ref13$barColor = _ref13.barColor,
|
|
329
|
+
answerResultBarColor = _ref13$barColor === void 0 ? null : _ref13$barColor,
|
|
330
|
+
answerResultTextColor = _ref13.textColor,
|
|
331
|
+
_ref13$percentageText = _ref13.percentageTextStyle,
|
|
332
|
+
answerResultPercentageTextStyle = _ref13$percentageText === void 0 ? null : _ref13$percentageText;
|
|
333
|
+
|
|
334
|
+
var _ref14 = label || {},
|
|
335
|
+
_ref14$body = _ref14.body,
|
|
336
|
+
body = _ref14$body === void 0 ? null : _ref14$body;
|
|
337
|
+
|
|
338
|
+
var _ref15 = body !== null ? quizAnswersComputed[body] || {} : {},
|
|
339
|
+
_ref15$percent = _ref15.percent,
|
|
340
|
+
percent = _ref15$percent === void 0 ? 0 : _ref15$percent;
|
|
341
|
+
|
|
342
|
+
var _ref16 = label || {},
|
|
343
|
+
_ref16$textStyle = _ref16.textStyle,
|
|
344
|
+
textStyle = _ref16$textStyle === void 0 ? null : _ref16$textStyle;
|
|
345
|
+
|
|
346
|
+
var _ref17 = textStyle || {},
|
|
347
|
+
_ref17$color = _ref17.color,
|
|
348
|
+
labelColor = _ref17$color === void 0 ? null : _ref17$color;
|
|
356
349
|
|
|
357
350
|
var hasAnswerLabel = isTextFilled(label);
|
|
358
351
|
var userAnswer = userAnswerIndex === answerIndex;
|
|
@@ -427,19 +420,11 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
427
420
|
}) : null))))) : null));
|
|
428
421
|
})) : null));
|
|
429
422
|
return /*#__PURE__*/React.createElement("div", {
|
|
430
|
-
className: classNames([styles.container, (
|
|
431
|
-
},
|
|
432
|
-
background: background,
|
|
423
|
+
className: classNames([styles.container, (_ref19 = {}, _defineProperty(_ref19, className, className !== null), _defineProperty(_ref19, styles.answered, answered), _defineProperty(_ref19, styles.withPercentage, !withoutPercentage), _defineProperty(_ref19, styles.isPlaceholder, isPlaceholder), _ref19)])
|
|
424
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
433
425
|
width: width,
|
|
434
426
|
height: height,
|
|
435
|
-
|
|
436
|
-
playing: backgroundPlaying,
|
|
437
|
-
muted: muted,
|
|
438
|
-
shouldLoad: mediaShouldLoad,
|
|
439
|
-
mediaRef: mediaRef
|
|
440
|
-
}) : null, /*#__PURE__*/React.createElement(Container, {
|
|
441
|
-
width: width,
|
|
442
|
-
height: height
|
|
427
|
+
className: styles.content
|
|
443
428
|
}, /*#__PURE__*/React.createElement(Scroll, {
|
|
444
429
|
verticalAlign: verticalAlign,
|
|
445
430
|
disabled: scrollingDisabled,
|
|
@@ -450,7 +435,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
450
435
|
verticalAlign: verticalAlign,
|
|
451
436
|
style: !isPlaceholder ? {
|
|
452
437
|
padding: spacing,
|
|
453
|
-
paddingTop: (
|
|
438
|
+
paddingTop: (!isPreview ? viewerTopHeight : 0) + spacing,
|
|
454
439
|
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (callToActionHeight + spacing)
|
|
455
440
|
} : null
|
|
456
441
|
}, items)), !isPlaceholder && hasCallToAction ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -467,7 +452,18 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
467
452
|
animationDisabled: isPreview,
|
|
468
453
|
focusable: current && isView,
|
|
469
454
|
openWebView: openWebView
|
|
470
|
-
}))) : null)
|
|
455
|
+
}))) : null), !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
|
|
456
|
+
background: background,
|
|
457
|
+
width: width,
|
|
458
|
+
height: height,
|
|
459
|
+
resolution: resolution,
|
|
460
|
+
playing: backgroundPlaying,
|
|
461
|
+
muted: muted,
|
|
462
|
+
shouldLoad: mediaShouldLoad,
|
|
463
|
+
mediaRef: mediaRef,
|
|
464
|
+
withoutVideo: isPreview,
|
|
465
|
+
className: styles.background
|
|
466
|
+
}) : null);
|
|
471
467
|
};
|
|
472
468
|
|
|
473
469
|
SurveyScreen.propTypes = propTypes;
|
package/lib/index.js
CHANGED
|
@@ -43,7 +43,7 @@ var Layout__default = /*#__PURE__*/_interopDefaultLegacy(Layout);
|
|
|
43
43
|
var Scroll__default = /*#__PURE__*/_interopDefaultLegacy(Scroll);
|
|
44
44
|
var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text);
|
|
45
45
|
|
|
46
|
-
var styles = {"container":"micromag-screen-survey-container","disabled":"micromag-screen-survey-disabled","hidden":"micromag-screen-survey-hidden","placeholder":"micromag-screen-survey-placeholder","content":"micromag-screen-survey-content","emptyAnswer":"micromag-screen-survey-emptyAnswer","emptyQuestion":"micromag-screen-survey-emptyQuestion","question":"micromag-screen-survey-question","answers":"micromag-screen-survey-answers","items":"micromag-screen-survey-items","callToAction":"micromag-screen-survey-callToAction","item":"micromag-screen-survey-item","placeholderAnswer":"micromag-screen-survey-placeholderAnswer","itemContent":"micromag-screen-survey-itemContent","resultBar":"micromag-screen-survey-resultBar","resultLabel":"micromag-screen-survey-resultLabel","itemInner":"micromag-screen-survey-itemInner","button":"micromag-screen-survey-button","itemLabel":"micromag-screen-survey-itemLabel","itemText":"micromag-screen-survey-itemText","userAnswer":"micromag-screen-survey-userAnswer","result":"micromag-screen-survey-result","answered":"micromag-screen-survey-answered","resultContainer":"micromag-screen-survey-resultContainer","resultContent":"micromag-screen-survey-resultContent","withPercentage":"micromag-screen-survey-withPercentage","isPlaceholder":"micromag-screen-survey-isPlaceholder","layout":"micromag-screen-survey-layout"};
|
|
46
|
+
var styles = {"container":"micromag-screen-survey-container","background":"micromag-screen-survey-background","disabled":"micromag-screen-survey-disabled","hidden":"micromag-screen-survey-hidden","placeholder":"micromag-screen-survey-placeholder","content":"micromag-screen-survey-content","emptyAnswer":"micromag-screen-survey-emptyAnswer","emptyQuestion":"micromag-screen-survey-emptyQuestion","question":"micromag-screen-survey-question","answers":"micromag-screen-survey-answers","items":"micromag-screen-survey-items","callToAction":"micromag-screen-survey-callToAction","item":"micromag-screen-survey-item","placeholderAnswer":"micromag-screen-survey-placeholderAnswer","itemContent":"micromag-screen-survey-itemContent","resultBar":"micromag-screen-survey-resultBar","resultLabel":"micromag-screen-survey-resultLabel","itemInner":"micromag-screen-survey-itemInner","button":"micromag-screen-survey-button","itemLabel":"micromag-screen-survey-itemLabel","itemText":"micromag-screen-survey-itemText","userAnswer":"micromag-screen-survey-userAnswer","result":"micromag-screen-survey-result","answered":"micromag-screen-survey-answered","resultContainer":"micromag-screen-survey-resultContainer","resultContent":"micromag-screen-survey-resultContent","withPercentage":"micromag-screen-survey-withPercentage","isPlaceholder":"micromag-screen-survey-isPlaceholder","layout":"micromag-screen-survey-layout"};
|
|
47
47
|
|
|
48
48
|
var propTypes = {
|
|
49
49
|
id: PropTypes__default["default"].string,
|
|
@@ -93,7 +93,7 @@ var defaultProps = {
|
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
var SurveyScreen = function SurveyScreen(_ref) {
|
|
96
|
-
var
|
|
96
|
+
var _ref19;
|
|
97
97
|
|
|
98
98
|
var id = _ref.id,
|
|
99
99
|
layout = _ref.layout,
|
|
@@ -115,12 +115,6 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
115
115
|
type = _ref.type,
|
|
116
116
|
className = _ref.className;
|
|
117
117
|
var screenId = id || 'screen-id';
|
|
118
|
-
var visitor = contexts.useVisitor();
|
|
119
|
-
|
|
120
|
-
var _ref2 = visitor || {},
|
|
121
|
-
_ref2$id = _ref2.id,
|
|
122
|
-
visitorId = _ref2$id === void 0 ? null : _ref2$id;
|
|
123
|
-
|
|
124
118
|
var trackScreenEvent = hooks.useTrackScreenEvent(type);
|
|
125
119
|
|
|
126
120
|
var _useScreenSize = contexts.useScreenSize(),
|
|
@@ -129,8 +123,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
129
123
|
resolution = _useScreenSize.resolution;
|
|
130
124
|
|
|
131
125
|
var _useQuizCreate = data.useQuizCreate({
|
|
132
|
-
screenId: screenId
|
|
133
|
-
visitorId: visitorId
|
|
126
|
+
screenId: screenId
|
|
134
127
|
}),
|
|
135
128
|
submitQuiz = _useQuizCreate.create;
|
|
136
129
|
|
|
@@ -165,18 +158,18 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
165
158
|
allQuizAnswers = _useQuiz$quiz === void 0 ? [] : _useQuiz$quiz;
|
|
166
159
|
|
|
167
160
|
var quizAnswers = allQuizAnswers.filter(function (item) {
|
|
168
|
-
var
|
|
169
|
-
|
|
170
|
-
choice =
|
|
161
|
+
var _ref2 = item || {},
|
|
162
|
+
_ref2$choice = _ref2.choice,
|
|
163
|
+
choice = _ref2$choice === void 0 ? null : _ref2$choice;
|
|
171
164
|
|
|
172
165
|
var answersBody = answers.map(function (answer) {
|
|
173
|
-
var
|
|
174
|
-
|
|
175
|
-
label =
|
|
166
|
+
var _ref3 = answer || {},
|
|
167
|
+
_ref3$label = _ref3.label,
|
|
168
|
+
label = _ref3$label === void 0 ? null : _ref3$label;
|
|
176
169
|
|
|
177
|
-
var
|
|
178
|
-
|
|
179
|
-
body =
|
|
170
|
+
var _ref4 = label || {},
|
|
171
|
+
_ref4$body = _ref4.body,
|
|
172
|
+
body = _ref4$body === void 0 ? null : _ref4$body;
|
|
180
173
|
|
|
181
174
|
return body;
|
|
182
175
|
}).filter(function (body) {
|
|
@@ -202,25 +195,25 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
202
195
|
|
|
203
196
|
var answered = userAnswerIndex !== null;
|
|
204
197
|
var quizAnswersComputed = React.useMemo(function () {
|
|
205
|
-
var total = answers !== null ? (quizAnswers || []).reduce(function (points,
|
|
206
|
-
var
|
|
207
|
-
count =
|
|
198
|
+
var total = answers !== null ? (quizAnswers || []).reduce(function (points, _ref5) {
|
|
199
|
+
var _ref5$count = _ref5.count,
|
|
200
|
+
count = _ref5$count === void 0 ? 0 : _ref5$count;
|
|
208
201
|
return points + parseInt(count, 10);
|
|
209
202
|
}, userAnswerIndex !== null && userAnswerIndex > -1 ? 1 : 0) : 0;
|
|
210
203
|
var computed = answers !== null ? (answers || []).reduce(function (answersTotal, ans, i) {
|
|
211
|
-
var
|
|
212
|
-
|
|
213
|
-
label =
|
|
204
|
+
var _ref6 = ans || {},
|
|
205
|
+
_ref6$label = _ref6.label,
|
|
206
|
+
label = _ref6$label === void 0 ? {} : _ref6$label;
|
|
214
207
|
|
|
215
|
-
var
|
|
216
|
-
|
|
217
|
-
body =
|
|
208
|
+
var _ref7 = label || {},
|
|
209
|
+
_ref7$body = _ref7.body,
|
|
210
|
+
body = _ref7$body === void 0 ? null : _ref7$body;
|
|
218
211
|
|
|
219
|
-
var
|
|
212
|
+
var _ref8 = quizAnswers.find(function (qa) {
|
|
220
213
|
return qa.choice === body;
|
|
221
214
|
}) || {},
|
|
222
|
-
|
|
223
|
-
count =
|
|
215
|
+
_ref8$count = _ref8.count,
|
|
216
|
+
count = _ref8$count === void 0 ? 0 : _ref8$count;
|
|
224
217
|
|
|
225
218
|
var countWithUser = i === userAnswerIndex ? count + 1 : count;
|
|
226
219
|
|
|
@@ -270,9 +263,9 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
270
263
|
}
|
|
271
264
|
}, [isEdit, current, userAnswerIndex, setUserAnswerIndex]); // Call to Action
|
|
272
265
|
|
|
273
|
-
var
|
|
274
|
-
|
|
275
|
-
hasCallToAction =
|
|
266
|
+
var _ref9 = callToAction || {},
|
|
267
|
+
_ref9$active = _ref9.active,
|
|
268
|
+
hasCallToAction = _ref9$active === void 0 ? false : _ref9$active;
|
|
276
269
|
|
|
277
270
|
var _useDimensionObserver = hooks.useDimensionObserver(),
|
|
278
271
|
callToActionRef = _useDimensionObserver.ref,
|
|
@@ -286,8 +279,8 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
286
279
|
scrolledBottom = _useState4[0],
|
|
287
280
|
setScrolledBottom = _useState4[1];
|
|
288
281
|
|
|
289
|
-
var onScrolledBottom = React.useCallback(function (
|
|
290
|
-
var initial =
|
|
282
|
+
var onScrolledBottom = React.useCallback(function (_ref10) {
|
|
283
|
+
var initial = _ref10.initial;
|
|
291
284
|
|
|
292
285
|
if (initial) {
|
|
293
286
|
trackScreenEvent('scroll', 'Screen');
|
|
@@ -327,13 +320,13 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
327
320
|
|
|
328
321
|
var finalTransitionDuration = showInstantAnswer ? 0 : "".concat(resultTransitionDuration, "ms");
|
|
329
322
|
|
|
330
|
-
var
|
|
331
|
-
|
|
332
|
-
resultsBarColor =
|
|
333
|
-
|
|
334
|
-
resultsTextColor =
|
|
335
|
-
|
|
336
|
-
resultsPercentageTextStyle =
|
|
323
|
+
var _ref11 = resultsStyle || {},
|
|
324
|
+
_ref11$barColor = _ref11.barColor,
|
|
325
|
+
resultsBarColor = _ref11$barColor === void 0 ? null : _ref11$barColor,
|
|
326
|
+
_ref11$textColor = _ref11.textColor,
|
|
327
|
+
resultsTextColor = _ref11$textColor === void 0 ? null : _ref11$textColor,
|
|
328
|
+
_ref11$percentageText = _ref11.percentageTextStyle,
|
|
329
|
+
resultsPercentageTextStyle = _ref11$percentageText === void 0 ? null : _ref11$percentageText;
|
|
337
330
|
|
|
338
331
|
items.push( /*#__PURE__*/React__default["default"].createElement("div", {
|
|
339
332
|
key: "answers",
|
|
@@ -343,38 +336,38 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
343
336
|
}, (isPlaceholder ? _toConsumableArray__default["default"](new Array(3)) : answers).map(function (answer, answerIndex) {
|
|
344
337
|
var hasAnswer = answer !== null;
|
|
345
338
|
|
|
346
|
-
var
|
|
347
|
-
|
|
348
|
-
label =
|
|
349
|
-
|
|
350
|
-
answerButtonStyle =
|
|
351
|
-
|
|
352
|
-
answerButtonTextStyle =
|
|
353
|
-
|
|
354
|
-
answerResultStyle =
|
|
355
|
-
|
|
356
|
-
var
|
|
357
|
-
|
|
358
|
-
answerResultBarColor =
|
|
359
|
-
answerResultTextColor =
|
|
360
|
-
|
|
361
|
-
answerResultPercentageTextStyle =
|
|
362
|
-
|
|
363
|
-
var
|
|
364
|
-
|
|
365
|
-
body =
|
|
366
|
-
|
|
367
|
-
var
|
|
368
|
-
|
|
369
|
-
percent =
|
|
370
|
-
|
|
371
|
-
var
|
|
372
|
-
|
|
373
|
-
textStyle =
|
|
374
|
-
|
|
375
|
-
var
|
|
376
|
-
|
|
377
|
-
labelColor =
|
|
339
|
+
var _ref12 = answer || {},
|
|
340
|
+
_ref12$label = _ref12.label,
|
|
341
|
+
label = _ref12$label === void 0 ? null : _ref12$label,
|
|
342
|
+
_ref12$buttonStyle = _ref12.buttonStyle,
|
|
343
|
+
answerButtonStyle = _ref12$buttonStyle === void 0 ? null : _ref12$buttonStyle,
|
|
344
|
+
_ref12$textStyle = _ref12.textStyle,
|
|
345
|
+
answerButtonTextStyle = _ref12$textStyle === void 0 ? null : _ref12$textStyle,
|
|
346
|
+
_ref12$resultStyle = _ref12.resultStyle,
|
|
347
|
+
answerResultStyle = _ref12$resultStyle === void 0 ? null : _ref12$resultStyle;
|
|
348
|
+
|
|
349
|
+
var _ref13 = answerResultStyle || {},
|
|
350
|
+
_ref13$barColor = _ref13.barColor,
|
|
351
|
+
answerResultBarColor = _ref13$barColor === void 0 ? null : _ref13$barColor,
|
|
352
|
+
answerResultTextColor = _ref13.textColor,
|
|
353
|
+
_ref13$percentageText = _ref13.percentageTextStyle,
|
|
354
|
+
answerResultPercentageTextStyle = _ref13$percentageText === void 0 ? null : _ref13$percentageText;
|
|
355
|
+
|
|
356
|
+
var _ref14 = label || {},
|
|
357
|
+
_ref14$body = _ref14.body,
|
|
358
|
+
body = _ref14$body === void 0 ? null : _ref14$body;
|
|
359
|
+
|
|
360
|
+
var _ref15 = body !== null ? quizAnswersComputed[body] || {} : {},
|
|
361
|
+
_ref15$percent = _ref15.percent,
|
|
362
|
+
percent = _ref15$percent === void 0 ? 0 : _ref15$percent;
|
|
363
|
+
|
|
364
|
+
var _ref16 = label || {},
|
|
365
|
+
_ref16$textStyle = _ref16.textStyle,
|
|
366
|
+
textStyle = _ref16$textStyle === void 0 ? null : _ref16$textStyle;
|
|
367
|
+
|
|
368
|
+
var _ref17 = textStyle || {},
|
|
369
|
+
_ref17$color = _ref17.color,
|
|
370
|
+
labelColor = _ref17$color === void 0 ? null : _ref17$color;
|
|
378
371
|
|
|
379
372
|
var hasAnswerLabel = utils.isTextFilled(label);
|
|
380
373
|
var userAnswer = userAnswerIndex === answerIndex;
|
|
@@ -449,19 +442,11 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
449
442
|
}) : null))))) : null));
|
|
450
443
|
})) : null));
|
|
451
444
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
452
|
-
className: classNames__default["default"]([styles.container, (
|
|
453
|
-
},
|
|
454
|
-
background: background,
|
|
445
|
+
className: classNames__default["default"]([styles.container, (_ref19 = {}, _defineProperty__default["default"](_ref19, className, className !== null), _defineProperty__default["default"](_ref19, styles.answered, answered), _defineProperty__default["default"](_ref19, styles.withPercentage, !withoutPercentage), _defineProperty__default["default"](_ref19, styles.isPlaceholder, isPlaceholder), _ref19)])
|
|
446
|
+
}, /*#__PURE__*/React__default["default"].createElement(Container__default["default"], {
|
|
455
447
|
width: width,
|
|
456
448
|
height: height,
|
|
457
|
-
|
|
458
|
-
playing: backgroundPlaying,
|
|
459
|
-
muted: muted,
|
|
460
|
-
shouldLoad: mediaShouldLoad,
|
|
461
|
-
mediaRef: mediaRef
|
|
462
|
-
}) : null, /*#__PURE__*/React__default["default"].createElement(Container__default["default"], {
|
|
463
|
-
width: width,
|
|
464
|
-
height: height
|
|
449
|
+
className: styles.content
|
|
465
450
|
}, /*#__PURE__*/React__default["default"].createElement(Scroll__default["default"], {
|
|
466
451
|
verticalAlign: verticalAlign,
|
|
467
452
|
disabled: scrollingDisabled,
|
|
@@ -472,7 +457,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
472
457
|
verticalAlign: verticalAlign,
|
|
473
458
|
style: !isPlaceholder ? {
|
|
474
459
|
padding: spacing,
|
|
475
|
-
paddingTop: (
|
|
460
|
+
paddingTop: (!isPreview ? viewerTopHeight : 0) + spacing,
|
|
476
461
|
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (callToActionHeight + spacing)
|
|
477
462
|
} : null
|
|
478
463
|
}, items)), !isPlaceholder && hasCallToAction ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -489,7 +474,18 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
489
474
|
animationDisabled: isPreview,
|
|
490
475
|
focusable: current && isView,
|
|
491
476
|
openWebView: openWebView
|
|
492
|
-
}))) : null)
|
|
477
|
+
}))) : null), !isPlaceholder ? /*#__PURE__*/React__default["default"].createElement(Background__default["default"], {
|
|
478
|
+
background: background,
|
|
479
|
+
width: width,
|
|
480
|
+
height: height,
|
|
481
|
+
resolution: resolution,
|
|
482
|
+
playing: backgroundPlaying,
|
|
483
|
+
muted: muted,
|
|
484
|
+
shouldLoad: mediaShouldLoad,
|
|
485
|
+
mediaRef: mediaRef,
|
|
486
|
+
withoutVideo: isPreview,
|
|
487
|
+
className: styles.background
|
|
488
|
+
}) : null);
|
|
493
489
|
};
|
|
494
490
|
|
|
495
491
|
SurveyScreen.propTypes = propTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-survey",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.262",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,17 +49,17 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.3.
|
|
53
|
-
"@micromag/data": "^0.3.
|
|
54
|
-
"@micromag/element-background": "^0.3.
|
|
55
|
-
"@micromag/element-button": "^0.3.
|
|
56
|
-
"@micromag/element-call-to-action": "^0.3.
|
|
57
|
-
"@micromag/element-container": "^0.3.
|
|
58
|
-
"@micromag/element-heading": "^0.3.
|
|
59
|
-
"@micromag/element-layout": "^0.3.
|
|
60
|
-
"@micromag/element-scroll": "^0.3.
|
|
61
|
-
"@micromag/element-text": "^0.3.
|
|
62
|
-
"@micromag/transforms": "^0.3.
|
|
52
|
+
"@micromag/core": "^0.3.262",
|
|
53
|
+
"@micromag/data": "^0.3.262",
|
|
54
|
+
"@micromag/element-background": "^0.3.262",
|
|
55
|
+
"@micromag/element-button": "^0.3.262",
|
|
56
|
+
"@micromag/element-call-to-action": "^0.3.262",
|
|
57
|
+
"@micromag/element-container": "^0.3.262",
|
|
58
|
+
"@micromag/element-heading": "^0.3.262",
|
|
59
|
+
"@micromag/element-layout": "^0.3.262",
|
|
60
|
+
"@micromag/element-scroll": "^0.3.262",
|
|
61
|
+
"@micromag/element-text": "^0.3.262",
|
|
62
|
+
"@micromag/transforms": "^0.3.262",
|
|
63
63
|
"classnames": "^2.2.6",
|
|
64
64
|
"lodash": "^4.17.21",
|
|
65
65
|
"prop-types": "^15.7.2",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "2299eaeb150cfdd14b4da321bf9089ab1e6383c2"
|
|
73
73
|
}
|