@pie-element/inline-dropdown 3.9.9 → 3.10.1-beta.1443

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.
@@ -45,15 +45,11 @@ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
45
45
 
46
46
  var _reduce = _interopRequireDefault(require("lodash/reduce"));
47
47
 
48
- var _styles = require("@material-ui/core/styles");
49
-
50
- var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
51
-
52
- var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
48
+ var _max = _interopRequireDefault(require("lodash/max"));
53
49
 
54
- var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
50
+ var _styles = require("@material-ui/core/styles");
55
51
 
56
- var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
52
+ var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
57
53
 
58
54
  var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
59
55
 
@@ -65,17 +61,19 @@ var _ExpansionPanelDetails = _interopRequireDefault(require("@material-ui/core/E
65
61
 
66
62
  var _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore"));
67
63
 
64
+ var _Info = _interopRequireDefault(require("@material-ui/icons/Info"));
65
+
68
66
  var _inlineDropdownToolbar = _interopRequireDefault(require("./inline-dropdown-toolbar"));
69
67
 
70
- var _max = _interopRequireDefault(require("lodash/max"));
68
+ var _utils = require("./utils");
71
69
 
72
70
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
73
71
 
74
72
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
75
73
 
76
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
74
+ 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; }
77
75
 
78
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
76
+ 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; }
79
77
 
80
78
  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); }; }
81
79
 
@@ -84,29 +82,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
84
82
  var toggle = _configUi.settings.toggle,
85
83
  Panel = _configUi.settings.Panel;
86
84
 
87
- var InfoDialog = function InfoDialog(_ref) {
88
- var open = _ref.open,
89
- onCancel = _ref.onCancel,
90
- onOk = _ref.onOk,
91
- title = _ref.title;
92
- return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
93
- open: open
94
- }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], null, title), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, onOk && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
95
- onClick: onOk,
96
- color: "primary"
97
- }, "OK"), onCancel && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
98
- onClick: onCancel,
99
- color: "primary"
100
- }, "Cancel")));
101
- };
102
-
103
- InfoDialog.propTypes = {
104
- open: _propTypes["default"].bool,
105
- onCancel: _propTypes["default"].func,
106
- onOk: _propTypes["default"].func,
107
- title: _propTypes["default"].string
108
- };
109
-
110
85
  var styles = function styles(theme) {
111
86
  return {
112
87
  promptHolder: {
@@ -142,19 +117,35 @@ var styles = function styles(theme) {
142
117
  },
143
118
  text: {
144
119
  fontFamily: 'Cerebri Sans',
145
- fontSize: '16px',
120
+ fontSize: theme.typography.fontSize + 2,
146
121
  lineHeight: '19px',
147
- color: '#495B8F'
122
+ color: '#495B8F',
123
+ marginRight: theme.spacing.unit
148
124
  },
149
125
  rationaleLabel: {
150
126
  display: 'flex',
151
127
  whiteSpace: 'break-spaces'
152
128
  },
153
129
  rationaleChoices: {
154
- marginTop: '16px'
130
+ marginTop: theme.spacing.unit * 2
155
131
  },
156
132
  panelDetails: {
157
133
  display: 'block'
134
+ },
135
+ flexContainer: {
136
+ display: 'flex',
137
+ alignItems: 'center',
138
+ marginBottom: theme.spacing.unit
139
+ },
140
+ tooltip: {
141
+ fontSize: theme.typography.fontSize - 2,
142
+ whiteSpace: 'pre',
143
+ maxWidth: '500px'
144
+ },
145
+ errorText: {
146
+ fontSize: theme.typography.fontSize - 2,
147
+ color: 'red',
148
+ paddingTop: theme.spacing.unit
158
149
  }
159
150
  };
160
151
  };
@@ -188,7 +179,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
188
179
 
189
180
  _this = _super.call.apply(_super, [this].concat(args));
190
181
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
191
- dialog: {
182
+ warning: {
192
183
  open: false
193
184
  }
194
185
  });
@@ -226,22 +217,22 @@ var Main = /*#__PURE__*/function (_React$Component) {
226
217
  });
227
218
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheck", function (callback) {
228
219
  _this.setState({
229
- dialog: {
220
+ warning: {
230
221
  open: true,
231
- message: 'Response areas with under 2 options or with no correct answers will be discarded',
232
- onOk: function onOk() {
222
+ text: 'Response areas with under 2 options or with no correct answers will be discarded.',
223
+ onClose: function onClose() {
233
224
  _this.setState({
234
- dialog: {
225
+ warning: {
235
226
  open: false
236
227
  }
237
- }, callback);
228
+ });
238
229
  },
239
- onCancel: function onCancel() {
240
- return _this.setState({
241
- dialog: {
230
+ onConfirm: function onConfirm() {
231
+ _this.setState({
232
+ warning: {
242
233
  open: false
243
234
  }
244
- });
235
+ }, callback);
245
236
  }
246
237
  }
247
238
  });
@@ -279,12 +270,19 @@ var Main = /*#__PURE__*/function (_React$Component) {
279
270
 
280
271
  if (shouldWarn) {
281
272
  _this.setState({
282
- dialog: {
273
+ warning: {
283
274
  open: true,
284
- message: 'Response areas with under 2 options or with no correct answers will be discarded',
285
- onOk: function onOk() {
275
+ text: 'Response areas with under 2 options or with no correct answers will be discarded.',
276
+ onClose: function onClose() {
286
277
  _this.setState({
287
- dialog: {
278
+ warning: {
279
+ open: false
280
+ }
281
+ });
282
+ },
283
+ onConfirm: function onConfirm() {
284
+ _this.setState({
285
+ warning: {
288
286
  open: false
289
287
  }
290
288
  }, function () {
@@ -293,13 +291,6 @@ var Main = /*#__PURE__*/function (_React$Component) {
293
291
  slateMarkup: domMarkup.innerHTML
294
292
  });
295
293
  });
296
- },
297
- onCancel: function onCancel() {
298
- return _this.setState({
299
- dialog: {
300
- open: false
301
- }
302
- });
303
294
  }
304
295
  }
305
296
  });
@@ -312,6 +303,26 @@ var Main = /*#__PURE__*/function (_React$Component) {
312
303
  });
313
304
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onAddChoice", function (index, label) {
314
305
  var respAreaChoices = _this.state.respAreaChoices;
306
+ var maxResponseAreaChoices = _this.props.configuration.maxResponseAreaChoices;
307
+
308
+ if (respAreaChoices[index] && respAreaChoices[index].length >= maxResponseAreaChoices) {
309
+ _this.setState({
310
+ warning: {
311
+ open: true,
312
+ text: "There are only ".concat(maxResponseAreaChoices, " answers allowed per choice."),
313
+ onClose: undefined,
314
+ onConfirm: function onConfirm() {
315
+ _this.setState({
316
+ warning: {
317
+ open: false
318
+ }
319
+ });
320
+ }
321
+ }
322
+ });
323
+
324
+ return;
325
+ }
315
326
 
316
327
  if (!respAreaChoices[index]) {
317
328
  respAreaChoices[index] = [];
@@ -321,12 +332,13 @@ var Main = /*#__PURE__*/function (_React$Component) {
321
332
  return prepareVal(r.label) === prepareVal(label);
322
333
  })) {
323
334
  _this.setState({
324
- dialog: {
335
+ warning: {
325
336
  open: true,
326
- message: 'Duplicate answers are not allowed.',
327
- onOk: function onOk() {
337
+ text: 'Duplicate answers are not allowed.',
338
+ onClose: undefined,
339
+ onConfirm: function onConfirm() {
328
340
  _this.setState({
329
- dialog: {
341
+ warning: {
330
342
  open: false
331
343
  }
332
344
  });
@@ -362,8 +374,8 @@ var Main = /*#__PURE__*/function (_React$Component) {
362
374
  });
363
375
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSelectChoice", function (respIndex, selectedIndex) {
364
376
  var respAreaChoices = _this.state.respAreaChoices;
365
- respAreaChoices[respIndex] = respAreaChoices[respIndex].map(function (ch, index) {
366
- return _objectSpread(_objectSpread({}, ch), {}, {
377
+ respAreaChoices[respIndex] = respAreaChoices[respIndex].map(function (choice, index) {
378
+ return _objectSpread(_objectSpread({}, choice), {}, {
367
379
  correct: index === selectedIndex
368
380
  });
369
381
  });
@@ -409,37 +421,58 @@ var Main = /*#__PURE__*/function (_React$Component) {
409
421
  value: function render() {
410
422
  var _this2 = this;
411
423
 
412
- var dialog = this.state.dialog;
424
+ var warning = this.state.warning;
413
425
  var _this$props = this.props,
414
426
  classes = _this$props.classes,
415
427
  model = _this$props.model,
416
428
  configuration = _this$props.configuration,
417
429
  onConfigurationChanged = _this$props.onConfigurationChanged,
418
- imageSupport = _this$props.imageSupport;
419
-
420
- var _ref2 = configuration || {},
421
- _ref2$prompt = _ref2.prompt,
422
- prompt = _ref2$prompt === void 0 ? {} : _ref2$prompt,
423
- _ref2$partialScoring = _ref2.partialScoring,
424
- partialScoring = _ref2$partialScoring === void 0 ? {} : _ref2$partialScoring,
425
- _ref2$lockChoiceOrder = _ref2.lockChoiceOrder,
426
- lockChoiceOrder = _ref2$lockChoiceOrder === void 0 ? {} : _ref2$lockChoiceOrder,
427
- _ref2$rationale = _ref2.rationale,
428
- rationale = _ref2$rationale === void 0 ? {} : _ref2$rationale,
429
- _ref2$choiceRationale = _ref2.choiceRationale,
430
- choiceRationale = _ref2$choiceRationale === void 0 ? {} : _ref2$choiceRationale,
431
- _ref2$teacherInstruct = _ref2.teacherInstructions,
432
- teacherInstructions = _ref2$teacherInstruct === void 0 ? {} : _ref2$teacherInstruct;
433
-
434
- var _ref3 = model || {},
435
- rationaleEnabled = _ref3.rationaleEnabled,
436
- choiceRationaleEnabled = _ref3.choiceRationaleEnabled,
437
- promptEnabled = _ref3.promptEnabled,
438
- teacherInstructionsEnabled = _ref3.teacherInstructionsEnabled,
439
- choices = _ref3.choices;
430
+ imageSupport = _this$props.imageSupport,
431
+ uploadSoundSupport = _this$props.uploadSoundSupport;
432
+
433
+ var _ref = configuration || {},
434
+ _ref$choiceRationale = _ref.choiceRationale,
435
+ choiceRationale = _ref$choiceRationale === void 0 ? {} : _ref$choiceRationale,
436
+ _ref$lockChoiceOrder = _ref.lockChoiceOrder,
437
+ lockChoiceOrder = _ref$lockChoiceOrder === void 0 ? {} : _ref$lockChoiceOrder,
438
+ maxResponseAreas = _ref.maxResponseAreas,
439
+ _ref$maxImageWidth = _ref.maxImageWidth,
440
+ maxImageWidth = _ref$maxImageWidth === void 0 ? {} : _ref$maxImageWidth,
441
+ _ref$maxImageHeight = _ref.maxImageHeight,
442
+ maxImageHeight = _ref$maxImageHeight === void 0 ? {} : _ref$maxImageHeight,
443
+ _ref$partialScoring = _ref.partialScoring,
444
+ partialScoring = _ref$partialScoring === void 0 ? {} : _ref$partialScoring,
445
+ _ref$prompt = _ref.prompt,
446
+ prompt = _ref$prompt === void 0 ? {} : _ref$prompt,
447
+ _ref$rationale = _ref.rationale,
448
+ rationale = _ref$rationale === void 0 ? {} : _ref$rationale,
449
+ settingsPanelDisabled = _ref.settingsPanelDisabled,
450
+ _ref$spellCheck = _ref.spellCheck,
451
+ spellCheck = _ref$spellCheck === void 0 ? {} : _ref$spellCheck,
452
+ _ref$teacherInstructi = _ref.teacherInstructions,
453
+ teacherInstructions = _ref$teacherInstructi === void 0 ? {} : _ref$teacherInstructi,
454
+ _ref$withRubric = _ref.withRubric,
455
+ withRubric = _ref$withRubric === void 0 ? {} : _ref$withRubric;
456
+
457
+ var _ref2 = model || {},
458
+ choiceRationaleEnabled = _ref2.choiceRationaleEnabled,
459
+ choices = _ref2.choices,
460
+ errors = _ref2.errors,
461
+ promptEnabled = _ref2.promptEnabled,
462
+ rationaleEnabled = _ref2.rationaleEnabled,
463
+ spellCheckEnabled = _ref2.spellCheckEnabled,
464
+ teacherInstructionsEnabled = _ref2.teacherInstructionsEnabled,
465
+ toolbarEditorPosition = _ref2.toolbarEditorPosition;
466
+
467
+ var _ref3 = errors || {},
468
+ responseAreasError = _ref3.responseAreasError,
469
+ responseAreaChoicesError = _ref3.responseAreaChoicesError;
470
+
471
+ var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
472
+ var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
440
473
 
441
474
  var renderChoiceRationale = function renderChoiceRationale() {
442
- return (Object.keys(choices) || []).map(function (key) {
475
+ return (Object.keys(choices) || []).map(function (key, index) {
443
476
  return /*#__PURE__*/_react["default"].createElement("div", {
444
477
  key: key,
445
478
  className: classes.rationaleChoices
@@ -447,7 +480,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
447
480
  expandIcon: /*#__PURE__*/_react["default"].createElement(_ExpandMore["default"], null)
448
481
  }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
449
482
  className: classes.text
450
- }, "Rationale for response area #".concat(parseInt(key) + 1))), /*#__PURE__*/_react["default"].createElement(_ExpansionPanelDetails["default"], {
483
+ }, "Rationale for response area #".concat(index + 1))), /*#__PURE__*/_react["default"].createElement(_ExpansionPanelDetails["default"], {
451
484
  className: classes.panelDetails
452
485
  }, (choices[key] || []).map(function (choice) {
453
486
  return /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
@@ -462,32 +495,41 @@ var Main = /*#__PURE__*/function (_React$Component) {
462
495
  }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
463
496
  className: classes.prompt,
464
497
  markup: choice.rationale || '',
498
+ spellCheck: spellCheckEnabled,
465
499
  onChange: function onChange(c) {
466
500
  return _this2.onChoiceRationaleChanged(key, _objectSpread(_objectSpread({}, choice), {}, {
467
501
  rationale: c
468
502
  }));
469
503
  },
470
- imageSupport: imageSupport
504
+ imageSupport: imageSupport,
505
+ maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
506
+ maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight,
507
+ uploadSoundSupport: uploadSoundSupport
471
508
  }));
472
509
  }))));
473
510
  });
474
511
  };
475
512
 
476
- var toolbarOpts = {};
477
-
478
- switch (model.toolbarEditorPosition) {
479
- case 'top':
480
- toolbarOpts.position = 'top';
481
- break;
482
-
483
- default:
484
- toolbarOpts.position = 'bottom';
485
- break;
486
- }
487
-
513
+ var toolbarOpts = {
514
+ position: toolbarEditorPosition === 'top' ? 'top' : 'bottom'
515
+ };
516
+ var validationMessage = (0, _utils.generateValidationMessage)(configuration);
517
+ var panelSettings = {
518
+ partialScoring: partialScoring.settings && toggle(partialScoring.label),
519
+ lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label)
520
+ };
521
+ var panelProperties = {
522
+ teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
523
+ rationaleEnabled: rationale.settings && toggle(rationale.label),
524
+ choiceRationaleEnabled: choiceRationale.settings && toggle(choiceRationale.label),
525
+ promptEnabled: prompt.settings && toggle(prompt.label),
526
+ spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
527
+ rubricEnabled: (withRubric === null || withRubric === void 0 ? void 0 : withRubric.settings) && toggle(withRubric === null || withRubric === void 0 ? void 0 : withRubric.label)
528
+ };
488
529
  return /*#__PURE__*/_react["default"].createElement("div", {
489
530
  className: classes.design
490
531
  }, /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
532
+ hideSettings: settingsPanelDisabled,
491
533
  settings: /*#__PURE__*/_react["default"].createElement(Panel, {
492
534
  model: model,
493
535
  configuration: configuration,
@@ -498,16 +540,8 @@ var Main = /*#__PURE__*/function (_React$Component) {
498
540
  return onConfigurationChanged(configuration, true);
499
541
  },
500
542
  groups: {
501
- Settings: {
502
- partialScoring: partialScoring.settings && toggle(partialScoring.label),
503
- lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label)
504
- },
505
- Properties: {
506
- teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
507
- rationaleEnabled: rationale.settings && toggle(rationale.label),
508
- choiceRationaleEnabled: choiceRationale.settings && toggle(choiceRationale.label),
509
- promptEnabled: prompt.settings && toggle(prompt.label)
510
- }
543
+ Settings: panelSettings,
544
+ Properties: panelProperties
511
545
  }
512
546
  })
513
547
  }, /*#__PURE__*/_react["default"].createElement("div", null, teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
@@ -519,7 +553,16 @@ var Main = /*#__PURE__*/function (_React$Component) {
519
553
  onChange: this.onTeacherInstructionsChanged,
520
554
  imageSupport: imageSupport,
521
555
  nonEmpty: false,
522
- toolbarOpts: toolbarOpts
556
+ toolbarOpts: toolbarOpts,
557
+ spellCheck: spellCheckEnabled,
558
+ maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
559
+ maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
560
+ uploadSoundSupport: uploadSoundSupport,
561
+ languageCharactersProps: [{
562
+ language: 'spanish'
563
+ }, {
564
+ language: 'special'
565
+ }]
523
566
  })), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
524
567
  label: prompt.label,
525
568
  className: classes.promptHolder
@@ -530,7 +573,16 @@ var Main = /*#__PURE__*/function (_React$Component) {
530
573
  imageSupport: imageSupport,
531
574
  nonEmpty: false,
532
575
  disableUnderline: true,
533
- toolbarOpts: toolbarOpts
576
+ toolbarOpts: toolbarOpts,
577
+ spellCheck: spellCheckEnabled,
578
+ maxImageWidth: defaultImageMaxWidth,
579
+ maxImageHeight: defaultImageMaxHeight,
580
+ uploadSoundSupport: uploadSoundSupport,
581
+ languageCharactersProps: [{
582
+ language: 'spanish'
583
+ }, {
584
+ language: 'special'
585
+ }]
534
586
  })), rationaleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
535
587
  label: rationale.label,
536
588
  className: classes.promptHolder
@@ -539,15 +591,32 @@ var Main = /*#__PURE__*/function (_React$Component) {
539
591
  markup: model.rationale || '',
540
592
  onChange: this.onRationaleChanged,
541
593
  imageSupport: imageSupport,
542
- toolbarOpts: toolbarOpts
543
- })), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
594
+ toolbarOpts: toolbarOpts,
595
+ spellCheck: spellCheckEnabled,
596
+ maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
597
+ maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight,
598
+ uploadSoundSupport: uploadSoundSupport,
599
+ languageCharactersProps: [{
600
+ language: 'spanish'
601
+ }, {
602
+ language: 'special'
603
+ }]
604
+ })), /*#__PURE__*/_react["default"].createElement("div", {
605
+ className: classes.flexContainer
606
+ }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
544
607
  className: classes.text
545
- }, "Define Template, Choices, and Correct Responses"), /*#__PURE__*/_react["default"].createElement(InfoDialog, {
546
- open: dialog.open,
547
- title: dialog.message,
548
- onCancel: dialog.onCancel,
549
- onOk: dialog.onOk
550
- }), /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
608
+ }, "Define Template, Choices, and Correct Responses"), /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
609
+ classes: {
610
+ tooltip: classes.tooltip
611
+ },
612
+ disableFocusListener: true,
613
+ disableTouchListener: true,
614
+ placement: 'right',
615
+ title: validationMessage
616
+ }, /*#__PURE__*/_react["default"].createElement(_Info["default"], {
617
+ fontSize: 'small',
618
+ color: 'primary'
619
+ }))), /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
551
620
  activePlugins: _editableHtml.ALL_PLUGINS,
552
621
  toolbarOpts: {
553
622
  position: 'top'
@@ -557,6 +626,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
557
626
  options: {
558
627
  duplicates: true
559
628
  },
629
+ maxResponseAreas: maxResponseAreas,
560
630
  respAreaToolbar: function respAreaToolbar(node, value, onToolbarDone) {
561
631
  var respAreaChoices = _this2.state.respAreaChoices;
562
632
  return function () {
@@ -572,19 +642,40 @@ var Main = /*#__PURE__*/function (_React$Component) {
572
642
  node: node,
573
643
  value: value,
574
644
  onToolbarDone: onToolbarDone,
575
- choices: respAreaChoices[node.data.get('index')]
645
+ choices: respAreaChoices[node.data.get('index')],
646
+ spellCheck: spellCheckEnabled,
647
+ uploadSoundSupport: uploadSoundSupport
576
648
  });
577
649
  };
578
650
  }
579
651
  },
652
+ spellCheck: spellCheckEnabled,
580
653
  className: classes.markup,
581
654
  markup: model.slateMarkup || '',
582
655
  onChange: this.onChange,
583
656
  imageSupport: imageSupport,
657
+ disableImageAlignmentButtons: true,
584
658
  onBlur: this.onBlur,
585
659
  disabled: false,
586
- highlightShape: false
587
- }), /*#__PURE__*/_react["default"].createElement("br", null), choiceRationaleEnabled && renderChoiceRationale())));
660
+ highlightShape: false,
661
+ error: responseAreasError,
662
+ uploadSoundSupport: uploadSoundSupport,
663
+ languageCharactersProps: [{
664
+ language: 'spanish'
665
+ }, {
666
+ language: 'special'
667
+ }]
668
+ }), responseAreasError && /*#__PURE__*/_react["default"].createElement("div", {
669
+ className: classes.errorText
670
+ }, responseAreasError), responseAreaChoicesError && /*#__PURE__*/_react["default"].createElement("div", {
671
+ className: classes.errorText
672
+ }, responseAreaChoicesError), /*#__PURE__*/_react["default"].createElement("br", null), choiceRationaleEnabled && renderChoiceRationale(), /*#__PURE__*/_react["default"].createElement(_configUi.AlertDialog, {
673
+ open: warning.open,
674
+ title: "Warning",
675
+ text: warning.text,
676
+ onClose: warning.onClose,
677
+ onConfirm: warning.onConfirm
678
+ }))));
588
679
  }
589
680
  }]);
590
681
  return Main;
@@ -601,6 +692,10 @@ exports.Main = Main;
601
692
  imageSupport: _propTypes["default"].shape({
602
693
  add: _propTypes["default"].func.isRequired,
603
694
  "delete": _propTypes["default"].func.isRequired
695
+ }),
696
+ uploadSoundSupport: _propTypes["default"].shape({
697
+ add: _propTypes["default"].func.isRequired,
698
+ "delete": _propTypes["default"].func.isRequired
604
699
  })
605
700
  });
606
701
  var Styled = (0, _styles.withStyles)(styles)(Main);