@stencil/core 5.0.0-alpha.3 → 5.0.0-alpha.31
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.
- package/README.md +94 -0
- package/dist/app-data/index.d.ts +2 -0
- package/dist/{runtime/app-data → app-data}/index.js +17 -11
- package/dist/{client-CSm3x5ke.mjs → client-D1MsT-Rp.mjs} +2717 -2424
- package/dist/compiler/index.d.mts +170 -6
- package/dist/compiler/index.mjs +4 -3
- package/dist/compiler/utils/index.d.mts +272 -2
- package/dist/compiler/utils/index.mjs +4 -3
- package/dist/{compiler-D6iP7Bzb.mjs → compiler-Cddp97Pg.mjs} +14953 -12327
- package/dist/declarations/stencil-ext-modules.d.ts +5 -5
- package/dist/declarations/stencil-public-compiler.d.ts +728 -287
- package/dist/declarations/stencil-public-compiler.js +2 -3
- package/dist/declarations/stencil-public-docs.d.ts +19 -0
- package/dist/declarations/stencil-public-runtime.d.ts +131 -17
- package/dist/fragment-Di1hWOC8.mjs +4 -0
- package/dist/{index-tUR6pD3J.d.mts → index-BHj3EBl2.d.mts} +1052 -668
- package/dist/{index-CyrGY82h.d.ts → index-D2PAsXxx.d.ts} +215 -40
- package/dist/index-VK8okIiF.d.mts +108 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +91 -2
- package/dist/jsx-runtime.d.mts +18 -0
- package/dist/jsx-runtime.mjs +3 -0
- package/dist/{node-Bg-mO5dw.mjs → node-BQR4L-TG.mjs} +76 -73
- package/dist/reactive-controller-BdCpSAQP.d.mts +13 -0
- package/dist/{regular-expression-D5pGVpCu.mjs → regular-expression-XqU5zmPp.mjs} +141 -31
- package/dist/{chunk-CjcI7cDX.mjs → rolldown-runtime-BhDjJH2R.mjs} +1 -1
- package/dist/{runtime-BBCnuprF.js → runtime/client/lazy.js} +2987 -2443
- package/dist/runtime/client/{index.d.ts → runtime.d.ts} +228 -83
- package/dist/runtime/client/{index.js → runtime.js} +2852 -2432
- package/dist/runtime/index.d.ts +48 -29
- package/dist/runtime/index.js +5069 -2
- package/dist/runtime/server/index.d.mts +182 -75
- package/dist/runtime/server/index.mjs +2769 -2283
- package/dist/runtime/server/runner.d.mts +47 -32
- package/dist/runtime/server/runner.mjs +563 -687
- package/dist/signals/index.d.ts +49 -0
- package/dist/signals/index.js +199 -0
- package/dist/sys/node/index.d.mts +1 -2
- package/dist/sys/node/index.mjs +1 -1
- package/dist/sys/node/worker.d.mts +1 -1
- package/dist/sys/node/worker.mjs +6 -3
- package/dist/testing/index.d.mts +98 -9
- package/dist/testing/index.mjs +395 -70
- package/dist/util-BIa-iHnt.mjs +724 -0
- package/dist/validation-Dd3g77T5.mjs +778 -0
- package/package.json +49 -36
- package/dist/index-CXHCTQNt.d.mts +0 -190
- package/dist/index-hS-KBdAP.d.ts +0 -30
- package/dist/jsx-runtime-DlDkTqps.d.ts +0 -28
- package/dist/jsx-runtime.d.ts +0 -2
- package/dist/jsx-runtime.js +0 -2
- package/dist/runtime/app-data/index.d.ts +0 -2
- package/dist/validation-Byxie0Uk.mjs +0 -1445
- /package/{LICENSE.md → LICENSE} +0 -0
- /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
- /package/dist/{runtime/app-globals → app-globals}/index.js +0 -0
|
@@ -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
|
-
*
|
|
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
|
|
72
|
-
*
|
|
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?(
|
|
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,44 @@ 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
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Minimal interface matched by signal objects (from @stencil/core/signals).
|
|
158
|
+
* Used in JSX attribute types.
|
|
159
|
+
*/
|
|
160
|
+
interface SignalRef<T = any> {
|
|
161
|
+
readonly value: T;
|
|
162
|
+
peek(): T;
|
|
163
|
+
}
|
|
99
164
|
/**
|
|
100
165
|
* Utilities for working with functional Stencil components. An object
|
|
101
166
|
* conforming to this interface is passed by the Stencil runtime as the third
|
|
@@ -137,7 +202,7 @@ interface FunctionalUtilities {
|
|
|
137
202
|
map: (children: VNode[], cb: (vnode: ChildNode$1, index: number, array: ChildNode$1[]) => ChildNode$1) => VNode[];
|
|
138
203
|
}
|
|
139
204
|
interface FunctionalComponent<T = {}> {
|
|
140
|
-
(props: T, children: VNode[], utils: FunctionalUtilities): VNode |
|
|
205
|
+
(props: T, children: VNode[], utils: FunctionalUtilities): VNode | null;
|
|
141
206
|
}
|
|
142
207
|
/**
|
|
143
208
|
* A Child VDOM node
|
|
@@ -148,7 +213,7 @@ interface FunctionalComponent<T = {}> {
|
|
|
148
213
|
* {@link FunctionalUtilities}).
|
|
149
214
|
*/
|
|
150
215
|
interface ChildNode$1 {
|
|
151
|
-
vtag?: string | number | Function;
|
|
216
|
+
vtag?: string | number | Function | symbol | null;
|
|
152
217
|
vkey?: string | number;
|
|
153
218
|
vtext?: string;
|
|
154
219
|
vchildren?: VNode[];
|
|
@@ -160,13 +225,15 @@ interface ChildNode$1 {
|
|
|
160
225
|
*/
|
|
161
226
|
interface VNode {
|
|
162
227
|
$flags$: number;
|
|
163
|
-
$tag$: string | number | Function;
|
|
228
|
+
$tag$: string | number | Function | symbol | null;
|
|
164
229
|
$elm$: any;
|
|
165
230
|
$text$: string;
|
|
166
231
|
$children$: VNode[];
|
|
167
232
|
$attrs$?: any;
|
|
168
233
|
$name$?: string;
|
|
169
234
|
$key$?: string | number;
|
|
235
|
+
/** Signal reference for vdom bypass: signal text nodes store the signal here. */
|
|
236
|
+
$signal$?: any;
|
|
170
237
|
}
|
|
171
238
|
declare namespace JSXBase {
|
|
172
239
|
interface IntrinsicElements {
|
|
@@ -424,6 +491,7 @@ declare namespace JSXBase {
|
|
|
424
491
|
onClose?: (event: Event) => void;
|
|
425
492
|
open?: boolean;
|
|
426
493
|
returnValue?: string;
|
|
494
|
+
closedby?: 'any' | 'closerequest' | 'none';
|
|
427
495
|
}
|
|
428
496
|
interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
429
497
|
height?: number | string;
|
|
@@ -461,6 +529,8 @@ declare namespace JSXBase {
|
|
|
461
529
|
allowtransparency?: string | boolean;
|
|
462
530
|
frameBorder?: number | string;
|
|
463
531
|
frameborder?: number | string;
|
|
532
|
+
fetchPriority?: 'high' | 'low' | 'auto';
|
|
533
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
464
534
|
importance?: 'low' | 'auto' | 'high';
|
|
465
535
|
height?: number | string;
|
|
466
536
|
loading?: 'lazy' | 'auto' | 'eager';
|
|
@@ -483,9 +553,12 @@ declare namespace JSXBase {
|
|
|
483
553
|
crossOrigin?: string;
|
|
484
554
|
crossorigin?: string;
|
|
485
555
|
decoding?: 'async' | 'auto' | 'sync';
|
|
556
|
+
fetchPriority?: 'high' | 'low' | 'auto';
|
|
557
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
486
558
|
importance?: 'low' | 'auto' | 'high';
|
|
487
559
|
height?: number | string;
|
|
488
560
|
loading?: 'lazy' | 'auto' | 'eager';
|
|
561
|
+
referrerPolicy?: ReferrerPolicy;
|
|
489
562
|
sizes?: string;
|
|
490
563
|
src?: string;
|
|
491
564
|
srcSet?: string;
|
|
@@ -581,6 +654,8 @@ declare namespace JSXBase {
|
|
|
581
654
|
}
|
|
582
655
|
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
583
656
|
as?: string;
|
|
657
|
+
fetchPriority?: 'high' | 'low' | 'auto';
|
|
658
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
584
659
|
href?: string;
|
|
585
660
|
hrefLang?: string;
|
|
586
661
|
hreflang?: string;
|
|
@@ -704,6 +779,8 @@ declare namespace JSXBase {
|
|
|
704
779
|
crossOrigin?: string;
|
|
705
780
|
crossorigin?: string;
|
|
706
781
|
defer?: boolean;
|
|
782
|
+
fetchPriority?: 'high' | 'low' | 'auto';
|
|
783
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
707
784
|
importance?: 'low' | 'auto' | 'high';
|
|
708
785
|
integrity?: string;
|
|
709
786
|
nonce?: string;
|
|
@@ -801,7 +878,7 @@ declare namespace JSXBase {
|
|
|
801
878
|
autofocus?: boolean | string;
|
|
802
879
|
class?: string | {
|
|
803
880
|
[className: string]: boolean;
|
|
804
|
-
}
|
|
881
|
+
} | SignalRef<string>;
|
|
805
882
|
contentEditable?: boolean | string;
|
|
806
883
|
contenteditable?: boolean | string;
|
|
807
884
|
contextMenu?: string;
|
|
@@ -819,7 +896,10 @@ declare namespace JSXBase {
|
|
|
819
896
|
tabIndex?: number;
|
|
820
897
|
tabindex?: number | string;
|
|
821
898
|
title?: string;
|
|
899
|
+
translate?: 'yes' | 'no' | (string & {});
|
|
822
900
|
popover?: string | null;
|
|
901
|
+
focusgroup?: string;
|
|
902
|
+
focusgroupstart?: boolean;
|
|
823
903
|
inputMode?: string;
|
|
824
904
|
inputmode?: string;
|
|
825
905
|
enterKeyHint?: string;
|
|
@@ -860,7 +940,7 @@ declare namespace JSXBase {
|
|
|
860
940
|
interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> {
|
|
861
941
|
class?: string | {
|
|
862
942
|
[className: string]: boolean;
|
|
863
|
-
}
|
|
943
|
+
} | SignalRef<string>;
|
|
864
944
|
color?: string;
|
|
865
945
|
height?: number | string;
|
|
866
946
|
id?: string;
|
|
@@ -1261,10 +1341,13 @@ declare namespace JSXBase {
|
|
|
1261
1341
|
interface JSXAttributes<T = Element$1> {
|
|
1262
1342
|
key?: string | number;
|
|
1263
1343
|
ref?: (elm?: T) => void;
|
|
1344
|
+
children?: any;
|
|
1264
1345
|
}
|
|
1265
1346
|
interface CustomElementsDefineOptions {
|
|
1266
1347
|
exclude?: string[];
|
|
1267
1348
|
syncQueue?: boolean;
|
|
1349
|
+
/** Scoped custom element registry to define components in. Defaults to the global registry. */
|
|
1350
|
+
registry?: CustomElementRegistry;
|
|
1268
1351
|
jmp?: (c: Function) => any;
|
|
1269
1352
|
raf?: (c: FrameRequestCallback) => number;
|
|
1270
1353
|
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
@@ -1301,6 +1384,7 @@ interface BuildFeatures {
|
|
|
1301
1384
|
vdomStyle: boolean;
|
|
1302
1385
|
vdomText: boolean;
|
|
1303
1386
|
vdomXlink: boolean;
|
|
1387
|
+
vdomSignals: boolean;
|
|
1304
1388
|
slotRelocation: boolean;
|
|
1305
1389
|
patchAll: boolean;
|
|
1306
1390
|
patchChildren: boolean;
|
|
@@ -1347,21 +1431,27 @@ interface BuildConditionals extends Partial<BuildFeatures> {
|
|
|
1347
1431
|
lazyLoad?: boolean;
|
|
1348
1432
|
profile?: boolean;
|
|
1349
1433
|
constructableCSS?: boolean;
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1434
|
+
/** True when `compat.lightDomPatches === true` - enables `applyLightDomPatches` shortcut. */
|
|
1435
|
+
lightDomPatches?: boolean;
|
|
1436
|
+
/** Patch `childNodes`/`children` getters on light-dom slotted components. */
|
|
1437
|
+
slotChildNodes?: boolean;
|
|
1438
|
+
/** Patch `cloneNode()` on light-dom slotted components. */
|
|
1439
|
+
slotCloneNode?: boolean;
|
|
1440
|
+
/** Patch `appendChild`/`insertBefore`/`removeChild` on light-dom slotted components. */
|
|
1441
|
+
slotDomMutations?: boolean;
|
|
1442
|
+
/** Patch `textContent` on light-dom slotted components. */
|
|
1443
|
+
slotTextContent?: boolean;
|
|
1354
1444
|
hydratedAttribute?: boolean;
|
|
1355
1445
|
hydratedClass?: boolean;
|
|
1356
1446
|
hydratedSelectorName?: string;
|
|
1447
|
+
/** True when a global-style input contains `@import "stencil-hydrate"` - suppresses dynamic style injection in the loader. */
|
|
1448
|
+
staticHydrationStyles?: boolean;
|
|
1357
1449
|
initializeNextTick?: boolean;
|
|
1358
|
-
shadowDomShim?: boolean;
|
|
1359
1450
|
asyncQueue?: boolean;
|
|
1360
1451
|
additionalTagTransformers?: boolean | 'prod';
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
addGlobalStyleToComponents?: boolean | 'client';
|
|
1452
|
+
signalBacking?: boolean;
|
|
1453
|
+
/** True when JSX signal bypass is active - text nodes and attributes backed by Signal objects update the DOM directly. Auto-enabled when `signalBacking: true`. */
|
|
1454
|
+
vdomSignals?: boolean;
|
|
1365
1455
|
}
|
|
1366
1456
|
interface ComponentConstructor {
|
|
1367
1457
|
is?: string;
|
|
@@ -1426,7 +1516,7 @@ interface HostElement extends HTMLElement {
|
|
|
1426
1516
|
disconnectedCallback?: () => void;
|
|
1427
1517
|
host?: Element;
|
|
1428
1518
|
forceUpdate?: () => void;
|
|
1429
|
-
|
|
1519
|
+
__s_ghr?: () => HostRef;
|
|
1430
1520
|
/**
|
|
1431
1521
|
* Unique stencil id for this element
|
|
1432
1522
|
*/
|
|
@@ -1480,6 +1570,15 @@ interface HostElement extends HTMLElement {
|
|
|
1480
1570
|
* must be resolved for the top, ancestor component to be fully hydrated
|
|
1481
1571
|
*/
|
|
1482
1572
|
['s-p']?: Promise<void>[];
|
|
1573
|
+
/**
|
|
1574
|
+
* Pending Connects:
|
|
1575
|
+
* A list of {@link HostRef.$onFirstConnectPromise$} promises for descendants that
|
|
1576
|
+
* were already registered with this component (their nearest Stencil ancestor) by
|
|
1577
|
+
* the time this component's own initial `componentWillLoad` was scheduled. Awaited
|
|
1578
|
+
* so this component's `componentWillLoad` can't fire before those descendants'
|
|
1579
|
+
* real `connectedCallback`s have.
|
|
1580
|
+
*/
|
|
1581
|
+
['s-pc']?: Promise<void>[];
|
|
1483
1582
|
componentOnReady?: () => Promise<this>;
|
|
1484
1583
|
}
|
|
1485
1584
|
/**
|
|
@@ -1519,6 +1618,11 @@ interface RenderNode extends HostElement {
|
|
|
1519
1618
|
* Slot name of either the slot itself or the slotted node
|
|
1520
1619
|
*/
|
|
1521
1620
|
['s-sn']?: string;
|
|
1621
|
+
/**
|
|
1622
|
+
* `slot` attribute of a `<slot>` reference rendered as a text node (no fallback content),
|
|
1623
|
+
* since text nodes can't carry real DOM attributes.
|
|
1624
|
+
*/
|
|
1625
|
+
['s-sa']?: string;
|
|
1522
1626
|
/**
|
|
1523
1627
|
* Host element tag name:
|
|
1524
1628
|
* The tag name of the host element that this
|
|
@@ -1571,64 +1675,64 @@ interface RenderNode extends HostElement {
|
|
|
1571
1675
|
* Used to know the components encapsulation.
|
|
1572
1676
|
* empty "" for shadow, "c" from scoped
|
|
1573
1677
|
*/
|
|
1574
|
-
['s-en']?: '' | /*shadow*/'c';
|
|
1678
|
+
['s-en']?: '' | /*shadow*/ 'c';
|
|
1575
1679
|
/**
|
|
1576
1680
|
* On a `scoped: true` component
|
|
1577
|
-
* with `
|
|
1681
|
+
* with `lightDomPatches` flag enabled,
|
|
1578
1682
|
* returns the internal `childNodes` of the component
|
|
1579
1683
|
*/
|
|
1580
1684
|
readonly __childNodes?: NodeListOf<ChildNode>;
|
|
1581
1685
|
/**
|
|
1582
1686
|
* On a `scoped: true` component
|
|
1583
|
-
* with `
|
|
1687
|
+
* with `lightDomPatches` flag enabled,
|
|
1584
1688
|
* returns the internal `children` of the component
|
|
1585
1689
|
*/
|
|
1586
1690
|
readonly __children?: HTMLCollectionOf<Element>;
|
|
1587
1691
|
/**
|
|
1588
1692
|
* On a `scoped: true` component
|
|
1589
|
-
* with `
|
|
1693
|
+
* with `lightDomPatches` flag enabled,
|
|
1590
1694
|
* returns the internal `firstChild` of the component
|
|
1591
1695
|
*/
|
|
1592
1696
|
readonly __firstChild?: ChildNode;
|
|
1593
1697
|
/**
|
|
1594
1698
|
* On a `scoped: true` component
|
|
1595
|
-
* with `
|
|
1699
|
+
* with `lightDomPatches` flag enabled,
|
|
1596
1700
|
* returns the internal `lastChild` of the component
|
|
1597
1701
|
*/
|
|
1598
1702
|
readonly __lastChild?: ChildNode;
|
|
1599
1703
|
/**
|
|
1600
1704
|
* On a `scoped: true` component
|
|
1601
|
-
* with `
|
|
1705
|
+
* with `lightDomPatches` flag enabled,
|
|
1602
1706
|
* returns the internal `textContent` of the component
|
|
1603
1707
|
*/
|
|
1604
1708
|
__textContent?: string;
|
|
1605
1709
|
/**
|
|
1606
1710
|
* On a `scoped: true` component
|
|
1607
|
-
* with `
|
|
1711
|
+
* with `lightDomPatches` flag enabled,
|
|
1608
1712
|
* gives access to the original `append` method
|
|
1609
1713
|
*/
|
|
1610
1714
|
__append?: (...nodes: (Node | string)[]) => void;
|
|
1611
1715
|
/**
|
|
1612
1716
|
* On a `scoped: true` component
|
|
1613
|
-
* with `
|
|
1717
|
+
* with `lightDomPatches` flag enabled,
|
|
1614
1718
|
* gives access to the original `prepend` method
|
|
1615
1719
|
*/
|
|
1616
1720
|
__prepend?: (...nodes: (Node | string)[]) => void;
|
|
1617
1721
|
/**
|
|
1618
1722
|
* On a `scoped: true` component
|
|
1619
|
-
* with `
|
|
1723
|
+
* with `lightDomPatches` flag enabled,
|
|
1620
1724
|
* gives access to the original `appendChild` method
|
|
1621
1725
|
*/
|
|
1622
1726
|
__appendChild?: <T extends Node>(newChild: T) => T;
|
|
1623
1727
|
/**
|
|
1624
1728
|
* On a `scoped: true` component
|
|
1625
|
-
* with `
|
|
1729
|
+
* with `lightDomPatches` flag enabled,
|
|
1626
1730
|
* gives access to the original `insertBefore` method
|
|
1627
1731
|
*/
|
|
1628
1732
|
__insertBefore?: <T extends Node>(node: T, child: Node | null) => T;
|
|
1629
1733
|
/**
|
|
1630
1734
|
* On a `scoped: true` component
|
|
1631
|
-
* with `
|
|
1735
|
+
* with `lightDomPatches` flag enabled,
|
|
1632
1736
|
* gives access to the original `removeChild` method
|
|
1633
1737
|
*/
|
|
1634
1738
|
__removeChild?: <T extends Node>(child: T) => T;
|
|
@@ -1666,40 +1770,56 @@ interface PatchedSlotNode extends Node {
|
|
|
1666
1770
|
['s-sr']?: boolean;
|
|
1667
1771
|
/**
|
|
1668
1772
|
* On a `scoped: true` component
|
|
1669
|
-
* with `
|
|
1773
|
+
* with `lightDomPatches` flag enabled,
|
|
1670
1774
|
* returns the actual `parentNode` of the component
|
|
1671
1775
|
*/
|
|
1672
1776
|
__parentNode?: RenderNode;
|
|
1673
1777
|
/**
|
|
1674
1778
|
* On a `scoped: true` component
|
|
1675
|
-
* with `
|
|
1779
|
+
* with `lightDomPatches` flag enabled,
|
|
1676
1780
|
* returns the actual `nextSibling` of the component
|
|
1677
1781
|
*/
|
|
1678
1782
|
__nextSibling?: RenderNode;
|
|
1679
1783
|
/**
|
|
1680
1784
|
* On a `scoped: true` component
|
|
1681
|
-
* with `
|
|
1785
|
+
* with `lightDomPatches` flag enabled,
|
|
1682
1786
|
* returns the actual `previousSibling` of the component
|
|
1683
1787
|
*/
|
|
1684
1788
|
__previousSibling?: RenderNode;
|
|
1685
1789
|
/**
|
|
1686
1790
|
* On a `scoped: true` component
|
|
1687
|
-
* with `
|
|
1791
|
+
* with `lightDomPatches` flag enabled,
|
|
1688
1792
|
* returns the actual `nextElementSibling` of the component
|
|
1689
1793
|
*/
|
|
1690
1794
|
__nextElementSibling?: RenderNode;
|
|
1691
1795
|
/**
|
|
1692
1796
|
* On a `scoped: true` component
|
|
1693
|
-
* with `
|
|
1797
|
+
* with `lightDomPatches` flag enabled,
|
|
1694
1798
|
* returns the actual `nextElementSibling` of the component
|
|
1695
1799
|
*/
|
|
1696
1800
|
__previousElementSibling?: RenderNode;
|
|
1697
1801
|
}
|
|
1698
1802
|
type LazyBundlesRuntimeData = LazyBundleRuntimeData[];
|
|
1699
|
-
type LazyBundleRuntimeData = [
|
|
1700
|
-
|
|
1803
|
+
type LazyBundleRuntimeData = [
|
|
1804
|
+
/** bundleIds */
|
|
1805
|
+
string, ComponentRuntimeMetaCompact[]];
|
|
1806
|
+
type ComponentRuntimeMetaCompact = [
|
|
1807
|
+
/** flags */
|
|
1808
|
+
number,
|
|
1809
|
+
/** tagname */
|
|
1810
|
+
string,
|
|
1811
|
+
/** members */
|
|
1812
|
+
{
|
|
1701
1813
|
[memberName: string]: ComponentRuntimeMember;
|
|
1702
|
-
}?,
|
|
1814
|
+
}?,
|
|
1815
|
+
/** listeners */
|
|
1816
|
+
ComponentRuntimeHostListener[]?,
|
|
1817
|
+
/** watchers */
|
|
1818
|
+
ComponentConstructorChangeHandlers?,
|
|
1819
|
+
/** serializers */
|
|
1820
|
+
ComponentConstructorChangeHandlers?,
|
|
1821
|
+
/** deserializers */
|
|
1822
|
+
ComponentConstructorChangeHandlers?];
|
|
1703
1823
|
/**
|
|
1704
1824
|
* Runtime metadata for a Stencil component
|
|
1705
1825
|
*/
|
|
@@ -1791,7 +1911,7 @@ type ComponentRuntimeReflectingAttr = [string, string | undefined];
|
|
|
1791
1911
|
* associated {@link HostRef} instance.
|
|
1792
1912
|
*/
|
|
1793
1913
|
type RuntimeRef = HostElement | {
|
|
1794
|
-
|
|
1914
|
+
__s_ghr?: () => HostRef;
|
|
1795
1915
|
};
|
|
1796
1916
|
/**
|
|
1797
1917
|
* Interface used to track an Element, it's virtual Node (`VNode`), and other data
|
|
@@ -1802,6 +1922,14 @@ interface HostRef {
|
|
|
1802
1922
|
$cmpMeta$: ComponentRuntimeMeta;
|
|
1803
1923
|
$hostElement$: HostElement;
|
|
1804
1924
|
$instanceValues$?: Map<string, any>;
|
|
1925
|
+
/**
|
|
1926
|
+
* Prop/state changes accumulated since the last render, flushed to
|
|
1927
|
+
* `componentShouldUpdate` once per render cycle.
|
|
1928
|
+
*/
|
|
1929
|
+
$queuedPropChanges$?: ComponentShouldUpdateChanges;
|
|
1930
|
+
$signalValues$?: Map<string, import('@preact/signals-core').Signal<any>>;
|
|
1931
|
+
/** Dispose function that tears down all signal effects for this component. */
|
|
1932
|
+
$signalCleanup$?: () => void;
|
|
1805
1933
|
$serializerValues$?: Map<string, string>;
|
|
1806
1934
|
$lazyInstance$?: ComponentInterface;
|
|
1807
1935
|
/**
|
|
@@ -1834,6 +1962,21 @@ interface HostRef {
|
|
|
1834
1962
|
* It is called after {@link HostRef.$onInstancePromise$} resolves.
|
|
1835
1963
|
*/
|
|
1836
1964
|
$onRenderResolve$?: () => void;
|
|
1965
|
+
/**
|
|
1966
|
+
* A promise that resolves once this component's real `connectedCallback` has fired
|
|
1967
|
+
* for the first time. Created lazily - either by a descendant that needs to wait for
|
|
1968
|
+
* this component's connection before firing its own real `connectedCallback`
|
|
1969
|
+
* ({@link HOST_FLAGS.hasFiredConnected}), or by this component registering itself
|
|
1970
|
+
* with its nearest Stencil ancestor's `s-pc` list. This is what lets a component's
|
|
1971
|
+
* real `connectedCallback` (and, transitively, a pending ancestor's initial
|
|
1972
|
+
* `componentWillLoad`) stay ordered correctly regardless of which of an
|
|
1973
|
+
* ancestor/descendant pair's lazy module happens to resolve first.
|
|
1974
|
+
*/
|
|
1975
|
+
$onFirstConnectPromise$?: Promise<void>;
|
|
1976
|
+
/**
|
|
1977
|
+
* A callback which resolves {@link HostRef.$onFirstConnectPromise$}
|
|
1978
|
+
*/
|
|
1979
|
+
$onFirstConnectResolve$?: () => void;
|
|
1837
1980
|
$vnode$?: VNode;
|
|
1838
1981
|
$queuedListeners$?: [string, any][];
|
|
1839
1982
|
$rmListeners$?: (() => void)[];
|
|
@@ -1843,6 +1986,11 @@ interface HostRef {
|
|
|
1843
1986
|
* Defer connectedCallback until after first render for components with slot relocation.
|
|
1844
1987
|
*/
|
|
1845
1988
|
$deferredConnectedCallback$?: boolean;
|
|
1989
|
+
/**
|
|
1990
|
+
* The number of times this host's lazy component load has failed and been retried.
|
|
1991
|
+
* Used to give up retrying after {@link MAX_LAZY_LOAD_RETRIES} failed attempts.
|
|
1992
|
+
*/
|
|
1993
|
+
$loadRetryCount$?: number;
|
|
1846
1994
|
}
|
|
1847
1995
|
interface PlatformRuntime {
|
|
1848
1996
|
/**
|
|
@@ -1888,4 +2036,31 @@ interface PlatformRuntime {
|
|
|
1888
2036
|
}
|
|
1889
2037
|
type ChildType = VNode | number | string;
|
|
1890
2038
|
//#endregion
|
|
1891
|
-
|
|
2039
|
+
//#region src/app-data/index.d.ts
|
|
2040
|
+
/**
|
|
2041
|
+
* A collection of default build flags for a Stencil project.
|
|
2042
|
+
*
|
|
2043
|
+
* This collection can be found throughout the Stencil codebase, often imported from the `virtual:app-data` module like so:
|
|
2044
|
+
* ```ts
|
|
2045
|
+
* import { BUILD } from 'virtual:app-data';
|
|
2046
|
+
* ```
|
|
2047
|
+
* and is used to determine if a portion of the output of a Stencil _project_'s compilation step can be eliminated.
|
|
2048
|
+
*
|
|
2049
|
+
* e.g. When `BUILD.allRenderFn` evaluates to `false`, the compiler will eliminate conditional statements like:
|
|
2050
|
+
* ```ts
|
|
2051
|
+
* if (BUILD.allRenderFn) {
|
|
2052
|
+
* // some code that will be eliminated if BUILD.allRenderFn is false
|
|
2053
|
+
* }
|
|
2054
|
+
* ```
|
|
2055
|
+
*
|
|
2056
|
+
* `virtual:app-data`, the module that `BUILD` is imported from, is an alias for `@stencil/core/app-data`, and is
|
|
2057
|
+
* partially referenced by {@link STENCIL_APP_DATA_ID}. The `src/compiler/bundle/app-data-plugin.ts` references
|
|
2058
|
+
* `STENCIL_APP_DATA_ID` uses it to replace these defaults with {@link BuildConditionals} that are derived from a
|
|
2059
|
+
* Stencil project's contents (i.e. metadata from the components). This replacement happens at a Stencil project's
|
|
2060
|
+
* compile time. Such code can be found at `src/compiler/app-core/app-data.ts`.
|
|
2061
|
+
*/
|
|
2062
|
+
declare const BUILD: BuildConditionals;
|
|
2063
|
+
declare const Env: {};
|
|
2064
|
+
declare const NAMESPACE: string;
|
|
2065
|
+
//#endregion
|
|
2066
|
+
export { ResolutionHandler as C, ReactiveControllerHostInterface as S, VNode as T, CustomElementsDefineOptions as _, ComponentConstructor as a, JSXBase as b, ComponentRuntimeMeta as c, HostRef as d, LazyBundlesRuntimeData as f, ComponentInterface 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, FunctionalComponent as v, TagTransformer as w, MixedInCtor as x, HTMLStencilElement as y };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Ca as VNode, Et as HostElement, Sa as UserBuildConditionals, ba as ResolutionHandler, cn as RuntimeRef, ga as FunctionalComponent, ha as ErrorHandler, p as ChildType, va as RafCallback, xa as TagTransformer } from "./index-BHj3EBl2.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/app-data/index.d.ts
|
|
22
|
+
declare const Env: {};
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/runtime/element.d.ts
|
|
25
|
+
declare const getElement: (ref: any) => HostElement;
|
|
26
|
+
/**
|
|
27
|
+
* Get the shadow root for a Stencil component's host element.
|
|
28
|
+
* This works for both open and closed shadow DOM modes.
|
|
29
|
+
*
|
|
30
|
+
* For closed shadow DOM, `element.shadowRoot` returns `null` by design,
|
|
31
|
+
* but Stencil stores the reference internally so components can still
|
|
32
|
+
* access their own shadow root.
|
|
33
|
+
*
|
|
34
|
+
* @param element The host element (from @Element() decorator)
|
|
35
|
+
* @returns The shadow root, or null if no shadow root exists
|
|
36
|
+
*/
|
|
37
|
+
declare const getShadowRoot: (element: HTMLElement) => ShadowRoot | null;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/runtime/event-emitter.d.ts
|
|
40
|
+
declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
|
|
41
|
+
emit: (detail: any) => CustomEvent<any>;
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/runtime/fragment.d.ts
|
|
45
|
+
declare const Fragment: FunctionalComponent;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/runtime/mode.d.ts
|
|
48
|
+
declare const setMode: (handler: ResolutionHandler) => number;
|
|
49
|
+
declare const getMode: (ref: RuntimeRef) => string;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/runtime/render.d.ts
|
|
52
|
+
/**
|
|
53
|
+
* Method to render a virtual DOM tree to a container element.
|
|
54
|
+
*
|
|
55
|
+
* Supports efficient re-renders: calling `render()` again on the same container
|
|
56
|
+
* will diff the new VNode tree against the previous one and only update what changed,
|
|
57
|
+
* preserving existing DOM elements and their state.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```tsx
|
|
61
|
+
* import { render } from '@stencil/core';
|
|
62
|
+
*
|
|
63
|
+
* const vnode = (
|
|
64
|
+
* <div>
|
|
65
|
+
* <h1>Hello, world!</h1>
|
|
66
|
+
* </div>
|
|
67
|
+
* );
|
|
68
|
+
* render(vnode, document.body);
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @param vnode - The virtual DOM tree to render
|
|
72
|
+
* @param container - The container element to render the virtual DOM tree to
|
|
73
|
+
*/
|
|
74
|
+
declare function render(vnode: VNode, container: Element): void;
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/runtime/tag-transform.d.ts
|
|
77
|
+
/**
|
|
78
|
+
* Transforms a tag name using the current tag transformer
|
|
79
|
+
* @param tag - the tag to transform e.g. `my-tag`
|
|
80
|
+
* @returns the transformed tag e.g. `new-my-tag`
|
|
81
|
+
*/
|
|
82
|
+
declare function transformTag<T extends string>(tag: T): T;
|
|
83
|
+
/**
|
|
84
|
+
* Sets the tag transformer to be used when rendering custom elements
|
|
85
|
+
* @param transformer the transformer function to use. Must return a string
|
|
86
|
+
*/
|
|
87
|
+
declare function setTagTransformer(transformer: TagTransformer): void;
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/runtime/update-component.d.ts
|
|
90
|
+
declare const getRenderingRef: () => any;
|
|
91
|
+
declare const forceUpdate: (ref: any) => boolean;
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/runtime/vdom/h.d.ts
|
|
94
|
+
declare const h: (nodeName: any, vnodeData: any, ...children: ChildType[]) => VNode;
|
|
95
|
+
declare const Host: {};
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/runtime/vdom/jsx-runtime.d.ts
|
|
98
|
+
declare function jsx(type: any, props: any, key?: string): VNode;
|
|
99
|
+
/**
|
|
100
|
+
* @alias
|
|
101
|
+
*/
|
|
102
|
+
declare const jsxs: typeof jsx;
|
|
103
|
+
/**
|
|
104
|
+
* @alias
|
|
105
|
+
*/
|
|
106
|
+
declare const jsxDEV: typeof jsx;
|
|
107
|
+
//#endregion
|
|
108
|
+
export { Build as S, Env as _, h as a, writeTask as b, setTagTransformer as c, getMode as d, setMode as f, getShadowRoot as g, getElement as h, Host as i, transformTag as l, createEvent as m, jsxDEV as n, forceUpdate as o, Fragment as p, jsxs as r, getRenderingRef as s, jsx as t, render as u, setPlatformHelpers as v, setErrorHandler as x, readTask as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -11,6 +11,7 @@ export type {
|
|
|
11
11
|
ComponentDidUpdate,
|
|
12
12
|
ComponentInterface,
|
|
13
13
|
ComponentOptions,
|
|
14
|
+
ComponentShouldUpdateChanges,
|
|
14
15
|
ComponentWillLoad,
|
|
15
16
|
ComponentWillUpdate,
|
|
16
17
|
EventEmitter,
|
|
@@ -25,6 +26,8 @@ export type {
|
|
|
25
26
|
PropOptions,
|
|
26
27
|
QueueApi,
|
|
27
28
|
RafCallback,
|
|
29
|
+
ReactiveController,
|
|
30
|
+
ReactiveControllerHostInterface,
|
|
28
31
|
VNode,
|
|
29
32
|
VNodeData,
|
|
30
33
|
} from './declarations/stencil-public-runtime';
|
|
@@ -51,9 +54,9 @@ export {
|
|
|
51
54
|
Method,
|
|
52
55
|
MixedInCtor,
|
|
53
56
|
Mixin,
|
|
54
|
-
MixinFactory,
|
|
55
57
|
Prop,
|
|
56
58
|
readTask,
|
|
59
|
+
ReactiveControllerHost,
|
|
57
60
|
render,
|
|
58
61
|
resolveVar,
|
|
59
62
|
setAssetPath,
|