@pie-element/math-templated 3.3.4-next.9 → 3.3.5-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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.3.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-templated@3.3.3...@pie-element/math-templated@3.3.4) (2024-12-20)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update @pie-framework/math-validation PD-4410 ([1792639](https://github.com/pie-framework/pie-elements/commit/1792639d56e47ce3a418bf79323e19cdf7531460))
12
+ * update pie-lib/pie-toolbox PD-3843, PD-4518, PD-4588, PD-4210, PD-4362, PD-4618 ([c213141](https://github.com/pie-framework/pie-elements/commit/c2131410e19605093ca77afb8234b31708db01b1))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [3.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-templated@3.3.2...@pie-element/math-templated@3.3.3) (2024-12-10)
7
19
 
8
20
 
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.2.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-templated-configure@2.2.3...@pie-element/math-templated-configure@2.2.4) (2024-12-20)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-3843, PD-4518, PD-4588, PD-4210, PD-4362, PD-4618 ([c213141](https://github.com/pie-framework/pie-elements/commit/c2131410e19605093ca77afb8234b31708db01b1))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.2.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-templated-configure@2.2.2...@pie-element/math-templated-configure@2.2.3) (2024-12-10)
7
18
 
8
19
 
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@pie-element/math-templated-configure",
3
3
  "private": true,
4
- "version": "2.2.3",
4
+ "version": "2.2.4",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
8
8
  "dependencies": {
9
9
  "@material-ui/core": "^3.9.2",
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
  "debug": "^3.1.0",
13
13
  "lodash": "^4.17.15",
14
14
  "prop-types": "^15.6.2",
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-templated-controller@3.1.5...@pie-element/math-templated-controller@3.1.6) (2024-12-20)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update @pie-framework/math-validation PD-4410 ([1792639](https://github.com/pie-framework/pie-elements/commit/1792639d56e47ce3a418bf79323e19cdf7531460))
12
+ * update pie-lib/pie-toolbox PD-3843, PD-4518, PD-4588, PD-4210, PD-4362, PD-4618 ([c213141](https://github.com/pie-framework/pie-elements/commit/c2131410e19605093ca77afb8234b31708db01b1))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [3.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-templated-controller@3.1.4...@pie-element/math-templated-controller@3.1.5) (2024-12-10)
7
19
 
8
20
 
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@pie-element/math-templated-controller",
3
3
  "private": true,
4
- "version": "3.1.5",
4
+ "version": "3.1.6",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
8
8
  "dependencies": {
9
- "@pie-framework/math-validation": "^1.2.2",
10
- "@pie-lib/pie-toolbox": "2.4.1",
9
+ "@pie-framework/math-validation": "^1.2.3",
10
+ "@pie-lib/pie-toolbox": "2.5.0",
11
11
  "debug": "^3.1.0",
12
12
  "lodash": "^4.17.15"
13
13
  },
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.4.1/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_editable_html} from "../../../@pie-lib/pie-toolbox-module@5.4.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_editable_html} 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;
@@ -3837,6 +3837,12 @@ var _default = {
3837
3837
  mathInline: {
3838
3838
  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.'
3839
3839
  },
3840
+ multipleChoice: {
3841
+ minSelections_one: 'This question requires at least {{minSelections}} answer.',
3842
+ minSelections_other: 'This question requires at least {{minSelections}} answers.',
3843
+ maxSelections_one: 'Only {{maxSelections}} answer is allowed.',
3844
+ maxSelections_other: 'Only {{maxSelections}} answers are allowed.'
3845
+ },
3840
3846
  selectText: {
3841
3847
  correctAnswerSelected: 'Correct answer selected',
3842
3848
  correctAnswerNotSelected: 'Correct answer not selected',
@@ -3927,6 +3933,12 @@ var _default = {
3927
3933
  mathInline: {
3928
3934
  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.'
3929
3935
  },
3936
+ multipleChoice: {
3937
+ minSelections_one: 'Esta pregunta requiere al menos {{minSelections}} respuesta.',
3938
+ minSelections_other: 'Esta pregunta requiere al menos {{minSelections}} respuestas.',
3939
+ maxSelections_one: 'Sólo se permite {{maxSelections}} respuesta.',
3940
+ maxSelections_other: 'Sólo se permiten {{maxSelections}} respuestas.'
3941
+ },
3930
3942
  selectText: {
3931
3943
  correctAnswerSelected: 'Respuesta correcta seleccionada',
3932
3944
  correctAnswerNotSelected: 'Respuesta correcta no seleccionada',
package/module/element.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _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_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.4.0/module/index.js";
2
+ import {_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.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) {
@@ -81036,7 +81036,8 @@ const require$$18$3 = _dll_classnames;
81036
81036
  fontSize: 'inherit',
81037
81037
  maxWidth: '374px',
81038
81038
  position: 'relative',
81039
- borderRadius: '3px'
81039
+ borderRadius: '3px',
81040
+ margin: '8px'
81040
81041
  },
81041
81042
  chipLabel: {
81042
81043
  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
package/module/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/math-templated@3.3.3</title>
5
+ <title>@pie-element/math-templated@3.3.4</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,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/math-templated",
3
- "version": "3.3.3",
3
+ "version": "3.3.4",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
@@ -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.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/math-templated@3.3.3</title>
5
+ <title>@pie-element/math-templated@3.3.4</title>
6
6
  <link
7
7
  href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
8
  rel="stylesheet"
package/module/print.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _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_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.4.0/module/index.js";
2
+ import {_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.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) {
@@ -80999,7 +80999,8 @@ const require$$18$3 = _dll_classnames;
80999
80999
  fontSize: 'inherit',
81000
81000
  maxWidth: '374px',
81001
81001
  position: 'relative',
81002
- borderRadius: '3px'
81002
+ borderRadius: '3px',
81003
+ margin: '8px'
81003
81004
  },
81004
81005
  chipLabel: {
81005
81006
  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
package/package.json CHANGED
@@ -4,19 +4,19 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "3.3.4-next.9+0e4534490",
7
+ "version": "3.3.5-next.0+cf87049dc",
8
8
  "description": "",
9
9
  "dependencies": {
10
10
  "@material-ui/core": "^3.9.2",
11
11
  "@pie-framework/pie-player-events": "^0.1.0",
12
- "@pie-lib/pie-toolbox": "2.4.1",
12
+ "@pie-lib/pie-toolbox": "2.5.0",
13
13
  "prop-types": "^15.6.1",
14
14
  "react": "^16.8.1",
15
15
  "react-dom": "^16.8.1"
16
16
  },
17
17
  "author": "",
18
18
  "license": "ISC",
19
- "gitHead": "0e45344900790b405c12993941b7ef4a03f99ef7",
19
+ "gitHead": "cf87049dcfad134d8b329c46239cb695874bc5ef",
20
20
  "scripts": {
21
21
  "postpublish": "../../scripts/postpublish"
22
22
  },