@arcgis/lumina 6.0.0-next.13 → 6.0.0-next.14
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/chunks/GenericController.js +1 -2
- package/dist/chunks/lazyLoad.js +2 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +2 -48
- package/package.json +2 -2
- package/dist/wrappersUtils.d.ts +0 -44
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { safeCall, isEsriInternalEnv, safeAsyncCall } from "@arcgis/toolkit/error";
|
|
2
2
|
import { r as retrieveComponent, b as retrieveParentControllers, a as setParentController, s as setAmbientComponent, u as use, j as useRef, k as useRefSync, d as controllerSymbol } from "./ControllerInternals.js";
|
|
3
3
|
import { nothing } from "lit";
|
|
4
|
-
import { Deferred } from "@arcgis/toolkit/promise";
|
|
5
4
|
import { rethrowError } from "@arcgis/toolkit/log";
|
|
6
5
|
const trackPropertyKey = (object, onResolved, defaultValue) => {
|
|
7
6
|
const keys = Object.keys(object);
|
|
@@ -143,7 +142,7 @@ class Controller {
|
|
|
143
142
|
this.#hostLifecycle = [];
|
|
144
143
|
this.#lifecycleCleanups = [];
|
|
145
144
|
this.#loadCalled = false;
|
|
146
|
-
this.P =
|
|
145
|
+
this.P = Promise.withResolvers();
|
|
147
146
|
this.connectedCalled = false;
|
|
148
147
|
this.loadedCalled = false;
|
|
149
148
|
this[_a] = true;
|
package/dist/chunks/lazyLoad.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isEsriInternalEnv } from "@arcgis/toolkit/error";
|
|
2
2
|
import { camelToKebab } from "@arcgis/toolkit/string";
|
|
3
|
-
import { Deferred } from "@arcgis/toolkit/promise";
|
|
4
3
|
import { lazyMetaGroupJoiner, lazyMetaItemJoiner, lazyMetaSubItemJoiner } from "../config.js";
|
|
5
4
|
function devOnlyDetectIncorrectLazyUsages(LitClass) {
|
|
6
5
|
const genericPrototype = LitClass.prototype;
|
|
@@ -182,8 +181,8 @@ class ProxyComponent extends HtmlElement {
|
|
|
182
181
|
super();
|
|
183
182
|
this.#store = {};
|
|
184
183
|
this.#pendingAttributes = [];
|
|
185
|
-
this.I =
|
|
186
|
-
this.H =
|
|
184
|
+
this.I = Promise.withResolvers();
|
|
185
|
+
this.H = Promise.withResolvers();
|
|
187
186
|
this.J = [];
|
|
188
187
|
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
|
|
189
188
|
this.devOnly$hmrSetProps = /* @__PURE__ */ new Set();
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,5 @@ export * from "./jsx/types.js";
|
|
|
12
12
|
export { safeClassMap, safeStyleMap, deferLoad, deferredLoaders, stabilizedRef, directive, live } from "./jsx/directives.js";
|
|
13
13
|
export { nothing, noChange, setAttribute, stringOrBoolean } from "./jsx/utils.js";
|
|
14
14
|
export { noShadowRoot, devOnly$getLitElementTagNameAndRuntime } from "./utils.js";
|
|
15
|
-
export { makeReactWrapperFactory, getReactWrapperOptions } from "./wrappersUtils.js";
|
|
16
15
|
export { renderElement } from "./render.js";
|
|
17
16
|
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import { e as emptyFunction, n as noShadowRoot, p as proxyFormMethodsToEvents, a
|
|
|
6
6
|
import { d, m } from "./chunks/lazyLoad.js";
|
|
7
7
|
import { isEsriInternalEnv, safeAsyncCall, safeCall } from "@arcgis/toolkit/error";
|
|
8
8
|
import { camelToKebab } from "@arcgis/toolkit/string";
|
|
9
|
-
import { Deferred } from "@arcgis/toolkit/promise";
|
|
10
9
|
import { LitElement as LitElement$1, isServer, notEqual, noChange as noChange$1, nothing as nothing$1, render } from "lit";
|
|
11
10
|
import { h as shouldBypassReadOnly, d as controllerSymbol } from "./chunks/ControllerInternals.js";
|
|
12
11
|
import { C as ControllerManager, b as autoDestroyDisabledPropName } from "./chunks/ControllerManager.js";
|
|
@@ -34,8 +33,8 @@ class LitElement extends LitElement$1 {
|
|
|
34
33
|
const lazy = constructor.N;
|
|
35
34
|
const createObservable = constructor.K.o;
|
|
36
35
|
const ourShouldUpdate = LitElement.prototype.shouldUpdate;
|
|
37
|
-
that.#postLoadedDeferred = lazy?.H ??
|
|
38
|
-
that.I = lazy?.I ??
|
|
36
|
+
that.#postLoadedDeferred = lazy?.H ?? Promise.withResolvers();
|
|
37
|
+
that.I = lazy?.I ?? Promise.withResolvers();
|
|
39
38
|
that.J = lazy?.J ?? [];
|
|
40
39
|
that["_offspring"] = that.J;
|
|
41
40
|
that["_postLoad"] = that.I;
|
|
@@ -502,49 +501,6 @@ function setAttribute(element, attributeName, value) {
|
|
|
502
501
|
const stringOrBoolean = {
|
|
503
502
|
toAttribute: (value) => value === true ? "" : value === false ? null : value
|
|
504
503
|
};
|
|
505
|
-
const emptyObject = {};
|
|
506
|
-
const makeReactWrapperFactory = (react, createComponent) => (options) => {
|
|
507
|
-
const tagName = options.tagName;
|
|
508
|
-
let customElementPrototype = emptyObject;
|
|
509
|
-
const elementClass = {
|
|
510
|
-
name: tagName,
|
|
511
|
-
/**
|
|
512
|
-
* Lit's createComponent tries to access the elementClass.prototype in
|
|
513
|
-
* global scope (in development mode). The elementClass may not be defined
|
|
514
|
-
* yet (because we are in a lazy loading build, or because current app
|
|
515
|
-
* doesn't import a given custom element as it doesn't use it).
|
|
516
|
-
*
|
|
517
|
-
* Thus, we return an empty object as a fake prototype.
|
|
518
|
-
*
|
|
519
|
-
* Right after the call to `createComponent`, we set to
|
|
520
|
-
* customElementPrototype undefined so that the next access of
|
|
521
|
-
* `.prototype` tries to get the real prototype.
|
|
522
|
-
* `createPrototypeProxy()` is called, this small proxy delays retrieving the custom
|
|
523
|
-
* element prototype until it is actually needed, and caches the result for future calls.
|
|
524
|
-
*/
|
|
525
|
-
get prototype() {
|
|
526
|
-
if (customElementPrototype === void 0) {
|
|
527
|
-
const customElement = customElements.get(tagName);
|
|
528
|
-
if (!customElement) {
|
|
529
|
-
throw new Error(`Custom element "${tagName}" not found`);
|
|
530
|
-
}
|
|
531
|
-
customElement.F?.();
|
|
532
|
-
customElement.F = emptyFunction;
|
|
533
|
-
customElementPrototype = customElement.prototype;
|
|
534
|
-
Object.defineProperty(elementClass, "prototype", { value: customElementPrototype });
|
|
535
|
-
}
|
|
536
|
-
return customElementPrototype;
|
|
537
|
-
}
|
|
538
|
-
};
|
|
539
|
-
const result = createComponent({
|
|
540
|
-
...options,
|
|
541
|
-
react,
|
|
542
|
-
elementClass
|
|
543
|
-
});
|
|
544
|
-
customElementPrototype = void 0;
|
|
545
|
-
return result;
|
|
546
|
-
};
|
|
547
|
-
const getReactWrapperOptions = (tagNameAndElement, events) => ({ tagName: tagNameAndElement, events });
|
|
548
504
|
const renderElement = (element) => {
|
|
549
505
|
const container = document.createElement("div");
|
|
550
506
|
render(element, container);
|
|
@@ -563,10 +519,8 @@ export {
|
|
|
563
519
|
d as devOnly$getLitElementTagNameAndRuntime,
|
|
564
520
|
directive,
|
|
565
521
|
disableReactiveUtilsIntegration,
|
|
566
|
-
getReactWrapperOptions,
|
|
567
522
|
live,
|
|
568
523
|
m as makeDefineCustomElements,
|
|
569
|
-
makeReactWrapperFactory,
|
|
570
524
|
makeRuntime,
|
|
571
525
|
method,
|
|
572
526
|
noChange,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/lumina",
|
|
3
|
-
"version": "6.0.0-next.
|
|
3
|
+
"version": "6.0.0-next.14",
|
|
4
4
|
"description": "Runtime for WebGIS SDK web components",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
],
|
|
37
37
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@arcgis/toolkit": "~6.0.0-next.
|
|
39
|
+
"@arcgis/toolkit": "~6.0.0-next.14",
|
|
40
40
|
"csstype": "^3.1.3",
|
|
41
41
|
"tslib": "^2.8.1"
|
|
42
42
|
},
|
package/dist/wrappersUtils.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/** @internal */
|
|
2
|
-
export interface Options<I extends HTMLElement, E extends EventNames> {
|
|
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;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/** @internal */
|
|
16
|
-
export type EventNames = Record<string, string>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Wrap `createComponent` from `@lit/react` to improve lazy loading
|
|
20
|
-
* compatibility.
|
|
21
|
-
*
|
|
22
|
-
* @deprecated since 5.0. React wrappers are not needed in React 19 or above
|
|
23
|
-
* @param react
|
|
24
|
-
* @param createComponent
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
export function makeReactWrapperFactory(react: unknown, createComponent: (options: Options<HTMLElement, EventNames>) => unknown): ((options: Pick<Options<HTMLElement, EventNames>, "events" | "tagName">) => unknown);
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Helper for `createComponent` to declare options in a type-safe and concise
|
|
31
|
-
* manner.
|
|
32
|
-
*
|
|
33
|
-
* Only tagName and events need to be provided to the wrapped version of the
|
|
34
|
-
* `createComponent` function. However, since we inherit the typings from
|
|
35
|
-
* the original `createComponent`, TypeScript would still force us to provide
|
|
36
|
-
* `react` and `elementClass` properties - instead, this helper convinces
|
|
37
|
-
* TypeScript that we are providing `react` and `elementClass` properties.
|
|
38
|
-
*
|
|
39
|
-
* @deprecated since 5.0. React wrappers are not needed in React 19 or above
|
|
40
|
-
* @param tagNameAndElement
|
|
41
|
-
* @param events
|
|
42
|
-
* @internal
|
|
43
|
-
*/
|
|
44
|
-
export function getReactWrapperOptions<Element extends HTMLElement, Events extends EventNames>(tagNameAndElement: Element, events: Events): Options<Element & { class?: string; }, Events>;
|