@pie-element/math-inline 11.0.5-esm.1 → 11.1.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/configure/CHANGELOG.md +69 -0
  3. package/configure/lib/configure.js +162 -240
  4. package/configure/lib/configure.js.map +1 -1
  5. package/configure/lib/defaults.js +8 -8
  6. package/configure/lib/defaults.js.map +1 -1
  7. package/configure/lib/general-config-block.js +447 -564
  8. package/configure/lib/general-config-block.js.map +1 -1
  9. package/configure/lib/index.js +111 -176
  10. package/configure/lib/index.js.map +1 -1
  11. package/configure/lib/response.js +330 -388
  12. package/configure/lib/response.js.map +1 -1
  13. package/configure/lib/utils.js +15 -30
  14. package/configure/lib/utils.js.map +1 -1
  15. package/configure/package.json +14 -12
  16. package/controller/CHANGELOG.md +49 -0
  17. package/controller/lib/defaults.js +5 -8
  18. package/controller/lib/defaults.js.map +1 -1
  19. package/controller/lib/index.js +189 -278
  20. package/controller/lib/index.js.map +1 -1
  21. package/controller/lib/utils.js +1 -2
  22. package/controller/lib/utils.js.map +1 -1
  23. package/controller/package.json +7 -7
  24. package/lib/index.js +72 -125
  25. package/lib/index.js.map +1 -1
  26. package/lib/main.js +784 -889
  27. package/lib/main.js.map +1 -1
  28. package/lib/print.js +43 -84
  29. package/lib/print.js.map +1 -1
  30. package/lib/simple-question-block.js +125 -162
  31. package/lib/simple-question-block.js.map +1 -1
  32. package/lib/utils.js +1 -2
  33. package/lib/utils.js.map +1 -1
  34. package/module/configure.js +1 -1
  35. package/module/controller.js +2319 -2930
  36. package/module/element.js +1 -1
  37. package/module/index.html +1 -1
  38. package/module/manifest.json +7 -3
  39. package/module/print.html +1 -1
  40. package/module/print.js +1 -1
  41. package/package.json +21 -33
  42. package/esm/configure.css +0 -847
  43. package/esm/configure.js +0 -1769
  44. package/esm/configure.js.map +0 -1
  45. package/esm/controller.css +0 -847
  46. package/esm/controller.js +0 -416
  47. package/esm/controller.js.map +0 -1
  48. package/esm/element.css +0 -847
  49. package/esm/element.js +0 -1476
  50. package/esm/element.js.map +0 -1
  51. package/esm/print.css +0 -847
  52. package/esm/print.js +0 -1288
  53. package/esm/print.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,76 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@10.3.1...@pie-element/math-inline@10.3.2) (2025-10-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * bump libs PD-5265 ([184a978](https://github.com/pie-framework/pie-elements/commit/184a978f57a2a84dc6ba87c1eba0b92d5cdd9eae))
12
+
13
+
14
+
15
+
16
+
17
+ ## [10.3.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@10.2.1...@pie-element/math-inline@10.3.1) (2025-10-16)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * bump pie-lib versions and pslb module versions ([393d39f](https://github.com/pie-framework/pie-elements/commit/393d39fb850ad055568f4d20464213e9043f208f))
23
+ * remove deprecated ReactDOM.findDOMNode from math-inline ([b6267be](https://github.com/pie-framework/pie-elements/commit/b6267be95153d5f6d9f4b46ed431859d6e99b7d5))
24
+
25
+
26
+
27
+
28
+
29
+ # [10.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@10.2.0...@pie-element/math-inline@10.3.0) (2025-10-15)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * bump libs ([2616ab2](https://github.com/pie-framework/pie-elements/commit/2616ab24f776f4df02302f5855c381ee52527665))
35
+
36
+
37
+
38
+
39
+
40
+ ## [10.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@10.2.0...@pie-element/math-inline@10.2.1) (2025-10-14)
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * bump libs ([2616ab2](https://github.com/pie-framework/pie-elements/commit/2616ab24f776f4df02302f5855c381ee52527665))
46
+
47
+
48
+
49
+
50
+
51
+ # [10.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@10.0.0...@pie-element/math-inline@10.2.0) (2025-10-10)
52
+
53
+
54
+ ### Bug Fixes
55
+
56
+ * conclude merge with develop ([8388078](https://github.com/pie-framework/pie-elements/commit/8388078124486bdab0def8dbe5e442117514c05a))
57
+
58
+
59
+ ### Features
60
+
61
+ * allow elemnts to use same fontFamily set in common ui container to avoid incons PD-5199 ([8b1742e](https://github.com/pie-framework/pie-elements/commit/8b1742e06c9befe1e81bf6a76c72448c91b2429b))
62
+ * update libs PD-5208, PD-5211, PD-5199, PD-5218, PD-5217 ([da327fa](https://github.com/pie-framework/pie-elements/commit/da327fa501f6e9eff1c0b30b5ef092426a91f78b))
63
+
64
+
65
+
66
+
67
+
68
+ # [10.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@9.0.0...@pie-element/math-inline@10.1.0) (2025-10-07)
69
+
70
+ **Note:** Version bump only for package @pie-element/math-inline
71
+
72
+
73
+
74
+
75
+
6
76
  # [10.0.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@8.8.11...@pie-element/math-inline@10.0.0) (2025-10-02)
7
77
 
8
78
 
@@ -3,6 +3,75 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [9.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@9.3.1...@pie-element/math-inline-configure@9.3.2) (2025-10-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * bump libs PD-5265 ([184a978](https://github.com/pie-framework/pie-elements/commit/184a978f57a2a84dc6ba87c1eba0b92d5cdd9eae))
12
+
13
+
14
+
15
+
16
+
17
+ ## [9.3.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@9.2.1...@pie-element/math-inline-configure@9.3.1) (2025-10-16)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * bump pie-lib versions and pslb module versions ([393d39f](https://github.com/pie-framework/pie-elements/commit/393d39fb850ad055568f4d20464213e9043f208f))
23
+
24
+
25
+
26
+
27
+
28
+ # [9.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@9.2.0...@pie-element/math-inline-configure@9.3.0) (2025-10-15)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * bump libs ([2616ab2](https://github.com/pie-framework/pie-elements/commit/2616ab24f776f4df02302f5855c381ee52527665))
34
+
35
+
36
+
37
+
38
+
39
+ ## [9.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@9.2.0...@pie-element/math-inline-configure@9.2.1) (2025-10-14)
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * bump libs ([2616ab2](https://github.com/pie-framework/pie-elements/commit/2616ab24f776f4df02302f5855c381ee52527665))
45
+
46
+
47
+
48
+
49
+
50
+ # [9.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@9.0.1...@pie-element/math-inline-configure@9.2.0) (2025-10-10)
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * conclude merge with develop ([8388078](https://github.com/pie-framework/pie-elements/commit/8388078124486bdab0def8dbe5e442117514c05a))
56
+
57
+
58
+ ### Features
59
+
60
+ * allow elemnts to use same fontFamily set in common ui container to avoid incons PD-5199 ([8b1742e](https://github.com/pie-framework/pie-elements/commit/8b1742e06c9befe1e81bf6a76c72448c91b2429b))
61
+ * update libs PD-5208, PD-5211, PD-5199, PD-5218, PD-5217 ([da327fa](https://github.com/pie-framework/pie-elements/commit/da327fa501f6e9eff1c0b30b5ef092426a91f78b))
62
+
63
+
64
+
65
+
66
+
67
+ # [9.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@9.0.0...@pie-element/math-inline-configure@9.1.0) (2025-10-07)
68
+
69
+ **Note:** Version bump only for package @pie-element/math-inline-configure
70
+
71
+
72
+
73
+
74
+
6
75
  ## [9.0.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@8.7.0...@pie-element/math-inline-configure@9.0.1) (2025-10-02)
7
76
 
8
77
  **Note:** Version bump only for package @pie-element/math-inline-configure
@@ -1,264 +1,186 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
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
-
7
+ exports.default = exports.Configure = void 0;
22
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
-
24
9
  var _react = _interopRequireDefault(require("react"));
25
-
26
- var _styles = require("@material-ui/core/styles");
27
-
10
+ var _styles = require("@mui/material/styles");
28
11
  var _configUi = require("@pie-lib/config-ui");
29
-
30
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
31
-
32
13
  var _debug = _interopRequireDefault(require("debug"));
33
-
34
- var _editableHtml = _interopRequireDefault(require("@pie-lib/editable-html"));
35
-
14
+ var _editableHtmlTipTap = _interopRequireDefault(require("@pie-lib/editable-html-tip-tap"));
36
15
  var _generalConfigBlock = _interopRequireDefault(require("./general-config-block"));
37
-
38
16
  var _utils = require("./utils");
39
-
40
- 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; }
41
-
42
- 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; }
43
-
44
- 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); }; }
45
-
46
- 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; } }
47
-
48
- var log = (0, _debug["default"])('@pie-element:math-inline:configure');
49
- var Panel = _configUi.settings.Panel,
50
- toggle = _configUi.settings.toggle,
51
- radio = _configUi.settings.radio,
52
- dropdown = _configUi.settings.dropdown;
53
-
54
- var styles = function styles(theme) {
55
- return {
56
- promptHolder: {
57
- width: '100%',
58
- paddingTop: theme.spacing.unit * 2,
59
- marginBottom: theme.spacing.unit * 2
60
- },
61
- errorText: {
62
- fontSize: theme.typography.fontSize - 2,
63
- color: theme.palette.error.main,
64
- paddingTop: theme.spacing.unit
65
- }
66
- };
67
- };
68
-
69
- var Configure = /*#__PURE__*/function (_React$Component) {
70
- (0, _inherits2["default"])(Configure, _React$Component);
71
-
72
- var _super = _createSuper(Configure);
73
-
74
- function Configure() {
75
- var _this;
76
-
77
- (0, _classCallCheck2["default"])(this, Configure);
78
-
79
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
80
- args[_key] = arguments[_key];
81
- }
82
-
83
- _this = _super.call.apply(_super, [this].concat(args));
84
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (model) {
85
- _this.props.onModelChanged(model);
17
+ const log = (0, _debug.default)('@pie-element:math-inline:configure');
18
+ const {
19
+ Panel,
20
+ toggle,
21
+ radio,
22
+ dropdown
23
+ } = _configUi.settings;
24
+ const PromptHolder = (0, _styles.styled)(_configUi.InputContainer)(({
25
+ theme
26
+ }) => ({
27
+ width: '100%',
28
+ paddingTop: theme.spacing(2),
29
+ marginBottom: theme.spacing(2)
30
+ }));
31
+ const ErrorText = (0, _styles.styled)('div')(({
32
+ theme
33
+ }) => ({
34
+ fontSize: theme.typography.fontSize - 2,
35
+ color: theme.palette.error.main,
36
+ paddingTop: theme.spacing(1)
37
+ }));
38
+ class Configure extends _react.default.Component {
39
+ constructor(...args) {
40
+ super(...args);
41
+ (0, _defineProperty2.default)(this, "onChange", model => {
42
+ this.props.onModelChanged(model);
86
43
  });
87
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeTeacherInstructions", function (teacherInstructions) {
88
- _this.props.onModelChanged(_objectSpread(_objectSpread({}, _this.props.model), {}, {
89
- teacherInstructions: teacherInstructions
90
- }));
44
+ (0, _defineProperty2.default)(this, "changeTeacherInstructions", teacherInstructions => {
45
+ this.props.onModelChanged({
46
+ ...this.props.model,
47
+ teacherInstructions
48
+ });
91
49
  });
92
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onFeedbackChange", function (feedback) {
93
- var _this$props = _this.props,
94
- model = _this$props.model,
95
- onModelChanged = _this$props.onModelChanged;
50
+ (0, _defineProperty2.default)(this, "onFeedbackChange", feedback => {
51
+ const {
52
+ model,
53
+ onModelChanged
54
+ } = this.props;
96
55
  model.feedback = feedback;
97
56
  onModelChanged(model);
98
57
  });
99
- return _this;
100
58
  }
101
-
102
- (0, _createClass2["default"])(Configure, [{
103
- key: "render",
104
- value: function render() {
105
- var _this$props2 = this.props,
106
- classes = _this$props2.classes,
107
- model = _this$props2.model,
108
- imageSupport = _this$props2.imageSupport,
109
- onModelChanged = _this$props2.onModelChanged,
110
- configuration = _this$props2.configuration,
111
- onConfigurationChanged = _this$props2.onConfigurationChanged,
112
- uploadSoundSupport = _this$props2.uploadSoundSupport;
113
-
114
- var _ref = configuration || {},
115
- _ref$allowTrailingZer = _ref.allowTrailingZeros,
116
- allowTrailingZeros = _ref$allowTrailingZer === void 0 ? {} : _ref$allowTrailingZer,
117
- _ref$baseInputConfigu = _ref.baseInputConfiguration,
118
- baseInputConfiguration = _ref$baseInputConfigu === void 0 ? {} : _ref$baseInputConfigu,
119
- _ref$contentDimension = _ref.contentDimensions,
120
- contentDimensions = _ref$contentDimension === void 0 ? {} : _ref$contentDimension,
121
- _ref$feedback = _ref.feedback,
122
- feedback = _ref$feedback === void 0 ? {} : _ref$feedback,
123
- _ref$ignoreOrder = _ref.ignoreOrder,
124
- ignoreOrder = _ref$ignoreOrder === void 0 ? {} : _ref$ignoreOrder,
125
- _ref$maxImageWidth = _ref.maxImageWidth,
126
- maxImageWidth = _ref$maxImageWidth === void 0 ? {} : _ref$maxImageWidth,
127
- _ref$maxImageHeight = _ref.maxImageHeight,
128
- maxImageHeight = _ref$maxImageHeight === void 0 ? {} : _ref$maxImageHeight,
129
- _ref$prompt = _ref.prompt,
130
- prompt = _ref$prompt === void 0 ? {} : _ref$prompt,
131
- _ref$rationale = _ref.rationale,
132
- rationale = _ref$rationale === void 0 ? {} : _ref$rationale,
133
- _ref$responseType = _ref.responseType,
134
- responseType = _ref$responseType === void 0 ? {} : _ref$responseType,
135
- _ref$scoringType = _ref.scoringType,
136
- scoringType = _ref$scoringType === void 0 ? {} : _ref$scoringType,
137
- settingsPanelDisabled = _ref.settingsPanelDisabled,
138
- _ref$spellCheck = _ref.spellCheck,
139
- spellCheck = _ref$spellCheck === void 0 ? {} : _ref$spellCheck,
140
- _ref$studentInstructi = _ref.studentInstructions,
141
- studentInstructions = _ref$studentInstructi === void 0 ? {} : _ref$studentInstructi,
142
- _ref$teacherInstructi = _ref.teacherInstructions,
143
- teacherInstructions = _ref$teacherInstructi === void 0 ? {} : _ref$teacherInstructi,
144
- _ref$withRubric = _ref.withRubric,
145
- withRubric = _ref$withRubric === void 0 ? {} : _ref$withRubric,
146
- _ref$mathMlOptions = _ref.mathMlOptions,
147
- mathMlOptions = _ref$mathMlOptions === void 0 ? {} : _ref$mathMlOptions,
148
- _ref$language = _ref.language,
149
- language = _ref$language === void 0 ? {} : _ref$language,
150
- _ref$languageChoices = _ref.languageChoices,
151
- languageChoices = _ref$languageChoices === void 0 ? {} : _ref$languageChoices;
152
-
153
- var _ref2 = model || {},
154
- _ref2$errors = _ref2.errors,
155
- errors = _ref2$errors === void 0 ? {} : _ref2$errors,
156
- extraCSSRules = _ref2.extraCSSRules,
157
- feedbackEnabled = _ref2.feedbackEnabled,
158
- promptEnabled = _ref2.promptEnabled,
159
- rationaleEnabled = _ref2.rationaleEnabled,
160
- spellCheckEnabled = _ref2.spellCheckEnabled,
161
- teacherInstructionsEnabled = _ref2.teacherInstructionsEnabled,
162
- toolbarEditorPosition = _ref2.toolbarEditorPosition;
163
-
164
- var teacherInstructionsError = errors.teacherInstructions;
165
- log('[render] model', model);
166
- var toolbarOpts = {
167
- position: toolbarEditorPosition === 'top' ? 'top' : 'bottom'
168
- };
169
- var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
170
- var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
171
- var panelSettings = {
172
- responseType: responseType.settings && radio(responseType.label, [_utils.ResponseTypes.simple, _utils.ResponseTypes.advanced]),
173
- feedbackEnabled: feedback.settings && toggle(feedback.label),
174
- promptEnabled: prompt.settings && toggle(prompt.label),
175
- 'language.enabled': language.settings && toggle(language.label, true),
176
- language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options)
177
- };
178
- var panelProperties = {
179
- teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
180
- studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
181
- rationaleEnabled: rationale.settings && toggle(rationale.label),
182
- spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
183
- scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),
184
- 'ignoreOrder.enabled': ignoreOrder.settings && toggle(ignoreOrder.label),
185
- 'allowTrailingZeros.enabled': allowTrailingZeros.settings && toggle(allowTrailingZeros.label),
186
- rubricEnabled: (withRubric === null || withRubric === void 0 ? void 0 : withRubric.settings) && toggle(withRubric === null || withRubric === void 0 ? void 0 : withRubric.label)
187
- };
188
- return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
189
- extraCSSRules: extraCSSRules,
190
- dimensions: contentDimensions,
191
- hideSettings: settingsPanelDisabled,
192
- settings: /*#__PURE__*/_react["default"].createElement(Panel, {
193
- model: model,
194
- configuration: configuration,
195
- onChangeModel: function onChangeModel(model) {
196
- return onModelChanged(model);
197
- },
198
- onChangeConfiguration: function onChangeConfiguration(config) {
199
- return onConfigurationChanged(config);
200
- },
201
- groups: {
202
- Settings: panelSettings,
203
- Properties: panelProperties
204
- }
205
- })
206
- }, teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
207
- label: teacherInstructions.label,
208
- className: classes.promptHolder
209
- }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
210
- className: classes.prompt,
211
- markup: model.teacherInstructions || '',
212
- onChange: this.changeTeacherInstructions,
213
- imageSupport: imageSupport,
214
- nonEmpty: false,
215
- error: teacherInstructionsError,
216
- toolbarOpts: toolbarOpts,
217
- pluginProps: (0, _utils.getPluginProps)(teacherInstructions === null || teacherInstructions === void 0 ? void 0 : teacherInstructions.inputConfiguration, baseInputConfiguration),
218
- spellCheck: spellCheckEnabled,
219
- maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
220
- maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
221
- uploadSoundSupport: uploadSoundSupport,
222
- languageCharactersProps: [{
223
- language: 'spanish'
224
- }, {
225
- language: 'special'
226
- }],
227
- mathMlOptions: mathMlOptions
228
- }), teacherInstructionsError && /*#__PURE__*/_react["default"].createElement("div", {
229
- className: classes.errorText
230
- }, teacherInstructionsError)), /*#__PURE__*/_react["default"].createElement(_generalConfigBlock["default"], {
231
- imageSupport: imageSupport,
232
- uploadSoundSupport: uploadSoundSupport,
59
+ render() {
60
+ const {
61
+ model,
62
+ imageSupport,
63
+ onModelChanged,
64
+ configuration,
65
+ onConfigurationChanged,
66
+ uploadSoundSupport
67
+ } = this.props;
68
+ const {
69
+ allowTrailingZeros = {},
70
+ baseInputConfiguration = {},
71
+ contentDimensions = {},
72
+ feedback = {},
73
+ ignoreOrder = {},
74
+ maxImageWidth = {},
75
+ maxImageHeight = {},
76
+ prompt = {},
77
+ rationale = {},
78
+ responseType = {},
79
+ scoringType = {},
80
+ settingsPanelDisabled,
81
+ spellCheck = {},
82
+ studentInstructions = {},
83
+ teacherInstructions = {},
84
+ withRubric = {},
85
+ mathMlOptions = {},
86
+ language = {},
87
+ languageChoices = {}
88
+ } = configuration || {};
89
+ const {
90
+ errors = {},
91
+ extraCSSRules,
92
+ feedbackEnabled,
93
+ promptEnabled,
94
+ rationaleEnabled,
95
+ spellCheckEnabled,
96
+ teacherInstructionsEnabled,
97
+ toolbarEditorPosition
98
+ } = model || {};
99
+ const {
100
+ teacherInstructions: teacherInstructionsError
101
+ } = errors;
102
+ log('[render] model', model);
103
+ const toolbarOpts = {
104
+ position: toolbarEditorPosition === 'top' ? 'top' : 'bottom'
105
+ };
106
+ const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
107
+ const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
108
+ const panelSettings = {
109
+ responseType: responseType.settings && radio(responseType.label, [_utils.ResponseTypes.simple, _utils.ResponseTypes.advanced]),
110
+ feedbackEnabled: feedback.settings && toggle(feedback.label),
111
+ promptEnabled: prompt.settings && toggle(prompt.label),
112
+ 'language.enabled': language.settings && toggle(language.label, true),
113
+ language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options)
114
+ };
115
+ const panelProperties = {
116
+ teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
117
+ studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
118
+ rationaleEnabled: rationale.settings && toggle(rationale.label),
119
+ spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
120
+ scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),
121
+ 'ignoreOrder.enabled': ignoreOrder.settings && toggle(ignoreOrder.label),
122
+ 'allowTrailingZeros.enabled': allowTrailingZeros.settings && toggle(allowTrailingZeros.label),
123
+ rubricEnabled: withRubric?.settings && toggle(withRubric?.label)
124
+ };
125
+ return /*#__PURE__*/_react.default.createElement(_configUi.layout.ConfigLayout, {
126
+ extraCSSRules: extraCSSRules,
127
+ dimensions: contentDimensions,
128
+ hideSettings: settingsPanelDisabled,
129
+ settings: /*#__PURE__*/_react.default.createElement(Panel, {
233
130
  model: model,
234
131
  configuration: configuration,
235
- onChange: this.onChange,
236
- rationaleEnabled: rationaleEnabled,
237
- promptEnabled: promptEnabled,
238
- toolbarOpts: toolbarOpts,
239
- spellCheck: spellCheckEnabled
240
- }), feedbackEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.FeedbackConfig, {
241
- feedback: model.feedback,
242
- onChange: this.onFeedbackChange,
243
- toolbarOpts: toolbarOpts
244
- }));
245
- }
246
- }]);
247
- return Configure;
248
- }(_react["default"].Component);
249
-
132
+ onChangeModel: model => onModelChanged(model),
133
+ onChangeConfiguration: config => onConfigurationChanged(config),
134
+ groups: {
135
+ Settings: panelSettings,
136
+ Properties: panelProperties
137
+ }
138
+ })
139
+ }, teacherInstructionsEnabled && /*#__PURE__*/_react.default.createElement(PromptHolder, {
140
+ label: teacherInstructions.label
141
+ }, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
142
+ markup: model.teacherInstructions || '',
143
+ onChange: this.changeTeacherInstructions,
144
+ imageSupport: imageSupport,
145
+ nonEmpty: false,
146
+ error: teacherInstructionsError,
147
+ toolbarOpts: toolbarOpts,
148
+ pluginProps: (0, _utils.getPluginProps)(teacherInstructions?.inputConfiguration, baseInputConfiguration),
149
+ spellCheck: spellCheckEnabled,
150
+ maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
151
+ maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
152
+ uploadSoundSupport: uploadSoundSupport,
153
+ languageCharactersProps: [{
154
+ language: 'spanish'
155
+ }, {
156
+ language: 'special'
157
+ }],
158
+ mathMlOptions: mathMlOptions
159
+ }), teacherInstructionsError && /*#__PURE__*/_react.default.createElement(ErrorText, null, teacherInstructionsError)), /*#__PURE__*/_react.default.createElement(_generalConfigBlock.default, {
160
+ imageSupport: imageSupport,
161
+ uploadSoundSupport: uploadSoundSupport,
162
+ model: model,
163
+ configuration: configuration,
164
+ onChange: this.onChange,
165
+ rationaleEnabled: rationaleEnabled,
166
+ promptEnabled: promptEnabled,
167
+ toolbarOpts: toolbarOpts,
168
+ spellCheck: spellCheckEnabled
169
+ }), feedbackEnabled && /*#__PURE__*/_react.default.createElement(_configUi.FeedbackConfig, {
170
+ feedback: model.feedback,
171
+ onChange: this.onFeedbackChange,
172
+ toolbarOpts: toolbarOpts
173
+ }));
174
+ }
175
+ }
250
176
  exports.Configure = Configure;
251
- (0, _defineProperty2["default"])(Configure, "propTypes", {
252
- onModelChanged: _propTypes["default"].func,
253
- onConfigurationChanged: _propTypes["default"].func,
254
- classes: _propTypes["default"].object,
255
- model: _propTypes["default"].object.isRequired,
256
- configuration: _propTypes["default"].object.isRequired,
257
- imageSupport: _propTypes["default"].object,
258
- uploadSoundSupport: _propTypes["default"].object
177
+ (0, _defineProperty2.default)(Configure, "propTypes", {
178
+ onModelChanged: _propTypes.default.func,
179
+ onConfigurationChanged: _propTypes.default.func,
180
+ model: _propTypes.default.object.isRequired,
181
+ configuration: _propTypes.default.object.isRequired,
182
+ imageSupport: _propTypes.default.object,
183
+ uploadSoundSupport: _propTypes.default.object
259
184
  });
260
-
261
- var _default = (0, _styles.withStyles)(styles)(Configure);
262
-
263
- exports["default"] = _default;
185
+ var _default = exports.default = Configure;
264
186
  //# sourceMappingURL=configure.js.map