@stencil/core 4.32.0 → 4.33.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 (39) hide show
  1. package/cli/index.cjs +1 -1
  2. package/cli/index.js +1 -1
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +21 -9
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +2 -2
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +2 -2
  12. package/internal/app-data/package.json +1 -1
  13. package/internal/app-globals/index.d.ts +2 -0
  14. package/internal/app-globals/index.js +14 -0
  15. package/internal/app-globals/package.json +14 -0
  16. package/internal/client/index.js +285 -286
  17. package/internal/client/package.json +1 -1
  18. package/internal/client/patch-browser.js +1 -1
  19. package/internal/hydrate/index.js +284 -293
  20. package/internal/hydrate/package.json +1 -1
  21. package/internal/hydrate/runner.js +53 -32
  22. package/internal/package.json +1 -1
  23. package/internal/stencil-private.d.ts +4 -1
  24. package/internal/stencil-public-runtime.d.ts +1 -1
  25. package/internal/testing/index.js +294 -288
  26. package/internal/testing/package.json +1 -1
  27. package/mock-doc/index.cjs +28 -10
  28. package/mock-doc/index.d.ts +5 -4
  29. package/mock-doc/index.js +28 -10
  30. package/mock-doc/package.json +1 -1
  31. package/package.json +5 -1
  32. package/screenshot/index.js +1 -1
  33. package/screenshot/package.json +1 -1
  34. package/screenshot/pixel-match.js +1 -1
  35. package/sys/node/index.js +21 -21
  36. package/sys/node/package.json +1 -1
  37. package/sys/node/worker.js +1 -1
  38. package/testing/index.js +27 -24
  39. package/testing/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/hydrate",
3
- "version": "4.32.0",
3
+ "version": "4.33.0",
4
4
  "description": "Stencil internal hydrate platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Hydrate Runner v4.32.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Runner v4.33.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -11700,6 +11700,12 @@ var MockDocumentFragment = class _MockDocumentFragment extends MockHTMLElement {
11700
11700
  getElementById(id) {
11701
11701
  return getElementById(this, id);
11702
11702
  }
11703
+ get adoptedStyleSheets() {
11704
+ return [];
11705
+ }
11706
+ set adoptedStyleSheets(_adoptedStyleSheets) {
11707
+ throw new Error("Unimplemented");
11708
+ }
11703
11709
  cloneNode(deep) {
11704
11710
  const cloned = new _MockDocumentFragment(null);
11705
11711
  if (deep) {
@@ -11748,7 +11754,9 @@ var MockCSSStyleSheet = class {
11748
11754
  deleteRule(index) {
11749
11755
  if (index >= 0 && index < this.cssRules.length) {
11750
11756
  this.cssRules.splice(index, 1);
11751
- updateStyleTextNode(this.ownerNode);
11757
+ if (this.ownerNode) {
11758
+ updateStyleTextNode(this.ownerNode);
11759
+ }
11752
11760
  }
11753
11761
  }
11754
11762
  insertRule(rule, index = 0) {
@@ -11764,9 +11772,23 @@ var MockCSSStyleSheet = class {
11764
11772
  const cssRule = new MockCSSRule(this);
11765
11773
  cssRule.cssText = rule;
11766
11774
  this.cssRules.splice(index, 0, cssRule);
11767
- updateStyleTextNode(this.ownerNode);
11775
+ if (this.ownerNode) {
11776
+ updateStyleTextNode(this.ownerNode);
11777
+ }
11768
11778
  return index;
11769
11779
  }
11780
+ replaceSync(cssText) {
11781
+ this.cssRules = [];
11782
+ const rules = cssText.split("}").map((rule) => rule.trim()).filter(Boolean).map((rule) => rule + "}");
11783
+ for (const rule of rules) {
11784
+ const cssRule = new MockCSSRule(this);
11785
+ cssRule.cssText = rule;
11786
+ this.cssRules.push(cssRule);
11787
+ }
11788
+ if (this.ownerNode) {
11789
+ updateStyleTextNode(this.ownerNode);
11790
+ }
11791
+ }
11770
11792
  };
11771
11793
  function getStyleElementText(styleElm) {
11772
11794
  const output = [];
@@ -12805,9 +12827,11 @@ var WINDOW_PROPS = [
12805
12827
  "NodeList",
12806
12828
  "FocusEvent",
12807
12829
  "KeyboardEvent",
12808
- "MouseEvent"
12830
+ "MouseEvent",
12831
+ "CSSStyleSheet"
12809
12832
  ];
12810
12833
  var GLOBAL_CONSTRUCTORS = [
12834
+ ["CSSStyleSheet", MockCSSStyleSheet],
12811
12835
  ["CustomEvent", MockCustomEvent],
12812
12836
  ["DocumentFragment", MockDocumentFragment],
12813
12837
  ["DOMParser", MockDOMParser],
@@ -13015,12 +13039,6 @@ var MockShadowRoot = class extends MockDocumentFragment {
13015
13039
  get activeElement() {
13016
13040
  return null;
13017
13041
  }
13018
- set adoptedStyleSheets(_adoptedStyleSheets) {
13019
- throw new Error("Unimplemented");
13020
- }
13021
- get adoptedStyleSheets() {
13022
- return [];
13023
- }
13024
13042
  get cloneable() {
13025
13043
  return false;
13026
13044
  }
@@ -14146,10 +14164,10 @@ var supportsConstructableStylesheets = BUILD6.constructableCSS ? /* @__PURE__ */
14146
14164
  })() : false;
14147
14165
 
14148
14166
  // src/client/index.ts
14149
- import { BUILD as BUILD29, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
14167
+ import { BUILD as BUILD30, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
14150
14168
 
14151
14169
  // src/runtime/bootstrap-custom-element.ts
14152
- import { BUILD as BUILD26 } from "@stencil/core/internal/app-data";
14170
+ import { BUILD as BUILD27 } from "@stencil/core/internal/app-data";
14153
14171
 
14154
14172
  // src/utils/helpers.ts
14155
14173
  var isString = (v) => typeof v === "string";
@@ -14582,6 +14600,9 @@ function deserializeProperty(value) {
14582
14600
  return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
14583
14601
  }
14584
14602
 
14603
+ // src/utils/shadow-root.ts
14604
+ import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
14605
+
14585
14606
  // src/utils/util.ts
14586
14607
  var lowerPathParam = (fn) => (p) => fn(p.toLowerCase());
14587
14608
  var isDtsFile = lowerPathParam((p) => p.endsWith(".d.ts") || p.endsWith(".d.mts") || p.endsWith(".d.cts"));
@@ -14597,25 +14618,25 @@ var isJsxFile = lowerPathParam(
14597
14618
  var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") || p.endsWith(".cjs"));
14598
14619
 
14599
14620
  // src/runtime/connected-callback.ts
14600
- import { BUILD as BUILD24 } from "@stencil/core/internal/app-data";
14621
+ import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
14601
14622
 
14602
14623
  // src/runtime/client-hydrate.ts
14603
- import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
14624
+ import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
14604
14625
 
14605
14626
  // src/runtime/dom-extras.ts
14606
- import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
14627
+ import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
14607
14628
 
14608
14629
  // src/runtime/slot-polyfill-utils.ts
14609
- import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
14630
+ import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
14610
14631
 
14611
14632
  // src/runtime/profile.ts
14612
- import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
14633
+ import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
14613
14634
 
14614
14635
  // src/runtime/vdom/h.ts
14615
- import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
14636
+ import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
14616
14637
 
14617
14638
  // src/runtime/initialize-component.ts
14618
- import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
14639
+ import { BUILD as BUILD24 } from "@stencil/core/internal/app-data";
14619
14640
 
14620
14641
  // src/utils/shadow-css.ts
14621
14642
  /**
@@ -14654,45 +14675,45 @@ var _colonHostContextRe = createSupportsRuleRe(":host-context");
14654
14675
  var setMode = (handler) => modeResolutionChain.push(handler);
14655
14676
 
14656
14677
  // src/runtime/proxy-component.ts
14657
- import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
14678
+ import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
14658
14679
 
14659
14680
  // src/runtime/set-value.ts
14660
- import { BUILD as BUILD21 } from "@stencil/core/internal/app-data";
14681
+ import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
14661
14682
 
14662
14683
  // src/runtime/parse-property-value.ts
14663
- import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
14684
+ import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
14664
14685
 
14665
14686
  // src/runtime/update-component.ts
14666
- import { BUILD as BUILD20, NAMESPACE } from "@stencil/core/internal/app-data";
14687
+ import { BUILD as BUILD21, NAMESPACE } from "@stencil/core/internal/app-data";
14667
14688
 
14668
14689
  // src/runtime/event-emitter.ts
14669
- import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
14690
+ import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
14670
14691
 
14671
14692
  // src/runtime/element.ts
14672
- import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
14693
+ import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
14673
14694
 
14674
14695
  // src/runtime/styles.ts
14675
- import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
14696
+ import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
14676
14697
 
14677
14698
  // src/runtime/vdom/vdom-render.ts
14678
- import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
14699
+ import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
14679
14700
 
14680
14701
  // src/runtime/vdom/update-element.ts
14681
- import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
14702
+ import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
14682
14703
 
14683
14704
  // src/runtime/vdom/set-accessor.ts
14684
- import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
14705
+ import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
14685
14706
  var CAPTURE_EVENT_SUFFIX = "Capture";
14686
14707
  var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
14687
14708
 
14688
14709
  // src/runtime/disconnected-callback.ts
14689
- import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
14710
+ import { BUILD as BUILD26 } from "@stencil/core/internal/app-data";
14690
14711
 
14691
14712
  // src/runtime/bootstrap-lazy.ts
14692
- import { BUILD as BUILD27 } from "@stencil/core/internal/app-data";
14713
+ import { BUILD as BUILD28 } from "@stencil/core/internal/app-data";
14693
14714
 
14694
14715
  // src/runtime/host-listener.ts
14695
- import { BUILD as BUILD28 } from "@stencil/core/internal/app-data";
14716
+ import { BUILD as BUILD29 } from "@stencil/core/internal/app-data";
14696
14717
 
14697
14718
  // src/compiler/html/canonical-link.ts
14698
14719
  var updateCanonicalLink = (doc, href) => {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal",
3
- "version": "4.32.0",
3
+ "version": "4.33.0",
4
4
  "description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -203,7 +203,10 @@ export interface BuildCtx {
203
203
  scriptsDeleted: string[];
204
204
  startTime: number;
205
205
  styleBuildCount: number;
206
- stylesPromise: Promise<void>;
206
+ /**
207
+ * A promise that resolves to the global styles for the current build.
208
+ */
209
+ stylesPromise: Promise<string>;
207
210
  stylesUpdated: BuildStyleUpdate[];
208
211
  timeSpan: LoggerTimeSpan;
209
212
  timestamp: string;
@@ -1601,7 +1601,7 @@ export declare namespace JSXBase {
1601
1601
  onKeyUp?: (event: KeyboardEvent) => void;
1602
1602
  onKeyUpCapture?: (event: KeyboardEvent) => void;
1603
1603
  onAuxClick?: (event: MouseEvent) => void;
1604
- onClick?: (event: MouseEvent) => void;
1604
+ onClick?: (event: PointerEvent) => void;
1605
1605
  onClickCapture?: (event: MouseEvent) => void;
1606
1606
  onContextMenu?: (event: MouseEvent) => void;
1607
1607
  onContextMenuCapture?: (event: MouseEvent) => void;