@arcgis/portal-components 5.2.0-next.129 → 5.2.0-next.130
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/cdn/GDKX2CGS.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-portal-account-switcher/customElement.js +100 -96
- package/dist/components/arcgis-portal-navigation/index.js +4 -4
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/package.json +7 -7
- package/dist/cdn/BYEIB47T.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/portal-components",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.130",
|
|
4
4
|
"description": "ArcGIS Portal Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
],
|
|
39
39
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@arcgis/ai-components": "5.2.0-next.
|
|
42
|
-
"@arcgis/lumina": "5.2.0-next.
|
|
43
|
-
"@arcgis/lumina-toolkit": "5.2.0-next.
|
|
44
|
-
"@arcgis/map-components": "5.2.0-next.
|
|
45
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
41
|
+
"@arcgis/ai-components": "5.2.0-next.130",
|
|
42
|
+
"@arcgis/lumina": "5.2.0-next.130",
|
|
43
|
+
"@arcgis/lumina-toolkit": "5.2.0-next.130",
|
|
44
|
+
"@arcgis/map-components": "5.2.0-next.130",
|
|
45
|
+
"@arcgis/toolkit": "5.2.0-next.130",
|
|
46
46
|
"@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
|
|
47
47
|
"@langchain/core": "^1.2.9",
|
|
48
48
|
"@langchain/langgraph": "^1.4.14",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"zod": "^4.4.3"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@arcgis/core": "5.2.0-next.
|
|
56
|
+
"@arcgis/core": "5.2.0-next.130",
|
|
57
57
|
"@esri/calcite-components": "^5.2.0-next.80"
|
|
58
58
|
},
|
|
59
59
|
"css.customData": [
|
package/dist/cdn/BYEIB47T.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as P}from"./YVKSTDL6.js";import c from"./RBGARTND.js";import b from"./F3ODJVJC.js";import{a as T}from"./MFT5NBI5.js";import{a as B}from"./KYNL256E.js";import{a as K}from"./NBB7R2RE.js";import a from"./OUFIJDIW.js";import"./VMQIDO4Z.js";import"./QS3GXAIH.js";import{b as M}from"./2GBRZSEC.js";import{a as J}from"./JJUCB3OG.js";import"./QFHL5APV.js";import"./KCYIOVJQ.js";import"./XD3TUJLE.js";import{b as x}from"./WMT55UQD.js";import{L as O,N as _,P as L,j as d,k as I,w as $}from"./EXBWPG5Y.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([m,{substitute:f},,,{f:N,g:E,h:H,i:W}])=>{var b=1260*1e3,j=2500;function R(o,t="_blank",i=582,e=670){let s=window.screenLeft??0,n=window.screenTop??0,a=window.innerWidth||document.documentElement.clientWidth||window.screen.width,r=window.innerHeight||document.documentElement.clientHeight||window.screen.height,c=a/2-i/2+s,l=r/2-e/2+n,u=window.open(o,t,`scrollbars=no, width=${i}, height=${e}, top=${l}, left=${c}`);return u?.focus(),u}function q(o){let t=m.findOAuthInfo(o.url),{locale:i="en",expiration:e=b}=t??{},s=new URLSearchParams({locale:i,client_id:"arcgisonline",response_type:"token",expiration:`${e}`,linkUserRequest:"true",showSocialLogins:"true",hideEnterpriseLogins:"false",force_login:"true",parent:window.location.origin,redirect_uri:`https://${o.portalHostname}/home/link_account_callback.html`,state:JSON.stringify({useMessage:!0})}),n=`https://${o.portalHostname}/sharing/oauth2/authorize?${s.toString()}`;R(n)}function y(o){let{config:t,token:i,clientId:e="arcgisonline",redirectToClientUri:s=!1,displaySignoutComplete:n=!1}=o,a=new URLSearchParams({display:"iframe",client_id:e,...i&&{token:i},parent:window.location.origin,redirect_uri:`${t.baseUrl}/check_sign_in_status.html`,state:JSON.stringify({signout:!0,origin:window.location.origin,redirectToClientUri:s,displaySignoutComplete:n})}),r=`${t.restBaseUrl}oauth2/signout?${a.toString()}`,c=document.createElement("iframe");c.src=r,c.style.display="none",document.body.appendChild(c)}function z(o,t,i){let e=h(o.orgUrlKey,t),s=m.findOAuthInfo(e),{appId:n,locale:a="en",expiration:r=b}=s??{},c=C(o.provider),l=new URLSearchParams({locale:a,client_id:i??n??"arcgisonline",response_type:"token",expiration:`${r}`,parent:window.location.origin,...c==="social"&&{socialLoginProviderName:o.provider},...c==="default"&&{prepopulatedusername:o.username},force_login:"true",redirect_uri:`${e}/home/sign_in_callback.html`,state:JSON.stringify({user:o.username,server:e,portalUrl:e,origin:window.location.origin})}),u=`${v(o,t)}?${l.toString()}`;R(u)}function F({accounts:o,clientId:t="arcgisonline",usersToFilter:i=[],accountsToFilter:e=""}){let s={};return o.reduce((n,a)=>{let r={disabled:a.disabled??!1,allowed:a.clientAppAccessAllowed??!0};return n[a.username]=r,(i.includes(a.username)||i.includes(a.username.toLowerCase())||e==="org"&&a.orgUrlKey||t==="esriapps"&&a.userType!=="both")&&(r.allowed=!1),n},s),s}function G({account:o,credential:t,clientId:i,portal:e,redirectUri:s}){let n=C(o.provider),a=v(o,e),r=s||D(o,e),c=new URLSearchParams({client_id:i,redirect_uri:r,parent:window.location.origin,response_type:"token",force_login:"false",...t.userId&&{prepopulatedusername:t.userId},...n==="social"&&{socialLoginProviderName:o.provider},expiration:`${(t?.expires??Date.now()+b)-Date.now()}`});return`${a}?${c.toString()}`}function C(o){return Q(o)?"social":o==="enterprise"?"enterprise":o.includes("oidc")?"oidc":"default"}function Q(o){return["apple","facebook","github","google"].includes(o)}function v(o,t){let i=h(o.orgUrlKey,t).toLowerCase(),e=C(o.provider),s="";switch(e){case"social":s="social/";break;case"enterprise":s="saml/";break;case"oidc":s=`oidc/${o.provider.split("_")[1]}/`;break}return`${i}/sharing/rest/oauth2/${s}authorize`}function h(o,t){return o?.startsWith("https://")?o:o&&t.customBaseUrl?`https://${o}.${t.customBaseUrl}`:`https://${t.portalHostname}`}function D(o,t){return`${h(o.orgUrlKey,t)}/home/accountswitcher-callback.html`}function V(o,t){return m.findCredential(h(o.orgUrlKey,t),o.username)}function X(o,t){let i=V(o,t);if(i)return i;let e=h(o.orgUrlKey,t),s=`${e}/home/check_sign_in_status.html#state=${JSON.stringify({origin:window.location.origin,server:e,orgKey:e})}`;Y(s,`iframe__for-${e}`)}function Y(o,t){let i=document.createElement("iframe");i.src=o,i.id=t,i.style.display="none",document.body.appendChild(i)}var U=100,S=class extends O{constructor(){super(),this.messages=J({blocking:!0}),this.targetUser="",this.targetToken="",this.accountAccess={},this.remainingSignouts=0,this.signoutHandle=0,this.linkedAccounts=[],this.loading=!1,this.signedInStatus={},this.showAssociatedAccountsWarning=!1,this.signedInAccounts=[],this.clientId="arcgisonline",this.signout=!1,this.signoutOptions={redirectToClientUri:!1,displaySignoutComplete:!1},this.arcgisAccountSwitch=$(),this.arcgisClose=$(),this.arcgisSignoutComplete=$(),this.listenOn(window,"message",this.handleMessageEvent)}static{this.properties={linkedAccounts:16,userAccounts:16,user:16,credential:16,alertOptions:16,loading:16,signedInStatus:16,showAssociatedAccountsWarning:16,signedInAccounts:16,portal:0,clientId:1,redirectUri:1,signout:5,signoutOptions:0}}static{this.styles=K}willUpdate(t){if(t.has("portal")&&(this.user=this.portal?.user),(t.has("portal")||t.has("user"))&&this.portal&&this.user){this.findLinkedUsers();return}if(t.has("linkedAccounts")||t.has("signedInStatus")){if(this.signout){let{signedInStatus:i,linkedAccounts:e,portal:s,signoutOptions:n,clientId:a,user:r}=this,c=Object.keys(i).filter(k=>i[k]!==null).map(k=>e.find(A=>A.username===k));this.remainingSignouts=c.length+1;let l=h(s.urlKey??"",s),u=`${l}/sharing/rest`,{displaySignoutComplete:g=!0,redirectToClientUri:p=!0}=n;c.length>0&&(g=!1,p=!1),this.loading=!0;let w=m.findCredential(l,r?.id||r?.username);y({displaySignoutComplete:g,redirectToClientUri:p,clientId:a,config:{baseUrl:l,restBaseUrl:u},token:w?.token}),this.signoutHandle=window.setTimeout(()=>{this.remainingSignouts-=1,this.finishSignout({accountOrigin:l,redirectToClientUri:p,displaySignoutComplete:g})},j)}return}}handleMessageEvent(t){if(new URL(t.origin).hostname!=="localhost"&&(t.origin.endsWith(".arcgis.com")||t.origin===window.location.origin)){if(typeof t.data=="string"){JSON.parse(t.data).type==="token_exchange"&&this.handleExchangeTokenMessage(t);return}if("type"in t.data)switch(t.data.type){case"signin":this.handleSigninMessage(t);return;case"signout":this.handleSignoutMessage(t);return;case"linkUser":this.handleLinkUserMessage(t);return;case"token_exchange":this.handleExchangeTokenMessage(t);return}if("credential"in t.data){this.handleSigninMessage(t);return}this.handleCheckSignInStatusMessage(t)}}handleSignoutMessage(t){let{error:i,signout:e,accountOrigin:s,redirectToClientUri:n,displaySignoutComplete:a}=t.data;if(this.remainingSignouts-=1,i&&i!=="unknown"){console.error(i),this.showAlert("danger",this.messages.errors.signout);return}e&&(this.user=void 0,this.credential=void 0,this.finishSignout({accountOrigin:s,redirectToClientUri:n,displaySignoutComplete:a}))}handleSigninMessage(t){let{messages:i,clientId:e}=this,{error:s,status:n,state:a,access_token:r,ssl:c}=t.data;if(s){console.error(s),this.showAlert("danger",i.errors.signin);return}if(n==="success"){let{portal:l,user:u,redirectUri:g}=this,p=this.linkedAccounts.find(A=>A.username===a.user);p?.orgUrlKey===this.portal.urlKey&&m.findCredential(`https://${l.portalHostname}`,u?.username)?.destroy();let w={server:a.portalUrl,userId:a.user,token:r,expires:Number(t.data.expires_in)+Date.now(),ssl:c===void 0||c!=="false"};m.registerToken(w);let k=G({account:p,credential:w,clientId:e,portal:l,redirectUri:g});window.self!==window.top?window.top?.postMessage({type:"navigate",url:k}):window.location.href=k}}handleCheckSignInStatusMessage(t){let{success:i,orgKey:e,server:s,userId:n,token:a,expires:r,ssl:c}=t.data;e&&s&&i&&n&&a&&r&&c!==void 0&&(this.signedInStatus[n]={token:a,expires:r,ssl:c})}async handleLinkUserMessage(t){let{error:i,username:e,access_token:s}=t.data,{portal:n,user:a,linkedAccounts:r,messages:c}=this;if(i){if(i.toString().toLowerCase().includes("user denied your request"))return;this.showAlert("danger",c.errors.accessAccount);return}if(e===a?.username){this.showAlert("danger",c.errors.selfLink);return}if(r.find(u=>u.username===e)){this.showAlert("danger",f(c.errors.alreadyLinked,{username:e}));return}let l=await E(n,e,s);if(l?.length){this.userAccounts=l,this.targetUser=e??"",this.targetToken=s??"",this.showAssociatedAccountsWarning=!0;return}this.linkAccount(e,s)}handleExchangeTokenMessage(t){let i=typeof t.data=="string"?JSON.parse(t.data):t.data;if(!(i.type&&i.type!=="token_exchange")){if(i.error)console.error(i);else if(i.status==="success"&&this.targetUser){let{portal:e,linkedAccounts:s,targetUser:n,clientId:a}=this,r=s.find(p=>p.username===n);if(!r)return;let c=D(r,e),l=h(r.orgUrlKey,e),u=new URLSearchParams({response_type:"token",client_id:a,redirect_uri:c,state:JSON.stringify({user:r.username,portalUrl:l})}),g=`${v(r,e)}?${u.toString()}`;window.opener?(window.opener.location.href=g,window.close()):window.location.href=g}}}finishSignout({accountOrigin:t,redirectToClientUri:i,displaySignoutComplete:e}){this.signoutHandle&&window.clearTimeout(this.signoutHandle),t===window.location.origin&&m.destroyCredentials(),console.info("Signout complete",t,i,e),this.remainingSignouts<=0&&this.arcgisSignoutComplete.emit({accountOrigin:t,redirectToClientUri:i,displaySignoutComplete:e})}async findLinkedUsers(){if(this.loading=!0,!this.portal||!this.user){this.linkedAccounts=[],this.loading=!1;return}this.linkedAccounts=await N(this.portal,this.user),this.linkedAccounts.length&&(this.signedInStatus=this.linkedAccounts.filter(t=>t.orgUrlKey!==this.portal.urlKey).reduce((t,i)=>(t[i.username]=X(i,this.portal)??null,t),{}),this.accountAccess=F({accounts:this.linkedAccounts,clientId:this.clientId})),this.loading=!1}async linkAccount(t,i){let{portal:e,user:s}=this;if(!e||!s)return;let n=await H({portal:e,user:s,targetUser:t,targetToken:i}),{messages:a}=this;if(n.error){this.showAlert("danger",f(a.errors.linkAccount,{username:t})),this.targetUser="",this.userAccounts=[];return}let r=this.userAccounts?.length?a.success.linkAccountMultiple:a.success.linkAccount;this.showAlert("success",f(r,{username:t})),this.targetUser="",this.userAccounts=[],await M(350),this.findLinkedUsers()}async unlinkAccount(t){if(!this.portal||!this.user)return;let{messages:i,portal:e,user:s}=this,{success:n}=await W({portal:e,user:s,linkedUsername:t.username});n?this.showAlert("success",f(i.success.unlinkAccount,{username:t.username})):this.showAlert("danger",f(i.errors.unlinkAccount,{username:t.username})),await this.findLinkedUsers()}startAccountLink(){q(this.portal)}switchAccount(t){let{portal:i,user:e,clientId:s}=this;if(!i||!e||!t)return;let n=h(e.sourceJSON.orgUrlKey??"",i),a=m.findCredential(n,e.id||e.username);a&&y({config:{baseUrl:n,restBaseUrl:`${n}/sharing/rest`},token:a?.token,clientId:s}),z(t,i,s)}signoutAll(t){let{portal:i,signedInStatus:e,clientId:s}=this;t.forEach(n=>{let a=h(n.orgUrlKey,i),r=`${a}/sharing/rest`,c=e[n.username];y({config:{baseUrl:a,restBaseUrl:r},token:c?.token,clientId:s})})}showAlert(t,i,e){this.alertOptions={kind:t,title:e,message:i}}showUnlinkConfirmation(t){let{messages:i}=this;this.alertOptions={kind:"danger",icon:"exclamation-mark-triangle-f",title:i.unlinkAccount,message:i.unlinkWarning,actions:[{text:i.unlink,kind:"danger",clickHandler:()=>{this.alertOptions=void 0,this.unlinkAccount(t)}}]}}render(){let{linkedAccounts:t,accountAccess:i,user:e,portal:s,messages:n,signout:a}=this;if(!s||!e)return null;if(a){let{signedInAccounts:r}=this;return r.length===0?d`<calcite-loader .label=${n.signingOut} .text=${n.signingOut}></calcite-loader>`:d`<arcgis-portal-account-switcher-signout .portal=${s} .signedInAccounts=${r} @arcgisSwitchAccount=${c=>{this.switchAccount(c.detail.account)}} @arcgisSignOutAll=${()=>{this.signoutAll(r)}}></arcgis-portal-account-switcher-signout>`}return d`<calcite-dialog .heading=${n.switchAccounts} heading-level=2 scale=m width=s open modal .loading=${this.loading} outside-close-disabled @calciteDialogClose=${()=>{this.arcgisClose.emit()}}><calcite-block .heading=${n.currentAccount} heading-level=3 .description=${n.signedInAs} expanded class="current-account-block" tabindex=-1>${T(e.id??e.username,d`<calcite-block class="current-account" .label=${s.urlKey?`${e.username}, ${s.name}`:e.username} heading-level=4 .heading=${e.username} .description=${s.urlKey?`${e.fullName??e.username}, ${s.name}`:e.fullName??e.username}><calcite-avatar slot=content-start inert .fullName=${e.fullName??void 0} .username=${e.username} .userId=${e.id} .thumbnail=${B(e,s)??void 0}></calcite-avatar></calcite-block>`)}</calcite-block>${t.length>0?d`<calcite-block .heading=${n.linkedAccounts} heading-level=3 .description=${n.linkedAccountActions} expanded class="linked-accounts-block"><calcite-button slot=content-end icon-start=plus class="link-account-button" @click=${()=>this.startAccountLink()} .disabled=${t.length>=U}>${n.addAccount}</calcite-button><arcgis-portal-account-switcher-list .portal=${s} .linkedAccounts=${t} .accountAccess=${i} .signedInUsers=${Object.keys(this.signedInStatus).filter(r=>this.signedInStatus[r]!==null)} interactive @arcgisAccountSwitch=${r=>{this.switchAccount(r.detail.account)}} @arcgisAccountUnlink=${r=>{this.showUnlinkConfirmation(r.detail.account)}}></arcgis-portal-account-switcher-list></calcite-block>`:d`<calcite-block .heading=${n.linkedAccounts} heading-level=3 expanded class="empty-accounts-block"><div class="empty-accounts-info"><svg class="empty-accounts-icon" width=48 height=48 viewBox="0 0 48 48" fill=none xmlns=http://www.w3.org/2000/svg>${I`<path d=${P.couple??L} fill=currentColor />`}</svg><h4>${n.emptyListTitle}</h4><p>${n.emptyList}</p><calcite-button icon-start=plus class="link-account-button" @click=${()=>this.startAccountLink()} .disabled=${t.length>=U}>${n.linkAccount}</calcite-button></div></calcite-block>`}<calcite-notice kind=info .open=${t.length>=U}><div slot=message>${n.maxAccounts}</div></calcite-notice><calcite-alert .label=${n.alertLabel} slot=alerts .autoClose=${this.alertOptions?.kind!=="danger"} auto-close-duration=fast placement=bottom .kind=${this.alertOptions?.kind} .icon=${this.alertOptions?.icon} .open=${!!this.alertOptions} @calciteAlertClose=${()=>{this.alertOptions=void 0}}>${this.alertOptions?.title&&d`<h4 slot=title class="alert-title">${this.alertOptions.title}</h4>`||""}${this.alertOptions?.message&&d`<p slot=message class=${_({"alert-message":!0,"short-message":!!this.alertOptions?.actions?.length})}>${this.alertOptions.message}</p>`||""}${this.alertOptions?.actions?.map(r=>d`<calcite-button slot=actions-end .kind=${r.kind} .appearance=${r.appearance} @click=${r.clickHandler}>${r.text}</calcite-button>`)}</calcite-alert></calcite-dialog>${this.showAssociatedAccountsWarning&&d`<arcgis-portal-account-switcher-accounts .portal=${s} .targetUser=${this.targetUser} .accounts=${this.userAccounts??[]} @arcgisLinkAll=${()=>{this.linkAccount(this.targetUser,this.targetToken)}} @arcgisCloseDialog=${()=>{this.showAssociatedAccountsWarning=!1}}></arcgis-portal-account-switcher-accounts>`||""}`}};x("arcgis-portal-account-switcher",S);return S},"identity/IdentityManager","intl",a,b,c)
|