@pie-element/complex-rubric 3.7.6-next.12 → 3.7.6-next.17
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/controller/package.json +1 -1
- package/module/configure.js +39 -7
- package/module/element.js +39 -7
- package/module/manifest.json +1 -1
- package/module/print.js +39 -7
- package/package.json +4 -4
package/controller/package.json
CHANGED
package/module/configure.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.5.2/module/index.js";
|
|
2
2
|
import RubricConfigure from '@pie-element/rubric/configure/lib';
|
|
3
|
-
import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@8.5.
|
|
3
|
+
import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@8.5.2/module/index.js";
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
5
5
|
m.forEach(function (e) {
|
|
6
6
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -151135,6 +151135,9 @@ const require$$16$3 = _dll_classnames;
|
|
|
151135
151135
|
(0, _classCallCheck2["default"])(this, BlankContent);
|
|
151136
151136
|
_this = _super.call(this, props);
|
|
151137
151137
|
_this.handleClick = _this.handleClick.bind((0, _assertThisInitialized2["default"])(_this));
|
|
151138
|
+
_this.state = {
|
|
151139
|
+
hoveredElementSize: null
|
|
151140
|
+
};
|
|
151138
151141
|
return _this;
|
|
151139
151142
|
}
|
|
151140
151143
|
(0, _createClass2["default"])(BlankContent, [{
|
|
@@ -151155,21 +151158,46 @@ const require$$16$3 = _dll_classnames;
|
|
|
151155
151158
|
this.elementRef.className = this.elementRef.contains(event.target) ? classes.selected : '';
|
|
151156
151159
|
}
|
|
151157
151160
|
}
|
|
151161
|
+
}, {
|
|
151162
|
+
key: "getSnapshotBeforeUpdate",
|
|
151163
|
+
value: function getSnapshotBeforeUpdate(prevProps) {
|
|
151164
|
+
if (!prevProps.isOver && this.props.isOver && this.elementRef) {
|
|
151165
|
+
var node = this.elementRef;
|
|
151166
|
+
return {
|
|
151167
|
+
width: node.offsetWidth,
|
|
151168
|
+
height: node.offsetHeight
|
|
151169
|
+
};
|
|
151170
|
+
}
|
|
151171
|
+
return null;
|
|
151172
|
+
}
|
|
151158
151173
|
}, {
|
|
151159
151174
|
key: "componentDidUpdate",
|
|
151160
|
-
value: function componentDidUpdate() {
|
|
151161
|
-
if (this.elementRef) {
|
|
151175
|
+
value: function componentDidUpdate(prevProps, prevState, snapshot) {
|
|
151176
|
+
if (this.elementRef && typeof _mathRendering.renderMath === 'function') {
|
|
151162
151177
|
(0, _mathRendering.renderMath)(this.elementRef);
|
|
151163
151178
|
}
|
|
151179
|
+
if (snapshot && (!this.state.hoveredElementSize || this.state.hoveredElementSize.width !== snapshot.width || this.state.hoveredElementSize.height !== snapshot.height)) {
|
|
151180
|
+
this.setState({
|
|
151181
|
+
hoveredElementSize: snapshot
|
|
151182
|
+
});
|
|
151183
|
+
return;
|
|
151184
|
+
}
|
|
151185
|
+
if (prevProps.isOver && !this.props.isOver && this.state.hoveredElementSize) {
|
|
151186
|
+
this.setState({
|
|
151187
|
+
hoveredElementSize: null
|
|
151188
|
+
});
|
|
151189
|
+
}
|
|
151164
151190
|
}
|
|
151165
151191
|
}, {
|
|
151166
151192
|
key: "render",
|
|
151167
151193
|
value: function render() {
|
|
151168
151194
|
var _this2 = this;
|
|
151169
151195
|
var _this$props = this.props, n = _this$props.n, children = _this$props.children, isDragging = _this$props.isDragging, dragItem = _this$props.dragItem, isOver = _this$props.isOver, value = _this$props.value;
|
|
151196
|
+
var hoveredElementSize = this.state.hoveredElementSize;
|
|
151170
151197
|
var label = dragItem && isOver ? dragItem.value.value : value.value || "\xA0";
|
|
151171
151198
|
var finalLabel = isDragging ? "\xA0" : label;
|
|
151172
151199
|
var hasGrip = finalLabel !== "\xA0";
|
|
151200
|
+
var isPreview = dragItem && isOver;
|
|
151173
151201
|
return _react["default"].createElement("div", {
|
|
151174
151202
|
ref: function ref(_ref) {
|
|
151175
151203
|
return _this2.elementRef = _ref;
|
|
@@ -151178,13 +151206,15 @@ const require$$16$3 = _dll_classnames;
|
|
|
151178
151206
|
display: 'inline-flex',
|
|
151179
151207
|
minWidth: '178px',
|
|
151180
151208
|
minHeight: '36px',
|
|
151181
|
-
background:
|
|
151182
|
-
border:
|
|
151209
|
+
background: isPreview ? ("").concat(_renderUi.color.defaults.BORDER_LIGHT) : ("").concat(_renderUi.color.defaults.WHITE),
|
|
151210
|
+
border: isPreview ? ("1px solid ").concat(_renderUi.color.defaults.BORDER_DARK) : ("1px solid ").concat(_renderUi.color.defaults.BORDER_LIGHT),
|
|
151183
151211
|
boxSizing: 'border-box',
|
|
151184
151212
|
borderRadius: '3px',
|
|
151185
151213
|
overflow: 'hidden',
|
|
151186
151214
|
position: 'relative',
|
|
151187
|
-
padding: '8px 8px 8px 35px'
|
|
151215
|
+
padding: '8px 8px 8px 35px',
|
|
151216
|
+
width: hoveredElementSize ? hoveredElementSize.width : undefined,
|
|
151217
|
+
height: hoveredElementSize ? hoveredElementSize.height : undefined
|
|
151188
151218
|
},
|
|
151189
151219
|
"data-key": n.key,
|
|
151190
151220
|
contentEditable: false
|
|
@@ -151246,7 +151276,9 @@ const require$$16$3 = _dll_classnames;
|
|
|
151246
151276
|
var DropTile = (0, _drag.DropTarget)('drag-in-the-blank-choice', tileTarget, function (connect, monitor) {
|
|
151247
151277
|
return {
|
|
151248
151278
|
connectDropTarget: connect.dropTarget(),
|
|
151249
|
-
isOver: monitor.isOver(
|
|
151279
|
+
isOver: monitor.isOver({
|
|
151280
|
+
shallow: true
|
|
151281
|
+
}),
|
|
151250
151282
|
dragItem: monitor.getItem()
|
|
151251
151283
|
};
|
|
151252
151284
|
})(connectedBlankContent);
|
package/module/element.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.5.2/module/index.js";
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@8.5.
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@8.5.2/module/index.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
5
5
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -149237,6 +149237,9 @@ const require$$16$3 = _dll_classnames;
|
|
|
149237
149237
|
(0, _classCallCheck2["default"])(this, BlankContent);
|
|
149238
149238
|
_this = _super.call(this, props);
|
|
149239
149239
|
_this.handleClick = _this.handleClick.bind((0, _assertThisInitialized2["default"])(_this));
|
|
149240
|
+
_this.state = {
|
|
149241
|
+
hoveredElementSize: null
|
|
149242
|
+
};
|
|
149240
149243
|
return _this;
|
|
149241
149244
|
}
|
|
149242
149245
|
(0, _createClass2["default"])(BlankContent, [{
|
|
@@ -149257,21 +149260,46 @@ const require$$16$3 = _dll_classnames;
|
|
|
149257
149260
|
this.elementRef.className = this.elementRef.contains(event.target) ? classes.selected : '';
|
|
149258
149261
|
}
|
|
149259
149262
|
}
|
|
149263
|
+
}, {
|
|
149264
|
+
key: "getSnapshotBeforeUpdate",
|
|
149265
|
+
value: function getSnapshotBeforeUpdate(prevProps) {
|
|
149266
|
+
if (!prevProps.isOver && this.props.isOver && this.elementRef) {
|
|
149267
|
+
var node = this.elementRef;
|
|
149268
|
+
return {
|
|
149269
|
+
width: node.offsetWidth,
|
|
149270
|
+
height: node.offsetHeight
|
|
149271
|
+
};
|
|
149272
|
+
}
|
|
149273
|
+
return null;
|
|
149274
|
+
}
|
|
149260
149275
|
}, {
|
|
149261
149276
|
key: "componentDidUpdate",
|
|
149262
|
-
value: function componentDidUpdate() {
|
|
149263
|
-
if (this.elementRef) {
|
|
149277
|
+
value: function componentDidUpdate(prevProps, prevState, snapshot) {
|
|
149278
|
+
if (this.elementRef && typeof _mathRendering.renderMath === 'function') {
|
|
149264
149279
|
(0, _mathRendering.renderMath)(this.elementRef);
|
|
149265
149280
|
}
|
|
149281
|
+
if (snapshot && (!this.state.hoveredElementSize || this.state.hoveredElementSize.width !== snapshot.width || this.state.hoveredElementSize.height !== snapshot.height)) {
|
|
149282
|
+
this.setState({
|
|
149283
|
+
hoveredElementSize: snapshot
|
|
149284
|
+
});
|
|
149285
|
+
return;
|
|
149286
|
+
}
|
|
149287
|
+
if (prevProps.isOver && !this.props.isOver && this.state.hoveredElementSize) {
|
|
149288
|
+
this.setState({
|
|
149289
|
+
hoveredElementSize: null
|
|
149290
|
+
});
|
|
149291
|
+
}
|
|
149266
149292
|
}
|
|
149267
149293
|
}, {
|
|
149268
149294
|
key: "render",
|
|
149269
149295
|
value: function render() {
|
|
149270
149296
|
var _this2 = this;
|
|
149271
149297
|
var _this$props = this.props, n = _this$props.n, children = _this$props.children, isDragging = _this$props.isDragging, dragItem = _this$props.dragItem, isOver = _this$props.isOver, value = _this$props.value;
|
|
149298
|
+
var hoveredElementSize = this.state.hoveredElementSize;
|
|
149272
149299
|
var label = dragItem && isOver ? dragItem.value.value : value.value || "\xA0";
|
|
149273
149300
|
var finalLabel = isDragging ? "\xA0" : label;
|
|
149274
149301
|
var hasGrip = finalLabel !== "\xA0";
|
|
149302
|
+
var isPreview = dragItem && isOver;
|
|
149275
149303
|
return _react["default"].createElement("div", {
|
|
149276
149304
|
ref: function ref(_ref) {
|
|
149277
149305
|
return _this2.elementRef = _ref;
|
|
@@ -149280,13 +149308,15 @@ const require$$16$3 = _dll_classnames;
|
|
|
149280
149308
|
display: 'inline-flex',
|
|
149281
149309
|
minWidth: '178px',
|
|
149282
149310
|
minHeight: '36px',
|
|
149283
|
-
background:
|
|
149284
|
-
border:
|
|
149311
|
+
background: isPreview ? ("").concat(_renderUi.color.defaults.BORDER_LIGHT) : ("").concat(_renderUi.color.defaults.WHITE),
|
|
149312
|
+
border: isPreview ? ("1px solid ").concat(_renderUi.color.defaults.BORDER_DARK) : ("1px solid ").concat(_renderUi.color.defaults.BORDER_LIGHT),
|
|
149285
149313
|
boxSizing: 'border-box',
|
|
149286
149314
|
borderRadius: '3px',
|
|
149287
149315
|
overflow: 'hidden',
|
|
149288
149316
|
position: 'relative',
|
|
149289
|
-
padding: '8px 8px 8px 35px'
|
|
149317
|
+
padding: '8px 8px 8px 35px',
|
|
149318
|
+
width: hoveredElementSize ? hoveredElementSize.width : undefined,
|
|
149319
|
+
height: hoveredElementSize ? hoveredElementSize.height : undefined
|
|
149290
149320
|
},
|
|
149291
149321
|
"data-key": n.key,
|
|
149292
149322
|
contentEditable: false
|
|
@@ -149348,7 +149378,9 @@ const require$$16$3 = _dll_classnames;
|
|
|
149348
149378
|
var DropTile = (0, _drag.DropTarget)('drag-in-the-blank-choice', tileTarget, function (connect, monitor) {
|
|
149349
149379
|
return {
|
|
149350
149380
|
connectDropTarget: connect.dropTarget(),
|
|
149351
|
-
isOver: monitor.isOver(
|
|
149381
|
+
isOver: monitor.isOver({
|
|
149382
|
+
shallow: true
|
|
149383
|
+
}),
|
|
149352
149384
|
dragItem: monitor.getItem()
|
|
149353
149385
|
};
|
|
149354
149386
|
})(connectedBlankContent);
|
package/module/manifest.json
CHANGED
package/module/print.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.5.2/module/index.js";
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@8.5.
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@8.5.2/module/index.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
5
5
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -149237,6 +149237,9 @@ const require$$16$3 = _dll_classnames;
|
|
|
149237
149237
|
(0, _classCallCheck2["default"])(this, BlankContent);
|
|
149238
149238
|
_this = _super.call(this, props);
|
|
149239
149239
|
_this.handleClick = _this.handleClick.bind((0, _assertThisInitialized2["default"])(_this));
|
|
149240
|
+
_this.state = {
|
|
149241
|
+
hoveredElementSize: null
|
|
149242
|
+
};
|
|
149240
149243
|
return _this;
|
|
149241
149244
|
}
|
|
149242
149245
|
(0, _createClass2["default"])(BlankContent, [{
|
|
@@ -149257,21 +149260,46 @@ const require$$16$3 = _dll_classnames;
|
|
|
149257
149260
|
this.elementRef.className = this.elementRef.contains(event.target) ? classes.selected : '';
|
|
149258
149261
|
}
|
|
149259
149262
|
}
|
|
149263
|
+
}, {
|
|
149264
|
+
key: "getSnapshotBeforeUpdate",
|
|
149265
|
+
value: function getSnapshotBeforeUpdate(prevProps) {
|
|
149266
|
+
if (!prevProps.isOver && this.props.isOver && this.elementRef) {
|
|
149267
|
+
var node = this.elementRef;
|
|
149268
|
+
return {
|
|
149269
|
+
width: node.offsetWidth,
|
|
149270
|
+
height: node.offsetHeight
|
|
149271
|
+
};
|
|
149272
|
+
}
|
|
149273
|
+
return null;
|
|
149274
|
+
}
|
|
149260
149275
|
}, {
|
|
149261
149276
|
key: "componentDidUpdate",
|
|
149262
|
-
value: function componentDidUpdate() {
|
|
149263
|
-
if (this.elementRef) {
|
|
149277
|
+
value: function componentDidUpdate(prevProps, prevState, snapshot) {
|
|
149278
|
+
if (this.elementRef && typeof _mathRendering.renderMath === 'function') {
|
|
149264
149279
|
(0, _mathRendering.renderMath)(this.elementRef);
|
|
149265
149280
|
}
|
|
149281
|
+
if (snapshot && (!this.state.hoveredElementSize || this.state.hoveredElementSize.width !== snapshot.width || this.state.hoveredElementSize.height !== snapshot.height)) {
|
|
149282
|
+
this.setState({
|
|
149283
|
+
hoveredElementSize: snapshot
|
|
149284
|
+
});
|
|
149285
|
+
return;
|
|
149286
|
+
}
|
|
149287
|
+
if (prevProps.isOver && !this.props.isOver && this.state.hoveredElementSize) {
|
|
149288
|
+
this.setState({
|
|
149289
|
+
hoveredElementSize: null
|
|
149290
|
+
});
|
|
149291
|
+
}
|
|
149266
149292
|
}
|
|
149267
149293
|
}, {
|
|
149268
149294
|
key: "render",
|
|
149269
149295
|
value: function render() {
|
|
149270
149296
|
var _this2 = this;
|
|
149271
149297
|
var _this$props = this.props, n = _this$props.n, children = _this$props.children, isDragging = _this$props.isDragging, dragItem = _this$props.dragItem, isOver = _this$props.isOver, value = _this$props.value;
|
|
149298
|
+
var hoveredElementSize = this.state.hoveredElementSize;
|
|
149272
149299
|
var label = dragItem && isOver ? dragItem.value.value : value.value || "\xA0";
|
|
149273
149300
|
var finalLabel = isDragging ? "\xA0" : label;
|
|
149274
149301
|
var hasGrip = finalLabel !== "\xA0";
|
|
149302
|
+
var isPreview = dragItem && isOver;
|
|
149275
149303
|
return _react["default"].createElement("div", {
|
|
149276
149304
|
ref: function ref(_ref) {
|
|
149277
149305
|
return _this2.elementRef = _ref;
|
|
@@ -149280,13 +149308,15 @@ const require$$16$3 = _dll_classnames;
|
|
|
149280
149308
|
display: 'inline-flex',
|
|
149281
149309
|
minWidth: '178px',
|
|
149282
149310
|
minHeight: '36px',
|
|
149283
|
-
background:
|
|
149284
|
-
border:
|
|
149311
|
+
background: isPreview ? ("").concat(_renderUi.color.defaults.BORDER_LIGHT) : ("").concat(_renderUi.color.defaults.WHITE),
|
|
149312
|
+
border: isPreview ? ("1px solid ").concat(_renderUi.color.defaults.BORDER_DARK) : ("1px solid ").concat(_renderUi.color.defaults.BORDER_LIGHT),
|
|
149285
149313
|
boxSizing: 'border-box',
|
|
149286
149314
|
borderRadius: '3px',
|
|
149287
149315
|
overflow: 'hidden',
|
|
149288
149316
|
position: 'relative',
|
|
149289
|
-
padding: '8px 8px 8px 35px'
|
|
149317
|
+
padding: '8px 8px 8px 35px',
|
|
149318
|
+
width: hoveredElementSize ? hoveredElementSize.width : undefined,
|
|
149319
|
+
height: hoveredElementSize ? hoveredElementSize.height : undefined
|
|
149290
149320
|
},
|
|
149291
149321
|
"data-key": n.key,
|
|
149292
149322
|
contentEditable: false
|
|
@@ -149348,7 +149378,9 @@ const require$$16$3 = _dll_classnames;
|
|
|
149348
149378
|
var DropTile = (0, _drag.DropTarget)('drag-in-the-blank-choice', tileTarget, function (connect, monitor) {
|
|
149349
149379
|
return {
|
|
149350
149380
|
connectDropTarget: connect.dropTarget(),
|
|
149351
|
-
isOver: monitor.isOver(
|
|
149381
|
+
isOver: monitor.isOver({
|
|
149382
|
+
shallow: true
|
|
149383
|
+
}),
|
|
149352
149384
|
dragItem: monitor.getItem()
|
|
149353
149385
|
};
|
|
149354
149386
|
})(connectedBlankContent);
|
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": "3.7.6-next.
|
|
4
|
+
"version": "3.7.6-next.17+fe5bbd145",
|
|
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": "^4.6.6-next.
|
|
11
|
-
"@pie-element/rubric": "^4.9.6-next.
|
|
10
|
+
"@pie-element/multi-trait-rubric": "^4.6.6-next.17+fe5bbd145",
|
|
11
|
+
"@pie-element/rubric": "^4.9.6-next.17+fe5bbd145",
|
|
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": "fe5bbd1455a83f8d2a97029ec86ffce85e8a5e59",
|
|
19
19
|
"scripts": {
|
|
20
20
|
"postpublish": "../../scripts/postpublish"
|
|
21
21
|
},
|