@stencil/core 2.16.1-0 → 2.17.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 (50) hide show
  1. package/cli/config-flags.d.ts +102 -0
  2. package/cli/index.cjs +697 -224
  3. package/cli/index.d.ts +2 -1
  4. package/cli/index.js +697 -224
  5. package/cli/package.json +1 -1
  6. package/compiler/package.json +1 -1
  7. package/compiler/stencil.js +856 -290
  8. package/compiler/stencil.min.js +2 -2
  9. package/dependencies.json +1 -1
  10. package/dev-server/client/index.js +1 -1
  11. package/dev-server/client/package.json +1 -1
  12. package/dev-server/connector.html +2 -2
  13. package/dev-server/index.js +1 -1
  14. package/dev-server/package.json +1 -1
  15. package/dev-server/server-process.js +2 -2
  16. package/internal/app-data/package.json +1 -1
  17. package/internal/client/css-shim.js +1 -1
  18. package/internal/client/dom.js +1 -1
  19. package/internal/client/index.js +11 -6
  20. package/internal/client/package.json +1 -1
  21. package/internal/client/patch-browser.js +1 -1
  22. package/internal/client/patch-esm.js +1 -1
  23. package/internal/client/shadow-css.js +1 -1
  24. package/internal/hydrate/index.js +2 -2
  25. package/internal/hydrate/package.json +1 -1
  26. package/internal/package.json +1 -1
  27. package/internal/stencil-private.d.ts +6 -2
  28. package/internal/stencil-public-compiler.d.ts +67 -48
  29. package/internal/testing/index.js +1 -1
  30. package/internal/testing/package.json +1 -1
  31. package/mock-doc/index.cjs +140 -5
  32. package/mock-doc/index.d.ts +76 -1
  33. package/mock-doc/index.js +140 -5
  34. package/mock-doc/package.json +1 -1
  35. package/package.json +2 -1
  36. package/screenshot/package.json +1 -1
  37. package/sys/node/index.js +325 -314
  38. package/sys/node/package.json +1 -1
  39. package/sys/node/worker.js +1 -1
  40. package/testing/index.d.ts +1 -1
  41. package/testing/index.js +436 -381
  42. package/testing/jest/jest-config.d.ts +1 -1
  43. package/testing/jest/jest-runner.d.ts +3 -2
  44. package/testing/jest/jest-screenshot.d.ts +1 -1
  45. package/testing/mocks.d.ts +48 -3
  46. package/testing/package.json +1 -1
  47. package/testing/puppeteer/puppeteer-browser.d.ts +2 -2
  48. package/testing/test/testing-utils.spec.d.ts +1 -0
  49. package/testing/testing-utils.d.ts +74 -2
  50. package/testing/testing.d.ts +2 -2
@@ -1,5 +1,6 @@
1
1
  import type { JsonDocs } from './stencil-public-docs';
2
2
  import type { PrerenderUrlResults } from '../internal';
3
+ import type { ConfigFlags } from '../cli/config-flags';
3
4
  export * from './stencil-public-docs';
4
5
  /**
5
6
  * https://stenciljs.com/docs/config/
@@ -356,6 +357,29 @@ declare type Loose<T extends Object> = Record<string, any> & Partial<T>;
356
357
  * and have type information carry though as we construct an object which is a valid `Config`.
357
358
  */
358
359
  export declare type UnvalidatedConfig = Loose<Config>;
360
+ /**
361
+ * Helper type to strip optional markers from keys in a type, while preserving other type information for the key.
362
+ * This type takes a union of keys, K, in type T to allow for the type T to be gradually updated.
363
+ *
364
+ * ```typescript
365
+ * type Foo { bar?: number, baz?: string }
366
+ * type ReqFieldFoo = RequireFields<Foo, 'bar'>; // { bar: number, baz?: string }
367
+ * ```
368
+ */
369
+ declare type RequireFields<T, K extends keyof T> = T & {
370
+ [P in K]-?: T[P];
371
+ };
372
+ /**
373
+ * Fields in {@link Config} to make required for {@link ValidatedConfig}
374
+ */
375
+ declare type StrictConfigFields = 'flags' | 'logger';
376
+ /**
377
+ * A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.
378
+ * When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees
379
+ * about the data from a type-safety perspective, this type is intended to be used throughout the codebase once
380
+ * validations have occurred at runtime.
381
+ */
382
+ export declare type ValidatedConfig = RequireFields<Config, StrictConfigFields>;
359
383
  export interface HydratedFlag {
360
384
  /**
361
385
  * Defaults to `hydrated`.
@@ -505,51 +529,6 @@ export interface DevServerEditor {
505
529
  supported?: boolean;
506
530
  priority?: number;
507
531
  }
508
- export interface ConfigFlags {
509
- task?: TaskCommand;
510
- args?: string[];
511
- knownArgs?: string[];
512
- unknownArgs?: string[];
513
- address?: string;
514
- build?: boolean;
515
- cache?: boolean;
516
- checkVersion?: boolean;
517
- ci?: boolean;
518
- compare?: boolean;
519
- config?: string;
520
- debug?: boolean;
521
- dev?: boolean;
522
- docs?: boolean;
523
- docsApi?: string;
524
- docsJson?: string;
525
- e2e?: boolean;
526
- emulate?: string;
527
- es5?: boolean;
528
- esm?: boolean;
529
- headless?: boolean;
530
- help?: boolean;
531
- log?: boolean;
532
- logLevel?: string;
533
- verbose?: boolean;
534
- maxWorkers?: number;
535
- open?: boolean;
536
- port?: number;
537
- prerender?: boolean;
538
- prod?: boolean;
539
- profile?: boolean;
540
- root?: string;
541
- screenshot?: boolean;
542
- screenshotConnector?: string;
543
- serve?: boolean;
544
- serviceWorker?: boolean;
545
- spec?: boolean;
546
- ssr?: boolean;
547
- stats?: boolean;
548
- updateScreenshot?: boolean;
549
- version?: boolean;
550
- watch?: boolean;
551
- devtools?: boolean;
552
- }
553
532
  export declare type TaskCommand = 'build' | 'docs' | 'generate' | 'g' | 'help' | 'info' | 'prerender' | 'serve' | 'telemetry' | 'test' | 'version';
554
533
  export declare type PageReloadStrategy = 'hmr' | 'pageReload' | null;
555
534
  /**
@@ -1653,7 +1632,29 @@ export interface EmulateViewport {
1653
1632
  */
1654
1633
  isLandscape?: boolean;
1655
1634
  }
1656
- export declare type LogLevel = 'debug' | 'info' | 'warn' | 'error' | string;
1635
+ /**
1636
+ * This sets the log level hierarchy for our terminal logger, ranging from
1637
+ * most to least verbose.
1638
+ *
1639
+ * Ordering the levels like this lets us easily check whether we should log a
1640
+ * message at a given time. For instance, if the log level is set to `'warn'`,
1641
+ * then anything passed to the logger with level `'warn'` or `'error'` should
1642
+ * be logged, but we should _not_ log anything with level `'info'` or `'debug'`.
1643
+ *
1644
+ * If we have a current log level `currentLevel` and a message with level
1645
+ * `msgLevel` is passed to the logger, we can determine whether or not we should
1646
+ * log it by checking if the log level on the message is further up or at the
1647
+ * same level in the hierarchy than `currentLevel`, like so:
1648
+ *
1649
+ * ```ts
1650
+ * LOG_LEVELS.indexOf(msgLevel) >= LOG_LEVELS.indexOf(currentLevel)
1651
+ * ```
1652
+ *
1653
+ * NOTE: for the reasons described above, do not change the order of the entries
1654
+ * in this array without good reason!
1655
+ */
1656
+ export declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error"];
1657
+ export declare type LogLevel = typeof LOG_LEVELS[number];
1657
1658
  /**
1658
1659
  * Common logger to be used by the compiler, dev-server and CLI. The CLI will use a
1659
1660
  * NodeJS based console logging and colors, and the web will use browser based
@@ -1980,7 +1981,7 @@ export interface LoadConfigInit {
1980
1981
  * operations around the codebase.
1981
1982
  */
1982
1983
  export interface LoadConfigResults {
1983
- config: UnvalidatedConfig;
1984
+ config: ValidatedConfig;
1984
1985
  diagnostics: Diagnostic[];
1985
1986
  tsconfig: {
1986
1987
  path: string;
@@ -2048,14 +2049,32 @@ export interface PrerenderResults {
2048
2049
  duration: number;
2049
2050
  average: number;
2050
2051
  }
2052
+ /**
2053
+ * Input for CSS optimization functions, including the input CSS
2054
+ * string and a few boolean options which turn on or off various
2055
+ * optimizations.
2056
+ */
2051
2057
  export interface OptimizeCssInput {
2052
2058
  input: string;
2053
2059
  filePath?: string;
2054
- autoprefixer?: any;
2060
+ autoprefixer?: boolean | null | AutoprefixerOptions;
2055
2061
  minify?: boolean;
2056
2062
  sourceMap?: boolean;
2057
2063
  resolveUrl?: (url: string) => Promise<string> | string;
2058
2064
  }
2065
+ /**
2066
+ * This is not a real interface describing the options which can
2067
+ * be passed to autoprefixer, for that see the docs, here:
2068
+ * https://github.com/postcss/autoprefixer#options
2069
+ *
2070
+ * Instead, this basically just serves as a label type to track
2071
+ * that arguments are being passed consistently.
2072
+ */
2073
+ export declare type AutoprefixerOptions = Object;
2074
+ /**
2075
+ * Output from CSS optimization functions, wrapping up optimized
2076
+ * CSS and any diagnostics produced during optimization.
2077
+ */
2059
2078
  export interface OptimizeCssOutput {
2060
2079
  output: string;
2061
2080
  diagnostics: Diagnostic[];
@@ -1089,5 +1089,5 @@ exports.setMode = e => modeResolutionChain.push(e), exports.setPlatformHelpers =
1089
1089
  }), 100));
1090
1090
  }));
1091
1091
  }, exports.stopAutoApplyChanges = stopAutoApplyChanges, exports.styles = styles,
1092
- exports.supportsConstructibleStylesheets = !1, exports.supportsListenerOptions = !0,
1092
+ exports.supportsConstructableStylesheets = !1, exports.supportsListenerOptions = !0,
1093
1093
  exports.win = win, exports.writeTask = writeTask;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/testing",
3
- "version": "2.16.1-0",
3
+ "version": "2.17.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
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc (CommonJS) v2.16.1-0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc (CommonJS) v2.17.1 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var mockDoc = (function(exports) {
5
5
  'use strict';
@@ -1601,6 +1601,9 @@ class MockElement extends MockNode {
1601
1601
  this.shadowRoot = shadowRoot;
1602
1602
  return shadowRoot;
1603
1603
  }
1604
+ blur() {
1605
+ /**/
1606
+ }
1604
1607
  get shadowRoot() {
1605
1608
  return this.__shadowRoot || null;
1606
1609
  }
@@ -1669,6 +1672,7 @@ class MockElement extends MockNode {
1669
1672
  get firstElementChild() {
1670
1673
  return this.children[0] || null;
1671
1674
  }
1675
+ focus(_options) { }
1672
1676
  getAttribute(attrName) {
1673
1677
  if (attrName === 'style') {
1674
1678
  if (this.__style != null && this.__style.length > 0) {
@@ -2572,7 +2576,28 @@ function createElementNS(ownerDocument, namespaceURI, tagName) {
2572
2576
  return createElement(ownerDocument, tagName);
2573
2577
  }
2574
2578
  else if (namespaceURI === 'http://www.w3.org/2000/svg') {
2575
- return new MockSVGElement(ownerDocument, tagName);
2579
+ switch (tagName.toLowerCase()) {
2580
+ case 'text':
2581
+ case 'tspan':
2582
+ case 'tref':
2583
+ case 'altglyph':
2584
+ case 'textpath':
2585
+ return new MockSVGTextContentElement(ownerDocument, tagName);
2586
+ case 'circle':
2587
+ case 'ellipse':
2588
+ case 'image':
2589
+ case 'line':
2590
+ case 'path':
2591
+ case 'polygon':
2592
+ case 'polyline':
2593
+ case 'rect':
2594
+ case 'use':
2595
+ return new MockSVGGraphicsElement(ownerDocument, tagName);
2596
+ case 'svg':
2597
+ return new MockSVGSVGElement(ownerDocument, tagName);
2598
+ default:
2599
+ return new MockSVGElement(ownerDocument, tagName);
2600
+ }
2576
2601
  }
2577
2602
  else {
2578
2603
  return new MockElement(ownerDocument, tagName);
@@ -2719,6 +2744,98 @@ class MockScriptElement extends MockHTMLElement {
2719
2744
  patchPropAttributes(MockScriptElement.prototype, {
2720
2745
  type: String,
2721
2746
  });
2747
+ class MockDOMMatrix {
2748
+ constructor() {
2749
+ this.a = 1;
2750
+ this.b = 0;
2751
+ this.c = 0;
2752
+ this.d = 1;
2753
+ this.e = 0;
2754
+ this.f = 0;
2755
+ this.m11 = 1;
2756
+ this.m12 = 0;
2757
+ this.m13 = 0;
2758
+ this.m14 = 0;
2759
+ this.m21 = 0;
2760
+ this.m22 = 1;
2761
+ this.m23 = 0;
2762
+ this.m24 = 0;
2763
+ this.m31 = 0;
2764
+ this.m32 = 0;
2765
+ this.m33 = 1;
2766
+ this.m34 = 0;
2767
+ this.m41 = 0;
2768
+ this.m42 = 0;
2769
+ this.m43 = 0;
2770
+ this.m44 = 1;
2771
+ this.is2D = true;
2772
+ this.isIdentity = true;
2773
+ }
2774
+ static fromMatrix() {
2775
+ return new MockDOMMatrix();
2776
+ }
2777
+ inverse() {
2778
+ return new MockDOMMatrix();
2779
+ }
2780
+ flipX() {
2781
+ return new MockDOMMatrix();
2782
+ }
2783
+ flipY() {
2784
+ return new MockDOMMatrix();
2785
+ }
2786
+ multiply() {
2787
+ return new MockDOMMatrix();
2788
+ }
2789
+ rotate() {
2790
+ return new MockDOMMatrix();
2791
+ }
2792
+ rotateAxisAngle() {
2793
+ return new MockDOMMatrix();
2794
+ }
2795
+ rotateFromVector() {
2796
+ return new MockDOMMatrix();
2797
+ }
2798
+ scale() {
2799
+ return new MockDOMMatrix();
2800
+ }
2801
+ scaleNonUniform() {
2802
+ return new MockDOMMatrix();
2803
+ }
2804
+ skewX() {
2805
+ return new MockDOMMatrix();
2806
+ }
2807
+ skewY() {
2808
+ return new MockDOMMatrix();
2809
+ }
2810
+ toJSON() { }
2811
+ toString() { }
2812
+ transformPoint() {
2813
+ return new MockDOMPoint();
2814
+ }
2815
+ translate() {
2816
+ return new MockDOMMatrix();
2817
+ }
2818
+ }
2819
+ class MockDOMPoint {
2820
+ constructor() {
2821
+ this.w = 1;
2822
+ this.x = 0;
2823
+ this.y = 0;
2824
+ this.z = 0;
2825
+ }
2826
+ toJSON() { }
2827
+ matrixTransform() {
2828
+ return new MockDOMMatrix();
2829
+ }
2830
+ }
2831
+ class MockSVGRect {
2832
+ constructor() {
2833
+ this.height = 10;
2834
+ this.width = 10;
2835
+ this.x = 0;
2836
+ this.y = 0;
2837
+ }
2838
+ }
2722
2839
  class MockStyleElement extends MockHTMLElement {
2723
2840
  constructor(ownerDocument) {
2724
2841
  super(ownerDocument, 'style');
@@ -2751,9 +2868,6 @@ class MockSVGElement extends MockElement {
2751
2868
  get viewportElement() {
2752
2869
  return null;
2753
2870
  }
2754
- focus() {
2755
- /**/
2756
- }
2757
2871
  onunload() {
2758
2872
  /**/
2759
2873
  }
@@ -2771,6 +2885,27 @@ class MockSVGElement extends MockElement {
2771
2885
  return 0;
2772
2886
  }
2773
2887
  }
2888
+ class MockSVGGraphicsElement extends MockSVGElement {
2889
+ getBBox(_options) {
2890
+ return new MockSVGRect();
2891
+ }
2892
+ getCTM() {
2893
+ return new MockDOMMatrix();
2894
+ }
2895
+ getScreenCTM() {
2896
+ return new MockDOMMatrix();
2897
+ }
2898
+ }
2899
+ class MockSVGSVGElement extends MockSVGGraphicsElement {
2900
+ createSVGPoint() {
2901
+ return new MockDOMPoint();
2902
+ }
2903
+ }
2904
+ class MockSVGTextContentElement extends MockSVGGraphicsElement {
2905
+ getComputedTextLength() {
2906
+ return 0;
2907
+ }
2908
+ }
2774
2909
  class MockBaseElement extends MockHTMLElement {
2775
2910
  constructor(ownerDocument) {
2776
2911
  super(ownerDocument, 'base');
@@ -199,6 +199,62 @@ declare class MockScriptElement extends MockHTMLElement {
199
199
  get src(): string;
200
200
  set src(value: string);
201
201
  }
202
+ declare class MockDOMMatrix {
203
+ static fromMatrix(): MockDOMMatrix;
204
+ a: number;
205
+ b: number;
206
+ c: number;
207
+ d: number;
208
+ e: number;
209
+ f: number;
210
+ m11: number;
211
+ m12: number;
212
+ m13: number;
213
+ m14: number;
214
+ m21: number;
215
+ m22: number;
216
+ m23: number;
217
+ m24: number;
218
+ m31: number;
219
+ m32: number;
220
+ m33: number;
221
+ m34: number;
222
+ m41: number;
223
+ m42: number;
224
+ m43: number;
225
+ m44: number;
226
+ is2D: boolean;
227
+ isIdentity: boolean;
228
+ inverse(): MockDOMMatrix;
229
+ flipX(): MockDOMMatrix;
230
+ flipY(): MockDOMMatrix;
231
+ multiply(): MockDOMMatrix;
232
+ rotate(): MockDOMMatrix;
233
+ rotateAxisAngle(): MockDOMMatrix;
234
+ rotateFromVector(): MockDOMMatrix;
235
+ scale(): MockDOMMatrix;
236
+ scaleNonUniform(): MockDOMMatrix;
237
+ skewX(): MockDOMMatrix;
238
+ skewY(): MockDOMMatrix;
239
+ toJSON(): void;
240
+ toString(): void;
241
+ transformPoint(): MockDOMPoint;
242
+ translate(): MockDOMMatrix;
243
+ }
244
+ declare class MockDOMPoint {
245
+ w: number;
246
+ x: number;
247
+ y: number;
248
+ z: number;
249
+ toJSON(): void;
250
+ matrixTransform(): MockDOMMatrix;
251
+ }
252
+ declare class MockSVGRect {
253
+ height: number;
254
+ width: number;
255
+ x: number;
256
+ y: number;
257
+ }
202
258
  declare class MockStyleElement extends MockHTMLElement {
203
259
  sheet: MockCSSStyleSheet;
204
260
  constructor(ownerDocument: any);
@@ -212,13 +268,28 @@ declare class MockStyleElement extends MockHTMLElement {
212
268
  declare class MockSVGElement extends MockElement {
213
269
  get ownerSVGElement(): SVGSVGElement;
214
270
  get viewportElement(): SVGElement;
215
- focus(): void;
216
271
  onunload(): void;
217
272
  get pathLength(): number;
218
273
  isPointInFill(_pt: DOMPoint): boolean;
219
274
  isPointInStroke(_pt: DOMPoint): boolean;
220
275
  getTotalLength(): number;
221
276
  }
277
+ declare class MockSVGGraphicsElement extends MockSVGElement {
278
+ getBBox(_options?: {
279
+ clipped: boolean;
280
+ fill: boolean;
281
+ markers: boolean;
282
+ stroke: boolean;
283
+ }): MockSVGRect;
284
+ getCTM(): MockDOMMatrix;
285
+ getScreenCTM(): MockDOMMatrix;
286
+ }
287
+ declare class MockSVGSVGElement extends MockSVGGraphicsElement {
288
+ createSVGPoint(): MockDOMPoint;
289
+ }
290
+ declare class MockSVGTextContentElement extends MockSVGGraphicsElement {
291
+ getComputedTextLength(): number;
292
+ }
222
293
  declare class MockBaseElement extends MockHTMLElement {
223
294
  constructor(ownerDocument: any);
224
295
  get href(): string;
@@ -438,6 +509,7 @@ declare class MockElement extends MockNode {
438
509
  constructor(ownerDocument: any, nodeName: string);
439
510
  addEventListener(type: string, handler: (ev?: any) => void): void;
440
511
  attachShadow(_opts: ShadowRootInit): any;
512
+ blur(): void;
441
513
  get shadowRoot(): any;
442
514
  set shadowRoot(shadowRoot: any);
443
515
  get attributes(): MockAttributeMap;
@@ -455,6 +527,9 @@ declare class MockElement extends MockNode {
455
527
  set dir(value: string);
456
528
  dispatchEvent(ev: MockEvent): boolean;
457
529
  get firstElementChild(): MockElement | null;
530
+ focus(_options?: {
531
+ preventScroll?: boolean;
532
+ }): void;
458
533
  getAttribute(attrName: string): any;
459
534
  getAttributeNS(namespaceURI: string, attrName: string): string;
460
535
  getBoundingClientRect(): {
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc v2.16.1-0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v2.17.1 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  const CONTENT_REF_ID = 'r';
5
5
  const ORG_LOCATION_ID = 'o';
@@ -1598,6 +1598,9 @@ class MockElement extends MockNode {
1598
1598
  this.shadowRoot = shadowRoot;
1599
1599
  return shadowRoot;
1600
1600
  }
1601
+ blur() {
1602
+ /**/
1603
+ }
1601
1604
  get shadowRoot() {
1602
1605
  return this.__shadowRoot || null;
1603
1606
  }
@@ -1666,6 +1669,7 @@ class MockElement extends MockNode {
1666
1669
  get firstElementChild() {
1667
1670
  return this.children[0] || null;
1668
1671
  }
1672
+ focus(_options) { }
1669
1673
  getAttribute(attrName) {
1670
1674
  if (attrName === 'style') {
1671
1675
  if (this.__style != null && this.__style.length > 0) {
@@ -2569,7 +2573,28 @@ function createElementNS(ownerDocument, namespaceURI, tagName) {
2569
2573
  return createElement(ownerDocument, tagName);
2570
2574
  }
2571
2575
  else if (namespaceURI === 'http://www.w3.org/2000/svg') {
2572
- return new MockSVGElement(ownerDocument, tagName);
2576
+ switch (tagName.toLowerCase()) {
2577
+ case 'text':
2578
+ case 'tspan':
2579
+ case 'tref':
2580
+ case 'altglyph':
2581
+ case 'textpath':
2582
+ return new MockSVGTextContentElement(ownerDocument, tagName);
2583
+ case 'circle':
2584
+ case 'ellipse':
2585
+ case 'image':
2586
+ case 'line':
2587
+ case 'path':
2588
+ case 'polygon':
2589
+ case 'polyline':
2590
+ case 'rect':
2591
+ case 'use':
2592
+ return new MockSVGGraphicsElement(ownerDocument, tagName);
2593
+ case 'svg':
2594
+ return new MockSVGSVGElement(ownerDocument, tagName);
2595
+ default:
2596
+ return new MockSVGElement(ownerDocument, tagName);
2597
+ }
2573
2598
  }
2574
2599
  else {
2575
2600
  return new MockElement(ownerDocument, tagName);
@@ -2716,6 +2741,98 @@ class MockScriptElement extends MockHTMLElement {
2716
2741
  patchPropAttributes(MockScriptElement.prototype, {
2717
2742
  type: String,
2718
2743
  });
2744
+ class MockDOMMatrix {
2745
+ constructor() {
2746
+ this.a = 1;
2747
+ this.b = 0;
2748
+ this.c = 0;
2749
+ this.d = 1;
2750
+ this.e = 0;
2751
+ this.f = 0;
2752
+ this.m11 = 1;
2753
+ this.m12 = 0;
2754
+ this.m13 = 0;
2755
+ this.m14 = 0;
2756
+ this.m21 = 0;
2757
+ this.m22 = 1;
2758
+ this.m23 = 0;
2759
+ this.m24 = 0;
2760
+ this.m31 = 0;
2761
+ this.m32 = 0;
2762
+ this.m33 = 1;
2763
+ this.m34 = 0;
2764
+ this.m41 = 0;
2765
+ this.m42 = 0;
2766
+ this.m43 = 0;
2767
+ this.m44 = 1;
2768
+ this.is2D = true;
2769
+ this.isIdentity = true;
2770
+ }
2771
+ static fromMatrix() {
2772
+ return new MockDOMMatrix();
2773
+ }
2774
+ inverse() {
2775
+ return new MockDOMMatrix();
2776
+ }
2777
+ flipX() {
2778
+ return new MockDOMMatrix();
2779
+ }
2780
+ flipY() {
2781
+ return new MockDOMMatrix();
2782
+ }
2783
+ multiply() {
2784
+ return new MockDOMMatrix();
2785
+ }
2786
+ rotate() {
2787
+ return new MockDOMMatrix();
2788
+ }
2789
+ rotateAxisAngle() {
2790
+ return new MockDOMMatrix();
2791
+ }
2792
+ rotateFromVector() {
2793
+ return new MockDOMMatrix();
2794
+ }
2795
+ scale() {
2796
+ return new MockDOMMatrix();
2797
+ }
2798
+ scaleNonUniform() {
2799
+ return new MockDOMMatrix();
2800
+ }
2801
+ skewX() {
2802
+ return new MockDOMMatrix();
2803
+ }
2804
+ skewY() {
2805
+ return new MockDOMMatrix();
2806
+ }
2807
+ toJSON() { }
2808
+ toString() { }
2809
+ transformPoint() {
2810
+ return new MockDOMPoint();
2811
+ }
2812
+ translate() {
2813
+ return new MockDOMMatrix();
2814
+ }
2815
+ }
2816
+ class MockDOMPoint {
2817
+ constructor() {
2818
+ this.w = 1;
2819
+ this.x = 0;
2820
+ this.y = 0;
2821
+ this.z = 0;
2822
+ }
2823
+ toJSON() { }
2824
+ matrixTransform() {
2825
+ return new MockDOMMatrix();
2826
+ }
2827
+ }
2828
+ class MockSVGRect {
2829
+ constructor() {
2830
+ this.height = 10;
2831
+ this.width = 10;
2832
+ this.x = 0;
2833
+ this.y = 0;
2834
+ }
2835
+ }
2719
2836
  class MockStyleElement extends MockHTMLElement {
2720
2837
  constructor(ownerDocument) {
2721
2838
  super(ownerDocument, 'style');
@@ -2748,9 +2865,6 @@ class MockSVGElement extends MockElement {
2748
2865
  get viewportElement() {
2749
2866
  return null;
2750
2867
  }
2751
- focus() {
2752
- /**/
2753
- }
2754
2868
  onunload() {
2755
2869
  /**/
2756
2870
  }
@@ -2768,6 +2882,27 @@ class MockSVGElement extends MockElement {
2768
2882
  return 0;
2769
2883
  }
2770
2884
  }
2885
+ class MockSVGGraphicsElement extends MockSVGElement {
2886
+ getBBox(_options) {
2887
+ return new MockSVGRect();
2888
+ }
2889
+ getCTM() {
2890
+ return new MockDOMMatrix();
2891
+ }
2892
+ getScreenCTM() {
2893
+ return new MockDOMMatrix();
2894
+ }
2895
+ }
2896
+ class MockSVGSVGElement extends MockSVGGraphicsElement {
2897
+ createSVGPoint() {
2898
+ return new MockDOMPoint();
2899
+ }
2900
+ }
2901
+ class MockSVGTextContentElement extends MockSVGGraphicsElement {
2902
+ getComputedTextLength() {
2903
+ return 0;
2904
+ }
2905
+ }
2771
2906
  class MockBaseElement extends MockHTMLElement {
2772
2907
  constructor(ownerDocument) {
2773
2908
  super(ownerDocument, 'base');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "2.16.1-0",
3
+ "version": "2.17.1",
4
4
  "description": "Mock window, document and DOM outside of a browser environment.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core",
3
- "version": "2.16.1-0",
3
+ "version": "2.17.1",
4
4
  "license": "MIT",
5
5
  "main": "./internal/stencil-core/index.cjs",
6
6
  "module": "./internal/stencil-core/index.js",
@@ -98,6 +98,7 @@
98
98
  "dts-bundle-generator": "~5.3.0",
99
99
  "eslint": "^8.13.0",
100
100
  "eslint-config-prettier": "^8.5.0",
101
+ "eslint-plugin-jest": "^26.5.3",
101
102
  "eslint-plugin-jsdoc": "^39.3.1",
102
103
  "execa": "4.1.0",
103
104
  "exit": "^0.1.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/screenshot",
3
- "version": "2.16.1-0",
3
+ "version": "2.17.1",
4
4
  "description": "Stencil Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",