@stencil/core 4.39.0-dev.1766120789.792acf5 → 4.39.0-dev.1766466419.b73a44b

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 +2 -1
  2. package/cli/index.js +2 -1
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +30 -12
  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 +3 -2
  12. package/internal/app-data/index.cjs +1 -0
  13. package/internal/app-data/index.js +1 -0
  14. package/internal/app-data/package.json +1 -1
  15. package/internal/app-globals/package.json +1 -1
  16. package/internal/client/index.js +45 -22
  17. package/internal/client/package.json +1 -1
  18. package/internal/client/patch-browser.js +1 -1
  19. package/internal/hydrate/index.js +45 -22
  20. package/internal/hydrate/package.json +1 -1
  21. package/internal/hydrate/runner.js +1 -1
  22. package/internal/package.json +1 -1
  23. package/internal/stencil-private.d.ts +6 -0
  24. package/internal/stencil-public-compiler.d.ts +8 -3
  25. package/internal/stencil-public-runtime.d.ts +8 -2
  26. package/internal/testing/index.js +44 -21
  27. package/internal/testing/package.json +1 -1
  28. package/mock-doc/index.cjs +1 -1
  29. package/mock-doc/index.js +1 -1
  30. package/mock-doc/package.json +1 -1
  31. package/package.json +1 -1
  32. package/screenshot/index.js +2 -1
  33. package/screenshot/package.json +1 -1
  34. package/screenshot/pixel-match.js +1 -1
  35. package/sys/node/index.js +23 -23
  36. package/sys/node/package.json +1 -1
  37. package/sys/node/worker.js +1 -1
  38. package/testing/index.js +8 -7
  39. package/testing/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Platform v4.39.0-dev.1766120789.792acf5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Platform v4.39.0-dev.1766466419.b73a44b | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -2130,10 +2130,17 @@ var globalStyleSheet;
2130
2130
  var GLOBAL_STYLE_ID = "sc-global";
2131
2131
  function createShadowRoot(cmpMeta) {
2132
2132
  var _a;
2133
- const shadowRoot = BUILD8.shadowDelegatesFocus ? this.attachShadow({
2134
- mode: "open",
2135
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
2136
- }) : this.attachShadow({ mode: "open" });
2133
+ const opts = { mode: "open" };
2134
+ if (BUILD8.shadowDelegatesFocus) {
2135
+ opts.delegatesFocus = !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */);
2136
+ }
2137
+ if (BUILD8.shadowSlotAssignmentManual) {
2138
+ const isManual = !!(cmpMeta.$flags$ & 1024 /* shadowSlotAssignmentManual */);
2139
+ if (isManual) {
2140
+ opts.slotAssignment = "manual";
2141
+ }
2142
+ }
2143
+ const shadowRoot = this.attachShadow(opts);
2137
2144
  if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported(globalStyles)) != null ? _a : null;
2138
2145
  if (globalStyleSheet) {
2139
2146
  if (supportsMutableAdoptedStyleSheets) {
@@ -2799,7 +2806,7 @@ var registerStyle = (scopeId2, cssText, allowCS) => {
2799
2806
  styles.set(scopeId2, style);
2800
2807
  };
2801
2808
  var addStyle = (styleContainerNode, cmpMeta, mode) => {
2802
- var _a;
2809
+ var _a, _b, _c;
2803
2810
  const scopeId2 = getScopeId(cmpMeta, mode);
2804
2811
  const style = styles.get(scopeId2);
2805
2812
  if (!BUILD12.attachStyles || !win.document) {
@@ -2837,7 +2844,8 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2837
2844
  );
2838
2845
  } else if ("host" in styleContainerNode) {
2839
2846
  if (supportsConstructableStylesheets) {
2840
- const stylesheet = new CSSStyleSheet();
2847
+ const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
2848
+ const stylesheet = new currentWindow.CSSStyleSheet();
2841
2849
  stylesheet.replaceSync(style);
2842
2850
  if (supportsMutableAdoptedStyleSheets) {
2843
2851
  styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
@@ -2866,11 +2874,28 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2866
2874
  appliedStyles.add(scopeId2);
2867
2875
  }
2868
2876
  }
2869
- } else if (BUILD12.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
2870
- if (supportsMutableAdoptedStyleSheets) {
2871
- styleContainerNode.adoptedStyleSheets.push(style);
2872
- } else {
2873
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
2877
+ } else if (BUILD12.constructableCSS) {
2878
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
2879
+ if (!appliedStyles) {
2880
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2881
+ }
2882
+ if (!appliedStyles.has(scopeId2)) {
2883
+ const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
2884
+ let stylesheet;
2885
+ if (style.constructor === currentWindow.CSSStyleSheet) {
2886
+ stylesheet = style;
2887
+ } else {
2888
+ stylesheet = new currentWindow.CSSStyleSheet();
2889
+ for (let i2 = 0; i2 < style.cssRules.length; i2++) {
2890
+ stylesheet.insertRule(style.cssRules[i2].cssText, i2);
2891
+ }
2892
+ }
2893
+ if (supportsMutableAdoptedStyleSheets) {
2894
+ styleContainerNode.adoptedStyleSheets.push(stylesheet);
2895
+ } else {
2896
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
2897
+ }
2898
+ appliedStyles.add(scopeId2);
2874
2899
  }
2875
2900
  }
2876
2901
  }
@@ -4637,13 +4662,16 @@ render() {
4637
4662
  for (const relocateData of relocateNodes) {
4638
4663
  const nodeToRelocate = relocateData.$nodeToRelocate$;
4639
4664
  const slotRefNode = relocateData.$slotRefNode$;
4665
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && isInitialLoad) {
4666
+ nodeToRelocate["s-ih"] = (_a = nodeToRelocate.hidden) != null ? _a : false;
4667
+ }
4640
4668
  if (slotRefNode) {
4641
4669
  const parentNodeRef = slotRefNode.parentNode;
4642
4670
  let insertBeforeNode = slotRefNode.nextSibling;
4643
4671
  if (!BUILD20.hydrateServerSide && (!BUILD20.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
4644
- let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
4672
+ let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
4645
4673
  while (orgLocationNode) {
4646
- let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
4674
+ let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
4647
4675
  if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
4648
4676
  refNode = refNode.nextSibling;
4649
4677
  while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
@@ -4666,18 +4694,13 @@ render() {
4666
4694
  }
4667
4695
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
4668
4696
  if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
4669
- nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
4697
+ nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
4670
4698
  }
4671
4699
  }
4672
4700
  }
4673
4701
  nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
4674
- } else {
4675
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
4676
- if (isInitialLoad) {
4677
- nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
4678
- }
4679
- nodeToRelocate.hidden = true;
4680
- }
4702
+ } else if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
4703
+ nodeToRelocate.hidden = true;
4681
4704
  }
4682
4705
  }
4683
4706
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/client",
3
- "version": "4.39.0-dev.1766120789.792acf5",
3
+ "version": "4.39.0-dev.1766466419.b73a44b",
4
4
  "description": "Stencil internal client platform to be imported by the Stencil Compiler and internal runtime. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "exports": "./index.js",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Patch Browser v4.39.0-dev.1766120789.792acf5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Patch Browser v4.39.0-dev.1766466419.b73a44b | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/client/client-patch-browser.ts
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Hydrate Platform v4.39.0-dev.1766120789.792acf5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Platform v4.39.0-dev.1766466419.b73a44b | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -1892,10 +1892,17 @@ var globalStyleSheet;
1892
1892
  var GLOBAL_STYLE_ID = "sc-global";
1893
1893
  function createShadowRoot(cmpMeta) {
1894
1894
  var _a;
1895
- const shadowRoot = BUILD2.shadowDelegatesFocus ? this.attachShadow({
1896
- mode: "open",
1897
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
1898
- }) : this.attachShadow({ mode: "open" });
1895
+ const opts = { mode: "open" };
1896
+ if (BUILD2.shadowDelegatesFocus) {
1897
+ opts.delegatesFocus = !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */);
1898
+ }
1899
+ if (BUILD2.shadowSlotAssignmentManual) {
1900
+ const isManual = !!(cmpMeta.$flags$ & 1024 /* shadowSlotAssignmentManual */);
1901
+ if (isManual) {
1902
+ opts.slotAssignment = "manual";
1903
+ }
1904
+ }
1905
+ const shadowRoot = this.attachShadow(opts);
1899
1906
  if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported(globalStyles)) != null ? _a : null;
1900
1907
  if (globalStyleSheet) {
1901
1908
  if (supportsMutableAdoptedStyleSheets) {
@@ -2561,7 +2568,7 @@ var registerStyle = (scopeId2, cssText, allowCS) => {
2561
2568
  styles.set(scopeId2, style);
2562
2569
  };
2563
2570
  var addStyle = (styleContainerNode, cmpMeta, mode) => {
2564
- var _a;
2571
+ var _a, _b, _c;
2565
2572
  const scopeId2 = getScopeId(cmpMeta, mode);
2566
2573
  const style = styles.get(scopeId2);
2567
2574
  if (!BUILD6.attachStyles || !win.document) {
@@ -2599,7 +2606,8 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2599
2606
  );
2600
2607
  } else if ("host" in styleContainerNode) {
2601
2608
  if (supportsConstructableStylesheets) {
2602
- const stylesheet = new CSSStyleSheet();
2609
+ const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
2610
+ const stylesheet = new currentWindow.CSSStyleSheet();
2603
2611
  stylesheet.replaceSync(style);
2604
2612
  if (supportsMutableAdoptedStyleSheets) {
2605
2613
  styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
@@ -2628,11 +2636,28 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2628
2636
  appliedStyles.add(scopeId2);
2629
2637
  }
2630
2638
  }
2631
- } else if (BUILD6.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
2632
- if (supportsMutableAdoptedStyleSheets) {
2633
- styleContainerNode.adoptedStyleSheets.push(style);
2634
- } else {
2635
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
2639
+ } else if (BUILD6.constructableCSS) {
2640
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
2641
+ if (!appliedStyles) {
2642
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2643
+ }
2644
+ if (!appliedStyles.has(scopeId2)) {
2645
+ const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
2646
+ let stylesheet;
2647
+ if (style.constructor === currentWindow.CSSStyleSheet) {
2648
+ stylesheet = style;
2649
+ } else {
2650
+ stylesheet = new currentWindow.CSSStyleSheet();
2651
+ for (let i2 = 0; i2 < style.cssRules.length; i2++) {
2652
+ stylesheet.insertRule(style.cssRules[i2].cssText, i2);
2653
+ }
2654
+ }
2655
+ if (supportsMutableAdoptedStyleSheets) {
2656
+ styleContainerNode.adoptedStyleSheets.push(stylesheet);
2657
+ } else {
2658
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
2659
+ }
2660
+ appliedStyles.add(scopeId2);
2636
2661
  }
2637
2662
  }
2638
2663
  }
@@ -4399,13 +4424,16 @@ render() {
4399
4424
  for (const relocateData of relocateNodes) {
4400
4425
  const nodeToRelocate = relocateData.$nodeToRelocate$;
4401
4426
  const slotRefNode = relocateData.$slotRefNode$;
4427
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && isInitialLoad) {
4428
+ nodeToRelocate["s-ih"] = (_a = nodeToRelocate.hidden) != null ? _a : false;
4429
+ }
4402
4430
  if (slotRefNode) {
4403
4431
  const parentNodeRef = slotRefNode.parentNode;
4404
4432
  let insertBeforeNode = slotRefNode.nextSibling;
4405
4433
  if (!BUILD14.hydrateServerSide && (!BUILD14.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
4406
- let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
4434
+ let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
4407
4435
  while (orgLocationNode) {
4408
- let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
4436
+ let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
4409
4437
  if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
4410
4438
  refNode = refNode.nextSibling;
4411
4439
  while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
@@ -4428,18 +4456,13 @@ render() {
4428
4456
  }
4429
4457
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
4430
4458
  if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
4431
- nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
4459
+ nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
4432
4460
  }
4433
4461
  }
4434
4462
  }
4435
4463
  nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
4436
- } else {
4437
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
4438
- if (isInitialLoad) {
4439
- nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
4440
- }
4441
- nodeToRelocate.hidden = true;
4442
- }
4464
+ } else if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
4465
+ nodeToRelocate.hidden = true;
4443
4466
  }
4444
4467
  }
4445
4468
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/hydrate",
3
- "version": "4.39.0-dev.1766120789.792acf5",
3
+ "version": "4.39.0-dev.1766466419.b73a44b",
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.39.0-dev.1766120789.792acf5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Runner v4.39.0-dev.1766466419.b73a44b | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal",
3
- "version": "4.39.0-dev.1766120789.792acf5",
3
+ "version": "4.39.0-dev.1766466419.b73a44b",
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",
@@ -59,6 +59,7 @@ export interface BuildFeatures {
59
59
  formAssociated: boolean;
60
60
  shadowDom: boolean;
61
61
  shadowDelegatesFocus: boolean;
62
+ shadowSlotAssignmentManual: boolean;
62
63
  scoped: boolean;
63
64
  /**
64
65
  * Every component has a render function
@@ -560,6 +561,11 @@ export interface ComponentCompilerMeta extends ComponentCompilerFeatures {
560
561
  properties: ComponentCompilerProperty[];
561
562
  serializers: ComponentCompilerChangeHandler[];
562
563
  shadowDelegatesFocus: boolean;
564
+ /**
565
+ * Slot assignment mode for shadow DOM. 'manual', enables imperative slotting
566
+ * using HTMLSlotElement.assign(). Only applicable when encapsulation is 'shadow'.
567
+ */
568
+ slotAssignment: 'manual' | null;
563
569
  sourceFilePath: string;
564
570
  sourceMapPath: string;
565
571
  states: ComponentCompilerState[];
@@ -123,9 +123,12 @@ export interface StencilConfig {
123
123
  */
124
124
  plugins?: any[];
125
125
  /**
126
- * Generate js source map files for all bundles
126
+ * Generate js source map files for all bundles.
127
+ * Set to `true` to always generate source maps, `false` to never generate source maps.
128
+ * Set to `'dev'` to only generate source maps when the `--dev` flag is passed.
129
+ * Defaults to `'dev'`.
127
130
  */
128
- sourceMap?: boolean;
131
+ sourceMap?: boolean | 'dev';
129
132
  /**
130
133
  * The srcDir config specifies the directory which should contain the source typescript files
131
134
  * for each component. The standard for Stencil apps is to use src, which is the default.
@@ -496,7 +499,9 @@ type StrictConfigFields = keyof Pick<Config, 'buildEs5' | 'cacheDir' | 'devMode'
496
499
  * about the data from a type-safety perspective, this type is intended to be used throughout the codebase once
497
500
  * validations have occurred at runtime.
498
501
  */
499
- export type ValidatedConfig = RequireFields<Config, StrictConfigFields>;
502
+ export type ValidatedConfig = RequireFields<Config, StrictConfigFields> & {
503
+ sourceMap: boolean;
504
+ };
500
505
  export interface HydratedFlag {
501
506
  /**
502
507
  * Defaults to `hydrated`.
@@ -63,6 +63,12 @@ export interface ShadowRootOptions {
63
63
  * focusable part is given focus, and the shadow host is given any available `:focus` styling.
64
64
  */
65
65
  delegatesFocus?: boolean;
66
+ /**
67
+ * Sets the slot assignment mode for the shadow root. When set to `'manual'`, enables imperative
68
+ * slotting using the `HTMLSlotElement.assign()` method. Defaults to `'named'` for standard
69
+ * declarative slotting behavior.
70
+ */
71
+ slotAssignment?: 'manual' | 'named';
66
72
  }
67
73
  export interface ModeStyles {
68
74
  [modeName: string]: string | string[];
@@ -697,7 +703,7 @@ declare namespace LocalJSX {
697
703
  export { LocalJSX as JSX };
698
704
  export declare namespace JSXBase {
699
705
  interface IntrinsicElements {
700
- slot: JSXBase.SlotAttributes;
706
+ slot: JSXBase.SlotAttributes<HTMLSlotElement>;
701
707
  a: JSXBase.AnchorHTMLAttributes<HTMLAnchorElement>;
702
708
  abbr: JSXBase.HTMLAttributes;
703
709
  address: JSXBase.HTMLAttributes;
@@ -867,7 +873,7 @@ export declare namespace JSXBase {
867
873
  use: JSXBase.SVGAttributes;
868
874
  view: JSXBase.SVGAttributes;
869
875
  }
870
- interface SlotAttributes extends JSXAttributes {
876
+ interface SlotAttributes<T = HTMLSlotElement> extends JSXAttributes<T> {
871
877
  name?: string;
872
878
  slot?: string;
873
879
  onSlotchange?: (event: Event) => void;
@@ -2221,10 +2221,17 @@ var globalStyleSheet;
2221
2221
  var GLOBAL_STYLE_ID = "sc-global";
2222
2222
  function createShadowRoot(cmpMeta) {
2223
2223
  var _a;
2224
- const shadowRoot = import_app_data.BUILD.shadowDelegatesFocus ? this.attachShadow({
2225
- mode: "open",
2226
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
2227
- }) : this.attachShadow({ mode: "open" });
2224
+ const opts = { mode: "open" };
2225
+ if (import_app_data.BUILD.shadowDelegatesFocus) {
2226
+ opts.delegatesFocus = !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */);
2227
+ }
2228
+ if (import_app_data.BUILD.shadowSlotAssignmentManual) {
2229
+ const isManual = !!(cmpMeta.$flags$ & 1024 /* shadowSlotAssignmentManual */);
2230
+ if (isManual) {
2231
+ opts.slotAssignment = "manual";
2232
+ }
2233
+ }
2234
+ const shadowRoot = this.attachShadow(opts);
2228
2235
  if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported(globalStyles)) != null ? _a : null;
2229
2236
  if (globalStyleSheet) {
2230
2237
  if (supportsMutableAdoptedStyleSheets) {
@@ -2890,7 +2897,7 @@ var registerStyle = (scopeId2, cssText, allowCS) => {
2890
2897
  styles.set(scopeId2, style);
2891
2898
  };
2892
2899
  var addStyle = (styleContainerNode, cmpMeta, mode) => {
2893
- var _a;
2900
+ var _a, _b, _c;
2894
2901
  const scopeId2 = getScopeId(cmpMeta, mode);
2895
2902
  const style = styles.get(scopeId2);
2896
2903
  if (!import_app_data5.BUILD.attachStyles || !win.document) {
@@ -2928,7 +2935,8 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2928
2935
  );
2929
2936
  } else if ("host" in styleContainerNode) {
2930
2937
  if (supportsConstructableStylesheets) {
2931
- const stylesheet = new CSSStyleSheet();
2938
+ const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
2939
+ const stylesheet = new currentWindow.CSSStyleSheet();
2932
2940
  stylesheet.replaceSync(style);
2933
2941
  if (supportsMutableAdoptedStyleSheets) {
2934
2942
  styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
@@ -2957,11 +2965,28 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2957
2965
  appliedStyles.add(scopeId2);
2958
2966
  }
2959
2967
  }
2960
- } else if (import_app_data5.BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
2961
- if (supportsMutableAdoptedStyleSheets) {
2962
- styleContainerNode.adoptedStyleSheets.push(style);
2963
- } else {
2964
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
2968
+ } else if (import_app_data5.BUILD.constructableCSS) {
2969
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
2970
+ if (!appliedStyles) {
2971
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2972
+ }
2973
+ if (!appliedStyles.has(scopeId2)) {
2974
+ const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
2975
+ let stylesheet;
2976
+ if (style.constructor === currentWindow.CSSStyleSheet) {
2977
+ stylesheet = style;
2978
+ } else {
2979
+ stylesheet = new currentWindow.CSSStyleSheet();
2980
+ for (let i2 = 0; i2 < style.cssRules.length; i2++) {
2981
+ stylesheet.insertRule(style.cssRules[i2].cssText, i2);
2982
+ }
2983
+ }
2984
+ if (supportsMutableAdoptedStyleSheets) {
2985
+ styleContainerNode.adoptedStyleSheets.push(stylesheet);
2986
+ } else {
2987
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
2988
+ }
2989
+ appliedStyles.add(scopeId2);
2965
2990
  }
2966
2991
  }
2967
2992
  }
@@ -4728,13 +4753,16 @@ render() {
4728
4753
  for (const relocateData of relocateNodes) {
4729
4754
  const nodeToRelocate = relocateData.$nodeToRelocate$;
4730
4755
  const slotRefNode = relocateData.$slotRefNode$;
4756
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && isInitialLoad) {
4757
+ nodeToRelocate["s-ih"] = (_a = nodeToRelocate.hidden) != null ? _a : false;
4758
+ }
4731
4759
  if (slotRefNode) {
4732
4760
  const parentNodeRef = slotRefNode.parentNode;
4733
4761
  let insertBeforeNode = slotRefNode.nextSibling;
4734
4762
  if (!import_app_data13.BUILD.hydrateServerSide && (!import_app_data13.BUILD.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
4735
- let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
4763
+ let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
4736
4764
  while (orgLocationNode) {
4737
- let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
4765
+ let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
4738
4766
  if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
4739
4767
  refNode = refNode.nextSibling;
4740
4768
  while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
@@ -4757,18 +4785,13 @@ render() {
4757
4785
  }
4758
4786
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
4759
4787
  if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
4760
- nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
4788
+ nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
4761
4789
  }
4762
4790
  }
4763
4791
  }
4764
4792
  nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
4765
- } else {
4766
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
4767
- if (isInitialLoad) {
4768
- nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
4769
- }
4770
- nodeToRelocate.hidden = true;
4771
- }
4793
+ } else if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
4794
+ nodeToRelocate.hidden = true;
4772
4795
  }
4773
4796
  }
4774
4797
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/testing",
3
- "version": "4.39.0-dev.1766120789.792acf5",
3
+ "version": "4.39.0-dev.1766466419.b73a44b",
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) v4.39.0-dev.1766120789.792acf5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc (CommonJS) v4.39.0-dev.1766466419.b73a44b | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __defProp = Object.defineProperty;
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc v4.39.0-dev.1766120789.792acf5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v4.39.0-dev.1766466419.b73a44b | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/runtime/runtime-constants.ts
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "4.39.0-dev.1766120789.792acf5",
3
+ "version": "4.39.0-dev.1766466419.b73a44b",
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": "4.39.0-dev.1766120789.792acf5",
3
+ "version": "4.39.0-dev.1766466419.b73a44b",
4
4
  "license": "MIT",
5
5
  "main": "./internal/stencil-core/index.cjs",
6
6
  "module": "./internal/stencil-core/index.js",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Screenshot v4.39.0-dev.1766120789.792acf5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot v4.39.0-dev.1766466419.b73a44b | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;
@@ -2233,6 +2233,7 @@ var BUILD = {
2233
2233
  constructableCSS: true,
2234
2234
  devTools: false,
2235
2235
  shadowDelegatesFocus: true,
2236
+ shadowSlotAssignmentManual: false,
2236
2237
  initializeNextTick: false,
2237
2238
  asyncLoading: true,
2238
2239
  asyncQueue: false,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/screenshot",
3
- "version": "4.39.0-dev.1766120789.792acf5",
3
+ "version": "4.39.0-dev.1766466419.b73a44b",
4
4
  "description": "Stencil Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Screenshot Pixel Match v4.39.0-dev.1766120789.792acf5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot Pixel Match v4.39.0-dev.1766466419.b73a44b | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;