@arcgis/common-components 1.0.0-beta.4 → 1.0.0-beta.6
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 -150
- package/dist/arcgis-common-components/index.esm.js +0 -3
- package/dist/arcgis-common-components/p-03a260f0.entry.js +1 -0
- package/dist/arcgis-common-components/p-b0c98bba.js +2 -0
- package/dist/arcgis-common-components/p-cf61ea62.js +1 -0
- package/dist/arcgis-common-components/p-e7d11c26.entry.js +1 -0
- package/dist/cjs/arcgis-api-key.cjs.entry.js +51 -0
- package/dist/cjs/arcgis-common-components.cjs.js +23 -0
- package/dist/cjs/arcgis-identity.cjs.entry.js +139 -0
- package/dist/cjs/index-a59a12ef.js +65 -0
- package/dist/cjs/index-e8c59179.js +858 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +22 -0
- package/dist/components/arcgis-api-key.js +67 -0
- package/dist/components/arcgis-identity.js +165 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index2.js +40 -0
- package/dist/{arcgis-common-components → esm}/arcgis-api-key.entry.js +2 -4
- package/dist/esm/arcgis-common-components.js +18 -0
- package/dist/{arcgis-common-components → esm}/arcgis-identity.entry.js +2 -4
- package/dist/esm/index-1f7e8e45.js +831 -0
- package/dist/esm/index-d62c741e.js +40 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +18 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +3 -0
- package/dist/loader/index.cjs.js +3 -0
- package/dist/loader/index.d.ts +21 -0
- package/dist/loader/index.es2017.js +3 -0
- package/dist/loader/index.js +4 -0
- package/dist/loader/package.json +11 -0
- package/package.json +6 -6
- package/dist/arcgis-common-components/app-globals-0f993ce5.js +0 -5
- package/dist/arcgis-common-components/app-globals-0f993ce5.js.map +0 -1
- package/dist/arcgis-common-components/arcgis-api-key.entry.js.map +0 -1
- package/dist/arcgis-common-components/arcgis-common-components.esm.js.map +0 -1
- package/dist/arcgis-common-components/arcgis-identity.entry.js.map +0 -1
- package/dist/arcgis-common-components/css-shim-b7d3d95f.js +0 -6
- package/dist/arcgis-common-components/css-shim-b7d3d95f.js.map +0 -1
- package/dist/arcgis-common-components/dom-64053c71.js +0 -75
- package/dist/arcgis-common-components/dom-64053c71.js.map +0 -1
- package/dist/arcgis-common-components/index-5dbab23c.js +0 -3373
- package/dist/arcgis-common-components/index-5dbab23c.js.map +0 -1
- package/dist/arcgis-common-components/index-bf3bb90d.js +0 -8295
- package/dist/arcgis-common-components/index-bf3bb90d.js.map +0 -1
- package/dist/arcgis-common-components/index.esm.js.map +0 -1
- package/dist/arcgis-common-components/shadow-css-008a49f5.js +0 -389
- package/dist/arcgis-common-components/shadow-css-008a49f5.js.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e8c59179.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchEsm = () => {
|
|
11
|
+
return index.promiseResolve();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const defineCustomElements = (win, options) => {
|
|
15
|
+
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
+
return patchEsm().then(() => {
|
|
17
|
+
return index.bootstrapLazy([["arcgis-api-key.cjs",[[0,"arcgis-api-key",{"apiKey":[1,"api-key"]}]]],["arcgis-identity.cjs",[[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);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.setNonce = index.setNonce;
|
|
22
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
|
|
2
|
+
import { i as importConfig } from './index2.js';
|
|
3
|
+
|
|
4
|
+
const arcgisApiKeyCss = ":host{display:none}arcgis-api-key{display:none}";
|
|
5
|
+
|
|
6
|
+
const ArcgisApiKey$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.apiKeyReady = createEvent(this, "apiKeyReady", 7);
|
|
11
|
+
this.apiKey = undefined;
|
|
12
|
+
}
|
|
13
|
+
//--------------------------------------------------------------------------
|
|
14
|
+
//
|
|
15
|
+
// Watchers
|
|
16
|
+
//
|
|
17
|
+
//--------------------------------------------------------------------------
|
|
18
|
+
apiKeyWatcher(value) {
|
|
19
|
+
this._setApiKey(value);
|
|
20
|
+
}
|
|
21
|
+
//--------------------------------------------------------------------------
|
|
22
|
+
//
|
|
23
|
+
// Lifecycle
|
|
24
|
+
//
|
|
25
|
+
//--------------------------------------------------------------------------
|
|
26
|
+
async connectedCallback() {
|
|
27
|
+
if (this.apiKey) {
|
|
28
|
+
await this._setApiKey(this.apiKey);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//--------------------------------------------------------------------------
|
|
32
|
+
//
|
|
33
|
+
// Private Methods
|
|
34
|
+
//
|
|
35
|
+
//--------------------------------------------------------------------------
|
|
36
|
+
async _setApiKey(value) {
|
|
37
|
+
const config = await importConfig();
|
|
38
|
+
config.apiKey = value;
|
|
39
|
+
this.apiKeyReady.emit(true);
|
|
40
|
+
}
|
|
41
|
+
get el() { return this; }
|
|
42
|
+
static get watchers() { return {
|
|
43
|
+
"apiKey": ["apiKeyWatcher"]
|
|
44
|
+
}; }
|
|
45
|
+
static get style() { return arcgisApiKeyCss; }
|
|
46
|
+
}, [0, "arcgis-api-key", {
|
|
47
|
+
"apiKey": [1, "api-key"]
|
|
48
|
+
}]);
|
|
49
|
+
function defineCustomElement$1() {
|
|
50
|
+
if (typeof customElements === "undefined") {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const components = ["arcgis-api-key"];
|
|
54
|
+
components.forEach(tagName => { switch (tagName) {
|
|
55
|
+
case "arcgis-api-key":
|
|
56
|
+
if (!customElements.get(tagName)) {
|
|
57
|
+
customElements.define(tagName, ArcgisApiKey$1);
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
} });
|
|
61
|
+
}
|
|
62
|
+
defineCustomElement$1();
|
|
63
|
+
|
|
64
|
+
const ArcgisApiKey = ArcgisApiKey$1;
|
|
65
|
+
const defineCustomElement = defineCustomElement$1;
|
|
66
|
+
|
|
67
|
+
export { ArcgisApiKey, defineCustomElement };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
|
|
2
|
+
import { a as importCoreReactiveUtils, n as newIdentityOAuthInfo, b as importIdentityIdentityManager } from './index2.js';
|
|
3
|
+
|
|
4
|
+
const arcgisIdentityCss = ":host{display:none}arcgis-identity{display:none}";
|
|
5
|
+
|
|
6
|
+
const ArcgisIdentity$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.identityReady = createEvent(this, "identityReady", 7);
|
|
11
|
+
this.credentialCreate = createEvent(this, "credentialCreate", 7);
|
|
12
|
+
this.dialogCreate = createEvent(this, "dialogCreate", 7);
|
|
13
|
+
this.identity = undefined;
|
|
14
|
+
this.appId = undefined;
|
|
15
|
+
this.credential = undefined;
|
|
16
|
+
this.expiration = undefined;
|
|
17
|
+
this.locale = undefined;
|
|
18
|
+
this.usePopup = false;
|
|
19
|
+
this.popupCallbackUrl = undefined;
|
|
20
|
+
this.portalUrl = undefined;
|
|
21
|
+
this.preserveUrlHash = false;
|
|
22
|
+
}
|
|
23
|
+
//--------------------------------------------------------------------------
|
|
24
|
+
//
|
|
25
|
+
// Watchers
|
|
26
|
+
//
|
|
27
|
+
//--------------------------------------------------------------------------
|
|
28
|
+
appIdWatcher(value, oldValue) {
|
|
29
|
+
if (oldValue !== value) {
|
|
30
|
+
this._registerOAuth();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//--------------------------------------------------------------------------
|
|
34
|
+
//
|
|
35
|
+
// Methods
|
|
36
|
+
//
|
|
37
|
+
//--------------------------------------------------------------------------
|
|
38
|
+
async signIn() {
|
|
39
|
+
if (!this.credential) {
|
|
40
|
+
try {
|
|
41
|
+
this.credential = await this._checkCurrentStatus();
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
this.credential = await this._fetchCredential();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return this.credential;
|
|
48
|
+
}
|
|
49
|
+
async signOut() {
|
|
50
|
+
if (!this.credential) {
|
|
51
|
+
try {
|
|
52
|
+
this.identity.destroyCredentials();
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
this.credential = undefined;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
this.credential = undefined;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
//--------------------------------------------------------------------------
|
|
62
|
+
//
|
|
63
|
+
// Lifecycle
|
|
64
|
+
//
|
|
65
|
+
//--------------------------------------------------------------------------
|
|
66
|
+
async connectedCallback() {
|
|
67
|
+
if (this.appId) {
|
|
68
|
+
await this._registerOAuth();
|
|
69
|
+
}
|
|
70
|
+
this._proxyEvents();
|
|
71
|
+
await this._addWatchers();
|
|
72
|
+
this.identityReady.emit({ identity: this.identity, ready: true });
|
|
73
|
+
}
|
|
74
|
+
//--------------------------------------------------------------------------
|
|
75
|
+
//
|
|
76
|
+
// Private Methods
|
|
77
|
+
//
|
|
78
|
+
//--------------------------------------------------------------------------
|
|
79
|
+
async _addWatchers() {
|
|
80
|
+
const { watch } = await importCoreReactiveUtils();
|
|
81
|
+
watch(() => this._info.expiration, (value) => (this.expiration = value), {
|
|
82
|
+
initial: true
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
_checkCurrentStatus() {
|
|
86
|
+
return this.identity.checkSignInStatus(`${this._info.portalUrl}/sharing`);
|
|
87
|
+
}
|
|
88
|
+
async _createOAuthInfo() {
|
|
89
|
+
const params = {};
|
|
90
|
+
if (this.appId !== undefined) {
|
|
91
|
+
params.appId = this.appId;
|
|
92
|
+
}
|
|
93
|
+
if (this.locale !== undefined) {
|
|
94
|
+
params.locale = this.locale;
|
|
95
|
+
}
|
|
96
|
+
if (this.popupCallbackUrl !== undefined) {
|
|
97
|
+
params.popupCallbackUrl = this.popupCallbackUrl;
|
|
98
|
+
}
|
|
99
|
+
if (this.preserveUrlHash !== undefined) {
|
|
100
|
+
params.preserveUrlHash = this.preserveUrlHash;
|
|
101
|
+
}
|
|
102
|
+
if (this.usePopup !== undefined) {
|
|
103
|
+
params.popup = this.usePopup;
|
|
104
|
+
}
|
|
105
|
+
if (this.portalUrl !== undefined) {
|
|
106
|
+
params.portalUrl = this.portalUrl;
|
|
107
|
+
}
|
|
108
|
+
const info = await newIdentityOAuthInfo(params);
|
|
109
|
+
this._info = info;
|
|
110
|
+
return info;
|
|
111
|
+
}
|
|
112
|
+
async _fetchCredential() {
|
|
113
|
+
const credential = await this.identity.getCredential(`${this._info?.portalUrl}/sharing`, {
|
|
114
|
+
error: null,
|
|
115
|
+
oAuthPopupConfirmation: false,
|
|
116
|
+
token: null
|
|
117
|
+
});
|
|
118
|
+
return credential;
|
|
119
|
+
}
|
|
120
|
+
async _registerOAuth() {
|
|
121
|
+
this.identity = await importIdentityIdentityManager();
|
|
122
|
+
const info = await this._createOAuthInfo();
|
|
123
|
+
this.identity.registerOAuthInfos([info]);
|
|
124
|
+
}
|
|
125
|
+
_proxyEvents() {
|
|
126
|
+
this.identity.on("credential-create", (e) => this.credentialCreate.emit(e));
|
|
127
|
+
this.identity.on("dialog-create", (e) => this.dialogCreate.emit(e));
|
|
128
|
+
}
|
|
129
|
+
get el() { return this; }
|
|
130
|
+
static get watchers() { return {
|
|
131
|
+
"appId": ["appIdWatcher"]
|
|
132
|
+
}; }
|
|
133
|
+
static get style() { return arcgisIdentityCss; }
|
|
134
|
+
}, [0, "arcgis-identity", {
|
|
135
|
+
"identity": [1040],
|
|
136
|
+
"appId": [1, "app-id"],
|
|
137
|
+
"credential": [1040],
|
|
138
|
+
"expiration": [1026],
|
|
139
|
+
"locale": [1],
|
|
140
|
+
"usePopup": [4, "use-popup"],
|
|
141
|
+
"popupCallbackUrl": [1, "popup-callback-url"],
|
|
142
|
+
"portalUrl": [1, "portal-url"],
|
|
143
|
+
"preserveUrlHash": [4, "preserve-url-hash"],
|
|
144
|
+
"signIn": [64],
|
|
145
|
+
"signOut": [64]
|
|
146
|
+
}]);
|
|
147
|
+
function defineCustomElement$1() {
|
|
148
|
+
if (typeof customElements === "undefined") {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const components = ["arcgis-identity"];
|
|
152
|
+
components.forEach(tagName => { switch (tagName) {
|
|
153
|
+
case "arcgis-identity":
|
|
154
|
+
if (!customElements.get(tagName)) {
|
|
155
|
+
customElements.define(tagName, ArcgisIdentity$1);
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
} });
|
|
159
|
+
}
|
|
160
|
+
defineCustomElement$1();
|
|
161
|
+
|
|
162
|
+
const ArcgisIdentity = ArcgisIdentity$1;
|
|
163
|
+
const defineCustomElement = defineCustomElement$1;
|
|
164
|
+
|
|
165
|
+
export { ArcgisIdentity, defineCustomElement };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
+
export { ArcgisApiKey, defineCustomElement as defineCustomElementArcgisApiKey } from './arcgis-api-key.js';
|
|
3
|
+
export { ArcgisIdentity, defineCustomElement as defineCustomElementArcgisIdentity } from './arcgis-identity.js';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const amd = "define" in window && typeof window.define === "function" && "amd" in window.define;
|
|
2
|
+
function requireModule(modulePath) {
|
|
3
|
+
return new Promise((resolve) => window.require([modulePath], (moduleDefault) => {
|
|
4
|
+
resolve(moduleDefault);
|
|
5
|
+
}));
|
|
6
|
+
}
|
|
7
|
+
async function importIdentityIdentityManager() {
|
|
8
|
+
if (amd) {
|
|
9
|
+
return requireModule("esri/identity/IdentityManager");
|
|
10
|
+
}
|
|
11
|
+
const module = await import('@arcgis/core/identity/IdentityManager.js');
|
|
12
|
+
return module.default;
|
|
13
|
+
}
|
|
14
|
+
async function importIdentityOAuthInfo() {
|
|
15
|
+
if (amd) {
|
|
16
|
+
return requireModule("esri/identity/OAuthInfo");
|
|
17
|
+
}
|
|
18
|
+
const module = await import('@arcgis/core/identity/OAuthInfo.js');
|
|
19
|
+
return module.default;
|
|
20
|
+
}
|
|
21
|
+
async function newIdentityOAuthInfo(properties) {
|
|
22
|
+
const ModConstructor = await importIdentityOAuthInfo();
|
|
23
|
+
return new ModConstructor(properties);
|
|
24
|
+
}
|
|
25
|
+
async function importConfig() {
|
|
26
|
+
if (amd) {
|
|
27
|
+
return requireModule("esri/config");
|
|
28
|
+
}
|
|
29
|
+
const module = await import('@arcgis/core/config.js');
|
|
30
|
+
return module.default;
|
|
31
|
+
}
|
|
32
|
+
async function importCoreReactiveUtils() {
|
|
33
|
+
if (amd) {
|
|
34
|
+
return requireModule("esri/core/reactiveUtils");
|
|
35
|
+
}
|
|
36
|
+
const module = await import('@arcgis/core/core/reactiveUtils.js');
|
|
37
|
+
return module;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { importCoreReactiveUtils as a, importIdentityIdentityManager as b, importConfig as i, newIdentityOAuthInfo as n };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
2
|
-
import { i as importConfig } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, g as getElement } from './index-1f7e8e45.js';
|
|
2
|
+
import { i as importConfig } from './index-d62c741e.js';
|
|
3
3
|
|
|
4
4
|
const arcgisApiKeyCss = ":host{display:none}arcgis-api-key{display:none}";
|
|
5
5
|
|
|
@@ -45,5 +45,3 @@ const ArcgisApiKey = class {
|
|
|
45
45
|
ArcgisApiKey.style = arcgisApiKeyCss;
|
|
46
46
|
|
|
47
47
|
export { ArcgisApiKey as arcgis_api_key };
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=arcgis-api-key.entry.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-1f7e8e45.js';
|
|
2
|
+
export { s as setNonce } from './index-1f7e8e45.js';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
6
|
+
*/
|
|
7
|
+
const patchBrowser = () => {
|
|
8
|
+
const importMeta = import.meta.url;
|
|
9
|
+
const opts = {};
|
|
10
|
+
if (importMeta !== '') {
|
|
11
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
12
|
+
}
|
|
13
|
+
return promiseResolve(opts);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
patchBrowser().then(options => {
|
|
17
|
+
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);
|
|
18
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
2
|
-
import { a as importCoreReactiveUtils, n as newIdentityOAuthInfo, b as importIdentityIdentityManager } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, g as getElement } from './index-1f7e8e45.js';
|
|
2
|
+
import { a as importCoreReactiveUtils, n as newIdentityOAuthInfo, b as importIdentityIdentityManager } from './index-d62c741e.js';
|
|
3
3
|
|
|
4
4
|
const arcgisIdentityCss = ":host{display:none}arcgis-identity{display:none}";
|
|
5
5
|
|
|
@@ -133,5 +133,3 @@ const ArcgisIdentity = class {
|
|
|
133
133
|
ArcgisIdentity.style = arcgisIdentityCss;
|
|
134
134
|
|
|
135
135
|
export { ArcgisIdentity as arcgis_identity };
|
|
136
|
-
|
|
137
|
-
//# sourceMappingURL=arcgis-identity.entry.js.map
|