Skip to content

Commit

Permalink
Upgrade version
Browse files Browse the repository at this point in the history
  • Loading branch information
thewebartisan7 committed Oct 24, 2022
1 parent 7e89190 commit ab4cb3b
Show file tree
Hide file tree
Showing 14 changed files with 585 additions and 113 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.0.0-beta.5 (2022-10-24)

* 100% coverage test
* Fix components with same slot name in the same node

## 1.0.0-beta.4 (2022-10-23)

* Refactor with underscore.js
Expand Down
8 changes: 2 additions & 6 deletions docs/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PostHTML UI</title>
<title>PostHTML X Components</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.doc-shadow {
Expand All @@ -17,11 +17,7 @@
<header class="py-3 mb-4">
<div class="container-lg">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between">
<a href="index.html" class="d-flex align-items-center col-md-3 mb-2 mb-md-0 text-dark text-decoration-none">
<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">
<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>
</svg>
</a>
<a href="index.html" class="d-flex align-items-center col-md-3 mb-2 mb-md-0 text-dark text-decoration-none h5">&lt;x-components/&gt;</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li>
<a class="nav-link px-2 link-dark" href="index.html">Home</a>
Expand Down
8 changes: 2 additions & 6 deletions docs/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PostHTML UI</title>
<title>PostHTML X Components</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.doc-shadow {
Expand Down Expand Up @@ -89,11 +89,7 @@
<header class="py-3 mb-4">
<div class="container-lg">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between">
<a href="index.html" class="d-flex align-items-center col-md-3 mb-2 mb-md-0 text-dark text-decoration-none">
<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">
<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>
</svg>
</a>
<a href="index.html" class="d-flex align-items-center col-md-3 mb-2 mb-md-0 text-dark text-decoration-none h5">&lt;x-components/&gt;</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li>
<a class="nav-link px-2 link-dark" href="index.html">Home</a>
Expand Down
15 changes: 6 additions & 9 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PostHTML UI</title>
<title>PostHTML X Components</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.doc-shadow {
Expand All @@ -17,11 +17,7 @@
<header class="py-3 mb-4">
<div class="container-lg">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between">
<a href="index.html" class="d-flex align-items-center col-md-3 mb-2 mb-md-0 text-dark text-decoration-none">
<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">
<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>
</svg>
</a>
<a href="index.html" class="d-flex align-items-center col-md-3 mb-2 mb-md-0 text-dark text-decoration-none h5">&lt;x-components/&gt;</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li>
<a class="nav-link px-2 link-dark" href="index.html">Home</a>
Expand Down Expand Up @@ -52,9 +48,10 @@
<div class="col-lg-8 text-center">
<h1 class="display-1 fw-bold mb-4">Build the web with PostHTML</h1>
<p class="lead mb-4">
Quickly design and customize responsive mobile-first sites with Bootstrap, the world's most popular front-end
open source toolkit, and with PostHTML, the simple, yet powerful tool for transforming HTML/XML with JS plugins.
Powered with PostHTML Components plugin which give you additional superpowers!
Quickly design with PostHTML, the simple, yet powerful tool for transforming HTML/XML with JS plugins.
Fueled with
<strong>x-components</strong>
plugin which give you additional superpowers!
</p>
<div class="text-center mb-4">
<a class="btn btn-light bg-white doc-shadow border-white btn-lg me-3" href="docs.html">Read the docs</a>
Expand Down
277 changes: 254 additions & 23 deletions docs/test.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,261 @@
<div class="bg-secondary">
<h4>Parent</h4>
<h5>YIELD PARENT IN CHILD-PARENT.html</h5>
Test
<!DOCTYPE html>
<html lang="en" class="h-100">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PostHTML X Components</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.doc-shadow {
box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px,
rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.1) 0px 1px 3px 0px,
rgba(0, 0, 0, 0.1) 0px 1px 2px -1px !important;
}
</style>
</head>
<body class="d-flex flex-column h-100 bg-light">
<header class="py-3 mb-4">
<div class="container-lg">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between">
<a href="index.html" class="d-flex align-items-center col-md-3 mb-2 mb-md-0 text-dark text-decoration-none h5">&lt;x-components/&gt;</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li>
<a class="nav-link px-2 link-dark" href="index.html">Home</a>
</li>
<li>
<a class="nav-link px-2 link-dark" href="docs.html">Docs</a>
</li>
<li>
<a class="nav-link px-2 link-dark" href="https://github.com/posthtml" target="_blank">PostHTML</a>
</li>
<li>
<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>
</li>
<li>
<a class="nav-link px-2 link-dark d-block d-md-none" href="https://github.com/thewebartisan7/posthtml-components" target="_blank">GitHub</a>
</li>
</ul>
<div class="col-md-3 text-end d-none d-md-block">
<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>
<a class="btn btn-light bg-white doc-shadow border-white" href="https://github.com/thewebartisan7/posthtml-components" target="_blank">GitHub</a>
</div>
</div>
</div>
</header>
<main class="flex-shrink-0">
<div class="container-lg">
<div class="row">
<div class="col-lg-8">
<h1 class="display-1 fw-bold mb-4">Demo</h1>
<div class="wrapper">
<div class="demo my-demo" something="alocal">
<h1>anObjectDefault</h1>
<p>
<strong>first</strong>
: First default item
</p>
<p>
<strong>second</strong>
: Second default item
</p>
<h1>anObjectOverride</h1>
<p>
<strong>third</strong>
: Third override item
</p>
<p>
<strong>fourth</strong>
: Fourth override item
</p>
<h1>anObjectMerged</h1>
<p>
<strong>first</strong>
: First merged item
</p>
<p>
<strong>second</strong>
: Second merged item
</p>
<p>
<strong>anObjectMerged1</strong>
: {"first":"First1 merged item","second":"Second1 merged item","anObjectMerged2":{"first":"First2 merged item","second":"Second2 merged item"},"third":"Third merged item (UPDATED?)","fourth1":"Fourth merged item"}
</p>
<p>
<strong>third</strong>
: Third merged item
</p>
<p>
<strong>fourth</strong>
: Fourth merged item
</p>
<h1>aStringDefault</h1>
<p>My default string</p>
<h1>aStringOverride</h1>
<p>My override string changed</p>
<hr>
<h1>post</h1>
My post title My post body
<p>
<strong>1</strong>
: My comment 1
</p>
<p>
<strong>2</strong>
: My comment 2
</p>
<p>
<strong>1</strong>
: My comment 1 new
</p>
<p>
<strong>3</strong>
: My comment 3
</p>
<h1>anArrayOfObjects</h1>
<p>
<strong>0</strong>
: {"id":1,"title":"My default title 1"}
</p>
<p>
<strong>1</strong>
: {"id":2,"title":"My default title 2"}
</p>
<p>
<strong>2</strong>
: {"id":1,"title":"My new title 1"}
</p>
<p>
<strong>3</strong>
: {"id":2,"title":"My new title 2","somethingnew":"New"}
</p>
<h1>anArray</h1>
<p>
<strong>0</strong>
: first
</p>
<p>
<strong>1</strong>
: second
</p>
<p>
<strong>2</strong>
: first
</p>
<p>
<strong>3</strong>
: third
</p>
<p>
<strong>4</strong>
: fourth
</p>
<p>
<strong>5</strong>
: ten
</p>
<hr>
<h1>aComputed</h1>
<p>Yes</p>
My filled slot
Hello
</div>
</div>
<hr>
<div class="bg-secondary">
<h4>Parent</h4>
<h5>YIELD PARENT IN CHILD-PARENT.html</h5>
Test




SLOT PARENT INSIDE CHILD-PARENT.html
</div>
<div class="bg-warning">
<h4>Child</h4>
<h5>YIELD CHILD INSIDE CHILD-PARENT.html</h5>
SLOT CHILD INSIDE CHILD-PARENT.html
</div>
<div class="bg-secondary">
<h4>Parent</h4>
<h5>YIELD PARENT IN TEST.html</h5>
undefined


</div>
<div class="bg-warning">
<h4>Child</h4>
<h5>YIELD CHILD INSIDE CHILD-PARENT.html</h5>
SLOT CHILD INSIDE CHILD-PARENT.html
</div>
<div class="bg-secondary">
<h4>Parent</h4>
<h5>YIELD PARENT IN TEST.html</h5>
undefined


SLOT PARENT INSIDE TEST.html
</div>
<div class="bg-warning">
<h4>Child</h4>
<h5>YIELD CHILD INSIDE TEST.html</h5>
SLOT CHILD INSIDE TEST.html
</div>
SLOT PARENT INSIDE TEST.html
</div>
<div class="bg-warning">
<h4>Child</h4>
<h5>YIELD CHILD INSIDE TEST.html</h5>
SLOT CHILD INSIDE TEST.html
</div>
</div>
</div>
</div>
</main>
<footer class="footer mt-auto py-3">
<div class="container-lg">
<div class="text-muted text-center">
Handcrafted with
<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">
<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>
</svg>
and
<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">
<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>
<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>
</svg>
in Swiss Alp by
<a href="https://github.com/thewebartisan7" class="text-muted text-decoration-none fst-italic" target="_blank">@thewebartisan7</a>
</div>
</div>
</footer>
<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">
<div class="modal-dialog modal-lg modal-fullscreen-lg-down modal-dialog-centered modal-dialog-custom">
<div class="modal-content modal-content-custom">
<div class="modal-header">
<h5 class="modal-title" id="modalWithComponentsLabel">Changelog</h5>
<button type="button" class="btn" override:class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<!-- /.modal-header -->
<div class="modal-body">
<h3 id="1.0.0-beta.4-(2022-10-23)" tabindex="-1">
<a class="header-anchor" href="#1.0.0-beta.4-(2022-10-23)">#</a>
1.0.0-beta.4 (2022-10-23)
</h3>
<ul>
<li>Refactor with underscore.js</li>
<li>Optionally set attributes to any nodes not only the first one</li>
<li>Added more docs</li>
</ul>
<h3 id="1.0.0-beta.3-(2022-10-21)" tabindex="-1">
<a class="header-anchor" href="#1.0.0-beta.3-(2022-10-21)">#</a>
1.0.0-beta.3 (2022-10-21)
</h3>
<ul>
<li>Apply additional plugins to tree</li>
</ul>
<h3 id="1.0.0-beta.2-(2022-10-20)" tabindex="-1">
<a class="header-anchor" href="#1.0.0-beta.2-(2022-10-20)">#</a>
1.0.0-beta.2 (2022-10-20)
</h3>
<ul>
<li>First beta release</li>
</ul>
</div>
<!-- /.modal-body -->
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
<!-- /.modal-footer -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
8 changes: 2 additions & 6 deletions examples/dist/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PostHTML UI</title>
<title>PostHTML X Components</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.doc-shadow {
Expand All @@ -17,11 +17,7 @@
<header class="py-3 mb-4">
<div class="container-lg">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between">
<a href="index.html" class="d-flex align-items-center col-md-3 mb-2 mb-md-0 text-dark text-decoration-none">
<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">
<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>
</svg>
</a>
<a href="index.html" class="d-flex align-items-center col-md-3 mb-2 mb-md-0 text-dark text-decoration-none h5">&lt;x-components/&gt;</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li>
<a class="nav-link px-2 link-dark" href="index.html">Home</a>
Expand Down
Loading

0 comments on commit ab4cb3b

Please sign in to comment.