@pie-element/extended-text-entry 6.5.3 → 6.5.4-next.1016
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +184 -0
- package/configure/CHANGELOG.md +150 -0
- package/configure/lib/defaults.js +35 -2
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +3 -3
- package/configure/lib/main.js +58 -14
- package/configure/lib/main.js.map +1 -1
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +40 -0
- package/controller/lib/index.js +13 -6
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/docs/config-schema.json +127 -0
- package/docs/config-schema.json.md +97 -1
- package/docs/demo/generate.js +5 -2
- package/docs/pie-schema.json +65 -2
- package/docs/pie-schema.json.md +56 -2
- package/lib/index.js +13 -4
- package/lib/index.js.map +1 -1
- package/lib/main.js +51 -22
- package/lib/main.js.map +1 -1
- package/lib/print.js +122 -0
- package/lib/print.js.map +1 -0
- package/package.json +11 -6
- package/module/configure.js +0 -330
- package/module/controller.js +0 -95
- package/module/demo.js +0 -34
- package/module/element.js +0 -562
- package/module/index.html +0 -16
- package/module/manifest.json +0 -14
package/module/element.js
DELETED
|
@@ -1,562 +0,0 @@
|
|
|
1
|
-
import {_dll_material_ui__core_styles, _dll_react, _dll_prop_types, _dll_material_ui__core, _dll_lodash, _dll_pie_lib__render_ui, _dll_pie_lib__math_rendering, _dll_react_dom, _dll_pie_framework__pie_player_events} from "../../../@pie-ui/shared-lib@^4.3.3/module/index.js";
|
|
2
|
-
import {_dll_pie_lib__editable_html} from "../../shared-config@^1.8.13/module/index.js";
|
|
3
|
-
function createCommonjsModule(fn, module) {
|
|
4
|
-
return (module = {
|
|
5
|
-
exports: {}
|
|
6
|
-
}, fn(module, module.exports), module.exports);
|
|
7
|
-
}
|
|
8
|
-
var s = 1000;
|
|
9
|
-
var m = s * 60;
|
|
10
|
-
var h = m * 60;
|
|
11
|
-
var d = h * 24;
|
|
12
|
-
var w = d * 7;
|
|
13
|
-
var y = d * 365.25;
|
|
14
|
-
var ms = function (val, options) {
|
|
15
|
-
options = options || ({});
|
|
16
|
-
var type = typeof val;
|
|
17
|
-
if (type === 'string' && val.length > 0) {
|
|
18
|
-
return parse(val);
|
|
19
|
-
} else if (type === 'number' && isFinite(val)) {
|
|
20
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
21
|
-
}
|
|
22
|
-
throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
|
|
23
|
-
};
|
|
24
|
-
function parse(str) {
|
|
25
|
-
str = String(str);
|
|
26
|
-
if (str.length > 100) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
var match = (/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i).exec(str);
|
|
30
|
-
if (!match) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
var n = parseFloat(match[1]);
|
|
34
|
-
var type = (match[2] || 'ms').toLowerCase();
|
|
35
|
-
switch (type) {
|
|
36
|
-
case 'years':
|
|
37
|
-
case 'year':
|
|
38
|
-
case 'yrs':
|
|
39
|
-
case 'yr':
|
|
40
|
-
case 'y':
|
|
41
|
-
return n * y;
|
|
42
|
-
case 'weeks':
|
|
43
|
-
case 'week':
|
|
44
|
-
case 'w':
|
|
45
|
-
return n * w;
|
|
46
|
-
case 'days':
|
|
47
|
-
case 'day':
|
|
48
|
-
case 'd':
|
|
49
|
-
return n * d;
|
|
50
|
-
case 'hours':
|
|
51
|
-
case 'hour':
|
|
52
|
-
case 'hrs':
|
|
53
|
-
case 'hr':
|
|
54
|
-
case 'h':
|
|
55
|
-
return n * h;
|
|
56
|
-
case 'minutes':
|
|
57
|
-
case 'minute':
|
|
58
|
-
case 'mins':
|
|
59
|
-
case 'min':
|
|
60
|
-
case 'm':
|
|
61
|
-
return n * m;
|
|
62
|
-
case 'seconds':
|
|
63
|
-
case 'second':
|
|
64
|
-
case 'secs':
|
|
65
|
-
case 'sec':
|
|
66
|
-
case 's':
|
|
67
|
-
return n * s;
|
|
68
|
-
case 'milliseconds':
|
|
69
|
-
case 'millisecond':
|
|
70
|
-
case 'msecs':
|
|
71
|
-
case 'msec':
|
|
72
|
-
case 'ms':
|
|
73
|
-
return n;
|
|
74
|
-
default:
|
|
75
|
-
return undefined;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function fmtShort(ms) {
|
|
79
|
-
var msAbs = Math.abs(ms);
|
|
80
|
-
if (msAbs >= d) {
|
|
81
|
-
return Math.round(ms / d) + 'd';
|
|
82
|
-
}
|
|
83
|
-
if (msAbs >= h) {
|
|
84
|
-
return Math.round(ms / h) + 'h';
|
|
85
|
-
}
|
|
86
|
-
if (msAbs >= m) {
|
|
87
|
-
return Math.round(ms / m) + 'm';
|
|
88
|
-
}
|
|
89
|
-
if (msAbs >= s) {
|
|
90
|
-
return Math.round(ms / s) + 's';
|
|
91
|
-
}
|
|
92
|
-
return ms + 'ms';
|
|
93
|
-
}
|
|
94
|
-
function fmtLong(ms) {
|
|
95
|
-
var msAbs = Math.abs(ms);
|
|
96
|
-
if (msAbs >= d) {
|
|
97
|
-
return plural(ms, msAbs, d, 'day');
|
|
98
|
-
}
|
|
99
|
-
if (msAbs >= h) {
|
|
100
|
-
return plural(ms, msAbs, h, 'hour');
|
|
101
|
-
}
|
|
102
|
-
if (msAbs >= m) {
|
|
103
|
-
return plural(ms, msAbs, m, 'minute');
|
|
104
|
-
}
|
|
105
|
-
if (msAbs >= s) {
|
|
106
|
-
return plural(ms, msAbs, s, 'second');
|
|
107
|
-
}
|
|
108
|
-
return ms + ' ms';
|
|
109
|
-
}
|
|
110
|
-
function plural(ms, msAbs, n, name) {
|
|
111
|
-
var isPlural = msAbs >= n * 1.5;
|
|
112
|
-
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
113
|
-
}
|
|
114
|
-
function setup(env) {
|
|
115
|
-
createDebug.debug = createDebug;
|
|
116
|
-
createDebug.default = createDebug;
|
|
117
|
-
createDebug.coerce = coerce;
|
|
118
|
-
createDebug.disable = disable;
|
|
119
|
-
createDebug.enable = enable;
|
|
120
|
-
createDebug.enabled = enabled;
|
|
121
|
-
createDebug.humanize = ms;
|
|
122
|
-
createDebug.destroy = destroy;
|
|
123
|
-
Object.keys(env).forEach(key => {
|
|
124
|
-
createDebug[key] = env[key];
|
|
125
|
-
});
|
|
126
|
-
createDebug.names = [];
|
|
127
|
-
createDebug.skips = [];
|
|
128
|
-
createDebug.formatters = {};
|
|
129
|
-
function selectColor(namespace) {
|
|
130
|
-
let hash = 0;
|
|
131
|
-
for (let i = 0; i < namespace.length; i++) {
|
|
132
|
-
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
133
|
-
hash |= 0;
|
|
134
|
-
}
|
|
135
|
-
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
136
|
-
}
|
|
137
|
-
createDebug.selectColor = selectColor;
|
|
138
|
-
function createDebug(namespace) {
|
|
139
|
-
let prevTime;
|
|
140
|
-
let enableOverride = null;
|
|
141
|
-
function debug(...args) {
|
|
142
|
-
if (!debug.enabled) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
const self = debug;
|
|
146
|
-
const curr = Number(new Date());
|
|
147
|
-
const ms = curr - (prevTime || curr);
|
|
148
|
-
self.diff = ms;
|
|
149
|
-
self.prev = prevTime;
|
|
150
|
-
self.curr = curr;
|
|
151
|
-
prevTime = curr;
|
|
152
|
-
args[0] = createDebug.coerce(args[0]);
|
|
153
|
-
if (typeof args[0] !== 'string') {
|
|
154
|
-
args.unshift('%O');
|
|
155
|
-
}
|
|
156
|
-
let index = 0;
|
|
157
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
158
|
-
if (match === '%%') {
|
|
159
|
-
return '%';
|
|
160
|
-
}
|
|
161
|
-
index++;
|
|
162
|
-
const formatter = createDebug.formatters[format];
|
|
163
|
-
if (typeof formatter === 'function') {
|
|
164
|
-
const val = args[index];
|
|
165
|
-
match = formatter.call(self, val);
|
|
166
|
-
args.splice(index, 1);
|
|
167
|
-
index--;
|
|
168
|
-
}
|
|
169
|
-
return match;
|
|
170
|
-
});
|
|
171
|
-
createDebug.formatArgs.call(self, args);
|
|
172
|
-
const logFn = self.log || createDebug.log;
|
|
173
|
-
logFn.apply(self, args);
|
|
174
|
-
}
|
|
175
|
-
debug.namespace = namespace;
|
|
176
|
-
debug.useColors = createDebug.useColors();
|
|
177
|
-
debug.color = createDebug.selectColor(namespace);
|
|
178
|
-
debug.extend = extend;
|
|
179
|
-
debug.destroy = createDebug.destroy;
|
|
180
|
-
Object.defineProperty(debug, 'enabled', {
|
|
181
|
-
enumerable: true,
|
|
182
|
-
configurable: false,
|
|
183
|
-
get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,
|
|
184
|
-
set: v => {
|
|
185
|
-
enableOverride = v;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
if (typeof createDebug.init === 'function') {
|
|
189
|
-
createDebug.init(debug);
|
|
190
|
-
}
|
|
191
|
-
return debug;
|
|
192
|
-
}
|
|
193
|
-
function extend(namespace, delimiter) {
|
|
194
|
-
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
|
195
|
-
newDebug.log = this.log;
|
|
196
|
-
return newDebug;
|
|
197
|
-
}
|
|
198
|
-
function enable(namespaces) {
|
|
199
|
-
createDebug.save(namespaces);
|
|
200
|
-
createDebug.names = [];
|
|
201
|
-
createDebug.skips = [];
|
|
202
|
-
let i;
|
|
203
|
-
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
|
204
|
-
const len = split.length;
|
|
205
|
-
for (i = 0; i < len; i++) {
|
|
206
|
-
if (!split[i]) {
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
namespaces = split[i].replace(/\*/g, '.*?');
|
|
210
|
-
if (namespaces[0] === '-') {
|
|
211
|
-
createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
|
212
|
-
} else {
|
|
213
|
-
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
function disable() {
|
|
218
|
-
const namespaces = [...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)].join(',');
|
|
219
|
-
createDebug.enable('');
|
|
220
|
-
return namespaces;
|
|
221
|
-
}
|
|
222
|
-
function enabled(name) {
|
|
223
|
-
if (name[name.length - 1] === '*') {
|
|
224
|
-
return true;
|
|
225
|
-
}
|
|
226
|
-
let i;
|
|
227
|
-
let len;
|
|
228
|
-
for ((i = 0, len = createDebug.skips.length); i < len; i++) {
|
|
229
|
-
if (createDebug.skips[i].test(name)) {
|
|
230
|
-
return false;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
for ((i = 0, len = createDebug.names.length); i < len; i++) {
|
|
234
|
-
if (createDebug.names[i].test(name)) {
|
|
235
|
-
return true;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
return false;
|
|
239
|
-
}
|
|
240
|
-
function toNamespace(regexp) {
|
|
241
|
-
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
|
|
242
|
-
}
|
|
243
|
-
function coerce(val) {
|
|
244
|
-
if (val instanceof Error) {
|
|
245
|
-
return val.stack || val.message;
|
|
246
|
-
}
|
|
247
|
-
return val;
|
|
248
|
-
}
|
|
249
|
-
function destroy() {
|
|
250
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
251
|
-
}
|
|
252
|
-
createDebug.enable(createDebug.load());
|
|
253
|
-
return createDebug;
|
|
254
|
-
}
|
|
255
|
-
var common = setup;
|
|
256
|
-
var browser = createCommonjsModule(function (module, exports) {
|
|
257
|
-
exports.formatArgs = formatArgs;
|
|
258
|
-
exports.save = save;
|
|
259
|
-
exports.load = load;
|
|
260
|
-
exports.useColors = useColors;
|
|
261
|
-
exports.storage = localstorage();
|
|
262
|
-
exports.destroy = (() => {
|
|
263
|
-
let warned = false;
|
|
264
|
-
return () => {
|
|
265
|
-
if (!warned) {
|
|
266
|
-
warned = true;
|
|
267
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
})();
|
|
271
|
-
exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
|
|
272
|
-
function useColors() {
|
|
273
|
-
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
274
|
-
return true;
|
|
275
|
-
}
|
|
276
|
-
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
277
|
-
return false;
|
|
278
|
-
}
|
|
279
|
-
return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
280
|
-
}
|
|
281
|
-
function formatArgs(args) {
|
|
282
|
-
args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
|
|
283
|
-
if (!this.useColors) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
const c = 'color: ' + this.color;
|
|
287
|
-
args.splice(1, 0, c, 'color: inherit');
|
|
288
|
-
let index = 0;
|
|
289
|
-
let lastC = 0;
|
|
290
|
-
args[0].replace(/%[a-zA-Z%]/g, match => {
|
|
291
|
-
if (match === '%%') {
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
index++;
|
|
295
|
-
if (match === '%c') {
|
|
296
|
-
lastC = index;
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
args.splice(lastC, 0, c);
|
|
300
|
-
}
|
|
301
|
-
exports.log = console.debug || console.log || (() => {});
|
|
302
|
-
function save(namespaces) {
|
|
303
|
-
try {
|
|
304
|
-
if (namespaces) {
|
|
305
|
-
exports.storage.setItem('debug', namespaces);
|
|
306
|
-
} else {
|
|
307
|
-
exports.storage.removeItem('debug');
|
|
308
|
-
}
|
|
309
|
-
} catch (error) {}
|
|
310
|
-
}
|
|
311
|
-
function load() {
|
|
312
|
-
let r;
|
|
313
|
-
try {
|
|
314
|
-
r = exports.storage.getItem('debug');
|
|
315
|
-
} catch (error) {}
|
|
316
|
-
if (!r && typeof process !== 'undefined' && ('env' in process)) {
|
|
317
|
-
r = process.env.DEBUG;
|
|
318
|
-
}
|
|
319
|
-
return r;
|
|
320
|
-
}
|
|
321
|
-
function localstorage() {
|
|
322
|
-
try {
|
|
323
|
-
return localStorage;
|
|
324
|
-
} catch (error) {}
|
|
325
|
-
}
|
|
326
|
-
module.exports = common(exports);
|
|
327
|
-
const {formatters} = module.exports;
|
|
328
|
-
formatters.j = function (v) {
|
|
329
|
-
try {
|
|
330
|
-
return JSON.stringify(v);
|
|
331
|
-
} catch (error) {
|
|
332
|
-
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
});
|
|
336
|
-
browser.formatArgs;
|
|
337
|
-
browser.save;
|
|
338
|
-
browser.load;
|
|
339
|
-
browser.useColors;
|
|
340
|
-
browser.storage;
|
|
341
|
-
browser.destroy;
|
|
342
|
-
browser.colors;
|
|
343
|
-
browser.log;
|
|
344
|
-
const React = _dll_react;
|
|
345
|
-
const PropTypes = _dll_prop_types;
|
|
346
|
-
const {Typography: Typography} = _dll_material_ui__core;
|
|
347
|
-
const {withStyles: withStyles} = _dll_material_ui__core_styles;
|
|
348
|
-
const {debounce: debounce} = _dll_lodash;
|
|
349
|
-
const {color: color} = _dll_pie_lib__render_ui;
|
|
350
|
-
const {Feedback: Feedback} = _dll_pie_lib__render_ui;
|
|
351
|
-
const {Collapsible: Collapsible} = _dll_pie_lib__render_ui;
|
|
352
|
-
const {renderMath: renderMath} = _dll_pie_lib__math_rendering;
|
|
353
|
-
const EditableHTML = _dll_pie_lib__editable_html;
|
|
354
|
-
const _jsxFileName = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-ui/extended-text-entry/src/main.jsx";
|
|
355
|
-
const log = browser('@pie-ui:extended-text-entry');
|
|
356
|
-
const style = theme => ({
|
|
357
|
-
main: {
|
|
358
|
-
padding: '10px 20px',
|
|
359
|
-
backgroundColor: color.background(),
|
|
360
|
-
color: color.text()
|
|
361
|
-
},
|
|
362
|
-
prompt: {
|
|
363
|
-
width: '100%',
|
|
364
|
-
color: color.text(),
|
|
365
|
-
marginBottom: theme.spacing.unit * 2,
|
|
366
|
-
fontSize: 'inherit'
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
class Main extends React.Component {
|
|
370
|
-
constructor(...args) {
|
|
371
|
-
super(...args);
|
|
372
|
-
Main.prototype.__init.call(this);
|
|
373
|
-
}
|
|
374
|
-
static __initStatic() {
|
|
375
|
-
this.propTypes = {
|
|
376
|
-
onChange: PropTypes.func.isRequired,
|
|
377
|
-
model: PropTypes.object,
|
|
378
|
-
classes: PropTypes.object.isRequired,
|
|
379
|
-
session: PropTypes.shape({
|
|
380
|
-
value: PropTypes.string
|
|
381
|
-
}).isRequired
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
componentDidUpdate() {
|
|
385
|
-
if (this.containerRef) {
|
|
386
|
-
renderMath(this.containerRef);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
__init() {
|
|
390
|
-
this.changeSession = debounce(this.props.onChange, 1500);
|
|
391
|
-
}
|
|
392
|
-
render() {
|
|
393
|
-
const {model, classes, session} = this.props;
|
|
394
|
-
const {dimensions, disabled, feedback, teacherInstructions, mathInput} = model;
|
|
395
|
-
const {value} = session;
|
|
396
|
-
const {width, height} = dimensions || ({});
|
|
397
|
-
const maxHeight = '40vh';
|
|
398
|
-
log('[render] disabled? ', disabled);
|
|
399
|
-
return React.createElement('div', {
|
|
400
|
-
className: classes.main,
|
|
401
|
-
ref: ref => {
|
|
402
|
-
this.containerRef = ref;
|
|
403
|
-
},
|
|
404
|
-
__self: this,
|
|
405
|
-
__source: {
|
|
406
|
-
fileName: _jsxFileName,
|
|
407
|
-
lineNumber: 54
|
|
408
|
-
}
|
|
409
|
-
}, teacherInstructions && React.createElement('div', {
|
|
410
|
-
__self: this,
|
|
411
|
-
__source: {
|
|
412
|
-
fileName: _jsxFileName,
|
|
413
|
-
lineNumber: 62
|
|
414
|
-
}
|
|
415
|
-
}, React.createElement(Collapsible, {
|
|
416
|
-
labels: {
|
|
417
|
-
hidden: 'Show Teacher Instructions',
|
|
418
|
-
visible: 'Hide Teacher Instructions'
|
|
419
|
-
},
|
|
420
|
-
className: classes.collapsible,
|
|
421
|
-
__self: this,
|
|
422
|
-
__source: {
|
|
423
|
-
fileName: _jsxFileName,
|
|
424
|
-
lineNumber: 63
|
|
425
|
-
}
|
|
426
|
-
}, React.createElement('div', {
|
|
427
|
-
dangerouslySetInnerHTML: {
|
|
428
|
-
__html: teacherInstructions
|
|
429
|
-
},
|
|
430
|
-
__self: this,
|
|
431
|
-
__source: {
|
|
432
|
-
fileName: _jsxFileName,
|
|
433
|
-
lineNumber: 67
|
|
434
|
-
}
|
|
435
|
-
})), React.createElement('br', {
|
|
436
|
-
__self: this,
|
|
437
|
-
__source: {
|
|
438
|
-
fileName: _jsxFileName,
|
|
439
|
-
lineNumber: 69
|
|
440
|
-
}
|
|
441
|
-
})), model.prompt && React.createElement(Typography, {
|
|
442
|
-
className: classes.prompt,
|
|
443
|
-
dangerouslySetInnerHTML: {
|
|
444
|
-
__html: model.prompt
|
|
445
|
-
},
|
|
446
|
-
__self: this,
|
|
447
|
-
__source: {
|
|
448
|
-
fileName: _jsxFileName,
|
|
449
|
-
lineNumber: 74
|
|
450
|
-
}
|
|
451
|
-
}), React.createElement(EditableHTML, {
|
|
452
|
-
onChange: this.changeSession,
|
|
453
|
-
markup: value || '',
|
|
454
|
-
width: width && width.toString(),
|
|
455
|
-
minHeight: height && height.toString(),
|
|
456
|
-
maxHeight: maxHeight,
|
|
457
|
-
disabled: disabled,
|
|
458
|
-
highlightShape: true,
|
|
459
|
-
pluginProps: {
|
|
460
|
-
math: {
|
|
461
|
-
disabled: !mathInput,
|
|
462
|
-
keypadMode: this.props.model.equationEditor,
|
|
463
|
-
controlledKeypadMode: false
|
|
464
|
-
},
|
|
465
|
-
video: {
|
|
466
|
-
disabled: true
|
|
467
|
-
},
|
|
468
|
-
audio: {
|
|
469
|
-
disabled: true
|
|
470
|
-
}
|
|
471
|
-
},
|
|
472
|
-
__self: this,
|
|
473
|
-
__source: {
|
|
474
|
-
fileName: _jsxFileName,
|
|
475
|
-
lineNumber: 79
|
|
476
|
-
}
|
|
477
|
-
}), feedback && React.createElement('div', {
|
|
478
|
-
__self: this,
|
|
479
|
-
__source: {
|
|
480
|
-
fileName: _jsxFileName,
|
|
481
|
-
lineNumber: 102
|
|
482
|
-
}
|
|
483
|
-
}, React.createElement('br', {
|
|
484
|
-
__self: this,
|
|
485
|
-
__source: {
|
|
486
|
-
fileName: _jsxFileName,
|
|
487
|
-
lineNumber: 103
|
|
488
|
-
}
|
|
489
|
-
}), React.createElement(Feedback, {
|
|
490
|
-
correctness: "correct",
|
|
491
|
-
feedback: feedback,
|
|
492
|
-
__self: this,
|
|
493
|
-
__source: {
|
|
494
|
-
fileName: _jsxFileName,
|
|
495
|
-
lineNumber: 104
|
|
496
|
-
}
|
|
497
|
-
})));
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
Main.__initStatic();
|
|
501
|
-
var Main$1 = withStyles(style)(Main);
|
|
502
|
-
const React$1 = _dll_react;
|
|
503
|
-
const ReactDOM = _dll_react_dom;
|
|
504
|
-
const {ModelSetEvent: ModelSetEvent} = _dll_pie_framework__pie_player_events;
|
|
505
|
-
const {SessionChangedEvent: SessionChangedEvent} = _dll_pie_framework__pie_player_events;
|
|
506
|
-
const log$1 = browser('@pie-ui:extended-text-entry');
|
|
507
|
-
const domParser = typeof window !== undefined ? new DOMParser() : {
|
|
508
|
-
parseFromString: v => v
|
|
509
|
-
};
|
|
510
|
-
function textContent(value) {
|
|
511
|
-
if (typeof value !== 'string') {
|
|
512
|
-
return undefined;
|
|
513
|
-
}
|
|
514
|
-
try {
|
|
515
|
-
const document = domParser.parseFromString(value, 'text/html');
|
|
516
|
-
const textContent = document.body.textContent;
|
|
517
|
-
return textContent;
|
|
518
|
-
} catch (err) {
|
|
519
|
-
log$1('tried to parse as dom and failed', value);
|
|
520
|
-
return value;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
function isComplete(value) {
|
|
524
|
-
const tc = textContent(value);
|
|
525
|
-
const out = tc !== undefined && tc.length > 0;
|
|
526
|
-
return out;
|
|
527
|
-
}
|
|
528
|
-
class RootExtendedTextEntry extends HTMLElement {
|
|
529
|
-
constructor() {
|
|
530
|
-
super();
|
|
531
|
-
this._model = null;
|
|
532
|
-
this._session = null;
|
|
533
|
-
}
|
|
534
|
-
set model(m) {
|
|
535
|
-
this._model = m;
|
|
536
|
-
this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), false, !!this._model));
|
|
537
|
-
this.render();
|
|
538
|
-
}
|
|
539
|
-
set session(s) {
|
|
540
|
-
this._session = s;
|
|
541
|
-
this.render();
|
|
542
|
-
}
|
|
543
|
-
handleChange(value) {
|
|
544
|
-
this._session.value = value;
|
|
545
|
-
this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(value)));
|
|
546
|
-
}
|
|
547
|
-
connectedCallback() {
|
|
548
|
-
this.render();
|
|
549
|
-
}
|
|
550
|
-
render() {
|
|
551
|
-
if (this._model && this._session) {
|
|
552
|
-
let elem = React$1.createElement(Main$1, {
|
|
553
|
-
model: this._model,
|
|
554
|
-
session: this._session,
|
|
555
|
-
onChange: this.handleChange.bind(this)
|
|
556
|
-
});
|
|
557
|
-
ReactDOM.render(elem, this);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
export default RootExtendedTextEntry;
|
|
562
|
-
export {isComplete, textContent};
|
package/module/index.html
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/extended-text-entry@6.3.7</title>
|
|
6
|
-
<link
|
|
7
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
8
|
-
rel="stylesheet"
|
|
9
|
-
/>
|
|
10
|
-
<script
|
|
11
|
-
type="module"
|
|
12
|
-
src="https://unpkg.com/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
|
|
13
|
-
<script type="module" src="./demo.js"></script>
|
|
14
|
-
</head>
|
|
15
|
-
<body></body>
|
|
16
|
-
</html>
|
package/module/manifest.json
DELETED