@micromag/screen-survey 0.3.113 → 0.3.119
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 +15 -3
- package/lib/index.js +14 -2
- package/package.json +13 -13
package/es/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
|
10
10
|
import { ScreenElement, Transitions } from '@micromag/core/components';
|
|
11
11
|
import { useScreenSize, useViewer, useScreenRenderContext } from '@micromag/core/contexts';
|
|
12
12
|
import { useTrackScreenEvent } from '@micromag/core/hooks';
|
|
13
|
-
import { isTextFilled, getLargestRemainderRound,
|
|
13
|
+
import { isTextFilled, getLargestRemainderRound, getStyleFromColor } from '@micromag/core/utils';
|
|
14
14
|
import { useQuizCreate, useQuiz } from '@micromag/data';
|
|
15
15
|
import Background from '@micromag/element-background';
|
|
16
16
|
import Button from '@micromag/element-button';
|
|
@@ -28,6 +28,7 @@ var propTypes = {
|
|
|
28
28
|
question: PropTypes$1.textElement,
|
|
29
29
|
answers: PropTypes$1.answers,
|
|
30
30
|
buttonsStyle: PropTypes$1.boxStyle,
|
|
31
|
+
buttonsTextStyle: PropTypes$1.textStyle,
|
|
31
32
|
resultsStyle: PropTypes.shape({
|
|
32
33
|
barColor: PropTypes$1.color,
|
|
33
34
|
textColor: PropTypes$1.color
|
|
@@ -53,6 +54,7 @@ var defaultProps = {
|
|
|
53
54
|
question: null,
|
|
54
55
|
answers: null,
|
|
55
56
|
buttonsStyle: null,
|
|
57
|
+
buttonsTextStyle: null,
|
|
56
58
|
resultsStyle: null,
|
|
57
59
|
spacing: 20,
|
|
58
60
|
background: null,
|
|
@@ -78,6 +80,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
78
80
|
question = _ref.question,
|
|
79
81
|
answers = _ref.answers,
|
|
80
82
|
buttonsStyle = _ref.buttonsStyle,
|
|
83
|
+
buttonsTextStyle = _ref.buttonsTextStyle,
|
|
81
84
|
resultsStyle = _ref.resultsStyle,
|
|
82
85
|
spacing = _ref.spacing,
|
|
83
86
|
background = _ref.background,
|
|
@@ -336,7 +339,6 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
336
339
|
}, /*#__PURE__*/React.createElement("div", {
|
|
337
340
|
className: styles.itemInner,
|
|
338
341
|
style: {
|
|
339
|
-
// width: buttonMaxWidth,
|
|
340
342
|
transitionDuration: finalTransitionDuration
|
|
341
343
|
}
|
|
342
344
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -346,7 +348,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
346
348
|
},
|
|
347
349
|
disabled: isPreview || userAnswerIndex !== null,
|
|
348
350
|
focusable: current && isView,
|
|
349
|
-
buttonStyle: _objectSpread(_objectSpread(_objectSpread({}, buttonsStyle),
|
|
351
|
+
buttonStyle: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, buttonsStyle), buttonsTextStyle), answerButtonStyle), answered ? {
|
|
350
352
|
textAlign: 'left'
|
|
351
353
|
} : null)
|
|
352
354
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -536,6 +538,16 @@ var definition = {
|
|
|
536
538
|
"value": "Buttons"
|
|
537
539
|
}]
|
|
538
540
|
})
|
|
541
|
+
}, {
|
|
542
|
+
name: 'buttonsTextStyle',
|
|
543
|
+
type: 'text-style-form',
|
|
544
|
+
label: defineMessage({
|
|
545
|
+
id: "gwPu/I",
|
|
546
|
+
defaultMessage: [{
|
|
547
|
+
"type": 0,
|
|
548
|
+
"value": "Buttons text"
|
|
549
|
+
}]
|
|
550
|
+
})
|
|
539
551
|
}, {
|
|
540
552
|
name: 'resultsStyle',
|
|
541
553
|
type: 'field-with-form',
|
package/lib/index.js
CHANGED
|
@@ -49,6 +49,7 @@ var propTypes = {
|
|
|
49
49
|
question: core.PropTypes.textElement,
|
|
50
50
|
answers: core.PropTypes.answers,
|
|
51
51
|
buttonsStyle: core.PropTypes.boxStyle,
|
|
52
|
+
buttonsTextStyle: core.PropTypes.textStyle,
|
|
52
53
|
resultsStyle: PropTypes__default["default"].shape({
|
|
53
54
|
barColor: core.PropTypes.color,
|
|
54
55
|
textColor: core.PropTypes.color
|
|
@@ -74,6 +75,7 @@ var defaultProps = {
|
|
|
74
75
|
question: null,
|
|
75
76
|
answers: null,
|
|
76
77
|
buttonsStyle: null,
|
|
78
|
+
buttonsTextStyle: null,
|
|
77
79
|
resultsStyle: null,
|
|
78
80
|
spacing: 20,
|
|
79
81
|
background: null,
|
|
@@ -99,6 +101,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
99
101
|
question = _ref.question,
|
|
100
102
|
answers = _ref.answers,
|
|
101
103
|
buttonsStyle = _ref.buttonsStyle,
|
|
104
|
+
buttonsTextStyle = _ref.buttonsTextStyle,
|
|
102
105
|
resultsStyle = _ref.resultsStyle,
|
|
103
106
|
spacing = _ref.spacing,
|
|
104
107
|
background = _ref.background,
|
|
@@ -357,7 +360,6 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
357
360
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
358
361
|
className: styles.itemInner,
|
|
359
362
|
style: {
|
|
360
|
-
// width: buttonMaxWidth,
|
|
361
363
|
transitionDuration: finalTransitionDuration
|
|
362
364
|
}
|
|
363
365
|
}, /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
|
|
@@ -367,7 +369,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
367
369
|
},
|
|
368
370
|
disabled: isPreview || userAnswerIndex !== null,
|
|
369
371
|
focusable: current && isView,
|
|
370
|
-
buttonStyle: _objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"]({}, buttonsStyle),
|
|
372
|
+
buttonStyle: _objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"]({}, buttonsStyle), buttonsTextStyle), answerButtonStyle), answered ? {
|
|
371
373
|
textAlign: 'left'
|
|
372
374
|
} : null)
|
|
373
375
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
@@ -557,6 +559,16 @@ var definition = {
|
|
|
557
559
|
"value": "Buttons"
|
|
558
560
|
}]
|
|
559
561
|
})
|
|
562
|
+
}, {
|
|
563
|
+
name: 'buttonsTextStyle',
|
|
564
|
+
type: 'text-style-form',
|
|
565
|
+
label: reactIntl.defineMessage({
|
|
566
|
+
id: "gwPu/I",
|
|
567
|
+
defaultMessage: [{
|
|
568
|
+
"type": 0,
|
|
569
|
+
"value": "Buttons text"
|
|
570
|
+
}]
|
|
571
|
+
})
|
|
560
572
|
}, {
|
|
561
573
|
name: 'resultsStyle',
|
|
562
574
|
type: 'field-with-form',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-survey",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.119",
|
|
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.119",
|
|
53
|
+
"@micromag/data": "^0.3.119",
|
|
54
|
+
"@micromag/element-background": "^0.3.119",
|
|
55
|
+
"@micromag/element-button": "^0.3.119",
|
|
56
|
+
"@micromag/element-call-to-action": "^0.3.119",
|
|
57
|
+
"@micromag/element-container": "^0.3.119",
|
|
58
|
+
"@micromag/element-heading": "^0.3.119",
|
|
59
|
+
"@micromag/element-layout": "^0.3.119",
|
|
60
|
+
"@micromag/element-scroll": "^0.3.119",
|
|
61
|
+
"@micromag/element-text": "^0.3.119",
|
|
62
|
+
"@micromag/transforms": "^0.3.119",
|
|
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": "009841dc1641be98ddce6ed56cfcddc22509f342"
|
|
73
73
|
}
|