@pie-element/extended-text-entry 10.12.1-next.0 → 10.12.1-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.
- package/configure/package.json +1 -1
- package/controller/package.json +1 -1
- package/package.json +3 -3
- package/configure/lib/defaults.js +0 -138
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/index.js +0 -179
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/main.js +0 -311
- package/configure/lib/main.js.map +0 -1
- package/controller/lib/defaults.js +0 -14
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -198
- package/controller/lib/index.js.map +0 -1
- package/lib/index.js +0 -136
- package/lib/index.js.map +0 -1
- package/lib/main.js +0 -216
- package/lib/main.js.map +0 -1
- package/lib/print.js +0 -122
- package/lib/print.js.map +0 -1
- package/module/configure.js +0 -6271
- package/module/controller.js +0 -263
- package/module/demo.js +0 -37
- package/module/element.js +0 -5970
- package/module/index.html +0 -21
- package/module/manifest.json +0 -14
- package/module/print-demo.js +0 -75
- package/module/print.html +0 -18
- package/module/print.js +0 -5927
package/configure/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@material-ui/core": "^3.9.2",
|
|
12
12
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
13
|
-
"@pie-lib/pie-toolbox": "1.16.
|
|
13
|
+
"@pie-lib/pie-toolbox": "1.16.1-next.28",
|
|
14
14
|
"lodash": "^4.17.15",
|
|
15
15
|
"prop-types": "^15.6.2",
|
|
16
16
|
"react": "^16.8.1",
|
package/controller/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/extended-text-entry",
|
|
3
|
-
"version": "10.12.1-next.
|
|
3
|
+
"version": "10.12.1-next.1+b15abe678",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "pie-framework/pie-elements",
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@material-ui/core": "^3.9.2",
|
|
13
13
|
"@material-ui/icons": "^3.0.2",
|
|
14
14
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
15
|
-
"@pie-lib/pie-toolbox": "1.16.
|
|
15
|
+
"@pie-lib/pie-toolbox": "1.16.1-next.28",
|
|
16
16
|
"classnames": "^2.2.5",
|
|
17
17
|
"debug": "^4.1.1",
|
|
18
18
|
"lodash.throttle": "^4.1.1",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"react": "^16.8.1",
|
|
21
21
|
"react-dom": "^16.8.1"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "b15abe678bf81101440641728f578317e11a58c1",
|
|
24
24
|
"scripts": {
|
|
25
25
|
"postpublish": "../../scripts/postpublish"
|
|
26
26
|
},
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _default = {
|
|
8
|
-
model: {
|
|
9
|
-
dimensions: {
|
|
10
|
-
height: 100,
|
|
11
|
-
width: 500
|
|
12
|
-
},
|
|
13
|
-
prompt: 'This is the question prompt',
|
|
14
|
-
mathInput: false,
|
|
15
|
-
spanishInput: false,
|
|
16
|
-
specialInput: false,
|
|
17
|
-
equationEditor: 'Grade 8 - HS',
|
|
18
|
-
feedbackEnabled: false,
|
|
19
|
-
rationaleEnabled: true,
|
|
20
|
-
promptEnabled: true,
|
|
21
|
-
teacherInstructionsEnabled: true,
|
|
22
|
-
studentInstructionsEnabled: true,
|
|
23
|
-
spellCheckEnabled: true,
|
|
24
|
-
playerSpellCheckDisabled: true,
|
|
25
|
-
toolbarEditorPosition: 'bottom'
|
|
26
|
-
},
|
|
27
|
-
configuration: {
|
|
28
|
-
baseInputConfiguration: {
|
|
29
|
-
audio: {
|
|
30
|
-
disabled: false
|
|
31
|
-
},
|
|
32
|
-
video: {
|
|
33
|
-
disabled: false
|
|
34
|
-
},
|
|
35
|
-
image: {
|
|
36
|
-
disabled: false
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
dimensions: {
|
|
40
|
-
settings: true,
|
|
41
|
-
label: 'Text-Entry Display Size'
|
|
42
|
-
},
|
|
43
|
-
spellCheck: {
|
|
44
|
-
label: 'Spellcheck',
|
|
45
|
-
settings: false,
|
|
46
|
-
enabled: true
|
|
47
|
-
},
|
|
48
|
-
playerSpellCheck: {
|
|
49
|
-
label: 'Disable Student Spellcheck',
|
|
50
|
-
settings: true,
|
|
51
|
-
enabled: true
|
|
52
|
-
},
|
|
53
|
-
equationEditor: {
|
|
54
|
-
settings: false,
|
|
55
|
-
label: 'Equation Editor',
|
|
56
|
-
enabled: true
|
|
57
|
-
},
|
|
58
|
-
feedback: {
|
|
59
|
-
settings: true,
|
|
60
|
-
label: 'Feedback'
|
|
61
|
-
},
|
|
62
|
-
mathInput: {
|
|
63
|
-
settings: true,
|
|
64
|
-
label: 'Student response can include math notation',
|
|
65
|
-
enabled: false
|
|
66
|
-
},
|
|
67
|
-
settingsPanelDisabled: false,
|
|
68
|
-
spanishInput: {
|
|
69
|
-
settings: true,
|
|
70
|
-
label: 'Students can insert Spanish',
|
|
71
|
-
enabled: false
|
|
72
|
-
},
|
|
73
|
-
specialInput: {
|
|
74
|
-
settings: true,
|
|
75
|
-
label: 'Students can insert Special Characters',
|
|
76
|
-
enabled: false
|
|
77
|
-
},
|
|
78
|
-
multiple: {
|
|
79
|
-
settings: false,
|
|
80
|
-
label: 'Multiple Parts',
|
|
81
|
-
enabled: false
|
|
82
|
-
},
|
|
83
|
-
studentInstructions: {
|
|
84
|
-
settings: false,
|
|
85
|
-
label: 'Student Instructions'
|
|
86
|
-
},
|
|
87
|
-
prompt: {
|
|
88
|
-
settings: true,
|
|
89
|
-
label: 'Prompt',
|
|
90
|
-
inputConfiguration: {
|
|
91
|
-
audio: {
|
|
92
|
-
disabled: false
|
|
93
|
-
},
|
|
94
|
-
video: {
|
|
95
|
-
disabled: false
|
|
96
|
-
},
|
|
97
|
-
image: {
|
|
98
|
-
disabled: false
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
required: false
|
|
102
|
-
},
|
|
103
|
-
teacherInstructions: {
|
|
104
|
-
settings: true,
|
|
105
|
-
label: 'Teacher Instructions',
|
|
106
|
-
inputConfiguration: {
|
|
107
|
-
audio: {
|
|
108
|
-
disabled: false
|
|
109
|
-
},
|
|
110
|
-
video: {
|
|
111
|
-
disabled: false
|
|
112
|
-
},
|
|
113
|
-
image: {
|
|
114
|
-
disabled: false
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
required: false
|
|
118
|
-
},
|
|
119
|
-
maxImageWidth: {
|
|
120
|
-
teacherInstructions: 300,
|
|
121
|
-
prompt: 300
|
|
122
|
-
},
|
|
123
|
-
maxImageHeight: {
|
|
124
|
-
teacherInstructions: 300,
|
|
125
|
-
prompt: 300
|
|
126
|
-
},
|
|
127
|
-
withRubric: {
|
|
128
|
-
settings: false,
|
|
129
|
-
label: 'Add Rubric'
|
|
130
|
-
},
|
|
131
|
-
mathMlOptions: {
|
|
132
|
-
mmlOutput: false,
|
|
133
|
-
mmlEditing: false
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
exports["default"] = _default;
|
|
138
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["model","dimensions","height","width","prompt","mathInput","spanishInput","specialInput","equationEditor","feedbackEnabled","rationaleEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","spellCheckEnabled","playerSpellCheckDisabled","toolbarEditorPosition","configuration","baseInputConfiguration","audio","disabled","video","image","settings","label","spellCheck","enabled","playerSpellCheck","feedback","settingsPanelDisabled","multiple","studentInstructions","inputConfiguration","required","teacherInstructions","maxImageWidth","maxImageHeight","withRubric","mathMlOptions","mmlOutput","mmlEditing"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,UAAU,EAAE;AACVC,MAAAA,MAAM,EAAE,GADE;AAEVC,MAAAA,KAAK,EAAE;AAFG,KADP;AAKLC,IAAAA,MAAM,EAAE,6BALH;AAMLC,IAAAA,SAAS,EAAE,KANN;AAOLC,IAAAA,YAAY,EAAE,KAPT;AAQLC,IAAAA,YAAY,EAAE,KART;AASLC,IAAAA,cAAc,EAAE,cATX;AAULC,IAAAA,eAAe,EAAE,KAVZ;AAWLC,IAAAA,gBAAgB,EAAE,IAXb;AAYLC,IAAAA,aAAa,EAAE,IAZV;AAaLC,IAAAA,0BAA0B,EAAE,IAbvB;AAcLC,IAAAA,0BAA0B,EAAE,IAdvB;AAeLC,IAAAA,iBAAiB,EAAE,IAfd;AAgBLC,IAAAA,wBAAwB,EAAE,IAhBrB;AAiBLC,IAAAA,qBAAqB,EAAE;AAjBlB,GADM;AAoBbC,EAAAA,aAAa,EAAE;AACbC,IAAAA,sBAAsB,EAAE;AACtBC,MAAAA,KAAK,EAAE;AAAEC,QAAAA,QAAQ,EAAE;AAAZ,OADe;AAEtBC,MAAAA,KAAK,EAAE;AAAED,QAAAA,QAAQ,EAAE;AAAZ,OAFe;AAGtBE,MAAAA,KAAK,EAAE;AAAEF,QAAAA,QAAQ,EAAE;AAAZ;AAHe,KADX;AAMbnB,IAAAA,UAAU,EAAE;AACVsB,MAAAA,QAAQ,EAAE,IADA;AAEVC,MAAAA,KAAK,EAAE;AAFG,KANC;AAUbC,IAAAA,UAAU,EAAE;AACVD,MAAAA,KAAK,EAAE,YADG;AAEVD,MAAAA,QAAQ,EAAE,KAFA;AAGVG,MAAAA,OAAO,EAAE;AAHC,KAVC;AAebC,IAAAA,gBAAgB,EAAE;AAChBH,MAAAA,KAAK,EAAE,4BAD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SAFW;AAGlBE,QAAAA,KAAK,EAAE;AAAEF,UAAAA,QAAQ,EAAE;AAAZ;AAHW,OAHd;AAQNa,MAAAA,QAAQ,EAAE;AARJ,KAtDK;AAgEbC,IAAAA,mBAAmB,EAAE;AACnBX,MAAAA,QAAQ,EAAE,IADS;AAEnBC,MAAAA,KAAK,EAAE,sBAFY;AAGnBQ,MAAAA,kBAAkB,EAAE;AAClBb,QAAAA,KAAK,EAAE;AAAEC,UAAAA,QAAQ,EAAE;AAAZ,SADW;AAElBC,QAAAA,KAAK,EAAE;AAAED,UAAAA,QAAQ,EAAE;AAAZ,SAFW;AAGlBE,QAAAA,KAAK,EAAE;AAAEF,UAAAA,QAAQ,EAAE;AAAZ;AAHW,OAHD;AAQnBa,MAAAA,QAAQ,EAAE;AARS,KAhER;AA0EbE,IAAAA,aAAa,EAAE;AACbD,MAAAA,mBAAmB,EAAE,GADR;AAEb9B,MAAAA,MAAM,EAAE;AAFK,KA1EF;AA8EbgC,IAAAA,cAAc,EAAE;AACdF,MAAAA,mBAAmB,EAAE,GADP;AAEd9B,MAAAA,MAAM,EAAE;AAFM,KA9EH;AAkFbiC,IAAAA,UAAU,EAAE;AACVd,MAAAA,QAAQ,EAAE,KADA;AAEVC,MAAAA,KAAK,EAAE;AAFG,KAlFC;AAsFbc,IAAAA,aAAa,EAAE;AACbC,MAAAA,SAAS,EAAE,KADE;AAEbC,MAAAA,UAAU,EAAE;AAFC;AAtFF;AApBF,C","sourcesContent":["export default {\n model: {\n dimensions: {\n height: 100,\n width: 500,\n },\n prompt: 'This is the question prompt',\n mathInput: false,\n spanishInput: false,\n specialInput: false,\n equationEditor: 'Grade 8 - HS',\n feedbackEnabled: false,\n rationaleEnabled: true,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n spellCheckEnabled: true,\n playerSpellCheckDisabled: true,\n toolbarEditorPosition: 'bottom',\n },\n configuration: {\n baseInputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n dimensions: {\n settings: true,\n label: 'Text-Entry Display Size',\n },\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n playerSpellCheck: {\n label: 'Disable Student Spellcheck',\n settings: true,\n enabled: true,\n },\n equationEditor: {\n settings: false,\n label: 'Equation Editor',\n enabled: true,\n },\n feedback: {\n settings: true,\n label: 'Feedback',\n },\n mathInput: {\n settings: true,\n label: 'Student response can include math notation',\n enabled: false,\n },\n settingsPanelDisabled: false,\n spanishInput: {\n settings: true,\n label: 'Students can insert Spanish',\n enabled: false,\n },\n specialInput: {\n settings: true,\n label: 'Students can insert Special Characters',\n enabled: false,\n },\n multiple: {\n settings: false,\n label: 'Multiple Parts',\n enabled: false,\n },\n studentInstructions: {\n settings: false,\n label: 'Student Instructions',\n },\n prompt: {\n settings: true,\n label: 'Prompt',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n required: false,\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n required: false,\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric',\n },\n mathMlOptions: {\n mmlOutput: false,\n mmlEditing: false,\n },\n },\n};\n"],"file":"defaults.js"}
|
package/configure/lib/index.js
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
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 _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
|
-
|
|
20
|
-
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
21
|
-
|
|
22
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
|
-
var _pieConfigureEvents = require("@pie-framework/pie-configure-events");
|
|
25
|
-
|
|
26
|
-
var _react = _interopRequireDefault(require("react"));
|
|
27
|
-
|
|
28
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
29
|
-
|
|
30
|
-
var _main = _interopRequireDefault(require("./main"));
|
|
31
|
-
|
|
32
|
-
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
33
|
-
|
|
34
|
-
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; }
|
|
35
|
-
|
|
36
|
-
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; }
|
|
37
|
-
|
|
38
|
-
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); }; }
|
|
39
|
-
|
|
40
|
-
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; } }
|
|
41
|
-
|
|
42
|
-
var ExtendedTextEntry = /*#__PURE__*/function (_HTMLElement) {
|
|
43
|
-
(0, _inherits2["default"])(ExtendedTextEntry, _HTMLElement);
|
|
44
|
-
|
|
45
|
-
var _super = _createSuper(ExtendedTextEntry);
|
|
46
|
-
|
|
47
|
-
function ExtendedTextEntry() {
|
|
48
|
-
var _this$_configuration$;
|
|
49
|
-
|
|
50
|
-
var _this;
|
|
51
|
-
|
|
52
|
-
(0, _classCallCheck2["default"])(this, ExtendedTextEntry);
|
|
53
|
-
_this = _super.call(this);
|
|
54
|
-
_this._configuration = _defaults["default"].configuration; // if configuration.withRubric.forceEnabled is true, then we
|
|
55
|
-
// update the configuration (we do not want to display the toggle in the Settings Panel)
|
|
56
|
-
|
|
57
|
-
if ((_this$_configuration$ = _this._configuration.withRubric) !== null && _this$_configuration$ !== void 0 && _this$_configuration$.forceEnabled) {
|
|
58
|
-
_this._configuration.withRubric.settings = false;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
_this._model = ExtendedTextEntry.createDefaultModel({}, _this._configuration);
|
|
62
|
-
return _this;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
(0, _createClass2["default"])(ExtendedTextEntry, [{
|
|
66
|
-
key: "model",
|
|
67
|
-
set: function set(m) {
|
|
68
|
-
this._model = ExtendedTextEntry.createDefaultModel(m, this._configuration);
|
|
69
|
-
this.render();
|
|
70
|
-
}
|
|
71
|
-
}, {
|
|
72
|
-
key: "configuration",
|
|
73
|
-
set: function set(c) {
|
|
74
|
-
this._configuration = _objectSpread(_objectSpread({}, _defaults["default"].configuration), c);
|
|
75
|
-
|
|
76
|
-
var _ref = c || {},
|
|
77
|
-
_ref$withRubric = _ref.withRubric,
|
|
78
|
-
withRubric = _ref$withRubric === void 0 ? {} : _ref$withRubric; // if configuration.withRubric.forceEnabled is true, then we update the model (rubricEnabled)
|
|
79
|
-
// without triggering the Model Updated event (for more details, check documentation)
|
|
80
|
-
// and also update the configuration (we do not want to display the toggle in the Settings Panel)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (withRubric !== null && withRubric !== void 0 && withRubric.forceEnabled) {
|
|
84
|
-
this._configuration.withRubric.settings = false;
|
|
85
|
-
|
|
86
|
-
if (!this._model.rubricEnabled) {
|
|
87
|
-
this._model.rubricEnabled = true;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
this.render();
|
|
92
|
-
}
|
|
93
|
-
}, {
|
|
94
|
-
key: "onModelChanged",
|
|
95
|
-
value: function onModelChanged(m) {
|
|
96
|
-
this._model = m;
|
|
97
|
-
this.render();
|
|
98
|
-
this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model, false));
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
key: "onConfigurationChanged",
|
|
102
|
-
value: function onConfigurationChanged(c) {
|
|
103
|
-
this._configuration = _objectSpread(_objectSpread({}, _defaults["default"].configuration), c);
|
|
104
|
-
|
|
105
|
-
if (this._model) {
|
|
106
|
-
this.onModelChanged(this._model);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
this.render();
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
*
|
|
113
|
-
* @param {done, progress, file} handler
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
}, {
|
|
117
|
-
key: "insertImage",
|
|
118
|
-
value: function insertImage(handler) {
|
|
119
|
-
this.dispatchEvent(new _pieConfigureEvents.InsertImageEvent(handler));
|
|
120
|
-
}
|
|
121
|
-
}, {
|
|
122
|
-
key: "onDeleteImage",
|
|
123
|
-
value: function onDeleteImage(src, done) {
|
|
124
|
-
this.dispatchEvent(new _pieConfigureEvents.DeleteImageEvent(src, done));
|
|
125
|
-
}
|
|
126
|
-
}, {
|
|
127
|
-
key: "insertSound",
|
|
128
|
-
value: function insertSound(handler) {
|
|
129
|
-
this.dispatchEvent(new _pieConfigureEvents.InsertSoundEvent(handler));
|
|
130
|
-
}
|
|
131
|
-
}, {
|
|
132
|
-
key: "onDeleteSound",
|
|
133
|
-
value: function onDeleteSound(src, done) {
|
|
134
|
-
this.dispatchEvent(new _pieConfigureEvents.DeleteSoundEvent(src, done));
|
|
135
|
-
}
|
|
136
|
-
}, {
|
|
137
|
-
key: "render",
|
|
138
|
-
value: function render() {
|
|
139
|
-
if (this._model) {
|
|
140
|
-
var element = /*#__PURE__*/_react["default"].createElement(_main["default"], {
|
|
141
|
-
model: this._model,
|
|
142
|
-
configuration: this._configuration,
|
|
143
|
-
onModelChanged: this.onModelChanged.bind(this),
|
|
144
|
-
onConfigurationChanged: this.onConfigurationChanged.bind(this),
|
|
145
|
-
imageSupport: {
|
|
146
|
-
add: this.insertImage.bind(this),
|
|
147
|
-
"delete": this.onDeleteImage.bind(this)
|
|
148
|
-
},
|
|
149
|
-
uploadSoundSupport: {
|
|
150
|
-
add: this.insertSound.bind(this),
|
|
151
|
-
"delete": this.onDeleteSound.bind(this)
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
_reactDom["default"].render(element, this);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}]);
|
|
159
|
-
return ExtendedTextEntry;
|
|
160
|
-
}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
|
|
161
|
-
|
|
162
|
-
exports["default"] = ExtendedTextEntry;
|
|
163
|
-
(0, _defineProperty2["default"])(ExtendedTextEntry, "createDefaultModel", function () {
|
|
164
|
-
var _config$withRubric;
|
|
165
|
-
|
|
166
|
-
var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
167
|
-
var config = arguments.length > 1 ? arguments[1] : undefined;
|
|
168
|
-
|
|
169
|
-
var defaultModel = _objectSpread(_objectSpread({}, _defaults["default"].model), model); // if configuration.withRubric.forceEnabled is true, then we update the model (rubricEnabled)
|
|
170
|
-
// without triggering the Model Updated event (for more details, check documentation)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (config !== null && config !== void 0 && (_config$withRubric = config.withRubric) !== null && _config$withRubric !== void 0 && _config$withRubric.forceEnabled && !defaultModel.rubricEnabled) {
|
|
174
|
-
defaultModel.rubricEnabled = true;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return defaultModel;
|
|
178
|
-
});
|
|
179
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["ExtendedTextEntry","_configuration","defaults","configuration","withRubric","forceEnabled","settings","_model","createDefaultModel","m","render","c","rubricEnabled","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","config","defaultModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAOA;;AACA;;AACA;;AAEA;;;;;;;;;;IAEqBA,iB;;;;;AAiBnB,+BAAc;AAAA;;AAAA;;AAAA;AACZ;AACA,UAAKC,cAAL,GAAsBC,qBAASC,aAA/B,CAFY,CAIZ;AACA;;AACA,iCAAI,MAAKF,cAAL,CAAoBG,UAAxB,kDAAI,sB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YAAwB;AAAA;;AAAA,MAAvB2B,KAAuB,uEAAf,EAAe;AAAA,MAAXY,MAAW;;AAClD,MAAMC,YAAY,mCACbtC,qBAASyB,KADI,GAEbA,KAFa,CAAlB,CADkD,CAMlD;AACA;;;AACA,MAAIY,MAAM,SAAN,IAAAA,MAAM,WAAN,0BAAAA,MAAM,CAAEnC,UAAR,kEAAoBC,YAApB,IAAoC,CAACmC,YAAY,CAAC5B,aAAtD,EAAqE;AACnE4B,IAAAA,YAAY,CAAC5B,aAAb,GAA6B,IAA7B;AACD;;AAED,SAAO4B,YAAP;AACD,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 = {}, config) => {\n const defaultModel = {\n ...defaults.model,\n ...model,\n };\n\n // if configuration.withRubric.forceEnabled is true, then we update the model (rubricEnabled)\n // without triggering the Model Updated event (for more details, check documentation)\n if (config?.withRubric?.forceEnabled && !defaultModel.rubricEnabled) {\n defaultModel.rubricEnabled = true;\n }\n\n return defaultModel;\n };\n\n\n constructor() {\n super();\n this._configuration = defaults.configuration;\n\n // if configuration.withRubric.forceEnabled is true, then we\n // update the configuration (we do not want to display the toggle in the Settings Panel)\n if (this._configuration.withRubric?.forceEnabled) {\n this._configuration.withRubric.settings = false;\n }\n\n this._model = ExtendedTextEntry.createDefaultModel({}, this._configuration);\n }\n\n set model(m) {\n this._model = ExtendedTextEntry.createDefaultModel(m, this._configuration);\n this.render();\n }\n\n set configuration(c) {\n this._configuration = {\n ...defaults.configuration,\n ...c,\n };\n\n const { withRubric = {} } = c || {};\n\n // if configuration.withRubric.forceEnabled is true, then we update the model (rubricEnabled)\n // without triggering the Model Updated event (for more details, check documentation)\n // and also update the configuration (we do not want to display the toggle in the Settings Panel)\n if (withRubric?.forceEnabled) {\n this._configuration.withRubric.settings = false;\n\n if (!this._model.rubricEnabled) {\n this._model.rubricEnabled = true;\n }\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\n ReactDOM.render(element, this);\n }\n }\n}\n"],"file":"index.js"}
|