@pie-element/ebsr 7.0.24-next.2 → 7.0.26
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/CHANGELOG.md +48 -0
- package/{configure/node_modules/@pie-element/multiple-choice/LICENSE.md → LICENSE.md} +0 -0
- package/configure/CHANGELOG.md +48 -0
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +8 -0
- package/controller/package.json +1 -1
- package/package.json +3 -3
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.json +0 -1972
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.md +0 -1793
- package/configure/node_modules/@pie-element/multiple-choice/PRINT.md +0 -35
- package/configure/node_modules/@pie-element/multiple-choice/README.md +0 -56
- package/configure/node_modules/@pie-element/multiple-choice/choice.png +0 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.json +0 -1387
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.md +0 -1334
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js +0 -104
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js +0 -198
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js +0 -599
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js +0 -18
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/configure/package.json +0 -20
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.json +0 -527
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.md +0 -768
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js +0 -18
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js +0 -305
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js +0 -36
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/controller/package.json +0 -15
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json +0 -353
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json.md +0 -277
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/config.js +0 -8
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/generate.js +0 -52
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/index.html +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/session.js +0 -7
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json +0 -338
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json.md +0 -274
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js +0 -298
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js +0 -157
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js +0 -174
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js +0 -151
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js +0 -97
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js +0 -254
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js +0 -129
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js +0 -35
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/module/configure.js +0 -843
- package/configure/node_modules/@pie-element/multiple-choice/module/controller.js +0 -20686
- package/configure/node_modules/@pie-element/multiple-choice/module/demo.js +0 -77
- package/configure/node_modules/@pie-element/multiple-choice/module/element.js +0 -2019
- package/configure/node_modules/@pie-element/multiple-choice/module/index.html +0 -21
- package/configure/node_modules/@pie-element/multiple-choice/module/manifest.json +0 -14
- package/configure/node_modules/@pie-element/multiple-choice/module/print-demo.js +0 -115
- package/configure/node_modules/@pie-element/multiple-choice/module/print.html +0 -18
- package/configure/node_modules/@pie-element/multiple-choice/module/print.js +0 -1983
- package/configure/node_modules/@pie-element/multiple-choice/package.json +0 -34
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.json +0 -672
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.md +0 -427
- package/configure/node_modules/@pie-lib/math-rendering/LICENSE.md +0 -5
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js +0 -30
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js +0 -316
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js.map +0 -1
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js +0 -23
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js.map +0 -1
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js +0 -123
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js.map +0 -1
- package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js +0 -103
- package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js.map +0 -1
- package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js +0 -275
- package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js.map +0 -1
- package/configure/node_modules/@pie-lib/math-rendering/package.json +0 -19
- package/configure/node_modules/@pie-lib/math-rendering/playground/demo.html +0 -872
- package/configure/node_modules/@pie-lib/math-rendering/playground/demo.js +0 -108
- package/configure/node_modules/@pie-lib/math-rendering/playground/main.html +0 -156
- package/configure/node_modules/@pie-lib/math-rendering/playground/main.js +0 -16
- package/configure/node_modules/@pie-lib/math-rendering/playground/webpack.config.js +0 -29
- package/configure/node_modules/@pie-lib/math-rendering/src/index.js +0 -4
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/chtml.js +0 -215
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/index.js +0 -13
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/mml.js +0 -24
- package/configure/node_modules/@pie-lib/math-rendering/src/normalization.js +0 -69
- package/configure/node_modules/@pie-lib/math-rendering/src/render-math.js +0 -234
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.json +0 -937
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.md +0 -602
- package/configure/node_modules/@pie-lib/render-ui/LICENSE.md +0 -5
- package/configure/node_modules/@pie-lib/render-ui/README.md +0 -33
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js +0 -146
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js +0 -134
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js +0 -160
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js +0 -24
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js +0 -102
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js +0 -104
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js +0 -60
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js +0 -133
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js +0 -162
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js +0 -28
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js +0 -28
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js +0 -160
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js +0 -206
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/package.json +0 -30
- package/configure/node_modules/@pie-lib/render-ui/src/collapsible/index.jsx +0 -68
- package/configure/node_modules/@pie-lib/render-ui/src/color.js +0 -48
- package/configure/node_modules/@pie-lib/render-ui/src/feedback.jsx +0 -100
- package/configure/node_modules/@pie-lib/render-ui/src/has-text.js +0 -14
- package/configure/node_modules/@pie-lib/render-ui/src/html-and-math.js +0 -40
- package/configure/node_modules/@pie-lib/render-ui/src/index.js +0 -27
- package/configure/node_modules/@pie-lib/render-ui/src/input-container.jsx +0 -41
- package/configure/node_modules/@pie-lib/render-ui/src/preview-layout.jsx +0 -77
- package/configure/node_modules/@pie-lib/render-ui/src/preview-prompt.jsx +0 -90
- package/configure/node_modules/@pie-lib/render-ui/src/purpose.jsx +0 -19
- package/configure/node_modules/@pie-lib/render-ui/src/readable.jsx +0 -19
- package/configure/node_modules/@pie-lib/render-ui/src/response-indicators.jsx +0 -89
- package/configure/node_modules/@pie-lib/render-ui/src/withUndoReset.jsx +0 -118
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
|
-
|
|
22
|
-
var _react = _interopRequireDefault(require("react"));
|
|
23
|
-
|
|
24
|
-
var _reactTransitionGroup = require("react-transition-group");
|
|
25
|
-
|
|
26
|
-
var _styles = require("@material-ui/core/styles");
|
|
27
|
-
|
|
28
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
|
-
|
|
30
|
-
var _renderUi = require("@pie-lib/render-ui");
|
|
31
|
-
|
|
32
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
33
|
-
|
|
34
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
|
-
|
|
36
|
-
var stylesheet = {
|
|
37
|
-
incorrect: {
|
|
38
|
-
fill: "var(--feedback-incorrect-bg-color, ".concat(_renderUi.color.incorrect(), ")")
|
|
39
|
-
},
|
|
40
|
-
correct: {
|
|
41
|
-
fill: "var(--feedback-correct-bg-color, ".concat(_renderUi.color.correct(), ")")
|
|
42
|
-
},
|
|
43
|
-
feedbackTick: {
|
|
44
|
-
width: '33px',
|
|
45
|
-
height: '33px',
|
|
46
|
-
'& svg': {
|
|
47
|
-
position: 'absolute',
|
|
48
|
-
display: 'inline-block',
|
|
49
|
-
width: '33px',
|
|
50
|
-
height: '33px',
|
|
51
|
-
verticalAlign: 'middle',
|
|
52
|
-
'& hide': {
|
|
53
|
-
display: 'none'
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
feedbackTickEnter: {
|
|
58
|
-
opacity: '0',
|
|
59
|
-
left: '-50px'
|
|
60
|
-
},
|
|
61
|
-
feedbackTickEnterActive: {
|
|
62
|
-
opacity: '1',
|
|
63
|
-
left: '0px',
|
|
64
|
-
transition: 'left 500ms ease-in 200ms, opacity 500ms linear 200ms'
|
|
65
|
-
},
|
|
66
|
-
feedbackTickLeave: {
|
|
67
|
-
opacity: '1',
|
|
68
|
-
left: '0px'
|
|
69
|
-
},
|
|
70
|
-
feedbackTickLeaveActive: {
|
|
71
|
-
opacity: '0',
|
|
72
|
-
left: '-50px',
|
|
73
|
-
transition: 'left 300ms ease-in, opacity 300ms'
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
var FeedbackTick = /*#__PURE__*/function (_React$Component) {
|
|
78
|
-
(0, _inherits2["default"])(FeedbackTick, _React$Component);
|
|
79
|
-
|
|
80
|
-
var _super = _createSuper(FeedbackTick);
|
|
81
|
-
|
|
82
|
-
function FeedbackTick(props) {
|
|
83
|
-
var _this;
|
|
84
|
-
|
|
85
|
-
(0, _classCallCheck2["default"])(this, FeedbackTick);
|
|
86
|
-
_this = _super.call(this, props);
|
|
87
|
-
_this.incorrectIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
88
|
-
key: "1",
|
|
89
|
-
preserveAspectRatio: "xMinYMin meet",
|
|
90
|
-
x: "0px",
|
|
91
|
-
y: "0px",
|
|
92
|
-
viewBox: "0 0 44 40",
|
|
93
|
-
style: {
|
|
94
|
-
enableBackground: 'new 0 0 44 40'
|
|
95
|
-
}
|
|
96
|
-
}, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("rect", {
|
|
97
|
-
x: "11",
|
|
98
|
-
y: "17.3",
|
|
99
|
-
transform: "matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",
|
|
100
|
-
className: _this.props.classes.incorrect,
|
|
101
|
-
width: "16.6",
|
|
102
|
-
height: "3.7"
|
|
103
|
-
}), /*#__PURE__*/_react["default"].createElement("rect", {
|
|
104
|
-
x: "17.4",
|
|
105
|
-
y: "10.7",
|
|
106
|
-
transform: "matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",
|
|
107
|
-
className: _this.props.classes.incorrect,
|
|
108
|
-
width: "3.7",
|
|
109
|
-
height: "16.6"
|
|
110
|
-
})));
|
|
111
|
-
_this.correctIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
112
|
-
key: "2",
|
|
113
|
-
preserveAspectRatio: "xMinYMin meet",
|
|
114
|
-
version: "1.1",
|
|
115
|
-
x: "0px",
|
|
116
|
-
y: "0px",
|
|
117
|
-
viewBox: "0 0 44 40",
|
|
118
|
-
style: {
|
|
119
|
-
enableBackground: 'new 0 0 44 40'
|
|
120
|
-
}
|
|
121
|
-
}, /*#__PURE__*/_react["default"].createElement("polygon", {
|
|
122
|
-
className: _this.props.classes.correct,
|
|
123
|
-
points: "19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4"
|
|
124
|
-
}));
|
|
125
|
-
return _this;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
(0, _createClass2["default"])(FeedbackTick, [{
|
|
129
|
-
key: "render",
|
|
130
|
-
value: function render() {
|
|
131
|
-
var _this2 = this;
|
|
132
|
-
|
|
133
|
-
var _this$props = this.props,
|
|
134
|
-
correctness = _this$props.correctness,
|
|
135
|
-
classes = _this$props.classes;
|
|
136
|
-
|
|
137
|
-
var icon = function () {
|
|
138
|
-
if (correctness === 'incorrect') {
|
|
139
|
-
return _this2.incorrectIcon;
|
|
140
|
-
} else if (correctness === 'correct') {
|
|
141
|
-
return _this2.correctIcon;
|
|
142
|
-
}
|
|
143
|
-
}();
|
|
144
|
-
|
|
145
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
146
|
-
className: classes.feedbackTick
|
|
147
|
-
}, /*#__PURE__*/_react["default"].createElement(_reactTransitionGroup.TransitionGroup, null, correctness && /*#__PURE__*/_react["default"].createElement(_reactTransitionGroup.CSSTransition, {
|
|
148
|
-
classNames: {
|
|
149
|
-
enter: classes.feedbackTickEnter,
|
|
150
|
-
enterActive: classes.feedbackTickEnterActive,
|
|
151
|
-
exit: classes.feedbackTickLeave,
|
|
152
|
-
exitActive: classes.feedbackTickLeaveActive
|
|
153
|
-
},
|
|
154
|
-
timeout: {
|
|
155
|
-
enter: 700,
|
|
156
|
-
exit: 300
|
|
157
|
-
}
|
|
158
|
-
}, icon)));
|
|
159
|
-
}
|
|
160
|
-
}]);
|
|
161
|
-
return FeedbackTick;
|
|
162
|
-
}(_react["default"].Component);
|
|
163
|
-
|
|
164
|
-
(0, _defineProperty2["default"])(FeedbackTick, "propTypes", {
|
|
165
|
-
classes: _propTypes["default"].object.isRequired,
|
|
166
|
-
correctness: _propTypes["default"].string
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
var _default = (0, _styles.withStyles)(stylesheet, {
|
|
170
|
-
name: 'FeedbackTick'
|
|
171
|
-
})(FeedbackTick);
|
|
172
|
-
|
|
173
|
-
exports["default"] = _default;
|
|
174
|
-
//# sourceMappingURL=feedback-tick.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/feedback-tick.jsx"],"names":["stylesheet","incorrect","fill","color","correct","feedbackTick","width","height","position","display","verticalAlign","feedbackTickEnter","opacity","left","feedbackTickEnterActive","transition","feedbackTickLeave","feedbackTickLeaveActive","FeedbackTick","props","incorrectIcon","enableBackground","classes","correctIcon","correctness","icon","enter","enterActive","exit","exitActive","React","Component","PropTypes","object","isRequired","string","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,UAAU,GAAG;AACjBC,EAAAA,SAAS,EAAE;AACTC,IAAAA,IAAI,+CAAwCC,gBAAMF,SAAN,EAAxC;AADK,GADM;AAIjBG,EAAAA,OAAO,EAAE;AACPF,IAAAA,IAAI,6CAAsCC,gBAAMC,OAAN,EAAtC;AADG,GAJQ;AAOjBC,EAAAA,YAAY,EAAE;AACZC,IAAAA,KAAK,EAAE,MADK;AAEZC,IAAAA,MAAM,EAAE,MAFI;AAGZ,aAAS;AACPC,MAAAA,QAAQ,EAAE,UADH;AAEPC,MAAAA,OAAO,EAAE,cAFF;AAGPH,MAAAA,KAAK,EAAE,MAHA;AAIPC,MAAAA,MAAM,EAAE,MAJD;AAKPG,MAAAA,aAAa,EAAE,QALR;AAMP,gBAAU;AACRD,QAAAA,OAAO,EAAE;AADD;AANH;AAHG,GAPG;AAqBjBE,EAAAA,i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MC,S;;iCAA3Bb,Y,eACe;AACjBI,EAAAA,OAAO,EAAEU,sBAAUC,MAAV,CAAiBC,UADT;AAEjBV,EAAAA,WAAW,EAAEQ,sBAAUG;AAFN,C;;eAuFN,wBAAWnC,UAAX,EAAuB;AAAEoC,EAAAA,IAAI,EAAE;AAAR,CAAvB,EAAiDlB,YAAjD,C","sourcesContent":["import React from 'react';\nimport { TransitionGroup, CSSTransition } from 'react-transition-group';\nimport { withStyles } from '@material-ui/core/styles';\nimport PropTypes from 'prop-types';\nimport { color } from '@pie-lib/render-ui';\n\nconst stylesheet = {\n incorrect: {\n fill: `var(--feedback-incorrect-bg-color, ${color.incorrect()})`,\n },\n correct: {\n fill: `var(--feedback-correct-bg-color, ${color.correct()})`,\n },\n feedbackTick: {\n width: '33px',\n height: '33px',\n '& svg': {\n position: 'absolute',\n display: 'inline-block',\n width: '33px',\n height: '33px',\n verticalAlign: 'middle',\n '& hide': {\n display: 'none',\n },\n },\n },\n feedbackTickEnter: {\n opacity: '0',\n left: '-50px',\n },\n feedbackTickEnterActive: {\n opacity: '1',\n left: '0px',\n transition: 'left 500ms ease-in 200ms, opacity 500ms linear 200ms',\n },\n feedbackTickLeave: {\n opacity: '1',\n left: '0px',\n },\n feedbackTickLeaveActive: {\n opacity: '0',\n left: '-50px',\n transition: 'left 300ms ease-in, opacity 300ms',\n },\n};\n\nclass FeedbackTick extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n correctness: PropTypes.string,\n };\n constructor(props) {\n super(props);\n this.incorrectIcon = (\n <svg\n key=\"1\"\n preserveAspectRatio=\"xMinYMin meet\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 44 40\"\n style={{ enableBackground: 'new 0 0 44 40' }}\n >\n <g>\n <rect\n x=\"11\"\n y=\"17.3\"\n transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)\"\n className={this.props.classes.incorrect}\n width=\"16.6\"\n height=\"3.7\"\n />\n <rect\n x=\"17.4\"\n y=\"10.7\"\n transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)\"\n className={this.props.classes.incorrect}\n width=\"3.7\"\n height=\"16.6\"\n />\n </g>\n </svg>\n );\n\n this.correctIcon = (\n <svg\n key=\"2\"\n preserveAspectRatio=\"xMinYMin meet\"\n version=\"1.1\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 44 40\"\n style={{ enableBackground: 'new 0 0 44 40' }}\n >\n <polygon\n className={this.props.classes.correct}\n points=\"19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4\"\n />\n </svg>\n );\n }\n\n render() {\n const { correctness, classes } = this.props;\n\n const icon = (() => {\n if (correctness === 'incorrect') {\n return this.incorrectIcon;\n } else if (correctness === 'correct') {\n return this.correctIcon;\n }\n })();\n\n return (\n <div className={classes.feedbackTick}>\n <TransitionGroup>\n {correctness && (\n <CSSTransition\n classNames={{\n enter: classes.feedbackTickEnter,\n enterActive: classes.feedbackTickEnterActive,\n exit: classes.feedbackTickLeave,\n exitActive: classes.feedbackTickLeaveActive,\n }}\n timeout={{ enter: 700, exit: 300 }}\n >\n {icon}\n </CSSTransition>\n )}\n </TransitionGroup>\n </div>\n );\n }\n}\n\nexport default withStyles(stylesheet, { name: 'FeedbackTick' })(FeedbackTick);\n"],"file":"feedback-tick.js"}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.isComplete = exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
22
|
-
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
23
|
-
|
|
24
|
-
var _main = _interopRequireDefault(require("./main"));
|
|
25
|
-
|
|
26
|
-
var _react = _interopRequireDefault(require("react"));
|
|
27
|
-
|
|
28
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
29
|
-
|
|
30
|
-
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
31
|
-
|
|
32
|
-
var _debug = _interopRequireDefault(require("debug"));
|
|
33
|
-
|
|
34
|
-
var _mathRendering = require("@pie-lib/math-rendering");
|
|
35
|
-
|
|
36
|
-
var _sessionUpdater = require("./session-updater");
|
|
37
|
-
|
|
38
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
39
|
-
|
|
40
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
|
-
|
|
42
|
-
var log = (0, _debug["default"])('pie-ui:multiple-choice');
|
|
43
|
-
|
|
44
|
-
var isComplete = function isComplete(session) {
|
|
45
|
-
return !!(session && session.value && session.value.length);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
exports.isComplete = isComplete;
|
|
49
|
-
|
|
50
|
-
var MultipleChoice = /*#__PURE__*/function (_HTMLElement) {
|
|
51
|
-
(0, _inherits2["default"])(MultipleChoice, _HTMLElement);
|
|
52
|
-
|
|
53
|
-
var _super = _createSuper(MultipleChoice);
|
|
54
|
-
|
|
55
|
-
function MultipleChoice() {
|
|
56
|
-
var _this;
|
|
57
|
-
|
|
58
|
-
(0, _classCallCheck2["default"])(this, MultipleChoice);
|
|
59
|
-
_this = _super.call(this);
|
|
60
|
-
_this._model = null;
|
|
61
|
-
_this._session = null;
|
|
62
|
-
_this._rerender = (0, _debounce["default"])(function () {
|
|
63
|
-
if (_this._model && _this._session) {
|
|
64
|
-
var element = /*#__PURE__*/_react["default"].createElement(_main["default"], {
|
|
65
|
-
model: _this._model,
|
|
66
|
-
session: _this._session,
|
|
67
|
-
onChoiceChanged: _this._onChange.bind((0, _assertThisInitialized2["default"])(_this))
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
_reactDom["default"].render(element, (0, _assertThisInitialized2["default"])(_this), function () {
|
|
71
|
-
log('render complete - render math');
|
|
72
|
-
(0, _mathRendering.renderMath)((0, _assertThisInitialized2["default"])(_this));
|
|
73
|
-
});
|
|
74
|
-
} else {
|
|
75
|
-
log('skip');
|
|
76
|
-
}
|
|
77
|
-
}, 50, {
|
|
78
|
-
leading: false,
|
|
79
|
-
trailing: true
|
|
80
|
-
});
|
|
81
|
-
_this._dispatchResponseChanged = (0, _debounce["default"])(function () {
|
|
82
|
-
var event = new CustomEvent('session-changed', {
|
|
83
|
-
bubbles: true,
|
|
84
|
-
composed: true,
|
|
85
|
-
detail: {
|
|
86
|
-
complete: isComplete(_this._session),
|
|
87
|
-
component: _this.tagName.toLowerCase()
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
_this.dispatchEvent(event);
|
|
92
|
-
});
|
|
93
|
-
_this._dispatchModelSet = (0, _debounce["default"])(function () {
|
|
94
|
-
_this.dispatchEvent(new CustomEvent('model-set', {
|
|
95
|
-
bubbles: true,
|
|
96
|
-
composed: true,
|
|
97
|
-
detail: {
|
|
98
|
-
complete: isComplete(_this._session),
|
|
99
|
-
component: _this.tagName.toLowerCase(),
|
|
100
|
-
hasModel: _this._model !== undefined
|
|
101
|
-
}
|
|
102
|
-
}));
|
|
103
|
-
}, 50, {
|
|
104
|
-
leading: false,
|
|
105
|
-
trailing: true
|
|
106
|
-
});
|
|
107
|
-
return _this;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
(0, _createClass2["default"])(MultipleChoice, [{
|
|
111
|
-
key: "model",
|
|
112
|
-
set: function set(s) {
|
|
113
|
-
this._model = s;
|
|
114
|
-
|
|
115
|
-
this._rerender();
|
|
116
|
-
|
|
117
|
-
this._dispatchModelSet();
|
|
118
|
-
}
|
|
119
|
-
}, {
|
|
120
|
-
key: "session",
|
|
121
|
-
get: function get() {
|
|
122
|
-
return this._session;
|
|
123
|
-
},
|
|
124
|
-
set: function set(s) {
|
|
125
|
-
this._session = s;
|
|
126
|
-
|
|
127
|
-
this._rerender(); //TODO: remove this session-changed should only be emit on user change
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
this._dispatchResponseChanged();
|
|
131
|
-
}
|
|
132
|
-
}, {
|
|
133
|
-
key: "_onChange",
|
|
134
|
-
value: function _onChange(data) {
|
|
135
|
-
(0, _sessionUpdater.updateSessionValue)(this._session, this._model.choiceMode, data);
|
|
136
|
-
|
|
137
|
-
this._dispatchResponseChanged();
|
|
138
|
-
|
|
139
|
-
this._rerender();
|
|
140
|
-
}
|
|
141
|
-
}, {
|
|
142
|
-
key: "connectedCallback",
|
|
143
|
-
value: function connectedCallback() {
|
|
144
|
-
this._rerender();
|
|
145
|
-
}
|
|
146
|
-
}]);
|
|
147
|
-
return MultipleChoice;
|
|
148
|
-
}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
|
|
149
|
-
|
|
150
|
-
exports["default"] = MultipleChoice;
|
|
151
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","isComplete","session","value","length","MultipleChoice","_model","_session","_rerender","element","React","createElement","Main","model","onChoiceChanged","_onChange","bind","ReactDOM","render","leading","trailing","_dispatchResponseChanged","event","CustomEvent","bubbles","composed","detail","complete","component","tagName","toLowerCase","dispatchEvent","_dispatchModelSet","hasModel","undefined","s","data","choiceMode","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,wBAAN,CAAZ;;AAEO,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAAAC,OAAO;AAAA,SAAI,CAAC,EAAEA,OAAO,IAAIA,OAAO,CAACC,KAAnB,IAA4BD,OAAO,CAACC,KAAR,CAAcC,MAA5C,CAAL;AAAA,CAA1B;;;;IAEcC,c;;;;;AACnB,4BAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,MAAL,GAAc,IAAd;AACA,UAAKC,QAAL,GAAgB,IAAhB;AAEA,UAAKC,SAAL,GAAiB,0BACf,YAAM;AACJ,UAAI,MAAKF,MAAL,IAAe,MAAKC,QAAxB,EAAkC;AAChC,YAAIE,OAAO,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACtCC,UAAAA,KAAK,EAAE,MAAKP,MAD0B;AAEtCJ,UAAAA,OAAO,EAAE,MAAKK,QAFwB;AAGtCO,UAAAA,eAAe,EAAE,MAAKC,SAAL,CAAeC,IAAf;AAHqB,SAA1B,CAAd;;AAMAC,6BAASC,MAAT,CAAgBT,OAAhB,kDAA+B,YAAM;AACnCT,UAAAA,GAAG,C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AL;AACD;;;SAED,eAAc;AACZ,aAAO,KAAKzB,QAAZ;AACD,K;SAED,aAAY4B,CAAZ,EAAe;AACb,WAAK5B,QAAL,GAAgB4B,CAAhB;;AACA,WAAK3B,SAAL,GAFa,CAGb;;;AACA,WAAKa,wBAAL;AACD;;;WAED,mBAAUe,IAAV,EAAgB;AACd,8CAAmB,KAAK7B,QAAxB,EAAkC,KAAKD,MAAL,CAAY+B,UAA9C,EAA0DD,IAA1D;;AACA,WAAKf,wBAAL;;AACA,WAAKb,SAAL;AACD;;;WAED,6BAAoB;AAClB,WAAKA,SAAL;AACD;;;kDApFyC8B,W","sourcesContent":["import Main from './main';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport debounce from 'lodash/debounce';\nimport debug from 'debug';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport { updateSessionValue } from './session-updater';\n\nconst log = debug('pie-ui:multiple-choice');\n\nexport const isComplete = session => !!(session && session.value && session.value.length);\n\nexport default class MultipleChoice extends HTMLElement {\n constructor() {\n super();\n this._model = null;\n this._session = null;\n\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n var element = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onChoiceChanged: this._onChange.bind(this)\n });\n\n ReactDOM.render(element, this, () => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true }\n );\n\n this._dispatchResponseChanged = debounce(() => {\n var event = new CustomEvent('session-changed', {\n bubbles: true,\n composed: true,\n detail: {\n complete: isComplete(this._session),\n component: this.tagName.toLowerCase()\n }\n });\n\n this.dispatchEvent(event);\n });\n\n this._dispatchModelSet = debounce(\n () => {\n this.dispatchEvent(\n new CustomEvent('model-set', {\n bubbles: true,\n composed: true,\n detail: {\n complete: isComplete(this._session),\n component: this.tagName.toLowerCase(),\n hasModel: this._model !== undefined\n }\n })\n );\n },\n 50,\n { leading: false, trailing: true }\n );\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n this._dispatchModelSet();\n }\n\n get session() {\n return this._session;\n }\n\n set session(s) {\n this._session = s;\n this._rerender();\n //TODO: remove this session-changed should only be emit on user change\n this._dispatchResponseChanged();\n }\n\n _onChange(data) {\n updateSessionValue(this._session, this._model.choiceMode, data);\n this._dispatchResponseChanged();\n this._rerender();\n }\n\n connectedCallback() {\n this._rerender();\n }\n}\n"],"file":"index.js"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
22
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
|
-
var _react = _interopRequireDefault(require("react"));
|
|
25
|
-
|
|
26
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
-
|
|
28
|
-
var _styles = require("@material-ui/core/styles");
|
|
29
|
-
|
|
30
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
31
|
-
|
|
32
|
-
var _renderUi = require("@pie-lib/render-ui");
|
|
33
|
-
|
|
34
|
-
var _multipleChoice = _interopRequireDefault(require("./multiple-choice"));
|
|
35
|
-
|
|
36
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
37
|
-
|
|
38
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
39
|
-
|
|
40
|
-
var Main = /*#__PURE__*/function (_React$Component) {
|
|
41
|
-
(0, _inherits2["default"])(Main, _React$Component);
|
|
42
|
-
|
|
43
|
-
var _super = _createSuper(Main);
|
|
44
|
-
|
|
45
|
-
function Main(props) {
|
|
46
|
-
(0, _classCallCheck2["default"])(this, Main);
|
|
47
|
-
return _super.call(this, props);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
(0, _createClass2["default"])(Main, [{
|
|
51
|
-
key: "render",
|
|
52
|
-
value: function render() {
|
|
53
|
-
var _this$props = this.props,
|
|
54
|
-
model = _this$props.model,
|
|
55
|
-
onChoiceChanged = _this$props.onChoiceChanged,
|
|
56
|
-
session = _this$props.session,
|
|
57
|
-
classes = _this$props.classes; // model.partLabel is a property used for ebsr
|
|
58
|
-
|
|
59
|
-
return /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewLayout, null, model.partLabel && /*#__PURE__*/_react["default"].createElement("p", null, model.partLabel), /*#__PURE__*/_react["default"].createElement("div", {
|
|
60
|
-
className: (0, _classnames["default"])(classes.root, classes[model.className])
|
|
61
|
-
}, /*#__PURE__*/_react["default"].createElement(_multipleChoice["default"], (0, _extends2["default"])({}, model, {
|
|
62
|
-
session: session,
|
|
63
|
-
onChoiceChanged: onChoiceChanged
|
|
64
|
-
}))));
|
|
65
|
-
}
|
|
66
|
-
}]);
|
|
67
|
-
return Main;
|
|
68
|
-
}(_react["default"].Component);
|
|
69
|
-
|
|
70
|
-
(0, _defineProperty2["default"])(Main, "propTypes", {
|
|
71
|
-
model: _propTypes["default"].object,
|
|
72
|
-
session: _propTypes["default"].object,
|
|
73
|
-
onChoiceChanged: _propTypes["default"].func,
|
|
74
|
-
classes: _propTypes["default"].object.isRequired
|
|
75
|
-
});
|
|
76
|
-
(0, _defineProperty2["default"])(Main, "defaultProps", {
|
|
77
|
-
model: {},
|
|
78
|
-
session: {}
|
|
79
|
-
});
|
|
80
|
-
var Styled = (0, _styles.withStyles)({}, {
|
|
81
|
-
name: 'Main'
|
|
82
|
-
})(Main);
|
|
83
|
-
var theme = (0, _styles.createMuiTheme)({
|
|
84
|
-
typography: {
|
|
85
|
-
useNextVariants: true
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
var Root = function Root(props) {
|
|
90
|
-
return /*#__PURE__*/_react["default"].createElement(_styles.MuiThemeProvider, {
|
|
91
|
-
theme: theme
|
|
92
|
-
}, /*#__PURE__*/_react["default"].createElement(Styled, props));
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
var _default = Root;
|
|
96
|
-
exports["default"] = _default;
|
|
97
|
-
//# sourceMappingURL=main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["Main","props","model","onChoiceChanged","session","classes","partLabel","root","className","React","Component","PropTypes","object","func","isRequired","Styled","name","theme","typography","useNextVariants","Root"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;IAEMA,I;;;;;AAYJ,gBAAYC,KAAZ,EAAmB;AAAA;AAAA,6BACXA,KADW;AAElB;;;;W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from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { createMuiTheme, MuiThemeProvider } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { PreviewLayout } from '@pie-lib/render-ui';\nimport MultipleChoice from './multiple-choice';\n\nclass Main extends React.Component {\n static propTypes = {\n model: PropTypes.object,\n session: PropTypes.object,\n onChoiceChanged: PropTypes.func,\n classes: PropTypes.object.isRequired,\n };\n\n static defaultProps = {\n model: {},\n session: {},\n };\n constructor(props) {\n super(props);\n }\n\n render() {\n const { model, onChoiceChanged, session, classes } = this.props;\n\n // model.partLabel is a property used for ebsr\n return (\n <PreviewLayout>\n {model.partLabel && <p>{model.partLabel}</p>}\n <div className={classNames(classes.root, classes[model.className])}>\n <MultipleChoice\n {...model}\n session={session}\n onChoiceChanged={onChoiceChanged}\n />\n </div>\n </PreviewLayout>\n );\n }\n}\n\nconst Styled = withStyles({}, { name: 'Main' })(Main);\n\nconst theme = createMuiTheme({\n typography: {\n useNextVariants: true,\n },\n});\n\nconst Root = (props) => (\n <MuiThemeProvider theme={theme}>\n <Styled {...props} />\n </MuiThemeProvider>\n);\n\nexport default Root;\n"],"file":"main.js"}
|