@pie-element/math-templated 3.4.4-next.11 → 3.4.4-next.9
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 +2 -2
- 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
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_debug, _dll_lodash} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.2/module/index.js";
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_editable_html} from "../../../@pie-lib/pie-toolbox-module@5.10.
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_editable_html} 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;
|
|
@@ -126308,7 +126308,7 @@ const require$$11$4 = _dll_prop_types;
|
|
|
126308
126308
|
},
|
|
126309
126309
|
label: {
|
|
126310
126310
|
color: ("").concat(color.text(), " !important"),
|
|
126311
|
-
display: '
|
|
126311
|
+
display: 'inline-block',
|
|
126312
126312
|
verticalAlign: 'middle',
|
|
126313
126313
|
cursor: 'pointer',
|
|
126314
126314
|
'& > p': {
|
package/module/element.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _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_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.10.
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} 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) {
|
|
@@ -142429,7 +142429,7 @@ const require$$11$r = _dll_prop_types;
|
|
|
142429
142429
|
},
|
|
142430
142430
|
label: {
|
|
142431
142431
|
color: ("").concat(color.text(), " !important"),
|
|
142432
|
-
display: '
|
|
142432
|
+
display: 'inline-block',
|
|
142433
142433
|
verticalAlign: 'middle',
|
|
142434
142434
|
cursor: 'pointer',
|
|
142435
142435
|
'& > 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_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _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_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.10.
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} 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) {
|
|
@@ -142392,7 +142392,7 @@ const require$$11$r = _dll_prop_types;
|
|
|
142392
142392
|
},
|
|
142393
142393
|
label: {
|
|
142394
142394
|
color: ("").concat(color.text(), " !important"),
|
|
142395
|
-
display: '
|
|
142395
|
+
display: 'inline-block',
|
|
142396
142396
|
verticalAlign: 'middle',
|
|
142397
142397
|
cursor: 'pointer',
|
|
142398
142398
|
'& > 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,19 +4,19 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "3.4.4-next.
|
|
7
|
+
"version": "3.4.4-next.9+0d9ce0b3b",
|
|
8
8
|
"description": "",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
11
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
12
|
-
"@pie-lib/pie-toolbox": "2.9.
|
|
12
|
+
"@pie-lib/pie-toolbox": "2.9.2",
|
|
13
13
|
"prop-types": "^15.6.1",
|
|
14
14
|
"react": "^16.8.1",
|
|
15
15
|
"react-dom": "^16.8.1"
|
|
16
16
|
},
|
|
17
17
|
"author": "",
|
|
18
18
|
"license": "ISC",
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "0d9ce0b3ba004625b63eec1704ad22da1c14bcad",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"postpublish": "../../scripts/postpublish"
|
|
22
22
|
},
|