@pie-element/explicit-constructed-response 7.3.4-next.11 → 7.3.4-next.5
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/configure/package.json +1 -1
- package/controller/package.json +1 -1
- package/module/configure.js +1 -1
- package/module/element.js +15 -53
- package/module/manifest.json +1 -1
- package/module/print.js +15 -53
- package/package.json +3 -3
package/configure/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@material-ui/core": "^3.9.2",
|
|
9
9
|
"@material-ui/icons": "^3.0.1",
|
|
10
10
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
11
|
-
"@pie-lib/pie-toolbox": "2.9.
|
|
11
|
+
"@pie-lib/pie-toolbox": "2.9.2",
|
|
12
12
|
"classnames": "^2.2.6",
|
|
13
13
|
"debug": "^3.1.0",
|
|
14
14
|
"lodash": "^4.17.15",
|
package/controller/package.json
CHANGED
package/module/configure.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.2/module/index.js";
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@5.10.
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@5.10.1/module/index.js";
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
|
5
5
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
package/module/element.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_classnames, _dll_react_dom, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.2/module/index.js";
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.10.
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.10.1/module/index.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
5
5
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -140667,7 +140667,7 @@ const require$$11$s = _dll_prop_types;
|
|
|
140667
140667
|
},
|
|
140668
140668
|
label: {
|
|
140669
140669
|
color: ("").concat(color.text(), " !important"),
|
|
140670
|
-
display: '
|
|
140670
|
+
display: 'inline-block',
|
|
140671
140671
|
verticalAlign: 'middle',
|
|
140672
140672
|
cursor: 'pointer',
|
|
140673
140673
|
'& > p': {
|
|
@@ -176382,74 +176382,36 @@ var reduceRedundantNewLineCharacters = function reduceRedundantNewLineCharacters
|
|
|
176382
176382
|
}
|
|
176383
176383
|
return markup;
|
|
176384
176384
|
};
|
|
176385
|
-
var
|
|
176386
|
-
var
|
|
176387
|
-
|
|
176388
|
-
var fixParagraphs = function fixParagraphs(child) {
|
|
176389
|
-
var p = document.createElement('p');
|
|
176390
|
-
p.innerHTML = child.innerHTML;
|
|
176391
|
-
Array.from(child.attributes).forEach(function (attr) {
|
|
176392
|
-
p.setAttribute(attr.name, attr.value);
|
|
176393
|
-
});
|
|
176394
|
-
child.replaceWith(p);
|
|
176395
|
-
};
|
|
176396
|
-
var fixTables = function fixTables(tableArray) {
|
|
176397
|
-
tableArray.forEach(function (el) {
|
|
176398
|
-
var index = el.index, child = el.child, parent = el.parent;
|
|
176399
|
-
var nodesBefore = [];
|
|
176400
|
-
var nodesAfter = [];
|
|
176401
|
-
var allNodes = Array.from(parent.childNodes);
|
|
176402
|
-
var i;
|
|
176403
|
-
for (i = 0; i < allNodes.length; i++) {
|
|
176404
|
-
var node = allNodes[i];
|
|
176405
|
-
if (i < index) {
|
|
176406
|
-
nodesBefore.push(node);
|
|
176407
|
-
} else if (i > index) {
|
|
176408
|
-
nodesAfter.push(node);
|
|
176409
|
-
}
|
|
176410
|
-
}
|
|
176411
|
-
var beforeEl = document.createElement(parent.nodeName);
|
|
176412
|
-
beforeEl.append.apply(beforeEl, nodesBefore);
|
|
176413
|
-
parent.replaceWith(beforeEl);
|
|
176414
|
-
beforeEl.after(child);
|
|
176415
|
-
var afterEl = document.createElement(parent.nodeName);
|
|
176416
|
-
afterEl.append.apply(afterEl, nodesAfter);
|
|
176417
|
-
child.after(afterEl);
|
|
176418
|
-
});
|
|
176419
|
-
};
|
|
176385
|
+
var wrapHtmlProperly = function wrapHtmlProperly(markup) {
|
|
176386
|
+
var el = document.createElement('div');
|
|
176387
|
+
el.innerHTML = markup;
|
|
176420
176388
|
var parseNode = function parseNode(el) {
|
|
176421
|
-
var childArray = Array.from(el.
|
|
176389
|
+
var childArray = Array.from(el.children);
|
|
176422
176390
|
var hasParagraphs = childArray.find(function (child) {
|
|
176423
176391
|
return child.nodeName === 'P';
|
|
176424
176392
|
});
|
|
176425
|
-
|
|
176426
|
-
childArray.forEach(function (child, index) {
|
|
176393
|
+
childArray.forEach(function (child) {
|
|
176427
176394
|
if ((child.nodeName === 'DIV' || child.nodeName === 'P') && child.childNodes.length === 0) {
|
|
176428
176395
|
child.remove();
|
|
176429
176396
|
return;
|
|
176430
176397
|
}
|
|
176431
176398
|
if (hasParagraphs && child.nodeName === 'DIV') {
|
|
176432
|
-
|
|
176433
|
-
|
|
176434
|
-
|
|
176435
|
-
|
|
176436
|
-
index: index,
|
|
176437
|
-
child: child,
|
|
176438
|
-
parent: el
|
|
176399
|
+
var p = document.createElement('p');
|
|
176400
|
+
p.innerHTML = child.innerHTML;
|
|
176401
|
+
Array.from(child.attributes).forEach(function (attr) {
|
|
176402
|
+
p.setAttribute(attr.name, attr.value);
|
|
176439
176403
|
});
|
|
176404
|
+
child.replaceWith(p);
|
|
176440
176405
|
}
|
|
176441
176406
|
parseNode(child);
|
|
176442
176407
|
});
|
|
176443
|
-
if (tables.length) {
|
|
176444
|
-
fixTables(tables);
|
|
176445
|
-
}
|
|
176446
176408
|
};
|
|
176447
|
-
parseNode(
|
|
176448
|
-
return
|
|
176409
|
+
parseNode(el);
|
|
176410
|
+
return el.innerHTML;
|
|
176449
176411
|
};
|
|
176450
176412
|
var htmlToValue = function htmlToValue(html) {
|
|
176451
176413
|
try {
|
|
176452
|
-
return serializer.deserialize(
|
|
176414
|
+
return serializer.deserialize(wrapHtmlProperly(reduceRedundantNewLineCharacters(reduceMultipleBrs(html))));
|
|
176453
176415
|
} catch (e) {
|
|
176454
176416
|
console.log("Couldn't parse html: ", e);
|
|
176455
176417
|
return {};
|
package/module/manifest.json
CHANGED
package/module/print.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_classnames, _dll_react_dom, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.2/module/index.js";
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.10.
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.10.1/module/index.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
5
5
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -140630,7 +140630,7 @@ const require$$11$s = _dll_prop_types;
|
|
|
140630
140630
|
},
|
|
140631
140631
|
label: {
|
|
140632
140632
|
color: ("").concat(color.text(), " !important"),
|
|
140633
|
-
display: '
|
|
140633
|
+
display: 'inline-block',
|
|
140634
140634
|
verticalAlign: 'middle',
|
|
140635
140635
|
cursor: 'pointer',
|
|
140636
140636
|
'& > p': {
|
|
@@ -176345,74 +176345,36 @@ var reduceRedundantNewLineCharacters = function reduceRedundantNewLineCharacters
|
|
|
176345
176345
|
}
|
|
176346
176346
|
return markup;
|
|
176347
176347
|
};
|
|
176348
|
-
var
|
|
176349
|
-
var
|
|
176350
|
-
|
|
176351
|
-
var fixParagraphs = function fixParagraphs(child) {
|
|
176352
|
-
var p = document.createElement('p');
|
|
176353
|
-
p.innerHTML = child.innerHTML;
|
|
176354
|
-
Array.from(child.attributes).forEach(function (attr) {
|
|
176355
|
-
p.setAttribute(attr.name, attr.value);
|
|
176356
|
-
});
|
|
176357
|
-
child.replaceWith(p);
|
|
176358
|
-
};
|
|
176359
|
-
var fixTables = function fixTables(tableArray) {
|
|
176360
|
-
tableArray.forEach(function (el) {
|
|
176361
|
-
var index = el.index, child = el.child, parent = el.parent;
|
|
176362
|
-
var nodesBefore = [];
|
|
176363
|
-
var nodesAfter = [];
|
|
176364
|
-
var allNodes = Array.from(parent.childNodes);
|
|
176365
|
-
var i;
|
|
176366
|
-
for (i = 0; i < allNodes.length; i++) {
|
|
176367
|
-
var node = allNodes[i];
|
|
176368
|
-
if (i < index) {
|
|
176369
|
-
nodesBefore.push(node);
|
|
176370
|
-
} else if (i > index) {
|
|
176371
|
-
nodesAfter.push(node);
|
|
176372
|
-
}
|
|
176373
|
-
}
|
|
176374
|
-
var beforeEl = document.createElement(parent.nodeName);
|
|
176375
|
-
beforeEl.append.apply(beforeEl, nodesBefore);
|
|
176376
|
-
parent.replaceWith(beforeEl);
|
|
176377
|
-
beforeEl.after(child);
|
|
176378
|
-
var afterEl = document.createElement(parent.nodeName);
|
|
176379
|
-
afterEl.append.apply(afterEl, nodesAfter);
|
|
176380
|
-
child.after(afterEl);
|
|
176381
|
-
});
|
|
176382
|
-
};
|
|
176348
|
+
var wrapHtmlProperly = function wrapHtmlProperly(markup) {
|
|
176349
|
+
var el = document.createElement('div');
|
|
176350
|
+
el.innerHTML = markup;
|
|
176383
176351
|
var parseNode = function parseNode(el) {
|
|
176384
|
-
var childArray = Array.from(el.
|
|
176352
|
+
var childArray = Array.from(el.children);
|
|
176385
176353
|
var hasParagraphs = childArray.find(function (child) {
|
|
176386
176354
|
return child.nodeName === 'P';
|
|
176387
176355
|
});
|
|
176388
|
-
|
|
176389
|
-
childArray.forEach(function (child, index) {
|
|
176356
|
+
childArray.forEach(function (child) {
|
|
176390
176357
|
if ((child.nodeName === 'DIV' || child.nodeName === 'P') && child.childNodes.length === 0) {
|
|
176391
176358
|
child.remove();
|
|
176392
176359
|
return;
|
|
176393
176360
|
}
|
|
176394
176361
|
if (hasParagraphs && child.nodeName === 'DIV') {
|
|
176395
|
-
|
|
176396
|
-
|
|
176397
|
-
|
|
176398
|
-
|
|
176399
|
-
index: index,
|
|
176400
|
-
child: child,
|
|
176401
|
-
parent: el
|
|
176362
|
+
var p = document.createElement('p');
|
|
176363
|
+
p.innerHTML = child.innerHTML;
|
|
176364
|
+
Array.from(child.attributes).forEach(function (attr) {
|
|
176365
|
+
p.setAttribute(attr.name, attr.value);
|
|
176402
176366
|
});
|
|
176367
|
+
child.replaceWith(p);
|
|
176403
176368
|
}
|
|
176404
176369
|
parseNode(child);
|
|
176405
176370
|
});
|
|
176406
|
-
if (tables.length) {
|
|
176407
|
-
fixTables(tables);
|
|
176408
|
-
}
|
|
176409
176371
|
};
|
|
176410
|
-
parseNode(
|
|
176411
|
-
return
|
|
176372
|
+
parseNode(el);
|
|
176373
|
+
return el.innerHTML;
|
|
176412
176374
|
};
|
|
176413
176375
|
var htmlToValue = function htmlToValue(html) {
|
|
176414
176376
|
try {
|
|
176415
|
-
return serializer.deserialize(
|
|
176377
|
+
return serializer.deserialize(wrapHtmlProperly(reduceRedundantNewLineCharacters(reduceMultipleBrs(html))));
|
|
176416
176378
|
} catch (e) {
|
|
176417
176379
|
console.log("Couldn't parse html: ", e);
|
|
176418
176380
|
return {};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "7.3.4-next.
|
|
7
|
+
"version": "7.3.4-next.5+5f76099dd",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"postpublish": "../../scripts/postpublish"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@material-ui/core": "^3.9.2",
|
|
14
14
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
15
|
-
"@pie-lib/pie-toolbox": "2.9.
|
|
15
|
+
"@pie-lib/pie-toolbox": "2.9.2",
|
|
16
16
|
"classnames": "^2.2.5",
|
|
17
17
|
"lodash": "^4.17.10",
|
|
18
18
|
"prop-types": "^15.6.1",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"author": "",
|
|
23
23
|
"license": "ISC",
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "5f76099dd4b9b67360801ea17ece7da525fb69f0",
|
|
25
25
|
"main": "lib/index.js",
|
|
26
26
|
"module": "src/index.js",
|
|
27
27
|
"exports": {
|