@pie-element/match 11.0.5-esm.1 → 11.1.2-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +1083 -2579
  2. package/configure/CHANGELOG.md +928 -2260
  3. package/configure/lib/add-row.js +27 -73
  4. package/configure/lib/add-row.js.map +1 -1
  5. package/configure/lib/answer-config-block.js +262 -335
  6. package/configure/lib/answer-config-block.js.map +1 -1
  7. package/configure/lib/common.js +18 -33
  8. package/configure/lib/common.js.map +1 -1
  9. package/configure/lib/configure.js +330 -420
  10. package/configure/lib/configure.js.map +1 -1
  11. package/configure/lib/defaults.js +5 -4
  12. package/configure/lib/defaults.js.map +1 -1
  13. package/configure/lib/general-config-block.js +123 -190
  14. package/configure/lib/general-config-block.js.map +1 -1
  15. package/configure/lib/index.js +117 -190
  16. package/configure/lib/index.js.map +1 -1
  17. package/configure/lib/row.js +283 -373
  18. package/configure/lib/row.js.map +1 -1
  19. package/configure/lib/utils.js +4 -15
  20. package/configure/lib/utils.js.map +1 -1
  21. package/configure/package.json +15 -14
  22. package/controller/CHANGELOG.md +630 -1541
  23. package/controller/lib/defaults.js +2 -3
  24. package/controller/lib/defaults.js.map +1 -1
  25. package/controller/lib/index.js +173 -301
  26. package/controller/lib/index.js.map +1 -1
  27. package/controller/package.json +6 -6
  28. package/lib/answer-grid.js +145 -242
  29. package/lib/answer-grid.js.map +1 -1
  30. package/lib/index.js +59 -108
  31. package/lib/index.js.map +1 -1
  32. package/lib/main.js +123 -191
  33. package/lib/main.js.map +1 -1
  34. package/package.json +15 -29
  35. package/esm/configure.js +0 -3936
  36. package/esm/configure.js.map +0 -1
  37. package/esm/controller.js +0 -428
  38. package/esm/controller.js.map +0 -1
  39. package/esm/element.js +0 -472
  40. package/esm/element.js.map +0 -1
@@ -1,225 +1,152 @@
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 _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
-
16
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
-
18
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
-
20
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
-
22
- var _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
- var _lodash = require("lodash");
27
-
9
+ var _lodashEs = require("lodash-es");
28
10
  var _react = _interopRequireDefault(require("react"));
29
-
30
- var _reactDom = _interopRequireDefault(require("react-dom"));
31
-
11
+ var _client = require("react-dom/client");
32
12
  var _configure = _interopRequireDefault(require("./configure"));
33
-
34
13
  var _pieConfigureEvents = require("@pie-framework/pie-configure-events");
35
-
36
14
  var _debug = _interopRequireDefault(require("debug"));
37
-
38
15
  var _defaults = _interopRequireDefault(require("./defaults"));
39
-
40
- var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
41
-
42
- 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; }
43
-
44
- 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; }
45
-
46
- 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); }; }
47
-
48
- 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; } }
49
-
50
- var log = (0, _debug["default"])('pie-elements:match:configure');
51
-
52
- var MatchConfigure = /*#__PURE__*/function (_HTMLElement) {
53
- (0, _inherits2["default"])(MatchConfigure, _HTMLElement);
54
-
55
- var _super = _createSuper(MatchConfigure);
56
-
57
- function MatchConfigure() {
58
- var _this;
59
-
60
- (0, _classCallCheck2["default"])(this, MatchConfigure);
61
- _this = _super.call(this);
62
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "resetModelAfterConfigurationIsSet", function () {
16
+ const log = (0, _debug.default)('pie-elements:match:configure');
17
+ class MatchConfigure extends HTMLElement {
18
+ constructor() {
19
+ super();
20
+ (0, _defineProperty2.default)(this, "resetModelAfterConfigurationIsSet", () => {
63
21
  // In environments that use pie-player-components, model is set before configuration.
64
22
  // This is the reason why sometimes the model gets altered non-reversible
65
23
  // (altered using default configuration instead of client configuration, because at that point client configuration was not set yet)
66
24
  // Therefore, in such environments, we will make sure to keep a modelCopy (initialised in set model) and use it to reset
67
25
  // the model in set configuration (resetModelAfterConfigurationIsSet) if set configuration is ever called
68
- var pieAuthors = document.querySelectorAll('pie-author');
69
- _this.hasPlayerAsParent = Array.from(pieAuthors).some(function (author) {
70
- return author.contains((0, _assertThisInitialized2["default"])(_this));
71
- });
72
-
73
- if (_this.hasPlayerAsParent) {
74
- if (_this._modelCopy) {
75
- _this._model = _this._modelCopy;
26
+ const pieAuthors = document.querySelectorAll('pie-author');
27
+ this.hasPlayerAsParent = Array.from(pieAuthors).some(author => author.contains(this));
28
+ if (this.hasPlayerAsParent) {
29
+ if (this._modelCopy) {
30
+ this._model = this._modelCopy;
76
31
  } else {
77
- delete _this._modelCopy;
32
+ delete this._modelCopy;
78
33
  }
79
34
  }
80
35
  });
81
- _this._model = MatchConfigure.createDefaultModel();
82
- _this._configuration = _defaults["default"].configuration;
83
- return _this;
36
+ this._root = null;
37
+ this._model = MatchConfigure.createDefaultModel();
38
+ this._configuration = _defaults.default.configuration;
84
39
  }
85
-
86
- (0, _createClass2["default"])(MatchConfigure, [{
87
- key: "model",
88
- set: function set(m) {
89
- this._model = MatchConfigure.createDefaultModel(m);
90
- this._modelCopy = (0, _cloneDeep["default"])(this._model);
91
-
92
- this._render();
93
- }
94
- }, {
95
- key: "configuration",
96
- set: function set(c) {
97
- var _newConfiguration$lan,
98
- _this2 = this,
99
- _c$rows;
100
-
101
- var newConfiguration = _objectSpread(_objectSpread({}, _defaults["default"].configuration), c);
102
-
103
- this._configuration = newConfiguration;
104
- this.resetModelAfterConfigurationIsSet(); // if language:enabled is true, then the corresponding default item model should include a language value;
105
- // if it is false, then the language field should be omitted from the item model.
106
- // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,
107
- // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).
108
-
109
- if (newConfiguration !== null && newConfiguration !== void 0 && (_newConfiguration$lan = newConfiguration.language) !== null && _newConfiguration$lan !== void 0 && _newConfiguration$lan.enabled) {
110
- var _newConfiguration$lan2, _newConfiguration$lan3;
111
-
112
- 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) {
113
- this._model.language = newConfiguration === null || newConfiguration === void 0 ? void 0 : newConfiguration.languageChoices.options[0].value;
114
- }
115
- } else if (newConfiguration.language.settings && this._model.language) {
116
- this._configuration.language.enabled = true;
117
-
118
- if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {
119
- this._configuration.languageChoices.options = [];
120
- } // check if the language is already included in the languageChoices.options array
121
- // and if not, then add it.
122
-
123
-
124
- if (!this._configuration.languageChoices.options.find(function (option) {
125
- return option.value === _this2._model.language;
126
- })) {
127
- this._configuration.languageChoices.options.push({
128
- value: this._model.language,
129
- label: this._model.language
130
- });
131
- }
132
- } else {
133
- delete this._model.language;
40
+ set model(m) {
41
+ this._model = MatchConfigure.createDefaultModel(m);
42
+ this._modelCopy = (0, _lodashEs.cloneDeep)(this._model);
43
+ this._render();
44
+ }
45
+ set configuration(c) {
46
+ const newConfiguration = {
47
+ ..._defaults.default.configuration,
48
+ ...c
49
+ };
50
+ this._configuration = newConfiguration;
51
+ this.resetModelAfterConfigurationIsSet();
52
+
53
+ // if language:enabled is true, then the corresponding default item model should include a language value;
54
+ // if it is false, then the language field should be omitted from the item model.
55
+ // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,
56
+ // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).
57
+ if (newConfiguration?.language?.enabled) {
58
+ if (newConfiguration?.languageChoices?.options?.length) {
59
+ this._model.language = newConfiguration?.languageChoices.options[0].value;
134
60
  }
135
- /**
136
- * @Deprecated we added rows.inputConfiguration to handle the plugins in the editable html fields
137
- * if rows.inputConfiguration is not defined we try to default to the old enableImages flag
138
- * This flag 'enableImages' will be removed in the future
139
- */
140
-
141
-
142
- if ((0, _lodash.isEmpty)(c === null || c === void 0 ? void 0 : (_c$rows = c.rows) === null || _c$rows === void 0 ? void 0 : _c$rows.inputConfiguration)) {
143
- var _this$_model;
144
-
145
- (0, _lodash.set)(this._configuration.rows, 'inputConfiguration.image.disabled', !((_this$_model = this._model) !== null && _this$_model !== void 0 && _this$_model.enableImages));
146
- (0, _lodash.set)(this._configuration.rows, 'inputConfiguration.video.disabled', true);
147
- (0, _lodash.set)(this._configuration.rows, 'inputConfiguration.audio.disabled', true);
61
+ } else if (newConfiguration.language.settings && this._model.language) {
62
+ this._configuration.language.enabled = true;
63
+ if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {
64
+ this._configuration.languageChoices.options = [];
148
65
  }
149
66
 
150
- this._render();
151
- }
152
- }, {
153
- key: "onModelChanged",
154
- value: function onModelChanged(model) {
155
- this._model = model;
156
- log('[onModelChanged]: ', this._model);
157
-
158
- this._render();
159
-
160
- this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model));
67
+ // check if the language is already included in the languageChoices.options array
68
+ // and if not, then add it.
69
+ if (!this._configuration.languageChoices.options.find(option => option.value === this._model.language)) {
70
+ this._configuration.languageChoices.options.push({
71
+ value: this._model.language,
72
+ label: this._model.language
73
+ });
74
+ }
75
+ } else {
76
+ delete this._model.language;
161
77
  }
162
- }, {
163
- key: "onConfigurationChanged",
164
- value: function onConfigurationChanged(config) {
165
- this._configuration = config;
166
78
 
167
- this._render();
168
- }
169
79
  /**
170
- *
171
- * @param {done, progress, file} handler
80
+ * @Deprecated we added rows.inputConfiguration to handle the plugins in the editable html fields
81
+ * if rows.inputConfiguration is not defined we try to default to the old enableImages flag
82
+ * This flag 'enableImages' will be removed in the future
172
83
  */
173
84
 
174
- }, {
175
- key: "insertImage",
176
- value: function insertImage(handler) {
177
- this.dispatchEvent(new _pieConfigureEvents.InsertImageEvent(handler));
178
- }
179
- }, {
180
- key: "onDeleteImage",
181
- value: function onDeleteImage(src, done) {
182
- this.dispatchEvent(new _pieConfigureEvents.DeleteImageEvent(src, done));
85
+ if ((0, _lodashEs.isEmpty)(c?.rows?.inputConfiguration)) {
86
+ (0, _lodashEs.set)(this._configuration.rows, 'inputConfiguration.image.disabled', !this._model?.enableImages);
87
+ (0, _lodashEs.set)(this._configuration.rows, 'inputConfiguration.video.disabled', true);
88
+ (0, _lodashEs.set)(this._configuration.rows, 'inputConfiguration.audio.disabled', true);
183
89
  }
184
- }, {
185
- key: "insertSound",
186
- value: function insertSound(handler) {
187
- this.dispatchEvent(new _pieConfigureEvents.InsertSoundEvent(handler));
188
- }
189
- }, {
190
- key: "onDeleteSound",
191
- value: function onDeleteSound(src, done) {
192
- this.dispatchEvent(new _pieConfigureEvents.DeleteSoundEvent(src, done));
193
- }
194
- }, {
195
- key: "_render",
196
- value: function _render() {
197
- if (this._model) {
198
- var el = /*#__PURE__*/_react["default"].createElement(_configure["default"], {
199
- onModelChanged: this.onModelChanged.bind(this),
200
- onConfigurationChanged: this.onConfigurationChanged.bind(this),
201
- model: this._model,
202
- configuration: this._configuration,
203
- imageSupport: {
204
- add: this.insertImage.bind(this),
205
- "delete": this.onDeleteImage.bind(this)
206
- },
207
- uploadSoundSupport: {
208
- add: this.insertSound.bind(this),
209
- "delete": this.onDeleteSound.bind(this)
210
- }
211
- });
90
+ this._render();
91
+ }
92
+ onModelChanged(model) {
93
+ this._model = model;
94
+ log('[onModelChanged]: ', this._model);
95
+ this._render();
96
+ this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model));
97
+ }
98
+ onConfigurationChanged(config) {
99
+ this._configuration = config;
100
+ this._render();
101
+ }
212
102
 
213
- _reactDom["default"].render(el, this);
103
+ /**
104
+ *
105
+ * @param {done, progress, file} handler
106
+ */
107
+ insertImage(handler) {
108
+ this.dispatchEvent(new _pieConfigureEvents.InsertImageEvent(handler));
109
+ }
110
+ onDeleteImage(src, done) {
111
+ this.dispatchEvent(new _pieConfigureEvents.DeleteImageEvent(src, done));
112
+ }
113
+ insertSound(handler) {
114
+ this.dispatchEvent(new _pieConfigureEvents.InsertSoundEvent(handler));
115
+ }
116
+ onDeleteSound(src, done) {
117
+ this.dispatchEvent(new _pieConfigureEvents.DeleteSoundEvent(src, done));
118
+ }
119
+ _render() {
120
+ if (this._model) {
121
+ const el = /*#__PURE__*/_react.default.createElement(_configure.default, {
122
+ onModelChanged: this.onModelChanged.bind(this),
123
+ onConfigurationChanged: this.onConfigurationChanged.bind(this),
124
+ model: this._model,
125
+ configuration: this._configuration,
126
+ imageSupport: {
127
+ add: this.insertImage.bind(this),
128
+ delete: this.onDeleteImage.bind(this)
129
+ },
130
+ uploadSoundSupport: {
131
+ add: this.insertSound.bind(this),
132
+ delete: this.onDeleteSound.bind(this)
133
+ }
134
+ });
135
+ if (!this._root) {
136
+ this._root = (0, _client.createRoot)(this);
214
137
  }
138
+ this._root.render(el);
215
139
  }
216
- }]);
217
- return MatchConfigure;
218
- }( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
219
-
220
- exports["default"] = MatchConfigure;
221
- (0, _defineProperty2["default"])(MatchConfigure, "createDefaultModel", function () {
222
- var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
223
- return _objectSpread(_objectSpread({}, _defaults["default"].model), model);
224
- });
140
+ }
141
+ disconnectedCallback() {
142
+ if (this._root) {
143
+ this._root.unmount();
144
+ }
145
+ }
146
+ }
147
+ exports.default = MatchConfigure;
148
+ (0, _defineProperty2.default)(MatchConfigure, "createDefaultModel", (model = {}) => ({
149
+ ..._defaults.default.model,
150
+ ...model
151
+ }));
225
152
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["log","MatchConfigure","pieAuthors","document","querySelectorAll","hasPlayerAsParent","Array","from","some","author","contains","_modelCopy","_model","createDefaultModel","_configuration","defaultValues","configuration","m","_render","c","newConfiguration","resetModelAfterConfigurationIsSet","language","enabled","languageChoices","options","length","value","settings","find","option","push","label","rows","inputConfiguration","enableImages","model","dispatchEvent","ModelUpdatedEvent","config","handler","InsertImageEvent","src","done","DeleteImageEvent","InsertSoundEvent","DeleteSoundEvent","el","React","createElement","Configure","onModelChanged","bind","onConfigurationChanged","imageSupport","add","insertImage","onDeleteImage","uploadSoundSupport","insertSound","onDeleteSound","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,8BAAN,CAAZ;;IAEqBC,c;;;;;AAMnB,4BAAc;AAAA;;AAAA;AACZ;AADY,0HAasB,YAAM;AACxC;AACA;AACA;AACA;AACA;AACA,UAAMC,UAAU,GAAGC,QAAQ,CAACC,gBAAT,CAA0B,YAA1B,CAAnB;AACA,YAAKC,iBAAL,GAAyBC,KAAK,CAACC,IAAN,CAAWL,UAAX,EAAuBM,IAAvB,CAA4B,UAACC,MAAD;AAAA,eAAYA,MAAM,CAACC,QAAP,gDAAZ;AAAA,OAA5B,CAAzB;;AAEA,UAAI,MAAKL,iBAAT,EAA4B;AAC1B,YAAI,MAAKM,UAAT,EAAqB;AACnB,gBAAKC,MAAL,GAAc,MAAKD,UAAnB;AACD,SAFD,MAEO;AACL,iBAAO,MAAKA,UAAZ;AACD;AACF;AACF,KA7Ba;AAEZ,UAAKC,MAAL,GAAcX,cAAc,CAACY,kBAAf,EAAd;AACA,UAAKC,cAAL,GAAsBC,qBAAcC,aAApC;AAHY;AAIb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKL,MAAL,GAAcX,cAAc,CAACY,kBAAf,CAAkCI,CAAlC,CAAd;AACA,WAAKN,UAAL,GAAkB,2BAAU,KAAKC,MAAf,CAAlB;;AAEA,WAAKM,OAAL;AACD;;;SAoBD,aAAkBC,CAAlB,EAAqB;AAAA;AAAA;AAAA;;AACnB,UAAMC,gBAAgB,mCACjBL,qBAAcC,aADG,GAEjBG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yB;AACvB,WAAKN,aAAL,CAAmB,IAAIS,oCAAJ,CAAqBJ,GAArB,EAA0BC,IAA1B,CAAnB;AACD;;;WAED,mBAAU;AACR,UAAI,KAAK/B,MAAT,EAAiB;AACf,YAAMmC,EAAE,gBAAGC,kBAAMC,aAAN,CAAoBC,qBAApB,EAA+B;AACxCC,UAAAA,cAAc,EAAE,KAAKA,cAAL,CAAoBC,IAApB,CAAyB,IAAzB,CADwB;AAExCC,UAAAA,sBAAsB,EAAE,KAAKA,sBAAL,CAA4BD,IAA5B,CAAiC,IAAjC,CAFgB;AAGxChB,UAAAA,KAAK,EAAE,KAAKxB,MAH4B;AAIxCI,UAAAA,aAAa,EAAE,KAAKF,cAJoB;AAKxCwC,UAAAA,YAAY,EAAE;AACZC,YAAAA,GAAG,EAAE,KAAKC,WAAL,CAAiBJ,IAAjB,CAAsB,IAAtB,CADO;AAEZ,sBAAQ,KAAKK,aAAL,CAAmBL,IAAnB,CAAwB,IAAxB;AAFI,WAL0B;AASxCM,UAAAA,kBAAkB,EAAE;AAClBH,YAAAA,GAAG,EAAE,KAAKI,WAAL,CAAiBP,IAAjB,CAAsB,IAAtB,CADa;AAElB,sBAAQ,KAAKQ,aAAL,CAAmBR,IAAnB,CAAwB,IAAxB;AAFU;AAToB,SAA/B,CAAX;;AAcAS,6BAASC,MAAT,CAAgBf,EAAhB,EAAoB,IAApB;AACD;AACF;;;kDA3IyCgB,W;;;iCAAvB9D,c,wBACS;AAAA,MAACmC,KAAD,uEAAS,EAAT;AAAA,yCACvBrB,qBAAcqB,KADS,GAEvBA,KAFuB;AAAA,C","sourcesContent":["import { isEmpty, set } from 'lodash';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport Configure from './configure';\nimport {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\nimport debug from 'debug';\nimport defaultValues from './defaults';\nimport cloneDeep from 'lodash/cloneDeep';\n\nconst log = debug('pie-elements:match:configure');\n\nexport default class MatchConfigure extends HTMLElement {\n static createDefaultModel = (model = {}) => ({\n ...defaultValues.model,\n ...model,\n });\n\n constructor() {\n super();\n this._model = MatchConfigure.createDefaultModel();\n this._configuration = defaultValues.configuration;\n }\n\n set model(m) {\n this._model = MatchConfigure.createDefaultModel(m);\n this._modelCopy = cloneDeep(this._model);\n\n this._render();\n }\n\n resetModelAfterConfigurationIsSet = () => {\n // In environments that use pie-player-components, model is set before configuration.\n // This is the reason why sometimes the model gets altered non-reversible\n // (altered using default configuration instead of client configuration, because at that point client configuration was not set yet)\n // Therefore, in such environments, we will make sure to keep a modelCopy (initialised in set model) and use it to reset\n // the model in set configuration (resetModelAfterConfigurationIsSet) if set configuration is ever called\n const pieAuthors = document.querySelectorAll('pie-author');\n this.hasPlayerAsParent = Array.from(pieAuthors).some((author) => author.contains(this));\n\n if (this.hasPlayerAsParent) {\n if (this._modelCopy) {\n this._model = this._modelCopy;\n } else {\n delete this._modelCopy;\n }\n }\n };\n\n set configuration(c) {\n const newConfiguration = {\n ...defaultValues.configuration,\n ...c,\n };\n\n this._configuration = newConfiguration;\n\n this.resetModelAfterConfigurationIsSet();\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 /**\n * @Deprecated we added rows.inputConfiguration to handle the plugins in the editable html fields\n * if rows.inputConfiguration is not defined we try to default to the old enableImages flag\n * This flag 'enableImages' will be removed in the future\n */\n \n if (isEmpty(c?.rows?.inputConfiguration)) {\n set(this._configuration.rows, 'inputConfiguration.image.disabled', !this._model?.enableImages);\n set(this._configuration.rows, 'inputConfiguration.video.disabled', true);\n set(this._configuration.rows, 'inputConfiguration.audio.disabled', true);\n }\n\n this._render();\n }\n\n onModelChanged(model) {\n this._model = model;\n log('[onModelChanged]: ', this._model);\n this._render();\n this.dispatchEvent(new ModelUpdatedEvent(this._model));\n }\n\n onConfigurationChanged(config) {\n this._configuration = config;\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 if (this._model) {\n const el = React.createElement(Configure, {\n onModelChanged: this.onModelChanged.bind(this),\n onConfigurationChanged: this.onConfigurationChanged.bind(this),\n model: this._model,\n configuration: this._configuration,\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 ReactDOM.render(el, this);\n }\n }\n}\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":["_lodashEs","require","_react","_interopRequireDefault","_client","_configure","_pieConfigureEvents","_debug","_defaults","log","debug","MatchConfigure","HTMLElement","constructor","_defineProperty2","default","pieAuthors","document","querySelectorAll","hasPlayerAsParent","Array","from","some","author","contains","_modelCopy","_model","_root","createDefaultModel","_configuration","defaultValues","configuration","model","m","cloneDeep","_render","c","newConfiguration","resetModelAfterConfigurationIsSet","language","enabled","languageChoices","options","length","value","settings","find","option","push","label","isEmpty","rows","inputConfiguration","set","enableImages","onModelChanged","dispatchEvent","ModelUpdatedEvent","onConfigurationChanged","config","insertImage","handler","InsertImageEvent","onDeleteImage","src","done","DeleteImageEvent","insertSound","InsertSoundEvent","onDeleteSound","DeleteSoundEvent","el","React","createElement","Configure","bind","imageSupport","add","delete","uploadSoundSupport","createRoot","render","disconnectedCallback","unmount","exports"],"sources":["../src/index.js"],"sourcesContent":["import { isEmpty, set } from 'lodash-es';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport Configure from './configure';\nimport {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\nimport debug from 'debug';\nimport defaultValues from './defaults';\nimport { cloneDeep } from 'lodash-es';\n\nconst log = debug('pie-elements:match:configure');\n\nexport default class MatchConfigure extends HTMLElement {\n static createDefaultModel = (model = {}) => ({\n ...defaultValues.model,\n ...model,\n });\n\n constructor() {\n super();\n this._root = null;\n this._model = MatchConfigure.createDefaultModel();\n this._configuration = defaultValues.configuration;\n }\n\n set model(m) {\n this._model = MatchConfigure.createDefaultModel(m);\n this._modelCopy = cloneDeep(this._model);\n\n this._render();\n }\n\n resetModelAfterConfigurationIsSet = () => {\n // In environments that use pie-player-components, model is set before configuration.\n // This is the reason why sometimes the model gets altered non-reversible\n // (altered using default configuration instead of client configuration, because at that point client configuration was not set yet)\n // Therefore, in such environments, we will make sure to keep a modelCopy (initialised in set model) and use it to reset\n // the model in set configuration (resetModelAfterConfigurationIsSet) if set configuration is ever called\n const pieAuthors = document.querySelectorAll('pie-author');\n this.hasPlayerAsParent = Array.from(pieAuthors).some((author) => author.contains(this));\n\n if (this.hasPlayerAsParent) {\n if (this._modelCopy) {\n this._model = this._modelCopy;\n } else {\n delete this._modelCopy;\n }\n }\n };\n\n set configuration(c) {\n const newConfiguration = {\n ...defaultValues.configuration,\n ...c,\n };\n\n this._configuration = newConfiguration;\n\n this.resetModelAfterConfigurationIsSet();\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 /**\n * @Deprecated we added rows.inputConfiguration to handle the plugins in the editable html fields\n * if rows.inputConfiguration is not defined we try to default to the old enableImages flag\n * This flag 'enableImages' will be removed in the future\n */\n\n if (isEmpty(c?.rows?.inputConfiguration)) {\n set(this._configuration.rows, 'inputConfiguration.image.disabled', !this._model?.enableImages);\n set(this._configuration.rows, 'inputConfiguration.video.disabled', true);\n set(this._configuration.rows, 'inputConfiguration.audio.disabled', true);\n }\n\n this._render();\n }\n\n onModelChanged(model) {\n this._model = model;\n log('[onModelChanged]: ', this._model);\n this._render();\n this.dispatchEvent(new ModelUpdatedEvent(this._model));\n }\n\n onConfigurationChanged(config) {\n this._configuration = config;\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 if (this._model) {\n const el = React.createElement(Configure, {\n onModelChanged: this.onModelChanged.bind(this),\n onConfigurationChanged: this.onConfigurationChanged.bind(this),\n model: this._model,\n configuration: this._configuration,\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 if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(el);\n }\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAOA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,SAAA,GAAAL,sBAAA,CAAAF,OAAA;AAGA,MAAMQ,GAAG,GAAG,IAAAC,cAAK,EAAC,8BAA8B,CAAC;AAElC,MAAMC,cAAc,SAASC,WAAW,CAAC;EAMtDC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA,6CAa0B,MAAM;MACxC;MACA;MACA;MACA;MACA;MACA,MAAMC,UAAU,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,YAAY,CAAC;MAC1D,IAAI,CAACC,iBAAiB,GAAGC,KAAK,CAACC,IAAI,CAACL,UAAU,CAAC,CAACM,IAAI,CAAEC,MAAM,IAAKA,MAAM,CAACC,QAAQ,CAAC,IAAI,CAAC,CAAC;MAEvF,IAAI,IAAI,CAACL,iBAAiB,EAAE;QAC1B,IAAI,IAAI,CAACM,UAAU,EAAE;U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