@arcgis/lumina 5.2.0-next.2 → 5.2.0-next.21

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 (58) hide show
  1. package/dist/{ControllerManager-DpJfvft9.js → ControllerManager-4cSEnB5Y.js} +12 -8
  2. package/dist/{Controller-Cer_6Z29.js → GenericController-C8NSb50b.js} +59 -23
  3. package/dist/LitElement.d.ts +179 -250
  4. package/dist/PublicLitElement.d.ts +64 -30
  5. package/dist/config.d.ts +22 -16
  6. package/dist/context.d.ts +24 -24
  7. package/dist/controllers/Controller.d.ts +106 -139
  8. package/dist/controllers/ControllerInternals.d.ts +33 -25
  9. package/dist/controllers/ControllerManager.d.ts +40 -61
  10. package/dist/controllers/GenericController.d.ts +26 -0
  11. package/dist/controllers/accessor/index.d.ts +6 -4
  12. package/dist/controllers/accessor/index.js +23 -5
  13. package/dist/controllers/accessor/reEmitEvent.d.ts +6 -3
  14. package/dist/controllers/accessor/store.d.ts +21 -14
  15. package/dist/controllers/accessor/useAccessor.d.ts +86 -68
  16. package/dist/controllers/functional.d.ts +11 -4
  17. package/dist/controllers/index.d.ts +35 -36
  18. package/dist/controllers/index.js +5 -7
  19. package/dist/controllers/load.d.ts +3 -2
  20. package/dist/controllers/proxyExports.d.ts +6 -5
  21. package/dist/controllers/toFunction.d.ts +4 -2
  22. package/dist/controllers/trackKey.d.ts +9 -4
  23. package/dist/controllers/trackPropKey.d.ts +8 -2
  24. package/dist/controllers/trackPropertyKey.d.ts +11 -6
  25. package/dist/controllers/types.d.ts +99 -170
  26. package/dist/controllers/useDirection.d.ts +5 -6
  27. package/dist/controllers/useMedia.d.ts +3 -2
  28. package/dist/controllers/usePropertyChange.d.ts +9 -10
  29. package/dist/controllers/useSlottableRequest.d.ts +15 -10
  30. package/dist/controllers/useT9n.d.ts +44 -38
  31. package/dist/controllers/useWatchAttributes.d.ts +6 -3
  32. package/dist/controllers/utils.d.ts +13 -5
  33. package/dist/createEvent.d.ts +32 -32
  34. package/dist/decorators.d.ts +16 -9
  35. package/dist/formAssociatedUtils.d.ts +5 -47
  36. package/dist/globalTypes/importMeta.d.ts +18 -10
  37. package/dist/globalTypes/index.d.ts +6 -4
  38. package/dist/globalTypes/jsxGlobals.d.ts +36 -23
  39. package/dist/globalTypes/loadLitCss.d.ts +61 -40
  40. package/dist/globalTypes/viteEnv.d.ts +60 -26
  41. package/dist/hmrSupport.d.ts +24 -28
  42. package/dist/index.d.ts +17 -16
  43. package/dist/index.js +27 -7
  44. package/dist/jsx/baseTypes.d.ts +26 -26
  45. package/dist/jsx/directives.d.ts +30 -42
  46. package/dist/jsx/generatedTypes.d.ts +3002 -2923
  47. package/dist/jsx/types.d.ts +214 -171
  48. package/dist/jsx/utils.d.ts +19 -14
  49. package/dist/lazyLoad.d.ts +31 -110
  50. package/dist/makeRuntime.d.ts +104 -127
  51. package/dist/{proxyExports-BkN6hND0.js → proxyExports-ZRLty8oJ.js} +1 -1
  52. package/dist/render.d.ts +4 -2
  53. package/dist/utils.d.ts +9 -14
  54. package/dist/wrappersUtils.d.ts +25 -26
  55. package/package.json +7 -4
  56. package/dist/devOnlyDetectIncorrectLazyUsages.d.ts +0 -14
  57. package/dist/lifecycleSupport.d.ts +0 -8
  58. package/dist/tests/wrappersUtils.typeTest.d.ts +0 -1
@@ -1,7 +1,7 @@
1
- import { Deferred } from '@arcgis/toolkit/promise';
2
- import { LitElement } from './LitElement.ts';
3
- import { Runtime } from './makeRuntime.ts';
4
- import { ControllerManager } from './controllers/ControllerManager.ts';
1
+ import type { LitElement } from "./LitElement.js";
2
+ import type { Runtime } from "./makeRuntime.js";
3
+ import type { ControllerManager } from "./controllers/ControllerManager.js";
4
+
5
5
  /**
6
6
  * Defines lazy-loading proxy components for all web components in this package.
7
7
  *
@@ -9,17 +9,26 @@ import { ControllerManager } from './controllers/ControllerManager.ts';
9
9
  * it will start loading the actual web component source code.
10
10
  */
11
11
  export interface DefineCustomElements {
12
- (options?: LazyLoadOptions): void;
13
- /** @deprecated Passing the Window argument is not necessary - omit the first argument */
14
- (_window?: Window, options?: LazyLoadOptions): void;
12
+ /** @param options */
13
+ (options?: LazyLoadOptions): void;
14
+ /**
15
+ * @deprecated Passing the Window argument is not necessary - omit the first argument
16
+ * @param window
17
+ * @param options
18
+ */
19
+ (window?: Window, options?: LazyLoadOptions): void;
15
20
  }
16
- export type LazyLoadOptions = {
17
- readonly resourcesUrl?: string;
18
- };
19
- interface CommonInterface extends HTMLElement {
20
- componentOnReady: () => Promise<this>;
21
+
22
+ export interface LazyLoadOptions {
23
+ readonly resourcesUrl?: string;
21
24
  }
22
- export declare const makeDefineCustomElements: (runtime: Runtime, structure: Readonly<Record<string, CompactMeta>>) => DefineCustomElements;
25
+
26
+ /**
27
+ * @param runtime
28
+ * @param structure
29
+ */
30
+ export function makeDefineCustomElements(runtime: Runtime, structure: Readonly<Record<string, CompactMeta>>): DefineCustomElements;
31
+
23
32
  /**
24
33
  * Use compact meta to reduce bundle size (otherwise, it would be ~65kb for
25
34
  * map-components). Also, the meta is a string to speed-up parsing
@@ -33,101 +42,13 @@ export declare const makeDefineCustomElements: (runtime: Runtime, structure: Rea
33
42
  * is formAssociated. We can expand this field to include more information in
34
43
  * the future using bit flags.
35
44
  */
36
- type CompactMeta = readonly [load: () => Promise<Record<string, typeof LitElement>>, compact?: string, flags?: 1];
37
- /**
38
- * If this file is run from a Node.js environment, HTMLElement won't be defined.
39
- * Falling back to uselessly extending emptyFunction in that case.
40
- * This will error if you try to instantiate a ProxyComponent in Node.js, but
41
- * that is expected - if you need to instantiate ProxyComponent, HTMLElement
42
- * must be defined
43
- */
44
- declare const HtmlElement: {
45
- new (): HTMLElement;
46
- prototype: HTMLElement;
47
- };
48
- /**
49
- * A web-component that, once connected to the page, starts loading the actual
50
- * component, and set's up two-way forwarding of attributes and methods.
51
- *
52
- * It also makes the actual component render it's content in this 'proxy'
53
- * component, so as to have identical DOM structure for lazy vs non-lazy builds
54
- * (otherwise, css selectors may break)
55
- *
56
- * @private
57
- */
58
- export declare abstract class ProxyComponent extends HtmlElement {
59
- #private;
60
- static observedAttributes?: readonly string[];
61
- static _LitElementLoadPromise: Promise<Record<string, typeof LitElement>> | undefined;
62
- static _LitElementConstructor?: typeof LitElement;
63
- /**
64
- * A list of instances of this component. This allows hot module replacement
65
- * to update all proxy component to use a new LitElement instance.
66
- */
67
- static devOnly$hmrInstances: WeakRef<ProxyComponent>[] | undefined;
68
- static devOnly$hmrIndex: number | undefined;
69
- static _proxiedProperties?: readonly string[];
70
- static _proxiedAsyncMethods?: readonly string[];
71
- static _proxiedSyncMethods?: readonly string[];
72
- static __runtime: Runtime;
73
- protected static __tagName: string;
74
- static readonly lumina = true;
75
- static _initializeProxyPrototype(): void;
76
- /**
77
- * On HMR, preserve the values of all properties that at least once were set
78
- * by someone other than component itself.
79
- */
80
- devOnly$hmrSetProps: Set<PropertyKey>;
81
- devOnly$hmrSetAttributes: Set<string>;
82
- devOnly$InitializeComponent?: (module: Record<string, typeof LitElement>) => void;
83
- devOnly$hmrResetStore?: (newStore: Record<string, unknown>) => void;
84
- devOnly$elementInternals?: ElementInternals;
85
- /**
86
- * This property is only set in development mode and exists only for usage in
87
- * tests or during debugging
88
- */
89
- $component: LitElement | undefined;
90
- /**
91
- * Resolved once LitElement's load() is complete.
92
- * Not read inside of this class, but needed for LitElement to determine if
93
- * it's closest ancestor finished load()
94
- */
95
- __postLoadDeferred: Deferred<void>;
96
- /**
97
- * Resolved once LitElement's loaded() is complete
98
- */
99
- _postLoadedDeferred: Deferred<void>;
100
- /**
101
- * Direct offspring that should be awaited before loaded() is emitted
102
- */
103
- __offspringComponents: (CommonInterface & {
104
- manager?: LitElement["manager"];
105
- })[];
106
- /**
107
- * Promise that resolves once parent's load() completed. False if there is no
108
- * parent
109
- */
110
- _ancestorLoadPromise?: Promise<void> | false;
111
- get manager(): ControllerManager | undefined;
112
- constructor();
113
- attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
114
- connectedCallback(): void;
115
- disconnectedCallback(): void;
116
- /**
117
- * Creates a promise that resolves once the component is fully loaded
118
- */
119
- componentOnReady(): Promise<this>;
120
- /**
121
- * Implemented on the proxy for compatibility with Lit Context.
122
- */
123
- addController(): void;
124
- /**
125
- * Implemented on the proxy for compatibility with Lit Context.
126
- */
127
- requestUpdate(): void;
128
- }
129
- /** @private */
45
+ export type CompactMeta = readonly [load: () => Promise<Record<string, typeof LitElement>>, compact?: string, flags?: 1];
46
+
47
+ /** @internal */
130
48
  export type GlobalThisWithPuppeteerEnv = typeof globalThis & {
131
- devOnly$createdElements?: WeakRef<ProxyComponent>[];
132
- };
133
- export {};
49
+ /** @internal */
50
+ devOnly$createdElements?: WeakRef<HTMLElement & {
51
+ componentOnReady: () => Promise<unknown>;
52
+ manager?: ControllerManager;
53
+ }>[];
54
+ };
@@ -1,148 +1,125 @@
1
- import { CSSResult } from 'lit';
2
- import { LitElement } from './LitElement.ts';
3
- import { AccessorObservableLike, ReactiveTrackingTarget } from './controllers/types.ts';
1
+ import type { CSSResult } from "lit";
2
+ import type { LitElement } from "./LitElement.js";
3
+
4
4
  /**
5
5
  * `@arcgis/lumina` package may be bundled once but used by multiple packages with
6
6
  * different configuration options. For that reason, the configuration options
7
7
  * cannot be a global object, but has to be an object that you pass around.
8
8
  */
9
- export type Runtime = RuntimeOptions & {
10
- /**
11
- * Get the base path to where the package assets can be found.
12
- * By default, the package asset path is set to `https://js.arcgis.com/<simplified-package-name>/<released-verion>/`.
13
- * We are hosting our assets on a CDN (Content Delivery Network) to ensure fast and reliable access.
14
- * It is CORS-enabled, so you can load the assets from any domain.
15
- * Use "setAssetPath(path)" if the path needs to be customized.
16
- */
17
- readonly getAssetPath: (suffix: string) => string;
18
- /**
19
- * Used to manually set the base path where package assets (like localization
20
- * and icons) can be found.
21
- *
22
- * By default, the package asset path is set to `https://js.arcgis.com/<simplified-package-name>/<released-verion>/`.
23
- * For example, `https://js.arcgis.com/map-components/4.30/`.
24
- * We are hosting our assets on a CDN (Content Delivery Network) to ensure fast and reliable access.
25
- * It is CORS-enabled, so you can load the assets from any domain.
26
- * This is the recommended way to load the assets and avoid bundling them with your application.
27
- * It means that by default, you don't need to use "setAssetPath" since the path is already set.
28
- *
29
- * However, if you need to host the assets locally, you can use "setAssetPath" to set the base path.
30
- * If the script is used as "module", it's recommended to use "import.meta.url",
31
- * such as "setAssetPath(import.meta.url)". Other options include
32
- * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
33
- * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
34
- * But do note that this configuration depends on how your script is bundled, or lack of
35
- * bundling, and where your assets can be loaded from. Additionally custom bundling
36
- * will have to ensure the static assets are copied to its build directory.
37
- */
38
- readonly setAssetPath: (path: URL | string) => void;
39
- /**
40
- * The customElement decorator. Unlike default Lit's decorator this one
41
- * provides runtime instance to the LitElement class
42
- *
43
- * @remarks
44
- * You do not need to call this decorator in your component.
45
- * It will be added automatically at build time.
46
- *
47
- * Instead, make sure your component file has the following:
48
- * ```ts
49
- * declare global {
50
- * interface DeclareElements {
51
- * "arcgis-your-component": ArcgisYourComponent;
52
- * }
53
- * }
54
- * ```
55
- */
56
- readonly customElement: (tagName: string, component: typeof LitElement) => void;
57
- /**
58
- * Short for trackAccess. A reference to JS API's accessor's trackAccess
59
- * function to mark an observable as accessed.
60
- * Used in the getter for each property in component packages that use @arcgis/core.
61
- *
62
- * @private
63
- */
64
- t?: (observable: AccessorObservableLike) => void;
65
- /**
66
- * Short for createObservable. A callback to create a JS API Accessor's
67
- * SimpleObservable. Such observable will be created for each property in
68
- * component packages that use @arcgis/core to bring reactiveUtils integration.
69
- * @private
70
- */
71
- o?: () => AccessorObservableLike;
72
- /**
73
- * In CDN build, we can only import `@arcgis/core` async, so the lazy loader will need
74
- * to await this promise before beginning hydration so that the reactiveUtils
75
- * integration modules had time to load.
76
- *
77
- * @private
78
- */
79
- p?: Promise<void>;
80
- /**
81
- * A possible reference to JS API's createTrackingTarget() function to create
82
- * an observer that will keep track of what properties were accessed during
83
- * render().
84
- *
85
- * @private
86
- */
87
- c?: (callback: () => void) => ReactiveTrackingTarget;
88
- /**
89
- * A possible reference to JS API's runTracked() function to run update() with
90
- * property accesses tracking enabled.
91
- *
92
- * @private
93
- */
94
- r?: (target: ReactiveTrackingTarget, callback: () => void) => void;
95
- };
96
- export type RuntimeOptions = {
97
- /**
98
- * The default asset path to use in NPM and CDN builds.
99
- *
100
- * This option will be set by Lumina compiler based on the value of the
101
- * `assets.defaultPath` option in the `useLumina()` plugin.
102
- */
103
- readonly defaultAssetPath: string;
104
- /**
105
- * The attribute that indicates a component has rendered its content.
106
- * Usually this attribute is added after your component's `loaded()` lifecycle
107
- * happened. However, during SSR, "hydrated" is added right away on the
108
- * server.
109
- *
110
- * Until element has this attribute, it will have `visibility:hidden` style
111
- * applied.
112
- *
113
- * This option will be set by the Lumina compiler based on the value of
114
- * the `css.hydratedAttribute` option in the `useLumina()` plugin.
115
- */
116
- readonly hydratedAttribute: string;
117
- /**
118
- * Styles that you wish to make available in each component's shadow root, but
119
- * to not apply outside the shadow root
120
- *
121
- * This option will be set by Lumina compiler based on the value of the
122
- * `css.commonStylesPath` option in the `useLumina()` plugin.
123
- */
124
- readonly commonStyles?: CSSResult;
125
- };
9
+ export interface Runtime extends RuntimeOptions {
10
+ /**
11
+ * Get the base path to where the package assets can be found.
12
+ * By default, the package asset path is set to `https://js.arcgis.com/<simplified-package-name>/<released-verion>/`.
13
+ * We are hosting our assets on a CDN (Content Delivery Network) to ensure fast and reliable access.
14
+ * It is CORS-enabled, so you can load the assets from any domain.
15
+ * Use "setAssetPath(path)" if the path needs to be customized.
16
+ *
17
+ * @param suffix
18
+ */
19
+ getAssetPath(suffix: string): string;
20
+ /**
21
+ * Used to manually set the base path where package assets (like localization
22
+ * and icons) can be found.
23
+ *
24
+ * By default, the package asset path is set to `https://js.arcgis.com/<simplified-package-name>/<released-verion>/`.
25
+ * For example, `https://js.arcgis.com/map-components/4.30/`.
26
+ * We are hosting our assets on a CDN (Content Delivery Network) to ensure fast and reliable access.
27
+ * It is CORS-enabled, so you can load the assets from any domain.
28
+ * This is the recommended way to load the assets and avoid bundling them with your application.
29
+ * It means that by default, you don't need to use "setAssetPath" since the path is already set.
30
+ *
31
+ * However, if you need to host the assets locally, you can use "setAssetPath" to set the base path.
32
+ * If the script is used as "module", it's recommended to use "import.meta.url",
33
+ * such as "setAssetPath(import.meta.url)". Other options include
34
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
35
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
36
+ * But do note that this configuration depends on how your script is bundled, or lack of
37
+ * bundling, and where your assets can be loaded from. Additionally custom bundling
38
+ * will have to ensure the static assets are copied to its build directory.
39
+ *
40
+ * @param path
41
+ */
42
+ setAssetPath(path: URL | string): void;
43
+ /**
44
+ * The customElement decorator. Unlike default Lit's decorator this one
45
+ * provides runtime instance to the LitElement class
46
+ *
47
+ * You do not need to call this decorator in your component.
48
+ * It will be added automatically at build time.
49
+ *
50
+ * Instead, make sure your component file has the following:
51
+ * ```ts
52
+ * declare global {
53
+ * interface DeclareElements {
54
+ * "arcgis-your-component": ArcgisYourComponent;
55
+ * }
56
+ * }
57
+ * ```
58
+ *
59
+ * @param tagName
60
+ * @param component
61
+ * @internal
62
+ */
63
+ customElement(tagName: string, component: typeof LitElement): void;
64
+ }
65
+
66
+ export interface RuntimeOptions {
67
+ /**
68
+ * The default asset path to use in NPM and CDN builds.
69
+ *
70
+ * This option will be set by Lumina compiler based on the value of the
71
+ * `assets.defaultPath` option in the `useLumina()` plugin.
72
+ */
73
+ readonly defaultAssetPath: string;
74
+ /**
75
+ * The attribute that indicates a component has rendered its content.
76
+ * Usually this attribute is added after your component's `loaded()` lifecycle
77
+ * happened. However, during SSR, "hydrated" is added right away on the
78
+ * server.
79
+ *
80
+ * Until element has this attribute, it will have `visibility:hidden` style
81
+ * applied.
82
+ *
83
+ * This option will be set by the Lumina compiler based on the value of
84
+ * the `css.hydratedAttribute` option in the `useLumina()` plugin.
85
+ */
86
+ readonly hydratedAttribute: string;
87
+ /**
88
+ * Styles that you wish to make available in each component's shadow root, but
89
+ * to not apply outside the shadow root
90
+ *
91
+ * This option will be set by Lumina compiler based on the value of the
92
+ * `css.commonStylesPath` option in the `useLumina()` plugin.
93
+ */
94
+ readonly commonStyles?: CSSResult;
95
+ }
96
+
126
97
  /**
127
98
  * The options object will be provided by Lumina compiler at build-time.
128
99
  * It should not be specified in the source code.
100
+ *
101
+ * @param options
129
102
  */
130
- export declare const makeRuntime: (options?: RuntimeOptions) => Runtime;
103
+ export function makeRuntime(options?: RuntimeOptions): Runtime;
104
+
131
105
  /**
132
106
  * Exposing the reference to the runtime globally when in tests or development.
133
- * This is primarily for usage by dynamically created components in tests
107
+ * This is primarily for usage by dynamically created components in tests.
134
108
  *
135
- * @private
109
+ * @internal
136
110
  */
137
111
  export type DevOnlyGlobalRuntime = typeof globalThis & {
138
- devOnly$luminaRuntime?: Runtime;
112
+ /** @internal */
113
+ devOnly$luminaRuntime?: Runtime;
139
114
  };
115
+
140
116
  /**
141
117
  * Called from the component constructor when in development or test mode.
142
118
  * Used primarily by mount to get a reference to the rendered component.
143
119
  *
144
- * @private
120
+ * @internal
145
121
  */
146
122
  export type DevOnlyGlobalComponentRefCallback = typeof globalThis & {
147
- devOnly$luminaComponentRefCallback?: (component: LitElement) => void;
148
- };
123
+ /** @internal */
124
+ devOnly$luminaComponentRefCallback?: (component: LitElement) => void;
125
+ };
@@ -1,5 +1,5 @@
1
1
  import { b as setParentController, h as setAmbientChildController, d as retrieveParentControllers, e as bypassReadOnly } from "./ControllerInternals-CeDntN3G.js";
2
- import { t as trackKey } from "./Controller-Cer_6Z29.js";
2
+ import { t as trackKey } from "./GenericController-C8NSb50b.js";
3
3
  const proxyExports = (Class) => (...args) => {
4
4
  const ambientControllers = retrieveParentControllers();
5
5
  const instance = new Class(...args);
package/dist/render.d.ts CHANGED
@@ -1,11 +1,13 @@
1
- import { JsxNode } from './jsx/types.ts';
1
+ import type { JsxNode } from "./jsx/types.js";
2
+
2
3
  /**
3
4
  * Retrieve an HTML element to be manually appended to an existing component.
4
5
  *
6
+ * @param element
5
7
  * @example
6
8
  * ```ts
7
9
  * const fullScreen = renderElement(<arcgis-fullscreen />);
8
10
  * document.body.appendChild(fullScreen);
9
11
  * ```
10
12
  */
11
- export declare const renderElement: <Element extends HTMLElement = HTMLElement>(element: JsxNode) => Element;
13
+ export function renderElement<Element extends HTMLElement = HTMLElement>(element: JsxNode): Element;
package/dist/utils.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { LitElement } from './LitElement.ts';
2
- import { Runtime } from './makeRuntime.ts';
1
+ import type { LitElement } from "./LitElement.js";
2
+ import type { Runtime } from "./makeRuntime.js";
3
+
3
4
  /**
4
5
  * Add this static property to your component to disable shadow root.
5
6
  *
6
- * @remarks
7
7
  * Without shadow root, any styles added using the `styles` property will
8
8
  * be applied to the entire DOM that the component is attached to, not just to
9
9
  * the insides of this component.
@@ -12,22 +12,17 @@ import { Runtime } from './makeRuntime.ts';
12
12
  * ```ts
13
13
  * static override shadowRootOptions = noShadowRoot;
14
14
  * ```
15
- *
16
- * @privateRemarks
17
- * This property is an empty object at runtime for bundle size reasons.
18
- * While empty object is not a valid shadowRootOption, it is never passed to
19
- * attachShadow() since we use this exact empty object as a magic value to opt
20
- * out of shadow root.
21
15
  */
22
- export declare const noShadowRoot: ShadowRootInit;
23
- export declare function emptyFunction(): undefined;
16
+ export const noShadowRoot: ShadowRootInit;
17
+
24
18
  /**
25
19
  * Exposed as a dev-only util for use by Lumina's mount() test helper. We need
26
20
  * to expose a wrapper util because private properties are mangled and so cannot
27
21
  * be reliably accessed outside the package.
28
- * @private
22
+ *
23
+ * @internal
29
24
  */
30
- export declare const devOnly$getLitElementTagNameAndRuntime: ((componentClass: typeof LitElement) => {
25
+ export const devOnly$getLitElementTagNameAndRuntime: ((componentClass: typeof LitElement) => {
31
26
  tagName: string | undefined;
32
27
  runtime: Runtime | undefined;
33
- }) | undefined;
28
+ }) | undefined;
@@ -1,45 +1,44 @@
1
+ /** @internal */
1
2
  export interface Options<I extends HTMLElement, E extends EventNames> {
2
- react: any;
3
- tagName: string;
4
- elementClass: Constructor<I>;
5
- events?: E;
6
- displayName?: string;
3
+ /** @internal */
4
+ react: any;
5
+ /** @internal */
6
+ tagName: string;
7
+ /** @internal */
8
+ elementClass: new () => I;
9
+ /** @internal */
10
+ events?: E;
11
+ /** @internal */
12
+ displayName?: string;
7
13
  }
14
+
15
+ /** @internal */
8
16
  export type EventNames = Record<string, string>;
9
- type Constructor<T> = new () => T;
17
+
10
18
  /**
11
19
  * Wrap `createComponent` from `@lit/react` to improve lazy loading
12
20
  * compatibility.
13
21
  *
14
- * @private
22
+ * @deprecated since 5.0. React wrappers are not needed in React 19 or above
23
+ * @param react
24
+ * @param createComponent
25
+ * @internal
15
26
  */
16
- export declare const makeReactWrapperFactory: (react: unknown, createComponent: (options: Options<HTMLElement, EventNames>) => unknown) => (options: Pick<Options<HTMLElement, EventNames>, "events" | "tagName">) => unknown;
27
+ export function makeReactWrapperFactory(react: unknown, createComponent: (options: Options<HTMLElement, EventNames>) => unknown): ((options: Pick<Options<HTMLElement, EventNames>, "events" | "tagName">) => unknown);
28
+
17
29
  /**
18
30
  * Helper for `createComponent` to declare options in a type-safe and concise
19
31
  * manner.
20
32
  *
21
- * @remarks
22
33
  * Only tagName and events need to be provided to the wrapped version of the
23
34
  * `createComponent` function. However, since we inherit the typings from
24
35
  * the original `createComponent`, TypeScript would still force us to provide
25
36
  * `react` and `elementClass` properties - instead, this helper convinces
26
37
  * TypeScript that we are providing `react` and `elementClass` properties.
27
38
  *
28
- * @private
39
+ * @deprecated since 5.0. React wrappers are not needed in React 19 or above
40
+ * @param tagNameAndElement
41
+ * @param events
42
+ * @internal
29
43
  */
30
- export declare const getReactWrapperOptions: <Element extends HTMLElement, Events extends EventNames>(
31
- /**
32
- * We want "Events" type argument to be inferred, but Element type
33
- * argument to be explicitly specified. That isn't possible until
34
- * https://github.com/microsoft/TypeScript/issues/26242.
35
- *
36
- * As a workaround we are making Element inferred by passing Element type as
37
- * a tag name:
38
- * ```ts
39
- * getReactWrapperOptions("te-st" as HTMLTeStElement, {});
40
- * ```
41
- */
42
- tagNameAndElement: Element, events: Events) => Options<Element & {
43
- class?: string;
44
- }, Events>;
45
- export {};
44
+ export function getReactWrapperOptions<Element extends HTMLElement, Events extends EventNames>(tagNameAndElement: Element, events: Events): Options<Element & { class?: string; }, Events>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina",
3
- "version": "5.2.0-next.2",
3
+ "version": "5.2.0-next.21",
4
4
  "description": "Runtime for WebGIS SDK web components",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -15,8 +15,11 @@
15
15
  "./globalTypes": {
16
16
  "types": "./dist/globalTypes/index.d.ts"
17
17
  },
18
- "./typings": {
19
- "types": "./dist/globalTypes/index.d.ts"
18
+ "./jsx/baseTypes": {
19
+ "types": "./dist/jsx/baseTypes.d.ts"
20
+ },
21
+ "./jsx/generatedTypes": {
22
+ "types": "./dist/jsx/generatedTypes.d.ts"
20
23
  },
21
24
  "./PublicLitElement": {
22
25
  "types": "./dist/PublicLitElement.d.ts"
@@ -32,7 +35,7 @@
32
35
  "dependencies": {
33
36
  "csstype": "^3.1.3",
34
37
  "tslib": "^2.8.1",
35
- "@arcgis/toolkit": "~5.2.0-next.2"
38
+ "@arcgis/toolkit": "~5.2.0-next.21"
36
39
  },
37
40
  "peerDependencies": {
38
41
  "@lit/context": "^1.1.6",
@@ -1,14 +0,0 @@
1
- import { LitElement } from './LitElement.ts';
2
- /**
3
- * When in lazy-build, the actual Lit element is never attached to the DOM.
4
- * Instead, a proxy element is present and should be used for all DOM actions.
5
- *
6
- * In practice, this means using this.el.getAttribute() instead of
7
- * this.getAttribute() and etc for each DOM method.
8
- *
9
- * To detect incorrect usages, this function overwrites each DOM member on the
10
- * LitElement prototype with an exception-throwing function.
11
- *
12
- * This code does not ship in production builds.
13
- */
14
- export declare function devOnlyDetectIncorrectLazyUsages(LitClass: typeof LitElement): void;
@@ -1,8 +0,0 @@
1
- import { ProxyComponent } from './lazyLoad.ts';
2
- /**
3
- * If there is a parent component, tell it to await it's loaded() until we
4
- * completed load().
5
- * Also, return a promise that will delay our load() until parent's load()
6
- * is completed.
7
- */
8
- export declare const attachToAncestor: (child: ProxyComponent["__offspringComponents"][number]) => Promise<void> | false;
@@ -1 +0,0 @@
1
- export {};