Skip to content

Commit

Permalink
Merge pull request #132 from posthtml/next
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin authored Jul 25, 2024
2 parents f153643 + 8078cce commit 3c1e4e9
Show file tree
Hide file tree
Showing 32 changed files with 5,790 additions and 27,397 deletions.
3 changes: 0 additions & 3 deletions .c8rc

This file was deleted.

21 changes: 0 additions & 21 deletions .clintonrc.json

This file was deleted.

7 changes: 2 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ quote_type = single
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml,*.jade,*.pss,*.css,*.js,*.md,.*,*.ts}]
indent_size = 2

[{changelog.md,.*}]
[{CHANGELOG.md,.*}]
insert_final_newline = false

[*.md]
trim_trailing_whitespace = false
trim_trailing_whitespace = false
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:

strategy:
matrix:
node-version: [14, 16, 18]
node-version: [18, 20, 22]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/npm-publish.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .huskyrc

This file was deleted.

4 changes: 0 additions & 4 deletions .lintstagedrc

This file was deleted.

20 changes: 0 additions & 20 deletions .npmignore

This file was deleted.

4 changes: 0 additions & 4 deletions .nycrc

This file was deleted.

File renamed without changes.
File renamed without changes.
441 changes: 230 additions & 211 deletions readme.md → README.md

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions ava.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions docs-src/md/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ You can run `npm run build` to compile them.
| **utilities** | `{merge: _.mergeWith, template: _.template}` | Object of utilities methods to be passed to `<script props>`. By default lodash `mergeWith` and `template`. |
| **elementAttributes** | `{}` | An object with tag name and a function modifier of valid-attributes.js. |
| **safelistAttributes** | `['data-*']` | An array of attributes name to be added to default valid attributes. |
| **blacklistAttributes** | `[]` | An array of attributes name to be removed from default valid attributes. |
| **blocklistAttributes** | `[]` | An array of attributes name to be removed from default valid attributes. |

## Features

Expand Down Expand Up @@ -793,7 +793,7 @@ const options = {
],

// Remove attributes from all tags that support it
blacklistAttributes: [
blocklistAttributes: [
'role'
]
}
Expand Down
30 changes: 15 additions & 15 deletions docs/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ <h2 id="options" tabindex="-1">
</tr>
<tr>
<td style="text-align:center">
<strong>blacklistAttributes</strong>
<strong>blocklistAttributes</strong>
</td>
<td style="text-align:center">
<code>[]</code>
Expand Down Expand Up @@ -692,9 +692,9 @@ <h3 id="tag-names-and-x-tags" tabindex="-1">
</p>
<pre><code class="language-js">// index.js

const options = {
root: './src',
matcher: [{tag: 'a-tag'}, {tag: 'another-one'}, {tag: new RegExp(`^app-`, 'i')}]
const options = {
root: './src',
matcher: [{tag: 'a-tag'}, {tag: 'another-one'}, {tag: new RegExp(`^app-`, 'i')}]
};

require('posthtml')(require('posthtml-components')(options))
Expand All @@ -710,8 +710,8 @@ <h3 id="tag-names-and-x-tags" tabindex="-1">
<p>Setup PostHTML:</p>
<pre><code class="language-js">// index.js

const options = {
root: './src',
const options = {
root: './src',
tagPrefix: 'x-'
};

Expand Down Expand Up @@ -759,9 +759,9 @@ <h3 id="multiple-folders" tabindex="-1">
You can set up the plugin like below:
</p>
<pre><code class="language-js">// index.js
const options = {
root: './src',
folders: ['components', 'layouts']
const options = {
root: './src',
folders: ['components', 'layouts']
};

require('posthtml')(require('posthtml-components')(options))
Expand Down Expand Up @@ -991,7 +991,7 @@ <h3 id="stacks" tabindex="-1">
&lt;fill:body&gt;Body content&lt;/fill:body&gt;
&lt;fill:footer&gt;Footer content&lt;/fill:footer&gt;
&lt;/x-modal&gt;

&lt;stack name=&quot;scripts&quot;&gt;&lt;/stack&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
Expand Down Expand Up @@ -1132,8 +1132,8 @@ <h3 id="props" tabindex="-1">
<pre><code class="language-html">&lt;!-- src/modal.html --&gt;
&lt;script props&gt;
module.exports = {
title: props.title || 'Default title',
size: props.size ? `modal-${props.size}` : '',
title: props.title || 'Default title',
size: props.size ? `modal-${props.size}` : '',
items: Array.isArray(props.items) ? props.items.concat(['first', 'second']) : ['first', 'second']
}
&lt;/script&gt;
Expand Down Expand Up @@ -1335,7 +1335,7 @@ <h3 id="advanced-attributes-configurations" tabindex="-1">

const options = {
root: './src',

// Add attributes to specific tag or override defaults
elementAttributes: {
DIV: (defaultAttributes) =&gt; {
Expand All @@ -1351,15 +1351,15 @@ <h3 id="advanced-attributes-configurations" tabindex="-1">
return defaultAttributes;
},
},

// Add attributes to all tags, use '*' as wildcard for attribute name that starts with
safelistAttributes: [
'custom-attribute-name',
'attribute-name-start-with-*'
],

// Remove attributes from all tags that support it
blacklistAttributes: [
blocklistAttributes: [
'role'
]
}
Expand Down
Loading

0 comments on commit 3c1e4e9

Please sign in to comment.