@epa-wg/custom-element 0.0.17 → 0.0.18
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 +21 -15
- package/bin/xslDtd2Ide.mjs +160 -0
- package/custom-element.d.ts +1 -1
- package/custom-element.js +35 -4
- package/demo/a.html +8 -2
- package/demo/hex-grid-dce.html +13 -13
- package/demo/http-request.html +13 -13
- package/demo/local-storage.html +2 -2
- package/demo/location-element.html +12 -12
- package/demo/parameters.html +3 -3
- package/demo/s.xslt +4 -6
- package/demo/z.html +3 -5
- package/ide/IDE.md +31 -0
- package/ide/customData-dce.json +89 -0
- package/ide/customData-xsl.json +1018 -0
- package/{web-types.json → ide/web-types-dce.json} +29 -1
- package/ide/web-types-xsl.json +867 -0
- package/index.html +5 -4
- package/package.json +4 -2
- package/request.html +2 -2
package/index.html
CHANGED
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
<dce-4-slot>🥕</dce-4-slot>
|
|
96
96
|
</template>
|
|
97
97
|
</html-demo-element>
|
|
98
|
+
|
|
98
99
|
<html-demo-element legend="2d. default slot"
|
|
99
100
|
description="slot without `name` attribute use whole payload">
|
|
100
101
|
<template>
|
|
@@ -115,12 +116,12 @@
|
|
|
115
116
|
<template>
|
|
116
117
|
<h3> {title} </h3> <!-- title is an attribute in instance
|
|
117
118
|
mapped into /*/attributes/title -->
|
|
118
|
-
<
|
|
119
|
+
<if test="//smile"> <!-- data-smile DCE instance attribute,
|
|
119
120
|
mapped into /*/dataset/smile
|
|
120
121
|
used in condition -->
|
|
121
122
|
<!-- data-smile DCE instance attribute, used as HTML -->
|
|
122
123
|
<div>Smile as: {//smile}</div> <!-- /datadom/dataset/smile -->
|
|
123
|
-
</
|
|
124
|
+
</if>
|
|
124
125
|
<!-- image would not be visible in sandbox, see live demo -->
|
|
125
126
|
<img src="https://unpkg.com/pokeapi-sprites@2.0.2/sprites/pokemon/other/dream-world/{pokemon-id}.svg"
|
|
126
127
|
alt="{title} image"/>
|
|
@@ -130,7 +131,7 @@
|
|
|
130
131
|
|
|
131
132
|
<!-- `slot name=xxx` replaced with elements with `slot=xxx` attribute -->
|
|
132
133
|
<p><slot name="description"><i>description is not available</i></slot></p>
|
|
133
|
-
<
|
|
134
|
+
<for-each select="//*[@pokemon-id]">
|
|
134
135
|
<!-- loop over payload elements with `pokemon-id` attribute,
|
|
135
136
|
i.e LI elements -->
|
|
136
137
|
<button>
|
|
@@ -141,7 +142,7 @@
|
|
|
141
142
|
{text()} <!-- text from LI element in loop -->
|
|
142
143
|
</button>
|
|
143
144
|
|
|
144
|
-
</
|
|
145
|
+
</for-each>
|
|
145
146
|
</template>
|
|
146
147
|
</custom-element>
|
|
147
148
|
|
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.18",
|
|
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