@stencil/core 5.0.0-alpha.5 → 5.0.0-alpha.6

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 (43) hide show
  1. package/dist/{client-Dnio47yQ.mjs → client-fWOou5EW.mjs} +2324 -2125
  2. package/dist/compiler/index.d.mts +5 -5
  3. package/dist/compiler/index.mjs +2 -2
  4. package/dist/compiler/utils/index.d.mts +2 -2
  5. package/dist/compiler/utils/index.mjs +3 -3
  6. package/dist/{compiler-Dxri2g8Z.mjs → compiler-CdUbDTbV.mjs} +13329 -12670
  7. package/dist/declarations/stencil-public-compiler.d.ts +254 -121
  8. package/dist/declarations/stencil-public-docs.d.ts +10 -0
  9. package/dist/declarations/stencil-public-runtime.d.ts +49 -12
  10. package/dist/{index-D5zaocDq.d.mts → index-D8vvsppY.d.mts} +228 -180
  11. package/dist/{index-D61XZw0f.d.ts → index-Dap2E02-.d.ts} +82 -31
  12. package/dist/{index-Dat4djoo.d.mts → index-UUlemGuu.d.mts} +13 -2
  13. package/dist/index.d.mts +0 -1
  14. package/dist/index.mjs +1 -1
  15. package/dist/jsx-runtime.d.mts +18 -0
  16. package/dist/jsx-runtime.mjs +2 -0
  17. package/dist/{node-pj6rF4Wt.mjs → node-klLZLdDe.mjs} +59 -55
  18. package/dist/{regular-expression-D0_N0PGa.mjs → regular-expression-DUdhF3Ei.mjs} +72 -6
  19. package/dist/runtime/app-data/index.d.ts +1 -1
  20. package/dist/runtime/app-data/index.js +15 -9
  21. package/dist/{runtime-CKyUrF4i.js → runtime/client/lazy.js} +2539 -2199
  22. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +49 -40
  23. package/dist/runtime/client/{index.js → runtime.js} +2401 -2185
  24. package/dist/runtime/index.d.ts +20 -3
  25. package/dist/runtime/index.js +4956 -2
  26. package/dist/runtime/server/index.d.mts +30 -39
  27. package/dist/runtime/server/index.mjs +2369 -2185
  28. package/dist/runtime/server/runner.d.mts +4 -6
  29. package/dist/runtime/server/runner.mjs +307 -361
  30. package/dist/signals/index.d.ts +47 -0
  31. package/dist/signals/index.js +199 -0
  32. package/dist/sys/node/index.d.mts +1 -1
  33. package/dist/sys/node/index.mjs +1 -1
  34. package/dist/sys/node/worker.mjs +2 -2
  35. package/dist/testing/index.d.mts +97 -3
  36. package/dist/testing/index.mjs +199 -47
  37. package/dist/{validation-BA8nzXu_.mjs → validation-2QipI30K.mjs} +21 -32
  38. package/package.json +41 -27
  39. package/dist/index-D-XN9HW_.d.ts +0 -30
  40. package/dist/jsx-runtime-B3vQbWIW.d.ts +0 -28
  41. package/dist/jsx-runtime.d.ts +0 -2
  42. package/dist/jsx-runtime.js +0 -2
  43. /package/dist/{chunk-CjcI7cDX.mjs → chunk-z9aeyW2b.mjs} +0 -0
@@ -55,6 +55,28 @@ interface ComponentOptions {
55
55
  * Array of relative links to folders of assets required by the component.
56
56
  */
57
57
  assetsDirs?: string[];
58
+ /**
59
+ * Relative URL to an external stylesheet providing document-level styles for this component.
60
+ * Unlike `styleUrl`, these styles are not scoped to shadow/scoped DOM - they are collected
61
+ * at build time and injected wherever `@import "stencil-globals"` appears in a global stylesheet.
62
+ *
63
+ * Useful for
64
+ * - pre-first-js-render styles (combatting cumulative layout shift)
65
+ * - host element and slotted content style
66
+ * - 'css-only' CEs - those that don't use a JS runtime at all
67
+ *
68
+ * @example
69
+ * ```tsx
70
+ * @Component({ tag: 'my-button', globalStyleUrl: './my-button.global.css' })
71
+ * ```
72
+ */
73
+ globalStyleUrl?: string;
74
+ /**
75
+ * Inline CSS string providing document-level styles for this component.
76
+ * Collected at build time and injected wherever `@import "stencil-globals"` appears.
77
+ * @see globalStyleUrl
78
+ */
79
+ globalStyle?: string;
58
80
  }
59
81
  /**
60
82
  * Shadow DOM encapsulation options for the `encapsulation` property.
@@ -83,7 +105,7 @@ interface ShadowEncapsulation {
83
105
  }
84
106
  /**
85
107
  * Patch types for non-shadow DOM components that use slots.
86
- * - `'all'`: Apply all slot-related patches (equivalent to `experimentalSlotFixes`)
108
+ * - `'all'`: Apply all slot-related patches (equivalent to `lightDomPatches: true`)
87
109
  * - `'children'`: Patch child node accessors (children, firstChild, lastChild, etc.)
88
110
  * - `'clone'`: Patch `cloneNode()` to handle slotted content
89
111
  * - `'insert'`: Patch `appendChild()`, `insertBefore()`, etc. for slot relocation
@@ -535,15 +557,16 @@ declare function setTagTransformer(transformer: TagTransformer): void;
535
557
  * @returns the transformed tag e.g. `new-my-tag`
536
558
  */
537
559
  declare function transformTag(tag: string): string;
560
+ type MixinFactory = (base: MixedInCtor) => MixedInCtor;
538
561
  /**
539
- * @deprecated - Use `MixedInCtor` instead:
562
+ * A constructor type that can be used as the base for mixin factories.
563
+ *
540
564
  * ```ts
541
565
  * import { MixedInCtor } from '@stencil/core';
542
566
  *
543
567
  * const AFactoryFn = <B extends MixedInCtor>(Base: B) => {class A extends Base { propA = A }; return A;}
544
568
  * ```
545
569
  */
546
- type MixinFactory = (base: MixedInCtor) => MixedInCtor;
547
570
  type MixedInCtor<T = {}> = new (...args: any[]) => T;
548
571
  /**
549
572
  * Compose multiple mixin classes into a single constructor.
@@ -684,13 +707,21 @@ interface QueueApi {
684
707
  clear?: () => void;
685
708
  flush?: (cb?: () => void) => void;
686
709
  }
710
+ /**
711
+ * Minimal interface matched by signal objects (from @stencil/core/signals).
712
+ * Used in JSX attribute types.
713
+ */
714
+ interface SignalRef<T = any> {
715
+ readonly value: T;
716
+ peek(): T;
717
+ }
687
718
  /**
688
719
  * Host
689
720
  */
690
721
  interface HostAttributes {
691
722
  class?: string | {
692
723
  [className: string]: boolean;
693
- };
724
+ } | SignalRef<string>;
694
725
  style?: {
695
726
  [key: string]: string | undefined;
696
727
  };
@@ -738,7 +769,7 @@ interface FunctionalUtilities {
738
769
  map: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => ChildNode) => VNode[];
739
770
  }
740
771
  interface FunctionalComponent<T = {}> {
741
- (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[] | null;
772
+ (props: T, children: VNode[], utils: FunctionalUtilities): VNode | null;
742
773
  }
743
774
  /**
744
775
  * A Child VDOM node
@@ -749,7 +780,7 @@ interface FunctionalComponent<T = {}> {
749
780
  * {@link FunctionalUtilities}).
750
781
  */
751
782
  interface ChildNode {
752
- vtag?: string | number | Function;
783
+ vtag?: string | number | Function | symbol | null;
753
784
  vkey?: string | number;
754
785
  vtext?: string;
755
786
  vchildren?: VNode[];
@@ -762,11 +793,11 @@ interface ChildNode {
762
793
  *
763
794
  * For further information: https://stenciljs.com/docs/host-element
764
795
  */
765
- declare const Host: FunctionalComponent<HostAttributes>;
796
+ declare const Host: (props: HostAttributes) => VNode;
766
797
  /**
767
798
  * Fragment
768
799
  */
769
- declare const Fragment: FunctionalComponent<{}>;
800
+ declare const Fragment: (props: {}) => VNode;
770
801
  /**
771
802
  * The "h" namespace is used to import JSX types for elements and attributes.
772
803
  * It is imported in order to avoid conflicting global JSX issues.
@@ -782,6 +813,7 @@ declare namespace h {
782
813
  function h(sel: any, data: VNodeData | null, children: VNode): VNode;
783
814
  function h(sel: any, data: VNodeData | null, ...children: (VNode | string | number)[]): VNode;
784
815
  namespace JSX {
816
+ type Element = VNode;
785
817
  interface IntrinsicElements extends LocalJSX.IntrinsicElements, JSXBase.IntrinsicElements {
786
818
  [tagName: string]: any;
787
819
  }
@@ -818,13 +850,15 @@ declare function jsxs(type: any, props: any, key?: string): VNode;
818
850
  */
819
851
  interface VNode {
820
852
  $flags$: number;
821
- $tag$: string | number | Function;
853
+ $tag$: string | number | Function | symbol | null;
822
854
  $elm$: any;
823
855
  $text$: string;
824
856
  $children$: VNode[];
825
857
  $attrs$?: any;
826
858
  $name$?: string;
827
859
  $key$?: string | number;
860
+ /** Signal reference for vdom bypass: signal text nodes store the signal here. */
861
+ $signal$?: any;
828
862
  }
829
863
  interface VNodeData {
830
864
  class?: {
@@ -1471,7 +1505,7 @@ declare namespace JSXBase {
1471
1505
  autofocus?: boolean | string;
1472
1506
  class?: string | {
1473
1507
  [className: string]: boolean;
1474
- };
1508
+ } | SignalRef<string>;
1475
1509
  contentEditable?: boolean | string;
1476
1510
  contenteditable?: boolean | string;
1477
1511
  contextMenu?: string;
@@ -1530,7 +1564,7 @@ declare namespace JSXBase {
1530
1564
  interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> {
1531
1565
  class?: string | {
1532
1566
  [className: string]: boolean;
1533
- };
1567
+ } | SignalRef<string>;
1534
1568
  color?: string;
1535
1569
  height?: number | string;
1536
1570
  id?: string;
@@ -1931,10 +1965,13 @@ declare namespace JSXBase {
1931
1965
  interface JSXAttributes<T = Element> {
1932
1966
  key?: string | number;
1933
1967
  ref?: (elm?: T) => void;
1968
+ children?: any;
1934
1969
  }
1935
1970
  interface CustomElementsDefineOptions {
1936
1971
  exclude?: string[];
1937
1972
  syncQueue?: boolean;
1973
+ /** Scoped custom element registry to define components in. Defaults to the global registry. */
1974
+ registry?: CustomElementRegistry;
1938
1975
  jmp?: (c: Function) => any;
1939
1976
  raf?: (c: FrameRequestCallback) => number;
1940
1977
  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
@@ -1942,4 +1979,4 @@ interface CustomElementsDefineOptions {
1942
1979
  ce?: (eventName: string, opts?: any) => CustomEvent;
1943
1980
  }
1944
1981
  //#endregion
1945
- export { AttachInternals, AttachInternalsDecorator, AttachInternalsOptions, AttrDeserialize, AttrDeserializeDecorator, Build, ChildNode, Component, ComponentDecorator, ComponentDidLoad, ComponentDidUpdate, ComponentInterface, ComponentOptions, ComponentWillLoad, ComponentWillUpdate, CustomElementsDefineOptions, Element, ElementDecorator, EncapsulationOptions, Env, ErrorHandler, Event, EventDecorator, EventEmitter, EventOptions, Fragment, FunctionalComponent, FunctionalUtilities, HTMLStencilElement, Host, HostAttributes, LocalJSX as JSX, JSXAttributes, JSXBase, Listen, ListenDecorator, ListenOptions, ListenTargetOptions, Method, MethodDecorator, MethodOptions, MixedInCtor, Mixin, MixinFactory, ModeStyles, NoneEncapsulation, Prop, PropDecorator, PropOptions, PropSerialize, PropSerializeDecorator, QueueApi, RafCallback, ResolutionHandler, ResolveVarFunction, ScopedEncapsulation, ShadowEncapsulation, ShadowRootOptions, SlotPatch, State, StateDecorator, TagTransformer, UserBuildConditionals, VNode, VNodeData, Watch, WatchDecorator, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, h, jsx, jsxs, readTask, render, resolveVar, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setTagTransformer, transformTag, writeTask };
1982
+ export { AttachInternals, AttachInternalsDecorator, AttachInternalsOptions, AttrDeserialize, AttrDeserializeDecorator, Build, ChildNode, Component, ComponentDecorator, ComponentDidLoad, ComponentDidUpdate, ComponentInterface, ComponentOptions, ComponentWillLoad, ComponentWillUpdate, CustomElementsDefineOptions, Element, ElementDecorator, EncapsulationOptions, Env, ErrorHandler, Event, EventDecorator, EventEmitter, EventOptions, Fragment, FunctionalComponent, FunctionalUtilities, HTMLStencilElement, Host, HostAttributes, LocalJSX as JSX, JSXAttributes, JSXBase, Listen, ListenDecorator, ListenOptions, ListenTargetOptions, Method, MethodDecorator, MethodOptions, MixedInCtor, Mixin, ModeStyles, NoneEncapsulation, Prop, PropDecorator, PropOptions, PropSerialize, PropSerializeDecorator, QueueApi, RafCallback, ResolutionHandler, ResolveVarFunction, ScopedEncapsulation, ShadowEncapsulation, ShadowRootOptions, SignalRef, SlotPatch, State, StateDecorator, TagTransformer, UserBuildConditionals, VNode, VNodeData, Watch, WatchDecorator, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, h, jsx, jsxs, readTask, render, resolveVar, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setTagTransformer, transformTag, writeTask };