@arcgis/portal-components 5.1.0-next.85 → 5.1.0-next.86
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/{74TC4CFL.js → MFMTJNSM.js} +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.d.ts +2 -0
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +29 -25
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import a from"./UXUVTFIJ.js";import"./S2PHM4WZ.js";import{a as I}from"./MUGCPKN6.js";import{a as y}from"./UNK7CMDL.js";import"./KKLD7GP6.js";import{I as u,J as h,K as f,N as g,Q as v,R as b,i as m,k as l,v as d}from"./3XZ4NJNW.js";export default $arcgis.t(([k,{i:w}])=>{var S=m`.thumbnail-container{width:100%}.replacement-container{margin:.5rem}.replacement-message{margin-bottom:.5rem}.replacement-card__title{margin-bottom:.25rem}`,C=["3DInsetMap","3DScene","3DViz","AttachmentViewer","CapacityAnalysis","Cascade","Compare","Compare/Configure","Compare/Multiviewer","Compare/Search","Compare/SideBySideViewer_Configure","Compare/storytelling_compare","Compare/storytelling_sidepanel","Compare/storytelling_tabbed","Compare3d","CompareAnalysis","CompareMaps","CrowdsourceManager","CrowdsourcePolling","CrowdsourceReporter","Directions","Edit","Editor","Elevations","ElevationsProfile","Embed","Filter","FilterGallery","GeoForm","GeoList","GeoTour","HeaderFooter","Identify","ImageInterpretation","ImageMask","ImageVisit","ImageryViewer","ImpactSummary","InformationLookup","InteractiveFilter","InteractiveLegend","LayerShowcase","Legend","LiveMaps","LocalPerspective","MapAndAppGallery","MapCarousel","MapJournal","MapSeries","Shortlist","MapTools","MapTour","Media","MinimalGallery","Minimalist","MobileViewer","Nearby","OnePane","Panels","PanelsLegend","Profile","PublicGallery","PublicInformation","ServiceLookup","SimpleMapViewer","SimpleViewer","SocialMedia","Solutions/s2.html?app=apps2/FindEditFilter","Solutions/s2.html?app=apps2/Finder","Solutions/s2.html","StoryMapBasic","StorytellingSwipe","StorytellingTextLegend","Styler","SummaryViewer","Time","TimeAware","TwoPane","View","Viewer","ZoneLookup"],M=i=>{if(!i)return!1;let e=C.some(t=>{let a=t.includes(".html"),r=`/apps/${t}${a?"":"/"}`;return decodeURIComponent(i.url)?.includes(r)});return i.type==="Web Mapping Application"&&!!i.url&&e};function T(i){let e=["Cascade","MapTour","MapJournal","MapSeries","Shortlist","StoryMapCrowdsource","SwipeSpyglass","Story Map"];return i.type==="Web Mapping Application"&&(D(e,i)||A(i))}function A(i){return["Cascade","MapTour","MapJournal","MapSeries","Shortlist","StoryMapCrowdsource","StorytellingSwipe"].some(e=>{let t=`/apps/${e}/index.html`;return decodeURIComponent(i.url)?.includes(t)})}function D(i,e){return i?.some(t=>e?.typeKeywords?.includes(t))}function $(i){let e=P(i);return b(`assets/portal-item-thumbnail/${e}`)}function P(i){let e=i.type?.toLowerCase(),t=i.typeKeywords||[];switch(e){case"web mapping application":return"webapp.avif";case"mobile application":return"mobileapp.avif";case"notebook code snippets":case"notebook code snippet library":return"notebookcodesnippets.avif";case"notebook":return"notebook.avif";case"style":return t.includes("Dictionary")?"dictionarystyle.avif":"style.avif";case"feature service":return t.includes("Location Tracking View")?"locationtrackingservice.avif":t.includes("IndoorPositioningDataService")?"indoor-positioning-data-service.avif":"default.avif";case"pro presentation":return"pro-presentation.avif";case"reality mapping project":return"realitymappingproject.avif";case"raster function template":return"rasterfunctiontemplate.avif";case"workforce project":return"workforceproject.avif";case"hub initiative":return"hubinitiative.avif";case"hub page":return"hubpage.avif";case"hub site application":case"site application":return"hubsite.avif";case"hub event":return"hubevent.avif";case"hub project":return"hubproject.avif";case"dashboard":return t.includes("ArcGIS Dashboards")?"dashboards.avif":"opsdashboard.avif";case"geoprocessing service":return t.includes("Notebook Web Tool")?"notebookwebtool.avif":"webtool.avif";case"web scene":case"scene service":return"scene.avif";case"ortho mapping project":return"orthomappingproject.avif";case"ortho mapping template":return"orthomappingtemplate.avif";case"insights theme":return"insightstheme.avif";case"insights workbook package":return"insightsworkbookpackage.avif";case"solution":return"solution.avif";case"mobile scene package":return"mobilescenepackage.avif";case"deep learning package":return"deeplearningpackage.avif";case"big data analytic":return"bigdataanalytic.avif";case"real time analytic":return"realtimeanalytic.avif";case"feed":return"feed.avif";case"excalibur imagery project":return"excaliburimageryproject.avif";case"storymap":return t?.includes("storymapcollection")?"storymapcollection.avif":"storymap.avif";case"survey123 add in":return"survey123addin.avif";case"mission":return"mission.avif";case"mission template":return"missiontemplate.avif";case"quickcapture project":return"quickcaptureproject.avif";case"pro report":return"proreport.avif";case"pro package":return"propackage.avif";case"pro report template":return"proreporttemplate.avif";case"urban model":return"urbanmodel.avif";case"urban project":return"urbanproject.avif";case"web experience":return"webexperience.avif";case"web experience template":return"webexperiencetemplate.avif";case"experience builder widget":return"experiencebuilderwidget.avif";case"experience builder widget package":return"experiencebuilderwidgetpackage.avif";case"workflow":return"workflow.avif";case"insights script":return"insightsscript.avif";case"kernel gateway connection":return"kernelgatewayconnection.avif";case"hub initiative template":return"hubinitiativetemplate.avif";case"image service":return t?.includes("Tile Imagery")?"tiledimagerylayer.avif":"imagerylayer.avif";case"mission report":return"missionreport.avif";case"administrative report":return"administrativereport.avif";case"storymap theme":return"storymaptheme.avif";case"knowledge graph":return"knowledgegraph.avif";case"knowledge graph layer":return"knowledgegraphlayer.avif";case"knowledge studio project":return"knowledgestudio.avif";case"earth configuration":return"earthconfiguration.avif";case"link chart":return"linkchart.avif";case"investigation":return"investigation.avif";case"apache parquet":return"apacheparquet.avif";case"curated collection":return"curatedcollection.avif";case"video service":return"mediaservice.avif";case"geodata service":return"geodataservice.avif";case"suitability model":return"suitabilitymodel.avif";case"esri classifier definition":return"classifierdefinition.avif";case"esri spectral library":return"spectrallibrary.avif";case"deep learning studio project":return"deeplearningstudioproject.avif";case"esri classification schema":return"classificationschema.avif";case"insights data engineering workbook":return"dataengineeringworkbook.avif";case"insights data engineering model":return"dataengineeringmodel.avif";case"discussion":return"discussion.avif";case"api key":return"apikey.avif";case"data pipeline":return"datapipeline.avif";case"analysis model":return"analysismodel.avif";case"service connection":return"serviceconnection.avif";case"xr experience":return"xrexperience.avif";case"3dtiles service":return t?.includes("GaussianSplat")?"gaussiansplatlayer.avif":"default.avif";default:return"default.avif"}}function U(i,e,t){let{restUrl:a}=i,r=j(i),n=r?`token=${r}`:"",c=`${a}/content/items/${e.id}`;if(e.thumbnail){let o=e.thumbnailUrl;if(o){let s=new URL(o);return s.searchParams.append("w","400"),s.href}return`${c}/info/${e.thumbnail}?w=400${r?"&":""}${n}`}else if(e.type==="Image")return`${c}/data?${n}`;return $(e)}function j(i){return i?.credential?.token||i?.token||i?.user?.credential?.token||i?.portalUser?.token||""}function x({portal:i,usePortalHostname:e}){let{customBaseUrl:t,portalHostname:a,urlKey:r}=i,{protocol:n}=window.location,c=!e&&r?`${r}.${t}`:a;return`${n}//${c}`}var R=5e3,p=class extends f{constructor(){super(...arguments),this.replacementId=null,this.replacementItemInRecycleBin=!1,this.hasInaccessibleReplacementItem=!1,this.thumbnailUrl=null,this.timer=void 0,this.t9n=y({blocking:!0}),this.primaryActionRef=u(),this.getItemDetailsUrl=({portal:e,itemId:t,redirect:a})=>{let r=x({portal:e,usePortalHostname:!this.user});return r?`${`${r}/home`}/item.html?id=${t}${a?"&performRedirectAction=true":""}`:""},this.performRedirectAction=()=>{window.open(this.getItemDetailsUrl({portal:this.portal,itemId:this.replacementId,redirect:!0}),"_self")},this.viewItemDetailsPage=()=>{window.open(this.getItemDetailsUrl({portal:this.portal,itemId:this.replacementId??this.itemId}),this.canRedirect?"_self":"_blank")},this.item=null,this.replacementItem=null,this.redirectAction=null,this.canRedirect=!1,this.redirectDisabled=!1,this.open=!1,this.redirectTimeRemaining=R/1e3,this.arcgisPortalReplacementItemFetch=d()}static{this.properties={item:16,replacementItem:16,redirectAction:16,canRedirect:16,redirectDisabled:16,open:16,redirectTimeRemaining:16,itemId:1,portal:0,user:0}}static{this.styles=S}async setFocus(){this.primaryActionRef.value?.setFocus()}willUpdate(e){(e.has("itemId")||e.has("portal")||e.has("user"))&&(this.user??=this.portal?.user??null,this.initItem())}setupTimer({onComplete:e}){typeof this.timer=="number"&&clearInterval(this.timer),this.redirectTimeRemaining=R/1e3,this.timer=setInterval(()=>{if(this.redirectTimeRemaining<=0){clearInterval(this.timer),this.timer=void 0,e();return}this.redirectTimeRemaining-=1},1e3)}cancelTimer({onCancel:e}={}){e?.(),clearInterval(this.timer)}handleClose(){this.cancelTimer(),this.itemId="",this.item=null,this.open=!1}disableRedirect(){this.cancelTimer(),this.redirectDisabled=this.canRedirect}isItemRetired(e){return M(e)||T(e)}async initItem(){if(!this.itemId)return;let{itemId:e,portal:t,performRedirectAction:a}=this,r=new k({id:e,portal:t});this.item=await r?.load();let n=await w(e,t,{relationshipType:"ReplacementItem2Item",direction:"reverse"},!0),c=n.data?.relatedItems?.[0];this.replacementItemInRecycleBin=c?.inRecycleBin;let o=c?.id,s=!this.replacementItemInRecycleBin&&o?new k({id:o,portal:t}):null;await s?.load(),this.replacementItem=s,this.hasInaccessibleReplacementItem=this.replacementItemInRecycleBin||!s&&n.data?.aggregations?.total?.count>0&&n.data?.relatedItems?.length===0,this.arcgisPortalReplacementItemFetch.emit({replacementItem:this.hasInaccessibleReplacementItem?{}:s||null}),this.replacementItem=s,this.thumbnailUrl=U(t,s??this.item),this.canRedirect=!!s&&this.isItemRetired(r),this.replacementId=s?.id||null,this.canRedirect&&this.setupTimer({onComplete:()=>a()}),this.open=!0}getReplacementHeading(){let{t9n:e,hasInaccessibleReplacementItem:t,canRedirect:a}=this;return t?e.replacementUnavailable:a?e.redirectToReplacement:this.isItemRetired(this.item)&&!this.replacementItem?e.retiredTitle:e.replacementAvailable}getReplacementMessage(){let{t9n:e,hasInaccessibleReplacementItem:t,canRedirect:a}=this;return t?e.retiredReplacementUnavailable:a?e.deprecatedHasReplacement:this.isItemRetired(this.item)&&!this.replacementItem?e.retired:e.deprecatedHasReplacement}renderCard(e){let{canRedirect:t,t9n:a}=this;return l`<calcite-card thumbnail-position=inline-start><img slot=thumbnail class="thumbnail" src=${(this.thumbnailUrl||void 0)??g} @error=${async()=>this.thumbnailUrl=$(e)}><span slot=heading class="replacement-card__title">${e.title}</span><span slot=description>${a.ownedBy?.replace("${owner}",e.owner||"")||""}</span>${t&&l`<calcite-link slot=footer-start icon-end=launch icon-flip-rtl=end .href=${this.getItemDetailsUrl({portal:this.portal,itemId:this.replacementId})} target=_blank>${a.moreDetails}</calcite-link>`||""}</calcite-card>`}render(){let{open:e,t9n:t,item:a,replacementItem:r,canRedirect:n,redirectDisabled:c,redirectTimeRemaining:o}=this;if(!(!a||!this.isItemRetired(a)))return l`<calcite-dialog modal .open=${e} width=s kind=info outside-close-disabled escape-disabled close-disabled .heading=${this.getReplacementHeading()} @calciteDialogClose=${()=>this.handleClose()}><div class="replacement-container"><div class="replacement-message">${I(this.getReplacementMessage()?.replace("${itemTitle}",this.item?.title||""))}</div>${this.renderCard(n?r:a)}</div>${n&&!c&&l`<calcite-button slot=footer-end appearance=outline-fill kind=neutral @click=${()=>{this.disableRedirect()}}>${t.cancel}</calcite-button>`||""}<calcite-button .disabled=${c} slot=footer-end @click=${()=>{this.cancelTimer(),n?this.performRedirectAction():this.viewItemDetailsPage()}} .iconEnd=${n?void 0:"launch"} icon-flip-rtl=end ${h(this.primaryActionRef)}>${n?t.redirect.replace("${seconds}",`${o}`):t.moreDetails}</calcite-button></calcite-dialog>`}};v("arcgis-portal-replacement-item-redirect",p);return p},"portal/PortalItem",a)
|
|
2
|
+
import a from"./UXUVTFIJ.js";import"./S2PHM4WZ.js";import{a as I}from"./MUGCPKN6.js";import{a as y}from"./UNK7CMDL.js";import"./KKLD7GP6.js";import{I as u,J as h,K as f,N as g,Q as v,R as b,i as m,k as l,v as d}from"./3XZ4NJNW.js";export default $arcgis.t(([k,{i:w}])=>{var C=m`.thumbnail-container{width:100%}.replacement-container{margin:.5rem}.replacement-message{margin-bottom:.5rem}.replacement-card__title{margin-bottom:.25rem}`,M=["3DInsetMap","3DScene","3DViz","AttachmentViewer","CapacityAnalysis","Cascade","Compare","Compare/Configure","Compare/Multiviewer","Compare/Search","Compare/SideBySideViewer_Configure","Compare/storytelling_compare","Compare/storytelling_sidepanel","Compare/storytelling_tabbed","Compare3d","CompareAnalysis","CompareMaps","CrowdsourceManager","CrowdsourcePolling","CrowdsourceReporter","Directions","Edit","Editor","Elevations","ElevationsProfile","Embed","Filter","FilterGallery","GeoForm","GeoList","GeoTour","HeaderFooter","Identify","ImageInterpretation","ImageMask","ImageVisit","ImageryViewer","ImpactSummary","InformationLookup","InteractiveFilter","InteractiveLegend","LayerShowcase","Legend","LiveMaps","LocalPerspective","MapAndAppGallery","MapCarousel","MapJournal","MapSeries","Shortlist","MapTools","MapTour","Media","MinimalGallery","Minimalist","MobileViewer","Nearby","OnePane","Panels","PanelsLegend","Profile","PublicGallery","PublicInformation","ServiceLookup","SimpleMapViewer","SimpleViewer","SocialMedia","Solutions/s2.html?app=apps2/FindEditFilter","Solutions/s2.html?app=apps2/Finder","Solutions/s2.html","StoryMapBasic","StorytellingSwipe","StorytellingTextLegend","Styler","SummaryViewer","Time","TimeAware","TwoPane","View","Viewer","ZoneLookup"],S=i=>{if(!i)return!1;let e=M.some(t=>{let a=t.includes(".html"),r=`/apps/${t}${a?"":"/"}`;return decodeURIComponent(i.url)?.includes(r)});return i.type==="Web Mapping Application"&&!!i.url&&e};function T(i){let e=["Cascade","MapTour","MapJournal","MapSeries","Shortlist","StoryMapCrowdsource","SwipeSpyglass","Story Map"];return i.type==="Web Mapping Application"&&(P(e,i)||A(i))}function A(i){return["Cascade","MapTour","MapJournal","MapSeries","Shortlist","StoryMapCrowdsource","StorytellingSwipe"].some(e=>{let t=`/apps/${e}/index.html`;return decodeURIComponent(i.url)?.includes(t)})}function P(i,e){return i?.some(t=>e?.typeKeywords?.includes(t))}function $(i){let e=x(i);return b(`assets/portal-item-thumbnail/${e}`)}function x(i){let e=i.type?.toLowerCase(),t=i.typeKeywords||[];switch(e){case"web mapping application":return"webapp.avif";case"mobile application":return"mobileapp.avif";case"notebook code snippets":case"notebook code snippet library":return"notebookcodesnippets.avif";case"notebook":return"notebook.avif";case"style":return t.includes("Dictionary")?"dictionarystyle.avif":"style.avif";case"feature service":return t.includes("Location Tracking View")?"locationtrackingservice.avif":t.includes("IndoorPositioningDataService")?"indoor-positioning-data-service.avif":"default.avif";case"pro presentation":return"pro-presentation.avif";case"reality mapping project":return"realitymappingproject.avif";case"raster function template":return"rasterfunctiontemplate.avif";case"workforce project":return"workforceproject.avif";case"hub initiative":return"hubinitiative.avif";case"hub page":return"hubpage.avif";case"hub site application":case"site application":return"hubsite.avif";case"hub event":return"hubevent.avif";case"hub project":return"hubproject.avif";case"dashboard":return t.includes("ArcGIS Dashboards")?"dashboards.avif":"opsdashboard.avif";case"geoprocessing service":return t.includes("Notebook Web Tool")?"notebookwebtool.avif":"webtool.avif";case"web scene":case"scene service":return"scene.avif";case"ortho mapping project":return"orthomappingproject.avif";case"ortho mapping template":return"orthomappingtemplate.avif";case"insights theme":return"insightstheme.avif";case"insights workbook package":return"insightsworkbookpackage.avif";case"solution":return"solution.avif";case"mobile scene package":return"mobilescenepackage.avif";case"deep learning package":return"deeplearningpackage.avif";case"big data analytic":return"bigdataanalytic.avif";case"real time analytic":return"realtimeanalytic.avif";case"feed":return"feed.avif";case"excalibur imagery project":return"excaliburimageryproject.avif";case"storymap":return t?.includes("storymapcollection")?"storymapcollection.avif":"storymap.avif";case"survey123 add in":return"survey123addin.avif";case"mission":return"mission.avif";case"mission template":return"missiontemplate.avif";case"quickcapture project":return"quickcaptureproject.avif";case"pro report":return"proreport.avif";case"pro package":return"propackage.avif";case"pro report template":return"proreporttemplate.avif";case"urban model":return"urbanmodel.avif";case"urban project":return"urbanproject.avif";case"web experience":return"webexperience.avif";case"web experience template":return"webexperiencetemplate.avif";case"experience builder widget":return"experiencebuilderwidget.avif";case"experience builder widget package":return"experiencebuilderwidgetpackage.avif";case"workflow":return"workflow.avif";case"insights script":return"insightsscript.avif";case"kernel gateway connection":return"kernelgatewayconnection.avif";case"hub initiative template":return"hubinitiativetemplate.avif";case"image service":return t?.includes("Tile Imagery")?"tiledimagerylayer.avif":"imagerylayer.avif";case"mission report":return"missionreport.avif";case"administrative report":return"administrativereport.avif";case"storymap theme":return"storymaptheme.avif";case"knowledge graph":return"knowledgegraph.avif";case"knowledge graph layer":return"knowledgegraphlayer.avif";case"knowledge studio project":return"knowledgestudio.avif";case"earth configuration":return"earthconfiguration.avif";case"link chart":return"linkchart.avif";case"investigation":return"investigation.avif";case"apache parquet":return"apacheparquet.avif";case"curated collection":return"curatedcollection.avif";case"video service":return"mediaservice.avif";case"geodata service":return"geodataservice.avif";case"suitability model":return"suitabilitymodel.avif";case"esri classifier definition":return"classifierdefinition.avif";case"esri spectral library":return"spectrallibrary.avif";case"deep learning studio project":return"deeplearningstudioproject.avif";case"esri classification schema":return"classificationschema.avif";case"insights data engineering workbook":return"dataengineeringworkbook.avif";case"insights data engineering model":return"dataengineeringmodel.avif";case"discussion":return"discussion.avif";case"api key":return"apikey.avif";case"data pipeline":return"datapipeline.avif";case"analysis model":return"analysismodel.avif";case"service connection":return"serviceconnection.avif";case"xr experience":return"xrexperience.avif";case"3dtiles service":return t?.includes("GaussianSplat")?"gaussiansplatlayer.avif":"default.avif";default:return"default.avif"}}function U(i,e,t){let{restUrl:a}=i,r=j(i),n=r?`token=${r}`:"",c=`${a}/content/items/${e.id}`;if(e.thumbnail){let o=e.thumbnailUrl;if(o){let s=new URL(o);return s.searchParams.append("w","400"),s.href}return`${c}/info/${e.thumbnail}?w=400${r?"&":""}${n}`}else if(e.type==="Image")return`${c}/data?${n}`;return $(e)}function j(i){return i?.credential?.token||i?.token||i?.user?.credential?.token||i?.portalUser?.token||""}function L({portal:i,usePortalHostname:e}){let{customBaseUrl:t,portalHostname:a,urlKey:r}=i,{protocol:n}=window.location,c=!e&&r?`${r}.${t}`:a;return`${n}//${c}`}var R=5e3,p=class extends f{constructor(){super(...arguments),this.replacementId=null,this.replacementItemInRecycleBin=!1,this.hasInaccessibleReplacementItem=!1,this.thumbnailUrl=null,this.timer=void 0,this.t9n=y({blocking:!0}),this.primaryActionRef=u(),this.getItemDetailsUrl=({portal:e,itemId:t,redirect:a})=>{let r=L({portal:e,usePortalHostname:!this.user});return r?`${`${r}/home`}/item.html?id=${t}${a?"&performRedirectAction=true":""}`:""},this.performRedirectAction=()=>{window.open(this.getItemDetailsUrl({portal:this.portal,itemId:this.replacementId,redirect:!0}),"_self")},this.viewItemDetailsPage=()=>{window.open(this.getItemDetailsUrl({portal:this.portal,itemId:this.replacementId??this.itemId}),this.canRedirect?"_self":"_blank")},this.item=null,this.replacementItem=null,this.redirectAction=null,this.canRedirect=!1,this.redirectCancelled=!1,this.open=!1,this.redirectTimeRemaining=R/1e3,this.arcgisPortalReplacementItemFetch=d()}static{this.properties={item:16,replacementItem:16,redirectAction:16,canRedirect:16,redirectCancelled:16,open:16,redirectTimeRemaining:16,itemId:1,portal:0,user:0}}static{this.styles=C}async setFocus(){this.primaryActionRef.value?.setFocus()}willUpdate(e){(e.has("itemId")||e.has("portal")||e.has("user"))&&(this.user??=this.portal?.user??null,this.initItem())}setupTimer({onComplete:e}){typeof this.timer=="number"&&clearInterval(this.timer),this.redirectTimeRemaining=R/1e3,this.timer=setInterval(()=>{if(this.redirectTimeRemaining<=0){clearInterval(this.timer),this.timer=void 0,e();return}this.redirectTimeRemaining-=1},1e3)}cancelTimer({onCancel:e}={}){e?.(),clearInterval(this.timer)}handleClose(){this.cancelTimer(),this.itemId="",this.item=null,this.open=!1}cancelRedirect(){this.cancelTimer(),this.redirectCancelled=!0}isItemRetired(e){return S(e)||T(e)}async initItem(){if(!this.itemId)return;let{itemId:e,portal:t,performRedirectAction:a}=this,r=new k({id:e,portal:t});this.item=await r?.load();let n=await w(e,t,{relationshipType:"ReplacementItem2Item",direction:"reverse"},!0),c=n.data?.relatedItems?.[0];this.replacementItemInRecycleBin=c?.inRecycleBin;let o=c?.id,s=!this.replacementItemInRecycleBin&&o?new k({id:o,portal:t}):null;await s?.load(),this.replacementItem=s,this.hasInaccessibleReplacementItem=this.replacementItemInRecycleBin||!s&&n.data?.aggregations?.total?.count>0&&n.data?.relatedItems?.length===0,this.arcgisPortalReplacementItemFetch.emit({replacementItem:this.hasInaccessibleReplacementItem?{}:s||null}),this.replacementItem=s,this.thumbnailUrl=U(t,s??this.item),this.canRedirect=!!s&&this.isItemRetired(r),this.replacementId=s?.id||null,this.canRedirect&&this.setupTimer({onComplete:()=>a()}),this.open=!0}getReplacementHeading(){let{t9n:e,hasInaccessibleReplacementItem:t,canRedirect:a}=this;return t?e.replacementUnavailable:a?e.redirectToReplacement:this.isItemRetired(this.item)&&!this.replacementItem?e.retiredTitle:e.replacementAvailable}getReplacementMessage(){let{t9n:e,hasInaccessibleReplacementItem:t,canRedirect:a}=this;return t?e.retiredReplacementUnavailable:a?e.deprecatedHasReplacement:this.isItemRetired(this.item)&&!this.replacementItem?e.retired:e.deprecatedHasReplacement}getRedirectActionMessage(){let{t9n:e,canRedirect:t,redirectTimeRemaining:a,redirectCancelled:r}=this;return r?e.redirectToReplacement:t?e.redirect.replace("${seconds}",`${a}`):e.moreDetails}renderCard(e){let{canRedirect:t,t9n:a}=this;return l`<calcite-card thumbnail-position=inline-start><img slot=thumbnail class="thumbnail" src=${(this.thumbnailUrl||void 0)??g} @error=${async()=>this.thumbnailUrl=$(e)}><span slot=heading class="replacement-card__title">${e.title}</span><span slot=description>${a.ownedBy?.replace("${owner}",e.owner||"")||""}</span>${t&&l`<calcite-link slot=footer-start icon-end=launch icon-flip-rtl=end .href=${this.getItemDetailsUrl({portal:this.portal,itemId:this.replacementId})} target=_blank>${a.moreDetails}</calcite-link>`||""}</calcite-card>`}render(){let{open:e,t9n:t,item:a,replacementItem:r,canRedirect:n,redirectCancelled:c}=this;if(!(!a||!this.isItemRetired(a)))return l`<calcite-dialog modal .open=${e} width=s kind=info outside-close-disabled escape-disabled close-disabled .heading=${this.getReplacementHeading()} @calciteDialogClose=${()=>this.handleClose()}><div class="replacement-container"><div class="replacement-message">${I(this.getReplacementMessage()?.replace("${itemTitle}",this.item?.title||""))}</div>${this.renderCard(n?r:a)}</div>${n&&!c&&l`<calcite-button slot=footer-end appearance=outline-fill kind=neutral @click=${()=>{this.cancelRedirect()}}>${t.cancelRedirection}</calcite-button>`||""}<calcite-button slot=footer-end @click=${()=>{this.cancelTimer(),n?this.performRedirectAction():this.viewItemDetailsPage()}} .iconEnd=${n?void 0:"launch"} icon-flip-rtl=end ${h(this.primaryActionRef)}>${this.getRedirectActionMessage()}</calcite-button></calcite-dialog>`}};v("arcgis-portal-replacement-item-redirect",p);return p},"portal/PortalItem",a)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"replacementAvailable":"Replacement available","replacementUnavailable":"Replacement unavailable","redirectToReplacement":"Redirect to replacement","retiredTitle":"Retired","cancel":"Cancel","ownedBy":"Owned by: ${owner}","redirect":"Redirecting in ${seconds}s...","deprecatedHasReplacement":"<strong>${itemTitle}</strong> has been replaced by the following:","retired":"<strong>${itemTitle}</strong> has been retired.","retiredReplacementUnavailable":"<strong>${itemTitle}</strong> has been retired. You do not have access to its replacement.","moreDetails":"More details"}
|
|
1
|
+
{"replacementAvailable":"Replacement available","replacementUnavailable":"Replacement unavailable","redirectToReplacement":"Redirect to replacement","retiredTitle":"Retired","cancel":"Cancel","cancelRedirection":"Cancel redirection","ownedBy":"Owned by: ${owner}","redirect":"Redirecting in ${seconds}s...","deprecatedHasReplacement":"<strong>${itemTitle}</strong> has been replaced by the following:","retired":"<strong>${itemTitle}</strong> has been retired.","retiredReplacementUnavailable":"<strong>${itemTitle}</strong> has been retired. You do not have access to its replacement.","moreDetails":"More details"}
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{P as t,z as e}from"./3XZ4NJNW.js";var a=e(t,{"arcgis-portal-ai-assistant":[()=>import("./I4ZGLRAS.js"),"autoDestroyDisabled,config:,defaultClosed,openEntitiesInNewTab,portal:,t9n:,user:"],"arcgis-portal-ai-assistant-composer":[()=>import("./VI6KZSVE.js"),"isLoading,portal:,t9n:,user:;focusTextArea,stopListening"],"arcgis-portal-ai-assistant-side-panel":[()=>import("./KGBCXUHG.js"),"activeThreadId,t9n:,threads:"],"arcgis-portal-classification-banner":[()=>import("./GDNNFUB4.js"),"autoDestroyDisabled,messages:,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],"arcgis-portal-classification-config":[()=>import("./4CENJHJO.js"),"autoDestroyDisabled,messages:,portalItem:,status,valid,values;destroy,resetForm,validateForm"],"arcgis-portal-classification-favorite":[()=>import("./NWUVXMPQ.js"),"attributeExpressionResults:,classificationValue:,favoriteClassifications:,messages:,portalItem:,resetFavoriteClassification:,selectedFavoriteClassificationName,updateClassificationData:"],"arcgis-portal-classification-form-element":[()=>import("./NTDYM2RH.js"),"attribute:,attributeKey,isRequiredErrors:,messages:,renderingInfo:,value:"],"arcgis-portal-extent-picker":[()=>import("./YJB3RZMI.js"),"active,contentOnly,extentService,extentValue:,isArea,itemId,messages:,portal:;;getExtent"],"arcgis-portal-extent-picker-coord-field":[()=>import("./WR6GOULY.js"),"errorMessage,inputId,label,max,min,relatedErrorMessage,validateRelated:,value;;checkRelatedField,isValid,setFocus"],"arcgis-portal-field-delete":[()=>import("./WRH4C2YQ.js"),"config:,fieldNames:,layer:,mapView:,messages:,options:"],"arcgis-portal-mentionable-text-area":[()=>import("./OI4PPW4B.js"),"disabled,maxLength,placeholder,popoverListLabel,popoverPlacement,portal:,readOnly,rows,scale,starters:,user:,value;closePopover,focusTextArea,selectItem"],"arcgis-portal-replacement-item-redirect":[()=>import("./
|
|
2
|
+
import{P as t,z as e}from"./3XZ4NJNW.js";var a=e(t,{"arcgis-portal-ai-assistant":[()=>import("./I4ZGLRAS.js"),"autoDestroyDisabled,config:,defaultClosed,openEntitiesInNewTab,portal:,t9n:,user:"],"arcgis-portal-ai-assistant-composer":[()=>import("./VI6KZSVE.js"),"isLoading,portal:,t9n:,user:;focusTextArea,stopListening"],"arcgis-portal-ai-assistant-side-panel":[()=>import("./KGBCXUHG.js"),"activeThreadId,t9n:,threads:"],"arcgis-portal-classification-banner":[()=>import("./GDNNFUB4.js"),"autoDestroyDisabled,messages:,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],"arcgis-portal-classification-config":[()=>import("./4CENJHJO.js"),"autoDestroyDisabled,messages:,portalItem:,status,valid,values;destroy,resetForm,validateForm"],"arcgis-portal-classification-favorite":[()=>import("./NWUVXMPQ.js"),"attributeExpressionResults:,classificationValue:,favoriteClassifications:,messages:,portalItem:,resetFavoriteClassification:,selectedFavoriteClassificationName,updateClassificationData:"],"arcgis-portal-classification-form-element":[()=>import("./NTDYM2RH.js"),"attribute:,attributeKey,isRequiredErrors:,messages:,renderingInfo:,value:"],"arcgis-portal-extent-picker":[()=>import("./YJB3RZMI.js"),"active,contentOnly,extentService,extentValue:,isArea,itemId,messages:,portal:;;getExtent"],"arcgis-portal-extent-picker-coord-field":[()=>import("./WR6GOULY.js"),"errorMessage,inputId,label,max,min,relatedErrorMessage,validateRelated:,value;;checkRelatedField,isValid,setFocus"],"arcgis-portal-field-delete":[()=>import("./WRH4C2YQ.js"),"config:,fieldNames:,layer:,mapView:,messages:,options:"],"arcgis-portal-mentionable-text-area":[()=>import("./OI4PPW4B.js"),"disabled,maxLength,placeholder,popoverListLabel,popoverPlacement,portal:,readOnly,rows,scale,starters:,user:,value;closePopover,focusTextArea,selectItem"],"arcgis-portal-replacement-item-redirect":[()=>import("./MFMTJNSM.js"),"itemId,portal:,t9n:,user:;setFocus"],"arcgis-portal-user-avatar":[()=>import("./6XC5HMRA.js"),"checkOnline,description,heading,hideAvatar,messages:,portal:,scale,showName,underline,user:,username,wrap"],"arcgis-portal-voice-input":[()=>import("./MCI6R5AJ.js"),"language;clearText,startListening,stopListening"]});a({resourcesUrl:import.meta.url});var i=new CSSStyleSheet;i.replaceSync("@layer{:not([hydrated]):is(arcgis-portal-ai-assistant,arcgis-portal-classification-banner,arcgis-portal-classification-config,arcgis-portal-classification-favorite,arcgis-portal-classification-form-element,arcgis-portal-extent-picker,arcgis-portal-field-delete,arcgis-portal-mentionable-text-area,arcgis-portal-replacement-item-redirect,arcgis-portal-user-avatar,arcgis-portal-voice-input){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,i];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,t)
|
|
@@ -25,6 +25,7 @@ export abstract class ArcgisPortalReplacementItemRedirect extends LitElement {
|
|
|
25
25
|
redirectToReplacement: string;
|
|
26
26
|
retiredTitle: string;
|
|
27
27
|
cancel: string;
|
|
28
|
+
cancelRedirection: string;
|
|
28
29
|
ownedBy: string;
|
|
29
30
|
redirect: string;
|
|
30
31
|
deprecatedHasReplacement: string;
|
|
@@ -37,6 +38,7 @@ export abstract class ArcgisPortalReplacementItemRedirect extends LitElement {
|
|
|
37
38
|
redirectToReplacement: string;
|
|
38
39
|
retiredTitle: string;
|
|
39
40
|
cancel: string;
|
|
41
|
+
cancelRedirection: string;
|
|
40
42
|
ownedBy: string;
|
|
41
43
|
redirect: string;
|
|
42
44
|
deprecatedHasReplacement: string;
|
|
@@ -7,7 +7,7 @@ import { createRef as I, ref as w } from "lit/directives/ref.js";
|
|
|
7
7
|
import { unsafeHTML as R } from "lit/directives/unsafe-html.js";
|
|
8
8
|
import { css as k, html as l } from "lit";
|
|
9
9
|
import p from "@arcgis/core/portal/PortalItem.js";
|
|
10
|
-
const $ = k`.thumbnail-container{width:100%}.replacement-container{margin:.5rem}.replacement-message{margin-bottom:.5rem}.replacement-card__title{margin-bottom:.25rem}`,
|
|
10
|
+
const $ = k`.thumbnail-container{width:100%}.replacement-container{margin:.5rem}.replacement-message{margin-bottom:.5rem}.replacement-card__title{margin-bottom:.25rem}`, C = [
|
|
11
11
|
"3DInsetMap",
|
|
12
12
|
"3DScene",
|
|
13
13
|
"3DViz",
|
|
@@ -92,13 +92,13 @@ const $ = k`.thumbnail-container{width:100%}.replacement-container{margin:.5rem}
|
|
|
92
92
|
], M = (i) => {
|
|
93
93
|
if (!i)
|
|
94
94
|
return !1;
|
|
95
|
-
const e =
|
|
95
|
+
const e = C.some((t) => {
|
|
96
96
|
const r = t.includes(".html"), a = `/apps/${t}${r ? "" : "/"}`;
|
|
97
97
|
return decodeURIComponent(i.url)?.includes(a);
|
|
98
98
|
});
|
|
99
99
|
return i.type === "Web Mapping Application" && !!i.url && e;
|
|
100
100
|
};
|
|
101
|
-
function
|
|
101
|
+
function S(i) {
|
|
102
102
|
const e = [
|
|
103
103
|
"Cascade",
|
|
104
104
|
"MapTour",
|
|
@@ -109,9 +109,9 @@ function T(i) {
|
|
|
109
109
|
"SwipeSpyglass",
|
|
110
110
|
"Story Map"
|
|
111
111
|
];
|
|
112
|
-
return i.type === "Web Mapping Application" && (U(e, i) ||
|
|
112
|
+
return i.type === "Web Mapping Application" && (U(e, i) || T(i));
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function T(i) {
|
|
115
115
|
return [
|
|
116
116
|
"Cascade",
|
|
117
117
|
"MapTour",
|
|
@@ -129,10 +129,10 @@ function U(i, e) {
|
|
|
129
129
|
return i?.some((t) => e?.typeKeywords?.includes(t));
|
|
130
130
|
}
|
|
131
131
|
function u(i) {
|
|
132
|
-
const e =
|
|
132
|
+
const e = A(i);
|
|
133
133
|
return d(`assets/portal-item-thumbnail/${e}`);
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function A(i) {
|
|
136
136
|
const e = i.type?.toLowerCase(), t = i.typeKeywords || [];
|
|
137
137
|
switch (e) {
|
|
138
138
|
case "web mapping application":
|
|
@@ -292,8 +292,8 @@ function P(i) {
|
|
|
292
292
|
return "default.avif";
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
const { restUrl: r } = i, a =
|
|
295
|
+
function P(i, e, t) {
|
|
296
|
+
const { restUrl: r } = i, a = L(i), n = a ? `token=${a}` : "", c = `${r}/content/items/${e.id}`;
|
|
297
297
|
if (e.thumbnail) {
|
|
298
298
|
const o = e.thumbnailUrl;
|
|
299
299
|
if (o) {
|
|
@@ -305,13 +305,13 @@ function A(i, e, t) {
|
|
|
305
305
|
return `${c}/data?${n}`;
|
|
306
306
|
return u(e);
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function L(i) {
|
|
309
309
|
return (
|
|
310
310
|
// @ts-ignore
|
|
311
311
|
i?.credential?.token || i?.token || i?.user?.credential?.token || i?.portalUser?.token || ""
|
|
312
312
|
);
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function x({
|
|
315
315
|
portal: i,
|
|
316
316
|
usePortalHostname: e
|
|
317
317
|
}) {
|
|
@@ -319,19 +319,19 @@ function L({
|
|
|
319
319
|
return `${n}//${c}`;
|
|
320
320
|
}
|
|
321
321
|
const m = 5e3;
|
|
322
|
-
class
|
|
322
|
+
class D extends f {
|
|
323
323
|
constructor() {
|
|
324
324
|
super(...arguments), this.replacementId = null, this.replacementItemInRecycleBin = !1, this.hasInaccessibleReplacementItem = !1, this.thumbnailUrl = null, this.timer = void 0, this.t9n = y({ blocking: !0 }), this.primaryActionRef = I(), this.getItemDetailsUrl = ({ portal: e, itemId: t, redirect: r }) => {
|
|
325
|
-
const a =
|
|
325
|
+
const a = x({ portal: e, usePortalHostname: !this.user });
|
|
326
326
|
return a ? `${`${a}/home`}/item.html?id=${t}${r ? "&performRedirectAction=true" : ""}` : "";
|
|
327
327
|
}, this.performRedirectAction = () => {
|
|
328
328
|
window.open(this.getItemDetailsUrl({ portal: this.portal, itemId: this.replacementId, redirect: !0 }), "_self");
|
|
329
329
|
}, this.viewItemDetailsPage = () => {
|
|
330
330
|
window.open(this.getItemDetailsUrl({ portal: this.portal, itemId: this.replacementId ?? this.itemId }), this.canRedirect ? "_self" : "_blank");
|
|
331
|
-
}, this.item = null, this.replacementItem = null, this.redirectAction = null, this.canRedirect = !1, this.
|
|
331
|
+
}, this.item = null, this.replacementItem = null, this.redirectAction = null, this.canRedirect = !1, this.redirectCancelled = !1, this.open = !1, this.redirectTimeRemaining = m / 1e3, this.arcgisPortalReplacementItemFetch = g();
|
|
332
332
|
}
|
|
333
333
|
static {
|
|
334
|
-
this.properties = { item: 16, replacementItem: 16, redirectAction: 16, canRedirect: 16,
|
|
334
|
+
this.properties = { item: 16, replacementItem: 16, redirectAction: 16, canRedirect: 16, redirectCancelled: 16, open: 16, redirectTimeRemaining: 16, itemId: 1, portal: 0, user: 0 };
|
|
335
335
|
}
|
|
336
336
|
static {
|
|
337
337
|
this.styles = $;
|
|
@@ -357,11 +357,11 @@ class x extends f {
|
|
|
357
357
|
handleClose() {
|
|
358
358
|
this.cancelTimer(), this.itemId = "", this.item = null, this.open = !1;
|
|
359
359
|
}
|
|
360
|
-
|
|
361
|
-
this.cancelTimer(), this.
|
|
360
|
+
cancelRedirect() {
|
|
361
|
+
this.cancelTimer(), this.redirectCancelled = !0;
|
|
362
362
|
}
|
|
363
363
|
isItemRetired(e) {
|
|
364
|
-
return M(e) ||
|
|
364
|
+
return M(e) || S(e);
|
|
365
365
|
}
|
|
366
366
|
async initItem() {
|
|
367
367
|
if (!this.itemId)
|
|
@@ -382,7 +382,7 @@ class x extends f {
|
|
|
382
382
|
}) : null;
|
|
383
383
|
await s?.load(), this.replacementItem = s, this.hasInaccessibleReplacementItem = this.replacementItemInRecycleBin || !s && n.data?.aggregations?.total?.count > 0 && n.data?.relatedItems?.length === 0, this.arcgisPortalReplacementItemFetch.emit({
|
|
384
384
|
replacementItem: this.hasInaccessibleReplacementItem ? {} : s || null
|
|
385
|
-
}), this.replacementItem = s, this.thumbnailUrl =
|
|
385
|
+
}), this.replacementItem = s, this.thumbnailUrl = P(t, s ?? this.item), this.canRedirect = !!s && this.isItemRetired(a), this.replacementId = s?.id || null, this.canRedirect && this.setupTimer({
|
|
386
386
|
onComplete: () => r()
|
|
387
387
|
}), this.open = !0;
|
|
388
388
|
}
|
|
@@ -394,21 +394,25 @@ class x extends f {
|
|
|
394
394
|
const { t9n: e, hasInaccessibleReplacementItem: t, canRedirect: r } = this;
|
|
395
395
|
return t ? e.retiredReplacementUnavailable : r ? e.deprecatedHasReplacement : this.isItemRetired(this.item) && !this.replacementItem ? e.retired : e.deprecatedHasReplacement;
|
|
396
396
|
}
|
|
397
|
+
getRedirectActionMessage() {
|
|
398
|
+
const { t9n: e, canRedirect: t, redirectTimeRemaining: r, redirectCancelled: a } = this;
|
|
399
|
+
return a ? e.redirectToReplacement : t ? e.redirect.replace("${seconds}", `${r}`) : e.moreDetails;
|
|
400
|
+
}
|
|
397
401
|
renderCard(e) {
|
|
398
402
|
const { canRedirect: t, t9n: r } = this;
|
|
399
403
|
return l`<calcite-card thumbnail-position=inline-start><img slot=thumbnail class="thumbnail" src=${(this.thumbnailUrl || void 0) ?? v} @error=${async () => this.thumbnailUrl = u(e)}><span slot=heading class="replacement-card__title">${e.title}</span><span slot=description>${r.ownedBy?.replace("${owner}", e.owner || "") || ""}</span>${t && l`<calcite-link slot=footer-start icon-end=launch icon-flip-rtl=end .href=${this.getItemDetailsUrl({ portal: this.portal, itemId: this.replacementId })} target=_blank>${r.moreDetails}</calcite-link>` || ""}</calcite-card>`;
|
|
400
404
|
}
|
|
401
405
|
render() {
|
|
402
|
-
const { open: e, t9n: t, item: r, replacementItem: a, canRedirect: n,
|
|
406
|
+
const { open: e, t9n: t, item: r, replacementItem: a, canRedirect: n, redirectCancelled: c } = this;
|
|
403
407
|
if (!(!r || !this.isItemRetired(r)))
|
|
404
408
|
return l`<calcite-dialog modal .open=${e} width=s kind=info outside-close-disabled escape-disabled close-disabled .heading=${this.getReplacementHeading()} @calciteDialogClose=${() => this.handleClose()}><div class="replacement-container"><div class="replacement-message">${R(this.getReplacementMessage()?.replace("${itemTitle}", this.item?.title || ""))}</div>${this.renderCard(n ? a : r)}</div>${n && !c && l`<calcite-button slot=footer-end appearance=outline-fill kind=neutral @click=${() => {
|
|
405
|
-
this.
|
|
406
|
-
}}>${t.
|
|
409
|
+
this.cancelRedirect();
|
|
410
|
+
}}>${t.cancelRedirection}</calcite-button>` || ""}<calcite-button slot=footer-end @click=${() => {
|
|
407
411
|
this.cancelTimer(), n ? this.performRedirectAction() : this.viewItemDetailsPage();
|
|
408
|
-
}} .iconEnd=${n ? void 0 : "launch"} icon-flip-rtl=end ${w(this.primaryActionRef)}>${
|
|
412
|
+
}} .iconEnd=${n ? void 0 : "launch"} icon-flip-rtl=end ${w(this.primaryActionRef)}>${this.getRedirectActionMessage()}</calcite-button></calcite-dialog>`;
|
|
409
413
|
}
|
|
410
414
|
}
|
|
411
|
-
h("arcgis-portal-replacement-item-redirect",
|
|
415
|
+
h("arcgis-portal-replacement-item-redirect", D);
|
|
412
416
|
export {
|
|
413
|
-
|
|
417
|
+
D as ArcgisPortalReplacementItemRedirect
|
|
414
418
|
};
|