@arcgis/lumina 4.33.0-next.99 → 4.34.0-next.1
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/{Controller-CZ8Djohh.js → Controller-BQOv8BAL.js} +170 -210
- package/dist/LitElement.d.ts +22 -18
- package/dist/config.d.ts +7 -9
- package/dist/config.js +15 -12
- package/dist/context.d.ts +2 -2
- package/dist/controllers/Controller.d.ts +4 -10
- package/dist/controllers/ControllerInternals.d.ts +7 -13
- package/dist/controllers/ControllerManager.d.ts +6 -21
- package/dist/controllers/accessor/index.d.ts +3 -1
- package/dist/controllers/accessor/index.js +208 -222
- package/dist/controllers/accessor/reEmitEvent.d.ts +1 -1
- package/dist/controllers/accessor/store.d.ts +17 -0
- package/dist/controllers/accessor/useAccessor.d.ts +29 -32
- package/dist/controllers/index.d.ts +2 -2
- package/dist/controllers/index.js +45 -38
- package/dist/controllers/trackKey.d.ts +1 -1
- package/dist/controllers/trackPropKey.d.ts +1 -1
- package/dist/controllers/trackPropertyKey.d.ts +2 -2
- package/dist/controllers/types.d.ts +35 -0
- package/dist/controllers/usePropertyChange.d.ts +3 -1
- package/dist/controllers/utils.d.ts +6 -9
- package/dist/createEvent.d.ts +4 -4
- package/dist/hmrSupport.js +22 -22
- package/dist/index.d.ts +1 -1
- package/dist/index.js +193 -200
- package/dist/jsx/generatedTypes.d.ts +414 -80
- package/dist/lazyLoad-DUvrNd2L.js +406 -0
- package/dist/lazyLoad.d.ts +22 -67
- package/dist/lifecycleSupport.d.ts +1 -1
- package/dist/makeRuntime.d.ts +40 -1
- package/dist/{proxyExports-CK5BLFLO.js → proxyExports-Cdzj7WL_.js} +8 -8
- package/dist/render.d.ts +1 -1
- package/dist/utils.d.ts +8 -0
- package/dist/wrappersUtils.d.ts +13 -1
- package/package.json +5 -5
- package/dist/utils-DBdf1Dqp.js +0 -405
package/dist/LitElement.d.ts
CHANGED
|
@@ -34,9 +34,19 @@ type ComponentLifecycle = {
|
|
|
34
34
|
* only.
|
|
35
35
|
*/
|
|
36
36
|
export declare class LitElement extends OriginalLitElement implements ComponentLifecycle {
|
|
37
|
+
#private;
|
|
38
|
+
/**
|
|
39
|
+
* @private
|
|
40
|
+
* @remarks
|
|
41
|
+
* We prefix private variables with double underscore to avoid collisions with
|
|
42
|
+
* subclasses. All runtime properties that start with underscore are mangled
|
|
43
|
+
* in production build, so collision avoidance is mainly important to avoid
|
|
44
|
+
* triggering TypeScript errors.
|
|
45
|
+
*/
|
|
46
|
+
static __runtime: Runtime;
|
|
37
47
|
/** @private */
|
|
38
|
-
static
|
|
39
|
-
static
|
|
48
|
+
static __tagName: string;
|
|
49
|
+
static elementProperties: Map<PropertyKey, LuminaPropertyDeclaration>;
|
|
40
50
|
/**
|
|
41
51
|
* Customize Lit's default style handling to support non-shadow-root styles
|
|
42
52
|
*/
|
|
@@ -50,6 +60,7 @@ export declare class LitElement extends OriginalLitElement implements ComponentL
|
|
|
50
60
|
* only to satisfy the type checker.
|
|
51
61
|
*/
|
|
52
62
|
options?: LuminaPropertyDeclaration | number | [number, LuminaPropertyDeclaration]): void;
|
|
63
|
+
protected static getPropertyDescriptor(name: PropertyKey, key: string | symbol, options: LuminaPropertyDeclaration): PropertyDescriptor | undefined;
|
|
53
64
|
/**
|
|
54
65
|
* Since we can't pass arguments to web component constructor, before lazy
|
|
55
66
|
* loading logic calls document.createElement(), it temporary sets this static
|
|
@@ -57,7 +68,7 @@ export declare class LitElement extends OriginalLitElement implements ComponentL
|
|
|
57
68
|
*
|
|
58
69
|
* @private
|
|
59
70
|
* */
|
|
60
|
-
static
|
|
71
|
+
static __lazy: ProxyComponent | undefined;
|
|
61
72
|
static readonly lumina = true;
|
|
62
73
|
/**
|
|
63
74
|
* In lazy build, the actual DOM element differs from the class instance:
|
|
@@ -86,15 +97,18 @@ export declare class LitElement extends OriginalLitElement implements ComponentL
|
|
|
86
97
|
* https://lit.dev/docs/composition/controllers/
|
|
87
98
|
*
|
|
88
99
|
* @private
|
|
100
|
+
* @privateRemarks
|
|
101
|
+
* For most private names I tried to prefix with __ to not conflict with
|
|
102
|
+
* private names on subclasses. However, Lit already has __controllers private.
|
|
89
103
|
*/
|
|
90
|
-
readonly _controllers:
|
|
104
|
+
readonly _controllers: (BaseController | Controller<unknown>)[];
|
|
91
105
|
/**
|
|
92
106
|
* Controller Manager orchestrates all controllers used by this component,
|
|
93
107
|
* connecting their lifecycle hooks and providing context information.
|
|
94
108
|
*/
|
|
95
109
|
readonly manager: ControllerManager;
|
|
96
110
|
/** @private */
|
|
97
|
-
|
|
111
|
+
__postLoadDeferred: ProxyComponent["__postLoadDeferred"];
|
|
98
112
|
/**
|
|
99
113
|
* Direct offspring that should be awaited before loaded() is emitted.
|
|
100
114
|
*
|
|
@@ -102,19 +116,10 @@ export declare class LitElement extends OriginalLitElement implements ComponentL
|
|
|
102
116
|
*
|
|
103
117
|
* @private
|
|
104
118
|
*/
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Promise that resolves once parent's load() completed. False if there is no
|
|
108
|
-
* parent
|
|
109
|
-
*
|
|
110
|
-
* @private
|
|
111
|
-
*/
|
|
112
|
-
_ancestorLoad: ProxyComponent["_ancestorLoad"];
|
|
113
|
-
private _originalShouldUpdate?;
|
|
114
|
-
private _enableUpdating;
|
|
115
|
-
private _postLoaded;
|
|
119
|
+
__offspringComponents: ProxyComponent["__offspringComponents"];
|
|
116
120
|
constructor();
|
|
117
121
|
connectedCallback(): void;
|
|
122
|
+
disconnectedCallback(): void;
|
|
118
123
|
/**
|
|
119
124
|
* Overwrite Lit's default behavior of attaching shadow root to the lit
|
|
120
125
|
* element, and instead use this.el to support lazy builds.
|
|
@@ -122,13 +127,12 @@ export declare class LitElement extends OriginalLitElement implements ComponentL
|
|
|
122
127
|
* Also, support the case when component asked to not use shadow root
|
|
123
128
|
*/
|
|
124
129
|
protected createRenderRoot(): DocumentFragment | HTMLElement;
|
|
125
|
-
/** Do asynchronous component load */
|
|
126
|
-
private _load;
|
|
127
130
|
/**
|
|
128
131
|
* Overwriting default shouldUpdate simply to get access to
|
|
129
132
|
* "changedProperties" so that we can later provide it to ControllerManager
|
|
130
133
|
*/
|
|
131
134
|
protected shouldUpdate(_changedProperties: PropertyValues): boolean;
|
|
135
|
+
protected update(changedProperties: PropertyValues): void;
|
|
132
136
|
/**
|
|
133
137
|
* A helper for setting event listener on the current component.
|
|
134
138
|
*
|
package/dist/config.d.ts
CHANGED
|
@@ -12,12 +12,10 @@ export declare const lazyMetaSubItemJoiner = ":";
|
|
|
12
12
|
* object, we pass it a compact number, that gets converted back to an object
|
|
13
13
|
* in createProperty() at runtime.
|
|
14
14
|
*/
|
|
15
|
-
export declare
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
NO_ACCESSOR = 64
|
|
23
|
-
}
|
|
15
|
+
export declare const propertyFlagAttribute: number;
|
|
16
|
+
export declare const propertyFlagReflect: number;
|
|
17
|
+
export declare const propertyFlagBoolean: number;
|
|
18
|
+
export declare const propertyFlagNumber: number;
|
|
19
|
+
export declare const propertyFlagState: number;
|
|
20
|
+
export declare const propertyFlagReadOnly: number;
|
|
21
|
+
export declare const propertyFlagNoAccessor: number;
|
package/dist/config.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
const lazyMetaGroupJoiner = ";";
|
|
2
2
|
const lazyMetaItemJoiner = ",";
|
|
3
3
|
const lazyMetaSubItemJoiner = ":";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
PropertyFlags2[PropertyFlags2["NO_ACCESSOR"] = 64] = "NO_ACCESSOR";
|
|
12
|
-
return PropertyFlags2;
|
|
13
|
-
})(PropertyFlags || {});
|
|
4
|
+
const propertyFlagAttribute = 1 << 0;
|
|
5
|
+
const propertyFlagReflect = 1 << 1;
|
|
6
|
+
const propertyFlagBoolean = 1 << 2;
|
|
7
|
+
const propertyFlagNumber = 1 << 3;
|
|
8
|
+
const propertyFlagState = 1 << 4;
|
|
9
|
+
const propertyFlagReadOnly = 1 << 5;
|
|
10
|
+
const propertyFlagNoAccessor = 1 << 6;
|
|
14
11
|
export {
|
|
15
|
-
PropertyFlags,
|
|
16
12
|
lazyMetaGroupJoiner,
|
|
17
13
|
lazyMetaItemJoiner,
|
|
18
|
-
lazyMetaSubItemJoiner
|
|
14
|
+
lazyMetaSubItemJoiner,
|
|
15
|
+
propertyFlagAttribute,
|
|
16
|
+
propertyFlagBoolean,
|
|
17
|
+
propertyFlagNoAccessor,
|
|
18
|
+
propertyFlagNumber,
|
|
19
|
+
propertyFlagReadOnly,
|
|
20
|
+
propertyFlagReflect,
|
|
21
|
+
propertyFlagState
|
|
19
22
|
};
|
package/dist/context.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ interface ContextConsumerOptions<C extends Context<unknown, unknown>> {
|
|
|
14
14
|
*
|
|
15
15
|
* @see https://lit.dev/docs/data/context/
|
|
16
16
|
*/
|
|
17
|
-
export declare
|
|
17
|
+
export declare const useContextProvider: <C extends Context<unknown, unknown>>(options: ContextProviderOptions<C>) => ContextProvider<C>;
|
|
18
18
|
/**
|
|
19
19
|
* Wrapper for Lit's ContextConsumer controller to provide lazy-loading compatibility.
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ export declare function useContextProvider<C extends Context<unknown, unknown>>(
|
|
|
22
22
|
*
|
|
23
23
|
* FEATURE: wrap this in proxyExports to improve DX, or keep it simple?
|
|
24
24
|
*/
|
|
25
|
-
export declare
|
|
25
|
+
export declare const useContextConsumer: <C extends Context<unknown, unknown>>(options: ContextConsumerOptions<C>) => ContextConsumer<C, LitContextHost>;
|
|
26
26
|
/**
|
|
27
27
|
* Lit context wasn't written with lazy loading proxy in mind. For it to
|
|
28
28
|
* work correctly, we must provide the DOM-attached element as the host element.
|
|
@@ -12,15 +12,12 @@ import { LitElement } from '../LitElement';
|
|
|
12
12
|
* See ./examples.tsx for many example controllers and their usages.
|
|
13
13
|
*/
|
|
14
14
|
export declare abstract class Controller<Exports = never> implements BaseController {
|
|
15
|
-
|
|
16
|
-
readonly [KEY in keyof Omit<ControllerLifecycleMethods, "controllerRemoved">]-?: NonNullable<ControllerLifecycleMethods[KEY]>[];
|
|
17
|
-
};
|
|
18
|
-
protected _ready: Deferred<Exports>;
|
|
19
|
-
private _lifecycleCleanups;
|
|
15
|
+
#private;
|
|
20
16
|
/** @private */
|
|
21
|
-
|
|
17
|
+
protected __ready: Deferred<Exports>;
|
|
18
|
+
/** @private */
|
|
19
|
+
__assignedProperty?: string | false;
|
|
22
20
|
connectedCalled: boolean;
|
|
23
|
-
protected _loadCalled: boolean;
|
|
24
21
|
loadedCalled: boolean;
|
|
25
22
|
readonly [controllerSymbol] = true;
|
|
26
23
|
component: LitElement;
|
|
@@ -31,7 +28,6 @@ export declare abstract class Controller<Exports = never> implements BaseControl
|
|
|
31
28
|
* construction, then trigger connected and load right away
|
|
32
29
|
*/
|
|
33
30
|
catchUpLifecycle(): void;
|
|
34
|
-
private _exports;
|
|
35
31
|
get exports(): Exports;
|
|
36
32
|
/**
|
|
37
33
|
* Set controller's exports property (for usage with proxyExports()) and mark
|
|
@@ -58,7 +54,6 @@ export declare abstract class Controller<Exports = never> implements BaseControl
|
|
|
58
54
|
setProvisionalExports(exports: Exports, proxy?: boolean): void;
|
|
59
55
|
setProvisionalExports(exports: Exports extends object ? Partial<Exports> : Exports, proxy?: boolean): void;
|
|
60
56
|
setProvisionalExports<Props extends keyof Exports>(exports: Pick<Exports, Props>, proxy?: boolean): void;
|
|
61
|
-
private _exportWatchers;
|
|
62
57
|
watchExports(callback: (exports: Exports) => void): () => void;
|
|
63
58
|
/**
|
|
64
59
|
* A flexible utility for making sure a controller is loaded before it's used,
|
|
@@ -126,7 +121,6 @@ export declare abstract class Controller<Exports = never> implements BaseControl
|
|
|
126
121
|
triggerDestroy(): void;
|
|
127
122
|
/** @private */
|
|
128
123
|
triggerLifecycle(): void;
|
|
129
|
-
private _callLifecycle;
|
|
130
124
|
}
|
|
131
125
|
export declare abstract class GenericControllerType<Exports, Requires = LitElement> extends Controller<Exports> {
|
|
132
126
|
component: LitElement & Requires;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Controller } from './Controller';
|
|
2
2
|
import { BaseController } from './types';
|
|
3
3
|
import { LitElement } from '../LitElement';
|
|
4
|
-
export declare
|
|
5
|
-
export declare
|
|
6
|
-
export declare
|
|
4
|
+
export declare const setAmbientComponent: (component: LitElement) => void;
|
|
5
|
+
export declare const retrieveComponent: (name?: string) => LitElement;
|
|
6
|
+
export declare const setParentController: (controller: BaseController | undefined) => void;
|
|
7
7
|
/**
|
|
8
8
|
* Get references to controllers this nested controller might have been called
|
|
9
9
|
* from. The list may include extra controllers, but at least one of them or
|
|
10
10
|
* the component itself is the parent for this controller.
|
|
11
11
|
*/
|
|
12
|
-
export declare
|
|
13
|
-
export declare
|
|
12
|
+
export declare const retrieveParentControllers: () => readonly BaseController[];
|
|
13
|
+
export declare const setAmbientChildController: (controller: BaseController | undefined) => void;
|
|
14
14
|
/**
|
|
15
15
|
* The type definition has to be duplicated due to this TypeScript error:
|
|
16
16
|
* "'use' is referenced directly or indirectly in its own type annotation."
|
|
@@ -18,23 +18,17 @@ export declare function setAmbientChildController(controller: BaseController | u
|
|
|
18
18
|
export declare const use: <Value>(value: Value, watchExports?: (value: NotNever<InferController<Value>>, unsubscribe: () => void) => void) => Promise<NotNever<InferController<Value>>>;
|
|
19
19
|
export declare const useRef: <Value>(value: Value) => Promise<InferController<Value>>;
|
|
20
20
|
export declare const useRefSync: <Value>(value: Value) => InferController<Value> | undefined;
|
|
21
|
-
/** @deprecated */
|
|
22
|
-
export declare let shouldBypassGetter: boolean;
|
|
23
21
|
export declare let shouldBypassReadOnly: boolean;
|
|
24
22
|
/**
|
|
25
23
|
* Permits updating read-only properties
|
|
26
24
|
*
|
|
27
25
|
* @see https://qawebgis.esri.com/components/lumina/properties#read-only-properties
|
|
28
26
|
*/
|
|
29
|
-
export declare
|
|
27
|
+
export declare const bypassReadOnly: <T = void>(callback: () => T) => T | void;
|
|
30
28
|
/**
|
|
31
29
|
* @deprecated see https://qawebgis.esri.com/components/lumina/properties#get-set-properties
|
|
32
30
|
*/
|
|
33
|
-
export declare const bypassSetter:
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated see https://qawebgis.esri.com/components/lumina/properties#get-set-properties
|
|
36
|
-
*/
|
|
37
|
-
export declare function bypassGetter<T = void>(callback: () => T): T | void;
|
|
31
|
+
export declare const bypassSetter: <T = void>(callback: () => T) => T | void;
|
|
38
32
|
/**
|
|
39
33
|
* If passed value is a controller, then return it. Otherwise, assume it's a
|
|
40
34
|
* proxyExports() result and wrap it into a controller
|
|
@@ -7,9 +7,9 @@ import { LitElement } from '../LitElement';
|
|
|
7
7
|
* component, loads them, and forwards lifecycle events to them.
|
|
8
8
|
*/
|
|
9
9
|
export declare class ControllerManager extends GenericController<undefined> {
|
|
10
|
+
#private;
|
|
10
11
|
hasDestroy: boolean;
|
|
11
12
|
destroyed: boolean;
|
|
12
|
-
private _autoDestroyTimeout?;
|
|
13
13
|
constructor(component: LitElement);
|
|
14
14
|
/**
|
|
15
15
|
* Throws an error if component does not implement destroy() lifecycle, but
|
|
@@ -17,25 +17,23 @@ export declare class ControllerManager extends GenericController<undefined> {
|
|
|
17
17
|
*
|
|
18
18
|
* @private
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
devOnly$ensureHasDestroy?: () => void;
|
|
21
21
|
destroy(): Promise<void>;
|
|
22
22
|
/** @private */
|
|
23
23
|
_setAutoDestroyTimeout(): void;
|
|
24
24
|
/**
|
|
25
25
|
* "readOnly" is not enabled initially since we need to allow to set property
|
|
26
26
|
* default values in the constructor.
|
|
27
|
+
*
|
|
28
|
+
* @private
|
|
27
29
|
*/
|
|
28
|
-
|
|
30
|
+
_isEnforcingReadonly: boolean;
|
|
29
31
|
/** @private */
|
|
30
32
|
_trackedValue: unknown;
|
|
31
33
|
/** @private */
|
|
32
34
|
_keyTrackers: ((key: string | undefined, value: unknown) => void)[];
|
|
33
35
|
/** @private */
|
|
34
36
|
_firePropTrackers(key: string | undefined, value: unknown): void;
|
|
35
|
-
/** @private */
|
|
36
|
-
readonly _accessorGetter: Record<string, (value: unknown, propertyName: string) => unknown>;
|
|
37
|
-
/** @private */
|
|
38
|
-
readonly _accessorSetter: Record<string, (newValue: unknown, oldValue: unknown, propertyName: string) => unknown>;
|
|
39
37
|
/**
|
|
40
38
|
* Map with keys for any properties that have changed since the last
|
|
41
39
|
* update cycle with previous values.
|
|
@@ -46,20 +44,7 @@ export declare class ControllerManager extends GenericController<undefined> {
|
|
|
46
44
|
*
|
|
47
45
|
* @private
|
|
48
46
|
*/
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Configure a getter or setter for a given \@property/\@state
|
|
52
|
-
*
|
|
53
|
-
* Since props are defined on the prototype, they are shared between all
|
|
54
|
-
* instances of a component. Thus, instead of passing a reference to the
|
|
55
|
-
* getter/setter function, you should update the
|
|
56
|
-
* ComponentInternals.getters/setters properties, and then call getSetProxy
|
|
57
|
-
* to apply the changes to the prototype
|
|
58
|
-
*
|
|
59
|
-
* @deprecated
|
|
60
|
-
*/
|
|
61
|
-
private _getSetProxy;
|
|
62
|
-
private _exportsStore;
|
|
47
|
+
_changedProperties?: PropertyValues;
|
|
63
48
|
/**
|
|
64
49
|
* Associate an exports object with a controller for reverse lookup in
|
|
65
50
|
* controller.use
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export { makeAccessorController, AccessorController, accessorSupport } from './useAccessor';
|
|
2
1
|
export { reEmitEvent } from './reEmitEvent';
|
|
2
|
+
export { makeAccessorController, AccessorController, reCreateAccessor, makeBinderProxy, getAccessorControllerBoundProperties, } from './useAccessor';
|
|
3
|
+
export { createStore, createLegacyStore } from './store';
|
|
4
|
+
export type { ObservableMap } from './store';
|