@stencil/core 3.0.0-alpha.1 → 3.0.0-beta.0
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/cli/config-flags.d.ts +16 -16
- package/cli/index.cjs +5 -4
- package/cli/index.js +5 -4
- package/cli/package.json +1 -1
- package/compiler/lib.dom.d.ts +308 -70
- package/compiler/lib.dom.iterable.d.ts +6 -2
- package/compiler/lib.es2015.promise.d.ts +9 -4
- package/compiler/lib.es2015.proxy.d.ts +1 -1
- package/compiler/lib.es2015.reflect.d.ts +25 -2
- package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
- package/compiler/lib.es2019.d.ts +1 -0
- package/compiler/lib.es2019.intl.d.ts +25 -0
- package/compiler/lib.es2020.intl.d.ts +1 -1
- package/compiler/lib.es5.d.ts +26 -13
- package/compiler/lib.webworker.d.ts +266 -30
- package/compiler/lib.webworker.iterable.d.ts +10 -2
- package/compiler/package.json +1 -1
- package/compiler/stencil.d.ts +1 -23
- package/compiler/stencil.js +1413 -323
- package/compiler/stencil.min.js +2 -2
- package/compiler/sys/in-memory-fs.d.ts +3 -3
- package/compiler/transpile.d.ts +32 -0
- package/dependencies.json +2 -1
- package/dev-server/client/app-error.d.ts +1 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/open-in-editor-api.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/index.cjs +4 -0
- package/internal/app-data/index.js +4 -0
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +2 -2
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +20 -3
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +15 -2
- package/internal/client/patch-esm.js +3 -1
- package/internal/client/polyfills/css-shim.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +2 -2
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +4 -4
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +37 -37
- package/internal/stencil-public-compiler.d.ts +43 -35
- package/internal/stencil-public-runtime.d.ts +3 -3
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.d.ts +2 -2
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +8 -8
- package/screenshot/package.json +1 -1
- package/sys/node/autoprefixer.js +1 -1
- package/sys/node/glob.js +1 -1
- package/sys/node/index.js +29 -42
- package/sys/node/package.json +1 -1
- package/sys/node/prompts.js +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +19 -13
- package/testing/jest/jest-preprocessor.d.ts +3 -3
- package/testing/package.json +1 -1
- package/testing/puppeteer/puppeteer-declarations.d.ts +4 -4
- package/testing/testing-utils.d.ts +1 -1
package/internal/client/index.js
CHANGED
|
@@ -19,7 +19,7 @@ let renderingRef = null;
|
|
|
19
19
|
let queueCongestion = 0;
|
|
20
20
|
let queuePending = false;
|
|
21
21
|
/*
|
|
22
|
-
Stencil Client Platform v3.0.0-
|
|
22
|
+
Stencil Client Platform v3.0.0-beta.0 | MIT Licensed | https://stenciljs.com
|
|
23
23
|
*/
|
|
24
24
|
import { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';
|
|
25
25
|
const Build = {
|
|
@@ -636,8 +636,12 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
636
636
|
styleElm.innerHTML = style;
|
|
637
637
|
}
|
|
638
638
|
else {
|
|
639
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
639
640
|
if (BUILD.cssVarShim && plt.$cssShim$) {
|
|
640
|
-
|
|
641
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
642
|
+
styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style,
|
|
643
|
+
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
644
|
+
!!(cmpMeta.$flags$ & 10 /* CMP_FLAGS.needsScopedEncapsulation */));
|
|
641
645
|
const newScopeId = styleElm['s-sc'];
|
|
642
646
|
if (newScopeId) {
|
|
643
647
|
scopeId = newScopeId;
|
|
@@ -673,6 +677,7 @@ const attachStyles = (hostRef) => {
|
|
|
673
677
|
const flags = cmpMeta.$flags$;
|
|
674
678
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
675
679
|
const scopeId = addStyle(BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm);
|
|
680
|
+
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
676
681
|
if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
677
682
|
// only required when we're NOT using native shadow dom (slot)
|
|
678
683
|
// or this browser doesn't support native shadow dom
|
|
@@ -1720,7 +1725,9 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1720
1725
|
else {
|
|
1721
1726
|
callRender(hostRef, instance, elm);
|
|
1722
1727
|
}
|
|
1728
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
1723
1729
|
if (BUILD.cssVarShim && plt.$cssShim$) {
|
|
1730
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
1724
1731
|
plt.$cssShim$.updateHost(elm);
|
|
1725
1732
|
}
|
|
1726
1733
|
if (BUILD.isDev) {
|
|
@@ -2228,6 +2235,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
2228
2235
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
2229
2236
|
if (!BUILD.hydrateServerSide &&
|
|
2230
2237
|
BUILD.shadowDom &&
|
|
2238
|
+
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
2231
2239
|
BUILD.shadowDomShim &&
|
|
2232
2240
|
cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
|
|
2233
2241
|
style = await import('./shadow-css.js').then((m) => m.scopeCss(style, scopeId, false));
|
|
@@ -2290,6 +2298,7 @@ const connectedCallback = (elm) => {
|
|
|
2290
2298
|
// host element has been connected to the DOM
|
|
2291
2299
|
if (BUILD.hydrateServerSide ||
|
|
2292
2300
|
((BUILD.slot || BUILD.shadowDom) &&
|
|
2301
|
+
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
2293
2302
|
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
2294
2303
|
setContentReference(elm);
|
|
2295
2304
|
}
|
|
@@ -2368,7 +2377,9 @@ const disconnectedCallback = (elm) => {
|
|
|
2368
2377
|
}
|
|
2369
2378
|
}
|
|
2370
2379
|
// clear CSS var-shim tracking
|
|
2380
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
2371
2381
|
if (BUILD.cssVarShim && plt.$cssShim$) {
|
|
2382
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
2372
2383
|
plt.$cssShim$.removeHost(elm);
|
|
2373
2384
|
}
|
|
2374
2385
|
if (BUILD.lazyLoad && BUILD.disconnectedCallback) {
|
|
@@ -2400,6 +2411,7 @@ const proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2400
2411
|
cmpMeta.$attrsToReflect$ = [];
|
|
2401
2412
|
}
|
|
2402
2413
|
if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2414
|
+
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
2403
2415
|
cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
|
|
2404
2416
|
}
|
|
2405
2417
|
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
@@ -2580,6 +2592,7 @@ const patchChildSlotNodes = (elm, cmpMeta) => {
|
|
|
2580
2592
|
return this[n];
|
|
2581
2593
|
}
|
|
2582
2594
|
}
|
|
2595
|
+
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
2583
2596
|
if (cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
|
|
2584
2597
|
const childNodesFn = elm.__lookupGetter__('childNodes');
|
|
2585
2598
|
Object.defineProperty(elm, 'children', {
|
|
@@ -2712,6 +2725,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2712
2725
|
cmpMeta.$watchers$ = {};
|
|
2713
2726
|
}
|
|
2714
2727
|
if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2728
|
+
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
2715
2729
|
cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
|
|
2716
2730
|
}
|
|
2717
2731
|
const tagName = BUILD.transformTagName && options.transformTagName
|
|
@@ -3132,6 +3146,7 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
3132
3146
|
const styles = /*@__PURE__*/ new Map();
|
|
3133
3147
|
const modeResolutionChain = [];
|
|
3134
3148
|
const win = typeof window !== 'undefined' ? window : {};
|
|
3149
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
3135
3150
|
const CSS = BUILD.cssVarShim ? win.CSS : null;
|
|
3136
3151
|
const doc = win.document || { head: {} };
|
|
3137
3152
|
const H = (win.HTMLElement || class {
|
|
@@ -3148,7 +3163,9 @@ const plt = {
|
|
|
3148
3163
|
const setPlatformHelpers = (helpers) => {
|
|
3149
3164
|
Object.assign(plt, helpers);
|
|
3150
3165
|
};
|
|
3151
|
-
const supportsShadow =
|
|
3166
|
+
const supportsShadow =
|
|
3167
|
+
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
3168
|
+
BUILD.shadowDomShim && BUILD.shadowDom
|
|
3152
3169
|
? /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
|
|
3153
3170
|
: true;
|
|
3154
3171
|
const supportsListenerOptions = /*@__PURE__*/ (() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/client",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-beta.0",
|
|
4
4
|
"description": "Stencil internal client platform to be imported by the Stencil Compiler and internal runtime. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true,
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Client Patch Browser v3.0.0-
|
|
2
|
+
Stencil Client Patch Browser v3.0.0-beta.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
import { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';
|
|
5
5
|
import { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';
|
|
6
|
+
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
|
6
7
|
const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
|
|
7
8
|
const patchBrowser = () => {
|
|
8
9
|
// NOTE!! This fn cannot use async/await!
|
|
9
10
|
if (BUILD.isDev && !BUILD.isTesting) {
|
|
10
11
|
consoleDevInfo('Running in development mode.');
|
|
11
12
|
}
|
|
13
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
12
14
|
if (BUILD.cssVarShim) {
|
|
13
15
|
// shim css vars
|
|
16
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
14
17
|
plt.$cssShim$ = win.__cssshim;
|
|
15
18
|
}
|
|
16
19
|
if (BUILD.cloneNodeFix) {
|
|
@@ -29,12 +32,16 @@ const patchBrowser = () => {
|
|
|
29
32
|
performance.getEntriesByName = () => [];
|
|
30
33
|
}
|
|
31
34
|
// @ts-ignore
|
|
32
|
-
const scriptElm =
|
|
35
|
+
const scriptElm =
|
|
36
|
+
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
|
37
|
+
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
|
38
|
+
BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim
|
|
33
39
|
? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\/${NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) ||
|
|
34
40
|
s.getAttribute('data-stencil-namespace') === NAMESPACE)
|
|
35
41
|
: null;
|
|
36
42
|
const importMeta = import.meta.url;
|
|
37
43
|
const opts = BUILD.scriptDataOpts ? scriptElm['data-opts'] || {} : {};
|
|
44
|
+
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
|
38
45
|
if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {
|
|
39
46
|
// Safari < v11 support: This IF is true if it's Safari below v11.
|
|
40
47
|
// This fn cannot use async/await since Safari didn't support it until v11,
|
|
@@ -49,14 +56,19 @@ const patchBrowser = () => {
|
|
|
49
56
|
},
|
|
50
57
|
};
|
|
51
58
|
}
|
|
59
|
+
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
|
52
60
|
if (!BUILD.safari10 && importMeta !== '') {
|
|
53
61
|
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
62
|
+
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
|
63
|
+
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
|
54
64
|
}
|
|
55
65
|
else if (BUILD.dynamicImportShim || BUILD.safari10) {
|
|
56
66
|
opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;
|
|
67
|
+
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
|
57
68
|
if (BUILD.dynamicImportShim) {
|
|
58
69
|
patchDynamicImport(opts.resourcesUrl, scriptElm);
|
|
59
70
|
}
|
|
71
|
+
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
|
60
72
|
if (BUILD.dynamicImportShim && !win.customElements) {
|
|
61
73
|
// module support, but no custom elements support (Old Edge)
|
|
62
74
|
// @ts-ignore
|
|
@@ -65,6 +77,7 @@ const patchBrowser = () => {
|
|
|
65
77
|
}
|
|
66
78
|
return promiseResolve(opts);
|
|
67
79
|
};
|
|
80
|
+
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
|
68
81
|
const patchDynamicImport = (base, orgScriptElm) => {
|
|
69
82
|
const importFunctionName = getDynamicImportFunction(NAMESPACE);
|
|
70
83
|
try {
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Client Patch Esm v3.0.0-
|
|
2
|
+
Stencil Client Patch Esm v3.0.0-beta.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
import { BUILD } from '@stencil/core/internal/app-data';
|
|
5
5
|
import { CSS, plt, win, promiseResolve } from '@stencil/core';
|
|
6
6
|
const patchEsm = () => {
|
|
7
7
|
// NOTE!! This fn cannot use async/await!
|
|
8
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
8
9
|
// @ts-ignore
|
|
9
10
|
if (BUILD.cssVarShim && !(CSS && CSS.supports && CSS.supports('color', 'var(--c)'))) {
|
|
10
11
|
// @ts-ignore
|
|
11
12
|
return import(/* webpackChunkName: "polyfills-css-shim" */ './css-shim.js').then(() => {
|
|
12
13
|
if ((plt.$cssShim$ = win.__cssshim)) {
|
|
14
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
13
15
|
return plt.$cssShim$.i();
|
|
14
16
|
}
|
|
15
17
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
|
|
1
|
+
var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},__assign.apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
|
|
@@ -116,8 +116,8 @@ function hydrateApp(e, t, o, n, s) {
|
|
|
116
116
|
const t = Array.from(i).filter((e => e.parentElement));
|
|
117
117
|
return t.length > 0 ? Promise.all(t.map(g)).then(e) : m;
|
|
118
118
|
}().then(l).catch(a);
|
|
119
|
-
} catch (
|
|
120
|
-
a(
|
|
119
|
+
} catch (y) {
|
|
120
|
+
a(y);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/hydrate",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-beta.0",
|
|
4
4
|
"description": "Stencil internal hydrate platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|
|
@@ -442,12 +442,12 @@ const templateWindows = new Map, isPromise = e => !!e && ("object" == typeof e |
|
|
|
442
442
|
}, d = () => {
|
|
443
443
|
let t;
|
|
444
444
|
const r = [];
|
|
445
|
-
for (m(), h(r); e.length && "}" !== e.charAt(0) && (t = w() || A()); )
|
|
446
|
-
h(r)
|
|
445
|
+
for (m(), h(r); e.length && "}" !== e.charAt(0) && (t = w() || A()); ) r.push(t),
|
|
446
|
+
h(r);
|
|
447
447
|
return r;
|
|
448
448
|
}, m = () => u(/^\s*/), h = e => {
|
|
449
449
|
let t;
|
|
450
|
-
for (e = e || []; t = p(); )
|
|
450
|
+
for (e = e || []; t = p(); ) e.push(t);
|
|
451
451
|
return e;
|
|
452
452
|
}, p = () => {
|
|
453
453
|
const t = i();
|
|
@@ -482,7 +482,7 @@ const templateWindows = new Map, isPromise = e => !!e && ("object" == typeof e |
|
|
|
482
482
|
const e = [];
|
|
483
483
|
if (!l()) return a("missing '{'");
|
|
484
484
|
let t;
|
|
485
|
-
for (h(e); t = g(); )
|
|
485
|
+
for (h(e); t = g(); ) e.push(t), h(e);
|
|
486
486
|
return c() ? e : a("missing '}'");
|
|
487
487
|
}, C = () => {
|
|
488
488
|
let e;
|
package/internal/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-beta.0",
|
|
4
4
|
"description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -132,7 +132,7 @@ export interface BuildConditionals extends Partial<BuildFeatures> {
|
|
|
132
132
|
transformTagName?: boolean;
|
|
133
133
|
attachStyles?: boolean;
|
|
134
134
|
}
|
|
135
|
-
export
|
|
135
|
+
export type ModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd' | 'commonjs' | 'esm' | 'module' | 'systemjs';
|
|
136
136
|
export interface RollupResultModule {
|
|
137
137
|
id: string;
|
|
138
138
|
}
|
|
@@ -211,8 +211,8 @@ export interface BuildStyleUpdate {
|
|
|
211
211
|
styleText: string;
|
|
212
212
|
styleMode: string;
|
|
213
213
|
}
|
|
214
|
-
export
|
|
215
|
-
export
|
|
214
|
+
export type BuildTask = any;
|
|
215
|
+
export type BuildStatus = 'pending' | 'error' | 'disabled' | 'default';
|
|
216
216
|
export interface CompilerBuildStats {
|
|
217
217
|
timestamp: string;
|
|
218
218
|
compiler: {
|
|
@@ -303,7 +303,7 @@ export interface BundleOutputChunk {
|
|
|
303
303
|
};
|
|
304
304
|
name: string;
|
|
305
305
|
}
|
|
306
|
-
export
|
|
306
|
+
export type SourceTarget = 'es5' | 'es2017' | 'latest';
|
|
307
307
|
export interface BundleEntryInputs {
|
|
308
308
|
[entryKey: string]: string;
|
|
309
309
|
}
|
|
@@ -313,7 +313,7 @@ export interface BundleEntryInputs {
|
|
|
313
313
|
* Stencil source. As a result, some types are duplicated here for Rollup that will be used within the codebase.
|
|
314
314
|
* Updates to rollup may require these typings to be updated.
|
|
315
315
|
*/
|
|
316
|
-
export
|
|
316
|
+
export type RollupResult = RollupChunkResult | RollupAssetResult;
|
|
317
317
|
export interface RollupAssetResult {
|
|
318
318
|
type: 'asset';
|
|
319
319
|
fileName: string;
|
|
@@ -346,7 +346,7 @@ export interface RollupSourceMap {
|
|
|
346
346
|
/**
|
|
347
347
|
* Result of Stencil compressing, mangling, and otherwise 'minifying' JavaScript
|
|
348
348
|
*/
|
|
349
|
-
export
|
|
349
|
+
export type OptimizeJsResult = {
|
|
350
350
|
output: string;
|
|
351
351
|
diagnostics: Diagnostic[];
|
|
352
352
|
sourceMap?: SourceMap;
|
|
@@ -399,7 +399,7 @@ export interface CollectionManifest {
|
|
|
399
399
|
compiler?: CollectionCompilerVersion;
|
|
400
400
|
bundles?: CollectionBundleManifest[];
|
|
401
401
|
}
|
|
402
|
-
export
|
|
402
|
+
export type CollectionComponentEntryPath = string;
|
|
403
403
|
export interface CollectionBundleManifest {
|
|
404
404
|
components: string[];
|
|
405
405
|
}
|
|
@@ -549,8 +549,8 @@ export interface BuildOutputFile {
|
|
|
549
549
|
name: string;
|
|
550
550
|
content: string;
|
|
551
551
|
}
|
|
552
|
-
export
|
|
553
|
-
export
|
|
552
|
+
export type OnCallback = (buildStart: CompilerBuildStart) => void;
|
|
553
|
+
export type RemoveCallback = () => boolean;
|
|
554
554
|
export interface CompilerCtx {
|
|
555
555
|
version: number;
|
|
556
556
|
activeBuildId: number;
|
|
@@ -584,7 +584,7 @@ export interface CompilerCtx {
|
|
|
584
584
|
rollupCache: Map<string, any>;
|
|
585
585
|
reset(): void;
|
|
586
586
|
}
|
|
587
|
-
export
|
|
587
|
+
export type NodeMap = WeakMap<any, ComponentCompilerMeta>;
|
|
588
588
|
/** Must be serializable to JSON!! */
|
|
589
589
|
export interface ComponentCompilerFeatures {
|
|
590
590
|
hasAttribute: boolean;
|
|
@@ -681,7 +681,7 @@ export interface ComponentCompilerLegacyContext {
|
|
|
681
681
|
name: string;
|
|
682
682
|
context: string;
|
|
683
683
|
}
|
|
684
|
-
export
|
|
684
|
+
export type Encapsulation = 'shadow' | 'scoped' | 'none';
|
|
685
685
|
/**
|
|
686
686
|
* Intermediate Representation (IR) of a static property on a Stencil component
|
|
687
687
|
*/
|
|
@@ -708,7 +708,7 @@ export interface ComponentCompilerVirtualProperty {
|
|
|
708
708
|
type: string;
|
|
709
709
|
docs: string;
|
|
710
710
|
}
|
|
711
|
-
export
|
|
711
|
+
export type ComponentCompilerPropertyType = 'any' | 'string' | 'boolean' | 'number' | 'unknown';
|
|
712
712
|
export interface ComponentCompilerPropertyComplexType {
|
|
713
713
|
original: string;
|
|
714
714
|
resolved: string;
|
|
@@ -722,7 +722,7 @@ export interface ComponentCompilerPropertyComplexType {
|
|
|
722
722
|
*
|
|
723
723
|
* Note any key can be a user defined type or a TypeScript standard type.
|
|
724
724
|
*/
|
|
725
|
-
export
|
|
725
|
+
export type ComponentCompilerTypeReferences = Record<string, ComponentCompilerTypeReference>;
|
|
726
726
|
/**
|
|
727
727
|
* Describes a reference to a type used by a component.
|
|
728
728
|
*/
|
|
@@ -862,7 +862,7 @@ export interface ComponentTestingConstructor extends ComponentConstructor {
|
|
|
862
862
|
export interface ComponentNativeConstructor extends ComponentConstructor {
|
|
863
863
|
cmpMeta: ComponentRuntimeMeta;
|
|
864
864
|
}
|
|
865
|
-
export
|
|
865
|
+
export type ComponentConstructorEncapsulation = 'shadow' | 'scoped' | 'none';
|
|
866
866
|
export interface ComponentConstructorProperties {
|
|
867
867
|
[propName: string]: ComponentConstructorProperty;
|
|
868
868
|
}
|
|
@@ -876,7 +876,7 @@ export interface ComponentConstructorProperty {
|
|
|
876
876
|
type?: ComponentConstructorPropertyType;
|
|
877
877
|
watchCallbacks?: string[];
|
|
878
878
|
}
|
|
879
|
-
export
|
|
879
|
+
export type ComponentConstructorPropertyType = StringConstructor | BooleanConstructor | NumberConstructor | 'string' | 'boolean' | 'number';
|
|
880
880
|
export interface ComponentConstructorEvent {
|
|
881
881
|
name: string;
|
|
882
882
|
method: string;
|
|
@@ -961,7 +961,7 @@ export interface DevServerMessage {
|
|
|
961
961
|
status: number;
|
|
962
962
|
};
|
|
963
963
|
}
|
|
964
|
-
export
|
|
964
|
+
export type DevServerSendMessage = (msg: DevServerMessage) => void;
|
|
965
965
|
export interface DevServerContext {
|
|
966
966
|
connectorHtml: string;
|
|
967
967
|
dirTemplate: string;
|
|
@@ -975,7 +975,7 @@ export interface DevServerContext {
|
|
|
975
975
|
serve500: (req: any, res: any, error: any, xSource: string) => void;
|
|
976
976
|
sys: CompilerSystem;
|
|
977
977
|
}
|
|
978
|
-
export
|
|
978
|
+
export type InitServerProcess = (sendMsg: (msg: DevServerMessage) => void) => (msg: DevServerMessage) => void;
|
|
979
979
|
export interface DevResponseHeaders {
|
|
980
980
|
'cache-control'?: string;
|
|
981
981
|
expires?: string;
|
|
@@ -1155,7 +1155,7 @@ export interface MinifyJsResult {
|
|
|
1155
1155
|
pos: number;
|
|
1156
1156
|
};
|
|
1157
1157
|
}
|
|
1158
|
-
export
|
|
1158
|
+
export type ModuleMap = Map<string, Module>;
|
|
1159
1159
|
/**
|
|
1160
1160
|
* Stencil's Intermediate Representation (IR) of a module, bundling together
|
|
1161
1161
|
* various pieces of information like the classes declared within it, the path
|
|
@@ -1320,13 +1320,13 @@ export interface RenderNode extends HostElement {
|
|
|
1320
1320
|
*/
|
|
1321
1321
|
['s-en']?: '' | /*shadow*/ 'c';
|
|
1322
1322
|
}
|
|
1323
|
-
export
|
|
1324
|
-
export
|
|
1323
|
+
export type LazyBundlesRuntimeData = LazyBundleRuntimeData[];
|
|
1324
|
+
export type LazyBundleRuntimeData = [
|
|
1325
1325
|
/** bundleIds */
|
|
1326
1326
|
string,
|
|
1327
1327
|
ComponentRuntimeMetaCompact[]
|
|
1328
1328
|
];
|
|
1329
|
-
export
|
|
1329
|
+
export type ComponentRuntimeMetaCompact = [
|
|
1330
1330
|
/** flags */
|
|
1331
1331
|
number,
|
|
1332
1332
|
/** tagname */
|
|
@@ -1392,7 +1392,7 @@ export interface ComponentRuntimeMembers {
|
|
|
1392
1392
|
* this is intended to store are documented in the {@link MEMBER_FLAGS} enum.
|
|
1393
1393
|
* 2. The attribute name to observe.
|
|
1394
1394
|
*/
|
|
1395
|
-
export
|
|
1395
|
+
export type ComponentRuntimeMember = [number, string?];
|
|
1396
1396
|
/**
|
|
1397
1397
|
* A tuple holding information about a host listener which is relevant at
|
|
1398
1398
|
* runtime. The field are:
|
|
@@ -1402,7 +1402,7 @@ export declare type ComponentRuntimeMember = [number, string?];
|
|
|
1402
1402
|
* 2. The event name.
|
|
1403
1403
|
* 3. The method name.
|
|
1404
1404
|
*/
|
|
1405
|
-
export
|
|
1405
|
+
export type ComponentRuntimeHostListener = [number, string, string];
|
|
1406
1406
|
/**
|
|
1407
1407
|
* A tuple containing information about props which are "reflected" at runtime,
|
|
1408
1408
|
* meaning that HTML attributes on the component instance are kept in sync with
|
|
@@ -1413,12 +1413,12 @@ export declare type ComponentRuntimeHostListener = [number, string, string];
|
|
|
1413
1413
|
* 1. the prop name
|
|
1414
1414
|
* 2. the prop attribute.
|
|
1415
1415
|
*/
|
|
1416
|
-
export
|
|
1417
|
-
export
|
|
1416
|
+
export type ComponentRuntimeReflectingAttr = [string, string | undefined];
|
|
1417
|
+
export type ModeBundleId = ModeBundleIds | string;
|
|
1418
1418
|
export interface ModeBundleIds {
|
|
1419
1419
|
[modeName: string]: string;
|
|
1420
1420
|
}
|
|
1421
|
-
export
|
|
1421
|
+
export type RuntimeRef = HostElement | {};
|
|
1422
1422
|
/**
|
|
1423
1423
|
* Interface used to track an Element, it's virtual Node (`VNode`), and other data
|
|
1424
1424
|
*/
|
|
@@ -1451,11 +1451,11 @@ export interface PlatformRuntime {
|
|
|
1451
1451
|
rel: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
1452
1452
|
ce: (eventName: string, opts?: any) => CustomEvent;
|
|
1453
1453
|
}
|
|
1454
|
-
export
|
|
1455
|
-
export
|
|
1456
|
-
export
|
|
1457
|
-
export
|
|
1458
|
-
export
|
|
1454
|
+
export type RefMap = WeakMap<any, HostRef>;
|
|
1455
|
+
export type StyleMap = Map<string, CSSStyleSheet | string>;
|
|
1456
|
+
export type RootAppliedStyleMap = WeakMap<Element, Set<string>>;
|
|
1457
|
+
export type AppliedStyleMap = Set<string>;
|
|
1458
|
+
export type ActivelyProcessingCmpMap = Set<Element>;
|
|
1459
1459
|
export interface ScreenshotConnector {
|
|
1460
1460
|
initBuild(opts: ScreenshotConnectorOptions): Promise<void>;
|
|
1461
1461
|
completeBuild(masterBuild: ScreenshotBuild): Promise<ScreenshotBuildResults>;
|
|
@@ -2107,7 +2107,7 @@ export interface TypesModule {
|
|
|
2107
2107
|
jsx: string;
|
|
2108
2108
|
element: string;
|
|
2109
2109
|
}
|
|
2110
|
-
export
|
|
2110
|
+
export type TypeInfo = {
|
|
2111
2111
|
name: string;
|
|
2112
2112
|
type: string;
|
|
2113
2113
|
optional: boolean;
|
|
@@ -2125,8 +2125,8 @@ export interface Hyperscript {
|
|
|
2125
2125
|
(sel: any, data: VNodeData, children: Array<VNode | undefined | null>): VNode;
|
|
2126
2126
|
(sel: any, data: VNodeData, children: VNode): VNode;
|
|
2127
2127
|
}
|
|
2128
|
-
export
|
|
2129
|
-
export
|
|
2128
|
+
export type ChildType = VNode | number | string;
|
|
2129
|
+
export type PropsType = VNodeProdData | number | string | null;
|
|
2130
2130
|
export interface VNodeProdData {
|
|
2131
2131
|
key?: string | number;
|
|
2132
2132
|
class?: {
|
|
@@ -2164,7 +2164,7 @@ export interface CompilerWorkerTask {
|
|
|
2164
2164
|
reject: (msg: string) => any;
|
|
2165
2165
|
retries?: number;
|
|
2166
2166
|
}
|
|
2167
|
-
export
|
|
2167
|
+
export type WorkerMsgHandler = (msgToWorker: MsgToWorker) => Promise<any>;
|
|
2168
2168
|
export interface WorkerTask {
|
|
2169
2169
|
taskId: number;
|
|
2170
2170
|
method: string;
|
|
@@ -2183,7 +2183,7 @@ export interface WorkerMessage {
|
|
|
2183
2183
|
error?: string;
|
|
2184
2184
|
exit?: boolean;
|
|
2185
2185
|
}
|
|
2186
|
-
export
|
|
2186
|
+
export type WorkerRunner = (methodName: string, args: any[]) => Promise<any>;
|
|
2187
2187
|
export interface WorkerRunnerOptions {
|
|
2188
2188
|
isLongRunningTask?: boolean;
|
|
2189
2189
|
workerKey?: string;
|
|
@@ -2217,7 +2217,7 @@ export interface TerminalInfo {
|
|
|
2217
2217
|
/**
|
|
2218
2218
|
* The task to run in order to collect the duration data point.
|
|
2219
2219
|
*/
|
|
2220
|
-
export
|
|
2220
|
+
export type TelemetryCallback = (...args: any[]) => void | Promise<void>;
|
|
2221
2221
|
/**
|
|
2222
2222
|
* The model for the data that's tracked.
|
|
2223
2223
|
*/
|