@pie-element/categorize 11.3.4-next.0 → 12.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/configure/lib/defaults.js +2 -5
  2. package/configure/lib/defaults.js.map +1 -1
  3. package/configure/lib/design/builder.js +15 -33
  4. package/configure/lib/design/builder.js.map +1 -1
  5. package/configure/lib/design/buttons.js +41 -95
  6. package/configure/lib/design/buttons.js.map +1 -1
  7. package/configure/lib/design/categories/RowLabel.js +32 -45
  8. package/configure/lib/design/categories/RowLabel.js.map +1 -1
  9. package/configure/lib/design/categories/alternateResponses.js +96 -251
  10. package/configure/lib/design/categories/alternateResponses.js.map +1 -1
  11. package/configure/lib/design/categories/category.js +135 -208
  12. package/configure/lib/design/categories/category.js.map +1 -1
  13. package/configure/lib/design/categories/choice-preview.js +61 -126
  14. package/configure/lib/design/categories/choice-preview.js.map +1 -1
  15. package/configure/lib/design/categories/droppable-placeholder.js +73 -165
  16. package/configure/lib/design/categories/droppable-placeholder.js.map +1 -1
  17. package/configure/lib/design/categories/index.js +195 -384
  18. package/configure/lib/design/categories/index.js.map +1 -1
  19. package/configure/lib/design/choices/choice.js +155 -264
  20. package/configure/lib/design/choices/choice.js.map +1 -1
  21. package/configure/lib/design/choices/config.js +42 -98
  22. package/configure/lib/design/choices/config.js.map +1 -1
  23. package/configure/lib/design/choices/index.js +148 -236
  24. package/configure/lib/design/choices/index.js.map +1 -1
  25. package/configure/lib/design/header.js +57 -111
  26. package/configure/lib/design/header.js.map +1 -1
  27. package/configure/lib/design/index.js +631 -476
  28. package/configure/lib/design/index.js.map +1 -1
  29. package/configure/lib/design/input-header.js +93 -149
  30. package/configure/lib/design/input-header.js.map +1 -1
  31. package/configure/lib/design/utils.js +4 -15
  32. package/configure/lib/design/utils.js.map +1 -1
  33. package/configure/lib/index.js +120 -183
  34. package/configure/lib/index.js.map +1 -1
  35. package/configure/lib/main.js +30 -74
  36. package/configure/lib/main.js.map +1 -1
  37. package/configure/lib/utils.js +22 -32
  38. package/configure/lib/utils.js.map +1 -1
  39. package/configure/package.json +15 -15
  40. package/controller/lib/defaults.js +2 -5
  41. package/controller/lib/defaults.js.map +1 -1
  42. package/controller/lib/index.js +237 -318
  43. package/controller/lib/index.js.map +1 -1
  44. package/controller/lib/utils.js +28 -65
  45. package/controller/lib/utils.js.map +1 -1
  46. package/controller/package.json +5 -5
  47. package/lib/categorize/categories.js +106 -164
  48. package/lib/categorize/categories.js.map +1 -1
  49. package/lib/categorize/category.js +73 -123
  50. package/lib/categorize/category.js.map +1 -1
  51. package/lib/categorize/choice.js +118 -245
  52. package/lib/categorize/choice.js.map +1 -1
  53. package/lib/categorize/choices.js +66 -131
  54. package/lib/categorize/choices.js.map +1 -1
  55. package/lib/categorize/droppable-placeholder.js +46 -103
  56. package/lib/categorize/droppable-placeholder.js.map +1 -1
  57. package/lib/categorize/grid-content.js +39 -87
  58. package/lib/categorize/grid-content.js.map +1 -1
  59. package/lib/categorize/index.js +341 -317
  60. package/lib/categorize/index.js.map +1 -1
  61. package/lib/index.js +285 -306
  62. package/lib/index.js.map +1 -1
  63. package/package.json +16 -14
@@ -1,210 +1,147 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports["default"] = void 0;
9
-
10
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
-
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
-
14
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
-
16
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
-
18
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
-
20
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
-
22
- var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
23
-
7
+ exports.default = void 0;
24
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
-
26
9
  var _react = _interopRequireDefault(require("react"));
27
-
28
- var _reactDom = _interopRequireDefault(require("react-dom"));
29
-
10
+ var _client = require("react-dom/client");
30
11
  var _pieConfigureEvents = require("@pie-framework/pie-configure-events");
31
-
32
12
  var _mathRendering = require("@pie-lib/math-rendering");
33
-
34
13
  var _main = _interopRequireDefault(require("./main"));
35
-
36
14
  var _defaults = _interopRequireDefault(require("./defaults"));
37
-
38
- var _excluded = ["alternateResponses"];
39
-
40
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
41
-
42
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
43
-
44
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
45
-
46
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
47
-
48
- var CategorizeConfigure = /*#__PURE__*/function (_HTMLElement) {
49
- (0, _inherits2["default"])(CategorizeConfigure, _HTMLElement);
50
-
51
- var _super = _createSuper(CategorizeConfigure);
52
-
53
- // PD-2960: make sure we don't have alternates in model or possibility to add them (temporary solution)
54
- // this function is used in controller, too
55
- function CategorizeConfigure() {
56
- var _this;
57
-
58
- (0, _classCallCheck2["default"])(this, CategorizeConfigure);
59
- _this = _super.call(this);
60
- _this._model = CategorizeConfigure.createDefaultModel();
61
- _this._configuration = _defaults["default"].configuration;
62
- return _this;
15
+ class CategorizeConfigure extends HTMLElement {
16
+ constructor() {
17
+ super();
18
+ this._root = null;
19
+ this._model = CategorizeConfigure.createDefaultModel();
20
+ this._configuration = _defaults.default.configuration;
63
21
  }
64
-
65
- (0, _createClass2["default"])(CategorizeConfigure, [{
66
- key: "model",
67
- set: function set(m) {
68
- this._model = CategorizeConfigure.createDefaultModel(m);
69
-
70
- if (m.choices && m.choices.length >= m.maxAnswerChoices) {
71
- this._model.maxAnswerChoices = m.choices.length;
72
- console.warn("Max Answer Choices can't be less than choices length!");
73
- }
74
-
75
- this.render();
22
+ set model(m) {
23
+ this._model = CategorizeConfigure.createDefaultModel(m);
24
+ if (m.choices && m.choices.length >= m.maxAnswerChoices) {
25
+ this._model.maxAnswerChoices = m.choices.length;
26
+ console.warn("Max Answer Choices can't be less than choices length!");
76
27
  }
77
- }, {
78
- key: "configuration",
79
- set: function set(c) {
80
- var _newConfiguration$lan,
81
- _this2 = this;
82
-
83
- var newConfiguration = _objectSpread(_objectSpread({}, _defaults["default"].configuration), c);
84
-
85
- this._configuration = newConfiguration; // if language:enabled is true, then the corresponding default item model should include a language value;
86
- // if it is false, then the language field should be omitted from the item model.
87
- // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,
88
- // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).
89
-
90
- if (newConfiguration !== null && newConfiguration !== void 0 && (_newConfiguration$lan = newConfiguration.language) !== null && _newConfiguration$lan !== void 0 && _newConfiguration$lan.enabled) {
91
- var _newConfiguration$lan2, _newConfiguration$lan3;
92
-
93
- if (newConfiguration !== null && newConfiguration !== void 0 && (_newConfiguration$lan2 = newConfiguration.languageChoices) !== null && _newConfiguration$lan2 !== void 0 && (_newConfiguration$lan3 = _newConfiguration$lan2.options) !== null && _newConfiguration$lan3 !== void 0 && _newConfiguration$lan3.length) {
94
- this._model.language = newConfiguration === null || newConfiguration === void 0 ? void 0 : newConfiguration.languageChoices.options[0].value;
95
- }
96
- } else if (newConfiguration.language.settings && this._model.language) {
97
- this._configuration.language.enabled = true;
98
-
99
- if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {
100
- this._configuration.languageChoices.options = [];
101
- } // check if the language is already included in the languageChoices.options array
102
- // and if not, then add it.
103
-
104
-
105
- if (!this._configuration.languageChoices.options.find(function (option) {
106
- return option.value === _this2._model.language;
107
- })) {
108
- this._configuration.languageChoices.options.push({
109
- value: this._model.language,
110
- label: this._model.language
111
- });
112
- }
113
- } else {
114
- delete this._model.language;
28
+ this.render();
29
+ }
30
+ set configuration(c) {
31
+ const newConfiguration = {
32
+ ..._defaults.default.configuration,
33
+ ...c
34
+ };
35
+ this._configuration = newConfiguration;
36
+
37
+ // if language:enabled is true, then the corresponding default item model should include a language value;
38
+ // if it is false, then the language field should be omitted from the item model.
39
+ // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,
40
+ // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).
41
+ if (newConfiguration?.language?.enabled) {
42
+ if (newConfiguration?.languageChoices?.options?.length) {
43
+ this._model.language = newConfiguration?.languageChoices.options[0].value;
44
+ }
45
+ } else if (newConfiguration.language.settings && this._model.language) {
46
+ this._configuration.language.enabled = true;
47
+ if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {
48
+ this._configuration.languageChoices.options = [];
115
49
  }
116
50
 
117
- this.render();
118
- }
119
- }, {
120
- key: "onModelChanged",
121
- value: function onModelChanged(m) {
122
- this._model = m;
123
- this.render();
124
- this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model, false));
125
- }
126
- }, {
127
- key: "onConfigurationChanged",
128
- value: function onConfigurationChanged(c) {
129
- this._configuration = c;
130
- this.render();
131
- }
132
- }, {
133
- key: "connectedCallback",
134
- value: function connectedCallback() {
135
- this.render();
51
+ // check if the language is already included in the languageChoices.options array
52
+ // and if not, then add it.
53
+ if (!this._configuration.languageChoices.options.find(option => option.value === this._model.language)) {
54
+ this._configuration.languageChoices.options.push({
55
+ value: this._model.language,
56
+ label: this._model.language
57
+ });
58
+ }
59
+ } else {
60
+ delete this._model.language;
136
61
  }
137
- /**
138
- *
139
- * @param {done, progress, file} handler
140
- */
62
+ this.render();
63
+ }
64
+ onModelChanged(m) {
65
+ this._model = m;
66
+ this.render();
67
+ this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model, false));
68
+ }
69
+ onConfigurationChanged(c) {
70
+ this._configuration = c;
71
+ this.render();
72
+ }
73
+ connectedCallback() {
74
+ this.render();
75
+ }
141
76
 
142
- }, {
143
- key: "insertImage",
144
- value: function insertImage(handler) {
145
- this.dispatchEvent(new _pieConfigureEvents.InsertImageEvent(handler));
146
- }
147
- }, {
148
- key: "onDeleteImage",
149
- value: function onDeleteImage(src, done) {
150
- this.dispatchEvent(new _pieConfigureEvents.DeleteImageEvent(src, done));
151
- }
152
- }, {
153
- key: "insertSound",
154
- value: function insertSound(handler) {
155
- this.dispatchEvent(new _pieConfigureEvents.InsertSoundEvent(handler));
156
- }
157
- }, {
158
- key: "onDeleteSound",
159
- value: function onDeleteSound(src, done) {
160
- this.dispatchEvent(new _pieConfigureEvents.DeleteSoundEvent(src, done));
77
+ /**
78
+ *
79
+ * @param {done, progress, file} handler
80
+ */
81
+ insertImage(handler) {
82
+ this.dispatchEvent(new _pieConfigureEvents.InsertImageEvent(handler));
83
+ }
84
+ onDeleteImage(src, done) {
85
+ this.dispatchEvent(new _pieConfigureEvents.DeleteImageEvent(src, done));
86
+ }
87
+ insertSound(handler) {
88
+ this.dispatchEvent(new _pieConfigureEvents.InsertSoundEvent(handler));
89
+ }
90
+ onDeleteSound(src, done) {
91
+ this.dispatchEvent(new _pieConfigureEvents.DeleteSoundEvent(src, done));
92
+ }
93
+ render() {
94
+ const el = /*#__PURE__*/_react.default.createElement(_main.default, {
95
+ model: this._model,
96
+ configuration: this._configuration,
97
+ onModelChanged: this.onModelChanged.bind(this),
98
+ onConfigurationChanged: this.onConfigurationChanged.bind(this),
99
+ imageSupport: {
100
+ add: this.insertImage.bind(this),
101
+ delete: this.onDeleteImage.bind(this)
102
+ },
103
+ uploadSoundSupport: {
104
+ add: this.insertSound.bind(this),
105
+ delete: this.onDeleteSound.bind(this)
106
+ }
107
+ });
108
+ if (!this._root) {
109
+ this._root = (0, _client.createRoot)(this);
161
110
  }
162
- }, {
163
- key: "render",
164
- value: function render() {
165
- var _this3 = this;
166
-
167
- var el = /*#__PURE__*/_react["default"].createElement(_main["default"], {
168
- model: this._model,
169
- configuration: this._configuration,
170
- onModelChanged: this.onModelChanged.bind(this),
171
- onConfigurationChanged: this.onConfigurationChanged.bind(this),
172
- imageSupport: {
173
- add: this.insertImage.bind(this),
174
- "delete": this.onDeleteImage.bind(this)
175
- },
176
- uploadSoundSupport: {
177
- add: this.insertSound.bind(this),
178
- "delete": this.onDeleteSound.bind(this)
179
- }
180
- });
181
-
182
- _reactDom["default"].render(el, this, function () {
183
- (0, _mathRendering.renderMath)(_this3);
184
- });
111
+ this._root.render(el);
112
+ setTimeout(() => {
113
+ (0, _mathRendering.renderMath)(this);
114
+ }, 0);
115
+ }
116
+ disconnectedCallback() {
117
+ if (this._root) {
118
+ this._root.unmount();
185
119
  }
186
- }]);
187
- return CategorizeConfigure;
188
- }( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
189
-
190
- exports["default"] = CategorizeConfigure;
191
- (0, _defineProperty2["default"])(CategorizeConfigure, "createDefaultModel", function () {
192
- var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
193
- return _objectSpread(_objectSpread({}, _defaults["default"].model), model);
194
- });
195
- (0, _defineProperty2["default"])(CategorizeConfigure, "disableAlternateResponses", function (m) {
196
- var _ref = m || {},
197
- correctResponse = _ref.correctResponse;
198
-
120
+ }
121
+ }
122
+ exports.default = CategorizeConfigure;
123
+ (0, _defineProperty2.default)(CategorizeConfigure, "createDefaultModel", (model = {}) => ({
124
+ ..._defaults.default.model,
125
+ ...model
126
+ }));
127
+ // PD-2960: make sure we don't have alternates in model or possibility to add them (temporary solution)
128
+ // this function is used in controller, too
129
+ (0, _defineProperty2.default)(CategorizeConfigure, "disableAlternateResponses", m => {
130
+ let {
131
+ correctResponse
132
+ } = m || {};
199
133
  correctResponse = correctResponse || [];
200
- var mappedCorrectResponse = correctResponse.map(function (cr) {
201
- var alternateResponses = cr.alternateResponses,
202
- response = (0, _objectWithoutProperties2["default"])(cr, _excluded);
134
+ const mappedCorrectResponse = correctResponse.map(cr => {
135
+ const {
136
+ alternateResponses,
137
+ ...response
138
+ } = cr;
203
139
  return response;
204
140
  });
205
- return _objectSpread(_objectSpread({}, m), {}, {
141
+ return {
142
+ ...m,
206
143
  correctResponse: mappedCorrectResponse,
207
144
  allowAlternateEnabled: false
208
- });
145
+ };
209
146
  });
210
147
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["CategorizeConfigure","_model","createDefaultModel","_configuration","defaults","configuration","m","choices","length","maxAnswerChoices","console","warn","render","c","newConfiguration","language","enabled","languageChoices","options","value","settings","find","option","push","label","dispatchEvent","ModelUpdatedEvent","handler","InsertImageEvent","src","done","DeleteImageEvent","InsertSoundEvent","DeleteSoundEvent","el","React","createElement","Main","model","onModelChanged","bind","onConfigurationChanged","imageSupport","add","insertImage","onDeleteImage","uploadSoundSupport","insertSound","onDeleteSound","ReactDOM","HTMLElement","correctResponse","mappedCorrectResponse","map","cr","alternateResponses","response","allowAlternateEnabled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAOA;;AAEA;;AAEA;;;;;;;;;;;;IAEqBA,mB;;;;;AAMnB;AACA;AAeA,iCAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,MAAL,GAAcD,mBAAmB,CAACE,kBAApB,EAAd;AACA,UAAKC,cAAL,GAAsBC,qBAASC,aAA/B;AAHY;AAIb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKL,MAAL,GAAcD,mBAAmB,CAACE,kBAApB,CAAuCI,CAAvC,CAAd;;AAEA,UAAIA,CAAC,CAACC,OAAF,IAAaD,CAAC,CAACC,OAAF,CAAUC,MAAV,IAAoBF,CAAC,CAACG,gBAAvC,EAAyD;AACvD,aAAKR,MAAL,CAAYQ,gBAAZ,GAA+BH,CAAC,CAACC,OAAF,CAAUC,MAAzC;AACAE,QAAAA,OAAO,CAACC,IAAR,CAAa,uDAAb;AACD;;AAED,WAAKC,MAAL;AACD;;;SAED,aAAkBC,CAAlB,EAAqB;AAAA;AAAA;;AACnB,UAAMC,gBAAgB,mCACjBV,qBAASC,aADQ,GAEjBQ,CAFiB,CAAtB;;AAKA,WAAKV,cAAL,GAAsBW,gBAAtB,CANmB,CAQnB;AACA;AACA;AACA;;AACA,UAAIA,gBAAJ,aAAIA,gBAAJ,wCAAIA,gBAAgB,CAAEC,QAAtB,kDAAI,sBAA4BC,OAAhC,EAAyC;AAAA;;AACvC,YAAIF,gBAAJ,aAAIA,gBAAJ,yCAAIA,gBAAgB,CAAEG,eAAtB,6EAAI,uBAAmCC,OAAvC,mDAAI,uBAA4CV,MAAhD,EAAwD;AACtD,eAAKP,MAAL,CAAYc,QAAZ,GAAuBD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T,CAAgBsB,EAAhB,EAAoB,IAApB,EAA0B,YAAM;AAC9B,uCAAW,MAAX;AACD,OAFD;AAGD;;;kDApI8CgB,W;;;iCAA5BlD,mB,wBACS;AAAA,MAACsC,KAAD,uEAAS,EAAT;AAAA,yCACvBlC,qBAASkC,KADc,GAEvBA,KAFuB;AAAA,C;iCADTtC,mB,+BAQgB,UAACM,CAAD,EAAO;AACxC,aAA0BA,CAAC,IAAI,EAA/B;AAAA,MAAM6C,eAAN,QAAMA,eAAN;;AACAA,EAAAA,eAAe,GAAGA,eAAe,IAAI,EAArC;AACA,MAAMC,qBAAqB,GAAGD,eAAe,CAACE,GAAhB,CAAoB,UAACC,EAAD,EAAQ;AACxD,QAAQC,kBAAR,GAA4CD,EAA5C,CAAQC,kBAAR;AAAA,QAA+BC,QAA/B,6CAA4CF,EAA5C;AACA,WAAOE,QAAP;AACD,GAH6B,CAA9B;AAIA,yCACKlD,CADL;AAEE6C,IAAAA,eAAe,EAAEC,qBAFnB;AAGEK,IAAAA,qBAAqB,EAAE;AAHzB;AAKD,C","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nimport Main from './main';\n\nimport defaults from './defaults';\n\nexport default class CategorizeConfigure extends HTMLElement {\n static createDefaultModel = (model = {}) => ({\n ...defaults.model,\n ...model,\n });\n\n // PD-2960: make sure we don't have alternates in model or possibility to add them (temporary solution)\n // this function is used in controller, too\n static disableAlternateResponses = (m) => {\n let { correctResponse } = m || {};\n correctResponse = correctResponse || [];\n const mappedCorrectResponse = correctResponse.map((cr) => {\n const { alternateResponses, ...response } = cr;\n return response;\n });\n return {\n ...m,\n correctResponse: mappedCorrectResponse,\n allowAlternateEnabled: false,\n };\n };\n\n constructor() {\n super();\n this._model = CategorizeConfigure.createDefaultModel();\n this._configuration = defaults.configuration;\n }\n\n set model(m) {\n this._model = CategorizeConfigure.createDefaultModel(m);\n\n if (m.choices && m.choices.length >= m.maxAnswerChoices) {\n this._model.maxAnswerChoices = m.choices.length;\n console.warn(\"Max Answer Choices can't be less than choices length!\");\n }\n\n this.render();\n }\n\n set configuration(c) {\n const newConfiguration = {\n ...defaults.configuration,\n ...c,\n };\n\n this._configuration = newConfiguration;\n\n // if language:enabled is true, then the corresponding default item model should include a language value;\n // if it is false, then the language field should be omitted from the item model.\n // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,\n // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).\n if (newConfiguration?.language?.enabled) {\n if (newConfiguration?.languageChoices?.options?.length) {\n this._model.language = newConfiguration?.languageChoices.options[0].value;\n }\n } else if (newConfiguration.language.settings && this._model.language) {\n this._configuration.language.enabled = true;\n\n if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {\n this._configuration.languageChoices.options = [];\n }\n\n // check if the language is already included in the languageChoices.options array\n // and if not, then add it.\n if (!this._configuration.languageChoices.options.find((option) => option.value === this._model.language)) {\n this._configuration.languageChoices.options.push({\n value: this._model.language,\n label: this._model.language,\n });\n }\n } else {\n delete this._model.language;\n }\n\n this.render();\n }\n\n onModelChanged(m) {\n this._model = m;\n\n this.render();\n this.dispatchEvent(new ModelUpdatedEvent(this._model, false));\n }\n\n onConfigurationChanged(c) {\n this._configuration = c;\n this.render();\n }\n\n connectedCallback() {\n this.render();\n }\n\n /**\n *\n * @param {done, progress, file} handler\n */\n insertImage(handler) {\n this.dispatchEvent(new InsertImageEvent(handler));\n }\n\n onDeleteImage(src, done) {\n this.dispatchEvent(new DeleteImageEvent(src, done));\n }\n\n insertSound(handler) {\n this.dispatchEvent(new InsertSoundEvent(handler));\n }\n\n onDeleteSound(src, done) {\n this.dispatchEvent(new DeleteSoundEvent(src, done));\n }\n\n render() {\n const el = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged.bind(this),\n onConfigurationChanged: this.onConfigurationChanged.bind(this),\n imageSupport: {\n add: this.insertImage.bind(this),\n delete: this.onDeleteImage.bind(this),\n },\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this),\n },\n });\n\n ReactDOM.render(el, this, () => {\n renderMath(this);\n });\n }\n}\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_client","_pieConfigureEvents","_mathRendering","_main","_defaults","CategorizeConfigure","HTMLElement","constructor","_root","_model","createDefaultModel","_configuration","defaults","configuration","model","m","choices","length","maxAnswerChoices","console","warn","render","c","newConfiguration","language","enabled","languageChoices","options","value","settings","find","option","push","label","onModelChanged","dispatchEvent","ModelUpdatedEvent","onConfigurationChanged","connectedCallback","insertImage","handler","InsertImageEvent","onDeleteImage","src","done","DeleteImageEvent","insertSound","InsertSoundEvent","onDeleteSound","DeleteSoundEvent","el","React","createElement","Main","bind","imageSupport","add","delete","uploadSoundSupport","createRoot","setTimeout","renderMath","disconnectedCallback","unmount","exports","default","_defineProperty2","correctResponse","mappedCorrectResponse","map","cr","alternateResponses","response","allowAlternateEnabled"],"sources":["../src/index.js"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nimport Main from './main';\n\nimport defaults from './defaults';\n\nexport default class CategorizeConfigure extends HTMLElement {\n static createDefaultModel = (model = {}) => ({\n ...defaults.model,\n ...model,\n });\n\n // PD-2960: make sure we don't have alternates in model or possibility to add them (temporary solution)\n // this function is used in controller, too\n static disableAlternateResponses = (m) => {\n let { correctResponse } = m || {};\n correctResponse = correctResponse || [];\n const mappedCorrectResponse = correctResponse.map((cr) => {\n const { alternateResponses, ...response } = cr;\n return response;\n });\n return {\n ...m,\n correctResponse: mappedCorrectResponse,\n allowAlternateEnabled: false,\n };\n };\n\n constructor() {\n super();\n this._root = null;\n this._model = CategorizeConfigure.createDefaultModel();\n this._configuration = defaults.configuration;\n }\n\n set model(m) {\n this._model = CategorizeConfigure.createDefaultModel(m);\n\n if (m.choices && m.choices.length >= m.maxAnswerChoices) {\n this._model.maxAnswerChoices = m.choices.length;\n console.warn(\"Max Answer Choices can't be less than choices length!\");\n }\n\n this.render();\n }\n\n set configuration(c) {\n const newConfiguration = {\n ...defaults.configuration,\n ...c,\n };\n\n this._configuration = newConfiguration;\n\n // if language:enabled is true, then the corresponding default item model should include a language value;\n // if it is false, then the language field should be omitted from the item model.\n // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,\n // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).\n if (newConfiguration?.language?.enabled) {\n if (newConfiguration?.languageChoices?.options?.length) {\n this._model.language = newConfiguration?.languageChoices.options[0].value;\n }\n } else if (newConfiguration.language.settings && this._model.language) {\n this._configuration.language.enabled = true;\n\n if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {\n this._configuration.languageChoices.options = [];\n }\n\n // check if the language is already included in the languageChoices.options array\n // and if not, then add it.\n if (!this._configuration.languageChoices.options.find((option) => option.value === this._model.language)) {\n this._configuration.languageChoices.options.push({\n value: this._model.language,\n label: this._model.language,\n });\n }\n } else {\n delete this._model.language;\n }\n\n this.render();\n }\n\n onModelChanged(m) {\n this._model = m;\n\n this.render();\n this.dispatchEvent(new ModelUpdatedEvent(this._model, false));\n }\n\n onConfigurationChanged(c) {\n this._configuration = c;\n this.render();\n }\n\n connectedCallback() {\n this.render();\n }\n\n /**\n *\n * @param {done, progress, file} handler\n */\n insertImage(handler) {\n this.dispatchEvent(new InsertImageEvent(handler));\n }\n\n onDeleteImage(src, done) {\n this.dispatchEvent(new DeleteImageEvent(src, done));\n }\n\n insertSound(handler) {\n this.dispatchEvent(new InsertSoundEvent(handler));\n }\n\n onDeleteSound(src, done) {\n this.dispatchEvent(new DeleteSoundEvent(src, done));\n }\n\n render() {\n const el = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged.bind(this),\n onConfigurationChanged: this.onConfigurationChanged.bind(this),\n imageSupport: {\n add: this.insertImage.bind(this),\n delete: this.onDeleteImage.bind(this),\n },\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this),\n },\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(el);\n\n setTimeout(() => {\n renderMath(this);\n }, 0);\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AAOA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEe,MAAMM,mBAAmB,SAASC,WAAW,CAAC;EAsB3DC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,KAAK,GAAG,IAAI;IACjB,IAAI,CAACC,MAAM,GAAGJ,mBAAmB,CAACK,kBAAkB,CAAC,CAAC;IACtD,IAAI,CAACC,cAAc,GAAGC,iBAAQ,CAACC,aAAa;EAC9C;EAEA,IAAIC,KAAKA,CAACC,CAAC,EAAE;IACX,IAAI,CAACN,MAAM,GAAGJ,mBAAmB,CAACK,kBAAkB,CAACK,CAAC,CAAC;IAEvD,IAAIA,CAAC,CAACC,OAAO,IAAID,CAAC,CAACC,OAAO,CAACC,MAAM,IAAIF,CAAC,CAACG,gBAAgB,EAAE;MACvD,IAAI,CAACT,MAAM,CAACS,gBAAgB,GAAGH,CAAC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AAGA,eAAe,IAAI,EAAE;EACvC,MAAMC,qBAAqB,GAAGD,eAAe,CAACE,GAAG,CAAEC,EAAE,IAAK;IACxD,MAAM;MAAEC,kBAAkB;MAAE,GAAGC;IAAS,CAAC,GAAGF,EAAE;IAC9C,OAAOE,QAAQ;EACjB,CAAC,CAAC;EACF,OAAO;IACL,GAAGzD,CAAC;IACJoD,eAAe,EAAEC,qBAAqB;IACtCK,qBAAqB,EAAE;EACzB,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1,88 +1,44 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports["default"] = exports.Main = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
-
16
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
17
-
18
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
-
7
+ exports.default = exports.Main = void 0;
20
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
21
-
22
9
  var _react = _interopRequireDefault(require("react"));
23
-
24
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
25
-
26
- var _styles = require("@material-ui/core/styles");
27
-
28
11
  var _design = _interopRequireDefault(require("./design"));
29
-
30
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
31
-
32
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
33
-
34
- var Main = /*#__PURE__*/function (_React$Component) {
35
- (0, _inherits2["default"])(Main, _React$Component);
36
-
37
- var _super = _createSuper(Main);
38
-
39
- function Main() {
40
- (0, _classCallCheck2["default"])(this, Main);
41
- return _super.apply(this, arguments);
12
+ class Main extends _react.default.Component {
13
+ render() {
14
+ const {
15
+ model,
16
+ onModelChanged,
17
+ configuration,
18
+ onConfigurationChanged,
19
+ imageSupport,
20
+ uploadSoundSupport
21
+ } = this.props;
22
+ return /*#__PURE__*/_react.default.createElement(_design.default, {
23
+ imageSupport: imageSupport,
24
+ uploadSoundSupport: uploadSoundSupport,
25
+ title: "Design",
26
+ model: model,
27
+ configuration: configuration,
28
+ onChange: onModelChanged,
29
+ onConfigurationChanged: onConfigurationChanged
30
+ });
42
31
  }
43
-
44
- (0, _createClass2["default"])(Main, [{
45
- key: "render",
46
- value: function render() {
47
- var _this$props = this.props,
48
- model = _this$props.model,
49
- onModelChanged = _this$props.onModelChanged,
50
- configuration = _this$props.configuration,
51
- onConfigurationChanged = _this$props.onConfigurationChanged,
52
- imageSupport = _this$props.imageSupport,
53
- uploadSoundSupport = _this$props.uploadSoundSupport;
54
- return /*#__PURE__*/_react["default"].createElement(_design["default"], {
55
- imageSupport: imageSupport,
56
- uploadSoundSupport: uploadSoundSupport,
57
- title: "Design",
58
- model: model,
59
- configuration: configuration,
60
- onChange: onModelChanged,
61
- onConfigurationChanged: onConfigurationChanged
62
- });
63
- }
64
- }]);
65
- return Main;
66
- }(_react["default"].Component);
67
-
32
+ }
68
33
  exports.Main = Main;
69
- (0, _defineProperty2["default"])(Main, "propTypes", {
70
- classes: _propTypes["default"].object.isRequired,
71
- configuration: _propTypes["default"].object,
72
- className: _propTypes["default"].string,
73
- onConfigurationChanged: _propTypes["default"].func,
74
- model: _propTypes["default"].object.isRequired,
75
- onModelChanged: _propTypes["default"].func.isRequired,
76
- imageSupport: _propTypes["default"].object,
77
- uploadSoundSupport: _propTypes["default"].object
34
+ (0, _defineProperty2.default)(Main, "propTypes", {
35
+ configuration: _propTypes.default.object,
36
+ onConfigurationChanged: _propTypes.default.func,
37
+ model: _propTypes.default.object.isRequired,
38
+ onModelChanged: _propTypes.default.func.isRequired,
39
+ imageSupport: _propTypes.default.object,
40
+ uploadSoundSupport: _propTypes.default.object
78
41
  });
79
- (0, _defineProperty2["default"])(Main, "defaultProps", {});
80
-
81
- var styles = function styles() {
82
- return {};
83
- };
84
-
85
- var _default = (0, _styles.withStyles)(styles)(Main);
86
-
87
- exports["default"] = _default;
42
+ (0, _defineProperty2.default)(Main, "defaultProps", {});
43
+ var _default = exports.default = Main;
88
44
  //# sourceMappingURL=main.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main.jsx"],"names":["Main","props","model","onModelChanged","configuration","onConfigurationChanged","imageSupport","uploadSoundSupport","React","Component","classes","PropTypes","object","isRequired","className","string","func","styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;IAEaA,I;;;;;;;;;;;;WAcX,kBAAS;AACP,wBACE,KAAKC,KADP;AAAA,UAAQC,KAAR,eAAQA,KAAR;AAAA,UAAeC,cAAf,eAAeA,cAAf;AAAA,UAA+BC,aAA/B,eAA+BA,aAA/B;AAAA,UAA8CC,sBAA9C,eAA8CA,sBAA9C;AAAA,UAAsEC,YAAtE,eAAsEA,YAAtE;AAAA,UAAoFC,kBAApF,eAAoFA,kBAApF;AAGA,0BACE,gCAAC,kBAAD;AACE,QAAA,YAAY,EAAED,YADhB;AAEE,QAAA,kBAAkB,EAAEC,kBAFtB;AAGE,QAAA,KAAK,EAAC,QAHR;AAIE,QAAA,KAAK,EAAEL,KAJT;AAKE,QAAA,aAAa,EAAEE,aALjB;AAME,QAAA,QAAQ,EAAED,cANZ;AAOE,QAAA,sBAAsB,EAAEE;AAP1B,QADF;AAWD;;;EA7BuBG,kBAAMC,S;;;iCAAnBT,I,eACQ;AACjBU,EAAAA,OAAO,EAAEC,sBAAUC,MAAV,CAAiBC,UADT;AAEjBT,EAAAA,aAAa,EAAEO,sBAAUC,MAFR;AAGjBE,EAAAA,SAAS,EAAEH,sBAAUI,MAHJ;AAIjBV,EAAAA,sBAAsB,EAAEM,sBAAUK,IAJjB;AAKjBd,EAAAA,KAAK,EAAES,sBAAUC,MAAV,CAAiBC,UALP;AAMjBV,EAAAA,cAAc,EAAEQ,sBAAUK,IAAV,CAAeH,UANd;AAOjBP,EAAAA,YAAY,EAAEK,sBAAUC,MAPP;AAQjBL,EAAAA,kBAAkB,EAAEI,sBAAUC;AARb,C;iCADRZ,I,kBAYW,E;;AAmBxB,IAAMiB,MAAM,GAAG,SAATA,MAAS;AAAA,SAAO,EAAP;AAAA,CAAf;;eAEe,wBAAWA,MAAX,EAAmBjB,IAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport Design from './design';\n\nexport class Main extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n configuration: PropTypes.object,\n className: PropTypes.string,\n onConfigurationChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n onModelChanged: PropTypes.func.isRequired,\n imageSupport: PropTypes.object,\n uploadSoundSupport: PropTypes.object,\n };\n\n static defaultProps = {};\n\n render() {\n const { model, onModelChanged, configuration, onConfigurationChanged, imageSupport, uploadSoundSupport } =\n this.props;\n\n return (\n <Design\n imageSupport={imageSupport}\n uploadSoundSupport={uploadSoundSupport}\n title=\"Design\"\n model={model}\n configuration={configuration}\n onChange={onModelChanged}\n onConfigurationChanged={onConfigurationChanged}\n />\n );\n }\n}\nconst styles = () => ({});\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
1
+ {"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_propTypes","_design","Main","React","Component","render","model","onModelChanged","configuration","onConfigurationChanged","imageSupport","uploadSoundSupport","props","default","createElement","title","onChange","exports","_defineProperty2","PropTypes","object","func","isRequired","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Design from './design';\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object,\n onConfigurationChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n onModelChanged: PropTypes.func.isRequired,\n imageSupport: PropTypes.object,\n uploadSoundSupport: PropTypes.object,\n };\n\n static defaultProps = {};\n\n render() {\n const { model, onModelChanged, configuration, onConfigurationChanged, imageSupport, uploadSoundSupport } =\n this.props;\n\n return (\n <Design\n imageSupport={imageSupport}\n uploadSoundSupport={uploadSoundSupport}\n title=\"Design\"\n model={model}\n configuration={configuration}\n onChange={onModelChanged}\n onConfigurationChanged={onConfigurationChanged}\n />\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEO,MAAMG,IAAI,SAASC,cAAK,CAACC,SAAS,CAAC;EAYxCC,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEC,KAAK;MAAEC,cAAc;MAAEC,aAAa;MAAEC,sBAAsB;MAAEC,YAAY;MAAEC;IAAmB,CAAC,GACtG,IAAI,CAACC,KAAK;IAEZ,oBACEf,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACb,OAAA,CAAAY,OAAM;MACLH,YAAY,EAAEA,YAAa;MAC3BC,kBAAkB,EAAEA,kBAAmB;MACvCI,KAAK,EAAC,QAAQ;MACdT,KAAK,EAAEA,KAAM;MACbE,aAAa,EAAEA,aAAc;MAC7BQ,QAAQ,EAAET,cAAe;MACzBE,sBAAsB,EAAEA;IAAuB,CAChD,CAAC;EAEN;AACF;AAACQ,OAAA,CAAAf,IAAA,GAAAA,IAAA;AAAA,IAAAgB,gBAAA,CAAAL,OAAA,EA5BYX,IAAI,eACI;EACjBM,aAAa,EAAEW,kBAAS,CAACC,MAAM;EAC/BX,sBAAsB,EAAEU,kBAAS,CAACE,IAAI;EACtCf,KAAK,EAAEa,kBAAS,CAACC,MAAM,CAACE,UAAU;EAClCf,cAAc,EAAEY,kBAAS,CAACE,IAAI,CAACC,UAAU;EACzCZ,YAAY,EAAES,kBAAS,CAACC,MAAM;EAC9BT,kBAAkB,EAAEQ,kBAAS,CAACC;AAChC,CAAC;AAAA,IAAAF,gBAAA,CAAAL,OAAA,EARUX,IAAI,kBAUO,CAAC,CAAC;AAAA,IAAAqB,QAAA,GAAAN,OAAA,CAAAJ,OAAA,GAoBXX,IAAI","ignoreList":[]}
@@ -4,50 +4,40 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.multiplePlacements = exports.maxLength = exports.getMaxCategoryChoices = exports.generateValidationMessage = void 0;
7
-
8
- var generateValidationMessage = function generateValidationMessage(config) {
9
- var _ref = config || {},
10
- minChoices = _ref.minChoices,
11
- maxChoices = _ref.maxChoices,
12
- maxCategories = _ref.maxCategories;
13
-
7
+ const generateValidationMessage = config => {
8
+ let {
9
+ minChoices,
10
+ maxChoices,
11
+ maxCategories
12
+ } = config || {};
14
13
  minChoices = minChoices || 1;
15
- var validationMessage = '\nThe choices content should ' + 'not be empty and should be unique.\nThere should be at least 1 ' + (maxCategories ? "and at most ".concat(maxCategories, " ") : '') + 'category' + (maxCategories ? 's' : '') + ' defined.' + (minChoices ? "\nThere should be at least ".concat(minChoices, " choices defined.") : '') + (maxChoices ? "\nNo more than ".concat(maxChoices, " choices should be defined.") : '') + '\nAt least one token should be assigned to at least one category.';
14
+ const validationMessage = '\nThe choices content should ' + 'not be empty and should be unique.\nThere should be at least 1 ' + (maxCategories ? `and at most ${maxCategories} ` : '') + 'category' + (maxCategories ? 's' : '') + ' defined.' + (minChoices ? `\nThere should be at least ${minChoices} choices defined.` : '') + (maxChoices ? `\nNo more than ${maxChoices} choices should be defined.` : '') + '\nAt least one token should be assigned to at least one category.';
16
15
  return 'Validation requirements:' + validationMessage;
17
- }; // used in controller too, for consistency modify it there too
18
-
16
+ };
19
17
 
18
+ // used in controller too, for consistency modify it there too
20
19
  exports.generateValidationMessage = generateValidationMessage;
21
- var multiplePlacements = {
20
+ const multiplePlacements = exports.multiplePlacements = {
22
21
  enabled: 'Yes',
23
22
  disabled: 'No',
24
23
  perChoice: 'Set Per Choice'
25
- }; // Find the length of the largest array from an array
26
-
27
- exports.multiplePlacements = multiplePlacements;
28
-
29
- var maxLength = function maxLength(array) {
30
- return (array || []).reduce(function (max, arr) {
31
- return Math.max(max, arr.length);
32
- }, 0);
33
24
  };
34
25
 
26
+ // Find the length of the largest array from an array
27
+ const maxLength = array => (array || []).reduce((max, arr) => {
28
+ return Math.max(max, arr.length);
29
+ }, 0);
35
30
  exports.maxLength = maxLength;
36
-
37
- var getMaxCategoryChoices = function getMaxCategoryChoices(model) {
38
- var _ref2 = model || {},
39
- _ref2$correctResponse = _ref2.correctResponse,
40
- correctResponse = _ref2$correctResponse === void 0 ? [] : _ref2$correctResponse;
41
-
42
- return correctResponse.reduce(function (max, correctRes) {
43
- var _correctRes$choices;
44
-
45
- var correctRespLength = (correctRes === null || correctRes === void 0 ? void 0 : (_correctRes$choices = correctRes.choices) === null || _correctRes$choices === void 0 ? void 0 : _correctRes$choices.length) || 0;
46
- var alternates = (correctRes === null || correctRes === void 0 ? void 0 : correctRes.alternateResponses) || [];
47
- var maxChoices = Math.max(correctRespLength, maxLength(alternates));
31
+ const getMaxCategoryChoices = model => {
32
+ const {
33
+ correctResponse = []
34
+ } = model || {};
35
+ return correctResponse.reduce((max, correctRes) => {
36
+ const correctRespLength = correctRes?.choices?.length || 0;
37
+ const alternates = correctRes?.alternateResponses || [];
38
+ const maxChoices = Math.max(correctRespLength, maxLength(alternates));
48
39
  return maxChoices > max ? maxChoices : max;
49
40
  }, 0);
50
41
  };
51
-
52
42
  exports.getMaxCategoryChoices = getMaxCategoryChoices;
53
43
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils.js"],"names":["generateValidationMessage","config","minChoices","maxChoices","maxCategories","validationMessage","multiplePlacements","enabled","disabled","perChoice","maxLength","array","reduce","max","arr","Math","length","getMaxCategoryChoices","model","correctResponse","correctRes","correctRespLength","choices","alternates","alternateResponses"],"mappings":";;;;;;;AAAO,IAAMA,yBAAyB,GAAG,SAA5BA,yBAA4B,CAACC,MAAD,EAAY;AACnD,aAAgDA,MAAM,IAAI,EAA1D;AAAA,MAAMC,UAAN,QAAMA,UAAN;AAAA,MAAkBC,UAAlB,QAAkBA,UAAlB;AAAA,MAA8BC,aAA9B,QAA8BA,aAA9B;;AACAF,EAAAA,UAAU,GAAGA,UAAU,IAAI,CAA3B;AAEA,MAAMG,iBAAiB,GACrB,kCACA,iEADA,IAECD,aAAa,yBAAkBA,aAAlB,SAAqC,EAFnD,IAGA,UAHA,IAICA,aAAa,GAAG,GAAH,GAAS,EAJvB,IAKA,WALA,IAMCF,UAAU,wCAAiCA,UAAjC,yBAAiE,EAN5E,KAOCC,UAAU,4BAAqBA,UAArB,mCAA+D,EAP1E,IAQA,mEATF;AAWA,SAAO,6BAA6BE,iBAApC;AACD,CAhBM,C,CAkBP;;;;AACO,IAAMC,kBAAkB,GAAG;AAAEC,EAAAA,OAAO,EAAE,KAAX;AAAkBC,EAAAA,QAAQ,EAAE,IAA5B;AAAkCC,EAAAA,SAAS,EAAE;AAA7C,CAA3B,C,CAEP;;;;AACO,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAACC,KAAD;AAAA,SACvB,CAACA,KAAK,IAAI,EAAV,EAAcC,MAAd,CAAqB,UAACC,GAAD,EAAMC,GAAN,EAAc;AACjC,WAAOC,IAAI,CAACF,GAAL,CAASA,GAAT,EAAcC,GAAG,CAACE,MAAlB,CAAP;AACD,GAFD,EAEG,CAFH,CADuB;AAAA,CAAlB;;;;AAKA,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAwB,CAACC,KAAD,EAAW;AAC9C,cAAiCA,KAAK,IAAI,EAA1C;AAAA,oCAAQC,eAAR;AAAA,MAAQA,eAAR,sCAA0B,EAA1B;;AACA,SAAOA,eAAe,CAACP,MAAhB,CAAuB,UAACC,GAAD,EAAMO,UAAN,EAAqB;AAAA;;AACjD,QAAMC,iBAAiB,GAAG,CAAAD,UAAU,SAAV,IAAAA,UAAU,WAAV,mCAAAA,UAAU,CAAEE,OAAZ,4EAAqBN,MAArB,KAA+B,CAAzD;AACA,QAAMO,UAAU,GAAG,CAAAH,UAAU,SAAV,IAAAA,UAAU,WAAV,YAAAA,UAAU,CAAEI,kBAAZ,KAAkC,EAArD;AACA,QAAMrB,UAAU,GAAGY,IAAI,CAACF,GAAL,CAASQ,iBAAT,EAA4BX,SAAS,CAACa,UAAD,CAArC,CAAnB;AACA,WAAOpB,UAAU,GAAGU,GAAb,GAAmBV,UAAnB,GAAgCU,GAAvC;AACD,GALM,EAKJ,CALI,CAAP;AAMD,CARM","sourcesContent":["export const generateValidationMessage = (config) => {\n let { minChoices, maxChoices, maxCategories } = config || {};\n minChoices = minChoices || 1;\n\n const validationMessage =\n '\\nThe choices content should ' +\n 'not be empty and should be unique.\\nThere should be at least 1 ' +\n (maxCategories ? `and at most ${maxCategories} ` : '') +\n 'category' +\n (maxCategories ? 's' : '') +\n ' defined.' +\n (minChoices ? `\\nThere should be at least ${minChoices} choices defined.` : '') +\n (maxChoices ? `\\nNo more than ${maxChoices} choices should be defined.` : '') +\n '\\nAt least one token should be assigned to at least one category.';\n\n return 'Validation requirements:' + validationMessage;\n};\n\n// used in controller too, for consistency modify it there too\nexport const multiplePlacements = { enabled: 'Yes', disabled: 'No', perChoice: 'Set Per Choice' };\n\n// Find the length of the largest array from an array\nexport const maxLength = (array) =>\n (array || []).reduce((max, arr) => {\n return Math.max(max, arr.length);\n }, 0);\n\nexport const getMaxCategoryChoices = (model) => {\n const { correctResponse = [] } = model || {};\n return correctResponse.reduce((max, correctRes) => {\n const correctRespLength = correctRes?.choices?.length || 0;\n const alternates = correctRes?.alternateResponses || [];\n const maxChoices = Math.max(correctRespLength, maxLength(alternates));\n return maxChoices > max ? maxChoices : max;\n }, 0);\n};\n"],"file":"utils.js"}
1
+ {"version":3,"file":"utils.js","names":["generateValidationMessage","config","minChoices","maxChoices","maxCategories","validationMessage","exports","multiplePlacements","enabled","disabled","perChoice","maxLength","array","reduce","max","arr","Math","length","getMaxCategoryChoices","model","correctResponse","correctRes","correctRespLength","choices","alternates","alternateResponses"],"sources":["../src/utils.js"],"sourcesContent":["export const generateValidationMessage = (config) => {\n let { minChoices, maxChoices, maxCategories } = config || {};\n minChoices = minChoices || 1;\n\n const validationMessage =\n '\\nThe choices content should ' +\n 'not be empty and should be unique.\\nThere should be at least 1 ' +\n (maxCategories ? `and at most ${maxCategories} ` : '') +\n 'category' +\n (maxCategories ? 's' : '') +\n ' defined.' +\n (minChoices ? `\\nThere should be at least ${minChoices} choices defined.` : '') +\n (maxChoices ? `\\nNo more than ${maxChoices} choices should be defined.` : '') +\n '\\nAt least one token should be assigned to at least one category.';\n\n return 'Validation requirements:' + validationMessage;\n};\n\n// used in controller too, for consistency modify it there too\nexport const multiplePlacements = { enabled: 'Yes', disabled: 'No', perChoice: 'Set Per Choice' };\n\n// Find the length of the largest array from an array\nexport const maxLength = (array) =>\n (array || []).reduce((max, arr) => {\n return Math.max(max, arr.length);\n }, 0);\n\nexport const getMaxCategoryChoices = (model) => {\n const { correctResponse = [] } = model || {};\n return correctResponse.reduce((max, correctRes) => {\n const correctRespLength = correctRes?.choices?.length || 0;\n const alternates = correctRes?.alternateResponses || [];\n const maxChoices = Math.max(correctRespLength, maxLength(alternates));\n return maxChoices > max ? maxChoices : max;\n }, 0);\n};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