@arcgis/lumina 4.31.0-next.89 → 4.31.0-next.91
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/dist/LitElement.d.ts +8 -7
- package/dist/createEvent.d.ts +3 -28
- package/dist/decorators.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -17
- package/dist/jsx/jsx.d.ts +110 -29
- package/dist/typings/jsxGlobals.d.ts +4 -1
- package/package.json +7 -6
package/dist/LitElement.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { CSSResultGroup, CSSResultOrNative, PropertyValues } from "lit";
|
|
2
2
|
import { LitElement as OriginalLitElement } from "lit";
|
|
3
|
-
import type {
|
|
3
|
+
import type { LuminaPropertyDeclaration } from "@arcgis/components-controllers";
|
|
4
4
|
import type { Runtime } from "./runtime";
|
|
5
5
|
import type { ProxyComponent } from "./lazyLoad";
|
|
6
|
+
import type { ToElement } from "./jsx/jsx";
|
|
6
7
|
type ComponentLifecycle = {
|
|
7
8
|
connectedCallback?: () => void;
|
|
8
9
|
disconnectedCallback?: () => void;
|
|
@@ -38,13 +39,13 @@ export declare class LitElement extends OriginalLitElement implements ComponentL
|
|
|
38
39
|
static finalizeStyles(styles?: CSSResultGroup): CSSResultOrNative[];
|
|
39
40
|
static createProperty(name: PropertyKey,
|
|
40
41
|
/**
|
|
41
|
-
* While in vanilla Lit this type is always
|
|
42
|
+
* While in vanilla Lit this type is always LuminaPropertyDeclaration,
|
|
42
43
|
* in Lumina it is always number or
|
|
43
|
-
* [number,
|
|
44
|
-
*
|
|
44
|
+
* [number,LuminaPropertyDeclaration], so we don't even check for the
|
|
45
|
+
* LuminaPropertyDeclaration case. LuminaPropertyDeclaration is here
|
|
45
46
|
* only to satisfy the type checker.
|
|
46
47
|
*/
|
|
47
|
-
options?:
|
|
48
|
+
options?: LuminaPropertyDeclaration | number | [number, LuminaPropertyDeclaration]): void;
|
|
48
49
|
/**
|
|
49
50
|
* Since we can't pass arguments to web component constructor, before lazy
|
|
50
51
|
* loading logic calls document.createElement(), it temporary sets this static
|
|
@@ -74,7 +75,7 @@ export declare class LitElement extends OriginalLitElement implements ComponentL
|
|
|
74
75
|
* const isLazy = this.el !== this;
|
|
75
76
|
* ```
|
|
76
77
|
*/
|
|
77
|
-
el:
|
|
78
|
+
el: ToElement<this>;
|
|
78
79
|
/**
|
|
79
80
|
* Controller Manager orchestrates all components used by this component,
|
|
80
81
|
* connecting their lifecycle hooks and providing context information.
|
|
@@ -194,7 +195,7 @@ export declare class LitElement extends OriginalLitElement implements ComponentL
|
|
|
194
195
|
listenOn<Name extends keyof HTMLElementEventMap>(target: HTMLElement, name: Name, listener: Listener<this, HTMLElementEventMap[Name] & {
|
|
195
196
|
currentTarget: HTMLElement;
|
|
196
197
|
}>, options?: AddEventListenerOptions | boolean): void;
|
|
197
|
-
listenOn<EventType extends Event = CustomEvent<"Provide type like this.listenOn<
|
|
198
|
+
listenOn<EventType extends Event = CustomEvent<"Provide type like this.listenOn<ToEvents<ArcgisCounter>['arcgisClick']>() to get type-checked payload type">, Target = EventTarget>(target: Target, name: string, listener: Listener<this, EventType & {
|
|
198
199
|
currentTarget: Target;
|
|
199
200
|
}>, options?: AddEventListenerOptions | boolean): void;
|
|
200
201
|
/**
|
package/dist/createEvent.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* An event emitter object
|
|
3
|
-
*/
|
|
4
|
-
export type EventEmitter<T = undefined> = {
|
|
5
|
-
emit(payload: T extends undefined ? void : T): CustomEvent<T>;
|
|
6
|
-
};
|
|
1
|
+
import type { EventEmitter } from "@arcgis/components-controllers";
|
|
7
2
|
export type EventOptions = {
|
|
8
3
|
/**
|
|
9
4
|
* A Boolean indicating whether the event bubbles up through the DOM or not.
|
|
@@ -27,27 +22,7 @@ export type EventOptions = {
|
|
|
27
22
|
*/
|
|
28
23
|
composed?: boolean;
|
|
29
24
|
};
|
|
30
|
-
|
|
31
|
-
* While we don't actually return CustomEvent<T>, only EventEmitter<T>, claiming
|
|
32
|
-
* that we return CustomElement<T> simplifies typing.
|
|
33
|
-
*
|
|
34
|
-
* See:
|
|
35
|
-
* ```ts
|
|
36
|
-
* handleClick(event: ArcgisCounter['arcgisClick']): void {
|
|
37
|
-
* }
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* Without it, you would have to do:
|
|
41
|
-
* ```ts
|
|
42
|
-
* handleClick(event: ReturnType<ArcgisCounter['arcgisClick']['emit']>): void {
|
|
43
|
-
* }
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* It also simplifies the work for Lumina - having property claim to
|
|
47
|
-
* be an even makes it easy to find event properties to provide JSX type-checking,
|
|
48
|
-
* and to find events when doing docs generation.
|
|
49
|
-
*/
|
|
50
|
-
export declare const createEventFactory: <T = undefined>(eventName?: string, options?: EventOptions, component?: import("@arcgis/components-controllers").BaseComponent) => CustomEvent<T> & EventEmitter<T>;
|
|
25
|
+
export declare const createEventFactory: <T = undefined>(eventName?: string, options?: EventOptions, component?: import("@arcgis/components-controllers").BaseComponent) => EventEmitter<T>;
|
|
51
26
|
/**
|
|
52
27
|
* Creates an event emitter.
|
|
53
28
|
* Events emitted by your component will be included in the documentation.
|
|
@@ -62,4 +37,4 @@ export declare const createEventFactory: <T = undefined>(eventName?: string, opt
|
|
|
62
37
|
* ```
|
|
63
38
|
*
|
|
64
39
|
*/
|
|
65
|
-
export declare const createEvent: <T = undefined>(options?: EventOptions) =>
|
|
40
|
+
export declare const createEvent: <T = undefined>(options?: EventOptions) => EventEmitter<T>;
|
package/dist/decorators.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LuminaPropertyDeclaration } from "@arcgis/components-controllers";
|
|
2
2
|
export { state } from "@lit/reactive-element/decorators/state.js";
|
|
3
3
|
/**
|
|
4
4
|
* A class field or accessor decorator which creates a reactive property that
|
|
@@ -41,7 +41,7 @@ export { state } from "@lit/reactive-element/decorators/state.js";
|
|
|
41
41
|
* }
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
|
-
export declare const property: (options?: Omit<
|
|
44
|
+
export declare const property: (options?: Omit<LuminaPropertyDeclaration, "state">) => PropertyDecorator;
|
|
45
45
|
declare type CustomMethodDecorator<T> = (target: unknown, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
|
|
46
46
|
/**
|
|
47
47
|
* The `@method()` decorator is used to expose methods on the public API.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { EventOptions } from "./createEvent";
|
|
2
2
|
export { createEvent } from "./createEvent";
|
|
3
3
|
export { state, property, method } from "./decorators";
|
|
4
4
|
export type { HmrComponentMeta } from "./hmrSupport";
|
package/dist/index.js
CHANGED
|
@@ -118,14 +118,28 @@ var makeDefineCustomElements = (runtime, structure) => function defineCustomElem
|
|
|
118
118
|
Object.entries(structure).forEach(createLazyElement);
|
|
119
119
|
};
|
|
120
120
|
function createLazyElement([tagName, [load, compactMeta = ""]]) {
|
|
121
|
-
var _a;
|
|
122
121
|
if (customElements.get(tagName)) {
|
|
123
122
|
return;
|
|
124
123
|
}
|
|
125
124
|
const [compactObservedProps, compactAsyncMethods, compactSyncMethods] = compactMeta.split(lazyMetaGroupJoiner);
|
|
126
125
|
const observedProps = compactObservedProps ? compactObservedProps?.split(lazyMetaItemJoiner).map(parseCondensedProp) : void 0;
|
|
127
126
|
const observedProperties = observedProps?.map(([property2]) => property2);
|
|
128
|
-
const ProxyClass =
|
|
127
|
+
const ProxyClass = class extends ProxyComponent {
|
|
128
|
+
static {
|
|
129
|
+
this.observedAttributes = observedProps?.map(([, attribute]) => attribute).filter((attribute) => attribute !== "");
|
|
130
|
+
}
|
|
131
|
+
static {
|
|
132
|
+
this._properties = observedProperties;
|
|
133
|
+
}
|
|
134
|
+
static {
|
|
135
|
+
this._asyncMethods = compactAsyncMethods ? compactAsyncMethods?.split(lazyMetaItemJoiner) : void 0;
|
|
136
|
+
}
|
|
137
|
+
static {
|
|
138
|
+
this._syncMethods = compactSyncMethods?.split(lazyMetaItemJoiner);
|
|
139
|
+
}
|
|
140
|
+
static {
|
|
141
|
+
this._name = tagName;
|
|
142
|
+
}
|
|
129
143
|
constructor() {
|
|
130
144
|
const isFirstInstanceOfType = !ProxyClass._loadPromise;
|
|
131
145
|
if (isFirstInstanceOfType) {
|
|
@@ -134,7 +148,7 @@ function createLazyElement([tagName, [load, compactMeta = ""]]) {
|
|
|
134
148
|
}
|
|
135
149
|
super();
|
|
136
150
|
}
|
|
137
|
-
}
|
|
151
|
+
};
|
|
138
152
|
customElements.define(tagName, ProxyClass);
|
|
139
153
|
}
|
|
140
154
|
function parseCondensedProp(propAndAttribute) {
|
|
@@ -183,10 +197,13 @@ var ProxyComponent = class extends HtmlElement {
|
|
|
183
197
|
void ProxyClass._loadPromise.then(this._initializeComponent.bind(this)).catch(this._postLoaded.reject);
|
|
184
198
|
}
|
|
185
199
|
if (process.env.NODE_ENV !== "production") {
|
|
186
|
-
ProxyClass._hmrInstances
|
|
200
|
+
ProxyClass._hmrInstances ??= [];
|
|
187
201
|
ProxyClass._hmrInstances.push(new WeakRef(this));
|
|
188
202
|
}
|
|
189
203
|
}
|
|
204
|
+
static {
|
|
205
|
+
this.lumina = true;
|
|
206
|
+
}
|
|
190
207
|
/** @internal */
|
|
191
208
|
static _initializePrototype() {
|
|
192
209
|
this._properties?.forEach(this._bindProp, this);
|
|
@@ -378,7 +395,6 @@ var ProxyComponent = class extends HtmlElement {
|
|
|
378
395
|
}
|
|
379
396
|
}
|
|
380
397
|
};
|
|
381
|
-
ProxyComponent.lumina = true;
|
|
382
398
|
function removeAttribute(qualifiedName) {
|
|
383
399
|
HTMLElement.prototype.removeAttribute.call(this.el, qualifiedName);
|
|
384
400
|
}
|
|
@@ -407,7 +423,7 @@ function handleHmrUpdate(newModules) {
|
|
|
407
423
|
}
|
|
408
424
|
ProxyClass._LitConstructor = void 0;
|
|
409
425
|
ProxyClass._loadPromise = void 0;
|
|
410
|
-
ProxyClass._hmrIndex
|
|
426
|
+
ProxyClass._hmrIndex ??= 0;
|
|
411
427
|
ProxyClass._hmrIndex += 1;
|
|
412
428
|
ProxyClass._initializePrototype();
|
|
413
429
|
ProxyClass._hmrInstances?.forEach((instanceWeakRef) => {
|
|
@@ -439,22 +455,21 @@ function reInitialize(instance, newModule) {
|
|
|
439
455
|
instance._initializeComponent(newModule);
|
|
440
456
|
}
|
|
441
457
|
function handleComponentMetaUpdate(meta) {
|
|
442
|
-
var _a, _b, _c;
|
|
443
458
|
const ProxyClass = customElements.get(meta.tagName);
|
|
444
459
|
if (ProxyClass === void 0) {
|
|
445
460
|
return;
|
|
446
461
|
}
|
|
447
462
|
const attributes = meta.properties.map(([property2, attribute]) => attribute ?? camelToKebab2(property2)).filter(Boolean);
|
|
448
|
-
observedAttributes[
|
|
449
|
-
|
|
463
|
+
observedAttributes[meta.tagName] ??= {};
|
|
464
|
+
observedAttributes[meta.tagName].original ??= new Set(ProxyClass.observedAttributes);
|
|
450
465
|
const originallyObserved = observedAttributes[meta.tagName].original;
|
|
451
|
-
|
|
466
|
+
observedAttributes[meta.tagName].manuallyObserved ??= new Set(
|
|
452
467
|
/**
|
|
453
468
|
* Never manually observe attributes that were in the original
|
|
454
469
|
* observedAttributes as those would be observed by the browser
|
|
455
470
|
*/
|
|
456
471
|
attributes.filter((attribute) => !originallyObserved.has(attribute))
|
|
457
|
-
)
|
|
472
|
+
);
|
|
458
473
|
ProxyClass._asyncMethods = meta.asyncMethods;
|
|
459
474
|
ProxyClass._syncMethods = meta.syncMethods;
|
|
460
475
|
ProxyClass._properties = meta.properties.map(([name]) => name);
|
|
@@ -463,7 +478,7 @@ function handleComponentMetaUpdate(meta) {
|
|
|
463
478
|
var observedAttributesSymbol = Symbol.for("@arcgis/lumina:observedAttributes");
|
|
464
479
|
var globalThisWithObservedAttributes = globalThis;
|
|
465
480
|
var alreadyHadObservers = observedAttributesSymbol in globalThisWithObservedAttributes;
|
|
466
|
-
globalThisWithObservedAttributes[observedAttributesSymbol]
|
|
481
|
+
globalThisWithObservedAttributes[observedAttributesSymbol] ??= {};
|
|
467
482
|
var observedAttributes = globalThisWithObservedAttributes[observedAttributesSymbol];
|
|
468
483
|
if (!alreadyHadObservers) {
|
|
469
484
|
const makeObserver = (original) => function observeAttributes(qualifiedName, ...rest) {
|
|
@@ -488,7 +503,7 @@ import { Deferred as Deferred2, camelToKebab as camelToKebab3 } from "@arcgis/co
|
|
|
488
503
|
import { LitElement as OriginalLitElement, isServer } from "lit";
|
|
489
504
|
import { useControllerManager } from "@arcgis/components-controllers";
|
|
490
505
|
var emptyFunction = () => void 0;
|
|
491
|
-
var
|
|
506
|
+
var LitElement = class _LitElement extends OriginalLitElement {
|
|
492
507
|
constructor() {
|
|
493
508
|
super();
|
|
494
509
|
/**
|
|
@@ -593,6 +608,9 @@ var _LitElement = class _LitElement extends OriginalLitElement {
|
|
|
593
608
|
...rest
|
|
594
609
|
});
|
|
595
610
|
}
|
|
611
|
+
static {
|
|
612
|
+
this.lumina = true;
|
|
613
|
+
}
|
|
596
614
|
connectedCallback() {
|
|
597
615
|
if (this.el.hasAttribute("defer-hydration")) {
|
|
598
616
|
return;
|
|
@@ -689,12 +707,10 @@ var _LitElement = class _LitElement extends OriginalLitElement {
|
|
|
689
707
|
return this;
|
|
690
708
|
}
|
|
691
709
|
};
|
|
692
|
-
|
|
693
|
-
var LitElement = _LitElement;
|
|
694
|
-
LitElement.createEvent = createEventFactory;
|
|
710
|
+
LitElement.$createEvent = createEventFactory;
|
|
695
711
|
if (process.env.NODE_ENV !== "production") {
|
|
696
712
|
const globalWithLit = globalThis;
|
|
697
|
-
globalWithLit.litIssuedWarnings
|
|
713
|
+
globalWithLit.litIssuedWarnings ??= /* @__PURE__ */ new Set();
|
|
698
714
|
globalWithLit.litIssuedWarnings.add(
|
|
699
715
|
"Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators See https://lit.dev/msg/no-override-create-property for more information."
|
|
700
716
|
);
|
package/dist/jsx/jsx.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ import type { DirectiveClass } from "lit/directive.js";
|
|
|
21
21
|
*/
|
|
22
22
|
export declare namespace h {
|
|
23
23
|
export function h(sel: any, data?: any, text?: any): TemplateResult;
|
|
24
|
-
export type {
|
|
24
|
+
export type { LuminaJsx as JSX };
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Fragment
|
|
@@ -175,6 +175,8 @@ export declare const bindEvent: <T>(descriptor: T | (AddEventListenerOptions & {
|
|
|
175
175
|
handleEvent: T;
|
|
176
176
|
})) => T;
|
|
177
177
|
export type JsxNode = DirectiveResult<any> | JsxNodeArray | Node | TemplateResult | boolean | number | (NonNullable<unknown> & string) | null | undefined;
|
|
178
|
+
interface JsxNodeArray extends Array<JsxNode> {
|
|
179
|
+
}
|
|
178
180
|
/**
|
|
179
181
|
* Equivalent to Lit's "nothing", but has type "never" to allow it to be set as a
|
|
180
182
|
* value for any JSX attribute.
|
|
@@ -213,8 +215,93 @@ export declare const noChange: never;
|
|
|
213
215
|
* "never" to allow it be set as a value for any JSX attribute.
|
|
214
216
|
*/
|
|
215
217
|
export declare const directive: <C extends DirectiveClass>(c: C) => (...values: Parameters<InstanceType<C>["render"]>) => never;
|
|
216
|
-
|
|
217
|
-
|
|
218
|
+
/**
|
|
219
|
+
* this.el property on a component only has the public properties of the
|
|
220
|
+
* component. All internal methods, properties, as well as LitElement methods
|
|
221
|
+
* are excluded. This type approximates what the public API of the component
|
|
222
|
+
* looks like.
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* Usually, you don't need to use this type directly. If you have an
|
|
226
|
+
* `ArcgisCounter` element, you can get it's el type by using
|
|
227
|
+
* `ArcgisCounter["el"]`
|
|
228
|
+
*
|
|
229
|
+
* @remarks
|
|
230
|
+
* By using Omit<>, TypeScript also "forgets" all private members of the
|
|
231
|
+
* passed in type, which is convenient for us.
|
|
232
|
+
*/
|
|
233
|
+
export type ToElement<Component> = Omit<Component, LuminaJsx.ExcludedProperties>;
|
|
234
|
+
/**
|
|
235
|
+
* Utility type for getting the JSX prop types for a given component. In particular:
|
|
236
|
+
*
|
|
237
|
+
* - Excludes LitElement properties that should not be exposed to the end-user
|
|
238
|
+
* - Converts event .emit() properties into event callbacks
|
|
239
|
+
* - Replaces original HTMLElement property typings with the ones we provide for
|
|
240
|
+
* greater type-safety and control
|
|
241
|
+
* - For native events listeners, makes currentTarget equal to the component's
|
|
242
|
+
* HTML instance
|
|
243
|
+
*
|
|
244
|
+
* We mark all component properties as optional because there is no easy
|
|
245
|
+
* way for us to differentiate between public component properties and just
|
|
246
|
+
* regular members that don't have `@property()` decorator (presence or
|
|
247
|
+
* absence of decorator does not change the type). Thus, if we don't mark all
|
|
248
|
+
* properties as optional, TypeScript will force us to provide a value for all
|
|
249
|
+
* methods, and regular properties component may have.
|
|
250
|
+
*/
|
|
251
|
+
export type ToJsx<Component extends {
|
|
252
|
+
el: unknown;
|
|
253
|
+
}> = LuminaJsx.HTMLAttributes<Component["el"]> & LuminaJsx.RemapEvents<Component> & Partial<Omit<Component, LuminaJsx.ExcludedProperties | keyof HTMLElement | keyof LuminaJsx.RemapEvents<Component>>>;
|
|
254
|
+
/**
|
|
255
|
+
* Get the type of all events for a given component. Includes native DOM events
|
|
256
|
+
* and custom events.
|
|
257
|
+
*
|
|
258
|
+
* @example
|
|
259
|
+
* ```tsx
|
|
260
|
+
* render() {
|
|
261
|
+
* return <arcgis-counter onArcgisOverflow={this._handleOverflow} />
|
|
262
|
+
* }
|
|
263
|
+
* _handleOverflow(event: ToEvents<ArcgisCounter>["arcgisOverflow"]) {
|
|
264
|
+
* // event.detail
|
|
265
|
+
* // event.currentTarget
|
|
266
|
+
* }
|
|
267
|
+
* ```
|
|
268
|
+
*
|
|
269
|
+
* @remarks
|
|
270
|
+
* Alternative implementation of this type that is simpler, and potentially
|
|
271
|
+
* more performant, but looses "go to definition" information.
|
|
272
|
+
*
|
|
273
|
+
* ```tsx
|
|
274
|
+
* export type ToEvents<Component extends { el: unknown }> = {
|
|
275
|
+
* [Key in keyof ToJsx<Component> as Key extends `on${infer EventName}`
|
|
276
|
+
* ? Uncapitalize<EventName>
|
|
277
|
+
* : never]-?: ListenerToPayloadType<ToJsx<Component>[Key]>;
|
|
278
|
+
* };
|
|
279
|
+
*
|
|
280
|
+
* type ListenerToPayloadType<Listener> = Listener extends (event: infer EventType) => unknown ? EventType : never;
|
|
281
|
+
* ```
|
|
282
|
+
*
|
|
283
|
+
* TypeScript issues that may fix this:
|
|
284
|
+
* - https://github.com/microsoft/TypeScript/issues/49909
|
|
285
|
+
* - https://github.com/microsoft/TypeScript/issues/50715
|
|
286
|
+
*/
|
|
287
|
+
export type ToEvents<Component> = GlobalEventTypes<MaybeEl<Component>> & {
|
|
288
|
+
[Key in keyof Component as ListenerToPayloadType<Component[Key]> extends CustomEvent ? Key : never]-?: ListenerToPayloadType<Component[Key]> & {
|
|
289
|
+
currentTarget: MaybeEl<Component>;
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
type MaybeEl<Component> = Component extends {
|
|
293
|
+
el: unknown;
|
|
294
|
+
} ? Component["el"] : Component;
|
|
295
|
+
/**
|
|
296
|
+
* From "GlobalEventHandlersCamelCase" extract event names and their payloads.
|
|
297
|
+
* Not using "HTMLElementEventMap" because that map has all events in lowercase.
|
|
298
|
+
*/
|
|
299
|
+
type GlobalEventTypes<Target = HTMLElement> = {
|
|
300
|
+
[Key in keyof LuminaJsx.GlobalEventHandlersCamelCase<Target> as Key extends `on${infer EventName}` ? Uncapitalize<EventName> : never]-?: Parameters<NonNullable<LuminaJsx.GlobalEventHandlersCamelCase<Target>[Key]>>[0];
|
|
301
|
+
};
|
|
302
|
+
type ListenerToPayloadType<Listener> = unknown extends Listener ? void : Listener extends {
|
|
303
|
+
emit: (...rest: never[]) => infer PayloadType;
|
|
304
|
+
} ? PayloadType : Listener extends CustomEvent ? Listener : void;
|
|
218
305
|
/**
|
|
219
306
|
* These typings are based on dom-expressions typings:
|
|
220
307
|
* https://github.com/ryansolid/dom-expressions/blob/main/packages/dom-expressions/src/jsx.d.ts
|
|
@@ -227,7 +314,7 @@ interface JsxNodeArray extends Array<JsxNode> {
|
|
|
227
314
|
* https://www.typescriptlang.org/docs/handbook/jsx.html
|
|
228
315
|
*/
|
|
229
316
|
type DOMElement = Element;
|
|
230
|
-
export declare namespace
|
|
317
|
+
export declare namespace LuminaJsx {
|
|
231
318
|
/**
|
|
232
319
|
* Whether to pick TemplateResult or JsxNode here is a compromise.
|
|
233
320
|
*
|
|
@@ -292,35 +379,24 @@ export declare namespace LitJsx {
|
|
|
292
379
|
* information and can generate the typings that expose only the actual
|
|
293
380
|
* properties component declared.
|
|
294
381
|
*/
|
|
295
|
-
type ExcludedProperties = "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "el" | "
|
|
382
|
+
type ExcludedProperties = "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "el" | "componentOnReady" | "listen" | "load" | "loaded" | "willUpdate" | "updated" | "render" | "renderOptions";
|
|
296
383
|
type ReMappedComponents<Components> = {
|
|
297
|
-
[Key in keyof Components]:
|
|
384
|
+
[Key in keyof Components]: Components[Key] extends {
|
|
385
|
+
el: unknown;
|
|
386
|
+
} ? ToJsx<Components[Key]> : never;
|
|
298
387
|
};
|
|
299
388
|
/**
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
* - Exclude LitElement properties that should not be exposed to the end-user
|
|
303
|
-
* - Convert event .emit() properties into event callbacks
|
|
304
|
-
* - Replace original HTMLElement property typings with the ones we provide for
|
|
305
|
-
* greater type-safety and control
|
|
306
|
-
* - For native events listeners, make currentTarget equal to the component's
|
|
307
|
-
* HTML instance
|
|
308
|
-
*
|
|
309
|
-
* We mark all component properties as optional because there is no easy
|
|
310
|
-
* way for us to differentiate between public component properties and just
|
|
311
|
-
* regular members that don't have `@property()` decorator (presence or
|
|
312
|
-
* absence of decorator does not change the type). Thus, if we don't mark all
|
|
313
|
-
* properties as optional, TypeScript will force us to provide a value for all
|
|
314
|
-
* methods, and regular properties component may have.
|
|
389
|
+
* From event emitters create event listener callbacks
|
|
315
390
|
*/
|
|
316
|
-
type
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
391
|
+
type RemapEvents<Component extends {
|
|
392
|
+
el: unknown;
|
|
393
|
+
}> = {
|
|
394
|
+
[Key in keyof Component as `on${Key & string}`]?: unknown extends Component[Key] ? never : Component[Key] extends {
|
|
395
|
+
emit: (...rest: never[]) => infer PayloadType;
|
|
396
|
+
} ? (event: PayloadType & {
|
|
397
|
+
currentTarget: Component["el"];
|
|
398
|
+
}) => void : never;
|
|
399
|
+
};
|
|
324
400
|
/**
|
|
325
401
|
* - Make ref prop return HTMLElement rather than Stencil element type
|
|
326
402
|
* - Uncapitalize the event properties to match the syntax of React 19,
|
|
@@ -656,6 +732,11 @@ export declare namespace LitJsx {
|
|
|
656
732
|
ariaControlsElements?: HTMLElement[];
|
|
657
733
|
/** Indicates the element that represents the current item within a container or set of related elements. */
|
|
658
734
|
ariaCurrent?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time";
|
|
735
|
+
/**
|
|
736
|
+
* Defines a string value that describes or annotates the current element.
|
|
737
|
+
* @see aria-describedby
|
|
738
|
+
*/
|
|
739
|
+
ariaDescription?: string;
|
|
659
740
|
/**
|
|
660
741
|
* Identifies the element (or elements) that describes the object.
|
|
661
742
|
* @see aria-labelledby
|
|
@@ -14,7 +14,10 @@ declare global {
|
|
|
14
14
|
*/
|
|
15
15
|
export interface DeclareElements {
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
type ReMappedDeclareElements = {
|
|
18
|
+
[TagName in keyof DeclareElements]: DeclareElements[TagName]["el"];
|
|
19
|
+
};
|
|
20
|
+
interface HTMLElementTagNameMap extends ReMappedDeclareElements {
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
23
|
* Extend this interface with Stencil web components that you wish to use
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/lumina",
|
|
3
|
-
"version": "4.31.0-next.
|
|
3
|
+
"version": "4.31.0-next.91",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -29,20 +29,21 @@
|
|
|
29
29
|
"clean": "rimraf ./dist ./build ./turbo ./node_modules"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@arcgis/components-controllers": "4.31.0-next.
|
|
33
|
-
"@arcgis/components-utils": "4.31.0-next.
|
|
32
|
+
"@arcgis/components-controllers": "4.31.0-next.91",
|
|
33
|
+
"@arcgis/components-utils": "4.31.0-next.91",
|
|
34
34
|
"@lit-labs/ssr": "^3.2.2",
|
|
35
35
|
"@lit-labs/ssr-client": "^1.1.7",
|
|
36
36
|
"csstype": "^3.1.3",
|
|
37
|
-
"lit": "^3.1.2"
|
|
37
|
+
"lit": "^3.1.2",
|
|
38
|
+
"tslib": "^2.7.0"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
|
-
"@arcgis/typescript-config": "4.31.0-next.
|
|
41
|
+
"@arcgis/typescript-config": "4.31.0-next.91",
|
|
41
42
|
"@types/node": "^20.2.5",
|
|
42
43
|
"eslint": "^8.55.0",
|
|
43
44
|
"rimraf": "^5.0.0",
|
|
44
45
|
"tsup": "^8.1.0",
|
|
45
46
|
"typescript": "~5.4.0"
|
|
46
47
|
},
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "c06a24c15d739911e39eb09ff59eeb895c478e7a"
|
|
48
49
|
}
|