@pie-element/inline-dropdown 3.9.7 → 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,46 @@
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
+
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)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * 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))
20
+
21
+
22
+ ### Features
23
+
24
+ * **drag-in-the-blank, inline-dropdown:** move rationale after the item content PD-1379 ([fd71c58](https://github.com/pie-framework/pie-elements/commit/fd71c5853bdd63b31a746241dd5649e5de051300))
25
+
26
+
27
+
28
+
29
+
30
+ ## [3.9.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown@3.9.8...@pie-element/inline-dropdown@3.9.9) (2022-01-10)
31
+
32
+ **Note:** Version bump only for package @pie-element/inline-dropdown
33
+
34
+
35
+
36
+
37
+
38
+ ## [3.9.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown@3.9.7...@pie-element/inline-dropdown@3.9.8) (2021-12-23)
39
+
40
+ **Note:** Version bump only for package @pie-element/inline-dropdown
41
+
42
+
43
+
44
+
45
+
6
46
  ## [3.9.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown@3.9.5...@pie-element/inline-dropdown@3.9.6) (2021-12-13)
7
47
 
8
48
  **Note:** Version bump only for package @pie-element/inline-dropdown
@@ -3,6 +3,38 @@
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
+
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)
15
+
16
+ **Note:** Version bump only for package @pie-element/inline-dropdown-configure
17
+
18
+
19
+
20
+
21
+
22
+ ## [3.6.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-configure@3.6.7...@pie-element/inline-dropdown-configure@3.6.8) (2022-01-10)
23
+
24
+ **Note:** Version bump only for package @pie-element/inline-dropdown-configure
25
+
26
+
27
+
28
+
29
+
30
+ ## [3.6.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-configure@3.6.6...@pie-element/inline-dropdown-configure@3.6.7) (2021-12-23)
31
+
32
+ **Note:** Version bump only for package @pie-element/inline-dropdown-configure
33
+
34
+
35
+
36
+
37
+
6
38
  ## [3.6.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-configure@3.6.4...@pie-element/inline-dropdown-configure@3.6.5) (2021-12-13)
7
39
 
8
40
  **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(/(\t+(?!imes))|(\n)|(\\t+(?!imes))|(\\n)/g, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
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;;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;;;;AAKA,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAwB,CAAAC,UAAU,EAAI;AACjD,MAAMC,GAAG,GAAGC,QAAQ,CAACC,aAAT,CAAuB,KAAvB,CAAZ;AAEAF,EAAAA,GAAG,CAACG,SAAJ,GAAgBJ,UAAU,CAACK,IAAX,EAAhB;AAEA,SAAOJ,GAAP;AACD,CANM;;;;AAQA,IAAMK,aAAa,GAAG,SAAhBA,aAAgB,CAAAT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.replace(/(\\t+(?!imes))|(\\n)|(\\\\t+(?!imes))|(\\\\n)/g, '')\n .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"}
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,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,w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C;;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"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/inline-dropdown-configure",
3
- "version": "3.6.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.13",
12
- "@pie-lib/editable-html": "^7.17.13",
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.9.7",
7
+ "version": "3.10.1",
8
8
  "description": "",
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "@material-ui/core": "^3.9.2",
15
15
  "@pie-framework/pie-player-events": "^0.1.0",
16
- "@pie-lib/correct-answer-toggle": "^2.3.33",
16
+ "@pie-lib/correct-answer-toggle": "^2.3.34",
17
17
  "@pie-lib/mask-markup": "^1.11.4",
18
18
  "@pie-lib/math-rendering": "^2.3.12",
19
19
  "@pie-lib/render-ui": "^4.12.4",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "author": "",
27
27
  "license": "ISC",
28
- "gitHead": "ff7c86a6e386b71b47fdd28890d5a977fff15e17",
28
+ "gitHead": "820dc9994e5f621018ca2c262f9a999996fd2079",
29
29
  "main": "lib/index.js",
30
30
  "module": "src/index.js"
31
31
  }