@stencil/core 2.18.0 → 2.18.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.
Files changed (61) hide show
  1. package/cli/index.cjs +261 -206
  2. package/cli/index.d.ts +1 -0
  3. package/cli/index.js +261 -206
  4. package/cli/package.json +1 -1
  5. package/compiler/package.json +1 -1
  6. package/compiler/stencil.d.ts +2 -2
  7. package/compiler/stencil.js +48945 -47701
  8. package/compiler/stencil.min.js +2 -2
  9. package/dependencies.json +1 -1
  10. package/dev-server/client/index.d.ts +2 -2
  11. package/dev-server/client/index.js +241 -241
  12. package/dev-server/client/package.json +1 -1
  13. package/dev-server/connector.html +3 -3
  14. package/dev-server/index.d.ts +1 -1
  15. package/dev-server/index.js +2 -2
  16. package/dev-server/package.json +1 -1
  17. package/dev-server/server-process.js +1230 -1199
  18. package/internal/app-data/package.json +1 -1
  19. package/internal/client/css-shim.js +2 -2
  20. package/internal/client/dom.js +1 -1
  21. package/internal/client/index.js +619 -601
  22. package/internal/client/package.json +1 -1
  23. package/internal/client/patch-browser.js +1 -1
  24. package/internal/client/patch-esm.js +1 -1
  25. package/internal/client/polyfills/css-shim.js +1 -1
  26. package/internal/client/shadow-css.js +1 -1
  27. package/internal/hydrate/index.js +119 -119
  28. package/internal/hydrate/package.json +1 -1
  29. package/internal/hydrate/runner.js +100 -100
  30. package/internal/package.json +1 -1
  31. package/internal/stencil-core/index.d.ts +8 -10
  32. package/internal/stencil-private.d.ts +77 -34
  33. package/internal/stencil-public-compiler.d.ts +2 -2
  34. package/internal/stencil-public-runtime.d.ts +15 -4
  35. package/internal/testing/index.js +148 -148
  36. package/internal/testing/package.json +1 -1
  37. package/mock-doc/index.cjs +898 -898
  38. package/mock-doc/index.js +898 -898
  39. package/mock-doc/package.json +1 -1
  40. package/package.json +19 -26
  41. package/readme.md +27 -33
  42. package/screenshot/index.d.ts +1 -1
  43. package/screenshot/index.js +3 -3
  44. package/screenshot/package.json +1 -1
  45. package/screenshot/pixel-match.js +983 -849
  46. package/sys/node/glob.js +1 -1
  47. package/sys/node/index.d.ts +2 -0
  48. package/sys/node/index.js +374 -373
  49. package/sys/node/package.json +1 -1
  50. package/sys/node/worker.js +1 -1
  51. package/testing/index.d.ts +6 -6
  52. package/testing/index.js +345 -345
  53. package/testing/jest/jest-config.d.ts +1 -1
  54. package/testing/matchers/index.d.ts +3 -3
  55. package/testing/mock-fetch.d.ts +1 -1
  56. package/testing/mocks.d.ts +2 -2
  57. package/testing/package.json +1 -1
  58. package/testing/puppeteer/puppeteer-element.d.ts +2 -2
  59. package/testing/puppeteer/puppeteer-events.d.ts +1 -1
  60. package/testing/testing-logger.d.ts +1 -1
  61. package/testing/testing.d.ts +1 -1
@@ -1,9 +1,10 @@
1
+ export type { StencilConfig as Config, PrerenderConfig } from '../stencil-public-compiler';
1
2
  export type {
2
3
  ChildNode,
3
- ComponentOptions,
4
4
  ComponentDidLoad,
5
5
  ComponentDidUpdate,
6
6
  ComponentInterface,
7
+ ComponentOptions,
7
8
  ComponentWillLoad,
8
9
  ComponentWillUpdate,
9
10
  EventEmitter,
@@ -11,42 +12,39 @@ export type {
11
12
  FunctionalComponent,
12
13
  FunctionalUtilities,
13
14
  JSX,
14
- MethodOptions,
15
- ModeStyles,
16
15
  ListenOptions,
17
16
  ListenTargetOptions,
17
+ MethodOptions,
18
+ ModeStyles,
18
19
  PropOptions,
19
20
  QueueApi,
20
21
  RafCallback,
21
22
  VNode,
22
23
  VNodeData,
23
24
  } from '../stencil-public-runtime';
24
-
25
25
  export {
26
26
  Build,
27
27
  Component,
28
28
  Element,
29
+ Env,
29
30
  Event,
31
+ forceUpdate,
32
+ Fragment,
30
33
  getAssetPath,
31
34
  getElement,
32
35
  getMode,
33
36
  getRenderingRef,
34
- Fragment,
35
- forceUpdate,
36
37
  h,
37
38
  Host,
38
- Env,
39
39
  Listen,
40
40
  Method,
41
41
  Prop,
42
42
  readTask,
43
43
  setAssetPath,
44
+ setErrorHandler,
44
45
  setMode,
45
46
  setPlatformHelpers,
46
47
  State,
47
48
  Watch,
48
49
  writeTask,
49
- setErrorHandler,
50
50
  } from '../stencil-public-runtime';
51
-
52
- export type { StencilConfig as Config, PrerenderConfig } from '../stencil-public-compiler';
@@ -1,7 +1,6 @@
1
- import { BuildResultsComponentGraph } from '.';
2
- import type { BuildEvents, BuildLog, CompilerBuildResults, CompilerBuildStart, CompilerFsStats, CompilerRequestResponse, CompilerSystem, Config, CopyResults, DevServerConfig, DevServerEditor, Diagnostic, Logger, LoggerTimeSpan, OptimizeCssInput, OptimizeCssOutput, OutputTargetWww, PageReloadStrategy, PrerenderConfig, StyleDoc, LoggerLineUpdater, TaskCommand } from './stencil-public-compiler';
3
- import type { ComponentInterface, ListenOptions, ListenTargetOptions, VNode, VNodeData } from './stencil-public-runtime';
4
1
  import type { InMemoryFileSystem } from '../compiler/sys/in-memory-fs';
2
+ import type { BuildEvents, BuildLog, BuildResultsComponentGraph, CompilerBuildResults, CompilerBuildStart, CompilerFsStats, CompilerRequestResponse, CompilerSystem, Config, CopyResults, DevServerConfig, DevServerEditor, Diagnostic, Logger, LoggerLineUpdater, LoggerTimeSpan, OptimizeCssInput, OptimizeCssOutput, OutputTargetWww, PageReloadStrategy, PrerenderConfig, StyleDoc, TaskCommand } from './stencil-public-compiler';
3
+ import type { ComponentInterface, ListenOptions, ListenTargetOptions, VNode, VNodeData } from './stencil-public-runtime';
5
4
  export interface SourceMap {
6
5
  file: string;
7
6
  mappings: string;
@@ -824,6 +823,10 @@ export interface ComponentConstructor {
824
823
  isProxied?: boolean;
825
824
  isStyleRegistered?: boolean;
826
825
  }
826
+ /**
827
+ * A mapping from class member names to a list of methods which are watching
828
+ * them.
829
+ */
827
830
  export interface ComponentConstructorWatchers {
828
831
  [propName: string]: string[];
829
832
  }
@@ -833,9 +836,9 @@ export interface ComponentTestingConstructor extends ComponentConstructor {
833
836
  componentWillLoad?: Function;
834
837
  componentWillUpdate?: Function;
835
838
  componentWillRender?: Function;
836
- __componentWillLoad?: Function;
837
- __componentWillUpdate?: Function;
838
- __componentWillRender?: Function;
839
+ __componentWillLoad?: Function | null;
840
+ __componentWillUpdate?: Function | null;
841
+ __componentWillRender?: Function | null;
839
842
  };
840
843
  }
841
844
  export interface ComponentNativeConstructor extends ComponentConstructor {
@@ -1320,42 +1323,82 @@ export declare type ComponentRuntimeMetaCompact = [
1320
1323
  /** listeners */
1321
1324
  ComponentRuntimeHostListener[]?
1322
1325
  ];
1326
+ /**
1327
+ * Runtime metadata for a Stencil component
1328
+ */
1323
1329
  export interface ComponentRuntimeMeta {
1330
+ /**
1331
+ * This number is used to hold a series of bitflags for various features we
1332
+ * support on components. The flags which this value is intended to store are
1333
+ * documented in the {@link CMP_FLAGS} enum.
1334
+ */
1324
1335
  $flags$: number;
1336
+ /**
1337
+ * Just what it says on the tin - the tag name for the component, as set in
1338
+ * the `@Component` decorator.
1339
+ */
1325
1340
  $tagName$: string;
1326
- $members$?: ComponentRuntimeMembers;
1327
- $listeners$?: ComponentRuntimeHostListener[];
1328
- $attrsToReflect$?: [string, string][];
1329
- $watchers$?: ComponentConstructorWatchers;
1330
- $lazyBundleId$?: string;
1331
- }
1332
- export interface ComponentRuntimeMembers {
1333
- [memberName: string]: ComponentRuntimeMember;
1334
- }
1335
- export declare type ComponentRuntimeMember = [
1336
1341
  /**
1337
- * flags data
1342
+ * A map of the component's members, which could include fields decorated
1343
+ * with `@Prop`, `@State`, etc as well as methods.
1338
1344
  */
1339
- number,
1345
+ $members$?: ComponentRuntimeMembers;
1340
1346
  /**
1341
- * attribute name to observe
1347
+ * Information about listeners on the component.
1342
1348
  */
1343
- string?
1344
- ];
1345
- export declare type ComponentRuntimeHostListener = [
1349
+ $listeners$?: ComponentRuntimeHostListener[];
1346
1350
  /**
1347
- * event flags
1351
+ * Tuples containing information about `@Prop` fields on the component which
1352
+ * are set to be reflected (i.e. kept in sync) as HTML attributes when
1353
+ * updated.
1348
1354
  */
1349
- number,
1355
+ $attrsToReflect$?: ComponentRuntimeReflectingAttr[];
1350
1356
  /**
1351
- * event name,
1357
+ * Information about which class members have watchers attached on the component.
1352
1358
  */
1353
- string,
1359
+ $watchers$?: ComponentConstructorWatchers;
1354
1360
  /**
1355
- * event method,
1361
+ * A bundle ID used for lazy loading.
1356
1362
  */
1357
- string
1358
- ];
1363
+ $lazyBundleId$?: string;
1364
+ }
1365
+ /**
1366
+ * A mapping of the names of members on the component to some runtime-specific
1367
+ * information about them.
1368
+ */
1369
+ export interface ComponentRuntimeMembers {
1370
+ [memberName: string]: ComponentRuntimeMember;
1371
+ }
1372
+ /**
1373
+ * A tuple with information about a class member that's relevant at runtime.
1374
+ * The fields are:
1375
+ *
1376
+ * 1. A number used to hold bitflags for component members. The bit flags which
1377
+ * this is intended to store are documented in the {@link MEMBER_FLAGS} enum.
1378
+ * 2. The attribute name to observe.
1379
+ */
1380
+ export declare type ComponentRuntimeMember = [number, string?];
1381
+ /**
1382
+ * A tuple holding information about a host listener which is relevant at
1383
+ * runtime. The field are:
1384
+ *
1385
+ * 1. A number used to hold bitflags for listeners. The bit flags which this is
1386
+ * intended to store are documented in the {@link LISTENER_FLAGS} enum.
1387
+ * 2. The event name.
1388
+ * 3. The method name.
1389
+ */
1390
+ export declare type ComponentRuntimeHostListener = [number, string, string];
1391
+ /**
1392
+ * A tuple containing information about props which are "reflected" at runtime,
1393
+ * meaning that HTML attributes on the component instance are kept in sync with
1394
+ * the prop value.
1395
+ *
1396
+ * The fields are:
1397
+ *
1398
+ * 1. the prop name
1399
+ * 2. the prop attribute.
1400
+ */
1401
+ export declare type ComponentRuntimeReflectingAttr = [string, string | undefined];
1359
1402
  export declare type ModeBundleId = ModeBundleIds | string;
1360
1403
  export interface ModeBundleIds {
1361
1404
  [modeName: string]: string;
@@ -2167,13 +2210,13 @@ export interface TrackableData {
2167
2210
  component_count?: number;
2168
2211
  arguments: string[];
2169
2212
  targets: string[];
2170
- task: TaskCommand;
2171
- duration_ms: number;
2213
+ task: TaskCommand | null;
2214
+ duration_ms: number | undefined;
2172
2215
  packages: string[];
2173
2216
  packages_no_versions?: string[];
2174
- os_name: string;
2175
- os_version: string;
2176
- cpu_model: string;
2217
+ os_name: string | undefined;
2218
+ os_version: string | undefined;
2219
+ cpu_model: string | undefined;
2177
2220
  typescript: string;
2178
2221
  rollup: string;
2179
2222
  system: string;
@@ -1,6 +1,6 @@
1
- import type { JsonDocs } from './stencil-public-docs';
2
- import type { PrerenderUrlResults } from '../internal';
3
1
  import type { ConfigFlags } from '../cli/config-flags';
2
+ import type { PrerenderUrlResults } from '../internal';
3
+ import type { JsonDocs } from './stencil-public-docs';
4
4
  export * from './stencil-public-docs';
5
5
  /**
6
6
  * https://stenciljs.com/docs/config/
@@ -221,7 +221,8 @@ export declare type ErrorHandler = (err: any, element?: HTMLElement) => void;
221
221
  */
222
222
  export declare const setMode: (handler: ResolutionHandler) => void;
223
223
  /**
224
- * getMode
224
+ * `getMode()` is used for libraries which provide multiple "modes" for styles.
225
+ * @param ref a reference to the node to get styles for
225
226
  */
226
227
  export declare function getMode<T = string | undefined>(ref: any): T;
227
228
  export declare function setPlatformHelpers(helpers: {
@@ -234,6 +235,8 @@ export declare function setPlatformHelpers(helpers: {
234
235
  /**
235
236
  * Get the base path to where the assets can be found. Use `setAssetPath(path)`
236
237
  * if the path needs to be customized.
238
+ * @param path the path to use in calculating the asset path. this value will be
239
+ * used in conjunction with the base asset path
237
240
  */
238
241
  export declare function getAssetPath(path: string): string;
239
242
  /**
@@ -246,18 +249,22 @@ export declare function getAssetPath(path: string): string;
246
249
  * `setAssetPath(document.currentScript.src)`, or using a bundler's replace plugin to
247
250
  * dynamically set the path at build time, such as `setAssetPath(process.env.ASSET_PATH)`.
248
251
  * But do note that this configuration depends on how your script is bundled, or lack of
249
- * bunding, and where your assets can be loaded from. Additionally custom bundling
252
+ * bundling, and where your assets can be loaded from. Additionally custom bundling
250
253
  * will have to ensure the static assets are copied to its build directory.
254
+ * @param path the asset path to set
251
255
  */
252
256
  export declare function setAssetPath(path: string): string;
253
257
  /**
254
- * getElement
258
+ * Retrieve a Stencil element for a given reference
259
+ * @param ref the ref to get the Stencil element for
255
260
  */
256
261
  export declare function getElement(ref: any): HTMLStencilElement;
257
262
  /**
258
263
  * Schedules a new render of the given instance or element even if no state changed.
259
264
  *
260
- * Notice `forceUpdate()` is not syncronous and might perform the DOM render in the next frame.
265
+ * Notice `forceUpdate()` is not synchronous and might perform the DOM render in the next frame.
266
+ *
267
+ * @param ref the node/element to force the re-render of
261
268
  */
262
269
  export declare function forceUpdate(ref: any): void;
263
270
  /**
@@ -272,6 +279,8 @@ export interface HTMLStencilElement extends HTMLElement {
272
279
  * in the best moment to perform DOM mutation without causing layout thrashing.
273
280
  *
274
281
  * For further information: https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing
282
+ *
283
+ * @param task the DOM-write to schedule
275
284
  */
276
285
  export declare function writeTask(task: RafCallback): void;
277
286
  /**
@@ -279,6 +288,8 @@ export declare function writeTask(task: RafCallback): void;
279
288
  * in the best moment to perform DOM reads without causing layout thrashing.
280
289
  *
281
290
  * For further information: https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing
291
+ *
292
+ * @param task the DOM-read to schedule
282
293
  */
283
294
  export declare function readTask(task: RafCallback): void;
284
295
  /**
@@ -88,61 +88,10 @@ function stopAutoApplyChanges() {
88
88
  isAutoApplyingChanges = !1, autoApplyTimer && (clearTimeout(autoApplyTimer), autoApplyTimer = void 0);
89
89
  }
90
90
 
91
- const appData = require("@stencil/core/internal/app-data"), mockDoc = require("@stencil/core/mock-doc"), styles = new Map, modeResolutionChain = [], cstrs = new Map, queuedTicks = [], queuedWriteTasks = [], queuedReadTasks = [], moduleLoaded = new Map, queuedLoadModules = [], caughtErrors = [], hostRefs = new Map;
92
-
93
- let customError;
94
-
95
- const defaultConsoleError = e => {
96
- caughtErrors.push(e);
97
- }, consoleError = (e, t) => (customError || defaultConsoleError)(e, t), consoleDevError = (...e) => {
98
- caughtErrors.push(new Error(e.join(", ")));
99
- }, consoleDevWarn = (...e) => {
100
- const t = e.filter((e => "string" == typeof e || "number" == typeof e || "boolean" == typeof e));
101
- console.warn(...t);
102
- }, nextTick = e => {
103
- queuedTicks.push(e);
104
- }, win = mockDoc.setupGlobal(global), doc = win.document;
105
-
106
- exports.supportsShadow = !0;
107
-
108
- const plt = {
109
- $flags$: 0,
110
- $resourcesUrl$: "",
111
- jmp: e => e(),
112
- raf: e => requestAnimationFrame(e),
113
- ael: (e, t, a, o) => e.addEventListener(t, a, o),
114
- rel: (e, t, a, o) => e.removeEventListener(t, a, o),
115
- ce: (e, t) => new win.CustomEvent(e, t)
116
- }, Context = {};
117
-
118
- let autoApplyTimer, isAutoApplyingChanges = !1;
119
-
120
- const isMemberInElement = (e, t) => {
121
- if (null != e) {
122
- if (t in e) return !0;
123
- const a = e.nodeName;
124
- if (a) {
125
- const e = cstrs.get(a.toLowerCase());
126
- if (null != e && null != e.COMPILER_META && null != e.COMPILER_META.properties) return e.COMPILER_META.properties.some((e => e.name === t));
127
- }
128
- }
129
- return !1;
130
- }, addHostEventListeners = (e, t, a, o) => {
131
- appData.BUILD.hostListener && a && (appData.BUILD.hostListenerTargetParent && (a = o ? a.filter((([e]) => 32 & e)) : a.filter((([e]) => !(32 & e)))),
132
- a.map((([a, o, s]) => {
133
- const n = appData.BUILD.hostListenerTarget ? getHostListenerTarget(e, a) : e, l = hostListenerProxy(t, s), r = hostListenerOpts(a);
134
- plt.ael(n, o, l, r), (t.$rmListeners$ = t.$rmListeners$ || []).push((() => plt.rel(n, o, l, r)));
135
- })));
136
- }, hostListenerProxy = (e, t) => a => {
137
- try {
138
- appData.BUILD.lazyLoad ? 256 & e.$flags$ ? e.$lazyInstance$[t](a) : (e.$queuedListeners$ = e.$queuedListeners$ || []).push([ t, a ]) : e.$hostElement$[t](a);
139
- } catch (e) {
140
- consoleError(e);
141
- }
142
- }, getHostListenerTarget = (e, t) => appData.BUILD.hostListenerTargetDocument && 4 & t ? doc : appData.BUILD.hostListenerTargetWindow && 8 & t ? win : appData.BUILD.hostListenerTargetBody && 16 & t ? doc.body : appData.BUILD.hostListenerTargetParent && 32 & t ? e.parentElement : e, hostListenerOpts = e => ({
143
- passive: 0 != (1 & e),
144
- capture: 0 != (2 & e)
145
- }), XLINK_NS = "http://www.w3.org/1999/xlink";
91
+ const mockDoc = require("@stencil/core/mock-doc"), appData = require("@stencil/core/internal/app-data"), styles = new Map, modeResolutionChain = [], cstrs = new Map, queuedTicks = [], queuedWriteTasks = [], queuedReadTasks = [], moduleLoaded = new Map, queuedLoadModules = [], caughtErrors = [], hostRefs = new Map, getAssetPath = e => {
92
+ const t = new URL(e, plt.$resourcesUrl$);
93
+ return t.origin !== win.location.origin ? t.href : t.pathname;
94
+ };
146
95
 
147
96
  let i = 0;
148
97
 
@@ -152,36 +101,7 @@ const createTime = (e, t = "") => {
152
101
  return performance.mark(a), () => performance.measure(`[Stencil] ${e}() <${t}>`, a);
153
102
  }
154
103
  return () => {};
155
- }, rootAppliedStyles = new WeakMap, registerStyle = (e, t, a) => {
156
- let o = styles.get(e);
157
- o = t, styles.set(e, o);
158
- }, addStyle = (e, t, a, o) => {
159
- let s = getScopeId(t, a);
160
- const n = styles.get(s);
161
- if (!appData.BUILD.attachStyles) return s;
162
- if (e = 11 === e.nodeType ? e : doc, n) if ("string" == typeof n) {
163
- e = e.head || e;
164
- let a, l = rootAppliedStyles.get(e);
165
- if (l || rootAppliedStyles.set(e, l = new Set), !l.has(s)) {
166
- if (appData.BUILD.hydrateClientSide && e.host && (a = e.querySelector(`[sty-id="${s}"]`))) a.innerHTML = n; else {
167
- if (appData.BUILD.cssVarShim && plt.$cssShim$) {
168
- a = plt.$cssShim$.createHostStyle(o, s, n, !!(10 & t.$flags$));
169
- const e = a["s-sc"];
170
- e && (s = e, l = null);
171
- } else a = doc.createElement("style"), a.innerHTML = n;
172
- (appData.BUILD.hydrateServerSide || appData.BUILD.hotModuleReplacement) && a.setAttribute("sty-id", s),
173
- e.insertBefore(a, e.querySelector("link"));
174
- }
175
- l && l.add(s);
176
- }
177
- } else appData.BUILD.constructableCSS && !e.adoptedStyleSheets.includes(n) && (e.adoptedStyleSheets = [ ...e.adoptedStyleSheets, n ]);
178
- return s;
179
- }, attachStyles = e => {
180
- 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);
181
- (appData.BUILD.shadowDom || appData.BUILD.scoped) && appData.BUILD.cssAnnotations && 10 & o && (a["s-sc"] = n,
182
- a.classList.add(n + "-h"), appData.BUILD.scoped && 2 & o && a.classList.add(n + "-s")),
183
- s();
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) => {
104
+ }, XLINK_NS = "http://www.w3.org/1999/xlink", EMPTY_OBJ = {}, isComplexType = e => "object" == (e = typeof e) || "function" === e, h = (e, t, ...a) => {
185
105
  let o = null, s = null, n = null, l = !1, r = !1;
186
106
  const p = [], i = t => {
187
107
  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."),
@@ -233,7 +153,92 @@ const createTime = (e, t = "") => {
233
153
  if (-1 === a) return;
234
154
  const o = t.indexOf("type"), s = t.indexOf("min"), n = t.indexOf("max"), l = t.indexOf("step");
235
155
  (a < o || a < s || a < n || a < l) && consoleDevWarn('The "value" prop of <input> should be set after "min", "max", "type" and "step"');
236
- }, setAccessor = (e, t, a, o, s, n) => {
156
+ }, clientHydrate = (e, t, a, o, s, n, l) => {
157
+ let r, p, i, d;
158
+ if (1 === n.nodeType) {
159
+ for (r = n.getAttribute("c-id"), r && (p = r.split("."), p[0] !== l && "0" !== p[0] || (i = {
160
+ $flags$: 0,
161
+ $hostId$: p[0],
162
+ $nodeId$: p[1],
163
+ $depth$: p[2],
164
+ $index$: p[3],
165
+ $tag$: n.tagName.toLowerCase(),
166
+ $elm$: n,
167
+ $attrs$: null,
168
+ $children$: null,
169
+ $key$: null,
170
+ $name$: null,
171
+ $text$: null
172
+ }, t.push(i), n.removeAttribute("c-id"), e.$children$ || (e.$children$ = []), e.$children$[i.$index$] = i,
173
+ e = i, o && "0" === i.$depth$ && (o[i.$index$] = i.$elm$))), d = n.childNodes.length - 1; d >= 0; d--) clientHydrate(e, t, a, o, s, n.childNodes[d], l);
174
+ if (n.shadowRoot) for (d = n.shadowRoot.childNodes.length - 1; d >= 0; d--) clientHydrate(e, t, a, o, s, n.shadowRoot.childNodes[d], l);
175
+ } else if (8 === n.nodeType) p = n.nodeValue.split("."), p[1] !== l && "0" !== p[1] || (r = p[0],
176
+ i = {
177
+ $flags$: 0,
178
+ $hostId$: p[1],
179
+ $nodeId$: p[2],
180
+ $depth$: p[3],
181
+ $index$: p[4],
182
+ $elm$: n,
183
+ $attrs$: null,
184
+ $children$: null,
185
+ $key$: null,
186
+ $name$: null,
187
+ $tag$: null,
188
+ $text$: null
189
+ }, "t" === r ? (i.$elm$ = n.nextSibling, i.$elm$ && 3 === i.$elm$.nodeType && (i.$text$ = i.$elm$.textContent,
190
+ t.push(i), n.remove(), e.$children$ || (e.$children$ = []), e.$children$[i.$index$] = i,
191
+ o && "0" === i.$depth$ && (o[i.$index$] = i.$elm$))) : i.$hostId$ === l && ("s" === r ? (i.$tag$ = "slot",
192
+ p[5] ? n["s-sn"] = i.$name$ = p[5] : n["s-sn"] = "", n["s-sr"] = !0, appData.BUILD.shadowDom && o && (i.$elm$ = doc.createElement(i.$tag$),
193
+ i.$name$ && i.$elm$.setAttribute("name", i.$name$), n.parentNode.insertBefore(i.$elm$, n),
194
+ n.remove(), "0" === i.$depth$ && (o[i.$index$] = i.$elm$)), a.push(i), e.$children$ || (e.$children$ = []),
195
+ e.$children$[i.$index$] = i) : "r" === r && (appData.BUILD.shadowDom && o ? n.remove() : appData.BUILD.slotRelocation && (s["s-cr"] = n,
196
+ n["s-cn"] = !0)))); else if (e && "style" === e.$tag$) {
197
+ const t = newVNode(null, n.textContent);
198
+ t.$elm$ = n, t.$index$ = "0", e.$children$ = [ t ];
199
+ }
200
+ }, initializeDocumentHydrate = (e, t) => {
201
+ if (1 === e.nodeType) {
202
+ let a = 0;
203
+ for (;a < e.childNodes.length; a++) initializeDocumentHydrate(e.childNodes[a], t);
204
+ if (e.shadowRoot) for (a = 0; a < e.shadowRoot.childNodes.length; a++) initializeDocumentHydrate(e.shadowRoot.childNodes[a], t);
205
+ } else if (8 === e.nodeType) {
206
+ const a = e.nodeValue.split(".");
207
+ "o" === a[0] && (t.set(a[1] + "." + a[2], e), e.nodeValue = "", e["s-en"] = a[3]);
208
+ }
209
+ }, computeMode = e => modeResolutionChain.map((t => t(e))).find((e => !!e)), parsePropertyValue = (e, t) => null == e || isComplexType(e) ? e : appData.BUILD.propBoolean && 4 & t ? "false" !== e && ("" === e || !!e) : appData.BUILD.propNumber && 2 & t ? parseFloat(e) : appData.BUILD.propString && 1 & t ? String(e) : e, getElement = e => appData.BUILD.lazyLoad ? getHostRef(e).$hostElement$ : e, emitEvent = (e, t, a) => {
210
+ const o = plt.ce(t, a);
211
+ return e.dispatchEvent(o), o;
212
+ }, rootAppliedStyles = new WeakMap, registerStyle = (e, t, a) => {
213
+ let o = styles.get(e);
214
+ o = t, styles.set(e, o);
215
+ }, addStyle = (e, t, a, o) => {
216
+ let s = getScopeId(t, a);
217
+ const n = styles.get(s);
218
+ if (!appData.BUILD.attachStyles) return s;
219
+ if (e = 11 === e.nodeType ? e : doc, n) if ("string" == typeof n) {
220
+ e = e.head || e;
221
+ let a, l = rootAppliedStyles.get(e);
222
+ if (l || rootAppliedStyles.set(e, l = new Set), !l.has(s)) {
223
+ if (appData.BUILD.hydrateClientSide && e.host && (a = e.querySelector(`[sty-id="${s}"]`))) a.innerHTML = n; else {
224
+ if (appData.BUILD.cssVarShim && plt.$cssShim$) {
225
+ a = plt.$cssShim$.createHostStyle(o, s, n, !!(10 & t.$flags$));
226
+ const e = a["s-sc"];
227
+ e && (s = e, l = null);
228
+ } else a = doc.createElement("style"), a.innerHTML = n;
229
+ (appData.BUILD.hydrateServerSide || appData.BUILD.hotModuleReplacement) && a.setAttribute("sty-id", s),
230
+ e.insertBefore(a, e.querySelector("link"));
231
+ }
232
+ l && l.add(s);
233
+ }
234
+ } else appData.BUILD.constructableCSS && !e.adoptedStyleSheets.includes(n) && (e.adoptedStyleSheets = [ ...e.adoptedStyleSheets, n ]);
235
+ return s;
236
+ }, attachStyles = e => {
237
+ 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
+ (appData.BUILD.shadowDom || appData.BUILD.scoped) && appData.BUILD.cssAnnotations && 10 & o && (a["s-sc"] = n,
239
+ a.classList.add(n + "-h"), appData.BUILD.scoped && 2 & o && a.classList.add(n + "-s")),
240
+ s();
241
+ }, getScopeId = (e, t) => "sc-" + (appData.BUILD.mode && t && 32 & e.$flags$ ? e.$tagName$ + "-" + t : e.$tagName$), setAccessor = (e, t, a, o, s, n) => {
237
242
  if (a !== o) {
238
243
  let l = isMemberInElement(e, t), r = t.toLowerCase();
239
244
  if (appData.BUILD.vdomClass && "class" === t) {
@@ -389,10 +394,7 @@ const createElm = (e, t, a, o) => {
389
394
  checkSlotFallbackVisibility && updateFallbackSlotVisibility(n.$elm$), plt.$flags$ &= -2,
390
395
  relocateNodes.length = 0;
391
396
  }
392
- }, slotReferenceDebugNode = e => doc.createComment(`<slot${e.$name$ ? ' name="' + e.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`), originalLocationDebugNode = e => doc.createComment("org-location for " + (e.localName ? `<${e.localName}> (host=${e["s-hn"]})` : `[${e.textContent}]`)), getElement = e => appData.BUILD.lazyLoad ? getHostRef(e).$hostElement$ : e, emitEvent = (e, t, a) => {
393
- const o = plt.ce(t, a);
394
- return e.dispatchEvent(o), o;
395
- }, attachToAncestor = (e, t) => {
397
+ }, slotReferenceDebugNode = e => doc.createComment(`<slot${e.$name$ ? ' name="' + e.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`), originalLocationDebugNode = e => doc.createComment("org-location for " + (e.localName ? `<${e.localName}> (host=${e["s-hn"]})` : `[${e.textContent}]`)), attachToAncestor = (e, t) => {
396
398
  appData.BUILD.asyncLoading && t && !e.$onRenderResolve$ && t["s-p"] && t["s-p"].push(new Promise((t => e.$onRenderResolve$ = t)));
397
399
  }, scheduleUpdate = (e, t) => {
398
400
  if (appData.BUILD.taskQueue && appData.BUILD.updatable && (e.$flags$ |= 16), appData.BUILD.asyncLoading && 4 & e.$flags$) return void (e.$flags$ |= 512);
@@ -486,60 +488,7 @@ const callRender = (e, t, a) => {
486
488
  const a = t[e];
487
489
  "function" == typeof a.connectedCallback && a.connectedCallback(), serverSideConnected(a);
488
490
  }
489
- }, clientHydrate = (e, t, a, o, s, n, l) => {
490
- let r, p, i, d;
491
- if (1 === n.nodeType) {
492
- for (r = n.getAttribute("c-id"), r && (p = r.split("."), p[0] !== l && "0" !== p[0] || (i = {
493
- $flags$: 0,
494
- $hostId$: p[0],
495
- $nodeId$: p[1],
496
- $depth$: p[2],
497
- $index$: p[3],
498
- $tag$: n.tagName.toLowerCase(),
499
- $elm$: n,
500
- $attrs$: null,
501
- $children$: null,
502
- $key$: null,
503
- $name$: null,
504
- $text$: null
505
- }, t.push(i), n.removeAttribute("c-id"), e.$children$ || (e.$children$ = []), e.$children$[i.$index$] = i,
506
- e = i, o && "0" === i.$depth$ && (o[i.$index$] = i.$elm$))), d = n.childNodes.length - 1; d >= 0; d--) clientHydrate(e, t, a, o, s, n.childNodes[d], l);
507
- if (n.shadowRoot) for (d = n.shadowRoot.childNodes.length - 1; d >= 0; d--) clientHydrate(e, t, a, o, s, n.shadowRoot.childNodes[d], l);
508
- } else if (8 === n.nodeType) p = n.nodeValue.split("."), p[1] !== l && "0" !== p[1] || (r = p[0],
509
- i = {
510
- $flags$: 0,
511
- $hostId$: p[1],
512
- $nodeId$: p[2],
513
- $depth$: p[3],
514
- $index$: p[4],
515
- $elm$: n,
516
- $attrs$: null,
517
- $children$: null,
518
- $key$: null,
519
- $name$: null,
520
- $tag$: null,
521
- $text$: null
522
- }, "t" === r ? (i.$elm$ = n.nextSibling, i.$elm$ && 3 === i.$elm$.nodeType && (i.$text$ = i.$elm$.textContent,
523
- t.push(i), n.remove(), e.$children$ || (e.$children$ = []), e.$children$[i.$index$] = i,
524
- o && "0" === i.$depth$ && (o[i.$index$] = i.$elm$))) : i.$hostId$ === l && ("s" === r ? (i.$tag$ = "slot",
525
- p[5] ? n["s-sn"] = i.$name$ = p[5] : n["s-sn"] = "", n["s-sr"] = !0, appData.BUILD.shadowDom && o && (i.$elm$ = doc.createElement(i.$tag$),
526
- i.$name$ && i.$elm$.setAttribute("name", i.$name$), n.parentNode.insertBefore(i.$elm$, n),
527
- n.remove(), "0" === i.$depth$ && (o[i.$index$] = i.$elm$)), a.push(i), e.$children$ || (e.$children$ = []),
528
- e.$children$[i.$index$] = i) : "r" === r && (appData.BUILD.shadowDom && o ? n.remove() : appData.BUILD.slotRelocation && (s["s-cr"] = n,
529
- n["s-cn"] = !0)))); else if (e && "style" === e.$tag$) {
530
- const t = newVNode(null, n.textContent);
531
- t.$elm$ = n, t.$index$ = "0", e.$children$ = [ t ];
532
- }
533
- }, initializeDocumentHydrate = (e, t) => {
534
- if (1 === e.nodeType) {
535
- let a = 0;
536
- for (;a < e.childNodes.length; a++) initializeDocumentHydrate(e.childNodes[a], t);
537
- if (e.shadowRoot) for (a = 0; a < e.shadowRoot.childNodes.length; a++) initializeDocumentHydrate(e.shadowRoot.childNodes[a], t);
538
- } else if (8 === e.nodeType) {
539
- const a = e.nodeValue.split(".");
540
- "o" === a[0] && (t.set(a[1] + "." + a[2], e), e.nodeValue = "", e["s-en"] = a[3]);
541
- }
542
- }, parsePropertyValue = (e, t) => null == e || isComplexType(e) ? e : appData.BUILD.propBoolean && 4 & t ? "false" !== e && ("" === e || !!e) : appData.BUILD.propNumber && 2 & t ? parseFloat(e) : appData.BUILD.propString && 1 & t ? String(e) : e, getValue = (e, t) => getHostRef(e).$instanceValues$.get(t), setValue = (e, t, a, o) => {
491
+ }, getValue = (e, t) => getHostRef(e).$instanceValues$.get(t), setValue = (e, t, a, o) => {
543
492
  const s = getHostRef(e), n = appData.BUILD.lazyLoad ? s.$hostElement$ : e, l = s.$instanceValues$.get(t), r = s.$flags$, p = appData.BUILD.lazyLoad ? s.$lazyInstance$ : n;
544
493
  a = parsePropertyValue(a, o.$members$[t][0]);
545
494
  const i = Number.isNaN(l) && Number.isNaN(a), d = a !== l && !i;
@@ -805,10 +754,22 @@ const callRender = (e, t, a) => {
805
754
  const a = [ e ];
806
755
  for (;(e = e.nextSibling) && e["s-sn"] === t; ) a.push(e);
807
756
  return a;
808
- }, getAssetPath = e => {
809
- const t = new URL(e, plt.$resourcesUrl$);
810
- return t.origin !== win.location.origin ? t.href : t.pathname;
811
- }, parseVNodeAnnotations = (e, t, a, o) => {
757
+ }, addHostEventListeners = (e, t, a, o) => {
758
+ appData.BUILD.hostListener && a && (appData.BUILD.hostListenerTargetParent && (a = o ? a.filter((([e]) => 32 & e)) : a.filter((([e]) => !(32 & e)))),
759
+ a.map((([a, o, s]) => {
760
+ const n = appData.BUILD.hostListenerTarget ? getHostListenerTarget(e, a) : e, l = hostListenerProxy(t, s), r = hostListenerOpts(a);
761
+ plt.ael(n, o, l, r), (t.$rmListeners$ = t.$rmListeners$ || []).push((() => plt.rel(n, o, l, r)));
762
+ })));
763
+ }, hostListenerProxy = (e, t) => a => {
764
+ try {
765
+ appData.BUILD.lazyLoad ? 256 & e.$flags$ ? e.$lazyInstance$[t](a) : (e.$queuedListeners$ = e.$queuedListeners$ || []).push([ t, a ]) : e.$hostElement$[t](a);
766
+ } catch (e) {
767
+ consoleError(e);
768
+ }
769
+ }, getHostListenerTarget = (e, t) => appData.BUILD.hostListenerTargetDocument && 4 & t ? doc : appData.BUILD.hostListenerTargetWindow && 8 & t ? win : appData.BUILD.hostListenerTargetBody && 16 & t ? doc.body : appData.BUILD.hostListenerTargetParent && 32 & t ? e.parentElement : e, hostListenerOpts = e => ({
770
+ passive: 0 != (1 & e),
771
+ capture: 0 != (2 & e)
772
+ }), parseVNodeAnnotations = (e, t, a, o) => {
812
773
  null != t && (null != t["s-nr"] && o.push(t), 1 === t.nodeType && t.childNodes.forEach((t => {
813
774
  const s = getHostRef(t);
814
775
  if (null != s && !a.staticComponents.has(t.nodeName.toLowerCase())) {
@@ -872,6 +833,45 @@ const callRender = (e, t, a) => {
872
833
  e["s-p"] = [], e["s-rc"] = [], addHostEventListeners(e, a, t.$listeners$, !1), hostRefs.set(e, a);
873
834
  };
874
835
 
836
+ let customError;
837
+
838
+ const defaultConsoleError = e => {
839
+ caughtErrors.push(e);
840
+ }, consoleError = (e, t) => (customError || defaultConsoleError)(e, t), consoleDevError = (...e) => {
841
+ caughtErrors.push(new Error(e.join(", ")));
842
+ }, consoleDevWarn = (...e) => {
843
+ const t = e.filter((e => "string" == typeof e || "number" == typeof e || "boolean" == typeof e));
844
+ console.warn(...t);
845
+ }, nextTick = e => {
846
+ queuedTicks.push(e);
847
+ }, win = mockDoc.setupGlobal(global), doc = win.document;
848
+
849
+ exports.supportsShadow = !0;
850
+
851
+ const plt = {
852
+ $flags$: 0,
853
+ $resourcesUrl$: "",
854
+ jmp: e => e(),
855
+ raf: e => requestAnimationFrame(e),
856
+ ael: (e, t, a, o) => e.addEventListener(t, a, o),
857
+ rel: (e, t, a, o) => e.removeEventListener(t, a, o),
858
+ ce: (e, t) => new win.CustomEvent(e, t)
859
+ }, Context = {};
860
+
861
+ let autoApplyTimer, isAutoApplyingChanges = !1;
862
+
863
+ const isMemberInElement = (e, t) => {
864
+ if (null != e) {
865
+ if (t in e) return !0;
866
+ const a = e.nodeName;
867
+ if (a) {
868
+ const e = cstrs.get(a.toLowerCase());
869
+ if (null != e && null != e.COMPILER_META && null != e.COMPILER_META.properties) return e.COMPILER_META.properties.some((e => e.name === t));
870
+ }
871
+ }
872
+ return !1;
873
+ };
874
+
875
875
  Object.defineProperty(exports, "Env", {
876
876
  enumerable: !0,
877
877
  get: function() {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/testing",
3
- "version": "2.18.0",
3
+ "version": "2.18.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