@arcgis/common-components 1.0.0-beta.3 → 1.0.0-beta.4

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.
Files changed (55) hide show
  1. package/dist/arcgis-common-components/app-globals-0f993ce5.js +5 -0
  2. package/dist/arcgis-common-components/app-globals-0f993ce5.js.map +1 -0
  3. package/dist/{esm → arcgis-common-components}/arcgis-api-key.entry.js +4 -2
  4. package/dist/arcgis-common-components/arcgis-api-key.entry.js.map +1 -0
  5. package/dist/arcgis-common-components/arcgis-common-components.esm.js +150 -1
  6. package/dist/arcgis-common-components/arcgis-common-components.esm.js.map +1 -0
  7. package/dist/{esm → arcgis-common-components}/arcgis-identity.entry.js +4 -2
  8. package/dist/arcgis-common-components/arcgis-identity.entry.js.map +1 -0
  9. package/dist/arcgis-common-components/css-shim-b7d3d95f.js +6 -0
  10. package/dist/arcgis-common-components/css-shim-b7d3d95f.js.map +1 -0
  11. package/dist/arcgis-common-components/dom-64053c71.js +75 -0
  12. package/dist/arcgis-common-components/dom-64053c71.js.map +1 -0
  13. package/dist/arcgis-common-components/index-5dbab23c.js +3373 -0
  14. package/dist/arcgis-common-components/index-5dbab23c.js.map +1 -0
  15. package/dist/arcgis-common-components/index-bf3bb90d.js +8295 -0
  16. package/dist/arcgis-common-components/index-bf3bb90d.js.map +1 -0
  17. package/dist/arcgis-common-components/index.esm.js +3 -0
  18. package/dist/arcgis-common-components/index.esm.js.map +1 -0
  19. package/dist/arcgis-common-components/shadow-css-008a49f5.js +389 -0
  20. package/dist/arcgis-common-components/shadow-css-008a49f5.js.map +1 -0
  21. package/package.json +3 -3
  22. package/dist/arcgis-common-components/p-9fc4e265.entry.js +0 -1
  23. package/dist/arcgis-common-components/p-adc54f17.entry.js +0 -1
  24. package/dist/arcgis-common-components/p-b0c98bba.js +0 -2
  25. package/dist/arcgis-common-components/p-e8b62824.js +0 -1
  26. package/dist/cjs/arcgis-api-key.cjs.entry.js +0 -51
  27. package/dist/cjs/arcgis-common-components.cjs.js +0 -23
  28. package/dist/cjs/arcgis-identity.cjs.entry.js +0 -139
  29. package/dist/cjs/index-33f2dbd2.js +0 -65
  30. package/dist/cjs/index-e8c59179.js +0 -858
  31. package/dist/cjs/index.cjs.js +0 -2
  32. package/dist/cjs/loader.cjs.js +0 -22
  33. package/dist/components/arcgis-api-key.js +0 -67
  34. package/dist/components/arcgis-identity.js +0 -165
  35. package/dist/components/index.js +0 -3
  36. package/dist/components/index2.js +0 -40
  37. package/dist/esm/arcgis-common-components.js +0 -18
  38. package/dist/esm/index-1f7e8e45.js +0 -831
  39. package/dist/esm/index-386f07e9.js +0 -40
  40. package/dist/esm/index.js +0 -1
  41. package/dist/esm/loader.js +0 -18
  42. package/dist/esm/polyfills/core-js.js +0 -11
  43. package/dist/esm/polyfills/css-shim.js +0 -1
  44. package/dist/esm/polyfills/dom.js +0 -79
  45. package/dist/esm/polyfills/es5-html-element.js +0 -1
  46. package/dist/esm/polyfills/index.js +0 -34
  47. package/dist/esm/polyfills/system.js +0 -6
  48. package/dist/index.cjs.js +0 -1
  49. package/dist/index.js +0 -1
  50. package/dist/loader/cdn.js +0 -3
  51. package/dist/loader/index.cjs.js +0 -3
  52. package/dist/loader/index.d.ts +0 -21
  53. package/dist/loader/index.es2017.js +0 -3
  54. package/dist/loader/index.js +0 -4
  55. package/dist/loader/package.json +0 -11
@@ -1,139 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-e8c59179.js');
6
- const index$1 = require('./index-33f2dbd2.js');
7
-
8
- const arcgisIdentityCss = ":host{display:none}arcgis-identity{display:none}";
9
-
10
- const ArcgisIdentity = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.identityReady = index.createEvent(this, "identityReady", 7);
14
- this.credentialCreate = index.createEvent(this, "credentialCreate", 7);
15
- this.dialogCreate = index.createEvent(this, "dialogCreate", 7);
16
- this.identity = undefined;
17
- this.appId = undefined;
18
- this.credential = undefined;
19
- this.expiration = undefined;
20
- this.locale = undefined;
21
- this.usePopup = false;
22
- this.popupCallbackUrl = undefined;
23
- this.portalUrl = undefined;
24
- this.preserveUrlHash = false;
25
- }
26
- //--------------------------------------------------------------------------
27
- //
28
- // Watchers
29
- //
30
- //--------------------------------------------------------------------------
31
- appIdWatcher(value, oldValue) {
32
- if (oldValue !== value) {
33
- this._registerOAuth();
34
- }
35
- }
36
- //--------------------------------------------------------------------------
37
- //
38
- // Methods
39
- //
40
- //--------------------------------------------------------------------------
41
- async signIn() {
42
- if (!this.credential) {
43
- try {
44
- this.credential = await this._checkCurrentStatus();
45
- }
46
- catch (error) {
47
- this.credential = await this._fetchCredential();
48
- }
49
- }
50
- return this.credential;
51
- }
52
- async signOut() {
53
- if (!this.credential) {
54
- try {
55
- this.identity.destroyCredentials();
56
- }
57
- catch (error) {
58
- this.credential = undefined;
59
- }
60
- }
61
- this.credential = undefined;
62
- return;
63
- }
64
- //--------------------------------------------------------------------------
65
- //
66
- // Lifecycle
67
- //
68
- //--------------------------------------------------------------------------
69
- async connectedCallback() {
70
- if (this.appId) {
71
- await this._registerOAuth();
72
- }
73
- this._proxyEvents();
74
- await this._addWatchers();
75
- this.identityReady.emit({ identity: this.identity, ready: true });
76
- }
77
- //--------------------------------------------------------------------------
78
- //
79
- // Private Methods
80
- //
81
- //--------------------------------------------------------------------------
82
- async _addWatchers() {
83
- const { watch } = await index$1.importCoreReactiveUtils();
84
- watch(() => this._info.expiration, (value) => (this.expiration = value), {
85
- initial: true
86
- });
87
- }
88
- _checkCurrentStatus() {
89
- return this.identity.checkSignInStatus(`${this._info.portalUrl}/sharing`);
90
- }
91
- async _createOAuthInfo() {
92
- const params = {};
93
- if (this.appId !== undefined) {
94
- params.appId = this.appId;
95
- }
96
- if (this.locale !== undefined) {
97
- params.locale = this.locale;
98
- }
99
- if (this.popupCallbackUrl !== undefined) {
100
- params.popupCallbackUrl = this.popupCallbackUrl;
101
- }
102
- if (this.preserveUrlHash !== undefined) {
103
- params.preserveUrlHash = this.preserveUrlHash;
104
- }
105
- if (this.usePopup !== undefined) {
106
- params.popup = this.usePopup;
107
- }
108
- if (this.portalUrl !== undefined) {
109
- params.portalUrl = this.portalUrl;
110
- }
111
- const info = await index$1.newIdentityOAuthInfo(params);
112
- this._info = info;
113
- return info;
114
- }
115
- async _fetchCredential() {
116
- const credential = await this.identity.getCredential(`${this._info?.portalUrl}/sharing`, {
117
- error: null,
118
- oAuthPopupConfirmation: false,
119
- token: null
120
- });
121
- return credential;
122
- }
123
- async _registerOAuth() {
124
- this.identity = await index$1.importIdentityIdentityManager();
125
- const info = await this._createOAuthInfo();
126
- this.identity.registerOAuthInfos([info]);
127
- }
128
- _proxyEvents() {
129
- this.identity.on("credential-create", (e) => this.credentialCreate.emit(e));
130
- this.identity.on("dialog-create", (e) => this.dialogCreate.emit(e));
131
- }
132
- get el() { return index.getElement(this); }
133
- static get watchers() { return {
134
- "appId": ["appIdWatcher"]
135
- }; }
136
- };
137
- ArcgisIdentity.style = arcgisIdentityCss;
138
-
139
- exports.arcgis_identity = ArcgisIdentity;
@@ -1,65 +0,0 @@
1
- 'use strict';
2
-
3
- function _interopNamespace(e) {
4
- if (e && e.__esModule) return e;
5
- var n = Object.create(null);
6
- if (e) {
7
- Object.keys(e).forEach(function (k) {
8
- if (k !== 'default') {
9
- var d = Object.getOwnPropertyDescriptor(e, k);
10
- Object.defineProperty(n, k, d.get ? d : {
11
- enumerable: true,
12
- get: function () {
13
- return e[k];
14
- }
15
- });
16
- }
17
- });
18
- }
19
- n['default'] = e;
20
- return Object.freeze(n);
21
- }
22
-
23
- const amd = "define" in window && typeof window.define === "function" && "amd" in window.define;
24
- function requireModule(modulePath) {
25
- return new Promise((resolve) => window.require([modulePath], (moduleDefault) => {
26
- resolve(moduleDefault);
27
- }));
28
- }
29
- async function importIdentityIdentityManager() {
30
- if (amd) {
31
- return requireModule("esri/identity/IdentityManager");
32
- }
33
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/identity/IdentityManager.js')); });
34
- return module.default;
35
- }
36
- async function importIdentityOAuthInfo() {
37
- if (amd) {
38
- return requireModule("esri/identity/OAuthInfo");
39
- }
40
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/identity/OAuthInfo.js')); });
41
- return module.default;
42
- }
43
- async function newIdentityOAuthInfo(properties) {
44
- const ModConstructor = await importIdentityOAuthInfo();
45
- return new ModConstructor(properties);
46
- }
47
- async function importConfig() {
48
- if (amd) {
49
- return requireModule("esri/config");
50
- }
51
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/config.js')); });
52
- return module.default;
53
- }
54
- async function importCoreReactiveUtils() {
55
- if (amd) {
56
- return requireModule("esri/core/reactiveUtils");
57
- }
58
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/core/reactiveUtils.js')); });
59
- return module;
60
- }
61
-
62
- exports.importConfig = importConfig;
63
- exports.importCoreReactiveUtils = importCoreReactiveUtils;
64
- exports.importIdentityIdentityManager = importIdentityIdentityManager;
65
- exports.newIdentityOAuthInfo = newIdentityOAuthInfo;