@micromag/element-quote 0.3.541 → 0.3.569
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/package.json +4 -5
- package/lib/index.js +0 -80
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-quote",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.569",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,11 +30,10 @@
|
|
|
30
30
|
}
|
|
31
31
|
],
|
|
32
32
|
"license": "ISC",
|
|
33
|
-
"
|
|
33
|
+
"type": "module",
|
|
34
34
|
"module": "es/index.js",
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
|
-
"require": "./lib/index.js",
|
|
38
37
|
"import": "./es/index.js"
|
|
39
38
|
},
|
|
40
39
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -60,7 +59,7 @@
|
|
|
60
59
|
},
|
|
61
60
|
"dependencies": {
|
|
62
61
|
"@babel/runtime": "^7.13.10",
|
|
63
|
-
"@micromag/core": "^0.3.
|
|
62
|
+
"@micromag/core": "^0.3.569",
|
|
64
63
|
"classnames": "^2.2.6",
|
|
65
64
|
"prop-types": "^15.7.2",
|
|
66
65
|
"react-intl": "^6.6.4",
|
|
@@ -70,5 +69,5 @@
|
|
|
70
69
|
"access": "public",
|
|
71
70
|
"registry": "https://registry.npmjs.org/"
|
|
72
71
|
},
|
|
73
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "ceb71f23a32ab8df4a1563a1e5cd5598e539de4d"
|
|
74
73
|
}
|
package/lib/index.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
-
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
5
|
-
var classNames = require('classnames');
|
|
6
|
-
var PropTypes = require('prop-types');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var uuid = require('uuid');
|
|
9
|
-
var core = require('@micromag/core');
|
|
10
|
-
var components = require('@micromag/core/components');
|
|
11
|
-
var utils = require('@micromag/core/utils');
|
|
12
|
-
|
|
13
|
-
var styles = {"container":"micromag-element-quote-container","showEmpty":"micromag-element-quote-showEmpty"};
|
|
14
|
-
|
|
15
|
-
var propTypes = {
|
|
16
|
-
body: PropTypes.string,
|
|
17
|
-
textStyle: core.PropTypes.textStyle,
|
|
18
|
-
linksStyle: core.PropTypes.textStyle,
|
|
19
|
-
margin: core.PropTypes.margin,
|
|
20
|
-
showEmpty: PropTypes.bool,
|
|
21
|
-
className: PropTypes.string,
|
|
22
|
-
emptyClassName: PropTypes.string
|
|
23
|
-
};
|
|
24
|
-
var defaultProps = {
|
|
25
|
-
body: null,
|
|
26
|
-
textStyle: null,
|
|
27
|
-
linksStyle: null,
|
|
28
|
-
margin: null,
|
|
29
|
-
showEmpty: false,
|
|
30
|
-
className: null,
|
|
31
|
-
emptyClassName: null
|
|
32
|
-
};
|
|
33
|
-
var Quote = function Quote(_ref) {
|
|
34
|
-
var body = _ref.body,
|
|
35
|
-
textStyle = _ref.textStyle,
|
|
36
|
-
linksStyle = _ref.linksStyle,
|
|
37
|
-
margin = _ref.margin,
|
|
38
|
-
showEmpty = _ref.showEmpty,
|
|
39
|
-
className = _ref.className,
|
|
40
|
-
emptyClassName = _ref.emptyClassName;
|
|
41
|
-
var _ref2 = textStyle || {},
|
|
42
|
-
_ref2$link = _ref2.link,
|
|
43
|
-
linkStyle = _ref2$link === void 0 ? null : _ref2$link,
|
|
44
|
-
_ref2$highlight = _ref2.highlight,
|
|
45
|
-
highlightStyle = _ref2$highlight === void 0 ? null : _ref2$highlight;
|
|
46
|
-
var finalStyle = {};
|
|
47
|
-
var finalLinkStyle = linkStyle !== null ? utils.getStyleFromLink(linkStyle) : null;
|
|
48
|
-
var finalHighlightStyle = highlightStyle !== null ? utils.getStyleFromHighlight(highlightStyle) : null;
|
|
49
|
-
if (textStyle !== null) {
|
|
50
|
-
finalStyle = _objectSpread(_objectSpread({}, finalStyle), utils.getStyleFromText(textStyle));
|
|
51
|
-
}
|
|
52
|
-
if (margin !== null) {
|
|
53
|
-
finalStyle = _objectSpread(_objectSpread({}, finalStyle), utils.getStyleFromMargin(margin));
|
|
54
|
-
}
|
|
55
|
-
if (linksStyle !== null) {
|
|
56
|
-
finalLinkStyle = _objectSpread(_objectSpread({}, finalLinkStyle), utils.getStyleFromText(linksStyle));
|
|
57
|
-
}
|
|
58
|
-
var id = React.useMemo(function () {
|
|
59
|
-
return finalLinkStyle !== null ? "quote-component-".concat(uuid.v1()) : null;
|
|
60
|
-
}, [finalLinkStyle !== null]);
|
|
61
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, finalLinkStyle !== null ? /*#__PURE__*/React.createElement(components.LinkStyle, {
|
|
62
|
-
selector: "#".concat(id),
|
|
63
|
-
style: finalLinkStyle
|
|
64
|
-
}) : null, finalHighlightStyle !== null ? /*#__PURE__*/React.createElement(components.HighlightStyle, {
|
|
65
|
-
selector: "#".concat(id),
|
|
66
|
-
style: finalHighlightStyle
|
|
67
|
-
}) : null, /*#__PURE__*/React.createElement("blockquote", {
|
|
68
|
-
id: id,
|
|
69
|
-
className: classNames([styles.container, _defineProperty(_defineProperty(_defineProperty({}, styles.showEmpty, showEmpty), emptyClassName, showEmpty && emptyClassName !== null), className, className !== null)]),
|
|
70
|
-
style: finalStyle,
|
|
71
|
-
dangerouslySetInnerHTML: {
|
|
72
|
-
__html: body
|
|
73
|
-
}
|
|
74
|
-
}));
|
|
75
|
-
};
|
|
76
|
-
Quote.propTypes = propTypes;
|
|
77
|
-
Quote.defaultProps = defaultProps;
|
|
78
|
-
var Quote$1 = Quote;
|
|
79
|
-
|
|
80
|
-
module.exports = Quote$1;
|