@micromag/element-quote 0.3.332 → 0.3.344
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/es/index.js +17 -8
- package/lib/index.js +18 -9
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
|
-
import
|
|
3
|
+
import classNames from 'classnames';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
5
6
|
import { v1 } from 'uuid';
|
|
6
|
-
import classNames from 'classnames';
|
|
7
7
|
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { LinkStyle, HighlightStyle } from '@micromag/core/components';
|
|
9
|
+
import { getStyleFromLink, getStyleFromHighlight, getStyleFromText, getStyleFromMargin } from '@micromag/core/utils';
|
|
10
10
|
|
|
11
11
|
var styles = {"container":"micromag-element-quote-container","showEmpty":"micromag-element-quote-showEmpty"};
|
|
12
12
|
|
|
@@ -29,7 +29,7 @@ var defaultProps = {
|
|
|
29
29
|
emptyClassName: null
|
|
30
30
|
};
|
|
31
31
|
var Quote = function Quote(_ref) {
|
|
32
|
-
var
|
|
32
|
+
var _ref3;
|
|
33
33
|
var body = _ref.body,
|
|
34
34
|
textStyle = _ref.textStyle,
|
|
35
35
|
linksStyle = _ref.linksStyle,
|
|
@@ -37,8 +37,14 @@ var Quote = function Quote(_ref) {
|
|
|
37
37
|
showEmpty = _ref.showEmpty,
|
|
38
38
|
className = _ref.className,
|
|
39
39
|
emptyClassName = _ref.emptyClassName;
|
|
40
|
-
var
|
|
41
|
-
|
|
40
|
+
var _ref2 = textStyle || {},
|
|
41
|
+
_ref2$link = _ref2.link,
|
|
42
|
+
linkStyle = _ref2$link === void 0 ? null : _ref2$link,
|
|
43
|
+
_ref2$highlight = _ref2.highlight,
|
|
44
|
+
highlightStyle = _ref2$highlight === void 0 ? null : _ref2$highlight;
|
|
45
|
+
var finalStyle = {};
|
|
46
|
+
var finalLinkStyle = linkStyle !== null ? getStyleFromLink(linkStyle) : null;
|
|
47
|
+
var finalHighlightStyle = highlightStyle !== null ? getStyleFromHighlight(highlightStyle) : null;
|
|
42
48
|
if (textStyle !== null) {
|
|
43
49
|
finalStyle = _objectSpread(_objectSpread({}, finalStyle), getStyleFromText(textStyle));
|
|
44
50
|
}
|
|
@@ -54,9 +60,12 @@ var Quote = function Quote(_ref) {
|
|
|
54
60
|
return /*#__PURE__*/React.createElement(React.Fragment, null, finalLinkStyle !== null ? /*#__PURE__*/React.createElement(LinkStyle, {
|
|
55
61
|
selector: "#".concat(id),
|
|
56
62
|
style: finalLinkStyle
|
|
63
|
+
}) : null, finalHighlightStyle !== null ? /*#__PURE__*/React.createElement(HighlightStyle, {
|
|
64
|
+
selector: "#".concat(id),
|
|
65
|
+
style: finalHighlightStyle
|
|
57
66
|
}) : null, /*#__PURE__*/React.createElement("blockquote", {
|
|
58
67
|
id: id,
|
|
59
|
-
className: classNames([styles.container, (
|
|
68
|
+
className: classNames([styles.container, (_ref3 = {}, _defineProperty(_ref3, styles.showEmpty, showEmpty), _defineProperty(_ref3, emptyClassName, showEmpty && emptyClassName !== null), _defineProperty(_ref3, className, className !== null), _ref3)]),
|
|
60
69
|
style: finalStyle,
|
|
61
70
|
dangerouslySetInnerHTML: {
|
|
62
71
|
__html: body
|
package/lib/index.js
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
5
|
-
var
|
|
5
|
+
var classNames = require('classnames');
|
|
6
6
|
var PropTypes = require('prop-types');
|
|
7
|
+
var React = require('react');
|
|
7
8
|
var uuid = require('uuid');
|
|
8
|
-
var classNames = require('classnames');
|
|
9
9
|
var core = require('@micromag/core');
|
|
10
|
-
var utils = require('@micromag/core/utils');
|
|
11
10
|
var components = require('@micromag/core/components');
|
|
11
|
+
var utils = require('@micromag/core/utils');
|
|
12
12
|
|
|
13
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
14
|
|
|
15
15
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
16
16
|
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
17
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
19
17
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
18
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
19
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
20
|
|
|
21
21
|
var styles = {"container":"micromag-element-quote-container","showEmpty":"micromag-element-quote-showEmpty"};
|
|
22
22
|
|
|
@@ -39,7 +39,7 @@ var defaultProps = {
|
|
|
39
39
|
emptyClassName: null
|
|
40
40
|
};
|
|
41
41
|
var Quote = function Quote(_ref) {
|
|
42
|
-
var
|
|
42
|
+
var _ref3;
|
|
43
43
|
var body = _ref.body,
|
|
44
44
|
textStyle = _ref.textStyle,
|
|
45
45
|
linksStyle = _ref.linksStyle,
|
|
@@ -47,8 +47,14 @@ var Quote = function Quote(_ref) {
|
|
|
47
47
|
showEmpty = _ref.showEmpty,
|
|
48
48
|
className = _ref.className,
|
|
49
49
|
emptyClassName = _ref.emptyClassName;
|
|
50
|
-
var
|
|
51
|
-
|
|
50
|
+
var _ref2 = textStyle || {},
|
|
51
|
+
_ref2$link = _ref2.link,
|
|
52
|
+
linkStyle = _ref2$link === void 0 ? null : _ref2$link,
|
|
53
|
+
_ref2$highlight = _ref2.highlight,
|
|
54
|
+
highlightStyle = _ref2$highlight === void 0 ? null : _ref2$highlight;
|
|
55
|
+
var finalStyle = {};
|
|
56
|
+
var finalLinkStyle = linkStyle !== null ? utils.getStyleFromLink(linkStyle) : null;
|
|
57
|
+
var finalHighlightStyle = highlightStyle !== null ? utils.getStyleFromHighlight(highlightStyle) : null;
|
|
52
58
|
if (textStyle !== null) {
|
|
53
59
|
finalStyle = _objectSpread__default["default"](_objectSpread__default["default"]({}, finalStyle), utils.getStyleFromText(textStyle));
|
|
54
60
|
}
|
|
@@ -64,9 +70,12 @@ var Quote = function Quote(_ref) {
|
|
|
64
70
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, finalLinkStyle !== null ? /*#__PURE__*/React__default["default"].createElement(components.LinkStyle, {
|
|
65
71
|
selector: "#".concat(id),
|
|
66
72
|
style: finalLinkStyle
|
|
73
|
+
}) : null, finalHighlightStyle !== null ? /*#__PURE__*/React__default["default"].createElement(components.HighlightStyle, {
|
|
74
|
+
selector: "#".concat(id),
|
|
75
|
+
style: finalHighlightStyle
|
|
67
76
|
}) : null, /*#__PURE__*/React__default["default"].createElement("blockquote", {
|
|
68
77
|
id: id,
|
|
69
|
-
className: classNames__default["default"]([styles.container, (
|
|
78
|
+
className: classNames__default["default"]([styles.container, (_ref3 = {}, _defineProperty__default["default"](_ref3, styles.showEmpty, showEmpty), _defineProperty__default["default"](_ref3, emptyClassName, showEmpty && emptyClassName !== null), _defineProperty__default["default"](_ref3, className, className !== null), _ref3)]),
|
|
70
79
|
style: finalStyle,
|
|
71
80
|
dangerouslySetInnerHTML: {
|
|
72
81
|
__html: body
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-quote",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.344",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.3.
|
|
52
|
+
"@micromag/core": "^0.3.344",
|
|
53
53
|
"classnames": "^2.2.6",
|
|
54
54
|
"prop-types": "^15.7.2",
|
|
55
55
|
"react-intl": "^5.12.1",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "5ab9a39d6a0ca4e9867716f03b4402a2581521f4"
|
|
62
62
|
}
|