@pie-element/complex-rubric 2.10.2 → 2.10.4
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 +37 -22
- package/module/element.js +37 -22
- package/module/index.html +1 -1
- package/module/manifest.json +2 -2
- package/module/print.html +1 -1
- package/module/print.js +37 -22
- 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.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)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* 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))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* update pie-lib/pie-toolbox PD-3731 ([2b5d6c9](https://github.com/pie-framework/pie-elements/commit/2b5d6c932280981a0fd636bcb30d7fbc181ac311))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [2.10.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@2.10.1...@pie-element/complex-rubric@2.10.2) (2024-05-03)
|
|
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.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)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/complex-rubric-configure
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [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)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-element/complex-rubric-configure
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [2.2.17](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@2.2.16...@pie-element/complex-rubric-configure@2.2.17) (2024-05-03)
|
|
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.19",
|
|
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.4",
|
|
12
|
+
"@pie-element/rubric": "^3.10.4",
|
|
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.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)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* 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))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* update pie-lib/pie-toolbox PD-3731 ([2b5d6c9](https://github.com/pie-framework/pie-elements/commit/2b5d6c932280981a0fd636bcb30d7fbc181ac311))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [2.9.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-controller@2.9.1...@pie-element/complex-rubric-controller@2.9.2) (2024-05-03)
|
|
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.4",
|
|
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.4",
|
|
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.3/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
|
},
|
|
@@ -104321,7 +104318,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
104321
104318
|
} else {
|
|
104322
104319
|
if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
|
|
104323
104320
|
removePlaceholdersAndRestoreDisplay();
|
|
104324
|
-
return mr.renderMath();
|
|
104321
|
+
return mr.renderMath(executeOn, renderOpts);
|
|
104325
104322
|
}
|
|
104326
104323
|
if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
|
|
104327
104324
|
return renderMathAccessible();
|
|
@@ -104339,7 +104336,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
104339
104336
|
clearInterval(checkIntervalId);
|
|
104340
104337
|
if (mathRenderingHasLoaded) {
|
|
104341
104338
|
removePlaceholdersAndRestoreDisplay();
|
|
104342
|
-
return mr.renderMath();
|
|
104339
|
+
return mr.renderMath(executeOn, renderOpts);
|
|
104343
104340
|
}
|
|
104344
104341
|
renderMathAccessibleCallback();
|
|
104345
104342
|
}
|
|
@@ -136758,6 +136755,11 @@ const require$$14$5 = _dll_pie_framework__mathquill;
|
|
|
136758
136755
|
return;
|
|
136759
136756
|
}
|
|
136760
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
|
+
});
|
|
136761
136763
|
return _this;
|
|
136762
136764
|
}
|
|
136763
136765
|
(0, _createClass2["default"])(Input, [{
|
|
@@ -136848,11 +136850,11 @@ const require$$14$5 = _dll_pie_framework__mathquill;
|
|
|
136848
136850
|
key: "render",
|
|
136849
136851
|
value: function render() {
|
|
136850
136852
|
var _this3 = this;
|
|
136851
|
-
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;
|
|
136852
136854
|
return _react["default"].createElement("span", {
|
|
136853
136855
|
className: (0, _classnames["default"])(classes.input, className),
|
|
136854
|
-
|
|
136855
|
-
onClick: onClick,
|
|
136856
|
+
onKeyDown: this.onKeyPress,
|
|
136857
|
+
onClick: this.onClick,
|
|
136856
136858
|
onFocus: onFocus,
|
|
136857
136859
|
onBlur: onBlur,
|
|
136858
136860
|
ref: function ref(r) {
|
|
@@ -144123,7 +144125,7 @@ const require$$17$2 = _dll_debug;
|
|
|
144123
144125
|
(0, _createClass2["default"])(TableToolbar, [{
|
|
144124
144126
|
key: "render",
|
|
144125
144127
|
value: function render() {
|
|
144126
|
-
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;
|
|
144127
144129
|
log('[render] hasBorder:', hasBorder);
|
|
144128
144130
|
return _react["default"].createElement("div", {
|
|
144129
144131
|
className: classes.tableToolbar
|
|
@@ -144144,7 +144146,8 @@ const require$$17$2 = _dll_debug;
|
|
|
144144
144146
|
key: ("plugin-").concat(index)
|
|
144145
144147
|
}, p.toolbar, {
|
|
144146
144148
|
value: value,
|
|
144147
|
-
onChange: onChange
|
|
144149
|
+
onChange: onChange,
|
|
144150
|
+
getFocusedValue: getFocusedValue
|
|
144148
144151
|
}));
|
|
144149
144152
|
}), _react["default"].createElement(_toolbarButtons.Button, {
|
|
144150
144153
|
onClick: onToggleBorder,
|
|
@@ -144806,7 +144809,7 @@ const require$$9$r = _dll_prop_types;
|
|
|
144806
144809
|
supports: function supports(node, value) {
|
|
144807
144810
|
return node && node.object === 'block' && core.utils.isSelectionInTable(value);
|
|
144808
144811
|
},
|
|
144809
|
-
customToolbar: function customToolbar(node, value, onToolbarDone) {
|
|
144812
|
+
customToolbar: function customToolbar(node, value, onToolbarDone, getFocusedValue) {
|
|
144810
144813
|
log('[customToolbar] node.data: ', node.data);
|
|
144811
144814
|
var tableBlock = core.utils.getTableBlock(value.document, node === null || node === void 0 ? void 0 : node.key);
|
|
144812
144815
|
log('[customToolbar] tableBlock: ', tableBlock);
|
|
@@ -144848,6 +144851,7 @@ const require$$9$r = _dll_prop_types;
|
|
|
144848
144851
|
};
|
|
144849
144852
|
var Tb = function Tb() {
|
|
144850
144853
|
return _react["default"].createElement(_tableToolbar["default"], {
|
|
144854
|
+
getFocusedValue: getFocusedValue,
|
|
144851
144855
|
plugins: toolbarPlugins,
|
|
144852
144856
|
onChange: function onChange(c) {
|
|
144853
144857
|
return onToolbarDone(c, false);
|
|
@@ -149159,8 +149163,8 @@ const require$$11$l = _dll_prop_types;
|
|
|
149159
149163
|
var letter = _ref2.letter;
|
|
149160
149164
|
return _react["default"].createElement("div", {
|
|
149161
149165
|
style: {
|
|
149162
|
-
fontSize: '
|
|
149163
|
-
lineHeight: '
|
|
149166
|
+
fontSize: '24px',
|
|
149167
|
+
lineHeight: '24px'
|
|
149164
149168
|
}
|
|
149165
149169
|
}, letter);
|
|
149166
149170
|
};
|
|
@@ -149179,7 +149183,9 @@ const require$$11$l = _dll_prop_types;
|
|
|
149179
149183
|
var editorDOM = document.querySelector(("[data-key=\"").concat(value.document.key, "\"]"));
|
|
149180
149184
|
var valueToUse = value;
|
|
149181
149185
|
var callback = function callback(_char, focus) {
|
|
149182
|
-
|
|
149186
|
+
if (getFocusedValue) {
|
|
149187
|
+
valueToUse = getFocusedValue() || valueToUse;
|
|
149188
|
+
}
|
|
149183
149189
|
if (_char) {
|
|
149184
149190
|
var change = valueToUse.change().insertTextByKey(valueToUse.anchorKey, valueToUse.anchorOffset, _char);
|
|
149185
149191
|
valueToUse = change.value;
|
|
@@ -149326,7 +149332,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
149326
149332
|
}
|
|
149327
149333
|
}
|
|
149328
149334
|
var log = (0, _debug["default"])('@pie-lib:editable-html:plugins:toolbar');
|
|
149329
|
-
var getCustomToolbar = function getCustomToolbar(plugin, node, value, handleDone, onDataChange) {
|
|
149335
|
+
var getCustomToolbar = function getCustomToolbar(plugin, node, value, handleDone, getFocusedValue, onDataChange) {
|
|
149330
149336
|
if (!plugin) {
|
|
149331
149337
|
return;
|
|
149332
149338
|
}
|
|
@@ -149337,7 +149343,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
149337
149343
|
return plugin.toolbar.CustomToolbarComp;
|
|
149338
149344
|
} else if (typeof plugin.toolbar.customToolbar === 'function') {
|
|
149339
149345
|
log('deprecated - use CustomToolbarComp');
|
|
149340
|
-
return plugin.toolbar.customToolbar(node, value, handleDone, onDataChange);
|
|
149346
|
+
return plugin.toolbar.customToolbar(node, value, handleDone, getFocusedValue, onDataChange);
|
|
149341
149347
|
}
|
|
149342
149348
|
};
|
|
149343
149349
|
var Toolbar = (function (_React$Component) {
|
|
@@ -149447,7 +149453,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
149447
149453
|
var handleDataChange = function handleDataChange(key, data) {
|
|
149448
149454
|
_this2.props.onDataChange(key, data);
|
|
149449
149455
|
};
|
|
149450
|
-
var CustomToolbar = getCustomToolbar(plugin, node, value, handleDone, this.props.onDataChange);
|
|
149456
|
+
var CustomToolbar = getCustomToolbar(plugin, node, value, handleDone, getFocusedValue, this.props.onDataChange);
|
|
149451
149457
|
var filteredPlugins = plugin && plugin.filterPlugins ? plugin.filterPlugins(node, plugins) : plugins;
|
|
149452
149458
|
log('[render] CustomToolbar: ', CustomToolbar);
|
|
149453
149459
|
var parentExtraStyles = parentPlugin && parentPlugin.pluginStyles ? parentPlugin.pluginStyles(node, parentNode, plugin) : {};
|
|
@@ -149466,6 +149472,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
149466
149472
|
}, CustomToolbar ? _react["default"].createElement(CustomToolbar, {
|
|
149467
149473
|
node: node,
|
|
149468
149474
|
value: value,
|
|
149475
|
+
getFocusedValue: getFocusedValue,
|
|
149469
149476
|
onToolbarDone: this.onToolbarDone,
|
|
149470
149477
|
onDataChange: handleDataChange,
|
|
149471
149478
|
pluginProps: pluginProps
|
|
@@ -150182,7 +150189,10 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
150182
150189
|
var imagePlugin = opts.image && opts.image.onDelete && (0, _image["default"])(opts.image);
|
|
150183
150190
|
var mathPlugin = (0, _math["default"])(opts.math);
|
|
150184
150191
|
var respAreaPlugin = opts.responseArea && opts.responseArea.type && (0, _respArea["default"])(opts.responseArea, (0, _compact["default"])([mathPlugin]));
|
|
150185
|
-
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({
|
|
150186
150196
|
key: 'b',
|
|
150187
150197
|
type: 'bold',
|
|
150188
150198
|
icon: _react$1e["default"].createElement(_FormatBold["default"], null),
|
|
@@ -150202,8 +150212,8 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
150202
150212
|
type: 'underline',
|
|
150203
150213
|
icon: _react$1e["default"].createElement(_FormatUnderlined["default"], null),
|
|
150204
150214
|
tag: 'u'
|
|
150205
|
-
})), 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"])(
|
|
150206
|
-
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);
|
|
150207
150217
|
})), [addIf('bulleted-list', (0, _list["default"])({
|
|
150208
150218
|
key: 'l',
|
|
150209
150219
|
type: 'ul_list',
|
|
@@ -158591,6 +158601,7 @@ const require$$23 = _dll_classnames;
|
|
|
158591
158601
|
isHtmlMode: isHtmlMode
|
|
158592
158602
|
});
|
|
158593
158603
|
};
|
|
158604
|
+
var MAX_CHARACTERS_LIMIT = 1000000;
|
|
158594
158605
|
var Editor = (function (_React$Component) {
|
|
158595
158606
|
(0, _inherits2["default"])(Editor, _React$Component);
|
|
158596
158607
|
var _super = _createSuper(Editor);
|
|
@@ -158971,7 +158982,11 @@ const require$$23 = _dll_classnames;
|
|
|
158971
158982
|
log('[onChange]');
|
|
158972
158983
|
var value = change.value;
|
|
158973
158984
|
var charactersLimit = _this.props.charactersLimit;
|
|
158974
|
-
|
|
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) {
|
|
158975
158990
|
return;
|
|
158976
158991
|
}
|
|
158977
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.3/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
|
},
|
|
@@ -126647,7 +126649,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126647
126649
|
} else {
|
|
126648
126650
|
if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
|
|
126649
126651
|
removePlaceholdersAndRestoreDisplay();
|
|
126650
|
-
return mr.renderMath();
|
|
126652
|
+
return mr.renderMath(executeOn, renderOpts);
|
|
126651
126653
|
}
|
|
126652
126654
|
if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
|
|
126653
126655
|
return renderMathAccessible();
|
|
@@ -126665,7 +126667,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126665
126667
|
clearInterval(checkIntervalId);
|
|
126666
126668
|
if (mathRenderingHasLoaded) {
|
|
126667
126669
|
removePlaceholdersAndRestoreDisplay();
|
|
126668
|
-
return mr.renderMath();
|
|
126670
|
+
return mr.renderMath(executeOn, renderOpts);
|
|
126669
126671
|
}
|
|
126670
126672
|
renderMathAccessibleCallback();
|
|
126671
126673
|
}
|
|
@@ -134314,7 +134316,7 @@ const require$$17$2 = _dll_debug;
|
|
|
134314
134316
|
(0, _createClass2["default"])(TableToolbar, [{
|
|
134315
134317
|
key: "render",
|
|
134316
134318
|
value: function render() {
|
|
134317
|
-
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;
|
|
134318
134320
|
log('[render] hasBorder:', hasBorder);
|
|
134319
134321
|
return _react["default"].createElement("div", {
|
|
134320
134322
|
className: classes.tableToolbar
|
|
@@ -134335,7 +134337,8 @@ const require$$17$2 = _dll_debug;
|
|
|
134335
134337
|
key: ("plugin-").concat(index)
|
|
134336
134338
|
}, p.toolbar, {
|
|
134337
134339
|
value: value,
|
|
134338
|
-
onChange: onChange
|
|
134340
|
+
onChange: onChange,
|
|
134341
|
+
getFocusedValue: getFocusedValue
|
|
134339
134342
|
}));
|
|
134340
134343
|
}), _react["default"].createElement(_toolbarButtons.Button, {
|
|
134341
134344
|
onClick: onToggleBorder,
|
|
@@ -134997,7 +135000,7 @@ const require$$9$s = _dll_prop_types;
|
|
|
134997
135000
|
supports: function supports(node, value) {
|
|
134998
135001
|
return node && node.object === 'block' && core.utils.isSelectionInTable(value);
|
|
134999
135002
|
},
|
|
135000
|
-
customToolbar: function customToolbar(node, value, onToolbarDone) {
|
|
135003
|
+
customToolbar: function customToolbar(node, value, onToolbarDone, getFocusedValue) {
|
|
135001
135004
|
log('[customToolbar] node.data: ', node.data);
|
|
135002
135005
|
var tableBlock = core.utils.getTableBlock(value.document, node === null || node === void 0 ? void 0 : node.key);
|
|
135003
135006
|
log('[customToolbar] tableBlock: ', tableBlock);
|
|
@@ -135039,6 +135042,7 @@ const require$$9$s = _dll_prop_types;
|
|
|
135039
135042
|
};
|
|
135040
135043
|
var Tb = function Tb() {
|
|
135041
135044
|
return _react["default"].createElement(_tableToolbar["default"], {
|
|
135045
|
+
getFocusedValue: getFocusedValue,
|
|
135042
135046
|
plugins: toolbarPlugins,
|
|
135043
135047
|
onChange: function onChange(c) {
|
|
135044
135048
|
return onToolbarDone(c, false);
|
|
@@ -147426,8 +147430,8 @@ const require$$11$l = _dll_prop_types;
|
|
|
147426
147430
|
var letter = _ref2.letter;
|
|
147427
147431
|
return _react["default"].createElement("div", {
|
|
147428
147432
|
style: {
|
|
147429
|
-
fontSize: '
|
|
147430
|
-
lineHeight: '
|
|
147433
|
+
fontSize: '24px',
|
|
147434
|
+
lineHeight: '24px'
|
|
147431
147435
|
}
|
|
147432
147436
|
}, letter);
|
|
147433
147437
|
};
|
|
@@ -147446,7 +147450,9 @@ const require$$11$l = _dll_prop_types;
|
|
|
147446
147450
|
var editorDOM = document.querySelector(("[data-key=\"").concat(value.document.key, "\"]"));
|
|
147447
147451
|
var valueToUse = value;
|
|
147448
147452
|
var callback = function callback(_char, focus) {
|
|
147449
|
-
|
|
147453
|
+
if (getFocusedValue) {
|
|
147454
|
+
valueToUse = getFocusedValue() || valueToUse;
|
|
147455
|
+
}
|
|
147450
147456
|
if (_char) {
|
|
147451
147457
|
var change = valueToUse.change().insertTextByKey(valueToUse.anchorKey, valueToUse.anchorOffset, _char);
|
|
147452
147458
|
valueToUse = change.value;
|
|
@@ -147593,7 +147599,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147593
147599
|
}
|
|
147594
147600
|
}
|
|
147595
147601
|
var log = (0, _debug["default"])('@pie-lib:editable-html:plugins:toolbar');
|
|
147596
|
-
var getCustomToolbar = function getCustomToolbar(plugin, node, value, handleDone, onDataChange) {
|
|
147602
|
+
var getCustomToolbar = function getCustomToolbar(plugin, node, value, handleDone, getFocusedValue, onDataChange) {
|
|
147597
147603
|
if (!plugin) {
|
|
147598
147604
|
return;
|
|
147599
147605
|
}
|
|
@@ -147604,7 +147610,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147604
147610
|
return plugin.toolbar.CustomToolbarComp;
|
|
147605
147611
|
} else if (typeof plugin.toolbar.customToolbar === 'function') {
|
|
147606
147612
|
log('deprecated - use CustomToolbarComp');
|
|
147607
|
-
return plugin.toolbar.customToolbar(node, value, handleDone, onDataChange);
|
|
147613
|
+
return plugin.toolbar.customToolbar(node, value, handleDone, getFocusedValue, onDataChange);
|
|
147608
147614
|
}
|
|
147609
147615
|
};
|
|
147610
147616
|
var Toolbar = (function (_React$Component) {
|
|
@@ -147714,7 +147720,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147714
147720
|
var handleDataChange = function handleDataChange(key, data) {
|
|
147715
147721
|
_this2.props.onDataChange(key, data);
|
|
147716
147722
|
};
|
|
147717
|
-
var CustomToolbar = getCustomToolbar(plugin, node, value, handleDone, this.props.onDataChange);
|
|
147723
|
+
var CustomToolbar = getCustomToolbar(plugin, node, value, handleDone, getFocusedValue, this.props.onDataChange);
|
|
147718
147724
|
var filteredPlugins = plugin && plugin.filterPlugins ? plugin.filterPlugins(node, plugins) : plugins;
|
|
147719
147725
|
log('[render] CustomToolbar: ', CustomToolbar);
|
|
147720
147726
|
var parentExtraStyles = parentPlugin && parentPlugin.pluginStyles ? parentPlugin.pluginStyles(node, parentNode, plugin) : {};
|
|
@@ -147733,6 +147739,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147733
147739
|
}, CustomToolbar ? _react["default"].createElement(CustomToolbar, {
|
|
147734
147740
|
node: node,
|
|
147735
147741
|
value: value,
|
|
147742
|
+
getFocusedValue: getFocusedValue,
|
|
147736
147743
|
onToolbarDone: this.onToolbarDone,
|
|
147737
147744
|
onDataChange: handleDataChange,
|
|
147738
147745
|
pluginProps: pluginProps
|
|
@@ -148449,7 +148456,10 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
148449
148456
|
var imagePlugin = opts.image && opts.image.onDelete && (0, _image["default"])(opts.image);
|
|
148450
148457
|
var mathPlugin = (0, _math["default"])(opts.math);
|
|
148451
148458
|
var respAreaPlugin = opts.responseArea && opts.responseArea.type && (0, _respArea["default"])(opts.responseArea, (0, _compact["default"])([mathPlugin]));
|
|
148452
|
-
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({
|
|
148453
148463
|
key: 'b',
|
|
148454
148464
|
type: 'bold',
|
|
148455
148465
|
icon: _react$1c["default"].createElement(_FormatBold["default"], null),
|
|
@@ -148469,8 +148479,8 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
148469
148479
|
type: 'underline',
|
|
148470
148480
|
icon: _react$1c["default"].createElement(_FormatUnderlined["default"], null),
|
|
148471
148481
|
tag: 'u'
|
|
148472
|
-
})), 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"])(
|
|
148473
|
-
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);
|
|
148474
148484
|
})), [addIf('bulleted-list', (0, _list["default"])({
|
|
148475
148485
|
key: 'l',
|
|
148476
148486
|
type: 'ul_list',
|
|
@@ -156663,6 +156673,7 @@ const require$$23 = _dll_classnames;
|
|
|
156663
156673
|
isHtmlMode: isHtmlMode
|
|
156664
156674
|
});
|
|
156665
156675
|
};
|
|
156676
|
+
var MAX_CHARACTERS_LIMIT = 1000000;
|
|
156666
156677
|
var Editor = (function (_React$Component) {
|
|
156667
156678
|
(0, _inherits2["default"])(Editor, _React$Component);
|
|
156668
156679
|
var _super = _createSuper(Editor);
|
|
@@ -157043,7 +157054,11 @@ const require$$23 = _dll_classnames;
|
|
|
157043
157054
|
log('[onChange]');
|
|
157044
157055
|
var value = change.value;
|
|
157045
157056
|
var charactersLimit = _this.props.charactersLimit;
|
|
157046
|
-
|
|
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) {
|
|
157047
157062
|
return;
|
|
157048
157063
|
}
|
|
157049
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.3",
|
|
4
4
|
"modules": [
|
|
5
5
|
{
|
|
6
6
|
"name": "@pie-lib/pie-toolbox-math-rendering-module",
|
|
7
|
-
"version": "1.10.
|
|
7
|
+
"version": "1.10.3"
|
|
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.3/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
|
},
|
|
@@ -126647,7 +126649,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126647
126649
|
} else {
|
|
126648
126650
|
if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
|
|
126649
126651
|
removePlaceholdersAndRestoreDisplay();
|
|
126650
|
-
return mr.renderMath();
|
|
126652
|
+
return mr.renderMath(executeOn, renderOpts);
|
|
126651
126653
|
}
|
|
126652
126654
|
if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
|
|
126653
126655
|
return renderMathAccessible();
|
|
@@ -126665,7 +126667,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
126665
126667
|
clearInterval(checkIntervalId);
|
|
126666
126668
|
if (mathRenderingHasLoaded) {
|
|
126667
126669
|
removePlaceholdersAndRestoreDisplay();
|
|
126668
|
-
return mr.renderMath();
|
|
126670
|
+
return mr.renderMath(executeOn, renderOpts);
|
|
126669
126671
|
}
|
|
126670
126672
|
renderMathAccessibleCallback();
|
|
126671
126673
|
}
|
|
@@ -134314,7 +134316,7 @@ const require$$17$2 = _dll_debug;
|
|
|
134314
134316
|
(0, _createClass2["default"])(TableToolbar, [{
|
|
134315
134317
|
key: "render",
|
|
134316
134318
|
value: function render() {
|
|
134317
|
-
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;
|
|
134318
134320
|
log('[render] hasBorder:', hasBorder);
|
|
134319
134321
|
return _react["default"].createElement("div", {
|
|
134320
134322
|
className: classes.tableToolbar
|
|
@@ -134335,7 +134337,8 @@ const require$$17$2 = _dll_debug;
|
|
|
134335
134337
|
key: ("plugin-").concat(index)
|
|
134336
134338
|
}, p.toolbar, {
|
|
134337
134339
|
value: value,
|
|
134338
|
-
onChange: onChange
|
|
134340
|
+
onChange: onChange,
|
|
134341
|
+
getFocusedValue: getFocusedValue
|
|
134339
134342
|
}));
|
|
134340
134343
|
}), _react["default"].createElement(_toolbarButtons.Button, {
|
|
134341
134344
|
onClick: onToggleBorder,
|
|
@@ -134997,7 +135000,7 @@ const require$$9$s = _dll_prop_types;
|
|
|
134997
135000
|
supports: function supports(node, value) {
|
|
134998
135001
|
return node && node.object === 'block' && core.utils.isSelectionInTable(value);
|
|
134999
135002
|
},
|
|
135000
|
-
customToolbar: function customToolbar(node, value, onToolbarDone) {
|
|
135003
|
+
customToolbar: function customToolbar(node, value, onToolbarDone, getFocusedValue) {
|
|
135001
135004
|
log('[customToolbar] node.data: ', node.data);
|
|
135002
135005
|
var tableBlock = core.utils.getTableBlock(value.document, node === null || node === void 0 ? void 0 : node.key);
|
|
135003
135006
|
log('[customToolbar] tableBlock: ', tableBlock);
|
|
@@ -135039,6 +135042,7 @@ const require$$9$s = _dll_prop_types;
|
|
|
135039
135042
|
};
|
|
135040
135043
|
var Tb = function Tb() {
|
|
135041
135044
|
return _react["default"].createElement(_tableToolbar["default"], {
|
|
135045
|
+
getFocusedValue: getFocusedValue,
|
|
135042
135046
|
plugins: toolbarPlugins,
|
|
135043
135047
|
onChange: function onChange(c) {
|
|
135044
135048
|
return onToolbarDone(c, false);
|
|
@@ -147426,8 +147430,8 @@ const require$$11$l = _dll_prop_types;
|
|
|
147426
147430
|
var letter = _ref2.letter;
|
|
147427
147431
|
return _react["default"].createElement("div", {
|
|
147428
147432
|
style: {
|
|
147429
|
-
fontSize: '
|
|
147430
|
-
lineHeight: '
|
|
147433
|
+
fontSize: '24px',
|
|
147434
|
+
lineHeight: '24px'
|
|
147431
147435
|
}
|
|
147432
147436
|
}, letter);
|
|
147433
147437
|
};
|
|
@@ -147446,7 +147450,9 @@ const require$$11$l = _dll_prop_types;
|
|
|
147446
147450
|
var editorDOM = document.querySelector(("[data-key=\"").concat(value.document.key, "\"]"));
|
|
147447
147451
|
var valueToUse = value;
|
|
147448
147452
|
var callback = function callback(_char, focus) {
|
|
147449
|
-
|
|
147453
|
+
if (getFocusedValue) {
|
|
147454
|
+
valueToUse = getFocusedValue() || valueToUse;
|
|
147455
|
+
}
|
|
147450
147456
|
if (_char) {
|
|
147451
147457
|
var change = valueToUse.change().insertTextByKey(valueToUse.anchorKey, valueToUse.anchorOffset, _char);
|
|
147452
147458
|
valueToUse = change.value;
|
|
@@ -147593,7 +147599,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147593
147599
|
}
|
|
147594
147600
|
}
|
|
147595
147601
|
var log = (0, _debug["default"])('@pie-lib:editable-html:plugins:toolbar');
|
|
147596
|
-
var getCustomToolbar = function getCustomToolbar(plugin, node, value, handleDone, onDataChange) {
|
|
147602
|
+
var getCustomToolbar = function getCustomToolbar(plugin, node, value, handleDone, getFocusedValue, onDataChange) {
|
|
147597
147603
|
if (!plugin) {
|
|
147598
147604
|
return;
|
|
147599
147605
|
}
|
|
@@ -147604,7 +147610,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147604
147610
|
return plugin.toolbar.CustomToolbarComp;
|
|
147605
147611
|
} else if (typeof plugin.toolbar.customToolbar === 'function') {
|
|
147606
147612
|
log('deprecated - use CustomToolbarComp');
|
|
147607
|
-
return plugin.toolbar.customToolbar(node, value, handleDone, onDataChange);
|
|
147613
|
+
return plugin.toolbar.customToolbar(node, value, handleDone, getFocusedValue, onDataChange);
|
|
147608
147614
|
}
|
|
147609
147615
|
};
|
|
147610
147616
|
var Toolbar = (function (_React$Component) {
|
|
@@ -147714,7 +147720,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147714
147720
|
var handleDataChange = function handleDataChange(key, data) {
|
|
147715
147721
|
_this2.props.onDataChange(key, data);
|
|
147716
147722
|
};
|
|
147717
|
-
var CustomToolbar = getCustomToolbar(plugin, node, value, handleDone, this.props.onDataChange);
|
|
147723
|
+
var CustomToolbar = getCustomToolbar(plugin, node, value, handleDone, getFocusedValue, this.props.onDataChange);
|
|
147718
147724
|
var filteredPlugins = plugin && plugin.filterPlugins ? plugin.filterPlugins(node, plugins) : plugins;
|
|
147719
147725
|
log('[render] CustomToolbar: ', CustomToolbar);
|
|
147720
147726
|
var parentExtraStyles = parentPlugin && parentPlugin.pluginStyles ? parentPlugin.pluginStyles(node, parentNode, plugin) : {};
|
|
@@ -147733,6 +147739,7 @@ const {debounce: require$$16$3} = _dll_lodash;
|
|
|
147733
147739
|
}, CustomToolbar ? _react["default"].createElement(CustomToolbar, {
|
|
147734
147740
|
node: node,
|
|
147735
147741
|
value: value,
|
|
147742
|
+
getFocusedValue: getFocusedValue,
|
|
147736
147743
|
onToolbarDone: this.onToolbarDone,
|
|
147737
147744
|
onDataChange: handleDataChange,
|
|
147738
147745
|
pluginProps: pluginProps
|
|
@@ -148449,7 +148456,10 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
148449
148456
|
var imagePlugin = opts.image && opts.image.onDelete && (0, _image["default"])(opts.image);
|
|
148450
148457
|
var mathPlugin = (0, _math["default"])(opts.math);
|
|
148451
148458
|
var respAreaPlugin = opts.responseArea && opts.responseArea.type && (0, _respArea["default"])(opts.responseArea, (0, _compact["default"])([mathPlugin]));
|
|
148452
|
-
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({
|
|
148453
148463
|
key: 'b',
|
|
148454
148464
|
type: 'bold',
|
|
148455
148465
|
icon: _react$1c["default"].createElement(_FormatBold["default"], null),
|
|
@@ -148469,8 +148479,8 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
148469
148479
|
type: 'underline',
|
|
148470
148480
|
icon: _react$1c["default"].createElement(_FormatUnderlined["default"], null),
|
|
148471
148481
|
tag: 'u'
|
|
148472
|
-
})), 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"])(
|
|
148473
|
-
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);
|
|
148474
148484
|
})), [addIf('bulleted-list', (0, _list["default"])({
|
|
148475
148485
|
key: 'l',
|
|
148476
148486
|
type: 'ul_list',
|
|
@@ -156663,6 +156673,7 @@ const require$$23 = _dll_classnames;
|
|
|
156663
156673
|
isHtmlMode: isHtmlMode
|
|
156664
156674
|
});
|
|
156665
156675
|
};
|
|
156676
|
+
var MAX_CHARACTERS_LIMIT = 1000000;
|
|
156666
156677
|
var Editor = (function (_React$Component) {
|
|
156667
156678
|
(0, _inherits2["default"])(Editor, _React$Component);
|
|
156668
156679
|
var _super = _createSuper(Editor);
|
|
@@ -157043,7 +157054,11 @@ const require$$23 = _dll_classnames;
|
|
|
157043
157054
|
log('[onChange]');
|
|
157044
157055
|
var value = change.value;
|
|
157045
157056
|
var charactersLimit = _this.props.charactersLimit;
|
|
157046
|
-
|
|
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) {
|
|
157047
157062
|
return;
|
|
157048
157063
|
}
|
|
157049
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.4",
|
|
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.4",
|
|
11
|
+
"@pie-element/rubric": "^3.10.4",
|
|
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": "512624fa52f5c653c74c32fa49c23af8c6d91c99",
|
|
19
19
|
"scripts": {
|
|
20
20
|
"postpublish": "../../scripts/postpublish"
|
|
21
21
|
},
|