@micromag/screen-survey 0.4.49 → 0.4.51
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/es/index.js +240 -223
- package/package.json +15 -15
package/es/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import DOMPurify from 'dompurify';
|
|
10
10
|
import isNumber from 'lodash/isNumber';
|
|
11
|
-
import
|
|
11
|
+
import { useState, useMemo, useCallback, useEffect } from 'react';
|
|
12
12
|
import { ScreenElement, Transitions, CloseIcon } from '@micromag/core/components';
|
|
13
13
|
import { useScreenSize, useScreenRenderContext, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef } from '@micromag/core/contexts';
|
|
14
14
|
import { useTrackScreenEvent, useDimensionObserver } from '@micromag/core/hooks';
|
|
@@ -24,6 +24,7 @@ import Layout, { Spacer } from '@micromag/element-layout';
|
|
|
24
24
|
import Scroll from '@micromag/element-scroll';
|
|
25
25
|
import Text from '@micromag/element-text';
|
|
26
26
|
import TextInput from '@micromag/element-text-input';
|
|
27
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
27
28
|
|
|
28
29
|
var styles = {"container":"micromag-screen-survey-container","background":"micromag-screen-survey-background","content":"micromag-screen-survey-content","question":"micromag-screen-survey-question","answers":"micromag-screen-survey-answers","items":"micromag-screen-survey-items","header":"micromag-screen-survey-header","disabled":"micromag-screen-survey-disabled","footer":"micromag-screen-survey-footer","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","resultText":"micromag-screen-survey-resultText","itemInner":"micromag-screen-survey-itemInner","button":"micromag-screen-survey-button","itemLabel":"micromag-screen-survey-itemLabel","itemText":"micromag-screen-survey-itemText","emptyQuestion":"micromag-screen-survey-emptyQuestion","emptyAnswer":"micromag-screen-survey-emptyAnswer","userAnswer":"micromag-screen-survey-userAnswer","input":"micromag-screen-survey-input","textInput":"micromag-screen-survey-textInput","confirm":"micromag-screen-survey-confirm","selected":"micromag-screen-survey-selected","submit":"micromag-screen-survey-submit","focused":"micromag-screen-survey-focused","filled":"micromag-screen-survey-filled","multiline":"micromag-screen-survey-multiline","icon":"micromag-screen-survey-icon","answered":"micromag-screen-survey-answered","withPercentage":"micromag-screen-survey-withPercentage","withBar":"micromag-screen-survey-withBar","inputFocused":"micromag-screen-survey-inputFocused","isPlaceholder":"micromag-screen-survey-isPlaceholder","layout":"micromag-screen-survey-layout","reset":"micromag-screen-survey-reset"};
|
|
29
30
|
|
|
@@ -320,10 +321,9 @@ function SurveyScreen(_ref) {
|
|
|
320
321
|
}, [setHasScroll]);
|
|
321
322
|
|
|
322
323
|
// Question
|
|
323
|
-
var items = [/*#__PURE__*/
|
|
324
|
-
key: "question",
|
|
324
|
+
var items = [/*#__PURE__*/jsx(ScreenElement, {
|
|
325
325
|
placeholder: "title",
|
|
326
|
-
emptyLabel: /*#__PURE__*/
|
|
326
|
+
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
327
327
|
id: "e1I+KU",
|
|
328
328
|
defaultMessage: [{
|
|
329
329
|
"type": 0,
|
|
@@ -331,18 +331,18 @@ function SurveyScreen(_ref) {
|
|
|
331
331
|
}]
|
|
332
332
|
}),
|
|
333
333
|
emptyClassName: styles.emptyQuestion,
|
|
334
|
-
isEmpty: !hasQuestion
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
334
|
+
isEmpty: !hasQuestion,
|
|
335
|
+
children: hasQuestion ? /*#__PURE__*/jsx(Transitions, {
|
|
336
|
+
transitions: transitions,
|
|
337
|
+
playing: transitionPlaying,
|
|
338
|
+
disabled: transitionDisabled,
|
|
339
|
+
children: /*#__PURE__*/jsx(Heading, _objectSpread(_objectSpread({}, question), {}, {
|
|
340
|
+
className: styles.question
|
|
341
|
+
}))
|
|
342
|
+
}) : null
|
|
343
|
+
}, "question")];
|
|
342
344
|
if (isSplitted || !isPlaceholder && hasFooter && isMiddleLayout) {
|
|
343
|
-
items.push(/*#__PURE__*/
|
|
344
|
-
key: "spacer"
|
|
345
|
-
}));
|
|
345
|
+
items.push(/*#__PURE__*/jsx(Spacer, {}, "spacer"));
|
|
346
346
|
}
|
|
347
347
|
var finalTransitionDuration = useMemo(function () {
|
|
348
348
|
return showInstantAnswer ? 0 : "".concat(resultTransitionDuration, "ms");
|
|
@@ -363,215 +363,232 @@ function SurveyScreen(_ref) {
|
|
|
363
363
|
return answerResult || defaultResult;
|
|
364
364
|
}, [hasDefaultResult, result, answers, userAnswerIndex]);
|
|
365
365
|
var showReset = isEdit && userAnswerIndex !== null;
|
|
366
|
-
items.push(/*#__PURE__*/
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
366
|
+
items.push(/*#__PURE__*/jsx("div", {
|
|
367
|
+
className: styles.answers,
|
|
368
|
+
children: answers !== null || isPlaceholder ? /*#__PURE__*/jsx("div", {
|
|
369
|
+
className: styles.items,
|
|
370
|
+
children: (isPlaceholder ? _toConsumableArray(new Array(3)) : answers).map(function (answer, answerIndex) {
|
|
371
|
+
var hasAnswer = answer !== null;
|
|
372
|
+
var _ref13 = answer || {},
|
|
373
|
+
_ref13$label = _ref13.label,
|
|
374
|
+
label = _ref13$label === void 0 ? null : _ref13$label,
|
|
375
|
+
_ref13$buttonStyle = _ref13.buttonStyle,
|
|
376
|
+
answerButtonStyle = _ref13$buttonStyle === void 0 ? null : _ref13$buttonStyle,
|
|
377
|
+
_ref13$textStyle = _ref13.textStyle,
|
|
378
|
+
answerButtonTextStyle = _ref13$textStyle === void 0 ? null : _ref13$textStyle,
|
|
379
|
+
_ref13$resultStyle = _ref13.resultStyle,
|
|
380
|
+
answerResultStyle = _ref13$resultStyle === void 0 ? null : _ref13$resultStyle;
|
|
381
|
+
var _ref14 = answerResultStyle || {},
|
|
382
|
+
_ref14$barColor = _ref14.barColor,
|
|
383
|
+
answerResultBarColor = _ref14$barColor === void 0 ? null : _ref14$barColor,
|
|
384
|
+
answerResultTextColor = _ref14.textColor,
|
|
385
|
+
_ref14$percentageText = _ref14.percentageTextStyle,
|
|
386
|
+
answerResultPercentageTextStyle = _ref14$percentageText === void 0 ? null : _ref14$percentageText;
|
|
387
|
+
var _ref15 = label || {},
|
|
388
|
+
_ref15$body = _ref15.body,
|
|
389
|
+
body = _ref15$body === void 0 ? null : _ref15$body;
|
|
390
|
+
var _ref16 = body !== null ? quizAnswersComputed[body] || {} : {},
|
|
391
|
+
_ref16$percent = _ref16.percent,
|
|
392
|
+
percent = _ref16$percent === void 0 ? 0 : _ref16$percent,
|
|
393
|
+
_ref16$count = _ref16.count,
|
|
394
|
+
count = _ref16$count === void 0 ? 0 : _ref16$count;
|
|
395
|
+
var _ref17 = label || {},
|
|
396
|
+
_ref17$textStyle = _ref17.textStyle,
|
|
397
|
+
textStyle = _ref17$textStyle === void 0 ? null : _ref17$textStyle;
|
|
398
|
+
var _ref18 = textStyle || {},
|
|
399
|
+
_ref18$color = _ref18.color,
|
|
400
|
+
labelColor = _ref18$color === void 0 ? null : _ref18$color;
|
|
401
|
+
var hasAnswerLabel = isTextFilled(label);
|
|
402
|
+
var userAnswer = userAnswerIndex === answerIndex;
|
|
403
|
+
var buttonStyles = _objectSpread(_objectSpread(_objectSpread({}, buttonsStyle), answerButtonStyle), answered ? {
|
|
404
|
+
textAlign: 'left'
|
|
405
|
+
} : null);
|
|
406
|
+
var _ref19 = buttonStyles || {},
|
|
407
|
+
_ref19$borderRadius = _ref19.borderRadius,
|
|
408
|
+
answerResultBorderRadius = _ref19$borderRadius === void 0 ? null : _ref19$borderRadius;
|
|
409
|
+
var finalBarBorderRadius = answerResultBorderRadius !== null && isNumber(answerResultBorderRadius) && answerResultBorderRadius > 2 ? answerResultBorderRadius - 2 : answerResultBorderRadius;
|
|
410
|
+
return /*#__PURE__*/jsx("div", {
|
|
411
|
+
className: classNames([styles.item, _defineProperty({}, styles.userAnswer, userAnswer)]),
|
|
412
|
+
children: /*#__PURE__*/jsx(ScreenElement, {
|
|
413
|
+
placeholder: "surveyAnswer",
|
|
414
|
+
placeholderProps: {
|
|
415
|
+
className: styles.placeholderAnswer
|
|
416
|
+
},
|
|
417
|
+
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
418
|
+
id: "+Ok+7S",
|
|
419
|
+
defaultMessage: [{
|
|
420
|
+
"type": 0,
|
|
421
|
+
"value": "Answer"
|
|
422
|
+
}]
|
|
423
|
+
}),
|
|
424
|
+
emptyClassName: styles.emptyAnswer,
|
|
425
|
+
isEmpty: !hasAnswerLabel,
|
|
426
|
+
children: hasAnswer ? /*#__PURE__*/jsx("div", {
|
|
427
|
+
className: styles.itemContent,
|
|
428
|
+
children: /*#__PURE__*/jsx("div", {
|
|
429
|
+
className: styles.itemInner,
|
|
430
|
+
style: {
|
|
431
|
+
borderRadius: answerResultBorderRadius,
|
|
432
|
+
transitionDuration: finalTransitionDuration
|
|
433
|
+
},
|
|
434
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
435
|
+
className: styles.button,
|
|
436
|
+
onPointerUp: function onPointerUp(e) {
|
|
437
|
+
if (e.pointerType !== 'mouse' || e.button === 0) {
|
|
438
|
+
onAnswerClick(answerIndex);
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
disabled: isPreview || userAnswerIndex !== null,
|
|
442
|
+
focusable: current && isView,
|
|
443
|
+
buttonStyle: buttonStyles,
|
|
444
|
+
textStyle: _objectSpread(_objectSpread(_objectSpread({}, buttonsTextStyle), textStyle), answerButtonTextStyle),
|
|
445
|
+
children: /*#__PURE__*/jsxs("span", {
|
|
446
|
+
className: styles.itemLabel,
|
|
447
|
+
children: [/*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({}, label), {}, {
|
|
448
|
+
textStyle: _objectSpread(_objectSpread(_objectSpread({}, buttonsTextStyle), textStyle), answerButtonTextStyle),
|
|
449
|
+
inline: true,
|
|
450
|
+
className: styles.itemText
|
|
451
|
+
})), !withoutPercentage ? /*#__PURE__*/jsx("div", {
|
|
452
|
+
className: styles.resultLabel,
|
|
453
|
+
style: _objectSpread(_objectSpread({}, getStyleFromColor(answered ? answerResultTextColor || resultsTextColor || answerResultBarColor || resultsBarColor || labelColor : null, 'color')), answered ? {
|
|
454
|
+
opacity: 1
|
|
455
|
+
} : {
|
|
456
|
+
opacity: 0
|
|
457
|
+
}),
|
|
458
|
+
children: /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({}, label), {}, {
|
|
459
|
+
textStyle: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, buttonsTextStyle), textStyle), answerButtonTextStyle), resultsTextColor), resultsPercentageTextStyle), answerResultTextColor), answerResultPercentageTextStyle),
|
|
460
|
+
inline: true,
|
|
461
|
+
className: styles.resultText,
|
|
462
|
+
body: showCount ? count : "".concat(percent, "%")
|
|
463
|
+
}))
|
|
464
|
+
}) : null, !withoutBar ? /*#__PURE__*/jsx("div", {
|
|
465
|
+
className: styles.resultBar,
|
|
466
|
+
style: _objectSpread(_objectSpread({
|
|
467
|
+
borderRadius: finalBarBorderRadius,
|
|
468
|
+
transitionDuration: finalTransitionDuration,
|
|
469
|
+
width: percent !== null ? "".concat(percent, "%") : '0%'
|
|
470
|
+
}, getStyleFromColor(answerResultBarColor || resultsBarColor || labelColor, 'backgroundColor')), answered ? {
|
|
471
|
+
opacity: 0.5
|
|
472
|
+
} : {
|
|
473
|
+
opacity: 0
|
|
474
|
+
})
|
|
475
|
+
}) : null]
|
|
476
|
+
})
|
|
477
|
+
})
|
|
478
|
+
})
|
|
479
|
+
}) : null
|
|
480
|
+
})
|
|
481
|
+
}, "answer-".concat(answerIndex + 1));
|
|
475
482
|
})
|
|
476
|
-
}) : null
|
|
477
|
-
}
|
|
478
|
-
return /*#__PURE__*/
|
|
479
|
-
className: classNames([styles.container, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles.answered, answered), styles.inputFocused, inputFocused), styles.withPercentage, !withoutPercentage), styles.withBar, !withoutBar), styles.isPlaceholder, isPlaceholder)])
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
483
|
+
}) : null
|
|
484
|
+
}, "answers"));
|
|
485
|
+
return /*#__PURE__*/jsxs("div", {
|
|
486
|
+
className: classNames([styles.container, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles.answered, answered), styles.inputFocused, inputFocused), styles.withPercentage, !withoutPercentage), styles.withBar, !withoutBar), styles.isPlaceholder, isPlaceholder)]),
|
|
487
|
+
children: [/*#__PURE__*/jsxs(Container, {
|
|
488
|
+
width: width,
|
|
489
|
+
height: height,
|
|
490
|
+
className: styles.content,
|
|
491
|
+
children: [/*#__PURE__*/jsxs(Scroll, {
|
|
492
|
+
verticalAlign: verticalAlign,
|
|
493
|
+
disabled: scrollingDisabled,
|
|
494
|
+
onScrolledTrigger: onScrolledTrigger,
|
|
495
|
+
onScrolledBottom: onScrolledBottom,
|
|
496
|
+
onScrolledNotBottom: onScrolledNotBottom,
|
|
497
|
+
onScrollHeightChange: onScrollHeightChange,
|
|
498
|
+
withShadow: true,
|
|
499
|
+
children: [showReset ? /*#__PURE__*/jsx(Button, {
|
|
500
|
+
className: styles.reset,
|
|
501
|
+
icon: /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
502
|
+
icon: faRedo,
|
|
503
|
+
size: "md"
|
|
504
|
+
}),
|
|
505
|
+
onClick: onQuizReset
|
|
506
|
+
}) : null, !isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
|
|
507
|
+
className: classNames([styles.header, _defineProperty({}, styles.disabled, scrolledBottom && !scrollingDisabled && hasScroll)]),
|
|
508
|
+
ref: headerRef,
|
|
509
|
+
style: {
|
|
510
|
+
paddingTop: spacing / 2,
|
|
511
|
+
paddingLeft: spacing,
|
|
512
|
+
paddingRight: spacing,
|
|
513
|
+
paddingBottom: spacing,
|
|
514
|
+
transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
|
|
515
|
+
},
|
|
516
|
+
children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
|
|
517
|
+
}) : null, /*#__PURE__*/jsxs(Layout, {
|
|
518
|
+
className: styles.layout,
|
|
519
|
+
verticalAlign: verticalAlign,
|
|
520
|
+
style: !isPlaceholder ? {
|
|
521
|
+
padding: spacing,
|
|
522
|
+
paddingTop: (current && !isPreview ? viewerTopHeight : 0) + (headerHeight || spacing),
|
|
523
|
+
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (footerHeight + spacing)
|
|
524
|
+
} : null,
|
|
525
|
+
children: [items, !isPlaceholder && allowCustomAnswer ? /*#__PURE__*/jsxs("form", {
|
|
526
|
+
className: classNames([styles.input, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles.focused, inputFocused), styles.filled, textInput !== null && textInput !== ''), styles.disabled, inputDisabled), styles.selected, userAnswerIndex === 'input'), styles.multiline, customAnswerMultiline)]),
|
|
527
|
+
onSubmit: onSubmitSuggestion,
|
|
528
|
+
children: [/*#__PURE__*/jsx(TextInput, {
|
|
529
|
+
className: styles.textInput,
|
|
530
|
+
disabled: inputDisabled,
|
|
531
|
+
focusable: current && isView,
|
|
532
|
+
buttonStyle: _objectSpread(_objectSpread({}, buttonsStyle), customAnswerBoxStyle),
|
|
533
|
+
textStyle: _objectSpread(_objectSpread({}, buttonsTextStyle), customAnswerTextStyle),
|
|
534
|
+
placeholderTextStyle: _objectSpread(_objectSpread(_objectSpread({}, buttonsTextStyle), customAnswerTextStyle), placeholderTextStyle),
|
|
535
|
+
value: textInput,
|
|
536
|
+
label: placeholderBody,
|
|
537
|
+
onChange: onTextInputChange,
|
|
538
|
+
onFocus: onInputFocused,
|
|
539
|
+
onBlur: onInputBlurred,
|
|
540
|
+
multiline: customAnswerMultiline
|
|
541
|
+
}), !answered ? /*#__PURE__*/jsx(Button, {
|
|
542
|
+
className: classNames([styles.confirm, _defineProperty({}, styles.disabled, inputDisabled || textInput === null || textInput === '')]),
|
|
543
|
+
type: "button",
|
|
544
|
+
onClick: onTextInputClear,
|
|
545
|
+
disabled: inputDisabled || textInput === null || textInput === '',
|
|
546
|
+
children: /*#__PURE__*/jsx(CloseIcon, {
|
|
547
|
+
className: styles.icon
|
|
548
|
+
})
|
|
549
|
+
}) : null, !answered ? /*#__PURE__*/jsx(Button, {
|
|
550
|
+
className: classNames([styles.submit, _defineProperty({}, styles.disabled, inputDisabled || textInput === null || textInput === '')]),
|
|
551
|
+
type: "submit",
|
|
552
|
+
buttonStyle: customAnswerSubmit === null || customAnswerSubmit === void 0 ? void 0 : customAnswerSubmit.buttonStyle,
|
|
553
|
+
disabled: inputDisabled || textInput === null || textInput === '',
|
|
554
|
+
children: /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({}, customAnswerSubmit), {}, {
|
|
555
|
+
inline: true
|
|
556
|
+
}))
|
|
557
|
+
}) : null]
|
|
558
|
+
}) : null, userAnswerIndex !== null && finalResult !== null ? /*#__PURE__*/jsx(Transitions, {
|
|
559
|
+
transitions: transitions,
|
|
560
|
+
playing: transitionPlaying,
|
|
561
|
+
disabled: transitionDisabled,
|
|
562
|
+
children: /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({}, finalResult || {}), {}, {
|
|
563
|
+
className: styles.resultText
|
|
564
|
+
}))
|
|
565
|
+
}) : null]
|
|
566
|
+
})]
|
|
567
|
+
}), !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
|
|
568
|
+
ref: footerRef,
|
|
569
|
+
className: classNames([styles.footer, _defineProperty({}, styles.disabled, !scrolledBottom)]),
|
|
570
|
+
style: {
|
|
571
|
+
transform: !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null,
|
|
572
|
+
paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
|
|
573
|
+
paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
|
|
574
|
+
paddingTop: spacing / 2,
|
|
575
|
+
paddingBottom: spacing / 2
|
|
576
|
+
},
|
|
577
|
+
children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
|
|
578
|
+
}) : null]
|
|
579
|
+
}), !isPlaceholder ? /*#__PURE__*/jsx(Background, {
|
|
580
|
+
background: background,
|
|
581
|
+
width: width,
|
|
582
|
+
height: height,
|
|
583
|
+
resolution: resolution,
|
|
584
|
+
playing: backgroundPlaying,
|
|
585
|
+
muted: muted,
|
|
586
|
+
shouldLoad: mediaShouldLoad,
|
|
587
|
+
mediaRef: mediaRef,
|
|
588
|
+
withoutVideo: isPreview,
|
|
589
|
+
className: styles.background
|
|
590
|
+
}) : null]
|
|
591
|
+
});
|
|
575
592
|
}
|
|
576
593
|
|
|
577
594
|
var definition = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-survey",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.51",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -64,19 +64,19 @@
|
|
|
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.
|
|
68
|
-
"@micromag/data": "^0.4.
|
|
69
|
-
"@micromag/element-background": "^0.4.
|
|
70
|
-
"@micromag/element-button": "^0.4.
|
|
71
|
-
"@micromag/element-container": "^0.4.
|
|
72
|
-
"@micromag/element-footer": "^0.4.
|
|
73
|
-
"@micromag/element-header": "^0.4.
|
|
74
|
-
"@micromag/element-heading": "^0.4.
|
|
75
|
-
"@micromag/element-layout": "^0.4.
|
|
76
|
-
"@micromag/element-scroll": "^0.4.
|
|
77
|
-
"@micromag/element-text": "^0.4.
|
|
78
|
-
"@micromag/element-text-input": "^0.4.
|
|
79
|
-
"@micromag/transforms": "^0.4.
|
|
67
|
+
"@micromag/core": "^0.4.51",
|
|
68
|
+
"@micromag/data": "^0.4.51",
|
|
69
|
+
"@micromag/element-background": "^0.4.51",
|
|
70
|
+
"@micromag/element-button": "^0.4.51",
|
|
71
|
+
"@micromag/element-container": "^0.4.51",
|
|
72
|
+
"@micromag/element-footer": "^0.4.51",
|
|
73
|
+
"@micromag/element-header": "^0.4.51",
|
|
74
|
+
"@micromag/element-heading": "^0.4.51",
|
|
75
|
+
"@micromag/element-layout": "^0.4.51",
|
|
76
|
+
"@micromag/element-scroll": "^0.4.51",
|
|
77
|
+
"@micromag/element-text": "^0.4.51",
|
|
78
|
+
"@micromag/element-text-input": "^0.4.51",
|
|
79
|
+
"@micromag/transforms": "^0.4.51",
|
|
80
80
|
"classnames": "^2.2.6",
|
|
81
81
|
"dompurify": "^3.2.6",
|
|
82
82
|
"lodash": "^4.17.23",
|
|
@@ -87,6 +87,6 @@
|
|
|
87
87
|
"access": "public",
|
|
88
88
|
"registry": "https://registry.npmjs.org/"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "985a2370829c9ac8901ea97bf20bfc98ab158439",
|
|
91
91
|
"types": "es/index.d.ts"
|
|
92
92
|
}
|