@arcgis/lumina 5.0.0-next.9 → 5.0.0-next.90
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 +5 -4
- 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
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export type { EventEmitter, EventOptions } from './createEvent';
|
|
2
|
-
export { createEvent } from './createEvent';
|
|
3
|
-
export { state, property, method } from './decorators';
|
|
4
|
-
export type { DefineCustomElements, LazyLoadOptions, GlobalThisWithPuppeteerEnv } from './lazyLoad';
|
|
5
|
-
export { makeDefineCustomElements } from './lazyLoad';
|
|
6
|
-
export { LitElement, disableReactiveUtilsIntegration } from './LitElement';
|
|
7
|
-
export type { PublicLitElement } from './PublicLitElement';
|
|
8
|
-
export type { Runtime, RuntimeOptions, DevOnlyGlobalRuntime, DevOnlyGlobalComponentRefCallback } from './makeRuntime';
|
|
9
|
-
export { makeRuntime } from './makeRuntime';
|
|
10
|
-
export type { EventHandler } from './jsx/baseTypes';
|
|
11
|
-
export * from './jsx/types';
|
|
12
|
-
export { safeClassMap, safeStyleMap, deferLoad, deferredLoaders, stabilizedRef, directive, live, } from './jsx/directives';
|
|
13
|
-
export { nothing, noChange, setAttribute, stringOrBoolean } from './jsx/utils';
|
|
14
|
-
export { noShadowRoot, devOnly$getLitElementTagNameAndRuntime } from './utils';
|
|
15
|
-
export { makeReactWrapperFactory, getReactWrapperOptions } from './wrappersUtils';
|
|
16
|
-
export { renderElement } from './render';
|
|
1
|
+
export type { EventEmitter, EventOptions } from './createEvent.ts';
|
|
2
|
+
export { createEvent } from './createEvent.ts';
|
|
3
|
+
export { state, property, method } from './decorators.ts';
|
|
4
|
+
export type { DefineCustomElements, LazyLoadOptions, GlobalThisWithPuppeteerEnv } from './lazyLoad.ts';
|
|
5
|
+
export { makeDefineCustomElements } from './lazyLoad.ts';
|
|
6
|
+
export { LitElement, disableReactiveUtilsIntegration } from './LitElement.ts';
|
|
7
|
+
export type { PublicLitElement } from './PublicLitElement.ts';
|
|
8
|
+
export type { Runtime, RuntimeOptions, DevOnlyGlobalRuntime, DevOnlyGlobalComponentRefCallback, } from './makeRuntime.ts';
|
|
9
|
+
export { makeRuntime } from './makeRuntime.ts';
|
|
10
|
+
export type { EventHandler } from './jsx/baseTypes.ts';
|
|
11
|
+
export * from './jsx/types.ts';
|
|
12
|
+
export { safeClassMap, safeStyleMap, deferLoad, deferredLoaders, stabilizedRef, directive, live, } from './jsx/directives.ts';
|
|
13
|
+
export { nothing, noChange, setAttribute, stringOrBoolean } from './jsx/utils.ts';
|
|
14
|
+
export { noShadowRoot, devOnly$getLitElementTagNameAndRuntime } from './utils.ts';
|
|
15
|
+
export { makeReactWrapperFactory, getReactWrapperOptions } from './wrappersUtils.ts';
|
|
16
|
+
export { renderElement } from './render.ts';
|
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 { isEsriInternalEnv,
|
|
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();
|
package/dist/jsx/baseTypes.d.ts
CHANGED
|
@@ -21,19 +21,19 @@ export type EventHandler<E> = {
|
|
|
21
21
|
}["bivarianceHack"];
|
|
22
22
|
export interface CustomAttributes<T = HTMLElement> {
|
|
23
23
|
/**
|
|
24
|
-
* [Documentation](https://
|
|
24
|
+
* [Documentation](https://webgis.esri.com/references/lumina/jsx#key-prop)
|
|
25
25
|
*/
|
|
26
26
|
key?: unknown;
|
|
27
27
|
/**
|
|
28
|
-
* [Documentation](https://
|
|
28
|
+
* [Documentation](https://webgis.esri.com/references/lumina/jsx#refs)
|
|
29
29
|
*/
|
|
30
30
|
ref?: EventHandler<T | undefined> | Ref<T>;
|
|
31
31
|
/**
|
|
32
|
-
* [Documentation](https://
|
|
32
|
+
* [Documentation](https://webgis.esri.com/references/lumina/jsx#lit-directives)
|
|
33
33
|
*/
|
|
34
34
|
directives?: readonly DirectiveResult[];
|
|
35
35
|
/**
|
|
36
|
-
* [Documentation](https://
|
|
36
|
+
* [Documentation](https://webgis.esri.com/references/lumina/jsx#deferring-web-component-load)
|
|
37
37
|
*/
|
|
38
38
|
deferLoad?: true;
|
|
39
39
|
}
|
package/dist/jsx/directives.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ClassInfo, ClassMapDirective } from 'lit/directives/class-map.js';
|
|
|
4
4
|
import { DirectiveResult, DirectiveClass, ElementPart, PartInfo, Directive } from 'lit/directive.js';
|
|
5
5
|
import { StyleMapDirective } from 'lit/directives/style-map.js';
|
|
6
6
|
import { noChange } from 'lit';
|
|
7
|
-
import { CustomAttributes } from './baseTypes';
|
|
7
|
+
import { CustomAttributes } from './baseTypes.ts';
|
|
8
8
|
import { RefDirective } from 'lit/directives/ref.js';
|
|
9
9
|
/**
|
|
10
10
|
* You likely won't have to import this directly. It will be added during
|
|
@@ -63,13 +63,13 @@ declare class DeferLoad extends Directive {
|
|
|
63
63
|
/**
|
|
64
64
|
* @private
|
|
65
65
|
* Do not use this directive directly. Use the `deferLoad` JSX prop instead.
|
|
66
|
-
* [Documentation](https://
|
|
66
|
+
* [Documentation](https://webgis.esri.com/references/lumina/jsx#deferring-web-component-load)
|
|
67
67
|
*/
|
|
68
68
|
export declare const deferLoad: DirectiveResult<typeof DeferLoad>;
|
|
69
69
|
/**
|
|
70
70
|
* @private
|
|
71
71
|
* Do not use this directly. Use the `deferLoad` JSX prop instead.
|
|
72
|
-
* [Documentation](https://
|
|
72
|
+
* [Documentation](https://webgis.esri.com/references/lumina/jsx#deferring-web-component-load)
|
|
73
73
|
*/
|
|
74
74
|
export declare const deferredLoaders: Map<string, () => Promise<unknown>>;
|
|
75
75
|
declare class StabilizedRef extends Directive {
|