@pie-lib/graphing 2.34.2-next.0 → 2.36.0-mui-update.0
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 +16 -6
- package/lib/axis/arrow.js +19 -55
- package/lib/axis/arrow.js.map +1 -1
- package/lib/axis/axes.js +104 -186
- package/lib/axis/axes.js.map +1 -1
- package/lib/axis/index.js +1 -6
- package/lib/axis/index.js.map +1 -1
- package/lib/bg.js +21 -49
- package/lib/bg.js.map +1 -1
- package/lib/container/actions.js +2 -8
- package/lib/container/actions.js.map +1 -1
- package/lib/container/index.js +14 -59
- package/lib/container/index.js.map +1 -1
- package/lib/container/marks.js +1 -6
- package/lib/container/marks.js.map +1 -1
- package/lib/container/middleware.js +2 -8
- package/lib/container/middleware.js.map +1 -1
- package/lib/container/reducer.js +1 -8
- package/lib/container/reducer.js.map +1 -1
- package/lib/coordinates-label.js +23 -55
- package/lib/coordinates-label.js.map +1 -1
- package/lib/graph-with-controls.js +120 -184
- package/lib/graph-with-controls.js.map +1 -1
- package/lib/graph.js +59 -116
- package/lib/graph.js.map +1 -1
- package/lib/grid-setup.js +174 -224
- package/lib/grid-setup.js.map +1 -1
- package/lib/grid.js +28 -73
- package/lib/grid.js.map +1 -1
- package/lib/index.js +1 -13
- package/lib/index.js.map +1 -1
- package/lib/key-legend.js +41 -85
- package/lib/key-legend.js.map +1 -1
- package/lib/label-svg-icon.js +1 -7
- package/lib/label-svg-icon.js.map +1 -1
- package/lib/labels.js +61 -119
- package/lib/labels.js.map +1 -1
- package/lib/mark-label.js +113 -163
- package/lib/mark-label.js.map +1 -1
- package/lib/toggle-bar.js +158 -242
- package/lib/toggle-bar.js.map +1 -1
- package/lib/tool-menu.js +16 -48
- package/lib/tool-menu.js.map +1 -1
- package/lib/tools/absolute/component.js +4 -10
- package/lib/tools/absolute/component.js.map +1 -1
- package/lib/tools/absolute/index.js +3 -16
- package/lib/tools/absolute/index.js.map +1 -1
- package/lib/tools/circle/bg-circle.js +42 -92
- package/lib/tools/circle/bg-circle.js.map +1 -1
- package/lib/tools/circle/component.js +79 -165
- package/lib/tools/circle/component.js.map +1 -1
- package/lib/tools/circle/index.js +3 -13
- package/lib/tools/circle/index.js.map +1 -1
- package/lib/tools/exponential/component.js +4 -10
- package/lib/tools/exponential/component.js.map +1 -1
- package/lib/tools/exponential/index.js +3 -18
- package/lib/tools/exponential/index.js.map +1 -1
- package/lib/tools/index.js +3 -16
- package/lib/tools/index.js.map +1 -1
- package/lib/tools/line/component.js +27 -48
- package/lib/tools/line/component.js.map +1 -1
- package/lib/tools/line/index.js +1 -6
- package/lib/tools/line/index.js.map +1 -1
- package/lib/tools/parabola/component.js +4 -10
- package/lib/tools/parabola/component.js.map +1 -1
- package/lib/tools/parabola/index.js +3 -16
- package/lib/tools/parabola/index.js.map +1 -1
- package/lib/tools/point/component.js +24 -71
- package/lib/tools/point/component.js.map +1 -1
- package/lib/tools/point/index.js +3 -11
- package/lib/tools/point/index.js.map +1 -1
- package/lib/tools/polygon/component.js +82 -183
- package/lib/tools/polygon/component.js.map +1 -1
- package/lib/tools/polygon/index.js +6 -23
- package/lib/tools/polygon/index.js.map +1 -1
- package/lib/tools/polygon/line.js +48 -91
- package/lib/tools/polygon/line.js.map +1 -1
- package/lib/tools/polygon/polygon.js +65 -98
- package/lib/tools/polygon/polygon.js.map +1 -1
- package/lib/tools/ray/component.js +41 -60
- package/lib/tools/ray/component.js.map +1 -1
- package/lib/tools/ray/index.js +1 -6
- package/lib/tools/ray/index.js.map +1 -1
- package/lib/tools/segment/component.js +25 -43
- package/lib/tools/segment/component.js.map +1 -1
- package/lib/tools/segment/index.js +1 -6
- package/lib/tools/segment/index.js.map +1 -1
- package/lib/tools/shared/arrow-head.js +69 -28
- package/lib/tools/shared/arrow-head.js.map +1 -1
- package/lib/tools/shared/icons/CorrectSVG.js +3 -8
- package/lib/tools/shared/icons/CorrectSVG.js.map +1 -1
- package/lib/tools/shared/icons/IncorrectSVG.js +3 -8
- package/lib/tools/shared/icons/IncorrectSVG.js.map +1 -1
- package/lib/tools/shared/icons/MissingSVG.js +3 -8
- package/lib/tools/shared/icons/MissingSVG.js.map +1 -1
- package/lib/tools/shared/line/index.js +126 -187
- package/lib/tools/shared/line/index.js.map +1 -1
- package/lib/tools/shared/line/line-path.js +70 -100
- package/lib/tools/shared/line/line-path.js.map +1 -1
- package/lib/tools/shared/line/with-root-edge.js +21 -55
- package/lib/tools/shared/line/with-root-edge.js.map +1 -1
- package/lib/tools/shared/point/arrow-point.js +23 -62
- package/lib/tools/shared/point/arrow-point.js.map +1 -1
- package/lib/tools/shared/point/arrow.js +24 -52
- package/lib/tools/shared/point/arrow.js.map +1 -1
- package/lib/tools/shared/point/base-point.js +54 -72
- package/lib/tools/shared/point/base-point.js.map +1 -1
- package/lib/tools/shared/point/index.js +22 -57
- package/lib/tools/shared/point/index.js.map +1 -1
- package/lib/tools/shared/styles.js +10 -38
- package/lib/tools/shared/styles.js.map +1 -1
- package/lib/tools/shared/types.js +2 -9
- package/lib/tools/shared/types.js.map +1 -1
- package/lib/tools/sine/component.js +8 -19
- package/lib/tools/sine/component.js.map +1 -1
- package/lib/tools/sine/index.js +3 -16
- package/lib/tools/sine/index.js.map +1 -1
- package/lib/tools/vector/component.js +24 -44
- package/lib/tools/vector/component.js.map +1 -1
- package/lib/tools/vector/index.js +1 -6
- package/lib/tools/vector/index.js.map +1 -1
- package/lib/undo-redo.js +29 -69
- package/lib/undo-redo.js.map +1 -1
- package/lib/use-debounce.js +4 -11
- package/lib/use-debounce.js.map +1 -1
- package/lib/utils.js +51 -128
- package/lib/utils.js.map +1 -1
- package/package.json +16 -13
- package/src/axis/arrow.jsx +7 -12
- package/src/axis/axes.jsx +40 -45
- package/src/coordinates-label.jsx +13 -18
- package/src/graph-with-controls.jsx +52 -59
- package/src/grid-setup.jsx +210 -206
- package/src/grid.jsx +1 -3
- package/src/key-legend.jsx +52 -56
- package/src/labels.jsx +21 -30
- package/src/mark-label.jsx +83 -81
- package/src/toggle-bar.jsx +155 -166
- package/src/tools/circle/bg-circle.jsx +20 -28
- package/src/tools/circle/component.jsx +28 -63
- package/src/tools/line/component.jsx +22 -15
- package/src/tools/polygon/component.jsx +1 -2
- package/src/tools/polygon/line.jsx +28 -32
- package/src/tools/polygon/polygon.jsx +52 -45
- package/src/tools/ray/component.jsx +38 -25
- package/src/tools/segment/component.jsx +19 -18
- package/src/tools/shared/arrow-head.jsx +60 -7
- package/src/tools/shared/line/index.jsx +39 -2
- package/src/tools/shared/line/line-path.jsx +54 -58
- package/src/tools/shared/point/arrow-point.jsx +10 -24
- package/src/tools/shared/point/arrow.jsx +5 -11
- package/src/tools/shared/point/base-point.jsx +42 -19
- package/src/tools/shared/point/index.jsx +27 -44
- package/src/tools/vector/component.jsx +11 -16
- package/src/undo-redo.jsx +19 -21
package/lib/mark-label.js
CHANGED
|
@@ -1,111 +1,103 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.position = exports["default"] = exports.coordinates = exports.MarkLabel = void 0;
|
|
11
|
-
|
|
12
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
-
|
|
14
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
18
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
|
-
|
|
20
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
|
-
|
|
22
|
-
var _styles = require("@material-ui/core/styles");
|
|
23
|
-
|
|
13
|
+
var _styles = require("@mui/material/styles");
|
|
24
14
|
var _reactInputAutosize = _interopRequireDefault(require("react-input-autosize"));
|
|
25
|
-
|
|
26
15
|
var _useDebounce = require("./use-debounce");
|
|
27
|
-
|
|
28
16
|
var _plot = require("@pie-lib/plot");
|
|
29
|
-
|
|
30
17
|
var _renderUi = require("@pie-lib/render-ui");
|
|
31
|
-
|
|
32
18
|
var _labelSvgIcon = _interopRequireDefault(require("./label-svg-icon"));
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
39
|
-
|
|
40
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
41
|
-
|
|
42
|
-
var inputStyles = function inputStyles(theme) {
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
|
+
var StyledInputCorrect = (0, _styles.styled)('div')(function (_ref2) {
|
|
23
|
+
var theme = _ref2.theme;
|
|
43
24
|
return {
|
|
44
25
|
"float": 'right',
|
|
45
|
-
padding: theme.spacing
|
|
26
|
+
padding: theme.spacing(0.5),
|
|
46
27
|
borderRadius: '4px',
|
|
47
28
|
fontSize: '10px',
|
|
48
|
-
backgroundColor: _renderUi.color.defaults.WHITE
|
|
29
|
+
backgroundColor: _renderUi.color.defaults.WHITE,
|
|
30
|
+
color: _renderUi.color.defaults.CORRECT_WITH_ICON,
|
|
31
|
+
border: "solid 1px ".concat(_renderUi.color.defaults.CORRECT_WITH_ICON)
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
var StyledInputIncorrect = (0, _styles.styled)('div')(function (_ref3) {
|
|
35
|
+
var theme = _ref3.theme;
|
|
36
|
+
return {
|
|
37
|
+
"float": 'right',
|
|
38
|
+
padding: theme.spacing(0.5),
|
|
39
|
+
borderRadius: '4px',
|
|
40
|
+
fontSize: '10px',
|
|
41
|
+
backgroundColor: _renderUi.color.defaults.WHITE,
|
|
42
|
+
color: _renderUi.color.defaults.INCORRECT_WITH_ICON,
|
|
43
|
+
border: "solid 1px ".concat(_renderUi.color.defaults.INCORRECT_WITH_ICON)
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
var StyledInputMissing = (0, _styles.styled)('div')(function (_ref4) {
|
|
47
|
+
var theme = _ref4.theme;
|
|
48
|
+
return {
|
|
49
|
+
"float": 'right',
|
|
50
|
+
padding: theme.spacing(0.5),
|
|
51
|
+
borderRadius: '4px',
|
|
52
|
+
fontSize: '10px',
|
|
53
|
+
backgroundColor: _renderUi.color.defaults.WHITE,
|
|
54
|
+
color: _renderUi.color.defaults.MISSING_WITH_ICON,
|
|
55
|
+
border: "solid 1px ".concat(_renderUi.color.defaults.MISSING_WITH_ICON),
|
|
56
|
+
fontWeight: 'bold'
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
var StyledIncorrect = (0, _styles.styled)('div')(function (_ref5) {
|
|
60
|
+
var theme = _ref5.theme;
|
|
61
|
+
return {
|
|
62
|
+
"float": 'right',
|
|
63
|
+
padding: 0,
|
|
64
|
+
borderRadius: '4px',
|
|
65
|
+
fontSize: '10px',
|
|
66
|
+
backgroundColor: _renderUi.color.defaults.WHITE,
|
|
67
|
+
color: _renderUi.color.defaults.INCORRECT_WITH_ICON,
|
|
68
|
+
fontWeight: 'bold'
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
var getInputStyles = function getInputStyles(theme, disabled, markDisabled) {
|
|
72
|
+
return {
|
|
73
|
+
"float": 'right',
|
|
74
|
+
padding: theme.spacing(0.5),
|
|
75
|
+
fontFamily: theme.typography.fontFamily,
|
|
76
|
+
fontSize: '10px',
|
|
77
|
+
border: disabled ? "solid 1px ".concat(_renderUi.color.defaults.PRIMARY_DARK) : markDisabled ? "solid 1px ".concat(_renderUi.color.disabled()) : "solid 1px ".concat(_renderUi.color.defaults.SECONDARY),
|
|
78
|
+
borderRadius: '3px',
|
|
79
|
+
color: markDisabled ? _renderUi.color.disabled() : _renderUi.color.defaults.PRIMARY_DARK,
|
|
80
|
+
backgroundColor: _renderUi.color.defaults.WHITE,
|
|
81
|
+
WebkitOpacity: disabled ? '1' : undefined,
|
|
82
|
+
WebkitTextFillColor: markDisabled ? _renderUi.color.disabled() : undefined
|
|
49
83
|
};
|
|
50
84
|
};
|
|
51
|
-
|
|
52
|
-
var styles = function styles(theme) {
|
|
85
|
+
var getStudentInputStyles = function getStudentInputStyles() {
|
|
53
86
|
return {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
fontWeight: 'bold'
|
|
59
|
-
}),
|
|
60
|
-
input: {
|
|
61
|
-
"float": 'right',
|
|
62
|
-
padding: theme.spacing.unit * 0.5,
|
|
63
|
-
fontFamily: theme.typography.fontFamily,
|
|
64
|
-
fontSize: '10px',
|
|
65
|
-
border: "solid 1px ".concat(_renderUi.color.defaults.SECONDARY),
|
|
66
|
-
borderRadius: '3px',
|
|
67
|
-
color: _renderUi.color.defaults.PRIMARY_DARK,
|
|
68
|
-
backgroundColor: _renderUi.color.defaults.WHITE
|
|
69
|
-
},
|
|
70
|
-
disabled: {
|
|
71
|
-
border: "solid 1px ".concat(_renderUi.color.defaults.PRIMARY_DARK),
|
|
72
|
-
backgroundColor: _renderUi.color.defaults.WHITE,
|
|
73
|
-
'-webkit-opacity': '1'
|
|
74
|
-
},
|
|
75
|
-
disabledMark: {
|
|
76
|
-
border: "solid 1px ".concat(_renderUi.color.disabled()),
|
|
77
|
-
color: _renderUi.color.disabled(),
|
|
78
|
-
'-webkit-text-fill-color': _renderUi.color.disabled()
|
|
79
|
-
},
|
|
80
|
-
inputCorrect: _objectSpread(_objectSpread({}, inputStyles(theme)), {}, {
|
|
81
|
-
color: _renderUi.color.defaults.CORRECT_WITH_ICON,
|
|
82
|
-
border: "solid 1px ".concat(_renderUi.color.defaults.CORRECT_WITH_ICON)
|
|
83
|
-
}),
|
|
84
|
-
inputIncorrect: _objectSpread(_objectSpread({}, inputStyles(theme)), {}, {
|
|
85
|
-
color: _renderUi.color.defaults.INCORRECT_WITH_ICON,
|
|
86
|
-
border: "solid 1px ".concat(_renderUi.color.defaults.INCORRECT_WITH_ICON)
|
|
87
|
-
}),
|
|
88
|
-
inputMissing: _objectSpread(_objectSpread({}, inputStyles(theme)), {}, {
|
|
89
|
-
color: _renderUi.color.defaults.MISSING_WITH_ICON,
|
|
90
|
-
border: "solid 1px ".concat(_renderUi.color.defaults.MISSING_WITH_ICON),
|
|
91
|
-
fontWeight: 'bold'
|
|
92
|
-
}),
|
|
93
|
-
incorrect: _objectSpread(_objectSpread({}, inputStyles(theme)), {}, {
|
|
94
|
-
color: _renderUi.color.defaults.INCORRECT_WITH_ICON,
|
|
95
|
-
fontWeight: 'bold',
|
|
96
|
-
padding: '0'
|
|
97
|
-
})
|
|
87
|
+
padding: '0',
|
|
88
|
+
border: 'none',
|
|
89
|
+
color: 'inherit',
|
|
90
|
+
fontWeight: 'bold'
|
|
98
91
|
};
|
|
99
92
|
};
|
|
100
|
-
|
|
101
|
-
var position = function position(graphProps, mark) {
|
|
93
|
+
var position = exports.position = function position(graphProps, mark) {
|
|
102
94
|
var rect = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
103
95
|
width: 0,
|
|
104
96
|
height: 0
|
|
105
97
|
};
|
|
106
98
|
var scale = graphProps.scale,
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
domain = graphProps.domain,
|
|
100
|
+
range = graphProps.range;
|
|
109
101
|
var shift = 5;
|
|
110
102
|
var rightEdge = scale.x(mark.x) + rect.width + shift;
|
|
111
103
|
var bottomEdge = scale.y(mark.y) + rect.height + shift;
|
|
@@ -113,10 +105,7 @@ var position = function position(graphProps, mark) {
|
|
|
113
105
|
var v = bottomEdge >= scale.y(range.min) ? 'top' : 'bottom';
|
|
114
106
|
return "".concat(v, "-").concat(h);
|
|
115
107
|
};
|
|
116
|
-
|
|
117
|
-
exports.position = position;
|
|
118
|
-
|
|
119
|
-
var coordinates = function coordinates(graphProps, mark) {
|
|
108
|
+
var coordinates = exports.coordinates = function coordinates(graphProps, mark) {
|
|
120
109
|
var rect = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
121
110
|
width: 0,
|
|
122
111
|
height: 0
|
|
@@ -124,97 +113,80 @@ var coordinates = function coordinates(graphProps, mark) {
|
|
|
124
113
|
var position = arguments.length > 3 ? arguments[3] : undefined;
|
|
125
114
|
var scale = graphProps.scale;
|
|
126
115
|
var shift = 5;
|
|
127
|
-
|
|
128
116
|
switch (position) {
|
|
129
117
|
case 'bottom-right':
|
|
130
118
|
return {
|
|
131
119
|
left: scale.x(mark.x) + shift,
|
|
132
120
|
top: scale.y(mark.y) + shift
|
|
133
121
|
};
|
|
134
|
-
|
|
135
122
|
case 'bottom-left':
|
|
136
123
|
return {
|
|
137
124
|
left: scale.x(mark.x) - shift - rect.width,
|
|
138
125
|
top: scale.y(mark.y) + shift
|
|
139
126
|
};
|
|
140
|
-
|
|
141
127
|
case 'top-left':
|
|
142
128
|
return {
|
|
143
129
|
left: scale.x(mark.x) - shift - rect.width,
|
|
144
130
|
top: scale.y(mark.y) - shift - rect.height
|
|
145
131
|
};
|
|
146
|
-
|
|
147
132
|
case 'top-right':
|
|
148
133
|
return {
|
|
149
134
|
left: scale.x(mark.x) + shift,
|
|
150
135
|
top: scale.y(mark.y) - shift - rect.height
|
|
151
136
|
};
|
|
152
|
-
|
|
153
137
|
default:
|
|
154
138
|
return {};
|
|
155
139
|
}
|
|
156
140
|
};
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
disabled = _ref2.disabled,
|
|
165
|
-
inputClassName = _ref2.inputClassName,
|
|
166
|
-
onChange = _ref2.onChange;
|
|
141
|
+
var LabelInput = function LabelInput(_ref6) {
|
|
142
|
+
var _ref = _ref6._ref,
|
|
143
|
+
externalInputRef = _ref6.externalInputRef,
|
|
144
|
+
label = _ref6.label,
|
|
145
|
+
disabled = _ref6.disabled,
|
|
146
|
+
inputStyle = _ref6.inputStyle,
|
|
147
|
+
onChange = _ref6.onChange;
|
|
167
148
|
return /*#__PURE__*/_react["default"].createElement(_reactInputAutosize["default"], {
|
|
168
149
|
inputRef: function inputRef(r) {
|
|
169
150
|
_ref(r);
|
|
170
|
-
|
|
171
151
|
externalInputRef(r);
|
|
172
152
|
},
|
|
173
153
|
disabled: disabled,
|
|
174
|
-
|
|
154
|
+
inputStyle: inputStyle,
|
|
175
155
|
value: label,
|
|
176
156
|
onChange: onChange
|
|
177
157
|
});
|
|
178
158
|
};
|
|
179
|
-
|
|
180
|
-
var MarkLabel = function MarkLabel(props) {
|
|
181
|
-
var _cn;
|
|
182
|
-
|
|
159
|
+
var MarkLabel = exports.MarkLabel = function MarkLabel(props) {
|
|
183
160
|
var _useState = (0, _react.useState)(null),
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
161
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
162
|
+
input = _useState2[0],
|
|
163
|
+
setInput = _useState2[1];
|
|
188
164
|
var _ref = (0, _react.useCallback)(function (node) {
|
|
189
165
|
return setInput(node);
|
|
190
166
|
});
|
|
191
|
-
|
|
167
|
+
var theme = (0, _styles.useTheme)();
|
|
192
168
|
var mark = props.mark,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
externalInputRef = props.inputRef,
|
|
197
|
-
theme = props.theme;
|
|
198
|
-
|
|
169
|
+
graphProps = props.graphProps,
|
|
170
|
+
disabled = props.disabled,
|
|
171
|
+
externalInputRef = props.inputRef;
|
|
199
172
|
var _useState3 = (0, _react.useState)(mark.label),
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
173
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
174
|
+
label = _useState4[0],
|
|
175
|
+
setLabel = _useState4[1];
|
|
204
176
|
var correctness = mark.correctness,
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
177
|
+
correctnesslabel = mark.correctnesslabel,
|
|
178
|
+
correctlabel = mark.correctlabel;
|
|
208
179
|
var onChange = function onChange(e) {
|
|
209
180
|
return setLabel(e.target.value);
|
|
210
181
|
};
|
|
182
|
+
var debouncedLabel = (0, _useDebounce.useDebounce)(label, 200);
|
|
211
183
|
|
|
212
|
-
|
|
213
|
-
|
|
184
|
+
// useState only sets the value once, to synch props to state need useEffect
|
|
214
185
|
(0, _react.useEffect)(function () {
|
|
215
186
|
setLabel(mark.label);
|
|
216
|
-
}, [mark.label]);
|
|
187
|
+
}, [mark.label]);
|
|
217
188
|
|
|
189
|
+
// pick up the change to debouncedLabel and save it
|
|
218
190
|
(0, _react.useEffect)(function () {
|
|
219
191
|
if (typeof debouncedLabel === 'string' && debouncedLabel !== mark.label) {
|
|
220
192
|
props.onChange(debouncedLabel);
|
|
@@ -226,7 +198,6 @@ var MarkLabel = function MarkLabel(props) {
|
|
|
226
198
|
};
|
|
227
199
|
var pos = position(graphProps, mark, rect);
|
|
228
200
|
var leftTop = coordinates(graphProps, mark, rect, pos);
|
|
229
|
-
|
|
230
201
|
var style = _objectSpread({
|
|
231
202
|
position: 'fixed',
|
|
232
203
|
pointerEvents: 'auto',
|
|
@@ -234,41 +205,35 @@ var MarkLabel = function MarkLabel(props) {
|
|
|
234
205
|
alignItems: 'center',
|
|
235
206
|
gap: '3px'
|
|
236
207
|
}, leftTop);
|
|
237
|
-
|
|
238
208
|
var secondLabelStyle = _objectSpread(_objectSpread({}, style), {}, {
|
|
239
209
|
top: leftTop.top + 25
|
|
240
210
|
});
|
|
241
|
-
|
|
242
211
|
var disabledInput = disabled || mark.disabled;
|
|
243
|
-
|
|
244
|
-
var renderInput = function renderInput(inputClass, labelValue) {
|
|
212
|
+
var renderInput = function renderInput(inputStyle, labelValue) {
|
|
245
213
|
return /*#__PURE__*/_react["default"].createElement(LabelInput, {
|
|
246
214
|
_ref: _ref,
|
|
247
215
|
externalInputRef: externalInputRef,
|
|
248
216
|
label: labelValue,
|
|
249
217
|
disabled: disabledInput,
|
|
250
|
-
|
|
218
|
+
inputStyle: inputStyle,
|
|
251
219
|
onChange: onChange
|
|
252
220
|
});
|
|
253
221
|
};
|
|
254
|
-
|
|
222
|
+
var studentInputStyle = getStudentInputStyles();
|
|
255
223
|
if (correctness === 'correct' && correctnesslabel === 'correct' && correctlabel) {
|
|
256
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
257
|
-
className: classes.inputCorrect,
|
|
224
|
+
return /*#__PURE__*/_react["default"].createElement(StyledInputCorrect, {
|
|
258
225
|
style: style
|
|
259
226
|
}, /*#__PURE__*/_react["default"].createElement(_labelSvgIcon["default"], {
|
|
260
227
|
type: "correct"
|
|
261
|
-
}), renderInput(
|
|
262
|
-
}
|
|
263
|
-
|
|
228
|
+
}), renderInput(studentInputStyle, correctlabel));
|
|
229
|
+
}
|
|
264
230
|
|
|
231
|
+
// avoid rendering empty label when a correct point without label was provided
|
|
265
232
|
if (correctness === 'correct' && correctnesslabel === 'correct' && !correctlabel) {
|
|
266
233
|
return null;
|
|
267
234
|
}
|
|
268
|
-
|
|
269
235
|
if (correctness === 'correct' && correctnesslabel === 'incorrect') {
|
|
270
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(
|
|
271
|
-
className: classes.inputIncorrect,
|
|
236
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(StyledInputIncorrect, {
|
|
272
237
|
style: style
|
|
273
238
|
}, /*#__PURE__*/_react["default"].createElement(_labelSvgIcon["default"], {
|
|
274
239
|
type: "incorrect"
|
|
@@ -277,45 +242,30 @@ var MarkLabel = function MarkLabel(props) {
|
|
|
277
242
|
style: {
|
|
278
243
|
marginLeft: '3px'
|
|
279
244
|
}
|
|
280
|
-
}) : renderInput(
|
|
281
|
-
className: classes.inputMissing,
|
|
245
|
+
}) : renderInput(studentInputStyle, label)), /*#__PURE__*/_react["default"].createElement(StyledInputMissing, {
|
|
282
246
|
style: secondLabelStyle
|
|
283
|
-
}, renderInput(
|
|
247
|
+
}, renderInput(studentInputStyle, correctlabel)));
|
|
284
248
|
}
|
|
285
|
-
|
|
286
249
|
if (correctness === 'missing') {
|
|
287
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
288
|
-
className: classes.inputMissing,
|
|
250
|
+
return /*#__PURE__*/_react["default"].createElement(StyledInputMissing, {
|
|
289
251
|
style: style
|
|
290
|
-
}, renderInput(
|
|
252
|
+
}, renderInput(studentInputStyle, label));
|
|
291
253
|
}
|
|
292
|
-
|
|
293
254
|
if (correctness === 'incorrect') {
|
|
294
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
295
|
-
className: classes.incorrect,
|
|
255
|
+
return /*#__PURE__*/_react["default"].createElement(StyledIncorrect, {
|
|
296
256
|
style: style
|
|
297
|
-
}, renderInput(
|
|
257
|
+
}, renderInput(studentInputStyle, label));
|
|
298
258
|
}
|
|
299
|
-
|
|
300
259
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
301
260
|
style: style
|
|
302
|
-
}, renderInput((
|
|
261
|
+
}, renderInput(getInputStyles(theme, disabled, mark.disabled), label));
|
|
303
262
|
};
|
|
304
|
-
|
|
305
|
-
exports.MarkLabel = MarkLabel;
|
|
306
263
|
MarkLabel.propTypes = {
|
|
307
264
|
disabled: _propTypes["default"].bool,
|
|
308
265
|
onChange: _propTypes["default"].func,
|
|
309
266
|
graphProps: _plot.types.GraphPropsType,
|
|
310
|
-
classes: _propTypes["default"].object,
|
|
311
267
|
inputRef: _propTypes["default"].func,
|
|
312
|
-
mark: _propTypes["default"].object
|
|
313
|
-
theme: _propTypes["default"].object
|
|
268
|
+
mark: _propTypes["default"].object
|
|
314
269
|
};
|
|
315
|
-
|
|
316
|
-
var _default = (0, _styles.withStyles)(styles, {
|
|
317
|
-
withTheme: true
|
|
318
|
-
})(MarkLabel);
|
|
319
|
-
|
|
320
|
-
exports["default"] = _default;
|
|
270
|
+
var _default = exports["default"] = MarkLabel;
|
|
321
271
|
//# sourceMappingURL=mark-label.js.map
|
package/lib/mark-label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mark-label.jsx"],"names":["inputStyles","theme","padding","spacing","unit","borderRadius","fontSize","backgroundColor","color","defaults","WHITE","styles","inputStudent","border","fontWeight","input","fontFamily","typography","SECONDARY","PRIMARY_DARK","disabled","disabledMark","inputCorrect","CORRECT_WITH_ICON","inputIncorrect","INCORRECT_WITH_ICON","inputMissing","MISSING_WITH_ICON","incorrect","position","graphProps","mark","rect","width","height","scale","domain","range","shift","rightEdge","x","bottomEdge","y","h","max","v","min","coordinates","left","top","LabelInput","_ref","externalInputRef","label","inputClassName","onChange","r","MarkLabel","props","setInput","node","classes","inputRef","setLabel","correctness","correctnesslabel","correctlabel","e","target","value","debouncedLabel","getBoundingClientRect","pos","leftTop","style","pointerEvents","display","alignItems","gap","secondLabelStyle","disabledInput","renderInput","inputClass","labelValue","marginLeft","propTypes","PropTypes","bool","func","types","GraphPropsType","object","withTheme"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,WAAW,GAAG,SAAdA,WAAc,CAACC,KAAD;AAAA,SAAY;AAC9B,aAAO,OADuB;AAE9BC,IAAAA,OAAO,EAAED,KAAK,CAACE,OAAN,CAAcC,IAAd,GAAqB,GAFA;AAG9BC,IAAAA,YAAY,EAAE,KAHgB;AAI9BC,IAAAA,QAAQ,EAAE,MAJoB;AAK9BC,IAAAA,eAAe,EAAEC,gBAAMC,QAAN,CAAeC;AALF,GAAZ;AAAA,CAApB;;AAQA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACV,KAAD;AAAA,SAAY;AACzBW,IAAAA,YAAY,kCACPZ,WAAW,CAACC,KA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AUE,IAFA;AAGpB1D,EAAAA,UAAU,EAAE2D,YAAMC,cAHE;AAIpB7B,EAAAA,OAAO,EAAEyB,sBAAUK,MAJC;AAKpB7B,EAAAA,QAAQ,EAAEwB,sBAAUE,IALA;AAMpBzD,EAAAA,IAAI,EAAEuD,sBAAUK,MANI;AAOpB1F,EAAAA,KAAK,EAAEqF,sBAAUK;AAPG,CAAtB;;eAUe,wBAAWhF,MAAX,EAAmB;AAAEiF,EAAAA,SAAS,EAAE;AAAb,CAAnB,EAAwCnC,SAAxC,C","sourcesContent":["import React, { useState, useCallback, useEffect } from 'react';\nimport cn from 'classnames';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport AutosizeInput from 'react-input-autosize';\nimport { useDebounce } from './use-debounce';\nimport { types } from '@pie-lib/plot';\nimport { color } from '@pie-lib/render-ui';\nimport SvgIcon from './label-svg-icon';\n\nconst inputStyles = (theme) => ({\n float: 'right',\n padding: theme.spacing.unit * 0.5,\n borderRadius: '4px',\n fontSize: '10px',\n backgroundColor: color.defaults.WHITE,\n});\n\nconst styles = (theme) => ({\n inputStudent: {\n ...inputStyles(theme),\n padding: '0',\n border: 'none',\n color: 'inherit',\n fontWeight: 'bold',\n },\n input: {\n float: 'right',\n padding: theme.spacing.unit * 0.5,\n fontFamily: theme.typography.fontFamily,\n fontSize: '10px',\n border: `solid 1px ${color.defaults.SECONDARY}`,\n borderRadius: '3px',\n color: color.defaults.PRIMARY_DARK,\n backgroundColor: color.defaults.WHITE,\n },\n disabled: {\n border: `solid 1px ${color.defaults.PRIMARY_DARK}`,\n backgroundColor: color.defaults.WHITE,\n '-webkit-opacity': '1',\n },\n disabledMark: {\n border: `solid 1px ${color.disabled()}`,\n color: color.disabled(),\n '-webkit-text-fill-color': color.disabled(),\n },\n inputCorrect: {\n ...inputStyles(theme),\n color: color.defaults.CORRECT_WITH_ICON,\n border: `solid 1px ${color.defaults.CORRECT_WITH_ICON}`,\n },\n inputIncorrect: {\n ...inputStyles(theme),\n color: color.defaults.INCORRECT_WITH_ICON,\n border: `solid 1px ${color.defaults.INCORRECT_WITH_ICON}`,\n },\n inputMissing: {\n ...inputStyles(theme),\n color: color.defaults.MISSING_WITH_ICON,\n border: `solid 1px ${color.defaults.MISSING_WITH_ICON}`,\n fontWeight: 'bold',\n },\n incorrect: {\n ...inputStyles(theme),\n color: color.defaults.INCORRECT_WITH_ICON,\n fontWeight: 'bold',\n padding: '0',\n },\n});\n\nexport const position = (graphProps, mark, rect = { width: 0, height: 0 }) => {\n const { scale, domain, range } = graphProps;\n const shift = 5;\n\n const rightEdge = scale.x(mark.x) + rect.width + shift;\n const bottomEdge = scale.y(mark.y) + rect.height + shift;\n\n const h = rightEdge >= scale.x(domain.max) ? 'left' : 'right';\n const v = bottomEdge >= scale.y(range.min) ? 'top' : 'bottom';\n\n return `${v}-${h}`;\n};\n\nexport const coordinates = (graphProps, mark, rect = { width: 0, height: 0 }, position) => {\n const { scale } = graphProps;\n const shift = 5;\n\n switch (position) {\n case 'bottom-right':\n return { left: scale.x(mark.x) + shift, top: scale.y(mark.y) + shift };\n case 'bottom-left':\n return { left: scale.x(mark.x) - shift - rect.width, top: scale.y(mark.y) + shift };\n case 'top-left':\n return { left: scale.x(mark.x) - shift - rect.width, top: scale.y(mark.y) - shift - rect.height };\n case 'top-right':\n return { left: scale.x(mark.x) + shift, top: scale.y(mark.y) - shift - rect.height };\n default:\n return {};\n }\n};\n\nconst LabelInput = ({ _ref, externalInputRef, label, disabled, inputClassName, onChange }) => (\n <AutosizeInput\n inputRef={(r) => {\n _ref(r);\n externalInputRef(r);\n }}\n disabled={disabled}\n inputClassName={inputClassName}\n value={label}\n onChange={onChange}\n />\n);\n\nexport const MarkLabel = (props) => {\n const [input, setInput] = useState(null);\n const _ref = useCallback((node) => setInput(node));\n\n const { mark, graphProps, classes, disabled, inputRef: externalInputRef, theme } = props;\n\n const [label, setLabel] = useState(mark.label);\n const { correctness, correctnesslabel, correctlabel } = mark;\n const onChange = (e) => setLabel(e.target.value);\n\n const debouncedLabel = useDebounce(label, 200);\n\n // useState only sets the value once, to synch props to state need useEffect\n useEffect(() => {\n setLabel(mark.label);\n }, [mark.label]);\n\n // pick up the change to debouncedLabel and save it\n useEffect(() => {\n if (typeof debouncedLabel === 'string' && debouncedLabel !== mark.label) {\n props.onChange(debouncedLabel);\n }\n }, [debouncedLabel]);\n\n const rect = input ? input.getBoundingClientRect() : { width: 0, height: 0 };\n const pos = position(graphProps, mark, rect);\n const leftTop = coordinates(graphProps, mark, rect, pos);\n\n const style = {\n position: 'fixed',\n pointerEvents: 'auto',\n display: 'flex',\n alignItems: 'center',\n gap: '3px',\n ...leftTop,\n };\n\n const secondLabelStyle = {\n ...style,\n top: leftTop.top + 25,\n };\n\n const disabledInput = disabled || mark.disabled;\n\n const renderInput = (inputClass, labelValue) => (\n <LabelInput\n _ref={_ref}\n externalInputRef={externalInputRef}\n label={labelValue}\n disabled={disabledInput}\n inputClassName={cn(inputClass)}\n onChange={onChange}\n />\n );\n\n if (correctness === 'correct' && correctnesslabel === 'correct' && correctlabel) {\n return (\n <div className={classes.inputCorrect} style={style}>\n <SvgIcon type=\"correct\" />\n {renderInput(classes.inputStudent, correctlabel)}\n </div>\n );\n }\n\n // avoid rendering empty label when a correct point without label was provided\n if (correctness === 'correct' && correctnesslabel === 'correct' && !correctlabel) {\n return null;\n }\n\n if (correctness === 'correct' && correctnesslabel === 'incorrect') {\n return (\n <>\n <div className={classes.inputIncorrect} style={style}>\n <SvgIcon type=\"incorrect\" />\n {label === '' ? (\n <SvgIcon type=\"empty\" style={{ marginLeft: '3px' }} />\n ) : (\n renderInput(classes.inputStudent, label)\n )}\n </div>\n <div className={classes.inputMissing} style={secondLabelStyle}>\n {renderInput(classes.inputStudent, correctlabel)}\n </div>\n </>\n );\n }\n\n if (correctness === 'missing') {\n return (\n <div className={classes.inputMissing} style={style}>\n {renderInput(classes.inputStudent, label)}\n </div>\n );\n }\n\n if (correctness === 'incorrect') {\n return (\n <div className={classes.incorrect} style={style}>\n {renderInput(classes.inputStudent, label)}\n </div>\n );\n }\n\n return (\n <div style={style}>\n {renderInput(\n cn(classes.input, {\n [classes.disabled]: disabled,\n [classes.disabledMark]: mark.disabled,\n }),\n label,\n )}\n </div>\n );\n};\n\nMarkLabel.propTypes = {\n disabled: PropTypes.bool,\n onChange: PropTypes.func,\n graphProps: types.GraphPropsType,\n classes: PropTypes.object,\n inputRef: PropTypes.func,\n mark: PropTypes.object,\n theme: PropTypes.object,\n};\n\nexport default withStyles(styles, { withTheme: true })(MarkLabel);\n"],"file":"mark-label.js"}
|
|
1
|
+
{"version":3,"file":"mark-label.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_styles","_reactInputAutosize","_useDebounce","_plot","_renderUi","_labelSvgIcon","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","StyledInputCorrect","styled","_ref2","theme","padding","spacing","borderRadius","fontSize","backgroundColor","color","defaults","WHITE","CORRECT_WITH_ICON","border","concat","StyledInputIncorrect","_ref3","INCORRECT_WITH_ICON","StyledInputMissing","_ref4","MISSING_WITH_ICON","fontWeight","StyledIncorrect","_ref5","getInputStyles","disabled","markDisabled","fontFamily","typography","PRIMARY_DARK","SECONDARY","WebkitOpacity","undefined","WebkitTextFillColor","getStudentInputStyles","position","exports","graphProps","mark","rect","width","height","scale","domain","range","shift","rightEdge","x","bottomEdge","y","h","max","v","min","coordinates","left","top","LabelInput","_ref6","_ref","externalInputRef","label","inputStyle","onChange","createElement","inputRef","value","MarkLabel","props","_useState","useState","_useState2","_slicedToArray2","input","setInput","useCallback","node","useTheme","_useState3","_useState4","setLabel","correctness","correctnesslabel","correctlabel","target","debouncedLabel","useDebounce","useEffect","getBoundingClientRect","pos","leftTop","style","pointerEvents","display","alignItems","gap","secondLabelStyle","disabledInput","renderInput","labelValue","studentInputStyle","type","Fragment","marginLeft","propTypes","PropTypes","bool","func","types","GraphPropsType","object","_default"],"sources":["../src/mark-label.jsx"],"sourcesContent":["import React, { useState, useCallback, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { styled, useTheme } from '@mui/material/styles';\nimport AutosizeInput from 'react-input-autosize';\nimport { useDebounce } from './use-debounce';\nimport { types } from '@pie-lib/plot';\nimport { color } from '@pie-lib/render-ui';\nimport SvgIcon from './label-svg-icon';\n\nconst StyledInputCorrect = styled('div')(({ theme }) => ({\n float: 'right',\n padding: theme.spacing(0.5),\n borderRadius: '4px',\n fontSize: '10px',\n backgroundColor: color.defaults.WHITE,\n color: color.defaults.CORRECT_WITH_ICON,\n border: `solid 1px ${color.defaults.CORRECT_WITH_ICON}`,\n}));\n\nconst StyledInputIncorrect = styled('div')(({ theme }) => ({\n float: 'right',\n padding: theme.spacing(0.5),\n borderRadius: '4px',\n fontSize: '10px',\n backgroundColor: color.defaults.WHITE,\n color: color.defaults.INCORRECT_WITH_ICON,\n border: `solid 1px ${color.defaults.INCORRECT_WITH_ICON}`,\n}));\n\nconst StyledInputMissing = styled('div')(({ theme }) => ({\n float: 'right',\n padding: theme.spacing(0.5),\n borderRadius: '4px',\n fontSize: '10px',\n backgroundColor: color.defaults.WHITE,\n color: color.defaults.MISSING_WITH_ICON,\n border: `solid 1px ${color.defaults.MISSING_WITH_ICON}`,\n fontWeight: 'bold',\n}));\n\nconst StyledIncorrect = styled('div')(({ theme }) => ({\n float: 'right',\n padding: 0,\n borderRadius: '4px',\n fontSize: '10px',\n backgroundColor: color.defaults.WHITE,\n color: color.defaults.INCORRECT_WITH_ICON,\n fontWeight: 'bold',\n}));\n\nconst getInputStyles = (theme, disabled, markDisabled) => ({\n float: 'right',\n padding: theme.spacing(0.5),\n fontFamily: theme.typography.fontFamily,\n fontSize: '10px',\n border: disabled \n ? `solid 1px ${color.defaults.PRIMARY_DARK}`\n : markDisabled \n ? `solid 1px ${color.disabled()}`\n : `solid 1px ${color.defaults.SECONDARY}`,\n borderRadius: '3px',\n color: markDisabled ? color.disabled() : color.defaults.PRIMARY_DARK,\n backgroundColor: color.defaults.WHITE,\n WebkitOpacity: disabled ? '1' : undefined,\n WebkitTextFillColor: markDisabled ? color.disabled() : undefined,\n});\n\nconst getStudentInputStyles = () => ({\n padding: '0',\n border: 'none',\n color: 'inherit',\n fontWeight: 'bold',\n});\n\nexport const position = (graphProps, mark, rect = { width: 0, height: 0 }) => {\n const { scale, domain, range } = graphProps;\n const shift = 5;\n\n const rightEdge = scale.x(mark.x) + rect.width + shift;\n const bottomEdge = scale.y(mark.y) + rect.height + shift;\n\n const h = rightEdge >= scale.x(domain.max) ? 'left' : 'right';\n const v = bottomEdge >= scale.y(range.min) ? 'top' : 'bottom';\n\n return `${v}-${h}`;\n};\n\nexport const coordinates = (graphProps, mark, rect = { width: 0, height: 0 }, position) => {\n const { scale } = graphProps;\n const shift = 5;\n\n switch (position) {\n case 'bottom-right':\n return { left: scale.x(mark.x) + shift, top: scale.y(mark.y) + shift };\n case 'bottom-left':\n return { left: scale.x(mark.x) - shift - rect.width, top: scale.y(mark.y) + shift };\n case 'top-left':\n return { left: scale.x(mark.x) - shift - rect.width, top: scale.y(mark.y) - shift - rect.height };\n case 'top-right':\n return { left: scale.x(mark.x) + shift, top: scale.y(mark.y) - shift - rect.height };\n default:\n return {};\n }\n};\n\nconst LabelInput = ({ _ref, externalInputRef, label, disabled, inputStyle, onChange }) => (\n <AutosizeInput\n inputRef={(r) => {\n _ref(r);\n externalInputRef(r);\n }}\n disabled={disabled}\n inputStyle={inputStyle}\n value={label}\n onChange={onChange}\n />\n);\n\nexport const MarkLabel = (props) => {\n const [input, setInput] = useState(null);\n const _ref = useCallback((node) => setInput(node));\n const theme = useTheme();\n\n const { mark, graphProps, disabled, inputRef: externalInputRef } = props;\n\n const [label, setLabel] = useState(mark.label);\n const { correctness, correctnesslabel, correctlabel } = mark;\n const onChange = (e) => setLabel(e.target.value);\n\n const debouncedLabel = useDebounce(label, 200);\n\n // useState only sets the value once, to synch props to state need useEffect\n useEffect(() => {\n setLabel(mark.label);\n }, [mark.label]);\n\n // pick up the change to debouncedLabel and save it\n useEffect(() => {\n if (typeof debouncedLabel === 'string' && debouncedLabel !== mark.label) {\n props.onChange(debouncedLabel);\n }\n }, [debouncedLabel]);\n\n const rect = input ? input.getBoundingClientRect() : { width: 0, height: 0 };\n const pos = position(graphProps, mark, rect);\n const leftTop = coordinates(graphProps, mark, rect, pos);\n\n const style = {\n position: 'fixed',\n pointerEvents: 'auto',\n display: 'flex',\n alignItems: 'center',\n gap: '3px',\n ...leftTop,\n };\n\n const secondLabelStyle = {\n ...style,\n top: leftTop.top + 25,\n };\n\n const disabledInput = disabled || mark.disabled;\n\n const renderInput = (inputStyle, labelValue) => (\n <LabelInput\n _ref={_ref}\n externalInputRef={externalInputRef}\n label={labelValue}\n disabled={disabledInput}\n inputStyle={inputStyle}\n onChange={onChange}\n />\n );\n\n const studentInputStyle = getStudentInputStyles();\n\n if (correctness === 'correct' && correctnesslabel === 'correct' && correctlabel) {\n return (\n <StyledInputCorrect style={style}>\n <SvgIcon type=\"correct\" />\n {renderInput(studentInputStyle, correctlabel)}\n </StyledInputCorrect>\n );\n }\n\n // avoid rendering empty label when a correct point without label was provided\n if (correctness === 'correct' && correctnesslabel === 'correct' && !correctlabel) {\n return null;\n }\n\n if (correctness === 'correct' && correctnesslabel === 'incorrect') {\n return (\n <>\n <StyledInputIncorrect style={style}>\n <SvgIcon type=\"incorrect\" />\n {label === '' ? (\n <SvgIcon type=\"empty\" style={{ marginLeft: '3px' }} />\n ) : (\n renderInput(studentInputStyle, label)\n )}\n </StyledInputIncorrect>\n <StyledInputMissing style={secondLabelStyle}>\n {renderInput(studentInputStyle, correctlabel)}\n </StyledInputMissing>\n </>\n );\n }\n\n if (correctness === 'missing') {\n return (\n <StyledInputMissing style={style}>\n {renderInput(studentInputStyle, label)}\n </StyledInputMissing>\n );\n }\n\n if (correctness === 'incorrect') {\n return (\n <StyledIncorrect style={style}>\n {renderInput(studentInputStyle, label)}\n </StyledIncorrect>\n );\n }\n\n return (\n <div style={style}>\n {renderInput(\n getInputStyles(theme, disabled, mark.disabled),\n label,\n )}\n </div>\n );\n};\n\nMarkLabel.propTypes = {\n disabled: PropTypes.bool,\n onChange: PropTypes.func,\n graphProps: types.GraphPropsType,\n inputRef: PropTypes.func,\n mark: PropTypes.object,\n};\n\nexport default MarkLabel;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAN,sBAAA,CAAAF,OAAA;AAAuC,SAAAD,wBAAAU,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAZ,uBAAA,YAAAA,wBAAAU,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,c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