@stencil/core 2.15.2 → 2.16.1
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 +34 -16
- package/cli/index.js +34 -16
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +641 -242
- 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/client/test/hmr-util.spec.d.ts +1 -0
- package/dev-server/client/test/status.spec.d.ts +1 -0
- package/dev-server/connector.html +3 -3
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +5 -3
- 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 +11 -9
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/shadow-css.js +2 -3
- package/internal/hydrate/index.js +37 -32
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/shadow-css.js +9 -9
- package/internal/package.json +1 -1
- package/internal/stencil-public-compiler.d.ts +67 -2
- package/internal/stencil-public-docs.d.ts +3 -0
- package/internal/testing/index.js +35 -30
- package/internal/testing/package.json +1 -1
- package/internal/testing/shadow-css.js +9 -9
- package/mock-doc/index.cjs +8 -2
- package/mock-doc/index.d.ts +9 -2
- package/mock-doc/index.js +8 -2
- package/mock-doc/package.json +1 -1
- package/package.json +22 -14
- package/screenshot/index.js +2 -0
- 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 +335 -331
- package/testing/jest/test/jest-config.spec.d.ts +1 -0
- package/testing/jest/test/jest-preprocessor.spec.d.ts +1 -0
- package/testing/jest/test/jest-runner.spec.d.ts +1 -0
- package/testing/jest/test/jest-serializer.spec.d.ts +1 -0
- package/testing/package.json +1 -1
|
@@ -59,9 +59,9 @@ function hydrateApp(e, t, o, n, s) {
|
|
|
59
59
|
enumerable: !0
|
|
60
60
|
});
|
|
61
61
|
} else 64 & l && Object.defineProperty(e, n, {
|
|
62
|
-
value() {
|
|
63
|
-
const
|
|
64
|
-
return
|
|
62
|
+
value(...e) {
|
|
63
|
+
const t = getHostRef(this);
|
|
64
|
+
return t.$onInstancePromise$.then((() => t.$lazyInstance$[n](...e))).catch(consoleError);
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
}));
|
|
@@ -210,7 +210,8 @@ const createTime = (e, t = "") => {
|
|
|
210
210
|
let n = styles.get(e);
|
|
211
211
|
n = t, styles.set(e, n);
|
|
212
212
|
}, addStyle = (e, t, o, n) => {
|
|
213
|
-
let s = getScopeId(t, o)
|
|
213
|
+
let s = getScopeId(t, o);
|
|
214
|
+
const l = styles.get(s);
|
|
214
215
|
if (!BUILD.attachStyles) return s;
|
|
215
216
|
if (e = 11 === e.nodeType ? e : doc, l) if ("string" == typeof l) {
|
|
216
217
|
e = e.head || e;
|
|
@@ -235,8 +236,8 @@ const createTime = (e, t = "") => {
|
|
|
235
236
|
o.classList.add(l + "-h"), BUILD.scoped && 2 & n && o.classList.add(l + "-s")),
|
|
236
237
|
s();
|
|
237
238
|
}, getScopeId = (e, t) => "sc-" + (BUILD.mode && t && 32 & e.$flags$ ? e.$tagName$ + "-" + t : e.$tagName$), computeMode = e => modeResolutionChain.map((t => t(e))).find((e => !!e)), setMode = e => modeResolutionChain.push(e), getMode = e => getHostRef(e).$modeName$, EMPTY_OBJ = {}, isComplexType = e => "object" == (e = typeof e) || "function" === e, isPromise = e => !!e && ("object" == typeof e || "function" == typeof e) && "function" == typeof e.then, h = (e, t, ...o) => {
|
|
238
|
-
let n = null, s = null, l = null, a = !1, r = !1
|
|
239
|
-
const d = t => {
|
|
239
|
+
let n = null, s = null, l = null, a = !1, r = !1;
|
|
240
|
+
const i = [], d = t => {
|
|
240
241
|
for (let o = 0; o < t.length; o++) n = t[o], Array.isArray(n) ? d(n) : null != n && "boolean" != typeof n && ((a = "function" != typeof e && !isComplexType(n)) ? n = String(n) : BUILD.isDev && "function" != typeof e && n.$flags$,
|
|
241
242
|
a && r ? i[i.length - 1].$text$ += n : i.push(a ? newVNode(null, n) : n), r = a);
|
|
242
243
|
};
|
|
@@ -297,7 +298,7 @@ const createTime = (e, t = "") => {
|
|
|
297
298
|
const i = isComplexType(n);
|
|
298
299
|
if ((a || i && null !== n) && !s) try {
|
|
299
300
|
if (e.tagName.includes("-")) e[t] = n; else {
|
|
300
|
-
|
|
301
|
+
const s = null == n ? "" : n;
|
|
301
302
|
"list" === t ? a = !1 : null != o && e[t] == s || (e[t] = s);
|
|
302
303
|
}
|
|
303
304
|
} catch (e) {}
|
|
@@ -317,21 +318,22 @@ const createTime = (e, t = "") => {
|
|
|
317
318
|
let scopeId, contentRef, hostTagName, useNativeShadowDom = !1, checkSlotFallbackVisibility = !1, checkSlotRelocate = !1, isSvgMode = !1;
|
|
318
319
|
|
|
319
320
|
const createElm = (e, t, o, n) => {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
BUILD.
|
|
324
|
-
|
|
325
|
-
BUILD.svg && isSvgMode && "
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
321
|
+
const s = t.$children$[o];
|
|
322
|
+
let l, a, r, i = 0;
|
|
323
|
+
if (BUILD.slotRelocation && !useNativeShadowDom && (checkSlotRelocate = !0, "slot" === s.$tag$ && (scopeId && n.classList.add(scopeId + "-s"),
|
|
324
|
+
s.$flags$ |= s.$children$ ? 2 : 1)), BUILD.isDev && s.$elm$ && consoleDevError(`The JSX ${null !== s.$text$ ? `"${s.$text$}" text` : `"${s.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`),
|
|
325
|
+
BUILD.vdomText && null !== s.$text$) l = s.$elm$ = doc.createTextNode(s.$text$); else if (BUILD.slotRelocation && 1 & s.$flags$) l = s.$elm$ = BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(s) : doc.createTextNode(""); else {
|
|
326
|
+
if (BUILD.svg && !isSvgMode && (isSvgMode = "svg" === s.$tag$), l = s.$elm$ = BUILD.svg ? doc.createElementNS(isSvgMode ? "http://www.w3.org/2000/svg" : "http://www.w3.org/1999/xhtml", BUILD.slotRelocation && 2 & s.$flags$ ? "slot-fb" : s.$tag$) : doc.createElement(BUILD.slotRelocation && 2 & s.$flags$ ? "slot-fb" : s.$tag$),
|
|
327
|
+
BUILD.svg && isSvgMode && "foreignObject" === s.$tag$ && (isSvgMode = !1), BUILD.vdomAttribute && updateElement(null, s, isSvgMode),
|
|
328
|
+
(BUILD.shadowDom || BUILD.scoped) && null != scopeId && l["s-si"] !== scopeId && l.classList.add(l["s-si"] = scopeId),
|
|
329
|
+
s.$children$) for (i = 0; i < s.$children$.length; ++i) a = createElm(e, s, i, l),
|
|
330
|
+
a && l.appendChild(a);
|
|
331
|
+
BUILD.svg && ("svg" === s.$tag$ ? isSvgMode = !1 : "foreignObject" === l.tagName && (isSvgMode = !0));
|
|
330
332
|
}
|
|
331
|
-
return BUILD.slotRelocation && (
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
return BUILD.slotRelocation && (l["s-hn"] = hostTagName, 3 & s.$flags$ && (l["s-sr"] = !0,
|
|
334
|
+
l["s-cr"] = contentRef, l["s-sn"] = s.$name$ || "", r = e && e.$children$ && e.$children$[o],
|
|
335
|
+
r && r.$tag$ === s.$tag$ && e.$elm$ && putBackInOriginalLocation(e.$elm$, !1))),
|
|
336
|
+
l;
|
|
335
337
|
}, putBackInOriginalLocation = (e, t) => {
|
|
336
338
|
plt.$flags$ |= 1;
|
|
337
339
|
const o = e.childNodes;
|
|
@@ -372,22 +374,24 @@ const createElm = (e, t, o, n) => {
|
|
|
372
374
|
addVnodes(o, null, t, s, 0, s.length - 1)) : BUILD.updatable && null !== n && removeVnodes(n, 0, n.length - 1),
|
|
373
375
|
BUILD.svg && isSvgMode && "svg" === l && (isSvgMode = !1));
|
|
374
376
|
}, updateFallbackSlotVisibility = e => {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
377
|
+
const t = e.childNodes;
|
|
378
|
+
let o, n, s, l, a, r;
|
|
379
|
+
for (n = 0, s = t.length; n < s; n++) if (o = t[n], 1 === o.nodeType) {
|
|
380
|
+
if (o["s-sr"]) for (a = o["s-sn"], o.hidden = !1, l = 0; l < s; l++) if (r = t[l].nodeType,
|
|
381
|
+
t[l]["s-hn"] !== o["s-hn"] || "" !== a) {
|
|
382
|
+
if (1 === r && a === t[l].getAttribute("slot")) {
|
|
383
|
+
o.hidden = !0;
|
|
381
384
|
break;
|
|
382
385
|
}
|
|
383
|
-
} else if (1 ===
|
|
384
|
-
|
|
386
|
+
} else if (1 === r || 3 === r && "" !== t[l].textContent.trim()) {
|
|
387
|
+
o.hidden = !0;
|
|
385
388
|
break;
|
|
386
389
|
}
|
|
387
|
-
updateFallbackSlotVisibility(
|
|
390
|
+
updateFallbackSlotVisibility(o);
|
|
388
391
|
}
|
|
389
392
|
}, relocateNodes = [], relocateSlotContent = e => {
|
|
390
|
-
let t, o, n, s, l, a, r = 0
|
|
393
|
+
let t, o, n, s, l, a, r = 0;
|
|
394
|
+
const i = e.childNodes, d = i.length;
|
|
391
395
|
for (;r < d; r++) {
|
|
392
396
|
if (t = i[r], t["s-sr"] && (o = t["s-cr"]) && o.parentNode) for (n = o.parentNode.childNodes,
|
|
393
397
|
s = t["s-sn"], a = n.length - 1; a >= 0; a--) o = n[a], o["s-cn"] || o["s-nr"] || o["s-hn"] === t["s-hn"] || (isNodeLocatedInSlot(o, s) ? (l = relocateNodes.find((e => e.$nodeToRelocate$ === o)),
|
|
@@ -782,7 +786,8 @@ const callRender = (e, t, o) => {
|
|
|
782
786
|
e.cloneNode = function(e) {
|
|
783
787
|
const o = this, n = !!BUILD.shadowDom && o.shadowRoot && supportsShadow, s = t.call(o, !!n && e);
|
|
784
788
|
if (BUILD.slot && !n && e) {
|
|
785
|
-
let e, t, n = 0
|
|
789
|
+
let e, t, n = 0;
|
|
790
|
+
const l = [ "s-id", "s-cr", "s-lr", "s-rc", "s-sc", "s-p", "s-cn", "s-sr", "s-sn", "s-hn", "s-ol", "s-nr", "s-si" ];
|
|
786
791
|
for (;n < o.childNodes.length; n++) e = o.childNodes[n]["s-nr"], t = l.every((e => !o.childNodes[n][e])),
|
|
787
792
|
e && (BUILD.appendChildSlotFix && s.__appendChild ? s.__appendChild(e.cloneNode(!0)) : s.appendChild(e.cloneNode(!0))),
|
|
788
793
|
t && s.appendChild(o.childNodes[n].cloneNode(!0));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/hydrate",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.1",
|
|
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
|
|
@@ -55,15 +55,15 @@ const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)", _cssColo
|
|
|
55
55
|
return c;
|
|
56
56
|
}, r = (e => {
|
|
57
57
|
const t = [];
|
|
58
|
-
let o
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
let o = 0;
|
|
59
|
+
return {
|
|
60
|
+
content: (e = e.replace(/(\[[^\]]*\])/g, ((e, s) => {
|
|
61
|
+
const c = `__ph-${o}__`;
|
|
62
|
+
return t.push(s), o++, c;
|
|
63
|
+
}))).replace(/(:nth-[-\w]+)(\([^)]+\))/g, ((e, s, c) => {
|
|
64
|
+
const r = `__ph-${o}__`;
|
|
65
|
+
return t.push(c), o++, s + r;
|
|
66
|
+
})),
|
|
67
67
|
placeholders: t
|
|
68
68
|
};
|
|
69
69
|
})(e);
|
package/internal/package.json
CHANGED
|
@@ -251,6 +251,13 @@ export interface ConfigExtras {
|
|
|
251
251
|
* and below. Defaults to `false`.
|
|
252
252
|
*/
|
|
253
253
|
dynamicImportShim?: boolean;
|
|
254
|
+
/**
|
|
255
|
+
* Experimental flag. Projects that use a Stencil library built using the `dist` output target may have trouble lazily
|
|
256
|
+
* loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil
|
|
257
|
+
* lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
|
|
258
|
+
* the size of the compiled output. Defaults to `false`.
|
|
259
|
+
*/
|
|
260
|
+
experimentalImportInjection?: boolean;
|
|
254
261
|
/**
|
|
255
262
|
* Dispatches component lifecycle events. Mainly used for testing. Defaults to `false`.
|
|
256
263
|
*/
|
|
@@ -317,6 +324,38 @@ export interface Config extends StencilConfig {
|
|
|
317
324
|
_isValidated?: boolean;
|
|
318
325
|
_isTesting?: boolean;
|
|
319
326
|
}
|
|
327
|
+
/**
|
|
328
|
+
* A 'loose' type useful for wrapping an incomplete / possible malformed
|
|
329
|
+
* object as we work on getting it comply with a particular Interface T.
|
|
330
|
+
*
|
|
331
|
+
* Example:
|
|
332
|
+
*
|
|
333
|
+
* ```ts
|
|
334
|
+
* interface Foo {
|
|
335
|
+
* bar: string
|
|
336
|
+
* }
|
|
337
|
+
*
|
|
338
|
+
* function validateFoo(foo: Loose<Foo>): Foo {
|
|
339
|
+
* let validatedFoo = {
|
|
340
|
+
* ...foo,
|
|
341
|
+
* bar: foo.bar || DEFAULT_BAR
|
|
342
|
+
* }
|
|
343
|
+
*
|
|
344
|
+
* return validatedFoo
|
|
345
|
+
* }
|
|
346
|
+
* ```
|
|
347
|
+
*
|
|
348
|
+
* Use this when you need to take user input or something from some other part
|
|
349
|
+
* of the world that we don't control and transform it into something
|
|
350
|
+
* conforming to a given interface. For best results, pair with a validation
|
|
351
|
+
* function as shown in the example.
|
|
352
|
+
*/
|
|
353
|
+
declare type Loose<T extends Object> = Record<string, any> & Partial<T>;
|
|
354
|
+
/**
|
|
355
|
+
* A Loose version of the Config interface. This is intended to let us load a partial config
|
|
356
|
+
* and have type information carry though as we construct an object which is a valid `Config`.
|
|
357
|
+
*/
|
|
358
|
+
export declare type UnvalidatedConfig = Loose<Config>;
|
|
320
359
|
export interface HydratedFlag {
|
|
321
360
|
/**
|
|
322
361
|
* Defaults to `hydrated`.
|
|
@@ -486,6 +525,7 @@ export interface ConfigFlags {
|
|
|
486
525
|
e2e?: boolean;
|
|
487
526
|
emulate?: string;
|
|
488
527
|
es5?: boolean;
|
|
528
|
+
esm?: boolean;
|
|
489
529
|
headless?: boolean;
|
|
490
530
|
help?: boolean;
|
|
491
531
|
log?: boolean;
|
|
@@ -1720,9 +1760,23 @@ export interface OutputTargetCustom extends OutputTargetBase {
|
|
|
1720
1760
|
generator: (config: Config, compilerCtx: any, buildCtx: any, docs: any) => Promise<void>;
|
|
1721
1761
|
copy?: CopyTask[];
|
|
1722
1762
|
}
|
|
1763
|
+
/**
|
|
1764
|
+
* Output target for generating [custom data](https://github.com/microsoft/vscode-custom-data) for VS Code as a JSON
|
|
1765
|
+
* file.
|
|
1766
|
+
*/
|
|
1723
1767
|
export interface OutputTargetDocsVscode extends OutputTargetBase {
|
|
1768
|
+
/**
|
|
1769
|
+
* Designates this output target to be used for generating VS Code custom data.
|
|
1770
|
+
* @see OutputTargetBase#type
|
|
1771
|
+
*/
|
|
1724
1772
|
type: 'docs-vscode';
|
|
1773
|
+
/**
|
|
1774
|
+
* The location on disk to write the JSON file.
|
|
1775
|
+
*/
|
|
1725
1776
|
file: string;
|
|
1777
|
+
/**
|
|
1778
|
+
* A base URL to find the source code of the component(s) described in the JSON file.
|
|
1779
|
+
*/
|
|
1726
1780
|
sourceCodeBaseUrl?: string;
|
|
1727
1781
|
}
|
|
1728
1782
|
export interface OutputTargetDocsReadme extends OutputTargetBase {
|
|
@@ -1779,7 +1833,13 @@ export interface OutputTargetDistCustomElementsBundle extends OutputTargetBaseNe
|
|
|
1779
1833
|
includeGlobalScripts?: boolean;
|
|
1780
1834
|
minify?: boolean;
|
|
1781
1835
|
}
|
|
1836
|
+
/**
|
|
1837
|
+
* The base type for output targets. All output targets should extend this base type.
|
|
1838
|
+
*/
|
|
1782
1839
|
export interface OutputTargetBase {
|
|
1840
|
+
/**
|
|
1841
|
+
* A unique string to differentiate one output target from another
|
|
1842
|
+
*/
|
|
1783
1843
|
type: string;
|
|
1784
1844
|
}
|
|
1785
1845
|
export declare type OutputTargetBuild = OutputTargetDistCollection | OutputTargetDistLazy;
|
|
@@ -1899,7 +1959,7 @@ export interface LoadConfigInit {
|
|
|
1899
1959
|
* User config object to merge into default config and
|
|
1900
1960
|
* config loaded from a file path.
|
|
1901
1961
|
*/
|
|
1902
|
-
config?:
|
|
1962
|
+
config?: UnvalidatedConfig;
|
|
1903
1963
|
/**
|
|
1904
1964
|
* Absolute path to a Stencil config file. This path cannot be
|
|
1905
1965
|
* relative and it does not resolve config files within a directory.
|
|
@@ -1914,8 +1974,13 @@ export interface LoadConfigInit {
|
|
|
1914
1974
|
*/
|
|
1915
1975
|
initTsConfig?: boolean;
|
|
1916
1976
|
}
|
|
1977
|
+
/**
|
|
1978
|
+
* Results from an attempt to load a config. The values on this interface
|
|
1979
|
+
* have not yet been validated and are not ready to be used for arbitrary
|
|
1980
|
+
* operations around the codebase.
|
|
1981
|
+
*/
|
|
1917
1982
|
export interface LoadConfigResults {
|
|
1918
|
-
config:
|
|
1983
|
+
config: UnvalidatedConfig;
|
|
1919
1984
|
diagnostics: Diagnostic[];
|
|
1920
1985
|
tsconfig: {
|
|
1921
1986
|
path: string;
|
|
@@ -98,7 +98,7 @@ const defaultConsoleError = e => {
|
|
|
98
98
|
caughtErrors.push(new Error(e.join(", ")));
|
|
99
99
|
}, consoleDevWarn = (...e) => {
|
|
100
100
|
const t = e.filter((e => "string" == typeof e || "number" == typeof e || "boolean" == typeof e));
|
|
101
|
-
console.warn
|
|
101
|
+
console.warn(...t);
|
|
102
102
|
}, nextTick = e => {
|
|
103
103
|
queuedTicks.push(e);
|
|
104
104
|
}, win = mockDoc.setupGlobal(global), doc = win.document;
|
|
@@ -156,7 +156,8 @@ const createTime = (e, t = "") => {
|
|
|
156
156
|
let o = styles.get(e);
|
|
157
157
|
o = t, styles.set(e, o);
|
|
158
158
|
}, addStyle = (e, t, a, o) => {
|
|
159
|
-
let s = getScopeId(t, a)
|
|
159
|
+
let s = getScopeId(t, a);
|
|
160
|
+
const n = styles.get(s);
|
|
160
161
|
if (!appData.BUILD.attachStyles) return s;
|
|
161
162
|
if (e = 11 === e.nodeType ? e : doc, n) if ("string" == typeof n) {
|
|
162
163
|
e = e.head || e;
|
|
@@ -181,8 +182,8 @@ const createTime = (e, t = "") => {
|
|
|
181
182
|
a.classList.add(n + "-h"), appData.BUILD.scoped && 2 & o && a.classList.add(n + "-s")),
|
|
182
183
|
s();
|
|
183
184
|
}, getScopeId = (e, t) => "sc-" + (appData.BUILD.mode && t && 32 & e.$flags$ ? e.$tagName$ + "-" + t : e.$tagName$), computeMode = e => modeResolutionChain.map((t => t(e))).find((e => !!e)), EMPTY_OBJ = {}, isComplexType = e => "object" == (e = typeof e) || "function" === e, h = (e, t, ...a) => {
|
|
184
|
-
let o = null, s = null, n = null, l = !1, r = !1
|
|
185
|
-
const i = t => {
|
|
185
|
+
let o = null, s = null, n = null, l = !1, r = !1;
|
|
186
|
+
const p = [], i = t => {
|
|
186
187
|
for (let a = 0; a < t.length; a++) o = t[a], Array.isArray(o) ? i(o) : null != o && "boolean" != typeof o && ((l = "function" != typeof e && !isComplexType(o)) ? o = String(o) : appData.BUILD.isDev && "function" != typeof e && void 0 === o.$flags$ && consoleDevError("vNode passed as children has unexpected type.\nMake sure it's using the correct h() function.\nEmpty objects can also be the cause, look for JSX comments that became objects."),
|
|
187
188
|
l && r ? p[p.length - 1].$text$ += o : p.push(l ? newVNode(null, o) : o), r = l);
|
|
188
189
|
};
|
|
@@ -246,7 +247,7 @@ const createTime = (e, t = "") => {
|
|
|
246
247
|
const p = isComplexType(o);
|
|
247
248
|
if ((l || p && null !== o) && !s) try {
|
|
248
249
|
if (e.tagName.includes("-")) e[t] = o; else {
|
|
249
|
-
|
|
250
|
+
const s = null == o ? "" : o;
|
|
250
251
|
"list" === t ? l = !1 : null != a && e[t] == s || (e[t] = s);
|
|
251
252
|
}
|
|
252
253
|
} catch (e) {}
|
|
@@ -267,22 +268,23 @@ const createTime = (e, t = "") => {
|
|
|
267
268
|
let scopeId, contentRef, hostTagName, useNativeShadowDom = !1, checkSlotFallbackVisibility = !1, checkSlotRelocate = !1, isSvgMode = !1;
|
|
268
269
|
|
|
269
270
|
const createElm = (e, t, a, o) => {
|
|
270
|
-
|
|
271
|
+
const s = t.$children$[a];
|
|
272
|
+
let n, l, r, p = 0;
|
|
271
273
|
if (appData.BUILD.slotRelocation && !useNativeShadowDom && (checkSlotRelocate = !0,
|
|
272
|
-
"slot" ===
|
|
273
|
-
appData.BUILD.isDev &&
|
|
274
|
-
appData.BUILD.vdomText && null !==
|
|
275
|
-
if (appData.BUILD.svg && !isSvgMode && (isSvgMode = "svg" ===
|
|
276
|
-
appData.BUILD.svg && isSvgMode && "foreignObject" ===
|
|
277
|
-
appData.BUILD.vdomAttribute && updateElement(null,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
appData.BUILD.svg && ("svg" ===
|
|
274
|
+
"slot" === s.$tag$ && (scopeId && o.classList.add(scopeId + "-s"), s.$flags$ |= s.$children$ ? 2 : 1)),
|
|
275
|
+
appData.BUILD.isDev && s.$elm$ && consoleDevError(`The JSX ${null !== s.$text$ ? `"${s.$text$}" text` : `"${s.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`),
|
|
276
|
+
appData.BUILD.vdomText && null !== s.$text$) n = s.$elm$ = doc.createTextNode(s.$text$); else if (appData.BUILD.slotRelocation && 1 & s.$flags$) n = s.$elm$ = appData.BUILD.isDebug || appData.BUILD.hydrateServerSide ? slotReferenceDebugNode(s) : doc.createTextNode(""); else {
|
|
277
|
+
if (appData.BUILD.svg && !isSvgMode && (isSvgMode = "svg" === s.$tag$), n = s.$elm$ = appData.BUILD.svg ? doc.createElementNS(isSvgMode ? "http://www.w3.org/2000/svg" : "http://www.w3.org/1999/xhtml", appData.BUILD.slotRelocation && 2 & s.$flags$ ? "slot-fb" : s.$tag$) : doc.createElement(appData.BUILD.slotRelocation && 2 & s.$flags$ ? "slot-fb" : s.$tag$),
|
|
278
|
+
appData.BUILD.svg && isSvgMode && "foreignObject" === s.$tag$ && (isSvgMode = !1),
|
|
279
|
+
appData.BUILD.vdomAttribute && updateElement(null, s, isSvgMode), (appData.BUILD.shadowDom || appData.BUILD.scoped) && null != scopeId && n["s-si"] !== scopeId && n.classList.add(n["s-si"] = scopeId),
|
|
280
|
+
s.$children$) for (p = 0; p < s.$children$.length; ++p) l = createElm(e, s, p, n),
|
|
281
|
+
l && n.appendChild(l);
|
|
282
|
+
appData.BUILD.svg && ("svg" === s.$tag$ ? isSvgMode = !1 : "foreignObject" === n.tagName && (isSvgMode = !0));
|
|
281
283
|
}
|
|
282
|
-
return appData.BUILD.slotRelocation && (
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
284
|
+
return appData.BUILD.slotRelocation && (n["s-hn"] = hostTagName, 3 & s.$flags$ && (n["s-sr"] = !0,
|
|
285
|
+
n["s-cr"] = contentRef, n["s-sn"] = s.$name$ || "", r = e && e.$children$ && e.$children$[a],
|
|
286
|
+
r && r.$tag$ === s.$tag$ && e.$elm$ && putBackInOriginalLocation(e.$elm$, !1))),
|
|
287
|
+
n;
|
|
286
288
|
}, putBackInOriginalLocation = (e, t) => {
|
|
287
289
|
plt.$flags$ |= 1;
|
|
288
290
|
const a = e.childNodes;
|
|
@@ -323,22 +325,24 @@ const createElm = (e, t, a, o) => {
|
|
|
323
325
|
addVnodes(a, null, t, s, 0, s.length - 1)) : appData.BUILD.updatable && null !== o && removeVnodes(o, 0, o.length - 1),
|
|
324
326
|
appData.BUILD.svg && isSvgMode && "svg" === n && (isSvgMode = !1));
|
|
325
327
|
}, updateFallbackSlotVisibility = e => {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
328
|
+
const t = e.childNodes;
|
|
329
|
+
let a, o, s, n, l, r;
|
|
330
|
+
for (o = 0, s = t.length; o < s; o++) if (a = t[o], 1 === a.nodeType) {
|
|
331
|
+
if (a["s-sr"]) for (l = a["s-sn"], a.hidden = !1, n = 0; n < s; n++) if (r = t[n].nodeType,
|
|
332
|
+
t[n]["s-hn"] !== a["s-hn"] || "" !== l) {
|
|
333
|
+
if (1 === r && l === t[n].getAttribute("slot")) {
|
|
334
|
+
a.hidden = !0;
|
|
332
335
|
break;
|
|
333
336
|
}
|
|
334
|
-
} else if (1 ===
|
|
335
|
-
|
|
337
|
+
} else if (1 === r || 3 === r && "" !== t[n].textContent.trim()) {
|
|
338
|
+
a.hidden = !0;
|
|
336
339
|
break;
|
|
337
340
|
}
|
|
338
|
-
updateFallbackSlotVisibility(
|
|
341
|
+
updateFallbackSlotVisibility(a);
|
|
339
342
|
}
|
|
340
343
|
}, relocateNodes = [], relocateSlotContent = e => {
|
|
341
|
-
let t, a, o, s, n, l, r = 0
|
|
344
|
+
let t, a, o, s, n, l, r = 0;
|
|
345
|
+
const p = e.childNodes, i = p.length;
|
|
342
346
|
for (;r < i; r++) {
|
|
343
347
|
if (t = p[r], t["s-sr"] && (a = t["s-cr"]) && a.parentNode) for (o = a.parentNode.childNodes,
|
|
344
348
|
s = t["s-sn"], l = o.length - 1; l >= 0; l--) a = o[l], a["s-cn"] || a["s-nr"] || a["s-hn"] === t["s-hn"] || (isNodeLocatedInSlot(a, s) ? (n = relocateNodes.find((e => e.$nodeToRelocate$ === a)),
|
|
@@ -724,7 +728,8 @@ const callRender = (e, t, a) => {
|
|
|
724
728
|
e.cloneNode = function(e) {
|
|
725
729
|
const a = this, o = !!appData.BUILD.shadowDom && a.shadowRoot && exports.supportsShadow, s = t.call(a, !!o && e);
|
|
726
730
|
if (appData.BUILD.slot && !o && e) {
|
|
727
|
-
let e, t, o = 0
|
|
731
|
+
let e, t, o = 0;
|
|
732
|
+
const n = [ "s-id", "s-cr", "s-lr", "s-rc", "s-sc", "s-p", "s-cn", "s-sr", "s-sn", "s-hn", "s-ol", "s-nr", "s-si" ];
|
|
728
733
|
for (;o < a.childNodes.length; o++) e = a.childNodes[o]["s-nr"], t = n.every((e => !a.childNodes[o][e])),
|
|
729
734
|
e && (appData.BUILD.appendChildSlotFix && s.__appendChild ? s.__appendChild(e.cloneNode(!0)) : s.appendChild(e.cloneNode(!0))),
|
|
730
735
|
t && s.appendChild(a.childNodes[o].cloneNode(!0));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/testing",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.1",
|
|
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
|
|
@@ -55,15 +55,15 @@ const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)", _cssColo
|
|
|
55
55
|
return c;
|
|
56
56
|
}, r = (e => {
|
|
57
57
|
const t = [];
|
|
58
|
-
let o
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
let o = 0;
|
|
59
|
+
return {
|
|
60
|
+
content: (e = e.replace(/(\[[^\]]*\])/g, ((e, s) => {
|
|
61
|
+
const c = `__ph-${o}__`;
|
|
62
|
+
return t.push(s), o++, c;
|
|
63
|
+
}))).replace(/(:nth-[-\w]+)(\([^)]+\))/g, ((e, s, c) => {
|
|
64
|
+
const r = `__ph-${o}__`;
|
|
65
|
+
return t.push(c), o++, s + r;
|
|
66
|
+
})),
|
|
67
67
|
placeholders: t
|
|
68
68
|
};
|
|
69
69
|
})(e);
|
package/mock-doc/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Mock Doc (CommonJS) v2.
|
|
2
|
+
Stencil Mock Doc (CommonJS) v2.16.1 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var mockDoc = (function(exports) {
|
|
5
5
|
'use strict';
|
|
@@ -1528,7 +1528,11 @@ class MockNode {
|
|
|
1528
1528
|
if (otherNode === this) {
|
|
1529
1529
|
return true;
|
|
1530
1530
|
}
|
|
1531
|
-
|
|
1531
|
+
const childNodes = Array.from(this.childNodes);
|
|
1532
|
+
if (childNodes.includes(otherNode)) {
|
|
1533
|
+
return true;
|
|
1534
|
+
}
|
|
1535
|
+
return childNodes.some((node) => this.contains.bind(node)(otherNode));
|
|
1532
1536
|
}
|
|
1533
1537
|
removeChild(childNode) {
|
|
1534
1538
|
const index = this.childNodes.indexOf(childNode);
|
|
@@ -4263,9 +4267,11 @@ function cloneDocument(srcDoc) {
|
|
|
4263
4267
|
const dstWin = cloneWindow(srcDoc.defaultView);
|
|
4264
4268
|
return dstWin.document;
|
|
4265
4269
|
}
|
|
4270
|
+
// TODO(STENCIL-345) - Evaluate reconciling MockWindow, Window differences
|
|
4266
4271
|
/**
|
|
4267
4272
|
* Constrain setTimeout() to 1ms, but still async. Also
|
|
4268
4273
|
* only allow setInterval() to fire once, also constrained to 1ms.
|
|
4274
|
+
* @param win the mock window instance to update
|
|
4269
4275
|
*/
|
|
4270
4276
|
function constrainTimeouts(win) {
|
|
4271
4277
|
win.__allowInterval = false;
|
package/mock-doc/index.d.ts
CHANGED
|
@@ -191,6 +191,7 @@ declare class MockLinkElement extends MockHTMLElement {
|
|
|
191
191
|
set href(value: string);
|
|
192
192
|
}
|
|
193
193
|
declare class MockMetaElement extends MockHTMLElement {
|
|
194
|
+
content: string;
|
|
194
195
|
constructor(ownerDocument: any);
|
|
195
196
|
}
|
|
196
197
|
declare class MockScriptElement extends MockHTMLElement {
|
|
@@ -754,6 +755,11 @@ declare class MockWindow {
|
|
|
754
755
|
screenY: number;
|
|
755
756
|
scrollX: number;
|
|
756
757
|
scrollY: number;
|
|
758
|
+
CustomEvent: typeof MockCustomEvent;
|
|
759
|
+
Event: typeof MockEvent;
|
|
760
|
+
Headers: typeof MockHeaders;
|
|
761
|
+
KeyboardEvent: typeof MockKeyboardEvent;
|
|
762
|
+
MouseEvent: typeof MockMouseEvent;
|
|
757
763
|
constructor(html?: string | boolean);
|
|
758
764
|
addEventListener(type: string, handler: (ev?: any) => void): void;
|
|
759
765
|
alert(msg: string): void;
|
|
@@ -791,8 +797,8 @@ declare class MockWindow {
|
|
|
791
797
|
get IntersectionObserver(): typeof MockIntersectionObserver;
|
|
792
798
|
get localStorage(): MockStorage;
|
|
793
799
|
set localStorage(locStorage: MockStorage);
|
|
794
|
-
get location():
|
|
795
|
-
set location(val: Location);
|
|
800
|
+
get location(): MockLocation;
|
|
801
|
+
set location(val: Location | string);
|
|
796
802
|
matchMedia(): {
|
|
797
803
|
matches: boolean;
|
|
798
804
|
};
|
|
@@ -917,6 +923,7 @@ declare function cloneDocument(srcDoc: Document): Document;
|
|
|
917
923
|
/**
|
|
918
924
|
* Constrain setTimeout() to 1ms, but still async. Also
|
|
919
925
|
* only allow setInterval() to fire once, also constrained to 1ms.
|
|
926
|
+
* @param win the mock window instance to update
|
|
920
927
|
*/
|
|
921
928
|
declare function constrainTimeouts(win: any): void;
|
|
922
929
|
export { MockAttr, MockAttributeMap, MockComment, MockCustomEvent, MockDocument, MockElement, MockHTMLElement, MockHeaders, MockKeyboardEvent, MockMouseEvent, MockNode, MockRequest, MockRequestInfo, MockRequestInit, MockResponse, MockResponseInit, MockTextNode, MockWindow, NODE_TYPES, SerializeNodeToHtmlOptions, cloneAttributes, cloneDocument, cloneWindow, constrainTimeouts, createDocument, createFragment, parseHtmlToDocument, parseHtmlToFragment, patchWindow, resetDocument, serializeNodeToHtml, setupGlobal, teardownGlobal }
|
package/mock-doc/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Mock Doc v2.
|
|
2
|
+
Stencil Mock Doc v2.16.1 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
const CONTENT_REF_ID = 'r';
|
|
5
5
|
const ORG_LOCATION_ID = 'o';
|
|
@@ -1525,7 +1525,11 @@ class MockNode {
|
|
|
1525
1525
|
if (otherNode === this) {
|
|
1526
1526
|
return true;
|
|
1527
1527
|
}
|
|
1528
|
-
|
|
1528
|
+
const childNodes = Array.from(this.childNodes);
|
|
1529
|
+
if (childNodes.includes(otherNode)) {
|
|
1530
|
+
return true;
|
|
1531
|
+
}
|
|
1532
|
+
return childNodes.some((node) => this.contains.bind(node)(otherNode));
|
|
1529
1533
|
}
|
|
1530
1534
|
removeChild(childNode) {
|
|
1531
1535
|
const index = this.childNodes.indexOf(childNode);
|
|
@@ -4260,9 +4264,11 @@ function cloneDocument(srcDoc) {
|
|
|
4260
4264
|
const dstWin = cloneWindow(srcDoc.defaultView);
|
|
4261
4265
|
return dstWin.document;
|
|
4262
4266
|
}
|
|
4267
|
+
// TODO(STENCIL-345) - Evaluate reconciling MockWindow, Window differences
|
|
4263
4268
|
/**
|
|
4264
4269
|
* Constrain setTimeout() to 1ms, but still async. Also
|
|
4265
4270
|
* only allow setInterval() to fire once, also constrained to 1ms.
|
|
4271
|
+
* @param win the mock window instance to update
|
|
4266
4272
|
*/
|
|
4267
4273
|
function constrainTimeouts(win) {
|
|
4268
4274
|
win.__allowInterval = false;
|