@arcgis/common-components 4.28.0-beta.6 → 4.28.0-beta.7

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.
@@ -1 +1 @@
1
- import{p,b as a}from"./p-b0c98bba.js";export{s as setNonce}from"./p-b0c98bba.js";(()=>{const a=import.meta.url,e={};return""!==a&&(e.resourcesUrl=new URL(".",a).href),p(e)})().then((p=>a([["p-2e2a7070",[[0,"arcgis-api-key",{apiKey:[1,"api-key"]}]]],["p-3692374d",[[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]}]]]],p)));
1
+ import{p,b as a}from"./p-b0c98bba.js";export{s as setNonce}from"./p-b0c98bba.js";(()=>{const a=import.meta.url,r={};return""!==a&&(r.resourcesUrl=new URL(".",a).href),p(r)})().then((p=>a([["p-602c118d",[[0,"arcgis-api-key",{apiKey:[1,"api-key"]}]]],["p-3323a8c9",[[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]}]]]],p)));
@@ -1 +1 @@
1
- import{r as t,c as i,g as s}from"./p-b0c98bba.js";import{a as h,n as a,b as e}from"./p-75169739.js";const r=class{constructor(s){t(this,s),this.identityReady=i(this,"identityReady",7),this.credentialCreate=i(this,"credentialCreate",7),this.dialogCreate=i(this,"dialogCreate",7),this.identity=void 0,this.appId=void 0,this.credential=void 0,this.expiration=void 0,this.locale=void 0,this.usePopup=!1,this.popupCallbackUrl=void 0,this.portalUrl=void 0,this.preserveUrlHash=!1}appIdWatcher(t,i){i!==t&&this._registerOAuth()}async signIn(){if(!this.credential)try{this.credential=await this._checkCurrentStatus()}catch(t){this.credential=await this._fetchCredential()}return this.credential}async signOut(){if(!this.credential)try{this.identity.destroyCredentials()}catch(t){this.credential=void 0}this.credential=void 0}async connectedCallback(){this.appId&&await this._registerOAuth(),this._proxyEvents(),await this._addWatchers(),this.identityReady.emit({identity:this.identity,ready:!0})}async _addWatchers(){const{watch:t}=await h();t((()=>this._info.expiration),(t=>this.expiration=t),{initial:!0})}_checkCurrentStatus(){return this.identity.checkSignInStatus(`${this._info.portalUrl}/sharing`)}async _createOAuthInfo(){const t={};void 0!==this.appId&&(t.appId=this.appId),void 0!==this.locale&&(t.locale=this.locale),void 0!==this.popupCallbackUrl&&(t.popupCallbackUrl=this.popupCallbackUrl),void 0!==this.preserveUrlHash&&(t.preserveUrlHash=this.preserveUrlHash),void 0!==this.usePopup&&(t.popup=this.usePopup),void 0!==this.portalUrl&&(t.portalUrl=this.portalUrl);const i=await a(t);return this._info=i,i}async _fetchCredential(){return await this.identity.getCredential(`${this._info?.portalUrl}/sharing`,{error:null,oAuthPopupConfirmation:!1,token:null})}async _registerOAuth(){this.identity=await e();const t=await this._createOAuthInfo();this.identity.registerOAuthInfos([t])}_proxyEvents(){this.identity.on("credential-create",(t=>this.credentialCreate.emit(t))),this.identity.on("dialog-create",(t=>this.dialogCreate.emit(t)))}get el(){return s(this)}static get watchers(){return{appId:["appIdWatcher"]}}};r.style=":host{display:none}arcgis-identity{display:none}";export{r as arcgis_identity}
1
+ import{r as t,c as i,g as s}from"./p-b0c98bba.js";import{a as h,n as a,b as e}from"./p-0a0582a4.js";const r=class{constructor(s){t(this,s),this.identityReady=i(this,"identityReady",7),this.credentialCreate=i(this,"credentialCreate",7),this.dialogCreate=i(this,"dialogCreate",7),this.identity=void 0,this.appId=void 0,this.credential=void 0,this.expiration=void 0,this.locale=void 0,this.usePopup=!1,this.popupCallbackUrl=void 0,this.portalUrl=void 0,this.preserveUrlHash=!1}appIdWatcher(t,i){i!==t&&this._registerOAuth()}async signIn(){if(!this.credential)try{this.credential=await this._checkCurrentStatus()}catch(t){this.credential=await this._fetchCredential()}return this.credential}async signOut(){if(!this.credential)try{this.identity.destroyCredentials()}catch(t){this.credential=void 0}this.credential=void 0}async connectedCallback(){this.appId&&await this._registerOAuth(),this._proxyEvents(),await this._addWatchers(),this.identityReady.emit({identity:this.identity,ready:!0})}async _addWatchers(){const{watch:t}=await h();t((()=>this._info.expiration),(t=>this.expiration=t),{initial:!0})}_checkCurrentStatus(){return this.identity.checkSignInStatus(`${this._info.portalUrl}/sharing`)}async _createOAuthInfo(){const t={};void 0!==this.appId&&(t.appId=this.appId),void 0!==this.locale&&(t.locale=this.locale),void 0!==this.popupCallbackUrl&&(t.popupCallbackUrl=this.popupCallbackUrl),void 0!==this.preserveUrlHash&&(t.preserveUrlHash=this.preserveUrlHash),void 0!==this.usePopup&&(t.popup=this.usePopup),void 0!==this.portalUrl&&(t.portalUrl=this.portalUrl);const i=await a(t);return this._info=i,i}async _fetchCredential(){return await this.identity.getCredential(`${this._info?.portalUrl}/sharing`,{error:null,oAuthPopupConfirmation:!1,token:null})}async _registerOAuth(){this.identity=await e();const t=await this._createOAuthInfo();this.identity.registerOAuthInfos([t])}_proxyEvents(){this.identity.on("credential-create",(t=>this.credentialCreate.emit(t))),this.identity.on("dialog-create",(t=>this.dialogCreate.emit(t)))}get el(){return s(this)}static get watchers(){return{appId:["appIdWatcher"]}}};r.style=":host{display:none}arcgis-identity{display:none}";export{r as arcgis_identity}
@@ -0,0 +1 @@
1
+ import{r as a,c as s,g as t}from"./p-b0c98bba.js";import{i}from"./p-0a0582a4.js";const e=class{constructor(t){a(this,t),this.apiKeyReady=s(this,"apiKeyReady",7),this.apiKey=void 0}apiKeyWatcher(a){this._setApiKey(a)}async connectedCallback(){this.apiKey&&await this._setApiKey(this.apiKey)}async _setApiKey(a){(await i()).apiKey=a,this.apiKeyReady.emit(!0)}get el(){return t(this)}static get watchers(){return{apiKey:["apiKeyWatcher"]}}};e.style=":host{display:none}arcgis-api-key{display:none}";export{e as arcgis_api_key}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-e8c59179.js');
6
- const index$1 = require('./index-f5e2ae1b.js');
6
+ const index$1 = require('./index-e075843e.js');
7
7
 
8
8
  const arcgisApiKeyCss = ":host{display:none}arcgis-api-key{display:none}";
9
9
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-e8c59179.js');
6
- const index$1 = require('./index-f5e2ae1b.js');
6
+ const index$1 = require('./index-e075843e.js');
7
7
 
8
8
  const arcgisIdentityCss = ":host{display:none}arcgis-identity{display:none}";
9
9
 
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, g as getElement } from './index-1f7e8e45.js';
2
- import { i as importConfig } from './index-966ae15b.js';
2
+ import { i as importConfig } from './index-2916e036.js';
3
3
 
4
4
  const arcgisApiKeyCss = ":host{display:none}arcgis-api-key{display:none}";
5
5
 
@@ -1,5 +1,5 @@
1
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-966ae15b.js';
2
+ import { a as importCoreReactiveUtils, n as newIdentityOAuthInfo, b as importIdentityIdentityManager } from './index-2916e036.js';
3
3
 
4
4
  const arcgisIdentityCss = ":host{display:none}arcgis-identity{display:none}";
5
5
 
@@ -1,11 +1,10 @@
1
1
  import { EventEmitter } from "../../stencil-public-runtime";
2
- import type OAuthInfo from "@arcgis/core/identity/OAuthInfo";
3
- export type Info = InstanceType<typeof OAuthInfo>;
2
+ import { ArcGISCredential } from "../types";
4
3
  export declare class ArcgisIdentity {
5
4
  el: HTMLDivElement;
6
5
  identity: __esri.IdentityManager;
7
6
  appId: string;
8
- credential?: __esri.Credential;
7
+ credential?: ArcGISCredential;
9
8
  expiration: number;
10
9
  locale: string;
11
10
  usePopup: boolean;
@@ -20,7 +19,7 @@ export declare class ArcgisIdentity {
20
19
  credentialCreate: EventEmitter<__esri.IdentityManagerCredentialCreateEvent>;
21
20
  dialogCreate: EventEmitter<__esri.IdentityManagerDialogCreateEvent>;
22
21
  appIdWatcher(value: string, oldValue: string): void;
23
- signIn(): Promise<__esri.Credential>;
22
+ signIn(): Promise<ArcGISCredential>;
24
23
  signOut(): Promise<void>;
25
24
  connectedCallback(): Promise<void>;
26
25
  private _addWatchers;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Exported @arcgis/core types for Stencil.
3
+ * This is to avoid the __esri namespace types
4
+ * and satisfy the Stencil typing requirements
5
+ * for builds.
6
+ */
7
+ import type OAuthInfo from "@arcgis/core/identity/OAuthInfo";
8
+ import type Credential from "@arcgis/core/identity/Credential";
9
+ export type ArcGISOAuthInfo = InstanceType<typeof OAuthInfo>;
10
+ export type ArcGISCredential = InstanceType<typeof Credential>;
@@ -5,20 +5,21 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { ArcGISCredential } from "./components/types";
8
9
  export namespace Components {
9
10
  interface ArcgisApiKey {
10
11
  "apiKey": string;
11
12
  }
12
13
  interface ArcgisIdentity {
13
14
  "appId": string;
14
- "credential"?: __esri.Credential;
15
+ "credential"?: ArcGISCredential;
15
16
  "expiration": number;
16
17
  "identity": __esri.IdentityManager;
17
18
  "locale": string;
18
19
  "popupCallbackUrl": string;
19
20
  "portalUrl": string;
20
21
  "preserveUrlHash": boolean;
21
- "signIn": () => Promise<__esri.Credential>;
22
+ "signIn": () => Promise<ArcGISCredential>;
22
23
  "signOut": () => Promise<void>;
23
24
  "usePopup": boolean;
24
25
  }
@@ -56,7 +57,7 @@ declare namespace LocalJSX {
56
57
  }
57
58
  interface ArcgisIdentity {
58
59
  "appId"?: string;
59
- "credential"?: __esri.Credential;
60
+ "credential"?: ArcGISCredential;
60
61
  "expiration"?: number;
61
62
  "identity"?: __esri.IdentityManager;
62
63
  "locale"?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arcgis/common-components",
3
3
  "description": "ArcGIS Common Components",
4
- "version": "4.28.0-beta.6",
4
+ "version": "4.28.0-beta.7",
5
5
  "module": "dist/components/index.js",
6
6
  "main": "dist/index.cjs.js",
7
7
  "types": "dist/types/index.d.ts",
@@ -55,8 +55,8 @@
55
55
  "@stencil/core": "2.22.3"
56
56
  },
57
57
  "devDependencies": {
58
- "@arcgis/components-plugins": "4.28.0-beta.6",
59
- "@arcgis/core-adapter": "4.28.0-beta.6",
58
+ "@arcgis/components-plugins": "4.28.0-beta.7",
59
+ "@arcgis/core-adapter": "4.28.0-beta.7",
60
60
  "@arcgis/eslint-config": "1.0.0",
61
61
  "@arcgis/typescript-config": "1.0.0",
62
62
  "@stencil/react-output-target": "0.5.3",
@@ -83,5 +83,5 @@
83
83
  "typescript": "4.9.5",
84
84
  "vite": "^4.4.9"
85
85
  },
86
- "gitHead": "5d458acf1958bd1a7ab664804153cd4c64a6af36"
86
+ "gitHead": "f1335d4cbe902c8785b3c277427ebaaebeac38da"
87
87
  }
@@ -1 +0,0 @@
1
- import{r as s,c as a,g as t}from"./p-b0c98bba.js";import{i}from"./p-75169739.js";const e=class{constructor(t){s(this,t),this.apiKeyReady=a(this,"apiKeyReady",7),this.apiKey=void 0}apiKeyWatcher(s){this._setApiKey(s)}async connectedCallback(){this.apiKey&&await this._setApiKey(this.apiKey)}async _setApiKey(s){(await i()).apiKey=s,this.apiKeyReady.emit(!0)}get el(){return t(this)}static get watchers(){return{apiKey:["apiKeyWatcher"]}}};e.style=":host{display:none}arcgis-api-key{display:none}";export{e as arcgis_api_key}