@arcgis/lumina 5.0.0-next.13 → 5.0.0-next.130

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.
Files changed (52) hide show
  1. package/dist/{Controller-ftAEcdmI.js → Controller-DQnXLHsP.js} +3 -2
  2. package/dist/{ControllerInternals-CWQrfEA8.js → ControllerInternals-By6dhpY-.js} +2 -2
  3. package/dist/ControllerManager-eFkqujn9.js +185 -0
  4. package/dist/LitElement.d.ts +6 -6
  5. package/dist/PublicLitElement.d.ts +8 -0
  6. package/dist/context.js +1 -1
  7. package/dist/controllers/Controller.d.ts +3 -3
  8. package/dist/controllers/ControllerInternals.d.ts +5 -5
  9. package/dist/controllers/ControllerManager.d.ts +4 -6
  10. package/dist/controllers/accessor/index.d.ts +4 -4
  11. package/dist/controllers/accessor/index.js +3 -3
  12. package/dist/controllers/accessor/reEmitEvent.d.ts +1 -1
  13. package/dist/controllers/accessor/store.d.ts +1 -1
  14. package/dist/controllers/accessor/useAccessor.d.ts +3 -3
  15. package/dist/controllers/functional.d.ts +2 -2
  16. package/dist/controllers/index.d.ts +29 -20
  17. package/dist/controllers/index.js +18 -11
  18. package/dist/controllers/load.d.ts +1 -1
  19. package/dist/controllers/proxyExports.d.ts +2 -2
  20. package/dist/controllers/trackKey.d.ts +2 -2
  21. package/dist/controllers/trackPropKey.d.ts +1 -1
  22. package/dist/controllers/trackPropertyKey.d.ts +2 -2
  23. package/dist/controllers/types.d.ts +1 -1
  24. package/dist/controllers/useDirection.d.ts +1 -1
  25. package/dist/controllers/useMedia.d.ts +1 -1
  26. package/dist/controllers/usePropertyChange.d.ts +3 -3
  27. package/dist/controllers/useT9n.d.ts +1 -1
  28. package/dist/controllers/useWatchAttributes.d.ts +2 -2
  29. package/dist/controllers/utils.d.ts +2 -2
  30. package/dist/createEvent.d.ts +1 -1
  31. package/dist/decorators.d.ts +1 -1
  32. package/dist/devOnlyDetectIncorrectLazyUsages.d.ts +1 -1
  33. package/dist/hmrSupport.js +1 -1
  34. package/dist/index.d.ts +16 -16
  35. package/dist/index.js +9 -179
  36. package/dist/jsx/baseTypes.d.ts +4 -4
  37. package/dist/jsx/directives.d.ts +3 -3
  38. package/dist/jsx/generatedTypes.d.ts +817 -539
  39. package/dist/jsx/types.d.ts +2 -2
  40. package/dist/{lazyLoad-BlK67lvm.js → lazyLoad-DjHR4rq8.js} +10 -4
  41. package/dist/lazyLoad.d.ts +3 -3
  42. package/dist/lifecycleSupport.d.ts +1 -1
  43. package/dist/makeRuntime.d.ts +2 -2
  44. package/dist/{proxyExports-D906TEtL.js → proxyExports-CXEnG2Az.js} +2 -2
  45. package/dist/render.d.ts +1 -1
  46. package/dist/tests/wrappersUtils.typeTest.d.ts +1 -0
  47. package/dist/typings/jsxGlobals.d.ts +1 -1
  48. package/dist/utils.d.ts +14 -9
  49. package/package.json +6 -5
  50. package/dist/controllers/tests/autoDestroyMock.d.ts +0 -5
  51. package/dist/controllers/tests/utils.d.ts +0 -1
  52. package/dist/runtime.d.ts +0 -6
@@ -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.
@@ -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.
@@ -1,4 +1,4 @@
1
- import { LuminaPropertyDeclaration } from './controllers/types';
1
+ import { LuminaPropertyDeclaration } from './controllers/types.ts';
2
2
  export { state } from 'lit/decorators/state.js';
3
3
  /**
4
4
  * A class field or accessor decorator which creates a reactive property that
@@ -1,4 +1,4 @@
1
- import { LitElement } from './LitElement';
1
+ import { LitElement } from './LitElement.ts';
2
2
  /**
3
3
  * When in lazy-build, the actual Lit element is never attached to the DOM.
4
4
  * Instead, a proxy element is present and should be used for all DOM actions.
@@ -1,4 +1,4 @@
1
- import { n as noShadowRoot, P as ProxyComponent } from "./lazyLoad-BlK67lvm.js";
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.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 { G as GenericController, p as propertyTrackResolve } from "./Controller-ftAEcdmI.js";
2
- import { c } from "./Controller-ftAEcdmI.js";
1
+ import { p as propertyTrackResolve } from "./Controller-DQnXLHsP.js";
2
+ import { c } from "./Controller-DQnXLHsP.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-BlK67lvm.js";
6
- import { d, m } from "./lazyLoad-BlK67lvm.js";
7
- import { isEsriInternalEnv, safeCall, safeAsyncCall } from "@arcgis/toolkit/error";
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 { devToolsAwareTimeout, Deferred } from "@arcgis/toolkit/promise";
10
- import { nothing as nothing$1, LitElement as LitElement$1, isServer, notEqual, noChange as noChange$1, render } from "lit";
11
- import { s as setAmbientComponent, c as controllerSymbol, a as shouldBypassReadOnly } from "./ControllerInternals-CWQrfEA8.js";
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-eFkqujn9.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();
@@ -21,19 +21,19 @@ export type EventHandler<E> = {
21
21
  }["bivarianceHack"];
22
22
  export interface CustomAttributes<T = HTMLElement> {
23
23
  /**
24
- * [Documentation](https://qawebgis.esri.com/components/lumina/jsx#key-prop)
24
+ * [Documentation](https://webgis.esri.com/references/lumina/jsx#key-prop)
25
25
  */
26
26
  key?: unknown;
27
27
  /**
28
- * [Documentation](https://qawebgis.esri.com/components/lumina/jsx#refs)
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://qawebgis.esri.com/components/lumina/jsx#lit-directives)
32
+ * [Documentation](https://webgis.esri.com/references/lumina/jsx#lit-directives)
33
33
  */
34
34
  directives?: readonly DirectiveResult[];
35
35
  /**
36
- * [Documentation](https://qawebgis.esri.com/components/lumina/jsx#deferring-web-component-load)
36
+ * [Documentation](https://webgis.esri.com/references/lumina/jsx#deferring-web-component-load)
37
37
  */
38
38
  deferLoad?: true;
39
39
  }
@@ -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://qawebgis.esri.com/components/lumina/jsx#deferring-web-component-load)
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://qawebgis.esri.com/components/lumina/jsx#deferring-web-component-load)
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 {