From eebf8429d7fecb9ad52f438f22baa85f808fe3bd Mon Sep 17 00:00:00 2001 From: Glauber Date: Tue, 10 Apr 2018 17:38:44 -0300 Subject: [PATCH 1/3] Add a custom root component tag. --- package.json | 5 ++++- src/Typist.jsx | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5a0f39f..4205c3c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,10 @@ "version": "2.0.4", "description": "Typing animations with React", "main": "dist/Typist.js", - "files": ["dist", "src"], + "files": [ + "dist", + "src" + ], "scripts": { "dist": "webpack --config webpack.dist.config.js", "standalone": "webpack --config webpack.standalone.config.js", diff --git a/src/Typist.jsx b/src/Typist.jsx index b779553..86854fc 100644 --- a/src/Typist.jsx +++ b/src/Typist.jsx @@ -13,6 +13,7 @@ export default class Typist extends Component { static propTypes = { children: PropTypes.node, className: PropTypes.string, + container: PropTypes.string, avgTypingDelay: PropTypes.number, stdTypingDelay: PropTypes.number, startDelay: PropTypes.number, @@ -24,6 +25,7 @@ export default class Typist extends Component { } static defaultProps = { + container: 'div', className: '', avgTypingDelay: 70, stdTypingDelay: 25, @@ -182,18 +184,19 @@ export default class Typist extends Component { } render() { - const { className, cursor } = this.props; + const { className, cursor, container } = this.props; const { isDone } = this.state; + const ContainerTag = container; const innerTree = utils.cloneElementWithSpecifiedText({ element: this.props.children, textLines: this.state.textLines, }); return ( -
+ {innerTree} -
+ ); } From 83f7fe3f817aa55aeeaf5919aca53d76b20c2bdf Mon Sep 17 00:00:00 2001 From: Glauber Date: Thu, 12 Apr 2018 10:56:08 -0300 Subject: [PATCH 2/3] Updated the version to 2.0.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4205c3c..fec4cd3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-typist", - "version": "2.0.4", + "version": "2.0.5", "description": "Typing animations with React", "main": "dist/Typist.js", "files": [ From feda806e54e7bc2bc566e3ac3a1a6054ab4bd276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Glauber=20Magalh=C3=A3es?= Date: Wed, 18 Apr 2018 14:55:21 -0300 Subject: [PATCH 3/3] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fec4cd3..4205c3c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-typist", - "version": "2.0.5", + "version": "2.0.4", "description": "Typing animations with React", "main": "dist/Typist.js", "files": [