@arcgis/common-components 4.29.0-beta.30 → 4.29.0-beta.32
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/arcgis-common-components/arcgis-common-components.esm.js +1 -1
- package/dist/arcgis-common-components/{p-de48d1cf.entry.js → p-04629339.entry.js} +1 -1
- package/dist/arcgis-common-components/{p-9f36faef.entry.js → p-264c3536.entry.js} +1 -1
- package/dist/arcgis-common-components/p-2a7fe37a.js +2 -0
- package/dist/cjs/arcgis-api-key.cjs.entry.js +1 -1
- package/dist/cjs/arcgis-common-components.cjs.js +3 -3
- package/dist/cjs/arcgis-identity.cjs.entry.js +1 -1
- package/dist/cjs/{index-e8c59179.js → index-693a0aa8.js} +207 -39
- package/dist/cjs/loader.cjs.js +3 -12
- package/dist/components/arcgis-api-key.js +3 -1
- package/dist/components/arcgis-identity.js +3 -1
- package/dist/components/index.d.ts +5 -4
- package/dist/components/index.js +1 -3
- package/dist/esm/arcgis-api-key.entry.js +1 -1
- package/dist/esm/arcgis-common-components.js +4 -4
- package/dist/esm/arcgis-identity.entry.js +1 -1
- package/dist/esm/{index-1f7e8e45.js → index-00709df9.js} +207 -39
- package/dist/esm/loader.js +4 -13
- package/dist/loader/index.d.ts +2 -2
- package/dist/types/components.d.ts +25 -0
- package/dist/types/stencil-public-runtime.d.ts +53 -17
- package/package.json +11 -11
- package/dist/arcgis-common-components/p-b0c98bba.js +0 -2
- package/dist/esm/polyfills/css-shim.js +0 -1
|
@@ -24,6 +24,13 @@ const uniqueTime = (key, measureText) => {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
const HYDRATED_CSS = '{visibility:hidden}[hydrated]{visibility:inherit}';
|
|
27
|
+
/**
|
|
28
|
+
* Check whether a value is a 'complex type', defined here as an object or a
|
|
29
|
+
* function.
|
|
30
|
+
*
|
|
31
|
+
* @param o the value to check
|
|
32
|
+
* @returns whether it's a complex type or not
|
|
33
|
+
*/
|
|
27
34
|
const isComplexType = (o) => {
|
|
28
35
|
// https://jsperf.com/typeof-fn-object/5
|
|
29
36
|
o = typeof o;
|
|
@@ -131,9 +138,9 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
131
138
|
}
|
|
132
139
|
styles.set(scopeId, style);
|
|
133
140
|
};
|
|
134
|
-
const addStyle = (styleContainerNode, cmpMeta, mode
|
|
141
|
+
const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
135
142
|
var _a;
|
|
136
|
-
|
|
143
|
+
const scopeId = getScopeId(cmpMeta);
|
|
137
144
|
const style = styles.get(scopeId);
|
|
138
145
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
139
146
|
// so the fallback is to always use the document for the root node in those cases
|
|
@@ -148,10 +155,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
148
155
|
}
|
|
149
156
|
if (!appliedStyles.has(scopeId)) {
|
|
150
157
|
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
styleElm.innerHTML = style;
|
|
154
|
-
}
|
|
158
|
+
styleElm = doc.createElement('style');
|
|
159
|
+
styleElm.innerHTML = style;
|
|
155
160
|
// Apply CSP nonce to the style tag if it exists
|
|
156
161
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
157
162
|
if (nonce != null) {
|
|
@@ -198,15 +203,76 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
198
203
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
199
204
|
return writeTask(dispatch) ;
|
|
200
205
|
};
|
|
206
|
+
/**
|
|
207
|
+
* Dispatch initial-render and update lifecycle hooks, enqueuing calls to
|
|
208
|
+
* component lifecycle methods like `componentWillLoad` as well as
|
|
209
|
+
* {@link updateComponent}, which will kick off the virtual DOM re-render.
|
|
210
|
+
*
|
|
211
|
+
* @param hostRef a reference to a host DOM node
|
|
212
|
+
* @param isInitialLoad whether we're on the initial load or not
|
|
213
|
+
* @returns an empty Promise which is used to enqueue a series of operations for
|
|
214
|
+
* the component
|
|
215
|
+
*/
|
|
201
216
|
const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
202
217
|
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
203
218
|
const instance = hostRef.$lazyInstance$ ;
|
|
204
|
-
|
|
219
|
+
// We're going to use this variable together with `enqueue` to implement a
|
|
220
|
+
// little promise-based queue. We start out with it `undefined`. When we add
|
|
221
|
+
// the first function to the queue we'll set this variable to be that
|
|
222
|
+
// function's return value. When we attempt to add subsequent values to the
|
|
223
|
+
// queue we'll check that value and, if it was a `Promise`, we'll then chain
|
|
224
|
+
// the new function off of that `Promise` using `.then()`. This will give our
|
|
225
|
+
// queue two nice properties:
|
|
226
|
+
//
|
|
227
|
+
// 1. If all functions added to the queue are synchronous they'll be called
|
|
228
|
+
// synchronously right away.
|
|
229
|
+
// 2. If all functions added to the queue are asynchronous they'll all be
|
|
230
|
+
// called in order after `dispatchHooks` exits.
|
|
231
|
+
let maybePromise;
|
|
205
232
|
endSchedule();
|
|
206
|
-
return
|
|
233
|
+
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
207
234
|
};
|
|
235
|
+
/**
|
|
236
|
+
* This function uses a Promise to implement a simple first-in, first-out queue
|
|
237
|
+
* of functions to be called.
|
|
238
|
+
*
|
|
239
|
+
* The queue is ordered on the basis of the first argument. If it's
|
|
240
|
+
* `undefined`, then nothing is on the queue yet, so the provided function can
|
|
241
|
+
* be called synchronously (although note that this function may return a
|
|
242
|
+
* `Promise`). The idea is that then the return value of that enqueueing
|
|
243
|
+
* operation is kept around, so that if it was a `Promise` then subsequent
|
|
244
|
+
* functions can be enqueued by calling this function again with that `Promise`
|
|
245
|
+
* as the first argument.
|
|
246
|
+
*
|
|
247
|
+
* @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
|
|
248
|
+
* @param fn a function to enqueue
|
|
249
|
+
* @returns either a `Promise` or the return value of the provided function
|
|
250
|
+
*/
|
|
251
|
+
const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
|
|
252
|
+
/**
|
|
253
|
+
* Check that a value is a `Promise`. To check, we first see if the value is an
|
|
254
|
+
* instance of the `Promise` global. In a few circumstances, in particular if
|
|
255
|
+
* the global has been overwritten, this is could be misleading, so we also do
|
|
256
|
+
* a little 'duck typing' check to see if the `.then` property of the value is
|
|
257
|
+
* defined and a function.
|
|
258
|
+
*
|
|
259
|
+
* @param maybePromise it might be a promise!
|
|
260
|
+
* @returns whether it is or not
|
|
261
|
+
*/
|
|
262
|
+
const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
|
|
263
|
+
(maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
|
|
264
|
+
/**
|
|
265
|
+
* Update a component given reference to its host elements and so on.
|
|
266
|
+
*
|
|
267
|
+
* @param hostRef an object containing references to the element's host node,
|
|
268
|
+
* VDom nodes, and other metadata
|
|
269
|
+
* @param instance a reference to the underlying host element where it will be
|
|
270
|
+
* rendered
|
|
271
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
272
|
+
* the first render cycle
|
|
273
|
+
*/
|
|
208
274
|
const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
209
|
-
|
|
275
|
+
var _a;
|
|
210
276
|
const elm = hostRef.$hostElement$;
|
|
211
277
|
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
212
278
|
const rc = elm['s-rc'];
|
|
@@ -228,7 +294,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
228
294
|
endRender();
|
|
229
295
|
endUpdate();
|
|
230
296
|
{
|
|
231
|
-
const childrenPromises = elm['s-p'];
|
|
297
|
+
const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
|
|
232
298
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
233
299
|
if (childrenPromises.length === 0) {
|
|
234
300
|
postUpdate();
|
|
@@ -240,8 +306,24 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
240
306
|
}
|
|
241
307
|
}
|
|
242
308
|
};
|
|
243
|
-
|
|
309
|
+
/**
|
|
310
|
+
* Handle making the call to the VDom renderer with the proper context given
|
|
311
|
+
* various build variables
|
|
312
|
+
*
|
|
313
|
+
* @param hostRef an object containing references to the element's host node,
|
|
314
|
+
* VDom nodes, and other metadata
|
|
315
|
+
* @param instance a reference to the underlying host element where it will be
|
|
316
|
+
* rendered
|
|
317
|
+
* @param elm the Host element for the component
|
|
318
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
319
|
+
* @returns an empty promise
|
|
320
|
+
*/
|
|
321
|
+
const callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
244
322
|
try {
|
|
323
|
+
/**
|
|
324
|
+
* minification optimization: `allRenderFn` is `true` if all components have a `render`
|
|
325
|
+
* method, so we can call the method immediately. If not, check before calling it.
|
|
326
|
+
*/
|
|
245
327
|
instance = instance.render && instance.render();
|
|
246
328
|
{
|
|
247
329
|
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
@@ -304,6 +386,16 @@ const appDidLoad = (who) => {
|
|
|
304
386
|
}
|
|
305
387
|
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
306
388
|
};
|
|
389
|
+
/**
|
|
390
|
+
* Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
|
|
391
|
+
* e.g. custom element node. If a build figures out that e.g. no component
|
|
392
|
+
* has a `componentDidLoad` method, the instance method gets removed from the
|
|
393
|
+
* output bundle and this function returns `undefined`.
|
|
394
|
+
* @param instance any object that may or may not contain methods
|
|
395
|
+
* @param method method name
|
|
396
|
+
* @param arg single arbitrary argument
|
|
397
|
+
* @returns result of method call if it exists, otherwise `undefined`
|
|
398
|
+
*/
|
|
307
399
|
const safeCall = (instance, method, arg) => {
|
|
308
400
|
if (instance && instance[method]) {
|
|
309
401
|
try {
|
|
@@ -315,9 +407,6 @@ const safeCall = (instance, method, arg) => {
|
|
|
315
407
|
}
|
|
316
408
|
return undefined;
|
|
317
409
|
};
|
|
318
|
-
const then = (promise, thenFn) => {
|
|
319
|
-
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
320
|
-
};
|
|
321
410
|
const addHydratedFlag = (elm) => elm.setAttribute('hydrated', '')
|
|
322
411
|
;
|
|
323
412
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
@@ -374,6 +463,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
374
463
|
* @returns a reference to the same constructor passed in (but now mutated)
|
|
375
464
|
*/
|
|
376
465
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
466
|
+
var _a;
|
|
377
467
|
if (cmpMeta.$members$) {
|
|
378
468
|
if (Cstr.watchers) {
|
|
379
469
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
@@ -411,7 +501,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
411
501
|
});
|
|
412
502
|
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
413
503
|
const attrNameToPropName = new Map();
|
|
414
|
-
prototype.attributeChangedCallback = function (attrName,
|
|
504
|
+
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
415
505
|
plt.jmp(() => {
|
|
416
506
|
const propName = attrNameToPropName.get(attrName);
|
|
417
507
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
@@ -434,12 +524,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
434
524
|
// customElements.define('my-component', MyComponent);
|
|
435
525
|
// </script>
|
|
436
526
|
// ```
|
|
437
|
-
// In this case if we do not
|
|
527
|
+
// In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
|
|
438
528
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
439
529
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
440
|
-
// the connectedCallback attempts to
|
|
530
|
+
// the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
|
|
441
531
|
//
|
|
442
|
-
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/
|
|
532
|
+
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
|
|
443
533
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
444
534
|
//
|
|
445
535
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
@@ -459,28 +549,67 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
459
549
|
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
460
550
|
return;
|
|
461
551
|
}
|
|
552
|
+
else if (propName == null) {
|
|
553
|
+
// At this point we should know this is not a "member", so we can treat it like watching an attribute
|
|
554
|
+
// on a vanilla web component
|
|
555
|
+
const hostRef = getHostRef(this);
|
|
556
|
+
const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
|
|
557
|
+
// We only want to trigger the callback(s) if:
|
|
558
|
+
// 1. The instance is ready
|
|
559
|
+
// 2. The watchers are ready
|
|
560
|
+
// 3. The value has changed
|
|
561
|
+
if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
562
|
+
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
563
|
+
newValue !== oldValue) {
|
|
564
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
565
|
+
const entry = cmpMeta.$watchers$[attrName];
|
|
566
|
+
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
567
|
+
if (instance[callbackName] != null) {
|
|
568
|
+
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
462
574
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
463
575
|
});
|
|
464
576
|
};
|
|
465
|
-
//
|
|
466
|
-
//
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
577
|
+
// Create an array of attributes to observe
|
|
578
|
+
// This list in comprised of all strings used within a `@Watch()` decorator
|
|
579
|
+
// on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
|
|
580
|
+
// As such, there is no way to guarantee type-safety here that a user hasn't entered
|
|
581
|
+
// an invalid attribute.
|
|
582
|
+
Cstr.observedAttributes = Array.from(new Set([
|
|
583
|
+
...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
|
|
584
|
+
...members
|
|
585
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
|
|
586
|
+
.map(([propName, m]) => {
|
|
587
|
+
const attrName = m[1] || propName;
|
|
588
|
+
attrNameToPropName.set(attrName, propName);
|
|
589
|
+
return attrName;
|
|
590
|
+
}),
|
|
591
|
+
]));
|
|
474
592
|
}
|
|
475
593
|
}
|
|
476
594
|
return Cstr;
|
|
477
595
|
};
|
|
478
|
-
|
|
596
|
+
/**
|
|
597
|
+
* Initialize a Stencil component given a reference to its host element, its
|
|
598
|
+
* runtime bookkeeping data structure, runtime metadata about the component,
|
|
599
|
+
* and (optionally) an HMR version ID.
|
|
600
|
+
*
|
|
601
|
+
* @param elm a host element
|
|
602
|
+
* @param hostRef the element's runtime bookkeeping object
|
|
603
|
+
* @param cmpMeta runtime metadata for the Stencil component
|
|
604
|
+
* @param hmrVersionId an (optional) HMR version ID
|
|
605
|
+
*/
|
|
606
|
+
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
607
|
+
let Cstr;
|
|
479
608
|
// initializeComponent
|
|
480
609
|
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
610
|
+
// Let the runtime know that the component has been initialized
|
|
611
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
481
612
|
{
|
|
482
|
-
// we haven't initialized this element yet
|
|
483
|
-
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
484
613
|
// lazy loaded components
|
|
485
614
|
// request the component's implementation to be
|
|
486
615
|
// wired up with the host element
|
|
@@ -599,14 +728,25 @@ const connectedCallback = (elm) => {
|
|
|
599
728
|
}
|
|
600
729
|
else {
|
|
601
730
|
// fire off connectedCallback() on component instance
|
|
602
|
-
|
|
731
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
|
|
732
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
733
|
+
}
|
|
734
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
735
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
|
|
736
|
+
}
|
|
603
737
|
}
|
|
604
738
|
endConnected();
|
|
605
739
|
}
|
|
606
740
|
};
|
|
607
|
-
const
|
|
741
|
+
const disconnectInstance = (instance) => {
|
|
742
|
+
};
|
|
743
|
+
const disconnectedCallback = async (elm) => {
|
|
608
744
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
609
|
-
getHostRef(elm);
|
|
745
|
+
const hostRef = getHostRef(elm);
|
|
746
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
747
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
748
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
749
|
+
}
|
|
610
750
|
}
|
|
611
751
|
};
|
|
612
752
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
@@ -625,6 +765,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
625
765
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
626
766
|
lazyBundles.map((lazyBundle) => {
|
|
627
767
|
lazyBundle[1].map((compactMeta) => {
|
|
768
|
+
var _a;
|
|
628
769
|
const cmpMeta = {
|
|
629
770
|
$flags$: compactMeta[0],
|
|
630
771
|
$tagName$: compactMeta[1],
|
|
@@ -635,7 +776,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
635
776
|
cmpMeta.$members$ = compactMeta[2];
|
|
636
777
|
}
|
|
637
778
|
{
|
|
638
|
-
cmpMeta.$watchers$ = {};
|
|
779
|
+
cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
|
|
639
780
|
}
|
|
640
781
|
const tagName = cmpMeta.$tagName$;
|
|
641
782
|
const HostElement = class extends HTMLElement {
|
|
@@ -703,13 +844,40 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
703
844
|
* @returns void
|
|
704
845
|
*/
|
|
705
846
|
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
847
|
+
/**
|
|
848
|
+
* A WeakMap mapping runtime component references to their corresponding host reference
|
|
849
|
+
* instances.
|
|
850
|
+
*/
|
|
706
851
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
852
|
+
/**
|
|
853
|
+
* Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
|
|
854
|
+
*
|
|
855
|
+
* @param ref the runtime ref of interest
|
|
856
|
+
* @returns the Host reference (if found) or undefined
|
|
857
|
+
*/
|
|
707
858
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
859
|
+
/**
|
|
860
|
+
* Register a lazy instance with the {@link hostRefs} object so it's
|
|
861
|
+
* corresponding {@link d.HostRef} can be retrieved later.
|
|
862
|
+
*
|
|
863
|
+
* @param lazyInstance the lazy instance of interest
|
|
864
|
+
* @param hostRef that instances `HostRef` object
|
|
865
|
+
* @returns a reference to the host ref WeakMap
|
|
866
|
+
*/
|
|
708
867
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
709
|
-
|
|
868
|
+
/**
|
|
869
|
+
* Register a host element for a Stencil component, setting up various metadata
|
|
870
|
+
* and callbacks based on {@link BUILD} flags as well as the component's runtime
|
|
871
|
+
* metadata.
|
|
872
|
+
*
|
|
873
|
+
* @param hostElement the host element to register
|
|
874
|
+
* @param cmpMeta runtime metadata for that component
|
|
875
|
+
* @returns a reference to the host ref WeakMap
|
|
876
|
+
*/
|
|
877
|
+
const registerHost = (hostElement, cmpMeta) => {
|
|
710
878
|
const hostRef = {
|
|
711
879
|
$flags$: 0,
|
|
712
|
-
$hostElement$:
|
|
880
|
+
$hostElement$: hostElement,
|
|
713
881
|
$cmpMeta$: cmpMeta,
|
|
714
882
|
$instanceValues$: new Map(),
|
|
715
883
|
};
|
|
@@ -718,10 +886,10 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
718
886
|
}
|
|
719
887
|
{
|
|
720
888
|
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
721
|
-
|
|
722
|
-
|
|
889
|
+
hostElement['s-p'] = [];
|
|
890
|
+
hostElement['s-rc'] = [];
|
|
723
891
|
}
|
|
724
|
-
return hostRefs.set(
|
|
892
|
+
return hostRefs.set(hostElement, hostRef);
|
|
725
893
|
};
|
|
726
894
|
const consoleError = (e, el) => (0, console.error)(e, el);
|
|
727
895
|
const cmpModules = /*@__PURE__*/ new Map();
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { s as setNonce } from './index-
|
|
3
|
-
|
|
4
|
-
/*
|
|
5
|
-
Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
6
|
-
*/
|
|
7
|
-
const patchEsm = () => {
|
|
8
|
-
return promiseResolve();
|
|
9
|
-
};
|
|
1
|
+
import { b as bootstrapLazy } from './index-00709df9.js';
|
|
2
|
+
export { s as setNonce } from './index-00709df9.js';
|
|
10
3
|
|
|
11
4
|
const defineCustomElements = (win, options) => {
|
|
12
|
-
if (typeof window === 'undefined') return
|
|
13
|
-
return
|
|
14
|
-
return bootstrapLazy([["arcgis-api-key",[[0,"arcgis-api-key",{"apiKey":[1,"api-key"]}]]],["arcgis-identity",[[0,"arcgis-identity",{"identity":[1040],"appId":[1,"app-id"],"credential":[1040],"expiration":[1026],"locale":[1],"usePopup":[4,"use-popup"],"popupCallbackUrl":[1,"popup-callback-url"],"portalUrl":[1,"portal-url"],"preserveUrlHash":[4,"preserve-url-hash"],"signIn":[64],"signOut":[64]}]]]], options);
|
|
15
|
-
});
|
|
5
|
+
if (typeof window === 'undefined') return undefined;
|
|
6
|
+
return bootstrapLazy([["arcgis-api-key",[[0,"arcgis-api-key",{"apiKey":[1,"api-key"]},null,{"apiKey":["apiKeyWatcher"]}]]],["arcgis-identity",[[0,"arcgis-identity",{"identity":[1040],"appId":[1,"app-id"],"credential":[1040],"expiration":[1026],"locale":[1],"usePopup":[4,"use-popup"],"popupCallbackUrl":[1,"popup-callback-url"],"portalUrl":[1,"portal-url"],"preserveUrlHash":[4,"preserve-url-hash"],"signIn":[64],"signOut":[64]},null,{"appId":["appIdWatcher"]}]]]], options);
|
|
16
7
|
};
|
|
17
8
|
|
|
18
9
|
export { defineCustomElements };
|
package/dist/loader/index.d.ts
CHANGED
|
@@ -8,10 +8,10 @@ export interface CustomElementsDefineOptions {
|
|
|
8
8
|
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
9
9
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
10
10
|
}
|
|
11
|
-
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions):
|
|
11
|
+
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;
|
|
12
12
|
export declare function applyPolyfills(): Promise<void>;
|
|
13
13
|
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
15
|
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
16
16
|
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
17
17
|
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { ArcGISCredential } from "./components/types";
|
|
9
|
+
export { ArcGISCredential } from "./components/types";
|
|
9
10
|
export namespace Components {
|
|
10
11
|
interface ArcgisApiKey {
|
|
11
12
|
"apiKey": string;
|
|
@@ -33,13 +34,37 @@ export interface ArcgisIdentityCustomEvent<T> extends CustomEvent<T> {
|
|
|
33
34
|
target: HTMLArcgisIdentityElement;
|
|
34
35
|
}
|
|
35
36
|
declare global {
|
|
37
|
+
interface HTMLArcgisApiKeyElementEventMap {
|
|
38
|
+
"apiKeyReady": boolean;
|
|
39
|
+
}
|
|
36
40
|
interface HTMLArcgisApiKeyElement extends Components.ArcgisApiKey, HTMLStencilElement {
|
|
41
|
+
addEventListener<K extends keyof HTMLArcgisApiKeyElementEventMap>(type: K, listener: (this: HTMLArcgisApiKeyElement, ev: ArcgisApiKeyCustomEvent<HTMLArcgisApiKeyElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
42
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
43
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
44
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
45
|
+
removeEventListener<K extends keyof HTMLArcgisApiKeyElementEventMap>(type: K, listener: (this: HTMLArcgisApiKeyElement, ev: ArcgisApiKeyCustomEvent<HTMLArcgisApiKeyElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
46
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
47
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
48
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
37
49
|
}
|
|
38
50
|
var HTMLArcgisApiKeyElement: {
|
|
39
51
|
prototype: HTMLArcgisApiKeyElement;
|
|
40
52
|
new (): HTMLArcgisApiKeyElement;
|
|
41
53
|
};
|
|
54
|
+
interface HTMLArcgisIdentityElementEventMap {
|
|
55
|
+
"identityReady": { identity: __esri.IdentityManager; ready: boolean };
|
|
56
|
+
"credentialCreate": __esri.IdentityManagerCredentialCreateEvent;
|
|
57
|
+
"dialogCreate": __esri.IdentityManagerDialogCreateEvent;
|
|
58
|
+
}
|
|
42
59
|
interface HTMLArcgisIdentityElement extends Components.ArcgisIdentity, HTMLStencilElement {
|
|
60
|
+
addEventListener<K extends keyof HTMLArcgisIdentityElementEventMap>(type: K, listener: (this: HTMLArcgisIdentityElement, ev: ArcgisIdentityCustomEvent<HTMLArcgisIdentityElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
61
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
62
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
63
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
64
|
+
removeEventListener<K extends keyof HTMLArcgisIdentityElementEventMap>(type: K, listener: (this: HTMLArcgisIdentityElement, ev: ArcgisIdentityCustomEvent<HTMLArcgisIdentityElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
65
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
66
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
67
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
43
68
|
}
|
|
44
69
|
var HTMLArcgisIdentityElement: {
|
|
45
70
|
prototype: HTMLArcgisIdentityElement;
|