Skip to content

Commit 8934fef

Browse files
committed
Updated dependencies
1 parent 1a9e3ac commit 8934fef

14 files changed

+4871
-3263
lines changed

package-lock.json

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

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
"prepublish": "npm run build"
2020
},
2121
"dependencies": {
22-
"@stencil/core": "^0.6.1"
22+
"@stencil/core": "~0.8.0"
2323
},
2424
"devDependencies": {
25-
"@stencil/dev-server": "latest",
26-
"@stencil/utils": "latest",
27-
"@types/jest": "^21.1.1",
28-
"jest": "^21.2.1"
25+
"@stencil/dev-server": "0.0.18",
26+
"@stencil/utils": "0.0.4",
27+
"@types/jest": "22.2.3",
28+
"jest": "22.4.3"
2929
},
3030
"repository": {
3131
"type": "git",

src/components.d.ts

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,75 +4,95 @@
44
* and imports for stencil collections that might be configured in your stencil.config.js file
55
*/
66

7+
import '@stencil/core';
78

89
declare global {
10+
namespace JSX {
11+
interface Element {}
12+
export interface IntrinsicElements {}
13+
}
14+
namespace JSXElements {}
15+
916
interface HTMLStencilElement extends HTMLElement {
1017
componentOnReady(): Promise<this>;
1118
componentOnReady(done: (ele?: this) => void): void;
12-
}
13-
}
1419

20+
forceUpdate(): void;
21+
}
1522

23+
interface HTMLAttributes {}
24+
}
1625

17-
import {
18-
StopWatchBoxComponent as StopWatchBox
19-
} from './components/stop-watch-box/stop-watch-box';
2026

2127
declare global {
22-
interface HTMLStopWatchBoxElement extends StopWatchBox, HTMLStencilElement {
28+
29+
namespace StencilComponents {
30+
interface StopWatchBox {
31+
'applyHover': boolean;
32+
}
2333
}
34+
35+
interface HTMLStopWatchBoxElement extends StencilComponents.StopWatchBox, HTMLStencilElement {}
36+
2437
var HTMLStopWatchBoxElement: {
2538
prototype: HTMLStopWatchBoxElement;
2639
new (): HTMLStopWatchBoxElement;
2740
};
2841
interface HTMLElementTagNameMap {
29-
"stop-watch-box": HTMLStopWatchBoxElement;
42+
'stop-watch-box': HTMLStopWatchBoxElement;
3043
}
3144
interface ElementTagNameMap {
32-
"stop-watch-box": HTMLStopWatchBoxElement;
45+
'stop-watch-box': HTMLStopWatchBoxElement;
3346
}
3447
namespace JSX {
3548
interface IntrinsicElements {
36-
"stop-watch-box": JSXElements.StopWatchBoxAttributes;
49+
'stop-watch-box': JSXElements.StopWatchBoxAttributes;
3750
}
3851
}
3952
namespace JSXElements {
4053
export interface StopWatchBoxAttributes extends HTMLAttributes {
41-
applyHover?: boolean;
54+
'applyHover'?: boolean;
4255
}
4356
}
4457
}
4558

4659

47-
import {
48-
StopWatchComponent as StopWatch
49-
} from './components/stop-watch/stop-watch';
50-
5160
declare global {
52-
interface HTMLStopWatchElement extends StopWatch, HTMLStencilElement {
61+
62+
namespace StencilComponents {
63+
interface StopWatch {
64+
'applyHover': boolean;
65+
'hours': string;
66+
'milliseconds': string;
67+
'minutes': string;
68+
'seconds': string;
69+
}
5370
}
71+
72+
interface HTMLStopWatchElement extends StencilComponents.StopWatch, HTMLStencilElement {}
73+
5474
var HTMLStopWatchElement: {
5575
prototype: HTMLStopWatchElement;
5676
new (): HTMLStopWatchElement;
5777
};
5878
interface HTMLElementTagNameMap {
59-
"stop-watch": HTMLStopWatchElement;
79+
'stop-watch': HTMLStopWatchElement;
6080
}
6181
interface ElementTagNameMap {
62-
"stop-watch": HTMLStopWatchElement;
82+
'stop-watch': HTMLStopWatchElement;
6383
}
6484
namespace JSX {
6585
interface IntrinsicElements {
66-
"stop-watch": JSXElements.StopWatchAttributes;
86+
'stop-watch': JSXElements.StopWatchAttributes;
6787
}
6888
}
6989
namespace JSXElements {
7090
export interface StopWatchAttributes extends HTMLAttributes {
71-
applyHover?: boolean;
72-
hours?: string;
73-
milliseconds?: string;
74-
minutes?: string;
75-
seconds?: string;
91+
'applyHover'?: boolean;
92+
'hours'?: string;
93+
'milliseconds'?: string;
94+
'minutes'?: string;
95+
'seconds'?: string;
7696
}
7797
}
7898
}

www/build/stopwatchbox.js

Lines changed: 122 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,123 @@
11
/*! Built with http://stenciljs.com */
2-
!function(t,e,n,o,i,s,r,c,a,u,p){!function(t,e,n,o,i,s,r,c,a,u,p,h,l){(t.stopwatchbox=t.stopwatchbox||{}).components=p,(l=p.filter(function(t){return t[2]}).map(function(t){return t[0]})).length&&((h=e.createElement("style")).innerHTML=l.join()+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),e.head.insertBefore(h,e.head.firstChild)),(h=n[n.length-1])&&h.src&&(s=(l=h.src.split("/").slice(0,-1)).join("/")+(l.length?"/":"")+"stopwatchbox/"),(h=e.createElement("script")).src=s+(!function(t){return t.location.search.indexOf("core=es5")>-1}(t)&&function(t){return t.customElements}(t)&&function(t){if(!("noModule"in h))return!1;try{return new Function('import("")'),!0}catch(t){return!1}}()&&function(t){return t.fetch}(t)&&function(t){return t.CSS&&t.CSS.supports&&t.CSS.supports("color","var(--c)")}(t)?"stopwatchbox.5ac9z1fx.js":"stopwatchbox.6jj17ql2.js"),h.setAttribute("data-path",s),h.setAttribute("data-namespace","stopwatchbox"),e.head.appendChild(h)}(t,e,e.scripts,0,0,"/build/stopwatchbox/",0,0,0,0,[["stop-watch","mbcice7o",1,[["applyHover",1,"apply-hover",3],["hours",1,1,2],["milliseconds",1,1,2],["minutes",1,1,2],["seconds",1,1,2]]],["stop-watch-box","mbcice7o",1,[["applyHover",1,"apply-hover",3],["hours",5],["isTimerRunning",5],["milliseconds",5],["minutes",5],["seconds",5]]]],void 0)}(window,document);
2+
(function(win, doc, namespace, fsNamespace, resourcesUrl, appCore, appCoreSsr, appCorePolyfilled, hydratedCssClass, components) {
3+
4+
function init(win, doc, namespace, fsNamespace, resourcesUrl, appCore, appCorePolyfilled, hydratedCssClass, components, HTMLElementPrototype, App, x, y, scriptElm, orgComponentOnReady) {
5+
// create global namespace if it doesn't already exist
6+
App = win[namespace] = win[namespace] || {};
7+
App.components = components;
8+
y = components.filter(function (c) { return c[2]; }).map(function (c) { return c[0]; });
9+
if (y.length) {
10+
// auto hide components until they been fully hydrated
11+
// reusing the "x" and "i" variables from the args for funzies
12+
x = doc.createElement('style');
13+
x.innerHTML = y.join() + '{visibility:hidden}.' + hydratedCssClass + '{visibility:inherit}';
14+
x.setAttribute('data-styles', '');
15+
doc.head.insertBefore(x, doc.head.firstChild);
16+
}
17+
// create a temporary array to store the resolves
18+
// before the core file has fully loaded
19+
App.$r = [];
20+
// add componentOnReady to HTMLElement.prototype
21+
orgComponentOnReady = HTMLElementPrototype.componentOnReady;
22+
HTMLElementPrototype.componentOnReady = function componentOnReady(cb) {
23+
const elm = this;
24+
// there may be more than one app on the window so
25+
// call original HTMLElement.prototype.componentOnReady
26+
// if one exists already
27+
orgComponentOnReady && orgComponentOnReady.call(elm);
28+
function executor(resolve) {
29+
if (App.$r) {
30+
// core file hasn't loaded yet
31+
// so let's throw it in this temporary queue
32+
// and when the core does load it'll handle these
33+
App.$r.push([elm, resolve]);
34+
}
35+
else {
36+
// core has finished loading because there's no temporary queue
37+
// call the core's logic to handle this
38+
App.componentOnReady(elm, resolve);
39+
}
40+
}
41+
if (cb) {
42+
// just a callback
43+
return executor(cb);
44+
}
45+
// callback wasn't provided, let's return a promise
46+
if (win.Promise) {
47+
// use native/polyfilled promise
48+
return new Promise(executor);
49+
}
50+
// promise may not have been polyfilled yet
51+
return { then: executor };
52+
};
53+
// figure out the script element for this current script
54+
y = doc.querySelectorAll('script');
55+
for (x = y.length - 1; x >= 0; x--) {
56+
scriptElm = y[x];
57+
if (scriptElm.src || scriptElm.hasAttribute('data-resources-url')) {
58+
break;
59+
}
60+
}
61+
// get the resource path attribute on this script element
62+
y = scriptElm.getAttribute('data-resources-url');
63+
if (y) {
64+
// the script element has a data-resources-url attribute, always use that
65+
resourcesUrl = y;
66+
}
67+
if (!resourcesUrl && scriptElm.src) {
68+
// we don't have an exact resourcesUrl, so let's
69+
// figure it out relative to this script's src and app's filesystem namespace
70+
y = scriptElm.src.split('/').slice(0, -1);
71+
resourcesUrl = (y.join('/')) + (y.length ? '/' : '') + fsNamespace + '/';
72+
}
73+
// request the core this browser needs
74+
// test for native support of custom elements and fetch
75+
// if either of those are not supported, then use the core w/ polyfills
76+
// also check if the page was build with ssr or not
77+
x = doc.createElement('script');
78+
if (usePolyfills(win, win.location, x, 'import("")')) {
79+
// requires the es5/polyfilled core
80+
x.src = resourcesUrl + appCorePolyfilled;
81+
}
82+
else {
83+
// let's do this!
84+
x.src = resourcesUrl + appCore;
85+
x.setAttribute('type', 'module');
86+
x.setAttribute('crossorigin', true);
87+
}
88+
x.setAttribute('data-resources-url', resourcesUrl);
89+
x.setAttribute('data-namespace', fsNamespace);
90+
doc.head.appendChild(x);
91+
}
92+
function usePolyfills(win, location, scriptElm, dynamicImportTest) {
93+
// fyi, dev mode has verbose if/return statements
94+
// but it minifies to a nice 'lil one-liner ;)
95+
if (location.search.indexOf('core=esm') > 0) {
96+
// force esm build
97+
return false;
98+
}
99+
if ((location.search.indexOf('core=es5') > 0) ||
100+
(location.protocol === 'file:') ||
101+
(!(win.customElements && win.customElements.define)) ||
102+
(!win.fetch) ||
103+
(!(win.CSS && win.CSS.supports && win.CSS.supports('color', 'var(--c)'))) ||
104+
(!('noModule' in scriptElm))) {
105+
// es5 build w/ polyfills
106+
return true;
107+
}
108+
// final test to see if this browser support dynamic imports
109+
return doesNotSupportsDynamicImports(dynamicImportTest);
110+
}
111+
function doesNotSupportsDynamicImports(dynamicImportTest) {
112+
try {
113+
new Function(dynamicImportTest);
114+
return false;
115+
}
116+
catch (e) { }
117+
return true;
118+
}
119+
120+
121+
init(win, doc, namespace, fsNamespace, resourcesUrl, appCore, appCoreSsr, appCorePolyfilled, hydratedCssClass, components);
122+
123+
})(window, document, "stopwatchbox","stopwatchbox",0,"stopwatchbox.core.js","es5-build-disabled.js","hydrated",[["stop-watch","stop-watch",1,[["applyHover",1,0,"apply-hover",3],["hours",1,0,1,2],["milliseconds",1,0,1,2],["minutes",1,0,1,2],["seconds",1,0,1,2]]],["stop-watch-box","stop-watch",1,[["applyHover",1,0,"apply-hover",3],["hours",5],["isTimerRunning",5],["milliseconds",5],["minutes",5],["seconds",5]]]],HTMLElement.prototype);

www/build/stopwatchbox/es5-build-disabled.js

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

www/build/stopwatchbox/mbcice7o.es5.js

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

0 commit comments

Comments
 (0)