@stencil/core 4.39.0-dev.1766120789.792acf5 → 4.39.0-dev.1766380053.d3b8b7a

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 +20 -15
  17. package/internal/client/package.json +1 -1
  18. package/internal/client/patch-browser.js +1 -1
  19. package/internal/hydrate/index.js +20 -15
  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 +19 -14
  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 +28 -28
  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 Hydrate Platform v4.39.0-dev.1766120789.792acf5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Platform v4.39.0-dev.1766380053.d3b8b7a | 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) {
@@ -4399,13 +4406,16 @@ render() {
4399
4406
  for (const relocateData of relocateNodes) {
4400
4407
  const nodeToRelocate = relocateData.$nodeToRelocate$;
4401
4408
  const slotRefNode = relocateData.$slotRefNode$;
4409
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && isInitialLoad) {
4410
+ nodeToRelocate["s-ih"] = (_a = nodeToRelocate.hidden) != null ? _a : false;
4411
+ }
4402
4412
  if (slotRefNode) {
4403
4413
  const parentNodeRef = slotRefNode.parentNode;
4404
4414
  let insertBeforeNode = slotRefNode.nextSibling;
4405
4415
  if (!BUILD14.hydrateServerSide && (!BUILD14.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
4406
- let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
4416
+ let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
4407
4417
  while (orgLocationNode) {
4408
- let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
4418
+ let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
4409
4419
  if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
4410
4420
  refNode = refNode.nextSibling;
4411
4421
  while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
@@ -4428,18 +4438,13 @@ render() {
4428
4438
  }
4429
4439
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
4430
4440
  if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
4431
- nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
4441
+ nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
4432
4442
  }
4433
4443
  }
4434
4444
  }
4435
4445
  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
- }
4446
+ } else if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
4447
+ nodeToRelocate.hidden = true;
4443
4448
  }
4444
4449
  }
4445
4450
  }
@@ -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.1766380053.d3b8b7a",
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.1766380053.d3b8b7a | 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.1766380053.d3b8b7a",
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) {
@@ -4728,13 +4735,16 @@ render() {
4728
4735
  for (const relocateData of relocateNodes) {
4729
4736
  const nodeToRelocate = relocateData.$nodeToRelocate$;
4730
4737
  const slotRefNode = relocateData.$slotRefNode$;
4738
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && isInitialLoad) {
4739
+ nodeToRelocate["s-ih"] = (_a = nodeToRelocate.hidden) != null ? _a : false;
4740
+ }
4731
4741
  if (slotRefNode) {
4732
4742
  const parentNodeRef = slotRefNode.parentNode;
4733
4743
  let insertBeforeNode = slotRefNode.nextSibling;
4734
4744
  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;
4745
+ let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
4736
4746
  while (orgLocationNode) {
4737
- let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
4747
+ let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
4738
4748
  if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
4739
4749
  refNode = refNode.nextSibling;
4740
4750
  while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
@@ -4757,18 +4767,13 @@ render() {
4757
4767
  }
4758
4768
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
4759
4769
  if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
4760
- nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
4770
+ nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
4761
4771
  }
4762
4772
  }
4763
4773
  }
4764
4774
  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
- }
4775
+ } else if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
4776
+ nodeToRelocate.hidden = true;
4772
4777
  }
4773
4778
  }
4774
4779
  }
@@ -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.1766380053.d3b8b7a",
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.1766380053.d3b8b7a | 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.1766380053.d3b8b7a | 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.1766380053.d3b8b7a",
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.1766380053.d3b8b7a",
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.1766380053.d3b8b7a | 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.1766380053.d3b8b7a",
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.1766380053.d3b8b7a | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;