@arcgis/lumina 4.32.0-next.20 → 4.32.0-next.22

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/jsx/jsx.d.ts CHANGED
@@ -27,13 +27,13 @@ export declare const Fragment: (props: {
27
27
  children?: JsxNode;
28
28
  }) => TemplateResult;
29
29
  /**
30
- * @internal
30
+ * @private
31
31
  * The references to this function are removed at build time. You do not need
32
32
  * to import it directly
33
33
  */
34
34
  export declare function jsx(type: string, props: unknown, key?: unknown): JsxNode;
35
35
  /**
36
- * @internal
36
+ * @private
37
37
  * The references to this function are removed at build time. You do not need
38
38
  * to import it directly
39
39
  */
@@ -200,6 +200,26 @@ export type ToElement<Component> = Omit<Component, LuminaJsx.ExcludedProperties>
200
200
  export type ToJsx<Component extends {
201
201
  el: unknown;
202
202
  }> = LuminaJsx.HTMLAttributes<Component["el"]> & LuminaJsx.RemapEvents<Component> & Partial<Omit<Component, LuminaJsx.ExcludedProperties | keyof HTMLElement | keyof LuminaJsx.RemapEvents<Component>>>;
203
+ /**
204
+ * This interface will be automatically extended in src/lumina.ts files to add
205
+ * typings for Stencil elements usages in Lumina. You do not need to manually
206
+ * extend this interface.
207
+ *
208
+ * @example
209
+ * ```ts
210
+ * import type { JSX as CalciteJSX } from "@esri/calcite-components/dist/types/components";
211
+ * import type { JSX as CommonComponentsJsx } from "@arcgis/common-components/dist/types/components";
212
+ *
213
+ * declare module "@arcgis/lumina" {
214
+ * interface ImportStencilElements
215
+ * extends CalciteJSX.IntrinsicElements,
216
+ * CommonComponentsJsx.IntrinsicElements {
217
+ * }
218
+ * }
219
+ * ```
220
+ */
221
+ export interface ImportStencilElements {
222
+ }
203
223
  /**
204
224
  * Get the type of all events for a given component. Includes native DOM events
205
225
  * and custom events.
@@ -207,9 +227,9 @@ export type ToJsx<Component extends {
207
227
  * @example
208
228
  * ```tsx
209
229
  * render() {
210
- * return <arcgis-counter onArcgisOverflow={this._handleOverflow} />
230
+ * return <arcgis-map onArcgisViewClick={this._handleViewClick} />
211
231
  * }
212
- * _handleOverflow(event: ToEvents<ArcgisCounter>["arcgisOverflow"]) {
232
+ * _handleViewClick(event: ToEvents<HTMLArcgisMapElement>["arcgisViewClick"]) {
213
233
  * // event.detail
214
234
  * // event.currentTarget
215
235
  * }
@@ -251,6 +271,12 @@ type GlobalEventTypes<Target = HTMLElement> = {
251
271
  type ListenerToPayloadType<Listener> = unknown extends Listener ? void : Listener extends {
252
272
  emit: (...rest: never[]) => infer PayloadType;
253
273
  } ? PayloadType : Listener extends CustomEvent ? Listener : void;
274
+ /**
275
+ * Defined Lumina custom elements. This interface is used only for internal
276
+ * type-checking only.
277
+ */
278
+ export interface DeclareElements {
279
+ }
254
280
  /**
255
281
  * These typings are based on dom-expressions typings:
256
282
  * https://github.com/ryansolid/dom-expressions/blob/main/packages/dom-expressions/src/jsx.d.ts
@@ -306,7 +332,7 @@ export declare namespace LuminaJsx {
306
332
  */
307
333
  key?: unknown;
308
334
  }
309
- interface IntrinsicElements extends HTMLElementTags, SVGElementTags, ReMappedComponents<globalThis.DeclareElements>, Omit<ReMapStencilComponents<globalThis.ImportStencilElements>, keyof HTMLElementTags | keyof SVGElementTags> {
335
+ interface IntrinsicElements extends HTMLElementTags, SVGElementTags, ReMappedComponents<DeclareElements>, Omit<ReMapStencilComponents<ImportStencilElements>, keyof HTMLElementTags | keyof SVGElementTags> {
310
336
  }
311
337
  /**
312
338
  * By not requiring to have some sort of typings generation watcher to run
@@ -842,6 +868,7 @@ export declare namespace LuminaJsx {
842
868
  }
843
869
  interface HTMLAttributes<T = HTMLElement> extends AriaAttributes, DOMAttributes<T>, RdfaAttributes {
844
870
  accessKey?: string;
871
+ autofocus?: boolean;
845
872
  dir?: HTMLDir;
846
873
  draggable?: boolean;
847
874
  hidden?: boolean | "hidden" | "until-found";
@@ -921,7 +948,6 @@ export declare namespace LuminaJsx {
921
948
  cite?: string;
922
949
  }
923
950
  interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
924
- autofocus?: boolean;
925
951
  disabled?: boolean;
926
952
  form?: string;
927
953
  name?: string;
@@ -1030,7 +1056,6 @@ export declare namespace LuminaJsx {
1030
1056
  autocomplete?: AutoFill;
1031
1057
  accept?: string;
1032
1058
  alt?: string;
1033
- autofocus?: boolean;
1034
1059
  capture?: boolean | string;
1035
1060
  checked?: boolean;
1036
1061
  disabled?: boolean;
@@ -1312,7 +1337,6 @@ export declare namespace LuminaJsx {
1312
1337
  referrerPolicy?: HTMLReferrerPolicy;
1313
1338
  }
1314
1339
  interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
1315
- autofocus?: boolean;
1316
1340
  disabled?: boolean;
1317
1341
  form?: string;
1318
1342
  multiple?: boolean;
@@ -1349,7 +1373,6 @@ export declare namespace LuminaJsx {
1349
1373
  }
1350
1374
  interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
1351
1375
  children?: "Error: Use value property instead. See https://lit.dev/docs/templates/expressions/#invalid-locations";
1352
- autofocus?: boolean;
1353
1376
  cols?: number | string;
1354
1377
  dirname?: string;
1355
1378
  disabled?: boolean;
@@ -2,7 +2,6 @@ import { Deferred } from "@arcgis/components-utils";
2
2
  import type { LitElement } from "./LitElement";
3
3
  import type { Runtime } from "./runtime";
4
4
  import type { ControllerManager } from "@arcgis/components-controllers";
5
- import type { PublicLitElement } from "./PublicLitElement";
6
5
  /**
7
6
  * Defines lazy-loading proxy components for all web components in this package.
8
7
  *
@@ -16,6 +15,9 @@ export interface DefineCustomElements {
16
15
  export type LazyLoadOptions = {
17
16
  readonly resourcesUrl?: string;
18
17
  };
18
+ interface CommonInterface extends HTMLElement {
19
+ componentOnReady: () => Promise<this>;
20
+ }
19
21
  export declare const makeDefineCustomElements: (runtime: Runtime, structure: Readonly<Record<string, CompactMeta>>) => DefineCustomElements;
20
22
  /**
21
23
  * Use compact meta to reduce bundle size (otherwise, it would be ~65kb for
@@ -106,7 +108,7 @@ export declare abstract class ProxyComponent extends HtmlElement {
106
108
  /**
107
109
  * Direct offspring that should be awaited before loaded() is emitted
108
110
  */
109
- _offspring: (PublicLitElement & {
111
+ _offspring: (CommonInterface & {
110
112
  manager?: LitElement["manager"];
111
113
  })[];
112
114
  /**
@@ -153,7 +155,16 @@ export declare abstract class ProxyComponent extends HtmlElement {
153
155
  componentOnReady(): Promise<this>;
154
156
  /** @internal */
155
157
  _initializeComponent(module: Record<string, typeof LitElement>): void;
158
+ /**
159
+ * Implemented on the proxy for compatibility with Lit Context.
160
+ */
161
+ addController(): void;
162
+ /**
163
+ * Implemented on the proxy for compatibility with Lit Context.
164
+ */
165
+ requestUpdate(): void;
156
166
  }
167
+ /** @private */
157
168
  export type GlobalThisWithPuppeteerEnv = typeof globalThis & {
158
169
  devOnly$createdElements?: WeakRef<ProxyComponent>[];
159
170
  };
package/dist/runtime.d.ts CHANGED
@@ -92,6 +92,8 @@ export declare function makeRuntime(options?: RuntimeOptions): Runtime;
92
92
  /**
93
93
  * Exposing the reference to the runtime globally when in tests or development.
94
94
  * This is primarily for usage by dynamically created components in tests
95
+ *
96
+ * @private
95
97
  */
96
98
  export type DevOnlyGlobalRuntime = typeof globalThis & {
97
99
  devOnly$luminaRuntime?: Runtime;
@@ -99,6 +101,8 @@ export type DevOnlyGlobalRuntime = typeof globalThis & {
99
101
  /**
100
102
  * Called from the component constructor when in development or test mode.
101
103
  * Used primarily by mount to get a reference to the rendered component.
104
+ *
105
+ * @private
102
106
  */
103
107
  export type DevOnlyGlobalComponentRefCallback = typeof globalThis & {
104
108
  devOnly$luminaComponentRefCallback?: (component: LitElement) => void;
@@ -1,4 +1,8 @@
1
- export {};
1
+ /**
2
+ * This file is used for internal type checking only. It should not be
3
+ * referenced in public types of your package to not pollute the global types
4
+ * namespace
5
+ */
2
6
  declare global {
3
7
  /**
4
8
  * This interface will be extended in each source file that defines a LitElement.
@@ -19,23 +23,17 @@ declare global {
19
23
  };
20
24
  interface HTMLElementTagNameMap extends ReMappedDeclareElements {
21
25
  }
22
- /**
23
- * Extend this interface with Stencil web components that you wish to use
24
- * in Lit
25
- *
26
- * @example
27
- * ```ts
28
- * import type { JSX as CalciteJSX } from "@esri/calcite-components/dist/types/components";
29
- * import type { JSX as CommonComponentsJsx } from "@arcgis/common-components/dist/types/components";
30
- *
31
- * declare global {
32
- * interface ImportStencilElements
33
- * extends CalciteJSX.IntrinsicElements,
34
- * CommonComponentsJsx.IntrinsicElements {
35
- * }
36
- * }
37
- * ```
38
- */
39
- export interface ImportStencilElements {
26
+ }
27
+ export interface DeclareElements extends globalThis.DeclareElements {
28
+ }
29
+ /**
30
+ * In the component files, we declare "DeclareElements" interface on the
31
+ * `declare global` namespace as it's shorter than writing
32
+ * `declare module "@arcgis/lumina"`. However, we want to avoid polluting
33
+ * global typings with this interface - thus we use namespace merging to
34
+ * extend the namespaced DeclareElements based on the global DeclareElements.
35
+ */
36
+ declare module "../jsx/jsx" {
37
+ interface DeclareElements extends globalThis.DeclareElements {
40
38
  }
41
39
  }
@@ -5,5 +5,7 @@
5
5
  * Because the custom element may not yet be defined in global scope when
6
6
  * `createPrototypeProxy()` is called, this small proxy delays retrieving the custom
7
7
  * element prototype until it is actually needed, and caches the result for future calls.
8
+ *
9
+ * @private
8
10
  */
9
11
  export declare function createPrototypeProxy<T extends HTMLElement>(tagName: string): new () => T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina",
3
- "version": "4.32.0-next.20",
3
+ "version": "4.32.0-next.22",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -8,6 +8,7 @@
8
8
  "exports": {
9
9
  ".": "./dist/index.js",
10
10
  "./config": "./dist/config.js",
11
+ "./hmrSupport": "./dist/hmrSupport.js",
11
12
  "./stencilSsrCompatibility": "./dist/stencilSsrCompatibility/index.js",
12
13
  "./typings": {
13
14
  "types": "./dist/typings/index.d.ts"
@@ -19,10 +20,11 @@
19
20
  ],
20
21
  "license": "SEE LICENSE IN LICENSE.md",
21
22
  "dependencies": {
22
- "@arcgis/components-controllers": "4.32.0-next.20",
23
- "@arcgis/components-utils": "4.32.0-next.20",
23
+ "@arcgis/components-controllers": "4.32.0-next.22",
24
+ "@arcgis/components-utils": "4.32.0-next.22",
24
25
  "@lit-labs/ssr": "^3.2.2",
25
26
  "@lit-labs/ssr-client": "^1.1.7",
27
+ "@lit/context": "^1.1.3",
26
28
  "csstype": "^3.1.3",
27
29
  "lit": "^3.2.0",
28
30
  "tslib": "^2.7.0"