@pie-element/extended-text-entry 8.4.0 → 8.4.1-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configure/lib/index.js +0 -43
- package/configure/lib/index.js.map +1 -1
- package/docs/config-schema.json +27 -1
- package/docs/config-schema.json.md +21 -1
- package/docs/pie-schema.json +21 -0
- package/docs/pie-schema.json.md +16 -0
- package/package.json +2 -2
package/configure/lib/index.js
CHANGED
|
@@ -7,16 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
11
|
|
|
16
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
13
|
|
|
18
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
19
|
-
|
|
20
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
15
|
|
|
22
16
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -55,34 +49,6 @@ var ExtendedTextEntry = /*#__PURE__*/function (_HTMLElement) {
|
|
|
55
49
|
|
|
56
50
|
(0, _classCallCheck2["default"])(this, ExtendedTextEntry);
|
|
57
51
|
_this = _super.call(this);
|
|
58
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "verifyRubric", /*#__PURE__*/function () {
|
|
59
|
-
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(c) {
|
|
60
|
-
var _ref2, withRubric;
|
|
61
|
-
|
|
62
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
63
|
-
while (1) {
|
|
64
|
-
switch (_context.prev = _context.next) {
|
|
65
|
-
case 0:
|
|
66
|
-
_ref2 = c || {}, withRubric = _ref2.withRubric;
|
|
67
|
-
|
|
68
|
-
if (withRubric.enabled && !_this._model.rubricEnabled) {
|
|
69
|
-
_this._model.rubricEnabled = true;
|
|
70
|
-
|
|
71
|
-
_this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(_this._model));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
case 2:
|
|
75
|
-
case "end":
|
|
76
|
-
return _context.stop();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}, _callee);
|
|
80
|
-
}));
|
|
81
|
-
|
|
82
|
-
return function (_x) {
|
|
83
|
-
return _ref.apply(this, arguments);
|
|
84
|
-
};
|
|
85
|
-
}());
|
|
86
52
|
_this._model = ExtendedTextEntry.createDefaultModel();
|
|
87
53
|
_this._configuration = _defaults["default"].configuration;
|
|
88
54
|
return _this;
|
|
@@ -98,7 +64,6 @@ var ExtendedTextEntry = /*#__PURE__*/function (_HTMLElement) {
|
|
|
98
64
|
key: "configuration",
|
|
99
65
|
set: function set(c) {
|
|
100
66
|
this._configuration = _objectSpread(_objectSpread({}, _defaults["default"].configuration), c);
|
|
101
|
-
this.verifyRubric(this._configuration);
|
|
102
67
|
this.render();
|
|
103
68
|
}
|
|
104
69
|
}, {
|
|
@@ -114,14 +79,6 @@ var ExtendedTextEntry = /*#__PURE__*/function (_HTMLElement) {
|
|
|
114
79
|
this._configuration = _objectSpread(_objectSpread({}, _defaults["default"].configuration), c);
|
|
115
80
|
|
|
116
81
|
if (this._model) {
|
|
117
|
-
var _ref3 = c || {},
|
|
118
|
-
_ref3$withRubric = _ref3.withRubric,
|
|
119
|
-
withRubric = _ref3$withRubric === void 0 ? {} : _ref3$withRubric;
|
|
120
|
-
|
|
121
|
-
if (withRubric.enabled && !this._model.rubricEnabled) {
|
|
122
|
-
this._model.rubricEnabled = true;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
82
|
this.onModelChanged(this._model);
|
|
126
83
|
}
|
|
127
84
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["ExtendedTextEntry","
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["ExtendedTextEntry","_model","createDefaultModel","_configuration","defaults","configuration","m","render","c","dispatchEvent","ModelUpdatedEvent","onModelChanged","handler","InsertImageEvent","src","done","DeleteImageEvent","InsertSoundEvent","DeleteSoundEvent","element","React","createElement","Main","model","bind","onConfigurationChanged","imageSupport","add","insertImage","onDeleteImage","uploadSoundSupport","insertSound","onDeleteSound","ReactDOM","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAOA;;AACA;;AACA;;AAEA;;;;;;;;;;IAEqBA,iB;;;;;AAMnB,+BAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,MAAL,GAAcD,iBAAiB,CAACE,kBAAlB,EAAd;AACA,UAAKC,cAAL,GAAsBC,qBAASC,aAA/B;AAHY;AAIb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKL,MAAL,GAAcD,iBAAiB,CAACE,kBAAlB,CAAqCI,CAArC,CAAd;AACA,WAAKC,MAAL;AACD;;;SAED,aAAkBC,CAAlB,EAAqB;AACnB,WAAKL,cAAL,mCACKC,qBAASC,aADd,GAEKG,CAFL;AAKA,WAAKD,MAAL;AACD;;;WAED,wBAAeD,CAAf,EAAkB;AAChB,WAAKL,MAAL,GAAcK,CAAd;AACA,WAAKC,MAAL;AACA,WAAKE,aAAL,CAAmB,IAAIC,qCAAJ,CAAsB,KAAKT,MAA3B,EAAmC,KAAnC,CAAnB;AACD;;;WAED,gCAAuBO,CAAvB,EAA0B;AACxB,WAAKL,cAAL,mCACKC,qBAASC,aADd,GAEKG,CAFL;;AAKA,UAAI,K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,IAAnB,CAAwB,IAAxB;AAFU;AAToB,SAA1B,CAAhB;;AAcAS,6BAAS1B,MAAT,CAAgBY,OAAhB,EAAyB,IAAzB;AACD;AACF;;;kDAnF4Ce,W;;;iCAA1BlC,iB,wBACS;AAAA,MAACuB,KAAD,uEAAS,EAAT;AAAA,yCACvBnB,qBAASmB,KADc,GAEvBA,KAFuB;AAAA,C","sourcesContent":["import {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport Main from './main';\n\nimport defaults from './defaults';\n\nexport default class ExtendedTextEntry extends HTMLElement {\n static createDefaultModel = (model = {}) => ({\n ...defaults.model,\n ...model\n });\n\n constructor() {\n super();\n this._model = ExtendedTextEntry.createDefaultModel();\n this._configuration = defaults.configuration;\n }\n\n set model(m) {\n this._model = ExtendedTextEntry.createDefaultModel(m);\n this.render();\n }\n\n set configuration(c) {\n this._configuration = {\n ...defaults.configuration,\n ...c,\n };\n\n this.render();\n }\n\n onModelChanged(m) {\n this._model = m;\n this.render();\n this.dispatchEvent(new ModelUpdatedEvent(this._model, false));\n }\n\n onConfigurationChanged(c) {\n this._configuration = {\n ...defaults.configuration,\n ...c,\n };\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\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 element = 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 ReactDOM.render(element, this);\n }\n }\n}\n"],"file":"index.js"}
|
package/docs/config-schema.json
CHANGED
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
218
|
"withRubric": {
|
|
219
|
-
"title": "
|
|
219
|
+
"title": "ConfigureWithForceProp",
|
|
220
220
|
"type": "object",
|
|
221
221
|
"properties": {
|
|
222
222
|
"settings": {
|
|
@@ -228,6 +228,11 @@
|
|
|
228
228
|
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
229
229
|
"type": "string",
|
|
230
230
|
"title": "label"
|
|
231
|
+
},
|
|
232
|
+
"forceEnabled": {
|
|
233
|
+
"description": "Indicates the value for the toggle; if true, this property will not be visible in Settings Panel",
|
|
234
|
+
"type": "boolean",
|
|
235
|
+
"title": "forceEnabled"
|
|
231
236
|
}
|
|
232
237
|
}
|
|
233
238
|
},
|
|
@@ -308,6 +313,27 @@
|
|
|
308
313
|
"title": "rationale"
|
|
309
314
|
}
|
|
310
315
|
}
|
|
316
|
+
},
|
|
317
|
+
"ConfigureWithForceProp": {
|
|
318
|
+
"title": "ConfigureWithForceProp",
|
|
319
|
+
"type": "object",
|
|
320
|
+
"properties": {
|
|
321
|
+
"settings": {
|
|
322
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
323
|
+
"type": "boolean",
|
|
324
|
+
"title": "settings"
|
|
325
|
+
},
|
|
326
|
+
"label": {
|
|
327
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
328
|
+
"type": "string",
|
|
329
|
+
"title": "label"
|
|
330
|
+
},
|
|
331
|
+
"forceEnabled": {
|
|
332
|
+
"description": "Indicates the value for the toggle; if true, this property will not be visible in Settings Panel",
|
|
333
|
+
"type": "boolean",
|
|
334
|
+
"title": "forceEnabled"
|
|
335
|
+
}
|
|
336
|
+
}
|
|
311
337
|
}
|
|
312
338
|
},
|
|
313
339
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
@@ -175,6 +175,10 @@ Indicates if the item has to be displayed in the Settings Panel
|
|
|
175
175
|
|
|
176
176
|
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
177
177
|
|
|
178
|
+
## `forceEnabled` (boolean)
|
|
179
|
+
|
|
180
|
+
Indicates the value for the toggle; if true, this property will not be visible in Settings Panel
|
|
181
|
+
|
|
178
182
|
# `showPrompt` (boolean)
|
|
179
183
|
|
|
180
184
|
Determines whether prompt field will be displayed or not
|
|
@@ -242,4 +246,20 @@ Indicates the max dimension for images in prompt - this is also the default dime
|
|
|
242
246
|
|
|
243
247
|
### `rationale` (number)
|
|
244
248
|
|
|
245
|
-
Indicates the max dimension for images in rationale
|
|
249
|
+
Indicates the max dimension for images in rationale
|
|
250
|
+
|
|
251
|
+
## `ConfigureWithForceProp` (object)
|
|
252
|
+
|
|
253
|
+
Properties of the `ConfigureWithForceProp` object:
|
|
254
|
+
|
|
255
|
+
### `settings` (boolean)
|
|
256
|
+
|
|
257
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
258
|
+
|
|
259
|
+
### `label` (string)
|
|
260
|
+
|
|
261
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
262
|
+
|
|
263
|
+
### `forceEnabled` (boolean)
|
|
264
|
+
|
|
265
|
+
Indicates the value for the toggle; if true, this property will not be visible in Settings Panel
|
package/docs/pie-schema.json
CHANGED
|
@@ -235,6 +235,27 @@
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
},
|
|
238
|
+
"ConfigureWithForceProp": {
|
|
239
|
+
"title": "ConfigureWithForceProp",
|
|
240
|
+
"type": "object",
|
|
241
|
+
"properties": {
|
|
242
|
+
"settings": {
|
|
243
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
244
|
+
"type": "boolean",
|
|
245
|
+
"title": "settings"
|
|
246
|
+
},
|
|
247
|
+
"label": {
|
|
248
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
249
|
+
"type": "string",
|
|
250
|
+
"title": "label"
|
|
251
|
+
},
|
|
252
|
+
"forceEnabled": {
|
|
253
|
+
"description": "Indicates the value for the toggle; if true, this property will not be visible in Settings Panel",
|
|
254
|
+
"type": "boolean",
|
|
255
|
+
"title": "forceEnabled"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
238
259
|
"Dimensions": {
|
|
239
260
|
"title": "Dimensions",
|
|
240
261
|
"type": "object",
|
package/docs/pie-schema.json.md
CHANGED
|
@@ -189,6 +189,22 @@ Indicates the max dimension for images in prompt - this is also the default dime
|
|
|
189
189
|
|
|
190
190
|
Indicates the max dimension for images in rationale
|
|
191
191
|
|
|
192
|
+
## `ConfigureWithForceProp` (object)
|
|
193
|
+
|
|
194
|
+
Properties of the `ConfigureWithForceProp` object:
|
|
195
|
+
|
|
196
|
+
### `settings` (boolean)
|
|
197
|
+
|
|
198
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
199
|
+
|
|
200
|
+
### `label` (string)
|
|
201
|
+
|
|
202
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
203
|
+
|
|
204
|
+
### `forceEnabled` (boolean)
|
|
205
|
+
|
|
206
|
+
Indicates the value for the toggle; if true, this property will not be visible in Settings Panel
|
|
207
|
+
|
|
192
208
|
## `Dimensions` (object)
|
|
193
209
|
|
|
194
210
|
Properties of the `Dimensions` object:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/extended-text-entry",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.1-next.4+660136116",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "pie-framework/pie-elements",
|
|
6
6
|
"publishConfig": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"react": "^16.8.1",
|
|
23
23
|
"react-dom": "^16.8.1"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "660136116e3b565c5fbd41c9d5f9d40294057733",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"postpublish": "../../scripts/postpublish"
|
|
28
28
|
},
|