@arcgis/lumina 4.34.0-next.16 → 4.34.0-next.18
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.
|
@@ -22,6 +22,7 @@ class AccessorController extends GenericController {
|
|
|
22
22
|
constructor(component, createInstance) {
|
|
23
23
|
super(component);
|
|
24
24
|
this.Y = /* @__PURE__ */ new Map();
|
|
25
|
+
this.A = void 0;
|
|
25
26
|
this.#exportsObservable = createObservable();
|
|
26
27
|
const that = this;
|
|
27
28
|
that.#createInstance = createInstance;
|
|
@@ -107,9 +108,12 @@ const makeBinderProxy = (component, accessorControllerRef, accessorControllerInd
|
|
|
107
108
|
) {
|
|
108
109
|
return value;
|
|
109
110
|
}
|
|
111
|
+
const accessorController = component.M[accessorControllerIndex];
|
|
112
|
+
accessorController.A = propertyName;
|
|
110
113
|
return trackKey(
|
|
111
114
|
component,
|
|
112
115
|
(resolved) => {
|
|
116
|
+
accessorController.A = void 0;
|
|
113
117
|
if (resolved !== void 0) {
|
|
114
118
|
const propName = resolved.key;
|
|
115
119
|
boundProperties.set(propertyName, propName);
|
|
@@ -120,15 +124,15 @@ const makeBinderProxy = (component, accessorControllerRef, accessorControllerInd
|
|
|
120
124
|
if (!(propertyName in instance)) {
|
|
121
125
|
throw new Error(`"${propertyName}" does not exist on the accessor instance`);
|
|
122
126
|
}
|
|
123
|
-
const
|
|
127
|
+
const accessorController2 = component.M[accessorControllerIndex];
|
|
124
128
|
if (descriptor.i !== void 0 && descriptor.i !== accessorControllerIndex) {
|
|
125
|
-
console.error(component.M[descriptor.i],
|
|
129
|
+
console.error(component.M[descriptor.i], accessorController2);
|
|
126
130
|
throw Error(
|
|
127
131
|
`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
132
|
);
|
|
129
133
|
}
|
|
130
|
-
if (
|
|
131
|
-
console.error(
|
|
134
|
+
if (accessorController2 !== accessorControllerRef.deref()) {
|
|
135
|
+
console.error(accessorController2);
|
|
132
136
|
throw Error(
|
|
133
137
|
`Expected controller at index ${accessorControllerIndex} to be instance of useAccessor but it is not.`
|
|
134
138
|
);
|
|
@@ -156,13 +160,6 @@ const makeBinderProxy = (component, accessorControllerRef, accessorControllerInd
|
|
|
156
160
|
},
|
|
157
161
|
value
|
|
158
162
|
);
|
|
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
163
|
}
|
|
167
164
|
});
|
|
168
165
|
const watchBoundProperty = (controllerRef, descriptor, propertyName, propName, shouldFlipBoolean, _handle) => _handle = watch(
|
|
@@ -199,7 +196,10 @@ const bindPropToProperty = (descriptor, accessorControllerIndex, propertyName, s
|
|
|
199
196
|
return shouldFlipBoolean ? !value : value;
|
|
200
197
|
};
|
|
201
198
|
descriptor.d.set = function(newValue) {
|
|
202
|
-
this.M[accessorControllerIndex]
|
|
199
|
+
const accessorController = this.M[accessorControllerIndex];
|
|
200
|
+
if (accessorController.A !== propertyName) {
|
|
201
|
+
accessorController.exports[propertyName] = shouldFlipBoolean ? !newValue : newValue;
|
|
202
|
+
}
|
|
203
203
|
};
|
|
204
204
|
};
|
|
205
205
|
const getAccessorControllerBoundProperties = (controller) => controller.Y;
|
|
@@ -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;
|
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.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@arcgis/components-utils": "4.34.0-next.
|
|
25
|
+
"@arcgis/components-utils": "4.34.0-next.18",
|
|
26
26
|
"@lit-labs/ssr": "^3.2.2",
|
|
27
27
|
"@lit-labs/ssr-client": "^1.1.7",
|
|
28
28
|
"@lit/context": "^1.1.5",
|