@stencil/core 2.16.1 → 2.17.2-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/cli/config-flags.d.ts +110 -0
  2. package/cli/index.cjs +710 -225
  3. package/cli/index.d.ts +2 -1
  4. package/cli/index.js +710 -225
  5. package/cli/package.json +1 -1
  6. package/compiler/package.json +1 -1
  7. package/compiler/stencil.js +905 -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 +163 -5
  32. package/mock-doc/index.d.ts +86 -1
  33. package/mock-doc/index.js +163 -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 +445 -382
  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
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc v2.16.1 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v2.17.2-0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  const CONTENT_REF_ID = 'r';
5
5
  const ORG_LOCATION_ID = 'o';
@@ -686,6 +686,25 @@ class MockMouseEvent extends MockEvent {
686
686
  }
687
687
  }
688
688
  }
689
+ class MockUIEvent extends MockEvent {
690
+ constructor(type, uiEventInitDic) {
691
+ super(type);
692
+ this.detail = null;
693
+ this.view = null;
694
+ if (uiEventInitDic != null) {
695
+ Object.assign(this, uiEventInitDic);
696
+ }
697
+ }
698
+ }
699
+ class MockFocusEvent extends MockUIEvent {
700
+ constructor(type, focusEventInitDic) {
701
+ super(type);
702
+ this.relatedTarget = null;
703
+ if (focusEventInitDic != null) {
704
+ Object.assign(this, focusEventInitDic);
705
+ }
706
+ }
707
+ }
689
708
  class MockEventListener {
690
709
  constructor(type, handler) {
691
710
  this.type = type;
@@ -1598,6 +1617,9 @@ class MockElement extends MockNode {
1598
1617
  this.shadowRoot = shadowRoot;
1599
1618
  return shadowRoot;
1600
1619
  }
1620
+ blur() {
1621
+ dispatchEvent(this, new MockFocusEvent('blur', { relatedTarget: null, bubbles: true, cancelable: true, composed: true }));
1622
+ }
1601
1623
  get shadowRoot() {
1602
1624
  return this.__shadowRoot || null;
1603
1625
  }
@@ -1666,6 +1688,9 @@ class MockElement extends MockNode {
1666
1688
  get firstElementChild() {
1667
1689
  return this.children[0] || null;
1668
1690
  }
1691
+ focus(_options) {
1692
+ dispatchEvent(this, new MockFocusEvent('focus', { relatedTarget: null, bubbles: true, cancelable: true, composed: true }));
1693
+ }
1669
1694
  getAttribute(attrName) {
1670
1695
  if (attrName === 'style') {
1671
1696
  if (this.__style != null && this.__style.length > 0) {
@@ -2569,7 +2594,28 @@ function createElementNS(ownerDocument, namespaceURI, tagName) {
2569
2594
  return createElement(ownerDocument, tagName);
2570
2595
  }
2571
2596
  else if (namespaceURI === 'http://www.w3.org/2000/svg') {
2572
- return new MockSVGElement(ownerDocument, tagName);
2597
+ switch (tagName.toLowerCase()) {
2598
+ case 'text':
2599
+ case 'tspan':
2600
+ case 'tref':
2601
+ case 'altglyph':
2602
+ case 'textpath':
2603
+ return new MockSVGTextContentElement(ownerDocument, tagName);
2604
+ case 'circle':
2605
+ case 'ellipse':
2606
+ case 'image':
2607
+ case 'line':
2608
+ case 'path':
2609
+ case 'polygon':
2610
+ case 'polyline':
2611
+ case 'rect':
2612
+ case 'use':
2613
+ return new MockSVGGraphicsElement(ownerDocument, tagName);
2614
+ case 'svg':
2615
+ return new MockSVGSVGElement(ownerDocument, tagName);
2616
+ default:
2617
+ return new MockSVGElement(ownerDocument, tagName);
2618
+ }
2573
2619
  }
2574
2620
  else {
2575
2621
  return new MockElement(ownerDocument, tagName);
@@ -2716,6 +2762,98 @@ class MockScriptElement extends MockHTMLElement {
2716
2762
  patchPropAttributes(MockScriptElement.prototype, {
2717
2763
  type: String,
2718
2764
  });
2765
+ class MockDOMMatrix {
2766
+ constructor() {
2767
+ this.a = 1;
2768
+ this.b = 0;
2769
+ this.c = 0;
2770
+ this.d = 1;
2771
+ this.e = 0;
2772
+ this.f = 0;
2773
+ this.m11 = 1;
2774
+ this.m12 = 0;
2775
+ this.m13 = 0;
2776
+ this.m14 = 0;
2777
+ this.m21 = 0;
2778
+ this.m22 = 1;
2779
+ this.m23 = 0;
2780
+ this.m24 = 0;
2781
+ this.m31 = 0;
2782
+ this.m32 = 0;
2783
+ this.m33 = 1;
2784
+ this.m34 = 0;
2785
+ this.m41 = 0;
2786
+ this.m42 = 0;
2787
+ this.m43 = 0;
2788
+ this.m44 = 1;
2789
+ this.is2D = true;
2790
+ this.isIdentity = true;
2791
+ }
2792
+ static fromMatrix() {
2793
+ return new MockDOMMatrix();
2794
+ }
2795
+ inverse() {
2796
+ return new MockDOMMatrix();
2797
+ }
2798
+ flipX() {
2799
+ return new MockDOMMatrix();
2800
+ }
2801
+ flipY() {
2802
+ return new MockDOMMatrix();
2803
+ }
2804
+ multiply() {
2805
+ return new MockDOMMatrix();
2806
+ }
2807
+ rotate() {
2808
+ return new MockDOMMatrix();
2809
+ }
2810
+ rotateAxisAngle() {
2811
+ return new MockDOMMatrix();
2812
+ }
2813
+ rotateFromVector() {
2814
+ return new MockDOMMatrix();
2815
+ }
2816
+ scale() {
2817
+ return new MockDOMMatrix();
2818
+ }
2819
+ scaleNonUniform() {
2820
+ return new MockDOMMatrix();
2821
+ }
2822
+ skewX() {
2823
+ return new MockDOMMatrix();
2824
+ }
2825
+ skewY() {
2826
+ return new MockDOMMatrix();
2827
+ }
2828
+ toJSON() { }
2829
+ toString() { }
2830
+ transformPoint() {
2831
+ return new MockDOMPoint();
2832
+ }
2833
+ translate() {
2834
+ return new MockDOMMatrix();
2835
+ }
2836
+ }
2837
+ class MockDOMPoint {
2838
+ constructor() {
2839
+ this.w = 1;
2840
+ this.x = 0;
2841
+ this.y = 0;
2842
+ this.z = 0;
2843
+ }
2844
+ toJSON() { }
2845
+ matrixTransform() {
2846
+ return new MockDOMMatrix();
2847
+ }
2848
+ }
2849
+ class MockSVGRect {
2850
+ constructor() {
2851
+ this.height = 10;
2852
+ this.width = 10;
2853
+ this.x = 0;
2854
+ this.y = 0;
2855
+ }
2856
+ }
2719
2857
  class MockStyleElement extends MockHTMLElement {
2720
2858
  constructor(ownerDocument) {
2721
2859
  super(ownerDocument, 'style');
@@ -2748,9 +2886,6 @@ class MockSVGElement extends MockElement {
2748
2886
  get viewportElement() {
2749
2887
  return null;
2750
2888
  }
2751
- focus() {
2752
- /**/
2753
- }
2754
2889
  onunload() {
2755
2890
  /**/
2756
2891
  }
@@ -2768,6 +2903,27 @@ class MockSVGElement extends MockElement {
2768
2903
  return 0;
2769
2904
  }
2770
2905
  }
2906
+ class MockSVGGraphicsElement extends MockSVGElement {
2907
+ getBBox(_options) {
2908
+ return new MockSVGRect();
2909
+ }
2910
+ getCTM() {
2911
+ return new MockDOMMatrix();
2912
+ }
2913
+ getScreenCTM() {
2914
+ return new MockDOMMatrix();
2915
+ }
2916
+ }
2917
+ class MockSVGSVGElement extends MockSVGGraphicsElement {
2918
+ createSVGPoint() {
2919
+ return new MockDOMPoint();
2920
+ }
2921
+ }
2922
+ class MockSVGTextContentElement extends MockSVGGraphicsElement {
2923
+ getComputedTextLength() {
2924
+ return 0;
2925
+ }
2926
+ }
2771
2927
  class MockBaseElement extends MockHTMLElement {
2772
2928
  constructor(ownerDocument) {
2773
2929
  super(ownerDocument, 'base');
@@ -3293,6 +3449,7 @@ const WINDOW_PROPS = [
3293
3449
  'HTMLElement',
3294
3450
  'Node',
3295
3451
  'NodeList',
3452
+ 'FocusEvent',
3296
3453
  'KeyboardEvent',
3297
3454
  'MouseEvent',
3298
3455
  ];
@@ -3300,6 +3457,7 @@ const GLOBAL_CONSTRUCTORS = [
3300
3457
  ['CustomEvent', MockCustomEvent],
3301
3458
  ['Event', MockEvent],
3302
3459
  ['Headers', MockHeaders],
3460
+ ['FocusEvent', MockFocusEvent],
3303
3461
  ['KeyboardEvent', MockKeyboardEvent],
3304
3462
  ['MouseEvent', MockMouseEvent],
3305
3463
  ['Request', MockRequest],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "2.16.1",
3
+ "version": "2.17.2-0",
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",
3
+ "version": "2.17.2-0",
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",
3
+ "version": "2.17.2-0",
4
4
  "description": "Stencil Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",