Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3 from yoriiis/template-compatibility
Browse files Browse the repository at this point in the history
Add template compatibility with HTML String and HTMLElement
  • Loading branch information
yoriiis authored Jan 5, 2021
2 parents 2f7a1ac + db41b59 commit 053a3a0
Show file tree
Hide file tree
Showing 14 changed files with 679 additions and 37 deletions.
15 changes: 13 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
jest: true
},

extends: 'standard',
extends: ['standard', 'plugin:react/recommended'],

plugins: ['prettier'],

Expand All @@ -28,11 +28,22 @@ module.exports = {
'space-before-function-paren': [
'error',
{ anonymous: 'never', named: 'never', asyncArrow: 'always' }
]
],
'react/prop-types': 0,
'react/display-name': 0,
'react/jsx-key': 0
},

globals: {
document: false,
window: false
},

settings: {
react: {
pragma: 'createElement',
fragment: 'Fragment',
version: '0' // Remove the warning of the missing React package
}
}
};
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 1.2.2

### New features

* Render the template in HTML string with template literals for exemple or by HTMLElement with JSX.

## 1.2.1

### New features
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ return {

`Function`

The function returns the HTML template of the step and exposes the return of the `getStepDatasToRender` function as parameter.
The function returns the template as HTML string or HTMLElement for the step and exposes the return of the `getStepDatasToRender` function as parameter.

> Template can be written with template literals (String) or with JSX (HTMLElement). The demo includes templates in both types for the example.
#### `getStepDatasToRender`

Expand Down
11 changes: 10 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ module.exports = function(api) {
]
];

const plugins = ['@babel/plugin-proposal-class-properties'];
const plugins = [
'@babel/plugin-proposal-class-properties',
[
'@babel/plugin-transform-react-jsx',
{
pragma: 'createElement',
pragmaFrag: 'Fragment'
}
]
];

api.cache.using(() => process.env.NODE_ENV);

Expand Down
4 changes: 2 additions & 2 deletions dist/step-manager.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 053a3a0

Please sign in to comment.