@pie-element/inline-dropdown 9.0.0-next.43 → 9.1.1-next.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 +961 -2420
- package/configure/CHANGELOG.md +840 -2158
- package/configure/lib/index.js +5 -5
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/inline-dropdown-toolbar.js +4 -5
- package/configure/lib/inline-dropdown-toolbar.js.map +1 -1
- package/configure/lib/main.js +13 -18
- package/configure/lib/main.js.map +1 -1
- package/configure/lib/markupUtils.js +2 -3
- package/configure/lib/markupUtils.js.map +1 -1
- package/configure/package.json +8 -8
- package/controller/CHANGELOG.md +593 -1510
- package/controller/lib/index.js +7 -9
- package/controller/lib/index.js.map +1 -1
- package/controller/lib/utils.js +2 -3
- package/controller/lib/utils.js.map +1 -1
- package/controller/package.json +3 -3
- package/lib/inline-dropdown.js +2 -2
- package/lib/inline-dropdown.js.map +1 -1
- package/package.json +8 -8
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.removeUnwantedCharacters = exports.processMarkup = exports.createSlateMarkup = exports.createElementFromHTML = void 0;
|
|
8
|
-
var
|
|
7
|
+
var _lodashEs = require("lodash-es");
|
|
9
8
|
// do not remove \t from \times, \triangle, \tan, \theta or \therefore
|
|
10
9
|
const tSymbols = 'imes|riangle|an|heta|herefore';
|
|
11
10
|
// do not remove \n from \nthroot, \nparallel, \ncong, \napprox, \neq, \ne or \nsim
|
|
@@ -41,7 +40,7 @@ const createSlateMarkup = (markup, choices) => {
|
|
|
41
40
|
label: ''
|
|
42
41
|
};
|
|
43
42
|
}
|
|
44
|
-
return `<span data-type="inline_dropdown" data-index="${index}" data-value="${(0,
|
|
43
|
+
return `<span data-type="inline_dropdown" data-index="${index}" data-value="${(0, _lodashEs.escape)(correctChoice.label)}"></span>`;
|
|
45
44
|
};
|
|
46
45
|
return newMarkup.replace(REGEX, (match, g) => {
|
|
47
46
|
return createSelect(g);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markupUtils.js","names":["
|
|
1
|
+
{"version":3,"file":"markupUtils.js","names":["_lodashEs","require","tSymbols","nSymbols","matchTabAndNewLine","RegExp","removeUnwantedCharacters","markup","replace","exports","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","escape","match","g"],"sources":["../src/markupUtils.js"],"sourcesContent":["import { escape } from 'lodash-es';\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(\n `(\\\\t(?!${tSymbols}))|(\\\\n(?!${nSymbols}))|(\\\\\\\\t(?!${tSymbols}))|(\\\\\\\\n(?!${nSymbols}))`,\n 'g',\n);\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(\n correctChoice.label,\n )}\"></span>`;\n };\n\n return newMarkup.replace(REGEX, (match, g) => {\n return createSelect(g);\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA;AACA,MAAMC,QAAQ,GAAG,+BAA+B;AAChD;AACA,MAAMC,QAAQ,GAAG,sCAAsC;AACvD;AACA,MAAMC,kBAAkB,GAAG,IAAIC,MAAM,CACnC,UAAUH,QAAQ,aAAaC,QAAQ,eAAeD,QAAQ,eAAeC,QAAQ,IAAI,EACzF,GACF,CAAC;AAEM,MAAMG,wBAAwB,GAAIC,MAAM,IAC7CA,MAAM,CAACC,OAAO,CAACJ,kBAAkB,EAAE,EAAE,CAAC,CAACI,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAACA,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AAACC,OAAA,CAAAH,wBAAA,GAAAA,wBAAA;AAE7E,MAAMI,qBAAqB,GAAIC,UAAU,IAAK;EACnD,MAAMC,GAAG,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAEzCF,GAAG,CAACG,SAAS,GAAGJ,UAAU,CAACK,IAAI,CAAC,CAAC;EAEjC,OAAOJ,GAAG;AACZ,CAAC;AAACH,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAEK,MAAMO,aAAa,GAAIV,MAAM,IAAK;EACvC,MAAMW,SAAS,GAAGZ,wBAAwB,CAACC,MAAM,CAAC;EAClD,MAAMY,WAAW,GAAGT,qBAAqB,CAACQ,SAAS,CAAC;EAEpDC,WAAW,CAACC,gBAAgB,CAAC,+BAA+B,CAAC,CAACC,OAAO,CAAEC,CAAC,IAAK;IAC3EA,CAAC,CAACC,WAAW,CAAC,KAAKD,CAAC,CAACE,OAAO,CAACC,KAAK,IAAI,CAAC;EACzC,CAAC,CAAC;EAEF,OAAON,WAAW,CAACJ,SAAS;AAC9B,CAAC;AAACN,OAAA,CAAAQ,aAAA,GAAAA,aAAA;AAEF,MAAMS,KAAK,GAAG,gBAAgB;AAEvB,MAAMC,iBAAiB,GAAGA,CAACpB,MAAM,EAAEqB,OAAO,KAAK;EACpD,MAAMV,SAAS,GAAGZ,wBAAwB,CAACC,MAAM,CAAC;EAClD,MAAMsB,YAAY,GAAIJ,KAAK,IAAK;IAC9B,IAAIK,aAAa,GAAGF,OAAO,CAACH,KAAK,CAAC,IAAIG,OAAO,CAACH,KAAK,CAAC,CAACM,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,CAAC;IAE3E,IAAI,CAACH,aAAa,IAAI,CAACA,aAAa,CAACI,KAAK,EAAE;MAC1CJ,aAAa,GAAG;QACdK,EAAE,EAAE,EAAE;QACND,KAAK,EAAE,EAAE;QACTE,KAAK,EAAE;MACT,CAAC;IACH;IAEA,OAAO,iDAAiDX,KAAK,iBAAiB,IAAAY,gBAAM,EAClFP,aAAa,CAACM,KAChB,CAAC,WAAW;EACd,CAAC;EAED,OAAOlB,SAAS,CAACV,OAAO,CAACkB,KAAK,EAAE,CAACY,KAAK,EAAEC,CAAC,KAAK;IAC5C,OAAOV,YAAY,CAACU,CAAC,CAAC;EACxB,CAAC,CAAC;AACJ,CAAC;AAAC9B,OAAA,CAAAkB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/inline-dropdown-configure",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.1-next.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"@mui/icons-material": "^7.3.4",
|
|
11
11
|
"@mui/material": "^7.3.4",
|
|
12
12
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
13
|
-
"@pie-lib/config-ui": "12.
|
|
14
|
-
"@pie-lib/editable-html-tip-tap": "1.
|
|
15
|
-
"@pie-lib/math-rendering": "4.
|
|
16
|
-
"@pie-lib/render-ui": "5.
|
|
13
|
+
"@pie-lib/config-ui": "12.2.0-next.11",
|
|
14
|
+
"@pie-lib/editable-html-tip-tap": "1.2.0-next.11",
|
|
15
|
+
"@pie-lib/math-rendering": "4.2.0-next.3",
|
|
16
|
+
"@pie-lib/render-ui": "5.2.0-next.4",
|
|
17
17
|
"classnames": "^2.2.6",
|
|
18
18
|
"debug": "^4.1.1",
|
|
19
|
-
"lodash": "^4.17.23",
|
|
19
|
+
"lodash-es": "^4.17.23",
|
|
20
20
|
"prop-types": "^15.8.1",
|
|
21
|
-
"react": "18.
|
|
22
|
-
"react-dom": "18.
|
|
21
|
+
"react": "18.3.1",
|
|
22
|
+
"react-dom": "18.3.1"
|
|
23
23
|
}
|
|
24
24
|
}
|