@pie-element/math-inline 6.5.1-beta.0 → 6.5.1-beta.1
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/package.json +2 -2
- package/package.json +2 -2
- package/configure/lib/configure.js +0 -249
- package/configure/lib/configure.js.map +0 -1
- package/configure/lib/defaults.js +0 -117
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/general-config-block.js +0 -631
- package/configure/lib/general-config-block.js.map +0 -1
- package/configure/lib/index.js +0 -166
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/response.js +0 -449
- package/configure/lib/response.js.map +0 -1
- package/configure/lib/utils.js +0 -29
- package/configure/lib/utils.js.map +0 -1
- package/controller/lib/defaults.js +0 -35
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -398
- package/controller/lib/index.js.map +0 -1
- package/controller/lib/utils.js +0 -12
- package/controller/lib/utils.js.map +0 -1
- package/lib/index.js +0 -127
- package/lib/index.js.map +0 -1
- package/lib/main.js +0 -830
- package/lib/main.js.map +0 -1
- package/lib/print.js +0 -133
- package/lib/print.js.map +0 -1
- package/lib/simple-question-block.js +0 -195
- package/lib/simple-question-block.js.map +0 -1
- package/lib/utils.js +0 -12
- package/lib/utils.js.map +0 -1
package/lib/main.js
DELETED
|
@@ -1,830 +0,0 @@
|
|
|
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.Main = 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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
-
|
|
28
|
-
var _correctAnswerToggle = _interopRequireDefault(require("@pie-lib/correct-answer-toggle"));
|
|
29
|
-
|
|
30
|
-
var _mathInput = require("@pie-lib/math-input");
|
|
31
|
-
|
|
32
|
-
var _renderUi = require("@pie-lib/render-ui");
|
|
33
|
-
|
|
34
|
-
var _mathRendering = require("@pie-lib/math-rendering");
|
|
35
|
-
|
|
36
|
-
var _styles = require("@material-ui/core/styles");
|
|
37
|
-
|
|
38
|
-
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
39
|
-
|
|
40
|
-
var _utils = require("./utils");
|
|
41
|
-
|
|
42
|
-
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
43
|
-
|
|
44
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
45
|
-
|
|
46
|
-
var _simpleQuestionBlock = _interopRequireDefault(require("./simple-question-block"));
|
|
47
|
-
|
|
48
|
-
var _mathquill = _interopRequireDefault(require("@pie-framework/mathquill"));
|
|
49
|
-
|
|
50
|
-
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
51
|
-
|
|
52
|
-
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; }
|
|
53
|
-
|
|
54
|
-
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; }
|
|
55
|
-
|
|
56
|
-
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); }; }
|
|
57
|
-
|
|
58
|
-
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; } }
|
|
59
|
-
|
|
60
|
-
var registered = false;
|
|
61
|
-
var NEWLINE_LATEX = /\\newline/g;
|
|
62
|
-
var REGEX = /{{response}}/gm;
|
|
63
|
-
var DEFAULT_KEYPAD_VARIANT = 6;
|
|
64
|
-
var IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
65
|
-
|
|
66
|
-
function generateAdditionalKeys() {
|
|
67
|
-
var keyData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
68
|
-
return keyData.map(function (key) {
|
|
69
|
-
return {
|
|
70
|
-
name: key,
|
|
71
|
-
latex: key,
|
|
72
|
-
write: key,
|
|
73
|
-
label: key
|
|
74
|
-
};
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function getKeyPadWidth() {
|
|
79
|
-
var additionalKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
80
|
-
var equationEditor = arguments.length > 1 ? arguments[1] : undefined;
|
|
81
|
-
return Math.floor(additionalKeys.length / 5) * 30 + (equationEditor === 'miscellaneous' ? 600 : 500);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function prepareForStatic(model, state) {
|
|
85
|
-
var _ref = model || {},
|
|
86
|
-
config = _ref.config,
|
|
87
|
-
disabled = _ref.disabled;
|
|
88
|
-
|
|
89
|
-
var _ref2 = config || {},
|
|
90
|
-
expression = _ref2.expression,
|
|
91
|
-
responses = _ref2.responses,
|
|
92
|
-
printMode = _ref2.printMode,
|
|
93
|
-
alwaysShowCorrect = _ref2.alwaysShowCorrect;
|
|
94
|
-
|
|
95
|
-
if (config && expression) {
|
|
96
|
-
var modelExpression = expression;
|
|
97
|
-
|
|
98
|
-
if (state.showCorrect) {
|
|
99
|
-
return responses && responses.length && responses[0].answer;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
var answerBlocks = 1; // assume one at least
|
|
103
|
-
// build out local state model using responses declared in expression
|
|
104
|
-
|
|
105
|
-
return (modelExpression || '').replace(REGEX, function () {
|
|
106
|
-
var answer = state.session.answers["r".concat(answerBlocks)];
|
|
107
|
-
|
|
108
|
-
if (printMode && !alwaysShowCorrect) {
|
|
109
|
-
var blankSpace = '\\ \\ '.repeat(30) + '\\newline ';
|
|
110
|
-
return "\\MathQuillMathField[r".concat(answerBlocks++, "]{").concat(blankSpace.repeat(3), "}");
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (disabled) {
|
|
114
|
-
return "\\embed{answerBlock}[r".concat(answerBlocks++, "]");
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return "\\MathQuillMathField[r".concat(answerBlocks++, "]{").concat(answer && answer.value || '', "}");
|
|
118
|
-
}).replace(NEWLINE_LATEX, '\\embed{newLine}[]');
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
var Main = /*#__PURE__*/function (_React$Component) {
|
|
123
|
-
(0, _inherits2["default"])(Main, _React$Component);
|
|
124
|
-
|
|
125
|
-
var _super = _createSuper(Main);
|
|
126
|
-
|
|
127
|
-
function Main(props) {
|
|
128
|
-
var _this;
|
|
129
|
-
|
|
130
|
-
(0, _classCallCheck2["default"])(this, Main);
|
|
131
|
-
_this = _super.call(this, props);
|
|
132
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleAnswerBlockDomUpdate", function () {
|
|
133
|
-
var _this$props = _this.props,
|
|
134
|
-
model = _this$props.model,
|
|
135
|
-
classes = _this$props.classes;
|
|
136
|
-
var _this$state = _this.state,
|
|
137
|
-
session = _this$state.session,
|
|
138
|
-
showCorrect = _this$state.showCorrect;
|
|
139
|
-
var answers = session.answers;
|
|
140
|
-
|
|
141
|
-
if (_this.root && model.disabled && !showCorrect) {
|
|
142
|
-
Object.keys(answers).forEach(function (answerId) {
|
|
143
|
-
var el = _this.root.querySelector("#".concat(answerId));
|
|
144
|
-
|
|
145
|
-
var indexEl = _this.root.querySelector("#".concat(answerId, "Index")); // const correct = model.correctness && model.correctness.correct;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (el) {
|
|
149
|
-
var MQ = _mathquill["default"].getInterface(2);
|
|
150
|
-
|
|
151
|
-
var answer = answers[answerId];
|
|
152
|
-
el.textContent = answer && answer.value || '';
|
|
153
|
-
|
|
154
|
-
if (!model.view) {// for now, we're not going to be showing individual response correctness
|
|
155
|
-
// TODO re-attach the classes once we are
|
|
156
|
-
// el.parentElement.parentElement.classList.add(
|
|
157
|
-
// correct ? classes.correct : classes.incorrect
|
|
158
|
-
// );
|
|
159
|
-
} else {
|
|
160
|
-
el.parentElement.parentElement.classList.remove(classes.correct);
|
|
161
|
-
el.parentElement.parentElement.classList.remove(classes.incorrect);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
MQ.StaticMath(el); // For now, we're not going to be indexing response blocks
|
|
165
|
-
// TODO go back to indexing once we support individual response correctness
|
|
166
|
-
// indexEl.textContent = `R${idx + 1}`;
|
|
167
|
-
|
|
168
|
-
indexEl.textContent = 'R';
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
(0, _mathRendering.renderMath)(_this.root);
|
|
174
|
-
});
|
|
175
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDone", function () {});
|
|
176
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSimpleResponseChange", function (response) {
|
|
177
|
-
_this.setState(function (state) {
|
|
178
|
-
return {
|
|
179
|
-
session: _objectSpread(_objectSpread({}, state.session), {}, {
|
|
180
|
-
response: response
|
|
181
|
-
})
|
|
182
|
-
};
|
|
183
|
-
}, _this.callOnSessionChange);
|
|
184
|
-
});
|
|
185
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSubFieldFocus", function (id) {
|
|
186
|
-
_this.setState({
|
|
187
|
-
activeAnswerBlock: id
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toNodeData", function (data) {
|
|
191
|
-
if (!data) {
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
var type = data.type,
|
|
196
|
-
value = data.value;
|
|
197
|
-
|
|
198
|
-
if (type === 'command' || type === 'cursor') {
|
|
199
|
-
return data;
|
|
200
|
-
} else if (type === 'answer') {
|
|
201
|
-
return _objectSpread({
|
|
202
|
-
type: 'answer'
|
|
203
|
-
}, data);
|
|
204
|
-
} else if (value === 'clear') {
|
|
205
|
-
return {
|
|
206
|
-
type: 'clear'
|
|
207
|
-
};
|
|
208
|
-
} else {
|
|
209
|
-
return {
|
|
210
|
-
type: 'write',
|
|
211
|
-
value: value
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setInput", function (input) {
|
|
216
|
-
_this.input = input;
|
|
217
|
-
});
|
|
218
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onClick", function (data) {
|
|
219
|
-
var c = _this.toNodeData(data);
|
|
220
|
-
|
|
221
|
-
if (c.type === 'clear') {
|
|
222
|
-
_this.input.clear();
|
|
223
|
-
} else if (c.type === 'command') {
|
|
224
|
-
if (Array.isArray(c.value)) {
|
|
225
|
-
c.value.forEach(function (vv) {
|
|
226
|
-
_this.input.cmd(vv);
|
|
227
|
-
});
|
|
228
|
-
} else {
|
|
229
|
-
_this.input.cmd(c.value);
|
|
230
|
-
}
|
|
231
|
-
} else if (c.type === 'cursor') {
|
|
232
|
-
_this.input.keystroke(c.value);
|
|
233
|
-
} else {
|
|
234
|
-
_this.input.write(c.value);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
_this.input.focus();
|
|
238
|
-
});
|
|
239
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "callOnSessionChange", function () {
|
|
240
|
-
var onSessionChange = _this.props.onSessionChange;
|
|
241
|
-
|
|
242
|
-
if (onSessionChange) {
|
|
243
|
-
onSessionChange(_this.state.session);
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toggleShowCorrect", function (show) {
|
|
247
|
-
_this.setState({
|
|
248
|
-
showCorrect: show
|
|
249
|
-
}, _this.handleAnswerBlockDomUpdate);
|
|
250
|
-
});
|
|
251
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "subFieldChanged", function (name, subfieldValue) {
|
|
252
|
-
(0, _mathInput.updateSpans)();
|
|
253
|
-
|
|
254
|
-
if (name) {
|
|
255
|
-
_this.setState(function (state) {
|
|
256
|
-
return {
|
|
257
|
-
session: _objectSpread(_objectSpread({}, state.session), {}, {
|
|
258
|
-
completeAnswer: _this.mqStatic && _this.mqStatic.mathField.latex(),
|
|
259
|
-
answers: _objectSpread(_objectSpread({}, state.session.answers), {}, (0, _defineProperty2["default"])({}, name, {
|
|
260
|
-
value: subfieldValue
|
|
261
|
-
}))
|
|
262
|
-
})
|
|
263
|
-
};
|
|
264
|
-
}, _this.callOnSessionChange);
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getFieldName", function (changeField, fields) {
|
|
268
|
-
var answers = _this.state.session.answers;
|
|
269
|
-
|
|
270
|
-
if (Object.keys(answers || {}).length) {
|
|
271
|
-
var keys = Object.keys(answers);
|
|
272
|
-
return keys.find(function (k) {
|
|
273
|
-
var tf = fields[k];
|
|
274
|
-
return tf && tf.id == changeField.id;
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function (e) {
|
|
279
|
-
var _relatedTarget$offset, _relatedTarget$offset2, _relatedTarget$offset3, _relatedTarget$offset4, _relatedTarget$offset5, _relatedTarget$offset6, _relatedTarget$offset7;
|
|
280
|
-
|
|
281
|
-
var _ref3 = e || {},
|
|
282
|
-
relatedTarget = _ref3.relatedTarget,
|
|
283
|
-
currentTarget = _ref3.currentTarget;
|
|
284
|
-
|
|
285
|
-
if (!relatedTarget || !currentTarget || !IS_SAFARI && !(relatedTarget !== null && relatedTarget !== void 0 && (_relatedTarget$offset = relatedTarget.offsetParent) !== null && _relatedTarget$offset !== void 0 && (_relatedTarget$offset2 = _relatedTarget$offset.children[0]) !== null && _relatedTarget$offset2 !== void 0 && (_relatedTarget$offset3 = _relatedTarget$offset2.attributes) !== null && _relatedTarget$offset3 !== void 0 && _relatedTarget$offset3['data-keypad']) || IS_SAFARI && !(relatedTarget !== null && relatedTarget !== void 0 && (_relatedTarget$offset4 = relatedTarget.offsetParent) !== null && _relatedTarget$offset4 !== void 0 && (_relatedTarget$offset5 = _relatedTarget$offset4.children[0]) !== null && _relatedTarget$offset5 !== void 0 && (_relatedTarget$offset6 = _relatedTarget$offset5.children[0]) !== null && _relatedTarget$offset6 !== void 0 && (_relatedTarget$offset7 = _relatedTarget$offset6.attributes) !== null && _relatedTarget$offset7 !== void 0 && _relatedTarget$offset7['data-keypad'])) {
|
|
286
|
-
_this.setState({
|
|
287
|
-
activeAnswerBlock: ''
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
var _answers = {};
|
|
292
|
-
|
|
293
|
-
if (props.model.config && props.model.config.expression) {
|
|
294
|
-
var answerBlocks = 1; // assume one at least
|
|
295
|
-
// build out local state model using responses declared in expression
|
|
296
|
-
|
|
297
|
-
(props.model.config.expression || '').replace(REGEX, function () {
|
|
298
|
-
_answers["r".concat(answerBlocks)] = {
|
|
299
|
-
value: props.session && props.session.answers && props.session.answers["r".concat(answerBlocks)] && props.session.answers["r".concat(answerBlocks)].value || ''
|
|
300
|
-
};
|
|
301
|
-
answerBlocks += 1;
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
_this.state = {
|
|
306
|
-
session: _objectSpread(_objectSpread({}, props.session), {}, {
|
|
307
|
-
answers: _answers
|
|
308
|
-
}),
|
|
309
|
-
activeAnswerBlock: '',
|
|
310
|
-
showCorrect: _this.props.model.config.alwaysShowCorrect || false
|
|
311
|
-
};
|
|
312
|
-
return _this;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
(0, _createClass2["default"])(Main, [{
|
|
316
|
-
key: "UNSAFE_componentWillMount",
|
|
317
|
-
value: function UNSAFE_componentWillMount() {
|
|
318
|
-
var classes = this.props.classes;
|
|
319
|
-
|
|
320
|
-
if (typeof window !== 'undefined') {
|
|
321
|
-
var MQ = _mathquill["default"].getInterface(2);
|
|
322
|
-
|
|
323
|
-
if (!registered) {
|
|
324
|
-
MQ.registerEmbed('answerBlock', function (data) {
|
|
325
|
-
return {
|
|
326
|
-
htmlString: "<div class=\"".concat(classes.blockContainer, "\">\n <div class=\"").concat(classes.blockResponse, "\" id=\"").concat(data, "Index\">R</div>\n <div class=\"").concat(classes.blockMath, "\">\n <span id=\"").concat(data, "\"></span>\n </div>\n </div>"),
|
|
327
|
-
text: function text() {
|
|
328
|
-
return 'text';
|
|
329
|
-
},
|
|
330
|
-
latex: function latex() {
|
|
331
|
-
return "\\embed{answerBlock}[".concat(data, "]");
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
});
|
|
335
|
-
registered = true;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}, {
|
|
340
|
-
key: "componentDidUpdate",
|
|
341
|
-
value: function componentDidUpdate() {
|
|
342
|
-
this.handleAnswerBlockDomUpdate();
|
|
343
|
-
}
|
|
344
|
-
}, {
|
|
345
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
346
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
347
|
-
var _this2 = this;
|
|
348
|
-
|
|
349
|
-
var config = this.props.model.config;
|
|
350
|
-
|
|
351
|
-
var _ref4 = nextProps.model || {},
|
|
352
|
-
_ref4$config = _ref4.config,
|
|
353
|
-
nextConfig = _ref4$config === void 0 ? {} : _ref4$config;
|
|
354
|
-
|
|
355
|
-
if (config.env && config.env.mode !== 'evaluate' || nextConfig.env && nextConfig.env.mode !== 'evaluate') {
|
|
356
|
-
this.setState(_objectSpread(_objectSpread({}, this.state.session), {}, {
|
|
357
|
-
showCorrect: false
|
|
358
|
-
}));
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
if (nextConfig.alwaysShowCorrect) {
|
|
362
|
-
this.setState({
|
|
363
|
-
showCorrect: true
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
if (config && config.responses && config.responses.length !== nextConfig.responses.length || !config && nextConfig && nextConfig.responses || config && nextConfig && config.expression !== nextConfig.expression) {
|
|
368
|
-
var newAnswers = {};
|
|
369
|
-
var answers = this.state.session.answers;
|
|
370
|
-
var answerBlocks = 1; // assume one at least
|
|
371
|
-
// build out local state model using responses declared in expression
|
|
372
|
-
|
|
373
|
-
(nextConfig.expression || '').replace(REGEX, function () {
|
|
374
|
-
newAnswers["r".concat(answerBlocks)] = {
|
|
375
|
-
value: answers && answers["r".concat(answerBlocks)] && answers["r".concat(answerBlocks)].value || ''
|
|
376
|
-
};
|
|
377
|
-
answerBlocks++;
|
|
378
|
-
});
|
|
379
|
-
this.setState(function (state) {
|
|
380
|
-
return {
|
|
381
|
-
session: _objectSpread(_objectSpread({}, state.session), {}, {
|
|
382
|
-
completeAnswer: _this2.mqStatic && _this2.mqStatic.mathField.latex(),
|
|
383
|
-
answers: newAnswers
|
|
384
|
-
})
|
|
385
|
-
};
|
|
386
|
-
}, this.handleAnswerBlockDomUpdate);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}, {
|
|
390
|
-
key: "shouldComponentUpdate",
|
|
391
|
-
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
392
|
-
var sameModel = (0, _isEqual["default"])(this.props.model, nextProps.model);
|
|
393
|
-
var sameState = (0, _isEqual["default"])(this.state, nextState);
|
|
394
|
-
return !sameModel || !sameState;
|
|
395
|
-
}
|
|
396
|
-
}, {
|
|
397
|
-
key: "componentDidMount",
|
|
398
|
-
value: function componentDidMount() {
|
|
399
|
-
var _this3 = this;
|
|
400
|
-
|
|
401
|
-
this.handleAnswerBlockDomUpdate();
|
|
402
|
-
setTimeout(function () {
|
|
403
|
-
return (0, _mathRendering.renderMath)(_this3.root);
|
|
404
|
-
}, 100);
|
|
405
|
-
}
|
|
406
|
-
}, {
|
|
407
|
-
key: "setTooltipRef",
|
|
408
|
-
value: function setTooltipRef(ref) {
|
|
409
|
-
// Safari Hack: https://stackoverflow.com/a/42764495/5757635
|
|
410
|
-
setTimeout(function () {
|
|
411
|
-
if (ref && IS_SAFARI) {
|
|
412
|
-
var div = document.querySelector("[role='tooltip']");
|
|
413
|
-
|
|
414
|
-
if (div) {
|
|
415
|
-
var el = div.firstChild;
|
|
416
|
-
el.setAttribute('tabindex', '-1');
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}, 1);
|
|
420
|
-
}
|
|
421
|
-
}, {
|
|
422
|
-
key: "render",
|
|
423
|
-
value: function render() {
|
|
424
|
-
var _this4 = this,
|
|
425
|
-
_cx;
|
|
426
|
-
|
|
427
|
-
var _this$props2 = this.props,
|
|
428
|
-
model = _this$props2.model,
|
|
429
|
-
classes = _this$props2.classes;
|
|
430
|
-
var _this$state2 = this.state,
|
|
431
|
-
activeAnswerBlock = _this$state2.activeAnswerBlock,
|
|
432
|
-
showCorrect = _this$state2.showCorrect,
|
|
433
|
-
session = _this$state2.session;
|
|
434
|
-
|
|
435
|
-
var _ref5 = model || {},
|
|
436
|
-
config = _ref5.config,
|
|
437
|
-
correctness = _ref5.correctness,
|
|
438
|
-
disabled = _ref5.disabled,
|
|
439
|
-
view = _ref5.view,
|
|
440
|
-
teacherInstructions = _ref5.teacherInstructions,
|
|
441
|
-
rationale = _ref5.rationale,
|
|
442
|
-
feedback = _ref5.feedback,
|
|
443
|
-
animationsDisabled = _ref5.animationsDisabled,
|
|
444
|
-
printMode = _ref5.printMode,
|
|
445
|
-
alwaysShowCorrect = _ref5.alwaysShowCorrect;
|
|
446
|
-
|
|
447
|
-
if (!config) {
|
|
448
|
-
return null;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
var _ref6 = config || {},
|
|
452
|
-
showNote = _ref6.showNote,
|
|
453
|
-
note = _ref6.note,
|
|
454
|
-
prompt = _ref6.prompt,
|
|
455
|
-
responses = _ref6.responses,
|
|
456
|
-
responseType = _ref6.responseType,
|
|
457
|
-
equationEditor = _ref6.equationEditor,
|
|
458
|
-
customKeys = _ref6.customKeys,
|
|
459
|
-
_ref6$env = _ref6.env;
|
|
460
|
-
|
|
461
|
-
_ref6$env = _ref6$env === void 0 ? {} : _ref6$env;
|
|
462
|
-
var mode = _ref6$env.mode,
|
|
463
|
-
role = _ref6$env.role;
|
|
464
|
-
var displayNote = (showCorrect || mode === 'view' && role === 'instructor') && showNote && note;
|
|
465
|
-
var emptyResponse = (0, _isEmpty["default"])(responses);
|
|
466
|
-
var showCorrectAnswerToggle = !emptyResponse && correctness && correctness.correctness !== 'correct';
|
|
467
|
-
var tooltipModeEnabled = disabled && correctness;
|
|
468
|
-
var additionalKeys = generateAdditionalKeys(customKeys);
|
|
469
|
-
var correct = correctness && correctness.correct;
|
|
470
|
-
var staticLatex = prepareForStatic(model, this.state) || '';
|
|
471
|
-
var viewMode = disabled && !correctness;
|
|
472
|
-
var studentPrintMode = printMode && !alwaysShowCorrect;
|
|
473
|
-
|
|
474
|
-
var printView = /*#__PURE__*/_react["default"].createElement("div", {
|
|
475
|
-
className: classes.printContainer
|
|
476
|
-
}, /*#__PURE__*/_react["default"].createElement(_mathInput.mq.Static, {
|
|
477
|
-
ref: function ref(mqStatic) {
|
|
478
|
-
return _this4.mqStatic = mqStatic || _this4.mqStatic;
|
|
479
|
-
},
|
|
480
|
-
latex: staticLatex,
|
|
481
|
-
onSubFieldChange: this.subFieldChanged,
|
|
482
|
-
getFieldName: this.getFieldName,
|
|
483
|
-
setInput: this.setInput,
|
|
484
|
-
onSubFieldFocus: this.onSubFieldFocus,
|
|
485
|
-
onBlur: this.onBlur
|
|
486
|
-
}));
|
|
487
|
-
|
|
488
|
-
var midContent = /*#__PURE__*/_react["default"].createElement("div", {
|
|
489
|
-
className: classes.main
|
|
490
|
-
}, prompt && /*#__PURE__*/_react["default"].createElement("div", {
|
|
491
|
-
className: classes.content
|
|
492
|
-
}, /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
|
|
493
|
-
prompt: prompt
|
|
494
|
-
})), studentPrintMode ? printView : /*#__PURE__*/_react["default"].createElement(_renderUi.Readable, {
|
|
495
|
-
"false": true
|
|
496
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
497
|
-
className: classes.inputAndKeypadContainer
|
|
498
|
-
}, responseType === _utils.ResponseTypes.simple && /*#__PURE__*/_react["default"].createElement(_simpleQuestionBlock["default"], {
|
|
499
|
-
onSimpleResponseChange: this.onSimpleResponseChange,
|
|
500
|
-
showCorrect: showCorrect,
|
|
501
|
-
emptyResponse: emptyResponse,
|
|
502
|
-
model: model,
|
|
503
|
-
session: session
|
|
504
|
-
}), responseType === _utils.ResponseTypes.advanced && /*#__PURE__*/_react["default"].createElement("div", {
|
|
505
|
-
className: (0, _classnames["default"])(classes.expression, (_cx = {}, (0, _defineProperty2["default"])(_cx, classes.incorrect, !emptyResponse && !correct && !showCorrect), (0, _defineProperty2["default"])(_cx, classes.correct, !emptyResponse && (correct || showCorrect)), (0, _defineProperty2["default"])(_cx, classes.showCorrectness, !emptyResponse && disabled && correctness && !view), (0, _defineProperty2["default"])(_cx, classes.correctAnswerShown, showCorrect), (0, _defineProperty2["default"])(_cx, classes.printCorrect, printMode && alwaysShowCorrect), _cx))
|
|
506
|
-
}, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
507
|
-
ref: function ref(_ref7) {
|
|
508
|
-
return _this4.setTooltipRef(_ref7);
|
|
509
|
-
},
|
|
510
|
-
interactive: true,
|
|
511
|
-
open: !!activeAnswerBlock,
|
|
512
|
-
classes: {
|
|
513
|
-
tooltip: classes.keypadTooltip,
|
|
514
|
-
popper: classes.keypadTooltipPopper
|
|
515
|
-
},
|
|
516
|
-
title: Object.keys(session.answers).map(function (answerId) {
|
|
517
|
-
return answerId === activeAnswerBlock && !(showCorrect || disabled) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
518
|
-
"data-keypad": true,
|
|
519
|
-
key: answerId,
|
|
520
|
-
className: classes.responseContainer,
|
|
521
|
-
style: {
|
|
522
|
-
// marginTop: this.mqStatic && this.mqStatic.input.offsetHeight - 20,
|
|
523
|
-
width: getKeyPadWidth(additionalKeys, equationEditor)
|
|
524
|
-
}
|
|
525
|
-
}, /*#__PURE__*/_react["default"].createElement(_mathInput.HorizontalKeypad, {
|
|
526
|
-
additionalKeys: additionalKeys,
|
|
527
|
-
mode: equationEditor || DEFAULT_KEYPAD_VARIANT,
|
|
528
|
-
onClick: _this4.onClick
|
|
529
|
-
})) || null;
|
|
530
|
-
})
|
|
531
|
-
}, /*#__PURE__*/_react["default"].createElement(_mathInput.mq.Static, {
|
|
532
|
-
ref: function ref(mqStatic) {
|
|
533
|
-
return _this4.mqStatic = mqStatic || _this4.mqStatic;
|
|
534
|
-
},
|
|
535
|
-
latex: staticLatex,
|
|
536
|
-
onSubFieldChange: this.subFieldChanged,
|
|
537
|
-
getFieldName: this.getFieldName,
|
|
538
|
-
setInput: this.setInput,
|
|
539
|
-
onSubFieldFocus: this.onSubFieldFocus,
|
|
540
|
-
onBlur: this.onBlur
|
|
541
|
-
}))))), viewMode && teacherInstructions && (0, _renderUi.hasText)(teacherInstructions) && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, !animationsDisabled ? /*#__PURE__*/_react["default"].createElement(_renderUi.Collapsible, {
|
|
542
|
-
labels: {
|
|
543
|
-
hidden: 'Show Teacher Instructions',
|
|
544
|
-
visible: 'Hide Teacher Instructions'
|
|
545
|
-
}
|
|
546
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
547
|
-
dangerouslySetInnerHTML: {
|
|
548
|
-
__html: teacherInstructions
|
|
549
|
-
}
|
|
550
|
-
})) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
551
|
-
dangerouslySetInnerHTML: {
|
|
552
|
-
__html: teacherInstructions
|
|
553
|
-
}
|
|
554
|
-
}), /*#__PURE__*/_react["default"].createElement("br", null)), viewMode && rationale && (0, _renderUi.hasText)(rationale) && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, !animationsDisabled ? /*#__PURE__*/_react["default"].createElement(_renderUi.Collapsible, {
|
|
555
|
-
labels: {
|
|
556
|
-
hidden: 'Show Rationale',
|
|
557
|
-
visible: 'Hide Rationale'
|
|
558
|
-
}
|
|
559
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
560
|
-
dangerouslySetInnerHTML: {
|
|
561
|
-
__html: rationale
|
|
562
|
-
}
|
|
563
|
-
})) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
564
|
-
dangerouslySetInnerHTML: {
|
|
565
|
-
__html: rationale
|
|
566
|
-
}
|
|
567
|
-
})), viewMode && displayNote && /*#__PURE__*/_react["default"].createElement("div", {
|
|
568
|
-
className: classes.note,
|
|
569
|
-
dangerouslySetInnerHTML: {
|
|
570
|
-
__html: "<strong>Note:</strong> ".concat(note)
|
|
571
|
-
}
|
|
572
|
-
}));
|
|
573
|
-
|
|
574
|
-
if (tooltipModeEnabled && (showCorrectAnswerToggle || teacherInstructions && (0, _renderUi.hasText)(teacherInstructions) || rationale && (0, _renderUi.hasText)(rationale) || feedback)) {
|
|
575
|
-
return /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
576
|
-
interactive: true,
|
|
577
|
-
classes: {
|
|
578
|
-
tooltip: classes.tooltip,
|
|
579
|
-
popper: classes.tooltipPopper
|
|
580
|
-
},
|
|
581
|
-
title: /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
582
|
-
className: classes.main
|
|
583
|
-
}, showCorrectAnswerToggle && /*#__PURE__*/_react["default"].createElement(_correctAnswerToggle["default"], {
|
|
584
|
-
className: classes.toggle,
|
|
585
|
-
show: true,
|
|
586
|
-
toggled: showCorrect,
|
|
587
|
-
onToggle: this.toggleShowCorrect
|
|
588
|
-
})), teacherInstructions && (0, _renderUi.hasText)(teacherInstructions) && [/*#__PURE__*/_react["default"].createElement(_renderUi.Collapsible, {
|
|
589
|
-
key: "collapsible",
|
|
590
|
-
labels: {
|
|
591
|
-
hidden: 'Show Teacher Instructions',
|
|
592
|
-
visible: 'Hide Teacher Instructions'
|
|
593
|
-
},
|
|
594
|
-
className: classes.collapsible
|
|
595
|
-
}, /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
|
|
596
|
-
prompt: teacherInstructions
|
|
597
|
-
})), /*#__PURE__*/_react["default"].createElement("br", {
|
|
598
|
-
key: "br"
|
|
599
|
-
})], rationale && (0, _renderUi.hasText)(rationale) && [/*#__PURE__*/_react["default"].createElement(_renderUi.Collapsible, {
|
|
600
|
-
key: "collapsible",
|
|
601
|
-
labels: {
|
|
602
|
-
hidden: 'Show Rationale',
|
|
603
|
-
visible: 'Hide Rationale'
|
|
604
|
-
}
|
|
605
|
-
}, /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
|
|
606
|
-
prompt: rationale
|
|
607
|
-
})), /*#__PURE__*/_react["default"].createElement("br", {
|
|
608
|
-
key: "br"
|
|
609
|
-
})], displayNote && (0, _renderUi.hasText)(note) && [/*#__PURE__*/_react["default"].createElement(_renderUi.Collapsible, {
|
|
610
|
-
key: "collapsible",
|
|
611
|
-
labels: {
|
|
612
|
-
hidden: 'Show Note',
|
|
613
|
-
visible: 'Hide Note'
|
|
614
|
-
}
|
|
615
|
-
}, /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
|
|
616
|
-
prompt: note
|
|
617
|
-
})), /*#__PURE__*/_react["default"].createElement("br", {
|
|
618
|
-
key: "br"
|
|
619
|
-
})], feedback && /*#__PURE__*/_react["default"].createElement(_renderUi.Feedback, {
|
|
620
|
-
correctness: correctness.correctness,
|
|
621
|
-
feedback: feedback
|
|
622
|
-
}))
|
|
623
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
624
|
-
className: classes.mainContainer,
|
|
625
|
-
ref: function ref(r) {
|
|
626
|
-
return _this4.root = r || _this4.root;
|
|
627
|
-
}
|
|
628
|
-
}, midContent));
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
632
|
-
className: classes.mainContainer,
|
|
633
|
-
ref: function ref(r) {
|
|
634
|
-
return _this4.root = r || _this4.root;
|
|
635
|
-
}
|
|
636
|
-
}, midContent);
|
|
637
|
-
}
|
|
638
|
-
}]);
|
|
639
|
-
return Main;
|
|
640
|
-
}(_react["default"].Component);
|
|
641
|
-
|
|
642
|
-
exports.Main = Main;
|
|
643
|
-
(0, _defineProperty2["default"])(Main, "propTypes", {
|
|
644
|
-
classes: _propTypes["default"].object,
|
|
645
|
-
session: _propTypes["default"].object.isRequired,
|
|
646
|
-
onSessionChange: _propTypes["default"].func,
|
|
647
|
-
model: _propTypes["default"].object.isRequired
|
|
648
|
-
});
|
|
649
|
-
|
|
650
|
-
var styles = function styles(theme) {
|
|
651
|
-
return {
|
|
652
|
-
mainContainer: {
|
|
653
|
-
display: 'inline-block'
|
|
654
|
-
},
|
|
655
|
-
tooltip: {
|
|
656
|
-
background: "".concat(_renderUi.color.primaryLight(), " !important"),
|
|
657
|
-
color: _renderUi.color.text(),
|
|
658
|
-
padding: theme.spacing.unit * 2,
|
|
659
|
-
border: "1px solid ".concat(_renderUi.color.secondary()),
|
|
660
|
-
fontSize: '16px',
|
|
661
|
-
'& :not(.MathJax) > table tr': {
|
|
662
|
-
'&:nth-child(2n)': {
|
|
663
|
-
backgroundColor: 'unset !important'
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
},
|
|
667
|
-
tooltipPopper: {
|
|
668
|
-
opacity: 1
|
|
669
|
-
},
|
|
670
|
-
keypadTooltip: {
|
|
671
|
-
fontSize: 'initial',
|
|
672
|
-
background: 'transparent',
|
|
673
|
-
width: '600px',
|
|
674
|
-
marginTop: 0,
|
|
675
|
-
paddingTop: 0
|
|
676
|
-
},
|
|
677
|
-
keypadTooltipPopper: {
|
|
678
|
-
background: 'transparent',
|
|
679
|
-
width: '650px',
|
|
680
|
-
opacity: 1
|
|
681
|
-
},
|
|
682
|
-
main: {
|
|
683
|
-
width: '100%',
|
|
684
|
-
position: 'relative',
|
|
685
|
-
padding: theme.spacing.unit / 2,
|
|
686
|
-
backgroundColor: _renderUi.color.background(),
|
|
687
|
-
color: _renderUi.color.text()
|
|
688
|
-
},
|
|
689
|
-
title: {
|
|
690
|
-
fontSize: '1.1rem',
|
|
691
|
-
display: 'block',
|
|
692
|
-
marginTop: theme.spacing.unit * 2,
|
|
693
|
-
marginBottom: theme.spacing.unit
|
|
694
|
-
},
|
|
695
|
-
content: {
|
|
696
|
-
marginTop: theme.spacing.unit * 2
|
|
697
|
-
},
|
|
698
|
-
note: {
|
|
699
|
-
paddingTop: '15px'
|
|
700
|
-
},
|
|
701
|
-
collapsible: {
|
|
702
|
-
marginTop: theme.spacing.unit * 2
|
|
703
|
-
},
|
|
704
|
-
responseContainer: {
|
|
705
|
-
zIndex: 10,
|
|
706
|
-
// position: 'absolute',
|
|
707
|
-
// right: 0,
|
|
708
|
-
minWidth: '400px',
|
|
709
|
-
marginTop: theme.spacing.unit * 2
|
|
710
|
-
},
|
|
711
|
-
expression: {
|
|
712
|
-
maxWidth: 'fit-content',
|
|
713
|
-
'& > .mq-math-mode': {
|
|
714
|
-
'& > .mq-root-block': {
|
|
715
|
-
'& > .mq-editable-field': {
|
|
716
|
-
minWidth: '10px',
|
|
717
|
-
margin: theme.spacing.unit * 2 / 3,
|
|
718
|
-
padding: theme.spacing.unit / 4
|
|
719
|
-
}
|
|
720
|
-
},
|
|
721
|
-
'& sup': {
|
|
722
|
-
top: 0
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
},
|
|
726
|
-
inputAndKeypadContainer: {
|
|
727
|
-
position: 'relative',
|
|
728
|
-
'& .mq-overarrow-inner': {
|
|
729
|
-
border: 'none !important',
|
|
730
|
-
padding: '0 !important'
|
|
731
|
-
},
|
|
732
|
-
'& .mq-overarrow-inner-right': {
|
|
733
|
-
display: 'none !important'
|
|
734
|
-
},
|
|
735
|
-
'& .mq-overarrow-inner-left': {
|
|
736
|
-
display: 'none !important'
|
|
737
|
-
},
|
|
738
|
-
'& .mq-overarrow.mq-arrow-both': {
|
|
739
|
-
minWidth: '1.23em',
|
|
740
|
-
'& *': {
|
|
741
|
-
lineHeight: '1 !important'
|
|
742
|
-
},
|
|
743
|
-
'&:before': {
|
|
744
|
-
top: '-0.4em',
|
|
745
|
-
left: '-1px'
|
|
746
|
-
},
|
|
747
|
-
'&:after': {
|
|
748
|
-
top: '-2.4em',
|
|
749
|
-
right: '-1px'
|
|
750
|
-
},
|
|
751
|
-
'&.mq-empty:after': {
|
|
752
|
-
top: '-0.45em'
|
|
753
|
-
}
|
|
754
|
-
},
|
|
755
|
-
'& .mq-overarrow.mq-arrow-right': {
|
|
756
|
-
'&:before': {
|
|
757
|
-
top: '-0.4em',
|
|
758
|
-
right: '-1px'
|
|
759
|
-
}
|
|
760
|
-
},
|
|
761
|
-
'& .mq-longdiv-inner': {
|
|
762
|
-
borderTop: '1px solid !important',
|
|
763
|
-
paddingTop: '1.5px !important'
|
|
764
|
-
},
|
|
765
|
-
'& .mq-parallelogram': {
|
|
766
|
-
lineHeight: 0.85
|
|
767
|
-
}
|
|
768
|
-
},
|
|
769
|
-
showCorrectness: {
|
|
770
|
-
border: '2px solid'
|
|
771
|
-
},
|
|
772
|
-
correctAnswerShown: {
|
|
773
|
-
padding: theme.spacing.unit,
|
|
774
|
-
letterSpacing: '0.5px'
|
|
775
|
-
},
|
|
776
|
-
printCorrect: {
|
|
777
|
-
border: "2px solid ".concat(_renderUi.color.correct(), " !important")
|
|
778
|
-
},
|
|
779
|
-
correct: {
|
|
780
|
-
borderColor: "".concat(_renderUi.color.correct(), " !important")
|
|
781
|
-
},
|
|
782
|
-
incorrect: {
|
|
783
|
-
borderColor: "".concat(_renderUi.color.incorrect(), " !important")
|
|
784
|
-
},
|
|
785
|
-
blockContainer: {
|
|
786
|
-
margin: "".concat(theme.spacing.unit, "px !important"),
|
|
787
|
-
display: 'inline-flex',
|
|
788
|
-
border: '2px solid grey !important'
|
|
789
|
-
},
|
|
790
|
-
blockResponse: {
|
|
791
|
-
flex: 2,
|
|
792
|
-
color: 'grey',
|
|
793
|
-
background: 'lightgrey',
|
|
794
|
-
fontSize: '0.8rem !important',
|
|
795
|
-
padding: "".concat(theme.spacing.unit / 2, "px !important"),
|
|
796
|
-
display: 'flex',
|
|
797
|
-
alignItems: 'center',
|
|
798
|
-
justifyContent: 'center',
|
|
799
|
-
borderRight: "2px solid ".concat(_renderUi.color.disabled(), " !important")
|
|
800
|
-
},
|
|
801
|
-
toggle: {
|
|
802
|
-
color: _renderUi.color.text()
|
|
803
|
-
},
|
|
804
|
-
blockMath: {
|
|
805
|
-
color: _renderUi.color.text(),
|
|
806
|
-
backgroundColor: _renderUi.color.background(),
|
|
807
|
-
padding: "".concat(theme.spacing.unit / 2, "px !important"),
|
|
808
|
-
display: 'flex',
|
|
809
|
-
alignItems: 'center',
|
|
810
|
-
justifyContent: 'center',
|
|
811
|
-
flex: 8,
|
|
812
|
-
'& > .mq-math-mode': {
|
|
813
|
-
'& > .mq-hasCursor': {
|
|
814
|
-
'& > .mq-cursor': {
|
|
815
|
-
display: 'none'
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
},
|
|
820
|
-
printContainer: {
|
|
821
|
-
marginBottom: '10px',
|
|
822
|
-
pointerEvents: 'none'
|
|
823
|
-
}
|
|
824
|
-
};
|
|
825
|
-
};
|
|
826
|
-
|
|
827
|
-
var _default = (0, _styles.withStyles)(styles)(Main);
|
|
828
|
-
|
|
829
|
-
exports["default"] = _default;
|
|
830
|
-
//# sourceMappingURL=main.js.map
|