@pie-element/graphing 5.5.1-next.42 → 5.5.1-next.43

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.
@@ -0,0 +1,392 @@
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"] = exports.Configure = 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 _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
+
24
+ var _react = _interopRequireDefault(require("react"));
25
+
26
+ var _styles = require("@material-ui/core/styles");
27
+
28
+ var _configUi = require("@pie-lib/pie-toolbox/config-ui");
29
+
30
+ var _propTypes = _interopRequireDefault(require("prop-types"));
31
+
32
+ var _debug = _interopRequireDefault(require("debug"));
33
+
34
+ var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
35
+
36
+ var _editableHtml = require("@pie-lib/pie-toolbox/editable-html");
37
+
38
+ var _graphingConfig = _interopRequireDefault(require("./graphing-config"));
39
+
40
+ var _correctResponse = _interopRequireDefault(require("./correct-response"));
41
+
42
+ var _intersection = _interopRequireDefault(require("lodash/intersection"));
43
+
44
+ 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; }
45
+
46
+ 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; }
47
+
48
+ 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); }; }
49
+
50
+ 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; } }
51
+
52
+ var Panel = _configUi.settings.Panel,
53
+ toggle = _configUi.settings.toggle,
54
+ radio = _configUi.settings.radio,
55
+ checkboxes = _configUi.settings.checkboxes,
56
+ textField = _configUi.settings.textField,
57
+ dropdown = _configUi.settings.dropdown;
58
+ var log = (0, _debug["default"])('@pie-element:graphing:configure');
59
+
60
+ var styles = function styles(theme) {
61
+ return {
62
+ title: {
63
+ fontSize: '1.1rem',
64
+ display: 'block',
65
+ marginTop: theme.spacing.unit * 2,
66
+ marginBottom: theme.spacing.unit
67
+ },
68
+ promptHolder: {
69
+ width: '100%',
70
+ paddingTop: theme.spacing.unit * 2,
71
+ marginBottom: theme.spacing.unit * 2
72
+ },
73
+ description: {
74
+ marginBottom: theme.spacing.unit * 2.5
75
+ }
76
+ };
77
+ };
78
+
79
+ var Configure = /*#__PURE__*/function (_React$Component) {
80
+ (0, _inherits2["default"])(Configure, _React$Component);
81
+
82
+ var _super = _createSuper(Configure);
83
+
84
+ function Configure() {
85
+ var _this;
86
+
87
+ (0, _classCallCheck2["default"])(this, Configure);
88
+
89
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
90
+ args[_key] = arguments[_key];
91
+ }
92
+
93
+ _this = _super.call.apply(_super, [this].concat(args));
94
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRationaleChange", function (rationale) {
95
+ var _this$props = _this.props,
96
+ onModelChanged = _this$props.onModelChanged,
97
+ model = _this$props.model;
98
+ onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
99
+ rationale: rationale
100
+ }));
101
+ });
102
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onPromptChange", function (prompt) {
103
+ var _this$props2 = _this.props,
104
+ onModelChanged = _this$props2.onModelChanged,
105
+ model = _this$props2.model;
106
+ onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
107
+ prompt: prompt
108
+ }));
109
+ });
110
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onTeacherInstructionsChange", function (teacherInstructions) {
111
+ var _this$props3 = _this.props,
112
+ onModelChanged = _this$props3.onModelChanged,
113
+ model = _this$props3.model;
114
+ onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
115
+ teacherInstructions: teacherInstructions
116
+ }));
117
+ });
118
+ return _this;
119
+ }
120
+
121
+ (0, _createClass2["default"])(Configure, [{
122
+ key: "componentDidMount",
123
+ value: function componentDidMount() {
124
+ var _this$props4 = this.props,
125
+ configuration = _this$props4.configuration,
126
+ onModelChanged = _this$props4.onModelChanged,
127
+ model = _this$props4.model;
128
+
129
+ var _ref = configuration || {},
130
+ availableTools = _ref.availableTools,
131
+ title = _ref.title,
132
+ graphDimensions = _ref.graphDimensions;
133
+
134
+ var _ref2 = model || {},
135
+ arrows = _ref2.arrows,
136
+ showTitle = _ref2.titleEnabled,
137
+ showDimensions = _ref2.dimensionsEnabled; // This is used for offering support for old models which have the property arrows: boolean
138
+ // Same thing is set in the controller: packages/graphing/controller/src/index.js - model
139
+
140
+
141
+ if (typeof arrows === 'boolean') {
142
+ if (arrows) {
143
+ arrows = {
144
+ left: true,
145
+ right: true,
146
+ up: true,
147
+ down: true
148
+ };
149
+ } else {
150
+ arrows = {
151
+ left: false,
152
+ right: false,
153
+ up: false,
154
+ down: false
155
+ };
156
+ }
157
+ }
158
+
159
+ var toolbarTools = (0, _intersection["default"])(availableTools || [], model.toolbarTools || []);
160
+ var titleEnabled = showTitle === undefined || showTitle === null ? title.enabled : showTitle;
161
+ var dimensionsEnabled = showDimensions === undefined || showDimensions === null ? graphDimensions.enabled : showDimensions;
162
+ onModelChanged && onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
163
+ arrows: arrows,
164
+ toolbarTools: toolbarTools,
165
+ titleEnabled: titleEnabled,
166
+ dimensionsEnabled: dimensionsEnabled
167
+ }));
168
+ }
169
+ }, {
170
+ key: "render",
171
+ value: function render() {
172
+ var _this$props5 = this.props,
173
+ classes = _this$props5.classes,
174
+ model = _this$props5.model,
175
+ configuration = _this$props5.configuration,
176
+ onConfigurationChanged = _this$props5.onConfigurationChanged,
177
+ onModelChanged = _this$props5.onModelChanged,
178
+ imageSupport = _this$props5.imageSupport,
179
+ uploadSoundSupport = _this$props5.uploadSoundSupport;
180
+
181
+ var _ref3 = configuration || {},
182
+ _ref3$arrows = _ref3.arrows,
183
+ arrows = _ref3$arrows === void 0 ? {} : _ref3$arrows,
184
+ _ref3$authoring = _ref3.authoring,
185
+ authoring = _ref3$authoring === void 0 ? {} : _ref3$authoring,
186
+ _ref3$availableTools = _ref3.availableTools,
187
+ availableTools = _ref3$availableTools === void 0 ? [] : _ref3$availableTools,
188
+ _ref3$coordinatesOnHo = _ref3.coordinatesOnHover,
189
+ coordinatesOnHover = _ref3$coordinatesOnHo === void 0 ? {} : _ref3$coordinatesOnHo,
190
+ _ref3$contentDimensio = _ref3.contentDimensions,
191
+ contentDimensions = _ref3$contentDimensio === void 0 ? {} : _ref3$contentDimensio,
192
+ _ref3$gridConfigurati = _ref3.gridConfigurations,
193
+ gridConfigurations = _ref3$gridConfigurati === void 0 ? [] : _ref3$gridConfigurati,
194
+ _ref3$graphDimensions = _ref3.graphDimensions,
195
+ graphDimensions = _ref3$graphDimensions === void 0 ? {} : _ref3$graphDimensions,
196
+ _ref3$instruction = _ref3.instruction,
197
+ instruction = _ref3$instruction === void 0 ? {} : _ref3$instruction,
198
+ _ref3$labels = _ref3.labels,
199
+ labels = _ref3$labels === void 0 ? {} : _ref3$labels,
200
+ _ref3$padding = _ref3.padding,
201
+ padding = _ref3$padding === void 0 ? {} : _ref3$padding,
202
+ _ref3$prompt = _ref3.prompt,
203
+ prompt = _ref3$prompt === void 0 ? {} : _ref3$prompt,
204
+ _ref3$rationale = _ref3.rationale,
205
+ rationale = _ref3$rationale === void 0 ? {} : _ref3$rationale,
206
+ _ref3$scoringType = _ref3.scoringType,
207
+ scoringType = _ref3$scoringType === void 0 ? {} : _ref3$scoringType,
208
+ settingsPanelDisabled = _ref3.settingsPanelDisabled,
209
+ _ref3$spellCheck = _ref3.spellCheck,
210
+ spellCheck = _ref3$spellCheck === void 0 ? {} : _ref3$spellCheck,
211
+ _ref3$studentInstruct = _ref3.studentInstructions,
212
+ studentInstructions = _ref3$studentInstruct === void 0 ? {} : _ref3$studentInstruct,
213
+ _ref3$teacherInstruct = _ref3.teacherInstructions,
214
+ teacherInstructions = _ref3$teacherInstruct === void 0 ? {} : _ref3$teacherInstruct,
215
+ _ref3$title = _ref3.title,
216
+ title = _ref3$title === void 0 ? {} : _ref3$title,
217
+ _ref3$maxImageWidth = _ref3.maxImageWidth,
218
+ maxImageWidth = _ref3$maxImageWidth === void 0 ? {} : _ref3$maxImageWidth,
219
+ _ref3$maxImageHeight = _ref3.maxImageHeight,
220
+ maxImageHeight = _ref3$maxImageHeight === void 0 ? {} : _ref3$maxImageHeight,
221
+ _ref3$withRubric = _ref3.withRubric,
222
+ withRubric = _ref3$withRubric === void 0 ? {} : _ref3$withRubric,
223
+ _ref3$language = _ref3.language,
224
+ language = _ref3$language === void 0 ? {} : _ref3$language,
225
+ _ref3$languageChoices = _ref3.languageChoices,
226
+ languageChoices = _ref3$languageChoices === void 0 ? {} : _ref3$languageChoices,
227
+ _ref3$mathMlOptions = _ref3.mathMlOptions,
228
+ mathMlOptions = _ref3$mathMlOptions === void 0 ? {} : _ref3$mathMlOptions;
229
+
230
+ var _ref4 = model || {},
231
+ _ref4$errors = _ref4.errors,
232
+ errors = _ref4$errors === void 0 ? {} : _ref4$errors,
233
+ labelsEnabled = _ref4.labelsEnabled,
234
+ dimensionsEnabled = _ref4.dimensionsEnabled,
235
+ promptEnabled = _ref4.promptEnabled,
236
+ rationaleEnabled = _ref4.rationaleEnabled,
237
+ spellCheckEnabled = _ref4.spellCheckEnabled,
238
+ teacherInstructionsEnabled = _ref4.teacherInstructionsEnabled,
239
+ titleEnabled = _ref4.titleEnabled;
240
+
241
+ log('[render] model', model);
242
+ var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
243
+ var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
244
+ var labelsPlaceholders = {
245
+ top: labels.top,
246
+ right: labels.right,
247
+ bottom: labels.bottom,
248
+ left: labels.left
249
+ };
250
+ var panelItemType = {
251
+ arrows: arrows.settings && checkboxes(arrows.label, {
252
+ left: arrows.left,
253
+ right: arrows.right,
254
+ up: arrows.up,
255
+ down: arrows.down
256
+ }),
257
+ titleEnabled: title.settings && toggle(title.label),
258
+ padding: padding.settings && toggle(padding.label),
259
+ labelsEnabled: labels.settings && toggle(labels.label),
260
+ 'language.enabled': language.settings && toggle(language.label, true),
261
+ language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),
262
+ dimensionsEnabled: graphDimensions.settings && toggle(graphDimensions.label),
263
+ coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label)
264
+ };
265
+ var panelProperties = {
266
+ 'authoring.enabled': authoring.settings && toggle(authoring.label, true),
267
+ teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
268
+ studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
269
+ promptEnabled: prompt.settings && toggle(prompt.label),
270
+ rationaleEnabled: rationale.settings && toggle(rationale.label),
271
+ spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
272
+ scoringType: scoringType.settings && radio(scoringType.label, ['dichotomous', 'partial scoring']),
273
+ rubricEnabled: (withRubric === null || withRubric === void 0 ? void 0 : withRubric.settings) && toggle(withRubric === null || withRubric === void 0 ? void 0 : withRubric.label),
274
+ instruction: instruction.settings && textField(instruction.label)
275
+ };
276
+ return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
277
+ dimensions: contentDimensions,
278
+ hideSettings: settingsPanelDisabled,
279
+ settings: /*#__PURE__*/_react["default"].createElement(Panel, {
280
+ model: model,
281
+ configuration: configuration,
282
+ onChangeModel: onModelChanged,
283
+ onChangeConfiguration: onConfigurationChanged,
284
+ groups: {
285
+ Settings: panelItemType,
286
+ Properties: panelProperties
287
+ }
288
+ })
289
+ }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
290
+ component: "div",
291
+ type: "body1",
292
+ className: classes.description
293
+ }, (instruction === null || instruction === void 0 ? void 0 : instruction.label) || ''), teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
294
+ label: teacherInstructions.label,
295
+ className: classes.promptHolder
296
+ }, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
297
+ className: classes.prompt,
298
+ markup: model.teacherInstructions || '',
299
+ onChange: this.onTeacherInstructionsChange,
300
+ imageSupport: imageSupport,
301
+ nonEmpty: false,
302
+ spellCheck: spellCheckEnabled,
303
+ maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
304
+ maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
305
+ uploadSoundSupport: uploadSoundSupport,
306
+ languageCharactersProps: [{
307
+ language: 'spanish'
308
+ }, {
309
+ language: 'special'
310
+ }],
311
+ mathMlOptions: mathMlOptions
312
+ })), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
313
+ label: prompt.label,
314
+ className: classes.promptHolder
315
+ }, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
316
+ className: classes.prompt,
317
+ markup: model.prompt,
318
+ onChange: this.onPromptChange,
319
+ imageSupport: imageSupport,
320
+ nonEmpty: false,
321
+ spellCheck: spellCheckEnabled,
322
+ disableUnderline: true,
323
+ maxImageWidth: defaultImageMaxWidth,
324
+ maxImageHeight: defaultImageMaxHeight,
325
+ uploadSoundSupport: uploadSoundSupport,
326
+ languageCharactersProps: [{
327
+ language: 'spanish'
328
+ }, {
329
+ language: 'special'
330
+ }],
331
+ mathMlOptions: mathMlOptions
332
+ })), /*#__PURE__*/_react["default"].createElement(_graphingConfig["default"], {
333
+ authoring: authoring,
334
+ availableTools: availableTools,
335
+ gridConfigurations: gridConfigurations,
336
+ graphDimensions: graphDimensions,
337
+ labelsPlaceholders: labelsPlaceholders,
338
+ model: model,
339
+ showLabels: labelsEnabled,
340
+ dimensionsEnabled: dimensionsEnabled,
341
+ showTitle: titleEnabled,
342
+ titlePlaceholder: title.placeholder,
343
+ onChange: this.props.onModelChanged,
344
+ mathMlOptions: mathMlOptions
345
+ }), /*#__PURE__*/_react["default"].createElement(_correctResponse["default"], {
346
+ availableTools: availableTools,
347
+ errors: errors,
348
+ model: model,
349
+ onChange: this.props.onModelChanged,
350
+ mathMlOptions: mathMlOptions
351
+ }), rationaleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
352
+ label: rationale.label || 'Rationale',
353
+ className: classes.promptHolder
354
+ }, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
355
+ className: classes.prompt,
356
+ markup: model.rationale || '',
357
+ onChange: this.onRationaleChange,
358
+ imageSupport: imageSupport,
359
+ spellCheck: spellCheckEnabled,
360
+ maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
361
+ maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight,
362
+ uploadSoundSupport: uploadSoundSupport,
363
+ languageCharactersProps: [{
364
+ language: 'spanish'
365
+ }, {
366
+ language: 'special'
367
+ }],
368
+ mathMlOptions: mathMlOptions
369
+ })));
370
+ }
371
+ }]);
372
+ return Configure;
373
+ }(_react["default"].Component);
374
+
375
+ exports.Configure = Configure;
376
+ (0, _defineProperty2["default"])(Configure, "propTypes", {
377
+ onModelChanged: _propTypes["default"].func,
378
+ onConfigurationChanged: _propTypes["default"].func,
379
+ classes: _propTypes["default"].object,
380
+ imageSupport: _propTypes["default"].object,
381
+ uploadSoundSupport: _propTypes["default"].object,
382
+ model: _propTypes["default"].object.isRequired,
383
+ configuration: _propTypes["default"].object.isRequired
384
+ });
385
+ (0, _defineProperty2["default"])(Configure, "defaultProps", {
386
+ classes: {}
387
+ });
388
+
389
+ var _default = (0, _styles.withStyles)(styles)(Configure);
390
+
391
+ exports["default"] = _default;
392
+ //# sourceMappingURL=configure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","checkboxes","textField","dropdown","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","promptHolder","width","paddingTop","description","Configure","rationale","props","onModelChanged","model","prompt","teacherInstructions","configuration","availableTools","graphDimensions","arrows","showTitle","titleEnabled","showDimensions","dimensionsEnabled","left","right","up","down","toolbarTools","undefined","enabled","classes","onConfigurationChanged","imageSupport","uploadSoundSupport","authoring","coordinatesOnHover","contentDimensions","gridConfigurations","instruction","labels","padding","scoringType","settingsPanelDisabled","spellCheck","studentInstructions","maxImageWidth","maxImageHeight","withRubric","language","languageChoices","mathMlOptions","errors","labelsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","defaultImageMaxWidth","defaultImageMaxHeight","labelsPlaceholders","top","bottom","panelItemType","label","options","panelProperties","studentInstructionsEnabled","rubricEnabled","Settings","Properties","onTeacherInstructionsChange","onPromptChange","placeholder","onRationaleChange","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAAkEC,kBAAlE,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAAkED,kBAAlE,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAAkEF,kBAAlE,CAAuBE,KAAvB;AAAA,IAA8BC,UAA9B,GAAkEH,kBAAlE,CAA8BG,UAA9B;AAAA,IAA0CC,SAA1C,GAAkEJ,kBAAlE,CAA0CI,SAA1C;AAAA,IAAqDC,QAArD,GAAkEL,kBAAlE,CAAqDK,QAArD;AACA,IAAMC,GAAG,GAAG,uBAAM,iCAAN,CAAZ;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,KAAK,EAAE;AACLC,MAAAA,QAAQ,EAAE,QADL;AAELC,MAAAA,OAAO,EAAE,OAFJ;AAGLC,MAAAA,SAAS,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB,CAH3B;AAILC,MAAAA,YAAY,EAAEP,KAAK,CAACK,OAAN,CAAcC;AAJvB,KADkB;AAOzBE,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,MADK;AAEZC,MAAAA,UAAU,EAAEV,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB,CAFrB;AAGZC,MAAAA,YAAY,EAAEP,KAAK,CAACK,OAAN,CAA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AHjB;AAIE,QAAA,YAAY,EAAEzC,YAJhB;AAKE,QAAA,UAAU,EAAEuB,iBALd;AAME,QAAA,aAAa,EAAGV,aAAa,IAAIA,aAAa,CAACpC,SAAhC,IAA8CgD,oBAN/D;AAOE,QAAA,cAAc,EAAGX,cAAc,IAAIA,cAAc,CAACrC,SAAlC,IAAgDiD,qBAPlE;AAQE,QAAA,kBAAkB,EAAEzB,kBARtB;AASE,QAAA,uBAAuB,EAAE,CAAC;AAAEe,UAAAA,QAAQ,EAAE;AAAZ,SAAD,EAA0B;AAAEA,UAAAA,QAAQ,EAAE;AAAZ,SAA1B,CAT3B;AAUE,QAAA,aAAa,EAAEE;AAVjB,QADF,CAjFJ,CADF;AAmGD;;;EA1O4BwB,kBAAMC,S;;;iCAAxBnE,S,eACQ;AACjBG,EAAAA,cAAc,EAAEiE,sBAAUC,IADT;AAEjB9C,EAAAA,sBAAsB,EAAE6C,sBAAUC,IAFjB;AAGjB/C,EAAAA,OAAO,EAAE8C,sBAAUE,MAHF;AAIjB9C,EAAAA,YAAY,EAAE4C,sBAAUE,MAJP;AAKjB7C,EAAAA,kBAAkB,EAAE2C,sBAAUE,MALb;AAMjBlE,EAAAA,KAAK,EAAEgE,sBAAUE,MAAV,CAAiBC,UANP;AAOjBhE,EAAAA,aAAa,EAAE6D,sBAAUE,MAAV,CAAiBC;AAPf,C;iCADRvE,S,kBAWW;AAAEsB,EAAAA,OAAO,EAAE;AAAX,C;;eAkOT,wBAAWnC,MAAX,EAAmBa,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/pie-toolbox/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport {EditableHtml} from '@pie-lib/pie-toolbox/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\nimport intersection from 'lodash/intersection';\n\nconst { Panel, toggle, radio, checkboxes, textField, dropdown } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = (theme) => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit,\n },\n promptHolder: {\n width: '100%',\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n },\n description: {\n marginBottom: theme.spacing.unit * 2.5,\n },\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n uploadSoundSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n };\n\n static defaultProps = { classes: {} };\n\n componentDidMount() {\n const { configuration, onModelChanged, model } = this.props;\n const { availableTools, title, graphDimensions } = configuration || {};\n let { arrows, titleEnabled: showTitle, dimensionsEnabled: showDimensions } = model || {};\n\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in the controller: packages/graphing/controller/src/index.js - model\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = { left: true, right: true, up: true, down: true };\n } else {\n arrows = { left: false, right: false, up: false, down: false };\n }\n }\n\n const toolbarTools = intersection(availableTools || [], model.toolbarTools || []);\n const titleEnabled = showTitle === undefined || showTitle === null ? title.enabled : showTitle;\n const dimensionsEnabled =\n showDimensions === undefined || showDimensions === null ? graphDimensions.enabled : showDimensions;\n\n onModelChanged && onModelChanged({ ...model, arrows, toolbarTools, titleEnabled, dimensionsEnabled });\n }\n\n onRationaleChange = (rationale) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = (prompt) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = (teacherInstructions) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const { classes, model, configuration, onConfigurationChanged, onModelChanged, imageSupport, uploadSoundSupport } =\n this.props;\n const {\n arrows = {},\n authoring = {},\n availableTools = [],\n coordinatesOnHover = {},\n contentDimensions = {},\n gridConfigurations = [],\n graphDimensions = {},\n instruction = {},\n labels = {},\n padding = {},\n prompt = {},\n rationale = {},\n scoringType = {},\n settingsPanelDisabled,\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n title = {},\n maxImageWidth = {},\n maxImageHeight = {},\n withRubric = {},\n language = {},\n languageChoices = {},\n mathMlOptions = {},\n } = configuration || {};\n const {\n errors = {},\n labelsEnabled,\n dimensionsEnabled,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n titleEnabled,\n } = model || {};\n\n log('[render] model', model);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n const labelsPlaceholders = {\n top: labels.top,\n right: labels.right,\n bottom: labels.bottom,\n left: labels.left,\n };\n\n const panelItemType = {\n arrows:\n arrows.settings &&\n checkboxes(arrows.label, {\n left: arrows.left,\n right: arrows.right,\n up: arrows.up,\n down: arrows.down,\n }),\n titleEnabled: title.settings && toggle(title.label),\n padding: padding.settings && toggle(padding.label),\n labelsEnabled: labels.settings && toggle(labels.label),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n dimensionsEnabled: graphDimensions.settings && toggle(graphDimensions.label),\n coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label),\n };\n\n const panelProperties = {\n 'authoring.enabled': authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['dichotomous', 'partial scoring']),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n instruction: instruction.settings && textField(instruction.label),\n };\n\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelItemType,\n Properties: panelProperties,\n }}\n />\n }\n >\n <Typography component=\"div\" type=\"body1\" className={classes.description}>\n {instruction?.label || ''}\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label={prompt.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n disableUnderline\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n </InputContainer>\n )}\n\n <GraphingConfig\n authoring={authoring}\n availableTools={availableTools}\n gridConfigurations={gridConfigurations}\n graphDimensions={graphDimensions}\n labelsPlaceholders={labelsPlaceholders}\n model={model}\n showLabels={labelsEnabled}\n dimensionsEnabled={dimensionsEnabled}\n showTitle={titleEnabled}\n titlePlaceholder={title.placeholder}\n onChange={this.props.onModelChanged}\n mathMlOptions={mathMlOptions}\n />\n\n <CorrectResponse\n availableTools={availableTools}\n errors={errors}\n model={model}\n onChange={this.props.onModelChanged}\n mathMlOptions={mathMlOptions}\n />\n\n {rationaleEnabled && (\n <InputContainer label={rationale.label || 'Rationale'} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n </InputContainer>\n )}\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}