@pie-element/math-inline 5.5.6-next.85 → 5.6.1-beta.587
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 +533 -0
- package/configure/CHANGELOG.md +488 -0
- package/configure/lib/configure.js +73 -31
- package/configure/lib/configure.js.map +1 -1
- package/configure/lib/defaults.js +37 -2
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/general-config-block.js +123 -29
- package/configure/lib/general-config-block.js.map +1 -1
- package/configure/lib/index.js +31 -3
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/response.js +90 -37
- package/configure/lib/response.js.map +1 -1
- package/configure/lib/utils.js +18 -1
- package/configure/lib/utils.js.map +1 -1
- package/configure/package.json +7 -8
- package/controller/CHANGELOG.md +164 -0
- package/controller/lib/defaults.js +2 -1
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +148 -131
- package/controller/lib/index.js.map +1 -1
- package/controller/lib/utils.js.map +1 -1
- package/controller/package.json +4 -4
- package/docs/config-schema.json +168 -0
- package/docs/config-schema.json.md +132 -1
- package/docs/demo/config.js +2 -2
- package/docs/demo/generate.js +20 -16
- package/docs/demo/session.js +1 -1
- package/docs/pie-schema.json +128 -3
- package/docs/pie-schema.json.md +107 -3
- package/lib/index.js +7 -4
- package/lib/index.js.map +1 -1
- package/lib/main.js +230 -55
- package/lib/main.js.map +1 -1
- package/lib/print.js +133 -0
- package/lib/print.js.map +1 -0
- package/lib/simple-question-block.js +50 -38
- package/lib/simple-question-block.js.map +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +13 -8
package/docs/pie-schema.json
CHANGED
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
},
|
|
226
226
|
"validation": {
|
|
227
227
|
"description": "Indicates what type of validation should be applied on the response",
|
|
228
|
-
"default": "is
|
|
228
|
+
"default": "is literal",
|
|
229
229
|
"enum": [
|
|
230
230
|
"literal",
|
|
231
231
|
"symbolic"
|
|
@@ -233,6 +233,18 @@
|
|
|
233
233
|
"type": "string",
|
|
234
234
|
"title": "validation"
|
|
235
235
|
},
|
|
236
|
+
"ignoreOrder": {
|
|
237
|
+
"description": "Indicates if the order of expression elements in literal validation can be ignore - whilst the expression is still mathematically correct",
|
|
238
|
+
"default": "is false",
|
|
239
|
+
"type": "boolean",
|
|
240
|
+
"title": "ignoreOrder"
|
|
241
|
+
},
|
|
242
|
+
"allowTrailingZeros": {
|
|
243
|
+
"description": "Indicates the allowance of trailing zeros in expressions - whilst the expression is still mathematically correct",
|
|
244
|
+
"default": "is false",
|
|
245
|
+
"type": "boolean",
|
|
246
|
+
"title": "allowTrailingZeros"
|
|
247
|
+
},
|
|
236
248
|
"answer": {
|
|
237
249
|
"description": "The answer for the question",
|
|
238
250
|
"type": "string",
|
|
@@ -268,9 +280,11 @@
|
|
|
268
280
|
}
|
|
269
281
|
},
|
|
270
282
|
"required": [
|
|
283
|
+
"allowTrailingZeros",
|
|
271
284
|
"alternates",
|
|
272
285
|
"answer",
|
|
273
286
|
"id",
|
|
287
|
+
"ignoreOrder",
|
|
274
288
|
"validation"
|
|
275
289
|
]
|
|
276
290
|
},
|
|
@@ -290,7 +304,7 @@
|
|
|
290
304
|
},
|
|
291
305
|
"validation": {
|
|
292
306
|
"description": "Indicates what type of validation should be applied on the response",
|
|
293
|
-
"default": "is
|
|
307
|
+
"default": "is literal",
|
|
294
308
|
"enum": [
|
|
295
309
|
"literal",
|
|
296
310
|
"symbolic"
|
|
@@ -298,6 +312,18 @@
|
|
|
298
312
|
"type": "string",
|
|
299
313
|
"title": "validation"
|
|
300
314
|
},
|
|
315
|
+
"ignoreOrder": {
|
|
316
|
+
"description": "Indicates if the order of expression elements in literal validation can be ignore - whilst the expression is still mathematically correct",
|
|
317
|
+
"default": "is false",
|
|
318
|
+
"type": "boolean",
|
|
319
|
+
"title": "ignoreOrder"
|
|
320
|
+
},
|
|
321
|
+
"allowTrailingZeros": {
|
|
322
|
+
"description": "Indicates the allowance of trailing zeros in expressions - whilst the expression is still mathematically correct",
|
|
323
|
+
"default": "is false",
|
|
324
|
+
"type": "boolean",
|
|
325
|
+
"title": "allowTrailingZeros"
|
|
326
|
+
},
|
|
301
327
|
"answer": {
|
|
302
328
|
"description": "The answer for the question",
|
|
303
329
|
"type": "string",
|
|
@@ -333,9 +359,11 @@
|
|
|
333
359
|
}
|
|
334
360
|
},
|
|
335
361
|
"required": [
|
|
362
|
+
"allowTrailingZeros",
|
|
336
363
|
"alternates",
|
|
337
364
|
"answer",
|
|
338
365
|
"id",
|
|
366
|
+
"ignoreOrder",
|
|
339
367
|
"validation"
|
|
340
368
|
]
|
|
341
369
|
},
|
|
@@ -344,6 +372,18 @@
|
|
|
344
372
|
"type": "boolean",
|
|
345
373
|
"title": "partialScoring"
|
|
346
374
|
},
|
|
375
|
+
"ignoreOrderDefault": {
|
|
376
|
+
"description": "Indicates the default value for ignoreOrder, in case that it's not set",
|
|
377
|
+
"default": "is false",
|
|
378
|
+
"type": "boolean",
|
|
379
|
+
"title": "ignoreOrderDefault"
|
|
380
|
+
},
|
|
381
|
+
"allowTrailingZerosDefault": {
|
|
382
|
+
"description": "Indicates the default value for allowTrailingZeros, in case that it's not set",
|
|
383
|
+
"default": "is false",
|
|
384
|
+
"type": "boolean",
|
|
385
|
+
"title": "allowTrailingZerosDefault"
|
|
386
|
+
},
|
|
347
387
|
"rationale": {
|
|
348
388
|
"description": "Indicates the value for rationale",
|
|
349
389
|
"type": "string",
|
|
@@ -386,6 +426,11 @@
|
|
|
386
426
|
"type": "boolean",
|
|
387
427
|
"title": "rationaleEnabled"
|
|
388
428
|
},
|
|
429
|
+
"spellCheckEnabled": {
|
|
430
|
+
"description": "Indicates if spellcheck is enabled for the author. Default value is true",
|
|
431
|
+
"type": "boolean",
|
|
432
|
+
"title": "spellCheckEnabled"
|
|
433
|
+
},
|
|
389
434
|
"studentInstructionsEnabled": {
|
|
390
435
|
"description": "Indicates if Student Instructions are enabled",
|
|
391
436
|
"type": "boolean",
|
|
@@ -396,6 +441,26 @@
|
|
|
396
441
|
"type": "boolean",
|
|
397
442
|
"title": "teacherInstructionsEnabled"
|
|
398
443
|
},
|
|
444
|
+
"note": {
|
|
445
|
+
"description": "Indicates the note for the answer",
|
|
446
|
+
"type": "string",
|
|
447
|
+
"title": "note"
|
|
448
|
+
},
|
|
449
|
+
"toolbarEditorPosition": {
|
|
450
|
+
"description": "Indicates the editor's toolbar position which can be 'bottom' or 'top'",
|
|
451
|
+
"default": ": 'bottom'",
|
|
452
|
+
"enum": [
|
|
453
|
+
"bottom",
|
|
454
|
+
"top"
|
|
455
|
+
],
|
|
456
|
+
"type": "string",
|
|
457
|
+
"title": "toolbarEditorPosition"
|
|
458
|
+
},
|
|
459
|
+
"rubricEnabled": {
|
|
460
|
+
"description": "Indicates if Rubric is enabled",
|
|
461
|
+
"type": "boolean",
|
|
462
|
+
"title": "rubricEnabled"
|
|
463
|
+
},
|
|
399
464
|
"id": {
|
|
400
465
|
"description": "Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.",
|
|
401
466
|
"type": "string",
|
|
@@ -408,12 +473,16 @@
|
|
|
408
473
|
}
|
|
409
474
|
},
|
|
410
475
|
"required": [
|
|
476
|
+
"allowTrailingZerosDefault",
|
|
411
477
|
"element",
|
|
412
478
|
"expression",
|
|
413
479
|
"feedbackEnabled",
|
|
414
480
|
"id",
|
|
481
|
+
"ignoreOrderDefault",
|
|
415
482
|
"rationaleEnabled",
|
|
416
483
|
"responses",
|
|
484
|
+
"rubricEnabled",
|
|
485
|
+
"spellCheckEnabled",
|
|
417
486
|
"studentInstructionsEnabled",
|
|
418
487
|
"teacherInstructionsEnabled"
|
|
419
488
|
],
|
|
@@ -434,6 +503,48 @@
|
|
|
434
503
|
}
|
|
435
504
|
}
|
|
436
505
|
},
|
|
506
|
+
"ConfigurePropWithEnabled": {
|
|
507
|
+
"title": "ConfigurePropWithEnabled",
|
|
508
|
+
"type": "object",
|
|
509
|
+
"properties": {
|
|
510
|
+
"settings": {
|
|
511
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
512
|
+
"type": "boolean",
|
|
513
|
+
"title": "settings"
|
|
514
|
+
},
|
|
515
|
+
"label": {
|
|
516
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
517
|
+
"type": "string",
|
|
518
|
+
"title": "label"
|
|
519
|
+
},
|
|
520
|
+
"enabled": {
|
|
521
|
+
"description": "Indicates the value of the item if it affects config-ui\n(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)",
|
|
522
|
+
"type": "boolean",
|
|
523
|
+
"title": "enabled"
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
"ConfigureMaxImageDimensionsProp": {
|
|
528
|
+
"title": "ConfigureMaxImageDimensionsProp",
|
|
529
|
+
"type": "object",
|
|
530
|
+
"properties": {
|
|
531
|
+
"teacherInstructions": {
|
|
532
|
+
"description": "Indicates the max dimension for images in teacher instructions",
|
|
533
|
+
"type": "number",
|
|
534
|
+
"title": "teacherInstructions"
|
|
535
|
+
},
|
|
536
|
+
"prompt": {
|
|
537
|
+
"description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified",
|
|
538
|
+
"type": "number",
|
|
539
|
+
"title": "prompt"
|
|
540
|
+
},
|
|
541
|
+
"rationale": {
|
|
542
|
+
"description": "Indicates the max dimension for images in rationale",
|
|
543
|
+
"type": "number",
|
|
544
|
+
"title": "rationale"
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
},
|
|
437
548
|
"ComplexFeedbackType": {
|
|
438
549
|
"title": "ComplexFeedbackType",
|
|
439
550
|
"type": "object",
|
|
@@ -660,7 +771,7 @@
|
|
|
660
771
|
},
|
|
661
772
|
"validation": {
|
|
662
773
|
"description": "Indicates what type of validation should be applied on the response",
|
|
663
|
-
"default": "is
|
|
774
|
+
"default": "is literal",
|
|
664
775
|
"enum": [
|
|
665
776
|
"literal",
|
|
666
777
|
"symbolic"
|
|
@@ -668,6 +779,18 @@
|
|
|
668
779
|
"type": "string",
|
|
669
780
|
"title": "validation"
|
|
670
781
|
},
|
|
782
|
+
"ignoreOrder": {
|
|
783
|
+
"description": "Indicates if the order of expression elements in literal validation can be ignore - whilst the expression is still mathematically correct",
|
|
784
|
+
"default": "is false",
|
|
785
|
+
"type": "boolean",
|
|
786
|
+
"title": "ignoreOrder"
|
|
787
|
+
},
|
|
788
|
+
"allowTrailingZeros": {
|
|
789
|
+
"description": "Indicates the allowance of trailing zeros in expressions - whilst the expression is still mathematically correct",
|
|
790
|
+
"default": "is false",
|
|
791
|
+
"type": "boolean",
|
|
792
|
+
"title": "allowTrailingZeros"
|
|
793
|
+
},
|
|
671
794
|
"answer": {
|
|
672
795
|
"description": "The answer for the question",
|
|
673
796
|
"type": "string",
|
|
@@ -703,9 +826,11 @@
|
|
|
703
826
|
}
|
|
704
827
|
},
|
|
705
828
|
"required": [
|
|
829
|
+
"allowTrailingZeros",
|
|
706
830
|
"alternates",
|
|
707
831
|
"answer",
|
|
708
832
|
"id",
|
|
833
|
+
"ignoreOrder",
|
|
709
834
|
"validation"
|
|
710
835
|
]
|
|
711
836
|
},
|
package/docs/pie-schema.json.md
CHANGED
|
@@ -81,7 +81,19 @@ This element must be one of the following enum values:
|
|
|
81
81
|
* `literal`
|
|
82
82
|
* `symbolic`
|
|
83
83
|
|
|
84
|
-
Default: `"is
|
|
84
|
+
Default: `"is literal"`
|
|
85
|
+
|
|
86
|
+
## `ignoreOrder` (boolean, required)
|
|
87
|
+
|
|
88
|
+
Indicates if the order of expression elements in literal validation can be ignore - whilst the expression is still mathematically correct
|
|
89
|
+
|
|
90
|
+
Default: `"is false"`
|
|
91
|
+
|
|
92
|
+
## `allowTrailingZeros` (boolean, required)
|
|
93
|
+
|
|
94
|
+
Indicates the allowance of trailing zeros in expressions - whilst the expression is still mathematically correct
|
|
95
|
+
|
|
96
|
+
Default: `"is false"`
|
|
85
97
|
|
|
86
98
|
## `answer` (string, required)
|
|
87
99
|
|
|
@@ -109,7 +121,19 @@ This element must be one of the following enum values:
|
|
|
109
121
|
* `literal`
|
|
110
122
|
* `symbolic`
|
|
111
123
|
|
|
112
|
-
Default: `"is
|
|
124
|
+
Default: `"is literal"`
|
|
125
|
+
|
|
126
|
+
## `ignoreOrder` (boolean, required)
|
|
127
|
+
|
|
128
|
+
Indicates if the order of expression elements in literal validation can be ignore - whilst the expression is still mathematically correct
|
|
129
|
+
|
|
130
|
+
Default: `"is false"`
|
|
131
|
+
|
|
132
|
+
## `allowTrailingZeros` (boolean, required)
|
|
133
|
+
|
|
134
|
+
Indicates the allowance of trailing zeros in expressions - whilst the expression is still mathematically correct
|
|
135
|
+
|
|
136
|
+
Default: `"is false"`
|
|
113
137
|
|
|
114
138
|
## `answer` (string, required)
|
|
115
139
|
|
|
@@ -125,6 +149,18 @@ an object with some alternatives for the correct answers
|
|
|
125
149
|
Indicates if partial scoring is allowed.
|
|
126
150
|
This property is not used yet.
|
|
127
151
|
|
|
152
|
+
# `ignoreOrderDefault` (boolean, required)
|
|
153
|
+
|
|
154
|
+
Indicates the default value for ignoreOrder, in case that it's not set
|
|
155
|
+
|
|
156
|
+
Default: `"is false"`
|
|
157
|
+
|
|
158
|
+
# `allowTrailingZerosDefault` (boolean, required)
|
|
159
|
+
|
|
160
|
+
Indicates the default value for allowTrailingZeros, in case that it's not set
|
|
161
|
+
|
|
162
|
+
Default: `"is false"`
|
|
163
|
+
|
|
128
164
|
# `rationale` (string)
|
|
129
165
|
|
|
130
166
|
Indicates the value for rationale
|
|
@@ -160,6 +196,10 @@ Indicates if Feedback is enabled
|
|
|
160
196
|
|
|
161
197
|
Indicates if Rationale are enabled
|
|
162
198
|
|
|
199
|
+
# `spellCheckEnabled` (boolean, required)
|
|
200
|
+
|
|
201
|
+
Indicates if spellcheck is enabled for the author. Default value is true
|
|
202
|
+
|
|
163
203
|
# `studentInstructionsEnabled` (boolean, required)
|
|
164
204
|
|
|
165
205
|
Indicates if Student Instructions are enabled
|
|
@@ -168,6 +208,25 @@ Indicates if Student Instructions are enabled
|
|
|
168
208
|
|
|
169
209
|
Indicates if Teacher Instructions are enabled
|
|
170
210
|
|
|
211
|
+
# `note` (string)
|
|
212
|
+
|
|
213
|
+
Indicates the note for the answer
|
|
214
|
+
|
|
215
|
+
# `toolbarEditorPosition` (string, enum)
|
|
216
|
+
|
|
217
|
+
Indicates the editor's toolbar position which can be 'bottom' or 'top'
|
|
218
|
+
|
|
219
|
+
This element must be one of the following enum values:
|
|
220
|
+
|
|
221
|
+
* `bottom`
|
|
222
|
+
* `top`
|
|
223
|
+
|
|
224
|
+
Default: `": 'bottom'"`
|
|
225
|
+
|
|
226
|
+
# `rubricEnabled` (boolean, required)
|
|
227
|
+
|
|
228
|
+
Indicates if Rubric is enabled
|
|
229
|
+
|
|
171
230
|
# `id` (string, required)
|
|
172
231
|
|
|
173
232
|
Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
|
|
@@ -194,6 +253,39 @@ Indicates if the item has to be displayed in the Settings Panel
|
|
|
194
253
|
|
|
195
254
|
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
196
255
|
|
|
256
|
+
## `ConfigurePropWithEnabled` (object)
|
|
257
|
+
|
|
258
|
+
Properties of the `ConfigurePropWithEnabled` object:
|
|
259
|
+
|
|
260
|
+
### `settings` (boolean)
|
|
261
|
+
|
|
262
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
263
|
+
|
|
264
|
+
### `label` (string)
|
|
265
|
+
|
|
266
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
267
|
+
|
|
268
|
+
### `enabled` (boolean)
|
|
269
|
+
|
|
270
|
+
Indicates the value of the item if it affects config-ui
|
|
271
|
+
(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
|
|
272
|
+
|
|
273
|
+
## `ConfigureMaxImageDimensionsProp` (object)
|
|
274
|
+
|
|
275
|
+
Properties of the `ConfigureMaxImageDimensionsProp` object:
|
|
276
|
+
|
|
277
|
+
### `teacherInstructions` (number)
|
|
278
|
+
|
|
279
|
+
Indicates the max dimension for images in teacher instructions
|
|
280
|
+
|
|
281
|
+
### `prompt` (number)
|
|
282
|
+
|
|
283
|
+
Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
|
|
284
|
+
|
|
285
|
+
### `rationale` (number)
|
|
286
|
+
|
|
287
|
+
Indicates the max dimension for images in rationale
|
|
288
|
+
|
|
197
289
|
## `ComplexFeedbackType` (object)
|
|
198
290
|
|
|
199
291
|
Properties of the `ComplexFeedbackType` object:
|
|
@@ -260,7 +352,19 @@ This element must be one of the following enum values:
|
|
|
260
352
|
* `literal`
|
|
261
353
|
* `symbolic`
|
|
262
354
|
|
|
263
|
-
Default: `"is
|
|
355
|
+
Default: `"is literal"`
|
|
356
|
+
|
|
357
|
+
### `ignoreOrder` (boolean, required)
|
|
358
|
+
|
|
359
|
+
Indicates if the order of expression elements in literal validation can be ignore - whilst the expression is still mathematically correct
|
|
360
|
+
|
|
361
|
+
Default: `"is false"`
|
|
362
|
+
|
|
363
|
+
### `allowTrailingZeros` (boolean, required)
|
|
364
|
+
|
|
365
|
+
Indicates the allowance of trailing zeros in expressions - whilst the expression is still mathematically correct
|
|
366
|
+
|
|
367
|
+
Default: `"is false"`
|
|
264
368
|
|
|
265
369
|
### `answer` (string, required)
|
|
266
370
|
|
package/lib/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var _defaults = _interopRequireDefault(require("../configure/lib/defaults"));
|
|
|
41
41
|
|
|
42
42
|
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); }; }
|
|
43
43
|
|
|
44
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
44
|
+
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; } }
|
|
45
45
|
|
|
46
46
|
var log = (0, _debug["default"])('pie-ui:math-inline');
|
|
47
47
|
|
|
@@ -56,8 +56,8 @@ var MathInline = /*#__PURE__*/function (_HTMLElement) {
|
|
|
56
56
|
(0, _classCallCheck2["default"])(this, MathInline);
|
|
57
57
|
_this = _super.call(this);
|
|
58
58
|
_this._configuration = _defaults["default"].configuration;
|
|
59
|
-
_this.sessionChangedEventCaller = _lodash["default"].debounce(function (
|
|
60
|
-
_this.dispatchEvent(new _piePlayerEvents.SessionChangedEvent(
|
|
59
|
+
_this.sessionChangedEventCaller = _lodash["default"].debounce(function () {
|
|
60
|
+
_this.dispatchEvent(new _piePlayerEvents.SessionChangedEvent(_this.tagName.toLowerCase(), true));
|
|
61
61
|
}, 1000);
|
|
62
62
|
return _this;
|
|
63
63
|
}
|
|
@@ -72,6 +72,9 @@ var MathInline = /*#__PURE__*/function (_HTMLElement) {
|
|
|
72
72
|
}
|
|
73
73
|
}, {
|
|
74
74
|
key: "session",
|
|
75
|
+
get: function get() {
|
|
76
|
+
return this._session;
|
|
77
|
+
},
|
|
75
78
|
set: function set(s) {
|
|
76
79
|
this._session = s;
|
|
77
80
|
|
|
@@ -92,7 +95,7 @@ var MathInline = /*#__PURE__*/function (_HTMLElement) {
|
|
|
92
95
|
Object.keys(s).map(function (key) {
|
|
93
96
|
_this2._session[key] = s[key];
|
|
94
97
|
});
|
|
95
|
-
this.sessionChangedEventCaller(
|
|
98
|
+
this.sessionChangedEventCaller();
|
|
96
99
|
log('session: ', this._session);
|
|
97
100
|
}
|
|
98
101
|
}, {
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","MathInline","_configuration","defaults","configuration","sessionChangedEventCaller","_","debounce","
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["log","MathInline","_configuration","defaults","configuration","sessionChangedEventCaller","_","debounce","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","m","_model","ModelSetEvent","_render","_session","s","c","Object","keys","map","key","el","React","createElement","Main","model","session","onSessionChange","sessionChanged","bind","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,oBAAN,CAAZ;;IAIqBC,U;;;;;AACnB,wBAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,cAAL,GAAsBC,qBAASC,aAA/B;AACA,UAAKC,yBAAL,GAAiCC,mBAAEC,QAAF,CAAW,YAAM;AAChD,YAAKC,aAAL,CAAmB,IAAIC,oCAAJ,CAAwB,MAAKC,OAAL,CAAaC,WAAb,EAAxB,EAAoD,IAApD,CAAnB;AACD,KAFgC,EAE9B,IAF8B,CAAjC;AAHY;AAMb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKC,MAAL,GAAcD,CAAd;AACA,WAAKJ,aAAL,CAAmB,IAAIM,8BAAJ,CAAkB,KAAKD,MAAvB,EAA+B,IAA/B,EAAqC,CAAC,CAAC,KAAKA,MAA5C,CAAnB;;AACA,WAAKE,OAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAKC,QAAZ;AACD,K;SAPD,aAAYC,CAAZ,EAAe;AACb,WAAKD,QAAL,GAAgBC,CAAhB;;AACA,WAAKF,OAAL;AACD;;;SAMD,aAAkBG,CAAlB,EAAqB;AACnB,WAAKhB,cAAL,GAAsBgB,CAAtB;;AACA,WAAKH,OAAL;AACD;;;WAED,wBAAeE,CAAf,EAAkB;AAAA;;AAChBE,MAAAA,MAAM,CAACC,IAAP,CAAYH,CAAZ,EAAeI,GAAf,CAAmB,UAACC,GAAD,EAAS;AAC1B,QAAA,MAAI,CAACN,QAAL,CAAcM,GAAd,IAAqBL,CAAC,CAACK,GAAD,CAAtB;AACD,OAFD;AAIA,WAAKjB,yBAAL;AACAL,MAAAA,GAAG,CAAC,WAAD,EAAc,KAAKgB,QAAnB,CAAH;AACD;;;WAED,6BAAoB;AAClB,WAAKD,OAAL;AACD;;;WAED,mBAAU;AACR,UAAI,CAAC,KAAKF,MAAN,IAAgB,CAAC,KAAKG,QAA1B,EAAoC;AAClC;AACD;;AAED,UAAMO,EAAE,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,QAAAA,KAAK,EAAE,KAAKd,MADuB;AAEnCe,QAAAA,OAAO,EAAE,KAAKZ,QAFqB;AAGnCZ,QAAAA,aAAa,EAAE,KAAKF,cAHe;AAInC2B,QAAAA,eAAe,EAAE,KAAKC,cAAL,CAAoBC,IAApB,CAAyB,IAAzB;AAJkB,OAA1B,CAAX;;AAOAC,2BAASC,MAAT,CAAgBV,EAAhB,EAAoB,IAApB;AACD;;;kDAvDqCW,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport Main from './main';\nimport debug from 'debug';\nimport _ from 'lodash';\n\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport defaults from '../configure/lib/defaults';\n\nconst log = debug('pie-ui:math-inline');\n\nexport { Main as Component };\n\nexport default class MathInline extends HTMLElement {\n constructor() {\n super();\n this._configuration = defaults.configuration;\n this.sessionChangedEventCaller = _.debounce(() => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), true));\n }, 1000);\n }\n\n set model(m) {\n this._model = m;\n this.dispatchEvent(new ModelSetEvent(this._model, true, !!this._model));\n this._render();\n }\n\n set session(s) {\n this._session = s;\n this._render();\n }\n\n get session() {\n return this._session;\n }\n\n set configuration(c) {\n this._configuration = c;\n this._render();\n }\n\n sessionChanged(s) {\n Object.keys(s).map((key) => {\n this._session[key] = s[key];\n });\n\n this.sessionChangedEventCaller();\n log('session: ', this._session);\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n if (!this._model || !this._session) {\n return;\n }\n\n const el = React.createElement(Main, {\n model: this._model,\n session: this._session,\n configuration: this._configuration,\n onSessionChange: this.sessionChanged.bind(this),\n });\n\n ReactDOM.render(el, this);\n }\n}\n"],"file":"index.js"}
|