@pie-lib/mask-markup 1.10.20 → 1.10.21-next.185
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.json +45 -0
- package/CHANGELOG.md +13 -102
- package/lib/choices/choice.js +25 -17
- package/lib/choices/choice.js.map +1 -1
- package/lib/choices/index.js +17 -15
- package/lib/choices/index.js.map +1 -1
- package/lib/components/blank.js +33 -22
- package/lib/components/blank.js.map +1 -1
- package/lib/components/correct-input.js +27 -4
- package/lib/components/correct-input.js.map +1 -1
- package/lib/components/dropdown.js +27 -17
- package/lib/components/dropdown.js.map +1 -1
- package/lib/components/input.js +8 -2
- package/lib/components/input.js.map +1 -1
- package/lib/constructed-response.js +10 -4
- package/lib/constructed-response.js.map +1 -1
- package/lib/drag-in-the-blank.js +19 -17
- package/lib/drag-in-the-blank.js.map +1 -1
- package/lib/index.js +12 -12
- package/lib/inline-dropdown.js +1 -1
- package/lib/inline-dropdown.js.map +1 -1
- package/lib/mask.js +47 -26
- package/lib/mask.js.map +1 -1
- package/lib/serialization.js +13 -4
- package/lib/serialization.js.map +1 -1
- package/lib/with-mask.js +19 -15
- package/lib/with-mask.js.map +1 -1
- package/package.json +2 -2
- package/src/choices/choice.jsx +5 -1
- package/src/components/blank.jsx +6 -1
- package/src/components/correct-input.jsx +29 -2
- package/src/components/dropdown.jsx +11 -1
- package/src/components/input.jsx +15 -1
- package/src/constructed-response.jsx +5 -1
- package/src/mask.jsx +14 -1
- package/src/serialization.js +8 -1
package/lib/with-mask.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -17,23 +19,25 @@ var _serialization = require("./serialization");
|
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
21
|
|
|
20
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
21
|
-
|
|
22
22
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
23
|
|
|
24
24
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
25
25
|
|
|
26
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
26
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
27
27
|
|
|
28
|
-
function
|
|
28
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
29
29
|
|
|
30
|
-
function
|
|
30
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
31
31
|
|
|
32
|
-
function
|
|
32
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
33
33
|
|
|
34
|
-
function
|
|
34
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
35
35
|
|
|
36
|
-
function
|
|
36
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
37
|
+
|
|
38
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
39
|
+
|
|
40
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
41
|
|
|
38
42
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
39
43
|
|
|
@@ -48,17 +52,17 @@ var buildLayoutFromMarkup = function buildLayoutFromMarkup(markup, type) {
|
|
|
48
52
|
exports.buildLayoutFromMarkup = buildLayoutFromMarkup;
|
|
49
53
|
|
|
50
54
|
var withMask = function withMask(type, renderChildren) {
|
|
51
|
-
var _class
|
|
55
|
+
var _class;
|
|
52
56
|
|
|
53
|
-
return
|
|
54
|
-
/*#__PURE__*/
|
|
55
|
-
function (_React$Component) {
|
|
57
|
+
return _class = /*#__PURE__*/function (_React$Component) {
|
|
56
58
|
_inherits(WithMask, _React$Component);
|
|
57
59
|
|
|
60
|
+
var _super = _createSuper(WithMask);
|
|
61
|
+
|
|
58
62
|
function WithMask() {
|
|
59
63
|
_classCallCheck(this, WithMask);
|
|
60
64
|
|
|
61
|
-
return
|
|
65
|
+
return _super.apply(this, arguments);
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
_createClass(WithMask, [{
|
|
@@ -70,7 +74,7 @@ var withMask = function withMask(type, renderChildren) {
|
|
|
70
74
|
value = _this$props.value,
|
|
71
75
|
onChange = _this$props.onChange;
|
|
72
76
|
var maskLayout = layout ? layout : buildLayoutFromMarkup(markup, type);
|
|
73
|
-
return _react["default"].createElement(_mask["default"], {
|
|
77
|
+
return /*#__PURE__*/_react["default"].createElement(_mask["default"], {
|
|
74
78
|
layout: maskLayout,
|
|
75
79
|
value: value,
|
|
76
80
|
onChange: onChange,
|
|
@@ -92,7 +96,7 @@ var withMask = function withMask(type, renderChildren) {
|
|
|
92
96
|
layout: _propTypes["default"].object,
|
|
93
97
|
value: _propTypes["default"].object,
|
|
94
98
|
onChange: _propTypes["default"].func
|
|
95
|
-
}),
|
|
99
|
+
}), _class;
|
|
96
100
|
};
|
|
97
101
|
|
|
98
102
|
exports.withMask = withMask;
|
package/lib/with-mask.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/with-mask.jsx"],"names":["buildLayoutFromMarkup","markup","type","processed","value","document","withMask","renderChildren","props","layout","onChange","maskLayout","React","Component","PropTypes","string","object","func"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/with-mask.jsx"],"names":["buildLayoutFromMarkup","markup","type","processed","value","document","withMask","renderChildren","props","layout","onChange","maskLayout","React","Component","PropTypes","string","object","func"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAwB,CAACC,MAAD,EAASC,IAAT,EAAkB;AACrD,sBAA8B,+BAAaD,MAAb,EAAqBC,IAArB,CAA9B;AAAA,MAAgBC,SAAhB,iBAAQF,MAAR;;AACA,MAAMG,KAAK,GAAG,gCAAYD,SAAZ,CAAd;AACA,SAAOC,KAAK,CAACC,QAAb;AACD,CAJM;;;;AAMA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CAACJ,IAAD,EAAOK,cAAP,EAA0B;AAAA;;AAChD;AAAA;;AAAA;;AAAA;AAAA;;AAAA;AAAA;;AAAA;AAAA;AAAA,aAcE,kBAAS;AACP,0BAA4C,KAAKC,KAAjD;AAAA,YAAQP,MAAR,eAAQA,MAAR;AAAA,YAAgBQ,MAAhB,eAAgBA,MAAhB;AAAA,YAAwBL,KAAxB,eAAwBA,KAAxB;AAAA,YAA+BM,QAA/B,eAA+BA,QAA/B;AAEA,YAAMC,UAAU,GAAGF,MAAM,GAAGA,MAAH,GAAYT,qBAAqB,CAACC,MAAD,EAASC,IAAT,CAA1D;AACA,4BACE,gCAAC,gBAAD;AACE,UAAA,MAAM,EAAES,UADV;AAEE,UAAA,KAAK,EAAEP,KAFT;AAGE,UAAA,QAAQ,EAAEM,QAHZ;AAIE,UAAA,cAAc,EAAEH,cAAc,CAAC,KAAKC,KAAN;AAJhC,UADF;AAQD;AA1BH;;AAAA;AAAA,IAA8BI,kBAAMC,SAApC,wCACqB;AACjB;AACN;AACA;AACMZ,IAAAA,MAAM,EAAEa,sBAAUC,MAJD;;AAKjB;AACN;AACA;AACMN,IAAAA,MAAM,EAAEK,sBAAUE,MARD;AASjBZ,IAAAA,KAAK,EAAEU,sBAAUE,MATA;AAUjBN,IAAAA,QAAQ,EAAEI,sBAAUG;AAVH,GADrB;AA4BD,CA7BM","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Mask from './mask';\nimport componentize from './componentize';\nimport { deserialize } from './serialization';\n\nexport const buildLayoutFromMarkup = (markup, type) => {\n const { markup: processed } = componentize(markup, type);\n const value = deserialize(processed);\n return value.document;\n};\n\nexport const withMask = (type, renderChildren) => {\n return class WithMask extends React.Component {\n static propTypes = {\n /**\n * At the start we'll probably work with markup\n */\n markup: PropTypes.string,\n /**\n * Once we start authoring, it may make sense for use to us layout, which will be a simple js object that maps to `slate.Value`.\n */\n layout: PropTypes.object,\n value: PropTypes.object,\n onChange: PropTypes.func\n };\n\n render() {\n const { markup, layout, value, onChange } = this.props;\n\n const maskLayout = layout ? layout : buildLayoutFromMarkup(markup, type);\n return (\n <Mask\n layout={maskLayout}\n value={value}\n onChange={onChange}\n renderChildren={renderChildren(this.props)}\n />\n );\n }\n };\n};\n"],"file":"with-mask.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/mask-markup",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.21-next.185+25ac3bb1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"keywords": [],
|
|
28
28
|
"author": "",
|
|
29
29
|
"license": "ISC",
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "25ac3bb1b07de51cd0c05c23963b85ac0f716f1b"
|
|
31
31
|
}
|
package/src/choices/choice.jsx
CHANGED
package/src/components/blank.jsx
CHANGED
|
@@ -20,11 +20,16 @@ const useStyles = withStyles(() => ({
|
|
|
20
20
|
minWidth: '90px',
|
|
21
21
|
fontSize: 'inherit',
|
|
22
22
|
minHeight: '32px',
|
|
23
|
+
height: 'auto',
|
|
23
24
|
maxWidth: '374px',
|
|
24
25
|
position: 'relative'
|
|
25
26
|
},
|
|
26
27
|
chipLabel: {
|
|
27
|
-
whiteSpace: 'pre-wrap'
|
|
28
|
+
whiteSpace: 'pre-wrap',
|
|
29
|
+
'& img': {
|
|
30
|
+
display: 'block',
|
|
31
|
+
padding: '2px 0'
|
|
32
|
+
}
|
|
28
33
|
},
|
|
29
34
|
hidden: {
|
|
30
35
|
color: 'transparent',
|
|
@@ -12,6 +12,7 @@ export default withStyles(() => ({
|
|
|
12
12
|
input: {
|
|
13
13
|
color: color.text(),
|
|
14
14
|
backgroundColor: color.background(),
|
|
15
|
+
borderRadius: '4px !important',
|
|
15
16
|
borderWidth: '1px',
|
|
16
17
|
borderStyle: 'solid',
|
|
17
18
|
padding: '10px 20px 10px 10px',
|
|
@@ -29,12 +30,17 @@ export default withStyles(() => ({
|
|
|
29
30
|
borderColor: color.primaryDark()
|
|
30
31
|
}
|
|
31
32
|
},
|
|
33
|
+
crInput: {
|
|
34
|
+
padding: '8px !important'
|
|
35
|
+
},
|
|
32
36
|
correct: correctStyle(color.correct()),
|
|
33
37
|
incorrect: correctStyle(color.incorrect()),
|
|
34
38
|
box: {
|
|
35
39
|
fontSize: 'inherit'
|
|
36
40
|
},
|
|
37
41
|
outlinedInput: {
|
|
42
|
+
padding: '2px',
|
|
43
|
+
borderRadius: '4px',
|
|
38
44
|
'& fieldset': {
|
|
39
45
|
border: 0
|
|
40
46
|
}
|
|
@@ -43,8 +49,24 @@ export default withStyles(() => ({
|
|
|
43
49
|
borderColor: color.correct()
|
|
44
50
|
}
|
|
45
51
|
}))(props => {
|
|
46
|
-
const {
|
|
52
|
+
const {
|
|
53
|
+
correct,
|
|
54
|
+
charactersLimit,
|
|
55
|
+
classes,
|
|
56
|
+
disabled,
|
|
57
|
+
isBox,
|
|
58
|
+
isConstructedResponse,
|
|
59
|
+
width,
|
|
60
|
+
...rest
|
|
61
|
+
} = props;
|
|
47
62
|
const label = typeof correct === 'boolean' ? (correct ? 'correct' : 'incorrect') : undefined;
|
|
63
|
+
const inputProps = charactersLimit ? { maxLength: charactersLimit } : {};
|
|
64
|
+
|
|
65
|
+
if (width) {
|
|
66
|
+
inputProps.style = {
|
|
67
|
+
width: `${width + Math.round(width / 10) + 1}ch` // added some extra space for capital letters
|
|
68
|
+
};
|
|
69
|
+
}
|
|
48
70
|
|
|
49
71
|
return (
|
|
50
72
|
<OutlinedInput
|
|
@@ -54,8 +76,13 @@ export default withStyles(() => ({
|
|
|
54
76
|
[classes.outlinedInput]: true
|
|
55
77
|
})}
|
|
56
78
|
classes={{
|
|
57
|
-
input: classnames({
|
|
79
|
+
input: classnames({
|
|
80
|
+
[classes.input]: true,
|
|
81
|
+
[classes[label]]: label,
|
|
82
|
+
[classes.crInput]: isConstructedResponse
|
|
83
|
+
})
|
|
58
84
|
}}
|
|
85
|
+
inputProps={inputProps}
|
|
59
86
|
labelWidth={0}
|
|
60
87
|
disabled={disabled}
|
|
61
88
|
{...rest}
|
|
@@ -59,7 +59,12 @@ class Dropdown extends React.Component {
|
|
|
59
59
|
|
|
60
60
|
return (
|
|
61
61
|
<Select
|
|
62
|
-
classes={{
|
|
62
|
+
classes={{
|
|
63
|
+
root: classes.root,
|
|
64
|
+
icon: classes.icon,
|
|
65
|
+
selectMenu: classes.selectMenu,
|
|
66
|
+
select: classes.select
|
|
67
|
+
}}
|
|
63
68
|
disabled={disabled}
|
|
64
69
|
value={value || ''}
|
|
65
70
|
onOpen={this.showCheckmarkAndOpen}
|
|
@@ -113,6 +118,11 @@ const styles = () => ({
|
|
|
113
118
|
backgroundColor: color.background()
|
|
114
119
|
}
|
|
115
120
|
},
|
|
121
|
+
select: {
|
|
122
|
+
'&:focus': {
|
|
123
|
+
borderRadius: '4px'
|
|
124
|
+
}
|
|
125
|
+
},
|
|
116
126
|
selectMenu: {
|
|
117
127
|
backgroundColor: color.background(),
|
|
118
128
|
'&:hover': {
|
package/src/components/input.jsx
CHANGED
|
@@ -2,20 +2,34 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import CorrectInput from './correct-input';
|
|
4
4
|
|
|
5
|
-
const Input = ({
|
|
5
|
+
const Input = ({
|
|
6
|
+
disabled,
|
|
7
|
+
correct,
|
|
8
|
+
charactersLimit,
|
|
9
|
+
id,
|
|
10
|
+
isConstructedResponse,
|
|
11
|
+
value,
|
|
12
|
+
onChange,
|
|
13
|
+
showCorrectAnswer,
|
|
14
|
+
width
|
|
15
|
+
}) => {
|
|
6
16
|
return (
|
|
7
17
|
<CorrectInput
|
|
8
18
|
disabled={disabled}
|
|
9
19
|
correct={showCorrectAnswer || correct}
|
|
20
|
+
charactersLimit={charactersLimit}
|
|
10
21
|
variant="outlined"
|
|
11
22
|
value={value}
|
|
23
|
+
isConstructedResponse={isConstructedResponse}
|
|
12
24
|
isBox={true}
|
|
25
|
+
width={width}
|
|
13
26
|
onChange={e => {
|
|
14
27
|
onChange(id, e.target.value);
|
|
15
28
|
}}
|
|
16
29
|
/>
|
|
17
30
|
);
|
|
18
31
|
};
|
|
32
|
+
|
|
19
33
|
Input.propTypes = {
|
|
20
34
|
id: PropTypes.string,
|
|
21
35
|
value: PropTypes.string,
|
|
@@ -5,12 +5,13 @@ import { withMask } from './with-mask';
|
|
|
5
5
|
export default withMask('input', props => (node, data, onChange) => {
|
|
6
6
|
const dataset = node.data ? node.data.dataset || {} : {};
|
|
7
7
|
if (dataset.component === 'input') {
|
|
8
|
-
const { disabled, feedback, showCorrectAnswer } = props;
|
|
8
|
+
const { adjustedLimit, disabled, feedback, showCorrectAnswer, maxLength } = props;
|
|
9
9
|
// the first answer is the correct one
|
|
10
10
|
const correctAnswer = ((props.choices && dataset && props.choices[dataset.id]) || [])[0];
|
|
11
11
|
const finalValue = showCorrectAnswer
|
|
12
12
|
? correctAnswer && correctAnswer.label
|
|
13
13
|
: data[dataset.id] || '';
|
|
14
|
+
const width = maxLength && maxLength[dataset.id];
|
|
14
15
|
|
|
15
16
|
return (
|
|
16
17
|
<Input
|
|
@@ -21,6 +22,9 @@ export default withMask('input', props => (node, data, onChange) => {
|
|
|
21
22
|
id={dataset.id}
|
|
22
23
|
onChange={onChange}
|
|
23
24
|
showCorrectAnswer={showCorrectAnswer}
|
|
25
|
+
width={width}
|
|
26
|
+
charactersLimit={adjustedLimit ? width : 25}
|
|
27
|
+
isConstructedResponse={true}
|
|
24
28
|
/>
|
|
25
29
|
);
|
|
26
30
|
}
|
package/src/mask.jsx
CHANGED
|
@@ -44,6 +44,13 @@ export const renderChildren = (layout, value, onChange, rootRenderChildren, pare
|
|
|
44
44
|
(layout.nodes || []).forEach((n, index) => {
|
|
45
45
|
const key = `${n.type}-${index}`;
|
|
46
46
|
|
|
47
|
+
if (n.isMath) {
|
|
48
|
+
children.push(
|
|
49
|
+
<span dangerouslySetInnerHTML={{ __html: `<math>${n.nodes[0].innerHTML}</math>` }} />
|
|
50
|
+
);
|
|
51
|
+
return children;
|
|
52
|
+
}
|
|
53
|
+
|
|
47
54
|
if (rootRenderChildren) {
|
|
48
55
|
const c = rootRenderChildren(n, value, onChange);
|
|
49
56
|
if (c) {
|
|
@@ -95,6 +102,12 @@ export const renderChildren = (layout, value, onChange, rootRenderChildren, pare
|
|
|
95
102
|
return children;
|
|
96
103
|
};
|
|
97
104
|
|
|
105
|
+
const MaskContainer = withStyles(() => ({
|
|
106
|
+
main: {
|
|
107
|
+
display: 'inherit'
|
|
108
|
+
}
|
|
109
|
+
}))(props => <div className={props.classes.main}>{props.children}</div>);
|
|
110
|
+
|
|
98
111
|
/**
|
|
99
112
|
* Renders a layout that uses the slate.js Value model structure.
|
|
100
113
|
*/
|
|
@@ -115,6 +128,6 @@ export default class Mask extends React.Component {
|
|
|
115
128
|
const { value, layout } = this.props;
|
|
116
129
|
const children = renderChildren(layout, value, this.handleChange, this.props.renderChildren);
|
|
117
130
|
|
|
118
|
-
return <
|
|
131
|
+
return <MaskContainer>{children}</MaskContainer>;
|
|
119
132
|
}
|
|
120
133
|
}
|
package/src/serialization.js
CHANGED
|
@@ -46,7 +46,7 @@ export const parseStyleString = s => {
|
|
|
46
46
|
return result;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
export const reactAttributes = o => toStyleObject(o, { camelize: true });
|
|
49
|
+
export const reactAttributes = o => toStyleObject(o, { camelize: true, addUnits: false });
|
|
50
50
|
|
|
51
51
|
const handleStyles = (el, attribute) => {
|
|
52
52
|
const styleString = el.getAttribute(attribute);
|
|
@@ -140,6 +140,13 @@ const rules = [
|
|
|
140
140
|
const allAttrs = attributes.reduce(attributesToMap(el), { ...normalAttrs });
|
|
141
141
|
const object = getObject(type);
|
|
142
142
|
|
|
143
|
+
if (el.tagName.toLowerCase() === 'math') {
|
|
144
|
+
return {
|
|
145
|
+
isMath: true,
|
|
146
|
+
nodes: [el]
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
143
150
|
return {
|
|
144
151
|
object,
|
|
145
152
|
type,
|