@pie-lib/math-toolbar 3.1.0-beta.7 → 4.0.0-next.41
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/dist/done-button.d.ts +30 -0
- package/dist/done-button.js +35 -0
- package/dist/editor-and-pad.d.ts +47 -0
- package/dist/editor-and-pad.js +352 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.js +158 -0
- package/dist/math-preview.d.ts +22 -0
- package/dist/math-preview.js +125 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +9 -0
- package/package.json +30 -26
- package/CHANGELOG.json +0 -17
- package/CHANGELOG.md +0 -1049
- package/lib/__tests__/editor-and-pad-mathlive.test.js +0 -272
- package/lib/__tests__/editor-and-pad-mathlive.test.js.map +0 -1
- package/lib/__tests__/editor-and-pad.test.js +0 -78
- package/lib/__tests__/editor-and-pad.test.js.map +0 -1
- package/lib/__tests__/index.test.js +0 -27
- package/lib/__tests__/index.test.js.map +0 -1
- package/lib/__tests__/math-preview.test.js +0 -91
- package/lib/__tests__/math-preview.test.js.map +0 -1
- package/lib/done-button.js +0 -51
- package/lib/done-button.js.map +0 -1
- package/lib/editor-and-pad.js +0 -536
- package/lib/editor-and-pad.js.map +0 -1
- package/lib/index.js +0 -241
- package/lib/index.js.map +0 -1
- package/lib/math-preview.js +0 -206
- package/lib/math-preview.js.map +0 -1
- package/lib/utils.js +0 -17
- package/lib/utils.js.map +0 -1
- package/src/__tests__/editor-and-pad-mathlive.test.js +0 -178
- package/src/__tests__/editor-and-pad.test.js +0 -74
- package/src/__tests__/index.test.js +0 -21
- package/src/__tests__/math-preview.test.js +0 -83
- package/src/done-button.jsx +0 -36
- package/src/editor-and-pad.jsx +0 -505
- package/src/index.jsx +0 -220
- package/src/math-preview.jsx +0 -174
- package/src/utils.js +0 -11
package/lib/index.js
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "MathPreview", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _mathPreview["default"];
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
exports.RawPureToolbar = exports.PureToolbar = exports.MathToolbar = void 0;
|
|
14
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
16
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
20
|
-
var _react = _interopRequireDefault(require("react"));
|
|
21
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
22
|
-
var _editorAndPad = _interopRequireDefault(require("./editor-and-pad"));
|
|
23
|
-
var _doneButton = require("./done-button");
|
|
24
|
-
var _styles = require("@mui/material/styles");
|
|
25
|
-
var _mathPreview = _interopRequireDefault(require("./math-preview"));
|
|
26
|
-
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
27
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
28
|
-
var PureToolbarContainer = (0, _styles.styled)('div')({
|
|
29
|
-
display: 'flex',
|
|
30
|
-
width: '100%',
|
|
31
|
-
zIndex: 8,
|
|
32
|
-
alignItems: 'center'
|
|
33
|
-
});
|
|
34
|
-
var MathToolbar = exports.MathToolbar = /*#__PURE__*/function (_React$Component) {
|
|
35
|
-
function MathToolbar(props) {
|
|
36
|
-
var _this;
|
|
37
|
-
(0, _classCallCheck2["default"])(this, MathToolbar);
|
|
38
|
-
_this = _callSuper(this, MathToolbar, [props]);
|
|
39
|
-
(0, _defineProperty2["default"])(_this, "done", function () {
|
|
40
|
-
_this.props.onDone(_this.state.latex);
|
|
41
|
-
});
|
|
42
|
-
(0, _defineProperty2["default"])(_this, "onChange", function (latex) {
|
|
43
|
-
_this.setState({
|
|
44
|
-
latex: latex
|
|
45
|
-
});
|
|
46
|
-
_this.props.onChange(latex);
|
|
47
|
-
});
|
|
48
|
-
_this.state = {
|
|
49
|
-
latex: props.latex
|
|
50
|
-
};
|
|
51
|
-
return _this;
|
|
52
|
-
}
|
|
53
|
-
(0, _inherits2["default"])(MathToolbar, _React$Component);
|
|
54
|
-
return (0, _createClass2["default"])(MathToolbar, [{
|
|
55
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
56
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
57
|
-
this.setState({
|
|
58
|
-
latex: nextProps.latex
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
62
|
-
key: "render",
|
|
63
|
-
value: function render() {
|
|
64
|
-
var latex = this.state.latex;
|
|
65
|
-
var _this$props = this.props,
|
|
66
|
-
classNames = _this$props.classNames,
|
|
67
|
-
autoFocus = _this$props.autoFocus,
|
|
68
|
-
allowAnswerBlock = _this$props.allowAnswerBlock,
|
|
69
|
-
onAnswerBlockAdd = _this$props.onAnswerBlockAdd,
|
|
70
|
-
controlledKeypad = _this$props.controlledKeypad,
|
|
71
|
-
controlledKeypadMode = _this$props.controlledKeypadMode,
|
|
72
|
-
keypadMode = _this$props.keypadMode,
|
|
73
|
-
noDecimal = _this$props.noDecimal,
|
|
74
|
-
additionalKeys = _this$props.additionalKeys,
|
|
75
|
-
showKeypad = _this$props.showKeypad,
|
|
76
|
-
onFocus = _this$props.onFocus,
|
|
77
|
-
onBlur = _this$props.onBlur,
|
|
78
|
-
hideDoneButton = _this$props.hideDoneButton,
|
|
79
|
-
error = _this$props.error,
|
|
80
|
-
keyPadCharacterRef = _this$props.keyPadCharacterRef,
|
|
81
|
-
setKeypadInteraction = _this$props.setKeypadInteraction,
|
|
82
|
-
maxResponseAreas = _this$props.maxResponseAreas;
|
|
83
|
-
return /*#__PURE__*/_react["default"].createElement(PureToolbar, {
|
|
84
|
-
autoFocus: autoFocus,
|
|
85
|
-
classNames: classNames,
|
|
86
|
-
onAnswerBlockAdd: onAnswerBlockAdd,
|
|
87
|
-
allowAnswerBlock: allowAnswerBlock,
|
|
88
|
-
latex: latex,
|
|
89
|
-
additionalKeys: additionalKeys,
|
|
90
|
-
noDecimal: noDecimal,
|
|
91
|
-
keypadMode: keypadMode,
|
|
92
|
-
keyPadCharacterRef: keyPadCharacterRef,
|
|
93
|
-
setKeypadInteraction: setKeypadInteraction,
|
|
94
|
-
onChange: this.onChange,
|
|
95
|
-
onDone: this.done,
|
|
96
|
-
onFocus: onFocus,
|
|
97
|
-
onBlur: onBlur,
|
|
98
|
-
showKeypad: showKeypad,
|
|
99
|
-
controlledKeypad: controlledKeypad,
|
|
100
|
-
controlledKeypadMode: controlledKeypadMode,
|
|
101
|
-
hideDoneButton: hideDoneButton,
|
|
102
|
-
error: error,
|
|
103
|
-
maxResponseAreas: maxResponseAreas
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}]);
|
|
107
|
-
}(_react["default"].Component);
|
|
108
|
-
(0, _defineProperty2["default"])(MathToolbar, "propTypes", {
|
|
109
|
-
autoFocus: _propTypes["default"].bool,
|
|
110
|
-
allowAnswerBlock: _propTypes["default"].bool,
|
|
111
|
-
controlledKeypad: _propTypes["default"].bool,
|
|
112
|
-
controlledKeypadMode: _propTypes["default"].bool,
|
|
113
|
-
keypadMode: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
114
|
-
classNames: _propTypes["default"].object,
|
|
115
|
-
error: _propTypes["default"].string,
|
|
116
|
-
maxResponseAreas: _propTypes["default"].number,
|
|
117
|
-
showKeypad: _propTypes["default"].bool,
|
|
118
|
-
noDecimal: _propTypes["default"].bool,
|
|
119
|
-
additionalKeys: _propTypes["default"].array,
|
|
120
|
-
latex: _propTypes["default"].string.isRequired,
|
|
121
|
-
onAnswerBlockAdd: _propTypes["default"].func,
|
|
122
|
-
onChange: _propTypes["default"].func,
|
|
123
|
-
onDone: _propTypes["default"].func.isRequired,
|
|
124
|
-
onFocus: _propTypes["default"].func,
|
|
125
|
-
onBlur: _propTypes["default"].func,
|
|
126
|
-
hideDoneButton: _propTypes["default"].bool,
|
|
127
|
-
keyPadCharacterRef: _propTypes["default"].func,
|
|
128
|
-
setKeypadInteraction: _propTypes["default"].func
|
|
129
|
-
});
|
|
130
|
-
(0, _defineProperty2["default"])(MathToolbar, "defaultProps", {
|
|
131
|
-
classNames: {},
|
|
132
|
-
keypadMode: 'item-authoring',
|
|
133
|
-
autoFocus: false,
|
|
134
|
-
allowAnswerBlock: false,
|
|
135
|
-
controlledKeypad: false,
|
|
136
|
-
controlledKeypadMode: false,
|
|
137
|
-
noDecimal: false,
|
|
138
|
-
showKeypad: true,
|
|
139
|
-
additionalKeys: [],
|
|
140
|
-
onChange: function onChange() {},
|
|
141
|
-
onAnswerBlockAdd: function onAnswerBlockAdd() {},
|
|
142
|
-
onFocus: function onFocus() {},
|
|
143
|
-
hideDoneButton: false
|
|
144
|
-
});
|
|
145
|
-
var RawPureToolbar = exports.RawPureToolbar = /*#__PURE__*/function (_React$Component2) {
|
|
146
|
-
function RawPureToolbar() {
|
|
147
|
-
(0, _classCallCheck2["default"])(this, RawPureToolbar);
|
|
148
|
-
return _callSuper(this, RawPureToolbar, arguments);
|
|
149
|
-
}
|
|
150
|
-
(0, _inherits2["default"])(RawPureToolbar, _React$Component2);
|
|
151
|
-
return (0, _createClass2["default"])(RawPureToolbar, [{
|
|
152
|
-
key: "render",
|
|
153
|
-
value: function render() {
|
|
154
|
-
var _this$props2 = this.props,
|
|
155
|
-
classNames = _this$props2.classNames,
|
|
156
|
-
autoFocus = _this$props2.autoFocus,
|
|
157
|
-
allowAnswerBlock = _this$props2.allowAnswerBlock,
|
|
158
|
-
onAnswerBlockAdd = _this$props2.onAnswerBlockAdd,
|
|
159
|
-
controlledKeypad = _this$props2.controlledKeypad,
|
|
160
|
-
controlledKeypadMode = _this$props2.controlledKeypadMode,
|
|
161
|
-
additionalKeys = _this$props2.additionalKeys,
|
|
162
|
-
showKeypad = _this$props2.showKeypad,
|
|
163
|
-
keypadMode = _this$props2.keypadMode,
|
|
164
|
-
noDecimal = _this$props2.noDecimal,
|
|
165
|
-
hideInput = _this$props2.hideInput,
|
|
166
|
-
noLatexHandling = _this$props2.noLatexHandling,
|
|
167
|
-
layoutForKeyPad = _this$props2.layoutForKeyPad,
|
|
168
|
-
keyPadCharacterRef = _this$props2.keyPadCharacterRef,
|
|
169
|
-
setKeypadInteraction = _this$props2.setKeypadInteraction,
|
|
170
|
-
latex = _this$props2.latex,
|
|
171
|
-
onChange = _this$props2.onChange,
|
|
172
|
-
onDone = _this$props2.onDone,
|
|
173
|
-
onFocus = _this$props2.onFocus,
|
|
174
|
-
onBlur = _this$props2.onBlur,
|
|
175
|
-
hideDoneButton = _this$props2.hideDoneButton,
|
|
176
|
-
hideDoneButtonBackground = _this$props2.hideDoneButtonBackground,
|
|
177
|
-
error = _this$props2.error,
|
|
178
|
-
maxResponseAreas = _this$props2.maxResponseAreas;
|
|
179
|
-
return /*#__PURE__*/_react["default"].createElement(PureToolbarContainer, {
|
|
180
|
-
className: classNames && classNames.toolbar || '',
|
|
181
|
-
ref: keyPadCharacterRef
|
|
182
|
-
}, /*#__PURE__*/_react["default"].createElement("div", null), /*#__PURE__*/_react["default"].createElement(_editorAndPad["default"], {
|
|
183
|
-
autoFocus: autoFocus,
|
|
184
|
-
keypadMode: keypadMode,
|
|
185
|
-
classNames: classNames || {},
|
|
186
|
-
controlledKeypad: controlledKeypad,
|
|
187
|
-
controlledKeypadMode: controlledKeypadMode,
|
|
188
|
-
noDecimal: noDecimal,
|
|
189
|
-
hideInput: hideInput,
|
|
190
|
-
noLatexHandling: noLatexHandling,
|
|
191
|
-
layoutForKeyPad: layoutForKeyPad,
|
|
192
|
-
showKeypad: showKeypad,
|
|
193
|
-
additionalKeys: additionalKeys,
|
|
194
|
-
allowAnswerBlock: allowAnswerBlock,
|
|
195
|
-
onAnswerBlockAdd: onAnswerBlockAdd,
|
|
196
|
-
latex: latex,
|
|
197
|
-
onChange: onChange,
|
|
198
|
-
onFocus: onFocus,
|
|
199
|
-
onBlur: onBlur,
|
|
200
|
-
error: error,
|
|
201
|
-
maxResponseAreas: maxResponseAreas,
|
|
202
|
-
setKeypadInteraction: setKeypadInteraction
|
|
203
|
-
}), (!controlledKeypad || controlledKeypad && showKeypad) && !hideDoneButton && /*#__PURE__*/_react["default"].createElement(_doneButton.DoneButton, {
|
|
204
|
-
hideBackground: hideDoneButtonBackground,
|
|
205
|
-
onClick: onDone
|
|
206
|
-
}));
|
|
207
|
-
}
|
|
208
|
-
}]);
|
|
209
|
-
}(_react["default"].Component);
|
|
210
|
-
(0, _defineProperty2["default"])(RawPureToolbar, "propTypes", {
|
|
211
|
-
classNames: _propTypes["default"].object,
|
|
212
|
-
latex: _propTypes["default"].string.isRequired,
|
|
213
|
-
keypadMode: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
214
|
-
hideInput: _propTypes["default"].bool,
|
|
215
|
-
noLatexHandling: _propTypes["default"].bool,
|
|
216
|
-
layoutForKeyPad: _propTypes["default"].object,
|
|
217
|
-
onChange: _propTypes["default"].func.isRequired,
|
|
218
|
-
onDone: _propTypes["default"].func.isRequired,
|
|
219
|
-
onBlur: _propTypes["default"].func,
|
|
220
|
-
onAnswerBlockAdd: _propTypes["default"].func,
|
|
221
|
-
additionalKeys: _propTypes["default"].array,
|
|
222
|
-
onFocus: _propTypes["default"].func,
|
|
223
|
-
autoFocus: _propTypes["default"].bool,
|
|
224
|
-
noDecimal: _propTypes["default"].bool,
|
|
225
|
-
allowAnswerBlock: _propTypes["default"].bool,
|
|
226
|
-
controlledKeypad: _propTypes["default"].bool,
|
|
227
|
-
controlledKeypadMode: _propTypes["default"].bool,
|
|
228
|
-
showKeypad: _propTypes["default"].bool,
|
|
229
|
-
hideDoneButton: _propTypes["default"].bool,
|
|
230
|
-
hideDoneButtonBackground: _propTypes["default"].bool,
|
|
231
|
-
error: _propTypes["default"].any,
|
|
232
|
-
maxResponseAreas: _propTypes["default"].number,
|
|
233
|
-
keyPadCharacterRef: _propTypes["default"].object,
|
|
234
|
-
setKeypadInteraction: _propTypes["default"].func
|
|
235
|
-
});
|
|
236
|
-
(0, _defineProperty2["default"])(RawPureToolbar, "defaultProps", {
|
|
237
|
-
classNames: {},
|
|
238
|
-
hideDoneButtonBackground: false
|
|
239
|
-
});
|
|
240
|
-
var PureToolbar = exports.PureToolbar = RawPureToolbar;
|
|
241
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_propTypes","_editorAndPad","_doneButton","_styles","_mathPreview","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","PureToolbarContainer","styled","display","width","zIndex","alignItems","MathToolbar","exports","_React$Component","props","_this","_classCallCheck2","_defineProperty2","onDone","state","latex","setState","onChange","_inherits2","_createClass2","key","value","UNSAFE_componentWillReceiveProps","nextProps","render","_this$props","classNames","autoFocus","allowAnswerBlock","onAnswerBlockAdd","controlledKeypad","controlledKeypadMode","keypadMode","noDecimal","additionalKeys","showKeypad","onFocus","onBlur","hideDoneButton","error","keyPadCharacterRef","setKeypadInteraction","maxResponseAreas","createElement","PureToolbar","done","React","Component","PropTypes","bool","oneOfType","string","number","object","array","isRequired","func","RawPureToolbar","_React$Component2","arguments","_this$props2","hideInput","noLatexHandling","layoutForKeyPad","hideDoneButtonBackground","className","toolbar","ref","DoneButton","hideBackground","onClick","any"],"sources":["../src/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport EditorAndPad from './editor-and-pad';\nimport { DoneButton } from './done-button';\nimport { styled } from '@mui/material/styles';\nimport MathPreview from './math-preview';\n\nexport { MathPreview };\n\nconst PureToolbarContainer = styled('div')({\n display: 'flex',\n width: '100%',\n zIndex: 8,\n alignItems: 'center',\n});\n\nexport class MathToolbar extends React.Component {\n static propTypes = {\n autoFocus: PropTypes.bool,\n allowAnswerBlock: PropTypes.bool,\n controlledKeypad: PropTypes.bool,\n controlledKeypadMode: PropTypes.bool,\n keypadMode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n classNames: PropTypes.object,\n error: PropTypes.string,\n maxResponseAreas: PropTypes.number,\n showKeypad: PropTypes.bool,\n noDecimal: PropTypes.bool,\n additionalKeys: PropTypes.array,\n latex: PropTypes.string.isRequired,\n onAnswerBlockAdd: PropTypes.func,\n onChange: PropTypes.func,\n onDone: PropTypes.func.isRequired,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n hideDoneButton: PropTypes.bool,\n keyPadCharacterRef: PropTypes.func,\n setKeypadInteraction: PropTypes.func,\n };\n\n static defaultProps = {\n classNames: {},\n keypadMode: 'item-authoring',\n autoFocus: false,\n allowAnswerBlock: false,\n controlledKeypad: false,\n controlledKeypadMode: false,\n noDecimal: false,\n showKeypad: true,\n additionalKeys: [],\n onChange: () => {},\n onAnswerBlockAdd: () => {},\n onFocus: () => {},\n hideDoneButton: false,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n latex: props.latex,\n };\n }\n\n done = () => {\n this.props.onDone(this.state.latex);\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n this.setState({ latex: nextProps.latex });\n }\n\n onChange = (latex) => {\n this.setState({ latex });\n this.props.onChange(latex);\n };\n\n render() {\n const { latex } = this.state;\n const {\n classNames,\n autoFocus,\n allowAnswerBlock,\n onAnswerBlockAdd,\n controlledKeypad,\n controlledKeypadMode,\n keypadMode,\n noDecimal,\n additionalKeys,\n showKeypad,\n onFocus,\n onBlur,\n hideDoneButton,\n error,\n keyPadCharacterRef,\n setKeypadInteraction,\n maxResponseAreas,\n } = this.props;\n\n return (\n <PureToolbar\n autoFocus={autoFocus}\n classNames={classNames}\n onAnswerBlockAdd={onAnswerBlockAdd}\n allowAnswerBlock={allowAnswerBlock}\n latex={latex}\n additionalKeys={additionalKeys}\n noDecimal={noDecimal}\n keypadMode={keypadMode}\n keyPadCharacterRef={keyPadCharacterRef}\n setKeypadInteraction={setKeypadInteraction}\n onChange={this.onChange}\n onDone={this.done}\n onFocus={onFocus}\n onBlur={onBlur}\n showKeypad={showKeypad}\n controlledKeypad={controlledKeypad}\n controlledKeypadMode={controlledKeypadMode}\n hideDoneButton={hideDoneButton}\n error={error}\n maxResponseAreas={maxResponseAreas}\n />\n );\n }\n}\n\nexport class RawPureToolbar extends React.Component {\n static propTypes = {\n classNames: PropTypes.object,\n latex: PropTypes.string.isRequired,\n keypadMode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n hideInput: PropTypes.bool,\n noLatexHandling: PropTypes.bool,\n layoutForKeyPad: PropTypes.object,\n onChange: PropTypes.func.isRequired,\n onDone: PropTypes.func.isRequired,\n onBlur: PropTypes.func,\n onAnswerBlockAdd: PropTypes.func,\n additionalKeys: PropTypes.array,\n onFocus: PropTypes.func,\n autoFocus: PropTypes.bool,\n noDecimal: PropTypes.bool,\n allowAnswerBlock: PropTypes.bool,\n controlledKeypad: PropTypes.bool,\n controlledKeypadMode: PropTypes.bool,\n showKeypad: PropTypes.bool,\n hideDoneButton: PropTypes.bool,\n hideDoneButtonBackground: PropTypes.bool,\n error: PropTypes.any,\n maxResponseAreas: PropTypes.number,\n keyPadCharacterRef: PropTypes.object,\n setKeypadInteraction: PropTypes.func,\n };\n\n static defaultProps = {\n classNames: {},\n hideDoneButtonBackground: false,\n };\n\n render() {\n const {\n classNames,\n autoFocus,\n allowAnswerBlock,\n onAnswerBlockAdd,\n controlledKeypad,\n controlledKeypadMode,\n additionalKeys,\n showKeypad,\n keypadMode,\n noDecimal,\n hideInput,\n noLatexHandling,\n layoutForKeyPad,\n keyPadCharacterRef,\n setKeypadInteraction,\n latex,\n onChange,\n onDone,\n onFocus,\n onBlur,\n hideDoneButton,\n hideDoneButtonBackground,\n error,\n maxResponseAreas,\n } = this.props;\n\n return (\n <PureToolbarContainer className={(classNames && classNames.toolbar) || ''} ref={keyPadCharacterRef}>\n <div />\n <EditorAndPad\n autoFocus={autoFocus}\n keypadMode={keypadMode}\n classNames={classNames || {}}\n controlledKeypad={controlledKeypad}\n controlledKeypadMode={controlledKeypadMode}\n noDecimal={noDecimal}\n hideInput={hideInput}\n noLatexHandling={noLatexHandling}\n layoutForKeyPad={layoutForKeyPad}\n showKeypad={showKeypad}\n additionalKeys={additionalKeys}\n allowAnswerBlock={allowAnswerBlock}\n onAnswerBlockAdd={onAnswerBlockAdd}\n latex={latex}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n error={error}\n maxResponseAreas={maxResponseAreas}\n setKeypadInteraction={setKeypadInteraction}\n />\n {(!controlledKeypad || (controlledKeypad && showKeypad)) && !hideDoneButton && (\n <DoneButton hideBackground={hideDoneButtonBackground} onClick={onDone} />\n )}\n </PureToolbarContainer>\n );\n }\n}\n\nexport const PureToolbar = RawPureToolbar;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sB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List":[]}
|
package/lib/math-preview.js
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = exports.RawMathPreview = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var _debug = _interopRequireDefault(require("debug"));
|
|
16
|
-
var _styles = require("@mui/material/styles");
|
|
17
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
|
-
var _mathInputMathlive = require("@pie-lib/math-input-mathlive");
|
|
19
|
-
var _utils = require("./utils");
|
|
20
|
-
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
21
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
-
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; }
|
|
23
|
-
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; }
|
|
24
|
-
var _mq$CommonMqStyles = _mathInputMathlive.mq.CommonMqStyles,
|
|
25
|
-
commonMqFontStyles = _mq$CommonMqStyles.commonMqFontStyles,
|
|
26
|
-
longdivStyles = _mq$CommonMqStyles.longdivStyles,
|
|
27
|
-
supsubStyles = _mq$CommonMqStyles.supsubStyles;
|
|
28
|
-
var log = (0, _debug["default"])('@pie-lib:math-toolbar:math-preview');
|
|
29
|
-
var MathPreviewContainer = (0, _styles.styled)('div')(function (_ref) {
|
|
30
|
-
var theme = _ref.theme,
|
|
31
|
-
isSelected = _ref.isSelected,
|
|
32
|
-
outlineOnWrapper = _ref.outlineOnWrapper;
|
|
33
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
34
|
-
display: 'inline-flex',
|
|
35
|
-
alignItems: 'center',
|
|
36
|
-
position: 'relative',
|
|
37
|
-
'& *': commonMqFontStyles
|
|
38
|
-
}, supsubStyles), longdivStyles), {}, {
|
|
39
|
-
'& > .mq-math-mode': {
|
|
40
|
-
border: isSelected ? 'solid 0px lightgrey' : 'solid 1px lightgrey'
|
|
41
|
-
},
|
|
42
|
-
'& .ML__latex': {
|
|
43
|
-
border: isSelected ? 'solid 0px lightgrey' : 'solid 1px lightgrey',
|
|
44
|
-
padding: isSelected ? '0px' : '5px'
|
|
45
|
-
}
|
|
46
|
-
}, !outlineOnWrapper && {
|
|
47
|
-
'&:not(:has(.ML__latex))': {
|
|
48
|
-
border: isSelected ? 'solid 0px lightgrey' : 'solid 1px lightgrey',
|
|
49
|
-
padding: isSelected ? '0px' : '5px'
|
|
50
|
-
}
|
|
51
|
-
}), {}, {
|
|
52
|
-
'& > .mq-focused': {
|
|
53
|
-
outline: 'none',
|
|
54
|
-
boxShadow: 'none',
|
|
55
|
-
border: 'solid 1px black',
|
|
56
|
-
borderRadius: '0px'
|
|
57
|
-
},
|
|
58
|
-
'& > .mq-math-mode .mq-root-block': {
|
|
59
|
-
paddingTop: '7px !important'
|
|
60
|
-
},
|
|
61
|
-
'& > .mq-math-mode .mq-overarc ': {
|
|
62
|
-
paddingTop: '0.45em !important'
|
|
63
|
-
},
|
|
64
|
-
'& > .mq-math-mode .mq-sqrt-prefix': {
|
|
65
|
-
verticalAlign: 'baseline !important',
|
|
66
|
-
top: '1px !important',
|
|
67
|
-
left: '-0.1em !important'
|
|
68
|
-
},
|
|
69
|
-
'& > .mq-math-mode .mq-denominator': {
|
|
70
|
-
marginTop: '-5px !important',
|
|
71
|
-
padding: '0.5em 0.1em 0.1em !important'
|
|
72
|
-
},
|
|
73
|
-
'& > .mq-math-mode .mq-numerator, .mq-math-mode .mq-over': {
|
|
74
|
-
padding: '0 0.1em !important',
|
|
75
|
-
paddingBottom: '0 !important',
|
|
76
|
-
marginBottom: '-2px'
|
|
77
|
-
},
|
|
78
|
-
'& > .mq-math-mode .mq-longdiv .mq-longdiv-inner .mq-empty': {
|
|
79
|
-
paddingTop: '6px !important',
|
|
80
|
-
paddingLeft: '4px !important'
|
|
81
|
-
},
|
|
82
|
-
'& > .mq-math-mode .mq-longdiv .mq-longdiv-inner': {
|
|
83
|
-
marginLeft: '0 !important'
|
|
84
|
-
},
|
|
85
|
-
'& > .mq-math-mode .mq-overarrow': {
|
|
86
|
-
fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'
|
|
87
|
-
},
|
|
88
|
-
'& > .mq-math-mode .mq-paren': {
|
|
89
|
-
verticalAlign: 'top !important',
|
|
90
|
-
padding: '1px 0.1em !important'
|
|
91
|
-
},
|
|
92
|
-
'& > .mq-math-mode .mq-sqrt-stem': {
|
|
93
|
-
borderTop: '0.07em solid',
|
|
94
|
-
marginLeft: '-1.5px',
|
|
95
|
-
marginTop: '-2px !important',
|
|
96
|
-
paddingTop: '5px !important'
|
|
97
|
-
},
|
|
98
|
-
'& .mq-overarrow-inner': {
|
|
99
|
-
paddingTop: '0 !important',
|
|
100
|
-
border: 'none !important'
|
|
101
|
-
},
|
|
102
|
-
'& .mq-editable-field .mq-cursor': {
|
|
103
|
-
marginTop: '-15px !important'
|
|
104
|
-
},
|
|
105
|
-
'& .mq-overarrow.mq-arrow-both': {
|
|
106
|
-
top: '7.5px',
|
|
107
|
-
marginTop: '0px',
|
|
108
|
-
minWidth: '1.23em',
|
|
109
|
-
'& *': {
|
|
110
|
-
lineHeight: '1 !important'
|
|
111
|
-
},
|
|
112
|
-
'&:before': {
|
|
113
|
-
top: '-0.4em',
|
|
114
|
-
left: '-1px'
|
|
115
|
-
},
|
|
116
|
-
'&:after': {
|
|
117
|
-
top: '0px !important',
|
|
118
|
-
position: 'absolute !important',
|
|
119
|
-
right: '-2px'
|
|
120
|
-
},
|
|
121
|
-
'&.mq-empty:after': {
|
|
122
|
-
top: '-0.45em'
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
'& .mq-overarrow.mq-arrow-right': {
|
|
126
|
-
'&:before': {
|
|
127
|
-
top: '-0.4em',
|
|
128
|
-
right: '-1px'
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
'& .mq-overarrow-inner-right': {
|
|
132
|
-
display: 'none !important'
|
|
133
|
-
},
|
|
134
|
-
'& .mq-overarrow-inner-left': {
|
|
135
|
-
display: 'none !important'
|
|
136
|
-
},
|
|
137
|
-
'& .mq-longdiv-inner': {
|
|
138
|
-
borderTop: '1px solid !important',
|
|
139
|
-
paddingTop: '1.5px !important'
|
|
140
|
-
},
|
|
141
|
-
'& .mq-parallelogram': {
|
|
142
|
-
lineHeight: 0.85
|
|
143
|
-
},
|
|
144
|
-
'& span[data-prime="true"]': {
|
|
145
|
-
fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'
|
|
146
|
-
}
|
|
147
|
-
}, isSelected && !outlineOnWrapper && {
|
|
148
|
-
border: "solid 1px ".concat(theme.palette.primary.main)
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
var InsideOverlay = (0, _styles.styled)('span')({
|
|
152
|
-
position: 'absolute',
|
|
153
|
-
bottom: 0,
|
|
154
|
-
left: 0,
|
|
155
|
-
right: 0,
|
|
156
|
-
top: 0
|
|
157
|
-
});
|
|
158
|
-
var RawMathPreview = exports.RawMathPreview = /*#__PURE__*/function (_React$Component) {
|
|
159
|
-
function RawMathPreview() {
|
|
160
|
-
(0, _classCallCheck2["default"])(this, RawMathPreview);
|
|
161
|
-
return _callSuper(this, RawMathPreview, arguments);
|
|
162
|
-
}
|
|
163
|
-
(0, _inherits2["default"])(RawMathPreview, _React$Component);
|
|
164
|
-
return (0, _createClass2["default"])(RawMathPreview, [{
|
|
165
|
-
key: "componentDidMount",
|
|
166
|
-
value: function componentDidMount() {
|
|
167
|
-
(0, _utils.markFractionBaseSuperscripts)();
|
|
168
|
-
}
|
|
169
|
-
}, {
|
|
170
|
-
key: "componentDidUpdate",
|
|
171
|
-
value: function componentDidUpdate(prevProps) {
|
|
172
|
-
// Re-run only if LaTeX changed
|
|
173
|
-
if (this.props.latex !== prevProps.latex) {
|
|
174
|
-
(0, _utils.markFractionBaseSuperscripts)();
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}, {
|
|
178
|
-
key: "render",
|
|
179
|
-
value: function render() {
|
|
180
|
-
var _this$props = this.props,
|
|
181
|
-
isSelected = _this$props.isSelected,
|
|
182
|
-
outlineOnWrapper = _this$props.outlineOnWrapper,
|
|
183
|
-
onFocus = _this$props.onFocus,
|
|
184
|
-
onBlur = _this$props.onBlur,
|
|
185
|
-
latex = _this$props.latex;
|
|
186
|
-
log('[render] latex: ', latex);
|
|
187
|
-
return /*#__PURE__*/_react["default"].createElement(MathPreviewContainer, {
|
|
188
|
-
isSelected: isSelected,
|
|
189
|
-
outlineOnWrapper: outlineOnWrapper
|
|
190
|
-
}, ' ', /*#__PURE__*/_react["default"].createElement(InsideOverlay, null), /*#__PURE__*/_react["default"].createElement(_mathInputMathlive.mq.Static, {
|
|
191
|
-
latex: latex,
|
|
192
|
-
onFocus: onFocus,
|
|
193
|
-
onBlur: onBlur
|
|
194
|
-
}));
|
|
195
|
-
}
|
|
196
|
-
}]);
|
|
197
|
-
}(_react["default"].Component);
|
|
198
|
-
(0, _defineProperty2["default"])(RawMathPreview, "propTypes", {
|
|
199
|
-
latex: _propTypes["default"].string,
|
|
200
|
-
isSelected: _propTypes["default"].bool,
|
|
201
|
-
outlineOnWrapper: _propTypes["default"].bool,
|
|
202
|
-
onFocus: _propTypes["default"].func,
|
|
203
|
-
onBlur: _propTypes["default"].func
|
|
204
|
-
});
|
|
205
|
-
var _default = exports["default"] = RawMathPreview;
|
|
206
|
-
//# sourceMappingURL=math-preview.js.map
|
package/lib/math-preview.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"math-preview.js","names":["_react","_interopRequireDefault","require","_debug","_styles","_propTypes","_mathInputMathlive","_utils","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","ownKeys","r","Object","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_mq$CommonMqStyles","mq","CommonMqStyles","commonMqFontStyles","longdivStyles","supsubStyles","log","debug","MathPreviewContainer","styled","_ref","theme","isSelected","outlineOnWrapper","display","alignItems","position","border","padding","outline","boxShadow","borderRadius","paddingTop","verticalAlign","top","left","marginTop","paddingBottom","marginBottom","paddingLeft","marginLeft","fontFamily","borderTop","minWidth","lineHeight","right","concat","palette","primary","main","InsideOverlay","bottom","RawMathPreview","exports","_React$Component","_classCallCheck2","_inherits2","_createClass2","key","value","componentDidMount","markFractionBaseSuperscripts","componentDidUpdate","prevProps","props","latex","render","_this$props","onFocus","onBlur","createElement","Static","React","Component","PropTypes","string","bool","func","_default"],"sources":["../src/math-preview.jsx"],"sourcesContent":["import React from 'react';\nimport debug from 'debug';\nimport { styled } from '@mui/material/styles';\nimport PropTypes from 'prop-types';\nimport { mq } from '@pie-lib/math-input-mathlive';\nimport { markFractionBaseSuperscripts } from './utils';\n\nconst { commonMqFontStyles, longdivStyles, supsubStyles } = mq.CommonMqStyles;\n\nconst log = debug('@pie-lib:math-toolbar:math-preview');\n\nconst MathPreviewContainer = styled('div')(({ theme, isSelected, outlineOnWrapper }) => ({\n display: 'inline-flex',\n alignItems: 'center',\n position: 'relative',\n '& *': commonMqFontStyles,\n ...supsubStyles,\n ...longdivStyles,\n '& > .mq-math-mode': {\n border: isSelected ? 'solid 0px lightgrey' : 'solid 1px lightgrey',\n },\n '& .ML__latex': {\n border: isSelected ? 'solid 0px lightgrey' : 'solid 1px lightgrey',\n padding: isSelected ? '0px' : '5px',\n },\n ...(!outlineOnWrapper && {\n '&:not(:has(.ML__latex))': {\n border: isSelected ? 'solid 0px lightgrey' : 'solid 1px lightgrey',\n padding: isSelected ? '0px' : '5px',\n },\n }),\n '& > .mq-focused': {\n outline: 'none',\n boxShadow: 'none',\n border: 'solid 1px black',\n borderRadius: '0px',\n },\n '& > .mq-math-mode .mq-root-block': {\n paddingTop: '7px !important',\n },\n '& > .mq-math-mode .mq-overarc ': {\n paddingTop: '0.45em !important',\n },\n '& > .mq-math-mode .mq-sqrt-prefix': {\n verticalAlign: 'baseline !important',\n top: '1px !important',\n left: '-0.1em !important',\n },\n '& > .mq-math-mode .mq-denominator': {\n marginTop: '-5px !important',\n padding: '0.5em 0.1em 0.1em !important',\n },\n '& > .mq-math-mode .mq-numerator, .mq-math-mode .mq-over': {\n padding: '0 0.1em !important',\n paddingBottom: '0 !important',\n marginBottom: '-2px',\n },\n '& > .mq-math-mode .mq-longdiv .mq-longdiv-inner .mq-empty': {\n paddingTop: '6px !important',\n paddingLeft: '4px !important',\n },\n '& > .mq-math-mode .mq-longdiv .mq-longdiv-inner': {\n marginLeft: '0 !important',\n },\n '& > .mq-math-mode .mq-overarrow': {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',\n },\n '& > .mq-math-mode .mq-paren': {\n verticalAlign: 'top !important',\n padding: '1px 0.1em !important',\n },\n '& > .mq-math-mode .mq-sqrt-stem': {\n borderTop: '0.07em solid',\n marginLeft: '-1.5px',\n marginTop: '-2px !important',\n paddingTop: '5px !important',\n },\n '& .mq-overarrow-inner': {\n paddingTop: '0 !important',\n border: 'none !important',\n },\n '& .mq-editable-field .mq-cursor': {\n marginTop: '-15px !important',\n },\n '& .mq-overarrow.mq-arrow-both': {\n top: '7.5px',\n marginTop: '0px',\n minWidth: '1.23em',\n '& *': {\n lineHeight: '1 !important',\n },\n '&:before': {\n top: '-0.4em',\n left: '-1px',\n },\n '&:after': {\n top: '0px !important',\n position: 'absolute !important',\n right: '-2px',\n },\n '&.mq-empty:after': {\n top: '-0.45em',\n },\n },\n '& .mq-overarrow.mq-arrow-right': {\n '&:before': {\n top: '-0.4em',\n right: '-1px',\n },\n },\n '& .mq-overarrow-inner-right': {\n display: 'none !important',\n },\n '& .mq-overarrow-inner-left': {\n display: 'none !important',\n },\n '& .mq-longdiv-inner': {\n borderTop: '1px solid !important',\n paddingTop: '1.5px !important',\n },\n '& .mq-parallelogram': {\n lineHeight: 0.85,\n },\n '& span[data-prime=\"true\"]': {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',\n },\n ...(isSelected &&\n !outlineOnWrapper && {\n border: `solid 1px ${theme.palette.primary.main}`,\n }),\n}));\n\nconst InsideOverlay = styled('span')({\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n});\n\nexport class RawMathPreview extends React.Component {\n static propTypes = {\n latex: PropTypes.string,\n isSelected: PropTypes.bool,\n outlineOnWrapper: PropTypes.bool,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n };\n\n componentDidMount() {\n markFractionBaseSuperscripts();\n }\n\n componentDidUpdate(prevProps) {\n // Re-run only if LaTeX changed\n if (this.props.latex !== prevProps.latex) {\n markFractionBaseSuperscripts();\n }\n }\n\n render() {\n const { isSelected, outlineOnWrapper, onFocus, onBlur, latex } = this.props;\n log('[render] latex: ', latex);\n return (\n <MathPreviewContainer isSelected={isSelected} outlineOnWrapper={outlineOnWrapper}>\n {' '}\n <InsideOverlay />\n <mq.Static latex={latex} onFocus={onFocus} onBlur={onBlur} />\n </MathPreviewContainer>\n );\n }\n}\n\nexport default RawMathPreview;\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAAuD,SAAAM,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,EAAAK,yBAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAG,0BAAA,cAAAL,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAP,OAAA,CAAAC,SAAA,CAAAG,OAAA,iCAAAV,CAAA,aAA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AhB5C,gBAAgB;QAAE6C,OAAO,GAAAD,WAAA,CAAPC,OAAO;QAAEC,MAAM,GAAAF,WAAA,CAANE,MAAM;QAAEJ,KAAK,GAAAE,WAAA,CAALF,KAAK;MAC5DjD,GAAG,CAAC,kBAAkB,EAAEiD,KAAK,CAAC;MAC9B,oBACE/F,MAAA,YAAAoG,aAAA,CAACpD,oBAAoB;QAACI,UAAU,EAAEA,UAAW;QAACC,gBAAgB,EAAEA;MAAiB,GAC9E,GAAG,eACJrD,MAAA,YAAAoG,aAAA,CAACpB,aAAa,MAAE,CAAC,eACjBhF,MAAA,YAAAoG,aAAA,CAAC9F,kBAAA,CAAAmC,EAAE,CAAC4D,MAAM;QAACN,KAAK,EAAEA,KAAM;QAACG,OAAO,EAAEA,OAAQ;QAACC,MAAM,EAAEA;MAAO,CAAE,CACxC,CAAC;IAE3B;EAAC;AAAA,EA9BiCG,iBAAK,CAACC,SAAS;AAAA,IAAAnE,gBAAA,aAAtC8C,cAAc,eACN;EACjBa,KAAK,EAAES,qBAAS,CAACC,MAAM;EACvBrD,UAAU,EAAEoD,qBAAS,CAACE,IAAI;EAC1BrD,gBAAgB,EAAEmD,qBAAS,CAACE,IAAI;EAChCR,OAAO,EAAEM,qBAAS,CAACG,IAAI;EACvBR,MAAM,EAAEK,qBAAS,CAACG;AACpB,CAAC;AAAA,IAAAC,QAAA,GAAAzB,OAAA,cA0BYD,cAAc","ignoreList":[]}
|
package/lib/utils.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.markFractionBaseSuperscripts = void 0;
|
|
7
|
-
var markFractionBaseSuperscripts = exports.markFractionBaseSuperscripts = function markFractionBaseSuperscripts() {
|
|
8
|
-
document.querySelectorAll('.mq-supsub.mq-sup-only').forEach(function (supsub) {
|
|
9
|
-
var prev = supsub.previousElementSibling;
|
|
10
|
-
if (prev && prev.classList.contains('mq-non-leaf') && prev.querySelector('.mq-fraction')) {
|
|
11
|
-
supsub.classList.add('mq-after-fraction-group');
|
|
12
|
-
} else {
|
|
13
|
-
supsub.classList.remove('mq-after-fraction-group');
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["markFractionBaseSuperscripts","exports","document","querySelectorAll","forEach","supsub","prev","previousElementSibling","classList","contains","querySelector","add","remove"],"sources":["../src/utils.js"],"sourcesContent":["export const markFractionBaseSuperscripts = () => {\n document.querySelectorAll('.mq-supsub.mq-sup-only').forEach((supsub) => {\n const prev = supsub.previousElementSibling;\n\n if (prev && prev.classList.contains('mq-non-leaf') && prev.querySelector('.mq-fraction')) {\n supsub.classList.add('mq-after-fraction-group');\n } else {\n supsub.classList.remove('mq-after-fraction-group');\n }\n });\n};\n"],"mappings":";;;;;;AAAO,IAAMA,4BAA4B,GAAAC,OAAA,CAAAD,4BAAA,GAAG,SAA/BA,4BAA4BA,CAAA,EAAS;EAChDE,QAAQ,CAACC,gBAAgB,CAAC,wBAAwB,CAAC,CAACC,OAAO,CAAC,UAACC,MAAM,EAAK;IACtE,IAAMC,IAAI,GAAGD,MAAM,CAACE,sBAAsB;IAE1C,IAAID,IAAI,IAAIA,IAAI,CAACE,SAAS,CAACC,QAAQ,CAAC,aAAa,CAAC,IAAIH,IAAI,CAACI,aAAa,CAAC,cAAc,CAAC,EAAE;MACxFL,MAAM,CAACG,SAAS,CAACG,GAAG,CAAC,yBAAyB,CAAC;IACjD,CAAC,MAAM;MACLN,MAAM,CAACG,SAAS,CAACI,MAAM,CAAC,yBAAyB,CAAC;IACpD;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|