@stencil/core 5.0.0-alpha.9 → 5.0.0-beta.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 (47) hide show
  1. package/README.md +94 -0
  2. package/dist/app-data/index.d.ts +1 -1
  3. package/dist/app-data/index.js +4 -1
  4. package/dist/client-BRu0GtRn.mjs +2368 -0
  5. package/dist/compiler/index.d.mts +167 -3
  6. package/dist/compiler/index.mjs +3 -3
  7. package/dist/compiler/utils/index.d.mts +272 -2
  8. package/dist/compiler/utils/index.mjs +4 -3
  9. package/dist/{compiler-C0qmPoKu.mjs → compiler-NrvbUOX1.mjs} +2754 -1259
  10. package/dist/declarations/stencil-ext-modules.d.ts +5 -5
  11. package/dist/declarations/stencil-public-compiler.d.ts +208 -66
  12. package/dist/declarations/stencil-public-docs.d.ts +9 -0
  13. package/dist/declarations/stencil-public-runtime.d.ts +91 -6
  14. package/dist/fragment-Di1hWOC8.mjs +4 -0
  15. package/dist/{regular-expression-CFVJOTUh.mjs → helpers-Cpp3qc3u.mjs} +31 -15
  16. package/dist/index-BOrz3rbJ.d.mts +100 -0
  17. package/dist/{index-xAkMgLX_.d.ts → index-DnISpqrd.d.ts} +149 -9
  18. package/dist/{index-vY35H18z.d.mts → index-RrQfiPWK.d.mts} +490 -845
  19. package/dist/index.d.mts +4 -0
  20. package/dist/index.mjs +91 -2
  21. package/dist/jsx-runtime.mjs +2 -1
  22. package/dist/{node--akYC-sG.mjs → node-75gQKkFz.mjs} +60 -58
  23. package/dist/{chunk-z9aeyW2b.mjs → rolldown-runtime-BhDjJH2R.mjs} +1 -1
  24. package/dist/runtime/client/lazy.js +481 -184
  25. package/dist/runtime/client/runtime.d.ts +149 -10
  26. package/dist/runtime/client/runtime.js +481 -184
  27. package/dist/runtime/index.d.ts +6 -4
  28. package/dist/runtime/index.js +480 -182
  29. package/dist/runtime/server/index.d.mts +80 -8
  30. package/dist/runtime/server/index.mjs +403 -177
  31. package/dist/runtime/server/runner.d.mts +3 -0
  32. package/dist/runtime/server/runner.mjs +320 -337
  33. package/dist/signals/index.d.ts +2 -0
  34. package/dist/signals/index.js +4 -1
  35. package/dist/sys/node/index.d.mts +1 -2
  36. package/dist/sys/node/index.mjs +1 -1
  37. package/dist/sys/node/worker.d.mts +1 -1
  38. package/dist/sys/node/worker.mjs +6 -3
  39. package/dist/testing/index.d.mts +4716 -105
  40. package/dist/testing/index.mjs +7590 -794
  41. package/dist/util-IKfWWLJo.mjs +724 -0
  42. package/dist/validation-DAdGTrys.mjs +791 -0
  43. package/package.json +27 -27
  44. package/dist/client-aTQ7xHxx.mjs +0 -4678
  45. package/dist/index-BvkyxSY6.d.mts +0 -205
  46. package/dist/validation-ByxKj8bC.mjs +0 -1458
  47. /package/{LICENSE.md → LICENSE} +0 -0
@@ -102,6 +102,16 @@ interface ShadowEncapsulation {
102
102
  * declarative slotting behavior.
103
103
  */
104
104
  slotAssignment?: 'manual' | 'named';
105
+ /**
106
+ * When set to `true`, the shadow root is preserved when the host element is deep-cloned via
107
+ * `Node.cloneNode(true)`. Without this, cloning a shadow host produces an empty shell.
108
+ */
109
+ clonable?: boolean;
110
+ /**
111
+ * When set to `true`, marks the shadow root as serializable so it is included when the host
112
+ * element is serialized via `Element.getHTML({ serializableShadowRoots: true })`.
113
+ */
114
+ serializable?: boolean;
105
115
  }
106
116
  /**
107
117
  * Patch types for non-shadow DOM components that use slots.
@@ -484,7 +494,7 @@ declare function setNonce(nonce: string): void;
484
494
  * @param ref the ref to get the Stencil element for
485
495
  * @returns a reference to the element
486
496
  */
487
- declare function getElement(ref: any): HTMLStencilElement;
497
+ declare function getElement<T extends HTMLElement = HTMLStencilElement>(ref: any): T;
488
498
  /**
489
499
  * Get the shadow root for a Stencil component's host element.
490
500
  * This works for both open and closed shadow DOM modes.
@@ -639,6 +649,17 @@ interface ComponentDidUpdate {
639
649
  */
640
650
  componentDidUpdate(): void;
641
651
  }
652
+ /**
653
+ * A map of `@Prop`/`@State` property names to their new and previous
654
+ * values, passed to `componentShouldUpdate` once per render cycle.
655
+ *
656
+ * Pass `this` as `T` to type `changes` against your component's own
657
+ * members, e.g. `componentShouldUpdate(changes: ComponentShouldUpdateChanges<this>)`.
658
+ */
659
+ type ComponentShouldUpdateChanges<T = any> = { [K in Extract<keyof T, string>]?: {
660
+ newVal: T[K];
661
+ oldVal: T[K];
662
+ }; };
642
663
  interface ComponentInterface {
643
664
  connectedCallback?(): void;
644
665
  disconnectedCallback?(): void;
@@ -664,14 +685,18 @@ interface ComponentInterface {
664
685
  */
665
686
  componentDidLoad?(): void;
666
687
  /**
667
- * A `@Prop` or `@State` property changed and a rerender is about to be requested.
688
+ * One or more `@Prop` or `@State` properties changed and a rerender is
689
+ * about to be requested. `changes` contains every property that changed
690
+ * since the last render, keyed by property name.
668
691
  *
669
- * Called multiple times throughout the life of
670
- * the component as its properties change.
692
+ * Called once per render cycle, batching all properties that changed
693
+ * synchronously since the last render.
694
+ *
695
+ * Return `false` to prevent the pending render.
671
696
  *
672
697
  * componentShouldUpdate is not called on the first render.
673
698
  */
674
- componentShouldUpdate?(newVal: any, oldVal: any, propName: string): boolean | void;
699
+ componentShouldUpdate?(changes: ComponentShouldUpdateChanges<this>): boolean | void;
675
700
  /**
676
701
  * The component is about to update and re-render.
677
702
  *
@@ -694,6 +719,54 @@ interface ComponentInterface {
694
719
  render?(): any;
695
720
  [memberName: string]: any;
696
721
  }
722
+ /**
723
+ * A reusable behavior that hooks into a `ReactiveControllerHost`'s lifecycle. Modeled after Lit's
724
+ * `ReactiveController` pattern: implement the hooks you need, then register an instance with a host
725
+ * via `host.addController(this)`.
726
+ */
727
+ interface ReactiveController {
728
+ hostConnected?(): void;
729
+ hostDisconnected?(): void;
730
+ hostWillLoad?(): Promise<void> | void;
731
+ hostDidLoad?(): void;
732
+ hostWillRender?(): Promise<void> | void;
733
+ hostDidRender?(): void;
734
+ hostWillUpdate?(): Promise<void> | void;
735
+ hostDidUpdate?(): void;
736
+ }
737
+ /**
738
+ * The shape added to a component by mixing in `ReactiveControllerHost` (see below).
739
+ */
740
+ interface ReactiveControllerHostInterface extends ComponentInterface, HTMLElement {
741
+ readonly controllers: ReadonlySet<ReactiveController>;
742
+ addController(controller: ReactiveController): void;
743
+ removeController(controller: ReactiveController): void;
744
+ requestUpdate(): void;
745
+ /**
746
+ * Resolves once the next pending render commits. Matches the shape of Lit's
747
+ * `ReactiveControllerHost.updateComplete`, for interop with controllers written against Lit's API
748
+ * (e.g. `@lit/context`).
749
+ */
750
+ readonly updateComplete: Promise<boolean>;
751
+ }
752
+ /**
753
+ * A mixin factory (for use with `Mixin()`) that adds `ReactiveController` support to a component,
754
+ * forwarding each Stencil lifecycle method to every registered controller's matching `hostX` hook.
755
+ *
756
+ * ```ts
757
+ * import { Mixin, ReactiveControllerHost } from '@stencil/core';
758
+ * import { MouseController } from './mouse-controller';
759
+ *
760
+ * class MyComponent extends Mixin(ReactiveControllerHost) {
761
+ * private mouse = new MouseController(this);
762
+ * render() { return <Host>{this.mouse.pos.x}, {this.mouse.pos.y}</Host>; }
763
+ * }
764
+ * ```
765
+ *
766
+ * @param Base the class to extend.
767
+ * @returns a class extending `Base` with reactive-controller support.
768
+ */
769
+ declare function ReactiveControllerHost<B extends MixedInCtor>(Base: B): MixedInCtor<InstanceType<B> & ReactiveControllerHostInterface>;
697
770
  interface EventEmitter<T = any> {
698
771
  emit: (data?: T) => CustomEvent<T>;
699
772
  }
@@ -1127,6 +1200,7 @@ declare namespace JSXBase {
1127
1200
  onClose?: (event: Event) => void;
1128
1201
  open?: boolean;
1129
1202
  returnValue?: string;
1203
+ closedby?: 'any' | 'closerequest' | 'none';
1130
1204
  }
1131
1205
  interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
1132
1206
  height?: number | string;
@@ -1164,6 +1238,8 @@ declare namespace JSXBase {
1164
1238
  allowtransparency?: string | boolean;
1165
1239
  frameBorder?: number | string;
1166
1240
  frameborder?: number | string;
1241
+ fetchPriority?: 'high' | 'low' | 'auto';
1242
+ fetchpriority?: 'high' | 'low' | 'auto';
1167
1243
  importance?: 'low' | 'auto' | 'high';
1168
1244
  height?: number | string;
1169
1245
  loading?: 'lazy' | 'auto' | 'eager';
@@ -1186,6 +1262,8 @@ declare namespace JSXBase {
1186
1262
  crossOrigin?: string;
1187
1263
  crossorigin?: string;
1188
1264
  decoding?: 'async' | 'auto' | 'sync';
1265
+ fetchPriority?: 'high' | 'low' | 'auto';
1266
+ fetchpriority?: 'high' | 'low' | 'auto';
1189
1267
  importance?: 'low' | 'auto' | 'high';
1190
1268
  height?: number | string;
1191
1269
  loading?: 'lazy' | 'auto' | 'eager';
@@ -1285,6 +1363,8 @@ declare namespace JSXBase {
1285
1363
  }
1286
1364
  interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
1287
1365
  as?: string;
1366
+ fetchPriority?: 'high' | 'low' | 'auto';
1367
+ fetchpriority?: 'high' | 'low' | 'auto';
1288
1368
  href?: string;
1289
1369
  hrefLang?: string;
1290
1370
  hreflang?: string;
@@ -1408,6 +1488,8 @@ declare namespace JSXBase {
1408
1488
  crossOrigin?: string;
1409
1489
  crossorigin?: string;
1410
1490
  defer?: boolean;
1491
+ fetchPriority?: 'high' | 'low' | 'auto';
1492
+ fetchpriority?: 'high' | 'low' | 'auto';
1411
1493
  importance?: 'low' | 'auto' | 'high';
1412
1494
  integrity?: string;
1413
1495
  nonce?: string;
@@ -1523,7 +1605,10 @@ declare namespace JSXBase {
1523
1605
  tabIndex?: number;
1524
1606
  tabindex?: number | string;
1525
1607
  title?: string;
1608
+ translate?: 'yes' | 'no' | (string & {});
1526
1609
  popover?: string | null;
1610
+ focusgroup?: string;
1611
+ focusgroupstart?: boolean;
1527
1612
  inputMode?: string;
1528
1613
  inputmode?: string;
1529
1614
  enterKeyHint?: string;
@@ -1979,4 +2064,4 @@ interface CustomElementsDefineOptions {
1979
2064
  ce?: (eventName: string, opts?: any) => CustomEvent;
1980
2065
  }
1981
2066
  //#endregion
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 };
2067
+ export { AttachInternals, AttachInternalsDecorator, AttachInternalsOptions, AttrDeserialize, AttrDeserializeDecorator, Build, ChildNode, Component, ComponentDecorator, ComponentDidLoad, ComponentDidUpdate, ComponentInterface, ComponentOptions, ComponentShouldUpdateChanges, 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, ReactiveController, ReactiveControllerHost, ReactiveControllerHostInterface, 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 };
@@ -0,0 +1,4 @@
1
+ //#region src/runtime/fragment.ts
2
+ const Fragment = (_, children) => children;
3
+ //#endregion
4
+ export { Fragment as t };
@@ -40,8 +40,20 @@ const HOST_FLAGS = {
40
40
  isWatchReady: 128,
41
41
  isListenReady: 256,
42
42
  needsRerender: 512,
43
- devOnRender: 1024,
44
- devOnDidLoad: 2048
43
+ /**
44
+ * Set once this component's real (lazy-loaded) `connectedCallback` has fired for
45
+ * the first time. Lets a descendant skip creating/awaiting a connect-promise for
46
+ * an ancestor that's already connected. See {@link HostRef.$onFirstConnectResolve$}.
47
+ */
48
+ hasFiredConnected: 1024,
49
+ /**
50
+ * Set when a lazy component's dynamic `import()` fails to resolve a
51
+ * constructor. Distinct from `hasInitializedComponent` being unset, which
52
+ * is true while an initialization attempt is merely queued/in-flight.
53
+ */
54
+ hasFailedLoad: 2048,
55
+ devOnRender: 4096,
56
+ devOnDidLoad: 8192
45
57
  };
46
58
  const CF_scopedCssEncapsulation = 2;
47
59
  /**
@@ -126,7 +138,17 @@ const CMP_FLAGS = {
126
138
  * e.g. `encapsulation: { type: 'none', patches: ['all'] }`
127
139
  * Equivalent to the global `experimentalSlotFixes` config option.
128
140
  */
129
- patchAll: 32768
141
+ patchAll: 32768,
142
+ /**
143
+ * Determines if `clonable` is enabled for a component that uses the shadow DOM.
144
+ * e.g. `encapsulation: { type: 'shadow', clonable: true }` is set on the `@Component()` decorator
145
+ */
146
+ shadowClonable: 65536,
147
+ /**
148
+ * Determines if `serializable` is enabled for a component that uses the shadow DOM.
149
+ * e.g. `encapsulation: { type: 'shadow', serializable: true }` is set on the `@Component()` decorator
150
+ */
151
+ shadowSerializable: 1 << 17
130
152
  };
131
153
  /**
132
154
  * Default style mode id
@@ -221,6 +243,10 @@ const DOCS_VSCODE = "docs-vscode";
221
243
  */
222
244
  const DOCS_CUSTOM_ELEMENTS_MANIFEST = "docs-custom-elements-manifest";
223
245
  /**
246
+ * Constant for the 'docs-agent-skill' output target
247
+ */
248
+ const DOCS_AGENT_SKILL = "docs-agent-skill";
249
+ /**
224
250
  * Constant for the 'stats' output target
225
251
  */
226
252
  const STATS = "stats";
@@ -256,6 +282,7 @@ const VALID_CONFIG_OUTPUT_TARGETS = [
256
282
  DOCS_VSCODE,
257
283
  DOCS_CUSTOM,
258
284
  DOCS_CUSTOM_ELEMENTS_MANIFEST,
285
+ DOCS_AGENT_SKILL,
259
286
  COPY,
260
287
  CUSTOM,
261
288
  STATS
@@ -494,15 +521,4 @@ const isObject = (val) => val != null && typeof val === "object" && Array.isArra
494
521
  const isString = (v) => typeof v === "string";
495
522
  const isIterable = (v) => isDefined(v) && isFunction(v[Symbol.iterator]);
496
523
  //#endregion
497
- //#region src/utils/regular-expression.ts
498
- /**
499
- * Utility function that will escape all regular expression special characters in a string.
500
- *
501
- * @param text The string potentially containing special characters.
502
- * @returns The string with all special characters escaped.
503
- */
504
- const escapeRegExpSpecialCharacters = (text) => {
505
- return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
506
- };
507
- //#endregion
508
- export { VALID_CONFIG_OUTPUT_TARGETS as $, DEFAULT_STYLE_MODE as A, HOST_FLAGS as B, ASSETS as C, COLLECTION_MANIFEST_FILE_NAME as D, COLLECTION_APP_DATA_FILE_NAME as E, DOCS_README as F, NODE_TYPES as G, LISTENER_FLAGS as H, DOCS_VSCODE as I, STANDALONE as J, SSR as K, EVENT_FLAGS as L, DOCS_CUSTOM as M, DOCS_CUSTOM_ELEMENTS_MANIFEST as N, COPY as O, DOCS_JSON as P, TYPES as Q, GENERATED_DTS as R, queryNonceMetaTagContent as S, COLLECTION as T, LOADER_BUNDLE as U, HTML_NS as V, MEMBER_FLAGS as W, STYLE_EXT as X, STATS as Y, SVG_NS as Z, sortBy as _, fromEntries as a, toTitleCase as b, isDef as c, isNumber as d, WATCH_FLAGS as et, isObject as f, pluck as g, noop as h, flatOne as i, DIST_LAZY as j, CUSTOM as k, isFunction as l, mergeIntoWith as m, dashToPascalCase as n, XLINK_NS as nt, isBoolean as o, isString as p, SSR_WASM as q, escapeWithPattern as r, isComplexType as s, escapeRegExpSpecialCharacters as t, WWW as tt, isIterable as u, toCamelCase as v, CMP_FLAGS as w, unique as x, toDashCase as y, GLOBAL_STYLE as z };
524
+ export { VALID_CONFIG_OUTPUT_TARGETS as $, DIST_LAZY as A, HOST_FLAGS as B, CMP_FLAGS as C, COPY as D, COLLECTION_MANIFEST_FILE_NAME as E, DOCS_README as F, NODE_TYPES as G, LISTENER_FLAGS as H, DOCS_VSCODE as I, STANDALONE as J, SSR as K, EVENT_FLAGS as L, DOCS_CUSTOM as M, DOCS_CUSTOM_ELEMENTS_MANIFEST as N, CUSTOM as O, DOCS_JSON as P, TYPES as Q, GENERATED_DTS as R, ASSETS as S, COLLECTION_APP_DATA_FILE_NAME as T, LOADER_BUNDLE as U, HTML_NS as V, MEMBER_FLAGS as W, STYLE_EXT as X, STATS as Y, SVG_NS as Z, toCamelCase as _, isBoolean as a, unique as b, isFunction as c, isObject as d, WATCH_FLAGS as et, isString as f, sortBy as g, pluck as h, fromEntries as i, DOCS_AGENT_SKILL as j, DEFAULT_STYLE_MODE as k, isIterable as l, noop as m, escapeWithPattern as n, XLINK_NS as nt, isComplexType as o, mergeIntoWith as p, SSR_WASM as q, flatOne as r, isDef as s, dashToPascalCase as t, WWW as tt, isNumber as u, toDashCase as v, COLLECTION as w, queryNonceMetaTagContent as x, toTitleCase as y, GLOBAL_STYLE as z };
@@ -0,0 +1,100 @@
1
+ import { Gn as FunctionalComponent, Qn as VNode, Wn as ErrorHandler, Xn as TagTransformer, Yn as ResolutionHandler, Zn as UserBuildConditionals, a as HostElement, l as PropsType, qn as RafCallback, t as ChildType, u as RuntimeRef } from "./index-RrQfiPWK.mjs";
2
+ //#region src/client/client-build.d.ts
3
+ declare const Build: UserBuildConditionals;
4
+ //#endregion
5
+ //#region src/client/client-log.d.ts
6
+ declare const setErrorHandler: (handler: ErrorHandler) => ErrorHandler;
7
+ //#endregion
8
+ //#region src/client/client-task-queue.d.ts
9
+ declare const readTask: (cb: RafCallback) => void;
10
+ declare const writeTask: (cb: RafCallback) => void;
11
+ //#endregion
12
+ //#region src/client/client-window.d.ts
13
+ declare const setPlatformHelpers: (helpers: {
14
+ jmp?: (c: any) => any;
15
+ raf?: (c: any) => number;
16
+ ael?: (el: any, eventName: string, listener: any, options: any) => void;
17
+ rel?: (el: any, eventName: string, listener: any, options: any) => void;
18
+ ce?: (eventName: string, opts?: any) => any;
19
+ }) => void;
20
+ //#endregion
21
+ //#region src/runtime/element.d.ts
22
+ declare const getElement: (ref: any) => HostElement;
23
+ /**
24
+ * Get the shadow root for a Stencil component's host element.
25
+ * This works for both open and closed shadow DOM modes.
26
+ *
27
+ * For closed shadow DOM, `element.shadowRoot` returns `null` by design,
28
+ * but Stencil stores the reference internally so components can still
29
+ * access their own shadow root.
30
+ *
31
+ * @param element The host element (from @Element() decorator)
32
+ * @returns The shadow root, or null if no shadow root exists
33
+ */
34
+ declare const getShadowRoot: (element: HTMLElement) => ShadowRoot | null;
35
+ //#endregion
36
+ //#region src/runtime/fragment.d.ts
37
+ declare const Fragment: FunctionalComponent;
38
+ //#endregion
39
+ //#region src/runtime/mode.d.ts
40
+ declare const setMode: (handler: ResolutionHandler) => number;
41
+ declare const getMode: (ref: RuntimeRef) => string;
42
+ //#endregion
43
+ //#region src/runtime/render.d.ts
44
+ /**
45
+ * Method to render a virtual DOM tree to a container element.
46
+ *
47
+ * Supports efficient re-renders: calling `render()` again on the same container
48
+ * will diff the new VNode tree against the previous one and only update what changed,
49
+ * preserving existing DOM elements and their state.
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * import { render } from '@stencil/core';
54
+ *
55
+ * const vnode = (
56
+ * <div>
57
+ * <h1>Hello, world!</h1>
58
+ * </div>
59
+ * );
60
+ * render(vnode, document.body);
61
+ * ```
62
+ *
63
+ * @param vnode - The virtual DOM tree to render
64
+ * @param container - The container element to render the virtual DOM tree to
65
+ */
66
+ declare function render(vnode: VNode, container: Element): void;
67
+ //#endregion
68
+ //#region src/runtime/tag-transform.d.ts
69
+ /**
70
+ * Transforms a tag name using the current tag transformer
71
+ * @param tag - the tag to transform e.g. `my-tag`
72
+ * @returns the transformed tag e.g. `new-my-tag`
73
+ */
74
+ declare function transformTag<T extends string>(tag: T): T;
75
+ /**
76
+ * Sets the tag transformer to be used when rendering custom elements
77
+ * @param transformer the transformer function to use. Must return a string
78
+ */
79
+ declare function setTagTransformer(transformer: TagTransformer): void;
80
+ //#endregion
81
+ //#region src/runtime/update-component.d.ts
82
+ declare const getRenderingRef: () => any;
83
+ declare const forceUpdate: (ref: any) => boolean;
84
+ //#endregion
85
+ //#region src/runtime/vdom/h.d.ts
86
+ declare const h: (nodeName: any, vnodeData: PropsType, ...children: ChildType[]) => VNode;
87
+ declare const Host: {};
88
+ //#endregion
89
+ //#region src/runtime/vdom/jsx-runtime.d.ts
90
+ declare function jsx(type: any, props: any, key?: string): VNode;
91
+ /**
92
+ * @alias
93
+ */
94
+ declare const jsxs: typeof jsx;
95
+ /**
96
+ * @alias
97
+ */
98
+ declare const jsxDEV: typeof jsx;
99
+ //#endregion
100
+ export { readTask as _, h as a, Build as b, setTagTransformer as c, getMode as d, setMode as f, setPlatformHelpers as g, getShadowRoot as h, Host as i, transformTag as l, getElement as m, jsxDEV as n, forceUpdate as o, Fragment as p, jsxs as r, getRenderingRef as s, jsx as t, render as u, writeTask as v, setErrorHandler as y };
@@ -1,3 +1,5 @@
1
+ import "rolldown";
2
+ import "typescript";
1
3
  //#region src/declarations/stencil-public-runtime.d.ts
2
4
  interface ElementDecorator {
3
5
  (): PropertyDecorator;
@@ -41,6 +43,27 @@ interface HTMLStencilElement extends HTMLElement {
41
43
  componentOnReady(): Promise<this>;
42
44
  }
43
45
  type TagTransformer = (tag: string) => string;
46
+ /**
47
+ * A constructor type that can be used as the base for mixin factories.
48
+ *
49
+ * ```ts
50
+ * import { MixedInCtor } from '@stencil/core';
51
+ *
52
+ * const AFactoryFn = <B extends MixedInCtor>(Base: B) => {class A extends Base { propA = A }; return A;}
53
+ * ```
54
+ */
55
+ type MixedInCtor<T = {}> = new (...args: any[]) => T;
56
+ /**
57
+ * A map of `@Prop`/`@State` property names to their new and previous
58
+ * values, passed to `componentShouldUpdate` once per render cycle.
59
+ *
60
+ * Pass `this` as `T` to type `changes` against your component's own
61
+ * members, e.g. `componentShouldUpdate(changes: ComponentShouldUpdateChanges<this>)`.
62
+ */
63
+ type ComponentShouldUpdateChanges<T = any> = { [K in Extract<keyof T, string>]?: {
64
+ newVal: T[K];
65
+ oldVal: T[K];
66
+ }; };
44
67
  interface ComponentInterface {
45
68
  connectedCallback?(): void;
46
69
  disconnectedCallback?(): void;
@@ -66,14 +89,18 @@ interface ComponentInterface {
66
89
  */
67
90
  componentDidLoad?(): void;
68
91
  /**
69
- * A `@Prop` or `@State` property changed and a rerender is about to be requested.
92
+ * One or more `@Prop` or `@State` properties changed and a rerender is
93
+ * about to be requested. `changes` contains every property that changed
94
+ * since the last render, keyed by property name.
70
95
  *
71
- * Called multiple times throughout the life of
72
- * the component as its properties change.
96
+ * Called once per render cycle, batching all properties that changed
97
+ * synchronously since the last render.
98
+ *
99
+ * Return `false` to prevent the pending render.
73
100
  *
74
101
  * componentShouldUpdate is not called on the first render.
75
102
  */
76
- componentShouldUpdate?(newVal: any, oldVal: any, propName: string): boolean | void;
103
+ componentShouldUpdate?(changes: ComponentShouldUpdateChanges<this>): boolean | void;
77
104
  /**
78
105
  * The component is about to update and re-render.
79
106
  *
@@ -96,6 +123,36 @@ interface ComponentInterface {
96
123
  render?(): any;
97
124
  [memberName: string]: any;
98
125
  }
126
+ /**
127
+ * A reusable behavior that hooks into a `ReactiveControllerHost`'s lifecycle. Modeled after Lit's
128
+ * `ReactiveController` pattern: implement the hooks you need, then register an instance with a host
129
+ * via `host.addController(this)`.
130
+ */
131
+ interface ReactiveController {
132
+ hostConnected?(): void;
133
+ hostDisconnected?(): void;
134
+ hostWillLoad?(): Promise<void> | void;
135
+ hostDidLoad?(): void;
136
+ hostWillRender?(): Promise<void> | void;
137
+ hostDidRender?(): void;
138
+ hostWillUpdate?(): Promise<void> | void;
139
+ hostDidUpdate?(): void;
140
+ }
141
+ /**
142
+ * The shape added to a component by mixing in `ReactiveControllerHost` (see below).
143
+ */
144
+ interface ReactiveControllerHostInterface extends ComponentInterface, HTMLElement {
145
+ readonly controllers: ReadonlySet<ReactiveController>;
146
+ addController(controller: ReactiveController): void;
147
+ removeController(controller: ReactiveController): void;
148
+ requestUpdate(): void;
149
+ /**
150
+ * Resolves once the next pending render commits. Matches the shape of Lit's
151
+ * `ReactiveControllerHost.updateComplete`, for interop with controllers written against Lit's API
152
+ * (e.g. `@lit/context`).
153
+ */
154
+ readonly updateComplete: Promise<boolean>;
155
+ }
99
156
  /**
100
157
  * Minimal interface matched by signal objects (from @stencil/core/signals).
101
158
  * Used in JSX attribute types.
@@ -434,6 +491,7 @@ declare namespace JSXBase {
434
491
  onClose?: (event: Event) => void;
435
492
  open?: boolean;
436
493
  returnValue?: string;
494
+ closedby?: 'any' | 'closerequest' | 'none';
437
495
  }
438
496
  interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
439
497
  height?: number | string;
@@ -471,6 +529,8 @@ declare namespace JSXBase {
471
529
  allowtransparency?: string | boolean;
472
530
  frameBorder?: number | string;
473
531
  frameborder?: number | string;
532
+ fetchPriority?: 'high' | 'low' | 'auto';
533
+ fetchpriority?: 'high' | 'low' | 'auto';
474
534
  importance?: 'low' | 'auto' | 'high';
475
535
  height?: number | string;
476
536
  loading?: 'lazy' | 'auto' | 'eager';
@@ -493,6 +553,8 @@ declare namespace JSXBase {
493
553
  crossOrigin?: string;
494
554
  crossorigin?: string;
495
555
  decoding?: 'async' | 'auto' | 'sync';
556
+ fetchPriority?: 'high' | 'low' | 'auto';
557
+ fetchpriority?: 'high' | 'low' | 'auto';
496
558
  importance?: 'low' | 'auto' | 'high';
497
559
  height?: number | string;
498
560
  loading?: 'lazy' | 'auto' | 'eager';
@@ -592,6 +654,8 @@ declare namespace JSXBase {
592
654
  }
593
655
  interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
594
656
  as?: string;
657
+ fetchPriority?: 'high' | 'low' | 'auto';
658
+ fetchpriority?: 'high' | 'low' | 'auto';
595
659
  href?: string;
596
660
  hrefLang?: string;
597
661
  hreflang?: string;
@@ -715,6 +779,8 @@ declare namespace JSXBase {
715
779
  crossOrigin?: string;
716
780
  crossorigin?: string;
717
781
  defer?: boolean;
782
+ fetchPriority?: 'high' | 'low' | 'auto';
783
+ fetchpriority?: 'high' | 'low' | 'auto';
718
784
  importance?: 'low' | 'auto' | 'high';
719
785
  integrity?: string;
720
786
  nonce?: string;
@@ -830,7 +896,10 @@ declare namespace JSXBase {
830
896
  tabIndex?: number;
831
897
  tabindex?: number | string;
832
898
  title?: string;
899
+ translate?: 'yes' | 'no' | (string & {});
833
900
  popover?: string | null;
901
+ focusgroup?: string;
902
+ focusgroupstart?: boolean;
834
903
  inputMode?: string;
835
904
  inputmode?: string;
836
905
  enterKeyHint?: string;
@@ -1295,6 +1364,8 @@ interface BuildFeatures {
1295
1364
  shadowDelegatesFocus: boolean;
1296
1365
  shadowModeClosed: boolean;
1297
1366
  shadowSlotAssignmentManual: boolean;
1367
+ shadowClonable: boolean;
1368
+ shadowSerializable: boolean;
1298
1369
  scoped: boolean;
1299
1370
  /**
1300
1371
  * Every component has a render function
@@ -1311,6 +1382,8 @@ interface BuildFeatures {
1311
1382
  vdomKey: boolean;
1312
1383
  vdomListener: boolean;
1313
1384
  vdomPropOrAttr: boolean;
1385
+ /** True when at least one component uses the explicit `attr:`/`prop:` JSX prefix. */
1386
+ vdomPropOrAttrPrefix: boolean;
1314
1387
  vdomRef: boolean;
1315
1388
  vdomStyle: boolean;
1316
1389
  vdomText: boolean;
@@ -1501,6 +1574,15 @@ interface HostElement extends HTMLElement {
1501
1574
  * must be resolved for the top, ancestor component to be fully hydrated
1502
1575
  */
1503
1576
  ['s-p']?: Promise<void>[];
1577
+ /**
1578
+ * Pending Connects:
1579
+ * A list of {@link HostRef.$onFirstConnectPromise$} promises for descendants that
1580
+ * were already registered with this component (their nearest Stencil ancestor) by
1581
+ * the time this component's own initial `componentWillLoad` was scheduled. Awaited
1582
+ * so this component's `componentWillLoad` can't fire before those descendants'
1583
+ * real `connectedCallback`s have.
1584
+ */
1585
+ ['s-pc']?: Promise<void>[];
1504
1586
  componentOnReady?: () => Promise<this>;
1505
1587
  }
1506
1588
  /**
@@ -1540,6 +1622,11 @@ interface RenderNode extends HostElement {
1540
1622
  * Slot name of either the slot itself or the slotted node
1541
1623
  */
1542
1624
  ['s-sn']?: string;
1625
+ /**
1626
+ * `slot` attribute of a `<slot>` reference rendered as a text node (no fallback content),
1627
+ * since text nodes can't carry real DOM attributes.
1628
+ */
1629
+ ['s-sa']?: string;
1543
1630
  /**
1544
1631
  * Host element tag name:
1545
1632
  * The tag name of the host element that this
@@ -1592,7 +1679,7 @@ interface RenderNode extends HostElement {
1592
1679
  * Used to know the components encapsulation.
1593
1680
  * empty "" for shadow, "c" from scoped
1594
1681
  */
1595
- ['s-en']?: '' | /*shadow*/'c';
1682
+ ['s-en']?: '' | /*shadow*/ 'c';
1596
1683
  /**
1597
1684
  * On a `scoped: true` component
1598
1685
  * with `lightDomPatches` flag enabled,
@@ -1717,10 +1804,26 @@ interface PatchedSlotNode extends Node {
1717
1804
  __previousElementSibling?: RenderNode;
1718
1805
  }
1719
1806
  type LazyBundlesRuntimeData = LazyBundleRuntimeData[];
1720
- type LazyBundleRuntimeData = [/** bundleIds */string, ComponentRuntimeMetaCompact[]];
1721
- type ComponentRuntimeMetaCompact = [/** flags */number, /** tagname */string, /** members */{
1807
+ type LazyBundleRuntimeData = [
1808
+ /** bundleIds */
1809
+ string, ComponentRuntimeMetaCompact[]];
1810
+ type ComponentRuntimeMetaCompact = [
1811
+ /** flags */
1812
+ number,
1813
+ /** tagname */
1814
+ string,
1815
+ /** members */
1816
+ {
1722
1817
  [memberName: string]: ComponentRuntimeMember;
1723
- }?, /** listeners */ComponentRuntimeHostListener[]?, /** watchers */ComponentConstructorChangeHandlers?, /** serializers */ComponentConstructorChangeHandlers?, /** deserializers */ComponentConstructorChangeHandlers?];
1818
+ }?,
1819
+ /** listeners */
1820
+ ComponentRuntimeHostListener[]?,
1821
+ /** watchers */
1822
+ ComponentConstructorChangeHandlers?,
1823
+ /** serializers */
1824
+ ComponentConstructorChangeHandlers?,
1825
+ /** deserializers */
1826
+ ComponentConstructorChangeHandlers?];
1724
1827
  /**
1725
1828
  * Runtime metadata for a Stencil component
1726
1829
  */
@@ -1823,6 +1926,11 @@ interface HostRef {
1823
1926
  $cmpMeta$: ComponentRuntimeMeta;
1824
1927
  $hostElement$: HostElement;
1825
1928
  $instanceValues$?: Map<string, any>;
1929
+ /**
1930
+ * Prop/state changes accumulated since the last render, flushed to
1931
+ * `componentShouldUpdate` once per render cycle.
1932
+ */
1933
+ $queuedPropChanges$?: ComponentShouldUpdateChanges;
1826
1934
  $signalValues$?: Map<string, import('@preact/signals-core').Signal<any>>;
1827
1935
  /** Dispose function that tears down all signal effects for this component. */
1828
1936
  $signalCleanup$?: () => void;
@@ -1858,6 +1966,21 @@ interface HostRef {
1858
1966
  * It is called after {@link HostRef.$onInstancePromise$} resolves.
1859
1967
  */
1860
1968
  $onRenderResolve$?: () => void;
1969
+ /**
1970
+ * A promise that resolves once this component's real `connectedCallback` has fired
1971
+ * for the first time. Created lazily - either by a descendant that needs to wait for
1972
+ * this component's connection before firing its own real `connectedCallback`
1973
+ * ({@link HOST_FLAGS.hasFiredConnected}), or by this component registering itself
1974
+ * with its nearest Stencil ancestor's `s-pc` list. This is what lets a component's
1975
+ * real `connectedCallback` (and, transitively, a pending ancestor's initial
1976
+ * `componentWillLoad`) stay ordered correctly regardless of which of an
1977
+ * ancestor/descendant pair's lazy module happens to resolve first.
1978
+ */
1979
+ $onFirstConnectPromise$?: Promise<void>;
1980
+ /**
1981
+ * A callback which resolves {@link HostRef.$onFirstConnectPromise$}
1982
+ */
1983
+ $onFirstConnectResolve$?: () => void;
1861
1984
  $vnode$?: VNode;
1862
1985
  $queuedListeners$?: [string, any][];
1863
1986
  $rmListeners$?: (() => void)[];
@@ -1867,6 +1990,11 @@ interface HostRef {
1867
1990
  * Defer connectedCallback until after first render for components with slot relocation.
1868
1991
  */
1869
1992
  $deferredConnectedCallback$?: boolean;
1993
+ /**
1994
+ * The number of times this host's lazy component load has failed and been retried.
1995
+ * Used to give up retrying after {@link MAX_LAZY_LOAD_RETRIES} failed attempts.
1996
+ */
1997
+ $loadRetryCount$?: number;
1870
1998
  }
1871
1999
  interface PlatformRuntime {
1872
2000
  /**
@@ -1911,6 +2039,18 @@ interface PlatformRuntime {
1911
2039
  ce: (eventName: string, opts?: any) => CustomEvent;
1912
2040
  }
1913
2041
  type ChildType = VNode | number | string;
2042
+ type PropsType = VNodeProdData | number | string | null;
2043
+ interface VNodeProdData {
2044
+ key?: string | number;
2045
+ class?: {
2046
+ [className: string]: boolean;
2047
+ } | string;
2048
+ className?: {
2049
+ [className: string]: boolean;
2050
+ } | string;
2051
+ style?: any;
2052
+ [key: string]: any;
2053
+ }
1914
2054
  //#endregion
1915
2055
  //#region src/app-data/index.d.ts
1916
2056
  /**
@@ -1939,4 +2079,4 @@ declare const BUILD: BuildConditionals;
1939
2079
  declare const Env: {};
1940
2080
  declare const NAMESPACE: string;
1941
2081
  //#endregion
1942
- export { VNode as S, FunctionalComponent as _, ComponentConstructor as a, ResolutionHandler as b, ComponentRuntimeMeta as c, HostRef as d, LazyBundlesRuntimeData as f, CustomElementsDefineOptions as g, RuntimeRef as h, ChildType as i, ComponentRuntimeMetaCompact as l, RenderNode as m, Env as n, ComponentConstructorChangeHandlers as o, PlatformRuntime as p, NAMESPACE as r, ComponentRuntimeHostListener as s, BUILD as t, HostElement as u, HTMLStencilElement as v, TagTransformer as x, JSXBase as y };
2082
+ export { ReactiveControllerHostInterface as C, VNode as E, MixedInCtor as S, TagTransformer as T, ComponentInterface as _, ComponentConstructor as a, HTMLStencilElement as b, ComponentRuntimeMeta as c, HostRef as d, LazyBundlesRuntimeData as f, RuntimeRef as g, RenderNode as h, ChildType as i, ComponentRuntimeMetaCompact as l, PropsType as m, Env as n, ComponentConstructorChangeHandlers as o, PlatformRuntime as p, NAMESPACE as r, ComponentRuntimeHostListener as s, BUILD as t, HostElement as u, CustomElementsDefineOptions as v, ResolutionHandler as w, JSXBase as x, FunctionalComponent as y };