@uncinc/uncinc-react-kitchen-sink 2.8.19 → 2.8.21
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.
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
export default WysiwygField;
|
|
2
|
-
declare function WysiwygField({ html, customElementHandler, ...props }: {
|
|
2
|
+
declare function WysiwygField({ html, customElementHandler, className, ...props }: {
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
html: any;
|
|
5
5
|
customElementHandler?: (() => void) | undefined;
|
|
6
|
+
className?: string | undefined;
|
|
6
7
|
}): React.JSX.Element;
|
|
7
8
|
declare namespace WysiwygField {
|
|
8
9
|
namespace propTypes {
|
|
9
10
|
let html: PropTypes.Validator<string>;
|
|
10
11
|
let customElementHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
|
+
let className: PropTypes.Requireable<string>;
|
|
11
13
|
}
|
|
12
14
|
namespace defaultProps {
|
|
13
15
|
export function customElementHandler_1(): void;
|
|
14
16
|
export { customElementHandler_1 as customElementHandler };
|
|
17
|
+
let className_1: string;
|
|
18
|
+
export { className_1 as className };
|
|
15
19
|
}
|
|
16
20
|
}
|
|
17
21
|
import React from 'react';
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
var _excluded = ["html", "customElementHandler"];
|
|
1
|
+
var _excluded = ["html", "customElementHandler", "className"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import ReactHtmlParser from 'react-html-parser';
|
|
8
|
+
import c from 'classnames';
|
|
8
9
|
import Button from '../Button';
|
|
9
10
|
var WysiwygField = function WysiwygField(_ref) {
|
|
10
11
|
var html = _ref.html,
|
|
11
12
|
_ref$customElementHan = _ref.customElementHandler,
|
|
12
13
|
customElementHandler = _ref$customElementHan === void 0 ? function () {} : _ref$customElementHan,
|
|
14
|
+
_ref$className = _ref.className,
|
|
15
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
13
16
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
var classes = c('WysiwygField', className);
|
|
14
18
|
var parsedHtml = ReactHtmlParser(html, {
|
|
15
19
|
transform: function transform(node) {
|
|
16
20
|
var customHandler = customElementHandler(node);
|
|
@@ -42,14 +46,16 @@ var WysiwygField = function WysiwygField(_ref) {
|
|
|
42
46
|
}
|
|
43
47
|
});
|
|
44
48
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
45
|
-
className:
|
|
49
|
+
className: classes
|
|
46
50
|
}, props), parsedHtml);
|
|
47
51
|
};
|
|
48
52
|
WysiwygField.propTypes = {
|
|
49
53
|
html: PropTypes.string.isRequired,
|
|
50
|
-
customElementHandler: PropTypes.func
|
|
54
|
+
customElementHandler: PropTypes.func,
|
|
55
|
+
className: PropTypes.string
|
|
51
56
|
};
|
|
52
57
|
WysiwygField.defaultProps = {
|
|
53
|
-
customElementHandler: function customElementHandler() {}
|
|
58
|
+
customElementHandler: function customElementHandler() {},
|
|
59
|
+
className: ''
|
|
54
60
|
};
|
|
55
61
|
export default WysiwygField;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uncinc/uncinc-react-kitchen-sink",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.21",
|
|
4
4
|
"description": "Default React components that are easily extended.",
|
|
5
5
|
"author": "uncinc",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"prepare": "yarn run publish:npm && husky install",
|
|
38
38
|
"storybook": "storybook dev -p 6006",
|
|
39
39
|
"build-storybook": "storybook build",
|
|
40
|
-
"yalc-watch": "nodemon -e js,jsx,ts,tsx --ignore dist --exec \"yalc publish && yalc push\"",
|
|
40
|
+
"yalc-watch": "nodemon -e js,jsx,ts,tsx,scss --ignore dist --exec \"yalc publish && yalc push\"",
|
|
41
41
|
"publish:npm": "yarn build && yarn build:cleanup",
|
|
42
42
|
"extract": "sb extract",
|
|
43
43
|
"eslint": "NODE_ENV=development eslint './src/**/*.{js,jsx,ts,tsx}'",
|