@pie-element/number-line 11.3.4-next.0 → 12.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/configure/lib/arrows.js +68 -103
  2. package/configure/lib/arrows.js.map +1 -1
  3. package/configure/lib/card-bar.js +41 -62
  4. package/configure/lib/card-bar.js.map +1 -1
  5. package/configure/lib/defaults.js +5 -7
  6. package/configure/lib/defaults.js.map +1 -1
  7. package/configure/lib/domain.js +60 -116
  8. package/configure/lib/domain.js.map +1 -1
  9. package/configure/lib/index.js +124 -194
  10. package/configure/lib/index.js.map +1 -1
  11. package/configure/lib/main.js +585 -721
  12. package/configure/lib/main.js.map +1 -1
  13. package/configure/lib/number-text-field.js +15 -86
  14. package/configure/lib/number-text-field.js.map +1 -1
  15. package/configure/lib/point-config.js +69 -129
  16. package/configure/lib/point-config.js.map +1 -1
  17. package/configure/lib/size.js +43 -77
  18. package/configure/lib/size.js.map +1 -1
  19. package/configure/lib/ticks.js +89 -151
  20. package/configure/lib/ticks.js.map +1 -1
  21. package/configure/lib/utils.js +2 -4
  22. package/configure/lib/utils.js.map +1 -1
  23. package/configure/package.json +10 -7
  24. package/controller/lib/defaults.js +5 -6
  25. package/controller/lib/defaults.js.map +1 -1
  26. package/controller/lib/index.js +171 -286
  27. package/controller/lib/index.js.map +1 -1
  28. package/controller/lib/tickUtils.js +96 -169
  29. package/controller/lib/tickUtils.js.map +1 -1
  30. package/controller/lib/utils.js +55 -88
  31. package/controller/lib/utils.js.map +1 -1
  32. package/controller/package.json +3 -3
  33. package/lib/data-converter.js +19 -23
  34. package/lib/data-converter.js.map +1 -1
  35. package/lib/draggable/index.js +104 -43
  36. package/lib/draggable/index.js.map +1 -1
  37. package/lib/index.js +118 -205
  38. package/lib/index.js.map +1 -1
  39. package/lib/number-line/colors.js +3 -13
  40. package/lib/number-line/colors.js.map +1 -1
  41. package/lib/number-line/feedback.js +53 -69
  42. package/lib/number-line/feedback.js.map +1 -1
  43. package/lib/number-line/graph/arrow.js +19 -38
  44. package/lib/number-line/graph/arrow.js.map +1 -1
  45. package/lib/number-line/graph/elements/base.js +7 -13
  46. package/lib/number-line/graph/elements/base.js.map +1 -1
  47. package/lib/number-line/graph/elements/builder.js +6 -7
  48. package/lib/number-line/graph/elements/builder.js.map +1 -1
  49. package/lib/number-line/graph/elements/line.js +209 -265
  50. package/lib/number-line/graph/elements/line.js.map +1 -1
  51. package/lib/number-line/graph/elements/point.js +170 -201
  52. package/lib/number-line/graph/elements/point.js.map +1 -1
  53. package/lib/number-line/graph/elements/ray.js +147 -185
  54. package/lib/number-line/graph/elements/ray.js.map +1 -1
  55. package/lib/number-line/graph/index.js +217 -283
  56. package/lib/number-line/graph/index.js.map +1 -1
  57. package/lib/number-line/graph/line.js +12 -22
  58. package/lib/number-line/graph/line.js.map +1 -1
  59. package/lib/number-line/graph/stacks.js +31 -54
  60. package/lib/number-line/graph/stacks.js.map +1 -1
  61. package/lib/number-line/graph/tick-utils.js +120 -209
  62. package/lib/number-line/graph/tick-utils.js.map +1 -1
  63. package/lib/number-line/graph/ticks.js +144 -225
  64. package/lib/number-line/graph/ticks.js.map +1 -1
  65. package/lib/number-line/index.js +331 -395
  66. package/lib/number-line/index.js.map +1 -1
  67. package/lib/number-line/point-chooser/button.js +33 -58
  68. package/lib/number-line/point-chooser/button.js.map +1 -1
  69. package/lib/number-line/point-chooser/img.js +2 -3
  70. package/lib/number-line/point-chooser/img.js.map +1 -1
  71. package/lib/number-line/point-chooser/index.js +152 -148
  72. package/lib/number-line/point-chooser/index.js.map +1 -1
  73. package/lib/number-line/point-chooser/styles.js +29 -52
  74. package/lib/number-line/point-chooser/styles.js.map +1 -1
  75. package/lib/number-line/transitions/fade.js +69 -48
  76. package/lib/number-line/transitions/fade.js.map +1 -1
  77. package/lib/number-line/transitions/index.js +2 -4
  78. package/lib/number-line/transitions/index.js.map +1 -1
  79. package/package.json +14 -11
@@ -1,205 +1,141 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
4
  Object.defineProperty(exports, "__esModule", {
8
5
  value: true
9
6
  });
10
- exports.toPointType = exports["default"] = exports.Main = void 0;
11
-
12
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
-
14
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
-
16
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
17
-
18
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
19
-
20
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
21
-
22
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
23
-
24
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
25
-
26
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
27
-
7
+ exports.toPointType = exports.default = exports.Main = void 0;
28
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
29
-
30
9
  var _react = _interopRequireDefault(require("react"));
31
-
32
10
  var _configUi = require("@pie-lib/config-ui");
33
-
34
11
  var _editableHtml = _interopRequireDefault(require("@pie-lib/editable-html"));
35
-
36
12
  var _numberLine = require("@pie-element/number-line");
37
-
38
13
  var _numberTextField = _interopRequireDefault(require("./number-text-field"));
39
-
40
14
  var _cardBar = _interopRequireDefault(require("./card-bar"));
41
-
42
15
  var _size = _interopRequireDefault(require("./size"));
43
-
44
16
  var _propTypes = _interopRequireDefault(require("prop-types"));
45
-
46
17
  var _domain = _interopRequireDefault(require("./domain"));
47
-
48
18
  var _arrows = _interopRequireDefault(require("./arrows"));
49
-
50
19
  var _pointConfig = _interopRequireDefault(require("./point-config"));
51
-
52
20
  var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
53
-
54
- var _styles = require("@material-ui/core/styles");
55
-
56
- var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
57
-
58
- var _Info = _interopRequireDefault(require("@material-ui/icons/Info"));
59
-
60
- var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
61
-
21
+ var _styles = require("@mui/material/styles");
22
+ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
23
+ var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
24
+ var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
62
25
  var _ticks = _interopRequireDefault(require("./ticks"));
63
-
64
26
  var _defaults = require("./defaults");
65
-
66
27
  var _utils = require("./utils");
67
-
68
28
  var math = _interopRequireWildcard(require("mathjs"));
69
-
70
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
71
-
72
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
73
-
74
- 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); }; }
75
-
76
- 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; } }
77
-
78
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
79
-
80
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
81
-
82
- var trimModel = function trimModel(model) {
83
- return _objectSpread(_objectSpread({}, model), {}, {
84
- feedback: undefined,
85
- prompt: undefined,
86
- teacherInstructions: undefined,
87
- graph: _objectSpread(_objectSpread({}, model.graph), {}, {
88
- title: undefined,
89
- disabled: true
90
- }),
91
- correctResponse: undefined
92
- });
93
- };
94
-
95
- var lineIsSwitched = _numberLine.dataConverter.lineIsSwitched,
96
- switchGraphLine = _numberLine.dataConverter.switchGraphLine,
97
- toGraphFormat = _numberLine.dataConverter.toGraphFormat,
98
- toSessionFormat = _numberLine.dataConverter.toSessionFormat;
99
- var Panel = _configUi.settings.Panel,
100
- toggle = _configUi.settings.toggle;
101
- var minorLimits = {};
102
- var minorValues = {};
103
- var majorValues = {};
104
-
105
- var styles = function styles(theme) {
106
- return {
107
- maxNumberOfPoints: {
108
- width: '150px'
109
- },
110
- checkbox: {
111
- marginTop: theme.spacing.unit * 2,
112
- marginBottom: theme.spacing.unit * 2
113
- },
114
- row: {
115
- display: 'flex',
116
- flexWrap: 'wrap',
117
- '& > *': {
118
- paddingRight: theme.spacing.unit * 2
119
- }
120
- },
121
- pointTypeChooser: {
122
- margin: "".concat(theme.spacing.unit * 2.5, "px 0")
123
- },
124
- promptContainer: {
125
- paddingTop: theme.spacing.unit * 2,
126
- marginBottom: theme.spacing.unit * 2,
127
- width: '100%'
128
- },
129
- title: {
130
- marginBottom: theme.spacing.unit * 4
131
- },
132
- tooltip: {
133
- fontSize: theme.typography.fontSize - 2,
134
- whiteSpace: 'pre',
135
- maxWidth: '500px'
136
- },
137
- inlineFlexContainer: {
138
- display: 'inline-flex'
139
- },
140
- resetButton: {
141
- marginBottom: theme.spacing.unit * 2.5
142
- },
143
- errorText: {
144
- fontSize: theme.typography.fontSize - 2,
145
- color: theme.palette.error.main,
146
- paddingTop: theme.spacing.unit
147
- },
148
- flexRow: {
149
- display: 'flex',
150
- alignItems: 'center',
151
- gap: '10px'
152
- },
153
- description: {
154
- marginBottom: theme.spacing.unit * 2.5
155
- }
156
- };
157
- };
158
-
159
- var toPointType = function toPointType(response) {
29
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
30
+ const trimModel = model => ({
31
+ ...model,
32
+ feedback: undefined,
33
+ prompt: undefined,
34
+ teacherInstructions: undefined,
35
+ graph: {
36
+ ...model.graph,
37
+ title: undefined,
38
+ disabled: true
39
+ },
40
+ correctResponse: undefined
41
+ });
42
+ const {
43
+ lineIsSwitched,
44
+ switchGraphLine,
45
+ toGraphFormat,
46
+ toSessionFormat
47
+ } = _numberLine.dataConverter;
48
+ const {
49
+ Panel,
50
+ toggle
51
+ } = _configUi.settings;
52
+ let minorLimits = {};
53
+ let minorValues = {};
54
+ let majorValues = {};
55
+ const StyledNumberTextField = (0, _styles.styled)(_numberTextField.default)({
56
+ width: '150px'
57
+ });
58
+ const Row = (0, _styles.styled)('div')(({
59
+ theme
60
+ }) => ({
61
+ display: 'flex',
62
+ flexWrap: 'wrap',
63
+ '& > *': {
64
+ paddingRight: theme.spacing(2)
65
+ }
66
+ }));
67
+ const PointTypeChooser = (0, _styles.styled)('div')(({
68
+ theme
69
+ }) => ({
70
+ margin: `${theme.spacing(2.5)}px 0`
71
+ }));
72
+ const StyledInputContainer = (0, _styles.styled)(_configUi.InputContainer)(({
73
+ theme
74
+ }) => ({
75
+ paddingTop: theme.spacing(2),
76
+ marginBottom: theme.spacing(2),
77
+ width: '100%'
78
+ }));
79
+ const StyledFormSection = (0, _styles.styled)(_configUi.FormSection)(({
80
+ theme
81
+ }) => ({
82
+ marginBottom: theme.spacing(4)
83
+ }));
84
+ const ErrorText = (0, _styles.styled)('div')(({
85
+ theme
86
+ }) => ({
87
+ fontSize: theme.typography.fontSize - 2,
88
+ color: theme.palette.error.main,
89
+ paddingTop: theme.spacing(1)
90
+ }));
91
+ const FlexRow = (0, _styles.styled)('div')({
92
+ display: 'flex',
93
+ alignItems: 'center',
94
+ gap: '10px'
95
+ });
96
+ const FlexRowFormSection = (0, _styles.styled)(_configUi.FormSection)({
97
+ display: 'flex',
98
+ alignItems: 'center',
99
+ gap: '10px'
100
+ });
101
+ const Description = (0, _styles.styled)(_Typography.default)(({
102
+ theme
103
+ }) => ({
104
+ marginBottom: theme.spacing(2.5)
105
+ }));
106
+ const toPointType = response => {
160
107
  function rest(response) {
161
108
  if (response.pointType) {
162
109
  if (response.direction) {
163
- return "".concat(response.pointType[0]).concat(response.direction[0]);
110
+ return `${response.pointType[0]}${response.direction[0]}`;
164
111
  }
165
-
166
112
  return response.pointType[0];
167
113
  }
168
-
169
- return "".concat(response.leftPoint[0]).concat(response.rightPoint[0]);
114
+ return `${response.leftPoint[0]}${response.rightPoint[0]}`;
170
115
  }
171
-
172
- return "".concat(response.type[0]).concat(rest(response)).toUpperCase();
116
+ return `${response.type[0]}${rest(response)}`.toUpperCase();
173
117
  };
174
-
175
118
  exports.toPointType = toPointType;
176
-
177
- var Main = /*#__PURE__*/function (_React$Component) {
178
- (0, _inherits2["default"])(Main, _React$Component);
179
-
180
- var _super = _createSuper(Main);
181
-
182
- function Main(props) {
183
- var _this;
184
-
185
- (0, _classCallCheck2["default"])(this, Main);
186
- _this = _super.call(this, props);
187
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "graphChange", function (obj) {
188
- var _this$props = _this.props,
189
- model = _this$props.model,
190
- onChange = _this$props.onChange;
191
-
192
- var graph = _objectSpread(_objectSpread({}, model.graph), obj);
193
-
194
- var respIndex = [];
195
- model.correctResponse.forEach(function (correctResp, key) {
119
+ class Main extends _react.default.Component {
120
+ constructor(props) {
121
+ super(props);
122
+ (0, _defineProperty2.default)(this, "graphChange", obj => {
123
+ const {
124
+ model,
125
+ onChange
126
+ } = this.props;
127
+ let graph = {
128
+ ...model.graph,
129
+ ...obj
130
+ };
131
+ let respIndex = [];
132
+ model.correctResponse.forEach((correctResp, key) => {
196
133
  if (correctResp.domainPosition < graph.domain.min || correctResp.domainPosition > graph.domain.max || correctResp.size && (correctResp.domainPosition + correctResp.size < graph.domain.min || correctResp.domainPosition + correctResp.size > graph.domain.max)) {
197
134
  respIndex.push(key);
198
135
  }
199
136
  });
200
-
201
137
  if (respIndex.length > 0) {
202
- _this.setState({
138
+ this.setState({
203
139
  correctAnswerDialog: {
204
140
  open: true,
205
141
  text: 'This\n' + 'change would make it impossible for students to plot one or more elements in the current\n' + 'correct answer. If you proceed, all such elements will be removed from the correct\n' + 'answer.',
@@ -207,29 +143,23 @@ var Main = /*#__PURE__*/function (_React$Component) {
207
143
  graph: model.graph
208
144
  }
209
145
  });
210
- } //reload ticks value whenever domain and width is changed
211
-
212
-
213
- graph = _this.reloadTicksData(graph);
146
+ }
147
+ //reload ticks value whenever domain and width is changed
148
+ graph = this.reloadTicksData(graph);
214
149
  onChange({
215
- graph: graph
150
+ graph
216
151
  });
217
152
  });
218
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeSize", function (_ref) {
219
- var width = _ref.width,
220
- height = _ref.height;
221
- return _this.graphChange({
222
- width: width,
223
- height: height
224
- });
225
- });
226
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getAdjustedHeight", function (availableTypes, maxNumberOfPoints) {
227
- var onlyPFAvailable = true;
228
- Object.entries(availableTypes || {}).forEach(function (_ref2) {
229
- var _ref3 = (0, _slicedToArray2["default"])(_ref2, 2),
230
- type = _ref3[0],
231
- value = _ref3[1];
232
-
153
+ (0, _defineProperty2.default)(this, "changeSize", ({
154
+ width,
155
+ height
156
+ }) => this.graphChange({
157
+ width,
158
+ height
159
+ }));
160
+ (0, _defineProperty2.default)(this, "getAdjustedHeight", (availableTypes, maxNumberOfPoints) => {
161
+ let onlyPFAvailable = true;
162
+ Object.entries(availableTypes || {}).forEach(([type, value]) => {
233
163
  if (type !== 'PF' && value) {
234
164
  onlyPFAvailable = false;
235
165
  return;
@@ -237,74 +167,83 @@ var Main = /*#__PURE__*/function (_React$Component) {
237
167
  });
238
168
  return maxNumberOfPoints && (maxNumberOfPoints === 1 || onlyPFAvailable) ? 100 : 50 + (maxNumberOfPoints || 20) * 25;
239
169
  });
240
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeMaxNoOfPoints", function (e, maxNumberOfPoints) {
170
+ (0, _defineProperty2.default)(this, "changeMaxNoOfPoints", (e, maxNumberOfPoints) => {
241
171
  maxNumberOfPoints = Math.floor(maxNumberOfPoints);
242
-
243
- if (_this.props.model.correctResponse.length > maxNumberOfPoints) {
244
- _this.setState({
172
+ if (this.props.model.correctResponse.length > maxNumberOfPoints) {
173
+ this.setState({
245
174
  dialog: {
246
175
  open: true,
247
176
  text: 'To use this value, you must first remove one or more elements from the correct answers.'
248
177
  }
249
178
  });
250
-
251
179
  return;
252
180
  }
253
-
254
- var availableTypes = _this.props.model.graph.availableTypes;
255
-
256
- var height = _this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
257
-
258
- _this.graphChange({
259
- maxNumberOfPoints: maxNumberOfPoints,
260
- height: height
261
- });
262
- });
263
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeGraphTitle", function (title) {
264
- return _this.graphChange({
265
- title: title
181
+ const {
182
+ model: {
183
+ graph: {
184
+ availableTypes
185
+ }
186
+ }
187
+ } = this.props;
188
+ const height = this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
189
+ this.graphChange({
190
+ maxNumberOfPoints,
191
+ height
266
192
  });
267
193
  });
268
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeTicks", function (object) {
269
- var _this$props2 = _this.props,
270
- model = _this$props2.model,
271
- onChange = _this$props2.onChange;
272
- var ticks = object.ticks;
273
-
274
- var correctResponse = _numberLine.tickUtils.snapElements(model.graph.domain, ticks, model.correctResponse);
275
-
276
- var initialElements = model.graph.initialElements ? _numberLine.tickUtils.snapElements(model.graph.domain, ticks, model.graph.initialElements) : [];
277
-
278
- var updatedGraph = _this.updateMajorValue(_objectSpread(_objectSpread({}, model.graph), {}, {
279
- ticks: ticks
280
- }));
281
-
282
- var graph = _objectSpread(_objectSpread({}, updatedGraph), {}, {
283
- initialElements: initialElements
194
+ (0, _defineProperty2.default)(this, "changeGraphTitle", title => this.graphChange({
195
+ title
196
+ }));
197
+ /*
198
+ * Gets triggered whenever ticks related data is changed by user.
199
+ * */
200
+ (0, _defineProperty2.default)(this, "changeTicks", object => {
201
+ const {
202
+ model,
203
+ onChange
204
+ } = this.props;
205
+ let {
206
+ ticks
207
+ } = object;
208
+ const correctResponse = _numberLine.tickUtils.snapElements(model.graph.domain, ticks, model.correctResponse);
209
+ const initialElements = model.graph.initialElements ? _numberLine.tickUtils.snapElements(model.graph.domain, ticks, model.graph.initialElements) : [];
210
+ let updatedGraph = this.updateMajorValue({
211
+ ...model.graph,
212
+ ticks
284
213
  });
285
-
214
+ const graph = {
215
+ ...updatedGraph,
216
+ initialElements
217
+ };
286
218
  onChange({
287
- graph: graph,
288
- correctResponse: correctResponse
219
+ graph,
220
+ correctResponse
289
221
  });
290
222
  });
291
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "reloadTicksData", function (graph) {
292
- var domain = graph.domain,
293
- ticks = graph.ticks,
294
- width = graph.width; //Set tick interval type if not present for legacy number line models depending upon minor value
295
-
223
+ /*
224
+ * This function is duplicated in controller/index.js
225
+ * This function will reload ticks data whenever graph object is changed and also sets required tick object
226
+ * for rendering Ticks Components.
227
+ * @param graph object containing domain, ticks and width value
228
+ * @return graph object with updated ticks values
229
+ * */
230
+ (0, _defineProperty2.default)(this, "reloadTicksData", graph => {
231
+ const {
232
+ domain,
233
+ ticks,
234
+ width
235
+ } = graph;
236
+ //Set tick interval type if not present for legacy number line models depending upon minor value
296
237
  if (!ticks.tickIntervalType) {
297
238
  if (ticks.minor > 0.5) {
298
239
  ticks.tickIntervalType = 'Integer';
299
240
  } else {
300
241
  ticks.tickIntervalType = 'Decimal';
301
242
  }
302
- } // This section will calculate minor and major values array and assign respective value
243
+ }
244
+ // This section will calculate minor and major values array and assign respective value
303
245
  // to different tick types object
304
-
305
-
306
246
  minorLimits = _numberLine.tickUtils.getMinorLimits(domain, width);
307
-
308
247
  if (minorLimits.min >= 1) {
309
248
  /*
310
249
  * In this scenario only integer tick will be enabled
@@ -325,11 +264,9 @@ var Main = /*#__PURE__*/function (_React$Component) {
325
264
  if (ticks.tickIntervalType === 'Integer') {
326
265
  ticks.tickIntervalType = 'Fraction';
327
266
  }
328
-
329
267
  minorValues = _numberLine.tickUtils.generateMinorValues(minorLimits);
330
- var minValue = math.number(math.fraction(minorValues.fraction[0]));
331
- var maxValue = math.number(math.fraction(minorValues.fraction[minorValues.fraction.length - 1]));
332
-
268
+ let minValue = math.number(math.fraction(minorValues.fraction[0]));
269
+ let maxValue = math.number(math.fraction(minorValues.fraction[minorValues.fraction.length - 1]));
333
270
  if (ticks.minor < minValue || ticks.minor > maxValue) {
334
271
  switch (ticks.tickIntervalType) {
335
272
  case 'Fraction':
@@ -337,7 +274,6 @@ var Main = /*#__PURE__*/function (_React$Component) {
337
274
  ticks.fractionTick = minorValues.fraction[minorValues.fraction.length - 1];
338
275
  ticks.decimalTick = minorValues.decimal[0];
339
276
  break;
340
-
341
277
  case 'Decimal':
342
278
  case 'Integer':
343
279
  ticks.minor = minorValues.decimal[minorValues.decimal.length - 1];
@@ -347,30 +283,26 @@ var Main = /*#__PURE__*/function (_React$Component) {
347
283
  } else {
348
284
  switch (ticks.tickIntervalType) {
349
285
  case 'Fraction':
350
- var fraction = math.fraction(math.number(ticks.minor));
286
+ let fraction = math.fraction(math.number(ticks.minor));
351
287
  ticks.fractionTick = fraction.n + '/' + fraction.d;
352
288
  ticks.decimalTick = ticks.decimalTick ? ticks.decimalTick : minorValues.decimal[0];
353
289
  break;
354
-
355
290
  case 'Decimal':
356
291
  case 'Integer':
357
292
  ticks.decimalTick = ticks.minor;
358
293
  ticks.fractionTick = ticks.fractionTick ? ticks.fractionTick : minorValues.fraction[0];
359
294
  }
360
295
  }
361
-
362
296
  ticks.integerTick = 1;
363
297
  } else if (minorLimits.min < 1 && minorLimits.max >= 1) {
364
298
  /*
365
299
  * In this scenario all integer, decimal or fraction tick will be enabled
366
300
  * */
367
301
  minorValues = _numberLine.tickUtils.generateMinorValues(minorLimits);
368
-
369
302
  if (!(ticks.minor >= minorLimits.min && ticks.minor <= minorLimits.max)) {
370
303
  if (minorLimits.min > 0.5) {
371
304
  ticks.tickIntervalType = 'Integer';
372
305
  }
373
-
374
306
  switch (ticks.tickIntervalType) {
375
307
  case 'Integer':
376
308
  ticks.minor = math.number(math.ceil(minorLimits.min));
@@ -378,14 +310,12 @@ var Main = /*#__PURE__*/function (_React$Component) {
378
310
  ticks.decimalTick = minorLimits.min > 0.5 ? 0 : minorValues.decimal[0];
379
311
  ticks.fractionTick = minorLimits.min > 0.5 ? '0' : minorValues.fraction[0];
380
312
  break;
381
-
382
313
  case 'Decimal':
383
314
  ticks.minor = minorValues.decimal[0];
384
315
  ticks.integerTick = 1;
385
316
  ticks.decimalTick = ticks.minor;
386
317
  ticks.fractionTick = minorValues.fraction[0];
387
318
  break;
388
-
389
319
  case 'Fraction':
390
320
  ticks.minor = math.number(math.fraction(minorValues.fraction[0]));
391
321
  ticks.integerTick = 1;
@@ -399,150 +329,158 @@ var Main = /*#__PURE__*/function (_React$Component) {
399
329
  ticks.decimalTick = minorLimits.min > 0.5 ? 0 : minorValues.decimal[0];
400
330
  ticks.fractionTick = minorLimits.min > 0.5 ? '0' : minorValues.fraction[0];
401
331
  break;
402
-
403
332
  case 'Decimal':
404
333
  ticks.integerTick = 1;
405
334
  ticks.decimalTick = ticks.minor;
406
335
  ticks.fractionTick = minorValues.fraction[0];
407
336
  break;
408
-
409
337
  case 'Fraction':
410
338
  ticks.integerTick = 1;
411
339
  ticks.decimalTick = minorValues.decimal[0];
412
-
413
- var _fraction = math.fraction(math.number(ticks.minor));
414
-
415
- ticks.fractionTick = _fraction.n + '/' + _fraction.d;
340
+ let fraction = math.fraction(math.number(ticks.minor));
341
+ ticks.fractionTick = fraction.n + '/' + fraction.d;
416
342
  }
417
343
  }
418
344
  }
419
-
420
- return _this.updateMajorValue(_objectSpread(_objectSpread({}, graph), {}, {
421
- ticks: ticks
422
- }));
345
+ return this.updateMajorValue({
346
+ ...graph,
347
+ ticks
348
+ });
423
349
  });
424
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "updateMajorValue", function (graph) {
425
- var domain = graph.domain,
426
- ticks = graph.ticks,
427
- width = graph.width;
350
+ /*
351
+ * This function is duplicated in controller/index.js
352
+ * This function will update major value whenever minor value is changed or tick type is changed
353
+ * @param graph object containing domain, ticks and width value
354
+ * @return graph object with updated ticks values
355
+ * */
356
+ (0, _defineProperty2.default)(this, "updateMajorValue", graph => {
357
+ const {
358
+ domain,
359
+ ticks,
360
+ width
361
+ } = graph;
428
362
  majorValues = _numberLine.tickUtils.generateMajorValuesForMinor(ticks.minor, domain, width);
429
-
430
363
  if (majorValues.decimal.indexOf(ticks.major) === -1) {
431
- var currIndex = 0;
432
-
364
+ let currIndex = 0;
433
365
  if (ticks.tickIntervalType === 'Integer') {
434
366
  currIndex = majorValues.decimal.length > 4 ? 4 : majorValues.decimal.length - 1;
435
367
  } else {
436
368
  currIndex = majorValues.decimal.length - 1;
437
369
  }
438
-
439
370
  ticks.major = majorValues.decimal[currIndex];
440
371
  }
441
-
442
372
  graph.fraction = ticks.tickIntervalType === 'Fraction' && ticks.major < 1;
443
- return _objectSpread(_objectSpread({}, graph), {}, {
444
- ticks: ticks
445
- });
446
- });
447
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeArrows", function (arrows) {
448
- return _this.graphChange({
449
- arrows: arrows
450
- });
373
+ return {
374
+ ...graph,
375
+ ticks
376
+ };
451
377
  });
452
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setDefaults", function () {
453
- var _defaultModel$graph = _defaults.model.graph,
454
- availableTypes = _defaultModel$graph.availableTypes,
455
- maxNumberOfPoints = _defaultModel$graph.maxNumberOfPoints;
456
-
457
- var height = _this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
458
-
459
- var graph = _objectSpread(_objectSpread({}, (0, _cloneDeep["default"])(_defaults.model.graph)), {}, {
460
- height: height
461
- });
462
-
463
- _this.props.onChange({
464
- graph: graph
378
+ (0, _defineProperty2.default)(this, "changeArrows", arrows => this.graphChange({
379
+ arrows
380
+ }));
381
+ (0, _defineProperty2.default)(this, "setDefaults", () => {
382
+ const {
383
+ graph: {
384
+ availableTypes,
385
+ maxNumberOfPoints
386
+ }
387
+ } = _defaults.model;
388
+ const height = this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
389
+ const graph = {
390
+ ...(0, _cloneDeep.default)(_defaults.model.graph),
391
+ height
392
+ };
393
+ this.props.onChange({
394
+ graph
465
395
  });
466
396
  });
467
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "moveCorrectResponse", function (index, el, position) {
397
+ (0, _defineProperty2.default)(this, "moveCorrectResponse", (index, el, position) => {
468
398
  el.position = position;
469
- var _this$props3 = _this.props,
470
- onChange = _this$props3.onChange,
471
- model = _this$props3.model;
472
- var update = toSessionFormat(el.type === 'line' && lineIsSwitched(el) ? switchGraphLine(el) : el);
473
- var correctResponse = (0, _toConsumableArray2["default"])(model.correctResponse);
399
+ const {
400
+ onChange,
401
+ model
402
+ } = this.props;
403
+ const update = toSessionFormat(el.type === 'line' && lineIsSwitched(el) ? switchGraphLine(el) : el);
404
+ const correctResponse = [...model.correctResponse];
474
405
  correctResponse[index] = update;
475
406
  onChange({
476
- correctResponse: correctResponse
407
+ correctResponse
477
408
  });
478
409
  });
479
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "availableTypesChange", function (availableTypes) {
480
- var _this$props4 = _this.props,
481
- model = _this$props4.model,
482
- onChange = _this$props4.onChange;
483
- var correctResponse = model.correctResponse,
484
- maxNumberOfPoints = model.graph.maxNumberOfPoints;
485
- new Set(correctResponse.map(toPointType)).forEach(function (pointType) {
410
+ (0, _defineProperty2.default)(this, "availableTypesChange", availableTypes => {
411
+ const {
412
+ model,
413
+ onChange
414
+ } = this.props;
415
+ const {
416
+ correctResponse,
417
+ graph: {
418
+ maxNumberOfPoints
419
+ }
420
+ } = model;
421
+ new Set(correctResponse.map(toPointType)).forEach(pointType => {
486
422
  availableTypes[pointType] = true;
487
423
  });
488
-
489
- var height = _this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
490
-
491
- var graph = _objectSpread(_objectSpread({}, model.graph), {}, {
492
- availableTypes: availableTypes,
493
- height: height
494
- });
495
-
424
+ const height = this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
425
+ const graph = {
426
+ ...model.graph,
427
+ availableTypes,
428
+ height
429
+ };
496
430
  onChange({
497
- graph: graph
431
+ graph
498
432
  });
499
433
  });
500
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "deleteCorrectResponse", function (indices) {
501
- var _this$props5 = _this.props,
502
- model = _this$props5.model,
503
- onChange = _this$props5.onChange;
504
- var correctResponse = model.correctResponse.filter(function (v, index) {
505
- return !indices.some(function (d) {
506
- return d === index;
507
- });
508
- });
434
+ (0, _defineProperty2.default)(this, "deleteCorrectResponse", indices => {
435
+ const {
436
+ model,
437
+ onChange
438
+ } = this.props;
439
+ const correctResponse = model.correctResponse.filter((v, index) => !indices.some(d => d === index));
509
440
  onChange({
510
- correctResponse: correctResponse
441
+ correctResponse
511
442
  });
512
443
  });
513
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "addCorrectResponse", function (data) {
514
- var _this$props6 = _this.props,
515
- model = _this$props6.model,
516
- onChange = _this$props6.onChange;
517
- var correctResponse = (0, _toConsumableArray2["default"])(model.correctResponse);
444
+ (0, _defineProperty2.default)(this, "addCorrectResponse", data => {
445
+ const {
446
+ model,
447
+ onChange
448
+ } = this.props;
449
+ const correctResponse = [...model.correctResponse];
518
450
  correctResponse.push(toSessionFormat(data));
519
451
  onChange({
520
- correctResponse: correctResponse
452
+ correctResponse
521
453
  });
522
454
  });
523
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "clearCorrectResponse", function () {
524
- var onChange = _this.props.onChange;
455
+ (0, _defineProperty2.default)(this, "clearCorrectResponse", () => {
456
+ const {
457
+ onChange
458
+ } = this.props;
525
459
  onChange({
526
460
  correctResponse: []
527
461
  });
528
462
  });
529
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "undoCorrectResponse", function () {
530
- var _this$props7 = _this.props,
531
- model = _this$props7.model,
532
- onChange = _this$props7.onChange;
533
- var correctResponse = (0, _toConsumableArray2["default"])(model.correctResponse);
463
+ (0, _defineProperty2.default)(this, "undoCorrectResponse", () => {
464
+ const {
465
+ model,
466
+ onChange
467
+ } = this.props;
468
+ const correctResponse = [...model.correctResponse];
534
469
  correctResponse.pop();
535
470
  onChange({
536
- correctResponse: correctResponse
471
+ correctResponse
537
472
  });
538
473
  });
539
- var _props$model$graph = props.model.graph,
540
- _availableTypes = _props$model$graph.availableTypes,
541
- _maxNumberOfPoints = _props$model$graph.maxNumberOfPoints;
542
-
543
- var _height = _this.getAdjustedHeight(_availableTypes, _maxNumberOfPoints);
544
-
545
- _this.state = {
474
+ const {
475
+ model: {
476
+ graph: {
477
+ availableTypes: _availableTypes,
478
+ maxNumberOfPoints: _maxNumberOfPoints
479
+ }
480
+ }
481
+ } = props;
482
+ const _height = this.getAdjustedHeight(_availableTypes, _maxNumberOfPoints);
483
+ this.state = {
546
484
  dialog: {
547
485
  open: false,
548
486
  text: ''
@@ -552,397 +490,323 @@ var Main = /*#__PURE__*/function (_React$Component) {
552
490
  text: ''
553
491
  }
554
492
  };
555
-
556
- _this.graphChange({
493
+ this.graphChange({
557
494
  height: _height
558
495
  });
559
-
560
- return _this;
561
496
  }
562
-
563
- (0, _createClass2["default"])(Main, [{
564
- key: "componentDidMount",
565
- value: function componentDidMount() {
566
- var _this$props8 = this.props,
567
- configuration = _this$props8.configuration,
568
- model = _this$props8.model,
569
- onChange = _this$props8.onChange;
570
-
571
- var _ref4 = configuration || {},
572
- title = _ref4.title;
573
-
574
- var _ref5 = model || {},
575
- showTitle = _ref5.titleEnabled;
576
-
577
- var titleEnabled = showTitle === undefined || showTitle === null ? title.enabled : showTitle;
578
- onChange && onChange(_objectSpread(_objectSpread({}, model), {}, {
579
- titleEnabled: titleEnabled
580
- }));
581
- }
582
- }, {
583
- key: "render",
584
- value: function render() {
585
- var _this2 = this;
586
-
587
- var _this$props9 = this.props,
588
- classes = _this$props9.classes,
589
- model = _this$props9.model,
590
- _onChange = _this$props9.onChange,
591
- configuration = _this$props9.configuration,
592
- onConfigurationChanged = _this$props9.onConfigurationChanged,
593
- uploadSoundSupport = _this$props9.uploadSoundSupport,
594
- imageSupport = _this$props9.imageSupport;
595
-
596
- var _ref6 = configuration || {},
597
- _ref6$baseInputConfig = _ref6.baseInputConfiguration,
598
- baseInputConfiguration = _ref6$baseInputConfig === void 0 ? {} : _ref6$baseInputConfig,
599
- _ref6$contentDimensio = _ref6.contentDimensions,
600
- contentDimensions = _ref6$contentDimensio === void 0 ? {} : _ref6$contentDimensio,
601
- _ref6$instruction = _ref6.instruction,
602
- instruction = _ref6$instruction === void 0 ? {} : _ref6$instruction,
603
- _ref6$teacherInstruct = _ref6.teacherInstructions,
604
- teacherInstructions = _ref6$teacherInstruct === void 0 ? {} : _ref6$teacherInstruct,
605
- _ref6$title = _ref6.title,
606
- title = _ref6$title === void 0 ? {} : _ref6$title,
607
- _ref6$prompt = _ref6.prompt,
608
- prompt = _ref6$prompt === void 0 ? {} : _ref6$prompt,
609
- _ref6$rationale = _ref6.rationale,
610
- rationale = _ref6$rationale === void 0 ? {} : _ref6$rationale,
611
- _ref6$spellCheck = _ref6.spellCheck,
612
- spellCheck = _ref6$spellCheck === void 0 ? {} : _ref6$spellCheck,
613
- _ref6$mathMlOptions = _ref6.mathMlOptions,
614
- mathMlOptions = _ref6$mathMlOptions === void 0 ? {} : _ref6$mathMlOptions,
615
- _ref6$numberLineDimen = _ref6.numberLineDimensions,
616
- numberLineDimensions = _ref6$numberLineDimen === void 0 ? {} : _ref6$numberLineDimen,
617
- _ref6$maxMaxElements = _ref6.maxMaxElements,
618
- maxMaxElements = _ref6$maxMaxElements === void 0 ? 20 : _ref6$maxMaxElements,
619
- _ref6$hidePointConfig = _ref6.hidePointConfigButtons,
620
- hidePointConfigButtons = _ref6$hidePointConfig === void 0 ? false : _ref6$hidePointConfig,
621
- _ref6$availableTools = _ref6.availableTools,
622
- availableTools = _ref6$availableTools === void 0 ? ['PF'] : _ref6$availableTools,
623
- _ref6$settingsPanelDi = _ref6.settingsPanelDisabled,
624
- settingsPanelDisabled = _ref6$settingsPanelDi === void 0 ? false : _ref6$settingsPanelDi;
625
-
626
- var _ref7 = model || {},
627
- _ref7$errors = _ref7.errors,
628
- errors = _ref7$errors === void 0 ? {} : _ref7$errors,
629
- extraCSSRules = _ref7.extraCSSRules,
630
- spellCheckEnabled = _ref7.spellCheckEnabled,
631
- toolbarEditorPosition = _ref7.toolbarEditorPosition,
632
- teacherInstructionsEnabled = _ref7.teacherInstructionsEnabled,
633
- titleEnabled = _ref7.titleEnabled,
634
- promptEnabled = _ref7.promptEnabled,
635
- rationaleEnabled = _ref7.rationaleEnabled;
636
-
637
- var graph = model.graph;
638
- graph = this.reloadTicksData(graph);
639
- var _this$state = this.state,
640
- dialog = _this$state.dialog,
641
- correctAnswerDialog = _this$state.correctAnswerDialog;
642
-
643
- var _ref8 = errors || {},
644
- correctResponseError = _ref8.correctResponseError,
645
- domainError = _ref8.domainError,
646
- maxError = _ref8.maxError,
647
- pointsError = _ref8.pointsError,
648
- promptError = _ref8.prompt,
649
- rationaleError = _ref8.rationale,
650
- teacherInstructionsError = _ref8.teacherInstructions,
651
- widthError = _ref8.widthError;
652
-
653
- var validationMessage = (0, _utils.generateValidationMessage)();
654
- var correctResponse = (0, _cloneDeep["default"])(model.correctResponse || []).map(toGraphFormat);
655
- var initialModel = (0, _cloneDeep["default"])(model);
656
- initialModel['disabled'] = true;
657
- var toolbarOpts = {
658
- position: toolbarEditorPosition === 'top' ? 'top' : 'bottom'
659
- };
660
- var panelProperties = {
661
- teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
662
- titleEnabled: title.settings && toggle(title.label),
663
- promptEnabled: prompt.settings && toggle(prompt.label),
664
- rationaleEnabled: rationale.settings && toggle(rationale.label),
665
- spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label)
666
- };
667
-
668
- var getPluginProps = function getPluginProps() {
669
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
670
- return _objectSpread(_objectSpread({}, baseInputConfiguration), props);
671
- };
672
-
673
- return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
674
- extraCSSRules: extraCSSRules,
675
- dimensions: contentDimensions,
676
- hideSettings: settingsPanelDisabled,
677
- settings: /*#__PURE__*/_react["default"].createElement(Panel, {
678
- model: model,
679
- configuration: configuration,
680
- onChangeModel: _onChange,
681
- onChangeConfiguration: onConfigurationChanged,
682
- groups: {
683
- Properties: panelProperties
684
- }
685
- })
686
- }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
687
- component: "div",
688
- type: "body1",
689
- className: classes.description
690
- }, instruction.label), teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
691
- label: teacherInstructions.label,
692
- className: classes.promptContainer
693
- }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
694
- className: classes.teacherInstructions,
695
- markup: model.teacherInstructions || '',
696
- onChange: function onChange(teacherInstructions) {
697
- return _onChange({
698
- teacherInstructions: teacherInstructions
699
- });
700
- },
701
- nonEmpty: false,
702
- disableUnderline: true,
703
- error: teacherInstructionsError,
704
- toolbarOpts: toolbarOpts,
705
- pluginProps: getPluginProps(teacherInstructions === null || teacherInstructions === void 0 ? void 0 : teacherInstructions.inputConfiguration),
706
- spellCheck: spellCheckEnabled,
707
- imageSupport: imageSupport,
708
- uploadSoundSupport: uploadSoundSupport,
709
- languageCharactersProps: [{
710
- language: 'spanish'
711
- }, {
712
- language: 'special'
713
- }],
714
- mathMlOptions: mathMlOptions
715
- }), teacherInstructionsError && /*#__PURE__*/_react["default"].createElement("div", {
716
- className: classes.errorText
717
- }, teacherInstructionsError)), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
718
- label: prompt.label,
719
- className: classes.promptContainer
720
- }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
721
- className: classes.prompt,
722
- markup: model.prompt || '',
723
- onChange: function onChange(prompt) {
724
- return _onChange({
725
- prompt: prompt
726
- });
727
- },
728
- nonEmpty: false,
729
- disableUnderline: true,
730
- error: promptError,
731
- toolbarOpts: toolbarOpts,
732
- pluginProps: getPluginProps(prompt === null || prompt === void 0 ? void 0 : prompt.inputConfiguration),
733
- spellCheck: spellCheckEnabled,
734
- imageSupport: imageSupport,
735
- uploadSoundSupport: uploadSoundSupport,
736
- languageCharactersProps: [{
737
- language: 'spanish'
738
- }, {
739
- language: 'special'
740
- }],
741
- mathMlOptions: mathMlOptions
742
- }), promptError && /*#__PURE__*/_react["default"].createElement("div", {
743
- className: classes.errorText
744
- }, promptError)), /*#__PURE__*/_react["default"].createElement(_cardBar["default"], {
745
- header: "Set Up Number Line",
746
- info: /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
747
- classes: {
748
- tooltip: classes.tooltip
749
- },
750
- disableFocusListener: true,
751
- disableTouchListener: true,
752
- placement: 'right',
753
- title: validationMessage
754
- }, /*#__PURE__*/_react["default"].createElement(_Info["default"], {
755
- fontSize: 'small',
756
- color: 'primary',
757
- style: {
758
- marginLeft: '8px'
497
+ componentDidMount() {
498
+ const {
499
+ configuration,
500
+ model,
501
+ onChange
502
+ } = this.props;
503
+ const {
504
+ title
505
+ } = configuration || {};
506
+ const {
507
+ titleEnabled: showTitle
508
+ } = model || {};
509
+ const titleEnabled = showTitle === undefined || showTitle === null ? title.enabled : showTitle;
510
+ onChange && onChange({
511
+ ...model,
512
+ titleEnabled
513
+ });
514
+ }
515
+ render() {
516
+ const {
517
+ model,
518
+ onChange,
519
+ configuration,
520
+ onConfigurationChanged,
521
+ uploadSoundSupport,
522
+ imageSupport
523
+ } = this.props;
524
+ const {
525
+ baseInputConfiguration = {},
526
+ contentDimensions = {},
527
+ instruction = {},
528
+ teacherInstructions = {},
529
+ title = {},
530
+ prompt = {},
531
+ rationale = {},
532
+ spellCheck = {},
533
+ mathMlOptions = {},
534
+ numberLineDimensions = {},
535
+ maxMaxElements = 20,
536
+ hidePointConfigButtons = false,
537
+ availableTools = ['PF'],
538
+ settingsPanelDisabled = false
539
+ } = configuration || {};
540
+ const {
541
+ errors = {},
542
+ extraCSSRules,
543
+ spellCheckEnabled,
544
+ toolbarEditorPosition,
545
+ teacherInstructionsEnabled,
546
+ titleEnabled,
547
+ promptEnabled,
548
+ rationaleEnabled
549
+ } = model || {};
550
+ let {
551
+ graph
552
+ } = model;
553
+ graph = this.reloadTicksData(graph);
554
+ const {
555
+ dialog,
556
+ correctAnswerDialog
557
+ } = this.state;
558
+ const {
559
+ correctResponseError,
560
+ domainError,
561
+ maxError,
562
+ pointsError,
563
+ prompt: promptError,
564
+ rationale: rationaleError,
565
+ teacherInstructions: teacherInstructionsError,
566
+ widthError
567
+ } = errors || {};
568
+ const validationMessage = (0, _utils.generateValidationMessage)();
569
+ const correctResponse = (0, _cloneDeep.default)(model.correctResponse || []).map(toGraphFormat);
570
+ const initialModel = (0, _cloneDeep.default)(model);
571
+ initialModel['disabled'] = true;
572
+ const toolbarOpts = {
573
+ position: toolbarEditorPosition === 'top' ? 'top' : 'bottom'
574
+ };
575
+ const panelProperties = {
576
+ teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
577
+ titleEnabled: title.settings && toggle(title.label),
578
+ promptEnabled: prompt.settings && toggle(prompt.label),
579
+ rationaleEnabled: rationale.settings && toggle(rationale.label),
580
+ spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label)
581
+ };
582
+ const getPluginProps = (props = {}) => ({
583
+ ...baseInputConfiguration,
584
+ ...props
585
+ });
586
+ return /*#__PURE__*/_react.default.createElement(_configUi.layout.ConfigLayout, {
587
+ extraCSSRules: extraCSSRules,
588
+ dimensions: contentDimensions,
589
+ hideSettings: settingsPanelDisabled,
590
+ settings: /*#__PURE__*/_react.default.createElement(Panel, {
591
+ model: model,
592
+ configuration: configuration,
593
+ onChangeModel: onChange,
594
+ onChangeConfiguration: onConfigurationChanged,
595
+ groups: {
596
+ Properties: panelProperties
597
+ }
598
+ })
599
+ }, /*#__PURE__*/_react.default.createElement(Description, {
600
+ component: "div",
601
+ type: "body1"
602
+ }, instruction.label), teacherInstructionsEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
603
+ label: teacherInstructions.label
604
+ }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
605
+ markup: model.teacherInstructions || '',
606
+ onChange: teacherInstructions => onChange({
607
+ teacherInstructions
608
+ }),
609
+ nonEmpty: false,
610
+ disableUnderline: true,
611
+ error: teacherInstructionsError,
612
+ toolbarOpts: toolbarOpts,
613
+ pluginProps: getPluginProps(teacherInstructions?.inputConfiguration),
614
+ spellCheck: spellCheckEnabled,
615
+ imageSupport: imageSupport,
616
+ uploadSoundSupport: uploadSoundSupport,
617
+ languageCharactersProps: [{
618
+ language: 'spanish'
619
+ }, {
620
+ language: 'special'
621
+ }],
622
+ mathMlOptions: mathMlOptions
623
+ }), teacherInstructionsError && /*#__PURE__*/_react.default.createElement(ErrorText, null, teacherInstructionsError)), promptEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
624
+ label: prompt.label
625
+ }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
626
+ markup: model.prompt || '',
627
+ onChange: prompt => onChange({
628
+ prompt
629
+ }),
630
+ nonEmpty: false,
631
+ disableUnderline: true,
632
+ error: promptError,
633
+ toolbarOpts: toolbarOpts,
634
+ pluginProps: getPluginProps(prompt?.inputConfiguration),
635
+ spellCheck: spellCheckEnabled,
636
+ imageSupport: imageSupport,
637
+ uploadSoundSupport: uploadSoundSupport,
638
+ languageCharactersProps: [{
639
+ language: 'spanish'
640
+ }, {
641
+ language: 'special'
642
+ }],
643
+ mathMlOptions: mathMlOptions
644
+ }), promptError && /*#__PURE__*/_react.default.createElement(ErrorText, null, promptError)), /*#__PURE__*/_react.default.createElement(_cardBar.default, {
645
+ header: "Set Up Number Line",
646
+ info: /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
647
+ disableFocusListener: true,
648
+ disableTouchListener: true,
649
+ placement: 'right',
650
+ title: validationMessage,
651
+ slotProps: {
652
+ tooltip: {
653
+ sx: theme => ({
654
+ fontSize: theme.typography.fontSize - 2,
655
+ whiteSpace: 'pre',
656
+ maxWidth: '500px'
657
+ })
759
658
  }
760
- }))
761
- }, "Set up the number line by entering the domain and number of tick marks to display. Labels on the number line can be edited or removed by clicking on the label."), /*#__PURE__*/_react["default"].createElement("div", {
762
- className: classes.row
763
- }, /*#__PURE__*/_react["default"].createElement(_domain["default"], {
764
- domain: graph.domain,
765
- errors: errors,
766
- onChange: function onChange(domain) {
767
- return _this2.graphChange({
768
- domain: domain
769
- });
770
659
  }
771
- })), maxError && /*#__PURE__*/_react["default"].createElement("div", {
772
- className: classes.errorText
773
- }, maxError), domainError && /*#__PURE__*/_react["default"].createElement("div", {
774
- className: classes.errorText
775
- }, domainError), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_configUi.FormSection, null, /*#__PURE__*/_react["default"].createElement(_ticks["default"], {
776
- ticks: graph.ticks,
777
- minorLimits: minorLimits,
778
- minorValues: minorValues,
779
- majorValues: majorValues,
780
- onChange: this.changeTicks
781
- }))), /*#__PURE__*/_react["default"].createElement("div", {
782
- className: classes.flexRow
783
- }, model.widthEnabled && /*#__PURE__*/_react["default"].createElement(_size["default"], {
784
- size: graph,
785
- min: numberLineDimensions.min,
786
- max: numberLineDimensions.max,
787
- step: numberLineDimensions.step,
788
- onChange: this.changeSize
789
- }), /*#__PURE__*/_react["default"].createElement("div", null), /*#__PURE__*/_react["default"].createElement(_arrows["default"], {
790
- arrows: graph.arrows,
791
- onChange: this.changeArrows
792
- })), widthError && /*#__PURE__*/_react["default"].createElement("div", {
793
- className: classes.errorText
794
- }, widthError), /*#__PURE__*/_react["default"].createElement(_numberLine.NumberLineComponent, {
795
- onMoveElement: function onMoveElement() {},
796
- onDeleteElements: function onDeleteElements() {},
797
- onAddElement: function onAddElement() {},
798
- onClearElements: function onClearElements() {},
799
- onUndoElement: function onUndoElement() {},
800
- minWidth: numberLineDimensions.min,
801
- maxWidth: numberLineDimensions.max,
802
- maxHeight: 70,
803
- model: trimModel(initialModel)
804
- }), titleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.FormSection, {
805
- label: (title === null || title === void 0 ? void 0 : title.label) || 'Title',
806
- className: classes.title
807
- }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
808
- markup: graph.title || '',
809
- onChange: this.changeGraphTitle,
810
- toolbarOpts: toolbarOpts,
811
- activePlugins: ['bold', 'html', 'italic', 'underline', 'strikethrough', 'image', 'math', 'languageCharacters', 'responseArea'],
812
- pluginProps: getPluginProps(title === null || title === void 0 ? void 0 : title.inputConfiguration),
813
- spellCheck: spellCheckEnabled,
814
- imageSupport: imageSupport,
815
- uploadSoundSupport: uploadSoundSupport,
816
- languageCharactersProps: [{
817
- language: 'spanish'
818
- }, {
819
- language: 'special'
820
- }],
821
- mathMlOptions: mathMlOptions
822
- })), !graph.exhibitOnly && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_cardBar["default"], {
823
- header: "Define Tool Set and Correct Response"
824
- }, "Select answer type and place it on the number line. Intersecting points, line segments and/or rays will appear above the number line. ", /*#__PURE__*/_react["default"].createElement("i", null, "Note: A maximum of 20 points, line segments or rays may be plotted.")), /*#__PURE__*/_react["default"].createElement(_cardBar["default"], {
825
- header: "Available Tools",
826
- mini: true
827
- }, "Click on the input options to be displayed to the students. All inputs will display by default."), /*#__PURE__*/_react["default"].createElement("div", {
828
- className: classes.pointTypeChooser
829
- }, /*#__PURE__*/_react["default"].createElement(_pointConfig["default"], {
830
- onSelectionChange: this.availableTypesChange,
831
- selection: graph.availableTypes,
832
- availableTools: availableTools,
833
- hideButtons: hidePointConfigButtons
834
- })), /*#__PURE__*/_react["default"].createElement(_configUi.FormSection, {
835
- className: classes.flexRow
836
- }, /*#__PURE__*/_react["default"].createElement("label", null, "Max No of Elements"), /*#__PURE__*/_react["default"].createElement(_numberTextField["default"], {
837
- className: classes.maxNumberOfPoints,
838
- min: 1,
839
- max: maxMaxElements,
840
- onlyIntegersAllowed: true,
841
- value: graph.maxNumberOfPoints,
842
- onChange: this.changeMaxNoOfPoints
843
- }), pointsError && /*#__PURE__*/_react["default"].createElement("div", {
844
- className: classes.errorText
845
- }, pointsError)), /*#__PURE__*/_react["default"].createElement("label", null, "Correct Answer"), /*#__PURE__*/_react["default"].createElement(_numberLine.NumberLineComponent, {
846
- onMoveElement: this.moveCorrectResponse,
847
- onDeleteElements: this.deleteCorrectResponse,
848
- onAddElement: this.addCorrectResponse,
849
- onClearElements: this.clearCorrectResponse,
850
- onUndoElement: this.undoCorrectResponse,
851
- minWidth: numberLineDimensions.min,
852
- maxWidth: numberLineDimensions.max,
853
- answer: correctResponse //strip feedback for this model
854
- ,
855
- model: trimModel(model)
856
- }), correctResponseError && /*#__PURE__*/_react["default"].createElement("div", {
857
- className: classes.errorText
858
- }, correctResponseError)), /*#__PURE__*/_react["default"].createElement(_configUi.AlertDialog, {
859
- open: dialog.open,
860
- title: "Warning",
861
- text: dialog.text,
862
- onConfirm: function onConfirm() {
863
- return _this2.setState({
864
- dialog: {
865
- open: false
866
- }
867
- });
660
+ }, /*#__PURE__*/_react.default.createElement(_Info.default, {
661
+ fontSize: 'small',
662
+ color: 'primary',
663
+ style: {
664
+ marginLeft: '8px'
868
665
  }
869
- }), /*#__PURE__*/_react["default"].createElement(_configUi.AlertDialog, {
870
- open: correctAnswerDialog.open,
871
- title: "Warning",
872
- text: correctAnswerDialog.text,
873
- onConfirm: function onConfirm() {
874
- var indices = _this2.state.correctAnswerDialog.indices;
875
-
876
- if (indices && indices.length > 0) {
877
- _this2.deleteCorrectResponse(indices);
666
+ }))
667
+ }, "Set up the number line by entering the domain and number of tick marks to display. Labels on the number line can be edited or removed by clicking on the label."), /*#__PURE__*/_react.default.createElement(Row, null, /*#__PURE__*/_react.default.createElement(_domain.default, {
668
+ domain: graph.domain,
669
+ errors: errors,
670
+ onChange: domain => this.graphChange({
671
+ domain
672
+ })
673
+ })), maxError && /*#__PURE__*/_react.default.createElement(ErrorText, null, maxError), domainError && /*#__PURE__*/_react.default.createElement(ErrorText, null, domainError), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_configUi.FormSection, null, /*#__PURE__*/_react.default.createElement(_ticks.default, {
674
+ ticks: graph.ticks,
675
+ minorLimits: minorLimits,
676
+ minorValues: minorValues,
677
+ majorValues: majorValues,
678
+ onChange: this.changeTicks
679
+ }))), /*#__PURE__*/_react.default.createElement(FlexRow, null, model.widthEnabled && /*#__PURE__*/_react.default.createElement(_size.default, {
680
+ size: graph,
681
+ min: numberLineDimensions.min,
682
+ max: numberLineDimensions.max,
683
+ step: numberLineDimensions.step,
684
+ onChange: this.changeSize
685
+ }), /*#__PURE__*/_react.default.createElement("div", null), /*#__PURE__*/_react.default.createElement(_arrows.default, {
686
+ arrows: graph.arrows,
687
+ onChange: this.changeArrows
688
+ })), widthError && /*#__PURE__*/_react.default.createElement(ErrorText, null, widthError), /*#__PURE__*/_react.default.createElement(_numberLine.NumberLineComponent, {
689
+ onMoveElement: () => {},
690
+ onDeleteElements: () => {},
691
+ onAddElement: () => {},
692
+ onClearElements: () => {},
693
+ onUndoElement: () => {},
694
+ minWidth: numberLineDimensions.min,
695
+ maxWidth: numberLineDimensions.max,
696
+ maxHeight: 70,
697
+ model: trimModel(initialModel)
698
+ }), titleEnabled && /*#__PURE__*/_react.default.createElement(StyledFormSection, {
699
+ label: title?.label || 'Title'
700
+ }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
701
+ markup: graph.title || '',
702
+ onChange: this.changeGraphTitle,
703
+ toolbarOpts: toolbarOpts,
704
+ activePlugins: ['bold', 'html', 'italic', 'underline', 'strikethrough', 'image', 'math', 'languageCharacters', 'responseArea'],
705
+ pluginProps: getPluginProps(title?.inputConfiguration),
706
+ spellCheck: spellCheckEnabled,
707
+ imageSupport: imageSupport,
708
+ uploadSoundSupport: uploadSoundSupport,
709
+ languageCharactersProps: [{
710
+ language: 'spanish'
711
+ }, {
712
+ language: 'special'
713
+ }],
714
+ mathMlOptions: mathMlOptions
715
+ })), !graph.exhibitOnly && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_cardBar.default, {
716
+ header: "Define Tool Set and Correct Response"
717
+ }, "Select answer type and place it on the number line. Intersecting points, line segments and/or rays will appear above the number line. ", /*#__PURE__*/_react.default.createElement("i", null, "Note: A maximum of 20 points, line segments or rays may be plotted.")), /*#__PURE__*/_react.default.createElement(_cardBar.default, {
718
+ header: "Available Tools",
719
+ mini: true
720
+ }, "Click on the input options to be displayed to the students. All inputs will display by default."), /*#__PURE__*/_react.default.createElement(PointTypeChooser, null, /*#__PURE__*/_react.default.createElement(_pointConfig.default, {
721
+ onSelectionChange: this.availableTypesChange,
722
+ selection: graph.availableTypes,
723
+ availableTools: availableTools,
724
+ hideButtons: hidePointConfigButtons
725
+ })), /*#__PURE__*/_react.default.createElement(FlexRowFormSection, null, /*#__PURE__*/_react.default.createElement("label", null, "Max No of Elements"), /*#__PURE__*/_react.default.createElement(StyledNumberTextField, {
726
+ min: 1,
727
+ max: maxMaxElements,
728
+ onlyIntegersAllowed: true,
729
+ value: graph.maxNumberOfPoints,
730
+ onChange: this.changeMaxNoOfPoints
731
+ }), pointsError && /*#__PURE__*/_react.default.createElement(ErrorText, null, pointsError)), /*#__PURE__*/_react.default.createElement("label", null, "Correct Answer"), /*#__PURE__*/_react.default.createElement(_numberLine.NumberLineComponent, {
732
+ onMoveElement: this.moveCorrectResponse,
733
+ onDeleteElements: this.deleteCorrectResponse,
734
+ onAddElement: this.addCorrectResponse,
735
+ onClearElements: this.clearCorrectResponse,
736
+ onUndoElement: this.undoCorrectResponse,
737
+ minWidth: numberLineDimensions.min,
738
+ maxWidth: numberLineDimensions.max,
739
+ answer: correctResponse
740
+ //strip feedback for this model
741
+ ,
742
+ model: trimModel(model)
743
+ }), correctResponseError && /*#__PURE__*/_react.default.createElement(ErrorText, null, correctResponseError)), /*#__PURE__*/_react.default.createElement(_configUi.AlertDialog, {
744
+ open: dialog.open,
745
+ title: "Warning",
746
+ text: dialog.text,
747
+ onConfirm: () => this.setState({
748
+ dialog: {
749
+ open: false
750
+ }
751
+ })
752
+ }), /*#__PURE__*/_react.default.createElement(_configUi.AlertDialog, {
753
+ open: correctAnswerDialog.open,
754
+ title: "Warning",
755
+ text: correctAnswerDialog.text,
756
+ onConfirm: () => {
757
+ let indices = this.state.correctAnswerDialog.indices;
758
+ if (indices && indices.length > 0) {
759
+ this.deleteCorrectResponse(indices);
760
+ }
761
+ this.setState({
762
+ correctAnswerDialog: {
763
+ open: false
878
764
  }
879
-
880
- _this2.setState({
881
- correctAnswerDialog: {
882
- open: false
883
- }
884
- });
885
- },
886
- onClose: function onClose() {
887
- var graph = _this2.state.correctAnswerDialog.graph;
888
-
889
- _onChange({
890
- graph: graph
891
- });
892
-
893
- _this2.setState({
894
- correctAnswerDialog: {
895
- open: false
896
- }
897
- });
898
- },
899
- onConfirmText: 'OK',
900
- onCloseText: 'Cancel'
901
- }), rationaleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
902
- label: rationale.label || 'Rationale',
903
- className: classes.promptContainer
904
- }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
905
- className: classes.prompt,
906
- markup: model.rationale || '',
907
- onChange: function onChange(rationale) {
908
- return _onChange({
909
- rationale: rationale
910
- });
911
- },
912
- error: rationaleError,
913
- toolbarOpts: toolbarOpts,
914
- spellCheck: spellCheckEnabled,
915
- pluginProps: getPluginProps(rationale === null || rationale === void 0 ? void 0 : rationale.inputConfiguration),
916
- imageSupport: imageSupport,
917
- uploadSoundSupport: uploadSoundSupport,
918
- languageCharactersProps: [{
919
- language: 'spanish'
920
- }, {
921
- language: 'special'
922
- }],
923
- mathMlOptions: mathMlOptions
924
- }), rationaleError && /*#__PURE__*/_react["default"].createElement("div", {
925
- className: classes.errorText
926
- }, rationaleError)));
927
- }
928
- }]);
929
- return Main;
930
- }(_react["default"].Component);
931
-
765
+ });
766
+ },
767
+ onClose: () => {
768
+ const graph = this.state.correctAnswerDialog.graph;
769
+ onChange({
770
+ graph
771
+ });
772
+ this.setState({
773
+ correctAnswerDialog: {
774
+ open: false
775
+ }
776
+ });
777
+ },
778
+ onConfirmText: 'OK',
779
+ onCloseText: 'Cancel'
780
+ }), rationaleEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
781
+ label: rationale.label || 'Rationale'
782
+ }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
783
+ markup: model.rationale || '',
784
+ onChange: rationale => onChange({
785
+ rationale
786
+ }),
787
+ error: rationaleError,
788
+ toolbarOpts: toolbarOpts,
789
+ spellCheck: spellCheckEnabled,
790
+ pluginProps: getPluginProps(rationale?.inputConfiguration),
791
+ imageSupport: imageSupport,
792
+ uploadSoundSupport: uploadSoundSupport,
793
+ languageCharactersProps: [{
794
+ language: 'spanish'
795
+ }, {
796
+ language: 'special'
797
+ }],
798
+ mathMlOptions: mathMlOptions
799
+ }), rationaleError && /*#__PURE__*/_react.default.createElement(ErrorText, null, rationaleError)));
800
+ }
801
+ }
932
802
  exports.Main = Main;
933
- (0, _defineProperty2["default"])(Main, "propTypes", {
934
- classes: _propTypes["default"].object.isRequired,
935
- model: _propTypes["default"].object.isRequired,
936
- configuration: _propTypes["default"].object.isRequired,
937
- onConfigurationChanged: _propTypes["default"].func.isRequired,
938
- onChange: _propTypes["default"].func.isRequired,
939
- imageSupport: _propTypes["default"].object.isRequired,
940
- uploadSoundSupport: _propTypes["default"].object.isRequired
803
+ (0, _defineProperty2.default)(Main, "propTypes", {
804
+ model: _propTypes.default.object.isRequired,
805
+ configuration: _propTypes.default.object.isRequired,
806
+ onConfigurationChanged: _propTypes.default.func.isRequired,
807
+ onChange: _propTypes.default.func.isRequired,
808
+ imageSupport: _propTypes.default.object.isRequired,
809
+ uploadSoundSupport: _propTypes.default.object.isRequired
941
810
  });
942
-
943
- var _default = (0, _styles.withStyles)(styles, {
944
- name: 'Main'
945
- })(Main);
946
-
947
- exports["default"] = _default;
811
+ var _default = exports.default = Main;
948
812
  //# sourceMappingURL=main.js.map