@pie-element/math-inline 8.4.1-next.7 → 8.4.2-next.0

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/module/element.js CHANGED
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_pie_lib__pie_toolbox_math_rendering, _dll_lodash, _dll_pie_framework__mathquill, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.1.1/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.8.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_pie_lib__pie_toolbox_math_rendering, _dll_lodash, _dll_pie_framework__mathquill, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.2.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.9.0/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -11572,10 +11572,11 @@ var en = {};
11572
11572
  primaryCorrectWithAlternates: 'Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct.'
11573
11573
  },
11574
11574
  multipleChoice: {
11575
- minSelections_one: 'This question requires at least {{minSelections}} answer.',
11576
- minSelections_other: 'This question requires at least {{minSelections}} answers.',
11575
+ minSelections: 'Select at least {{minSelections}}.',
11577
11576
  maxSelections_one: 'Only {{maxSelections}} answer is allowed.',
11578
- maxSelections_other: 'Only {{maxSelections}} answers are allowed.'
11577
+ maxSelections_other: 'Only {{maxSelections}} answers are allowed.',
11578
+ minmaxSelections_equal: 'Select {{minSelections}}.',
11579
+ minmaxSelections_range: 'Select between {{minSelections}} and {{maxSelections}}.'
11579
11580
  },
11580
11581
  selectText: {
11581
11582
  correctAnswerSelected: 'Correct answer selected',
@@ -11665,10 +11666,11 @@ var es = {};
11665
11666
  primaryCorrectWithAlternates: 'Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas.'
11666
11667
  },
11667
11668
  multipleChoice: {
11668
- minSelections_one: 'Esta pregunta requiere al menos {{minSelections}} respuesta.',
11669
- minSelections_other: 'Esta pregunta requiere al menos {{minSelections}} respuestas.',
11669
+ minSelections: 'Seleccione al menos {{minSelections}}.',
11670
11670
  maxSelections_one: 'Sólo se permite {{maxSelections}} respuesta.',
11671
- maxSelections_other: 'Sólo se permiten {{maxSelections}} respuestas.'
11671
+ maxSelections_other: 'Sólo se permiten {{maxSelections}} respuestas.',
11672
+ minmaxSelections_equal: 'Seleccione {{minSelections}}.',
11673
+ minmaxSelections_range: 'Seleccione entre {{minSelections}} y {{maxSelections}}.'
11672
11674
  },
11673
11675
  selectText: {
11674
11676
  correctAnswerSelected: 'Respuesta correcta seleccionada',
@@ -11837,6 +11839,16 @@ function generateAdditionalKeys(keyData = []) {
11837
11839
  label: key
11838
11840
  }));
11839
11841
  }
11842
+ function isChildOfCurrentPieElement(child, parent) {
11843
+ let node = child;
11844
+ while (node !== null) {
11845
+ if (node === parent) {
11846
+ return true;
11847
+ }
11848
+ node = node.parentNode;
11849
+ }
11850
+ return false;
11851
+ }
11840
11852
  function getKeyPadWidth(additionalKeys = [], equationEditor) {
11841
11853
  return Math.floor(additionalKeys.length / 5) * 30 + (equationEditor === 'miscellaneous' ? 600 : 500);
11842
11854
  }
@@ -12062,10 +12074,14 @@ class Main extends React$1.Component {
12062
12074
  }
12063
12075
  __init4() {
12064
12076
  this.handleKeyDown = (event, id) => {
12077
+ const {config} = this.props.model;
12078
+ const myElement = document.getElementById(config.id);
12079
+ let isTrigerredFromActualPieElement = true;
12080
+ isTrigerredFromActualPieElement = isChildOfCurrentPieElement(event.target, myElement);
12065
12081
  const isAnswerInputFocused = document.activeElement.getAttribute('aria-label') === 'Enter answer.';
12066
12082
  const isClickOrTouchEvent = event.type === 'click' || event.type === 'touchstart';
12067
12083
  if (isAnswerInputFocused && (event.key === 'ArrowDown' || isClickOrTouchEvent)) {
12068
- if (this.state.activeAnswerBlock !== id) {
12084
+ if (this.state.activeAnswerBlock !== id && isTrigerredFromActualPieElement) {
12069
12085
  this.cleanupKeyDownListener();
12070
12086
  this.setState({
12071
12087
  activeAnswerBlock: id
@@ -12221,6 +12237,7 @@ class Main extends React$1.Component {
12221
12237
  __init16() {
12222
12238
  this.onBlur = e => {
12223
12239
  const {relatedTarget, currentTarget} = e || ({});
12240
+ const isKeypadOpen = currentTarget && currentTarget.closest('[role=tooltip]');
12224
12241
  function getParentWithRoleTooltip(element, depth = 0) {
12225
12242
  if (!element || depth >= 16) return null;
12226
12243
  const parent = element.offsetParent;
@@ -12242,9 +12259,11 @@ class Main extends React$1.Component {
12242
12259
  const parentWithTooltipRole = getParentWithRoleTooltip(relatedTarget);
12243
12260
  const childWithDataKeypad = parentWithTooltipRole ? getDeepChildDataKeypad(parentWithTooltipRole) : null;
12244
12261
  if (!relatedTarget || !currentTarget || !_optionalChain([childWithDataKeypad, 'optionalAccess', _16 => _16.attributes, 'access', _17 => _17['data-keypad']])) {
12245
- this.setState({
12246
- activeAnswerBlock: ''
12247
- });
12262
+ if (!isKeypadOpen) {
12263
+ this.setState({
12264
+ activeAnswerBlock: ''
12265
+ });
12266
+ }
12248
12267
  }
12249
12268
  };
12250
12269
  }
@@ -12266,7 +12285,7 @@ class Main extends React$1.Component {
12266
12285
  if (!config) {
12267
12286
  return null;
12268
12287
  }
12269
- const {showNote, note, prompt, responses, responseType, equationEditor, customKeys, env: {mode, role} = {}} = config || ({});
12288
+ const {showNote, note, prompt, responses, responseType, equationEditor, customKeys, id, env: {mode, role} = {}} = config || ({});
12270
12289
  const displayNote = (showCorrect || mode === 'view' && role === 'instructor') && showNote && note;
12271
12290
  const emptyResponse = isEmpty(responses);
12272
12291
  const showCorrectAnswerToggle = !emptyResponse && correctness && correctness.correctness !== 'correct';
@@ -12281,7 +12300,7 @@ class Main extends React$1.Component {
12281
12300
  __self: this,
12282
12301
  __source: {
12283
12302
  fileName: _jsxFileName,
12284
- lineNumber: 578
12303
+ lineNumber: 604
12285
12304
  }
12286
12305
  }, React$1.createElement(mq.Static, {
12287
12306
  className: classes.static,
@@ -12295,7 +12314,7 @@ class Main extends React$1.Component {
12295
12314
  __self: this,
12296
12315
  __source: {
12297
12316
  fileName: _jsxFileName,
12298
- lineNumber: 579
12317
+ lineNumber: 605
12299
12318
  }
12300
12319
  }));
12301
12320
  const midContent = React$1.createElement('div', {
@@ -12303,14 +12322,14 @@ class Main extends React$1.Component {
12303
12322
  __self: this,
12304
12323
  __source: {
12305
12324
  fileName: _jsxFileName,
12306
- lineNumber: 593
12325
+ lineNumber: 619
12307
12326
  }
12308
12327
  }, mode === 'gather' && React$1.createElement('h2', {
12309
12328
  className: classes.srOnly,
12310
12329
  __self: this,
12311
12330
  __source: {
12312
12331
  fileName: _jsxFileName,
12313
- lineNumber: 594
12332
+ lineNumber: 620
12314
12333
  }
12315
12334
  }, "Math Equation Response Question"), viewMode && teacherInstructions && hasText(teacherInstructions) && (!animationsDisabled ? React$1.createElement(Collapsible, {
12316
12335
  className: classes.collapsible,
@@ -12321,7 +12340,7 @@ class Main extends React$1.Component {
12321
12340
  __self: this,
12322
12341
  __source: {
12323
12342
  fileName: _jsxFileName,
12324
- lineNumber: 600
12343
+ lineNumber: 626
12325
12344
  }
12326
12345
  }, React$1.createElement('div', {
12327
12346
  dangerouslySetInnerHTML: {
@@ -12330,7 +12349,7 @@ class Main extends React$1.Component {
12330
12349
  __self: this,
12331
12350
  __source: {
12332
12351
  fileName: _jsxFileName,
12333
- lineNumber: 604
12352
+ lineNumber: 630
12334
12353
  }
12335
12354
  })) : React$1.createElement('div', {
12336
12355
  dangerouslySetInnerHTML: {
@@ -12339,28 +12358,28 @@ class Main extends React$1.Component {
12339
12358
  __self: this,
12340
12359
  __source: {
12341
12360
  fileName: _jsxFileName,
12342
- lineNumber: 607
12361
+ lineNumber: 633
12343
12362
  }
12344
12363
  })), prompt && React$1.createElement('div', {
12345
12364
  className: classes.promptContainer,
12346
12365
  __self: this,
12347
12366
  __source: {
12348
12367
  fileName: _jsxFileName,
12349
- lineNumber: 611
12368
+ lineNumber: 637
12350
12369
  }
12351
12370
  }, React$1.createElement(PreviewPrompt, {
12352
12371
  prompt: prompt,
12353
12372
  __self: this,
12354
12373
  __source: {
12355
12374
  fileName: _jsxFileName,
12356
- lineNumber: 612
12375
+ lineNumber: 638
12357
12376
  }
12358
12377
  })), studentPrintMode ? printView : React$1.createElement(Readable, {
12359
12378
  false: true,
12360
12379
  __self: this,
12361
12380
  __source: {
12362
12381
  fileName: _jsxFileName,
12363
- lineNumber: 619
12382
+ lineNumber: 645
12364
12383
  }
12365
12384
  }, React$1.createElement('div', {
12366
12385
  className: classes.inputAndKeypadContainer,
@@ -12368,7 +12387,7 @@ class Main extends React$1.Component {
12368
12387
  __self: this,
12369
12388
  __source: {
12370
12389
  fileName: _jsxFileName,
12371
- lineNumber: 620
12390
+ lineNumber: 646
12372
12391
  }
12373
12392
  }, responseType === ResponseTypes.simple && React$1.createElement(SimpleQuestionBlock, {
12374
12393
  onSimpleResponseChange: this.onSimpleResponseChange,
@@ -12381,7 +12400,7 @@ class Main extends React$1.Component {
12381
12400
  __self: this,
12382
12401
  __source: {
12383
12402
  fileName: _jsxFileName,
12384
- lineNumber: 622
12403
+ lineNumber: 648
12385
12404
  }
12386
12405
  }), responseType === ResponseTypes.advanced && React$1.createElement('div', {
12387
12406
  ref: tooltipContainerRef,
@@ -12395,7 +12414,7 @@ class Main extends React$1.Component {
12395
12414
  __self: this,
12396
12415
  __source: {
12397
12416
  fileName: _jsxFileName,
12398
- lineNumber: 634
12417
+ lineNumber: 660
12399
12418
  }
12400
12419
  }, React$1.createElement(Tooltip, {
12401
12420
  ref: ref => this.setTooltipRef(ref),
@@ -12429,7 +12448,7 @@ class Main extends React$1.Component {
12429
12448
  __self: this,
12430
12449
  __source: {
12431
12450
  fileName: _jsxFileName,
12432
- lineNumber: 669
12451
+ lineNumber: 695
12433
12452
  }
12434
12453
  }, React$1.createElement(HorizontalKeypad, {
12435
12454
  additionalKeys: additionalKeys,
@@ -12438,13 +12457,13 @@ class Main extends React$1.Component {
12438
12457
  __self: this,
12439
12458
  __source: {
12440
12459
  fileName: _jsxFileName,
12441
- lineNumber: 678
12460
+ lineNumber: 704
12442
12461
  }
12443
12462
  })) || null),
12444
12463
  __self: this,
12445
12464
  __source: {
12446
12465
  fileName: _jsxFileName,
12447
- lineNumber: 644
12466
+ lineNumber: 670
12448
12467
  }
12449
12468
  }, React$1.createElement(mq.Static, {
12450
12469
  className: classes.static,
@@ -12458,7 +12477,7 @@ class Main extends React$1.Component {
12458
12477
  __self: this,
12459
12478
  __source: {
12460
12479
  fileName: _jsxFileName,
12461
- lineNumber: 688
12480
+ lineNumber: 714
12462
12481
  }
12463
12482
  }))))), viewMode && displayNote && React$1.createElement('div', {
12464
12483
  className: classes.note,
@@ -12468,7 +12487,7 @@ class Main extends React$1.Component {
12468
12487
  __self: this,
12469
12488
  __source: {
12470
12489
  fileName: _jsxFileName,
12471
- lineNumber: 706
12490
+ lineNumber: 732
12472
12491
  }
12473
12492
  }), viewMode && rationale && hasText(rationale) && (!animationsDisabled ? React$1.createElement(Collapsible, {
12474
12493
  labels: {
@@ -12478,7 +12497,7 @@ class Main extends React$1.Component {
12478
12497
  __self: this,
12479
12498
  __source: {
12480
12499
  fileName: _jsxFileName,
12481
- lineNumber: 713
12500
+ lineNumber: 739
12482
12501
  }
12483
12502
  }, React$1.createElement('div', {
12484
12503
  dangerouslySetInnerHTML: {
@@ -12487,7 +12506,7 @@ class Main extends React$1.Component {
12487
12506
  __self: this,
12488
12507
  __source: {
12489
12508
  fileName: _jsxFileName,
12490
- lineNumber: 714
12509
+ lineNumber: 740
12491
12510
  }
12492
12511
  })) : React$1.createElement('div', {
12493
12512
  dangerouslySetInnerHTML: {
@@ -12496,16 +12515,17 @@ class Main extends React$1.Component {
12496
12515
  __self: this,
12497
12516
  __source: {
12498
12517
  fileName: _jsxFileName,
12499
- lineNumber: 717
12518
+ lineNumber: 743
12500
12519
  }
12501
12520
  })));
12502
12521
  if (tooltipModeEnabled && (showCorrectAnswerToggle || teacherInstructions && hasText(teacherInstructions) || rationale && hasText(rationale) || feedback)) {
12503
12522
  return React$1.createElement(UiLayout, {
12504
12523
  extraCSSRules: extraCSSRules,
12524
+ id: id,
12505
12525
  __self: this,
12506
12526
  __source: {
12507
12527
  fileName: _jsxFileName,
12508
- lineNumber: 730
12528
+ lineNumber: 756
12509
12529
  }
12510
12530
  }, React$1.createElement(Tooltip, {
12511
12531
  interactive: true,
@@ -12518,14 +12538,14 @@ class Main extends React$1.Component {
12518
12538
  __self: this,
12519
12539
  __source: {
12520
12540
  fileName: _jsxFileName,
12521
- lineNumber: 739
12541
+ lineNumber: 765
12522
12542
  }
12523
12543
  }, React$1.createElement('div', {
12524
12544
  className: classes.main,
12525
12545
  __self: this,
12526
12546
  __source: {
12527
12547
  fileName: _jsxFileName,
12528
- lineNumber: 740
12548
+ lineNumber: 766
12529
12549
  }
12530
12550
  }, showCorrectAnswerToggle && React$1.createElement(CorrectAnswerToggle, {
12531
12551
  language: language,
@@ -12536,7 +12556,7 @@ class Main extends React$1.Component {
12536
12556
  __self: this,
12537
12557
  __source: {
12538
12558
  fileName: _jsxFileName,
12539
- lineNumber: 742
12559
+ lineNumber: 768
12540
12560
  }
12541
12561
  })), teacherInstructions && hasText(teacherInstructions) && React$1.createElement(Collapsible, {
12542
12562
  className: classes.collapsible,
@@ -12548,14 +12568,14 @@ class Main extends React$1.Component {
12548
12568
  __self: this,
12549
12569
  __source: {
12550
12570
  fileName: _jsxFileName,
12551
- lineNumber: 753
12571
+ lineNumber: 779
12552
12572
  }
12553
12573
  }, React$1.createElement(PreviewPrompt, {
12554
12574
  prompt: teacherInstructions,
12555
12575
  __self: this,
12556
12576
  __source: {
12557
12577
  fileName: _jsxFileName,
12558
- lineNumber: 761
12578
+ lineNumber: 787
12559
12579
  }
12560
12580
  })), displayNote && hasText(note) && React$1.createElement(Collapsible, {
12561
12581
  className: classes.collapsible,
@@ -12571,14 +12591,14 @@ class Main extends React$1.Component {
12571
12591
  __self: this,
12572
12592
  __source: {
12573
12593
  fileName: _jsxFileName,
12574
- lineNumber: 765
12594
+ lineNumber: 791
12575
12595
  }
12576
12596
  }, React$1.createElement(PreviewPrompt, {
12577
12597
  prompt: note,
12578
12598
  __self: this,
12579
12599
  __source: {
12580
12600
  fileName: _jsxFileName,
12581
- lineNumber: 773
12601
+ lineNumber: 799
12582
12602
  }
12583
12603
  })), rationale && hasText(rationale) && React$1.createElement(Collapsible, {
12584
12604
  className: classes.collapsible,
@@ -12590,14 +12610,14 @@ class Main extends React$1.Component {
12590
12610
  __self: this,
12591
12611
  __source: {
12592
12612
  fileName: _jsxFileName,
12593
- lineNumber: 778
12613
+ lineNumber: 804
12594
12614
  }
12595
12615
  }, React$1.createElement(PreviewPrompt, {
12596
12616
  prompt: rationale,
12597
12617
  __self: this,
12598
12618
  __source: {
12599
12619
  fileName: _jsxFileName,
12600
- lineNumber: 786
12620
+ lineNumber: 812
12601
12621
  }
12602
12622
  })), feedback && React$1.createElement(Feedback, {
12603
12623
  correctness: correctness.correctness,
@@ -12605,13 +12625,13 @@ class Main extends React$1.Component {
12605
12625
  __self: this,
12606
12626
  __source: {
12607
12627
  fileName: _jsxFileName,
12608
- lineNumber: 790
12628
+ lineNumber: 816
12609
12629
  }
12610
12630
  })),
12611
12631
  __self: this,
12612
12632
  __source: {
12613
12633
  fileName: _jsxFileName,
12614
- lineNumber: 731
12634
+ lineNumber: 757
12615
12635
  }
12616
12636
  }, React$1.createElement('div', {
12617
12637
  className: classes.mainContainer,
@@ -12619,11 +12639,12 @@ class Main extends React$1.Component {
12619
12639
  __self: this,
12620
12640
  __source: {
12621
12641
  fileName: _jsxFileName,
12622
- lineNumber: 794
12642
+ lineNumber: 820
12623
12643
  }
12624
12644
  }, midContent)));
12625
12645
  }
12626
12646
  return React$1.createElement(UiLayout, {
12647
+ id: id,
12627
12648
  extraCSSRules: extraCSSRules,
12628
12649
  className: classes.mainContainer,
12629
12650
  ref: r => {
@@ -12633,7 +12654,7 @@ class Main extends React$1.Component {
12633
12654
  __self: this,
12634
12655
  __source: {
12635
12656
  fileName: _jsxFileName,
12636
- lineNumber: 803
12657
+ lineNumber: 829
12637
12658
  }
12638
12659
  }, midContent);
12639
12660
  }
package/module/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/math-inline@8.4.0</title>
5
+ <title>@pie-element/math-inline@8.4.1</title>
6
6
  <script
7
7
  type="module"
8
8
  src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@pie-element/math-inline",
3
- "version": "8.4.0",
3
+ "version": "8.4.1",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "3.1.1"
7
+ "version": "3.2.0"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "5.8.1"
11
+ "version": "5.9.0"
12
12
  }
13
13
  ]
14
14
  }
package/module/print.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/math-inline@8.4.0</title>
5
+ <title>@pie-element/math-inline@8.4.1</title>
6
6
  <link
7
7
  href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
8
  rel="stylesheet"