@arcgis/lumina 5.0.0-next.74 → 5.0.0-next.75
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/context.js +1 -1
- package/dist/controllers/ControllerManager.d.ts +1 -3
- package/dist/controllers/accessor/index.js +3 -3
- package/dist/controllers/index.d.ts +9 -0
- package/dist/controllers/index.js +12 -5
- package/dist/hmrSupport.js +1 -1
- package/dist/index.js +9 -179
- package/dist/{lazyLoad-BlK67lvm.js → lazyLoad-DjHR4rq8.js} +10 -4
- package/dist/{proxyExports-D906TEtL.js → proxyExports-BH_3cSmm.js} +2 -2
- package/dist/tests/wrappersUtils.typeTest.d.ts +1 -0
- package/dist/utils.d.ts +2 -2
- package/package.json +2 -2
- 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/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);
|
|
@@ -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,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,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter as _EventEmitter } from '../createEvent.ts';
|
|
2
|
+
import { setAutoDestroyOnDisconnectTimeout } from './ControllerManager.ts';
|
|
2
3
|
export type { GenericControllerType } from './Controller.ts';
|
|
3
4
|
export { Controller, GenericController } from './Controller.ts';
|
|
4
5
|
export type { ControllerManager } from './ControllerManager.ts';
|
|
@@ -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,
|
|
@@ -251,12 +252,18 @@ const propertyChangeController = (...toWatch) => {
|
|
|
251
252
|
return eventEmitter;
|
|
252
253
|
};
|
|
253
254
|
const keyTrackResolve = propertyTrackResolve;
|
|
255
|
+
const exportsForTests = {
|
|
256
|
+
setAmbientComponent,
|
|
257
|
+
autoDestroyOnDisconnectTimeout,
|
|
258
|
+
setAutoDestroyOnDisconnectTimeout
|
|
259
|
+
};
|
|
254
260
|
export {
|
|
255
261
|
Controller,
|
|
256
262
|
G as GenericController,
|
|
257
263
|
f as bypassReadOnly,
|
|
258
264
|
e as bypassSetter,
|
|
259
265
|
c as controllerSymbol,
|
|
266
|
+
exportsForTests,
|
|
260
267
|
h as getControllersCount,
|
|
261
268
|
g as isController,
|
|
262
269
|
keyTrackResolve,
|
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) => {
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c } from "./Controller-
|
|
1
|
+
import { p as propertyTrackResolve } from "./Controller-DDyB41GY.js";
|
|
2
|
+
import { c } from "./Controller-DDyB41GY.js";
|
|
3
3
|
import { state } from "lit/decorators/state.js";
|
|
4
4
|
import { property as property$1 } from "lit/decorators/property.js";
|
|
5
|
-
import { e as emptyFunction, n as noShadowRoot, a as attachToAncestor } from "./lazyLoad-
|
|
6
|
-
import { d, m } from "./lazyLoad-
|
|
7
|
-
import {
|
|
5
|
+
import { e as emptyFunction, n as noShadowRoot, a as attachToAncestor } from "./lazyLoad-DjHR4rq8.js";
|
|
6
|
+
import { d, m } from "./lazyLoad-DjHR4rq8.js";
|
|
7
|
+
import { isEsriInternalEnv, safeAsyncCall, safeCall } from "@arcgis/toolkit/error";
|
|
8
8
|
import { camelToKebab } from "@arcgis/toolkit/string";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { Deferred } from "@arcgis/toolkit/promise";
|
|
10
|
+
import { LitElement as LitElement$1, isServer, notEqual, noChange as noChange$1, nothing as nothing$1, render } from "lit";
|
|
11
|
+
import { c as controllerSymbol, s as shouldBypassReadOnly } from "./ControllerInternals-By6dhpY-.js";
|
|
12
|
+
import { C as ControllerManager, a as autoDestroyDisabledPropName } from "./ControllerManager-LzfJtMG7.js";
|
|
12
13
|
import { propertyFlagAttribute, propertyFlagNoAccessor, propertyFlagReadOnly, propertyFlagState, propertyFlagBoolean, propertyFlagNumber, propertyFlagReflect } from "./config.js";
|
|
13
14
|
import { classMap } from "lit/directives/class-map.js";
|
|
14
15
|
import { styleMap } from "lit/directives/style-map.js";
|
|
@@ -17,177 +18,6 @@ import { live as live$1 } from "lit/directives/live.js";
|
|
|
17
18
|
import { ref } from "lit/directives/ref.js";
|
|
18
19
|
const property = property$1;
|
|
19
20
|
const method = void 0;
|
|
20
|
-
class ControllerManager extends GenericController {
|
|
21
|
-
constructor(component) {
|
|
22
|
-
super(component);
|
|
23
|
-
this.destroyed = false;
|
|
24
|
-
this.R = false;
|
|
25
|
-
this.V = nothing$1;
|
|
26
|
-
this.T = [];
|
|
27
|
-
this.#exportsStore = /* @__PURE__ */ new WeakMap();
|
|
28
|
-
this.#component = component;
|
|
29
|
-
this.exports = void 0;
|
|
30
|
-
this.hasDestroy = autoDestroyDisabledPropName in component && typeof component.destroy === "function";
|
|
31
|
-
LitElement$1.prototype.addController.call(component, {
|
|
32
|
-
// Lit will call these callbacks
|
|
33
|
-
// We do not directly implement hostConnected and etc on ControllerManager
|
|
34
|
-
// because ControllerManager is also included in the list of controllers
|
|
35
|
-
// we manage - and for each controller we manage we call hostConnected
|
|
36
|
-
// (from inside of .triggerConnected). So there would be an infinite
|
|
37
|
-
// loop if Lit calls hostConnected which in turn calls
|
|
38
|
-
// triggerConnected which calls hostConnected again.
|
|
39
|
-
hostConnected: () => {
|
|
40
|
-
if (this.destroyed) {
|
|
41
|
-
const tagName = component.el.localName;
|
|
42
|
-
component.el.remove();
|
|
43
|
-
throw new Error(
|
|
44
|
-
`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.`
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
if (this.#autoDestroyTimeout !== void 0) {
|
|
48
|
-
clearTimeout(this.#autoDestroyTimeout);
|
|
49
|
-
}
|
|
50
|
-
propertyTrackResolve();
|
|
51
|
-
for (const controller of component.M) {
|
|
52
|
-
if ("triggerConnected" in controller) {
|
|
53
|
-
controller.triggerConnected();
|
|
54
|
-
} else {
|
|
55
|
-
safeCall(controller.hostConnected, controller);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
hostDisconnected: () => {
|
|
60
|
-
for (const controller of component.M) {
|
|
61
|
-
if ("triggerDisconnected" in controller) {
|
|
62
|
-
controller.triggerDisconnected();
|
|
63
|
-
} else {
|
|
64
|
-
safeCall(controller.hostDisconnected, controller);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (this.hasDestroy && !this.destroyed) {
|
|
68
|
-
this.U();
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
hostUpdate: () => {
|
|
72
|
-
for (const controller of component.M) {
|
|
73
|
-
if ("triggerUpdate" in controller) {
|
|
74
|
-
controller.triggerUpdate(this.Q);
|
|
75
|
-
} else {
|
|
76
|
-
safeCall(controller.hostUpdate, controller, this.Q);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
hostUpdated: () => {
|
|
81
|
-
for (const controller of component.M) {
|
|
82
|
-
if ("triggerUpdated" in controller) {
|
|
83
|
-
controller.triggerUpdated(this.Q);
|
|
84
|
-
} else {
|
|
85
|
-
safeCall(controller.hostUpdated, controller, this.Q);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
this.Q = void 0;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
queueMicrotask(() => this.R = true);
|
|
92
|
-
setAmbientComponent(component);
|
|
93
|
-
}
|
|
94
|
-
#autoDestroyTimeout;
|
|
95
|
-
#component;
|
|
96
|
-
// Keep this method async needlessly for now to avoid a breaking change if we
|
|
97
|
-
// would need to make it async in the future
|
|
98
|
-
// eslint-disable-next-line @typescript-eslint/require-await
|
|
99
|
-
async destroy() {
|
|
100
|
-
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
|
|
101
|
-
this.devOnly$ensureHasDestroy?.();
|
|
102
|
-
}
|
|
103
|
-
if (this.destroyed) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
if (this.#component.el.isConnected) {
|
|
107
|
-
this.hasDestroy = false;
|
|
108
|
-
this.#component.el.remove();
|
|
109
|
-
}
|
|
110
|
-
this.#autoDestroyTimeout = void 0;
|
|
111
|
-
this.destroyed = true;
|
|
112
|
-
for (const controller of this.#component.M) {
|
|
113
|
-
if ("triggerDestroy" in controller) {
|
|
114
|
-
controller.triggerDestroy();
|
|
115
|
-
} else {
|
|
116
|
-
safeCall(controller.hostDestroy, controller);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
this.#component.M.splice(0);
|
|
120
|
-
}
|
|
121
|
-
/** @private */
|
|
122
|
-
U() {
|
|
123
|
-
if (this.#autoDestroyTimeout !== void 0) {
|
|
124
|
-
clearTimeout(this.#autoDestroyTimeout);
|
|
125
|
-
}
|
|
126
|
-
if (!this.#component.el.isConnected && !this.#component.autoDestroyDisabled) {
|
|
127
|
-
const destroy = () => void this.#component.destroy();
|
|
128
|
-
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && autoDestroyOnDisconnectTimeout === 0) ;
|
|
129
|
-
else {
|
|
130
|
-
this.#autoDestroyTimeout = devToolsAwareTimeout(destroy, autoDestroyOnDisconnectTimeout);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
/** @private */
|
|
135
|
-
S(key, value) {
|
|
136
|
-
const trackers = this.T;
|
|
137
|
-
this.V = nothing$1;
|
|
138
|
-
this.T = [];
|
|
139
|
-
trackers.forEach((tracker) => tracker(key, value));
|
|
140
|
-
}
|
|
141
|
-
#exportsStore;
|
|
142
|
-
/**
|
|
143
|
-
* Associate an exports object with a controller for reverse lookup in
|
|
144
|
-
* controller.use
|
|
145
|
-
*
|
|
146
|
-
* @private
|
|
147
|
-
*/
|
|
148
|
-
W(controller, exports) {
|
|
149
|
-
if (typeof exports === "object" && exports !== null || typeof exports === "function") {
|
|
150
|
-
this.#exportsStore.set(exports, controller);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
/** @private */
|
|
154
|
-
X(exports) {
|
|
155
|
-
if (typeof exports === "object" && exports !== null || typeof exports === "function") {
|
|
156
|
-
return this.#exportsStore.get(exports);
|
|
157
|
-
} else {
|
|
158
|
-
return void 0;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
|
|
163
|
-
ControllerManager.prototype.devOnly$ensureHasDestroy = function ensureHasDestroy() {
|
|
164
|
-
if (!this.hasDestroy) {
|
|
165
|
-
throw new Error(
|
|
166
|
-
`
|
|
167
|
-
If the component uses a controller that uses destroy() method, then the
|
|
168
|
-
component must have the following properties:
|
|
169
|
-
/**
|
|
170
|
-
* If true, the component will not be destroyed automatically when it is
|
|
171
|
-
* disconnected from the document. This is useful when you want to move the
|
|
172
|
-
* component to a different place on the page, or temporarily hide it. If this
|
|
173
|
-
* is set, make sure to call the \`destroy\` method when you are done to prevent
|
|
174
|
-
* memory leaks.
|
|
175
|
-
*/
|
|
176
|
-
@property() ${autoDestroyDisabledPropName} = false;
|
|
177
|
-
|
|
178
|
-
/** Permanently destroy the component */
|
|
179
|
-
@method()
|
|
180
|
-
async destroy(): Promise<void> {
|
|
181
|
-
await this.manager.destroy();
|
|
182
|
-
}
|
|
183
|
-
`.trim().split("\n").map((line) => line.trim()).join("\n")
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
let autoDestroyOnDisconnectTimeout = 1e3;
|
|
189
|
-
const autoDestroyDisabledPropName = "autoDestroyDisabled";
|
|
190
|
-
process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? {} : void 0;
|
|
191
21
|
class LitElement extends LitElement$1 {
|
|
192
22
|
constructor() {
|
|
193
23
|
super();
|
|
@@ -96,10 +96,16 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
96
96
|
const noShadowRoot = {};
|
|
97
97
|
function emptyFunction() {
|
|
98
98
|
}
|
|
99
|
-
const devOnly$getLitElementTagNameAndRuntime = process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? (componentClass) =>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
const devOnly$getLitElementTagNameAndRuntime = process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? (componentClass) => {
|
|
100
|
+
const prototype = Object.getPrototypeOf(componentClass);
|
|
101
|
+
if (prototype.L !== void 0 && prototype.L === componentClass.L) {
|
|
102
|
+
return { tagName: void 0, runtime: void 0 };
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
tagName: componentClass.L,
|
|
106
|
+
runtime: componentClass.K
|
|
107
|
+
};
|
|
108
|
+
} : void 0;
|
|
103
109
|
const makeDefineCustomElements = (runtime, structure) => function defineCustomElements(windowOrOptions, options) {
|
|
104
110
|
if (!globalThis.customElements) {
|
|
105
111
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as setParentController, d as retrieveParentControllers, j as setAmbientChildController, f as bypassReadOnly } from "./ControllerInternals-
|
|
2
|
-
import { t as trackKey } from "./Controller-
|
|
1
|
+
import { b as setParentController, d as retrieveParentControllers, j as setAmbientChildController, f as bypassReadOnly } from "./ControllerInternals-By6dhpY-.js";
|
|
2
|
+
import { t as trackKey } from "./Controller-DDyB41GY.js";
|
|
3
3
|
const proxyExports = (Class) => (...args) => {
|
|
4
4
|
const ambientControllers = retrieveParentControllers();
|
|
5
5
|
const instance = new Class(...args);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/utils.d.ts
CHANGED
|
@@ -28,6 +28,6 @@ export declare function emptyFunction(): undefined;
|
|
|
28
28
|
* @private
|
|
29
29
|
*/
|
|
30
30
|
export declare const devOnly$getLitElementTagNameAndRuntime: ((componentClass: typeof LitElement) => {
|
|
31
|
-
tagName: string;
|
|
32
|
-
runtime: Runtime;
|
|
31
|
+
tagName: string | undefined;
|
|
32
|
+
runtime: Runtime | undefined;
|
|
33
33
|
}) | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/lumina",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.75",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@arcgis/toolkit": "~5.0.0-next.
|
|
26
|
+
"@arcgis/toolkit": "~5.0.0-next.75",
|
|
27
27
|
"csstype": "^3.1.3",
|
|
28
28
|
"tslib": "^2.8.1"
|
|
29
29
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function captureConsoleErrors(): unknown[][];
|
package/dist/runtime.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const runtime: import('./makeRuntime.ts').Runtime;
|
|
2
|
-
/**
|
|
3
|
-
* "customElement" needs to be exported - it will be used by the build system.
|
|
4
|
-
* You should not call it directly.
|
|
5
|
-
*/
|
|
6
|
-
export declare const customElement: (tagName: string, component: typeof import('./LitElement.ts').LitElement) => void;
|