@arcgis/lumina 4.33.0-next.97 → 4.33.0-next.98
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/{useWatch-CFtSpNnN.js → Controller-CZ8Djohh.js} +70 -368
- package/dist/LitElement.d.ts +33 -25
- package/dist/context.d.ts +12 -2
- package/dist/controllers/Controller.d.ts +18 -17
- package/dist/controllers/ControllerInternals.d.ts +19 -12
- package/dist/controllers/ControllerManager.d.ts +62 -42
- package/dist/controllers/accessor/index.js +12 -60
- package/dist/controllers/accessor/reEmitEvent.d.ts +1 -5
- package/dist/controllers/accessor/useAccessor.d.ts +6 -7
- package/dist/controllers/functional.d.ts +4 -4
- package/dist/controllers/index.d.ts +6 -5
- package/dist/controllers/index.js +35 -55
- package/dist/controllers/proxyExports.d.ts +1 -1
- package/dist/controllers/trackKey.d.ts +4 -4
- package/dist/controllers/trackPropKey.d.ts +6 -6
- package/dist/controllers/trackPropertyKey.d.ts +8 -7
- package/dist/controllers/types.d.ts +15 -45
- package/dist/controllers/usePropertyChange.d.ts +4 -3
- package/dist/controllers/useT9n.d.ts +1 -1
- package/dist/createEvent.d.ts +7 -2
- package/dist/hmrSupport.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +331 -14
- package/dist/lazyLoad.d.ts +14 -14
- package/dist/proxyExports-CK5BLFLO.js +60 -0
- package/dist/{utils-GhKD5Lo-.js → utils-DBdf1Dqp.js} +4 -12
- package/package.json +2 -2
- package/dist/ControllerManager-B2comd8J.js +0 -310
- package/dist/controllers/ComponentInternals.d.ts +0 -92
- package/dist/controllers/framework.d.ts +0 -45
- package/dist/controllers/getSet.d.ts +0 -116
- package/dist/controllers/readonly.d.ts +0 -29
- package/dist/controllers/useWatch.d.ts +0 -27
- package/dist/proxyExports-Dl5CHmHQ.js +0 -150
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { r as retrieveComponent, f as trackPropKey, o as devOnlyGetPersistentControllerData, p as shouldBypass, a as setParentController, b as retrieveParentControllers, q as setAmbientChildController, t as trackKey, w as watch } from "./useWatch-CFtSpNnN.js";
|
|
2
|
-
import { isEsriInternalEnv } from "@arcgis/components-utils";
|
|
3
|
-
function getSet(defaultValue, getSet2) {
|
|
4
|
-
const component = retrieveComponent();
|
|
5
|
-
return trackPropKey(
|
|
6
|
-
component,
|
|
7
|
-
(rawName) => {
|
|
8
|
-
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && rawName === void 0) {
|
|
9
|
-
throw new Error(
|
|
10
|
-
"Unable to resolve get/set's prop name. Make sure you are using it like @Prop() someProp = getSet(defaultValue,{get,set})"
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
const name = rawName;
|
|
14
|
-
const manager = component.manager;
|
|
15
|
-
const genericComponent = component;
|
|
16
|
-
const value = genericComponent[name];
|
|
17
|
-
const isStencilHotReload = process.env.NODE_ENV !== "production" && isEsriInternalEnv() && !manager.isLit && devOnlyGetPersistentControllerData?.(manager) === true;
|
|
18
|
-
if (value != null && value !== defaultValue && typeof getSet2.set === "function" && !isStencilHotReload) {
|
|
19
|
-
const newValue = getSet2.set(value, defaultValue, name);
|
|
20
|
-
if (newValue !== value) {
|
|
21
|
-
if (manager.isLit) {
|
|
22
|
-
genericComponent[name] = newValue;
|
|
23
|
-
} else {
|
|
24
|
-
let firstConnected = true;
|
|
25
|
-
manager.onConnected(() => {
|
|
26
|
-
if (!firstConnected) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
firstConnected = true;
|
|
30
|
-
bypassSetter(() => {
|
|
31
|
-
genericComponent[name] = newValue;
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
genericGetSet(component, name, getSet2);
|
|
38
|
-
},
|
|
39
|
-
defaultValue
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
const dynamicGetSet = (component, property, getSet2) => genericGetSet(component, property, getSet2);
|
|
43
|
-
function bypassSetter(callback) {
|
|
44
|
-
shouldBypass.setter = true;
|
|
45
|
-
try {
|
|
46
|
-
return callback();
|
|
47
|
-
} finally {
|
|
48
|
-
shouldBypass.setter = false;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function bypassGetter(callback) {
|
|
52
|
-
shouldBypass.getter = true;
|
|
53
|
-
try {
|
|
54
|
-
return callback();
|
|
55
|
-
} finally {
|
|
56
|
-
shouldBypass.getter = false;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function genericGetSet(component, property, getSet2) {
|
|
60
|
-
const genericGetSet2 = getSet2;
|
|
61
|
-
const internals = component.manager.internals;
|
|
62
|
-
const get = typeof genericGetSet2.get === "function" ? genericGetSet2.get : void 0;
|
|
63
|
-
if (get) {
|
|
64
|
-
internals.getters[property] ??= [];
|
|
65
|
-
internals.getters[property].unshift(get);
|
|
66
|
-
}
|
|
67
|
-
const set = genericGetSet2.set === "ignore" ? ignoreSet : genericGetSet2.set;
|
|
68
|
-
if (set) {
|
|
69
|
-
internals.setters[property] ??= [];
|
|
70
|
-
internals.setters[property].unshift(
|
|
71
|
-
set
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
const ignoreSet = (_, value) => value;
|
|
76
|
-
function readonly(value) {
|
|
77
|
-
const component = retrieveComponent();
|
|
78
|
-
return getSet(value, { set: component.manager.internals.readonlySetter });
|
|
79
|
-
}
|
|
80
|
-
function bypassReadOnly(callback) {
|
|
81
|
-
shouldBypass.readOnly = true;
|
|
82
|
-
try {
|
|
83
|
-
return callback();
|
|
84
|
-
} finally {
|
|
85
|
-
shouldBypass.readOnly = false;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
const proxyExports = (Class) => (...args) => {
|
|
89
|
-
const ambientControllers = retrieveParentControllers();
|
|
90
|
-
const instance = new Class(...args);
|
|
91
|
-
const initialExports = instance.exports;
|
|
92
|
-
setParentController(ambientControllers.at(-1));
|
|
93
|
-
const internals = instance.component.manager.internals;
|
|
94
|
-
internals.markExports(instance, initialExports);
|
|
95
|
-
instance.watchExports((exports) => internals.markExports(instance, exports));
|
|
96
|
-
setAmbientChildController(instance);
|
|
97
|
-
const hostCandidates = [instance.component, ...ambientControllers].reverse();
|
|
98
|
-
return trackKey(
|
|
99
|
-
hostCandidates,
|
|
100
|
-
(resolution) => resolution === void 0 ? void 0 : setProxy(instance, resolution, initialExports),
|
|
101
|
-
initialExports
|
|
102
|
-
);
|
|
103
|
-
};
|
|
104
|
-
function setProxy(controller, { host, key, isReactive: assignedToProp }, initialExports) {
|
|
105
|
-
const genericHost = host;
|
|
106
|
-
const controllerValueChanged = genericHost[key] !== controller.exports;
|
|
107
|
-
const hostValueChanged = genericHost[key] !== initialExports;
|
|
108
|
-
const controllerUpdatedExports = initialExports !== controller.exports;
|
|
109
|
-
if (controllerValueChanged && !hostValueChanged && controllerUpdatedExports) {
|
|
110
|
-
genericHost[key] = controller.exports;
|
|
111
|
-
}
|
|
112
|
-
const isProxyExportsOnComponent = host === controller.component;
|
|
113
|
-
if (isProxyExportsOnComponent) {
|
|
114
|
-
if (assignedToProp) {
|
|
115
|
-
const internals = controller.component.manager.internals;
|
|
116
|
-
if (hostValueChanged) {
|
|
117
|
-
internals.markExports(controller, genericHost[key]);
|
|
118
|
-
}
|
|
119
|
-
watch(controller.component, key, (value) => {
|
|
120
|
-
if (value !== controller.exports) {
|
|
121
|
-
internals.markExports(controller, value);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
controller.assignedProperty = assignedToProp ? void 0 : key;
|
|
126
|
-
}
|
|
127
|
-
controller.watchExports(() => {
|
|
128
|
-
if (genericHost[key] === controller.exports) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
const manager = controller.component.manager;
|
|
132
|
-
const isReadOnly = manager.internals.setters[key]?.includes(manager.internals.readonlySetter);
|
|
133
|
-
if (isReadOnly) {
|
|
134
|
-
bypassReadOnly(() => {
|
|
135
|
-
genericHost[key] = controller.exports;
|
|
136
|
-
});
|
|
137
|
-
} else {
|
|
138
|
-
genericHost[key] = controller.exports;
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
export {
|
|
143
|
-
bypassGetter as a,
|
|
144
|
-
bypassReadOnly as b,
|
|
145
|
-
bypassSetter as c,
|
|
146
|
-
dynamicGetSet as d,
|
|
147
|
-
getSet as g,
|
|
148
|
-
proxyExports as p,
|
|
149
|
-
readonly as r
|
|
150
|
-
};
|