@pie-element/explicit-constructed-response 3.11.6 → 3.12.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,47 @@
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.12.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.11.9...@pie-element/explicit-constructed-response@3.12.0) (2022-01-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **explicit-constructed-response:** Displayed delta, theta, times and tan symbols correctly PD-1507 ([29d97ec](https://github.com/pie-framework/pie-elements/commit/29d97ec68c6b66056595eb9444b9984aeb04472e))
12
+ * **multiple-choice, explicit-constructed-response, extended-text-entry:** print do not show teacher instructions, rationale or prompt if they are diabled DNA-13089 ([06b9555](https://github.com/pie-framework/pie-elements/commit/06b9555b25e094e0b2bce0e6a852a206c6d2c17d))
13
+ * use preview prompt for prompt, rationale and teacher instructions to fix table rendering PD-1456 ([f330601](https://github.com/pie-framework/pie-elements/commit/f3306019a2d1c8ce3e2783823dfe9ef0a0394e4f))
14
+ * **explicit-constructed-response:** call session change depending on input max length PD-1353 ([2664a10](https://github.com/pie-framework/pie-elements/commit/2664a108cce80a9e3a9d34141613836cf057e25e))
15
+ * **explicit-constructed-response:** fix authoring bug when changing markup PD-1413. Show all choices and change title when maxLengthPerChoice is enabled PD-1396 ([b7944f4](https://github.com/pie-framework/pie-elements/commit/b7944f4ee7ae82eb7d40b7ec13dd1c5214157690))
16
+ * **explicit-constructed-response:** Fixed characters limit PD-1396 PD-1395 ([fcbf149](https://github.com/pie-framework/pie-elements/commit/fcbf149e49b5ead36585935e0b5616a970d0a81e))
17
+ * **multiple-choice-print, ecr-print:** fix toggle issue, change options.mode to options.role ([0b3f534](https://github.com/pie-framework/pie-elements/commit/0b3f534bb4d2f969e21528e74516345e84f18d72))
18
+
19
+
20
+ ### Features
21
+
22
+ * **explicit-constructed-response:** Added a max limit of characters and adjusted the width PD-794 ([135f176](https://github.com/pie-framework/pie-elements/commit/135f176402187e9a6120b88768ae7fb0152ac418))
23
+ * **explicit-constructed-response:** added the ability to choose the display property of the element [PD-1418] ([ac3ad81](https://github.com/pie-framework/pie-elements/commit/ac3ad8182911077b0eb3096944304c935bdf5e9a))
24
+ * **explicit-constructed-response:** Calculate maxChoicesLength if it's undefined. Fixed delete response area and choices bug. BREAKING CHANGE: add maxChoicesLength prop ([97431b9](https://github.com/pie-framework/pie-elements/commit/97431b9c3fbdafd84e040653c54d5f04bae16a1d))
25
+ * **explicit-constructed-response:** implement print PD-1284 ([3a387ba](https://github.com/pie-framework/pie-elements/commit/3a387ba5e9aff0e94cbb6465550bd07185ba7eff))
26
+
27
+
28
+
29
+
30
+
31
+ ## [3.11.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.11.8...@pie-element/explicit-constructed-response@3.11.9) (2022-01-10)
32
+
33
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
34
+
35
+
36
+
37
+
38
+
39
+ ## [3.11.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.11.7...@pie-element/explicit-constructed-response@3.11.8) (2021-12-23)
40
+
41
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
42
+
43
+
44
+
45
+
46
+
6
47
  ## [3.11.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.11.5...@pie-element/explicit-constructed-response@3.11.6) (2021-12-13)
7
48
 
8
49
  **Note:** Version bump only for package @pie-element/explicit-constructed-response
@@ -3,6 +3,42 @@
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.7.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.6.9...@pie-element/explicit-constructed-response-configure@3.7.0) (2022-01-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **explicit-constructed-response:** Displayed delta, theta, times and tan symbols correctly PD-1507 ([29d97ec](https://github.com/pie-framework/pie-elements/commit/29d97ec68c6b66056595eb9444b9984aeb04472e))
12
+ * **explicit-constructed-response:** fix authoring bug when changing markup PD-1413. Show all choices and change title when maxLengthPerChoice is enabled PD-1396 ([b7944f4](https://github.com/pie-framework/pie-elements/commit/b7944f4ee7ae82eb7d40b7ec13dd1c5214157690))
13
+ * **explicit-constructed-response:** Fixed characters limit PD-1396 PD-1395 ([fcbf149](https://github.com/pie-framework/pie-elements/commit/fcbf149e49b5ead36585935e0b5616a970d0a81e))
14
+
15
+
16
+ ### Features
17
+
18
+ * **explicit-constructed-response:** Added a max limit of characters and adjusted the width PD-794 ([135f176](https://github.com/pie-framework/pie-elements/commit/135f176402187e9a6120b88768ae7fb0152ac418))
19
+ * **explicit-constructed-response:** added the ability to choose the display property of the element [PD-1418] ([ac3ad81](https://github.com/pie-framework/pie-elements/commit/ac3ad8182911077b0eb3096944304c935bdf5e9a))
20
+ * **explicit-constructed-response:** Calculate maxChoicesLength if it's undefined. Fixed delete response area and choices bug. BREAKING CHANGE: add maxChoicesLength prop ([97431b9](https://github.com/pie-framework/pie-elements/commit/97431b9c3fbdafd84e040653c54d5f04bae16a1d))
21
+
22
+
23
+
24
+
25
+
26
+ ## [3.6.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.6.8...@pie-element/explicit-constructed-response-configure@3.6.9) (2022-01-10)
27
+
28
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
29
+
30
+
31
+
32
+
33
+
34
+ ## [3.6.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.6.7...@pie-element/explicit-constructed-response-configure@3.6.8) (2021-12-23)
35
+
36
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
37
+
38
+
39
+
40
+
41
+
6
42
  ## [3.6.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.6.5...@pie-element/explicit-constructed-response-configure@3.6.6) (2021-12-13)
7
43
 
8
44
  **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
@@ -10,7 +10,8 @@ exports.getAdjustedLength = exports.createSlateMarkup = exports.processMarkup =
10
10
  var _escape = _interopRequireDefault(require("lodash/escape"));
11
11
 
12
12
  var removeUnwantedCharacters = function removeUnwantedCharacters(markup) {
13
- return markup.replace(/(\t+(?!imes))|(\n)|(\\t+(?!imes))|(\\n)/g, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
13
+ return markup // do not remove \t from \times, \triangle, \tan or \theta
14
+ .replace(/(\t(?!imes|riangle|an|heta))|(\n)|(\\t(?!imes|riangle|an|heta))|(\\n)/g, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
14
15
  };
15
16
 
16
17
  exports.removeUnwantedCharacters = removeUnwantedCharacters;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/markupUtils.js"],"names":["removeUnwantedCharacters","markup","replace","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","processMarkup","newMarkup","slateMarkup","index","querySelectorAll","forEach","s","replaceWith","REGEX","createSlateMarkup","choices","match","g","label","getAdjustedLength","length"],"mappings":";;;;;;;;;AAAA;;AAEO,IAAMA,wBAAwB,GAAG,SAA3BA,wBAA2B,CAAAC,MAAM;AAAA,SAC5CA,MAAM,CACHC,OADH,CACW,0CADX,EACuD,EADvD,EAEGA,OAFH,CAEW,MAFX,EAEmB,GAFnB,EAEwBA,OAFxB,CAEgC,OAFhC,EAEyC,GAFzC,CAD4C;AAAA,CAAvC;;;;AAKP,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAwB,GAAqB;AAAA,MAApBC,UAAoB,uEAAP,EAAO;AACjD,MAAMC,GAAG,GAAGC,QAAQ,CAACC,aAAT,CAAuB,KAAvB,CAAZ;AAEAF,EAAAA,GAAG,CAACG,SAAJ,GAAgBJ,UAAU,CAACK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AAG,CAAhB;AACD;;AAED,SAAOA,MAAM,GAAG,CAAhB;AACD,CAdM","sourcesContent":["import escape from 'lodash/escape';\n\nexport const removeUnwantedCharacters = markup =>\n markup\n .replace(/(\\t+(?!imes))|(\\n)|(\\\\t+(?!imes))|(\\\\n)/g, '')\n .replace(/\\\\\"/g, '\"').replace(/\\\\\\//g, '/');\n\nconst createElementFromHTML = (htmlString = '') => {\n const div = document.createElement('div');\n\n div.innerHTML = htmlString.trim();\n\n return div;\n};\n\nexport const processMarkup = markup => {\n const newMarkup = removeUnwantedCharacters(markup || '');\n const slateMarkup = createElementFromHTML(newMarkup || '');\n let index = 0;\n\n slateMarkup.querySelectorAll('[data-type=\"explicit_constructed_response\"]').forEach(s => {\n s.replaceWith(`{{${index++}}}`);\n });\n\n return slateMarkup.innerHTML;\n};\n\nconst REGEX = /\\{\\{(\\d+)\\}\\}/g;\n\nexport const createSlateMarkup = (markup, choices) => {\n if (!markup) {\n return '';\n }\n\n const newMarkup = removeUnwantedCharacters(markup);\n\n return newMarkup.replace(REGEX, (match, g) => {\n const label = choices[g][0].label || '';\n\n return `<span data-type=\"explicit_constructed_response\" data-index=\"${g}\" data-value=\"${escape(label)}\"></span>`;\n });\n};\n\n// also used in controller/src/index.js\nexport const getAdjustedLength = length => {\n if (length <= 2) {\n return length + 2;\n }\n\n if (length <= 4) {\n return length + 3;\n }\n\n if (length <= 6) {\n return length + 4;\n }\n\n return length + 5;\n};\n"],"file":"markupUtils.js"}
1
+ {"version":3,"sources":["../src/markupUtils.js"],"names":["removeUnwantedCharacters","markup","replace","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","processMarkup","newMarkup","slateMarkup","index","querySelectorAll","forEach","s","replaceWith","REGEX","createSlateMarkup","choices","match","g","label","getAdjustedLength","length"],"mappings":";;;;;;;;;AAAA;;AAEO,IAAMA,wBAAwB,GAAG,SAA3BA,wBAA2B,CAAAC,MAAM;AAAA,SAC5CA,MAAM,CACJ;AADI,GAEHC,OAFH,CA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6BAAwF,wBAAOC,KAAP,CAAxF;AACD,GAJM,CAAP;AAKD,CAZM,C,CAcP;;;;;AACO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,CAAAC,MAAM,EAAI;AACzC,MAAIA,MAAM,IAAI,CAAd,EAAiB;AACf,WAAOA,MAAM,GAAG,CAAhB;AACD;;AAED,MAAIA,MAAM,IAAI,CAAd,EAAiB;AACf,WAAOA,MAAM,GAAG,CAAhB;AACD;;AAED,MAAIA,MAAM,IAAI,CAAd,EAAiB;AACf,WAAOA,MAAM,GAAG,CAAhB;AACD;;AAED,SAAOA,MAAM,GAAG,CAAhB;AACD,CAdM","sourcesContent":["import escape from 'lodash/escape';\n\nexport const removeUnwantedCharacters = markup =>\n markup\n // do not remove \\t from \\times, \\triangle, \\tan or \\theta\n .replace(/(\\t(?!imes|riangle|an|heta))|(\\n)|(\\\\t(?!imes|riangle|an|heta))|(\\\\n)/g, '')\n .replace(/\\\\\"/g, '\"').replace(/\\\\\\//g, '/');\n\nconst createElementFromHTML = (htmlString = '') => {\n const div = document.createElement('div');\n\n div.innerHTML = htmlString.trim();\n\n return div;\n};\n\nexport const processMarkup = markup => {\n const newMarkup = removeUnwantedCharacters(markup || '');\n const slateMarkup = createElementFromHTML(newMarkup || '');\n let index = 0;\n\n slateMarkup.querySelectorAll('[data-type=\"explicit_constructed_response\"]').forEach(s => {\n s.replaceWith(`{{${index++}}}`);\n });\n\n return slateMarkup.innerHTML;\n};\n\nconst REGEX = /\\{\\{(\\d+)\\}\\}/g;\n\nexport const createSlateMarkup = (markup, choices) => {\n if (!markup) {\n return '';\n }\n\n const newMarkup = removeUnwantedCharacters(markup);\n\n return newMarkup.replace(REGEX, (match, g) => {\n const label = choices[g][0].label || '';\n\n return `<span data-type=\"explicit_constructed_response\" data-index=\"${g}\" data-value=\"${escape(label)}\"></span>`;\n });\n};\n\n// also used in controller/src/index.js\nexport const getAdjustedLength = length => {\n if (length <= 2) {\n return length + 2;\n }\n\n if (length <= 4) {\n return length + 3;\n }\n\n if (length <= 6) {\n return length + 4;\n }\n\n return length + 5;\n};\n"],"file":"markupUtils.js"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/explicit-constructed-response-configure",
3
- "version": "3.6.6",
3
+ "version": "3.7.0",
4
4
  "private": true,
5
5
  "main": "lib/index.js",
6
6
  "modue": "src/index.js",
@@ -8,8 +8,8 @@
8
8
  "@material-ui/core": "^3.9.2",
9
9
  "@material-ui/icons": "^3.0.1",
10
10
  "@pie-framework/pie-configure-events": "^1.2.0",
11
- "@pie-lib/config-ui": "^10.10.13",
12
- "@pie-lib/editable-html": "^7.17.13",
11
+ "@pie-lib/config-ui": "^10.10.16",
12
+ "@pie-lib/editable-html": "^7.17.16",
13
13
  "classnames": "^2.2.6",
14
14
  "debug": "^3.1.0",
15
15
  "lodash": "^4.17.15",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/explicit-constructed-response-controller",
3
3
  "private": true,
4
- "version": "3.4.5",
4
+ "version": "3.4.6",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -1,6 +1,6 @@
1
- import {_dll_react, _dll_prop_types, _dll_material_ui__core, _dll_material_ui__core_styles, _dll_lodash, _dll_material_ui__icons, _dll_react_dom, _dll_debug} from "../../../@pie-lib/shared-module@^1.2.14/module/index.js";
2
- import {_dll_pie_lib__editable_html} from "../../../@pie-lib/editable-html-module@^1.0.15/module/index.js";
3
- import {_dll_pie_lib__config_ui} from "../../../@pie-lib/config-module@^1.0.15/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_material_ui__core, _dll_material_ui__core_styles, _dll_lodash, _dll_material_ui__icons, _dll_react_dom, _dll_debug} from "../../../@pie-lib/shared-module@^1.2.17/module/index.js";
2
+ import {_dll_pie_lib__editable_html} from "../../../@pie-lib/editable-html-module@^1.0.18/module/index.js";
3
+ import {_dll_pie_lib__config_ui} from "../../../@pie-lib/config-module@^1.0.18/module/index.js";
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
6
6
  }
@@ -604,7 +604,7 @@ Object.defineProperty(markupUtils, "__esModule", {
604
604
  markupUtils.getAdjustedLength = markupUtils.createSlateMarkup = markupUtils.processMarkup = markupUtils.removeUnwantedCharacters = void 0;
605
605
  var _escape = _interopRequireDefault(require$$1);
606
606
  var removeUnwantedCharacters = function removeUnwantedCharacters(markup) {
607
- return markup.replace(/(\t+(?!imes))|(\n)|(\\t+(?!imes))|(\\n)/g, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
607
+ return markup.replace(/(\t(?!imes|riangle|an|heta))|(\n)|(\\t(?!imes|riangle|an|heta))|(\\n)/g, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
608
608
  };
609
609
  markupUtils.removeUnwantedCharacters = removeUnwantedCharacters;
610
610
  var createElementFromHTML = function createElementFromHTML() {