@arcgis/lumina 4.34.0-next.4 → 4.34.0-next.40
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/{Controller-BQOv8BAL.js → Controller-6vd9TSNE.js} +6 -133
- package/dist/ControllerInternals-DOZNgCJl.js +134 -0
- package/dist/context.js +18 -0
- package/dist/controllers/accessor/index.js +22 -16
- package/dist/controllers/accessor/store.d.ts +1 -1
- package/dist/controllers/accessor/useAccessor.d.ts +8 -3
- package/dist/controllers/index.js +12 -10
- package/dist/index.d.ts +9 -1
- package/dist/index.js +7 -16
- package/dist/jsx/generatedTypes.d.ts +8 -0
- package/dist/{proxyExports-Cdzj7WL_.js → proxyExports-BgcDxXBO.js} +2 -1
- package/package.json +3 -2
|
@@ -1,121 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { safeCall, isEsriInternalEnv, Deferred, safeAsyncCall } from "@arcgis/components-utils";
|
|
2
|
+
import { r as retrieveComponent, d as retrieveParentControllers, b as setParentController, s as setAmbientComponent, u as use, k as useRef, l as useRefSync, c as controllerSymbol } from "./ControllerInternals-DOZNgCJl.js";
|
|
2
3
|
import { nothing } from "lit";
|
|
3
|
-
const controllerSymbol = Symbol.for("controller");
|
|
4
|
-
const isController = (value) => typeof value === "object" && value !== null && (controllerSymbol in value || "hostConnected" in value || "hostDisconnected" in value || "hostUpdate" in value || "hostUpdated" in value);
|
|
5
|
-
const isPromise = (arg) => typeof arg?.then === "function";
|
|
6
|
-
const getControllersCount = (component) => component.M.length;
|
|
7
|
-
let ambientComponent;
|
|
8
|
-
const setAmbientComponent = (component) => {
|
|
9
|
-
if (ambientComponent === component) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
ambientComponent = component;
|
|
13
|
-
queueMicrotask(() => ambientComponent === component ? ambientComponent = void 0 : 0);
|
|
14
|
-
};
|
|
15
|
-
const retrieveComponent = (name) => {
|
|
16
|
-
if (process.env.NODE_ENV !== "production" && ambientComponent === void 0) {
|
|
17
|
-
throw new Error(
|
|
18
|
-
[
|
|
19
|
-
`Unable to find out which component ${name || "this"} controller `,
|
|
20
|
-
"belongs to. Possible causes:\n",
|
|
21
|
-
"- You might have multiple versions of ",
|
|
22
|
-
"@arcgis/lumina package installed\n",
|
|
23
|
-
...isEsriInternalEnv() ? [
|
|
24
|
-
"- You tried to create controller outside the component. If so, ",
|
|
25
|
-
"please wrap your controller definition in an arrow function (like",
|
|
26
|
-
"`const myController = ()=>makeController(...);`) and call that",
|
|
27
|
-
"function inside the component (`my = myController();`), or ",
|
|
28
|
-
"define your controller using makeGenericController/GenericController ",
|
|
29
|
-
"instead.\n",
|
|
30
|
-
"- You tried to create a controller inside an async function. ",
|
|
31
|
-
"This is allowed without calling controller.use(). Make sure you ",
|
|
32
|
-
"use it like `await controller.use(useController())`."
|
|
33
|
-
] : []
|
|
34
|
-
].join("")
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
return ambientComponent;
|
|
38
|
-
};
|
|
39
|
-
let ambientControllers = [];
|
|
40
|
-
const setParentController = (controller) => {
|
|
41
|
-
if (controller === void 0) {
|
|
42
|
-
ambientControllers = [];
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const index = ambientControllers.indexOf(controller);
|
|
46
|
-
ambientControllers = index === -1 ? [...ambientControllers, controller] : ambientControllers.slice(0, index + 1);
|
|
47
|
-
queueMicrotask(() => ambientControllers = []);
|
|
48
|
-
};
|
|
49
|
-
const retrieveParentControllers = () => ambientControllers;
|
|
50
|
-
let ambientChildController;
|
|
51
|
-
const setAmbientChildController = (controller) => {
|
|
52
|
-
if (ambientChildController === controller) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
ambientChildController = controller;
|
|
56
|
-
queueMicrotask(() => ambientChildController === controller ? ambientChildController = void 0 : 0);
|
|
57
|
-
};
|
|
58
|
-
const retrieveAmbientChildController = () => {
|
|
59
|
-
const controller = ambientChildController;
|
|
60
|
-
ambientChildController = void 0;
|
|
61
|
-
return controller;
|
|
62
|
-
};
|
|
63
|
-
const use = async (value, watchExports) => {
|
|
64
|
-
const controller = useRefSync(value);
|
|
65
|
-
if (controller === void 0) {
|
|
66
|
-
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && typeof watchExports === "function") {
|
|
67
|
-
throw new Error(
|
|
68
|
-
`Unable to resolve a controller from the provided value, so can't watch it's exports. The value you passed is not a controller and not a controller exports. If your controller exports a literal value, try making your controller export an object instead`
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
return value;
|
|
72
|
-
}
|
|
73
|
-
await controller.ready;
|
|
74
|
-
if (typeof watchExports === "function") {
|
|
75
|
-
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && controller.watchExports === void 0) {
|
|
76
|
-
throw new Error(`The controller must implement watchExports method to support watching exports`);
|
|
77
|
-
}
|
|
78
|
-
const unsubscribe = controller.watchExports(
|
|
79
|
-
(exports) => watchExports(exports, unsubscribe)
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
return controller.exports;
|
|
83
|
-
};
|
|
84
|
-
const useRef = async (value) => {
|
|
85
|
-
const controller = useRefSync(value);
|
|
86
|
-
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && controller === void 0) {
|
|
87
|
-
throw new Error(
|
|
88
|
-
`Unable to resolve a controller from the provided value. The value you passed is not a controller and not a controller exports. If your controller exports a literal value, try making your controller export an object instead`
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
await controller.ready;
|
|
92
|
-
return controller;
|
|
93
|
-
};
|
|
94
|
-
const useRefSync = (value) => {
|
|
95
|
-
const component = retrieveComponent();
|
|
96
|
-
const controller = component.manager.X(value);
|
|
97
|
-
if (controller !== void 0) {
|
|
98
|
-
return controller;
|
|
99
|
-
}
|
|
100
|
-
if (isController(value)) {
|
|
101
|
-
return value;
|
|
102
|
-
}
|
|
103
|
-
const ambientChildController2 = retrieveAmbientChildController();
|
|
104
|
-
if (ambientChildController2 !== void 0) {
|
|
105
|
-
return ambientChildController2;
|
|
106
|
-
}
|
|
107
|
-
return void 0;
|
|
108
|
-
};
|
|
109
|
-
let shouldBypassReadOnly = false;
|
|
110
|
-
const bypassReadOnly = (callback) => {
|
|
111
|
-
shouldBypassReadOnly = true;
|
|
112
|
-
try {
|
|
113
|
-
return callback();
|
|
114
|
-
} finally {
|
|
115
|
-
shouldBypassReadOnly = false;
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
const bypassSetter = bypassReadOnly;
|
|
119
4
|
const trackPropertyKey = (object, onResolved, defaultValue) => {
|
|
120
5
|
const keys = Object.keys(object);
|
|
121
6
|
const keyCount = keys.length;
|
|
@@ -566,22 +451,10 @@ const accessBeforeLoad = process.env.NODE_ENV !== "production" && isEsriInternal
|
|
|
566
451
|
export {
|
|
567
452
|
Controller as C,
|
|
568
453
|
GenericController as G,
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
retrieveParentControllers as e,
|
|
574
|
-
createEventFactory as f,
|
|
575
|
-
bypassSetter as g,
|
|
576
|
-
bypassReadOnly as h,
|
|
577
|
-
isPromise as i,
|
|
578
|
-
trackPropertyKey as j,
|
|
454
|
+
createEventFactory as a,
|
|
455
|
+
trackPropertyKey as b,
|
|
456
|
+
createEvent as c,
|
|
457
|
+
trackPropKey as d,
|
|
579
458
|
keyTrackResolve as k,
|
|
580
|
-
trackPropKey as l,
|
|
581
|
-
isController as m,
|
|
582
|
-
getControllersCount as n,
|
|
583
|
-
setAmbientChildController as o,
|
|
584
|
-
retrieveComponent as r,
|
|
585
|
-
setAmbientComponent as s,
|
|
586
459
|
trackKey as t
|
|
587
460
|
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { isEsriInternalEnv } from "@arcgis/components-utils";
|
|
2
|
+
const controllerSymbol = Symbol.for("controller");
|
|
3
|
+
const isController = (value) => typeof value === "object" && value !== null && (controllerSymbol in value || "hostConnected" in value || "hostDisconnected" in value || "hostUpdate" in value || "hostUpdated" in value);
|
|
4
|
+
const isPromise = (arg) => typeof arg?.then === "function";
|
|
5
|
+
const getControllersCount = (component) => component.M.length;
|
|
6
|
+
let ambientComponent;
|
|
7
|
+
const setAmbientComponent = (component) => {
|
|
8
|
+
if (ambientComponent === component) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
ambientComponent = component;
|
|
12
|
+
queueMicrotask(() => ambientComponent === component ? ambientComponent = void 0 : 0);
|
|
13
|
+
};
|
|
14
|
+
const retrieveComponent = (name) => {
|
|
15
|
+
if (process.env.NODE_ENV !== "production" && ambientComponent === void 0) {
|
|
16
|
+
throw new Error(
|
|
17
|
+
[
|
|
18
|
+
`Unable to find out which component ${name || "this"} controller `,
|
|
19
|
+
"belongs to. Possible causes:\n",
|
|
20
|
+
"- You might have multiple versions of ",
|
|
21
|
+
"@arcgis/lumina package installed\n",
|
|
22
|
+
...isEsriInternalEnv() ? [
|
|
23
|
+
"- You tried to create controller outside the component. If so, ",
|
|
24
|
+
"please wrap your controller definition in an arrow function (like",
|
|
25
|
+
"`const myController = ()=>makeController(...);`) and call that",
|
|
26
|
+
"function inside the component (`my = myController();`), or ",
|
|
27
|
+
"define your controller using makeGenericController/GenericController ",
|
|
28
|
+
"instead.\n",
|
|
29
|
+
"- You tried to create a controller inside an async function. ",
|
|
30
|
+
"This is allowed without calling controller.use(). Make sure you ",
|
|
31
|
+
"use it like `await controller.use(useController())`."
|
|
32
|
+
] : []
|
|
33
|
+
].join("")
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
return ambientComponent;
|
|
37
|
+
};
|
|
38
|
+
let ambientControllers = [];
|
|
39
|
+
const setParentController = (controller) => {
|
|
40
|
+
if (controller === void 0) {
|
|
41
|
+
ambientControllers = [];
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const index = ambientControllers.indexOf(controller);
|
|
45
|
+
ambientControllers = index === -1 ? [...ambientControllers, controller] : ambientControllers.slice(0, index + 1);
|
|
46
|
+
queueMicrotask(() => ambientControllers = []);
|
|
47
|
+
};
|
|
48
|
+
const retrieveParentControllers = () => ambientControllers;
|
|
49
|
+
let ambientChildController;
|
|
50
|
+
const setAmbientChildController = (controller) => {
|
|
51
|
+
if (ambientChildController === controller) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
ambientChildController = controller;
|
|
55
|
+
queueMicrotask(() => ambientChildController === controller ? ambientChildController = void 0 : 0);
|
|
56
|
+
};
|
|
57
|
+
const retrieveAmbientChildController = () => {
|
|
58
|
+
const controller = ambientChildController;
|
|
59
|
+
ambientChildController = void 0;
|
|
60
|
+
return controller;
|
|
61
|
+
};
|
|
62
|
+
const use = async (value, watchExports) => {
|
|
63
|
+
const controller = useRefSync(value);
|
|
64
|
+
if (controller === void 0) {
|
|
65
|
+
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && typeof watchExports === "function") {
|
|
66
|
+
throw new Error(
|
|
67
|
+
`Unable to resolve a controller from the provided value, so can't watch it's exports. The value you passed is not a controller and not a controller exports. If your controller exports a literal value, try making your controller export an object instead`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
await controller.ready;
|
|
73
|
+
if (typeof watchExports === "function") {
|
|
74
|
+
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && controller.watchExports === void 0) {
|
|
75
|
+
throw new Error(`The controller must implement watchExports method to support watching exports`);
|
|
76
|
+
}
|
|
77
|
+
const unsubscribe = controller.watchExports(
|
|
78
|
+
(exports) => watchExports(exports, unsubscribe)
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
return controller.exports;
|
|
82
|
+
};
|
|
83
|
+
const useRef = async (value) => {
|
|
84
|
+
const controller = useRefSync(value);
|
|
85
|
+
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && controller === void 0) {
|
|
86
|
+
throw new Error(
|
|
87
|
+
`Unable to resolve a controller from the provided value. The value you passed is not a controller and not a controller exports. If your controller exports a literal value, try making your controller export an object instead`
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
await controller.ready;
|
|
91
|
+
return controller;
|
|
92
|
+
};
|
|
93
|
+
const useRefSync = (value) => {
|
|
94
|
+
const component = retrieveComponent();
|
|
95
|
+
const controller = component.manager.X(value);
|
|
96
|
+
if (controller !== void 0) {
|
|
97
|
+
return controller;
|
|
98
|
+
}
|
|
99
|
+
if (isController(value)) {
|
|
100
|
+
return value;
|
|
101
|
+
}
|
|
102
|
+
const ambientChildController2 = retrieveAmbientChildController();
|
|
103
|
+
if (ambientChildController2 !== void 0) {
|
|
104
|
+
return ambientChildController2;
|
|
105
|
+
}
|
|
106
|
+
return void 0;
|
|
107
|
+
};
|
|
108
|
+
let shouldBypassReadOnly = false;
|
|
109
|
+
const bypassReadOnly = (callback) => {
|
|
110
|
+
shouldBypassReadOnly = true;
|
|
111
|
+
try {
|
|
112
|
+
return callback();
|
|
113
|
+
} finally {
|
|
114
|
+
shouldBypassReadOnly = false;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const bypassSetter = bypassReadOnly;
|
|
118
|
+
export {
|
|
119
|
+
shouldBypassReadOnly as a,
|
|
120
|
+
setParentController as b,
|
|
121
|
+
controllerSymbol as c,
|
|
122
|
+
retrieveParentControllers as d,
|
|
123
|
+
bypassSetter as e,
|
|
124
|
+
bypassReadOnly as f,
|
|
125
|
+
isController as g,
|
|
126
|
+
getControllersCount as h,
|
|
127
|
+
isPromise as i,
|
|
128
|
+
setAmbientChildController as j,
|
|
129
|
+
useRef as k,
|
|
130
|
+
useRefSync as l,
|
|
131
|
+
retrieveComponent as r,
|
|
132
|
+
setAmbientComponent as s,
|
|
133
|
+
use as u
|
|
134
|
+
};
|
package/dist/context.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ContextProvider, ContextConsumer } from "@lit/context";
|
|
2
|
+
import { r as retrieveComponent } from "./ControllerInternals-DOZNgCJl.js";
|
|
3
|
+
const useContextProvider = (options) => {
|
|
4
|
+
const component = retrieveComponent();
|
|
5
|
+
const controller = new ContextProvider(component.el, options);
|
|
6
|
+
component.addController(controller);
|
|
7
|
+
return controller;
|
|
8
|
+
};
|
|
9
|
+
const useContextConsumer = (options) => {
|
|
10
|
+
const component = retrieveComponent();
|
|
11
|
+
const controller = new ContextConsumer(component.el, options);
|
|
12
|
+
component.addController(controller);
|
|
13
|
+
return controller;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
useContextConsumer,
|
|
17
|
+
useContextProvider
|
|
18
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isEsriInternalEnv } from "@arcgis/components-utils";
|
|
2
|
-
import { r as retrieveComponent
|
|
2
|
+
import { r as retrieveComponent } from "../../ControllerInternals-DOZNgCJl.js";
|
|
3
3
|
import { on, watch } from "@arcgis/core/core/reactiveUtils.js";
|
|
4
|
-
import {
|
|
4
|
+
import { a as createEventFactory, G as GenericController, d as trackPropKey, t as trackKey } from "../../Controller-6vd9TSNE.js";
|
|
5
|
+
import { p as proxyExports } from "../../proxyExports-BgcDxXBO.js";
|
|
5
6
|
import { createObservable, trackAccess } from "@arcgis/core/applications/Components/reactiveUtils.js";
|
|
6
7
|
import { property, subclass } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
7
8
|
import Accessor from "@arcgis/core/core/Accessor.js";
|
|
@@ -22,6 +23,7 @@ class AccessorController extends GenericController {
|
|
|
22
23
|
constructor(component, createInstance) {
|
|
23
24
|
super(component);
|
|
24
25
|
this.Y = /* @__PURE__ */ new Map();
|
|
26
|
+
this.A = void 0;
|
|
25
27
|
this.#exportsObservable = createObservable();
|
|
26
28
|
const that = this;
|
|
27
29
|
that.#createInstance = createInstance;
|
|
@@ -107,9 +109,12 @@ const makeBinderProxy = (component, accessorControllerRef, accessorControllerInd
|
|
|
107
109
|
) {
|
|
108
110
|
return value;
|
|
109
111
|
}
|
|
112
|
+
const accessorController = component.M[accessorControllerIndex];
|
|
113
|
+
accessorController.A = propertyName;
|
|
110
114
|
return trackKey(
|
|
111
115
|
component,
|
|
112
116
|
(resolved) => {
|
|
117
|
+
accessorController.A = void 0;
|
|
113
118
|
if (resolved !== void 0) {
|
|
114
119
|
const propName = resolved.key;
|
|
115
120
|
boundProperties.set(propertyName, propName);
|
|
@@ -120,15 +125,15 @@ const makeBinderProxy = (component, accessorControllerRef, accessorControllerInd
|
|
|
120
125
|
if (!(propertyName in instance)) {
|
|
121
126
|
throw new Error(`"${propertyName}" does not exist on the accessor instance`);
|
|
122
127
|
}
|
|
123
|
-
const
|
|
128
|
+
const accessorController2 = component.M[accessorControllerIndex];
|
|
124
129
|
if (descriptor.i !== void 0 && descriptor.i !== accessorControllerIndex) {
|
|
125
|
-
console.error(component.M[descriptor.i],
|
|
130
|
+
console.error(component.M[descriptor.i], accessorController2);
|
|
126
131
|
throw Error(
|
|
127
132
|
`Expected property "${propName}" to be bound to the controller at index ${descriptor.i}, but tried to bind it to a controller at index ${accessorControllerIndex}. Double check whether you are calling useAccessor() conditionally in a way that is not supported.`
|
|
128
133
|
);
|
|
129
134
|
}
|
|
130
|
-
if (
|
|
131
|
-
console.error(
|
|
135
|
+
if (accessorController2 !== accessorControllerRef.deref()) {
|
|
136
|
+
console.error(accessorController2);
|
|
132
137
|
throw Error(
|
|
133
138
|
`Expected controller at index ${accessorControllerIndex} to be instance of useAccessor but it is not.`
|
|
134
139
|
);
|
|
@@ -156,13 +161,6 @@ const makeBinderProxy = (component, accessorControllerRef, accessorControllerInd
|
|
|
156
161
|
},
|
|
157
162
|
value
|
|
158
163
|
);
|
|
159
|
-
},
|
|
160
|
-
set(_target, propertyName, newValue) {
|
|
161
|
-
if (boundProperties.has(propertyName) || // But some properties may be never bound, yet set in the constructor - let them through
|
|
162
|
-
newValue !== (instance[propertyName] ?? void 0)) {
|
|
163
|
-
instance[propertyName] = newValue;
|
|
164
|
-
}
|
|
165
|
-
return true;
|
|
166
164
|
}
|
|
167
165
|
});
|
|
168
166
|
const watchBoundProperty = (controllerRef, descriptor, propertyName, propName, shouldFlipBoolean, _handle) => _handle = watch(
|
|
@@ -199,7 +197,10 @@ const bindPropToProperty = (descriptor, accessorControllerIndex, propertyName, s
|
|
|
199
197
|
return shouldFlipBoolean ? !value : value;
|
|
200
198
|
};
|
|
201
199
|
descriptor.d.set = function(newValue) {
|
|
202
|
-
this.M[accessorControllerIndex]
|
|
200
|
+
const accessorController = this.M[accessorControllerIndex];
|
|
201
|
+
if (accessorController.A !== propertyName) {
|
|
202
|
+
accessorController.exports[propertyName] = shouldFlipBoolean ? !newValue : newValue;
|
|
203
|
+
}
|
|
203
204
|
};
|
|
204
205
|
};
|
|
205
206
|
const getAccessorControllerBoundProperties = (controller) => controller.Y;
|
|
@@ -212,10 +213,15 @@ const reCreateAccessor = (instance, component) => {
|
|
|
212
213
|
console.error("Unable to resolve the useAccessor controller from the provided value");
|
|
213
214
|
}
|
|
214
215
|
};
|
|
215
|
-
const createStore = (
|
|
216
|
+
const createStore = (initializer) => {
|
|
216
217
|
const SubClass = class extends Accessor {
|
|
217
218
|
};
|
|
218
|
-
|
|
219
|
+
const defaultValues = typeof initializer === "function" ? initializer() : initializer;
|
|
220
|
+
const descriptors = Object.getOwnPropertyDescriptors(defaultValues);
|
|
221
|
+
for (const [key, descriptor] of Object.entries(descriptors)) {
|
|
222
|
+
Object.defineProperty(SubClass.prototype, key, descriptor);
|
|
223
|
+
property()(SubClass.prototype, key);
|
|
224
|
+
}
|
|
219
225
|
const State = subclass()(SubClass);
|
|
220
226
|
return new State();
|
|
221
227
|
};
|
|
@@ -2,7 +2,7 @@ import { default as Accessor } from '@arcgis/core/core/Accessor.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* See https://qawebgis.esri.com/components/lumina/controllers/useAccessor#createstore-utility
|
|
4
4
|
*/
|
|
5
|
-
export declare const createStore: <T extends Record<string, unknown>>(
|
|
5
|
+
export declare const createStore: <T extends Record<string, unknown>>(initializer: T | (() => T)) => __esri.Accessor & T;
|
|
6
6
|
/** @deprecated Use {@link createStore} instead */
|
|
7
7
|
export declare const createLegacyStore: <T extends Record<string, unknown>>(defaultState: T | (() => T)) => ObservableMap<T>;
|
|
8
8
|
/** @deprecated Use {@link createStore} instead */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GenericController } from '../Controller';
|
|
2
2
|
import { LitElement } from '../../LitElement';
|
|
3
3
|
type Requires<Props, Accessor extends __esri.Accessor, OmitProps extends string = never> = LitElement & Omit<Pick<Accessor, keyof Accessor & keyof Props>, AlwaysOmit | OmitProps> & {
|
|
4
4
|
autoDestroyDisabled: boolean;
|
|
@@ -46,6 +46,8 @@ export declare class AccessorController<Props, Accessor extends __esri.Accessor,
|
|
|
46
46
|
* @private
|
|
47
47
|
*/
|
|
48
48
|
_boundAccessorProperties: Map<string & keyof Accessor, string>;
|
|
49
|
+
/** @private */
|
|
50
|
+
_currentlyBindingPropertyName?: string;
|
|
49
51
|
/**
|
|
50
52
|
* (development only) Allow these props to mismatch the name of the Accessor's
|
|
51
53
|
* property to avoid collisions
|
|
@@ -61,8 +63,11 @@ export declare class AccessorController<Props, Accessor extends __esri.Accessor,
|
|
|
61
63
|
hostConnected(): void;
|
|
62
64
|
hostDestroy(): void;
|
|
63
65
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
type MinimalAccessorController = Pick<AccessorController<never, __esri.Accessor>, "_currentlyBindingPropertyName" | "exports"> & {
|
|
67
|
+
component: LitElement;
|
|
68
|
+
};
|
|
69
|
+
export declare const makeBinderProxy: (component: LitElement, accessorControllerRef: WeakRef<MinimalAccessorController & {
|
|
70
|
+
constructor: MinimalAccessorController["constructor"] & {
|
|
66
71
|
devOnly$allowedPropNameMismatches?: ReadonlySet<string>;
|
|
67
72
|
};
|
|
68
73
|
}>, accessorControllerIndex: number, instance: __esri.Accessor, boundProperties: Map<string, string>) => unknown;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { C as Controller,
|
|
2
|
-
import { G,
|
|
3
|
-
import {
|
|
1
|
+
import { C as Controller, t as trackKey, a as createEventFactory } from "../Controller-6vd9TSNE.js";
|
|
2
|
+
import { G, k, d, b } from "../Controller-6vd9TSNE.js";
|
|
3
|
+
import { s as setAmbientComponent, i as isPromise, b as setParentController, d as retrieveParentControllers, r as retrieveComponent } from "../ControllerInternals-DOZNgCJl.js";
|
|
4
|
+
import { f, e, c, h, g } from "../ControllerInternals-DOZNgCJl.js";
|
|
5
|
+
import { p as proxyExports } from "../proxyExports-BgcDxXBO.js";
|
|
4
6
|
import { isServer } from "lit";
|
|
5
7
|
import { observeAncestorsMutation, isEsriInternalEnv, getElementAttribute, getElementLocales, startLocaleObserver } from "@arcgis/components-utils";
|
|
6
8
|
const makeController = (constructor) => proxy(void 0, constructor);
|
|
@@ -127,7 +129,7 @@ const useDirection = () => makeController((component, controller) => {
|
|
|
127
129
|
(resolved) => {
|
|
128
130
|
if (resolved?.key === "dir") {
|
|
129
131
|
throw new Error(
|
|
130
|
-
|
|
132
|
+
"Do not assign this controller to a prop called `dir` as that will overwrite the HTMLElement's built-in `dir` attribute - component should not be setting the `dir` attribute on itself. Instead, assign this controller to a property called `direction`."
|
|
131
133
|
);
|
|
132
134
|
}
|
|
133
135
|
},
|
|
@@ -247,11 +249,11 @@ const propertyChangeController = (...toWatch) => {
|
|
|
247
249
|
export {
|
|
248
250
|
Controller,
|
|
249
251
|
G as GenericController,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
+
f as bypassReadOnly,
|
|
253
|
+
e as bypassSetter,
|
|
252
254
|
c as controllerSymbol,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
+
h as getControllersCount,
|
|
256
|
+
g as isController,
|
|
255
257
|
k as keyTrackResolve,
|
|
256
258
|
load,
|
|
257
259
|
makeController,
|
|
@@ -261,8 +263,8 @@ export {
|
|
|
261
263
|
retrieveComponent,
|
|
262
264
|
toFunction,
|
|
263
265
|
trackKey,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
+
d as trackPropKey,
|
|
267
|
+
b as trackPropertyKey,
|
|
266
268
|
useDirection,
|
|
267
269
|
useMedia,
|
|
268
270
|
usePropertyChange,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { useContextProvider as useContextProviderImplementation, useContextConsumer as useContextConsumerImplementation } from './context';
|
|
2
2
|
export type { EventEmitter, EventOptions } from './createEvent';
|
|
3
3
|
export { createEvent } from './createEvent';
|
|
4
4
|
export { state, property, method } from './decorators';
|
|
@@ -15,3 +15,11 @@ export { nothing, noChange, setAttribute, stringOrBoolean } from './jsx/utils';
|
|
|
15
15
|
export { noShadowRoot, devOnly$getLitElementTagNameAndRuntime } from './utils';
|
|
16
16
|
export { makeReactWrapperFactory, getReactWrapperOptions } from './wrappersUtils';
|
|
17
17
|
export { renderElement } from './render';
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `useContextProvider` from `@arcgis/lumina/context` instead.
|
|
20
|
+
*/
|
|
21
|
+
export declare const useContextProvider: typeof useContextProviderImplementation;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use `useContextConsumer` from `@arcgis/lumina/context` instead.
|
|
24
|
+
*/
|
|
25
|
+
export declare const useContextConsumer: typeof useContextConsumerImplementation;
|
package/dist/index.js
CHANGED
|
@@ -1,30 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { b } from "./Controller-BQOv8BAL.js";
|
|
1
|
+
import { G as GenericController, k as keyTrackResolve } from "./Controller-6vd9TSNE.js";
|
|
2
|
+
import { c } from "./Controller-6vd9TSNE.js";
|
|
4
3
|
import { state } from "@lit/reactive-element/decorators/state.js";
|
|
5
4
|
import { property as property$1 } from "@lit/reactive-element/decorators/property.js";
|
|
6
5
|
import { e as emptyFunction, n as noShadowRoot, a as attachToAncestor } from "./lazyLoad-DUvrNd2L.js";
|
|
7
6
|
import { d, m } from "./lazyLoad-DUvrNd2L.js";
|
|
8
7
|
import { isEsriInternalEnv, safeCall, devToolsAwareTimeout, Deferred, camelToKebab, safeAsyncCall } from "@arcgis/components-utils";
|
|
9
8
|
import { nothing as nothing$1, LitElement as LitElement$1, isServer, notEqual, noChange as noChange$1 } from "lit";
|
|
9
|
+
import { s as setAmbientComponent, c as controllerSymbol, a as shouldBypassReadOnly } from "./ControllerInternals-DOZNgCJl.js";
|
|
10
10
|
import { propertyFlagAttribute, propertyFlagNoAccessor, propertyFlagReadOnly, propertyFlagState, propertyFlagBoolean, propertyFlagNumber, propertyFlagReflect } from "./config.js";
|
|
11
11
|
import { classMap } from "lit-html/directives/class-map.js";
|
|
12
12
|
import { styleMap } from "lit/directives/style-map.js";
|
|
13
13
|
import { directive as directive$1, Directive } from "lit-html/directive.js";
|
|
14
14
|
import { live as live$1 } from "lit-html/directives/live.js";
|
|
15
15
|
import { nothing as nothing$2, noChange as noChange$2, render } from "lit-html";
|
|
16
|
-
|
|
17
|
-
const component = retrieveComponent();
|
|
18
|
-
const controller = new ContextProvider(component.el, options);
|
|
19
|
-
component.addController(controller);
|
|
20
|
-
return controller;
|
|
21
|
-
};
|
|
22
|
-
const useContextConsumer = (options) => {
|
|
23
|
-
const component = retrieveComponent();
|
|
24
|
-
const controller = new ContextConsumer(component.el, options);
|
|
25
|
-
component.addController(controller);
|
|
26
|
-
return controller;
|
|
27
|
-
};
|
|
16
|
+
import { useContextProvider as useContextProvider$1, useContextConsumer as useContextConsumer$1 } from "./context.js";
|
|
28
17
|
const property = property$1;
|
|
29
18
|
const method = void 0;
|
|
30
19
|
class ControllerManager extends GenericController {
|
|
@@ -655,6 +644,8 @@ const renderElement = (element) => {
|
|
|
655
644
|
render(element, container);
|
|
656
645
|
return container.firstElementChild;
|
|
657
646
|
};
|
|
647
|
+
const useContextProvider = useContextProvider$1;
|
|
648
|
+
const useContextConsumer = useContextConsumer$1;
|
|
658
649
|
export {
|
|
659
650
|
Fragment,
|
|
660
651
|
LitElement,
|
|
@@ -662,7 +653,7 @@ export {
|
|
|
662
653
|
bindBooleanAttribute,
|
|
663
654
|
bindEvent,
|
|
664
655
|
bindProperty,
|
|
665
|
-
|
|
656
|
+
c as createEvent,
|
|
666
657
|
deferLoad,
|
|
667
658
|
deferredLoaders,
|
|
668
659
|
d as devOnly$getLitElementTagNameAndRuntime,
|
|
@@ -511,6 +511,7 @@ export interface AriaAttributes {
|
|
|
511
511
|
* @see aria-controls
|
|
512
512
|
*/
|
|
513
513
|
["aria-owns"]?: string;
|
|
514
|
+
ariaActiveDescendantElement?: Element;
|
|
514
515
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaAtomic) */
|
|
515
516
|
ariaAtomic?: boolean | "false" | "true";
|
|
516
517
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaAutoComplete) */
|
|
@@ -529,14 +530,19 @@ export interface AriaAttributes {
|
|
|
529
530
|
ariaColIndex?: number | string;
|
|
530
531
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaColSpan) */
|
|
531
532
|
ariaColSpan?: number | string;
|
|
533
|
+
ariaControlsElements?: Element[];
|
|
532
534
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaCurrent) */
|
|
533
535
|
ariaCurrent?: boolean | "date" | "false" | "location" | "page" | "step" | "time" | "true";
|
|
536
|
+
ariaDescribedByElements?: Element[];
|
|
534
537
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaDescription) */
|
|
535
538
|
ariaDescription?: string;
|
|
539
|
+
ariaDetailsElements?: Element[];
|
|
536
540
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaDisabled) */
|
|
537
541
|
ariaDisabled?: boolean | "false" | "true";
|
|
542
|
+
ariaErrorMessageElement?: Element;
|
|
538
543
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaExpanded) */
|
|
539
544
|
ariaExpanded?: boolean | "false" | "true";
|
|
545
|
+
ariaFlowToElements?: Element[];
|
|
540
546
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaHasPopup) */
|
|
541
547
|
ariaHasPopup?: boolean | "dialog" | "false" | "grid" | "listbox" | "menu" | "tree" | "true";
|
|
542
548
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaHidden) */
|
|
@@ -550,6 +556,7 @@ export interface AriaAttributes {
|
|
|
550
556
|
ariaKeyShortcuts?: string;
|
|
551
557
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLabel) */
|
|
552
558
|
ariaLabel?: string;
|
|
559
|
+
ariaLabelledByElements?: Element[];
|
|
553
560
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLevel) */
|
|
554
561
|
ariaLevel?: number | string;
|
|
555
562
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLive) */
|
|
@@ -562,6 +569,7 @@ export interface AriaAttributes {
|
|
|
562
569
|
ariaMultiSelectable?: boolean | "false" | "true";
|
|
563
570
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaOrientation) */
|
|
564
571
|
ariaOrientation?: "horizontal" | "vertical";
|
|
572
|
+
ariaOwnsElements?: Element[];
|
|
565
573
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPlaceholder) */
|
|
566
574
|
ariaPlaceholder?: string;
|
|
567
575
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPosInSet) */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as setParentController, d as retrieveParentControllers, j as setAmbientChildController, f as bypassReadOnly } from "./ControllerInternals-DOZNgCJl.js";
|
|
2
|
+
import { t as trackKey } from "./Controller-6vd9TSNE.js";
|
|
2
3
|
const proxyExports = (Class) => (...args) => {
|
|
3
4
|
const ambientControllers = retrieveParentControllers();
|
|
4
5
|
const instance = new Class(...args);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/lumina",
|
|
3
|
-
"version": "4.34.0-next.
|
|
3
|
+
"version": "4.34.0-next.40",
|
|
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
|
+
"./context": "./dist/context.js",
|
|
11
12
|
"./hmrSupport": "./dist/hmrSupport.js",
|
|
12
13
|
"./stencilSsrCompatibility": "./dist/stencilSsrCompatibility/index.js",
|
|
13
14
|
"./typings": {
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
],
|
|
23
24
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"@arcgis/components-utils": "4.34.0-next.
|
|
26
|
+
"@arcgis/components-utils": "4.34.0-next.40",
|
|
26
27
|
"@lit-labs/ssr": "^3.2.2",
|
|
27
28
|
"@lit-labs/ssr-client": "^1.1.7",
|
|
28
29
|
"@lit/context": "^1.1.5",
|