@arcgis/lumina 4.33.0-next.11 → 4.33.0-next.110

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 (53) hide show
  1. package/dist/Controller-CZ8Djohh.js +627 -0
  2. package/dist/LitElement.d.ts +36 -29
  3. package/dist/config.js +13 -6
  4. package/dist/context.d.ts +13 -3
  5. package/dist/controllers/Controller.d.ts +153 -0
  6. package/dist/controllers/ControllerInternals.d.ts +59 -0
  7. package/dist/controllers/ControllerManager.d.ts +83 -0
  8. package/dist/controllers/accessor/index.d.ts +2 -0
  9. package/dist/controllers/accessor/index.js +259 -0
  10. package/dist/controllers/accessor/reEmitEvent.d.ts +10 -0
  11. package/dist/controllers/accessor/useAccessor.d.ts +74 -0
  12. package/dist/controllers/functional.d.ts +19 -0
  13. package/dist/controllers/index.d.ts +24 -0
  14. package/dist/controllers/index.js +267 -0
  15. package/dist/controllers/load.d.ts +6 -0
  16. package/dist/controllers/proxyExports.d.ts +27 -0
  17. package/dist/controllers/tests/autoDestroyMock.d.ts +5 -0
  18. package/dist/controllers/tests/utils.d.ts +1 -0
  19. package/dist/controllers/toFunction.d.ts +8 -0
  20. package/dist/controllers/trackKey.d.ts +8 -0
  21. package/dist/controllers/trackPropKey.d.ts +21 -0
  22. package/dist/controllers/trackPropertyKey.d.ts +29 -0
  23. package/dist/controllers/types.d.ts +152 -0
  24. package/dist/controllers/useDirection.d.ts +11 -0
  25. package/dist/controllers/useMedia.d.ts +8 -0
  26. package/dist/controllers/usePropertyChange.d.ts +12 -0
  27. package/dist/controllers/useT9n.d.ts +48 -0
  28. package/dist/controllers/useWatchAttributes.d.ts +7 -0
  29. package/dist/controllers/utils.d.ts +15 -0
  30. package/dist/createEvent.d.ts +7 -2
  31. package/dist/decorators.d.ts +2 -2
  32. package/dist/devOnlyDetectIncorrectLazyUsages.d.ts +1 -1
  33. package/dist/hmrSupport.d.ts +1 -1
  34. package/dist/hmrSupport.js +1 -7
  35. package/dist/index.d.ts +17 -16
  36. package/dist/index.js +386 -150
  37. package/dist/jsx/baseTypes.d.ts +13 -9
  38. package/dist/jsx/directives.d.ts +25 -7
  39. package/dist/jsx/generatedTypes.d.ts +6 -10
  40. package/dist/jsx/types.d.ts +5 -32
  41. package/dist/lazyLoad.d.ts +18 -18
  42. package/dist/lifecycleSupport.d.ts +1 -1
  43. package/dist/makeRuntime.d.ts +109 -0
  44. package/dist/proxyExports-CK5BLFLO.js +60 -0
  45. package/dist/render.d.ts +5 -0
  46. package/dist/runtime.d.ts +4 -107
  47. package/dist/stencilSsrCompatibility/index.d.ts +2 -6
  48. package/dist/stencilSsrCompatibility/index.js +2 -3
  49. package/dist/typings/importMeta.d.ts +2 -2
  50. package/dist/{chunk-NO7HOBNA.js → utils-CwiifsrO.js} +44 -61
  51. package/package.json +4 -3
  52. package/dist/chunk-PGHUBTOM.js +0 -21
  53. package/dist/wrappersUtils.test.d.ts +0 -1
@@ -1,5 +1,5 @@
1
- import type { DirectiveResult } from "lit-html/directive.js";
2
- import type { Ref } from "lit-html/directives/ref.js";
1
+ import { DirectiveResult } from 'lit-html/directive.js';
2
+ import { Ref } from 'lit-html/directives/ref.js';
3
3
  export type EventHandlerUnion<T, E extends Event> = (e: E & {
4
4
  currentTarget: T;
5
5
  target: Element;
@@ -21,15 +21,19 @@ export type EventHandler<E> = {
21
21
  }["bivarianceHack"];
22
22
  export interface CustomAttributes<T = HTMLElement> {
23
23
  /**
24
- * The `key` is a special attribute that can be set on any element.
25
- *
26
- * At build-time it is translated into the `keyed()` directive:
27
- * https://lit.dev/docs/templates/directives/#keyed
28
- *
29
- * @remarks
30
- * Unlike in React or Stencil, any JavaScript value is acceptable as a key
24
+ * [Documentation](https://qawebgis.esri.com/components/lumina/jsx#key-prop)
31
25
  */
32
26
  key?: unknown;
27
+ /**
28
+ * [Documentation](https://qawebgis.esri.com/components/lumina/jsx#refs)
29
+ */
33
30
  ref?: EventHandler<T | undefined> | Ref<T>;
31
+ /**
32
+ * [Documentation](https://qawebgis.esri.com/components/lumina/jsx#lit-directives)
33
+ */
34
34
  directives?: readonly DirectiveResult[];
35
+ /**
36
+ * [Documentation](https://qawebgis.esri.com/components/lumina/jsx#deferring-web-component-load)
37
+ */
38
+ deferLoad?: true;
35
39
  }
@@ -1,10 +1,11 @@
1
- import type { Nil } from "@arcgis/components-utils";
2
- import type { Properties as CssProperties } from "csstype";
3
- import type { ClassInfo } from "lit-html/directives/class-map.js";
4
- import type { DirectiveResult } from "lit/directive.js";
5
- import type { ClassMapDirective } from "lit/directives/class-map.js";
6
- import type { StyleMapDirective } from "lit/directives/style-map.js";
7
- import type { DirectiveClass } from "lit-html/directive.js";
1
+ import { Nil } from '@arcgis/components-utils';
2
+ import { Properties as CssProperties } from 'csstype';
3
+ import { ClassInfo } from 'lit-html/directives/class-map.js';
4
+ import { DirectiveResult } from 'lit/directive.js';
5
+ import { ClassMapDirective } from 'lit/directives/class-map.js';
6
+ import { StyleMapDirective } from 'lit/directives/style-map.js';
7
+ import { DirectiveClass, ElementPart, Directive } from 'lit-html/directive.js';
8
+ import { noChange } from 'lit';
8
9
  /**
9
10
  * You likely won't have to import this directly. It will be added during
10
11
  * _JSX to lit-html_ conversion.
@@ -55,6 +56,22 @@ export declare const safeClassMap: (parameters: ClassInfo | Nil | string) => Dir
55
56
  * @private
56
57
  */
57
58
  export declare const safeStyleMap: (parameters: CssProperties | Nil | string) => DirectiveResult<typeof StyleMapDirective> | Nil | string;
59
+ declare class DeferLoad extends Directive {
60
+ update(part: ElementPart): void;
61
+ render(): typeof noChange;
62
+ }
63
+ /**
64
+ * @private
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)
67
+ */
68
+ export declare const deferLoad: DirectiveResult<typeof DeferLoad>;
69
+ /**
70
+ * @private
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)
73
+ */
74
+ export declare const deferredLoaders: Map<string, () => Promise<unknown>>;
58
75
  /**
59
76
  * Creates a user-facing directive function from a Directive class. This
60
77
  * function has the same parameters as the directive's render() method.
@@ -75,3 +92,4 @@ export declare const directive: <C extends DirectiveClass>(c: C) => (...values:
75
92
  * "never" to allow it be set as a value for any JSX attribute.
76
93
  */
77
94
  export declare const live: (value: unknown) => never;
95
+ export {};
@@ -1,13 +1,9 @@
1
- /**
2
- * Parts of this file are auto-generated or auto-updated by the `generate-jsx-types`
3
- * script.
4
- */
5
- import type { DirectiveResult } from "lit/directive.js";
6
- import type { ClassInfo, ClassMapDirective } from "lit/directives/class-map.js";
7
- import type { StyleMapDirective } from "lit/directives/style-map.js";
8
- import type { ChangeEventHandlerUnion, CustomAttributes, EventHandlerUnion, FocusEventHandlerUnion, InputEventHandlerUnion } from "./baseTypes";
9
- import type { JsxNode } from "./types";
10
- import type { Properties as CssProperties } from "csstype";
1
+ import { DirectiveResult } from 'lit/directive.js';
2
+ import { ClassInfo, ClassMapDirective } from 'lit/directives/class-map.js';
3
+ import { StyleMapDirective } from 'lit/directives/style-map.js';
4
+ import { ChangeEventHandlerUnion, CustomAttributes, EventHandlerUnion, FocusEventHandlerUnion, InputEventHandlerUnion } from './baseTypes';
5
+ import { JsxNode } from './types';
6
+ import { Properties as CssProperties } from 'csstype';
11
7
  /**
12
8
  * Some attributes accepts numbers as a number or as a string, while also
13
9
  * accepting "inherit". Define the type as `number | string | "inherit"` rather
@@ -1,15 +1,7 @@
1
- /**
2
- * This reference directive is removed by tsup at compile time. It is only
3
- * needed to correctly type-check this package. For consumers of this package,
4
- * they should have an `./src/lumina.ts` file like so:
5
- * ```ts
6
- * /// <reference types="@arcgis/lumina/typings" />
7
- * ```
8
- */
9
- import type { TemplateResult } from "lit-html";
10
- import type { DirectiveResult } from "lit-html/directive.js";
11
- import type { HTMLElementTags, HTMLAttributes, GlobalEventHandlersCamelCase, SvgElementTags, DOMAttributes, AriaAttributes } from "./generatedTypes";
12
- import type { CustomAttributes } from "./baseTypes";
1
+ import { TemplateResult } from 'lit-html';
2
+ import { DirectiveResult } from 'lit-html/directive.js';
3
+ import { HTMLElementTags, HTMLAttributes, GlobalEventHandlersCamelCase, SvgElementTags, DOMAttributes, AriaAttributes } from './generatedTypes';
4
+ import { CustomAttributes } from './baseTypes';
13
5
  /**
14
6
  * The "h" namespace is used to import JSX types for elements and attributes.
15
7
  * It is imported in order to avoid conflicting global JSX issues.
@@ -372,27 +364,8 @@ type FixupStencilEventCasing<PropertyName extends PropertyKey> = PropertyName ex
372
364
  * https://www.typescriptlang.org/docs/handbook/jsx.html
373
365
  */
374
366
  export declare namespace LuminaJsx {
375
- /**
376
- * Whether to pick TemplateResult or JsxNode here is a compromise.
377
- *
378
- * - If I tell it Lit JSX type is JsxNode, then even <a /> expression will
379
- * have a very broad JsxNode type (union of template results, null,
380
- * undefined, false, and more). This may slow down type-checking and may be
381
- * too-broad for certain use cases.
382
- * - Since <a /> would be typed very broad, you won't be able to declare
383
- * your function as receiving just TemplateResult
384
- * - Also, this makes TypeScript not allow you to return undefined from
385
- * your functional component
386
- * - This is what React did and what I am going with
387
- * - If I tell TypeScript that JSX type is TemplateResult, then my function
388
- * component is no longer allowed to return undefined or string or etc.
389
- *
390
- * This is mainly a TypeScript limitation. Issues tracking this:
391
- * - https://github.com/microsoft/TypeScript/issues/21699
392
- * - https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18912
393
- *
394
- */
395
367
  export type Element = TemplateResult;
368
+ export type ElementType = JsxNode;
396
369
  export interface ElementClass {
397
370
  }
398
371
  export interface ElementAttributesProperty {
@@ -1,7 +1,7 @@
1
- import { Deferred } from "@arcgis/components-utils";
2
- import type { LitElement } from "./LitElement";
3
- import type { Runtime } from "./runtime";
4
- import type { ControllerManager } from "@arcgis/components-controllers";
1
+ import { Deferred } from '@arcgis/components-utils';
2
+ import { LitElement } from './LitElement';
3
+ import { Runtime } from './makeRuntime';
4
+ import { ControllerManager } from './controllers/ControllerManager';
5
5
  /**
6
6
  * Defines lazy-loading proxy components for all web components in this package.
7
7
  *
@@ -47,32 +47,32 @@ declare const HtmlElement: {
47
47
  * component, so as to have identical DOM structure for lazy vs non-lazy builds
48
48
  * (otherwise, css selectors may break)
49
49
  *
50
- * @internal
50
+ * @private
51
51
  */
52
52
  export declare abstract class ProxyComponent extends HtmlElement {
53
53
  static observedAttributes?: readonly string[];
54
- /** @internal */
54
+ /** @private */
55
55
  static _loadPromise: Promise<Record<string, typeof LitElement>> | undefined;
56
- /** @internal */
56
+ /** private */
57
57
  static _LitConstructor?: typeof LitElement;
58
58
  /**
59
59
  * A list of instances of this component. This allows hot module replacement
60
60
  * to update all proxy component to use a new LitElement instance.
61
61
  *
62
- * @internal
62
+ * private
63
63
  */
64
64
  static _hmrInstances: WeakRef<ProxyComponent>[] | undefined;
65
- /** @internal */
65
+ /** private */
66
66
  static _hmrIndex: number | undefined;
67
- /** @internal */
67
+ /** private */
68
68
  static _properties?: readonly string[];
69
- /** @internal */
69
+ /** private */
70
70
  static _asyncMethods?: readonly string[];
71
- /** @internal */
71
+ /** private */
72
72
  static _syncMethods?: readonly string[];
73
73
  protected static _name: string;
74
74
  static readonly lumina = true;
75
- /** @internal */
75
+ /** private */
76
76
  static _initializePrototype(): void;
77
77
  private static _bindProp;
78
78
  private static _bindAsync;
@@ -81,14 +81,14 @@ export declare abstract class ProxyComponent extends HtmlElement {
81
81
  * On HMR, preserve the values of all properties that at least once were set
82
82
  * by someone other than component itself.
83
83
  *
84
- * @internal
84
+ * private
85
85
  */
86
86
  _hmrSetProps: Set<PropertyKey>;
87
- /** @internal */
87
+ /** private */
88
88
  _hmrSetAttributes: Set<string>;
89
- /** @internal */
89
+ /** private */
90
90
  _litElement: LitElement | undefined;
91
- /** @internal */
91
+ /** private */
92
92
  _store: LitElement | Record<string, unknown>;
93
93
  /**
94
94
  * If attributeChangedCallback() is called before the LitElement is loaded,
@@ -153,7 +153,7 @@ export declare abstract class ProxyComponent extends HtmlElement {
153
153
  * Create a promise that resolves once component is fully loaded
154
154
  */
155
155
  componentOnReady(): Promise<this>;
156
- /** @internal */
156
+ /** private */
157
157
  _initializeComponent(module: Record<string, typeof LitElement>): void;
158
158
  /**
159
159
  * Implemented on the proxy for compatibility with Lit Context.
@@ -1,4 +1,4 @@
1
- import type { ProxyComponent } from "./lazyLoad";
1
+ import { ProxyComponent } from './lazyLoad';
2
2
  /**
3
3
  * If there is a parent component, tell it to await it's loaded() until we
4
4
  * completed load().
@@ -0,0 +1,109 @@
1
+ import { CSSResult } from 'lit';
2
+ import { LitElement } from './LitElement';
3
+ /**
4
+ * `@arcgis/lumina` package may be bundled once but used by multiple packages with
5
+ * different configuration options. For that reason, the configuration options
6
+ * cannot be a global object, but has to be an object that you pass around.
7
+ */
8
+ export type Runtime = RuntimeOptions & {
9
+ /**
10
+ * Get the base path to where the package assets can be found.
11
+ * By default, the package asset path is set to `https://js.arcgis.com/<simplified-package-name>/<released-verion>/`.
12
+ * We are hosting our assets on a CDN (Content Delivery Network) to ensure fast and reliable access.
13
+ * It is CORS-enabled, so you can load the assets from any domain.
14
+ * Use "setAssetPath(path)" if the path needs to be customized.
15
+ */
16
+ readonly getAssetPath: (suffix: string) => string;
17
+ /**
18
+ * Used to manually set the base path where package assets (like localization
19
+ * and icons) can be found.
20
+ *
21
+ * By default, the package asset path is set to `https://js.arcgis.com/<simplified-package-name>/<released-verion>/`.
22
+ * For example, `https://js.arcgis.com/map-components/4.30/`.
23
+ * We are hosting our assets on a CDN (Content Delivery Network) to ensure fast and reliable access.
24
+ * It is CORS-enabled, so you can load the assets from any domain.
25
+ * This is the recommended way to load the assets and avoid bundling them with your application.
26
+ * It means that by default, you don't need to use "setAssetPath" since the path is already set.
27
+ *
28
+ * However, if you need to host the assets locally, you can use "setAssetPath" to set the base path.
29
+ * If the script is used as "module", it's recommended to use "import.meta.url",
30
+ * such as "setAssetPath(import.meta.url)". Other options include
31
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
32
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
33
+ * But do note that this configuration depends on how your script is bundled, or lack of
34
+ * bundling, and where your assets can be loaded from. Additionally custom bundling
35
+ * will have to ensure the static assets are copied to its build directory.
36
+ */
37
+ readonly setAssetPath: (path: URL | string) => void;
38
+ /**
39
+ * The customElement decorator. Unlike default Lit's decorator this one
40
+ * provides runtime instance to the LitElement class
41
+ *
42
+ * @remarks
43
+ * You do not need to call this decorator in your component.
44
+ * It will be added automatically at build time.
45
+ *
46
+ * Instead, make sure your component file has the following:
47
+ * ```ts
48
+ * declare global {
49
+ * interface DeclareElements {
50
+ * "arcgis-your-component": ArcgisYourComponent;
51
+ * }
52
+ * }
53
+ * ```
54
+ */
55
+ readonly customElement: (tagName: string, component: typeof LitElement) => void;
56
+ };
57
+ export type RuntimeOptions = {
58
+ /**
59
+ * The default asset path to use in NPM and CDN builds.
60
+ *
61
+ * This option will be set by Lumina compiler based on the value of the
62
+ * `assets.defaultPath` option in the `useLumina()` plugin.
63
+ */
64
+ readonly defaultAssetPath: string;
65
+ /**
66
+ * The attribute that indicates a component has rendered it's content.
67
+ * Usually this attribute is added after your component's `loaded()` lifecycle
68
+ * happened. However, during SSR, "hydrated" is added right away on the
69
+ * server.
70
+ *
71
+ * Until element has this attribute, it will have `visibility:hidden` style
72
+ * applied.
73
+ *
74
+ * This option will be set by the Lumina compiler based on the value of
75
+ * the `css.hydratedAttribute` option in the `useLumina()` plugin.
76
+ */
77
+ readonly hydratedAttribute: string;
78
+ /**
79
+ * Styles that you wish to make available in each component's shadow root, but
80
+ * to not apply outside the shadow root
81
+ *
82
+ * This option will be set by Lumina compiler based on the value of the
83
+ * `css.commonStylesPath` option in the `useLumina()` plugin.
84
+ */
85
+ readonly commonStyles?: CSSResult;
86
+ };
87
+ /**
88
+ * The options object will be provided by Lumina compiler at build-time.
89
+ * It should not be specified in the source code.
90
+ */
91
+ export declare function makeRuntime(options?: RuntimeOptions): Runtime;
92
+ /**
93
+ * Exposing the reference to the runtime globally when in tests or development.
94
+ * This is primarily for usage by dynamically created components in tests
95
+ *
96
+ * @private
97
+ */
98
+ export type DevOnlyGlobalRuntime = typeof globalThis & {
99
+ devOnly$luminaRuntime?: Runtime;
100
+ };
101
+ /**
102
+ * Called from the component constructor when in development or test mode.
103
+ * Used primarily by mount to get a reference to the rendered component.
104
+ *
105
+ * @private
106
+ */
107
+ export type DevOnlyGlobalComponentRefCallback = typeof globalThis & {
108
+ devOnly$luminaComponentRefCallback?: (component: LitElement) => void;
109
+ };
@@ -0,0 +1,60 @@
1
+ import { e as setParentController, f as retrieveParentControllers, u as setAmbientChildController, t as trackKey, l as bypassReadOnly } from "./Controller-CZ8Djohh.js";
2
+ const proxyExports = (Class) => (...args) => {
3
+ const ambientControllers = retrieveParentControllers();
4
+ const instance = new Class(...args);
5
+ const initialExports = instance.exports;
6
+ setParentController(ambientControllers.at(-1));
7
+ const manager = instance.component.manager;
8
+ manager._markExports(instance, initialExports);
9
+ instance.watchExports((exports) => manager._markExports(instance, exports));
10
+ setAmbientChildController(instance);
11
+ const hostCandidates = [instance.component, ...ambientControllers].reverse();
12
+ return trackKey(
13
+ hostCandidates,
14
+ (resolution) => resolution === void 0 ? void 0 : setProxy(instance, resolution, initialExports),
15
+ initialExports
16
+ );
17
+ };
18
+ function setProxy(controller, { host, key, isReactive: assignedToProp }, initialExports) {
19
+ const genericHost = host;
20
+ const controllerValueChanged = genericHost[key] !== controller.exports;
21
+ const hostValueChanged = genericHost[key] !== initialExports;
22
+ const controllerUpdatedExports = initialExports !== controller.exports;
23
+ if (controllerValueChanged && !hostValueChanged && controllerUpdatedExports) {
24
+ genericHost[key] = controller.exports;
25
+ }
26
+ const isProxyExportsOnComponent = host === controller.component;
27
+ if (isProxyExportsOnComponent) {
28
+ if (assignedToProp) {
29
+ const manager = controller.component.manager;
30
+ if (hostValueChanged) {
31
+ manager._markExports(controller, genericHost[key]);
32
+ }
33
+ controller.onUpdate((changes) => {
34
+ if (changes.has(key)) {
35
+ const value = genericHost[key];
36
+ if (value !== controller.exports) {
37
+ manager._markExports(controller, value);
38
+ }
39
+ }
40
+ });
41
+ }
42
+ controller.assignedProperty = assignedToProp ? void 0 : key;
43
+ }
44
+ const isReadOnly = controller.component.constructor.elementProperties.get(key)?.readOnly;
45
+ controller.watchExports(() => {
46
+ if (genericHost[key] === controller.exports) {
47
+ return;
48
+ }
49
+ if (isReadOnly) {
50
+ bypassReadOnly(() => {
51
+ genericHost[key] = controller.exports;
52
+ });
53
+ } else {
54
+ genericHost[key] = controller.exports;
55
+ }
56
+ });
57
+ }
58
+ export {
59
+ proxyExports as p
60
+ };
@@ -0,0 +1,5 @@
1
+ import { JsxNode } from './jsx/types';
2
+ /**
3
+ * Retrieve an HTML element to be manually appended to an existing component.
4
+ */
5
+ export declare function renderElement<Element extends HTMLElement = HTMLElement>(element: JsxNode): Element;
package/dist/runtime.d.ts CHANGED
@@ -1,109 +1,6 @@
1
- import type { CSSResult } from "lit";
2
- import type { LitElement } from "./LitElement";
1
+ export declare const runtime: import('./makeRuntime').Runtime;
3
2
  /**
4
- * `@arcgis/lumina` package may be bundled once but used by multiple packages with
5
- * different configuration options. For that reason, the configuration options
6
- * cannot be a global object, but has to be an object that you pass around.
3
+ * "customElement" needs to be exported - it will be used by the build system.
4
+ * You should not call it directly.
7
5
  */
8
- export type Runtime = RuntimeOptions & {
9
- /**
10
- * Get the base path to where the package assets can be found.
11
- * By default, the package asset path is set to `https://js.arcgis.com/<simplified-package-name>/<released-verion>/`.
12
- * We are hosting our assets on a CDN (Content Delivery Network) to ensure fast and reliable access.
13
- * It is CORS-enabled, so you can load the assets from any domain.
14
- * Use "setAssetPath(path)" if the path needs to be customized.
15
- */
16
- readonly getAssetPath: (suffix: string) => string;
17
- /**
18
- * Used to manually set the base path where package assets (like localization
19
- * and icons) can be found.
20
- *
21
- * By default, the package asset path is set to `https://js.arcgis.com/<simplified-package-name>/<released-verion>/`.
22
- * For example, `https://js.arcgis.com/map-components/4.30/`.
23
- * We are hosting our assets on a CDN (Content Delivery Network) to ensure fast and reliable access.
24
- * It is CORS-enabled, so you can load the assets from any domain.
25
- * This is the recommended way to load the assets and avoid bundling them with your application.
26
- * It means that by default, you don't need to use "setAssetPath" since the path is already set.
27
- *
28
- * However, if you need to host the assets locally, you can use "setAssetPath" to set the base path.
29
- * If the script is used as "module", it's recommended to use "import.meta.url",
30
- * such as "setAssetPath(import.meta.url)". Other options include
31
- * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
32
- * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
33
- * But do note that this configuration depends on how your script is bundled, or lack of
34
- * bundling, and where your assets can be loaded from. Additionally custom bundling
35
- * will have to ensure the static assets are copied to its build directory.
36
- */
37
- readonly setAssetPath: (path: URL | string) => void;
38
- /**
39
- * The customElement decorator. Unlike default Lit's decorator this one
40
- * provides runtime instance to the LitElement class
41
- *
42
- * @remarks
43
- * You do not need to call this decorator in your component.
44
- * It will be added automatically at build time.
45
- *
46
- * Instead, make sure your component file has the following:
47
- * ```ts
48
- * declare global {
49
- * interface DeclareElements {
50
- * "arcgis-your-component": ArcgisYourComponent;
51
- * }
52
- * }
53
- * ```
54
- */
55
- readonly customElement: (tagName: string, component: typeof LitElement) => void;
56
- };
57
- export type RuntimeOptions = {
58
- /**
59
- * The default asset path to use in NPM and CDN builds.
60
- *
61
- * This option will be set by Lumina compiler based on the value of the
62
- * `assets.defaultPath` option in the `useLumina()` plugin.
63
- */
64
- readonly defaultAssetPath: string;
65
- /**
66
- * The attribute that indicates a component has rendered it's content.
67
- * Usually this attribute is added after your component's `loaded()` lifecycle
68
- * happened. However, during SSR, "hydrated" is added right away on the
69
- * server.
70
- *
71
- * Until element has this attribute, it will have `visibility:hidden` style
72
- * applied.
73
- *
74
- * This option will be set by the Lumina compiler based on the value of
75
- * the `css.hydratedAttribute` option in the `useLumina()` plugin.
76
- */
77
- readonly hydratedAttribute: string;
78
- /**
79
- * Styles that you wish to make available in each component's shadow root, but
80
- * to not apply outside the shadow root
81
- *
82
- * This option will be set by Lumina compiler based on the value of the
83
- * `css.commonStylesPath` option in the `useLumina()` plugin.
84
- */
85
- readonly commonStyles?: CSSResult;
86
- };
87
- /**
88
- * The options object will be provided by Lumina compiler at build-time.
89
- * It should not be specified in the source code.
90
- */
91
- export declare function makeRuntime(options?: RuntimeOptions): Runtime;
92
- /**
93
- * Exposing the reference to the runtime globally when in tests or development.
94
- * This is primarily for usage by dynamically created components in tests
95
- *
96
- * @private
97
- */
98
- export type DevOnlyGlobalRuntime = typeof globalThis & {
99
- devOnly$luminaRuntime?: Runtime;
100
- };
101
- /**
102
- * Called from the component constructor when in development or test mode.
103
- * Used primarily by mount to get a reference to the rendered component.
104
- *
105
- * @private
106
- */
107
- export type DevOnlyGlobalComponentRefCallback = typeof globalThis & {
108
- devOnly$luminaComponentRefCallback?: (component: LitElement) => void;
109
- };
6
+ export declare const customElement: (tagName: string, component: typeof import('./LitElement').LitElement) => void;
@@ -1,9 +1,5 @@
1
- /**
2
- * Lots of silencing of ESLint in this file to be compatible with Stencil's
3
- * unsafe typings.
4
- */
5
- import { type RenderInfo } from "@lit-labs/ssr/lib/render.js";
6
- import type { Readable } from "node:stream";
1
+ import { RenderInfo } from '@lit-labs/ssr/lib/render.js';
2
+ import { Readable } from 'node:stream';
7
3
  /**
8
4
  * @deprecated
9
5
  * Use `render` from `@lit-labs/ssr` instead.
@@ -1,11 +1,10 @@
1
- // src/stencilSsrCompatibility/index.ts
2
1
  import { getWindow } from "@lit-labs/ssr/lib/dom-shim.js";
3
2
  import { render } from "@lit-labs/ssr/lib/render.js";
4
3
  import { html } from "@lit-labs/ssr/lib/server-template.js";
5
- import { unsafeStatic, withStatic } from "lit-html/static.js";
4
+ import { withStatic, unsafeStatic } from "lit-html/static.js";
6
5
  import { collectResult } from "@lit-labs/ssr/lib/render-result.js";
7
6
  import { RenderResultReadable } from "@lit-labs/ssr/lib/render-result-readable.js";
8
- var staticHtml = withStatic(html);
7
+ const staticHtml = withStatic(html);
9
8
  function createWindowFromHtml(templateHtml, uniqueId = Math.random().toString()) {
10
9
  const window = getWindow({ includeJSBuiltIns: true });
11
10
  window.document.defaultView = window;
@@ -7,7 +7,7 @@ interface ImportMetaEnv {
7
7
  }
8
8
  interface ImportMeta {
9
9
  url: string;
10
- readonly hot?: import("vite/types/hot.d.ts").ViteHotContext;
10
+ readonly hot?: import('vite/types/hot.d.ts').ViteHotContext;
11
11
  readonly env: ImportMetaEnv;
12
- glob: import("vite/types/importGlob.d.ts").ImportGlobFunction;
12
+ glob: import('vite/types/importGlob.d.ts').ImportGlobFunction;
13
13
  }