Skip to content

Commit 7e89190

Browse files
Fix components with same slot name in the same node
1 parent f98c89e commit 7e89190

16 files changed

+435
-547
lines changed

docs/demo.html

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<!DOCTYPE html>
2+
<html lang="en" class="h-100">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>PostHTML UI</title>
7+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet">
8+
<style>
9+
.doc-shadow {
10+
box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px,
11+
rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.1) 0px 1px 3px 0px,
12+
rgba(0, 0, 0, 0.1) 0px 1px 2px -1px !important;
13+
}
14+
</style>
15+
</head>
16+
<body class="d-flex flex-column h-100 bg-light">
17+
<header class="py-3 mb-4">
18+
<div class="container-lg">
19+
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between">
20+
<a href="index.html" class="d-flex align-items-center col-md-3 mb-2 mb-md-0 text-dark text-decoration-none">
21+
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="32" fill="currentColor" class="bi bi-code-slash me-2" viewbox="0 0 16 16">
22+
<path d="M10.478 1.647a.5.5 0 1 0-.956-.294l-4 13a.5.5 0 0 0 .956.294l4-13zM4.854 4.146a.5.5 0 0 1 0 .708L1.707 8l3.147 3.146a.5.5 0 0 1-.708.708l-3.5-3.5a.5.5 0 0 1 0-.708l3.5-3.5a.5.5 0 0 1 .708 0zm6.292 0a.5.5 0 0 0 0 .708L14.293 8l-3.147 3.146a.5.5 0 0 0 .708.708l3.5-3.5a.5.5 0 0 0 0-.708l-3.5-3.5a.5.5 0 0 0-.708 0z"></path>
23+
</svg>
24+
</a>
25+
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
26+
<li>
27+
<a class="nav-link px-2 link-dark" href="index.html">Home</a>
28+
</li>
29+
<li>
30+
<a class="nav-link px-2 link-dark" href="docs.html">Docs</a>
31+
</li>
32+
<li>
33+
<a class="nav-link px-2 link-dark" href="https://github.com/posthtml" target="_blank">PostHTML</a>
34+
</li>
35+
<li>
36+
<a class="nav-link px-2 link-dark d-block d-md-none" href="https://www.npmjs.com/package/posthtml-component" target="_blank">NPM</a>
37+
</li>
38+
<li>
39+
<a class="nav-link px-2 link-dark d-block d-md-none" href="https://github.com/thewebartisan7/posthtml-components" target="_blank">GitHub</a>
40+
</li>
41+
</ul>
42+
<div class="col-md-3 text-end d-none d-md-block">
43+
<a class="btn btn-light bg-white doc-shadow border-white me-3" href="https://www.npmjs.com/package/posthtml-component" target="_blank">NPM</a>
44+
<a class="btn btn-light bg-white doc-shadow border-white" href="https://github.com/thewebartisan7/posthtml-components" target="_blank">GitHub</a>
45+
</div>
46+
</div>
47+
</div>
48+
</header>
49+
<main class="flex-shrink-0">
50+
<div class="container-lg">
51+
<div class="row">
52+
<div class="col-lg-8">
53+
<h1 class="display-1 fw-bold mb-4">Demo</h1>
54+
</div>
55+
</div>
56+
</div>
57+
</main>
58+
<footer class="footer mt-auto py-3">
59+
<div class="container-lg">
60+
<div class="text-muted text-center">
61+
Handcrafted with
62+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill d-inline mx-1 text-danger" viewbox="0 0 16 16">
63+
<path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"></path>
64+
</svg>
65+
and
66+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cup-hot-fill d-inline mx-1 text-warning" viewbox="0 0 16 16">
67+
<path fill-rule="evenodd" d="M.5 6a.5.5 0 0 0-.488.608l1.652 7.434A2.5 2.5 0 0 0 4.104 16h5.792a2.5 2.5 0 0 0 2.44-1.958l.131-.59a3 3 0 0 0 1.3-5.854l.221-.99A.5.5 0 0 0 13.5 6H.5ZM13 12.5a2.01 2.01 0 0 1-.316-.025l.867-3.898A2.001 2.001 0 0 1 13 12.5Z"></path>
68+
<path d="m4.4.8-.003.004-.014.019a4.167 4.167 0 0 0-.204.31 2.327 2.327 0 0 0-.141.267c-.026.06-.034.092-.037.103v.004a.593.593 0 0 0 .091.248c.075.133.178.272.308.445l.01.012c.118.158.26.347.37.543.112.2.22.455.22.745 0 .188-.065.368-.119.494a3.31 3.31 0 0 1-.202.388 5.444 5.444 0 0 1-.253.382l-.018.025-.005.008-.002.002A.5.5 0 0 1 3.6 4.2l.003-.004.014-.019a4.149 4.149 0 0 0 .204-.31 2.06 2.06 0 0 0 .141-.267c.026-.06.034-.092.037-.103a.593.593 0 0 0-.09-.252A4.334 4.334 0 0 0 3.6 2.8l-.01-.012a5.099 5.099 0 0 1-.37-.543A1.53 1.53 0 0 1 3 1.5c0-.188.065-.368.119-.494.059-.138.134-.274.202-.388a5.446 5.446 0 0 1 .253-.382l.025-.035A.5.5 0 0 1 4.4.8Zm3 0-.003.004-.014.019a4.167 4.167 0 0 0-.204.31 2.327 2.327 0 0 0-.141.267c-.026.06-.034.092-.037.103v.004a.593.593 0 0 0 .091.248c.075.133.178.272.308.445l.01.012c.118.158.26.347.37.543.112.2.22.455.22.745 0 .188-.065.368-.119.494a3.31 3.31 0 0 1-.202.388 5.444 5.444 0 0 1-.253.382l-.018.025-.005.008-.002.002A.5.5 0 0 1 6.6 4.2l.003-.004.014-.019a4.149 4.149 0 0 0 .204-.31 2.06 2.06 0 0 0 .141-.267c.026-.06.034-.092.037-.103a.593.593 0 0 0-.09-.252A4.334 4.334 0 0 0 6.6 2.8l-.01-.012a5.099 5.099 0 0 1-.37-.543A1.53 1.53 0 0 1 6 1.5c0-.188.065-.368.119-.494.059-.138.134-.274.202-.388a5.446 5.446 0 0 1 .253-.382l.025-.035A.5.5 0 0 1 7.4.8Zm3 0-.003.004-.014.019a4.077 4.077 0 0 0-.204.31 2.337 2.337 0 0 0-.141.267c-.026.06-.034.092-.037.103v.004a.593.593 0 0 0 .091.248c.075.133.178.272.308.445l.01.012c.118.158.26.347.37.543.112.2.22.455.22.745 0 .188-.065.368-.119.494a3.198 3.198 0 0 1-.202.388 5.385 5.385 0 0 1-.252.382l-.019.025-.005.008-.002.002A.5.5 0 0 1 9.6 4.2l.003-.004.014-.019a4.149 4.149 0 0 0 .204-.31 2.06 2.06 0 0 0 .141-.267c.026-.06.034-.092.037-.103a.593.593 0 0 0-.09-.252A4.334 4.334 0 0 0 9.6 2.8l-.01-.012a5.099 5.099 0 0 1-.37-.543A1.53 1.53 0 0 1 9 1.5c0-.188.065-.368.119-.494.059-.138.134-.274.202-.388a5.446 5.446 0 0 1 .253-.382l.025-.035A.5.5 0 0 1 10.4.8Z"></path>
69+
</svg>
70+
in Swiss Alp by
71+
<a href="https://github.com/thewebartisan7" class="text-muted text-decoration-none fst-italic" target="_blank">@thewebartisan7</a>
72+
</div>
73+
</div>
74+
</footer>
75+
<div class="modal fade" id="modalWithComponents" data-bs-backdrop="true" data-bs-keyboard="true" aria-labelledby="modalWithComponents" tabindex="-1" aria-hidden="true" aria-modal="true" role="dialog">
76+
<div class="modal-dialog modal-lg modal-fullscreen-lg-down modal-dialog-centered modal-dialog-custom">
77+
<div class="modal-content modal-content-custom">
78+
<div class="modal-header">
79+
<h5 class="modal-title" id="modalWithComponentsLabel">Changelog</h5>
80+
<button type="button" class="btn" override:class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
81+
</div>
82+
<!-- /.modal-header -->
83+
<div class="modal-body">
84+
<h3 id="1.0.0-beta.4-(2022-10-23)" tabindex="-1">
85+
<a class="header-anchor" href="#1.0.0-beta.4-(2022-10-23)">#</a>
86+
1.0.0-beta.4 (2022-10-23)
87+
</h3>
88+
<ul>
89+
<li>Refactor with underscore.js</li>
90+
<li>Optionally set attributes to any nodes not only the first one</li>
91+
<li>Added more docs</li>
92+
</ul>
93+
<h3 id="1.0.0-beta.3-(2022-10-21)" tabindex="-1">
94+
<a class="header-anchor" href="#1.0.0-beta.3-(2022-10-21)">#</a>
95+
1.0.0-beta.3 (2022-10-21)
96+
</h3>
97+
<ul>
98+
<li>Apply additional plugins to tree</li>
99+
</ul>
100+
<h3 id="1.0.0-beta.2-(2022-10-20)" tabindex="-1">
101+
<a class="header-anchor" href="#1.0.0-beta.2-(2022-10-20)">#</a>
102+
1.0.0-beta.2 (2022-10-20)
103+
</h3>
104+
<ul>
105+
<li>First beta release</li>
106+
</ul>
107+
</div>
108+
<!-- /.modal-body -->
109+
<div class="modal-footer">
110+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
111+
</div>
112+
<!-- /.modal-footer -->
113+
</div>
114+
<!-- /.modal-content -->
115+
</div>
116+
<!-- /.modal-dialog -->
117+
</div>
118+
<!-- /.modal -->
119+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>
120+
</body>
121+
</html>

docs/docs.html

+26-17
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,37 @@
3232
margin-bottom: 1.5rem;
3333
}
3434

35-
.header-anchor {
36-
margin-left: -28px;
37-
line-height: 1;
35+
.header-anchor,
36+
h1 .header-anchor,
37+
h2 .header-anchor,
38+
h3 .header-anchor {
3839
color: inherit;
3940
text-decoration: none;
40-
visibility: hidden;
4141
}
4242

43-
h1 .header-anchor {
44-
margin-left: -34px;
45-
}
43+
@media only screen and (min-width: 1200px) {
44+
.header-anchor {
45+
margin-left: -28px;
46+
line-height: 1;
47+
color: inherit;
48+
text-decoration: none;
49+
visibility: hidden;
50+
}
4651

47-
h3 .header-anchor {
48-
margin-left: -24px;
49-
}
52+
h1 .header-anchor {
53+
margin-left: -34px;
54+
}
5055

51-
.header-anchor:hover,
52-
h1:hover .header-anchor,
53-
h2:hover .header-anchor,
54-
h3:hover .header-anchor{
55-
visibility: visible;
56-
color: inherit;
56+
h3 .header-anchor {
57+
margin-left: -24px;
58+
}
59+
60+
.header-anchor:hover,
61+
h1:hover .header-anchor,
62+
h2:hover .header-anchor,
63+
h3:hover .header-anchor {
64+
visibility: visible;
65+
}
5766
}
5867

5968
#header-toc .nav-link {
@@ -110,7 +119,7 @@
110119
</div>
111120
</header>
112121
<main class="flex-shrink-0">
113-
<div class="container">
122+
<div class="container-lg">
114123
<div class="row">
115124
<div class="col-12 col-xl-3 order-1 order-xl-2 toc">
116125
<div class="mt-3 mb-5 my-lg-0 ps-xl-3 mb-lg-5 text-muted">

docs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</div>
4848
</header>
4949
<main class="flex-shrink-0">
50-
<div class="container">
50+
<div class="container-lg">
5151
<div class="row justify-content-center align-items-center">
5252
<div class="col-lg-8 text-center">
5353
<h1 class="display-1 fw-bold mb-4">Build the web with PostHTML</h1>

0 commit comments

Comments
 (0)