@pie-element/explicit-constructed-response 3.12.0 → 3.12.1
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 +8 -0
- package/configure/CHANGELOG.md +8 -0
- package/configure/lib/markupUtils.js +8 -2
- package/configure/lib/markupUtils.js.map +1 -1
- package/configure/package.json +3 -3
- package/module/configure.js +7 -4
- package/module/element.js +3 -3
- package/module/index.html +1 -1
- package/module/manifest.json +4 -4
- package/module/print.html +1 -1
- package/module/print.js +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.12.0...@pie-element/explicit-constructed-response@3.12.1) (2022-02-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/explicit-constructed-response
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [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
15
|
|
|
8
16
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.7.0...@pie-element/explicit-constructed-response-configure@3.7.1) (2022-02-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [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
15
|
|
|
8
16
|
|
|
@@ -9,9 +9,15 @@ exports.getAdjustedLength = exports.createSlateMarkup = exports.processMarkup =
|
|
|
9
9
|
|
|
10
10
|
var _escape = _interopRequireDefault(require("lodash/escape"));
|
|
11
11
|
|
|
12
|
+
// do not remove \t from \times, \triangle, \tan, \theta or \therefore
|
|
13
|
+
var tSymbols = 'imes|riangle|an|heta|herefore'; // do not remove \n from \nthroot, \nparallel, \ncong, \napprox, \neq, \ne or \nsim
|
|
14
|
+
|
|
15
|
+
var nSymbols = 'throot|parallel|cong|approx|eq|e|sim'; // match all \t and \n that are not part of math symbols that starts with \t or \n
|
|
16
|
+
|
|
17
|
+
var matchTabAndNewLine = new RegExp("(\\t(?!".concat(tSymbols, "))|(\\n(?!").concat(nSymbols, "))|(\\\\t(?!").concat(tSymbols, "))|(\\\\n(?!").concat(nSymbols, "))"), 'g');
|
|
18
|
+
|
|
12
19
|
var removeUnwantedCharacters = function removeUnwantedCharacters(markup) {
|
|
13
|
-
return markup
|
|
14
|
-
.replace(/(\t(?!imes|riangle|an|heta))|(\n)|(\\t(?!imes|riangle|an|heta))|(\\n)/g, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
|
|
20
|
+
return markup.replace(matchTabAndNewLine, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
|
|
15
21
|
};
|
|
16
22
|
|
|
17
23
|
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;;
|
|
1
|
+
{"version":3,"sources":["../src/markupUtils.js"],"names":["tSymbols","nSymbols","matchTabAndNewLine","RegExp","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;;AAEA;AACA,IAAMA,QAAQ,GAAG,+BAAjB,C,CACA;;AACA,IAAMC,QAAQ,GAAG,sCAAjB,C,CACA;;AACA,IAAMC,kBAAkB,GAAG,IAAIC,MAAJ,kBAAqBH,QAArB,uBAA0CC,QAA1C,yBAAiED,QAAjE,yBAAwFC,QAAxF,SAAsG,GAAtG,CAA3B;;AAEO,IAAMG,wBAAwB,GAAG,SAA3BA,wBAA2B,CAAAC,MAAM;AAAA,SAC5CA,MAAM,CAACC,OAAP,CAAeJ,kBAAf,EAAmC,EAAnC,EAAuCI,OAAvC,CAA+C,MAA/C,EAAuD,GAAvD,EAA4DA,OAA5D,CAAoE,OAApE,EAA6E,GAA7E,CAD4C;AAAA,CAAvC;;;;AAGP,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,IAAX,EAAhB;AAEA,SAAOJ,GAAP;AACD,CAND;;AAQO,IAAMK,aAAa,GAAG,SAAhBA,aAAgB,CAAAT,MAAM,EAAI;AACrC,MAAMU,SAAS,GAAGX,wBAAwB,CAACC,MAAM,IAAI,EAAX,CAA1C;AACA,MAAMW,WAAW,GAAGT,qBAAqB,CAACQ,SAAS,IAAI,EAAd,CAAzC;AACA,MAAIE,KAAK,GAAG,CAAZ;AAEAD,EAAAA,WAAW,CAACE,gBAAZ,CAA6B,6CAA7B,EAA4EC,OAA5E,CAAoF,UAAAC,CAAC,EAAI;AACvFA,IAAAA,CAAC,CAACC,WAAF,aAAmBJ,KAAK,EAAxB;AACD,GAFD;AAIA,SAAOD,WAAW,CAACJ,SAAnB;AACD,CAVM;;;AAYP,IAAMU,KAAK,GAAG,gBAAd;;AAEO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,CAAClB,MAAD,EAASmB,OAAT,EAAqB;AACpD,MAAI,CAACnB,MAAL,EAAa;AACX,WAAO,EAAP;AACD;;AAED,MAAMU,SAAS,GAAGX,wBAAwB,CAACC,MAAD,CAA1C;AAEA,SAAOU,SAAS,CAACT,OAAV,CAAkBgB,KAAlB,EAAyB,UAACG,KAAD,EAAQC,CAAR,EAAc;AAC5C,QAAMC,KAAK,GAAGH,OAAO,CAACE,CAAD,CAAP,CAAW,CAAX,EAAcC,KAAd,IAAuB,EAArC;AAEA,oFAAsED,CAAtE,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\n// do not remove \\t from \\times, \\triangle, \\tan, \\theta or \\therefore\nconst tSymbols = 'imes|riangle|an|heta|herefore';\n// do not remove \\n from \\nthroot, \\nparallel, \\ncong, \\napprox, \\neq, \\ne or \\nsim\nconst nSymbols = 'throot|parallel|cong|approx|eq|e|sim';\n// match all \\t and \\n that are not part of math symbols that starts with \\t or \\n\nconst matchTabAndNewLine = new RegExp(`(\\\\t(?!${tSymbols}))|(\\\\n(?!${nSymbols}))|(\\\\\\\\t(?!${tSymbols}))|(\\\\\\\\n(?!${nSymbols}))`, 'g');\n\nexport const removeUnwantedCharacters = markup =>\n markup.replace(matchTabAndNewLine, '').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"}
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/explicit-constructed-response-configure",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.1",
|
|
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.
|
|
12
|
-
"@pie-lib/editable-html": "^7.17.
|
|
11
|
+
"@pie-lib/config-ui": "^10.10.18",
|
|
12
|
+
"@pie-lib/editable-html": "^7.17.18",
|
|
13
13
|
"classnames": "^2.2.6",
|
|
14
14
|
"debug": "^3.1.0",
|
|
15
15
|
"lodash": "^4.17.15",
|
package/module/configure.js
CHANGED
|
@@ -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.
|
|
2
|
-
import {_dll_pie_lib__editable_html} from "../../../@pie-lib/editable-html-module@^1.0.
|
|
3
|
-
import {_dll_pie_lib__config_ui} from "../../../@pie-lib/config-module@^1.0.
|
|
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.19/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__editable_html} from "../../../@pie-lib/editable-html-module@^1.0.20/module/index.js";
|
|
3
|
+
import {_dll_pie_lib__config_ui} from "../../../@pie-lib/config-module@^1.0.20/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
|
}
|
|
@@ -603,8 +603,11 @@ Object.defineProperty(markupUtils, "__esModule", {
|
|
|
603
603
|
});
|
|
604
604
|
markupUtils.getAdjustedLength = markupUtils.createSlateMarkup = markupUtils.processMarkup = markupUtils.removeUnwantedCharacters = void 0;
|
|
605
605
|
var _escape = _interopRequireDefault(require$$1);
|
|
606
|
+
var tSymbols = 'imes|riangle|an|heta|herefore';
|
|
607
|
+
var nSymbols = 'throot|parallel|cong|approx|eq|e|sim';
|
|
608
|
+
var matchTabAndNewLine = new RegExp(("(\\t(?!").concat(tSymbols, "))|(\\n(?!").concat(nSymbols, "))|(\\\\t(?!").concat(tSymbols, "))|(\\\\n(?!").concat(nSymbols, "))"), 'g');
|
|
606
609
|
var removeUnwantedCharacters = function removeUnwantedCharacters(markup) {
|
|
607
|
-
return markup.replace(
|
|
610
|
+
return markup.replace(matchTabAndNewLine, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
|
|
608
611
|
};
|
|
609
612
|
markupUtils.removeUnwantedCharacters = removeUnwantedCharacters;
|
|
610
613
|
var createElementFromHTML = function createElementFromHTML() {
|
package/module/element.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {_dll_debug, _dll_lodash, _dll_react, _dll_react_dom_server, _dll_prop_types, _dll_material_ui__core_styles, _dll_material_ui__core, _dll_classnames, _dll_react_dom, _dll_pie_lib__render_ui, _dll_pie_lib__correct_answer_toggle} from "../../../@pie-lib/shared-module@^1.2.
|
|
2
|
-
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.
|
|
3
|
-
import {_dll_pie_lib__drag} from "../../../@pie-lib/drag-module@^1.0.
|
|
1
|
+
import {_dll_debug, _dll_lodash, _dll_react, _dll_react_dom_server, _dll_prop_types, _dll_material_ui__core_styles, _dll_material_ui__core, _dll_classnames, _dll_react_dom, _dll_pie_lib__render_ui, _dll_pie_lib__correct_answer_toggle} from "../../../@pie-lib/shared-module@^1.2.19/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.22/module/index.js";
|
|
3
|
+
import {_dll_pie_lib__drag} from "../../../@pie-lib/drag-module@^1.0.20/module/index.js";
|
|
4
4
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
5
5
|
var lib$1 = {};
|
|
6
6
|
Object.defineProperty(lib$1, "__esModule", {
|
package/module/index.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<!doctype html>
|
|
3
3
|
<html>
|
|
4
4
|
<head>
|
|
5
|
-
<title>@pie-element/explicit-constructed-response@3.
|
|
5
|
+
<title>@pie-element/explicit-constructed-response@3.12.0</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>
|
package/module/manifest.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/explicit-constructed-response",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.0",
|
|
4
4
|
"modules": [
|
|
5
5
|
{
|
|
6
6
|
"name": "@pie-lib/shared-module",
|
|
7
|
-
"version": "^1.2.
|
|
7
|
+
"version": "^1.2.19"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"name": "@pie-lib/math-rendering-module",
|
|
11
|
-
"version": "^1.0.
|
|
11
|
+
"version": "^1.0.22"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"name": "@pie-lib/drag-module",
|
|
15
|
-
"version": "^1.0.
|
|
15
|
+
"version": "^1.0.20"
|
|
16
16
|
}
|
|
17
17
|
]
|
|
18
18
|
}
|
package/module/print.html
CHANGED
package/module/print.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {_dll_debug, _dll_lodash, _dll_react, _dll_react_dom_server, _dll_prop_types, _dll_material_ui__core_styles, _dll_material_ui__core, _dll_classnames, _dll_react_dom, _dll_pie_lib__render_ui, _dll_pie_lib__correct_answer_toggle} from "../../../@pie-lib/shared-module@^1.2.
|
|
2
|
-
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.
|
|
3
|
-
import {_dll_pie_lib__drag} from "../../../@pie-lib/drag-module@^1.0.
|
|
1
|
+
import {_dll_debug, _dll_lodash, _dll_react, _dll_react_dom_server, _dll_prop_types, _dll_material_ui__core_styles, _dll_material_ui__core, _dll_classnames, _dll_react_dom, _dll_pie_lib__render_ui, _dll_pie_lib__correct_answer_toggle} from "../../../@pie-lib/shared-module@^1.2.19/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.22/module/index.js";
|
|
3
|
+
import {_dll_pie_lib__drag} from "../../../@pie-lib/drag-module@^1.0.20/module/index.js";
|
|
4
4
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
5
5
|
var toString$1 = Object.prototype.toString;
|
|
6
6
|
var typeOf = function (val) {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "3.12.
|
|
7
|
+
"version": "3.12.1",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"author": "",
|
|
27
27
|
"license": "ISC",
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "820dc9994e5f621018ca2c262f9a999996fd2079",
|
|
29
29
|
"main": "lib/index.js",
|
|
30
30
|
"module": "src/index.js",
|
|
31
31
|
"exports": {
|