@pie-element/complex-rubric 2.10.3 → 2.10.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/CHANGELOG.md +22 -0
- package/configure/CHANGELOG.md +16 -0
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +22 -0
- package/controller/package.json +2 -2
- package/module/configure.js +35 -43
- package/module/element.js +35 -43
- package/module/index.html +1 -1
- package/module/manifest.json +2 -2
- package/module/print.html +1 -1
- package/module/print.js +35 -43
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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
|
+
## [2.10.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@2.10.4...@pie-element/complex-rubric@2.10.5) (2024-05-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update pie-toolbox PD-3640 ([707c240](https://github.com/pie-framework/pie-elements/commit/707c24031bc0cb05bb070605d4bc27384334eaac))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.10.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@2.10.3...@pie-element/complex-rubric@2.10.4) (2024-05-13)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* update pie-lib/pie-toolbox PD-3650, PD-3651, PD-3621, PD-3620, PD-2127,PD-3709, PD-3726, PD-3191 ([2ef6881](https://github.com/pie-framework/pie-elements/commit/2ef688118b9099c7338cbe88afcdeed228fae11e))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [2.10.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@2.10.2...@pie-element/complex-rubric@2.10.3) (2024-05-07)
|
|
7
29
|
|
|
8
30
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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
|
+
## [2.2.20](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@2.2.19...@pie-element/complex-rubric-configure@2.2.20) (2024-05-14)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/complex-rubric-configure
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.2.19](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@2.2.18...@pie-element/complex-rubric-configure@2.2.19) (2024-05-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-element/complex-rubric-configure
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [2.2.18](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@2.2.17...@pie-element/complex-rubric-configure@2.2.18) (2024-05-07)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @pie-element/complex-rubric-configure
|
package/configure/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/complex-rubric-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.20",
|
|
5
5
|
"description": "Complex Rubric authoring view",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
8
8
|
"author": "Pie Framework Authors",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
|
-
"@pie-element/multi-trait-rubric": "^3.10.
|
|
12
|
-
"@pie-element/rubric": "^3.10.
|
|
11
|
+
"@pie-element/multi-trait-rubric": "^3.10.5",
|
|
12
|
+
"@pie-element/rubric": "^3.10.5",
|
|
13
13
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
14
14
|
"@pie-lib/config-ui": "^11.9.25-next.0",
|
|
15
15
|
"@pie-lib/editable-html": "^11.1.2-next.0",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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
|
+
## [2.9.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-controller@2.9.4...@pie-element/complex-rubric-controller@2.9.5) (2024-05-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update pie-toolbox PD-3640 ([707c240](https://github.com/pie-framework/pie-elements/commit/707c24031bc0cb05bb070605d4bc27384334eaac))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.9.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-controller@2.9.3...@pie-element/complex-rubric-controller@2.9.4) (2024-05-13)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* update pie-lib/pie-toolbox PD-3650, PD-3651, PD-3621, PD-3620, PD-2127,PD-3709, PD-3726, PD-3191 ([2ef6881](https://github.com/pie-framework/pie-elements/commit/2ef688118b9099c7338cbe88afcdeed228fae11e))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [2.9.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-controller@2.9.2...@pie-element/complex-rubric-controller@2.9.3) (2024-05-07)
|
|
7
29
|
|
|
8
30
|
|
package/controller/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/complex-rubric-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "2.9.
|
|
4
|
+
"version": "2.9.5",
|
|
5
5
|
"description": "",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@pie-lib/pie-toolbox": "1.17.
|
|
10
|
+
"@pie-lib/pie-toolbox": "1.17.5",
|
|
11
11
|
"lodash": "^4.17.15"
|
|
12
12
|
},
|
|
13
13
|
"author": "",
|
package/module/configure.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.10.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.10.4/module/index.js";
|
|
2
2
|
import RubricConfigure from '@pie-element/rubric/configure/lib';
|
|
3
3
|
import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@4.12.0/module/index.js";
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -95187,7 +95187,6 @@ const require$$12$r = _dll_debug;
|
|
|
95187
95187
|
};
|
|
95188
95188
|
var mmlConfig = {
|
|
95189
95189
|
parseError: function parseError(node) {
|
|
95190
|
-
console.log('error:', node);
|
|
95191
95190
|
this.error(this.adaptor.textContent(node).replace(/\n.*/g, ''));
|
|
95192
95191
|
}
|
|
95193
95192
|
};
|
|
@@ -95200,11 +95199,9 @@ const require$$12$r = _dll_debug;
|
|
|
95200
95199
|
var customMmlFactory = new _MmlFactory.MmlFactory(_objectSpread(_objectSpread({}, _MmlFactory.MmlFactory.defaultNodes), _mstack.mmlNodes));
|
|
95201
95200
|
var html = _mathjax.mathjax.document(docProvided, {
|
|
95202
95201
|
compileError: function compileError(mj, math, err) {
|
|
95203
|
-
console.log('bad math?:', math);
|
|
95204
95202
|
console.error(err);
|
|
95205
95203
|
},
|
|
95206
95204
|
typesetError: function typesetError(doc, math, err) {
|
|
95207
|
-
console.log('typeset error');
|
|
95208
95205
|
console.error(err);
|
|
95209
95206
|
doc.typesetError(math, err);
|
|
95210
95207
|
},
|
|
@@ -95250,13 +95247,10 @@ const require$$12$r = _dll_debug;
|
|
|
95250
95247
|
var renderMath = function renderMath(el, renderOpts) {
|
|
95251
95248
|
var _getGlobal$instance, _getGlobal$instance2;
|
|
95252
95249
|
if (window && window.MathJax && window.MathJax.customKey && window.MathJax.customKey == '@pie-lib/math-rendering-accessible@1') {
|
|
95253
|
-
console.log('RETURN FROM OLD MATH RENDERING, MATH RENDERING ACCESSIBLE WAS FOUND');
|
|
95254
95250
|
return;
|
|
95255
95251
|
}
|
|
95256
|
-
console.log('we are in old math rendering');
|
|
95257
95252
|
var isString = typeof el === 'string';
|
|
95258
95253
|
var executeOn = document.body;
|
|
95259
|
-
console.log(isString, 'is string in old math rendering');
|
|
95260
95254
|
if (isString) {
|
|
95261
95255
|
var div = document.createElement('div');
|
|
95262
95256
|
div.innerHTML = el;
|
|
@@ -95269,14 +95263,11 @@ const require$$12$r = _dll_debug;
|
|
|
95269
95263
|
var updatedDocument = html.findMath().compile().getMetrics().typeset().updateDocument();
|
|
95270
95264
|
var list = updatedDocument.math.list;
|
|
95271
95265
|
var item = list.next;
|
|
95272
|
-
console.log(item, 'item in old math rendering');
|
|
95273
95266
|
if (!item) {
|
|
95274
|
-
console.log("return '' in old math rendering");
|
|
95275
95267
|
return '';
|
|
95276
95268
|
}
|
|
95277
95269
|
var mathMl = toMMl(item.data.root);
|
|
95278
95270
|
var parsedMathMl = mathMl.replaceAll('\n', '');
|
|
95279
|
-
console.log(parsedMathMl, 'parsedMathMl in old math rendering');
|
|
95280
95271
|
return parsedMathMl;
|
|
95281
95272
|
}
|
|
95282
95273
|
if (!getGlobal().instance) {
|
|
@@ -95286,14 +95277,11 @@ const require$$12$r = _dll_debug;
|
|
|
95286
95277
|
log('el is undefined');
|
|
95287
95278
|
return;
|
|
95288
95279
|
}
|
|
95289
|
-
console.log(el, 'element in old math rendering');
|
|
95290
95280
|
if (el instanceof Element && (_getGlobal$instance = getGlobal().instance) !== null && _getGlobal$instance !== void 0 && _getGlobal$instance.Typeset) {
|
|
95291
|
-
console.log('Typeset element in old math rendering');
|
|
95292
95281
|
getGlobal().instance.Typeset(el);
|
|
95293
95282
|
} else if (el.length && (_getGlobal$instance2 = getGlobal().instance) !== null && _getGlobal$instance2 !== void 0 && _getGlobal$instance2.Typeset) {
|
|
95294
95283
|
var _getGlobal$instance3;
|
|
95295
95284
|
var arr = Array.from(el);
|
|
95296
|
-
console.log(arr, 'Typeset arr in old math rendering');
|
|
95297
95285
|
(_getGlobal$instance3 = getGlobal().instance).Typeset.apply(_getGlobal$instance3, (0, _toConsumableArray2["default"])(arr));
|
|
95298
95286
|
}
|
|
95299
95287
|
};
|
|
@@ -104264,10 +104252,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
104264
104252
|
return ((_window = window) === null || _window === void 0 ? void 0 : (_window$MathJax = _window.MathJax) === null || _window$MathJax === void 0 ? void 0 : _window$MathJax.customKey) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MathJax = _window2.MathJax) === null || _window2$MathJax === void 0 ? void 0 : (_window2$MathJax$conf = _window2$MathJax.config) === null || _window2$MathJax$conf === void 0 ? void 0 : _window2$MathJax$conf.customKey);
|
|
104265
104253
|
};
|
|
104266
104254
|
var renderMath = function renderMath(el, renderOpts) {
|
|
104267
|
-
console.log("I'm in math rendering accessible");
|
|
104268
104255
|
var isString = typeof el === 'string';
|
|
104269
|
-
console.log('IS STRING', isString);
|
|
104270
|
-
console.log('renderOpts', renderOpts);
|
|
104271
104256
|
var executeOn = document.body;
|
|
104272
104257
|
if (isString) {
|
|
104273
104258
|
var div = document.createElement('div');
|
|
@@ -104275,19 +104260,16 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
104275
104260
|
executeOn = div;
|
|
104276
104261
|
}
|
|
104277
104262
|
var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
|
|
104278
|
-
console.log(skipWaitForMathRenderingLib, 'skipWaitForMathRenderingLib');
|
|
104279
104263
|
var renderMathAccessible = function renderMathAccessible() {
|
|
104280
104264
|
fixMathElements(executeOn);
|
|
104281
104265
|
adjustMathMLStyle(executeOn);
|
|
104282
104266
|
var mathJaxCustomKey = getMathJaxCustomKey();
|
|
104283
104267
|
if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
|
|
104284
|
-
console.log('INITIALIZE MATHJAX ACCESSIBLE');
|
|
104285
104268
|
renderOpts = renderOpts || defaultOpts();
|
|
104286
104269
|
(0, _mathjaxScript.initializeMathJax)(renderOpts);
|
|
104287
104270
|
}
|
|
104288
104271
|
if (isString && window.MathJax && window.mathjaxLoadedP) {
|
|
104289
104272
|
try {
|
|
104290
|
-
console.log('THE ISSUE MUST BE HERE');
|
|
104291
104273
|
MathJax.texReset();
|
|
104292
104274
|
MathJax.typesetClear();
|
|
104293
104275
|
window.MathJax.typeset([executeOn]);
|
|
@@ -104296,7 +104278,6 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
104296
104278
|
var item = list.next;
|
|
104297
104279
|
var mathMl = toMMl(item.data.root);
|
|
104298
104280
|
var parsedMathMl = mathMl.replaceAll('\n', '');
|
|
104299
|
-
console.log(parsedMathMl, 'parsedMathMl');
|
|
104300
104281
|
return parsedMathMl;
|
|
104301
104282
|
} catch (error) {
|
|
104302
104283
|
console.error('Error rendering math:', error.message);
|
|
@@ -104305,13 +104286,11 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
104305
104286
|
if (window.mathjaxLoadedP) {
|
|
104306
104287
|
window.mathjaxLoadedP.then(function () {
|
|
104307
104288
|
var mathJaxInstance = getGlobal().instance;
|
|
104308
|
-
console.log(mathJaxInstance, 'mathJaxInstance');
|
|
104309
104289
|
if (mathJaxInstance) {
|
|
104310
104290
|
mathJaxInstance.texReset();
|
|
104311
104291
|
mathJaxInstance.typesetClear();
|
|
104312
104292
|
mathJaxInstance.typesetPromise([executeOn]).then(function () {
|
|
104313
104293
|
try {
|
|
104314
|
-
console.log("I'm in typesetPromise???");
|
|
104315
104294
|
removeExcessMjxContainers(executeOn);
|
|
104316
104295
|
removePlaceholdersAndRestoreDisplay();
|
|
104317
104296
|
var _updatedDocument = mathJaxInstance.startup.document;
|
|
@@ -104335,16 +104314,13 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
104335
104314
|
}
|
|
104336
104315
|
};
|
|
104337
104316
|
if (skipWaitForMathRenderingLib) {
|
|
104338
|
-
console.log(skipWaitForMathRenderingLib, 'skipWaitForMathRenderingLib');
|
|
104339
104317
|
return renderMathAccessible();
|
|
104340
104318
|
} else {
|
|
104341
104319
|
if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
|
|
104342
|
-
console.log(mathRenderingKEY, 'mathRenderingKEY');
|
|
104343
104320
|
removePlaceholdersAndRestoreDisplay();
|
|
104344
104321
|
return mr.renderMath(executeOn, renderOpts);
|
|
104345
104322
|
}
|
|
104346
104323
|
if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
|
|
104347
|
-
console.log(mathRenderingAccessibleKEY, 'mathRenderingAccessibleKEY');
|
|
104348
104324
|
return renderMathAccessible();
|
|
104349
104325
|
}
|
|
104350
104326
|
var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
|
|
@@ -104359,7 +104335,6 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
104359
104335
|
if (mathRenderingHasLoaded || hasExceededMaxWait) {
|
|
104360
104336
|
clearInterval(checkIntervalId);
|
|
104361
104337
|
if (mathRenderingHasLoaded) {
|
|
104362
|
-
console.log(mathRenderingHasLoaded, 'mathRenderingHasLoaded');
|
|
104363
104338
|
removePlaceholdersAndRestoreDisplay();
|
|
104364
104339
|
return mr.renderMath(executeOn, renderOpts);
|
|
104365
104340
|
}
|
|
@@ -104368,7 +104343,6 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
104368
104343
|
};
|
|
104369
104344
|
checkIntervalId = setInterval(checkForLib, 100);
|
|
104370
104345
|
};
|
|
104371
|
-
console.log('waitForMathRenderingLib');
|
|
104372
104346
|
waitForMathRenderingLib(renderMathAccessible);
|
|
104373
104347
|
}
|
|
104374
104348
|
};
|
|
@@ -136781,6 +136755,11 @@ const require$$14$5 = _dll_pie_framework__mathquill;
|
|
|
136781
136755
|
return;
|
|
136782
136756
|
}
|
|
136783
136757
|
});
|
|
136758
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onClick", function (event) {
|
|
136759
|
+
var onClick = _this.props.onClick;
|
|
136760
|
+
_this.refresh();
|
|
136761
|
+
onClick && onClick(event);
|
|
136762
|
+
});
|
|
136784
136763
|
return _this;
|
|
136785
136764
|
}
|
|
136786
136765
|
(0, _createClass2["default"])(Input, [{
|
|
@@ -136871,11 +136850,11 @@ const require$$14$5 = _dll_pie_framework__mathquill;
|
|
|
136871
136850
|
key: "render",
|
|
136872
136851
|
value: function render() {
|
|
136873
136852
|
var _this3 = this;
|
|
136874
|
-
var _this$props = this.props,
|
|
136853
|
+
var _this$props = this.props, onFocus = _this$props.onFocus, onBlur = _this$props.onBlur, classes = _this$props.classes, className = _this$props.className;
|
|
136875
136854
|
return _react["default"].createElement("span", {
|
|
136876
136855
|
className: (0, _classnames["default"])(classes.input, className),
|
|
136877
|
-
|
|
136878
|
-
onClick: onClick,
|
|
136856
|
+
onKeyDown: this.onKeyPress,
|
|
136857
|
+
onClick: this.onClick,
|
|
136879
136858
|
onFocus: onFocus,
|
|
136880
136859
|
onBlur: onBlur,
|
|
136881
136860
|
ref: function ref(r) {
|
|
@@ -144146,7 +144125,7 @@ const require$$17$2 = _dll_debug;
|
|
|
144146
144125
|
(0, _createClass2["default"])(TableToolbar, [{
|
|
144147
144126
|
key: "render",
|
|
144148
144127
|
value: function render() {
|
|
144149
|
-
var _this$props = this.props, plugins = _this$props.plugins, value = _this$props.value, onChange = _this$props.onChange, onAddRow = _this$props.onAddRow, onRemoveRow = _this$props.onRemoveRow, onAddColumn = _this$props.onAddColumn, onRemoveColumn = _this$props.onRemoveColumn, onRemoveTable = _this$props.onRemoveTable, onToggleBorder = _this$props.onToggleBorder, hasBorder = _this$props.hasBorder, classes = _this$props.classes;
|
|
144128
|
+
var _this$props = this.props, getFocusedValue = _this$props.getFocusedValue, plugins = _this$props.plugins, value = _this$props.value, onChange = _this$props.onChange, onAddRow = _this$props.onAddRow, onRemoveRow = _this$props.onRemoveRow, onAddColumn = _this$props.onAddColumn, onRemoveColumn = _this$props.onRemoveColumn, onRemoveTable = _this$props.onRemoveTable, onToggleBorder = _this$props.onToggleBorder, hasBorder = _this$props.hasBorder, classes = _this$props.classes;
|
|
144150
144129
|
log('[render] hasBorder:', hasBorder);
|
|
144151
144130
|
return _react["default"].createElement("div", {
|
|
144152
144131
|
className: classes.tableToolbar
|
|
@@ -144167,7 +144146,8 @@ const require$$17$2 = _dll_debug;
|
|
|
144167
144146
|
key: ("plugin-").concat(index)
|
|
144168
144147
|
}, p.toolbar, {
|
|
144169
144148
|
value: value,
|
|
144170
|
-
onChange: onChange
|
|
144149
|
+
onChange: onChange,
|
|
144150
|
+
getFocusedValue: getFocusedValue
|
|
144171
144151
|
}));
|
|
144172
144152
|
}), _react["default"].createElement(_toolbarButtons.Button, {
|
|
144173
144153
|
onClick: onToggleBorder,
|
|
@@ -144829,7 +144809,7 @@ const require$$9$r = _dll_prop_types;
|
|
|
144829
144809
|
supports: function supports(node, value) {
|
|
144830
144810
|
return node && node.object === 'block' && core.utils.isSelectionInTable(value);
|
|
144831
144811
|
},
|
|
144832
|
-
customToolbar: function customToolbar(node, value, onToolbarDone) {
|
|
144812
|
+
customToolbar: function customToolbar(node, value, onToolbarDone, getFocusedValue) {
|
|
144833
144813
|
log('[customToolbar] node.data: ', node.data);
|
|
144834
144814
|
var tableBlock = core.utils.getTableBlock(value.document, node === null || node === void 0 ? void 0 : node.key);
|
|
144835
144815
|
log('[customToolbar] tableBlock: ', tableBlock);
|
|
@@ -144871,6 +144851,7 @@ const require$$9$r = _dll_prop_types;
|
|
|
144871
144851
|
};
|
|
144872
144852
|
var Tb = function Tb() {
|
|
144873
144853
|
return _react["default"].createElement(_tableToolbar["default"], {
|
|
144854
|
+
getFocusedValue: getFocusedValue,
|
|
144874
144855
|
plugins: toolbarPlugins,
|
|
144875
144856
|
onChange: function onChange(c) {
|
|
144876
144857
|
return onToolbarDone(c, false);
|
|
@@ -149182,8 +149163,8 @@ const require$$11$l = _dll_prop_types;
|
|
|
149182
149163
|
var letter = _ref2.letter;
|
|
149183
149164
|
return _react["default"].createElement("div", {
|
|
149184
149165
|
style: {
|
|
149185
|
-
fontSize: '
|
|
149186
|
-
lineHeight: '
|
|
149166
|
+
fontSize: '24px',
|
|
149167
|
+
lineHeight: '24px'
|
|
149187
149168
|
}
|
|
149188
149169
|
}, letter);
|
|
149189
149170
|
};
|
|
@@ -149202,7 +149183,9 @@ const require$$11$l = _dll_prop_types;
|
|
|
149202
149183
|
var editorDOM = document.querySelector(("[data-key=\"").concat(value.document.key, "\"]"));
|
|
149203
149184
|
var valueToUse = value;
|
|
149204
149185
|
var callback = function callback(_char, focus) {
|
|
149205
|
-
|
|
149186
|
+
if (getFocusedValue) {
|
|
149187
|
+
valueToUse = getFocusedValue() || valueToUse;
|
|
149188
|
+
}
|
|
149206
149189
|
if (_char) {
|
|
149207
149190
|
var change = valueToUse.change().insertTextByKey(valueToUse.anchorKey, valueToUse.anchorOffset, _char);
|
|
149208
149191
|
valueToUse = change.value;
|
|
@@ -149349,7 +149332,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
149349
149332
|
}
|
|
149350
149333
|
}
|
|
149351
149334
|
var log = (0, _debug["default"])('@pie-lib:editable-html:plugins:toolbar');
|
|
149352
|
-
var getCustomToolbar = function getCustomToolbar(plugin, node, value, handleDone, onDataChange) {
|
|
149335
|
+
var getCustomToolbar = function getCustomToolbar(plugin, node, value, handleDone, getFocusedValue, onDataChange) {
|
|
149353
149336
|
if (!plugin) {
|
|
149354
149337
|
return;
|
|
149355
149338
|
}
|
|
@@ -149360,7 +149343,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
149360
149343
|
return plugin.toolbar.CustomToolbarComp;
|
|
149361
149344
|
} else if (typeof plugin.toolbar.customToolbar === 'function') {
|
|
149362
149345
|
log('deprecated - use CustomToolbarComp');
|
|
149363
|
-
return plugin.toolbar.customToolbar(node, value, handleDone, onDataChange);
|
|
149346
|
+
return plugin.toolbar.customToolbar(node, value, handleDone, getFocusedValue, onDataChange);
|
|
149364
149347
|
}
|
|
149365
149348
|
};
|
|
149366
149349
|
var Toolbar = (function (_React$Component) {
|
|
@@ -149470,7 +149453,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
149470
149453
|
var handleDataChange = function handleDataChange(key, data) {
|
|
149471
149454
|
_this2.props.onDataChange(key, data);
|
|
149472
149455
|
};
|
|
149473
|
-
var CustomToolbar = getCustomToolbar(plugin, node, value, handleDone, this.props.onDataChange);
|
|
149456
|
+
var CustomToolbar = getCustomToolbar(plugin, node, value, handleDone, getFocusedValue, this.props.onDataChange);
|
|
149474
149457
|
var filteredPlugins = plugin && plugin.filterPlugins ? plugin.filterPlugins(node, plugins) : plugins;
|
|
149475
149458
|
log('[render] CustomToolbar: ', CustomToolbar);
|
|
149476
149459
|
var parentExtraStyles = parentPlugin && parentPlugin.pluginStyles ? parentPlugin.pluginStyles(node, parentNode, plugin) : {};
|
|
@@ -149489,6 +149472,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
149489
149472
|
}, CustomToolbar ? _react["default"].createElement(CustomToolbar, {
|
|
149490
149473
|
node: node,
|
|
149491
149474
|
value: value,
|
|
149475
|
+
getFocusedValue: getFocusedValue,
|
|
149492
149476
|
onToolbarDone: this.onToolbarDone,
|
|
149493
149477
|
onDataChange: handleDataChange,
|
|
149494
149478
|
pluginProps: pluginProps
|
|
@@ -150205,7 +150189,10 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
150205
150189
|
var imagePlugin = opts.image && opts.image.onDelete && (0, _image["default"])(opts.image);
|
|
150206
150190
|
var mathPlugin = (0, _math["default"])(opts.math);
|
|
150207
150191
|
var respAreaPlugin = opts.responseArea && opts.responseArea.type && (0, _respArea["default"])(opts.responseArea, (0, _compact["default"])([mathPlugin]));
|
|
150208
|
-
var
|
|
150192
|
+
var languageCharactersPlugins = ((opts === null || opts === void 0 ? void 0 : opts.languageCharacters) || []).map(function (config) {
|
|
150193
|
+
return (0, _characters["default"])(config);
|
|
150194
|
+
});
|
|
150195
|
+
var builtPlugins = (0, _compact["default"])([addIf('table', (0, _table["default"])(opts.table, (0, _compact["default"])([imagePlugin, mathPlugin].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins))))), addIf('bold', MarkHotkey({
|
|
150209
150196
|
key: 'b',
|
|
150210
150197
|
type: 'bold',
|
|
150211
150198
|
icon: _react$1e["default"].createElement(_FormatBold["default"], null),
|
|
@@ -150225,8 +150212,8 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
150225
150212
|
type: 'underline',
|
|
150226
150213
|
icon: _react$1e["default"].createElement(_FormatUnderlined["default"], null),
|
|
150227
150214
|
tag: 'u'
|
|
150228
|
-
})), addIf('image', imagePlugin), addIf('video', (0, _media["default"])('video', opts.media)), addIf('audio', (0, _media["default"])('audio', opts.media)), addIf('math', mathPlugin)].concat((0, _toConsumableArray2$2["default"])(
|
|
150229
|
-
return addIf('languageCharacters',
|
|
150215
|
+
})), addIf('image', imagePlugin), addIf('video', (0, _media["default"])('video', opts.media)), addIf('audio', (0, _media["default"])('audio', opts.media)), addIf('math', mathPlugin)].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins.map(function (plugin) {
|
|
150216
|
+
return addIf('languageCharacters', plugin);
|
|
150230
150217
|
})), [addIf('bulleted-list', (0, _list["default"])({
|
|
150231
150218
|
key: 'l',
|
|
150232
150219
|
type: 'ul_list',
|
|
@@ -158614,6 +158601,7 @@ const require$$23 = _dll_classnames;
|
|
|
158614
158601
|
isHtmlMode: isHtmlMode
|
|
158615
158602
|
});
|
|
158616
158603
|
};
|
|
158604
|
+
var MAX_CHARACTERS_LIMIT = 1000000;
|
|
158617
158605
|
var Editor = (function (_React$Component) {
|
|
158618
158606
|
(0, _inherits2["default"])(Editor, _React$Component);
|
|
158619
158607
|
var _super = _createSuper(Editor);
|
|
@@ -158994,7 +158982,11 @@ const require$$23 = _dll_classnames;
|
|
|
158994
158982
|
log('[onChange]');
|
|
158995
158983
|
var value = change.value;
|
|
158996
158984
|
var charactersLimit = _this.props.charactersLimit;
|
|
158997
|
-
|
|
158985
|
+
var limit = charactersLimit;
|
|
158986
|
+
if (!limit || limit > MAX_CHARACTERS_LIMIT) {
|
|
158987
|
+
limit = MAX_CHARACTERS_LIMIT;
|
|
158988
|
+
}
|
|
158989
|
+
if (value && value.document && value.document.text && value.document.text.length > limit) {
|
|
158998
158990
|
return;
|
|
158999
158991
|
}
|
|
159000
158992
|
var isEditedInHtmlMode = !_this.state.isHtmlMode ? false : _this.state.value.document.text !== value.document.text ? true : _this.state.isEditedInHtmlMode;
|
package/module/element.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.10.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.10.4/module/index.js";
|
|
2
2
|
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.12.0/module/index.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -37584,6 +37584,11 @@ const require$$14$5 = _dll_pie_framework__mathquill;
|
|
|
37584
37584
|
return;
|
|
37585
37585
|
}
|
|
37586
37586
|
});
|
|
37587
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onClick", function (event) {
|
|
37588
|
+
var onClick = _this.props.onClick;
|
|
37589
|
+
_this.refresh();
|
|
37590
|
+
onClick && onClick(event);
|
|
37591
|
+
});
|
|
37587
37592
|
return _this;
|
|
37588
37593
|
}
|
|
37589
37594
|
(0, _createClass2["default"])(Input, [{
|
|
@@ -37674,11 +37679,11 @@ const require$$14$5 = _dll_pie_framework__mathquill;
|
|
|
37674
37679
|
key: "render",
|
|
37675
37680
|
value: function render() {
|
|
37676
37681
|
var _this3 = this;
|
|
37677
|
-
var _this$props = this.props,
|
|
37682
|
+
var _this$props = this.props, onFocus = _this$props.onFocus, onBlur = _this$props.onBlur, classes = _this$props.classes, className = _this$props.className;
|
|
37678
37683
|
return _react["default"].createElement("span", {
|
|
37679
37684
|
className: (0, _classnames["default"])(classes.input, className),
|
|
37680
|
-
|
|
37681
|
-
onClick: onClick,
|
|
37685
|
+
onKeyDown: this.onKeyPress,
|
|
37686
|
+
onClick: this.onClick,
|
|
37682
37687
|
onFocus: onFocus,
|
|
37683
37688
|
onBlur: onBlur,
|
|
37684
37689
|
ref: function ref(r) {
|
|
@@ -117513,7 +117518,6 @@ const require$$12$h = _dll_debug;
|
|
|
117513
117518
|
};
|
|
117514
117519
|
var mmlConfig = {
|
|
117515
117520
|
parseError: function parseError(node) {
|
|
117516
|
-
console.log('error:', node);
|
|
117517
117521
|
this.error(this.adaptor.textContent(node).replace(/\n.*/g, ''));
|
|
117518
117522
|
}
|
|
117519
117523
|
};
|
|
@@ -117526,11 +117530,9 @@ const require$$12$h = _dll_debug;
|
|
|
117526
117530
|
var customMmlFactory = new _MmlFactory.MmlFactory(_objectSpread(_objectSpread({}, _MmlFactory.MmlFactory.defaultNodes), _mstack.mmlNodes));
|
|
117527
117531
|
var html = _mathjax.mathjax.document(docProvided, {
|
|
117528
117532
|
compileError: function compileError(mj, math, err) {
|
|
117529
|
-
console.log('bad math?:', math);
|
|
117530
117533
|
console.error(err);
|
|
117531
117534
|
},
|
|
117532
117535
|
typesetError: function typesetError(doc, math, err) {
|
|
117533
|
-
console.log('typeset error');
|
|
117534
117536
|
console.error(err);
|
|
117535
117537
|
doc.typesetError(math, err);
|
|
117536
117538
|
},
|
|
@@ -117576,13 +117578,10 @@ const require$$12$h = _dll_debug;
|
|
|
117576
117578
|
var renderMath = function renderMath(el, renderOpts) {
|
|
117577
117579
|
var _getGlobal$instance, _getGlobal$instance2;
|
|
117578
117580
|
if (window && window.MathJax && window.MathJax.customKey && window.MathJax.customKey == '@pie-lib/math-rendering-accessible@1') {
|
|
117579
|
-
console.log('RETURN FROM OLD MATH RENDERING, MATH RENDERING ACCESSIBLE WAS FOUND');
|
|
117580
117581
|
return;
|
|
117581
117582
|
}
|
|
117582
|
-
console.log('we are in old math rendering');
|
|
117583
117583
|
var isString = typeof el === 'string';
|
|
117584
117584
|
var executeOn = document.body;
|
|
117585
|
-
console.log(isString, 'is string in old math rendering');
|
|
117586
117585
|
if (isString) {
|
|
117587
117586
|
var div = document.createElement('div');
|
|
117588
117587
|
div.innerHTML = el;
|
|
@@ -117595,14 +117594,11 @@ const require$$12$h = _dll_debug;
|
|
|
117595
117594
|
var updatedDocument = html.findMath().compile().getMetrics().typeset().updateDocument();
|
|
117596
117595
|
var list = updatedDocument.math.list;
|
|
117597
117596
|
var item = list.next;
|
|
117598
|
-
console.log(item, 'item in old math rendering');
|
|
117599
117597
|
if (!item) {
|
|
117600
|
-
console.log("return '' in old math rendering");
|
|
117601
117598
|
return '';
|
|
117602
117599
|
}
|
|
117603
117600
|
var mathMl = toMMl(item.data.root);
|
|
117604
117601
|
var parsedMathMl = mathMl.replaceAll('\n', '');
|
|
117605
|
-
console.log(parsedMathMl, 'parsedMathMl in old math rendering');
|
|
117606
117602
|
return parsedMathMl;
|
|
117607
117603
|
}
|
|
117608
117604
|
if (!getGlobal().instance) {
|
|
@@ -117612,14 +117608,11 @@ const require$$12$h = _dll_debug;
|
|
|
117612
117608
|
log('el is undefined');
|
|
117613
117609
|
return;
|
|
117614
117610
|
}
|
|
117615
|
-
console.log(el, 'element in old math rendering');
|
|
117616
117611
|
if (el instanceof Element && (_getGlobal$instance = getGlobal().instance) !== null && _getGlobal$instance !== void 0 && _getGlobal$instance.Typeset) {
|
|
117617
|
-
console.log('Typeset element in old math rendering');
|
|
117618
117612
|
getGlobal().instance.Typeset(el);
|
|
117619
117613
|
} else if (el.length && (_getGlobal$instance2 = getGlobal().instance) !== null && _getGlobal$instance2 !== void 0 && _getGlobal$instance2.Typeset) {
|
|
117620
117614
|
var _getGlobal$instance3;
|
|
117621
117615
|
var arr = Array.from(el);
|
|
117622
|
-
console.log(arr, 'Typeset arr in old math rendering');
|
|
117623
117616
|
(_getGlobal$instance3 = getGlobal().instance).Typeset.apply(_getGlobal$instance3, (0, _toConsumableArray2["default"])(arr));
|
|
117624
117617
|
}
|
|
117625
117618
|
};
|
|
@@ -126590,10 +126583,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126590
126583
|
return ((_window = window) === null || _window === void 0 ? void 0 : (_window$MathJax = _window.MathJax) === null || _window$MathJax === void 0 ? void 0 : _window$MathJax.customKey) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MathJax = _window2.MathJax) === null || _window2$MathJax === void 0 ? void 0 : (_window2$MathJax$conf = _window2$MathJax.config) === null || _window2$MathJax$conf === void 0 ? void 0 : _window2$MathJax$conf.customKey);
|
|
126591
126584
|
};
|
|
126592
126585
|
var renderMath = function renderMath(el, renderOpts) {
|
|
126593
|
-
console.log("I'm in math rendering accessible");
|
|
126594
126586
|
var isString = typeof el === 'string';
|
|
126595
|
-
console.log('IS STRING', isString);
|
|
126596
|
-
console.log('renderOpts', renderOpts);
|
|
126597
126587
|
var executeOn = document.body;
|
|
126598
126588
|
if (isString) {
|
|
126599
126589
|
var div = document.createElement('div');
|
|
@@ -126601,19 +126591,16 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126601
126591
|
executeOn = div;
|
|
126602
126592
|
}
|
|
126603
126593
|
var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
|
|
126604
|
-
console.log(skipWaitForMathRenderingLib, 'skipWaitForMathRenderingLib');
|
|
126605
126594
|
var renderMathAccessible = function renderMathAccessible() {
|
|
126606
126595
|
fixMathElements(executeOn);
|
|
126607
126596
|
adjustMathMLStyle(executeOn);
|
|
126608
126597
|
var mathJaxCustomKey = getMathJaxCustomKey();
|
|
126609
126598
|
if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
|
|
126610
|
-
console.log('INITIALIZE MATHJAX ACCESSIBLE');
|
|
126611
126599
|
renderOpts = renderOpts || defaultOpts();
|
|
126612
126600
|
(0, _mathjaxScript.initializeMathJax)(renderOpts);
|
|
126613
126601
|
}
|
|
126614
126602
|
if (isString && window.MathJax && window.mathjaxLoadedP) {
|
|
126615
126603
|
try {
|
|
126616
|
-
console.log('THE ISSUE MUST BE HERE');
|
|
126617
126604
|
MathJax.texReset();
|
|
126618
126605
|
MathJax.typesetClear();
|
|
126619
126606
|
window.MathJax.typeset([executeOn]);
|
|
@@ -126622,7 +126609,6 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126622
126609
|
var item = list.next;
|
|
126623
126610
|
var mathMl = toMMl(item.data.root);
|
|
126624
126611
|
var parsedMathMl = mathMl.replaceAll('\n', '');
|
|
126625
|
-
console.log(parsedMathMl, 'parsedMathMl');
|
|
126626
126612
|
return parsedMathMl;
|
|
126627
126613
|
} catch (error) {
|
|
126628
126614
|
console.error('Error rendering math:', error.message);
|
|
@@ -126631,13 +126617,11 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126631
126617
|
if (window.mathjaxLoadedP) {
|
|
126632
126618
|
window.mathjaxLoadedP.then(function () {
|
|
126633
126619
|
var mathJaxInstance = getGlobal().instance;
|
|
126634
|
-
console.log(mathJaxInstance, 'mathJaxInstance');
|
|
126635
126620
|
if (mathJaxInstance) {
|
|
126636
126621
|
mathJaxInstance.texReset();
|
|
126637
126622
|
mathJaxInstance.typesetClear();
|
|
126638
126623
|
mathJaxInstance.typesetPromise([executeOn]).then(function () {
|
|
126639
126624
|
try {
|
|
126640
|
-
console.log("I'm in typesetPromise???");
|
|
126641
126625
|
removeExcessMjxContainers(executeOn);
|
|
126642
126626
|
removePlaceholdersAndRestoreDisplay();
|
|
126643
126627
|
var _updatedDocument = mathJaxInstance.startup.document;
|
|
@@ -126661,16 +126645,13 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126661
126645
|
}
|
|
126662
126646
|
};
|
|
126663
126647
|
if (skipWaitForMathRenderingLib) {
|
|
126664
|
-
console.log(skipWaitForMathRenderingLib, 'skipWaitForMathRenderingLib');
|
|
126665
126648
|
return renderMathAccessible();
|
|
126666
126649
|
} else {
|
|
126667
126650
|
if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
|
|
126668
|
-
console.log(mathRenderingKEY, 'mathRenderingKEY');
|
|
126669
126651
|
removePlaceholdersAndRestoreDisplay();
|
|
126670
126652
|
return mr.renderMath(executeOn, renderOpts);
|
|
126671
126653
|
}
|
|
126672
126654
|
if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
|
|
126673
|
-
console.log(mathRenderingAccessibleKEY, 'mathRenderingAccessibleKEY');
|
|
126674
126655
|
return renderMathAccessible();
|
|
126675
126656
|
}
|
|
126676
126657
|
var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
|
|
@@ -126685,7 +126666,6 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126685
126666
|
if (mathRenderingHasLoaded || hasExceededMaxWait) {
|
|
126686
126667
|
clearInterval(checkIntervalId);
|
|
126687
126668
|
if (mathRenderingHasLoaded) {
|
|
126688
|
-
console.log(mathRenderingHasLoaded, 'mathRenderingHasLoaded');
|
|
126689
126669
|
removePlaceholdersAndRestoreDisplay();
|
|
126690
126670
|
return mr.renderMath(executeOn, renderOpts);
|
|
126691
126671
|
}
|
|
@@ -126694,7 +126674,6 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126694
126674
|
};
|
|
126695
126675
|
checkIntervalId = setInterval(checkForLib, 100);
|
|
126696
126676
|
};
|
|
126697
|
-
console.log('waitForMathRenderingLib');
|
|
126698
126677
|
waitForMathRenderingLib(renderMathAccessible);
|
|
126699
126678
|
}
|
|
126700
126679
|
};
|
|
@@ -134337,7 +134316,7 @@ const require$$17$2 = _dll_debug;
|
|
|
134337
134316
|
(0, _createClass2["default"])(TableToolbar, [{
|
|
134338
134317
|
key: "render",
|
|
134339
134318
|
value: function render() {
|
|
134340
|
-
var _this$props = this.props, plugins = _this$props.plugins, value = _this$props.value, onChange = _this$props.onChange, onAddRow = _this$props.onAddRow, onRemoveRow = _this$props.onRemoveRow, onAddColumn = _this$props.onAddColumn, onRemoveColumn = _this$props.onRemoveColumn, onRemoveTable = _this$props.onRemoveTable, onToggleBorder = _this$props.onToggleBorder, hasBorder = _this$props.hasBorder, classes = _this$props.classes;
|
|
134319
|
+
var _this$props = this.props, getFocusedValue = _this$props.getFocusedValue, plugins = _this$props.plugins, value = _this$props.value, onChange = _this$props.onChange, onAddRow = _this$props.onAddRow, onRemoveRow = _this$props.onRemoveRow, onAddColumn = _this$props.onAddColumn, onRemoveColumn = _this$props.onRemoveColumn, onRemoveTable = _this$props.onRemoveTable, onToggleBorder = _this$props.onToggleBorder, hasBorder = _this$props.hasBorder, classes = _this$props.classes;
|
|
134341
134320
|
log('[render] hasBorder:', hasBorder);
|
|
134342
134321
|
return _react["default"].createElement("div", {
|
|
134343
134322
|
className: classes.tableToolbar
|
|
@@ -134358,7 +134337,8 @@ const require$$17$2 = _dll_debug;
|
|
|
134358
134337
|
key: ("plugin-").concat(index)
|
|
134359
134338
|
}, p.toolbar, {
|
|
134360
134339
|
value: value,
|
|
134361
|
-
onChange: onChange
|
|
134340
|
+
onChange: onChange,
|
|
134341
|
+
getFocusedValue: getFocusedValue
|
|
134362
134342
|
}));
|
|
134363
134343
|
}), _react["default"].createElement(_toolbarButtons.Button, {
|
|
134364
134344
|
onClick: onToggleBorder,
|
|
@@ -135020,7 +135000,7 @@ const require$$9$s = _dll_prop_types;
|
|
|
135020
135000
|
supports: function supports(node, value) {
|
|
135021
135001
|
return node && node.object === 'block' && core.utils.isSelectionInTable(value);
|
|
135022
135002
|
},
|
|
135023
|
-
customToolbar: function customToolbar(node, value, onToolbarDone) {
|
|
135003
|
+
customToolbar: function customToolbar(node, value, onToolbarDone, getFocusedValue) {
|
|
135024
135004
|
log('[customToolbar] node.data: ', node.data);
|
|
135025
135005
|
var tableBlock = core.utils.getTableBlock(value.document, node === null || node === void 0 ? void 0 : node.key);
|
|
135026
135006
|
log('[customToolbar] tableBlock: ', tableBlock);
|
|
@@ -135062,6 +135042,7 @@ const require$$9$s = _dll_prop_types;
|
|
|
135062
135042
|
};
|
|
135063
135043
|
var Tb = function Tb() {
|
|
135064
135044
|
return _react["default"].createElement(_tableToolbar["default"], {
|
|
135045
|
+
getFocusedValue: getFocusedValue,
|
|
135065
135046
|
plugins: toolbarPlugins,
|
|
135066
135047
|
onChange: function onChange(c) {
|
|
135067
135048
|
return onToolbarDone(c, false);
|
|
@@ -147449,8 +147430,8 @@ const require$$11$l = _dll_prop_types;
|
|
|
147449
147430
|
var letter = _ref2.letter;
|
|
147450
147431
|
return _react["default"].createElement("div", {
|
|
147451
147432
|
style: {
|
|
147452
|
-
fontSize: '
|
|
147453
|
-
lineHeight: '
|
|
147433
|
+
fontSize: '24px',
|
|
147434
|
+
lineHeight: '24px'
|
|
147454
147435
|
}
|
|
147455
147436
|
}, letter);
|
|
147456
147437
|
};
|
|
@@ -147469,7 +147450,9 @@ const require$$11$l = _dll_prop_types;
|
|
|
147469
147450
|
var editorDOM = document.querySelector(("[data-key=\"").concat(value.document.key, "\"]"));
|
|
147470
147451
|
var valueToUse = value;
|
|
147471
147452
|
var callback = function callback(_char, focus) {
|
|
147472
|
-
|
|
147453
|
+
if (getFocusedValue) {
|
|
147454
|
+
valueToUse = getFocusedValue() || valueToUse;
|
|
147455
|
+
}
|
|
147473
147456
|
if (_char) {
|
|
147474
147457
|
var change = valueToUse.change().insertTextByKey(valueToUse.anchorKey, valueToUse.anchorOffset, _char);
|
|
147475
147458
|
valueToUse = change.value;
|
|
@@ -147616,7 +147599,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147616
147599
|
}
|
|
147617
147600
|
}
|
|
147618
147601
|
var log = (0, _debug["default"])('@pie-lib:editable-html:plugins:toolbar');
|
|
147619
|
-
var getCustomToolbar = function getCustomToolbar(plugin, node, value, handleDone, onDataChange) {
|
|
147602
|
+
var getCustomToolbar = function getCustomToolbar(plugin, node, value, handleDone, getFocusedValue, onDataChange) {
|
|
147620
147603
|
if (!plugin) {
|
|
147621
147604
|
return;
|
|
147622
147605
|
}
|
|
@@ -147627,7 +147610,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147627
147610
|
return plugin.toolbar.CustomToolbarComp;
|
|
147628
147611
|
} else if (typeof plugin.toolbar.customToolbar === 'function') {
|
|
147629
147612
|
log('deprecated - use CustomToolbarComp');
|
|
147630
|
-
return plugin.toolbar.customToolbar(node, value, handleDone, onDataChange);
|
|
147613
|
+
return plugin.toolbar.customToolbar(node, value, handleDone, getFocusedValue, onDataChange);
|
|
147631
147614
|
}
|
|
147632
147615
|
};
|
|
147633
147616
|
var Toolbar = (function (_React$Component) {
|
|
@@ -147737,7 +147720,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147737
147720
|
var handleDataChange = function handleDataChange(key, data) {
|
|
147738
147721
|
_this2.props.onDataChange(key, data);
|
|
147739
147722
|
};
|
|
147740
|
-
var CustomToolbar = getCustomToolbar(plugin, node, value, handleDone, this.props.onDataChange);
|
|
147723
|
+
var CustomToolbar = getCustomToolbar(plugin, node, value, handleDone, getFocusedValue, this.props.onDataChange);
|
|
147741
147724
|
var filteredPlugins = plugin && plugin.filterPlugins ? plugin.filterPlugins(node, plugins) : plugins;
|
|
147742
147725
|
log('[render] CustomToolbar: ', CustomToolbar);
|
|
147743
147726
|
var parentExtraStyles = parentPlugin && parentPlugin.pluginStyles ? parentPlugin.pluginStyles(node, parentNode, plugin) : {};
|
|
@@ -147756,6 +147739,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147756
147739
|
}, CustomToolbar ? _react["default"].createElement(CustomToolbar, {
|
|
147757
147740
|
node: node,
|
|
147758
147741
|
value: value,
|
|
147742
|
+
getFocusedValue: getFocusedValue,
|
|
147759
147743
|
onToolbarDone: this.onToolbarDone,
|
|
147760
147744
|
onDataChange: handleDataChange,
|
|
147761
147745
|
pluginProps: pluginProps
|
|
@@ -148472,7 +148456,10 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
148472
148456
|
var imagePlugin = opts.image && opts.image.onDelete && (0, _image["default"])(opts.image);
|
|
148473
148457
|
var mathPlugin = (0, _math["default"])(opts.math);
|
|
148474
148458
|
var respAreaPlugin = opts.responseArea && opts.responseArea.type && (0, _respArea["default"])(opts.responseArea, (0, _compact["default"])([mathPlugin]));
|
|
148475
|
-
var
|
|
148459
|
+
var languageCharactersPlugins = ((opts === null || opts === void 0 ? void 0 : opts.languageCharacters) || []).map(function (config) {
|
|
148460
|
+
return (0, _characters["default"])(config);
|
|
148461
|
+
});
|
|
148462
|
+
var builtPlugins = (0, _compact["default"])([addIf('table', (0, _table["default"])(opts.table, (0, _compact["default"])([imagePlugin, mathPlugin].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins))))), addIf('bold', MarkHotkey({
|
|
148476
148463
|
key: 'b',
|
|
148477
148464
|
type: 'bold',
|
|
148478
148465
|
icon: _react$1c["default"].createElement(_FormatBold["default"], null),
|
|
@@ -148492,8 +148479,8 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
148492
148479
|
type: 'underline',
|
|
148493
148480
|
icon: _react$1c["default"].createElement(_FormatUnderlined["default"], null),
|
|
148494
148481
|
tag: 'u'
|
|
148495
|
-
})), addIf('image', imagePlugin), addIf('video', (0, _media["default"])('video', opts.media)), addIf('audio', (0, _media["default"])('audio', opts.media)), addIf('math', mathPlugin)].concat((0, _toConsumableArray2$2["default"])(
|
|
148496
|
-
return addIf('languageCharacters',
|
|
148482
|
+
})), addIf('image', imagePlugin), addIf('video', (0, _media["default"])('video', opts.media)), addIf('audio', (0, _media["default"])('audio', opts.media)), addIf('math', mathPlugin)].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins.map(function (plugin) {
|
|
148483
|
+
return addIf('languageCharacters', plugin);
|
|
148497
148484
|
})), [addIf('bulleted-list', (0, _list["default"])({
|
|
148498
148485
|
key: 'l',
|
|
148499
148486
|
type: 'ul_list',
|
|
@@ -156686,6 +156673,7 @@ const require$$23 = _dll_classnames;
|
|
|
156686
156673
|
isHtmlMode: isHtmlMode
|
|
156687
156674
|
});
|
|
156688
156675
|
};
|
|
156676
|
+
var MAX_CHARACTERS_LIMIT = 1000000;
|
|
156689
156677
|
var Editor = (function (_React$Component) {
|
|
156690
156678
|
(0, _inherits2["default"])(Editor, _React$Component);
|
|
156691
156679
|
var _super = _createSuper(Editor);
|
|
@@ -157066,7 +157054,11 @@ const require$$23 = _dll_classnames;
|
|
|
157066
157054
|
log('[onChange]');
|
|
157067
157055
|
var value = change.value;
|
|
157068
157056
|
var charactersLimit = _this.props.charactersLimit;
|
|
157069
|
-
|
|
157057
|
+
var limit = charactersLimit;
|
|
157058
|
+
if (!limit || limit > MAX_CHARACTERS_LIMIT) {
|
|
157059
|
+
limit = MAX_CHARACTERS_LIMIT;
|
|
157060
|
+
}
|
|
157061
|
+
if (value && value.document && value.document.text && value.document.text.length > limit) {
|
|
157070
157062
|
return;
|
|
157071
157063
|
}
|
|
157072
157064
|
var isEditedInHtmlMode = !_this.state.isHtmlMode ? false : _this.state.value.document.text !== value.document.text ? true : _this.state.isEditedInHtmlMode;
|
package/module/index.html
CHANGED
package/module/manifest.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/complex-rubric",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.4",
|
|
4
4
|
"modules": [
|
|
5
5
|
{
|
|
6
6
|
"name": "@pie-lib/pie-toolbox-math-rendering-module",
|
|
7
|
-
"version": "1.10.
|
|
7
|
+
"version": "1.10.4"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"name": "@pie-lib/pie-toolbox-module",
|
package/module/print.html
CHANGED
package/module/print.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.10.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.10.4/module/index.js";
|
|
2
2
|
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.12.0/module/index.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -37584,6 +37584,11 @@ const require$$14$5 = _dll_pie_framework__mathquill;
|
|
|
37584
37584
|
return;
|
|
37585
37585
|
}
|
|
37586
37586
|
});
|
|
37587
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onClick", function (event) {
|
|
37588
|
+
var onClick = _this.props.onClick;
|
|
37589
|
+
_this.refresh();
|
|
37590
|
+
onClick && onClick(event);
|
|
37591
|
+
});
|
|
37587
37592
|
return _this;
|
|
37588
37593
|
}
|
|
37589
37594
|
(0, _createClass2["default"])(Input, [{
|
|
@@ -37674,11 +37679,11 @@ const require$$14$5 = _dll_pie_framework__mathquill;
|
|
|
37674
37679
|
key: "render",
|
|
37675
37680
|
value: function render() {
|
|
37676
37681
|
var _this3 = this;
|
|
37677
|
-
var _this$props = this.props,
|
|
37682
|
+
var _this$props = this.props, onFocus = _this$props.onFocus, onBlur = _this$props.onBlur, classes = _this$props.classes, className = _this$props.className;
|
|
37678
37683
|
return _react["default"].createElement("span", {
|
|
37679
37684
|
className: (0, _classnames["default"])(classes.input, className),
|
|
37680
|
-
|
|
37681
|
-
onClick: onClick,
|
|
37685
|
+
onKeyDown: this.onKeyPress,
|
|
37686
|
+
onClick: this.onClick,
|
|
37682
37687
|
onFocus: onFocus,
|
|
37683
37688
|
onBlur: onBlur,
|
|
37684
37689
|
ref: function ref(r) {
|
|
@@ -117513,7 +117518,6 @@ const require$$12$h = _dll_debug;
|
|
|
117513
117518
|
};
|
|
117514
117519
|
var mmlConfig = {
|
|
117515
117520
|
parseError: function parseError(node) {
|
|
117516
|
-
console.log('error:', node);
|
|
117517
117521
|
this.error(this.adaptor.textContent(node).replace(/\n.*/g, ''));
|
|
117518
117522
|
}
|
|
117519
117523
|
};
|
|
@@ -117526,11 +117530,9 @@ const require$$12$h = _dll_debug;
|
|
|
117526
117530
|
var customMmlFactory = new _MmlFactory.MmlFactory(_objectSpread(_objectSpread({}, _MmlFactory.MmlFactory.defaultNodes), _mstack.mmlNodes));
|
|
117527
117531
|
var html = _mathjax.mathjax.document(docProvided, {
|
|
117528
117532
|
compileError: function compileError(mj, math, err) {
|
|
117529
|
-
console.log('bad math?:', math);
|
|
117530
117533
|
console.error(err);
|
|
117531
117534
|
},
|
|
117532
117535
|
typesetError: function typesetError(doc, math, err) {
|
|
117533
|
-
console.log('typeset error');
|
|
117534
117536
|
console.error(err);
|
|
117535
117537
|
doc.typesetError(math, err);
|
|
117536
117538
|
},
|
|
@@ -117576,13 +117578,10 @@ const require$$12$h = _dll_debug;
|
|
|
117576
117578
|
var renderMath = function renderMath(el, renderOpts) {
|
|
117577
117579
|
var _getGlobal$instance, _getGlobal$instance2;
|
|
117578
117580
|
if (window && window.MathJax && window.MathJax.customKey && window.MathJax.customKey == '@pie-lib/math-rendering-accessible@1') {
|
|
117579
|
-
console.log('RETURN FROM OLD MATH RENDERING, MATH RENDERING ACCESSIBLE WAS FOUND');
|
|
117580
117581
|
return;
|
|
117581
117582
|
}
|
|
117582
|
-
console.log('we are in old math rendering');
|
|
117583
117583
|
var isString = typeof el === 'string';
|
|
117584
117584
|
var executeOn = document.body;
|
|
117585
|
-
console.log(isString, 'is string in old math rendering');
|
|
117586
117585
|
if (isString) {
|
|
117587
117586
|
var div = document.createElement('div');
|
|
117588
117587
|
div.innerHTML = el;
|
|
@@ -117595,14 +117594,11 @@ const require$$12$h = _dll_debug;
|
|
|
117595
117594
|
var updatedDocument = html.findMath().compile().getMetrics().typeset().updateDocument();
|
|
117596
117595
|
var list = updatedDocument.math.list;
|
|
117597
117596
|
var item = list.next;
|
|
117598
|
-
console.log(item, 'item in old math rendering');
|
|
117599
117597
|
if (!item) {
|
|
117600
|
-
console.log("return '' in old math rendering");
|
|
117601
117598
|
return '';
|
|
117602
117599
|
}
|
|
117603
117600
|
var mathMl = toMMl(item.data.root);
|
|
117604
117601
|
var parsedMathMl = mathMl.replaceAll('\n', '');
|
|
117605
|
-
console.log(parsedMathMl, 'parsedMathMl in old math rendering');
|
|
117606
117602
|
return parsedMathMl;
|
|
117607
117603
|
}
|
|
117608
117604
|
if (!getGlobal().instance) {
|
|
@@ -117612,14 +117608,11 @@ const require$$12$h = _dll_debug;
|
|
|
117612
117608
|
log('el is undefined');
|
|
117613
117609
|
return;
|
|
117614
117610
|
}
|
|
117615
|
-
console.log(el, 'element in old math rendering');
|
|
117616
117611
|
if (el instanceof Element && (_getGlobal$instance = getGlobal().instance) !== null && _getGlobal$instance !== void 0 && _getGlobal$instance.Typeset) {
|
|
117617
|
-
console.log('Typeset element in old math rendering');
|
|
117618
117612
|
getGlobal().instance.Typeset(el);
|
|
117619
117613
|
} else if (el.length && (_getGlobal$instance2 = getGlobal().instance) !== null && _getGlobal$instance2 !== void 0 && _getGlobal$instance2.Typeset) {
|
|
117620
117614
|
var _getGlobal$instance3;
|
|
117621
117615
|
var arr = Array.from(el);
|
|
117622
|
-
console.log(arr, 'Typeset arr in old math rendering');
|
|
117623
117616
|
(_getGlobal$instance3 = getGlobal().instance).Typeset.apply(_getGlobal$instance3, (0, _toConsumableArray2["default"])(arr));
|
|
117624
117617
|
}
|
|
117625
117618
|
};
|
|
@@ -126590,10 +126583,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126590
126583
|
return ((_window = window) === null || _window === void 0 ? void 0 : (_window$MathJax = _window.MathJax) === null || _window$MathJax === void 0 ? void 0 : _window$MathJax.customKey) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MathJax = _window2.MathJax) === null || _window2$MathJax === void 0 ? void 0 : (_window2$MathJax$conf = _window2$MathJax.config) === null || _window2$MathJax$conf === void 0 ? void 0 : _window2$MathJax$conf.customKey);
|
|
126591
126584
|
};
|
|
126592
126585
|
var renderMath = function renderMath(el, renderOpts) {
|
|
126593
|
-
console.log("I'm in math rendering accessible");
|
|
126594
126586
|
var isString = typeof el === 'string';
|
|
126595
|
-
console.log('IS STRING', isString);
|
|
126596
|
-
console.log('renderOpts', renderOpts);
|
|
126597
126587
|
var executeOn = document.body;
|
|
126598
126588
|
if (isString) {
|
|
126599
126589
|
var div = document.createElement('div');
|
|
@@ -126601,19 +126591,16 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126601
126591
|
executeOn = div;
|
|
126602
126592
|
}
|
|
126603
126593
|
var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
|
|
126604
|
-
console.log(skipWaitForMathRenderingLib, 'skipWaitForMathRenderingLib');
|
|
126605
126594
|
var renderMathAccessible = function renderMathAccessible() {
|
|
126606
126595
|
fixMathElements(executeOn);
|
|
126607
126596
|
adjustMathMLStyle(executeOn);
|
|
126608
126597
|
var mathJaxCustomKey = getMathJaxCustomKey();
|
|
126609
126598
|
if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
|
|
126610
|
-
console.log('INITIALIZE MATHJAX ACCESSIBLE');
|
|
126611
126599
|
renderOpts = renderOpts || defaultOpts();
|
|
126612
126600
|
(0, _mathjaxScript.initializeMathJax)(renderOpts);
|
|
126613
126601
|
}
|
|
126614
126602
|
if (isString && window.MathJax && window.mathjaxLoadedP) {
|
|
126615
126603
|
try {
|
|
126616
|
-
console.log('THE ISSUE MUST BE HERE');
|
|
126617
126604
|
MathJax.texReset();
|
|
126618
126605
|
MathJax.typesetClear();
|
|
126619
126606
|
window.MathJax.typeset([executeOn]);
|
|
@@ -126622,7 +126609,6 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126622
126609
|
var item = list.next;
|
|
126623
126610
|
var mathMl = toMMl(item.data.root);
|
|
126624
126611
|
var parsedMathMl = mathMl.replaceAll('\n', '');
|
|
126625
|
-
console.log(parsedMathMl, 'parsedMathMl');
|
|
126626
126612
|
return parsedMathMl;
|
|
126627
126613
|
} catch (error) {
|
|
126628
126614
|
console.error('Error rendering math:', error.message);
|
|
@@ -126631,13 +126617,11 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126631
126617
|
if (window.mathjaxLoadedP) {
|
|
126632
126618
|
window.mathjaxLoadedP.then(function () {
|
|
126633
126619
|
var mathJaxInstance = getGlobal().instance;
|
|
126634
|
-
console.log(mathJaxInstance, 'mathJaxInstance');
|
|
126635
126620
|
if (mathJaxInstance) {
|
|
126636
126621
|
mathJaxInstance.texReset();
|
|
126637
126622
|
mathJaxInstance.typesetClear();
|
|
126638
126623
|
mathJaxInstance.typesetPromise([executeOn]).then(function () {
|
|
126639
126624
|
try {
|
|
126640
|
-
console.log("I'm in typesetPromise???");
|
|
126641
126625
|
removeExcessMjxContainers(executeOn);
|
|
126642
126626
|
removePlaceholdersAndRestoreDisplay();
|
|
126643
126627
|
var _updatedDocument = mathJaxInstance.startup.document;
|
|
@@ -126661,16 +126645,13 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126661
126645
|
}
|
|
126662
126646
|
};
|
|
126663
126647
|
if (skipWaitForMathRenderingLib) {
|
|
126664
|
-
console.log(skipWaitForMathRenderingLib, 'skipWaitForMathRenderingLib');
|
|
126665
126648
|
return renderMathAccessible();
|
|
126666
126649
|
} else {
|
|
126667
126650
|
if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
|
|
126668
|
-
console.log(mathRenderingKEY, 'mathRenderingKEY');
|
|
126669
126651
|
removePlaceholdersAndRestoreDisplay();
|
|
126670
126652
|
return mr.renderMath(executeOn, renderOpts);
|
|
126671
126653
|
}
|
|
126672
126654
|
if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
|
|
126673
|
-
console.log(mathRenderingAccessibleKEY, 'mathRenderingAccessibleKEY');
|
|
126674
126655
|
return renderMathAccessible();
|
|
126675
126656
|
}
|
|
126676
126657
|
var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
|
|
@@ -126685,7 +126666,6 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126685
126666
|
if (mathRenderingHasLoaded || hasExceededMaxWait) {
|
|
126686
126667
|
clearInterval(checkIntervalId);
|
|
126687
126668
|
if (mathRenderingHasLoaded) {
|
|
126688
|
-
console.log(mathRenderingHasLoaded, 'mathRenderingHasLoaded');
|
|
126689
126669
|
removePlaceholdersAndRestoreDisplay();
|
|
126690
126670
|
return mr.renderMath(executeOn, renderOpts);
|
|
126691
126671
|
}
|
|
@@ -126694,7 +126674,6 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126694
126674
|
};
|
|
126695
126675
|
checkIntervalId = setInterval(checkForLib, 100);
|
|
126696
126676
|
};
|
|
126697
|
-
console.log('waitForMathRenderingLib');
|
|
126698
126677
|
waitForMathRenderingLib(renderMathAccessible);
|
|
126699
126678
|
}
|
|
126700
126679
|
};
|
|
@@ -134337,7 +134316,7 @@ const require$$17$2 = _dll_debug;
|
|
|
134337
134316
|
(0, _createClass2["default"])(TableToolbar, [{
|
|
134338
134317
|
key: "render",
|
|
134339
134318
|
value: function render() {
|
|
134340
|
-
var _this$props = this.props, plugins = _this$props.plugins, value = _this$props.value, onChange = _this$props.onChange, onAddRow = _this$props.onAddRow, onRemoveRow = _this$props.onRemoveRow, onAddColumn = _this$props.onAddColumn, onRemoveColumn = _this$props.onRemoveColumn, onRemoveTable = _this$props.onRemoveTable, onToggleBorder = _this$props.onToggleBorder, hasBorder = _this$props.hasBorder, classes = _this$props.classes;
|
|
134319
|
+
var _this$props = this.props, getFocusedValue = _this$props.getFocusedValue, plugins = _this$props.plugins, value = _this$props.value, onChange = _this$props.onChange, onAddRow = _this$props.onAddRow, onRemoveRow = _this$props.onRemoveRow, onAddColumn = _this$props.onAddColumn, onRemoveColumn = _this$props.onRemoveColumn, onRemoveTable = _this$props.onRemoveTable, onToggleBorder = _this$props.onToggleBorder, hasBorder = _this$props.hasBorder, classes = _this$props.classes;
|
|
134341
134320
|
log('[render] hasBorder:', hasBorder);
|
|
134342
134321
|
return _react["default"].createElement("div", {
|
|
134343
134322
|
className: classes.tableToolbar
|
|
@@ -134358,7 +134337,8 @@ const require$$17$2 = _dll_debug;
|
|
|
134358
134337
|
key: ("plugin-").concat(index)
|
|
134359
134338
|
}, p.toolbar, {
|
|
134360
134339
|
value: value,
|
|
134361
|
-
onChange: onChange
|
|
134340
|
+
onChange: onChange,
|
|
134341
|
+
getFocusedValue: getFocusedValue
|
|
134362
134342
|
}));
|
|
134363
134343
|
}), _react["default"].createElement(_toolbarButtons.Button, {
|
|
134364
134344
|
onClick: onToggleBorder,
|
|
@@ -135020,7 +135000,7 @@ const require$$9$s = _dll_prop_types;
|
|
|
135020
135000
|
supports: function supports(node, value) {
|
|
135021
135001
|
return node && node.object === 'block' && core.utils.isSelectionInTable(value);
|
|
135022
135002
|
},
|
|
135023
|
-
customToolbar: function customToolbar(node, value, onToolbarDone) {
|
|
135003
|
+
customToolbar: function customToolbar(node, value, onToolbarDone, getFocusedValue) {
|
|
135024
135004
|
log('[customToolbar] node.data: ', node.data);
|
|
135025
135005
|
var tableBlock = core.utils.getTableBlock(value.document, node === null || node === void 0 ? void 0 : node.key);
|
|
135026
135006
|
log('[customToolbar] tableBlock: ', tableBlock);
|
|
@@ -135062,6 +135042,7 @@ const require$$9$s = _dll_prop_types;
|
|
|
135062
135042
|
};
|
|
135063
135043
|
var Tb = function Tb() {
|
|
135064
135044
|
return _react["default"].createElement(_tableToolbar["default"], {
|
|
135045
|
+
getFocusedValue: getFocusedValue,
|
|
135065
135046
|
plugins: toolbarPlugins,
|
|
135066
135047
|
onChange: function onChange(c) {
|
|
135067
135048
|
return onToolbarDone(c, false);
|
|
@@ -147449,8 +147430,8 @@ const require$$11$l = _dll_prop_types;
|
|
|
147449
147430
|
var letter = _ref2.letter;
|
|
147450
147431
|
return _react["default"].createElement("div", {
|
|
147451
147432
|
style: {
|
|
147452
|
-
fontSize: '
|
|
147453
|
-
lineHeight: '
|
|
147433
|
+
fontSize: '24px',
|
|
147434
|
+
lineHeight: '24px'
|
|
147454
147435
|
}
|
|
147455
147436
|
}, letter);
|
|
147456
147437
|
};
|
|
@@ -147469,7 +147450,9 @@ const require$$11$l = _dll_prop_types;
|
|
|
147469
147450
|
var editorDOM = document.querySelector(("[data-key=\"").concat(value.document.key, "\"]"));
|
|
147470
147451
|
var valueToUse = value;
|
|
147471
147452
|
var callback = function callback(_char, focus) {
|
|
147472
|
-
|
|
147453
|
+
if (getFocusedValue) {
|
|
147454
|
+
valueToUse = getFocusedValue() || valueToUse;
|
|
147455
|
+
}
|
|
147473
147456
|
if (_char) {
|
|
147474
147457
|
var change = valueToUse.change().insertTextByKey(valueToUse.anchorKey, valueToUse.anchorOffset, _char);
|
|
147475
147458
|
valueToUse = change.value;
|
|
@@ -147616,7 +147599,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147616
147599
|
}
|
|
147617
147600
|
}
|
|
147618
147601
|
var log = (0, _debug["default"])('@pie-lib:editable-html:plugins:toolbar');
|
|
147619
|
-
var getCustomToolbar = function getCustomToolbar(plugin, node, value, handleDone, onDataChange) {
|
|
147602
|
+
var getCustomToolbar = function getCustomToolbar(plugin, node, value, handleDone, getFocusedValue, onDataChange) {
|
|
147620
147603
|
if (!plugin) {
|
|
147621
147604
|
return;
|
|
147622
147605
|
}
|
|
@@ -147627,7 +147610,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147627
147610
|
return plugin.toolbar.CustomToolbarComp;
|
|
147628
147611
|
} else if (typeof plugin.toolbar.customToolbar === 'function') {
|
|
147629
147612
|
log('deprecated - use CustomToolbarComp');
|
|
147630
|
-
return plugin.toolbar.customToolbar(node, value, handleDone, onDataChange);
|
|
147613
|
+
return plugin.toolbar.customToolbar(node, value, handleDone, getFocusedValue, onDataChange);
|
|
147631
147614
|
}
|
|
147632
147615
|
};
|
|
147633
147616
|
var Toolbar = (function (_React$Component) {
|
|
@@ -147737,7 +147720,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147737
147720
|
var handleDataChange = function handleDataChange(key, data) {
|
|
147738
147721
|
_this2.props.onDataChange(key, data);
|
|
147739
147722
|
};
|
|
147740
|
-
var CustomToolbar = getCustomToolbar(plugin, node, value, handleDone, this.props.onDataChange);
|
|
147723
|
+
var CustomToolbar = getCustomToolbar(plugin, node, value, handleDone, getFocusedValue, this.props.onDataChange);
|
|
147741
147724
|
var filteredPlugins = plugin && plugin.filterPlugins ? plugin.filterPlugins(node, plugins) : plugins;
|
|
147742
147725
|
log('[render] CustomToolbar: ', CustomToolbar);
|
|
147743
147726
|
var parentExtraStyles = parentPlugin && parentPlugin.pluginStyles ? parentPlugin.pluginStyles(node, parentNode, plugin) : {};
|
|
@@ -147756,6 +147739,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147756
147739
|
}, CustomToolbar ? _react["default"].createElement(CustomToolbar, {
|
|
147757
147740
|
node: node,
|
|
147758
147741
|
value: value,
|
|
147742
|
+
getFocusedValue: getFocusedValue,
|
|
147759
147743
|
onToolbarDone: this.onToolbarDone,
|
|
147760
147744
|
onDataChange: handleDataChange,
|
|
147761
147745
|
pluginProps: pluginProps
|
|
@@ -148472,7 +148456,10 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
148472
148456
|
var imagePlugin = opts.image && opts.image.onDelete && (0, _image["default"])(opts.image);
|
|
148473
148457
|
var mathPlugin = (0, _math["default"])(opts.math);
|
|
148474
148458
|
var respAreaPlugin = opts.responseArea && opts.responseArea.type && (0, _respArea["default"])(opts.responseArea, (0, _compact["default"])([mathPlugin]));
|
|
148475
|
-
var
|
|
148459
|
+
var languageCharactersPlugins = ((opts === null || opts === void 0 ? void 0 : opts.languageCharacters) || []).map(function (config) {
|
|
148460
|
+
return (0, _characters["default"])(config);
|
|
148461
|
+
});
|
|
148462
|
+
var builtPlugins = (0, _compact["default"])([addIf('table', (0, _table["default"])(opts.table, (0, _compact["default"])([imagePlugin, mathPlugin].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins))))), addIf('bold', MarkHotkey({
|
|
148476
148463
|
key: 'b',
|
|
148477
148464
|
type: 'bold',
|
|
148478
148465
|
icon: _react$1c["default"].createElement(_FormatBold["default"], null),
|
|
@@ -148492,8 +148479,8 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
148492
148479
|
type: 'underline',
|
|
148493
148480
|
icon: _react$1c["default"].createElement(_FormatUnderlined["default"], null),
|
|
148494
148481
|
tag: 'u'
|
|
148495
|
-
})), addIf('image', imagePlugin), addIf('video', (0, _media["default"])('video', opts.media)), addIf('audio', (0, _media["default"])('audio', opts.media)), addIf('math', mathPlugin)].concat((0, _toConsumableArray2$2["default"])(
|
|
148496
|
-
return addIf('languageCharacters',
|
|
148482
|
+
})), addIf('image', imagePlugin), addIf('video', (0, _media["default"])('video', opts.media)), addIf('audio', (0, _media["default"])('audio', opts.media)), addIf('math', mathPlugin)].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins.map(function (plugin) {
|
|
148483
|
+
return addIf('languageCharacters', plugin);
|
|
148497
148484
|
})), [addIf('bulleted-list', (0, _list["default"])({
|
|
148498
148485
|
key: 'l',
|
|
148499
148486
|
type: 'ul_list',
|
|
@@ -156686,6 +156673,7 @@ const require$$23 = _dll_classnames;
|
|
|
156686
156673
|
isHtmlMode: isHtmlMode
|
|
156687
156674
|
});
|
|
156688
156675
|
};
|
|
156676
|
+
var MAX_CHARACTERS_LIMIT = 1000000;
|
|
156689
156677
|
var Editor = (function (_React$Component) {
|
|
156690
156678
|
(0, _inherits2["default"])(Editor, _React$Component);
|
|
156691
156679
|
var _super = _createSuper(Editor);
|
|
@@ -157066,7 +157054,11 @@ const require$$23 = _dll_classnames;
|
|
|
157066
157054
|
log('[onChange]');
|
|
157067
157055
|
var value = change.value;
|
|
157068
157056
|
var charactersLimit = _this.props.charactersLimit;
|
|
157069
|
-
|
|
157057
|
+
var limit = charactersLimit;
|
|
157058
|
+
if (!limit || limit > MAX_CHARACTERS_LIMIT) {
|
|
157059
|
+
limit = MAX_CHARACTERS_LIMIT;
|
|
157060
|
+
}
|
|
157061
|
+
if (value && value.document && value.document.text && value.document.text.length > limit) {
|
|
157070
157062
|
return;
|
|
157071
157063
|
}
|
|
157072
157064
|
var isEditedInHtmlMode = !_this.state.isHtmlMode ? false : _this.state.value.document.text !== value.document.text ? true : _this.state.isEditedInHtmlMode;
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/complex-rubric",
|
|
3
3
|
"repository": "pie-framework/pie-elements",
|
|
4
|
-
"version": "2.10.
|
|
4
|
+
"version": "2.10.5",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@material-ui/core": "^3.9.2",
|
|
10
|
-
"@pie-element/multi-trait-rubric": "^3.10.
|
|
11
|
-
"@pie-element/rubric": "^3.10.
|
|
10
|
+
"@pie-element/multi-trait-rubric": "^3.10.5",
|
|
11
|
+
"@pie-element/rubric": "^3.10.5",
|
|
12
12
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
13
13
|
"classnames": "^2.2.5",
|
|
14
14
|
"debug": "^4.1.1",
|
|
15
15
|
"lodash": "^4.17.11",
|
|
16
16
|
"prop-types": "^15.7.2"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "45597f58c90f92d58a6713eeae1eb5d0dfb1f371",
|
|
19
19
|
"scripts": {
|
|
20
20
|
"postpublish": "../../scripts/postpublish"
|
|
21
21
|
},
|