@pie-element/math-inline 7.8.1-next.9 → 7.9.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
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
+ # [7.9.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@7.8.0...@pie-element/math-inline@7.9.0) (2024-03-20)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Renamed the html prop to the correct math prop PD-3527 ([28061b6](https://github.com/pie-framework/pie-elements/commit/28061b6032817dae15837131d8a0bf5a08683b10))
12
+ * updated pie-lib/pie-toolbox SC-28500 ([a8e4e6a](https://github.com/pie-framework/pie-elements/commit/a8e4e6ab27584435ce7ac3e964ccac2747402777))
13
+ * **math-inline:** change margins logic in player to prevent breaking multi-items PD-3562 ([575cda9](https://github.com/pie-framework/pie-elements/commit/575cda9249380f829caabc18fb7231c691cf3cbc))
14
+ * **math-inline:** tests PD-3562 ([25b2919](https://github.com/pie-framework/pie-elements/commit/25b2919167e65f6e254d758cb49e52149271539f))
15
+
16
+
17
+ ### Features
18
+
19
+ * Add configuration for custom buttons PD-3520 ([a7a7ace](https://github.com/pie-framework/pie-elements/commit/a7a7ace27eaac47c9a0f172f7ae0440c6dc4e600))
20
+ * Add configuration for custom buttons PD-3527 ([45a32bd](https://github.com/pie-framework/pie-elements/commit/45a32bd8e9d7bd33beca74cc10c7dd973a9f9dbc))
21
+ * Replace math-rendering package with math-rendering-accessible-package for accessibility PD-1870 ([b6cdee8](https://github.com/pie-framework/pie-elements/commit/b6cdee8915b06e4c11b002b10437db07ce966501))
22
+ * updated pie-lib/pie-toolbox SC-27890 and reverted once again math-rendering-accessible ([fd312e1](https://github.com/pie-framework/pie-elements/commit/fd312e1336999893025231946649496d290883e4))
23
+ * use math-rendering-accessible everywhere PD-1870 ([d52e660](https://github.com/pie-framework/pie-elements/commit/d52e6607ad8847d704bd9cb9b7e3107c130f0500))
24
+
25
+
26
+
27
+
28
+
6
29
  # [7.8.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@7.7.2...@pie-element/math-inline@7.8.0) (2024-03-15)
7
30
 
8
31
 
@@ -3,6 +3,24 @@
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
+ # [7.7.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@7.6.0...@pie-element/math-inline-configure@7.7.0) (2024-03-20)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * updated pie-lib/pie-toolbox SC-28500 ([a8e4e6a](https://github.com/pie-framework/pie-elements/commit/a8e4e6ab27584435ce7ac3e964ccac2747402777))
12
+
13
+
14
+ ### Features
15
+
16
+ * Add configuration for custom buttons PD-3520 ([a7a7ace](https://github.com/pie-framework/pie-elements/commit/a7a7ace27eaac47c9a0f172f7ae0440c6dc4e600))
17
+ * updated pie-lib/pie-toolbox SC-27890 and reverted once again math-rendering-accessible ([fd312e1](https://github.com/pie-framework/pie-elements/commit/fd312e1336999893025231946649496d290883e4))
18
+ * use math-rendering-accessible everywhere PD-1870 ([d52e660](https://github.com/pie-framework/pie-elements/commit/d52e6607ad8847d704bd9cb9b7e3107c130f0500))
19
+
20
+
21
+
22
+
23
+
6
24
  # [7.6.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@7.5.2...@pie-element/math-inline-configure@7.6.0) (2024-03-15)
7
25
 
8
26
 
@@ -39,7 +39,7 @@ exports.generateValidationMessage = generateValidationMessage;
39
39
  var getPluginProps = function getPluginProps() {
40
40
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
41
41
  var baseInputConfiguration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
42
- return Object.assign(_objectSpread({}, baseInputConfiguration), props || {});
42
+ return _objectSpread(_objectSpread({}, baseInputConfiguration), props);
43
43
  };
44
44
 
45
45
  exports.getPluginProps = getPluginProps;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils.js"],"names":["ResponseTypes","advanced","simple","generateValidationMessage","model","config","maxResponseAreas","responseType","responseAreasMessage","answersMessage","getPluginProps","props","baseInputConfiguration","Object","assign"],"mappings":";;;;;;;;;;;;;;;AAAO,IAAMA,aAAa,GAAG;AAC3BC,EAAAA,QAAQ,EAAE,gBADiB;AAE3BC,EAAAA,MAAM,EAAE;AAFmB,CAAtB;;;AAKA,IAAMC,yBAAyB,GAAG,SAA5BA,yBAA4B,GAA6B;AAAA,MAA5BC,KAA4B,uEAApB,EAAoB;AAAA,MAAhBC,MAAgB,uEAAP,EAAO;AACpE,MAAQC,gBAAR,GAA6BD,MAA7B,CAAQC,gBAAR;AACA,MAAQC,YAAR,GAAyBH,KAAzB,CAAQG,YAAR;AACA,MAAIC,oBAAoB,GAAG,EAA3B;AAEA,MAAMC,cAAc,GAClB,kGADF;;AAGA,MAAIF,YAAY,KAAK,gBAArB,EAAuC;AACrCC,IAAAA,oBAAoB,GAClB,mCACCF,gBAAgB,yBAAkBA,gBAAlB,SAAwC,EADzD,IAEA,eAFA,IAGCA,gBAAgB,GAAG,GAAH,GAAS,EAH1B,IAIA,WALF;AAMD;;AAED,SAAO,6BAA6BG,cAA7B,GAA8CD,oBAArD;AACD,CAlBM;;;;AAoBA,IAAME,cAAc,GAAG,SAAjBA,cAAiB,GAA6C;AAAA,MAA5CC,KAA4C,uEAApC,EAAoC;AAAA,MAAhCC,sBAAgC,uEAAP,EAAO;AACzE,SAAOC,MAAM,CAACC,MAAP,mBAEAF,sBAFA,GAILD,KAAK,IAAI,EAJJ,CAAP;AAMD,CAPM","sourcesContent":["export const ResponseTypes = {\n advanced: 'Advanced Multi',\n simple: 'Simple',\n};\n\nexport const generateValidationMessage = (model = {}, config = {}) => {\n const { maxResponseAreas } = config;\n const { responseType } = model;\n let responseAreasMessage = '';\n\n const answersMessage =\n '\\nAll correct answers (the primary and any alternates) should not be empty and should be unique.';\n\n if (responseType === 'Advanced Multi') {\n responseAreasMessage =\n '\\nThere should be at least 1 ' +\n (maxResponseAreas ? `and at most ${maxResponseAreas} ` : '') +\n 'response area' +\n (maxResponseAreas ? 's' : '') +\n ' defined.';\n }\n\n return 'Validation requirements:' + answersMessage + responseAreasMessage;\n};\n\nexport const getPluginProps = (props = {}, baseInputConfiguration = {}) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n};\n"],"file":"utils.js"}
1
+ {"version":3,"sources":["../src/utils.js"],"names":["ResponseTypes","advanced","simple","generateValidationMessage","model","config","maxResponseAreas","responseType","responseAreasMessage","answersMessage","getPluginProps","props","baseInputConfiguration"],"mappings":";;;;;;;;;;;;;;;AAAO,IAAMA,aAAa,GAAG;AAC3BC,EAAAA,QAAQ,EAAE,gBADiB;AAE3BC,EAAAA,MAAM,EAAE;AAFmB,CAAtB;;;AAKA,IAAMC,yBAAyB,GAAG,SAA5BA,yBAA4B,GAA6B;AAAA,MAA5BC,KAA4B,uEAApB,EAAoB;AAAA,MAAhBC,MAAgB,uEAAP,EAAO;AACpE,MAAQC,gBAAR,GAA6BD,MAA7B,CAAQC,gBAAR;AACA,MAAQC,YAAR,GAAyBH,KAAzB,CAAQG,YAAR;AACA,MAAIC,oBAAoB,GAAG,EAA3B;AAEA,MAAMC,cAAc,GAClB,kGADF;;AAGA,MAAIF,YAAY,KAAK,gBAArB,EAAuC;AACrCC,IAAAA,oBAAoB,GAClB,mCACCF,gBAAgB,yBAAkBA,gBAAlB,SAAwC,EADzD,IAEA,eAFA,IAGCA,gBAAgB,GAAG,GAAH,GAAS,EAH1B,IAIA,WALF;AAMD;;AAED,SAAO,6BAA6BG,cAA7B,GAA8CD,oBAArD;AACD,CAlBM;;;;AAoBA,IAAME,cAAc,GAAG,SAAjBA,cAAiB;AAAA,MAACC,KAAD,uEAAS,EAAT;AAAA,MAAaC,sBAAb,uEAAsC,EAAtC;AAAA,yCACzBA,sBADyB,GAEzBD,KAFyB;AAAA,CAAvB","sourcesContent":["export const ResponseTypes = {\n advanced: 'Advanced Multi',\n simple: 'Simple',\n};\n\nexport const generateValidationMessage = (model = {}, config = {}) => {\n const { maxResponseAreas } = config;\n const { responseType } = model;\n let responseAreasMessage = '';\n\n const answersMessage =\n '\\nAll correct answers (the primary and any alternates) should not be empty and should be unique.';\n\n if (responseType === 'Advanced Multi') {\n responseAreasMessage =\n '\\nThere should be at least 1 ' +\n (maxResponseAreas ? `and at most ${maxResponseAreas} ` : '') +\n 'response area' +\n (maxResponseAreas ? 's' : '') +\n ' defined.';\n }\n\n return 'Validation requirements:' + answersMessage + responseAreasMessage;\n};\n\nexport const getPluginProps = (props = {}, baseInputConfiguration = {}) => ({\n ...baseInputConfiguration,\n ...props,\n});\n"],"file":"utils.js"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/math-inline-configure",
3
3
  "private": true,
4
- "version": "7.6.0",
4
+ "version": "7.7.0",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -11,7 +11,7 @@
11
11
  "@material-ui/icons": "^3.0.1",
12
12
  "@pie-framework/mathquill": "^1.1.3",
13
13
  "@pie-framework/pie-configure-events": "^1.3.0",
14
- "@pie-lib/pie-toolbox": "1.10.0",
14
+ "@pie-lib/pie-toolbox": "1.11.1",
15
15
  "classnames": "^2.2.5",
16
16
  "debug": "^3.1.0",
17
17
  "prop-types": "^15.6.2",
@@ -3,6 +3,23 @@
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
+ # [6.5.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-controller@6.4.0...@pie-element/math-inline-controller@6.5.0) (2024-03-20)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * updated pie-lib/pie-toolbox SC-28500 ([a8e4e6a](https://github.com/pie-framework/pie-elements/commit/a8e4e6ab27584435ce7ac3e964ccac2747402777))
12
+
13
+
14
+ ### Features
15
+
16
+ * updated pie-lib/pie-toolbox SC-27890 and reverted once again math-rendering-accessible ([fd312e1](https://github.com/pie-framework/pie-elements/commit/fd312e1336999893025231946649496d290883e4))
17
+ * use math-rendering-accessible everywhere PD-1870 ([d52e660](https://github.com/pie-framework/pie-elements/commit/d52e6607ad8847d704bd9cb9b7e3107c130f0500))
18
+
19
+
20
+
21
+
22
+
6
23
  # [6.4.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-controller@6.3.2...@pie-element/math-inline-controller@6.4.0) (2024-03-15)
7
24
 
8
25
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/math-inline-controller",
3
3
  "private": true,
4
- "version": "6.4.0",
4
+ "version": "6.5.0",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@pie-framework/math-validation": "^1.2.2",
13
- "@pie-lib/pie-toolbox": "1.10.0",
13
+ "@pie-lib/pie-toolbox": "1.11.1",
14
14
  "debug": "^3.1.0",
15
15
  "lodash": "^4.17.15"
16
16
  },
@@ -7,6 +7,17 @@
7
7
  "title": "EditableHtmlConfigureProp",
8
8
  "type": "object",
9
9
  "properties": {
10
+ "math": {
11
+ "title": "EditableHtmlButtonConfigure",
12
+ "type": "object",
13
+ "properties": {
14
+ "disabled": {
15
+ "description": "Indicates if the plugin is disabled or not",
16
+ "type": "boolean",
17
+ "title": "disabled"
18
+ }
19
+ }
20
+ },
10
21
  "audio": {
11
22
  "title": "EditableHtmlButtonConfigure",
12
23
  "type": "object",
@@ -50,6 +61,17 @@
50
61
  "title": "EditableHtmlConfigureProp",
51
62
  "type": "object",
52
63
  "properties": {
64
+ "math": {
65
+ "title": "EditableHtmlButtonConfigure",
66
+ "type": "object",
67
+ "properties": {
68
+ "disabled": {
69
+ "description": "Indicates if the plugin is disabled or not",
70
+ "type": "boolean",
71
+ "title": "disabled"
72
+ }
73
+ }
74
+ },
53
75
  "audio": {
54
76
  "title": "EditableHtmlButtonConfigure",
55
77
  "type": "object",
@@ -137,6 +159,17 @@
137
159
  "title": "EditableHtmlConfigureProp",
138
160
  "type": "object",
139
161
  "properties": {
162
+ "math": {
163
+ "title": "EditableHtmlButtonConfigure",
164
+ "type": "object",
165
+ "properties": {
166
+ "disabled": {
167
+ "description": "Indicates if the plugin is disabled or not",
168
+ "type": "boolean",
169
+ "title": "disabled"
170
+ }
171
+ }
172
+ },
140
173
  "audio": {
141
174
  "title": "EditableHtmlButtonConfigure",
142
175
  "type": "object",
@@ -245,6 +278,17 @@
245
278
  "title": "EditableHtmlConfigureProp",
246
279
  "type": "object",
247
280
  "properties": {
281
+ "math": {
282
+ "title": "EditableHtmlButtonConfigure",
283
+ "type": "object",
284
+ "properties": {
285
+ "disabled": {
286
+ "description": "Indicates if the plugin is disabled or not",
287
+ "type": "boolean",
288
+ "title": "disabled"
289
+ }
290
+ }
291
+ },
248
292
  "audio": {
249
293
  "title": "EditableHtmlButtonConfigure",
250
294
  "type": "object",
@@ -541,6 +585,17 @@
541
585
  "title": "EditableHtmlConfigureProp",
542
586
  "type": "object",
543
587
  "properties": {
588
+ "math": {
589
+ "title": "EditableHtmlButtonConfigure",
590
+ "type": "object",
591
+ "properties": {
592
+ "disabled": {
593
+ "description": "Indicates if the plugin is disabled or not",
594
+ "type": "boolean",
595
+ "title": "disabled"
596
+ }
597
+ }
598
+ },
544
599
  "audio": {
545
600
  "title": "EditableHtmlButtonConfigure",
546
601
  "type": "object",
@@ -595,6 +650,17 @@
595
650
  "title": "EditableHtmlConfigureProp",
596
651
  "type": "object",
597
652
  "properties": {
653
+ "math": {
654
+ "title": "EditableHtmlButtonConfigure",
655
+ "type": "object",
656
+ "properties": {
657
+ "disabled": {
658
+ "description": "Indicates if the plugin is disabled or not",
659
+ "type": "boolean",
660
+ "title": "disabled"
661
+ }
662
+ }
663
+ },
598
664
  "audio": {
599
665
  "title": "EditableHtmlButtonConfigure",
600
666
  "type": "object",
@@ -6,6 +6,14 @@ The schema defines the following properties:
6
6
 
7
7
  Properties of the `baseInputConfiguration` object:
8
8
 
9
+ ## `math` (object)
10
+
11
+ Properties of the `math` object:
12
+
13
+ ### `disabled` (boolean)
14
+
15
+ Indicates if the plugin is disabled or not
16
+
9
17
  ## `audio` (object)
10
18
 
11
19
  Properties of the `audio` object:
@@ -38,6 +46,14 @@ Properties of the `prompt` object:
38
46
 
39
47
  Properties of the `inputConfiguration` object:
40
48
 
49
+ ### `math` (object)
50
+
51
+ Properties of the `math` object:
52
+
53
+ #### `disabled` (boolean)
54
+
55
+ Indicates if the plugin is disabled or not
56
+
41
57
  ### `audio` (object)
42
58
 
43
59
  Properties of the `audio` object:
@@ -102,6 +118,14 @@ Properties of the `rationale` object:
102
118
 
103
119
  Properties of the `inputConfiguration` object:
104
120
 
121
+ ### `math` (object)
122
+
123
+ Properties of the `math` object:
124
+
125
+ #### `disabled` (boolean)
126
+
127
+ Indicates if the plugin is disabled or not
128
+
105
129
  ### `audio` (object)
106
130
 
107
131
  Properties of the `audio` object:
@@ -182,6 +206,14 @@ Properties of the `teacherInstructions` object:
182
206
 
183
207
  Properties of the `inputConfiguration` object:
184
208
 
209
+ ### `math` (object)
210
+
211
+ Properties of the `math` object:
212
+
213
+ #### `disabled` (boolean)
214
+
215
+ Indicates if the plugin is disabled or not
216
+
185
217
  ### `audio` (object)
186
218
 
187
219
  Properties of the `audio` object:
@@ -410,6 +442,14 @@ The schema defines the following additional types:
410
442
 
411
443
  Properties of the `EditableHtmlConfigureProp` object:
412
444
 
445
+ ### `math` (object)
446
+
447
+ Properties of the `math` object:
448
+
449
+ #### `disabled` (boolean)
450
+
451
+ Indicates if the plugin is disabled or not
452
+
413
453
  ### `audio` (object)
414
454
 
415
455
  Properties of the `audio` object:
@@ -450,6 +490,14 @@ Properties of the `EditableHtmlPluginConfigure` object:
450
490
 
451
491
  Properties of the `inputConfiguration` object:
452
492
 
493
+ #### `math` (object)
494
+
495
+ Properties of the `math` object:
496
+
497
+ ##### `disabled` (boolean)
498
+
499
+ Indicates if the plugin is disabled or not
500
+
453
501
  #### `audio` (object)
454
502
 
455
503
  Properties of the `audio` object:
@@ -500,6 +500,17 @@
500
500
  "title": "EditableHtmlConfigureProp",
501
501
  "type": "object",
502
502
  "properties": {
503
+ "math": {
504
+ "title": "EditableHtmlButtonConfigure",
505
+ "type": "object",
506
+ "properties": {
507
+ "disabled": {
508
+ "description": "Indicates if the plugin is disabled or not",
509
+ "type": "boolean",
510
+ "title": "disabled"
511
+ }
512
+ }
513
+ },
503
514
  "audio": {
504
515
  "title": "EditableHtmlButtonConfigure",
505
516
  "type": "object",
@@ -554,6 +565,17 @@
554
565
  "title": "EditableHtmlConfigureProp",
555
566
  "type": "object",
556
567
  "properties": {
568
+ "math": {
569
+ "title": "EditableHtmlButtonConfigure",
570
+ "type": "object",
571
+ "properties": {
572
+ "disabled": {
573
+ "description": "Indicates if the plugin is disabled or not",
574
+ "type": "boolean",
575
+ "title": "disabled"
576
+ }
577
+ }
578
+ },
557
579
  "audio": {
558
580
  "title": "EditableHtmlButtonConfigure",
559
581
  "type": "object",
@@ -261,6 +261,14 @@ The schema defines the following additional types:
261
261
 
262
262
  Properties of the `EditableHtmlConfigureProp` object:
263
263
 
264
+ ### `math` (object)
265
+
266
+ Properties of the `math` object:
267
+
268
+ #### `disabled` (boolean)
269
+
270
+ Indicates if the plugin is disabled or not
271
+
264
272
  ### `audio` (object)
265
273
 
266
274
  Properties of the `audio` object:
@@ -301,6 +309,14 @@ Properties of the `EditableHtmlPluginConfigure` object:
301
309
 
302
310
  Properties of the `inputConfiguration` object:
303
311
 
312
+ #### `math` (object)
313
+
314
+ Properties of the `math` object:
315
+
316
+ ##### `disabled` (boolean)
317
+
318
+ Indicates if the plugin is disabled or not
319
+
304
320
  #### `audio` (object)
305
321
 
306
322
  Properties of the `audio` object:
package/lib/main.js CHANGED
@@ -31,7 +31,7 @@ var _mathInput = require("@pie-lib/pie-toolbox/math-input");
31
31
 
32
32
  var _renderUi = require("@pie-lib/pie-toolbox/render-ui");
33
33
 
34
- var _mathRenderingAccessible = require("@pie-lib/pie-toolbox/math-rendering-accessible");
34
+ var _mathRendering = require("@pie-lib/pie-toolbox/math-rendering");
35
35
 
36
36
  var _styles = require("@material-ui/core/styles");
37
37
 
@@ -173,7 +173,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
173
173
  });
174
174
  }
175
175
 
176
- (0, _mathRenderingAccessible.renderMath)(_this.root);
176
+ (0, _mathRendering.renderMath)(_this.root);
177
177
  });
178
178
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "updateAria", function () {
179
179
  if (_this.root) {
@@ -439,7 +439,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
439
439
  this.handleAnswerBlockDomUpdate();
440
440
  this.updateAria();
441
441
  setTimeout(function () {
442
- return (0, _mathRenderingAccessible.renderMath)(_this3.root);
442
+ return (0, _mathRendering.renderMath)(_this3.root);
443
443
  }, 100);
444
444
  }
445
445
  }, {
@@ -550,7 +550,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
550
550
  __html: teacherInstructions
551
551
  }
552
552
  })), prompt && /*#__PURE__*/_react["default"].createElement("div", {
553
- className: classes.content
553
+ className: classes.promptContainer
554
554
  }, /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
555
555
  prompt: prompt
556
556
  })), studentPrintMode ? printView : /*#__PURE__*/_react["default"].createElement(_renderUi.Readable, {
@@ -732,6 +732,9 @@ var styles = function styles(theme) {
732
732
  width: '650px',
733
733
  opacity: 1
734
734
  },
735
+ promptContainer: {
736
+ marginBottom: theme.spacing.unit * 2
737
+ },
735
738
  main: {
736
739
  width: '100%',
737
740
  position: 'relative',
@@ -780,8 +783,6 @@ var styles = function styles(theme) {
780
783
  }
781
784
  },
782
785
  inputAndKeypadContainer: {
783
- marginTop: theme.spacing.unit * 2,
784
- marginBottom: theme.spacing.unit * 2,
785
786
  position: 'relative',
786
787
  '& .mq-overarrow-inner': {
787
788
  border: 'none !important',
package/lib/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main.jsx"],"names":["translator","Translator","registered","NEWLINE_LATEX","REGEX","DEFAULT_KEYPAD_VARIANT","IS_SAFARI","test","navigator","userAgent","generateAdditionalKeys","keyData","map","key","name","latex","write","label","getKeyPadWidth","additionalKeys","equationEditor","Math","floor","length","prepareForStatic","model","state","config","disabled","expression","responses","printMode","alwaysShowCorrect","modelExpression","showCorrect","answer","answerBlocks","replace","session","answers","blankSpace","repeat","value","Main","props","classes","root","Object","keys","forEach","answerId","el","querySelector","indexEl","MQ","MathQuill","getInterface","textContent","view","parentElement","classList","remove","correct","incorrect","StaticMath","selectableElements","querySelectorAll","elem","setAttribute","textareaElements","response","setState","callOnSessionChange","id","activeAnswerBlock","data","type","input","c","toNodeData","clear","Array","isArray","vv","cmd","keystroke","focus","onSessionChange","show","handleAnswerBlockDomUpdate","subfieldValue","completeAnswer","mqStatic","mathField","changeField","fields","find","k","tf","e","relatedTarget","currentTarget","offsetParent","children","attributes","window","registerEmbed","htmlString","blockContainer","blockResponse","blockMath","text","pattern","matches","match","nextProps","nextConfig","note","language","t","lng","env","mode","countResponseOccurrences","setTimeout","updateAria","newAnswers","nextState","sameModel","sameState","ref","div","document","firstChild","correctness","teacherInstructions","rationale","feedback","animationsDisabled","showNote","prompt","responseType","customKeys","role","displayNote","emptyResponse","showCorrectAnswerToggle","tooltipModeEnabled","staticLatex","viewMode","studentPrintMode","printView","printContainer","subFieldChanged","getFieldName","setInput","onSubFieldFocus","onBlur","midContent","main","srOnly","collapsible","hidden","visible","__html","content","inputAndKeypadContainer","ResponseTypes","simple","onSimpleResponseChange","advanced","showCorrectness","correctAnswerShown","printCorrect","setTooltipRef","tooltip","keypadTooltip","popper","keypadTooltipPopper","responseContainer","width","onClick","tooltipPopper","toggle","toggleShowCorrect","mainContainer","r","React","Component","PropTypes","object","isRequired","func","styles","theme","color","backgroundColor","background","display","primaryLight","padding","spacing","unit","border","secondary","fontSize","opacity","marginTop","paddingTop","position","title","marginBottom","paddingBottom","zIndex","minWidth","maxWidth","margin","top","borderColor","lineHeight","left","right","borderTop","letterSpacing","flex","palette","grey","alignItems","justifyContent","borderRight","pointerEvents","height","overflow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AACA,IAAQA,UAAR,GAAuBC,sBAAvB,CAAQD,UAAR;AACA,IAAIE,UAAU,GAAG,KAAjB;AAEA,IAAMC,aAAa,GAAG,YAAtB;AACA,IAAMC,KAAK,GAAG,gBAAd;AACA,IAAMC,sBAAsB,GAAG,CAA/B;AAEA,IAAMC,SAAS,GAAG,iCAAiCC,IAAjC,CAAsCC,SAAS,CAACC,SAAhD,CAAlB;;AAEA,SAASC,sBAAT,GAA8C;AAAA,MAAdC,OAAc,uEAAJ,EAAI;AAC5C,SAAOA,OAAO,CAACC,GAAR,CAAY,UAACC,GAAD;AAAA,WAAU;AAC3BC,MAAAA,IAAI,EAAED,GADqB;AAE3BE,MAAAA,KAAK,EAAEF,GAFoB;AAG3BG,MAAAA,KAAK,EAAEH,GAHoB;AAI3BI,MAAAA,KAAK,EAAEJ;AAJoB,KAAV;AAAA,GAAZ,CAAP;AAMD;;AAED,SAASK,cAAT,GAA6D;AAAA,MAArCC,cAAqC,uEAApB,EAAoB;AAAA,MAAhBC,cAAgB;AAC3D,SAAOC,IAAI,CAACC,KAAL,CAAWH,cAAc,CAACI,MAAf,GAAwB,CAAnC,IAAwC,EAAxC,IAA8CH,cAAc,KAAK,eAAnB,GAAqC,GAArC,GAA2C,GAAzF,CAAP;AACD;;AAED,SAASI,gBAAT,CAA0BC,KAA1B,EAAiCC,KAAjC,EAAwC;AACtC,aAA6B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TG,MAAAA,OAAO,YAAKN,KAAK,CAACO,OAAN,CAAcC,IAAd,GAAqB,CAA1B,kBAHE;AAITJ,MAAAA,OAAO,EAAE,MAJA;AAKT6B,MAAAA,UAAU,EAAE,QALH;AAMTC,MAAAA,cAAc,EAAE,QANP;AAOTJ,MAAAA,IAAI,EAAE,CAPG;AAQT,2BAAqB;AACnB,6BAAqB;AACnB,4BAAkB;AAChB1B,YAAAA,OAAO,EAAE;AADO;AADC;AADF;AARZ,KAjKc;AAiLzB9C,IAAAA,cAAc,EAAE;AACd2D,MAAAA,YAAY,EAAEjB,KAAK,CAACO,OAAN,CAAcC,IADd;AAEd4B,MAAAA,aAAa,EAAE;AAFD,KAjLS;AAqLzBtE,IAAAA,MAAM,EAAE;AACNiD,MAAAA,QAAQ,EAAE,UADJ;AAENW,MAAAA,IAAI,EAAE,UAFA;AAGNH,MAAAA,GAAG,EAAE,MAHC;AAINrC,MAAAA,KAAK,EAAE,KAJD;AAKNmD,MAAAA,MAAM,EAAE,KALF;AAMNC,MAAAA,QAAQ,EAAE;AANJ;AArLiB,GAAZ;AAAA,CAAf;;eA+Le,wBAAWvC,MAAX,EAAmBtJ,IAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { CorrectAnswerToggle } from '@pie-lib/pie-toolbox/correct-answer-toggle';\nimport { mq, HorizontalKeypad, updateSpans } from '@pie-lib/pie-toolbox/math-input';\nimport { Feedback, Collapsible, Readable, hasText, PreviewPrompt } from '@pie-lib/pie-toolbox/render-ui';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering-accessible';\nimport { withStyles } from '@material-ui/core/styles';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { ResponseTypes } from './utils';\nimport isEqual from 'lodash/isEqual';\nimport cx from 'classnames';\nimport SimpleQuestionBlock from './simple-question-block';\nimport MathQuill from '@pie-framework/mathquill';\nimport { color } from '@pie-lib/pie-toolbox/render-ui';\nimport isEmpty from 'lodash/isEmpty';\nimport Translator from '@pie-lib/pie-toolbox/translator';\nconst { translator } = Translator;\nlet registered = false;\n\nconst NEWLINE_LATEX = /\\\\newline/g;\nconst REGEX = /{{response}}/gm;\nconst DEFAULT_KEYPAD_VARIANT = 6;\n\nconst IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n\nfunction generateAdditionalKeys(keyData = []) {\n return keyData.map((key) => ({\n name: key,\n latex: key,\n write: key,\n label: key,\n }));\n}\n\nfunction getKeyPadWidth(additionalKeys = [], equationEditor) {\n return Math.floor(additionalKeys.length / 5) * 30 + (equationEditor === 'miscellaneous' ? 600 : 500);\n}\n\nfunction prepareForStatic(model, state) {\n const { config, disabled } = model || {};\n const { expression, responses, printMode, alwaysShowCorrect } = config || {};\n\n if (config && expression) {\n const modelExpression = expression;\n\n if (state.showCorrect) {\n return responses && responses.length && responses[0].answer;\n }\n\n let answerBlocks = 1; // assume one at least\n // build out local state model using responses declared in expression\n\n return (modelExpression || '')\n .replace(REGEX, function () {\n const answer = state.session.answers[`r${answerBlocks}`];\n\n if (printMode && !alwaysShowCorrect) {\n const blankSpace = '\\\\ \\\\ '.repeat(30) + '\\\\newline ';\n\n return `\\\\MathQuillMathField[r${answerBlocks++}]{${blankSpace.repeat(3)}}`;\n }\n\n if (disabled) {\n return `\\\\embed{answerBlock}[r${answerBlocks++}]`;\n }\n\n return `\\\\MathQuillMathField[r${answerBlocks++}]{${(answer && answer.value) || ''}}`;\n })\n .replace(NEWLINE_LATEX, '\\\\embed{newLine}[]');\n }\n}\n\nexport class Main extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n session: PropTypes.object.isRequired,\n onSessionChange: PropTypes.func,\n model: PropTypes.object.isRequired,\n };\n\n constructor(props) {\n super(props);\n\n const answers = {};\n\n if (props.model.config && props.model.config.expression) {\n let answerBlocks = 1; // assume one at least\n // build out local state model using responses declared in expression\n\n (props.model.config.expression || '').replace(REGEX, () => {\n answers[`r${answerBlocks}`] = {\n value:\n (props.session &&\n props.session.answers &&\n props.session.answers[`r${answerBlocks}`] &&\n props.session.answers[`r${answerBlocks}`].value) ||\n '',\n };\n\n answerBlocks += 1;\n });\n }\n\n this.state = {\n session: { ...props.session, answers },\n activeAnswerBlock: '',\n showCorrect: this.props.model.config.alwaysShowCorrect || false,\n };\n }\n\n UNSAFE_componentWillMount() {\n const { classes } = this.props;\n\n if (typeof window !== 'undefined') {\n let MQ = MathQuill.getInterface(2);\n\n if (!registered) {\n MQ.registerEmbed('answerBlock', (data) => {\n return {\n htmlString: `<div class=\"${classes.blockContainer}\">\n <div class=\"${classes.blockResponse}\" id=\"${data}Index\">R</div>\n <div class=\"${classes.blockMath}\">\n <span id=\"${data}\"></span>\n </div>\n </div>`,\n text: () => 'text',\n latex: () => `\\\\embed{answerBlock}[${data}]`,\n };\n });\n\n registered = true;\n }\n }\n }\n\n handleAnswerBlockDomUpdate = () => {\n const { model, classes } = this.props;\n const { session, showCorrect } = this.state;\n const answers = session.answers;\n\n if (this.root && model.disabled && !showCorrect) {\n Object.keys(answers).forEach((answerId) => {\n const el = this.root.querySelector(`#${answerId}`);\n const indexEl = this.root.querySelector(`#${answerId}Index`);\n // const correct = model.correctness && model.correctness.correct;\n\n if (el) {\n let MQ = MathQuill.getInterface(2);\n const answer = answers[answerId];\n\n el.textContent = (answer && answer.value) || '';\n\n if (!model.view) {\n // for now, we're not going to be showing individual response correctness\n // TODO re-attach the classes once we are\n // el.parentElement.parentElement.classList.add(\n // correct ? classes.correct : classes.incorrect\n // );\n } else {\n el.parentElement.parentElement.classList.remove(classes.correct);\n el.parentElement.parentElement.classList.remove(classes.incorrect);\n }\n\n MQ.StaticMath(el);\n\n // For now, we're not going to be indexing response blocks\n // TODO go back to indexing once we support individual response correctness\n // indexEl.textContent = `R${idx + 1}`;\n indexEl.textContent = 'R';\n }\n });\n }\n\n renderMath(this.root);\n };\n\n countResponseOccurrences(expression) {\n const pattern = /\\{\\{response\\}\\}/g;\n const matches = expression.match(pattern);\n\n return matches ? matches.length : 0;\n }\n\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { config } = this.props.model;\n const { config: nextConfig = {} } = nextProps.model || {};\n // check if the note is the default one for prev language and change to the default one for new language\n // this check is necessary in order to diferanciate between default and authour defined note\n // and only change between languages for default ones\n if (\n config.note &&\n config.language &&\n config.language !== nextConfig.language &&\n config.note === translator.t('mathInline.primaryCorrectWithAlternates', { lng: config.language })\n ) {\n config.note = translator.t('mathInline.primaryCorrectWithAlternates', { lng: nextConfig.language });\n }\n\n if ((config.env && config.env.mode !== 'evaluate') || (nextConfig.env && nextConfig.env.mode !== 'evaluate')) {\n this.setState({ ...this.state.session, showCorrect: false });\n }\n\n if (nextConfig.alwaysShowCorrect) {\n this.setState({ showCorrect: true });\n }\n\n if(this.countResponseOccurrences(config.expression) < this.countResponseOccurrences(nextConfig.expression)) {\n setTimeout(() => this.updateAria(), 100);\n }\n\n if (\n (config && config.responses && config.responses.length !== nextConfig.responses.length) ||\n (!config && nextConfig && nextConfig.responses) ||\n (config && nextConfig && config.expression !== nextConfig.expression)\n ) {\n const newAnswers = {};\n const answers = this.state.session.answers;\n\n let answerBlocks = 1; // assume one at least\n\n // build out local state model using responses declared in expression\n (nextConfig.expression || '').replace(REGEX, () => {\n newAnswers[`r${answerBlocks}`] = {\n value: (answers && answers[`r${answerBlocks}`] && answers[`r${answerBlocks}`].value) || '',\n };\n answerBlocks++;\n });\n\n this.setState(\n (state) => ({\n session: {\n ...state.session,\n completeAnswer: this.mqStatic && this.mqStatic.mathField.latex(),\n answers: newAnswers,\n },\n }),\n this.handleAnswerBlockDomUpdate,\n );\n }\n }\n\n shouldComponentUpdate(nextProps, nextState) {\n const sameModel = isEqual(this.props.model, nextProps.model);\n const sameState = isEqual(this.state, nextState);\n\n return !sameModel || !sameState;\n }\n\n componentDidMount() {\n this.handleAnswerBlockDomUpdate();\n this.updateAria();\n setTimeout(() => renderMath(this.root), 100);\n }\n\n componentDidUpdate() {\n this.handleAnswerBlockDomUpdate();\n }\n\n updateAria = () => {\n if (this.root) {\n // Update aria-hidden for .mq-selectable elements\n const selectableElements = this.root.querySelectorAll('.mq-selectable');\n selectableElements.forEach(elem => elem.setAttribute('aria-hidden', 'true'));\n \n // Update aria-label for textarea elements\n const textareaElements = this.root.querySelectorAll('textarea');\n textareaElements.forEach(elem => {\n elem.setAttribute('aria-label', 'Enter answer using math editor buttons or keyboard.');\n });\n }\n };\n\n onDone = () => {};\n\n onSimpleResponseChange = (response) => {\n this.setState((state) => ({ session: { ...state.session, response } }), this.callOnSessionChange);\n };\n\n onSubFieldFocus = (id) => {\n this.setState({ activeAnswerBlock: id });\n };\n\n toNodeData = (data) => {\n if (!data) {\n return;\n }\n\n const { type, value } = data;\n\n if (type === 'command' || type === 'cursor') {\n return data;\n } else if (type === 'answer') {\n return { type: 'answer', ...data };\n } else if (value === 'clear') {\n return { type: 'clear' };\n } else {\n return { type: 'write', value };\n }\n };\n\n setInput = (input) => {\n this.input = input;\n };\n\n onClick = (data) => {\n const c = this.toNodeData(data);\n\n if (c.type === 'clear') {\n this.input.clear();\n } else if (c.type === 'command') {\n if (Array.isArray(c.value)) {\n c.value.forEach((vv) => {\n this.input.cmd(vv);\n });\n } else {\n this.input.cmd(c.value);\n }\n } else if (c.type === 'cursor') {\n this.input.keystroke(c.value);\n } else {\n this.input.write(c.value);\n }\n\n this.input.focus();\n };\n\n callOnSessionChange = () => {\n const { onSessionChange } = this.props;\n\n if (onSessionChange) {\n onSessionChange(this.state.session);\n }\n };\n\n toggleShowCorrect = (show) => {\n this.setState({ showCorrect: show }, this.handleAnswerBlockDomUpdate);\n };\n\n subFieldChanged = (name, subfieldValue) => {\n updateSpans();\n\n if (name) {\n this.setState(\n (state) => ({\n session: {\n ...state.session,\n completeAnswer: this.mqStatic && this.mqStatic.mathField.latex(),\n answers: {\n ...state.session.answers,\n [name]: { value: subfieldValue },\n },\n },\n }),\n this.callOnSessionChange,\n );\n }\n };\n\n getFieldName = (changeField, fields) => {\n const { answers } = this.state.session;\n\n if (Object.keys(answers || {}).length) {\n const keys = Object.keys(answers);\n\n return keys.find((k) => {\n const tf = fields[k];\n\n return tf && tf.id == changeField.id;\n });\n }\n };\n\n onBlur = (e) => {\n const { relatedTarget, currentTarget } = e || {};\n\n if (\n !relatedTarget ||\n !currentTarget ||\n (!IS_SAFARI && !relatedTarget?.offsetParent?.children[0]?.attributes?.['data-keypad']) ||\n (IS_SAFARI && !relatedTarget?.offsetParent?.children[0]?.children[0]?.attributes?.['data-keypad'])\n ) {\n this.setState({ activeAnswerBlock: '' });\n }\n };\n\n setTooltipRef(ref) {\n // Safari Hack: https://stackoverflow.com/a/42764495/5757635\n setTimeout(() => {\n if (ref && IS_SAFARI) {\n const div = document.querySelector(\"[role='tooltip']\");\n\n if (div) {\n const el = div.firstChild;\n el.setAttribute('tabindex', '-1');\n }\n }\n }, 1);\n }\n\n render() {\n const { model, classes } = this.props;\n const { activeAnswerBlock, showCorrect, session } = this.state;\n const {\n config,\n correctness,\n disabled,\n view,\n teacherInstructions,\n rationale,\n feedback,\n animationsDisabled,\n printMode,\n alwaysShowCorrect,\n language,\n } = model || {};\n\n if (!config) {\n return null;\n }\n\n const {\n showNote,\n note,\n prompt,\n responses,\n responseType,\n equationEditor,\n customKeys,\n env: { mode, role } = {},\n } = config || {};\n const displayNote = (showCorrect || (mode === 'view' && role === 'instructor')) && showNote && note;\n const emptyResponse = isEmpty(responses);\n const showCorrectAnswerToggle = !emptyResponse && correctness && correctness.correctness !== 'correct';\n const tooltipModeEnabled = disabled && correctness;\n const additionalKeys = generateAdditionalKeys(customKeys);\n const correct = correctness && correctness.correct;\n const staticLatex = prepareForStatic(model, this.state) || '';\n const viewMode = disabled && !correctness;\n const studentPrintMode = printMode && !alwaysShowCorrect;\n\n const printView = (\n <div className={classes.printContainer}>\n <mq.Static\n className={classes.static}\n ref={(mqStatic) => (this.mqStatic = mqStatic || this.mqStatic)}\n latex={staticLatex}\n onSubFieldChange={this.subFieldChanged}\n getFieldName={this.getFieldName}\n setInput={this.setInput}\n onSubFieldFocus={this.onSubFieldFocus}\n onBlur={this.onBlur}\n />\n </div>\n );\n\n const midContent = (\n <div className={classes.main}>\n {mode === 'gather' && <h2 className={classes.srOnly}>Math Equation Response Question</h2>}\n\n {viewMode &&\n teacherInstructions &&\n hasText(teacherInstructions) &&\n (!animationsDisabled ? (\n <Collapsible\n className={classes.collapsible}\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n >\n <div dangerouslySetInnerHTML={{ __html: teacherInstructions }} />\n </Collapsible>\n ) : (\n <div dangerouslySetInnerHTML={{ __html: teacherInstructions }} />\n ))}\n\n {prompt && (\n <div className={classes.content}>\n <PreviewPrompt prompt={prompt} />\n </div>\n )}\n\n {studentPrintMode ? (\n printView\n ) : (\n <Readable false>\n <div className={classes.inputAndKeypadContainer}>\n {responseType === ResponseTypes.simple && (\n <SimpleQuestionBlock\n onSimpleResponseChange={this.onSimpleResponseChange}\n showCorrect={showCorrect}\n emptyResponse={emptyResponse}\n model={model}\n session={session}\n />\n )}\n\n {responseType === ResponseTypes.advanced && (\n <div\n className={cx(classes.expression, {\n [classes.incorrect]: !emptyResponse && !correct && !showCorrect,\n [classes.correct]: !emptyResponse && (correct || showCorrect),\n [classes.showCorrectness]: !emptyResponse && disabled && correctness && !view,\n [classes.correctAnswerShown]: showCorrect,\n [classes.printCorrect]: printMode && alwaysShowCorrect,\n })}\n >\n <Tooltip\n ref={(ref) => this.setTooltipRef(ref)}\n interactive\n open={!!activeAnswerBlock}\n classes={{\n tooltip: classes.keypadTooltip,\n popper: classes.keypadTooltipPopper,\n }}\n title={Object.keys(session.answers).map(\n (answerId) =>\n (answerId === activeAnswerBlock && !(showCorrect || disabled) && (\n <div\n data-keypad={true}\n key={answerId}\n className={classes.responseContainer}\n style={{\n // marginTop: this.mqStatic && this.mqStatic.input.offsetHeight - 20,\n width: getKeyPadWidth(additionalKeys, equationEditor),\n }}\n >\n <HorizontalKeypad\n additionalKeys={additionalKeys}\n mode={equationEditor || DEFAULT_KEYPAD_VARIANT}\n onClick={this.onClick}\n />\n </div>\n )) ||\n null,\n )}\n >\n <mq.Static\n className={classes.static}\n ref={(mqStatic) => (this.mqStatic = mqStatic || this.mqStatic)}\n latex={staticLatex}\n onSubFieldChange={this.subFieldChanged}\n getFieldName={this.getFieldName}\n setInput={this.setInput}\n onSubFieldFocus={this.onSubFieldFocus}\n onBlur={this.onBlur}\n />\n </Tooltip>\n </div>\n )}\n </div>\n </Readable>\n )}\n\n {viewMode && displayNote && (\n <div className={classes.note} dangerouslySetInnerHTML={{ __html: `<strong>Note:</strong> ${note}` }} />\n )}\n\n {viewMode &&\n rationale &&\n hasText(rationale) &&\n (!animationsDisabled ? (\n <Collapsible labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}>\n <div dangerouslySetInnerHTML={{ __html: rationale }} />\n </Collapsible>\n ) : (\n <div dangerouslySetInnerHTML={{ __html: rationale }} />\n ))}\n </div>\n );\n\n if (\n tooltipModeEnabled &&\n (showCorrectAnswerToggle ||\n (teacherInstructions && hasText(teacherInstructions)) ||\n (rationale && hasText(rationale)) ||\n feedback)\n ) {\n return (\n <Tooltip\n interactive\n classes={{\n tooltip: classes.tooltip,\n popper: classes.tooltipPopper,\n }}\n title={\n <div>\n <div className={classes.main}>\n {showCorrectAnswerToggle && (\n <CorrectAnswerToggle\n language={language}\n className={classes.toggle}\n show\n toggled={showCorrect}\n onToggle={this.toggleShowCorrect}\n />\n )}\n </div>\n\n {teacherInstructions && hasText(teacherInstructions) && (\n <Collapsible\n className={classes.collapsible}\n key=\"collapsible-teacher-instructions\"\n labels={{\n hidden: 'Show Teacher Instructions',\n visible: 'Hide Teacher Instructions',\n }}\n >\n <PreviewPrompt prompt={teacherInstructions} />\n </Collapsible>\n )}\n {displayNote && hasText(note) && (\n <Collapsible\n className={classes.collapsible}\n key=\"collapsible-note\"\n labels={{\n hidden: translator.t('common:showNote', { lng: language }),\n visible: translator.t('common:hideNote', { lng: language }),\n }}\n >\n <PreviewPrompt prompt={note} />\n </Collapsible>\n )}\n\n {rationale && hasText(rationale) && (\n <Collapsible\n className={classes.collapsible}\n key=\"collapsible-rationale\"\n labels={{\n hidden: 'Show Rationale',\n visible: 'Hide Rationale',\n }}\n >\n <PreviewPrompt prompt={rationale} />\n </Collapsible>\n )}\n\n {feedback && <Feedback correctness={correctness.correctness} feedback={feedback} />}\n </div>\n }\n >\n <div className={classes.mainContainer} ref={(r) => (this.root = r || this.root)}>\n {midContent}\n </div>\n </Tooltip>\n );\n }\n\n return (\n <div className={classes.mainContainer} ref={(r) => (this.root = r || this.root)}>\n {midContent}\n </div>\n );\n }\n}\n\nconst styles = (theme) => ({\n mainContainer: {\n color: color.text(),\n backgroundColor: color.background(),\n display: 'inline-block',\n },\n tooltip: {\n background: `${color.primaryLight()} !important`,\n color: color.text(),\n padding: theme.spacing.unit * 2,\n border: `1px solid ${color.secondary()}`,\n fontSize: '16px',\n '& :not(.MathJax) > table tr': {\n '&:nth-child(2n)': {\n backgroundColor: 'unset !important',\n },\n },\n },\n tooltipPopper: {\n opacity: 1,\n },\n keypadTooltip: {\n fontSize: 'initial',\n background: 'transparent',\n width: '600px',\n marginTop: 0,\n paddingTop: 0,\n },\n keypadTooltipPopper: {\n background: 'transparent',\n width: '650px',\n opacity: 1,\n },\n main: {\n width: '100%',\n position: 'relative',\n backgroundColor: color.background(),\n color: color.text(),\n },\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit,\n },\n note: {\n paddingBottom: theme.spacing.unit * 2,\n },\n collapsible: {\n marginBottom: theme.spacing.unit * 2,\n },\n responseContainer: {\n zIndex: 10,\n // position: 'absolute',\n // right: 0,\n minWidth: '400px',\n marginTop: theme.spacing.unit * 2,\n },\n expression: {\n maxWidth: 'fit-content',\n '& > .mq-math-mode': {\n '& > .mq-root-block': {\n '& > .mq-editable-field': {\n minWidth: '10px',\n margin: (theme.spacing.unit * 2) / 3,\n padding: theme.spacing.unit / 4,\n },\n },\n '& sup': {\n top: 0,\n },\n },\n },\n static: {\n '& > .mq-root-block': {\n '& > .mq-editable-field': {\n borderColor: color.text(),\n },\n },\n },\n inputAndKeypadContainer: {\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n position: 'relative',\n '& .mq-overarrow-inner': {\n border: 'none !important',\n padding: '0 !important',\n },\n '& .mq-overarrow-inner-right': {\n display: 'none !important',\n },\n '& .mq-overarrow-inner-left': {\n display: 'none !important',\n },\n '& .mq-overarrow.mq-arrow-both': {\n minWidth: '1.23em',\n '& *': {\n lineHeight: '1 !important',\n },\n '&:before': {\n top: '-0.4em',\n left: '-1px',\n },\n '&:after': {\n top: '-2.4em',\n right: '-1px',\n },\n '&.mq-empty:after': {\n top: '-0.45em',\n },\n },\n '& .mq-overarrow.mq-arrow-right': {\n '&:before': {\n top: '-0.4em',\n right: '-1px',\n },\n },\n '& .mq-longdiv-inner': {\n borderTop: '1px solid !important',\n paddingTop: '1.5px !important',\n },\n '& .mq-parallelogram': {\n lineHeight: 0.85,\n },\n },\n showCorrectness: {\n border: '2px solid',\n },\n correctAnswerShown: {\n padding: theme.spacing.unit,\n letterSpacing: '0.5px',\n },\n printCorrect: {\n border: `2px solid ${color.correct()} !important`,\n },\n correct: {\n borderColor: `${color.correct()} !important`,\n },\n incorrect: {\n borderColor: `${color.incorrect()} !important`,\n },\n blockContainer: {\n margin: `${theme.spacing.unit}px !important`,\n display: 'inline-flex',\n border: '2px solid grey !important',\n },\n blockResponse: {\n flex: 2,\n color: 'grey',\n background: theme.palette.grey['A100'],\n fontSize: '0.8rem !important',\n padding: `${theme.spacing.unit / 2}px !important`,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRight: `2px solid ${color.disabled()} !important`,\n },\n toggle: {\n color: color.text(),\n marginBottom: theme.spacing.unit * 2,\n },\n blockMath: {\n color: color.text(),\n backgroundColor: color.background(),\n padding: `${theme.spacing.unit / 2}px !important`,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flex: 8,\n '& > .mq-math-mode': {\n '& > .mq-hasCursor': {\n '& > .mq-cursor': {\n display: 'none',\n },\n },\n },\n },\n printContainer: {\n marginBottom: theme.spacing.unit,\n pointerEvents: 'none',\n },\n srOnly: {\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n },\n});\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
1
+ {"version":3,"sources":["../src/main.jsx"],"names":["translator","Translator","registered","NEWLINE_LATEX","REGEX","DEFAULT_KEYPAD_VARIANT","IS_SAFARI","test","navigator","userAgent","generateAdditionalKeys","keyData","map","key","name","latex","write","label","getKeyPadWidth","additionalKeys","equationEditor","Math","floor","length","prepareForStatic","model","state","config","disabled","expression","responses","printMode","alwaysShowCorrect","modelExpression","showCorrect","answer","answerBlocks","replace","session","answers","blankSpace","repeat","value","Main","props","classes","root","Object","keys","forEach","answerId","el","querySelector","indexEl","MQ","MathQuill","getInterface","textContent","view","parentElement","classList","remove","correct","incorrect","StaticMath","selectableElements","querySelectorAll","elem","setAttribute","textareaElements","response","setState","callOnSessionChange","id","activeAnswerBlock","data","type","input","c","toNodeData","clear","Array","isArray","vv","cmd","keystroke","focus","onSessionChange","show","handleAnswerBlockDomUpdate","subfieldValue","completeAnswer","mqStatic","mathField","changeField","fields","find","k","tf","e","relatedTarget","currentTarget","offsetParent","children","attributes","window","registerEmbed","htmlString","blockContainer","blockResponse","blockMath","text","pattern","matches","match","nextProps","nextConfig","note","language","t","lng","env","mode","countResponseOccurrences","setTimeout","updateAria","newAnswers","nextState","sameModel","sameState","ref","div","document","firstChild","correctness","teacherInstructions","rationale","feedback","animationsDisabled","showNote","prompt","responseType","customKeys","role","displayNote","emptyResponse","showCorrectAnswerToggle","tooltipModeEnabled","staticLatex","viewMode","studentPrintMode","printView","printContainer","subFieldChanged","getFieldName","setInput","onSubFieldFocus","onBlur","midContent","main","srOnly","collapsible","hidden","visible","__html","promptContainer","inputAndKeypadContainer","ResponseTypes","simple","onSimpleResponseChange","advanced","showCorrectness","correctAnswerShown","printCorrect","setTooltipRef","tooltip","keypadTooltip","popper","keypadTooltipPopper","responseContainer","width","onClick","tooltipPopper","toggle","toggleShowCorrect","mainContainer","r","React","Component","PropTypes","object","isRequired","func","styles","theme","color","backgroundColor","background","display","primaryLight","padding","spacing","unit","border","secondary","fontSize","opacity","marginTop","paddingTop","marginBottom","position","title","paddingBottom","zIndex","minWidth","maxWidth","margin","top","borderColor","lineHeight","left","right","borderTop","letterSpacing","flex","palette","grey","alignItems","justifyContent","borderRight","pointerEvents","height","overflow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AACA,IAAQA,UAAR,GAAuBC,sBAAvB,CAAQD,UAAR;AACA,IAAIE,UAAU,GAAG,KAAjB;AAEA,IAAMC,aAAa,GAAG,YAAtB;AACA,IAAMC,KAAK,GAAG,gBAAd;AACA,IAAMC,sBAAsB,GAAG,CAA/B;AAEA,IAAMC,SAAS,GAAG,iCAAiCC,IAAjC,CAAsCC,SAAS,CAACC,SAAhD,CAAlB;;AAEA,SAASC,sBAAT,GAA8C;AAAA,MAAdC,OAAc,uEAAJ,EAAI;AAC5C,SAAOA,OAAO,CAACC,GAAR,CAAY,UAACC,GAAD;AAAA,WAAU;AAC3BC,MAAAA,IAAI,EAAED,GADqB;AAE3BE,MAAAA,KAAK,EAAEF,GAFoB;AAG3BG,MAAAA,KAAK,EAAEH,GAHoB;AAI3BI,MAAAA,KAAK,EAAEJ;AAJoB,KAAV;AAAA,GAAZ,CAAP;AAMD;;AAED,SAASK,cAAT,GAA6D;AAAA,MAArCC,cAAqC,uEAApB,EAAoB;AAAA,MAAhBC,cAAgB;AAC3D,SAAOC,IAAI,CAACC,KAAL,CAAW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AF7B,KA9JiB;AAkKzB5F,IAAAA,SAAS,EAAE;AACTqF,MAAAA,KAAK,EAAEA,gBAAMpF,IAAN,EADE;AAETqF,MAAAA,eAAe,EAAED,gBAAME,UAAN,EAFR;AAGTG,MAAAA,OAAO,YAAKN,KAAK,CAACO,OAAN,CAAcC,IAAd,GAAqB,CAA1B,kBAHE;AAITJ,MAAAA,OAAO,EAAE,MAJA;AAKT6B,MAAAA,UAAU,EAAE,QALH;AAMTC,MAAAA,cAAc,EAAE,QANP;AAOTJ,MAAAA,IAAI,EAAE,CAPG;AAQT,2BAAqB;AACnB,6BAAqB;AACnB,4BAAkB;AAChB1B,YAAAA,OAAO,EAAE;AADO;AADC;AADF;AARZ,KAlKc;AAkLzB9C,IAAAA,cAAc,EAAE;AACdyD,MAAAA,YAAY,EAAEf,KAAK,CAACO,OAAN,CAAcC,IADd;AAEd4B,MAAAA,aAAa,EAAE;AAFD,KAlLS;AAsLzBtE,IAAAA,MAAM,EAAE;AACNkD,MAAAA,QAAQ,EAAE,UADJ;AAENU,MAAAA,IAAI,EAAE,UAFA;AAGNH,MAAAA,GAAG,EAAE,MAHC;AAINrC,MAAAA,KAAK,EAAE,KAJD;AAKNmD,MAAAA,MAAM,EAAE,KALF;AAMNC,MAAAA,QAAQ,EAAE;AANJ;AAtLiB,GAAZ;AAAA,CAAf;;eAgMe,wBAAWvC,MAAX,EAAmBtJ,IAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { CorrectAnswerToggle } from '@pie-lib/pie-toolbox/correct-answer-toggle';\nimport { mq, HorizontalKeypad, updateSpans } from '@pie-lib/pie-toolbox/math-input';\nimport { Feedback, Collapsible, Readable, hasText, PreviewPrompt } from '@pie-lib/pie-toolbox/render-ui';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering';\nimport { withStyles } from '@material-ui/core/styles';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { ResponseTypes } from './utils';\nimport isEqual from 'lodash/isEqual';\nimport cx from 'classnames';\nimport SimpleQuestionBlock from './simple-question-block';\nimport MathQuill from '@pie-framework/mathquill';\nimport { color } from '@pie-lib/pie-toolbox/render-ui';\nimport isEmpty from 'lodash/isEmpty';\nimport Translator from '@pie-lib/pie-toolbox/translator';\nconst { translator } = Translator;\nlet registered = false;\n\nconst NEWLINE_LATEX = /\\\\newline/g;\nconst REGEX = /{{response}}/gm;\nconst DEFAULT_KEYPAD_VARIANT = 6;\n\nconst IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n\nfunction generateAdditionalKeys(keyData = []) {\n return keyData.map((key) => ({\n name: key,\n latex: key,\n write: key,\n label: key,\n }));\n}\n\nfunction getKeyPadWidth(additionalKeys = [], equationEditor) {\n return Math.floor(additionalKeys.length / 5) * 30 + (equationEditor === 'miscellaneous' ? 600 : 500);\n}\n\nfunction prepareForStatic(model, state) {\n const { config, disabled } = model || {};\n const { expression, responses, printMode, alwaysShowCorrect } = config || {};\n\n if (config && expression) {\n const modelExpression = expression;\n\n if (state.showCorrect) {\n return responses && responses.length && responses[0].answer;\n }\n\n let answerBlocks = 1; // assume one at least\n // build out local state model using responses declared in expression\n\n return (modelExpression || '')\n .replace(REGEX, function () {\n const answer = state.session.answers[`r${answerBlocks}`];\n\n if (printMode && !alwaysShowCorrect) {\n const blankSpace = '\\\\ \\\\ '.repeat(30) + '\\\\newline ';\n\n return `\\\\MathQuillMathField[r${answerBlocks++}]{${blankSpace.repeat(3)}}`;\n }\n\n if (disabled) {\n return `\\\\embed{answerBlock}[r${answerBlocks++}]`;\n }\n\n return `\\\\MathQuillMathField[r${answerBlocks++}]{${(answer && answer.value) || ''}}`;\n })\n .replace(NEWLINE_LATEX, '\\\\embed{newLine}[]');\n }\n}\n\nexport class Main extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n session: PropTypes.object.isRequired,\n onSessionChange: PropTypes.func,\n model: PropTypes.object.isRequired,\n };\n\n constructor(props) {\n super(props);\n\n const answers = {};\n\n if (props.model.config && props.model.config.expression) {\n let answerBlocks = 1; // assume one at least\n // build out local state model using responses declared in expression\n\n (props.model.config.expression || '').replace(REGEX, () => {\n answers[`r${answerBlocks}`] = {\n value:\n (props.session &&\n props.session.answers &&\n props.session.answers[`r${answerBlocks}`] &&\n props.session.answers[`r${answerBlocks}`].value) ||\n '',\n };\n\n answerBlocks += 1;\n });\n }\n\n this.state = {\n session: { ...props.session, answers },\n activeAnswerBlock: '',\n showCorrect: this.props.model.config.alwaysShowCorrect || false,\n };\n }\n\n UNSAFE_componentWillMount() {\n const { classes } = this.props;\n\n if (typeof window !== 'undefined') {\n let MQ = MathQuill.getInterface(2);\n\n if (!registered) {\n MQ.registerEmbed('answerBlock', (data) => {\n return {\n htmlString: `<div class=\"${classes.blockContainer}\">\n <div class=\"${classes.blockResponse}\" id=\"${data}Index\">R</div>\n <div class=\"${classes.blockMath}\">\n <span id=\"${data}\"></span>\n </div>\n </div>`,\n text: () => 'text',\n latex: () => `\\\\embed{answerBlock}[${data}]`,\n };\n });\n\n registered = true;\n }\n }\n }\n\n handleAnswerBlockDomUpdate = () => {\n const { model, classes } = this.props;\n const { session, showCorrect } = this.state;\n const answers = session.answers;\n\n if (this.root && model.disabled && !showCorrect) {\n Object.keys(answers).forEach((answerId) => {\n const el = this.root.querySelector(`#${answerId}`);\n const indexEl = this.root.querySelector(`#${answerId}Index`);\n // const correct = model.correctness && model.correctness.correct;\n\n if (el) {\n let MQ = MathQuill.getInterface(2);\n const answer = answers[answerId];\n\n el.textContent = (answer && answer.value) || '';\n\n if (!model.view) {\n // for now, we're not going to be showing individual response correctness\n // TODO re-attach the classes once we are\n // el.parentElement.parentElement.classList.add(\n // correct ? classes.correct : classes.incorrect\n // );\n } else {\n el.parentElement.parentElement.classList.remove(classes.correct);\n el.parentElement.parentElement.classList.remove(classes.incorrect);\n }\n\n MQ.StaticMath(el);\n\n // For now, we're not going to be indexing response blocks\n // TODO go back to indexing once we support individual response correctness\n // indexEl.textContent = `R${idx + 1}`;\n indexEl.textContent = 'R';\n }\n });\n }\n\n renderMath(this.root);\n };\n\n countResponseOccurrences(expression) {\n const pattern = /\\{\\{response\\}\\}/g;\n const matches = expression.match(pattern);\n\n return matches ? matches.length : 0;\n }\n\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { config } = this.props.model;\n const { config: nextConfig = {} } = nextProps.model || {};\n // check if the note is the default one for prev language and change to the default one for new language\n // this check is necessary in order to diferanciate between default and authour defined note\n // and only change between languages for default ones\n if (\n config.note &&\n config.language &&\n config.language !== nextConfig.language &&\n config.note === translator.t('mathInline.primaryCorrectWithAlternates', { lng: config.language })\n ) {\n config.note = translator.t('mathInline.primaryCorrectWithAlternates', { lng: nextConfig.language });\n }\n\n if ((config.env && config.env.mode !== 'evaluate') || (nextConfig.env && nextConfig.env.mode !== 'evaluate')) {\n this.setState({ ...this.state.session, showCorrect: false });\n }\n\n if (nextConfig.alwaysShowCorrect) {\n this.setState({ showCorrect: true });\n }\n\n if(this.countResponseOccurrences(config.expression) < this.countResponseOccurrences(nextConfig.expression)) {\n setTimeout(() => this.updateAria(), 100);\n }\n\n if (\n (config && config.responses && config.responses.length !== nextConfig.responses.length) ||\n (!config && nextConfig && nextConfig.responses) ||\n (config && nextConfig && config.expression !== nextConfig.expression)\n ) {\n const newAnswers = {};\n const answers = this.state.session.answers;\n\n let answerBlocks = 1; // assume one at least\n\n // build out local state model using responses declared in expression\n (nextConfig.expression || '').replace(REGEX, () => {\n newAnswers[`r${answerBlocks}`] = {\n value: (answers && answers[`r${answerBlocks}`] && answers[`r${answerBlocks}`].value) || '',\n };\n answerBlocks++;\n });\n\n this.setState(\n (state) => ({\n session: {\n ...state.session,\n completeAnswer: this.mqStatic && this.mqStatic.mathField.latex(),\n answers: newAnswers,\n },\n }),\n this.handleAnswerBlockDomUpdate,\n );\n }\n }\n\n shouldComponentUpdate(nextProps, nextState) {\n const sameModel = isEqual(this.props.model, nextProps.model);\n const sameState = isEqual(this.state, nextState);\n\n return !sameModel || !sameState;\n }\n\n componentDidMount() {\n this.handleAnswerBlockDomUpdate();\n this.updateAria();\n setTimeout(() => renderMath(this.root), 100);\n }\n\n componentDidUpdate() {\n this.handleAnswerBlockDomUpdate();\n }\n\n updateAria = () => {\n if (this.root) {\n // Update aria-hidden for .mq-selectable elements\n const selectableElements = this.root.querySelectorAll('.mq-selectable');\n selectableElements.forEach(elem => elem.setAttribute('aria-hidden', 'true'));\n\n // Update aria-label for textarea elements\n const textareaElements = this.root.querySelectorAll('textarea');\n textareaElements.forEach(elem => {\n elem.setAttribute('aria-label', 'Enter answer using math editor buttons or keyboard.');\n });\n }\n };\n\n onDone = () => {};\n\n onSimpleResponseChange = (response) => {\n this.setState((state) => ({ session: { ...state.session, response } }), this.callOnSessionChange);\n };\n\n onSubFieldFocus = (id) => {\n this.setState({ activeAnswerBlock: id });\n };\n\n toNodeData = (data) => {\n if (!data) {\n return;\n }\n\n const { type, value } = data;\n\n if (type === 'command' || type === 'cursor') {\n return data;\n } else if (type === 'answer') {\n return { type: 'answer', ...data };\n } else if (value === 'clear') {\n return { type: 'clear' };\n } else {\n return { type: 'write', value };\n }\n };\n\n setInput = (input) => {\n this.input = input;\n };\n\n onClick = (data) => {\n const c = this.toNodeData(data);\n\n if (c.type === 'clear') {\n this.input.clear();\n } else if (c.type === 'command') {\n if (Array.isArray(c.value)) {\n c.value.forEach((vv) => {\n this.input.cmd(vv);\n });\n } else {\n this.input.cmd(c.value);\n }\n } else if (c.type === 'cursor') {\n this.input.keystroke(c.value);\n } else {\n this.input.write(c.value);\n }\n\n this.input.focus();\n };\n\n callOnSessionChange = () => {\n const { onSessionChange } = this.props;\n\n if (onSessionChange) {\n onSessionChange(this.state.session);\n }\n };\n\n toggleShowCorrect = (show) => {\n this.setState({ showCorrect: show }, this.handleAnswerBlockDomUpdate);\n };\n\n subFieldChanged = (name, subfieldValue) => {\n updateSpans();\n\n if (name) {\n this.setState(\n (state) => ({\n session: {\n ...state.session,\n completeAnswer: this.mqStatic && this.mqStatic.mathField.latex(),\n answers: {\n ...state.session.answers,\n [name]: { value: subfieldValue },\n },\n },\n }),\n this.callOnSessionChange,\n );\n }\n };\n\n getFieldName = (changeField, fields) => {\n const { answers } = this.state.session;\n\n if (Object.keys(answers || {}).length) {\n const keys = Object.keys(answers);\n\n return keys.find((k) => {\n const tf = fields[k];\n\n return tf && tf.id == changeField.id;\n });\n }\n };\n\n onBlur = (e) => {\n const { relatedTarget, currentTarget } = e || {};\n\n if (\n !relatedTarget ||\n !currentTarget ||\n (!IS_SAFARI && !relatedTarget?.offsetParent?.children[0]?.attributes?.['data-keypad']) ||\n (IS_SAFARI && !relatedTarget?.offsetParent?.children[0]?.children[0]?.attributes?.['data-keypad'])\n ) {\n this.setState({ activeAnswerBlock: '' });\n }\n };\n\n setTooltipRef(ref) {\n // Safari Hack: https://stackoverflow.com/a/42764495/5757635\n setTimeout(() => {\n if (ref && IS_SAFARI) {\n const div = document.querySelector(\"[role='tooltip']\");\n\n if (div) {\n const el = div.firstChild;\n el.setAttribute('tabindex', '-1');\n }\n }\n }, 1);\n }\n\n render() {\n const { model, classes } = this.props;\n const { activeAnswerBlock, showCorrect, session } = this.state;\n const {\n config,\n correctness,\n disabled,\n view,\n teacherInstructions,\n rationale,\n feedback,\n animationsDisabled,\n printMode,\n alwaysShowCorrect,\n language,\n } = model || {};\n\n if (!config) {\n return null;\n }\n\n const {\n showNote,\n note,\n prompt,\n responses,\n responseType,\n equationEditor,\n customKeys,\n env: { mode, role } = {},\n } = config || {};\n const displayNote = (showCorrect || (mode === 'view' && role === 'instructor')) && showNote && note;\n const emptyResponse = isEmpty(responses);\n const showCorrectAnswerToggle = !emptyResponse && correctness && correctness.correctness !== 'correct';\n const tooltipModeEnabled = disabled && correctness;\n const additionalKeys = generateAdditionalKeys(customKeys);\n const correct = correctness && correctness.correct;\n const staticLatex = prepareForStatic(model, this.state) || '';\n const viewMode = disabled && !correctness;\n const studentPrintMode = printMode && !alwaysShowCorrect;\n\n const printView = (\n <div className={classes.printContainer}>\n <mq.Static\n className={classes.static}\n ref={(mqStatic) => (this.mqStatic = mqStatic || this.mqStatic)}\n latex={staticLatex}\n onSubFieldChange={this.subFieldChanged}\n getFieldName={this.getFieldName}\n setInput={this.setInput}\n onSubFieldFocus={this.onSubFieldFocus}\n onBlur={this.onBlur}\n />\n </div>\n );\n\n const midContent = (\n <div className={classes.main}>\n {mode === 'gather' && <h2 className={classes.srOnly}>Math Equation Response Question</h2>}\n\n {viewMode &&\n teacherInstructions &&\n hasText(teacherInstructions) &&\n (!animationsDisabled ? (\n <Collapsible\n className={classes.collapsible}\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n >\n <div dangerouslySetInnerHTML={{ __html: teacherInstructions }} />\n </Collapsible>\n ) : (\n <div dangerouslySetInnerHTML={{ __html: teacherInstructions }} />\n ))}\n\n {prompt && (\n <div className={classes.promptContainer}>\n <PreviewPrompt prompt={prompt} />\n </div>\n )}\n\n {studentPrintMode ? (\n printView\n ) : (\n <Readable false>\n <div className={classes.inputAndKeypadContainer}>\n {responseType === ResponseTypes.simple && (\n <SimpleQuestionBlock\n onSimpleResponseChange={this.onSimpleResponseChange}\n showCorrect={showCorrect}\n emptyResponse={emptyResponse}\n model={model}\n session={session}\n />\n )}\n\n {responseType === ResponseTypes.advanced && (\n <div\n className={cx(classes.expression, {\n [classes.incorrect]: !emptyResponse && !correct && !showCorrect,\n [classes.correct]: !emptyResponse && (correct || showCorrect),\n [classes.showCorrectness]: !emptyResponse && disabled && correctness && !view,\n [classes.correctAnswerShown]: showCorrect,\n [classes.printCorrect]: printMode && alwaysShowCorrect,\n })}\n >\n <Tooltip\n ref={(ref) => this.setTooltipRef(ref)}\n interactive\n open={!!activeAnswerBlock}\n classes={{\n tooltip: classes.keypadTooltip,\n popper: classes.keypadTooltipPopper,\n }}\n title={Object.keys(session.answers).map(\n (answerId) =>\n (answerId === activeAnswerBlock && !(showCorrect || disabled) && (\n <div\n data-keypad={true}\n key={answerId}\n className={classes.responseContainer}\n style={{\n // marginTop: this.mqStatic && this.mqStatic.input.offsetHeight - 20,\n width: getKeyPadWidth(additionalKeys, equationEditor),\n }}\n >\n <HorizontalKeypad\n additionalKeys={additionalKeys}\n mode={equationEditor || DEFAULT_KEYPAD_VARIANT}\n onClick={this.onClick}\n />\n </div>\n )) ||\n null,\n )}\n >\n <mq.Static\n className={classes.static}\n ref={(mqStatic) => (this.mqStatic = mqStatic || this.mqStatic)}\n latex={staticLatex}\n onSubFieldChange={this.subFieldChanged}\n getFieldName={this.getFieldName}\n setInput={this.setInput}\n onSubFieldFocus={this.onSubFieldFocus}\n onBlur={this.onBlur}\n />\n </Tooltip>\n </div>\n )}\n </div>\n </Readable>\n )}\n\n {viewMode && displayNote && (\n <div className={classes.note} dangerouslySetInnerHTML={{ __html: `<strong>Note:</strong> ${note}` }} />\n )}\n\n {viewMode &&\n rationale &&\n hasText(rationale) &&\n (!animationsDisabled ? (\n <Collapsible labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}>\n <div dangerouslySetInnerHTML={{ __html: rationale }} />\n </Collapsible>\n ) : (\n <div dangerouslySetInnerHTML={{ __html: rationale }} />\n ))}\n </div>\n );\n\n if (\n tooltipModeEnabled &&\n (showCorrectAnswerToggle ||\n (teacherInstructions && hasText(teacherInstructions)) ||\n (rationale && hasText(rationale)) ||\n feedback)\n ) {\n return (\n <Tooltip\n interactive\n classes={{\n tooltip: classes.tooltip,\n popper: classes.tooltipPopper,\n }}\n title={\n <div>\n <div className={classes.main}>\n {showCorrectAnswerToggle && (\n <CorrectAnswerToggle\n language={language}\n className={classes.toggle}\n show\n toggled={showCorrect}\n onToggle={this.toggleShowCorrect}\n />\n )}\n </div>\n\n {teacherInstructions && hasText(teacherInstructions) && (\n <Collapsible\n className={classes.collapsible}\n key=\"collapsible-teacher-instructions\"\n labels={{\n hidden: 'Show Teacher Instructions',\n visible: 'Hide Teacher Instructions',\n }}\n >\n <PreviewPrompt prompt={teacherInstructions} />\n </Collapsible>\n )}\n {displayNote && hasText(note) && (\n <Collapsible\n className={classes.collapsible}\n key=\"collapsible-note\"\n labels={{\n hidden: translator.t('common:showNote', { lng: language }),\n visible: translator.t('common:hideNote', { lng: language }),\n }}\n >\n <PreviewPrompt prompt={note} />\n </Collapsible>\n )}\n\n {rationale && hasText(rationale) && (\n <Collapsible\n className={classes.collapsible}\n key=\"collapsible-rationale\"\n labels={{\n hidden: 'Show Rationale',\n visible: 'Hide Rationale',\n }}\n >\n <PreviewPrompt prompt={rationale} />\n </Collapsible>\n )}\n\n {feedback && <Feedback correctness={correctness.correctness} feedback={feedback} />}\n </div>\n }\n >\n <div className={classes.mainContainer} ref={(r) => (this.root = r || this.root)}>\n {midContent}\n </div>\n </Tooltip>\n );\n }\n\n return (\n <div className={classes.mainContainer} ref={(r) => (this.root = r || this.root)}>\n {midContent}\n </div>\n );\n }\n}\n\nconst styles = (theme) => ({\n mainContainer: {\n color: color.text(),\n backgroundColor: color.background(),\n display: 'inline-block',\n },\n tooltip: {\n background: `${color.primaryLight()} !important`,\n color: color.text(),\n padding: theme.spacing.unit * 2,\n border: `1px solid ${color.secondary()}`,\n fontSize: '16px',\n '& :not(.MathJax) > table tr': {\n '&:nth-child(2n)': {\n backgroundColor: 'unset !important',\n },\n },\n },\n tooltipPopper: {\n opacity: 1,\n },\n keypadTooltip: {\n fontSize: 'initial',\n background: 'transparent',\n width: '600px',\n marginTop: 0,\n paddingTop: 0,\n },\n keypadTooltipPopper: {\n background: 'transparent',\n width: '650px',\n opacity: 1,\n },\n promptContainer: {\n marginBottom: theme.spacing.unit * 2,\n },\n main: {\n width: '100%',\n position: 'relative',\n backgroundColor: color.background(),\n color: color.text(),\n },\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit,\n },\n note: {\n paddingBottom: theme.spacing.unit * 2,\n },\n collapsible: {\n marginBottom: theme.spacing.unit * 2,\n },\n responseContainer: {\n zIndex: 10,\n // position: 'absolute',\n // right: 0,\n minWidth: '400px',\n marginTop: theme.spacing.unit * 2,\n },\n expression: {\n maxWidth: 'fit-content',\n '& > .mq-math-mode': {\n '& > .mq-root-block': {\n '& > .mq-editable-field': {\n minWidth: '10px',\n margin: (theme.spacing.unit * 2) / 3,\n padding: theme.spacing.unit / 4,\n },\n },\n '& sup': {\n top: 0,\n },\n },\n },\n static: {\n '& > .mq-root-block': {\n '& > .mq-editable-field': {\n borderColor: color.text(),\n },\n },\n },\n inputAndKeypadContainer: {\n position: 'relative',\n '& .mq-overarrow-inner': {\n border: 'none !important',\n padding: '0 !important',\n },\n '& .mq-overarrow-inner-right': {\n display: 'none !important',\n },\n '& .mq-overarrow-inner-left': {\n display: 'none !important',\n },\n '& .mq-overarrow.mq-arrow-both': {\n minWidth: '1.23em',\n '& *': {\n lineHeight: '1 !important',\n },\n '&:before': {\n top: '-0.4em',\n left: '-1px',\n },\n '&:after': {\n top: '-2.4em',\n right: '-1px',\n },\n '&.mq-empty:after': {\n top: '-0.45em',\n },\n },\n '& .mq-overarrow.mq-arrow-right': {\n '&:before': {\n top: '-0.4em',\n right: '-1px',\n },\n },\n '& .mq-longdiv-inner': {\n borderTop: '1px solid !important',\n paddingTop: '1.5px !important',\n },\n '& .mq-parallelogram': {\n lineHeight: 0.85,\n },\n },\n showCorrectness: {\n border: '2px solid',\n },\n correctAnswerShown: {\n padding: theme.spacing.unit,\n letterSpacing: '0.5px',\n },\n printCorrect: {\n border: `2px solid ${color.correct()} !important`,\n },\n correct: {\n borderColor: `${color.correct()} !important`,\n },\n incorrect: {\n borderColor: `${color.incorrect()} !important`,\n },\n blockContainer: {\n margin: `${theme.spacing.unit}px !important`,\n display: 'inline-flex',\n border: '2px solid grey !important',\n },\n blockResponse: {\n flex: 2,\n color: 'grey',\n background: theme.palette.grey['A100'],\n fontSize: '0.8rem !important',\n padding: `${theme.spacing.unit / 2}px !important`,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRight: `2px solid ${color.disabled()} !important`,\n },\n toggle: {\n color: color.text(),\n marginBottom: theme.spacing.unit * 2,\n },\n blockMath: {\n color: color.text(),\n backgroundColor: color.background(),\n padding: `${theme.spacing.unit / 2}px !important`,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flex: 8,\n '& > .mq-math-mode': {\n '& > .mq-hasCursor': {\n '& > .mq-cursor': {\n display: 'none',\n },\n },\n },\n },\n printContainer: {\n marginBottom: theme.spacing.unit,\n pointerEvents: 'none',\n },\n srOnly: {\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n },\n});\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
package/lib/print.js CHANGED
@@ -31,7 +31,7 @@ var _debounce = _interopRequireDefault(require("lodash/debounce"));
31
31
 
32
32
  var _main = _interopRequireDefault(require("./main"));
33
33
 
34
- var _mathRenderingAccessible = require("@pie-lib/pie-toolbox/math-rendering-accessible");
34
+ var _mathRendering = require("@pie-lib/pie-toolbox/math-rendering");
35
35
 
36
36
  var _debug = _interopRequireDefault(require("debug"));
37
37
 
@@ -98,7 +98,7 @@ var MathInlinePrint = /*#__PURE__*/function (_HTMLElement) {
98
98
 
99
99
  _reactDom["default"].render(element, (0, _assertThisInitialized2["default"])(_this), function () {
100
100
  log('render complete - render math');
101
- (0, _mathRenderingAccessible.renderMath)((0, _assertThisInitialized2["default"])(_this));
101
+ (0, _mathRendering.renderMath)((0, _assertThisInitialized2["default"])(_this));
102
102
  });
103
103
  } else {
104
104
  log('skip');
package/lib/print.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/print.js"],"names":["log","preparePrintModel","model","opts","instr","role","prompt","promptEnabled","undefined","teacherInstructions","teacherInstructionsEnabled","rationale","rationaleEnabled","showTeacherInstructions","alwaysShowCorrect","printMode","feedback","expression","animationsDisabled","disabled","config","env","mode","MathInlinePrint","_options","_model","_session","_rerender","printModel","element","React","createElement","Main","session","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EAAEF,IAAI,CAACE;AAApD;AAFD;AAHR;AAQD,CAtBD;;IAwBqBkB,e;;;;;AACnB,6BAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,QAAL,GAAgB,IAAhB;AACA,UAAKC,MAAL,GAAc,IAAd;AACA,UAAKC,QAAL,GAAgB,EAAhB;AACA,UAAKC,SAAL,GAAiB,0BACf,YAAM;AACJ,UAAI,MAAKF,MAAL,IAAe,MAAKC,QAAxB,EAAkC;AAChC,YAAME,UAAU,GAAG3B,iBAAiB,CAAC,MAAKwB,MAAN,EAAc,MAAKD,QAAnB,CAApC;;AAEA,YAAMK,OAAO,GACX,MAAKL,QAAL,iBACAM,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACxB9B,UAAAA,KAAK,EAAE0B,UADiB;AAExBK,UAAAA,OAAO,EAAE;AAFe,SAA1B,CAFF;;AAOAC,6BAASC,MAAT,CAAgBN,OAAhB,kDAA+B,YAAM;AACnC7B,UAAAA,GAAG,CAAC,+BAAD,CAAH;AACA;AACD,SAHD;AAID,OAdD,MAcO;AACLA,QAAAA,GAAG,CAAC,MAAD,CAAH;AACD;AACF,KAnBc,EAoBf,EApBe,EAqBf;AAAEoC,MAAAA,OAAO,EAAE,KAAX;AAAkBC,MAAAA,QAAQ,EAAE;AAA5B,KArBe,CAAjB;AALY;AA4Bb;;;;SACD,aAAYC,CAAZ,EAAe;AACb,WAAKd,QAAL,GAAgBc,CAAhB;AACD;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKd,MAAL,GAAcc,CAAd;;AACA,WAAKZ,SAAL;AACD;;;WAED,6BAAoB,CAAE;;;kDAvCqBa,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport debounce from 'lodash/debounce';\nimport Main from './main';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering-accessible';\nimport debug from 'debug';\n\nconst log = debug('pie-element:math-inline:print');\n\n/**\n * Live in same package as main element - so we can access some of the shared comps!\n *\n * - update pslb to build print if src/print.js is there\n * - update demo el\n * - get configure/controller building\n */\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions =\n instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.rationale = instr && model.rationaleEnabled !== false ? model.rationale : undefined;\n model.showTeacherInstructions = instr;\n model.alwaysShowCorrect = instr;\n model.printMode = true;\n model.feedback = undefined;\n model.expression = model.expression || '{{response}}';\n\n model.animationsDisabled = true;\n return {\n ...model,\n disabled: true,\n config: {\n ...model,\n env: { mode: instr ? 'evaluate' : model.mode, role: opts.role },\n },\n };\n};\n\nexport default class MathInlinePrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element =\n this._options &&\n React.createElement(Main, {\n model: printModel,\n session: {},\n });\n\n ReactDOM.render(element, this, () => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n}\n"],"file":"print.js"}
1
+ {"version":3,"sources":["../src/print.js"],"names":["log","preparePrintModel","model","opts","instr","role","prompt","promptEnabled","undefined","teacherInstructions","teacherInstructionsEnabled","rationale","rationaleEnabled","showTeacherInstructions","alwaysShowCorrect","printMode","feedback","expression","animationsDisabled","disabled","config","env","mode","MathInlinePrint","_options","_model","_session","_rerender","printModel","element","React","createElement","Main","session","ReactDOM","render","leading","trailing","o","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,+BAAN,CAAZ;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AA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,UAAKC,SAAL,GAAiB,0BACf,YAAM;AACJ,UAAI,MAAKF,MAAL,IAAe,MAAKC,QAAxB,EAAkC;AAChC,YAAME,UAAU,GAAG3B,iBAAiB,CAAC,MAAKwB,MAAN,EAAc,MAAKD,QAAnB,CAApC;;AAEA,YAAMK,OAAO,GACX,MAAKL,QAAL,iBACAM,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACxB9B,UAAAA,KAAK,EAAE0B,UADiB;AAExBK,UAAAA,OAAO,EAAE;AAFe,SAA1B,CAFF;;AAOAC,6BAASC,MAAT,CAAgBN,OAAhB,kDAA+B,YAAM;AACnC7B,UAAAA,GAAG,CAAC,+BAAD,CAAH;AACA;AACD,SAHD;AAID,OAdD,MAcO;AACLA,QAAAA,GAAG,CAAC,MAAD,CAAH;AACD;AACF,KAnBc,EAoBf,EApBe,EAqBf;AAAEoC,MAAAA,OAAO,EAAE,KAAX;AAAkBC,MAAAA,QAAQ,EAAE;AAA5B,KArBe,CAAjB;AALY;AA4Bb;;;;SACD,aAAYC,CAAZ,EAAe;AACb,WAAKd,QAAL,GAAgBc,CAAhB;AACD;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKd,MAAL,GAAcc,CAAd;;AACA,WAAKZ,SAAL;AACD;;;WAED,6BAAoB,CAAE;;;kDAvCqBa,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport debounce from 'lodash/debounce';\nimport Main from './main';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering';\nimport debug from 'debug';\n\nconst log = debug('pie-element:math-inline:print');\n\n/**\n * Live in same package as main element - so we can access some of the shared comps!\n *\n * - update pslb to build print if src/print.js is there\n * - update demo el\n * - get configure/controller building\n */\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions =\n instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.rationale = instr && model.rationaleEnabled !== false ? model.rationale : undefined;\n model.showTeacherInstructions = instr;\n model.alwaysShowCorrect = instr;\n model.printMode = true;\n model.feedback = undefined;\n model.expression = model.expression || '{{response}}';\n\n model.animationsDisabled = true;\n return {\n ...model,\n disabled: true,\n config: {\n ...model,\n env: { mode: instr ? 'evaluate' : model.mode, role: opts.role },\n },\n };\n};\n\nexport default class MathInlinePrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element =\n this._options &&\n React.createElement(Main, {\n model: printModel,\n session: {},\n });\n\n ReactDOM.render(element, this, () => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n}\n"],"file":"print.js"}
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_pie_framework__mathquill, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.2.0/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_pie_framework__mathquill, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.4.0/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_editable_html} from "../../../@pie-lib/pie-toolbox-module@4.0.0/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
@@ -13522,11 +13522,10 @@ const generateValidationMessage = (model = {}, config = {}) => {
13522
13522
  }
13523
13523
  return 'Validation requirements:' + answersMessage + responseAreasMessage;
13524
13524
  };
13525
- const getPluginProps = (props = {}, baseInputConfiguration = {}) => {
13526
- return Object.assign({
13527
- ...baseInputConfiguration
13528
- }, props || ({}));
13529
- };
13525
+ const getPluginProps = (props = {}, baseInputConfiguration = {}) => ({
13526
+ ...baseInputConfiguration,
13527
+ ...props
13528
+ });
13530
13529
  var Info = {};
13531
13530
  var createSvgIcon$1 = {};
13532
13531
  const require$$1$1 = _dll_react;
package/module/element.js CHANGED
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_lodash, _dll_pie_framework__mathquill, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.2.0/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_pie_lib__pie_toolbox_math_rendering, _dll_lodash, _dll_pie_framework__mathquill, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.4.0/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@4.0.0/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
@@ -11512,7 +11512,7 @@ getDefaultExportFromCjs(translator$1);
11512
11512
  var Translator = getDefaultExportFromCjs(translator$2);
11513
11513
  const React$1 = _dll_react;
11514
11514
  const PropTypes = _dll_prop_types;
11515
- const {renderMath: renderMath} = _dll_pie_lib__pie_toolbox_math_rendering_accessible;
11515
+ const {renderMath: renderMath} = _dll_pie_lib__pie_toolbox_math_rendering;
11516
11516
  const {isEqual: isEqual} = _dll_lodash;
11517
11517
  const {isEmpty: isEmpty} = _dll_lodash;
11518
11518
  const cx = _dll_classnames;
@@ -11971,7 +11971,7 @@ class Main extends React$1.Component {
11971
11971
  lineNumber: 472
11972
11972
  }
11973
11973
  })), prompt && React$1.createElement('div', {
11974
- className: classes.content,
11974
+ className: classes.promptContainer,
11975
11975
  __self: this,
11976
11976
  __source: {
11977
11977
  fileName: _jsxFileName,
@@ -12271,6 +12271,9 @@ const styles = theme => ({
12271
12271
  width: '650px',
12272
12272
  opacity: 1
12273
12273
  },
12274
+ promptContainer: {
12275
+ marginBottom: theme.spacing.unit * 2
12276
+ },
12274
12277
  main: {
12275
12278
  width: '100%',
12276
12279
  position: 'relative',
@@ -12317,8 +12320,6 @@ const styles = theme => ({
12317
12320
  }
12318
12321
  },
12319
12322
  inputAndKeypadContainer: {
12320
- marginTop: theme.spacing.unit * 2,
12321
- marginBottom: theme.spacing.unit * 2,
12322
12323
  position: 'relative',
12323
12324
  '& .mq-overarrow-inner': {
12324
12325
  border: 'none !important',
@@ -12514,7 +12515,7 @@ utils.generateValidationMessage = generateValidationMessage;
12514
12515
  var getPluginProps = function getPluginProps() {
12515
12516
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12516
12517
  var baseInputConfiguration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12517
- return Object.assign(_objectSpread({}, baseInputConfiguration), props || ({}));
12518
+ return _objectSpread(_objectSpread({}, baseInputConfiguration), props);
12518
12519
  };
12519
12520
  utils.getPluginProps = getPluginProps;
12520
12521
  (function (exports) {
@@ -4,7 +4,7 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "1.2.0"
7
+ "version": "1.4.0"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
package/module/print.js CHANGED
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_lodash, _dll_pie_framework__mathquill, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.2.0/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_pie_lib__pie_toolbox_math_rendering, _dll_lodash, _dll_pie_framework__mathquill, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.4.0/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@4.0.0/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
@@ -11512,7 +11512,7 @@ getDefaultExportFromCjs(translator$1);
11512
11512
  var Translator = getDefaultExportFromCjs(translator$2);
11513
11513
  const React$1 = _dll_react;
11514
11514
  const PropTypes = _dll_prop_types;
11515
- const {renderMath: renderMath$1} = _dll_pie_lib__pie_toolbox_math_rendering_accessible;
11515
+ const {renderMath: renderMath$1} = _dll_pie_lib__pie_toolbox_math_rendering;
11516
11516
  const {isEqual: isEqual} = _dll_lodash;
11517
11517
  const {isEmpty: isEmpty} = _dll_lodash;
11518
11518
  const cx = _dll_classnames;
@@ -11971,7 +11971,7 @@ class Main extends React$1.Component {
11971
11971
  lineNumber: 472
11972
11972
  }
11973
11973
  })), prompt && React$1.createElement('div', {
11974
- className: classes.content,
11974
+ className: classes.promptContainer,
11975
11975
  __self: this,
11976
11976
  __source: {
11977
11977
  fileName: _jsxFileName,
@@ -12271,6 +12271,9 @@ const styles = theme => ({
12271
12271
  width: '650px',
12272
12272
  opacity: 1
12273
12273
  },
12274
+ promptContainer: {
12275
+ marginBottom: theme.spacing.unit * 2
12276
+ },
12274
12277
  main: {
12275
12278
  width: '100%',
12276
12279
  position: 'relative',
@@ -12317,8 +12320,6 @@ const styles = theme => ({
12317
12320
  }
12318
12321
  },
12319
12322
  inputAndKeypadContainer: {
12320
- marginTop: theme.spacing.unit * 2,
12321
- marginBottom: theme.spacing.unit * 2,
12322
12323
  position: 'relative',
12323
12324
  '& .mq-overarrow-inner': {
12324
12325
  border: 'none !important',
@@ -12430,7 +12431,7 @@ var Main$1 = styles$3.withStyles(styles)(Main);
12430
12431
  const React = _dll_react;
12431
12432
  const ReactDOM = _dll_react_dom;
12432
12433
  const {debounce: debounce} = _dll_lodash;
12433
- const {renderMath: renderMath} = _dll_pie_lib__pie_toolbox_math_rendering_accessible;
12434
+ const {renderMath: renderMath} = _dll_pie_lib__pie_toolbox_math_rendering;
12434
12435
  const debug = _dll_debug;
12435
12436
  const log = debug('pie-element:math-inline:print');
12436
12437
  const preparePrintModel = (model, opts) => {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "7.8.1-next.9+c3f6156ab",
7
+ "version": "7.9.0",
8
8
  "main": "lib/index.js",
9
9
  "description": "",
10
10
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "@material-ui/core": "^3.9.2",
15
15
  "@pie-framework/mathquill": "^1.1.3",
16
16
  "@pie-framework/pie-player-events": "^0.1.0",
17
- "@pie-lib/pie-toolbox": "1.10.0",
17
+ "@pie-lib/pie-toolbox": "1.11.1",
18
18
  "classnames": "^2.2.5",
19
19
  "debug": "^4.1.1",
20
20
  "lodash": "^4.17.10",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "author": "",
26
26
  "license": "ISC",
27
- "gitHead": "c3f6156abbc3d45042d5b8ebeb96372055360ed8",
27
+ "gitHead": "229e10aa53659f55129b8a4e27dbfc76939e214b",
28
28
  "module": "src/index.js",
29
29
  "exports": {
30
30
  ".": "./src/index.js",