@stencil/core 3.0.0-beta.1 → 3.0.0-rc.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/index.cjs +2 -2
- package/cli/index.js +2 -2
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +25 -6
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +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/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +1 -1
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +33 -2
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +19 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +46 -35
- package/internal/hydrate/package.json +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-core/index.d.ts +1 -0
- package/internal/stencil-private.d.ts +10 -0
- package/internal/stencil-public-runtime.d.ts +9 -0
- package/internal/testing/index.js +51 -39
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +4 -4
- package/screenshot/package.json +1 -1
- package/sys/node/index.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +35 -34
- package/testing/package.json +1 -1
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
function queryNonceMetaTagContent(e) {
|
|
2
|
+
var t, o, n;
|
|
3
|
+
return null !== (n = null === (o = null === (t = e.head) || void 0 === t ? void 0 : t.querySelector('meta[name="csp-nonce"]')) || void 0 === o ? void 0 : o.getAttribute("content")) && void 0 !== n ? n : void 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
1
6
|
function componentOnReady() {
|
|
2
7
|
return getHostRef(this).$onReadyPromise$;
|
|
3
8
|
}
|
|
@@ -316,26 +321,28 @@ const createTime = (e, t = "") => {
|
|
|
316
321
|
let n = styles.get(e);
|
|
317
322
|
n = t, styles.set(e, n);
|
|
318
323
|
}, addStyle = (e, t, o, n) => {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
if (
|
|
324
|
+
var s;
|
|
325
|
+
let l = getScopeId(t, o);
|
|
326
|
+
const a = styles.get(l);
|
|
327
|
+
if (!BUILD.attachStyles) return l;
|
|
328
|
+
if (e = 11 === e.nodeType ? e : doc, a) if ("string" == typeof a) {
|
|
323
329
|
e = e.head || e;
|
|
324
|
-
let o,
|
|
325
|
-
if (
|
|
326
|
-
if (BUILD.hydrateClientSide && e.host && (o = e.querySelector(`[sty-id="${
|
|
330
|
+
let o, r = rootAppliedStyles.get(e);
|
|
331
|
+
if (r || rootAppliedStyles.set(e, r = new Set), !r.has(l)) {
|
|
332
|
+
if (BUILD.hydrateClientSide && e.host && (o = e.querySelector(`[sty-id="${l}"]`))) o.innerHTML = a; else {
|
|
327
333
|
if (BUILD.cssVarShim && plt.$cssShim$) {
|
|
328
|
-
o = plt.$cssShim$.createHostStyle(n,
|
|
334
|
+
o = plt.$cssShim$.createHostStyle(n, l, a, !!(10 & t.$flags$));
|
|
329
335
|
const e = o["s-sc"];
|
|
330
|
-
e && (
|
|
331
|
-
} else o = doc.createElement("style"), o.innerHTML =
|
|
332
|
-
(
|
|
336
|
+
e && (l = e, r = null);
|
|
337
|
+
} else o = doc.createElement("style"), o.innerHTML = a;
|
|
338
|
+
const i = null !== (s = plt.$nonce$) && void 0 !== s ? s : queryNonceMetaTagContent(doc);
|
|
339
|
+
null != i && o.setAttribute("nonce", i), (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) && o.setAttribute("sty-id", l),
|
|
333
340
|
e.insertBefore(o, e.querySelector("link"));
|
|
334
341
|
}
|
|
335
|
-
|
|
342
|
+
r && r.add(l);
|
|
336
343
|
}
|
|
337
|
-
} else BUILD.constructableCSS && !e.adoptedStyleSheets.includes(
|
|
338
|
-
return
|
|
344
|
+
} else BUILD.constructableCSS && !e.adoptedStyleSheets.includes(a) && (e.adoptedStyleSheets = [ ...e.adoptedStyleSheets, a ]);
|
|
345
|
+
return l;
|
|
339
346
|
}, attachStyles = e => {
|
|
340
347
|
const t = e.$cmpMeta$, o = e.$hostElement$, n = t.$flags$, s = createTime("attachStyles", t.$tagName$), l = addStyle(BUILD.shadowDom && supportsShadow && o.shadowRoot ? o.shadowRoot : o.getRootNode(), t, e.$modeName$, o);
|
|
341
348
|
(BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && 10 & n && (o["s-sc"] = l,
|
|
@@ -855,6 +862,7 @@ const callRender = (e, t, o) => {
|
|
|
855
862
|
for (;(e = e.nextSibling) && e["s-sn"] === t; ) o.push(e);
|
|
856
863
|
return o;
|
|
857
864
|
}, bootstrapLazy = (e, t = {}) => {
|
|
865
|
+
var o;
|
|
858
866
|
BUILD.profile && performance.mark && performance.mark("st:app:start"), (() => {
|
|
859
867
|
if (BUILD.devTools) {
|
|
860
868
|
const e = win.stencil = win.stencil || {}, t = e.inspect;
|
|
@@ -902,29 +910,29 @@ const callRender = (e, t, o) => {
|
|
|
902
910
|
};
|
|
903
911
|
}
|
|
904
912
|
})();
|
|
905
|
-
const
|
|
906
|
-
let
|
|
913
|
+
const n = createTime("bootstrapLazy"), s = [], l = t.exclude || [], a = win.customElements, r = doc.head, i = r.querySelector("meta[charset]"), d = doc.createElement("style"), c = [], $ = doc.querySelectorAll("[sty-id]");
|
|
914
|
+
let m, p = !0, h = 0;
|
|
907
915
|
if (Object.assign(plt, t), plt.$resourcesUrl$ = new URL(t.resourcesUrl || "./", doc.baseURI).href,
|
|
908
916
|
BUILD.asyncQueue && t.syncQueue && (plt.$flags$ |= 4), BUILD.hydrateClientSide && (plt.$flags$ |= 2),
|
|
909
|
-
BUILD.hydrateClientSide && BUILD.shadowDom) for (;
|
|
910
|
-
e.map((e => {
|
|
917
|
+
BUILD.hydrateClientSide && BUILD.shadowDom) for (;h < $.length; h++) registerStyle($[h].getAttribute("sty-id"), $[h].innerHTML.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{"));
|
|
918
|
+
if (e.map((e => {
|
|
911
919
|
e[1].map((o => {
|
|
912
|
-
const
|
|
920
|
+
const n = {
|
|
913
921
|
$flags$: o[0],
|
|
914
922
|
$tagName$: o[1],
|
|
915
923
|
$members$: o[2],
|
|
916
924
|
$listeners$: o[3]
|
|
917
925
|
};
|
|
918
|
-
BUILD.member && (
|
|
919
|
-
BUILD.reflect && (
|
|
920
|
-
BUILD.shadowDom && !supportsShadow && 1 &
|
|
921
|
-
const r = BUILD.transformTagName && t.transformTagName ? t.transformTagName(
|
|
926
|
+
BUILD.member && (n.$members$ = o[2]), BUILD.hostListener && (n.$listeners$ = o[3]),
|
|
927
|
+
BUILD.reflect && (n.$attrsToReflect$ = []), BUILD.watchCallback && (n.$watchers$ = {}),
|
|
928
|
+
BUILD.shadowDom && !supportsShadow && 1 & n.$flags$ && (n.$flags$ |= 8);
|
|
929
|
+
const r = BUILD.transformTagName && t.transformTagName ? t.transformTagName(n.$tagName$) : n.$tagName$, i = class extends HTMLElement {
|
|
922
930
|
constructor(e) {
|
|
923
|
-
super(e), registerHost(e = this,
|
|
924
|
-
BUILD.slotChildNodesFix && patchChildSlotNodes(e,
|
|
931
|
+
super(e), registerHost(e = this, n), BUILD.shadowDom && 1 & n.$flags$ && (BUILD.hydrateServerSide || "shadowRoot" in e || (e.shadowRoot = e)),
|
|
932
|
+
BUILD.slotChildNodesFix && patchChildSlotNodes(e, n);
|
|
925
933
|
}
|
|
926
934
|
connectedCallback() {
|
|
927
|
-
|
|
935
|
+
m && (clearTimeout(m), m = null), p ? c.push(this) : plt.jmp((() => connectedCallback(this)));
|
|
928
936
|
}
|
|
929
937
|
disconnectedCallback() {
|
|
930
938
|
plt.jmp((() => disconnectedCallback(this)));
|
|
@@ -940,14 +948,17 @@ const callRender = (e, t, o) => {
|
|
|
940
948
|
n.$flags$ = 1, e["s-hmr-load"] = () => {
|
|
941
949
|
delete e["s-hmr-load"];
|
|
942
950
|
}, initializeComponent(e, n, t);
|
|
943
|
-
})(this,
|
|
944
|
-
}), BUILD.scopedSlotTextContentFix && patchTextContent(i.prototype,
|
|
945
|
-
|
|
951
|
+
})(this, n);
|
|
952
|
+
}), BUILD.scopedSlotTextContentFix && patchTextContent(i.prototype, n), n.$lazyBundleId$ = e[0],
|
|
953
|
+
l.includes(r) || a.get(r) || (s.push(r), a.define(r, proxyComponent(i, n, 1)));
|
|
946
954
|
}));
|
|
947
|
-
})), BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
955
|
+
})), BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)) {
|
|
956
|
+
d.innerHTML = s + "{visibility:hidden}.hydrated{visibility:inherit}", d.setAttribute("data-styles", "");
|
|
957
|
+
const e = null !== (o = plt.$nonce$) && void 0 !== o ? o : queryNonceMetaTagContent(doc);
|
|
958
|
+
null != e && d.setAttribute("nonce", e), r.insertBefore(d, i ? i.nextSibling : r.firstChild);
|
|
959
|
+
}
|
|
960
|
+
p = !1, c.length ? c.map((e => e.connectedCallback())) : BUILD.profile ? plt.jmp((() => m = setTimeout(appDidLoad, 30, "timeout"))) : plt.jmp((() => m = setTimeout(appDidLoad, 30))),
|
|
961
|
+
n();
|
|
951
962
|
}, getConnect = (e, t) => {
|
|
952
963
|
const o = () => {
|
|
953
964
|
let e = doc.querySelector(t);
|
|
@@ -975,7 +986,7 @@ const callRender = (e, t, o) => {
|
|
|
975
986
|
} catch (e) {
|
|
976
987
|
consoleError(e);
|
|
977
988
|
}
|
|
978
|
-
}, getHostListenerTarget = (e, t) => BUILD.hostListenerTargetDocument && 4 & t ? doc : BUILD.hostListenerTargetWindow && 8 & t ? win : BUILD.hostListenerTargetBody && 16 & t ? doc.body : BUILD.hostListenerTargetParent && 32 & t ? e.parentElement : e, hostListenerOpts = e => 0 != (2 & e), insertVdomAnnotations = (e, t) => {
|
|
989
|
+
}, getHostListenerTarget = (e, t) => BUILD.hostListenerTargetDocument && 4 & t ? doc : BUILD.hostListenerTargetWindow && 8 & t ? win : BUILD.hostListenerTargetBody && 16 & t ? doc.body : BUILD.hostListenerTargetParent && 32 & t ? e.parentElement : e, hostListenerOpts = e => 0 != (2 & e), setNonce = e => plt.$nonce$ = e, insertVdomAnnotations = (e, t) => {
|
|
979
990
|
if (null != e) {
|
|
980
991
|
const o = {
|
|
981
992
|
hostIds: 0,
|
|
@@ -1129,4 +1140,4 @@ const cmpModules = new Map, getModule = e => {
|
|
|
1129
1140
|
isTesting: !1
|
|
1130
1141
|
}, styles = new Map, modeResolutionChain = [];
|
|
1131
1142
|
|
|
1132
|
-
export { Build, Context, Fragment, Host, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, doc, forceModeUpdate, forceUpdate$1 as forceUpdate, getAssetPath, getConnect, getContext, getElement, getHostRef, getMode, getRenderingRef, getValue, hAsync as h, hydrateApp, insertVdomAnnotations, isMemberInElement, loadModule, modeResolutionChain, nextTick, parsePropertyValue, plt, postUpdateComponent, proxyComponent, proxyCustomElement, readTask, registerComponents, registerHost, registerInstance, renderVdom, setAssetPath, setErrorHandler, setMode, setPlatformHelpers, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsShadow, win, writeTask };
|
|
1143
|
+
export { Build, Context, Fragment, Host, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, doc, forceModeUpdate, forceUpdate$1 as forceUpdate, getAssetPath, getConnect, getContext, getElement, getHostRef, getMode, getRenderingRef, getValue, hAsync as h, hydrateApp, insertVdomAnnotations, isMemberInElement, loadModule, modeResolutionChain, nextTick, parsePropertyValue, plt, postUpdateComponent, proxyComponent, proxyCustomElement, readTask, registerComponents, registerHost, registerInstance, renderVdom, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsShadow, win, writeTask };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/hydrate",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-rc.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
|
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-rc.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",
|
|
@@ -1445,6 +1445,11 @@ export interface PlatformRuntime {
|
|
|
1445
1445
|
$flags$: number;
|
|
1446
1446
|
$orgLocNodes$?: Map<string, RenderNode>;
|
|
1447
1447
|
$resourcesUrl$: string;
|
|
1448
|
+
/**
|
|
1449
|
+
* The nonce value to be applied to all script/style tags at runtime.
|
|
1450
|
+
* If `null`, the nonce attribute will not be applied.
|
|
1451
|
+
*/
|
|
1452
|
+
$nonce$?: string | null;
|
|
1448
1453
|
jmp: (c: Function) => any;
|
|
1449
1454
|
raf: (c: FrameRequestCallback) => number;
|
|
1450
1455
|
ael: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
@@ -2072,6 +2077,11 @@ export interface NewSpecPageOptions {
|
|
|
2072
2077
|
*/
|
|
2073
2078
|
attachStyles?: boolean;
|
|
2074
2079
|
strictBuild?: boolean;
|
|
2080
|
+
/**
|
|
2081
|
+
* Default values to be set on the platform runtime object (@see PlatformRuntime) when creating
|
|
2082
|
+
* the spec page.
|
|
2083
|
+
*/
|
|
2084
|
+
platform?: Partial<PlatformRuntime>;
|
|
2075
2085
|
}
|
|
2076
2086
|
/**
|
|
2077
2087
|
* A record of `TypesMemberNameData` entities.
|
|
@@ -257,6 +257,15 @@ export declare function getAssetPath(path: string): string;
|
|
|
257
257
|
* @returns the set path
|
|
258
258
|
*/
|
|
259
259
|
export declare function setAssetPath(path: string): string;
|
|
260
|
+
/**
|
|
261
|
+
* Used to specify a nonce value that corresponds with an application's
|
|
262
|
+
* [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).
|
|
263
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
264
|
+
* Alternatively, the nonce value can be set on a `meta` tag in the DOM head
|
|
265
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) and will result in the same behavior.
|
|
266
|
+
* @param nonce The value to be used for the nonce attribute.
|
|
267
|
+
*/
|
|
268
|
+
export declare function setNonce(nonce: string): void;
|
|
260
269
|
/**
|
|
261
270
|
* Retrieve a Stencil element for a given reference
|
|
262
271
|
* @param ref the ref to get the Stencil element for
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
function queryNonceMetaTagContent(e) {
|
|
2
|
+
var t, a, o;
|
|
3
|
+
return null !== (o = null === (a = null === (t = e.head) || void 0 === t ? void 0 : t.querySelector('meta[name="csp-nonce"]')) || void 0 === a ? void 0 : a.getAttribute("content")) && void 0 !== o ? o : void 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
1
6
|
function writeTask(e) {
|
|
2
7
|
queuedWriteTasks.push(e);
|
|
3
8
|
}
|
|
@@ -213,26 +218,28 @@ const createTime = (e, t = "") => {
|
|
|
213
218
|
let o = styles.get(e);
|
|
214
219
|
o = t, styles.set(e, o);
|
|
215
220
|
}, addStyle = (e, t, a, o) => {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if (
|
|
221
|
+
var s;
|
|
222
|
+
let n = getScopeId(t, a);
|
|
223
|
+
const l = styles.get(n);
|
|
224
|
+
if (!appData.BUILD.attachStyles) return n;
|
|
225
|
+
if (e = 11 === e.nodeType ? e : doc, l) if ("string" == typeof l) {
|
|
220
226
|
e = e.head || e;
|
|
221
|
-
let a,
|
|
222
|
-
if (
|
|
223
|
-
if (appData.BUILD.hydrateClientSide && e.host && (a = e.querySelector(`[sty-id="${
|
|
227
|
+
let a, r = rootAppliedStyles.get(e);
|
|
228
|
+
if (r || rootAppliedStyles.set(e, r = new Set), !r.has(n)) {
|
|
229
|
+
if (appData.BUILD.hydrateClientSide && e.host && (a = e.querySelector(`[sty-id="${n}"]`))) a.innerHTML = l; else {
|
|
224
230
|
if (appData.BUILD.cssVarShim && plt.$cssShim$) {
|
|
225
|
-
a = plt.$cssShim$.createHostStyle(o,
|
|
231
|
+
a = plt.$cssShim$.createHostStyle(o, n, l, !!(10 & t.$flags$));
|
|
226
232
|
const e = a["s-sc"];
|
|
227
|
-
e && (
|
|
228
|
-
} else a = doc.createElement("style"), a.innerHTML =
|
|
229
|
-
(
|
|
233
|
+
e && (n = e, r = null);
|
|
234
|
+
} else a = doc.createElement("style"), a.innerHTML = l;
|
|
235
|
+
const p = null !== (s = plt.$nonce$) && void 0 !== s ? s : queryNonceMetaTagContent(doc);
|
|
236
|
+
null != p && a.setAttribute("nonce", p), (appData.BUILD.hydrateServerSide || appData.BUILD.hotModuleReplacement) && a.setAttribute("sty-id", n),
|
|
230
237
|
e.insertBefore(a, e.querySelector("link"));
|
|
231
238
|
}
|
|
232
|
-
|
|
239
|
+
r && r.add(n);
|
|
233
240
|
}
|
|
234
|
-
} else appData.BUILD.constructableCSS && !e.adoptedStyleSheets.includes(
|
|
235
|
-
return
|
|
241
|
+
} else appData.BUILD.constructableCSS && !e.adoptedStyleSheets.includes(l) && (e.adoptedStyleSheets = [ ...e.adoptedStyleSheets, l ]);
|
|
242
|
+
return n;
|
|
236
243
|
}, attachStyles = e => {
|
|
237
244
|
const t = e.$cmpMeta$, a = e.$hostElement$, o = t.$flags$, s = createTime("attachStyles", t.$tagName$), n = addStyle(appData.BUILD.shadowDom && exports.supportsShadow && a.shadowRoot ? a.shadowRoot : a.getRootNode(), t, e.$modeName$, a);
|
|
238
245
|
(appData.BUILD.shadowDom || appData.BUILD.scoped) && appData.BUILD.cssAnnotations && 10 & o && (a["s-sc"] = n,
|
|
@@ -884,6 +891,7 @@ Object.defineProperty(exports, "Env", {
|
|
|
884
891
|
isTesting: !0
|
|
885
892
|
}, exports.Context = Context, exports.Fragment = (e, t) => t, exports.Host = Host,
|
|
886
893
|
exports.addHostEventListeners = addHostEventListeners, exports.bootstrapLazy = (e, t = {}) => {
|
|
894
|
+
var a;
|
|
887
895
|
appData.BUILD.profile && performance.mark && performance.mark("st:app:start"), (() => {
|
|
888
896
|
if (appData.BUILD.devTools) {
|
|
889
897
|
const e = win.stencil = win.stencil || {}, t = e.inspect;
|
|
@@ -931,34 +939,34 @@ exports.addHostEventListeners = addHostEventListeners, exports.bootstrapLazy = (
|
|
|
931
939
|
};
|
|
932
940
|
}
|
|
933
941
|
})();
|
|
934
|
-
const
|
|
935
|
-
let
|
|
942
|
+
const o = createTime("bootstrapLazy"), s = [], n = t.exclude || [], l = win.customElements, r = doc.head, p = r.querySelector("meta[charset]"), i = doc.createElement("style"), d = [], c = doc.querySelectorAll("[sty-id]");
|
|
943
|
+
let $, u = !0, m = 0;
|
|
936
944
|
if (Object.assign(plt, t), plt.$resourcesUrl$ = new URL(t.resourcesUrl || "./", doc.baseURI).href,
|
|
937
945
|
appData.BUILD.asyncQueue && t.syncQueue && (plt.$flags$ |= 4), appData.BUILD.hydrateClientSide && (plt.$flags$ |= 2),
|
|
938
|
-
appData.BUILD.hydrateClientSide && appData.BUILD.shadowDom) for (;
|
|
939
|
-
e.map((e => {
|
|
946
|
+
appData.BUILD.hydrateClientSide && appData.BUILD.shadowDom) for (;m < c.length; m++) registerStyle(c[m].getAttribute("sty-id"), c[m].innerHTML.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{"));
|
|
947
|
+
if (e.map((e => {
|
|
940
948
|
e[1].map((a => {
|
|
941
|
-
const
|
|
949
|
+
const o = {
|
|
942
950
|
$flags$: a[0],
|
|
943
951
|
$tagName$: a[1],
|
|
944
952
|
$members$: a[2],
|
|
945
953
|
$listeners$: a[3]
|
|
946
954
|
};
|
|
947
|
-
appData.BUILD.member && (
|
|
948
|
-
appData.BUILD.reflect && (
|
|
949
|
-
appData.BUILD.shadowDom && !exports.supportsShadow && 1 &
|
|
950
|
-
const r = appData.BUILD.transformTagName && t.transformTagName ? t.transformTagName(
|
|
955
|
+
appData.BUILD.member && (o.$members$ = a[2]), appData.BUILD.hostListener && (o.$listeners$ = a[3]),
|
|
956
|
+
appData.BUILD.reflect && (o.$attrsToReflect$ = []), appData.BUILD.watchCallback && (o.$watchers$ = {}),
|
|
957
|
+
appData.BUILD.shadowDom && !exports.supportsShadow && 1 & o.$flags$ && (o.$flags$ |= 8);
|
|
958
|
+
const r = appData.BUILD.transformTagName && t.transformTagName ? t.transformTagName(o.$tagName$) : o.$tagName$, p = class extends HTMLElement {
|
|
951
959
|
constructor(e) {
|
|
952
|
-
super(e), registerHost(e = this,
|
|
960
|
+
super(e), registerHost(e = this, o), appData.BUILD.shadowDom && 1 & o.$flags$ && (exports.supportsShadow ? appData.BUILD.shadowDelegatesFocus ? e.attachShadow({
|
|
953
961
|
mode: "open",
|
|
954
|
-
delegatesFocus: !!(16 &
|
|
962
|
+
delegatesFocus: !!(16 & o.$flags$)
|
|
955
963
|
}) : e.attachShadow({
|
|
956
964
|
mode: "open"
|
|
957
965
|
}) : appData.BUILD.hydrateServerSide || "shadowRoot" in e || (e.shadowRoot = e)),
|
|
958
|
-
appData.BUILD.slotChildNodesFix && patchChildSlotNodes(e,
|
|
966
|
+
appData.BUILD.slotChildNodesFix && patchChildSlotNodes(e, o);
|
|
959
967
|
}
|
|
960
968
|
connectedCallback() {
|
|
961
|
-
|
|
969
|
+
$ && (clearTimeout($), $ = null), u ? d.push(this) : plt.jmp((() => connectedCallback(this)));
|
|
962
970
|
}
|
|
963
971
|
disconnectedCallback() {
|
|
964
972
|
plt.jmp((() => disconnectedCallback(this)));
|
|
@@ -974,14 +982,17 @@ exports.addHostEventListeners = addHostEventListeners, exports.bootstrapLazy = (
|
|
|
974
982
|
o.$flags$ = 1, e["s-hmr-load"] = () => {
|
|
975
983
|
delete e["s-hmr-load"];
|
|
976
984
|
}, initializeComponent(e, o, t);
|
|
977
|
-
})(this,
|
|
978
|
-
}), appData.BUILD.scopedSlotTextContentFix && patchTextContent(p.prototype,
|
|
979
|
-
|
|
985
|
+
})(this, o);
|
|
986
|
+
}), appData.BUILD.scopedSlotTextContentFix && patchTextContent(p.prototype, o),
|
|
987
|
+
o.$lazyBundleId$ = e[0], n.includes(r) || l.get(r) || (s.push(r), l.define(r, proxyComponent(p, o, 1)));
|
|
980
988
|
}));
|
|
981
|
-
})), appData.BUILD.invisiblePrehydration && (appData.BUILD.hydratedClass || appData.BUILD.hydratedAttribute)
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
989
|
+
})), appData.BUILD.invisiblePrehydration && (appData.BUILD.hydratedClass || appData.BUILD.hydratedAttribute)) {
|
|
990
|
+
i.innerHTML = s + "{visibility:hidden}.hydrated{visibility:inherit}", i.setAttribute("data-styles", "");
|
|
991
|
+
const e = null !== (a = plt.$nonce$) && void 0 !== a ? a : queryNonceMetaTagContent(doc);
|
|
992
|
+
null != e && i.setAttribute("nonce", e), r.insertBefore(i, p ? p.nextSibling : r.firstChild);
|
|
993
|
+
}
|
|
994
|
+
u = !1, d.length ? d.map((e => e.connectedCallback())) : appData.BUILD.profile ? plt.jmp((() => $ = setTimeout(appDidLoad, 30, "timeout"))) : plt.jmp((() => $ = setTimeout(appDidLoad, 30))),
|
|
995
|
+
o();
|
|
985
996
|
}, exports.connectedCallback = connectedCallback, exports.consoleDevError = consoleDevError,
|
|
986
997
|
exports.consoleDevInfo = (...e) => {}, exports.consoleDevWarn = consoleDevWarn,
|
|
987
998
|
exports.consoleError = consoleError, exports.createEvent = (e, t, a) => {
|
|
@@ -1069,16 +1080,17 @@ exports.readTask = readTask, exports.registerComponents = e => {
|
|
|
1069
1080
|
return t.$lazyInstance$ = e, hostRefs.set(e, t);
|
|
1070
1081
|
}, exports.registerModule = function registerModule(e, t) {
|
|
1071
1082
|
moduleLoaded.set(e, t);
|
|
1072
|
-
}, exports.renderVdom = renderVdom, exports.resetPlatform = function resetPlatform() {
|
|
1083
|
+
}, exports.renderVdom = renderVdom, exports.resetPlatform = function resetPlatform(e = {}) {
|
|
1073
1084
|
win && "function" == typeof win.close && win.close(), hostRefs.clear(), styles.clear(),
|
|
1074
|
-
plt.$flags$ = 0, Object.keys(Context).forEach((e => delete Context[e])),
|
|
1075
|
-
plt.$orgLocNodes$
|
|
1076
|
-
function
|
|
1085
|
+
plt.$flags$ = 0, Object.keys(Context).forEach((e => delete Context[e])), Object.assign(plt, e),
|
|
1086
|
+
null != plt.$orgLocNodes$ && (plt.$orgLocNodes$.clear(), plt.$orgLocNodes$ = void 0),
|
|
1087
|
+
win.location.href = plt.$resourcesUrl$ = "http://testing.stenciljs.com/", function t() {
|
|
1077
1088
|
queuedTicks.length = 0, queuedWriteTasks.length = 0, queuedReadTasks.length = 0,
|
|
1078
1089
|
moduleLoaded.clear(), queuedLoadModules.length = 0, caughtErrors.length = 0;
|
|
1079
1090
|
}(), stopAutoApplyChanges(), cstrs.clear();
|
|
1080
1091
|
}, exports.setAssetPath = e => plt.$resourcesUrl$ = e, exports.setErrorHandler = e => customError = e,
|
|
1081
|
-
exports.setMode = e => modeResolutionChain.push(e), exports.
|
|
1092
|
+
exports.setMode = e => modeResolutionChain.push(e), exports.setNonce = e => plt.$nonce$ = e,
|
|
1093
|
+
exports.setPlatformHelpers = e => {
|
|
1082
1094
|
Object.assign(plt, e);
|
|
1083
1095
|
}, exports.setPlatformOptions = e => Object.assign(plt, e), exports.setSupportsShadowDom = e => {
|
|
1084
1096
|
exports.supportsShadow = e;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/testing",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-rc.0",
|
|
4
4
|
"description": "Stencil internal testing 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
|
package/mock-doc/index.cjs
CHANGED
package/mock-doc/index.js
CHANGED
package/mock-doc/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./internal/stencil-core/index.cjs",
|
|
6
6
|
"module": "./internal/stencil-core/index.js",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"eslint-config-prettier": "^8.5.0",
|
|
92
92
|
"eslint-plugin-jest": "^27.0.4",
|
|
93
93
|
"eslint-plugin-jsdoc": "^39.3.1",
|
|
94
|
-
"eslint-plugin-simple-import-sort": "^
|
|
94
|
+
"eslint-plugin-simple-import-sort": "^9.0.0",
|
|
95
95
|
"execa": "4.1.0",
|
|
96
96
|
"exit": "^0.1.2",
|
|
97
97
|
"fs-extra": "^11.0.0",
|
|
@@ -114,9 +114,9 @@
|
|
|
114
114
|
"path-browserify": "^1.0.1",
|
|
115
115
|
"pixelmatch": "5.3.0",
|
|
116
116
|
"postcss": "^8.2.8",
|
|
117
|
-
"prettier": "2.8.
|
|
117
|
+
"prettier": "2.8.3",
|
|
118
118
|
"prompts": "2.4.2",
|
|
119
|
-
"puppeteer": "^19.
|
|
119
|
+
"puppeteer": "^19.5.0",
|
|
120
120
|
"rollup": "2.42.3",
|
|
121
121
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
122
122
|
"semver": "^7.3.7",
|
package/screenshot/package.json
CHANGED
package/sys/node/index.js
CHANGED
package/sys/node/package.json
CHANGED
package/sys/node/worker.js
CHANGED
package/testing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Testing v3.0.0-
|
|
2
|
+
Stencil Testing v3.0.0-rc.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
function _lazyRequire(e) {
|
|
5
5
|
return new Proxy({}, {
|
|
@@ -3148,7 +3148,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3148
3148
|
d("/");
|
|
3149
3149
|
const C = {
|
|
3150
3150
|
name: "in-memory",
|
|
3151
|
-
version: "3.0.0-
|
|
3151
|
+
version: "3.0.0-rc.0",
|
|
3152
3152
|
events: a,
|
|
3153
3153
|
access: async e => u(e),
|
|
3154
3154
|
accessSync: u,
|
|
@@ -4169,27 +4169,28 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4169
4169
|
}
|
|
4170
4170
|
return t;
|
|
4171
4171
|
}, exports.newSpecPage = async function newSpecPage(e) {
|
|
4172
|
+
var t;
|
|
4172
4173
|
if (null == e) throw new Error("NewSpecPageOptions required");
|
|
4173
|
-
testing.resetPlatform(
|
|
4174
|
-
e.
|
|
4175
|
-
testing.setSupportsShadowDom(!1)) : (e.includeAnnotations = !!e.includeAnnotations,
|
|
4174
|
+
testing.resetPlatform(null !== (t = e.platform) && void 0 !== t ? t : {}), resetBuildConditionals(appData.BUILD),
|
|
4175
|
+
Array.isArray(e.components) && testing.registerComponents(e.components), e.hydrateClientSide && (e.includeAnnotations = !0),
|
|
4176
|
+
e.hydrateServerSide ? (e.includeAnnotations = !0, testing.setSupportsShadowDom(!1)) : (e.includeAnnotations = !!e.includeAnnotations,
|
|
4176
4177
|
!1 === e.supportsShadowDom ? testing.setSupportsShadowDom(!1) : testing.setSupportsShadowDom(!0)),
|
|
4177
4178
|
appData.BUILD.cssAnnotations = e.includeAnnotations;
|
|
4178
|
-
const
|
|
4179
|
+
const r = new Set;
|
|
4179
4180
|
testing.win.__stencil_spec_options = e;
|
|
4180
|
-
const
|
|
4181
|
+
const s = testing.win.document, n = {
|
|
4181
4182
|
win: testing.win,
|
|
4182
|
-
doc:
|
|
4183
|
-
body:
|
|
4183
|
+
doc: s,
|
|
4184
|
+
body: s.body,
|
|
4184
4185
|
build: appData.BUILD,
|
|
4185
4186
|
styles: testing.styles,
|
|
4186
|
-
setContent: e => (
|
|
4187
|
+
setContent: e => (s.body.innerHTML = e, testing.flushAll()),
|
|
4187
4188
|
waitForChanges: testing.flushAll,
|
|
4188
4189
|
flushLoadModule: testing.flushLoadModule,
|
|
4189
4190
|
flushQueue: testing.flushQueue
|
|
4190
|
-
},
|
|
4191
|
+
}, i = e.components.map((e => {
|
|
4191
4192
|
if (null == e.COMPILER_META) throw new Error('Invalid component class: Missing static "COMPILER_META" property.');
|
|
4192
|
-
|
|
4193
|
+
r.add(e.COMPILER_META.tagName), e.isProxied = !1, function t(e) {
|
|
4193
4194
|
var t, r, s, n, i, o;
|
|
4194
4195
|
"function" == typeof (null === (t = e.prototype) || void 0 === t ? void 0 : t.__componentWillLoad) && (e.prototype.componentWillLoad = e.prototype.__componentWillLoad,
|
|
4195
4196
|
e.prototype.__componentWillLoad = null), "function" == typeof (null === (r = e.prototype) || void 0 === r ? void 0 : r.__componentWillUpdate) && (e.prototype.componentWillUpdate = e.prototype.__componentWillUpdate,
|
|
@@ -4227,7 +4228,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4227
4228
|
return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
|
|
4228
4229
|
})(e, !0))) ])(s, [ e.COMPILER_META ]);
|
|
4229
4230
|
return i;
|
|
4230
|
-
})),
|
|
4231
|
+
})), o = (e => {
|
|
4231
4232
|
const t = e.some((e => e.htmlTagNames.includes("slot"))), r = e.some((e => "shadow" === e.encapsulation)), s = e.some((e => "shadow" !== e.encapsulation && e.htmlTagNames.includes("slot"))), n = {
|
|
4232
4233
|
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
4233
4234
|
cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
|
|
@@ -4287,24 +4288,24 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4287
4288
|
return n.asyncLoading = n.cmpWillUpdate || n.cmpWillLoad || n.cmpWillRender, n.vdomAttribute = n.vdomAttribute || n.reflect,
|
|
4288
4289
|
n.vdomPropOrAttr = n.vdomPropOrAttr || n.reflect, n;
|
|
4289
4290
|
})(e.components.map((e => e.COMPILER_META)));
|
|
4290
|
-
if (e.strictBuild ? Object.assign(appData.BUILD,
|
|
4291
|
-
!0 ===
|
|
4291
|
+
if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach((e => {
|
|
4292
|
+
!0 === o[e] && (appData.BUILD[e] = !0);
|
|
4292
4293
|
})), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
4293
4294
|
appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
|
|
4294
4295
|
appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
|
|
4295
|
-
appData.BUILD.safari10 = !1, appData.BUILD.attachStyles = !!e.attachStyles, "string" == typeof e.url && (
|
|
4296
|
-
"string" == typeof e.direction &&
|
|
4297
|
-
"string" == typeof e.language &&
|
|
4296
|
+
appData.BUILD.safari10 = !1, appData.BUILD.attachStyles = !!e.attachStyles, "string" == typeof e.url && (n.win.location.href = e.url),
|
|
4297
|
+
"string" == typeof e.direction && n.doc.documentElement.setAttribute("dir", e.direction),
|
|
4298
|
+
"string" == typeof e.language && n.doc.documentElement.setAttribute("lang", e.language),
|
|
4298
4299
|
"string" == typeof e.cookie) try {
|
|
4299
|
-
|
|
4300
|
+
n.doc.cookie = e.cookie;
|
|
4300
4301
|
} catch (e) {}
|
|
4301
4302
|
if ("string" == typeof e.referrer) try {
|
|
4302
|
-
|
|
4303
|
+
n.doc.referrer = e.referrer;
|
|
4303
4304
|
} catch (e) {}
|
|
4304
4305
|
if ("string" == typeof e.userAgent) try {
|
|
4305
|
-
|
|
4306
|
+
n.win.navigator.userAgent = e.userAgent;
|
|
4306
4307
|
} catch (e) {}
|
|
4307
|
-
if (testing.bootstrapLazy(
|
|
4308
|
+
if (testing.bootstrapLazy(i), "function" == typeof e.template) {
|
|
4308
4309
|
const t = {
|
|
4309
4310
|
$ancestorComponent$: void 0,
|
|
4310
4311
|
$flags$: 0,
|
|
@@ -4313,26 +4314,26 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4313
4314
|
$flags$: 0,
|
|
4314
4315
|
$tagName$: "body"
|
|
4315
4316
|
},
|
|
4316
|
-
$hostElement$:
|
|
4317
|
+
$hostElement$: n.body
|
|
4317
4318
|
};
|
|
4318
4319
|
testing.renderVdom(t, e.template());
|
|
4319
|
-
} else "string" == typeof e.html && (
|
|
4320
|
-
!1 !== e.flushQueue && await
|
|
4321
|
-
let
|
|
4322
|
-
return Object.defineProperty(
|
|
4320
|
+
} else "string" == typeof e.html && (n.body.innerHTML = e.html);
|
|
4321
|
+
!1 !== e.flushQueue && await n.waitForChanges();
|
|
4322
|
+
let a = null;
|
|
4323
|
+
return Object.defineProperty(n, "root", {
|
|
4323
4324
|
get() {
|
|
4324
|
-
if (null ==
|
|
4325
|
-
const e =
|
|
4325
|
+
if (null == a && (a = findRootComponent(r, n.body)), null != a) return a;
|
|
4326
|
+
const e = n.body.firstElementChild;
|
|
4326
4327
|
return null != e ? e : null;
|
|
4327
4328
|
}
|
|
4328
|
-
}), Object.defineProperty(
|
|
4329
|
+
}), Object.defineProperty(n, "rootInstance", {
|
|
4329
4330
|
get() {
|
|
4330
|
-
const e = testing.getHostRef(
|
|
4331
|
+
const e = testing.getHostRef(n.root);
|
|
4331
4332
|
return null != e ? e.$lazyInstance$ : null;
|
|
4332
4333
|
}
|
|
4333
|
-
}), e.hydrateServerSide && testing.insertVdomAnnotations(
|
|
4334
|
-
|
|
4335
|
-
Promise.resolve())),
|
|
4334
|
+
}), e.hydrateServerSide && testing.insertVdomAnnotations(s, []), e.autoApplyChanges && (testing.startAutoApplyChanges(),
|
|
4335
|
+
n.waitForChanges = () => (console.error('waitForChanges() cannot be used manually if the "startAutoApplyChanges" option is enabled'),
|
|
4336
|
+
Promise.resolve())), n;
|
|
4336
4337
|
}, exports.shuffleArray = function shuffleArray(e) {
|
|
4337
4338
|
let t, r, s = e.length;
|
|
4338
4339
|
for (;0 !== s; ) r = Math.floor(Math.random() * s), s -= 1, t = e[s], e[s] = e[r],
|