Skip to content

Commit d23ba5d

Browse files
peterennisgrgur
authored andcommitted
One (#10)
* chore (deps) bump * feat(one): update to stencil 1.1.2
1 parent 4869bb8 commit d23ba5d

File tree

10 files changed

+2935
-361
lines changed

10 files changed

+2935
-361
lines changed

package-lock.json

Lines changed: 2847 additions & 289 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stop-watch-box",
3-
"version": "0.0.5",
3+
"version": "1.0.0",
44
"description": "A simple Stop-Watch-Box Web Component created with Stencil",
55
"module": "dist/esm/index.js",
66
"main": "dist/index.js",
@@ -18,7 +18,12 @@
1818
},
1919
"dependencies": {},
2020
"devDependencies": {
21-
"@stencil/core": "0.18.1"
21+
"@stencil/core": "1.1.2",
22+
"@types/jest": "24.0.15",
23+
"@types/puppeteer": "1.12.4",
24+
"jest": "24.8.0",
25+
"jest-cli": "24.8.0",
26+
"puppeteer": "1.17.0"
2227
},
2328
"license": "MIT",
2429
"author": "Modus Create <[email protected]>",

src/components.d.ts

Lines changed: 33 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,77 +5,67 @@
55
*/
66

77

8-
import '@stencil/core';
9-
10-
8+
import { HTMLStencilElement, JSXBase } from '@stencil/core/internal';
119

1210

1311
export namespace Components {
14-
15-
interface StopWatchBox {
16-
'applyHover': boolean;
17-
}
18-
interface StopWatchBoxAttributes extends StencilHTMLAttributes {
19-
'applyHover'?: boolean;
20-
}
21-
2212
interface StopWatch {
2313
'applyHover': boolean;
2414
'hours': string;
2515
'milliseconds': string;
2616
'minutes': string;
2717
'seconds': string;
2818
}
29-
interface StopWatchAttributes extends StencilHTMLAttributes {
30-
'applyHover'?: boolean;
31-
'hours'?: string;
32-
'milliseconds'?: string;
33-
'minutes'?: string;
34-
'seconds'?: string;
19+
interface StopWatchBox {
20+
'applyHover': boolean;
3521
}
3622
}
3723

3824
declare global {
39-
interface StencilElementInterfaces {
40-
'StopWatchBox': Components.StopWatchBox;
41-
'StopWatch': Components.StopWatch;
42-
}
43-
44-
interface StencilIntrinsicElements {
45-
'stop-watch-box': Components.StopWatchBoxAttributes;
46-
'stop-watch': Components.StopWatchAttributes;
47-
}
4825

4926

50-
interface HTMLStopWatchBoxElement extends Components.StopWatchBox, HTMLStencilElement {}
51-
var HTMLStopWatchBoxElement: {
52-
prototype: HTMLStopWatchBoxElement;
53-
new (): HTMLStopWatchBoxElement;
54-
};
55-
5627
interface HTMLStopWatchElement extends Components.StopWatch, HTMLStencilElement {}
5728
var HTMLStopWatchElement: {
5829
prototype: HTMLStopWatchElement;
5930
new (): HTMLStopWatchElement;
6031
};
6132

33+
interface HTMLStopWatchBoxElement extends Components.StopWatchBox, HTMLStencilElement {}
34+
var HTMLStopWatchBoxElement: {
35+
prototype: HTMLStopWatchBoxElement;
36+
new (): HTMLStopWatchBoxElement;
37+
};
6238
interface HTMLElementTagNameMap {
63-
'stop-watch-box': HTMLStopWatchBoxElement
64-
'stop-watch': HTMLStopWatchElement
39+
'stop-watch': HTMLStopWatchElement;
40+
'stop-watch-box': HTMLStopWatchBoxElement;
6541
}
42+
}
6643

67-
interface ElementTagNameMap {
68-
'stop-watch-box': HTMLStopWatchBoxElement;
69-
'stop-watch': HTMLStopWatchElement;
44+
declare namespace LocalJSX {
45+
interface StopWatch extends JSXBase.HTMLAttributes<HTMLStopWatchElement> {
46+
'applyHover'?: boolean;
47+
'hours'?: string;
48+
'milliseconds'?: string;
49+
'minutes'?: string;
50+
'seconds'?: string;
51+
}
52+
interface StopWatchBox extends JSXBase.HTMLAttributes<HTMLStopWatchBoxElement> {
53+
'applyHover'?: boolean;
54+
}
55+
56+
interface IntrinsicElements {
57+
'stop-watch': StopWatch;
58+
'stop-watch-box': StopWatchBox;
7059
}
60+
}
61+
62+
export { LocalJSX as JSX };
7163

7264

65+
declare module "@stencil/core" {
7366
export namespace JSX {
74-
export interface Element {}
75-
export interface IntrinsicElements extends StencilIntrinsicElements {
76-
[tagName: string]: any;
77-
}
67+
interface IntrinsicElements extends LocalJSX.IntrinsicElements {}
7868
}
79-
export interface HTMLAttributes extends StencilHTMLAttributes {}
80-
8169
}
70+
71+

src/components/stop-watch-box/stop-watch-box.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, State, Prop } from "@stencil/core";
1+
import { h, Component, State, Prop } from "@stencil/core";
22
import { WatchService } from "../../services/watch-service";
33

44
@Component({

src/components/stop-watch/stop-watch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Prop } from "@stencil/core";
1+
import { h, Component, Prop } from "@stencil/core";
22

33
@Component({
44
tag: "stop-watch",

src/index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<!DOCTYPE html>
22
<html dir="ltr" lang="en">
3+
34
<head>
45
<meta charset="utf-8">
56
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
67
<title>Stencil Component Starter</title>
7-
<script src="/build/stopwatchbox.js"></script>
8+
<script type="module" src="/build/stopwatchbox.esm.js"></script>
9+
<script nomodule src="/build/stopwatchbox.js"></script>
810
<!-- <script src="https://unpkg.com/[email protected]/dist/stopwatchbox.js"></script> -->
911

1012
<style>
@@ -15,13 +17,15 @@
1517
</style>
1618

1719
</head>
20+
1821
<body>
1922

2023
<h2>Without hover effect</h2>
21-
<stop-watch-box ></stop-watch-box>
24+
<stop-watch-box></stop-watch-box>
2225

2326
<h2>With hover effect</h2>
2427
<stop-watch-box apply-hover="true"></stop-watch-box>
2528

2629
</body>
30+
2731
</html>

stencil.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const config: Config = {
44
namespace: 'stopwatchbox',
55
outputTargets: [
66
{ type: 'dist' },
7-
{ type: 'docs' },
7+
{ type: 'docs-readme' },
88
{
99
type: 'www',
1010
serviceWorker: null // disable service workers

www/build/stopwatchbox.js

Lines changed: 24 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

www/build/stopwatchbox/stopwatchbox.registry.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

www/index.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1-
<!DOCTYPE html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <script data-resources-url="/build/stopwatchbox/">!function(t,e,r,o,s,n,c,i,a,u,p,l,h,d){for(p=t.stopwatchbox=t.stopwatchbox||{},(l=e.createElement("style")).innerHTML=a+"{visibility:hidden}.hydrated{visibility:inherit}",l.setAttribute("data-styles",""),h=e.head.querySelector("meta[charset]"),e.head.insertBefore(l,h?h.nextSibling:e.head.firstChild),function(t,e,r){(t["s-apps"]=t["s-apps"]||[]).push("stopwatchbox"),r.componentOnReady||(r.componentOnReady=function(){var e=this;function r(r){if(e.nodeName.indexOf("-")>0){for(var o=t["s-apps"],s=0,n=0;n<o.length;n++)if(t[o[n]].componentOnReady){if(t[o[n]].componentOnReady(e,r))return;s++}if(s<o.length)return void(t["s-cr"]=t["s-cr"]||[]).push([e,r])}r(null)}return t.Promise?new t.Promise(r):{then:r}})}(t,0,u),s=s||p.resourcesUrl,l=(h=e.querySelectorAll("script")).length-1;l>=0&&!(d=h[l]).src&&!d.hasAttribute("data-resources-url");l--);h=d.getAttribute("data-resources-url"),!s&&h&&(s=h),!s&&d.src&&(s=(h=d.src.split("/").slice(0,-1)).join("/")+(h.length?"/":"")+"stopwatchbox/"),l=e.createElement("script"),function(t,e,r,o){return!(e.search.indexOf("core=esm")>0)&&(!(!(e.search.indexOf("core=es5")>0||"file:"===e.protocol)&&t.customElements&&t.customElements.define&&t.fetch&&t.CSS&&t.CSS.supports&&t.CSS.supports("color","var(--c)")&&"noModule"in r)||function(t){try{return new Function('import("")'),!1}catch(t){}return!0}())}(t,t.location,l)?l.src=s+"stopwatchbox.rxfoamy4.js":(l.src=s+"stopwatchbox.kz4ywcaa.js",l.setAttribute("type","module"),l.setAttribute("crossorigin",!0)),l.setAttribute("data-resources-url",s),l.setAttribute("data-namespace","stopwatchbox"),e.head.appendChild(l)}(window,document,0,0,0,0,0,0,"stop-watch,stop-watch-box",HTMLElement.prototype);</script> <!-- <script src="https://unpkg.com/[email protected]/dist/stopwatchbox.js"></script> --> <style>h2{text-align:center;margin:0}</style> </head>
2-
<body> <h2>Without hover effect</h2> <stop-watch-box></stop-watch-box> <h2>With hover effect</h2> <stop-watch-box apply-hover="true"></stop-watch-box> </body></html>
1+
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <script type="module" src="/build/stopwatchbox.esm.js"></script> <script nomodule="" src="/build/stopwatchbox.js"></script> <!-- <script src="https://unpkg.com/[email protected]/dist/stopwatchbox.js"></script> --> <style>
2+
h2 {
3+
text-align: center;
4+
margin: 0;
5+
}
6+
</style> </head> <body> <h2>Without hover effect</h2> <stop-watch-box></stop-watch-box> <h2>With hover effect</h2> <stop-watch-box apply-hover="true"></stop-watch-box> <script>
7+
if ('serviceWorker' in navigator && location.protocol !== 'file:') {
8+
// auto-unregister service worker during dev mode
9+
navigator.serviceWorker.getRegistration().then(function(registration) {
10+
if (registration) {
11+
registration.unregister().then(function() { location.reload(true) });
12+
}
13+
});
14+
}
15+
</script></body></html>

0 commit comments

Comments
 (0)