@arcgis/lumina 5.0.0-next.8 → 5.0.0-next.81
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-ftAEcdmI.js → Controller-DDyB41GY.js} +1 -1
- package/dist/{ControllerInternals-CWQrfEA8.js → ControllerInternals-By6dhpY-.js} +2 -2
- package/dist/ControllerManager-LzfJtMG7.js +185 -0
- package/dist/LitElement.d.ts +6 -6
- package/dist/context.js +1 -1
- package/dist/controllers/Controller.d.ts +3 -3
- package/dist/controllers/ControllerInternals.d.ts +5 -5
- package/dist/controllers/ControllerManager.d.ts +4 -6
- package/dist/controllers/accessor/index.d.ts +4 -4
- package/dist/controllers/accessor/index.js +3 -3
- package/dist/controllers/accessor/reEmitEvent.d.ts +1 -1
- package/dist/controllers/accessor/store.d.ts +1 -1
- package/dist/controllers/accessor/useAccessor.d.ts +3 -3
- package/dist/controllers/functional.d.ts +2 -2
- package/dist/controllers/index.d.ts +29 -20
- package/dist/controllers/index.js +18 -9
- package/dist/controllers/load.d.ts +1 -1
- package/dist/controllers/proxyExports.d.ts +2 -2
- package/dist/controllers/trackKey.d.ts +2 -2
- package/dist/controllers/trackPropKey.d.ts +1 -1
- package/dist/controllers/trackPropertyKey.d.ts +2 -2
- package/dist/controllers/types.d.ts +1 -1
- package/dist/controllers/useDirection.d.ts +1 -1
- package/dist/controllers/useMedia.d.ts +1 -1
- package/dist/controllers/usePropertyChange.d.ts +3 -3
- package/dist/controllers/useT9n.d.ts +1 -1
- package/dist/controllers/useWatchAttributes.d.ts +2 -2
- package/dist/controllers/utils.d.ts +2 -2
- package/dist/createEvent.d.ts +1 -1
- package/dist/decorators.d.ts +1 -1
- package/dist/devOnlyDetectIncorrectLazyUsages.d.ts +1 -1
- package/dist/hmrSupport.js +1 -1
- package/dist/index.d.ts +16 -16
- package/dist/index.js +9 -179
- package/dist/jsx/baseTypes.d.ts +4 -4
- package/dist/jsx/directives.d.ts +3 -3
- package/dist/jsx/generatedTypes.d.ts +817 -539
- package/dist/jsx/types.d.ts +2 -2
- package/dist/{lazyLoad-BlK67lvm.js → lazyLoad-DjHR4rq8.js} +10 -4
- package/dist/lazyLoad.d.ts +3 -3
- package/dist/lifecycleSupport.d.ts +1 -1
- package/dist/makeRuntime.d.ts +2 -2
- package/dist/{proxyExports-D906TEtL.js → proxyExports-BH_3cSmm.js} +2 -2
- package/dist/render.d.ts +1 -1
- package/dist/tests/wrappersUtils.typeTest.d.ts +1 -0
- package/dist/typings/jsxGlobals.d.ts +1 -1
- package/dist/utils.d.ts +14 -9
- package/package.json +4 -3
- package/dist/controllers/tests/autoDestroyMock.d.ts +0 -5
- package/dist/controllers/tests/utils.d.ts +0 -1
- package/dist/runtime.d.ts +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { safeCall, isEsriInternalEnv, safeAsyncCall } from "@arcgis/toolkit/error";
|
|
2
|
-
import { r as retrieveComponent, d as retrieveParentControllers, b as setParentController,
|
|
2
|
+
import { r as retrieveComponent, d as retrieveParentControllers, b as setParentController, a as setAmbientComponent, u as use, k as useRef, l as useRefSync, c as controllerSymbol } from "./ControllerInternals-By6dhpY-.js";
|
|
3
3
|
import { nothing } from "lit";
|
|
4
4
|
import { Deferred } from "@arcgis/toolkit/promise";
|
|
5
5
|
const trackPropertyKey = (object, onResolved, defaultValue) => {
|
|
@@ -115,7 +115,7 @@ const bypassReadOnly = (callback) => {
|
|
|
115
115
|
};
|
|
116
116
|
const bypassSetter = bypassReadOnly;
|
|
117
117
|
export {
|
|
118
|
-
|
|
118
|
+
setAmbientComponent as a,
|
|
119
119
|
setParentController as b,
|
|
120
120
|
controllerSymbol as c,
|
|
121
121
|
retrieveParentControllers as d,
|
|
@@ -128,6 +128,6 @@ export {
|
|
|
128
128
|
useRef as k,
|
|
129
129
|
useRefSync as l,
|
|
130
130
|
retrieveComponent as r,
|
|
131
|
-
|
|
131
|
+
shouldBypassReadOnly as s,
|
|
132
132
|
use as u
|
|
133
133
|
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { safeCall, isEsriInternalEnv } from "@arcgis/toolkit/error";
|
|
2
|
+
import { G as GenericController, p as propertyTrackResolve } from "./Controller-DDyB41GY.js";
|
|
3
|
+
import { nothing, LitElement as LitElement$1 } from "lit";
|
|
4
|
+
import { devToolsAwareTimeout } from "@arcgis/toolkit/promise";
|
|
5
|
+
import { a as setAmbientComponent } from "./ControllerInternals-By6dhpY-.js";
|
|
6
|
+
class ControllerManager extends GenericController {
|
|
7
|
+
constructor(component) {
|
|
8
|
+
super(component);
|
|
9
|
+
this.destroyed = false;
|
|
10
|
+
this.R = false;
|
|
11
|
+
this.V = nothing;
|
|
12
|
+
this.T = [];
|
|
13
|
+
this.#exportsStore = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
this.#component = component;
|
|
15
|
+
this.exports = void 0;
|
|
16
|
+
this.hasDestroy = autoDestroyDisabledPropName in component && typeof component.destroy === "function";
|
|
17
|
+
LitElement$1.prototype.addController.call(component, {
|
|
18
|
+
// Lit will call these callbacks
|
|
19
|
+
// We do not directly implement hostConnected and etc on ControllerManager
|
|
20
|
+
// because ControllerManager is also included in the list of controllers
|
|
21
|
+
// we manage - and for each controller we manage we call hostConnected
|
|
22
|
+
// (from inside of .triggerConnected). So there would be an infinite
|
|
23
|
+
// loop if Lit calls hostConnected which in turn calls
|
|
24
|
+
// triggerConnected which calls hostConnected again.
|
|
25
|
+
hostConnected: () => {
|
|
26
|
+
if (this.destroyed) {
|
|
27
|
+
const tagName = component.el.localName;
|
|
28
|
+
component.el.remove();
|
|
29
|
+
throw new Error(
|
|
30
|
+
`The ${tagName} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${autoDestroyDisabledPropName} prop.`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
if (this.#autoDestroyTimeout !== void 0) {
|
|
34
|
+
clearTimeout(this.#autoDestroyTimeout);
|
|
35
|
+
}
|
|
36
|
+
propertyTrackResolve();
|
|
37
|
+
for (const controller of component.M) {
|
|
38
|
+
if ("triggerConnected" in controller) {
|
|
39
|
+
controller.triggerConnected();
|
|
40
|
+
} else {
|
|
41
|
+
safeCall(controller.hostConnected, controller);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
hostDisconnected: () => {
|
|
46
|
+
for (const controller of component.M) {
|
|
47
|
+
if ("triggerDisconnected" in controller) {
|
|
48
|
+
controller.triggerDisconnected();
|
|
49
|
+
} else {
|
|
50
|
+
safeCall(controller.hostDisconnected, controller);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (this.hasDestroy && !this.destroyed) {
|
|
54
|
+
this.U();
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
hostUpdate: () => {
|
|
58
|
+
for (const controller of component.M) {
|
|
59
|
+
if ("triggerUpdate" in controller) {
|
|
60
|
+
controller.triggerUpdate(this.Q);
|
|
61
|
+
} else {
|
|
62
|
+
safeCall(controller.hostUpdate, controller, this.Q);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
hostUpdated: () => {
|
|
67
|
+
for (const controller of component.M) {
|
|
68
|
+
if ("triggerUpdated" in controller) {
|
|
69
|
+
controller.triggerUpdated(this.Q);
|
|
70
|
+
} else {
|
|
71
|
+
safeCall(controller.hostUpdated, controller, this.Q);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
this.Q = void 0;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
queueMicrotask(() => this.R = true);
|
|
78
|
+
setAmbientComponent(component);
|
|
79
|
+
}
|
|
80
|
+
#autoDestroyTimeout;
|
|
81
|
+
#component;
|
|
82
|
+
// Keep this method async needlessly for now to avoid a breaking change if we
|
|
83
|
+
// would need to make it async in the future
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
85
|
+
async destroy() {
|
|
86
|
+
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
|
|
87
|
+
this.devOnly$ensureHasDestroy?.();
|
|
88
|
+
}
|
|
89
|
+
if (this.destroyed) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (this.#component.el.isConnected) {
|
|
93
|
+
this.hasDestroy = false;
|
|
94
|
+
this.#component.el.remove();
|
|
95
|
+
}
|
|
96
|
+
this.#autoDestroyTimeout = void 0;
|
|
97
|
+
this.destroyed = true;
|
|
98
|
+
for (const controller of this.#component.M) {
|
|
99
|
+
if ("triggerDestroy" in controller) {
|
|
100
|
+
controller.triggerDestroy();
|
|
101
|
+
} else {
|
|
102
|
+
safeCall(controller.hostDestroy, controller);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
this.#component.M.splice(0);
|
|
106
|
+
}
|
|
107
|
+
/** @private */
|
|
108
|
+
U() {
|
|
109
|
+
if (this.#autoDestroyTimeout !== void 0) {
|
|
110
|
+
clearTimeout(this.#autoDestroyTimeout);
|
|
111
|
+
}
|
|
112
|
+
if (!this.#component.el.isConnected && !this.#component.autoDestroyDisabled) {
|
|
113
|
+
const destroy = () => void this.#component.destroy();
|
|
114
|
+
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && autoDestroyOnDisconnectTimeout === 0) {
|
|
115
|
+
queueMicrotask(destroy);
|
|
116
|
+
} else {
|
|
117
|
+
this.#autoDestroyTimeout = devToolsAwareTimeout(destroy, autoDestroyOnDisconnectTimeout);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** @private */
|
|
122
|
+
S(key, value) {
|
|
123
|
+
const trackers = this.T;
|
|
124
|
+
this.V = nothing;
|
|
125
|
+
this.T = [];
|
|
126
|
+
trackers.forEach((tracker) => tracker(key, value));
|
|
127
|
+
}
|
|
128
|
+
#exportsStore;
|
|
129
|
+
/**
|
|
130
|
+
* Associate an exports object with a controller for reverse lookup in
|
|
131
|
+
* controller.use
|
|
132
|
+
*
|
|
133
|
+
* @private
|
|
134
|
+
*/
|
|
135
|
+
W(controller, exports) {
|
|
136
|
+
if (typeof exports === "object" && exports !== null || typeof exports === "function") {
|
|
137
|
+
this.#exportsStore.set(exports, controller);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/** @private */
|
|
141
|
+
X(exports) {
|
|
142
|
+
if (typeof exports === "object" && exports !== null || typeof exports === "function") {
|
|
143
|
+
return this.#exportsStore.get(exports);
|
|
144
|
+
} else {
|
|
145
|
+
return void 0;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
|
|
150
|
+
ControllerManager.prototype.devOnly$ensureHasDestroy = function ensureHasDestroy() {
|
|
151
|
+
if (!this.hasDestroy) {
|
|
152
|
+
throw new Error(
|
|
153
|
+
`
|
|
154
|
+
If the component uses a controller that uses destroy() method, then the
|
|
155
|
+
component must have the following properties:
|
|
156
|
+
/**
|
|
157
|
+
* If true, the component will not be destroyed automatically when it is
|
|
158
|
+
* disconnected from the document. This is useful when you want to move the
|
|
159
|
+
* component to a different place on the page, or temporarily hide it. If this
|
|
160
|
+
* is set, make sure to call the \`destroy\` method when you are done to prevent
|
|
161
|
+
* memory leaks.
|
|
162
|
+
*/
|
|
163
|
+
@property() ${autoDestroyDisabledPropName} = false;
|
|
164
|
+
|
|
165
|
+
/** Permanently destroy the component */
|
|
166
|
+
@method()
|
|
167
|
+
async destroy(): Promise<void> {
|
|
168
|
+
await this.manager.destroy();
|
|
169
|
+
}
|
|
170
|
+
`.trim().split("\n").map((line) => line.trim()).join("\n")
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
let autoDestroyOnDisconnectTimeout = 1e3;
|
|
176
|
+
const autoDestroyDisabledPropName = "autoDestroyDisabled";
|
|
177
|
+
function setAutoDestroyOnDisconnectTimeout(timeout) {
|
|
178
|
+
autoDestroyOnDisconnectTimeout = timeout;
|
|
179
|
+
}
|
|
180
|
+
export {
|
|
181
|
+
ControllerManager as C,
|
|
182
|
+
autoDestroyDisabledPropName as a,
|
|
183
|
+
autoDestroyOnDisconnectTimeout as b,
|
|
184
|
+
setAutoDestroyOnDisconnectTimeout as s
|
|
185
|
+
};
|
package/dist/LitElement.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CSSResultGroup, CSSResultOrNative, PropertyValues, ReactiveController, LitElement as OriginalLitElement } from 'lit';
|
|
2
|
-
import { Runtime } from './makeRuntime';
|
|
3
|
-
import { ProxyComponent } from './lazyLoad';
|
|
4
|
-
import { ToElement } from './jsx/types';
|
|
5
|
-
import { BaseController, LuminaPropertyDeclaration } from './controllers/types';
|
|
6
|
-
import { ControllerManager } from './controllers/ControllerManager';
|
|
7
|
-
import { Controller } from './controllers/Controller';
|
|
2
|
+
import { Runtime } from './makeRuntime.ts';
|
|
3
|
+
import { ProxyComponent } from './lazyLoad.ts';
|
|
4
|
+
import { ToElement } from './jsx/types.ts';
|
|
5
|
+
import { BaseController, LuminaPropertyDeclaration } from './controllers/types.ts';
|
|
6
|
+
import { ControllerManager } from './controllers/ControllerManager.ts';
|
|
7
|
+
import { Controller } from './controllers/Controller.ts';
|
|
8
8
|
type ComponentLifecycle = {
|
|
9
9
|
connectedCallback?: () => void;
|
|
10
10
|
disconnectedCallback?: () => void;
|
package/dist/context.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContextProvider, ContextConsumer } from "@lit/context";
|
|
2
|
-
import { r as retrieveComponent } from "./ControllerInternals-
|
|
2
|
+
import { r as retrieveComponent } from "./ControllerInternals-By6dhpY-.js";
|
|
3
3
|
const useContextProvider = (options) => {
|
|
4
4
|
const component = retrieveComponent();
|
|
5
5
|
const controller = new ContextProvider(component.el, options);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Deferred } from '@arcgis/toolkit/promise';
|
|
2
|
-
import { BaseController, ControllerLifecycleMethods, controllerSymbol } from './types';
|
|
3
|
-
import { use, useRef, useRefSync } from './ControllerInternals';
|
|
2
|
+
import { BaseController, ControllerLifecycleMethods, controllerSymbol } from './types.ts';
|
|
3
|
+
import { use, useRef, useRefSync } from './ControllerInternals.ts';
|
|
4
4
|
import { PropertyValues } from 'lit';
|
|
5
|
-
import { LitElement } from '../LitElement';
|
|
5
|
+
import { LitElement } from '../LitElement.ts';
|
|
6
6
|
/**
|
|
7
7
|
* Base class for Controllers defined using a class rather than a function.
|
|
8
8
|
* Defining controller using makeController() function is more succinct for smaller
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Controller } from './Controller';
|
|
2
|
-
import { BaseController } from './types';
|
|
3
|
-
import { LitElement } from '../LitElement';
|
|
1
|
+
import { Controller } from './Controller.ts';
|
|
2
|
+
import { BaseController } from './types.ts';
|
|
3
|
+
import { LitElement } from '../LitElement.ts';
|
|
4
4
|
export declare const setAmbientComponent: (component: LitElement) => void;
|
|
5
5
|
export declare const retrieveComponent: (name?: string) => LitElement;
|
|
6
6
|
export declare const setParentController: (controller: BaseController | undefined) => void;
|
|
@@ -22,11 +22,11 @@ export declare let shouldBypassReadOnly: boolean;
|
|
|
22
22
|
/**
|
|
23
23
|
* Permits updating read-only properties
|
|
24
24
|
*
|
|
25
|
-
* @see https://
|
|
25
|
+
* @see https://webgis.esri.com/references/lumina/properties#read-only-properties
|
|
26
26
|
*/
|
|
27
27
|
export declare const bypassReadOnly: <T = void>(callback: () => T) => T | void;
|
|
28
28
|
/**
|
|
29
|
-
* @deprecated see https://
|
|
29
|
+
* @deprecated see https://webgis.esri.com/references/lumina/properties#get-set-properties
|
|
30
30
|
*/
|
|
31
31
|
export declare const bypassSetter: <T = void>(callback: () => T) => T | void;
|
|
32
32
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BaseController } from './types';
|
|
2
|
-
import { GenericController } from './Controller';
|
|
1
|
+
import { BaseController } from './types.ts';
|
|
2
|
+
import { GenericController } from './Controller.ts';
|
|
3
3
|
import { PropertyValues } from 'lit';
|
|
4
|
-
import { LitElement } from '../LitElement';
|
|
4
|
+
import { LitElement } from '../LitElement.ts';
|
|
5
5
|
/**
|
|
6
6
|
* A manager for all other controllers. It finds all controllers on the
|
|
7
7
|
* component, loads them, and forwards lifecycle events to them.
|
|
@@ -57,9 +57,7 @@ export declare class ControllerManager extends GenericController<undefined> {
|
|
|
57
57
|
}
|
|
58
58
|
export declare let autoDestroyOnDisconnectTimeout: number;
|
|
59
59
|
export declare const autoDestroyDisabledPropName = "autoDestroyDisabled";
|
|
60
|
-
export declare
|
|
61
|
-
setAutoDestroyOnDisconnectTimeout: (timeout: number) => void;
|
|
62
|
-
} | undefined;
|
|
60
|
+
export declare function setAutoDestroyOnDisconnectTimeout(timeout: number): void;
|
|
63
61
|
export type LuminaLifecycles = {
|
|
64
62
|
connectedCallback?: LitElement["connectedCallback"];
|
|
65
63
|
disconnectedCallback?: LitElement["disconnectedCallback"];
|
|
@@ -1,4 +1,4 @@
|
|
|
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';
|
|
1
|
+
export { reEmitEvent } from './reEmitEvent.ts';
|
|
2
|
+
export { makeAccessorController, AccessorController, reCreateAccessor, makeBinderProxy, getAccessorControllerBoundProperties, } from './useAccessor.ts';
|
|
3
|
+
export { createStore, createLegacyStore } from './store.ts';
|
|
4
|
+
export type { ObservableMap } from './store.ts';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isEsriInternalEnv } from "@arcgis/toolkit/error";
|
|
2
|
-
import { r as retrieveComponent } from "../../ControllerInternals-
|
|
2
|
+
import { r as retrieveComponent } from "../../ControllerInternals-By6dhpY-.js";
|
|
3
3
|
import { on, watch } from "@arcgis/core/core/reactiveUtils.js";
|
|
4
|
-
import { a as createEventFactory, G as GenericController, d as trackPropKey, t as trackKey } from "../../Controller-
|
|
5
|
-
import { p as proxyExports } from "../../proxyExports-
|
|
4
|
+
import { a as createEventFactory, G as GenericController, d as trackPropKey, t as trackKey } from "../../Controller-DDyB41GY.js";
|
|
5
|
+
import { p as proxyExports } from "../../proxyExports-BH_3cSmm.js";
|
|
6
6
|
import { createObservable, trackAccess } from "@arcgis/core/applications/Components/reactiveUtils.js";
|
|
7
7
|
import { property, subclass } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
8
8
|
import Accessor from "@arcgis/core/core/Accessor.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as Accessor } from '@arcgis/core/core/Accessor.js';
|
|
2
2
|
/**
|
|
3
|
-
* See https://
|
|
3
|
+
* See https://webgis.esri.com/references/lumina/controllers/useAccessor#createstore-utility
|
|
4
4
|
*/
|
|
5
5
|
export declare const createStore: <T extends object>(initializer: T | (() => T)) => __esri.Accessor & T;
|
|
6
6
|
/** @deprecated Use {@link createStore} instead */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GenericController } from '../Controller';
|
|
2
|
-
import { LitElement } from '../../LitElement';
|
|
1
|
+
import { GenericController } from '../Controller.ts';
|
|
2
|
+
import { LitElement } from '../../LitElement.ts';
|
|
3
3
|
type Requires<Props, Accessor extends __esri.Accessor, OmitProps extends string = never> = LitElement & Omit<Pick<Accessor, keyof Accessor & keyof Props>, AlwaysOmit | OmitProps> & {
|
|
4
4
|
autoDestroyDisabled: boolean;
|
|
5
5
|
destroy: () => Promise<void>;
|
|
@@ -9,7 +9,7 @@ type AlwaysOmit = "addHandles" | "declaredClass" | "destroyed" | "hasHandles" |
|
|
|
9
9
|
* Given an Accessor class, create a controller that will do two-way binding of
|
|
10
10
|
* props between the component and the Accessor.
|
|
11
11
|
*
|
|
12
|
-
* See https://
|
|
12
|
+
* See https://webgis.esri.com/references/lumina/controllers/useAccessor for
|
|
13
13
|
* documentation & examples.
|
|
14
14
|
*/
|
|
15
15
|
export declare const makeAccessorController: <Props, Accessor extends __esri.Accessor, OmitProps extends string = never>(createInstance: ((props?: Props) => Accessor) | (new (props?: Props) => Accessor), _options?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LitElement } from '../LitElement';
|
|
2
|
-
import { GenericControllerType, Controller } from './Controller';
|
|
1
|
+
import { LitElement } from '../LitElement.ts';
|
|
2
|
+
import { GenericControllerType, Controller } from './Controller.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Controller is a function that takes a component instance and then can
|
|
5
5
|
* export some values to the component, or hook into component's lifecycle
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { EventEmitter as _EventEmitter } from '../createEvent';
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export {
|
|
17
|
-
export
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
1
|
+
import { EventEmitter as _EventEmitter } from '../createEvent.ts';
|
|
2
|
+
import { setAutoDestroyOnDisconnectTimeout } from './ControllerManager.ts';
|
|
3
|
+
export type { GenericControllerType } from './Controller.ts';
|
|
4
|
+
export { Controller, GenericController } from './Controller.ts';
|
|
5
|
+
export type { ControllerManager } from './ControllerManager.ts';
|
|
6
|
+
export { retrieveComponent, bypassSetter, bypassReadOnly } from './ControllerInternals.ts';
|
|
7
|
+
export { trackPropertyKey, propertyTrackResolve } from './trackPropertyKey.ts';
|
|
8
|
+
export { trackPropKey } from './trackPropKey.ts';
|
|
9
|
+
export { trackKey } from './trackKey.ts';
|
|
10
|
+
export { makeController, makeGenericController } from './functional.ts';
|
|
11
|
+
export { useWatchAttributes } from './useWatchAttributes.ts';
|
|
12
|
+
export { load } from './load.ts';
|
|
13
|
+
export { proxyExports } from './proxyExports.ts';
|
|
14
|
+
export { toFunction } from './toFunction.ts';
|
|
15
|
+
export * from './types.ts';
|
|
16
|
+
export { useMedia } from './useMedia.ts';
|
|
17
|
+
export { useDirection } from './useDirection.ts';
|
|
18
|
+
export type { UseT9n, T9nMeta } from './useT9n.ts';
|
|
19
|
+
export { makeT9nController } from './useT9n.ts';
|
|
20
|
+
export { usePropertyChange } from './usePropertyChange.ts';
|
|
21
|
+
export { isController, getControllersCount } from './utils.ts';
|
|
21
22
|
/**
|
|
22
23
|
* @deprecated import from "@arcgis/lumina" instead
|
|
23
24
|
*/
|
|
@@ -26,3 +27,11 @@ export type EventEmitter<T = undefined> = _EventEmitter<T>;
|
|
|
26
27
|
* @deprecated Let us know if someone is using this
|
|
27
28
|
*/
|
|
28
29
|
export declare const keyTrackResolve: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
export declare const exportsForTests: {
|
|
34
|
+
setAmbientComponent: (component: import('../LitElement.ts').LitElement) => void;
|
|
35
|
+
autoDestroyOnDisconnectTimeout: number;
|
|
36
|
+
setAutoDestroyOnDisconnectTimeout: typeof setAutoDestroyOnDisconnectTimeout;
|
|
37
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { C as Controller, t as trackKey, a as createEventFactory, p as propertyTrackResolve } from "../Controller-
|
|
2
|
-
import { G, d, b } from "../Controller-
|
|
3
|
-
import {
|
|
4
|
-
import { f, e, c, h, g } from "../ControllerInternals-
|
|
5
|
-
import { p as proxyExports } from "../proxyExports-
|
|
1
|
+
import { C as Controller, t as trackKey, a as createEventFactory, p as propertyTrackResolve } from "../Controller-DDyB41GY.js";
|
|
2
|
+
import { G, d, b } from "../Controller-DDyB41GY.js";
|
|
3
|
+
import { a as setAmbientComponent, i as isPromise, b as setParentController, d as retrieveParentControllers, r as retrieveComponent } from "../ControllerInternals-By6dhpY-.js";
|
|
4
|
+
import { f, e, c, h, g } from "../ControllerInternals-By6dhpY-.js";
|
|
5
|
+
import { p as proxyExports } from "../proxyExports-BH_3cSmm.js";
|
|
6
6
|
import { isServer } from "lit";
|
|
7
7
|
import { isEsriInternalEnv } from "@arcgis/toolkit/error";
|
|
8
8
|
import { observeAncestorsMutation, getElementAttribute } from "@arcgis/toolkit/dom";
|
|
9
9
|
import { getElementLocale, startLocaleObserver } from "@arcgis/toolkit/intl";
|
|
10
|
+
import { s as setAutoDestroyOnDisconnectTimeout, b as autoDestroyOnDisconnectTimeout } from "../ControllerManager-LzfJtMG7.js";
|
|
10
11
|
const makeController = (constructor) => proxy(void 0, constructor);
|
|
11
12
|
const makeGenericController = (constructor) => (component) => proxy(
|
|
12
13
|
component,
|
|
@@ -197,10 +198,12 @@ const deepMerge = (original, overwrites) => {
|
|
|
197
198
|
}
|
|
198
199
|
const merged = { ...original };
|
|
199
200
|
Object.entries(overwrites).forEach(([key, value]) => {
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
if (original[key] !== void 0) {
|
|
202
|
+
if (typeof value === "object") {
|
|
203
|
+
merged[key] = deepMerge(original[key], value);
|
|
204
|
+
} else {
|
|
205
|
+
merged[key] = value ?? original[key];
|
|
206
|
+
}
|
|
204
207
|
}
|
|
205
208
|
});
|
|
206
209
|
return merged;
|
|
@@ -249,12 +252,18 @@ const propertyChangeController = (...toWatch) => {
|
|
|
249
252
|
return eventEmitter;
|
|
250
253
|
};
|
|
251
254
|
const keyTrackResolve = propertyTrackResolve;
|
|
255
|
+
const exportsForTests = {
|
|
256
|
+
setAmbientComponent,
|
|
257
|
+
autoDestroyOnDisconnectTimeout,
|
|
258
|
+
setAutoDestroyOnDisconnectTimeout
|
|
259
|
+
};
|
|
252
260
|
export {
|
|
253
261
|
Controller,
|
|
254
262
|
G as GenericController,
|
|
255
263
|
f as bypassReadOnly,
|
|
256
264
|
e as bypassSetter,
|
|
257
265
|
c as controllerSymbol,
|
|
266
|
+
exportsForTests,
|
|
258
267
|
h as getControllersCount,
|
|
259
268
|
g as isController,
|
|
260
269
|
keyTrackResolve,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Load a value from a promise and provide it to the component
|
|
3
3
|
*
|
|
4
|
-
* Documentation: https://
|
|
4
|
+
* Documentation: https://webgis.esri.com/references/lumina/controllers/load
|
|
5
5
|
*/
|
|
6
6
|
export declare const load: <T>(loader: () => Promise<T>) => T;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Controller } from './Controller';
|
|
2
|
-
import { ControllerLifecycleMethods } from './types';
|
|
1
|
+
import { Controller } from './Controller.ts';
|
|
2
|
+
import { ControllerLifecycleMethods } from './types.ts';
|
|
3
3
|
/**
|
|
4
4
|
* If you wish to directly expose the "exports" property of your controller,
|
|
5
5
|
* rather than the entire controller class, wrap your class definition in
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LitElement } from '../LitElement';
|
|
2
|
-
import { BaseController, TrackKeyResolution } from './types';
|
|
1
|
+
import { LitElement } from '../LitElement.ts';
|
|
2
|
+
import { BaseController, TrackKeyResolution } from './types.ts';
|
|
3
3
|
/**
|
|
4
4
|
* A combination of trackPropertyKey() and trackPropKey(). For usage when
|
|
5
5
|
* you want to track a property, but don't know if it will be defined with the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LitElement } from '../LitElement';
|
|
2
|
-
import { BaseController } from './types';
|
|
1
|
+
import { LitElement } from '../LitElement.ts';
|
|
2
|
+
import { BaseController } from './types.ts';
|
|
3
3
|
/**
|
|
4
4
|
* A magical solution to finding out what property name a given controller
|
|
5
5
|
* on a given object was assigned to.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IHandle } from '@arcgis/toolkit/type';
|
|
2
2
|
import { ReactiveControllerHost, ReactiveController, PropertyDeclaration, PropertyValues } from 'lit';
|
|
3
|
-
import { LitElement } from '../LitElement';
|
|
3
|
+
import { LitElement } from '../LitElement.ts';
|
|
4
4
|
export type TrackKeyResolution = {
|
|
5
5
|
readonly key: string;
|
|
6
6
|
readonly host: BaseController | LitElement;
|
|
@@ -3,7 +3,7 @@ type Direction = "ltr" | "rtl";
|
|
|
3
3
|
* Finds the closest "dir" attribute to current component and returns it's value.
|
|
4
4
|
* Watches for changes to "dir" and will re-render your component if needed.
|
|
5
5
|
*
|
|
6
|
-
* Documentation: https://
|
|
6
|
+
* Documentation: https://webgis.esri.com/references/lumina/controllers/useDirection
|
|
7
7
|
*
|
|
8
8
|
* Design decisions: https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/987
|
|
9
9
|
*/
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* whether user asked to use reduced motion, or whether the screen size is above
|
|
4
4
|
* certain threshold).
|
|
5
5
|
*
|
|
6
|
-
* Documentation: https://
|
|
6
|
+
* Documentation: https://webgis.esri.com/references/lumina/controllers/useMedia
|
|
7
7
|
*/
|
|
8
8
|
export declare const useMedia: (query: string) => boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { EventEmitter } from '../createEvent';
|
|
2
|
-
import { LitElement } from '../LitElement';
|
|
1
|
+
import { EventEmitter } from '../createEvent.ts';
|
|
2
|
+
import { LitElement } from '../LitElement.ts';
|
|
3
3
|
type PropertyChangeController<Component extends LitElement> = <ToWatch extends keyof Component>(...toWatch: ToWatch[]) => EventEmitter<{
|
|
4
4
|
name: ToWatch & string;
|
|
5
5
|
}>;
|
|
6
6
|
/**
|
|
7
7
|
* Let user easily set watchers for component properties.
|
|
8
8
|
*
|
|
9
|
-
* Documentation: https://
|
|
9
|
+
* Documentation: https://webgis.esri.com/references/lumina/controllers/usePropertyChange
|
|
10
10
|
*/
|
|
11
11
|
export declare const usePropertyChange: <Component extends LitElement>(
|
|
12
12
|
/** Needed for typings only */
|
|
@@ -38,7 +38,7 @@ export interface UseT9n {
|
|
|
38
38
|
/**
|
|
39
39
|
* Load component's localization strings.
|
|
40
40
|
*
|
|
41
|
-
* Documentation: https://
|
|
41
|
+
* Documentation: https://webgis.esri.com/references/lumina/controllers/useT9n
|
|
42
42
|
*
|
|
43
43
|
* Design decisions:
|
|
44
44
|
* - https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/969
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Controller } from './Controller';
|
|
1
|
+
import { Controller } from './Controller.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Watch when given attributes change on the component element.
|
|
4
4
|
*
|
|
5
|
-
* Documentation: https://
|
|
5
|
+
* Documentation: https://webgis.esri.com/references/lumina/controllers/useWatchAttributes
|
|
6
6
|
*/
|
|
7
7
|
export declare const useWatchAttributes: <T extends string>(attributes: readonly T[], callback: (newValue: string | null, oldValue: string | null, attribute: T) => void) => Controller;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LitElement } from '../LitElement';
|
|
2
|
-
import { ControllerLifecycleMethods } from './types';
|
|
1
|
+
import { LitElement } from '../LitElement.ts';
|
|
2
|
+
import { ControllerLifecycleMethods } from './types.ts';
|
|
3
3
|
export declare const isController: (value: unknown) => value is ControllerLifecycleMethods;
|
|
4
4
|
/**
|
|
5
5
|
* Checks if the argument is a promise by checking if it has a `then` method.
|
package/dist/createEvent.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export type EventOptions = {
|
|
|
32
32
|
*/
|
|
33
33
|
composed?: boolean;
|
|
34
34
|
};
|
|
35
|
-
export declare const createEventFactory: <T = void>(eventName?: string, options?: EventOptions, component?: import('./LitElement').LitElement) => EventEmitter<T>;
|
|
35
|
+
export declare const createEventFactory: <T = void>(eventName?: string, options?: EventOptions, component?: import('./LitElement.ts').LitElement) => EventEmitter<T>;
|
|
36
36
|
/**
|
|
37
37
|
* Creates an event emitter.
|
|
38
38
|
* Events emitted by your component will be included in the documentation.
|
package/dist/decorators.d.ts
CHANGED
package/dist/hmrSupport.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as noShadowRoot, P as ProxyComponent } from "./lazyLoad-
|
|
1
|
+
import { n as noShadowRoot, P as ProxyComponent } from "./lazyLoad-DjHR4rq8.js";
|
|
2
2
|
import { camelToKebab } from "@arcgis/toolkit/string";
|
|
3
3
|
function handleHmrUpdate(newModules) {
|
|
4
4
|
newModules.forEach((newModule) => {
|