Skip to content

Commit f967aa3

Browse files
Release beta.16
1 parent 975eb25 commit f967aa3

19 files changed

+209
-35
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.0.0-beta.16 (2022-11-06)
2+
3+
* Fix aware props propagation
4+
* Add utility `isEnabled` to check if a prop is either `<div myprop>` or `<div myprop="true">`
5+
16
## 1.0.0-beta.15 (2022-11-04)
27

38
* Fix aware props must be available only to nested components

docs-src/components/test/a.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script props>
2+
module.exports = {
3+
myprop: props.myprop || 'Default prop'
4+
}
5+
</script>
6+
7+
<div><yield></yield></div>

docs-src/components/test/b.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script props>
2+
module.exports = {
3+
myprop: props.myprop || 'Default prop'
4+
}
5+
</script>
6+
7+
<div>{{ myprop }}</div>

docs-src/components/test/layout.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<script props>
2+
module.exports = {
3+
layoutprop: props.layoutprop || 'Default layoutprop'
4+
}
5+
</script>
6+
7+
<div>
8+
{{ layoutprop }}
9+
<yield></yield>
10+
</div>

docs-src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ const md = './docs-src/md';
1616
const options = {};
1717

1818
readdirSync(src).forEach(file => {
19+
if (file !== 'test.html') {
20+
return;
21+
}
22+
1923
const html = readFileSync(path.resolve(`${src}${file}`), 'utf-8');
2024

2125
posthtml([

docs-src/md/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.0.0-beta.16 (2022-11-06)
2+
3+
* Fix aware props propagation
4+
* Add utility `isEnabled` to check if a prop is either `<div myprop>` or `<div myprop="true">`
5+
16
## 1.0.0-beta.15 (2022-11-04)
27

38
* Fix aware props must be available only to nested components

docs-src/pages/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1 class="display-1 fw-bold mb-4">Build the web with PostHTML</h1>
1414
</div>
1515

1616
<p class="text-muted">
17-
Currently <strong>v1.0.0-beta.15</strong>
17+
Currently <strong>v1.0.0-beta.16</strong>
1818
<span class="px-1">·</span>
1919
<a href="#" class="link-secondary" data-bs-toggle="modal" data-bs-target="#modalWithComponents">Changelog</a>
2020
</p>

docs-src/pages/test.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,28 @@ <h1 class="display-1 fw-bold mb-4">Playground</h1>
3737
</x-test.div2>
3838
</x-test.div1>
3939

40+
<x-test.a aware:myprop="I am aware prop">
41+
<x-test.b></x-test.b>
42+
<x-test.b></x-test.b>
43+
</x-test.a>
44+
45+
<x-test.a>
46+
<x-test.b></x-test.b>
47+
<x-test.b></x-test.b>
48+
</x-test.a>
49+
50+
<x-test.layout aware:layoutprop="Title">
51+
<x-test.a aware:myprop="I am aware prop">
52+
<x-test.b></x-test.b>
53+
<x-test.b></x-test.b>
54+
</x-test.a>
55+
56+
<x-test.a>
57+
<x-test.b></x-test.b>
58+
<x-test.b></x-test.b>
59+
</x-test.a>
60+
</x-test.layout>
61+
4062
<x-test
4163
aStringOverride="My override string changed"
4264
anObjectOverride='{ "third": "Third override item", "fourth": "Fourth override item" }'

docs/test.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,25 @@ <h1 class="display-1 fw-bold mb-4">Playground</h1>
8585
</div>
8686
</div>
8787
</div>
88+
<div>
89+
<div>I am aware prop</div>
90+
<div>I am aware prop</div>
91+
</div>
92+
<div>
93+
<div>Default prop</div>
94+
<div>Default prop</div>
95+
</div>
96+
<div>
97+
Title
98+
<div>
99+
<div>I am aware prop</div>
100+
<div>I am aware prop</div>
101+
</div>
102+
<div>
103+
<div>Default prop</div>
104+
<div>Default prop</div>
105+
</div>
106+
</div>
88107
<div class="wrapper">
89108
<div class="demo my-demo" computed:acomputed="true" something="alocal">
90109
{"title":"PostHTML Components","aStringOverride":"My override string changed","anObjectOverride":{"third":"Third override item","fourth":"Fourth override item"},"computed:aComputed":true,"class":"my-demo","anObjectMerged":{"third":"Third merged item","fourth":"Fourth merged item","anObjectMerged1":{"third":"Third merged item (UPDATED?)","fourth1":"Fourth merged item"}},"post":{"title":"My post title","body":"My post body","comments":[{"id":1,"body":"My comment 1 new"},{"id":3,"body":"My comment 3"}]},"anArrayOfObjects":[{"id":1,"title":"My new title 1"},{"id":2,"title":"My new title 2","somethingnew":"New"}],"anArray":["first","third","fourth","ten"],"something":"alocal"}
@@ -259,6 +278,21 @@ <h5 class="modal-title" id="modalWithComponentsLabel">Changelog</h5>
259278
</div>
260279
<!-- /.modal-header -->
261280
<div class="modal-body">
281+
<h2 id="1.0.0-beta.16-(2022-11-06)" tabindex="-1">
282+
<a class="header-anchor" href="#1.0.0-beta.16-(2022-11-06)">#</a>
283+
1.0.0-beta.16 (2022-11-06)
284+
</h2>
285+
<ul>
286+
<li>Fix aware props propagation</li>
287+
<li>
288+
Add utility
289+
<code>isEnabled</code>
290+
to check if a prop is either
291+
<code>&lt;div myprop&gt;</code>
292+
or
293+
<code>&lt;div myprop=&quot;true&quot;&gt;</code>
294+
</li>
295+
</ul>
262296
<h2 id="1.0.0-beta.15-(2022-11-04)" tabindex="-1">
263297
<a class="header-anchor" href="#1.0.0-beta.15-(2022-11-04)">#</a>
264298
1.0.0-beta.15 (2022-11-04)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "posthtml-component",
3-
"version": "1.0.0-beta.15",
3+
"version": "1.0.0-beta.16",
44
"description": "PostHTML Components Blade-like with slots, attributes as props and custom tag",
55
"license": "MIT",
66
"repository": "thewebartisan7/posthtml-components",

0 commit comments

Comments
 (0)