@pie-element/categorize 8.9.1-next.9 → 8.10.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,27 @@
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
+ # [8.10.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize@8.9.0...@pie-element/categorize@8.10.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
+
14
+
15
+ ### Features
16
+
17
+ * Add configuration for custom buttons PD-3520 ([a7a7ace](https://github.com/pie-framework/pie-elements/commit/a7a7ace27eaac47c9a0f172f7ae0440c6dc4e600))
18
+ * Add configuration for custom buttons PD-3527 ([45a32bd](https://github.com/pie-framework/pie-elements/commit/45a32bd8e9d7bd33beca74cc10c7dd973a9f9dbc))
19
+ * Replace math-rendering package with math-rendering-accessible-package for accessibility PD-1870 ([b6cdee8](https://github.com/pie-framework/pie-elements/commit/b6cdee8915b06e4c11b002b10437db07ce966501))
20
+ * updated pie-lib/pie-toolbox SC-27890 and reverted once again math-rendering-accessible ([fd312e1](https://github.com/pie-framework/pie-elements/commit/fd312e1336999893025231946649496d290883e4))
21
+ * use math-rendering-accessible everywhere PD-1870 ([d52e660](https://github.com/pie-framework/pie-elements/commit/d52e6607ad8847d704bd9cb9b7e3107c130f0500))
22
+
23
+
24
+
25
+
26
+
6
27
  # [8.9.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize@8.8.1...@pie-element/categorize@8.9.0) (2024-03-15)
7
28
 
8
29
 
@@ -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.10.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@7.9.0...@pie-element/categorize-configure@7.10.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.9.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@7.8.1...@pie-element/categorize-configure@7.9.0) (2024-03-15)
7
25
 
8
26
 
@@ -16,7 +16,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
16
16
  var getPluginProps = function getPluginProps() {
17
17
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18
18
  var baseInputConfiguration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
19
- return Object.assign(_objectSpread({}, baseInputConfiguration), props || {});
19
+ return _objectSpread(_objectSpread({}, baseInputConfiguration), props);
20
20
  };
21
21
 
22
22
  exports.getPluginProps = getPluginProps;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/design/utils.js"],"names":["getPluginProps","props","baseInputConfiguration","Object","assign"],"mappings":";;;;;;;;;;;;;;;AAAO,IAAMA,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 getPluginProps = (props = {}, baseInputConfiguration = {}) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n};\n"],"file":"utils.js"}
1
+ {"version":3,"sources":["../../src/design/utils.js"],"names":["getPluginProps","props","baseInputConfiguration"],"mappings":";;;;;;;;;;;;;;;AAAO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB;AAAA,MAACC,KAAD,uEAAS,EAAT;AAAA,MAAaC,sBAAb,uEAAsC,EAAtC;AAAA,yCACzBA,sBADyB,GAEzBD,KAFyB;AAAA,CAAvB","sourcesContent":["export const getPluginProps = (props = {}, baseInputConfiguration = {}) => ({\n ...baseInputConfiguration,\n ...props,\n});\n"],"file":"utils.js"}
@@ -3,7 +3,7 @@
3
3
  "private": true,
4
4
  "main": "lib/index.js",
5
5
  "module": "src/index.js",
6
- "version": "7.9.0",
6
+ "version": "7.10.0",
7
7
  "description": "",
8
8
  "scripts": {},
9
9
  "author": "pie framework developers",
@@ -12,7 +12,7 @@
12
12
  "@material-ui/core": "^3.9.2",
13
13
  "@material-ui/icons": "^3.0.1",
14
14
  "@pie-framework/pie-configure-events": "^1.3.0",
15
- "@pie-lib/pie-toolbox": "1.10.0",
15
+ "@pie-lib/pie-toolbox": "1.11.1",
16
16
  "classnames": "^2.2.5",
17
17
  "debug": "^3.1.0",
18
18
  "lodash": "^4.17.15",
@@ -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.7.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-controller@6.6.0...@pie-element/categorize-controller@6.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
+ * 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.6.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-controller@6.5.1...@pie-element/categorize-controller@6.6.0) (2024-03-15)
7
24
 
8
25
 
@@ -2,10 +2,10 @@
2
2
  "name": "@pie-element/categorize-controller",
3
3
  "private": true,
4
4
  "dependencies": {
5
- "@pie-lib/pie-toolbox": "1.10.0",
5
+ "@pie-lib/pie-toolbox": "1.11.1",
6
6
  "lodash": "^4.17.15"
7
7
  },
8
- "version": "6.6.0",
8
+ "version": "6.7.0",
9
9
  "description": "",
10
10
  "scripts": {},
11
11
  "main": "lib/index.js",
@@ -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",
@@ -66,6 +77,17 @@
66
77
  "title": "EditableHtmlConfigureProp",
67
78
  "type": "object",
68
79
  "properties": {
80
+ "math": {
81
+ "title": "EditableHtmlButtonConfigure",
82
+ "type": "object",
83
+ "properties": {
84
+ "disabled": {
85
+ "description": "Indicates if the plugin is disabled or not",
86
+ "type": "boolean",
87
+ "title": "disabled"
88
+ }
89
+ }
90
+ },
69
91
  "audio": {
70
92
  "title": "EditableHtmlButtonConfigure",
71
93
  "type": "object",
@@ -179,6 +201,17 @@
179
201
  "title": "EditableHtmlConfigureProp",
180
202
  "type": "object",
181
203
  "properties": {
204
+ "math": {
205
+ "title": "EditableHtmlButtonConfigure",
206
+ "type": "object",
207
+ "properties": {
208
+ "disabled": {
209
+ "description": "Indicates if the plugin is disabled or not",
210
+ "type": "boolean",
211
+ "title": "disabled"
212
+ }
213
+ }
214
+ },
182
215
  "audio": {
183
216
  "title": "EditableHtmlButtonConfigure",
184
217
  "type": "object",
@@ -239,6 +272,17 @@
239
272
  "title": "EditableHtmlConfigureProp",
240
273
  "type": "object",
241
274
  "properties": {
275
+ "math": {
276
+ "title": "EditableHtmlButtonConfigure",
277
+ "type": "object",
278
+ "properties": {
279
+ "disabled": {
280
+ "description": "Indicates if the plugin is disabled or not",
281
+ "type": "boolean",
282
+ "title": "disabled"
283
+ }
284
+ }
285
+ },
242
286
  "audio": {
243
287
  "title": "EditableHtmlButtonConfigure",
244
288
  "type": "object",
@@ -299,6 +343,17 @@
299
343
  "title": "EditableHtmlConfigureProp",
300
344
  "type": "object",
301
345
  "properties": {
346
+ "math": {
347
+ "title": "EditableHtmlButtonConfigure",
348
+ "type": "object",
349
+ "properties": {
350
+ "disabled": {
351
+ "description": "Indicates if the plugin is disabled or not",
352
+ "type": "boolean",
353
+ "title": "disabled"
354
+ }
355
+ }
356
+ },
302
357
  "audio": {
303
358
  "title": "EditableHtmlButtonConfigure",
304
359
  "type": "object",
@@ -354,6 +409,17 @@
354
409
  "title": "EditableHtmlConfigureProp",
355
410
  "type": "object",
356
411
  "properties": {
412
+ "math": {
413
+ "title": "EditableHtmlButtonConfigure",
414
+ "type": "object",
415
+ "properties": {
416
+ "disabled": {
417
+ "description": "Indicates if the plugin is disabled or not",
418
+ "type": "boolean",
419
+ "title": "disabled"
420
+ }
421
+ }
422
+ },
357
423
  "audio": {
358
424
  "title": "EditableHtmlButtonConfigure",
359
425
  "type": "object",
@@ -657,6 +723,17 @@
657
723
  "title": "EditableHtmlConfigureProp",
658
724
  "type": "object",
659
725
  "properties": {
726
+ "math": {
727
+ "title": "EditableHtmlButtonConfigure",
728
+ "type": "object",
729
+ "properties": {
730
+ "disabled": {
731
+ "description": "Indicates if the plugin is disabled or not",
732
+ "type": "boolean",
733
+ "title": "disabled"
734
+ }
735
+ }
736
+ },
660
737
  "audio": {
661
738
  "title": "EditableHtmlButtonConfigure",
662
739
  "type": "object",
@@ -727,6 +804,17 @@
727
804
  "title": "EditableHtmlConfigureProp",
728
805
  "type": "object",
729
806
  "properties": {
807
+ "math": {
808
+ "title": "EditableHtmlButtonConfigure",
809
+ "type": "object",
810
+ "properties": {
811
+ "disabled": {
812
+ "description": "Indicates if the plugin is disabled or not",
813
+ "type": "boolean",
814
+ "title": "disabled"
815
+ }
816
+ }
817
+ },
730
818
  "audio": {
731
819
  "title": "EditableHtmlButtonConfigure",
732
820
  "type": "object",
@@ -787,6 +875,17 @@
787
875
  "title": "EditableHtmlConfigureProp",
788
876
  "type": "object",
789
877
  "properties": {
878
+ "math": {
879
+ "title": "EditableHtmlButtonConfigure",
880
+ "type": "object",
881
+ "properties": {
882
+ "disabled": {
883
+ "description": "Indicates if the plugin is disabled or not",
884
+ "type": "boolean",
885
+ "title": "disabled"
886
+ }
887
+ }
888
+ },
790
889
  "audio": {
791
890
  "title": "EditableHtmlButtonConfigure",
792
891
  "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:
@@ -50,6 +58,14 @@ Properties of the `rationale` object:
50
58
 
51
59
  Properties of the `inputConfiguration` object:
52
60
 
61
+ ### `math` (object)
62
+
63
+ Properties of the `math` object:
64
+
65
+ #### `disabled` (boolean)
66
+
67
+ Indicates if the plugin is disabled or not
68
+
53
69
  ### `audio` (object)
54
70
 
55
71
  Properties of the `audio` object:
@@ -134,6 +150,14 @@ Properties of the `teacherInstructions` object:
134
150
 
135
151
  Properties of the `inputConfiguration` object:
136
152
 
153
+ ### `math` (object)
154
+
155
+ Properties of the `math` object:
156
+
157
+ #### `disabled` (boolean)
158
+
159
+ Indicates if the plugin is disabled or not
160
+
137
161
  ### `audio` (object)
138
162
 
139
163
  Properties of the `audio` object:
@@ -178,6 +202,14 @@ Properties of the `prompt` object:
178
202
 
179
203
  Properties of the `inputConfiguration` object:
180
204
 
205
+ ### `math` (object)
206
+
207
+ Properties of the `math` object:
208
+
209
+ #### `disabled` (boolean)
210
+
211
+ Indicates if the plugin is disabled or not
212
+
181
213
  ### `audio` (object)
182
214
 
183
215
  Properties of the `audio` object:
@@ -222,6 +254,14 @@ Properties of the `headers` object:
222
254
 
223
255
  Properties of the `inputConfiguration` object:
224
256
 
257
+ ### `math` (object)
258
+
259
+ Properties of the `math` object:
260
+
261
+ #### `disabled` (boolean)
262
+
263
+ Indicates if the plugin is disabled or not
264
+
225
265
  ### `audio` (object)
226
266
 
227
267
  Properties of the `audio` object:
@@ -262,6 +302,14 @@ Properties of the `rowLabels` object:
262
302
 
263
303
  Properties of the `inputConfiguration` object:
264
304
 
305
+ ### `math` (object)
306
+
307
+ Properties of the `math` object:
308
+
309
+ #### `disabled` (boolean)
310
+
311
+ Indicates if the plugin is disabled or not
312
+
265
313
  ### `audio` (object)
266
314
 
267
315
  Properties of the `audio` object:
@@ -492,6 +540,14 @@ The schema defines the following additional types:
492
540
 
493
541
  Properties of the `EditableHtmlConfigureProp` object:
494
542
 
543
+ ### `math` (object)
544
+
545
+ Properties of the `math` object:
546
+
547
+ #### `disabled` (boolean)
548
+
549
+ Indicates if the plugin is disabled or not
550
+
495
551
  ### `audio` (object)
496
552
 
497
553
  Properties of the `audio` object:
@@ -544,6 +600,14 @@ Properties of the `EditableHtmlPluginConfigureRequired` object:
544
600
 
545
601
  Properties of the `inputConfiguration` object:
546
602
 
603
+ #### `math` (object)
604
+
605
+ Properties of the `math` object:
606
+
607
+ ##### `disabled` (boolean)
608
+
609
+ Indicates if the plugin is disabled or not
610
+
547
611
  #### `audio` (object)
548
612
 
549
613
  Properties of the `audio` object:
@@ -588,6 +652,14 @@ Properties of the `EditableHtmlPluginConfigure` object:
588
652
 
589
653
  Properties of the `inputConfiguration` object:
590
654
 
655
+ #### `math` (object)
656
+
657
+ Properties of the `math` object:
658
+
659
+ ##### `disabled` (boolean)
660
+
661
+ Indicates if the plugin is disabled or not
662
+
591
663
  #### `audio` (object)
592
664
 
593
665
  Properties of the `audio` object:
@@ -449,6 +449,17 @@
449
449
  "title": "EditableHtmlConfigureProp",
450
450
  "type": "object",
451
451
  "properties": {
452
+ "math": {
453
+ "title": "EditableHtmlButtonConfigure",
454
+ "type": "object",
455
+ "properties": {
456
+ "disabled": {
457
+ "description": "Indicates if the plugin is disabled or not",
458
+ "type": "boolean",
459
+ "title": "disabled"
460
+ }
461
+ }
462
+ },
452
463
  "audio": {
453
464
  "title": "EditableHtmlButtonConfigure",
454
465
  "type": "object",
@@ -519,6 +530,17 @@
519
530
  "title": "EditableHtmlConfigureProp",
520
531
  "type": "object",
521
532
  "properties": {
533
+ "math": {
534
+ "title": "EditableHtmlButtonConfigure",
535
+ "type": "object",
536
+ "properties": {
537
+ "disabled": {
538
+ "description": "Indicates if the plugin is disabled or not",
539
+ "type": "boolean",
540
+ "title": "disabled"
541
+ }
542
+ }
543
+ },
522
544
  "audio": {
523
545
  "title": "EditableHtmlButtonConfigure",
524
546
  "type": "object",
@@ -579,6 +601,17 @@
579
601
  "title": "EditableHtmlConfigureProp",
580
602
  "type": "object",
581
603
  "properties": {
604
+ "math": {
605
+ "title": "EditableHtmlButtonConfigure",
606
+ "type": "object",
607
+ "properties": {
608
+ "disabled": {
609
+ "description": "Indicates if the plugin is disabled or not",
610
+ "type": "boolean",
611
+ "title": "disabled"
612
+ }
613
+ }
614
+ },
582
615
  "audio": {
583
616
  "title": "EditableHtmlButtonConfigure",
584
617
  "type": "object",
@@ -207,6 +207,14 @@ The schema defines the following additional types:
207
207
 
208
208
  Properties of the `EditableHtmlConfigureProp` object:
209
209
 
210
+ ### `math` (object)
211
+
212
+ Properties of the `math` object:
213
+
214
+ #### `disabled` (boolean)
215
+
216
+ Indicates if the plugin is disabled or not
217
+
210
218
  ### `audio` (object)
211
219
 
212
220
  Properties of the `audio` object:
@@ -259,6 +267,14 @@ Properties of the `EditableHtmlPluginConfigureRequired` object:
259
267
 
260
268
  Properties of the `inputConfiguration` object:
261
269
 
270
+ #### `math` (object)
271
+
272
+ Properties of the `math` object:
273
+
274
+ ##### `disabled` (boolean)
275
+
276
+ Indicates if the plugin is disabled or not
277
+
262
278
  #### `audio` (object)
263
279
 
264
280
  Properties of the `audio` object:
@@ -303,6 +319,14 @@ Properties of the `EditableHtmlPluginConfigure` object:
303
319
 
304
320
  Properties of the `inputConfiguration` object:
305
321
 
322
+ #### `math` (object)
323
+
324
+ Properties of the `math` object:
325
+
326
+ ##### `disabled` (boolean)
327
+
328
+ Indicates if the plugin is disabled or not
329
+
306
330
  #### `audio` (object)
307
331
 
308
332
  Properties of the `audio` object:
package/lib/index.js CHANGED
@@ -23,7 +23,7 @@ var _react = _interopRequireDefault(require("react"));
23
23
 
24
24
  var _reactDom = _interopRequireDefault(require("react-dom"));
25
25
 
26
- var _mathRenderingAccessible = require("@pie-lib/pie-toolbox/math-rendering-accessible");
26
+ var _mathRendering = require("@pie-lib/pie-toolbox/math-rendering");
27
27
 
28
28
  var _piePlayerEvents = require("@pie-framework/pie-player-events");
29
29
 
@@ -109,7 +109,7 @@ var Categorize = /*#__PURE__*/function (_HTMLElement) {
109
109
  }, {
110
110
  key: "onShowCorrectToggle",
111
111
  value: function onShowCorrectToggle() {
112
- (0, _mathRenderingAccessible.renderMath)(this);
112
+ (0, _mathRendering.renderMath)(this);
113
113
  }
114
114
  }, {
115
115
  key: "render",
@@ -125,7 +125,7 @@ var Categorize = /*#__PURE__*/function (_HTMLElement) {
125
125
  });
126
126
 
127
127
  _reactDom["default"].render(el, this, function () {
128
- (0, _mathRenderingAccessible.renderMath)(_this);
128
+ (0, _mathRendering.renderMath)(_this);
129
129
  });
130
130
  }
131
131
  }
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["Categorize","m","_model","eliminateBlindAnswersFromSession","dispatchEvent","ModelSetEvent","tagName","toLowerCase","isComplete","render","_session","Array","isArray","answers","length","s","choices","mappedChoices","map","c","id","filteredAnswers","answer","answerChoices","filter","includes","changeAnswers","SessionChangedEvent","el","React","createElement","CategorizeComponent","model","session","onAnswersChange","bind","onShowCorrectToggle","ReactDOM","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEqBA,U;;;;;;;;;;;;SACnB,aAAUC,CAAV,EAAa;AACX,WAAKC,MAAL,GAAcD,CAAd;AAEA,WAAKE,gCAAL;AACA,WAAKC,aAAL,CAAmB,IAAIC,8BAAJ,CAAkB,KAAKC,OAAL,CAAaC,WAAb,EAAlB,EAA8C,KAAKC,UAAL,EAA9C,EAAiE,CAAC,CAAC,KAAKN,MAAxE,CAAnB;AACA,WAAKO,MAAL;AACD;;;WAED,sBAAa;AACX,UAAI,CAAC,KAAKC,QAAV,EAAoB;AAClB,eAAO,KAAP;AACD;;AAED,aAAOC,KAAK,CAACC,OAAN,CAAc,KAAKF,QAAL,CAAcG,OAA5B,KAAwC,KAAKH,QAAL,CAAcG,OAAd,CAAsBC,MAAtB,GAA+B,CAA9E;AACD;;;SAWD,eAAc;AACZ,aAAO,KAAKJ,QAAZ;AACD,K;SAXD,aAAYK,CAAZ,EAAe;AACb,UAAIA,CAAC,IAAI,CAACA,CAAC,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,IAAe,KAAKQ,QAAxB,EAAkC;AAChC,YAAMkB,EAAE,gBAAGC,kBAAMC,aAAN,CAAoBC,sBAApB,EAAyC;AAClDC,UAAAA,KAAK,EAAE,KAAK9B,MADsC;AAElD+B,UAAAA,OAAO,EAAE,KAAKvB,QAFoC;AAGlDwB,UAAAA,eAAe,EAAE,KAAKR,aAAL,CAAmBS,IAAnB,CAAwB,IAAxB,CAHiC;AAIlDC,UAAAA,mBAAmB,EAAE,KAAKA,mBAAL,CAAyBD,IAAzB,CAA8B,IAA9B;AAJ6B,SAAzC,CAAX;;AAOAE,6BAAS5B,MAAT,CAAgBmB,EAAhB,EAAoB,IAApB,EAA0B,YAAM;AAC9B,mDAAW,KAAX;AACD,SAFD;AAGD;AACF;;;kDArEqCU,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering-accessible';\nimport { SessionChangedEvent, ModelSetEvent } from '@pie-framework/pie-player-events';\nimport CategorizeComponent from './categorize';\n\nexport default class Categorize extends HTMLElement {\n set model(m) {\n this._model = m;\n\n this.eliminateBlindAnswersFromSession();\n this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), this.isComplete(), !!this._model));\n this.render();\n }\n\n isComplete() {\n if (!this._session) {\n return false;\n }\n\n return Array.isArray(this._session.answers) && this._session.answers.length > 0;\n }\n\n set session(s) {\n if (s && !s.answers) {\n s.answers = [];\n }\n\n this._session = s;\n this.render();\n }\n\n get session() {\n return this._session;\n }\n\n eliminateBlindAnswersFromSession(){\n const { answers = [] } = this._session || {};\n const { choices = [] } = this._model || {};\n const mappedChoices = choices.map(c => c.id) || [];\n const filteredAnswers = answers.map(answer => {\n const answerChoices = answer?.choices || [];\n answer.choices = answerChoices.filter(c => mappedChoices.includes(c));\n return answer;\n })\n if(filteredAnswers.length > 0){\n this.changeAnswers(filteredAnswers);\n }\n }\n\n changeAnswers(answers) {\n this._session.answers = answers;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete()));\n\n this.render();\n }\n\n onShowCorrectToggle() {\n renderMath(this);\n }\n\n render() {\n if (this._model && this._session) {\n const el = React.createElement(CategorizeComponent, {\n model: this._model,\n session: this._session,\n onAnswersChange: this.changeAnswers.bind(this),\n onShowCorrectToggle: this.onShowCorrectToggle.bind(this),\n });\n\n ReactDOM.render(el, this, () => {\n renderMath(this);\n });\n }\n }\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":["Categorize","m","_model","eliminateBlindAnswersFromSession","dispatchEvent","ModelSetEvent","tagName","toLowerCase","isComplete","render","_session","Array","isArray","answers","length","s","choices","mappedChoices","map","c","id","filteredAnswers","answer","answerChoices","filter","includes","changeAnswers","SessionChangedEvent","el","React","createElement","CategorizeComponent","model","session","onAnswersChange","bind","onShowCorrectToggle","ReactDOM","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEqBA,U;;;;;;;;;;;;SACnB,aAAUC,CAAV,EAAa;AACX,WAAKC,MAAL,GAAcD,CAAd;AAEA,WAAKE,gCAAL;AACA,WAAKC,aAAL,CAAmB,IAAIC,8BAAJ,CAAkB,KAAKC,OAAL,CAAaC,WAAb,EAAlB,EAA8C,KAAKC,UAAL,EAA9C,EAAiE,CAAC,CAAC,KAAKN,MAAxE,CAAnB;AACA,WAAKO,MAAL;AACD;;;WAED,sBAAa;AACX,UAAI,CAAC,KAAKC,QAAV,EAAoB;AAClB,eAAO,KAAP;AACD;;AAED,aAAOC,KAAK,CAACC,OAAN,CAAc,KAAKF,QAAL,CAAcG,OAA5B,KAAwC,KAAKH,QAAL,CAAcG,OAAd,CAAsBC,MAAtB,GAA+B,CAA9E;AACD;;;SAWD,eAAc;AACZ,aAAO,KAAKJ,QAAZ;AACD,K;SAXD,aAAYK,CAAZ,EAAe;AACb,UAAIA,CAAC,IAAI,CAACA,CAAC,CAACF,OAAZ,EAAqB;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B,EAAkC;AAChC,YAAMkB,EAAE,gBAAGC,kBAAMC,aAAN,CAAoBC,sBAApB,EAAyC;AAClDC,UAAAA,KAAK,EAAE,KAAK9B,MADsC;AAElD+B,UAAAA,OAAO,EAAE,KAAKvB,QAFoC;AAGlDwB,UAAAA,eAAe,EAAE,KAAKR,aAAL,CAAmBS,IAAnB,CAAwB,IAAxB,CAHiC;AAIlDC,UAAAA,mBAAmB,EAAE,KAAKA,mBAAL,CAAyBD,IAAzB,CAA8B,IAA9B;AAJ6B,SAAzC,CAAX;;AAOAE,6BAAS5B,MAAT,CAAgBmB,EAAhB,EAAoB,IAApB,EAA0B,YAAM;AAC9B,yCAAW,KAAX;AACD,SAFD;AAGD;AACF;;;kDArEqCU,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering';\nimport { SessionChangedEvent, ModelSetEvent } from '@pie-framework/pie-player-events';\nimport CategorizeComponent from './categorize';\n\nexport default class Categorize extends HTMLElement {\n set model(m) {\n this._model = m;\n\n this.eliminateBlindAnswersFromSession();\n this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), this.isComplete(), !!this._model));\n this.render();\n }\n\n isComplete() {\n if (!this._session) {\n return false;\n }\n\n return Array.isArray(this._session.answers) && this._session.answers.length > 0;\n }\n\n set session(s) {\n if (s && !s.answers) {\n s.answers = [];\n }\n\n this._session = s;\n this.render();\n }\n\n get session() {\n return this._session;\n }\n\n eliminateBlindAnswersFromSession(){\n const { answers = [] } = this._session || {};\n const { choices = [] } = this._model || {};\n const mappedChoices = choices.map(c => c.id) || [];\n const filteredAnswers = answers.map(answer => {\n const answerChoices = answer?.choices || [];\n answer.choices = answerChoices.filter(c => mappedChoices.includes(c));\n return answer;\n })\n if(filteredAnswers.length > 0){\n this.changeAnswers(filteredAnswers);\n }\n }\n\n changeAnswers(answers) {\n this._session.answers = answers;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete()));\n\n this.render();\n }\n\n onShowCorrectToggle() {\n renderMath(this);\n }\n\n render() {\n if (this._model && this._session) {\n const el = React.createElement(CategorizeComponent, {\n model: this._model,\n session: this._session,\n onAnswersChange: this.changeAnswers.bind(this),\n onShowCorrectToggle: this.onShowCorrectToggle.bind(this),\n });\n\n ReactDOM.render(el, this, () => {\n renderMath(this);\n });\n }\n }\n}\n"],"file":"index.js"}
package/package.json CHANGED
@@ -4,14 +4,14 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "8.9.1-next.9+c3f6156ab",
7
+ "version": "8.10.0",
8
8
  "description": "",
9
9
  "author": "pie framework developers",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "@material-ui/core": "^3.9.2",
13
13
  "@pie-framework/pie-player-events": "^0.1.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": "^4.1.1",
17
17
  "lodash": "^4.17.15",
@@ -20,7 +20,7 @@
20
20
  "react-dnd": "^14.0.5",
21
21
  "react-dom": "^16.8.1"
22
22
  },
23
- "gitHead": "c3f6156abbc3d45042d5b8ebeb96372055360ed8",
23
+ "gitHead": "229e10aa53659f55129b8a4e27dbfc76939e214b",
24
24
  "scripts": {
25
25
  "postpublish": "../../scripts/postpublish"
26
26
  },