@pie-element/inline-dropdown 3.10.0 → 3.10.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
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.10.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown@3.10.0...@pie-element/inline-dropdown@3.10.1) (2022-02-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/inline-dropdown
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [3.10.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown@3.9.9...@pie-element/inline-dropdown@3.10.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.6.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-configure@3.6.9...@pie-element/inline-dropdown-configure@3.6.10) (2022-02-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/inline-dropdown-configure
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [3.6.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-configure@3.6.8...@pie-element/inline-dropdown-configure@3.6.9) (2022-01-24)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/inline-dropdown-configure
|
|
@@ -9,8 +9,15 @@ exports.createSlateMarkup = exports.processMarkup = exports.createElementFromHTM
|
|
|
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.replace(
|
|
20
|
+
return markup.replace(matchTabAndNewLine, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
|
|
14
21
|
};
|
|
15
22
|
|
|
16
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","querySelectorAll","forEach","s","replaceWith","dataset","index","REGEX","createSlateMarkup","choices","createSelect","correctChoice","find","c","correct","value","id","label","match","g"],"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","querySelectorAll","forEach","s","replaceWith","dataset","index","REGEX","createSlateMarkup","choices","createSelect","correctChoice","find","c","correct","value","id","label","match","g"],"mappings":";;;;;;;;;AAAA;;AAEA;AACA,IAAMA,QAAQ,GAA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AAG,SAAfA,YAAe,CAAAJ,KAAK,EAAI;AAC5B,QAAIK,aAAa,GAAGF,OAAO,CAACH,KAAD,CAAP,IAAkBG,OAAO,CAACH,KAAD,CAAP,CAAeM,IAAf,CAAoB,UAAAC,CAAC;AAAA,aAAIA,CAAC,CAACC,OAAN;AAAA,KAArB,CAAtC;;AAEA,QAAI,CAACH,aAAD,IAAkB,CAACA,aAAa,CAACI,KAArC,EAA4C;AAC1CJ,MAAAA,aAAa,GAAG;AACdK,QAAAA,EAAE,EAAE,EADU;AAEdD,QAAAA,KAAK,EAAE,EAFO;AAGdE,QAAAA,KAAK,EAAE;AAHO,OAAhB;AAKD;;AAED,sEAAwDX,KAAxD,6BAA8E,wBAAOK,aAAa,CAACM,KAArB,CAA9E;AACD,GAZD;;AAcA,SAAOlB,SAAS,CAACT,OAAV,CAAkBiB,KAAlB,EAAyB,UAACW,KAAD,EAAQC,CAAR,EAAc;AAC5C,WAAOT,YAAY,CAACS,CAAD,CAAnB;AACD,GAFM,CAAP;AAGD,CAnBM","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\nexport const 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\n slateMarkup.querySelectorAll('[data-type=\"inline_dropdown\"]').forEach(s => {\n s.replaceWith(`{{${s.dataset.index}}}`);\n });\n\n return slateMarkup.innerHTML;\n};\n\nconst REGEX = /\\{\\{(\\d+)\\}\\}/g;\n\nexport const createSlateMarkup = (markup, choices) => {\n const newMarkup = removeUnwantedCharacters(markup);\n const createSelect = index => {\n let correctChoice = choices[index] && choices[index].find(c => c.correct);\n\n if (!correctChoice || !correctChoice.value) {\n correctChoice = {\n id: '',\n value: '',\n label: ''\n };\n }\n\n return `<span data-type=\"inline_dropdown\" data-index=\"${index}\" data-value=\"${escape(correctChoice.label)}\"></span>`;\n };\n\n return newMarkup.replace(REGEX, (match, g) => {\n return createSelect(g);\n });\n};\n"],"file":"markupUtils.js"}
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/inline-dropdown-configure",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.10",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "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
|
"@pie-lib/math-rendering": "^2.3.12",
|
|
14
14
|
"classnames": "^2.2.6",
|
|
15
15
|
"debug": "^3.1.0",
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "3.10.
|
|
7
|
+
"version": "3.10.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
|
}
|