@pie-element/graphing 5.15.1-next.1 → 5.15.1-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configure/lib/configure.js +426 -0
- package/configure/lib/configure.js.map +1 -0
- package/configure/lib/correct-response.js +581 -0
- package/configure/lib/correct-response.js.map +1 -0
- package/configure/lib/defaults.js +434 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/graphing-config.js +435 -0
- package/configure/lib/graphing-config.js.map +1 -0
- package/configure/lib/index.js +232 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/utils.js +168 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +1 -1
- package/controller/lib/defaults.js +62 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +437 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/utils.js +466 -0
- package/controller/lib/utils.js.map +1 -0
- package/controller/package.json +1 -1
- package/lib/index.js +123 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +215 -0
- package/lib/main.js.map +1 -0
- package/lib/utils.js +55 -0
- package/lib/utils.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,426 @@
|
|
|
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
|
+
errorText: {
|
|
77
|
+
fontSize: theme.typography.fontSize - 2,
|
|
78
|
+
color: theme.palette.error.main,
|
|
79
|
+
paddingTop: theme.spacing.unit
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
var Configure = /*#__PURE__*/function (_React$Component) {
|
|
85
|
+
(0, _inherits2["default"])(Configure, _React$Component);
|
|
86
|
+
|
|
87
|
+
var _super = _createSuper(Configure);
|
|
88
|
+
|
|
89
|
+
function Configure() {
|
|
90
|
+
var _this;
|
|
91
|
+
|
|
92
|
+
(0, _classCallCheck2["default"])(this, Configure);
|
|
93
|
+
|
|
94
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
95
|
+
args[_key] = arguments[_key];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
99
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRationaleChange", function (rationale) {
|
|
100
|
+
var _this$props = _this.props,
|
|
101
|
+
onModelChanged = _this$props.onModelChanged,
|
|
102
|
+
model = _this$props.model;
|
|
103
|
+
onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
104
|
+
rationale: rationale
|
|
105
|
+
}));
|
|
106
|
+
});
|
|
107
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onPromptChange", function (prompt) {
|
|
108
|
+
var _this$props2 = _this.props,
|
|
109
|
+
onModelChanged = _this$props2.onModelChanged,
|
|
110
|
+
model = _this$props2.model;
|
|
111
|
+
onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
112
|
+
prompt: prompt
|
|
113
|
+
}));
|
|
114
|
+
});
|
|
115
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onTeacherInstructionsChange", function (teacherInstructions) {
|
|
116
|
+
var _this$props3 = _this.props,
|
|
117
|
+
onModelChanged = _this$props3.onModelChanged,
|
|
118
|
+
model = _this$props3.model;
|
|
119
|
+
onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
120
|
+
teacherInstructions: teacherInstructions
|
|
121
|
+
}));
|
|
122
|
+
});
|
|
123
|
+
return _this;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
(0, _createClass2["default"])(Configure, [{
|
|
127
|
+
key: "componentDidMount",
|
|
128
|
+
value: function componentDidMount() {
|
|
129
|
+
var _this$props4 = this.props,
|
|
130
|
+
configuration = _this$props4.configuration,
|
|
131
|
+
onModelChanged = _this$props4.onModelChanged,
|
|
132
|
+
model = _this$props4.model;
|
|
133
|
+
|
|
134
|
+
var _ref = configuration || {},
|
|
135
|
+
availableTools = _ref.availableTools,
|
|
136
|
+
title = _ref.title,
|
|
137
|
+
graphDimensions = _ref.graphDimensions;
|
|
138
|
+
|
|
139
|
+
var _ref2 = model || {},
|
|
140
|
+
arrows = _ref2.arrows,
|
|
141
|
+
showTitle = _ref2.titleEnabled,
|
|
142
|
+
showDimensions = _ref2.dimensionsEnabled; // This is used for offering support for old models which have the property arrows: boolean
|
|
143
|
+
// Same thing is set in the controller: packages/graphing/controller/src/index.js - model
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
if (typeof arrows === 'boolean') {
|
|
147
|
+
if (arrows) {
|
|
148
|
+
arrows = {
|
|
149
|
+
left: true,
|
|
150
|
+
right: true,
|
|
151
|
+
up: true,
|
|
152
|
+
down: true
|
|
153
|
+
};
|
|
154
|
+
} else {
|
|
155
|
+
arrows = {
|
|
156
|
+
left: false,
|
|
157
|
+
right: false,
|
|
158
|
+
up: false,
|
|
159
|
+
down: false
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
var toolbarTools = (0, _intersection["default"])(availableTools || [], model.toolbarTools || []);
|
|
165
|
+
var titleEnabled = showTitle === undefined || showTitle === null ? title.enabled : showTitle;
|
|
166
|
+
var dimensionsEnabled = showDimensions === undefined || showDimensions === null ? graphDimensions.enabled : showDimensions;
|
|
167
|
+
onModelChanged && onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
168
|
+
arrows: arrows,
|
|
169
|
+
toolbarTools: toolbarTools,
|
|
170
|
+
titleEnabled: titleEnabled,
|
|
171
|
+
dimensionsEnabled: dimensionsEnabled
|
|
172
|
+
}));
|
|
173
|
+
}
|
|
174
|
+
}, {
|
|
175
|
+
key: "render",
|
|
176
|
+
value: function render() {
|
|
177
|
+
var _this$props5 = this.props,
|
|
178
|
+
classes = _this$props5.classes,
|
|
179
|
+
model = _this$props5.model,
|
|
180
|
+
configuration = _this$props5.configuration,
|
|
181
|
+
onConfigurationChanged = _this$props5.onConfigurationChanged,
|
|
182
|
+
onModelChanged = _this$props5.onModelChanged,
|
|
183
|
+
imageSupport = _this$props5.imageSupport,
|
|
184
|
+
uploadSoundSupport = _this$props5.uploadSoundSupport;
|
|
185
|
+
|
|
186
|
+
var _ref3 = configuration || {},
|
|
187
|
+
_ref3$arrows = _ref3.arrows,
|
|
188
|
+
arrows = _ref3$arrows === void 0 ? {} : _ref3$arrows,
|
|
189
|
+
_ref3$authoring = _ref3.authoring,
|
|
190
|
+
authoring = _ref3$authoring === void 0 ? {} : _ref3$authoring,
|
|
191
|
+
_ref3$availableTools = _ref3.availableTools,
|
|
192
|
+
availableTools = _ref3$availableTools === void 0 ? [] : _ref3$availableTools,
|
|
193
|
+
_ref3$baseInputConfig = _ref3.baseInputConfiguration,
|
|
194
|
+
baseInputConfiguration = _ref3$baseInputConfig === void 0 ? {} : _ref3$baseInputConfig,
|
|
195
|
+
_ref3$coordinatesOnHo = _ref3.coordinatesOnHover,
|
|
196
|
+
coordinatesOnHover = _ref3$coordinatesOnHo === void 0 ? {} : _ref3$coordinatesOnHo,
|
|
197
|
+
_ref3$contentDimensio = _ref3.contentDimensions,
|
|
198
|
+
contentDimensions = _ref3$contentDimensio === void 0 ? {} : _ref3$contentDimensio,
|
|
199
|
+
_ref3$gridConfigurati = _ref3.gridConfigurations,
|
|
200
|
+
gridConfigurations = _ref3$gridConfigurati === void 0 ? [] : _ref3$gridConfigurati,
|
|
201
|
+
_ref3$graphDimensions = _ref3.graphDimensions,
|
|
202
|
+
graphDimensions = _ref3$graphDimensions === void 0 ? {} : _ref3$graphDimensions,
|
|
203
|
+
_ref3$instruction = _ref3.instruction,
|
|
204
|
+
instruction = _ref3$instruction === void 0 ? {} : _ref3$instruction,
|
|
205
|
+
_ref3$labels = _ref3.labels,
|
|
206
|
+
labels = _ref3$labels === void 0 ? {} : _ref3$labels,
|
|
207
|
+
_ref3$padding = _ref3.padding,
|
|
208
|
+
padding = _ref3$padding === void 0 ? {} : _ref3$padding,
|
|
209
|
+
_ref3$prompt = _ref3.prompt,
|
|
210
|
+
prompt = _ref3$prompt === void 0 ? {} : _ref3$prompt,
|
|
211
|
+
_ref3$rationale = _ref3.rationale,
|
|
212
|
+
rationale = _ref3$rationale === void 0 ? {} : _ref3$rationale,
|
|
213
|
+
_ref3$scoringType = _ref3.scoringType,
|
|
214
|
+
scoringType = _ref3$scoringType === void 0 ? {} : _ref3$scoringType,
|
|
215
|
+
settingsPanelDisabled = _ref3.settingsPanelDisabled,
|
|
216
|
+
_ref3$spellCheck = _ref3.spellCheck,
|
|
217
|
+
spellCheck = _ref3$spellCheck === void 0 ? {} : _ref3$spellCheck,
|
|
218
|
+
_ref3$studentInstruct = _ref3.studentInstructions,
|
|
219
|
+
studentInstructions = _ref3$studentInstruct === void 0 ? {} : _ref3$studentInstruct,
|
|
220
|
+
_ref3$teacherInstruct = _ref3.teacherInstructions,
|
|
221
|
+
teacherInstructions = _ref3$teacherInstruct === void 0 ? {} : _ref3$teacherInstruct,
|
|
222
|
+
_ref3$title = _ref3.title,
|
|
223
|
+
title = _ref3$title === void 0 ? {} : _ref3$title,
|
|
224
|
+
_ref3$maxImageWidth = _ref3.maxImageWidth,
|
|
225
|
+
maxImageWidth = _ref3$maxImageWidth === void 0 ? {} : _ref3$maxImageWidth,
|
|
226
|
+
_ref3$maxImageHeight = _ref3.maxImageHeight,
|
|
227
|
+
maxImageHeight = _ref3$maxImageHeight === void 0 ? {} : _ref3$maxImageHeight,
|
|
228
|
+
_ref3$withRubric = _ref3.withRubric,
|
|
229
|
+
withRubric = _ref3$withRubric === void 0 ? {} : _ref3$withRubric,
|
|
230
|
+
_ref3$language = _ref3.language,
|
|
231
|
+
language = _ref3$language === void 0 ? {} : _ref3$language,
|
|
232
|
+
_ref3$languageChoices = _ref3.languageChoices,
|
|
233
|
+
languageChoices = _ref3$languageChoices === void 0 ? {} : _ref3$languageChoices,
|
|
234
|
+
_ref3$mathMlOptions = _ref3.mathMlOptions,
|
|
235
|
+
mathMlOptions = _ref3$mathMlOptions === void 0 ? {} : _ref3$mathMlOptions,
|
|
236
|
+
_ref3$removeIncomplet = _ref3.removeIncompleteTool,
|
|
237
|
+
removeIncompleteTool = _ref3$removeIncomplet === void 0 ? false : _ref3$removeIncomplet;
|
|
238
|
+
|
|
239
|
+
var _ref4 = model || {},
|
|
240
|
+
_ref4$errors = _ref4.errors,
|
|
241
|
+
errors = _ref4$errors === void 0 ? {} : _ref4$errors,
|
|
242
|
+
labelsEnabled = _ref4.labelsEnabled,
|
|
243
|
+
dimensionsEnabled = _ref4.dimensionsEnabled,
|
|
244
|
+
promptEnabled = _ref4.promptEnabled,
|
|
245
|
+
rationaleEnabled = _ref4.rationaleEnabled,
|
|
246
|
+
spellCheckEnabled = _ref4.spellCheckEnabled,
|
|
247
|
+
teacherInstructionsEnabled = _ref4.teacherInstructionsEnabled,
|
|
248
|
+
titleEnabled = _ref4.titleEnabled;
|
|
249
|
+
|
|
250
|
+
var _ref5 = errors || {},
|
|
251
|
+
promptError = _ref5.prompt,
|
|
252
|
+
rationaleError = _ref5.rationale,
|
|
253
|
+
teacherInstructionsError = _ref5.teacherInstructions;
|
|
254
|
+
|
|
255
|
+
log('[render] model', model);
|
|
256
|
+
var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
257
|
+
var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
|
|
258
|
+
var labelsPlaceholders = {
|
|
259
|
+
top: labels.top,
|
|
260
|
+
right: labels.right,
|
|
261
|
+
bottom: labels.bottom,
|
|
262
|
+
left: labels.left
|
|
263
|
+
};
|
|
264
|
+
var panelItemType = {
|
|
265
|
+
arrows: arrows.settings && checkboxes(arrows.label, {
|
|
266
|
+
left: arrows.left,
|
|
267
|
+
right: arrows.right,
|
|
268
|
+
up: arrows.up,
|
|
269
|
+
down: arrows.down
|
|
270
|
+
}),
|
|
271
|
+
titleEnabled: title.settings && toggle(title.label),
|
|
272
|
+
padding: padding.settings && toggle(padding.label),
|
|
273
|
+
labelsEnabled: labels.settings && toggle(labels.label),
|
|
274
|
+
'language.enabled': language.settings && toggle(language.label, true),
|
|
275
|
+
language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),
|
|
276
|
+
dimensionsEnabled: graphDimensions.settings && toggle(graphDimensions.label),
|
|
277
|
+
coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label)
|
|
278
|
+
};
|
|
279
|
+
var panelProperties = {
|
|
280
|
+
'authoring.enabled': authoring.settings && toggle(authoring.label, true),
|
|
281
|
+
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
282
|
+
studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
|
|
283
|
+
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
284
|
+
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
285
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
286
|
+
scoringType: scoringType.settings && radio(scoringType.label, ['dichotomous', 'partial scoring']),
|
|
287
|
+
rubricEnabled: (withRubric === null || withRubric === void 0 ? void 0 : withRubric.settings) && toggle(withRubric === null || withRubric === void 0 ? void 0 : withRubric.label),
|
|
288
|
+
instruction: instruction.settings && textField(instruction.label)
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
var getPluginProps = function getPluginProps() {
|
|
292
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
293
|
+
return _objectSpread(_objectSpread({}, baseInputConfiguration), props);
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
297
|
+
dimensions: contentDimensions,
|
|
298
|
+
hideSettings: settingsPanelDisabled,
|
|
299
|
+
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
300
|
+
model: model,
|
|
301
|
+
configuration: configuration,
|
|
302
|
+
onChangeModel: onModelChanged,
|
|
303
|
+
onChangeConfiguration: onConfigurationChanged,
|
|
304
|
+
groups: {
|
|
305
|
+
Settings: panelItemType,
|
|
306
|
+
Properties: panelProperties
|
|
307
|
+
}
|
|
308
|
+
})
|
|
309
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
310
|
+
component: "div",
|
|
311
|
+
type: "body1",
|
|
312
|
+
className: classes.description
|
|
313
|
+
}, (instruction === null || instruction === void 0 ? void 0 : instruction.label) || ''), teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
314
|
+
label: teacherInstructions.label,
|
|
315
|
+
className: classes.promptHolder
|
|
316
|
+
}, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
|
|
317
|
+
className: classes.prompt,
|
|
318
|
+
markup: model.teacherInstructions || '',
|
|
319
|
+
onChange: this.onTeacherInstructionsChange,
|
|
320
|
+
imageSupport: imageSupport,
|
|
321
|
+
error: teacherInstructionsError,
|
|
322
|
+
nonEmpty: false,
|
|
323
|
+
pluginProps: getPluginProps(teacherInstructions === null || teacherInstructions === void 0 ? void 0 : teacherInstructions.inputConfiguration),
|
|
324
|
+
spellCheck: spellCheckEnabled,
|
|
325
|
+
maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
|
|
326
|
+
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
|
|
327
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
328
|
+
languageCharactersProps: [{
|
|
329
|
+
language: 'spanish'
|
|
330
|
+
}, {
|
|
331
|
+
language: 'special'
|
|
332
|
+
}],
|
|
333
|
+
mathMlOptions: mathMlOptions
|
|
334
|
+
}), teacherInstructionsError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
335
|
+
className: classes.errorText
|
|
336
|
+
}, teacherInstructionsError)), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
337
|
+
label: prompt.label,
|
|
338
|
+
className: classes.promptHolder
|
|
339
|
+
}, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
|
|
340
|
+
className: classes.prompt,
|
|
341
|
+
markup: model.prompt,
|
|
342
|
+
onChange: this.onPromptChange,
|
|
343
|
+
imageSupport: imageSupport,
|
|
344
|
+
error: promptError,
|
|
345
|
+
nonEmpty: false,
|
|
346
|
+
spellCheck: spellCheckEnabled,
|
|
347
|
+
pluginProps: getPluginProps(prompt === null || prompt === void 0 ? void 0 : prompt.inputConfiguration),
|
|
348
|
+
disableUnderline: true,
|
|
349
|
+
maxImageWidth: defaultImageMaxWidth,
|
|
350
|
+
maxImageHeight: defaultImageMaxHeight,
|
|
351
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
352
|
+
languageCharactersProps: [{
|
|
353
|
+
language: 'spanish'
|
|
354
|
+
}, {
|
|
355
|
+
language: 'special'
|
|
356
|
+
}],
|
|
357
|
+
mathMlOptions: mathMlOptions
|
|
358
|
+
}), promptError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
359
|
+
className: classes.errorText
|
|
360
|
+
}, promptError)), /*#__PURE__*/_react["default"].createElement(_graphingConfig["default"], {
|
|
361
|
+
authoring: authoring,
|
|
362
|
+
availableTools: availableTools,
|
|
363
|
+
gridConfigurations: gridConfigurations,
|
|
364
|
+
graphDimensions: graphDimensions,
|
|
365
|
+
labelsPlaceholders: labelsPlaceholders,
|
|
366
|
+
model: model,
|
|
367
|
+
showLabels: labelsEnabled,
|
|
368
|
+
dimensionsEnabled: dimensionsEnabled,
|
|
369
|
+
showTitle: titleEnabled,
|
|
370
|
+
titlePlaceholder: title.placeholder,
|
|
371
|
+
onChange: this.props.onModelChanged,
|
|
372
|
+
mathMlOptions: mathMlOptions,
|
|
373
|
+
removeIncompleteTool: removeIncompleteTool
|
|
374
|
+
}), /*#__PURE__*/_react["default"].createElement(_correctResponse["default"], {
|
|
375
|
+
availableTools: availableTools,
|
|
376
|
+
errors: errors,
|
|
377
|
+
model: model,
|
|
378
|
+
onChange: this.props.onModelChanged,
|
|
379
|
+
mathMlOptions: mathMlOptions,
|
|
380
|
+
removeIncompleteTool: removeIncompleteTool
|
|
381
|
+
}), rationaleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
382
|
+
label: rationale.label || 'Rationale',
|
|
383
|
+
className: classes.promptHolder
|
|
384
|
+
}, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
|
|
385
|
+
className: classes.prompt,
|
|
386
|
+
markup: model.rationale || '',
|
|
387
|
+
onChange: this.onRationaleChange,
|
|
388
|
+
imageSupport: imageSupport,
|
|
389
|
+
error: rationaleError,
|
|
390
|
+
spellCheck: spellCheckEnabled,
|
|
391
|
+
pluginProps: getPluginProps(rationale === null || rationale === void 0 ? void 0 : rationale.inputConfiguration),
|
|
392
|
+
maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
|
|
393
|
+
maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight,
|
|
394
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
395
|
+
languageCharactersProps: [{
|
|
396
|
+
language: 'spanish'
|
|
397
|
+
}, {
|
|
398
|
+
language: 'special'
|
|
399
|
+
}],
|
|
400
|
+
mathMlOptions: mathMlOptions
|
|
401
|
+
}), rationaleError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
402
|
+
className: classes.errorText
|
|
403
|
+
}, rationaleError)));
|
|
404
|
+
}
|
|
405
|
+
}]);
|
|
406
|
+
return Configure;
|
|
407
|
+
}(_react["default"].Component);
|
|
408
|
+
|
|
409
|
+
exports.Configure = Configure;
|
|
410
|
+
(0, _defineProperty2["default"])(Configure, "propTypes", {
|
|
411
|
+
onModelChanged: _propTypes["default"].func,
|
|
412
|
+
onConfigurationChanged: _propTypes["default"].func,
|
|
413
|
+
classes: _propTypes["default"].object,
|
|
414
|
+
imageSupport: _propTypes["default"].object,
|
|
415
|
+
uploadSoundSupport: _propTypes["default"].object,
|
|
416
|
+
model: _propTypes["default"].object.isRequired,
|
|
417
|
+
configuration: _propTypes["default"].object.isRequired
|
|
418
|
+
});
|
|
419
|
+
(0, _defineProperty2["default"])(Configure, "defaultProps", {
|
|
420
|
+
classes: {}
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
var _default = (0, _styles.withStyles)(styles)(Configure);
|
|
424
|
+
|
|
425
|
+
exports["default"] = _default;
|
|
426
|
+
//# 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","errorText","typography","color","palette","error","main","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","baseInputConfiguration","coordinatesOnHover","contentDimensions","gridConfigurations","instruction","labels","padding","scoringType","settingsPanelDisabled","spellCheck","studentInstructions","maxImageWidth","maxImageHeight","withRubric","language","languageChoices","mathMlOptions","removeIncompleteTool","errors","labelsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","promptError","rationaleError","teacherInstructionsError","defaultImageMaxWidth","defaultImageMaxHeight","labelsPlaceholders","top","bottom","panelItemType","label","options","panelProperties","studentInstructionsEnabled","rubricEnabled","getPluginProps","Settings","Properties","onTeacherInstructionsChange","inputConfiguration","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,CAAcC,IAAd,GAAqB;AAHvB,KAPW;AAYzBK,IAAAA,WAAW,EAAE;AACXJ,MAAAA,YAAY,EAAEP,KAAK,CA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AACA,SAAD,uBAACA,SAAS,CAAEoE,kBAAZ,CAP7B;AAQE,QAAA,aAAa,EAAG/B,aAAa,IAAIA,aAAa,CAACrC,SAAhC,IAA8CqD,oBAR/D;AASE,QAAA,cAAc,EAAGf,cAAc,IAAIA,cAAc,CAACtC,SAAlC,IAAgDsD,qBATlE;AAUE,QAAA,kBAAkB,EAAE9B,kBAVtB;AAWE,QAAA,uBAAuB,EAAE,CAAC;AAAEgB,UAAAA,QAAQ,EAAE;AAAZ,SAAD,EAA0B;AAAEA,UAAAA,QAAQ,EAAE;AAAZ,SAA1B,CAX3B;AAYE,QAAA,aAAa,EAAEE;AAZjB,QADF,EAeGS,cAAc,iBAAI;AAAK,QAAA,SAAS,EAAE9B,OAAO,CAAC5B;AAAxB,SAAoC0D,cAApC,CAfrB,CAzFJ,CADF;AA8GD;;;EAjQ4BqB,kBAAMC,S;;;iCAAxB1E,S,eACQ;AACjBG,EAAAA,cAAc,EAAEwE,sBAAUC,IADT;AAEjBrD,EAAAA,sBAAsB,EAAEoD,sBAAUC,IAFjB;AAGjBtD,EAAAA,OAAO,EAAEqD,sBAAUE,MAHF;AAIjBrD,EAAAA,YAAY,EAAEmD,sBAAUE,MAJP;AAKjBpD,EAAAA,kBAAkB,EAAEkD,sBAAUE,MALb;AAMjBzE,EAAAA,KAAK,EAAEuE,sBAAUE,MAAV,CAAiBC,UANP;AAOjBvE,EAAAA,aAAa,EAAEoE,sBAAUE,MAAV,CAAiBC;AAPf,C;iCADR9E,S,kBAWW;AAAEsB,EAAAA,OAAO,EAAE;AAAX,C;;eAyPT,wBAAWzC,MAAX,EAAmBmB,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 errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit,\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 baseInputConfiguration = {},\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 removeIncompleteTool = false,\n } = configuration || {};\n const {\n errors = {},\n labelsEnabled,\n dimensionsEnabled,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n titleEnabled,\n } = model || {};\n const {\n prompt: promptError,\n rationale: rationaleError,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\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 const getPluginProps = (props = {}) => ({\n ...baseInputConfiguration,\n ...props,\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 error={teacherInstructionsError}\n nonEmpty={false}\n pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}\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 {teacherInstructionsError && <div className={classes.errorText}>{teacherInstructionsError}</div>}\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 error={promptError}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n disableUnderline\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {promptError && <div className={classes.errorText}>{promptError}</div>}\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 removeIncompleteTool={removeIncompleteTool}\n />\n\n <CorrectResponse\n availableTools={availableTools}\n errors={errors}\n model={model}\n onChange={this.props.onModelChanged}\n mathMlOptions={mathMlOptions}\n removeIncompleteTool={removeIncompleteTool}\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 error={rationaleError}\n spellCheck={spellCheckEnabled}\n pluginProps={getPluginProps(rationale?.inputConfiguration)}\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 {rationaleError && <div className={classes.errorText}>{rationaleError}</div>}\n </InputContainer>\n )}\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
|