@pie-element/explicit-constructed-response 7.2.6-next.34 → 7.2.6-next.40

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.
@@ -8,7 +8,7 @@
8
8
  "@material-ui/core": "^3.9.2",
9
9
  "@material-ui/icons": "^3.0.1",
10
10
  "@pie-framework/pie-configure-events": "^1.3.0",
11
- "@pie-lib/pie-toolbox": "2.4.1",
11
+ "@pie-lib/pie-toolbox": "2.5.0",
12
12
  "classnames": "^2.2.6",
13
13
  "debug": "^3.1.0",
14
14
  "lodash": "^4.17.15",
@@ -8,7 +8,7 @@
8
8
  "author": "",
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
- "@pie-lib/pie-toolbox": "2.4.1",
11
+ "@pie-lib/pie-toolbox": "2.5.0",
12
12
  "debug": "^3.1.0",
13
13
  "lodash": "^4.17.15",
14
14
  "type-of": "^2.0.1"
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.4.1/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@5.4.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@5.4.1/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;
@@ -24421,6 +24421,12 @@ var _default = {
24421
24421
  mathInline: {
24422
24422
  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.'
24423
24423
  },
24424
+ multipleChoice: {
24425
+ minSelections_one: 'This question requires at least {{minSelections}} answer.',
24426
+ minSelections_other: 'This question requires at least {{minSelections}} answers.',
24427
+ maxSelections_one: 'Only {{maxSelections}} answer is allowed.',
24428
+ maxSelections_other: 'Only {{maxSelections}} answers are allowed.'
24429
+ },
24424
24430
  selectText: {
24425
24431
  correctAnswerSelected: 'Correct answer selected',
24426
24432
  correctAnswerNotSelected: 'Correct answer not selected',
@@ -24511,6 +24517,12 @@ var _default = {
24511
24517
  mathInline: {
24512
24518
  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.'
24513
24519
  },
24520
+ multipleChoice: {
24521
+ minSelections_one: 'Esta pregunta requiere al menos {{minSelections}} respuesta.',
24522
+ minSelections_other: 'Esta pregunta requiere al menos {{minSelections}} respuestas.',
24523
+ maxSelections_one: 'Sólo se permite {{maxSelections}} respuesta.',
24524
+ maxSelections_other: 'Sólo se permiten {{maxSelections}} respuestas.'
24525
+ },
24514
24526
  selectText: {
24515
24527
  correctAnswerSelected: 'Respuesta correcta seleccionada',
24516
24528
  correctAnswerNotSelected: 'Respuesta correcta no seleccionada',
package/module/element.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_react_dom, _dll_classnames, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.4.1/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.4.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.4.1/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
5
5
  e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
@@ -79274,7 +79274,8 @@ const require$$18$3 = _dll_classnames;
79274
79274
  fontSize: 'inherit',
79275
79275
  maxWidth: '374px',
79276
79276
  position: 'relative',
79277
- borderRadius: '3px'
79277
+ borderRadius: '3px',
79278
+ margin: '8px'
79278
79279
  },
79279
79280
  chipLabel: {
79280
79281
  whiteSpace: 'pre-wrap',
@@ -113563,7 +113564,7 @@ const require$$24 = _dll_classnames;
113563
113564
  var relatedTarget = event.relatedTarget;
113564
113565
  var toolbarElement = _this.toolbarRef && (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.closest(("[class*=\"").concat(_this.toolbarRef.className, "\"]")));
113565
113566
  var isRawDoneButton = _this.doneButtonRef && (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.closest(("[class*=\"").concat((_this$doneButtonRef$c = _this.doneButtonRef.current) === null || _this$doneButtonRef$c === void 0 ? void 0 : _this$doneButtonRef$c.className, "\"]")));
113566
- _this.skipBlurHandling = _this.keypadInteractionDetected ? true : false;
113567
+ _this.skipBlurHandling = _this.keypadInteractionDetected && relatedTarget !== null;
113567
113568
  if (toolbarElement && !isRawDoneButton && !_this.state.focusToolbar) {
113568
113569
  _this.setState({
113569
113570
  focusToolbar: true
@@ -113573,6 +113574,7 @@ const require$$24 = _dll_classnames;
113573
113574
  log('[onBlur] node: ', node);
113574
113575
  return new Promise(function (resolve) {
113575
113576
  if (!_this.skipBlurHandling) {
113577
+ _this.setKeypadInteraction(false);
113576
113578
  _this.setState({
113577
113579
  preBlurValue: _this.state.value,
113578
113580
  focusedNode: !node ? null : node
@@ -113628,14 +113630,10 @@ const require$$24 = _dll_classnames;
113628
113630
  }
113629
113631
  _this.stashValue();
113630
113632
  _this.props.onFocus();
113631
- var isKeypadInteractionActive = _this.keypadInteractionDetected;
113632
- var shouldFocusEditor = !isKeypadInteractionActive && !isTouchDevice;
113633
+ var shouldFocusEditor = !_this.keypadInteractionDetected && !isTouchDevice;
113633
113634
  if (shouldFocusEditor) {
113634
113635
  change === null || change === void 0 ? void 0 : change.focus();
113635
113636
  }
113636
- if (isKeypadInteractionActive) {
113637
- _this.setKeypadInteraction(false);
113638
- }
113639
113637
  resolve();
113640
113638
  });
113641
113639
  });
@@ -113710,10 +113708,11 @@ const require$$24 = _dll_classnames;
113710
113708
  if (!v) {
113711
113709
  return;
113712
113710
  }
113711
+ var calcRegex = /^calc\((.*)\)$/;
113713
113712
  if (typeof v === 'string') {
113714
113713
  if (v.endsWith('%')) {
113715
113714
  return undefined;
113716
- } else if (v.endsWith('px') || v.endsWith('vh') || v.endsWith('vw')) {
113715
+ } else if (v.endsWith('px') || v.endsWith('vh') || v.endsWith('vw') || v.endsWith('ch') || v.match(calcRegex)) {
113717
113716
  return v;
113718
113717
  } else {
113719
113718
  var value = parseInt(v, 10);
@@ -114668,6 +114667,11 @@ const require$$6 = _dll_classnames;
114668
114667
  var updatedValue = _objectSpread(_objectSpread({}, data), {}, (0, _defineProperty2["default"])({}, dataset.id, newValue));
114669
114668
  onChange(updatedValue);
114670
114669
  };
114670
+ var handleKeyDown = function handleKeyDown(event) {
114671
+ if (event.key === 'Enter' || event.keyCode === 13) {
114672
+ return false;
114673
+ }
114674
+ };
114671
114675
  return _react["default"].createElement(_editableHtml["default"], {
114672
114676
  id: dataset.id,
114673
114677
  key: ("").concat(node.type, "-input-").concat(dataset.id),
@@ -114682,7 +114686,8 @@ const require$$6 = _dll_classnames;
114682
114686
  language: 'spanish'
114683
114687
  }],
114684
114688
  spellCheck: spellCheck,
114685
- width: width * 25,
114689
+ width: ("calc(").concat(width, "ch + 42px)"),
114690
+ onKeyDown: handleKeyDown,
114686
114691
  toolbarOpts: {
114687
114692
  minWidth: 'auto',
114688
114693
  noBorder: true
@@ -118232,6 +118237,12 @@ var en = {};
118232
118237
  mathInline: {
118233
118238
  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.'
118234
118239
  },
118240
+ multipleChoice: {
118241
+ minSelections_one: 'This question requires at least {{minSelections}} answer.',
118242
+ minSelections_other: 'This question requires at least {{minSelections}} answers.',
118243
+ maxSelections_one: 'Only {{maxSelections}} answer is allowed.',
118244
+ maxSelections_other: 'Only {{maxSelections}} answers are allowed.'
118245
+ },
118235
118246
  selectText: {
118236
118247
  correctAnswerSelected: 'Correct answer selected',
118237
118248
  correctAnswerNotSelected: 'Correct answer not selected',
@@ -118319,6 +118330,12 @@ var es = {};
118319
118330
  mathInline: {
118320
118331
  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.'
118321
118332
  },
118333
+ multipleChoice: {
118334
+ minSelections_one: 'Esta pregunta requiere al menos {{minSelections}} respuesta.',
118335
+ minSelections_other: 'Esta pregunta requiere al menos {{minSelections}} respuestas.',
118336
+ maxSelections_one: 'Sólo se permite {{maxSelections}} respuesta.',
118337
+ maxSelections_other: 'Sólo se permiten {{maxSelections}} respuestas.'
118338
+ },
118322
118339
  selectText: {
118323
118340
  correctAnswerSelected: 'Respuesta correcta seleccionada',
118324
118341
  correctAnswerNotSelected: 'Respuesta correcta no seleccionada',
@@ -8,7 +8,7 @@
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "5.4.0"
11
+ "version": "5.4.1"
12
12
  }
13
13
  ]
14
14
  }
package/module/print.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_react_dom, _dll_classnames, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.4.1/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.4.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.4.1/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
5
5
  e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
@@ -79237,7 +79237,8 @@ const require$$18$3 = _dll_classnames;
79237
79237
  fontSize: 'inherit',
79238
79238
  maxWidth: '374px',
79239
79239
  position: 'relative',
79240
- borderRadius: '3px'
79240
+ borderRadius: '3px',
79241
+ margin: '8px'
79241
79242
  },
79242
79243
  chipLabel: {
79243
79244
  whiteSpace: 'pre-wrap',
@@ -113526,7 +113527,7 @@ const require$$24 = _dll_classnames;
113526
113527
  var relatedTarget = event.relatedTarget;
113527
113528
  var toolbarElement = _this.toolbarRef && (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.closest(("[class*=\"").concat(_this.toolbarRef.className, "\"]")));
113528
113529
  var isRawDoneButton = _this.doneButtonRef && (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.closest(("[class*=\"").concat((_this$doneButtonRef$c = _this.doneButtonRef.current) === null || _this$doneButtonRef$c === void 0 ? void 0 : _this$doneButtonRef$c.className, "\"]")));
113529
- _this.skipBlurHandling = _this.keypadInteractionDetected ? true : false;
113530
+ _this.skipBlurHandling = _this.keypadInteractionDetected && relatedTarget !== null;
113530
113531
  if (toolbarElement && !isRawDoneButton && !_this.state.focusToolbar) {
113531
113532
  _this.setState({
113532
113533
  focusToolbar: true
@@ -113536,6 +113537,7 @@ const require$$24 = _dll_classnames;
113536
113537
  log('[onBlur] node: ', node);
113537
113538
  return new Promise(function (resolve) {
113538
113539
  if (!_this.skipBlurHandling) {
113540
+ _this.setKeypadInteraction(false);
113539
113541
  _this.setState({
113540
113542
  preBlurValue: _this.state.value,
113541
113543
  focusedNode: !node ? null : node
@@ -113591,14 +113593,10 @@ const require$$24 = _dll_classnames;
113591
113593
  }
113592
113594
  _this.stashValue();
113593
113595
  _this.props.onFocus();
113594
- var isKeypadInteractionActive = _this.keypadInteractionDetected;
113595
- var shouldFocusEditor = !isKeypadInteractionActive && !isTouchDevice;
113596
+ var shouldFocusEditor = !_this.keypadInteractionDetected && !isTouchDevice;
113596
113597
  if (shouldFocusEditor) {
113597
113598
  change === null || change === void 0 ? void 0 : change.focus();
113598
113599
  }
113599
- if (isKeypadInteractionActive) {
113600
- _this.setKeypadInteraction(false);
113601
- }
113602
113600
  resolve();
113603
113601
  });
113604
113602
  });
@@ -113673,10 +113671,11 @@ const require$$24 = _dll_classnames;
113673
113671
  if (!v) {
113674
113672
  return;
113675
113673
  }
113674
+ var calcRegex = /^calc\((.*)\)$/;
113676
113675
  if (typeof v === 'string') {
113677
113676
  if (v.endsWith('%')) {
113678
113677
  return undefined;
113679
- } else if (v.endsWith('px') || v.endsWith('vh') || v.endsWith('vw')) {
113678
+ } else if (v.endsWith('px') || v.endsWith('vh') || v.endsWith('vw') || v.endsWith('ch') || v.match(calcRegex)) {
113680
113679
  return v;
113681
113680
  } else {
113682
113681
  var value = parseInt(v, 10);
@@ -114631,6 +114630,11 @@ const require$$6 = _dll_classnames;
114631
114630
  var updatedValue = _objectSpread(_objectSpread({}, data), {}, (0, _defineProperty2["default"])({}, dataset.id, newValue));
114632
114631
  onChange(updatedValue);
114633
114632
  };
114633
+ var handleKeyDown = function handleKeyDown(event) {
114634
+ if (event.key === 'Enter' || event.keyCode === 13) {
114635
+ return false;
114636
+ }
114637
+ };
114634
114638
  return _react["default"].createElement(_editableHtml["default"], {
114635
114639
  id: dataset.id,
114636
114640
  key: ("").concat(node.type, "-input-").concat(dataset.id),
@@ -114645,7 +114649,8 @@ const require$$6 = _dll_classnames;
114645
114649
  language: 'spanish'
114646
114650
  }],
114647
114651
  spellCheck: spellCheck,
114648
- width: width * 25,
114652
+ width: ("calc(").concat(width, "ch + 42px)"),
114653
+ onKeyDown: handleKeyDown,
114649
114654
  toolbarOpts: {
114650
114655
  minWidth: 'auto',
114651
114656
  noBorder: true
@@ -118195,6 +118200,12 @@ var en = {};
118195
118200
  mathInline: {
118196
118201
  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.'
118197
118202
  },
118203
+ multipleChoice: {
118204
+ minSelections_one: 'This question requires at least {{minSelections}} answer.',
118205
+ minSelections_other: 'This question requires at least {{minSelections}} answers.',
118206
+ maxSelections_one: 'Only {{maxSelections}} answer is allowed.',
118207
+ maxSelections_other: 'Only {{maxSelections}} answers are allowed.'
118208
+ },
118198
118209
  selectText: {
118199
118210
  correctAnswerSelected: 'Correct answer selected',
118200
118211
  correctAnswerNotSelected: 'Correct answer not selected',
@@ -118282,6 +118293,12 @@ var es = {};
118282
118293
  mathInline: {
118283
118294
  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.'
118284
118295
  },
118296
+ multipleChoice: {
118297
+ minSelections_one: 'Esta pregunta requiere al menos {{minSelections}} respuesta.',
118298
+ minSelections_other: 'Esta pregunta requiere al menos {{minSelections}} respuestas.',
118299
+ maxSelections_one: 'Sólo se permite {{maxSelections}} respuesta.',
118300
+ maxSelections_other: 'Sólo se permiten {{maxSelections}} respuestas.'
118301
+ },
118285
118302
  selectText: {
118286
118303
  correctAnswerSelected: 'Respuesta correcta seleccionada',
118287
118304
  correctAnswerNotSelected: 'Respuesta correcta no seleccionada',
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "7.2.6-next.34+1bf85f10a",
7
+ "version": "7.2.6-next.40+c2131410e",
8
8
  "description": "",
9
9
  "scripts": {
10
10
  "postpublish": "../../scripts/postpublish"
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "@material-ui/core": "^3.9.2",
14
14
  "@pie-framework/pie-player-events": "^0.1.0",
15
- "@pie-lib/pie-toolbox": "2.4.1",
15
+ "@pie-lib/pie-toolbox": "2.5.0",
16
16
  "classnames": "^2.2.5",
17
17
  "lodash": "^4.17.10",
18
18
  "prop-types": "^15.6.1",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "author": "",
23
23
  "license": "ISC",
24
- "gitHead": "1bf85f10abdec54911ebbade6b8a54c17d00870a",
24
+ "gitHead": "c2131410e19605093ca77afb8234b31708db01b1",
25
25
  "main": "lib/index.js",
26
26
  "module": "src/index.js",
27
27
  "exports": {