@pie-element/extended-text-entry 13.4.1-next.0 → 14.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.
@@ -1,322 +1,247 @@
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["default"] = exports.Main = void 0;
11
-
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
-
14
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
-
16
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
17
-
18
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
-
20
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
-
22
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
-
7
+ exports.default = exports.Main = void 0;
24
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
-
26
9
  var _react = _interopRequireDefault(require("react"));
27
-
28
10
  var _configUi = require("@pie-lib/config-ui");
29
-
30
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
31
-
32
- var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
33
-
34
- var _styles = require("@material-ui/core/styles");
35
-
12
+ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
13
+ var _styles = require("@mui/material/styles");
36
14
  var _editableHtml = _interopRequireWildcard(require("@pie-lib/editable-html"));
37
-
38
- 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); }
39
-
40
- 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; }
41
-
42
- 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; }
43
-
44
- 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; }
45
-
46
- 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); }; }
47
-
48
- 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; } }
49
-
50
- var Panel = _configUi.settings.Panel,
51
- toggle = _configUi.settings.toggle,
52
- numberFields = _configUi.settings.numberFields,
53
- dropdown = _configUi.settings.dropdown;
54
- var defaultFeedback = {
15
+ 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); }
16
+ const {
17
+ Panel,
18
+ toggle,
19
+ numberFields,
20
+ dropdown
21
+ } = _configUi.settings;
22
+ const defaultFeedback = {
55
23
  type: 'default',
56
- "default": 'Your answer has been submitted'
24
+ default: 'Your answer has been submitted'
57
25
  };
58
-
59
- var Main = /*#__PURE__*/function (_React$Component) {
60
- (0, _inherits2["default"])(Main, _React$Component);
61
-
62
- var _super = _createSuper(Main);
63
-
64
- function Main(props) {
65
- var _this;
66
-
67
- (0, _classCallCheck2["default"])(this, Main);
68
- _this = _super.call(this, props);
69
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onPromptChange", function (markup) {
70
- var _this$props = _this.props,
71
- onModelChanged = _this$props.onModelChanged,
72
- model = _this$props.model;
73
- onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
26
+ const StyledHeader = (0, _styles.styled)(_Typography.default)(({
27
+ theme
28
+ }) => ({
29
+ paddingBottom: theme.spacing(1)
30
+ }));
31
+ const PromptContainer = (0, _styles.styled)(_configUi.InputContainer)(({
32
+ theme
33
+ }) => ({
34
+ paddingTop: theme.spacing(1),
35
+ marginTop: theme.spacing(2),
36
+ marginBottom: theme.spacing(2),
37
+ width: '100%'
38
+ }));
39
+ const ErrorText = (0, _styles.styled)('div')(({
40
+ theme
41
+ }) => ({
42
+ fontSize: theme.typography.fontSize - 2,
43
+ color: theme.palette.error.main,
44
+ paddingTop: theme.spacing(1)
45
+ }));
46
+ class Main extends _react.default.Component {
47
+ constructor(props) {
48
+ super(props);
49
+ (0, _defineProperty2.default)(this, "onPromptChange", markup => {
50
+ const {
51
+ onModelChanged,
52
+ model
53
+ } = this.props;
54
+ onModelChanged({
55
+ ...model,
74
56
  prompt: markup
75
- }));
76
- });
77
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeFeedback", function (feedback) {
78
- var _this$props2 = _this.props,
79
- model = _this$props2.model,
80
- onModelChanged = _this$props2.onModelChanged;
81
-
82
- var update = _objectSpread(_objectSpread({}, model), {}, {
83
- feedback: feedback
84
57
  });
85
-
58
+ });
59
+ (0, _defineProperty2.default)(this, "changeFeedback", feedback => {
60
+ const {
61
+ model,
62
+ onModelChanged
63
+ } = this.props;
64
+ const update = {
65
+ ...model,
66
+ feedback
67
+ };
86
68
  onModelChanged(update);
87
69
  });
88
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeTeacherInstructions", function (teacherInstructions) {
89
- var _this$props3 = _this.props,
90
- model = _this$props3.model,
91
- onModelChanged = _this$props3.onModelChanged;
92
-
93
- var update = _objectSpread(_objectSpread({}, model), {}, {
94
- teacherInstructions: teacherInstructions
95
- });
96
-
70
+ (0, _defineProperty2.default)(this, "changeTeacherInstructions", teacherInstructions => {
71
+ const {
72
+ model,
73
+ onModelChanged
74
+ } = this.props;
75
+ const update = {
76
+ ...model,
77
+ teacherInstructions
78
+ };
97
79
  onModelChanged(update);
98
80
  });
99
- _this.state = {
81
+ this.state = {
100
82
  setDimensions: true
101
83
  };
102
- return _this;
103
84
  }
104
-
105
- (0, _createClass2["default"])(Main, [{
106
- key: "render",
107
- value: function render() {
108
- var _this$props4 = this.props,
109
- model = _this$props4.model,
110
- classes = _this$props4.classes,
111
- configuration = _this$props4.configuration,
112
- imageSupport = _this$props4.imageSupport,
113
- onConfigurationChanged = _this$props4.onConfigurationChanged,
114
- onModelChanged = _this$props4.onModelChanged,
115
- uploadSoundSupport = _this$props4.uploadSoundSupport;
116
-
117
- var _ref = configuration || {},
118
- _ref$annotations = _ref.annotations,
119
- annotations = _ref$annotations === void 0 ? {} : _ref$annotations,
120
- _ref$contentDimension = _ref.contentDimensions,
121
- contentDimensions = _ref$contentDimension === void 0 ? {} : _ref$contentDimension,
122
- _ref$dimensions = _ref.dimensions,
123
- dimensions = _ref$dimensions === void 0 ? {} : _ref$dimensions,
124
- _ref$equationEditor = _ref.equationEditor,
125
- equationEditor = _ref$equationEditor === void 0 ? {} : _ref$equationEditor,
126
- _ref$feedback = _ref.feedback,
127
- feedback = _ref$feedback === void 0 ? {} : _ref$feedback,
128
- _ref$playerSpellCheck = _ref.playerSpellCheck,
129
- playerSpellCheck = _ref$playerSpellCheck === void 0 ? {} : _ref$playerSpellCheck,
130
- _ref$prompt = _ref.prompt,
131
- prompt = _ref$prompt === void 0 ? {} : _ref$prompt,
132
- settingsPanelDisabled = _ref.settingsPanelDisabled,
133
- _ref$spanishInput = _ref.spanishInput,
134
- spanishInput = _ref$spanishInput === void 0 ? {} : _ref$spanishInput,
135
- _ref$specialInput = _ref.specialInput,
136
- specialInput = _ref$specialInput === void 0 ? {} : _ref$specialInput,
137
- _ref$spellCheck = _ref.spellCheck,
138
- spellCheck = _ref$spellCheck === void 0 ? {} : _ref$spellCheck,
139
- _ref$studentInstructi = _ref.studentInstructions,
140
- studentInstructions = _ref$studentInstructi === void 0 ? {} : _ref$studentInstructi,
141
- _ref$teacherInstructi = _ref.teacherInstructions,
142
- teacherInstructions = _ref$teacherInstructi === void 0 ? {} : _ref$teacherInstructi,
143
- _ref$mathInput = _ref.mathInput,
144
- mathInput = _ref$mathInput === void 0 ? {} : _ref$mathInput,
145
- _ref$maxImageWidth = _ref.maxImageWidth,
146
- maxImageWidth = _ref$maxImageWidth === void 0 ? {} : _ref$maxImageWidth,
147
- _ref$maxImageHeight = _ref.maxImageHeight,
148
- maxImageHeight = _ref$maxImageHeight === void 0 ? {} : _ref$maxImageHeight,
149
- _ref$multiple = _ref.multiple,
150
- multiple = _ref$multiple === void 0 ? {} : _ref$multiple,
151
- _ref$withRubric = _ref.withRubric,
152
- withRubric = _ref$withRubric === void 0 ? {} : _ref$withRubric,
153
- _ref$mathMlOptions = _ref.mathMlOptions,
154
- mathMlOptions = _ref$mathMlOptions === void 0 ? {} : _ref$mathMlOptions,
155
- _ref$baseInputConfigu = _ref.baseInputConfiguration,
156
- baseInputConfiguration = _ref$baseInputConfigu === void 0 ? {} : _ref$baseInputConfigu;
157
-
158
- var _ref2 = model || {},
159
- _ref2$errors = _ref2.errors,
160
- errors = _ref2$errors === void 0 ? {} : _ref2$errors,
161
- extraCSSRules = _ref2.extraCSSRules,
162
- feedbackEnabled = _ref2.feedbackEnabled,
163
- promptEnabled = _ref2.promptEnabled,
164
- spellCheckEnabled = _ref2.spellCheckEnabled,
165
- teacherInstructionsEnabled = _ref2.teacherInstructionsEnabled,
166
- toolbarEditorPosition = _ref2.toolbarEditorPosition;
167
-
168
- var promptError = errors.prompt,
169
- teacherInstructionsError = errors.teacherInstructions;
170
- var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
171
- var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
172
- var toolbarOpts = {
173
- position: toolbarEditorPosition === 'top' ? 'top' : 'bottom'
174
- };
175
- var panelSettings = {
176
- mathInput: mathInput.settings && toggle(mathInput.label),
177
- equationEditor: equationEditor.enabled && model.mathInput && dropdown(equationEditor.label, ['non-negative-integers', 'integers', 'decimals', 'fractions', 'Grade 1 - 2', 'Grade 3 - 5', 'Grade 6 - 7', 'Grade 8 - HS', 'geometry', 'advanced-algebra', 'statistics', 'item-authoring']),
178
- spanishInput: spanishInput.settings && toggle(spanishInput.label),
179
- specialInput: specialInput.settings && toggle(specialInput.label),
180
- dimensions: dimensions.settings && numberFields(dimensions.label, {
181
- width: {
182
- label: 'Width (px)',
183
- suffix: 'px',
184
- min: 100,
185
- max: 1200
186
- },
187
- height: {
188
- label: 'Height (px)',
189
- suffix: 'px',
190
- min: 100,
191
- max: 500
192
- }
193
- }),
194
- 'multiple.enabled': multiple.settings && toggle(multiple.label, true),
195
- promptEnabled: prompt.settings && toggle(prompt.label),
196
- feedbackEnabled: feedback.settings && toggle(feedback.label),
197
- annotationsEnabled: annotations.settings && toggle(annotations.label),
198
- spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
199
- playerSpellCheckDisabled: playerSpellCheck.settings && toggle(playerSpellCheck.label)
200
- };
201
- var panelProperties = {
202
- teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
203
- studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
204
- rubricEnabled: (withRubric === null || withRubric === void 0 ? void 0 : withRubric.settings) && toggle(withRubric === null || withRubric === void 0 ? void 0 : withRubric.label)
205
- };
206
-
207
- var getPluginProps = function getPluginProps(props) {
208
- return Object.assign(_objectSpread({}, baseInputConfiguration), props || {});
209
- };
210
-
211
- return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
212
- extraCSSRules: extraCSSRules,
213
- dimensions: contentDimensions,
214
- hideSettings: settingsPanelDisabled,
215
- settings: /*#__PURE__*/_react["default"].createElement(Panel, {
216
- model: model,
217
- configuration: configuration,
218
- onChangeModel: function onChangeModel(model) {
219
- return onModelChanged(model);
220
- },
221
- onChangeConfiguration: function onChangeConfiguration(config) {
222
- return onConfigurationChanged(config);
223
- },
224
- groups: {
225
- Settings: panelSettings,
226
- Properties: panelProperties
227
- }
228
- })
229
- }, teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
230
- label: teacherInstructions.label,
231
- className: classes.promptContainer
232
- }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
233
- className: classes.prompt,
234
- markup: model.teacherInstructions || '',
235
- onChange: this.changeTeacherInstructions,
236
- imageSupport: imageSupport,
237
- nonEmpty: false,
238
- error: teacherInstructionsError,
239
- toolbarOpts: toolbarOpts,
240
- spellCheck: spellCheckEnabled,
241
- maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
242
- maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
243
- uploadSoundSupport: uploadSoundSupport,
244
- languageCharactersProps: [{
245
- language: 'spanish'
246
- }, {
247
- language: 'special'
248
- }],
249
- mathMlOptions: mathMlOptions,
250
- pluginProps: getPluginProps(teacherInstructions === null || teacherInstructions === void 0 ? void 0 : teacherInstructions.inputConfiguration)
251
- }), teacherInstructionsError && /*#__PURE__*/_react["default"].createElement("div", {
252
- className: classes.errorText
253
- }, teacherInstructionsError)), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
254
- label: prompt.label,
255
- className: classes.promptContainer
256
- }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
257
- activePlugins: _editableHtml.ALL_PLUGINS,
258
- className: classes.prompt,
259
- markup: model.prompt || '',
260
- onChange: this.onPromptChange,
261
- imageSupport: imageSupport,
262
- nonEmpty: false,
263
- error: promptError,
264
- toolbarOpts: toolbarOpts,
265
- spellCheck: spellCheckEnabled,
266
- maxImageWidth: defaultImageMaxWidth,
267
- maxImageHeight: defaultImageMaxHeight,
268
- uploadSoundSupport: uploadSoundSupport,
269
- languageCharactersProps: [{
270
- language: 'spanish'
271
- }, {
272
- language: 'special'
273
- }],
274
- mathMlOptions: mathMlOptions,
275
- pluginProps: getPluginProps(prompt === null || prompt === void 0 ? void 0 : prompt.inputConfiguration)
276
- }), promptError && /*#__PURE__*/_react["default"].createElement("div", {
277
- className: classes.errorText
278
- }, promptError)), feedbackEnabled && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
279
- className: classes.header,
280
- variant: "subheading"
281
- }, "Feedback"), /*#__PURE__*/_react["default"].createElement(_configUi.FeedbackSelector, {
282
- label: "When submitted, show",
283
- feedback: model.feedback || defaultFeedback,
284
- onChange: this.changeFeedback,
285
- toolbarOpts: toolbarOpts
286
- })));
287
- }
288
- }]);
289
- return Main;
290
- }(_react["default"].Component);
291
-
85
+ render() {
86
+ const {
87
+ model,
88
+ configuration,
89
+ imageSupport,
90
+ onConfigurationChanged,
91
+ onModelChanged,
92
+ uploadSoundSupport
93
+ } = this.props;
94
+ const {
95
+ annotations = {},
96
+ contentDimensions = {},
97
+ dimensions = {},
98
+ equationEditor = {},
99
+ feedback = {},
100
+ playerSpellCheck = {},
101
+ prompt = {},
102
+ settingsPanelDisabled,
103
+ spanishInput = {},
104
+ specialInput = {},
105
+ spellCheck = {},
106
+ studentInstructions = {},
107
+ teacherInstructions = {},
108
+ mathInput = {},
109
+ maxImageWidth = {},
110
+ maxImageHeight = {},
111
+ multiple = {},
112
+ withRubric = {},
113
+ mathMlOptions = {},
114
+ baseInputConfiguration = {}
115
+ } = configuration || {};
116
+ const {
117
+ errors = {},
118
+ extraCSSRules,
119
+ feedbackEnabled,
120
+ promptEnabled,
121
+ spellCheckEnabled,
122
+ teacherInstructionsEnabled,
123
+ toolbarEditorPosition
124
+ } = model || {};
125
+ const {
126
+ prompt: promptError,
127
+ teacherInstructions: teacherInstructionsError
128
+ } = errors;
129
+ const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
130
+ const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
131
+ const toolbarOpts = {
132
+ position: toolbarEditorPosition === 'top' ? 'top' : 'bottom'
133
+ };
134
+ const panelSettings = {
135
+ mathInput: mathInput.settings && toggle(mathInput.label),
136
+ equationEditor: equationEditor.enabled && model.mathInput && dropdown(equationEditor.label, ['non-negative-integers', 'integers', 'decimals', 'fractions', 'Grade 1 - 2', 'Grade 3 - 5', 'Grade 6 - 7', 'Grade 8 - HS', 'geometry', 'advanced-algebra', 'statistics', 'item-authoring']),
137
+ spanishInput: spanishInput.settings && toggle(spanishInput.label),
138
+ specialInput: specialInput.settings && toggle(specialInput.label),
139
+ dimensions: dimensions.settings && numberFields(dimensions.label, {
140
+ width: {
141
+ label: 'Width (px)',
142
+ suffix: 'px',
143
+ min: 100,
144
+ max: 1200
145
+ },
146
+ height: {
147
+ label: 'Height (px)',
148
+ suffix: 'px',
149
+ min: 100,
150
+ max: 500
151
+ }
152
+ }),
153
+ 'multiple.enabled': multiple.settings && toggle(multiple.label, true),
154
+ promptEnabled: prompt.settings && toggle(prompt.label),
155
+ feedbackEnabled: feedback.settings && toggle(feedback.label),
156
+ annotationsEnabled: annotations.settings && toggle(annotations.label),
157
+ spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
158
+ playerSpellCheckDisabled: playerSpellCheck.settings && toggle(playerSpellCheck.label)
159
+ };
160
+ const panelProperties = {
161
+ teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
162
+ studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
163
+ rubricEnabled: withRubric?.settings && toggle(withRubric?.label)
164
+ };
165
+ const getPluginProps = props => {
166
+ return Object.assign({
167
+ ...baseInputConfiguration
168
+ }, props || {});
169
+ };
170
+ return /*#__PURE__*/_react.default.createElement(_configUi.layout.ConfigLayout, {
171
+ extraCSSRules: extraCSSRules,
172
+ dimensions: contentDimensions,
173
+ hideSettings: settingsPanelDisabled,
174
+ settings: /*#__PURE__*/_react.default.createElement(Panel, {
175
+ model: model,
176
+ configuration: configuration,
177
+ onChangeModel: model => onModelChanged(model),
178
+ onChangeConfiguration: config => onConfigurationChanged(config),
179
+ groups: {
180
+ Settings: panelSettings,
181
+ Properties: panelProperties
182
+ }
183
+ })
184
+ }, teacherInstructionsEnabled && /*#__PURE__*/_react.default.createElement(PromptContainer, {
185
+ label: teacherInstructions.label
186
+ }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
187
+ className: "prompt",
188
+ markup: model.teacherInstructions || '',
189
+ onChange: this.changeTeacherInstructions,
190
+ imageSupport: imageSupport,
191
+ nonEmpty: false,
192
+ error: teacherInstructionsError,
193
+ toolbarOpts: toolbarOpts,
194
+ spellCheck: spellCheckEnabled,
195
+ maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
196
+ maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
197
+ uploadSoundSupport: uploadSoundSupport,
198
+ languageCharactersProps: [{
199
+ language: 'spanish'
200
+ }, {
201
+ language: 'special'
202
+ }],
203
+ mathMlOptions: mathMlOptions,
204
+ pluginProps: getPluginProps(teacherInstructions?.inputConfiguration)
205
+ }), teacherInstructionsError && /*#__PURE__*/_react.default.createElement(ErrorText, null, teacherInstructionsError)), promptEnabled && /*#__PURE__*/_react.default.createElement(PromptContainer, {
206
+ label: prompt.label
207
+ }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
208
+ activePlugins: _editableHtml.ALL_PLUGINS,
209
+ className: "prompt",
210
+ markup: model.prompt || '',
211
+ onChange: this.onPromptChange,
212
+ imageSupport: imageSupport,
213
+ nonEmpty: false,
214
+ error: promptError,
215
+ toolbarOpts: toolbarOpts,
216
+ spellCheck: spellCheckEnabled,
217
+ maxImageWidth: defaultImageMaxWidth,
218
+ maxImageHeight: defaultImageMaxHeight,
219
+ uploadSoundSupport: uploadSoundSupport,
220
+ languageCharactersProps: [{
221
+ language: 'spanish'
222
+ }, {
223
+ language: 'special'
224
+ }],
225
+ mathMlOptions: mathMlOptions,
226
+ pluginProps: getPluginProps(prompt?.inputConfiguration)
227
+ }), promptError && /*#__PURE__*/_react.default.createElement(ErrorText, null, promptError)), feedbackEnabled && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(StyledHeader, {
228
+ variant: "h6"
229
+ }, "Feedback"), /*#__PURE__*/_react.default.createElement(_configUi.FeedbackSelector, {
230
+ label: "When submitted, show",
231
+ feedback: model.feedback || defaultFeedback,
232
+ onChange: this.changeFeedback,
233
+ toolbarOpts: toolbarOpts
234
+ })));
235
+ }
236
+ }
292
237
  exports.Main = Main;
293
- (0, _defineProperty2["default"])(Main, "propTypes", {
294
- onModelChanged: _propTypes["default"].func.isRequired,
295
- onConfigurationChanged: _propTypes["default"].func,
296
- model: _propTypes["default"].object.isRequired,
297
- configuration: _propTypes["default"].object.isRequired,
298
- imageSupport: _propTypes["default"].object.isRequired,
299
- uploadSoundSupport: _propTypes["default"].object.isRequired,
300
- classes: _propTypes["default"].object.isRequired
238
+ (0, _defineProperty2.default)(Main, "propTypes", {
239
+ onModelChanged: _propTypes.default.func.isRequired,
240
+ onConfigurationChanged: _propTypes.default.func,
241
+ model: _propTypes.default.object.isRequired,
242
+ configuration: _propTypes.default.object.isRequired,
243
+ imageSupport: _propTypes.default.object.isRequired,
244
+ uploadSoundSupport: _propTypes.default.object.isRequired
301
245
  });
302
-
303
- var _default = (0, _styles.withStyles)(function (theme) {
304
- return {
305
- header: {
306
- paddingBottom: theme.spacing.unit
307
- },
308
- promptContainer: {
309
- paddingTop: theme.spacing.unit * 2,
310
- marginBottom: theme.spacing.unit * 2,
311
- width: '100%'
312
- },
313
- errorText: {
314
- fontSize: theme.typography.fontSize - 2,
315
- color: theme.palette.error.main,
316
- paddingTop: theme.spacing.unit
317
- }
318
- };
319
- })(Main);
320
-
321
- exports["default"] = _default;
246
+ var _default = exports.default = Main;
322
247
  //# sourceMappingURL=main.js.map