@pie-element/hotspot 5.7.1-beta.1 → 5.7.1-beta.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/configure/lib/button.js +51 -0
- package/configure/lib/button.js.map +1 -0
- package/configure/lib/defaults.js +82 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/hotspot-container.js +350 -0
- package/configure/lib/hotspot-container.js.map +1 -0
- package/configure/lib/hotspot-drawable.js +397 -0
- package/configure/lib/hotspot-drawable.js.map +1 -0
- package/configure/lib/hotspot-palette.js +126 -0
- package/configure/lib/hotspot-palette.js.map +1 -0
- package/configure/lib/hotspot-polygon.js +170 -0
- package/configure/lib/hotspot-polygon.js.map +1 -0
- package/configure/lib/hotspot-rectangle.js +123 -0
- package/configure/lib/hotspot-rectangle.js.map +1 -0
- package/configure/lib/index.js +177 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/root.js +359 -0
- package/configure/lib/root.js.map +1 -0
- package/configure/lib/upload-control.js +58 -0
- package/configure/lib/upload-control.js.map +1 -0
- package/configure/lib/utils.js +137 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +2 -2
- package/controller/lib/defaults.js +26 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +221 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/utils.js +39 -0
- package/controller/lib/utils.js.map +1 -0
- package/lib/hotspot/container.js +211 -0
- package/lib/hotspot/container.js.map +1 -0
- package/lib/hotspot/icons.js +8 -0
- package/lib/hotspot/icons.js.map +1 -0
- package/lib/hotspot/image.js +113 -0
- package/lib/hotspot/image.js.map +1 -0
- package/lib/hotspot/index.js +174 -0
- package/lib/hotspot/index.js.map +1 -0
- package/lib/hotspot/polygon.js +197 -0
- package/lib/hotspot/polygon.js.map +1 -0
- package/lib/hotspot/rectangle.js +179 -0
- package/lib/hotspot/rectangle.js.map +1 -0
- package/lib/index.js +87 -0
- package/lib/index.js.map +1 -0
- package/lib/session-updater.js +27 -0
- package/lib/session-updater.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
var _react = _interopRequireDefault(require("react"));
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
18
|
+
var _correctAnswerToggle = _interopRequireDefault(require("@pie-lib/correct-answer-toggle"));
|
|
19
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
20
|
+
var _styles = require("@material-ui/core/styles");
|
|
21
|
+
var _container = _interopRequireDefault(require("./container"));
|
|
22
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
23
|
+
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; } }
|
|
24
|
+
var HotspotComponent = /*#__PURE__*/function (_React$Component) {
|
|
25
|
+
(0, _inherits2["default"])(HotspotComponent, _React$Component);
|
|
26
|
+
var _super = _createSuper(HotspotComponent);
|
|
27
|
+
function HotspotComponent(props) {
|
|
28
|
+
var _this;
|
|
29
|
+
(0, _classCallCheck2["default"])(this, HotspotComponent);
|
|
30
|
+
_this = _super.call(this, props);
|
|
31
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onToggle", function () {
|
|
32
|
+
var showCorrect = _this.state.showCorrect;
|
|
33
|
+
_this.setState({
|
|
34
|
+
showCorrect: !showCorrect
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
_this.state = {
|
|
38
|
+
showCorrect: false,
|
|
39
|
+
observer: null,
|
|
40
|
+
scale: 1
|
|
41
|
+
};
|
|
42
|
+
return _this;
|
|
43
|
+
}
|
|
44
|
+
(0, _createClass2["default"])(HotspotComponent, [{
|
|
45
|
+
key: "componentDidMount",
|
|
46
|
+
value: function componentDidMount() {
|
|
47
|
+
var _this2 = this;
|
|
48
|
+
this.observer = new MutationObserver(function (mutations) {
|
|
49
|
+
mutations.forEach(function () {
|
|
50
|
+
var _document$getElementB;
|
|
51
|
+
var target = (_document$getElementB = document.getElementById('question-container')) === null || _document$getElementB === void 0 || (_document$getElementB = _document$getElementB.style) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.cssText;
|
|
52
|
+
var zoom = target === null || target === void 0 ? void 0 : target.substring(target.indexOf('--pie-zoom') + 11, target.lastIndexOf('%'));
|
|
53
|
+
var zoomParsed = zoom === null || zoom === void 0 ? void 0 : zoom.replace(/\s/g, '');
|
|
54
|
+
if (zoomParsed) {
|
|
55
|
+
var newScale = parseFloat(zoomParsed) / 100;
|
|
56
|
+
if (newScale !== _this2.state.scale) {
|
|
57
|
+
_this2.setState({
|
|
58
|
+
scale: parseFloat(zoomParsed) / 100
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
} else if (!zoomParsed && _this2.state.scale !== 1) {
|
|
62
|
+
_this2.setState({
|
|
63
|
+
scale: 1
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
var target = document.getElementById('question-container');
|
|
69
|
+
if (target) {
|
|
70
|
+
this.observer.observe(target, {
|
|
71
|
+
attributes: true,
|
|
72
|
+
attributeFilter: ['style']
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "componentWillUnmount",
|
|
78
|
+
value: function componentWillUnmount() {
|
|
79
|
+
var _this$observer;
|
|
80
|
+
(_this$observer = this.observer) === null || _this$observer === void 0 ? void 0 : _this$observer.disconnect();
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
key: "render",
|
|
84
|
+
value: function render() {
|
|
85
|
+
var _this$props = this.props,
|
|
86
|
+
session = _this$props.session,
|
|
87
|
+
_this$props$model = _this$props.model,
|
|
88
|
+
disabled = _this$props$model.disabled,
|
|
89
|
+
imageUrl = _this$props$model.imageUrl,
|
|
90
|
+
prompt = _this$props$model.prompt,
|
|
91
|
+
mode = _this$props$model.mode,
|
|
92
|
+
multipleCorrect = _this$props$model.multipleCorrect,
|
|
93
|
+
shapes = _this$props$model.shapes,
|
|
94
|
+
outlineColor = _this$props$model.outlineColor,
|
|
95
|
+
hotspotColor = _this$props$model.hotspotColor,
|
|
96
|
+
dimensions = _this$props$model.dimensions,
|
|
97
|
+
rationale = _this$props$model.rationale,
|
|
98
|
+
teacherInstructions = _this$props$model.teacherInstructions,
|
|
99
|
+
strokeWidth = _this$props$model.strokeWidth,
|
|
100
|
+
responseCorrect = _this$props$model.responseCorrect,
|
|
101
|
+
onSelectChoice = _this$props.onSelectChoice,
|
|
102
|
+
classes = _this$props.classes;
|
|
103
|
+
var showCorrect = this.state.showCorrect;
|
|
104
|
+
var isEvaluateMode = mode === 'evaluate';
|
|
105
|
+
var showCorrectAnswerToggle = isEvaluateMode && !responseCorrect;
|
|
106
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, showCorrectAnswerToggle && /*#__PURE__*/_react["default"].createElement(_correctAnswerToggle["default"], {
|
|
107
|
+
show: showCorrectAnswerToggle,
|
|
108
|
+
toggled: showCorrect,
|
|
109
|
+
onToggle: this.onToggle.bind(this)
|
|
110
|
+
}), showCorrectAnswerToggle && /*#__PURE__*/_react["default"].createElement("br", null), teacherInstructions && (0, _renderUi.hasText)(teacherInstructions) && /*#__PURE__*/_react["default"].createElement(_renderUi.Collapsible, {
|
|
111
|
+
labels: {
|
|
112
|
+
hidden: 'Show Teacher Instructions',
|
|
113
|
+
visible: 'Hide Teacher Instructions'
|
|
114
|
+
},
|
|
115
|
+
className: classes.collapsible
|
|
116
|
+
}, /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
|
|
117
|
+
className: "prompt",
|
|
118
|
+
prompt: teacherInstructions
|
|
119
|
+
})), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
120
|
+
className: classes.prompt
|
|
121
|
+
}, /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
|
|
122
|
+
className: "prompt",
|
|
123
|
+
prompt: prompt
|
|
124
|
+
})), imageUrl ? /*#__PURE__*/_react["default"].createElement(_container["default"], {
|
|
125
|
+
isEvaluateMode: isEvaluateMode,
|
|
126
|
+
session: session,
|
|
127
|
+
dimensions: dimensions,
|
|
128
|
+
imageUrl: imageUrl,
|
|
129
|
+
hotspotColor: hotspotColor,
|
|
130
|
+
multipleCorrect: multipleCorrect,
|
|
131
|
+
outlineColor: outlineColor,
|
|
132
|
+
onSelectChoice: onSelectChoice,
|
|
133
|
+
shapes: shapes,
|
|
134
|
+
disabled: disabled,
|
|
135
|
+
strokeWidth: strokeWidth,
|
|
136
|
+
scale: this.state.scale,
|
|
137
|
+
showCorrect: showCorrect
|
|
138
|
+
}) : null, rationale && (0, _renderUi.hasText)(rationale) && /*#__PURE__*/_react["default"].createElement(_renderUi.Collapsible, {
|
|
139
|
+
labels: {
|
|
140
|
+
hidden: 'Show Rationale',
|
|
141
|
+
visible: 'Hide Rationale'
|
|
142
|
+
},
|
|
143
|
+
className: classes.collapsible
|
|
144
|
+
}, /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
|
|
145
|
+
className: "prompt",
|
|
146
|
+
prompt: rationale
|
|
147
|
+
})));
|
|
148
|
+
}
|
|
149
|
+
}]);
|
|
150
|
+
return HotspotComponent;
|
|
151
|
+
}(_react["default"].Component);
|
|
152
|
+
HotspotComponent.propTypes = {
|
|
153
|
+
classes: _propTypes["default"].object,
|
|
154
|
+
model: _propTypes["default"].object.isRequired,
|
|
155
|
+
onSelectChoice: _propTypes["default"].func.isRequired,
|
|
156
|
+
session: _propTypes["default"].object.isRequired
|
|
157
|
+
};
|
|
158
|
+
HotspotComponent.defaultProps = {
|
|
159
|
+
classes: {}
|
|
160
|
+
};
|
|
161
|
+
var styles = function styles(theme) {
|
|
162
|
+
return {
|
|
163
|
+
collapsible: {
|
|
164
|
+
paddingTop: theme.spacing.unit * 2,
|
|
165
|
+
paddingBottom: theme.spacing.unit * 2
|
|
166
|
+
},
|
|
167
|
+
prompt: {
|
|
168
|
+
fontSize: 'inherit'
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
var _default = (0, _styles.withStyles)(styles)(HotspotComponent);
|
|
173
|
+
exports["default"] = _default;
|
|
174
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_propTypes","_Typography","_correctAnswerToggle","_renderUi","_styles","_container","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","HotspotComponent","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","_defineProperty2","_assertThisInitialized2","showCorrect","state","setState","observer","scale","_createClass2","key","value","componentDidMount","_this2","MutationObserver","mutations","forEach","_document$getElementB","target","document","getElementById","style","cssText","zoom","substring","indexOf","lastIndexOf","zoomParsed","replace","newScale","parseFloat","observe","attributes","attributeFilter","componentWillUnmount","_this$observer","disconnect","render","_this$props","session","_this$props$model","model","disabled","imageUrl","prompt","mode","multipleCorrect","shapes","outlineColor","hotspotColor","dimensions","rationale","teacherInstructions","strokeWidth","responseCorrect","onSelectChoice","classes","isEvaluateMode","showCorrectAnswerToggle","createElement","show","toggled","onToggle","bind","hasText","Collapsible","labels","hidden","visible","className","collapsible","PreviewPrompt","React","Component","propTypes","PropTypes","object","isRequired","func","defaultProps","styles","theme","paddingTop","spacing","unit","paddingBottom","fontSize","_default","withStyles","exports"],"sources":["../../src/hotspot/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Typography from '@material-ui/core/Typography';\nimport CorrectAnswerToggle from '@pie-lib/correct-answer-toggle';\nimport { Collapsible, hasText, PreviewPrompt } from '@pie-lib/render-ui';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport Container from './container';\n\nclass HotspotComponent extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n showCorrect: false,\n observer: null,\n scale: 1,\n };\n }\n\n componentDidMount() {\n this.observer = new MutationObserver((mutations) => {\n mutations.forEach(() => {\n const target = document.getElementById('question-container')?.style?.cssText;\n const zoom = target?.substring(target.indexOf('--pie-zoom') + 11, target.lastIndexOf('%'));\n\n const zoomParsed = zoom?.replace(/\\s/g, '');\n if (zoomParsed) {\n const newScale = parseFloat(zoomParsed) / 100;\n if (newScale !== this.state.scale) {\n this.setState({\n scale: parseFloat(zoomParsed) / 100,\n });\n }\n } else if (!zoomParsed && this.state.scale !== 1) {\n this.setState({\n scale: 1,\n });\n }\n });\n });\n\n const target = document.getElementById('question-container');\n if (target) {\n this.observer.observe(target, { attributes: true, attributeFilter: ['style'] });\n }\n }\n\n componentWillUnmount() {\n this.observer?.disconnect();\n }\n\n onToggle = () => {\n const { showCorrect } = this.state;\n this.setState({ showCorrect: !showCorrect });\n };\n\n render() {\n const {\n session,\n model: {\n disabled,\n imageUrl,\n prompt,\n mode,\n multipleCorrect,\n shapes,\n outlineColor,\n hotspotColor,\n dimensions,\n rationale,\n teacherInstructions,\n strokeWidth,\n responseCorrect,\n },\n onSelectChoice,\n classes,\n } = this.props;\n const { showCorrect } = this.state;\n const isEvaluateMode = mode === 'evaluate';\n const showCorrectAnswerToggle = isEvaluateMode && !responseCorrect;\n\n return (\n <div>\n {showCorrectAnswerToggle && (\n <CorrectAnswerToggle\n show={showCorrectAnswerToggle}\n toggled={showCorrect}\n onToggle={this.onToggle.bind(this)}\n />\n )}\n {showCorrectAnswerToggle && <br />}\n {teacherInstructions && hasText(teacherInstructions) && (\n <Collapsible\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n className={classes.collapsible}\n >\n <PreviewPrompt className=\"prompt\" prompt={teacherInstructions} />\n </Collapsible>\n )}\n\n <Typography className={classes.prompt}>\n <PreviewPrompt className=\"prompt\" prompt={prompt} />\n </Typography>\n\n {imageUrl ? (\n <Container\n isEvaluateMode={isEvaluateMode}\n session={session}\n dimensions={dimensions}\n imageUrl={imageUrl}\n hotspotColor={hotspotColor}\n multipleCorrect={multipleCorrect}\n outlineColor={outlineColor}\n onSelectChoice={onSelectChoice}\n shapes={shapes}\n disabled={disabled}\n strokeWidth={strokeWidth}\n scale={this.state.scale}\n showCorrect={showCorrect}\n />\n ) : null}\n\n {rationale && hasText(rationale) && (\n <Collapsible labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }} className={classes.collapsible}>\n <PreviewPrompt className=\"prompt\" prompt={rationale} />\n </Collapsible>\n )}\n </div>\n );\n }\n}\n\nHotspotComponent.propTypes = {\n classes: PropTypes.object,\n model: PropTypes.object.isRequired,\n onSelectChoice: PropTypes.func.isRequired,\n session: PropTypes.object.isRequired,\n};\n\nHotspotComponent.defaultProps = {\n classes: {},\n};\n\nconst styles = (theme) => ({\n collapsible: {\n paddingTop: theme.spacing.unit * 2,\n paddingBottom: theme.spacing.unit * 2,\n },\n prompt: {\n fontSize: 'inherit',\n },\n});\n\nexport default withStyles(styles)(HotspotComponent);\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,oBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,UAAA,GAAAP,sBAAA,CAAAC,OAAA;AAAoC,SAAAO,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,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CAAE,CAC3C,CAEZ,CAAC;IAEV;EAAC;EAAA,OAAAxD,gBAAA;AAAA,EAxH4B6E,iBAAK,CAACC,SAAS;AA2H9C9E,gBAAgB,CAAC+E,SAAS,GAAG;EAC3BlB,OAAO,EAAEmB,qBAAS,CAACC,MAAM;EACzBnC,KAAK,EAAEkC,qBAAS,CAACC,MAAM,CAACC,UAAU;EAClCtB,cAAc,EAAEoB,qBAAS,CAACG,IAAI,CAACD,UAAU;EACzCtC,OAAO,EAAEoC,qBAAS,CAACC,MAAM,CAACC;AAC5B,CAAC;AAEDlF,gBAAgB,CAACoF,YAAY,GAAG;EAC9BvB,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,IAAMwB,MAAM,GAAG,SAATA,MAAMA,CAAIC,KAAK;EAAA,OAAM;IACzBX,WAAW,EAAE;MACXY,UAAU,EAAED,KAAK,CAACE,OAAO,CAACC,IAAI,GAAG,CAAC;MAClCC,aAAa,EAAEJ,KAAK,CAACE,OAAO,CAACC,IAAI,GAAG;IACtC,CAAC;IACDxC,MAAM,EAAE;MACN0C,QAAQ,EAAE;IACZ;EACF,CAAC;AAAA,CAAC;AAAC,IAAAC,QAAA,GAEY,IAAAC,kBAAU,EAACR,MAAM,CAAC,CAACrF,gBAAgB,CAAC;AAAA8F,OAAA,cAAAF,QAAA"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
var _react = _interopRequireDefault(require("react"));
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
var _reactKonva = require("react-konva");
|
|
18
|
+
var _styles = require("@material-ui/core/styles");
|
|
19
|
+
var _image = _interopRequireDefault(require("./image"));
|
|
20
|
+
var _icons = require("./icons");
|
|
21
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
22
|
+
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; } }
|
|
23
|
+
var PolygonComponent = /*#__PURE__*/function (_React$Component) {
|
|
24
|
+
(0, _inherits2["default"])(PolygonComponent, _React$Component);
|
|
25
|
+
var _super = _createSuper(PolygonComponent);
|
|
26
|
+
function PolygonComponent(props) {
|
|
27
|
+
var _this;
|
|
28
|
+
(0, _classCallCheck2["default"])(this, PolygonComponent);
|
|
29
|
+
_this = _super.call(this, props);
|
|
30
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPolygonCenter", function (points) {
|
|
31
|
+
var x = points.map(function (_ref) {
|
|
32
|
+
var x = _ref.x;
|
|
33
|
+
return x;
|
|
34
|
+
});
|
|
35
|
+
var y = points.map(function (_ref2) {
|
|
36
|
+
var y = _ref2.y;
|
|
37
|
+
return y;
|
|
38
|
+
});
|
|
39
|
+
var minX = Math.min.apply(null, x);
|
|
40
|
+
var maxX = Math.max.apply(null, x);
|
|
41
|
+
var minY = Math.min.apply(null, y);
|
|
42
|
+
var maxY = Math.max.apply(null, y);
|
|
43
|
+
return [(minX + maxX) / 2, (minY + maxY) / 2];
|
|
44
|
+
});
|
|
45
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "parsePointsForKonva", function (points) {
|
|
46
|
+
var parsedPoints = [];
|
|
47
|
+
points.forEach(function (_ref3) {
|
|
48
|
+
var x = _ref3.x,
|
|
49
|
+
y = _ref3.y;
|
|
50
|
+
parsedPoints.push(x);
|
|
51
|
+
parsedPoints.push(y);
|
|
52
|
+
});
|
|
53
|
+
return parsedPoints;
|
|
54
|
+
});
|
|
55
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClick", function (e) {
|
|
56
|
+
var _this$props = _this.props,
|
|
57
|
+
onClick = _this$props.onClick,
|
|
58
|
+
id = _this$props.id,
|
|
59
|
+
selected = _this$props.selected,
|
|
60
|
+
disabled = _this$props.disabled;
|
|
61
|
+
if (!disabled) {
|
|
62
|
+
e.cancelBubble = true;
|
|
63
|
+
onClick({
|
|
64
|
+
id: id,
|
|
65
|
+
selected: !selected
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMouseEnter", function () {
|
|
70
|
+
var disabled = _this.props.disabled;
|
|
71
|
+
if (!disabled) {
|
|
72
|
+
document.body.style.cursor = 'pointer';
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMouseLeave", function () {
|
|
76
|
+
document.body.style.cursor = 'default';
|
|
77
|
+
});
|
|
78
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getEvaluateOutlineColor", function (isCorrect, markAsCorrect, outlineColor) {
|
|
79
|
+
return markAsCorrect ? 'green' : isCorrect ? outlineColor : 'red';
|
|
80
|
+
});
|
|
81
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getOutlineWidth", function (showCorrectEnabled, selected, markAsCorrect, strokeWidth) {
|
|
82
|
+
return markAsCorrect || !markAsCorrect && !showCorrectEnabled && selected ? strokeWidth : 0;
|
|
83
|
+
});
|
|
84
|
+
return _this;
|
|
85
|
+
}
|
|
86
|
+
(0, _createClass2["default"])(PolygonComponent, [{
|
|
87
|
+
key: "render",
|
|
88
|
+
value: function render() {
|
|
89
|
+
var _this$props2 = this.props,
|
|
90
|
+
classes = _this$props2.classes,
|
|
91
|
+
hotspotColor = _this$props2.hotspotColor,
|
|
92
|
+
isCorrect = _this$props2.isCorrect,
|
|
93
|
+
isEvaluateMode = _this$props2.isEvaluateMode,
|
|
94
|
+
outlineColor = _this$props2.outlineColor,
|
|
95
|
+
selected = _this$props2.selected,
|
|
96
|
+
points = _this$props2.points,
|
|
97
|
+
evaluateText = _this$props2.evaluateText,
|
|
98
|
+
strokeWidth = _this$props2.strokeWidth,
|
|
99
|
+
scale = _this$props2.scale,
|
|
100
|
+
markAsCorrect = _this$props2.markAsCorrect,
|
|
101
|
+
showCorrectEnabled = _this$props2.showCorrectEnabled;
|
|
102
|
+
var outlineColorParsed = isEvaluateMode ? this.getEvaluateOutlineColor(isCorrect, markAsCorrect, outlineColor) : outlineColor;
|
|
103
|
+
var outlineWidth = this.getOutlineWidth(showCorrectEnabled, selected, markAsCorrect, strokeWidth);
|
|
104
|
+
var pointsParsed = this.parsePointsForKonva(points);
|
|
105
|
+
var center = this.getPolygonCenter(points);
|
|
106
|
+
var iconX = center[0];
|
|
107
|
+
var iconY = center[1];
|
|
108
|
+
|
|
109
|
+
// "Show Correct Answer" Enabled:
|
|
110
|
+
// - Correctly Selected: white checkmark in green circle
|
|
111
|
+
// - Correctly Not Selected: none
|
|
112
|
+
// - Incorrectly Selected: none
|
|
113
|
+
// - Incorrectly Not Selected: white checkmark in green circle
|
|
114
|
+
// "Show Correct Answer" Disabled:
|
|
115
|
+
// - Correctly Selected:
|
|
116
|
+
// - white checkmark in green circle
|
|
117
|
+
// - heavy outline, as on “Gather”
|
|
118
|
+
// - Correctly Not Selected: none
|
|
119
|
+
// - Incorrectly Selected:
|
|
120
|
+
// - white "X" in red circle
|
|
121
|
+
// - heavy outline around the selection should appear in red
|
|
122
|
+
// - Incorrectly Not Selected: white "X" in red circle
|
|
123
|
+
var iconSrc;
|
|
124
|
+
if (showCorrectEnabled) {
|
|
125
|
+
if (selected && isCorrect || !selected && !isCorrect) {
|
|
126
|
+
iconSrc = _icons.faCorrect;
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
if (selected) {
|
|
130
|
+
if (isCorrect) {
|
|
131
|
+
iconSrc = _icons.faCorrect;
|
|
132
|
+
} else {
|
|
133
|
+
iconSrc = _icons.faWrong;
|
|
134
|
+
}
|
|
135
|
+
} else if (!isCorrect) {
|
|
136
|
+
iconSrc = _icons.faWrong;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return /*#__PURE__*/_react["default"].createElement(_reactKonva.Group, {
|
|
140
|
+
scaleX: scale,
|
|
141
|
+
scaleY: scale
|
|
142
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactKonva.Line, {
|
|
143
|
+
points: pointsParsed,
|
|
144
|
+
closed: true,
|
|
145
|
+
classes: classes.base,
|
|
146
|
+
fill: hotspotColor,
|
|
147
|
+
onClick: this.handleClick,
|
|
148
|
+
onTap: this.handleClick,
|
|
149
|
+
draggable: false,
|
|
150
|
+
stroke: outlineColorParsed,
|
|
151
|
+
strokeWidth: outlineWidth,
|
|
152
|
+
onMouseLeave: this.handleMouseLeave,
|
|
153
|
+
onMouseEnter: this.handleMouseEnter
|
|
154
|
+
}), isEvaluateMode && iconSrc ? /*#__PURE__*/_react["default"].createElement(_image["default"], {
|
|
155
|
+
src: iconSrc,
|
|
156
|
+
x: iconX,
|
|
157
|
+
y: iconY,
|
|
158
|
+
tooltip: evaluateText
|
|
159
|
+
}) : null);
|
|
160
|
+
}
|
|
161
|
+
}]);
|
|
162
|
+
return PolygonComponent;
|
|
163
|
+
}(_react["default"].Component);
|
|
164
|
+
var styles = function styles() {
|
|
165
|
+
return {
|
|
166
|
+
base: {
|
|
167
|
+
cursor: 'pointer',
|
|
168
|
+
opacity: 0.5,
|
|
169
|
+
position: 'relative'
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
PolygonComponent.propTypes = {
|
|
174
|
+
classes: _propTypes["default"].object.isRequired,
|
|
175
|
+
hotspotColor: _propTypes["default"].string.isRequired,
|
|
176
|
+
id: _propTypes["default"].string.isRequired,
|
|
177
|
+
isCorrect: _propTypes["default"].bool.isRequired,
|
|
178
|
+
isEvaluateMode: _propTypes["default"].bool.isRequired,
|
|
179
|
+
disabled: _propTypes["default"].bool.isRequired,
|
|
180
|
+
onClick: _propTypes["default"].func.isRequired,
|
|
181
|
+
outlineColor: _propTypes["default"].string.isRequired,
|
|
182
|
+
points: _propTypes["default"].array.isRequired,
|
|
183
|
+
selected: _propTypes["default"].bool.isRequired,
|
|
184
|
+
evaluateText: _propTypes["default"].string,
|
|
185
|
+
strokeWidth: _propTypes["default"].number,
|
|
186
|
+
scale: _propTypes["default"].number,
|
|
187
|
+
markAsCorrect: _propTypes["default"].bool.isRequired,
|
|
188
|
+
showCorrectEnabled: _propTypes["default"].bool.isRequired
|
|
189
|
+
};
|
|
190
|
+
PolygonComponent.defaultProps = {
|
|
191
|
+
evaluateText: null,
|
|
192
|
+
strokeWidth: 5,
|
|
193
|
+
scale: 1
|
|
194
|
+
};
|
|
195
|
+
var _default = (0, _styles.withStyles)(styles)(PolygonComponent);
|
|
196
|
+
exports["default"] = _default;
|
|
197
|
+
//# sourceMappingURL=polygon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polygon.js","names":["_react","_interopRequireDefault","require","_propTypes","_reactKonva","_styles","_image","_icons","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","PolygonComponent","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","_defineProperty2","_assertThisInitialized2","points","x","map","_ref","y","_ref2","minX","Math","min","maxX","max","minY","maxY","parsedPoints","forEach","_ref3","push","_this$props","onClick","id","selected","disabled","cancelBubble","document","body","style","cursor","isCorrect","markAsCorrect","outlineColor","showCorrectEnabled","strokeWidth","_createClass2","key","value","render","_this$props2","classes","hotspotColor","isEvaluateMode","evaluateText","scale","outlineColorParsed","getEvaluateOutlineColor","outlineWidth","getOutlineWidth","pointsParsed","parsePointsForKonva","center","getPolygonCenter","iconX","iconY","iconSrc","faCorrect","faWrong","createElement","Group","scaleX","scaleY","Line","closed","base","fill","handleClick","onTap","draggable","stroke","onMouseLeave","handleMouseLeave","onMouseEnter","handleMouseEnter","src","tooltip","React","Component","styles","opacity","position","propTypes","PropTypes","object","isRequired","string","bool","func","array","number","defaultProps","_default","withStyles","exports"],"sources":["../../src/hotspot/polygon.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Line, Group } from 'react-konva';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport Image from './image';\nimport { faCorrect, faWrong } from './icons';\n\nclass PolygonComponent extends React.Component {\n constructor(props) {\n super(props);\n }\n\n getPolygonCenter = (points) => {\n const x = points.map(({ x }) => x);\n const y = points.map(({ y }) => y);\n const minX = Math.min.apply(null, x);\n const maxX = Math.max.apply(null, x);\n const minY = Math.min.apply(null, y);\n const maxY = Math.max.apply(null, y);\n return [(minX + maxX) / 2, (minY + maxY) / 2];\n };\n\n parsePointsForKonva = (points) => {\n const parsedPoints = [];\n points.forEach(({ x, y }) => {\n parsedPoints.push(x);\n parsedPoints.push(y);\n });\n return parsedPoints;\n };\n\n handleClick = (e) => {\n const { onClick, id, selected, disabled } = this.props;\n\n if (!disabled) {\n e.cancelBubble = true;\n onClick({ id, selected: !selected });\n }\n };\n\n handleMouseEnter = () => {\n const { disabled } = this.props;\n\n if (!disabled) {\n document.body.style.cursor = 'pointer';\n }\n };\n\n handleMouseLeave = () => {\n document.body.style.cursor = 'default';\n };\n\n getEvaluateOutlineColor = (isCorrect, markAsCorrect, outlineColor) =>\n markAsCorrect ? 'green' : isCorrect ? outlineColor : 'red';\n\n getOutlineWidth = (showCorrectEnabled, selected, markAsCorrect, strokeWidth) =>\n markAsCorrect || (!markAsCorrect && !showCorrectEnabled && selected) ? strokeWidth : 0;\n\n render() {\n const {\n classes,\n hotspotColor,\n isCorrect,\n isEvaluateMode,\n outlineColor,\n selected,\n points,\n evaluateText,\n strokeWidth,\n scale,\n markAsCorrect,\n showCorrectEnabled,\n } = this.props;\n\n const outlineColorParsed = isEvaluateMode\n ? this.getEvaluateOutlineColor(isCorrect, markAsCorrect, outlineColor)\n : outlineColor;\n const outlineWidth = this.getOutlineWidth(showCorrectEnabled, selected, markAsCorrect, strokeWidth);\n\n const pointsParsed = this.parsePointsForKonva(points);\n const center = this.getPolygonCenter(points);\n const iconX = center[0];\n const iconY = center[1];\n\n // \"Show Correct Answer\" Enabled:\n // - Correctly Selected: white checkmark in green circle\n // - Correctly Not Selected: none\n // - Incorrectly Selected: none\n // - Incorrectly Not Selected: white checkmark in green circle\n // \"Show Correct Answer\" Disabled:\n // - Correctly Selected:\n // - white checkmark in green circle\n // - heavy outline, as on “Gather”\n // - Correctly Not Selected: none\n // - Incorrectly Selected:\n // - white \"X\" in red circle\n // - heavy outline around the selection should appear in red\n // - Incorrectly Not Selected: white \"X\" in red circle\n let iconSrc;\n\n if (showCorrectEnabled) {\n if ((selected && isCorrect) || (!selected && !isCorrect)) {\n iconSrc = faCorrect;\n }\n } else {\n if (selected) {\n if (isCorrect) {\n iconSrc = faCorrect;\n } else {\n iconSrc = faWrong;\n }\n } else if (!isCorrect) {\n iconSrc = faWrong;\n }\n }\n\n return (\n <Group scaleX={scale} scaleY={scale}>\n <Line\n points={pointsParsed}\n closed={true}\n classes={classes.base}\n fill={hotspotColor}\n onClick={this.handleClick}\n onTap={this.handleClick}\n draggable={false}\n stroke={outlineColorParsed}\n strokeWidth={outlineWidth}\n onMouseLeave={this.handleMouseLeave}\n onMouseEnter={this.handleMouseEnter}\n />\n {isEvaluateMode && iconSrc ? <Image src={iconSrc} x={iconX} y={iconY} tooltip={evaluateText} /> : null}\n </Group>\n );\n }\n}\n\nconst styles = () => ({\n base: {\n cursor: 'pointer',\n opacity: 0.5,\n position: 'relative',\n },\n});\n\nPolygonComponent.propTypes = {\n classes: PropTypes.object.isRequired,\n hotspotColor: PropTypes.string.isRequired,\n id: PropTypes.string.isRequired,\n isCorrect: PropTypes.bool.isRequired,\n isEvaluateMode: PropTypes.bool.isRequired,\n disabled: PropTypes.bool.isRequired,\n onClick: PropTypes.func.isRequired,\n outlineColor: PropTypes.string.isRequired,\n points: PropTypes.array.isRequired,\n selected: PropTypes.bool.isRequired,\n evaluateText: PropTypes.string,\n strokeWidth: PropTypes.number,\n scale: PropTypes.number,\n markAsCorrect: PropTypes.bool.isRequired,\n showCorrectEnabled: PropTypes.bool.isRequired,\n};\n\nPolygonComponent.defaultProps = {\n evaluateText: null,\n strokeWidth: 5,\n scale: 1,\n};\n\nexport default withStyles(styles)(PolygonComponent);\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,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D,SAAS,EAAEoD,qBAAS,CAACI,IAAI,CAACF,UAAU;EACpC1C,cAAc,EAAEwC,qBAAS,CAACI,IAAI,CAACF,UAAU;EACzC5D,QAAQ,EAAE0D,qBAAS,CAACI,IAAI,CAACF,UAAU;EACnC/D,OAAO,EAAE6D,qBAAS,CAACK,IAAI,CAACH,UAAU;EAClCpD,YAAY,EAAEkD,qBAAS,CAACG,MAAM,CAACD,UAAU;EACzCjF,MAAM,EAAE+E,qBAAS,CAACM,KAAK,CAACJ,UAAU;EAClC7D,QAAQ,EAAE2D,qBAAS,CAACI,IAAI,CAACF,UAAU;EACnCzC,YAAY,EAAEuC,qBAAS,CAACG,MAAM;EAC9BnD,WAAW,EAAEgD,qBAAS,CAACO,MAAM;EAC7B7C,KAAK,EAAEsC,qBAAS,CAACO,MAAM;EACvB1D,aAAa,EAAEmD,qBAAS,CAACI,IAAI,CAACF,UAAU;EACxCnD,kBAAkB,EAAEiD,qBAAS,CAACI,IAAI,CAACF;AACrC,CAAC;AAED1F,gBAAgB,CAACgG,YAAY,GAAG;EAC9B/C,YAAY,EAAE,IAAI;EAClBT,WAAW,EAAE,CAAC;EACdU,KAAK,EAAE;AACT,CAAC;AAAC,IAAA+C,QAAA,GAEa,IAAAC,kBAAU,EAACd,MAAM,CAAC,CAACpF,gBAAgB,CAAC;AAAAmG,OAAA,cAAAF,QAAA"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
var _react = _interopRequireDefault(require("react"));
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
var _reactKonva = require("react-konva");
|
|
18
|
+
var _styles = require("@material-ui/core/styles");
|
|
19
|
+
var _image = _interopRequireDefault(require("./image"));
|
|
20
|
+
var _icons = require("./icons");
|
|
21
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
22
|
+
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; } }
|
|
23
|
+
var RectComponent = /*#__PURE__*/function (_React$Component) {
|
|
24
|
+
(0, _inherits2["default"])(RectComponent, _React$Component);
|
|
25
|
+
var _super = _createSuper(RectComponent);
|
|
26
|
+
function RectComponent(props) {
|
|
27
|
+
var _this;
|
|
28
|
+
(0, _classCallCheck2["default"])(this, RectComponent);
|
|
29
|
+
_this = _super.call(this, props);
|
|
30
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClick", function (e) {
|
|
31
|
+
var _this$props = _this.props,
|
|
32
|
+
onClick = _this$props.onClick,
|
|
33
|
+
id = _this$props.id,
|
|
34
|
+
selected = _this$props.selected,
|
|
35
|
+
disabled = _this$props.disabled;
|
|
36
|
+
if (!disabled) {
|
|
37
|
+
e.cancelBubble = true;
|
|
38
|
+
onClick({
|
|
39
|
+
id: id,
|
|
40
|
+
selected: !selected
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMouseEnter", function () {
|
|
45
|
+
var disabled = _this.props.disabled;
|
|
46
|
+
if (!disabled) {
|
|
47
|
+
document.body.style.cursor = 'pointer';
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMouseLeave", function () {
|
|
51
|
+
document.body.style.cursor = 'default';
|
|
52
|
+
});
|
|
53
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getEvaluateOutlineColor", function (isCorrect, markAsCorrect, outlineColor) {
|
|
54
|
+
return markAsCorrect ? 'green' : isCorrect ? outlineColor : 'red';
|
|
55
|
+
});
|
|
56
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getOutlineWidth", function (showCorrectEnabled, selected, markAsCorrect, strokeWidth) {
|
|
57
|
+
return markAsCorrect || !markAsCorrect && !showCorrectEnabled && selected ? strokeWidth : 0;
|
|
58
|
+
});
|
|
59
|
+
return _this;
|
|
60
|
+
}
|
|
61
|
+
(0, _createClass2["default"])(RectComponent, [{
|
|
62
|
+
key: "render",
|
|
63
|
+
value: function render() {
|
|
64
|
+
var _this$props2 = this.props,
|
|
65
|
+
classes = _this$props2.classes,
|
|
66
|
+
height = _this$props2.height,
|
|
67
|
+
hotspotColor = _this$props2.hotspotColor,
|
|
68
|
+
isCorrect = _this$props2.isCorrect,
|
|
69
|
+
isEvaluateMode = _this$props2.isEvaluateMode,
|
|
70
|
+
outlineColor = _this$props2.outlineColor,
|
|
71
|
+
selected = _this$props2.selected,
|
|
72
|
+
width = _this$props2.width,
|
|
73
|
+
x = _this$props2.x,
|
|
74
|
+
y = _this$props2.y,
|
|
75
|
+
evaluateText = _this$props2.evaluateText,
|
|
76
|
+
strokeWidth = _this$props2.strokeWidth,
|
|
77
|
+
scale = _this$props2.scale,
|
|
78
|
+
markAsCorrect = _this$props2.markAsCorrect,
|
|
79
|
+
showCorrectEnabled = _this$props2.showCorrectEnabled;
|
|
80
|
+
var outlineColorParsed = isEvaluateMode ? this.getEvaluateOutlineColor(isCorrect, markAsCorrect, outlineColor) : outlineColor;
|
|
81
|
+
var outlineWidth = this.getOutlineWidth(showCorrectEnabled, selected, markAsCorrect, strokeWidth);
|
|
82
|
+
var iconX = x + width / 2 - 10;
|
|
83
|
+
var iconY = y + height / 2 - 10;
|
|
84
|
+
|
|
85
|
+
// "Show Correct Answer" Enabled:
|
|
86
|
+
// - Correctly Selected: white checkmark in green circle
|
|
87
|
+
// - Correctly Not Selected: none
|
|
88
|
+
// - Incorrectly Selected: none
|
|
89
|
+
// - Incorrectly Not Selected: white checkmark in green circle
|
|
90
|
+
// "Show Correct Answer" Disabled:
|
|
91
|
+
// - Correctly Selected:
|
|
92
|
+
// - white checkmark in green circle
|
|
93
|
+
// - heavy outline, as on “Gather”
|
|
94
|
+
// - Correctly Not Selected: none
|
|
95
|
+
// - Incorrectly Selected:
|
|
96
|
+
// - white "X" in red circle
|
|
97
|
+
// - heavy outline around the selection should appear in red
|
|
98
|
+
// - Incorrectly Not Selected: white "X" in red circle
|
|
99
|
+
var iconSrc;
|
|
100
|
+
if (showCorrectEnabled) {
|
|
101
|
+
if (selected && isCorrect || !selected && !isCorrect) {
|
|
102
|
+
iconSrc = _icons.faCorrect;
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
if (selected) {
|
|
106
|
+
if (isCorrect) {
|
|
107
|
+
iconSrc = _icons.faCorrect;
|
|
108
|
+
} else {
|
|
109
|
+
iconSrc = _icons.faWrong;
|
|
110
|
+
}
|
|
111
|
+
} else if (!isCorrect) {
|
|
112
|
+
iconSrc = _icons.faWrong;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return /*#__PURE__*/_react["default"].createElement(_reactKonva.Group, {
|
|
116
|
+
scaleX: scale,
|
|
117
|
+
scaleY: scale
|
|
118
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactKonva.Rect, {
|
|
119
|
+
classes: classes.base,
|
|
120
|
+
width: width,
|
|
121
|
+
height: height,
|
|
122
|
+
fill: hotspotColor,
|
|
123
|
+
onClick: this.handleClick,
|
|
124
|
+
onTap: this.handleClick,
|
|
125
|
+
draggable: false,
|
|
126
|
+
stroke: outlineColorParsed,
|
|
127
|
+
strokeWidth: outlineWidth,
|
|
128
|
+
onMouseLeave: this.handleMouseLeave,
|
|
129
|
+
onMouseEnter: this.handleMouseEnter,
|
|
130
|
+
x: x,
|
|
131
|
+
y: y
|
|
132
|
+
}), isEvaluateMode && iconSrc ? /*#__PURE__*/_react["default"].createElement(_image["default"], {
|
|
133
|
+
src: iconSrc,
|
|
134
|
+
x: iconX,
|
|
135
|
+
y: iconY,
|
|
136
|
+
tooltip: evaluateText
|
|
137
|
+
}) : null);
|
|
138
|
+
}
|
|
139
|
+
}]);
|
|
140
|
+
return RectComponent;
|
|
141
|
+
}(_react["default"].Component);
|
|
142
|
+
var styles = function styles() {
|
|
143
|
+
return {
|
|
144
|
+
base: {
|
|
145
|
+
cursor: 'pointer',
|
|
146
|
+
opacity: 0.5,
|
|
147
|
+
position: 'relative'
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
RectComponent.propTypes = {
|
|
152
|
+
classes: _propTypes["default"].object.isRequired,
|
|
153
|
+
height: _propTypes["default"].number.isRequired,
|
|
154
|
+
hotspotColor: _propTypes["default"].string.isRequired,
|
|
155
|
+
id: _propTypes["default"].string.isRequired,
|
|
156
|
+
isCorrect: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string]),
|
|
157
|
+
isEvaluateMode: _propTypes["default"].bool.isRequired,
|
|
158
|
+
disabled: _propTypes["default"].bool.isRequired,
|
|
159
|
+
onClick: _propTypes["default"].func.isRequired,
|
|
160
|
+
outlineColor: _propTypes["default"].string.isRequired,
|
|
161
|
+
selected: _propTypes["default"].bool.isRequired,
|
|
162
|
+
width: _propTypes["default"].number.isRequired,
|
|
163
|
+
x: _propTypes["default"].number.isRequired,
|
|
164
|
+
y: _propTypes["default"].number.isRequired,
|
|
165
|
+
evaluateText: _propTypes["default"].string,
|
|
166
|
+
strokeWidth: _propTypes["default"].number,
|
|
167
|
+
scale: _propTypes["default"].number,
|
|
168
|
+
markAsCorrect: _propTypes["default"].bool.isRequired,
|
|
169
|
+
showCorrectEnabled: _propTypes["default"].bool.isRequired
|
|
170
|
+
};
|
|
171
|
+
RectComponent.defaultProps = {
|
|
172
|
+
isCorrect: false,
|
|
173
|
+
evaluateText: null,
|
|
174
|
+
strokeWidth: 5,
|
|
175
|
+
scale: 1
|
|
176
|
+
};
|
|
177
|
+
var _default = (0, _styles.withStyles)(styles)(RectComponent);
|
|
178
|
+
exports["default"] = _default;
|
|
179
|
+
//# sourceMappingURL=rectangle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rectangle.js","names":["_react","_interopRequireDefault","require","_propTypes","_reactKonva","_styles","_image","_icons","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","RectComponent","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","_defineProperty2","_assertThisInitialized2","_this$props","onClick","id","selected","disabled","cancelBubble","document","body","style","cursor","isCorrect","markAsCorrect","outlineColor","showCorrectEnabled","strokeWidth","_createClass2","key","value","render","_this$props2","classes","height","hotspotColor","isEvaluateMode","width","x","y","evaluateText","scale","outlineColorParsed","getEvaluateOutlineColor","outlineWidth","getOutlineWidth","iconX","iconY","iconSrc","faCorrect","faWrong","createElement","Group","scaleX","scaleY","Rect","base","fill","handleClick","onTap","draggable","stroke","onMouseLeave","handleMouseLeave","onMouseEnter","handleMouseEnter","src","tooltip","React","Component","styles","opacity","position","propTypes","PropTypes","object","isRequired","number","string","oneOfType","bool","func","defaultProps","_default","withStyles","exports"],"sources":["../../src/hotspot/rectangle.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Rect, Group } from 'react-konva';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport Image from './image';\nimport { faCorrect, faWrong } from './icons';\n\nclass RectComponent extends React.Component {\n constructor(props) {\n super(props);\n }\n\n handleClick = (e) => {\n const { onClick, id, selected, disabled } = this.props;\n\n if (!disabled) {\n e.cancelBubble = true;\n onClick({ id, selected: !selected });\n }\n };\n\n handleMouseEnter = () => {\n const { disabled } = this.props;\n\n if (!disabled) {\n document.body.style.cursor = 'pointer';\n }\n };\n\n handleMouseLeave = () => {\n document.body.style.cursor = 'default';\n };\n\n getEvaluateOutlineColor = (isCorrect, markAsCorrect, outlineColor) =>\n markAsCorrect ? 'green' : isCorrect ? outlineColor : 'red';\n\n getOutlineWidth = (showCorrectEnabled, selected, markAsCorrect, strokeWidth) =>\n markAsCorrect || (!markAsCorrect && !showCorrectEnabled && selected) ? strokeWidth : 0;\n\n render() {\n const {\n classes,\n height,\n hotspotColor,\n isCorrect,\n isEvaluateMode,\n outlineColor,\n selected,\n width,\n x,\n y,\n evaluateText,\n strokeWidth,\n scale,\n markAsCorrect,\n showCorrectEnabled,\n } = this.props;\n\n const outlineColorParsed = isEvaluateMode\n ? this.getEvaluateOutlineColor(isCorrect, markAsCorrect, outlineColor)\n : outlineColor;\n\n const outlineWidth = this.getOutlineWidth(showCorrectEnabled, selected, markAsCorrect, strokeWidth);\n\n const iconX = x + width / 2 - 10;\n const iconY = y + height / 2 - 10;\n\n // \"Show Correct Answer\" Enabled:\n // - Correctly Selected: white checkmark in green circle\n // - Correctly Not Selected: none\n // - Incorrectly Selected: none\n // - Incorrectly Not Selected: white checkmark in green circle\n // \"Show Correct Answer\" Disabled:\n // - Correctly Selected:\n // - white checkmark in green circle\n // - heavy outline, as on “Gather”\n // - Correctly Not Selected: none\n // - Incorrectly Selected:\n // - white \"X\" in red circle\n // - heavy outline around the selection should appear in red\n // - Incorrectly Not Selected: white \"X\" in red circle\n let iconSrc;\n\n if (showCorrectEnabled) {\n if ((selected && isCorrect) || (!selected && !isCorrect)) {\n iconSrc = faCorrect;\n }\n } else {\n if (selected) {\n if (isCorrect) {\n iconSrc = faCorrect;\n } else {\n iconSrc = faWrong;\n }\n } else if (!isCorrect) {\n iconSrc = faWrong;\n }\n }\n\n return (\n <Group scaleX={scale} scaleY={scale}>\n <Rect\n classes={classes.base}\n width={width}\n height={height}\n fill={hotspotColor}\n onClick={this.handleClick}\n onTap={this.handleClick}\n draggable={false}\n stroke={outlineColorParsed}\n strokeWidth={outlineWidth}\n onMouseLeave={this.handleMouseLeave}\n onMouseEnter={this.handleMouseEnter}\n x={x}\n y={y}\n />\n {isEvaluateMode && iconSrc ? <Image src={iconSrc} x={iconX} y={iconY} tooltip={evaluateText} /> : null}\n </Group>\n );\n }\n}\n\nconst styles = () => ({\n base: {\n cursor: 'pointer',\n opacity: 0.5,\n position: 'relative',\n },\n});\n\nRectComponent.propTypes = {\n classes: PropTypes.object.isRequired,\n height: PropTypes.number.isRequired,\n hotspotColor: PropTypes.string.isRequired,\n id: PropTypes.string.isRequired,\n isCorrect: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n isEvaluateMode: PropTypes.bool.isRequired,\n disabled: PropTypes.bool.isRequired,\n onClick: PropTypes.func.isRequired,\n outlineColor: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n width: PropTypes.number.isRequired,\n x: PropTypes.number.isRequired,\n y: PropTypes.number.isRequired,\n evaluateText: PropTypes.string,\n strokeWidth: PropTypes.number,\n scale: PropTypes.number,\n markAsCorrect: PropTypes.bool.isRequired,\n showCorrectEnabled: PropTypes.bool.isRequired,\n};\n\nRectComponent.defaultProps = {\n isCorrect: false,\n evaluateText: null,\n strokeWidth: 5,\n scale: 1,\n};\n\nexport default withStyles(styles)(RectComponent);\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA6C,SAAAM,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;AAAA,IAEvCC,aAAa,0BAAAC,gBAAA;EAAA,IAAAC,UAAA,aAAAF,aAAA,EAAAC,gBAAA;EAAA,IAAAE,MAAA,GAAAzB,YAAA,CAAAsB,aAAA;EACjB,SAAAA,cAAYI,KAAK,EAAE;IAAA,IAAAC,KAAA;I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