@epa-wg/custom-element 0.0.17 → 0.0.19
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/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.vscode/settings.json +25 -0
- package/README.md +49 -18
- package/bin/xslDtd2Ide.mjs +160 -0
- package/custom-element.d.ts +1 -1
- package/custom-element.js +220 -59
- package/demo/a.html +44 -10
- package/demo/data-slices.html +185 -0
- package/demo/demo.css +1 -0
- package/demo/dom-merge.html +1 -1
- package/demo/external-template.html +1 -0
- package/demo/hex-grid-dce.html +13 -13
- package/demo/http-request.html +19 -17
- package/demo/local-storage.html +3 -3
- package/demo/location-element.html +16 -11
- package/demo/parameters.html +21 -3
- package/demo/s.xml +6 -1
- package/demo/s.xslt +8 -10
- package/demo/z.html +61 -49
- package/http-request.js +2 -1
- package/ide/IDE.md +31 -0
- package/ide/customData-dce.json +112 -0
- package/ide/customData-xsl.json +1018 -0
- package/{web-types.json → ide/web-types-dce.json} +42 -1
- package/ide/web-types-xsl.json +867 -0
- package/index.html +7 -5
- package/package.json +4 -2
- package/request.html +2 -2
package/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
@import "demo/demo.css";
|
|
10
10
|
</style>
|
|
11
11
|
</head>
|
|
12
|
-
<body>
|
|
12
|
+
<body xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
|
13
13
|
<nav>
|
|
14
14
|
<h3><code>custom-element</code> demo</h3>
|
|
15
15
|
<div><a href="https://github.com/EPA-WG/custom-element"
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
<a href="./demo/hex-grid.html" >hex grid lib </a> |
|
|
35
35
|
<a href="./demo/scoped-css.html" >scoped CSS </a> |
|
|
36
36
|
<a href="./demo/parameters.html" >attributes </a> |
|
|
37
|
+
<a href="./demo/data-slices.html" >data slices/events </a> |
|
|
37
38
|
<a href="./demo/dom-merge.html" >DOM merge on dynamic update </a>
|
|
38
39
|
</section>
|
|
39
40
|
</nav>
|
|
@@ -95,6 +96,7 @@
|
|
|
95
96
|
<dce-4-slot>🥕</dce-4-slot>
|
|
96
97
|
</template>
|
|
97
98
|
</html-demo-element>
|
|
99
|
+
|
|
98
100
|
<html-demo-element legend="2d. default slot"
|
|
99
101
|
description="slot without `name` attribute use whole payload">
|
|
100
102
|
<template>
|
|
@@ -115,12 +117,12 @@
|
|
|
115
117
|
<template>
|
|
116
118
|
<h3> {title} </h3> <!-- title is an attribute in instance
|
|
117
119
|
mapped into /*/attributes/title -->
|
|
118
|
-
<
|
|
120
|
+
<if test="//smile"> <!-- data-smile DCE instance attribute,
|
|
119
121
|
mapped into /*/dataset/smile
|
|
120
122
|
used in condition -->
|
|
121
123
|
<!-- data-smile DCE instance attribute, used as HTML -->
|
|
122
124
|
<div>Smile as: {//smile}</div> <!-- /datadom/dataset/smile -->
|
|
123
|
-
</
|
|
125
|
+
</if>
|
|
124
126
|
<!-- image would not be visible in sandbox, see live demo -->
|
|
125
127
|
<img src="https://unpkg.com/pokeapi-sprites@2.0.2/sprites/pokemon/other/dream-world/{pokemon-id}.svg"
|
|
126
128
|
alt="{title} image"/>
|
|
@@ -130,7 +132,7 @@
|
|
|
130
132
|
|
|
131
133
|
<!-- `slot name=xxx` replaced with elements with `slot=xxx` attribute -->
|
|
132
134
|
<p><slot name="description"><i>description is not available</i></slot></p>
|
|
133
|
-
<
|
|
135
|
+
<for-each select="//*[@pokemon-id]">
|
|
134
136
|
<!-- loop over payload elements with `pokemon-id` attribute,
|
|
135
137
|
i.e LI elements -->
|
|
136
138
|
<button>
|
|
@@ -141,7 +143,7 @@
|
|
|
141
143
|
{text()} <!-- text from LI element in loop -->
|
|
142
144
|
</button>
|
|
143
145
|
|
|
144
|
-
</
|
|
146
|
+
</for-each>
|
|
145
147
|
</template>
|
|
146
148
|
</custom-element>
|
|
147
149
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epa-wg/custom-element",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "Declarative Custom Element as W3C proposal PoC with native(XSLT) based templating",
|
|
5
5
|
"browser": "custom-element.js",
|
|
6
6
|
"module": "custom-element.js",
|
|
@@ -46,5 +46,7 @@
|
|
|
46
46
|
"type": "patreon",
|
|
47
47
|
"url": "https://www.patreon.com/sashafirsov"
|
|
48
48
|
},
|
|
49
|
-
"web-types": "./web-types.json"
|
|
49
|
+
"web-types": ["./ide/web-types-dce.json","./ide/web-types-xsl.json"],
|
|
50
|
+
"dependencies": {
|
|
51
|
+
}
|
|
50
52
|
}
|
package/request.html
CHANGED