@pie-element/ebsr 7.0.22 → 7.0.24-next.2
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 +0 -16
- package/configure/CHANGELOG.md +0 -16
- package/configure/lib/main.js +6 -4
- package/configure/lib/main.js.map +1 -1
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.json +1972 -0
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.md +1793 -0
- package/{LICENSE.md → configure/node_modules/@pie-element/multiple-choice/LICENSE.md} +0 -0
- package/configure/node_modules/@pie-element/multiple-choice/PRINT.md +35 -0
- package/configure/node_modules/@pie-element/multiple-choice/README.md +56 -0
- package/configure/node_modules/@pie-element/multiple-choice/choice.png +0 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.json +1387 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.md +1334 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js +104 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js +198 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js +599 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js +18 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/package.json +20 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.json +527 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.md +768 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js +18 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js +305 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js +36 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/package.json +15 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json +353 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json.md +277 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/config.js +8 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/generate.js +52 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/index.html +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/session.js +7 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json +338 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json.md +274 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js +298 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js +157 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js +174 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js +151 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js +97 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js +254 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js +129 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js +35 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/configure.js +843 -0
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/controller.js +17304 -17374
- package/configure/node_modules/@pie-element/multiple-choice/module/demo.js +77 -0
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/element.js +42 -171
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/index.html +1 -1
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/manifest.json +4 -4
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/print-demo.js +46 -46
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/print.html +1 -1
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/print.js +70 -259
- package/configure/node_modules/@pie-element/multiple-choice/package.json +34 -0
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.json +672 -0
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.md +427 -0
- package/configure/node_modules/@pie-lib/math-rendering/LICENSE.md +5 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js +30 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js +316 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js +23 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js +123 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js +103 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js +275 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/package.json +19 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/demo.html +872 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/demo.js +108 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/main.html +156 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/main.js +16 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/webpack.config.js +29 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/index.js +4 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/chtml.js +215 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/index.js +13 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/mml.js +24 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/normalization.js +69 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/render-math.js +234 -0
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.json +937 -0
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.md +602 -0
- package/configure/node_modules/@pie-lib/render-ui/LICENSE.md +5 -0
- package/configure/node_modules/@pie-lib/render-ui/README.md +33 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js +146 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js +134 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js +160 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js +24 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js +102 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js +104 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js +60 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js +133 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js +162 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js +28 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js +28 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js +160 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js +206 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/package.json +30 -0
- package/configure/node_modules/@pie-lib/render-ui/src/collapsible/index.jsx +68 -0
- package/configure/node_modules/@pie-lib/render-ui/src/color.js +48 -0
- package/configure/node_modules/@pie-lib/render-ui/src/feedback.jsx +100 -0
- package/configure/node_modules/@pie-lib/render-ui/src/has-text.js +14 -0
- package/configure/node_modules/@pie-lib/render-ui/src/html-and-math.js +40 -0
- package/configure/node_modules/@pie-lib/render-ui/src/index.js +27 -0
- package/configure/node_modules/@pie-lib/render-ui/src/input-container.jsx +41 -0
- package/configure/node_modules/@pie-lib/render-ui/src/preview-layout.jsx +77 -0
- package/configure/node_modules/@pie-lib/render-ui/src/preview-prompt.jsx +90 -0
- package/configure/node_modules/@pie-lib/render-ui/src/purpose.jsx +19 -0
- package/configure/node_modules/@pie-lib/render-ui/src/readable.jsx +19 -0
- package/configure/node_modules/@pie-lib/render-ui/src/response-indicators.jsx +89 -0
- package/configure/node_modules/@pie-lib/render-ui/src/withUndoReset.jsx +118 -0
- package/configure/package.json +3 -3
- package/configure/src/__tests__/index.test.js +4 -2
- package/configure/src/main.jsx +8 -3
- package/controller/lib/index.js +79 -3
- package/controller/lib/index.js.map +1 -1
- package/controller/src/index.js +55 -0
- package/package.json +3 -3
- package/module/configure.js +0 -472
- package/module/demo.js +0 -77
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.Collapsible = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _index = require("@material-ui/core/styles/index");
|
|
13
|
+
|
|
14
|
+
var _index2 = _interopRequireDefault(require("@material-ui/core/Collapse/index"));
|
|
15
|
+
|
|
16
|
+
var _mathRendering = require("@pie-lib/math-rendering");
|
|
17
|
+
|
|
18
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
|
+
|
|
24
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
25
|
+
|
|
26
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
27
|
+
|
|
28
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
29
|
+
|
|
30
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
31
|
+
|
|
32
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
33
|
+
|
|
34
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
35
|
+
|
|
36
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
37
|
+
|
|
38
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
39
|
+
|
|
40
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
+
|
|
42
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
43
|
+
|
|
44
|
+
var Collapsible = /*#__PURE__*/function (_React$Component) {
|
|
45
|
+
_inherits(Collapsible, _React$Component);
|
|
46
|
+
|
|
47
|
+
var _super = _createSuper(Collapsible);
|
|
48
|
+
|
|
49
|
+
function Collapsible() {
|
|
50
|
+
var _this;
|
|
51
|
+
|
|
52
|
+
_classCallCheck(this, Collapsible);
|
|
53
|
+
|
|
54
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
55
|
+
args[_key] = arguments[_key];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
59
|
+
|
|
60
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
61
|
+
expanded: false
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
_defineProperty(_assertThisInitialized(_this), "toggleExpanded", function () {
|
|
65
|
+
_this.setState(function (state) {
|
|
66
|
+
return {
|
|
67
|
+
expanded: !state.expanded
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
return _this;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
_createClass(Collapsible, [{
|
|
76
|
+
key: "componentDidMount",
|
|
77
|
+
value: function componentDidMount() {
|
|
78
|
+
(0, _mathRendering.renderMath)(this.root);
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
key: "componentDidUpdate",
|
|
82
|
+
value: function componentDidUpdate() {
|
|
83
|
+
(0, _mathRendering.renderMath)(this.root);
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "render",
|
|
87
|
+
value: function render() {
|
|
88
|
+
var _this2 = this;
|
|
89
|
+
|
|
90
|
+
var _this$props = this.props,
|
|
91
|
+
classes = _this$props.classes,
|
|
92
|
+
labels = _this$props.labels,
|
|
93
|
+
children = _this$props.children,
|
|
94
|
+
className = _this$props.className;
|
|
95
|
+
var title = this.state.expanded ? labels.visible || 'Hide' : labels.hidden || 'Show';
|
|
96
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
97
|
+
className: className,
|
|
98
|
+
ref: function ref(r) {
|
|
99
|
+
return _this2.root = r;
|
|
100
|
+
}
|
|
101
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
102
|
+
onClick: this.toggleExpanded
|
|
103
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
104
|
+
className: classes.title
|
|
105
|
+
}, title)), /*#__PURE__*/_react["default"].createElement(_index2["default"], {
|
|
106
|
+
"in": this.state.expanded,
|
|
107
|
+
timeout: "auto",
|
|
108
|
+
unmountOnExit: true,
|
|
109
|
+
className: classes.collapsible
|
|
110
|
+
}, children));
|
|
111
|
+
}
|
|
112
|
+
}]);
|
|
113
|
+
|
|
114
|
+
return Collapsible;
|
|
115
|
+
}(_react["default"].Component);
|
|
116
|
+
|
|
117
|
+
exports.Collapsible = Collapsible;
|
|
118
|
+
|
|
119
|
+
_defineProperty(Collapsible, "propTypes", {
|
|
120
|
+
classes: _propTypes["default"].object.isRequired,
|
|
121
|
+
className: _propTypes["default"].string,
|
|
122
|
+
children: _propTypes["default"].object,
|
|
123
|
+
labels: _propTypes["default"].shape({
|
|
124
|
+
visible: _propTypes["default"].string,
|
|
125
|
+
hidden: _propTypes["default"].string
|
|
126
|
+
})
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
_defineProperty(Collapsible, "defaultProps", {
|
|
130
|
+
labels: {}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
var _default = (0, _index.withStyles)(function (theme) {
|
|
134
|
+
return {
|
|
135
|
+
title: {
|
|
136
|
+
color: theme.palette.primary.light,
|
|
137
|
+
borderBottom: "1px dotted ".concat(theme.palette.primary.light)
|
|
138
|
+
},
|
|
139
|
+
collapsible: {
|
|
140
|
+
paddingTop: theme.spacing.unit * 2
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
})(Collapsible);
|
|
144
|
+
|
|
145
|
+
exports["default"] = _default;
|
|
146
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collapsible/index.jsx"],"names":["Collapsible","expanded","setState","state","root","props","classes","labels","children","className","title","visible","hidden","r","toggleExpanded","collapsible","React","Component","PropTypes","object","isRequired","string","shape","theme","color","palette","primary","light","borderBottom","paddingTop","spacing","unit"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;IAEaA,W;;;;;;;;;;;;;;;;4DAeH;AACNC,MAAAA,QAAQ,EAAE;AADJ,K;;qEAIS,YAAM;AACrB,YAAKC,QAAL,CAAc,UAAAC,KAAK;AAAA,eAAK;AAAEF,UAAAA,QAAQ,EAAE,CAACE,KAAK,CAACF;AAAnB,SAAL;AAAA,OAAnB;AACD,K;;;;;;;WAED,6BAAoB;AAClB,qCAAW,KAAKG,IAAhB;AACD;;;WAED,8BAAqB;AACnB,qCAAW,KAAKA,IAAhB;AACD;;;WAED,kBAAS;AAAA;;AACP,wBAAiD,KAAKC,KAAtD;AAAA,UAAQC,OAAR,eAAQA,OAAR;AAAA,UAAiBC,MAAjB,eAAiBA,MAAjB;AAAA,UAAyBC,QAAzB,eAAyBA,QAAzB;AAAA,UAAmCC,SAAnC,eAAmCA,SAAnC;AACA,UAAMC,KAAK,GAAG,KAAKP,KAAL,CAAWF,QAAX,GAAsBM,MAAM,CAACI,OAAP,IAAkB,MAAxC,GAA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B,EAQX/B,WARW,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles/index';\nimport Collapse from '@material-ui/core/Collapse/index';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport PropTypes from 'prop-types';\n\nexport class Collapsible extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n children: PropTypes.object,\n labels: PropTypes.shape({\n visible: PropTypes.string,\n hidden: PropTypes.string\n })\n };\n\n static defaultProps = {\n labels: {}\n };\n\n state = {\n expanded: false\n };\n\n toggleExpanded = () => {\n this.setState(state => ({ expanded: !state.expanded }));\n };\n\n componentDidMount() {\n renderMath(this.root);\n }\n\n componentDidUpdate() {\n renderMath(this.root);\n }\n\n render() {\n const { classes, labels, children, className } = this.props;\n const title = this.state.expanded ? labels.visible || 'Hide' : labels.hidden || 'Show';\n\n return (\n <div className={className} ref={r => (this.root = r)}>\n <div onClick={this.toggleExpanded}>\n <span className={classes.title}>{title}</span>\n </div>\n <Collapse\n in={this.state.expanded}\n timeout=\"auto\"\n unmountOnExit\n className={classes.collapsible}\n >\n {children}\n </Collapse>\n </div>\n );\n }\n}\n\nexport default withStyles(theme => ({\n title: {\n color: theme.palette.primary.light,\n borderBottom: `1px dotted ${theme.palette.primary.light}`\n },\n collapsible: {\n paddingTop: theme.spacing.unit * 2\n }\n}))(Collapsible);\n"],"file":"index.js"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.v = exports.text = exports.secondaryText = exports.secondaryLight = exports.secondaryDark = exports.secondaryBackground = exports.secondary = exports.primaryText = exports.primaryLight = exports.primaryDark = exports.primary = exports.incorrect = exports.disabled = exports.defaults = exports.correct = exports.background = void 0;
|
|
7
|
+
|
|
8
|
+
var _green = _interopRequireDefault(require("@material-ui/core/colors/green"));
|
|
9
|
+
|
|
10
|
+
var _orange = _interopRequireDefault(require("@material-ui/core/colors/orange"));
|
|
11
|
+
|
|
12
|
+
var _pink = _interopRequireDefault(require("@material-ui/core/colors/pink"));
|
|
13
|
+
|
|
14
|
+
var _indigo = _interopRequireDefault(require("@material-ui/core/colors/indigo"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
|
|
18
|
+
var defaults = {
|
|
19
|
+
TEXT: 'black',
|
|
20
|
+
DISABLED: 'grey',
|
|
21
|
+
CORRECT: _green["default"][500],
|
|
22
|
+
INCORRECT: _orange["default"][500],
|
|
23
|
+
PRIMARY: _indigo["default"][500],
|
|
24
|
+
PRIMARY_LIGHT: _indigo["default"][200],
|
|
25
|
+
PRIMARY_DARK: _indigo["default"][800],
|
|
26
|
+
SECONDARY: _pink["default"].A400,
|
|
27
|
+
SECONDARY_LIGHT: _pink["default"][200],
|
|
28
|
+
SECONDARY_DARK: _pink["default"][900],
|
|
29
|
+
BACKGROUND: 'rgba(255,255,255,0)',
|
|
30
|
+
SECONDARY_BACKGROUND: 'rgba(241,241,241,1)'
|
|
31
|
+
};
|
|
32
|
+
exports.defaults = defaults;
|
|
33
|
+
Object.freeze(defaults);
|
|
34
|
+
|
|
35
|
+
var v = function v(prefix) {
|
|
36
|
+
return function () {
|
|
37
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
38
|
+
args[_key] = arguments[_key];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var fallback = args.pop();
|
|
42
|
+
return args.reduceRight(function (acc, v) {
|
|
43
|
+
return "var(--".concat(prefix, "-").concat(v, ", ").concat(acc, ")");
|
|
44
|
+
}, fallback);
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
exports.v = v;
|
|
49
|
+
var pv = v('pie');
|
|
50
|
+
|
|
51
|
+
var text = function text() {
|
|
52
|
+
return pv('text', defaults.TEXT);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.text = text;
|
|
56
|
+
|
|
57
|
+
var disabled = function disabled() {
|
|
58
|
+
return pv('disabled', defaults.DISABLED);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
exports.disabled = disabled;
|
|
62
|
+
|
|
63
|
+
var correct = function correct() {
|
|
64
|
+
return pv('correct', defaults.CORRECT);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
exports.correct = correct;
|
|
68
|
+
|
|
69
|
+
var incorrect = function incorrect() {
|
|
70
|
+
return pv('incorrect', defaults.INCORRECT);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
exports.incorrect = incorrect;
|
|
74
|
+
|
|
75
|
+
var primary = function primary() {
|
|
76
|
+
return pv('primary', defaults.PRIMARY);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
exports.primary = primary;
|
|
80
|
+
|
|
81
|
+
var primaryLight = function primaryLight() {
|
|
82
|
+
return pv('primary-light', defaults.PRIMARY_LIGHT);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
exports.primaryLight = primaryLight;
|
|
86
|
+
|
|
87
|
+
var primaryDark = function primaryDark() {
|
|
88
|
+
return pv('primary-dark', defaults.PRIMARY_DARK);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
exports.primaryDark = primaryDark;
|
|
92
|
+
|
|
93
|
+
var primaryText = function primaryText() {
|
|
94
|
+
return pv('primary-text', 'text', defaults.TEXT);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
exports.primaryText = primaryText;
|
|
98
|
+
|
|
99
|
+
var secondary = function secondary() {
|
|
100
|
+
return pv('secondary', defaults.SECONDARY);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
exports.secondary = secondary;
|
|
104
|
+
|
|
105
|
+
var secondaryLight = function secondaryLight() {
|
|
106
|
+
return pv('secondary-light', defaults.SECONDARY_LIGHT);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
exports.secondaryLight = secondaryLight;
|
|
110
|
+
|
|
111
|
+
var secondaryDark = function secondaryDark() {
|
|
112
|
+
return pv('secondary-dark', defaults.SECONDARY_DARK);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
exports.secondaryDark = secondaryDark;
|
|
116
|
+
|
|
117
|
+
var secondaryText = function secondaryText() {
|
|
118
|
+
return pv('secondary-text', 'text', defaults.TEXT);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
exports.secondaryText = secondaryText;
|
|
122
|
+
|
|
123
|
+
var background = function background() {
|
|
124
|
+
return pv('background', defaults.BACKGROUND);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
exports.background = background;
|
|
128
|
+
|
|
129
|
+
var secondaryBackground = function secondaryBackground() {
|
|
130
|
+
return pv('secondary-background', defaults.SECONDARY_BACKGROUND);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
exports.secondaryBackground = secondaryBackground;
|
|
134
|
+
//# sourceMappingURL=color.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/color.js"],"names":["defaults","TEXT","DISABLED","CORRECT","green","INCORRECT","orange","PRIMARY","indigo","PRIMARY_LIGHT","PRIMARY_DARK","SECONDARY","pink","A400","SECONDARY_LIGHT","SECONDARY_DARK","BACKGROUND","SECONDARY_BACKGROUND","Object","freeze","v","prefix","args","fallback","pop","reduceRight","acc","pv","text","disabled","correct","incorrect","primary","primaryLight","primaryDark","primaryText","secondary","secondaryLight","secondaryDark","secondaryText","background","secondaryBackground"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;AAEO,IAAMA,QAAQ,GAAG;AACtBC,EAAAA,IAAI,EAAE,OADgB;AAEtBC,EAAAA,QAAQ,EAAE,MAFY;AAGtBC,EAAAA,OAAO,EAAEC,kBAAM,GAAN,CAHa;AAItBC,EAAAA,SAAS,EAAEC,mBAAO,GAAP,CAJW;AAKtBC,EAAAA,OAAO,EAAEC,mBAAO,GAA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EAAyB3B,QAAQ,CAACiB,oBAAlC,CAAR;AAAA,CAA5B","sourcesContent":["import green from '@material-ui/core/colors/green';\nimport orange from '@material-ui/core/colors/orange';\nimport pink from '@material-ui/core/colors/pink';\nimport indigo from '@material-ui/core/colors/indigo';\n\nexport const defaults = {\n TEXT: 'black',\n DISABLED: 'grey',\n CORRECT: green[500],\n INCORRECT: orange[500],\n PRIMARY: indigo[500],\n PRIMARY_LIGHT: indigo[200],\n PRIMARY_DARK: indigo[800],\n SECONDARY: pink.A400,\n SECONDARY_LIGHT: pink[200],\n SECONDARY_DARK: pink[900],\n BACKGROUND: 'rgba(255,255,255,0)',\n SECONDARY_BACKGROUND: 'rgba(241,241,241,1)'\n};\n\nObject.freeze(defaults);\n\nexport const v = prefix => (...args) => {\n const fallback = args.pop();\n return args.reduceRight((acc, v) => {\n return `var(--${prefix}-${v}, ${acc})`;\n }, fallback);\n};\n\nconst pv = v('pie');\n\nexport const text = () => pv('text', defaults.TEXT);\nexport const disabled = () => pv('disabled', defaults.DISABLED);\nexport const correct = () => pv('correct', defaults.CORRECT);\nexport const incorrect = () => pv('incorrect', defaults.INCORRECT);\n\nexport const primary = () => pv('primary', defaults.PRIMARY);\nexport const primaryLight = () => pv('primary-light', defaults.PRIMARY_LIGHT);\nexport const primaryDark = () => pv('primary-dark', defaults.PRIMARY_DARK);\nexport const primaryText = () => pv('primary-text', 'text', defaults.TEXT);\n\nexport const secondary = () => pv('secondary', defaults.SECONDARY);\nexport const secondaryLight = () => pv('secondary-light', defaults.SECONDARY_LIGHT);\nexport const secondaryDark = () => pv('secondary-dark', defaults.SECONDARY_DARK);\n\nexport const secondaryText = () => pv('secondary-text', 'text', defaults.TEXT);\nexport const background = () => pv('background', defaults.BACKGROUND);\nexport const secondaryBackground = () => pv('secondary-background', defaults.SECONDARY_BACKGROUND);\n"],"file":"color.js"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.Feedback = void 0;
|
|
9
|
+
|
|
10
|
+
var _styles = require("@material-ui/core/styles");
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _reactTransitionGroup = require("react-transition-group");
|
|
15
|
+
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
|
|
18
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
+
|
|
20
|
+
var color = _interopRequireWildcard(require("./color"));
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
+
|
|
28
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
|
+
|
|
30
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
31
|
+
|
|
32
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
33
|
+
|
|
34
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
35
|
+
|
|
36
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
+
|
|
38
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
39
|
+
|
|
40
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
41
|
+
|
|
42
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
+
|
|
44
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
|
+
|
|
46
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
|
+
|
|
48
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
49
|
+
|
|
50
|
+
var styleSheet = {
|
|
51
|
+
corespringFeedback: {
|
|
52
|
+
transformOrigin: '0% 0px 0px',
|
|
53
|
+
width: '100%',
|
|
54
|
+
display: 'block',
|
|
55
|
+
overflow: 'hidden',
|
|
56
|
+
'&:.incorrect': {
|
|
57
|
+
color: '#946202'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
content: {
|
|
61
|
+
'-webkit-font-smoothing': 'antialiased',
|
|
62
|
+
backgroundColor: "var(--feedback-bg-color, ".concat(color.disabled(), ")"),
|
|
63
|
+
borderRadius: '4px',
|
|
64
|
+
fontFamily: '"Roboto", "Noto", sans-serif',
|
|
65
|
+
fontSize: '12px',
|
|
66
|
+
lineHeight: '25px',
|
|
67
|
+
margin: '0px',
|
|
68
|
+
padding: '10px',
|
|
69
|
+
verticalAlign: 'middle',
|
|
70
|
+
color: 'var(--feedback-color, white)'
|
|
71
|
+
},
|
|
72
|
+
correct: {
|
|
73
|
+
backgroundColor: "var(--feedback-correct-bg-color, ".concat(color.correct(), ")")
|
|
74
|
+
},
|
|
75
|
+
incorrect: {
|
|
76
|
+
backgroundColor: "var(--feedback-incorrect-bg-color, ".concat(color.incorrect(), ")")
|
|
77
|
+
},
|
|
78
|
+
feedbackEnter: {
|
|
79
|
+
height: '1px'
|
|
80
|
+
},
|
|
81
|
+
feedbackEnterActive: {
|
|
82
|
+
height: '45px',
|
|
83
|
+
transition: 'height 500ms'
|
|
84
|
+
},
|
|
85
|
+
feedbackLeave: {
|
|
86
|
+
height: '45px'
|
|
87
|
+
},
|
|
88
|
+
feedbackLeaveActive: {
|
|
89
|
+
height: '1px',
|
|
90
|
+
transition: 'height 200ms'
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
var Feedback = /*#__PURE__*/function (_React$Component) {
|
|
95
|
+
_inherits(Feedback, _React$Component);
|
|
96
|
+
|
|
97
|
+
var _super = _createSuper(Feedback);
|
|
98
|
+
|
|
99
|
+
function Feedback() {
|
|
100
|
+
_classCallCheck(this, Feedback);
|
|
101
|
+
|
|
102
|
+
return _super.apply(this, arguments);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
_createClass(Feedback, [{
|
|
106
|
+
key: "render",
|
|
107
|
+
value: function render() {
|
|
108
|
+
var _this$props = this.props,
|
|
109
|
+
correctness = _this$props.correctness,
|
|
110
|
+
feedback = _this$props.feedback,
|
|
111
|
+
classes = _this$props.classes;
|
|
112
|
+
|
|
113
|
+
function chooseFeedback(correctness) {
|
|
114
|
+
if (correctness && feedback) {
|
|
115
|
+
return /*#__PURE__*/_react["default"].createElement(_reactTransitionGroup.CSSTransition, {
|
|
116
|
+
classNames: {
|
|
117
|
+
enter: classes.feedbackEnter,
|
|
118
|
+
enterActive: classes.feedbackEnterActive,
|
|
119
|
+
leave: classes.feedbackLeave,
|
|
120
|
+
leaveActive: classes.feedbackLeaveActive
|
|
121
|
+
},
|
|
122
|
+
key: "hasFeedback",
|
|
123
|
+
timeout: {
|
|
124
|
+
enter: 500,
|
|
125
|
+
exit: 300
|
|
126
|
+
}
|
|
127
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
128
|
+
className: classes.corespringFeedback
|
|
129
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
130
|
+
className: (0, _classnames["default"])(classes.content, classes[correctness]),
|
|
131
|
+
dangerouslySetInnerHTML: {
|
|
132
|
+
__html: feedback
|
|
133
|
+
}
|
|
134
|
+
})));
|
|
135
|
+
} else {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_reactTransitionGroup.TransitionGroup, null, chooseFeedback(correctness)));
|
|
141
|
+
}
|
|
142
|
+
}]);
|
|
143
|
+
|
|
144
|
+
return Feedback;
|
|
145
|
+
}(_react["default"].Component);
|
|
146
|
+
|
|
147
|
+
exports.Feedback = Feedback;
|
|
148
|
+
|
|
149
|
+
_defineProperty(Feedback, "propTypes", {
|
|
150
|
+
correctness: _propTypes["default"].string,
|
|
151
|
+
feedback: _propTypes["default"].string,
|
|
152
|
+
classes: _propTypes["default"].object.isRequired
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
var _default = (0, _styles.withStyles)(styleSheet, {
|
|
156
|
+
name: 'Feedback'
|
|
157
|
+
})(Feedback);
|
|
158
|
+
|
|
159
|
+
exports["default"] = _default;
|
|
160
|
+
//# sourceMappingURL=feedback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/feedback.jsx"],"names":["styleSheet","corespringFeedback","transformOrigin","width","display","overflow","color","content","backgroundColor","disabled","borderRadius","fontFamily","fontSize","lineHeight","margin","padding","verticalAlign","correct","incorrect","feedbackEnter","height","feedbackEnterActive","transition","feedbackLeave","feedbackLeaveActive","Feedback","props","correctness","feedback","classes","chooseFeedback","enter","enterActive","leave","leaveActive","exit","__html","React","Component","PropTypes","string","object","isRequired","name"],"mappings":";;;;;;;;;AAGA;;AAEA;;AACA;;AACA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A7C,C","sourcesContent":["/**\n * Lifted from multiple-choice - TODO: create a shared package for it.\n */\nimport { withStyles } from '@material-ui/core/styles';\n\nimport React from 'react';\nimport { TransitionGroup, CSSTransition } from 'react-transition-group';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport * as color from './color';\n\nconst styleSheet = {\n corespringFeedback: {\n transformOrigin: '0% 0px 0px',\n width: '100%',\n display: 'block',\n overflow: 'hidden',\n '&:.incorrect': {\n color: '#946202'\n }\n },\n content: {\n '-webkit-font-smoothing': 'antialiased',\n backgroundColor: `var(--feedback-bg-color, ${color.disabled()})`,\n borderRadius: '4px',\n fontFamily: '\"Roboto\", \"Noto\", sans-serif',\n fontSize: '12px',\n lineHeight: '25px',\n margin: '0px',\n padding: '10px',\n verticalAlign: 'middle',\n color: 'var(--feedback-color, white)'\n },\n correct: {\n backgroundColor: `var(--feedback-correct-bg-color, ${color.correct()})`\n },\n incorrect: {\n backgroundColor: `var(--feedback-incorrect-bg-color, ${color.incorrect()})`\n },\n feedbackEnter: {\n height: '1px'\n },\n feedbackEnterActive: {\n height: '45px',\n transition: 'height 500ms'\n },\n feedbackLeave: {\n height: '45px'\n },\n feedbackLeaveActive: {\n height: '1px',\n transition: 'height 200ms'\n }\n};\n\nexport class Feedback extends React.Component {\n static propTypes = {\n correctness: PropTypes.string,\n feedback: PropTypes.string,\n classes: PropTypes.object.isRequired\n };\n\n render() {\n const { correctness, feedback, classes } = this.props;\n\n function chooseFeedback(correctness) {\n if (correctness && feedback) {\n return (\n <CSSTransition\n classNames={{\n enter: classes.feedbackEnter,\n enterActive: classes.feedbackEnterActive,\n leave: classes.feedbackLeave,\n leaveActive: classes.feedbackLeaveActive\n }}\n key=\"hasFeedback\"\n timeout={{ enter: 500, exit: 300 }}\n >\n <div className={classes.corespringFeedback}>\n <div\n className={classNames(classes.content, classes[correctness])}\n dangerouslySetInnerHTML={{ __html: feedback }}\n />\n </div>\n </CSSTransition>\n );\n } else {\n return null;\n }\n }\n\n return (\n <div>\n <TransitionGroup>{chooseFeedback(correctness)}</TransitionGroup>\n </div>\n );\n }\n}\n\nexport default withStyles(styleSheet, { name: 'Feedback' })(Feedback);\n"],"file":"feedback.js"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.hasText = void 0;
|
|
7
|
+
var dp = new DOMParser();
|
|
8
|
+
|
|
9
|
+
var markupToText = function markupToText(s) {
|
|
10
|
+
var root = dp.parseFromString(s, 'text/html');
|
|
11
|
+
return root.body.textContent;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
var hasText = function hasText(s) {
|
|
15
|
+
if (!s) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var tc = markupToText(s);
|
|
20
|
+
return !!(tc && tc.trim());
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.hasText = hasText;
|
|
24
|
+
//# sourceMappingURL=has-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/has-text.js"],"names":["dp","DOMParser","markupToText","s","root","parseFromString","body","textContent","hasText","tc","trim"],"mappings":";;;;;;AAAA,IAAMA,EAAE,GAAG,IAAIC,SAAJ,EAAX;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAAAC,CAAC,EAAI;AACxB,MAAMC,IAAI,GAAGJ,EAAE,CAACK,eAAH,CAAmBF,CAAnB,EAAsB,WAAtB,CAAb;AACA,SAAOC,IAAI,CAACE,IAAL,CAAUC,WAAjB;AACD,CAHD;;AAKO,IAAMC,OAAO,GAAG,SAAVA,OAAU,CAAAL,CAAC,EAAI;AAC1B,MAAI,CAACA,CAAL,EAAQ;AACN,WAAO,KAAP;AACD;;AACD,MAAMM,EAAE,GAAGP,YAAY,CAACC,CAAD,CAAvB;AACA,SAAO,CAAC,EAAEM,EAAE,IAAIA,EAAE,CAACC,IAAH,EAAR,CAAR;AACD,CANM","sourcesContent":["const dp = new DOMParser();\n\nconst markupToText = s => {\n const root = dp.parseFromString(s, 'text/html');\n return root.body.textContent;\n};\n\nexport const hasText = s => {\n if (!s) {\n return false;\n }\n const tc = markupToText(s);\n return !!(tc && tc.trim());\n};\n"],"file":"has-text.js"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _mathRendering = require("@pie-lib/math-rendering");
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
|
|
18
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
+
|
|
20
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
21
|
+
|
|
22
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
23
|
+
|
|
24
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
25
|
+
|
|
26
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
+
|
|
28
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
29
|
+
|
|
30
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
31
|
+
|
|
32
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
|
+
|
|
34
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
|
+
|
|
36
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
|
+
|
|
38
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
39
|
+
|
|
40
|
+
var HtmlAndMath = /*#__PURE__*/function (_React$Component) {
|
|
41
|
+
_inherits(HtmlAndMath, _React$Component);
|
|
42
|
+
|
|
43
|
+
var _super = _createSuper(HtmlAndMath);
|
|
44
|
+
|
|
45
|
+
function HtmlAndMath() {
|
|
46
|
+
_classCallCheck(this, HtmlAndMath);
|
|
47
|
+
|
|
48
|
+
return _super.apply(this, arguments);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
_createClass(HtmlAndMath, [{
|
|
52
|
+
key: "componentDidMount",
|
|
53
|
+
value: function componentDidMount() {
|
|
54
|
+
if (this.node) {
|
|
55
|
+
(0, _mathRendering.renderMath)(this.node);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "componentDidUpdate",
|
|
60
|
+
value: function componentDidUpdate() {
|
|
61
|
+
if (this.node) {
|
|
62
|
+
(0, _mathRendering.renderMath)(this.node);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "render",
|
|
67
|
+
value: function render() {
|
|
68
|
+
var _this = this;
|
|
69
|
+
|
|
70
|
+
var _this$props = this.props,
|
|
71
|
+
tag = _this$props.tag,
|
|
72
|
+
className = _this$props.className,
|
|
73
|
+
html = _this$props.html;
|
|
74
|
+
var Tag = tag || 'div';
|
|
75
|
+
return /*#__PURE__*/_react["default"].createElement(Tag, {
|
|
76
|
+
ref: function ref(r) {
|
|
77
|
+
return _this.node = r;
|
|
78
|
+
},
|
|
79
|
+
className: className,
|
|
80
|
+
dangerouslySetInnerHTML: {
|
|
81
|
+
__html: html
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}]);
|
|
86
|
+
|
|
87
|
+
return HtmlAndMath;
|
|
88
|
+
}(_react["default"].Component);
|
|
89
|
+
|
|
90
|
+
exports["default"] = HtmlAndMath;
|
|
91
|
+
|
|
92
|
+
_defineProperty(HtmlAndMath, "propTypes", {
|
|
93
|
+
tag: _propTypes["default"].string,
|
|
94
|
+
className: _propTypes["default"].string,
|
|
95
|
+
html: _propTypes["default"].string
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
_defineProperty(HtmlAndMath, "defaultProps", {
|
|
99
|
+
tag: 'div',
|
|
100
|
+
html: ''
|
|
101
|
+
});
|
|
102
|
+
//# sourceMappingURL=html-and-math.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/html-and-math.js"],"names":["HtmlAndMath","node","props","tag","className","html","Tag","r","__html","React","Component","PropTypes","string"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;IAEqBA,W;;;;;;;;;;;;;WAYnB,6BAAoB;AAClB,UAAI,KAAKC,IAAT,EAAe;AACb,uCAAW,KAAKA,IAAhB;AACD;AACF;;;WAED,8BAAqB;AACnB,UAAI,KAAKA,IAAT,EAAe;AACb,uCAAW,KAAKA,IAAhB;AACD;AACF;;;WAED,kBAAS;AAAA;;AACP,wBAAiC,KAAKC,KAAtC;AAAA,UAAQC,GAAR,eAAQA,GAAR;AAAA,UAAaC,SAAb,eAAaA,SAAb;AAAA,UAAwBC,IAAxB,eAAwBA,IAAxB;AACA,UAAMC,GAAG,GAAGH,GAAG,IAAI,KAAnB;AACA,0BACE,gCAAC,GAAD;AACE,QAAA,GAAG,EAAE,aAAAI,CAAC;AAAA,iBAAK,KAAI,CAACN,IAAL,GAAYM,CAAjB;AAAA,SADR;AAEE,QAAA,SAAS,EAAEH,SAFb;AAGE,QAAA,uBAAuB,EAAE;AAAEI,UAAAA,MAAM,EAAEH;AAAV;AAH3B,QADF;AAOD;;;;EAlCsCI,kBAAMC,S;;;;gBAA1BV,W,eACA;AACjBG,EAAAA,GAAG,EAAEQ,sBAAUC,MADE;AAEjBR,EAAAA,SAAS,EAAEO,sBAAUC,MAFJ;AAGjBP,EAAAA,IAAI,EAAEM,sBAAUC;AAHC,C;;gBADAZ,W,kBAOG;AACpBG,EAAAA,GAAG,EAAE,KADe;AAEpBE,EAAAA,IAAI,EAAE;AAFc,C","sourcesContent":["import React from 'react';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport PropTypes from 'prop-types';\n\nexport default class HtmlAndMath extends React.Component {\n static propTypes = {\n tag: PropTypes.string,\n className: PropTypes.string,\n html: PropTypes.string\n };\n\n static defaultProps = {\n tag: 'div',\n html: ''\n };\n\n componentDidMount() {\n if (this.node) {\n renderMath(this.node);\n }\n }\n\n componentDidUpdate() {\n if (this.node) {\n renderMath(this.node);\n }\n }\n\n render() {\n const { tag, className, html } = this.props;\n const Tag = tag || 'div';\n return (\n <Tag\n ref={r => (this.node = r)}\n className={className}\n dangerouslySetInnerHTML={{ __html: html }}\n />\n );\n }\n}\n"],"file":"html-and-math.js"}
|