@arcgis/lumina 5.2.0-next.10 → 5.2.0-next.11
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/{ControllerManager-DpJfvft9.js → ControllerManager-4cSEnB5Y.js} +12 -8
- package/dist/{Controller-Cer_6Z29.js → GenericController-C8NSb50b.js} +59 -23
- package/dist/LitElement.d.ts +179 -250
- package/dist/PublicLitElement.d.ts +64 -30
- package/dist/config.d.ts +22 -16
- package/dist/context.d.ts +24 -24
- package/dist/controllers/Controller.d.ts +106 -139
- package/dist/controllers/ControllerInternals.d.ts +33 -25
- package/dist/controllers/ControllerManager.d.ts +40 -61
- package/dist/controllers/GenericController.d.ts +26 -0
- package/dist/controllers/accessor/index.d.ts +6 -4
- package/dist/controllers/accessor/index.js +23 -5
- package/dist/controllers/accessor/reEmitEvent.d.ts +6 -3
- package/dist/controllers/accessor/store.d.ts +21 -14
- package/dist/controllers/accessor/useAccessor.d.ts +86 -68
- package/dist/controllers/functional.d.ts +11 -4
- package/dist/controllers/index.d.ts +35 -36
- package/dist/controllers/index.js +5 -7
- package/dist/controllers/load.d.ts +3 -2
- package/dist/controllers/proxyExports.d.ts +6 -5
- package/dist/controllers/toFunction.d.ts +4 -2
- package/dist/controllers/trackKey.d.ts +9 -4
- package/dist/controllers/trackPropKey.d.ts +8 -2
- package/dist/controllers/trackPropertyKey.d.ts +11 -6
- package/dist/controllers/types.d.ts +99 -170
- package/dist/controllers/useDirection.d.ts +5 -6
- package/dist/controllers/useMedia.d.ts +3 -2
- package/dist/controllers/usePropertyChange.d.ts +9 -10
- package/dist/controllers/useSlottableRequest.d.ts +15 -10
- package/dist/controllers/useT9n.d.ts +44 -38
- package/dist/controllers/useWatchAttributes.d.ts +6 -3
- package/dist/controllers/utils.d.ts +13 -5
- package/dist/createEvent.d.ts +32 -32
- package/dist/decorators.d.ts +16 -9
- package/dist/formAssociatedUtils.d.ts +5 -47
- package/dist/globalTypes/importMeta.d.ts +18 -10
- package/dist/globalTypes/index.d.ts +6 -4
- package/dist/globalTypes/jsxGlobals.d.ts +36 -23
- package/dist/globalTypes/loadLitCss.d.ts +61 -40
- package/dist/globalTypes/viteEnv.d.ts +60 -26
- package/dist/hmrSupport.d.ts +24 -28
- package/dist/index.d.ts +17 -16
- package/dist/index.js +27 -7
- package/dist/jsx/baseTypes.d.ts +26 -26
- package/dist/jsx/directives.d.ts +30 -42
- package/dist/jsx/generatedTypes.d.ts +3002 -2923
- package/dist/jsx/types.d.ts +214 -171
- package/dist/jsx/utils.d.ts +19 -14
- package/dist/lazyLoad.d.ts +31 -110
- package/dist/makeRuntime.d.ts +104 -127
- package/dist/{proxyExports-BkN6hND0.js → proxyExports-ZRLty8oJ.js} +1 -1
- package/dist/render.d.ts +4 -2
- package/dist/utils.d.ts +9 -14
- package/dist/wrappersUtils.d.ts +25 -26
- package/package.json +7 -4
- package/dist/devOnlyDetectIncorrectLazyUsages.d.ts +0 -14
- package/dist/lifecycleSupport.d.ts +0 -8
- package/dist/tests/wrappersUtils.typeTest.d.ts +0 -1
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { safeCall, isEsriInternalEnv } from "@arcgis/toolkit/error";
|
|
2
|
-
import { G as GenericController, p as propertyTrackResolve } from "./
|
|
2
|
+
import { G as GenericController, p as propertyTrackResolve } from "./GenericController-C8NSb50b.js";
|
|
3
3
|
import { nothing, LitElement as LitElement$1 } from "lit";
|
|
4
4
|
import { devToolsAwareTimeout } from "@arcgis/toolkit/promise";
|
|
5
5
|
import { a as setAmbientComponent } from "./ControllerInternals-CeDntN3G.js";
|
|
6
6
|
class ControllerManager extends GenericController {
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
* @param component
|
|
10
|
+
*/
|
|
7
11
|
constructor(component) {
|
|
8
12
|
super(component);
|
|
9
13
|
this.destroyed = false;
|
|
@@ -79,8 +83,13 @@ class ControllerManager extends GenericController {
|
|
|
79
83
|
}
|
|
80
84
|
#autoDestroyTimeout;
|
|
81
85
|
#component;
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
/**
|
|
87
|
+
* @public
|
|
88
|
+
* @privateRemarks
|
|
89
|
+
* Keeping this method async needlessly for now to avoid a breaking change if
|
|
90
|
+
* we would need to make it async in the future.
|
|
91
|
+
* Related: https://devtopia.esri.com/WebGIS/arcgis-web-components/pull/15301#issuecomment-6321306
|
|
92
|
+
*/
|
|
84
93
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
85
94
|
async destroy() {
|
|
86
95
|
if (this.destroyed) {
|
|
@@ -104,7 +113,6 @@ class ControllerManager extends GenericController {
|
|
|
104
113
|
}
|
|
105
114
|
this.#component.M.splice(0);
|
|
106
115
|
}
|
|
107
|
-
/** @private */
|
|
108
116
|
U() {
|
|
109
117
|
if (this.#autoDestroyTimeout !== void 0) {
|
|
110
118
|
clearTimeout(this.#autoDestroyTimeout);
|
|
@@ -118,7 +126,6 @@ class ControllerManager extends GenericController {
|
|
|
118
126
|
}
|
|
119
127
|
}
|
|
120
128
|
}
|
|
121
|
-
/** @private */
|
|
122
129
|
S(key, value) {
|
|
123
130
|
const trackers = this.T;
|
|
124
131
|
this.V = nothing;
|
|
@@ -129,15 +136,12 @@ class ControllerManager extends GenericController {
|
|
|
129
136
|
/**
|
|
130
137
|
* Associate an exports object with a controller for reverse lookup in
|
|
131
138
|
* controller.use
|
|
132
|
-
*
|
|
133
|
-
* @private
|
|
134
139
|
*/
|
|
135
140
|
W(controller, exports$1) {
|
|
136
141
|
if (typeof exports$1 === "object" && exports$1 !== null || typeof exports$1 === "function") {
|
|
137
142
|
this.#exportsStore.set(exports$1, controller);
|
|
138
143
|
}
|
|
139
144
|
}
|
|
140
|
-
/** @private */
|
|
141
145
|
X(exports$1) {
|
|
142
146
|
if (typeof exports$1 === "object" && exports$1 !== null || typeof exports$1 === "function") {
|
|
143
147
|
return this.#exportsStore.get(exports$1);
|
|
@@ -128,6 +128,10 @@ const createEvent = createEventFactory.bind(null, "");
|
|
|
128
128
|
var _a;
|
|
129
129
|
_a = controllerSymbol;
|
|
130
130
|
class Controller {
|
|
131
|
+
/**
|
|
132
|
+
* @public
|
|
133
|
+
* @param component
|
|
134
|
+
*/
|
|
131
135
|
constructor(component) {
|
|
132
136
|
this.#hostConnected = [];
|
|
133
137
|
this.#hostDisconnected = [];
|
|
@@ -203,14 +207,16 @@ class Controller {
|
|
|
203
207
|
).catch(rethrowError(this.#component));
|
|
204
208
|
}
|
|
205
209
|
#exports;
|
|
210
|
+
/**
|
|
211
|
+
* Setting .exports set controller's exports property for usage with
|
|
212
|
+
* proxyExports() and marks the controller as ready for usage in other
|
|
213
|
+
* controllers. Also, this triggers re-render of the component.
|
|
214
|
+
*
|
|
215
|
+
* @public
|
|
216
|
+
*/
|
|
206
217
|
get exports() {
|
|
207
218
|
return this.#exports;
|
|
208
219
|
}
|
|
209
|
-
/**
|
|
210
|
-
* Set controller's exports property (for usage with proxyExports()) and mark
|
|
211
|
-
* controller as ready (for usage in other controllers). Also, triggers
|
|
212
|
-
* re-render of the component
|
|
213
|
-
*/
|
|
214
220
|
set exports(exports$1) {
|
|
215
221
|
const oldExports = this.#exports;
|
|
216
222
|
if (oldExports !== exports$1) {
|
|
@@ -227,6 +233,10 @@ class Controller {
|
|
|
227
233
|
this.#exportWatchers.forEach(safeCall);
|
|
228
234
|
}
|
|
229
235
|
#exportWatchers;
|
|
236
|
+
/**
|
|
237
|
+
* @public
|
|
238
|
+
* @param callback
|
|
239
|
+
*/
|
|
230
240
|
watchExports(callback) {
|
|
231
241
|
const safeCallback = () => callback(this.#exports);
|
|
232
242
|
this.#exportWatchers.push(safeCallback);
|
|
@@ -236,6 +246,13 @@ class Controller {
|
|
|
236
246
|
* A flexible utility for making sure a controller is loaded before it's used,
|
|
237
247
|
* regardless of how or where a controller was defined:
|
|
238
248
|
*
|
|
249
|
+
* If your controller is not async, and you are not creating it inside async
|
|
250
|
+
* function, then you are not required to use controller.use - you can create
|
|
251
|
+
* controller directly. Similarly, accessing controllers after
|
|
252
|
+
* componentWillLoad callback does not require awaiting them as they are
|
|
253
|
+
* guaranteed to be loaded by then.
|
|
254
|
+
*
|
|
255
|
+
* @public
|
|
239
256
|
* @example
|
|
240
257
|
* makeGenericController(async (component, controller) => {
|
|
241
258
|
* // Await some controller from the component:
|
|
@@ -245,12 +262,6 @@ class Controller {
|
|
|
245
262
|
* await controller.use(new ViewModelController(component,newWidgetsHomeHomeViewModel));
|
|
246
263
|
* await controller.use(someController(component));
|
|
247
264
|
* });
|
|
248
|
-
*
|
|
249
|
-
* @remarks
|
|
250
|
-
* If your controller is not async, and you are not creating it async, then
|
|
251
|
-
* you are not required to use controller.use - you can use it directly.
|
|
252
|
-
* Similarly, accessing controllers after componentWillLoad callback does not
|
|
253
|
-
* require awaiting them as they are guaranteed to be loaded by then.
|
|
254
265
|
*/
|
|
255
266
|
get use() {
|
|
256
267
|
setAmbientComponent(this.#component);
|
|
@@ -268,6 +279,8 @@ class Controller {
|
|
|
268
279
|
* - You have a controller exports only, and you want to retrieve the
|
|
269
280
|
* controller itself. This is useful if you wish to call .watchExports() or
|
|
270
281
|
* some other method on the controller
|
|
282
|
+
*
|
|
283
|
+
* @public
|
|
271
284
|
*/
|
|
272
285
|
get useRef() {
|
|
273
286
|
setAmbientComponent(this.#component);
|
|
@@ -275,44 +288,75 @@ class Controller {
|
|
|
275
288
|
}
|
|
276
289
|
/**
|
|
277
290
|
* Like useRef, but doesn't wait for the controller to get ready
|
|
278
|
-
*
|
|
279
|
-
* @private
|
|
280
291
|
*/
|
|
281
292
|
get useRefSync() {
|
|
282
293
|
setAmbientComponent(this.#component);
|
|
283
294
|
return useRefSync;
|
|
284
295
|
}
|
|
296
|
+
/** @internal */
|
|
285
297
|
controllerRemoved() {
|
|
286
298
|
if (this.#component.el.isConnected) {
|
|
287
299
|
this.triggerDisconnected();
|
|
288
300
|
}
|
|
289
301
|
this.triggerDestroy();
|
|
290
302
|
}
|
|
291
|
-
|
|
303
|
+
/**
|
|
304
|
+
* Register a connected lifecycle callback
|
|
305
|
+
* @public
|
|
306
|
+
* @param callback
|
|
307
|
+
*/
|
|
292
308
|
onConnected(callback) {
|
|
293
309
|
this.#hostConnected.push(callback);
|
|
294
310
|
}
|
|
311
|
+
/**
|
|
312
|
+
* @public
|
|
313
|
+
* @param callback
|
|
314
|
+
*/
|
|
295
315
|
onDisconnected(callback) {
|
|
296
316
|
this.#hostDisconnected.push(callback);
|
|
297
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* @public
|
|
320
|
+
* @param callback
|
|
321
|
+
*/
|
|
298
322
|
onLoad(callback) {
|
|
299
323
|
this.#hostLoad.push(callback);
|
|
300
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* @public
|
|
327
|
+
* @param callback
|
|
328
|
+
*/
|
|
301
329
|
onLoaded(callback) {
|
|
302
330
|
this.#hostLoaded.push(callback);
|
|
303
331
|
}
|
|
332
|
+
/**
|
|
333
|
+
* @public
|
|
334
|
+
* @param callback
|
|
335
|
+
*/
|
|
304
336
|
onUpdate(callback) {
|
|
305
337
|
this.#hostUpdate.push(callback);
|
|
306
338
|
}
|
|
339
|
+
/**
|
|
340
|
+
* @public
|
|
341
|
+
* @param callback
|
|
342
|
+
*/
|
|
307
343
|
onUpdated(callback) {
|
|
308
344
|
this.#hostUpdated.push(callback);
|
|
309
345
|
}
|
|
346
|
+
/**
|
|
347
|
+
* @public
|
|
348
|
+
* @param callback
|
|
349
|
+
*/
|
|
310
350
|
onDestroy(callback) {
|
|
311
351
|
if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
|
|
312
352
|
this.#component.manager.devOnly$ensureHasDestroy?.();
|
|
313
353
|
}
|
|
314
354
|
this.#hostDestroy.push(callback);
|
|
315
355
|
}
|
|
356
|
+
/**
|
|
357
|
+
* @public
|
|
358
|
+
* @param callback
|
|
359
|
+
*/
|
|
316
360
|
onLifecycle(callback) {
|
|
317
361
|
this.#hostLifecycle.push(callback);
|
|
318
362
|
if (this.connectedCalled && this.#component.el.isConnected) {
|
|
@@ -320,7 +364,6 @@ class Controller {
|
|
|
320
364
|
}
|
|
321
365
|
}
|
|
322
366
|
// Call each lifecycle hook
|
|
323
|
-
/** @private */
|
|
324
367
|
triggerConnected() {
|
|
325
368
|
const that = this;
|
|
326
369
|
if (that.hostConnected) {
|
|
@@ -330,7 +373,6 @@ class Controller {
|
|
|
330
373
|
that.triggerLifecycle();
|
|
331
374
|
that.connectedCalled = true;
|
|
332
375
|
}
|
|
333
|
-
/** @private */
|
|
334
376
|
triggerDisconnected() {
|
|
335
377
|
const that = this;
|
|
336
378
|
if (that.hostDisconnected) {
|
|
@@ -340,7 +382,6 @@ class Controller {
|
|
|
340
382
|
that.#lifecycleCleanups.forEach(safeCall);
|
|
341
383
|
that.#lifecycleCleanups = [];
|
|
342
384
|
}
|
|
343
|
-
/** @private */
|
|
344
385
|
async triggerLoad() {
|
|
345
386
|
if (this.#loadCalled) {
|
|
346
387
|
return;
|
|
@@ -355,7 +396,6 @@ class Controller {
|
|
|
355
396
|
}
|
|
356
397
|
this.P.resolve(this.#exports);
|
|
357
398
|
}
|
|
358
|
-
/** @private */
|
|
359
399
|
triggerLoaded() {
|
|
360
400
|
if (this.loadedCalled) {
|
|
361
401
|
return;
|
|
@@ -366,28 +406,24 @@ class Controller {
|
|
|
366
406
|
this.#hostLoaded.forEach(safeCall);
|
|
367
407
|
this.loadedCalled = true;
|
|
368
408
|
}
|
|
369
|
-
/** @private */
|
|
370
409
|
triggerUpdate(changes) {
|
|
371
410
|
if (this.hostUpdate) {
|
|
372
411
|
safeCall(this.hostUpdate, this, changes);
|
|
373
412
|
}
|
|
374
413
|
this.#hostUpdate.forEach(callUpdate, changes);
|
|
375
414
|
}
|
|
376
|
-
/** @private */
|
|
377
415
|
triggerUpdated(changes) {
|
|
378
416
|
if (this.hostUpdated) {
|
|
379
417
|
safeCall(this.hostUpdated, this, changes);
|
|
380
418
|
}
|
|
381
419
|
this.#hostUpdated.forEach(callUpdate, changes);
|
|
382
420
|
}
|
|
383
|
-
/** @private */
|
|
384
421
|
triggerDestroy() {
|
|
385
422
|
if (this.hostDestroy) {
|
|
386
423
|
safeCall(this.hostDestroy, this);
|
|
387
424
|
}
|
|
388
425
|
this.#hostDestroy.forEach(safeCall);
|
|
389
426
|
}
|
|
390
|
-
/** @private */
|
|
391
427
|
triggerLifecycle() {
|
|
392
428
|
if (this.hostLifecycle) {
|
|
393
429
|
this.#callLifecycle(() => this.hostLifecycle());
|
|
@@ -410,7 +446,6 @@ class Controller {
|
|
|
410
446
|
function callUpdate(callback) {
|
|
411
447
|
safeCall(callback, void 0, this);
|
|
412
448
|
}
|
|
413
|
-
const GenericController = Controller;
|
|
414
449
|
const makeProvisionalValue = (base) => {
|
|
415
450
|
if (typeof base !== "object" && typeof base !== "function" || base === null) {
|
|
416
451
|
return base;
|
|
@@ -450,6 +485,7 @@ const accessBeforeLoad = process.env.NODE_ENV !== "production" && isEsriInternal
|
|
|
450
485
|
"usage:\n",
|
|
451
486
|
"makeController(async (component, controller)=>{ await controller.use(someOtherController); });"
|
|
452
487
|
].join("") : void 0;
|
|
488
|
+
const GenericController = Controller;
|
|
453
489
|
export {
|
|
454
490
|
Controller as C,
|
|
455
491
|
GenericController as G,
|