progressively-enhance-web-components 1.0.4 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -3
- package/CONFIGURATION.md +16 -0
- package/README.md +11 -185
- package/USAGE.md +300 -0
- package/package.json +20 -14
- package/progressively-enhance-web-components.js +447 -84
- package/.github/workflows/ci.yml +0 -18
- package/renovate.json +0 -9
- package/sampleApps/express/browser.js +0 -23
- package/sampleApps/express/mvc/routes.js +0 -17
- package/sampleApps/express/mvc/views/index.html +0 -5
- package/sampleApps/express/mvc/views/layouts/main.html +0 -49
- package/sampleApps/express/mvc/views/pageWithForm.html +0 -21
- package/sampleApps/express/mvc/views/secondPage.html +0 -5
- package/sampleApps/express/package-lock.json +0 -1981
- package/sampleApps/express/package.json +0 -13
- package/sampleApps/express/server.js +0 -53
- package/test/test.js +0 -39
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
<meta name="format-detection" content="telephone=no">
|
|
7
|
-
<title>Sample app for progressively enhanced web components</title>
|
|
8
|
-
<script src="/bundle.js" defer></script>
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<nav>
|
|
12
|
-
<ul>
|
|
13
|
-
<li><a href="/">Homepage</a></li>
|
|
14
|
-
<li><a href="/secondPage">Second page</a></li>
|
|
15
|
-
<li><a href="/pageWithForm">Page with form</a></li>
|
|
16
|
-
</ul>
|
|
17
|
-
</nav>
|
|
18
|
-
<article id="page-contents">
|
|
19
|
-
{pageContent|s}
|
|
20
|
-
</article>
|
|
21
|
-
<noparse> {! the noparse tag prevents the teddy templating system from parsing any children of this block which is necessary to prevent teddy from trying to parse the template literals below !}
|
|
22
|
-
<template id="word-count">
|
|
23
|
-
<style>
|
|
24
|
-
div {
|
|
25
|
-
position: relative;
|
|
26
|
-
}
|
|
27
|
-
textarea {
|
|
28
|
-
margin-top: 35px;
|
|
29
|
-
width: 100%;
|
|
30
|
-
box-sizing: border-box;
|
|
31
|
-
}
|
|
32
|
-
span {
|
|
33
|
-
display: block;
|
|
34
|
-
position: absolute;
|
|
35
|
-
top: 0;
|
|
36
|
-
right: 0;
|
|
37
|
-
margin-top: 10px;
|
|
38
|
-
font-weight: bold;
|
|
39
|
-
}
|
|
40
|
-
</style>
|
|
41
|
-
<div>
|
|
42
|
-
<textarea rows="10" cols="50" name="${elId}" id="${elId}">${text}</textarea>
|
|
43
|
-
<slot name="description"></slot>
|
|
44
|
-
<span class="word-count"></span>
|
|
45
|
-
</div>
|
|
46
|
-
</template>
|
|
47
|
-
</noparse>
|
|
48
|
-
</body>
|
|
49
|
-
</html>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<include src="layouts/main">
|
|
2
|
-
<arg pageContent>
|
|
3
|
-
<p>page with a form</p>
|
|
4
|
-
<form action="/pageWithForm" method="post">
|
|
5
|
-
<dl>
|
|
6
|
-
<dt><label for="your_name">Your name:</label></dt>
|
|
7
|
-
<dd><input type="text" name="your_name" id="your_name" value=""></dd>
|
|
8
|
-
<dt><label for="story">Tell me a story:</label></dt>
|
|
9
|
-
<dd>
|
|
10
|
-
<word-count text="Once upon a time... " elId="story">
|
|
11
|
-
<p slot="description">Type your story in the box above!</p>
|
|
12
|
-
</word-count>
|
|
13
|
-
</dd>
|
|
14
|
-
</dl>
|
|
15
|
-
<menu>
|
|
16
|
-
<li><button type="submit" name="button1">Button 1</button></li>
|
|
17
|
-
<li><button type="submit" name="button2">Button 2</button></li>
|
|
18
|
-
</menu>
|
|
19
|
-
</form>
|
|
20
|
-
</arg>
|
|
21
|
-
</include>
|