@epa-wg/custom-element 0.0.3 → 0.0.4

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.
@@ -0,0 +1,36 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ release:
8
+ types: [created]
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - uses: actions/setup-node@v3
16
+ with:
17
+ node-version: 16
18
+ - run: npm ci
19
+ - run: npm test
20
+
21
+ publish-gpr:
22
+ needs: build
23
+ runs-on: ubuntu-latest
24
+ permissions:
25
+ contents: read
26
+ packages: write
27
+ steps:
28
+ - uses: actions/checkout@v3
29
+ - uses: actions/setup-node@v3
30
+ with:
31
+ node-version: 16
32
+ registry-url: https://npm.pkg.github.com/
33
+ - run: npm ci
34
+ - run: npm publish
35
+ env:
36
+ NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
package/.gitignore CHANGED
@@ -105,4 +105,3 @@ dist
105
105
 
106
106
  /.idea/
107
107
  /0/
108
- /package-lock.json
package/README.md CHANGED
@@ -144,6 +144,6 @@ within template
144
144
  [github-image]: https://cdnjs.cloudflare.com/ajax/libs/octicons/8.5.0/svg/mark-github.svg
145
145
  [npm-image]: https://img.shields.io/npm/v/@epa-wg/custom-element.svg
146
146
  [npm-url]: https://npmjs.org/package/@epa-wg/custom-element
147
- [coverage-image]: https://unpkg.com/@epa-wg/custom-element-test@0.0.3/coverage/coverage.svg
148
- [coverage-url]: https://unpkg.com/@epa-wg/custom-element-test@0.0.3/coverage/lcov-report/index.html
147
+ [coverage-image]: https://unpkg.com/@epa-wg/custom-element-test@0.0.4/coverage/coverage.svg
148
+ [coverage-url]: https://unpkg.com/@epa-wg/custom-element-test@0.0.4/coverage/lcov-report/index.html
149
149
  [sandbox-url]: https://stackblitz.com/github/EPA-WG/custom-element?file=index.html
@@ -0,0 +1,5 @@
1
+ ## needed for stackblitz sandbox
2
+ ## https://stackblitz.com/github/EPA-WG/custom-element
3
+ npm i @web/dev-server
4
+ web-dev-server --node-resolve
5
+ echo "stackblitz scripts changes package.json"
package/index.html CHANGED
@@ -17,7 +17,7 @@
17
17
  <nav>
18
18
  <h3><code>custom-element</code> demo</h3>
19
19
  <a href="https://github.com/EPA-WG/custom-element"
20
- ><img src="https://cdnjs.cloudflare.com/ajax/libs/octicons/8.5.0/svg/mark-github.svg">GIT</a>
20
+ ><img src="https://cdnjs.cloudflare.com/ajax/libs/octicons/8.5.0/svg/mark-github.svg" alt="icon">GIT</a>
21
21
  <p>
22
22
  This <em>Declarative Custom Element</em> allows to define<br/>
23
23
  custom HTML tag with template filled from slots, attributes, dataset. </p>
@@ -114,14 +114,31 @@
114
114
 
115
115
  <!-- `slot name=xxx` replaced with elements with `slot=xxx` attribute -->
116
116
  <p><slot name="description"><i>description is not available</i></slot></p>
117
+ <xsl:for-each select="//*[@pokemon-id]">
118
+ <!-- loop over payload elements with `pokemon-id` attribute -->
119
+ <button>
120
+ <img height="32"
121
+ src="https://unpkg.com/pokeapi-sprites@2.0.2/sprites/pokemon/other/dream-world/{@pokemon-id}.svg"
122
+ alt="{text()}"/>
123
+ <br/>
124
+ <xsl:value-of select='text()'/>
125
+ </button>
126
+
127
+ </xsl:for-each>
117
128
  </custom-element>
118
129
 
119
130
  <pokemon-tile title="bulbasaur" data-smile="👼" pokemon-id="1" >
120
131
  <p slot="description">Bulbasaur is a cute Pokémon born with a large seed firmly affixed to its back;
121
132
  the seed grows in size as the Pokémon does.</p>
133
+ <ul>
134
+ <li pokemon-id="2">ivysaur</li>
135
+ <li pokemon-id="3">venusaur</li>
136
+ </ul>
122
137
  </pokemon-tile>
123
138
 
124
- <pokemon-tile title="ninetales" pokemon-id="38" ></pokemon-tile>
139
+ <pokemon-tile title="ninetales" pokemon-id="38" >
140
+ <li pokemon-id="37">vulpix</li>
141
+ </pokemon-tile>
125
142
  </template>
126
143
  </html-demo-element>
127
144
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epa-wg/custom-element",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
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",
@@ -15,6 +15,7 @@
15
15
  "type": "module",
16
16
  "types": "./custom-element.d.ts",
17
17
  "scripts": {
18
+ "dev": "bash bin/stackblitz.sh",
18
19
  "start": "npm i --no-save @web/dev-server && web-dev-server --node-resolve",
19
20
  "test": "echo \"test would reside in https://github.com/EPA-WG/custom-element-test\" && exit 0",
20
21
  "typings": "npx -p typescript tsc custom-element.js --declaration --allowJs --emitDeclarationOnly "