@arcgis/portal-components 5.2.0-next.2 → 5.2.0-next.21
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/25UUUQAQ.js +71 -0
- package/dist/cdn/{OQDPULPD.js → 2RGMWFHB.js} +1 -1
- package/dist/cdn/3KS5IDT2.js +2 -0
- package/dist/cdn/{AQWTJKUH.js → 3MQIRMUM.js} +9 -7
- package/dist/cdn/{JNRN6DTV.js → 47NPIL2S.js} +1 -1
- package/dist/cdn/{LQ3DMZ3K.js → 5VHBNEN3.js} +1 -1
- package/dist/cdn/6AGZRMJC.js +2 -0
- package/dist/cdn/6W2IHKCA.js +2 -0
- package/dist/cdn/{WOZDQW3S.js → DBKSQGEI.js} +1 -1
- package/dist/cdn/DFTUMKSN.js +3 -0
- package/dist/cdn/{YMPTDKT6.js → EETBNQU2.js} +1 -1
- package/dist/cdn/EHRAFAEA.js +65 -0
- package/dist/cdn/EKO6SVAF.js +2 -0
- package/dist/cdn/{GHQ3ZW4U.js → FI45QCN2.js} +1 -1
- package/dist/cdn/GEIZTD7F.js +2 -0
- package/dist/cdn/{ZTHTFEYA.js → HGSK6OFA.js} +1 -1
- package/dist/cdn/{LAFNDBTQ.js → HIRM34QB.js} +1 -1
- package/dist/cdn/HMBSJR37.js +2 -0
- package/dist/cdn/KT7PE6UE.js +2 -0
- package/dist/cdn/{BEHLBKKM.js → KY7Q7DH3.js} +1 -1
- package/dist/cdn/{5DPWJ7DI.js → KZWW4BWJ.js} +1 -1
- package/dist/cdn/{N6G6Z7BF.js → MH7KZ5G3.js} +256 -154
- package/dist/cdn/MLTQECPL.js +2 -0
- package/dist/cdn/{G47ZZQYL.js → OKRYML2G.js} +1 -1
- package/dist/cdn/PDL3DPMG.js +2 -0
- package/dist/cdn/{QNUYUNEY.js → QJ2UHWPU.js} +1 -1
- package/dist/cdn/{GT26WGJS.js → SXZRHHXC.js} +1 -1
- package/dist/cdn/TSLW4FSA.js +2 -0
- package/dist/cdn/{72N3KAXN.js → TW4LFQA5.js} +1 -1
- package/dist/cdn/{7WZHZP6U.js → UR7W4CEV.js} +8 -2
- package/dist/cdn/{W6PSG4GX.js → VRXKORTR.js} +9 -4
- package/dist/cdn/VXCB2YBR.js +3 -0
- package/dist/cdn/{DHHSKOUY.js → WJ2NMHDE.js} +1 -1
- package/dist/cdn/{2UUZHENH.js → WSNLUGEP.js} +1 -1
- package/dist/cdn/{53MSUMA3.js → XCZSPNKS.js} +16 -0
- package/dist/cdn/{K3HS2LQ7.js → YECI7XG3.js} +1 -1
- package/dist/cdn/ZDLFZJBT.js +2 -0
- package/dist/cdn/assets/portal-group-badges/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-group-card/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-item-type/icons/parquetfeaturelayer16.svg +1 -0
- package/dist/cdn/assets/portal-item-type/icons/parquetfeaturelayer32.svg +1 -0
- package/dist/cdn/assets/portal-item-type/icons/storymapframe16.svg +1 -0
- package/dist/cdn/assets/portal-item-type/icons/storymapframe32.svg +1 -0
- package/dist/cdn/assets/portal-item-type/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/portal-user-popup/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/groups.js +7 -83
- package/dist/chunks/item2.js +86 -0
- package/dist/chunks/portal.js +48 -8
- package/dist/chunks/user2.js +26 -25
- package/dist/components/arcgis-portal-ai-assistant/agents/types.d.ts +11 -2
- package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +4 -2
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +797 -488
- package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.js +10 -10
- package/dist/components/arcgis-portal-group-badges/customElement.d.ts +102 -0
- package/dist/components/arcgis-portal-group-badges/customElement.js +50 -0
- package/dist/components/arcgis-portal-group-badges/index.d.ts +1 -0
- package/dist/components/arcgis-portal-group-badges/index.js +3 -0
- package/dist/components/arcgis-portal-group-badges/types.d.ts +3 -0
- package/dist/components/arcgis-portal-group-card/customElement.d.ts +167 -0
- package/dist/components/arcgis-portal-group-card/customElement.js +187 -0
- package/dist/components/arcgis-portal-group-card/index.d.ts +1 -0
- package/dist/components/arcgis-portal-group-card/index.js +8 -0
- package/dist/components/arcgis-portal-group-thumbnail/customElement.d.ts +32 -0
- package/dist/components/arcgis-portal-group-thumbnail/customElement.js +153 -0
- package/dist/components/arcgis-portal-group-thumbnail/index.d.ts +1 -0
- package/dist/components/arcgis-portal-group-thumbnail/index.js +3 -0
- package/dist/components/arcgis-portal-item-type/customElement.d.ts +2 -0
- package/dist/components/arcgis-portal-item-type/customElement.js +45 -37
- package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +1 -1
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +53 -42
- package/dist/components/arcgis-portal-user-popup/customElement.d.ts +111 -0
- package/dist/components/arcgis-portal-user-popup/customElement.js +231 -0
- package/dist/components/arcgis-portal-user-popup/index.d.ts +1 -0
- package/dist/components/arcgis-portal-user-popup/index.js +5 -0
- package/dist/components/arcgis-portal-voice-input/customElement.d.ts +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +30 -2
- package/dist/loader.js +8 -4
- package/dist/types/lumina.d.ts +26 -1
- package/dist/types/preact.d.ts +30 -1
- package/dist/types/react.d.ts +34 -1
- package/dist/types/stencil.d.ts +26 -1
- package/dist/types/tracking.d.ts +10 -0
- package/dist/types/user.d.ts +2 -2
- package/package.json +7 -7
- package/dist/cdn/5VSDGPHH.js +0 -2
- package/dist/cdn/CI5ENGVT.js +0 -2
- package/dist/cdn/EVDOPN3G.js +0 -54
- package/dist/cdn/GNOZCQ34.js +0 -2
- package/dist/cdn/KEKBRUUC.js +0 -2
- package/dist/cdn/RNLVNDGG.js +0 -2
- package/dist/cdn/SM4GWLRA.js +0 -66
- package/dist/cdn/TMYTUOSS.js +0 -2
- package/dist/cdn/YG5YYL6X.js +0 -2
- /package/dist/cdn/{B7633S2A.js → 5NIJVBS7.js} +0 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { c as p } from "../../chunks/runtime.js";
|
|
3
|
+
import { LitElement as m, nothing as f, safeStyleMap as g } from "@arcgis/lumina";
|
|
4
|
+
import { css as d, html as l } from "lit";
|
|
5
|
+
import { createRef as c, ref as h } from "lit/directives/ref.js";
|
|
6
|
+
import { a as $, g as b } from "../../chunks/portal.js";
|
|
7
|
+
const x = /^#[0-9a-f]{3}$/iu, k = /^#[0-9a-f]{6}$/iu;
|
|
8
|
+
function u(r) {
|
|
9
|
+
return E(r) || I(r);
|
|
10
|
+
}
|
|
11
|
+
function E(r) {
|
|
12
|
+
return r?.length === 4 && x.test(r);
|
|
13
|
+
}
|
|
14
|
+
function I(r) {
|
|
15
|
+
return r?.length === 7 && k.test(r);
|
|
16
|
+
}
|
|
17
|
+
function O(r) {
|
|
18
|
+
if (!u(r))
|
|
19
|
+
return null;
|
|
20
|
+
const t = r.replace("#", "");
|
|
21
|
+
if (t.length === 3) {
|
|
22
|
+
const [e, i, o] = t.split("");
|
|
23
|
+
return {
|
|
24
|
+
r: Number.parseInt(`${e}${e}`, 16),
|
|
25
|
+
g: Number.parseInt(`${i}${i}`, 16),
|
|
26
|
+
b: Number.parseInt(`${o}${o}`, 16)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
r: Number.parseInt(t.slice(0, 2), 16),
|
|
31
|
+
g: Number.parseInt(t.slice(2, 4), 16),
|
|
32
|
+
b: Number.parseInt(t.slice(4, 6), 16)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function T(r) {
|
|
36
|
+
let t = 0;
|
|
37
|
+
for (let i = 0; i < r.length; i++)
|
|
38
|
+
t = r.charCodeAt(i) + ((t << 5) - t);
|
|
39
|
+
let e = "#";
|
|
40
|
+
for (let i = 0; i < 3; i++) {
|
|
41
|
+
const o = t >> i * 8 & 255;
|
|
42
|
+
e += `00${o.toString(16)}`.slice(-2);
|
|
43
|
+
}
|
|
44
|
+
return e;
|
|
45
|
+
}
|
|
46
|
+
function v(r) {
|
|
47
|
+
let { r: t, g: e, b: i } = r;
|
|
48
|
+
t /= 255, e /= 255, i /= 255;
|
|
49
|
+
const o = Math.max(t, e, i), n = Math.min(t, e, i), s = o - n;
|
|
50
|
+
if (s === 0)
|
|
51
|
+
return 0;
|
|
52
|
+
let a = 0;
|
|
53
|
+
switch (o) {
|
|
54
|
+
case t:
|
|
55
|
+
a = (e - i) / s + (e < i ? 6 : 0);
|
|
56
|
+
break;
|
|
57
|
+
case e:
|
|
58
|
+
a = (i - t) / s + 2;
|
|
59
|
+
break;
|
|
60
|
+
default:
|
|
61
|
+
a = (t - e) / s + 4;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
return Math.round(a * 60);
|
|
65
|
+
}
|
|
66
|
+
function w(r) {
|
|
67
|
+
const t = O(r);
|
|
68
|
+
return t ? v(t) : 0;
|
|
69
|
+
}
|
|
70
|
+
const H = d`:host{display:inline-block}:host([scale="s"]){height:1.5rem;width:1.5rem;font-size:.625rem}:host([scale="m"]){height:2rem;width:2rem;font-size:.75rem}:host([scale="l"]){font-size:1rem;height:2.75rem;width:2.75rem}:host([scale="xl"]){font-size:1.25rem;height:4rem;width:4rem}.icon{display:flex;color:var(--calcite-color-text-3)}.background{position:relative;display:flex;height:100%;width:100%;align-items:center;justify-content:center}.initials{position:absolute;font-weight:700;text-transform:uppercase;color:var(--calcite-color-text-2)}.thumbnail{height:100%;width:100%}.tooltip-text{margin:0;padding:0;font-size:.75rem;color:var(--calcite-color-text-2)}calcite-tooltip{pointer-events:none}`;
|
|
71
|
+
class y extends m {
|
|
72
|
+
constructor() {
|
|
73
|
+
super(...arguments), this.imageEl = c(), this.fallbackEl = c(), this.tooltipEl = c(), this.imageError = !1, this.tooltipOpen = !1, this.tooltip = !1, this.scale = "m";
|
|
74
|
+
}
|
|
75
|
+
static {
|
|
76
|
+
this.properties = { imageError: 16, tooltipOpen: 16, group: 0, portal: 0, tooltip: 5, scale: 3 };
|
|
77
|
+
}
|
|
78
|
+
static {
|
|
79
|
+
this.styles = H;
|
|
80
|
+
}
|
|
81
|
+
willUpdate(t) {
|
|
82
|
+
t.has("group") && (this.imageError = !1);
|
|
83
|
+
}
|
|
84
|
+
updated() {
|
|
85
|
+
const t = this.tooltipEl.value, e = this.imageEl.value || this.fallbackEl.value;
|
|
86
|
+
t && e && (t.referenceElement = e);
|
|
87
|
+
}
|
|
88
|
+
isDarkMode() {
|
|
89
|
+
return !!this.el.closest(".calcite-mode-dark");
|
|
90
|
+
}
|
|
91
|
+
getThumbnailURI() {
|
|
92
|
+
const { group: t, portal: e } = this;
|
|
93
|
+
if (!t)
|
|
94
|
+
return null;
|
|
95
|
+
if (t.thumbnailUrl)
|
|
96
|
+
return t.thumbnailUrl;
|
|
97
|
+
const i = t.thumbnail;
|
|
98
|
+
if (!i)
|
|
99
|
+
return null;
|
|
100
|
+
if (i.startsWith("http"))
|
|
101
|
+
return i;
|
|
102
|
+
if (!e || !t.id)
|
|
103
|
+
return null;
|
|
104
|
+
const o = $(e), n = o ? `?token=${o}` : "";
|
|
105
|
+
return `${b(e)}community/groups/${t.id}/info/${i}${n}`;
|
|
106
|
+
}
|
|
107
|
+
generateFillColor() {
|
|
108
|
+
const { id: t, title: e } = this.group || {}, i = t ? `#${t.slice(Math.max(0, t.length - 6))}` : "", o = t && u(i) ? i : T(e || "");
|
|
109
|
+
if (!t && !e || !u(o))
|
|
110
|
+
return "var(--calcite-color-foreground-2)";
|
|
111
|
+
const n = w(o), s = this.isDarkMode() ? 20 : 90;
|
|
112
|
+
return `hsl(${n}, 60%, ${s}%)`;
|
|
113
|
+
}
|
|
114
|
+
generateInitials() {
|
|
115
|
+
const t = this.group?.title?.trim().charAt(0);
|
|
116
|
+
return t?.match(/^\w+$/u) ? t : null;
|
|
117
|
+
}
|
|
118
|
+
getIconScale() {
|
|
119
|
+
return this.scale === "xl" ? "l" : this.scale === "xs" ? "s" : this.scale;
|
|
120
|
+
}
|
|
121
|
+
renderTooltip() {
|
|
122
|
+
return !this.tooltip || !this.group?.title ? null : l`<calcite-tooltip .open=${this.tooltipOpen} close-on-click placement=bottom-start offset-distance=6 offset-skidding=0 ${h(this.tooltipEl)}><p class="tooltip-text">${this.group.title}</p></calcite-tooltip>`;
|
|
123
|
+
}
|
|
124
|
+
render() {
|
|
125
|
+
const t = this.getThumbnailURI();
|
|
126
|
+
if (t && !this.imageError)
|
|
127
|
+
return l`<img class="thumbnail" src=${t ?? f} alt @error=${() => {
|
|
128
|
+
this.imageError = !0;
|
|
129
|
+
}} @mouseenter=${() => {
|
|
130
|
+
this.tooltipOpen = !0;
|
|
131
|
+
}} @mouseleave=${() => {
|
|
132
|
+
this.tooltipOpen = !1;
|
|
133
|
+
}} @focusin=${() => {
|
|
134
|
+
this.tooltipOpen = !0;
|
|
135
|
+
}} @focusout=${() => {
|
|
136
|
+
this.tooltipOpen = !1;
|
|
137
|
+
}} ${h(this.imageEl)}>${this.renderTooltip()}`;
|
|
138
|
+
const e = this.generateInitials();
|
|
139
|
+
return l`<span class="background" style=${g({ backgroundColor: this.generateFillColor() })} @mouseenter=${() => {
|
|
140
|
+
this.tooltipOpen = !0;
|
|
141
|
+
}} @mouseleave=${() => {
|
|
142
|
+
this.tooltipOpen = !1;
|
|
143
|
+
}} @focusin=${() => {
|
|
144
|
+
this.tooltipOpen = !0;
|
|
145
|
+
}} @focusout=${() => {
|
|
146
|
+
this.tooltipOpen = !1;
|
|
147
|
+
}} ${h(this.fallbackEl)}>${e ? l`<span aria-hidden=true class="initials">${e}</span>` : l`<calcite-icon class="icon" icon=users .scale=${this.getIconScale()}></calcite-icon>`}</span>${this.renderTooltip()}`;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
p("arcgis-portal-group-thumbnail", y);
|
|
151
|
+
export {
|
|
152
|
+
y as ArcgisPortalGroupThumbnail
|
|
153
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -28,6 +28,7 @@ export abstract class ArcgisPortalItemType extends LitElement {
|
|
|
28
28
|
hostedCollectionMultidimensional: string;
|
|
29
29
|
collectionMultidimensional: string;
|
|
30
30
|
multidimensional: string;
|
|
31
|
+
query: string;
|
|
31
32
|
collection: string;
|
|
32
33
|
photoLocations: string;
|
|
33
34
|
locatorView: string;
|
|
@@ -56,6 +57,7 @@ export abstract class ArcgisPortalItemType extends LitElement {
|
|
|
56
57
|
hostedCollectionMultidimensional: string;
|
|
57
58
|
collectionMultidimensional: string;
|
|
58
59
|
multidimensional: string;
|
|
60
|
+
query: string;
|
|
59
61
|
collection: string;
|
|
60
62
|
photoLocations: string;
|
|
61
63
|
locatorView: string;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { g as
|
|
3
|
-
import { css as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
return ["org_admin", "account_admin"].includes(
|
|
2
|
+
import { g as x, c as C } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as T, html as m } from "lit";
|
|
4
|
+
import { LitElement as j, nothing as h, safeClassMap as G } from "@arcgis/lumina";
|
|
5
|
+
import { u as L } from "../../chunks/useT9n.js";
|
|
6
|
+
import { u as w, h as S, j as E, k as W, m as $, n as R, o as B, p as H } from "../../chunks/item.js";
|
|
7
|
+
const V = T`:host{display:inline-flex;align-items:center}:host([scale="s"]){--arcgis-portal-item-type-font-size: var(--calcite-font-size--2);--arcgis-portal-item-type-spacing: 1rem}:host([scale="m"]){--arcgis-portal-item-type-font-size: var(--calcite-font-size--1);--arcgis-portal-item-type-spacing: 1rem}:host([scale="l"]){--arcgis-portal-item-type-font-size: var(--calcite-font-size-0);--arcgis-portal-item-type-spacing: 1rem}.icon{display:block;flex-grow:0;flex-shrink:0;width:var(--arcgis-portal-item-type-spacing);height:var(--arcgis-portal-item-type-spacing)}.text{color:var(--calcite-text-color-2);font-size:var(--arcgis-portal-item-type-font-size);line-height:1.25rem}.text--ellipsis{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.text--spaced{margin-inline-start:calc(var(--arcgis-portal-item-type-spacing) / 2);word-wrap:break-word;word-break:break-word}`, O = (t) => typeof t?.role == "string" && t?.role ? t?.role : t?.roleId ?? t?.sourceJSON?.id;
|
|
8
|
+
function P(t) {
|
|
9
|
+
return ["org_admin", "account_admin"].includes(O(t)) && !t?.roleId;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function F(t) {
|
|
12
12
|
return !!(t?.roleId && t.roleId.length > 0);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function K(t) {
|
|
15
15
|
return !!t?.privileges?.includes("portal:admin:deleteItems");
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return r ?
|
|
17
|
+
function N(t, r) {
|
|
18
|
+
return r ? w(t, r) || t.itemControl === "update" || S([t], r) && P(r) : !1;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function q(t, r) {
|
|
21
21
|
if (!r)
|
|
22
22
|
return !1;
|
|
23
|
-
const a =
|
|
23
|
+
const a = S([t], r), e = w(t, r) || P(r) && a, i = F(r) && K(r);
|
|
24
24
|
return !!(e || a && i);
|
|
25
25
|
}
|
|
26
26
|
async function z({ item: t, messages: r, user: a, serviceInfo: e, portal: i }) {
|
|
27
|
-
const o =
|
|
27
|
+
const o = J(t), n = _(t, r, i);
|
|
28
28
|
return {
|
|
29
|
-
displayName:
|
|
30
|
-
displayNameHosted:
|
|
29
|
+
displayName: v(n, { item: t, user: a, messages: r, serviceInfo: e }, !1),
|
|
30
|
+
displayNameHosted: v(n, { item: t, user: a, messages: r, serviceInfo: e }, !0),
|
|
31
31
|
icon: o
|
|
32
32
|
};
|
|
33
33
|
}
|
|
@@ -37,35 +37,37 @@ function U(t) {
|
|
|
37
37
|
const r = t.typeKeywords;
|
|
38
38
|
return r?.includes("IntegratedMesh") ? "mesh" : r?.includes("3DObject") ? "3D object" : r?.includes("Point") ? "3D point" : r?.includes("PointCloud") ? "point cloud" : r?.includes("Building") ? "building" : r?.includes("Voxel") ? "voxel" : null;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function v(t, { item: r, user: a, messages: e, serviceInfo: i }, o = !0) {
|
|
41
41
|
const n = r.type === "Image Service";
|
|
42
42
|
if (!r || !e || !(o && a) && r.type !== "Image Service")
|
|
43
43
|
return t;
|
|
44
|
-
const c = r.type === "Feature Service" && r.typeKeywords?.includes("UtilityNetwork"), l = r.type === "Feature Service" && r.typeKeywords?.includes("ParcelFabric"), u = a &&
|
|
44
|
+
const c = r.type === "Feature Service" && r.typeKeywords?.includes("UtilityNetwork"), l = r.type === "Feature Service" && r.typeKeywords?.includes("ParcelFabric"), g = r.type === "Feature Service" && r.typeKeywords?.includes("Query Layer"), u = a && N(r, a), p = a && q(r, a), y = E(r), f = (u || p) && y, k = (u || p) && o;
|
|
45
|
+
if (g)
|
|
46
|
+
return `${t} (${e.query})`;
|
|
45
47
|
if (l)
|
|
46
|
-
return `${t} (${
|
|
48
|
+
return `${t} (${f ? e.parcelFabricHosted : e.parcelFabric})`;
|
|
47
49
|
if (c) {
|
|
48
|
-
const s =
|
|
50
|
+
const s = f ? `, ${e.hosted}` : "";
|
|
49
51
|
return `${t} (${e.utilityNetwork}${s})`;
|
|
50
52
|
}
|
|
51
53
|
if (n) {
|
|
52
|
-
const s = r.typeKeywords?.includes("Elevation 3D Layer"), I = k &&
|
|
53
|
-
return `${t}${
|
|
54
|
+
const s = r.typeKeywords?.includes("Elevation 3D Layer"), I = k && y, D = W(r, i) && !s, M = $(r, i) && !s, d = `${I ? "Hosted" : ""}${M ? "Collection" : ""}${D ? "Multidimensional" : ""}`, b = d && `${d[0].toLowerCase()}${d.slice(1)}`, A = b ? ` (${e[b]})` : "";
|
|
55
|
+
return `${t}${A}`;
|
|
54
56
|
}
|
|
55
57
|
if (k) {
|
|
56
58
|
if (r.type === "Scene Service" || r.type === "3DTiles Service") {
|
|
57
59
|
const s = U(r);
|
|
58
60
|
s && (t = `${t} - ${e[s] || s}`);
|
|
59
61
|
}
|
|
60
|
-
if (
|
|
61
|
-
const s = ` (${
|
|
62
|
+
if (y) {
|
|
63
|
+
const s = ` (${R(r) ? e.hostedView : e.hosted})`;
|
|
62
64
|
return `${t}${s}`;
|
|
63
65
|
}
|
|
64
|
-
return
|
|
66
|
+
return B(r) ? `${t} (${e.locatorView})` : H(r) ? `${t} (${e.photoLocations})` : t;
|
|
65
67
|
}
|
|
66
68
|
return t;
|
|
67
69
|
}
|
|
68
|
-
const
|
|
70
|
+
const Q = {
|
|
69
71
|
"360 VR Experience": "360 VR experience",
|
|
70
72
|
"3DTiles Package": "3D tiles package",
|
|
71
73
|
"3DTiles Service": "3D tiles layer",
|
|
@@ -182,6 +184,8 @@ const q = {
|
|
|
182
184
|
"Oriented Imagery Catalog": "Oriented imagery catalog",
|
|
183
185
|
"Ortho Mapping Project": "Ortho mapping project",
|
|
184
186
|
"Ortho Mapping Template": "Ortho mapping template",
|
|
187
|
+
"Parquet Feature Layer": "Parquet feature layer",
|
|
188
|
+
"Parquet Collection": "Parquet collection",
|
|
185
189
|
"Pro Map": "Pro map",
|
|
186
190
|
"Pro Presentation": "Pro presentation",
|
|
187
191
|
"Pro Project": "Pro project",
|
|
@@ -321,10 +325,10 @@ function _(t, r, a) {
|
|
|
321
325
|
return "Instant App";
|
|
322
326
|
break;
|
|
323
327
|
}
|
|
324
|
-
const i =
|
|
328
|
+
const i = Q[t.type] || t.type;
|
|
325
329
|
return i?.toLowerCase().includes("add in") ? i.replace(/(add in)/giu, "add-in") : i;
|
|
326
330
|
}
|
|
327
|
-
function
|
|
331
|
+
function J(t) {
|
|
328
332
|
const r = t.type?.toLowerCase() || "", a = t.typeKeywords || [], e = a.includes("Hosted Service");
|
|
329
333
|
switch (r.trim()) {
|
|
330
334
|
case "360 vr experience":
|
|
@@ -549,7 +553,7 @@ function Q(t) {
|
|
|
549
553
|
case "reality mapping project":
|
|
550
554
|
return "realitymappingproject";
|
|
551
555
|
case "storymap":
|
|
552
|
-
return a.includes("storymaptemplate") ? "storymapstemplate" : a.includes("storymapcollection") ? "storymapcollection" : a.includes("storymapbriefing") ? "storymapbriefing" : "storymap";
|
|
556
|
+
return a.includes("storymaptemplate") ? "storymapstemplate" : a.includes("storymapcollection") ? "storymapcollection" : a.includes("storymapbriefing") ? "storymapbriefing" : a.includes("storymapframe") ? "storymapframe" : "storymap";
|
|
553
557
|
case "survey123 add in":
|
|
554
558
|
return "survey123addin";
|
|
555
559
|
case "mission":
|
|
@@ -627,6 +631,10 @@ function Q(t) {
|
|
|
627
631
|
return "datastore";
|
|
628
632
|
case "data pipeline":
|
|
629
633
|
return "datapipeline";
|
|
634
|
+
case "parquet collection":
|
|
635
|
+
return "datafilesgray";
|
|
636
|
+
case "parquet feature layer":
|
|
637
|
+
return "parquetfeaturelayer";
|
|
630
638
|
case "service connection":
|
|
631
639
|
return "serviceconnection";
|
|
632
640
|
case "xr experience":
|
|
@@ -634,15 +642,15 @@ function Q(t) {
|
|
|
634
642
|
}
|
|
635
643
|
return a.includes("Document") ? "datafilesgray" : r.includes("service") ? "layers" : "maps";
|
|
636
644
|
}
|
|
637
|
-
class
|
|
645
|
+
class X extends j {
|
|
638
646
|
constructor() {
|
|
639
|
-
super(...arguments), this.messages =
|
|
647
|
+
super(...arguments), this.messages = L({ blocking: !0 }), this.icon = null, this.displayName = "", this.displayNameHosted = "", this.scale = "s";
|
|
640
648
|
}
|
|
641
649
|
static {
|
|
642
650
|
this.properties = { icon: 16, displayName: 16, displayNameHosted: 16, item: 0, serviceInfo: 0, portal: 0, user: 0, scale: 3, hideText: 5, hideIcon: 5, ellipsis: 5, showHosted: 5 };
|
|
643
651
|
}
|
|
644
652
|
static {
|
|
645
|
-
this.styles =
|
|
653
|
+
this.styles = V;
|
|
646
654
|
}
|
|
647
655
|
async load() {
|
|
648
656
|
this.item && await this.getItemDisplayInformation();
|
|
@@ -661,11 +669,11 @@ class J extends T {
|
|
|
661
669
|
const { showHosted: r, displayNameHosted: a, scale: e, icon: i, hideText: o, hideIcon: n, ellipsis: c } = this;
|
|
662
670
|
if (!i)
|
|
663
671
|
return null;
|
|
664
|
-
const l = r ? a : this.displayName,
|
|
665
|
-
return
|
|
672
|
+
const l = r ? a : this.displayName, g = l?.includes("(") ? "" : "‭", u = x(`./assets/portal-item-type/icons/${i}16.svg`), p = this.hideText ? l : void 0;
|
|
673
|
+
return m`${!n && m`<span class="icon"><img src=${u ?? h} alt=${(p || "") ?? h} class=${`icon icon--${e}`}></span>` || ""}${!o && m`<span class=${G({ text: !0, "text--spaced": !n, "text--ellipsis": c })} .innerHTML=${`${g}${l}`}></span>` || ""}`;
|
|
666
674
|
}
|
|
667
675
|
}
|
|
668
|
-
|
|
676
|
+
C("arcgis-portal-item-type", X);
|
|
669
677
|
export {
|
|
670
|
-
|
|
678
|
+
X as ArcgisPortalItemType
|
|
671
679
|
};
|
|
@@ -5,7 +5,7 @@ import { html as u, css as k } from "lit";
|
|
|
5
5
|
import { ref as M, createRef as E } from "lit/directives/ref.js";
|
|
6
6
|
import { makeGenericController as P } from "@arcgis/lumina/controllers";
|
|
7
7
|
import { debounce as R } from "@arcgis/toolkit/function";
|
|
8
|
-
import { q as L, s as U } from "../../chunks/
|
|
8
|
+
import { q as L, s as U } from "../../chunks/item2.js";
|
|
9
9
|
import { a as w, b as D } from "../../chunks/user2.js";
|
|
10
10
|
import { keyed as q } from "lit/directives/keyed.js";
|
|
11
11
|
const v = ["@", "#", "$"], O = 400;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { g as
|
|
3
|
-
import { LitElement as
|
|
4
|
-
import { f as
|
|
5
|
-
import { u as
|
|
6
|
-
import { createRef as
|
|
7
|
-
import { unsafeHTML as
|
|
8
|
-
import { css as
|
|
2
|
+
import { g as f, c as g } from "../../chunks/runtime.js";
|
|
3
|
+
import { LitElement as v, createEvent as b, nothing as y } from "@arcgis/lumina";
|
|
4
|
+
import { f as I } from "../../chunks/item.js";
|
|
5
|
+
import { u as w } from "../../chunks/useT9n.js";
|
|
6
|
+
import { createRef as R, ref as k } from "lit/directives/ref.js";
|
|
7
|
+
import { unsafeHTML as S } from "lit/directives/unsafe-html.js";
|
|
8
|
+
import { css as M, html as l } from "lit";
|
|
9
9
|
import m from "@arcgis/core/portal/PortalItem.js";
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
10
|
+
import { g as T, b as $ } from "../../chunks/portal.js";
|
|
11
|
+
import C from "@arcgis/core/request.js";
|
|
12
|
+
import { f as P } from "../../chunks/user2.js";
|
|
13
|
+
import { g as A } from "../../chunks/user.js";
|
|
14
|
+
const U = M`.thumbnail{object-fit:cover;max-height:8rem}.replacement-container{margin:.5rem}.replacement-message{margin-bottom:.5rem}.replacement-card__title{margin-bottom:.25rem}`, j = [
|
|
13
15
|
"360 VR Experience",
|
|
14
16
|
"Big Data Analytic",
|
|
15
17
|
"Dashboard",
|
|
@@ -39,8 +41,7 @@ const $ = S`.thumbnail-container{width:100%}.replacement-container{margin:.5rem}
|
|
|
39
41
|
"Notebook",
|
|
40
42
|
"OGCFeatureServer",
|
|
41
43
|
"Ortho Mapping Project",
|
|
42
|
-
"Parquet Layer",
|
|
43
|
-
"PDF",
|
|
44
|
+
"Parquet Feature Layer",
|
|
44
45
|
"Real Time Analytic",
|
|
45
46
|
"Route Layer",
|
|
46
47
|
"Scene Service",
|
|
@@ -59,7 +60,7 @@ const $ = S`.thumbnail-container{width:100%}.replacement-container{margin:.5rem}
|
|
|
59
60
|
"Web Scene",
|
|
60
61
|
"WFS",
|
|
61
62
|
"Workflow"
|
|
62
|
-
],
|
|
63
|
+
], L = [
|
|
63
64
|
"3DInsetMap",
|
|
64
65
|
"3DScene",
|
|
65
66
|
"3DViz",
|
|
@@ -141,16 +142,16 @@ const $ = S`.thumbnail-container{width:100%}.replacement-container{margin:.5rem}
|
|
|
141
142
|
"View",
|
|
142
143
|
"Viewer",
|
|
143
144
|
"ZoneLookup"
|
|
144
|
-
],
|
|
145
|
+
], D = (i) => {
|
|
145
146
|
if (!i)
|
|
146
147
|
return !1;
|
|
147
|
-
const e =
|
|
148
|
+
const e = L.some((t) => {
|
|
148
149
|
const r = t.includes(".html"), a = `/apps/${t}${r ? "" : "/"}`;
|
|
149
150
|
return decodeURIComponent(i.url)?.includes(a);
|
|
150
151
|
});
|
|
151
152
|
return i.type === "Web Mapping Application" && !!i.url && e;
|
|
152
153
|
};
|
|
153
|
-
function
|
|
154
|
+
function x(i) {
|
|
154
155
|
const e = [
|
|
155
156
|
"Cascade",
|
|
156
157
|
"MapTour",
|
|
@@ -161,9 +162,9 @@ function U(i) {
|
|
|
161
162
|
"SwipeSpyglass",
|
|
162
163
|
"Story Map"
|
|
163
164
|
];
|
|
164
|
-
return i.type === "Web Mapping Application" && (
|
|
165
|
+
return i.type === "Web Mapping Application" && (B(e, i) || F(i));
|
|
165
166
|
}
|
|
166
|
-
function
|
|
167
|
+
function F(i) {
|
|
167
168
|
return [
|
|
168
169
|
"Cascade",
|
|
169
170
|
"MapTour",
|
|
@@ -177,17 +178,17 @@ function D(i) {
|
|
|
177
178
|
return decodeURIComponent(i.url)?.includes(r);
|
|
178
179
|
});
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
+
function B(i, e) {
|
|
181
182
|
return i?.some((t) => e?.typeKeywords?.includes(t));
|
|
182
183
|
}
|
|
183
|
-
function
|
|
184
|
-
return !!i &&
|
|
184
|
+
function E(i) {
|
|
185
|
+
return !!i && j.some((e) => i.type === e);
|
|
185
186
|
}
|
|
186
187
|
function d(i) {
|
|
187
|
-
const e =
|
|
188
|
-
return
|
|
188
|
+
const e = V(i);
|
|
189
|
+
return f(`assets/portal-item-thumbnail/${e}`);
|
|
189
190
|
}
|
|
190
|
-
function
|
|
191
|
+
function V(i) {
|
|
191
192
|
const e = i.type?.toLowerCase(), t = i.typeKeywords || [];
|
|
192
193
|
switch (e) {
|
|
193
194
|
case "web mapping application":
|
|
@@ -347,8 +348,8 @@ function x(i) {
|
|
|
347
348
|
return "default.avif";
|
|
348
349
|
}
|
|
349
350
|
}
|
|
350
|
-
function
|
|
351
|
-
const { restUrl: r } = i, a =
|
|
351
|
+
function H(i, e, t) {
|
|
352
|
+
const { restUrl: r } = i, a = G(i), s = a ? `token=${a}` : "", o = `${r}/content/items/${e.id}`;
|
|
352
353
|
if (e.thumbnail) {
|
|
353
354
|
const c = e.thumbnailUrl;
|
|
354
355
|
if (c) {
|
|
@@ -360,36 +361,44 @@ function F(i, e, t) {
|
|
|
360
361
|
return `${o}/data?${s}`;
|
|
361
362
|
return d(e);
|
|
362
363
|
}
|
|
363
|
-
function
|
|
364
|
+
function G(i) {
|
|
364
365
|
return (
|
|
365
366
|
// @ts-ignore
|
|
366
367
|
i?.credential?.token || i?.token || i?.user?.credential?.token || i?.portalUser?.token || ""
|
|
367
368
|
);
|
|
368
369
|
}
|
|
369
|
-
function
|
|
370
|
+
function _({
|
|
370
371
|
portal: i,
|
|
371
372
|
usePortalHostname: e
|
|
372
373
|
}) {
|
|
373
374
|
const { customBaseUrl: t, portalHostname: r, urlKey: a } = i, { protocol: s } = window.location, o = !e && a ? `${a}.${t}` : r;
|
|
374
375
|
return `${s}//${o}`;
|
|
375
376
|
}
|
|
377
|
+
async function O(i) {
|
|
378
|
+
if (!i?.user)
|
|
379
|
+
return [];
|
|
380
|
+
const e = `${T(i)}portals/self/signinSettings`;
|
|
381
|
+
return (await C(e, {
|
|
382
|
+
query: { f: "json" }
|
|
383
|
+
}))?.data.blockedApps || [];
|
|
384
|
+
}
|
|
376
385
|
const u = 5e3;
|
|
377
|
-
class
|
|
386
|
+
class W extends v {
|
|
378
387
|
constructor() {
|
|
379
|
-
super(...arguments), this.replacementId = null, this.itemOwnerName = "", this.replacementItemInRecycleBin = !1, this.hasInaccessibleReplacementItem = !1, this.replacementItemSupportsOpenActions = !1, this.thumbnailUrl = null, this.timer = void 0, this.messages =
|
|
380
|
-
const a =
|
|
388
|
+
super(...arguments), this.replacementId = null, this.itemOwnerName = "", this.replacementItemInRecycleBin = !1, this.hasInaccessibleReplacementItem = !1, this.replacementItemSupportsOpenActions = !1, this.thumbnailUrl = null, this.timer = void 0, this.messages = w({ blocking: !0 }), this.primaryActionRef = R(), this.getItemDetailsUrl = ({ portal: e, itemId: t, redirect: r }) => {
|
|
389
|
+
const a = _({ portal: e, usePortalHostname: !this.user });
|
|
381
390
|
return a ? `${`${a}/home`}/item.html?id=${t}${r ? "&performRedirectAction=true" : ""}` : "";
|
|
382
391
|
}, this.performRedirectAction = () => {
|
|
383
392
|
window.open(this.getItemDetailsUrl({ portal: this.portal, itemId: this.replacementId, redirect: !0 }), "_self");
|
|
384
393
|
}, this.viewItemDetailsPage = () => {
|
|
385
394
|
window.open(this.getItemDetailsUrl({ portal: this.portal, itemId: this.replacementId ?? this.itemId }), this.supportsReplacement ? "_self" : "_blank");
|
|
386
|
-
}, this.canRedirect = !1, this.item = null, this.replacementItem = null, this.redirectAction = null, this.supportsReplacement = !1, this.redirectCancelled = !1, this.open = !1, this.redirectTimeRemaining = u / 1e3, this.arcgisPortalReplacementItemFetch =
|
|
395
|
+
}, this.canRedirect = !1, this.item = null, this.replacementItem = null, this.redirectAction = null, this.supportsReplacement = !1, this.redirectCancelled = !1, this.open = !1, this.redirectTimeRemaining = u / 1e3, this.arcgisPortalReplacementItemFetch = b();
|
|
387
396
|
}
|
|
388
397
|
static {
|
|
389
398
|
this.properties = { item: 16, replacementItem: 16, redirectAction: 16, supportsReplacement: 16, redirectCancelled: 16, open: 16, redirectTimeRemaining: 16, itemId: 1, portal: 0, user: 0 };
|
|
390
399
|
}
|
|
391
400
|
static {
|
|
392
|
-
this.styles =
|
|
401
|
+
this.styles = U;
|
|
393
402
|
}
|
|
394
403
|
async setFocus() {
|
|
395
404
|
this.primaryActionRef.value?.setFocus();
|
|
@@ -416,7 +425,7 @@ class H extends g {
|
|
|
416
425
|
this.cancelTimer(), this.redirectCancelled = !0;
|
|
417
426
|
}
|
|
418
427
|
isItemRetired(e) {
|
|
419
|
-
return
|
|
428
|
+
return D(e) || x(e);
|
|
420
429
|
}
|
|
421
430
|
async initItem() {
|
|
422
431
|
if (!this.itemId)
|
|
@@ -426,7 +435,7 @@ class H extends g {
|
|
|
426
435
|
portal: t
|
|
427
436
|
});
|
|
428
437
|
this.item = await a?.load();
|
|
429
|
-
const s = await
|
|
438
|
+
const s = await I(e, t, {
|
|
430
439
|
relationshipType: "ReplacementItem2Item",
|
|
431
440
|
direction: "reverse"
|
|
432
441
|
}, !0), o = s.data?.relatedItems?.[0];
|
|
@@ -438,8 +447,10 @@ class H extends g {
|
|
|
438
447
|
await n?.load(), this.replacementItem = n, this.hasInaccessibleReplacementItem = this.replacementItemInRecycleBin || !n && s.data?.aggregations?.total?.count > 0 && s.data?.relatedItems?.length === 0, this.arcgisPortalReplacementItemFetch.emit({
|
|
439
448
|
replacementItem: this.hasInaccessibleReplacementItem ? {} : n || null
|
|
440
449
|
}), this.replacementItem = n;
|
|
441
|
-
const p =
|
|
442
|
-
this.itemOwnerName = p ?
|
|
450
|
+
const p = this.replacementItem?.owner ?? (a?.owner || null);
|
|
451
|
+
this.itemOwnerName = p ? A(await P(p, t), this.messages?._t9nLocale || "en") : "", this.replacementItemSupportsOpenActions = E(n), this.thumbnailUrl = H(t, n ?? this.item), this.supportsReplacement = !!n && this.isItemRetired(a);
|
|
452
|
+
const h = $(this.replacementItem, await O(this.portal), this.portal?.isPortal ?? !1);
|
|
453
|
+
this.canRedirect = this.supportsReplacement && this.replacementItemSupportsOpenActions && !h, this.replacementId = n?.id || null, this.canRedirect && this.setupTimer({
|
|
443
454
|
onComplete: () => r()
|
|
444
455
|
}), this.open = !0;
|
|
445
456
|
}
|
|
@@ -457,19 +468,19 @@ class H extends g {
|
|
|
457
468
|
}
|
|
458
469
|
renderCard(e) {
|
|
459
470
|
const { canRedirect: t, messages: r } = this;
|
|
460
|
-
return l`<calcite-card thumbnail-position=inline-start><img slot=thumbnail class="thumbnail" src=${(this.thumbnailUrl || void 0) ??
|
|
471
|
+
return l`<calcite-card thumbnail-position=inline-start><img slot=thumbnail class="thumbnail" src=${(this.thumbnailUrl || void 0) ?? y} @error=${async () => this.thumbnailUrl = d(e)}><span slot=heading class="replacement-card__title">${e.title}</span><span slot=description>${r.ownedBy?.replace("${owner}", this.itemOwnerName)}</span>${t && l`<calcite-link slot=footer-start icon-end=launch .href=${this.getItemDetailsUrl({ portal: this.portal, itemId: this.replacementId })} target=_blank>${r.moreDetails}</calcite-link>` || ""}</calcite-card>`;
|
|
461
472
|
}
|
|
462
473
|
render() {
|
|
463
474
|
const { open: e, messages: t, item: r, replacementItem: a, supportsReplacement: s, canRedirect: o, redirectCancelled: c } = this;
|
|
464
475
|
if (!(!r || !this.isItemRetired(r)))
|
|
465
|
-
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">${
|
|
476
|
+
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">${S(this.getReplacementMessage()?.replace("${itemTitle}", this.item?.title || ""))}</div>${this.renderCard(s ? a : r)}</div>${o && !c && l`<calcite-button slot=footer-end appearance=outline-fill kind=neutral @click=${() => {
|
|
466
477
|
this.cancelRedirect();
|
|
467
478
|
}}>${t.cancelRedirection}</calcite-button>` || ""}<calcite-button slot=footer-end @click=${() => {
|
|
468
479
|
this.cancelTimer(), o ? this.performRedirectAction() : this.viewItemDetailsPage();
|
|
469
|
-
}} .iconEnd=${o ? void 0 : "launch"}
|
|
480
|
+
}} .iconEnd=${o ? void 0 : "launch"} ${k(this.primaryActionRef)}>${this.getRedirectActionMessage()}</calcite-button></calcite-dialog>`;
|
|
470
481
|
}
|
|
471
482
|
}
|
|
472
|
-
|
|
483
|
+
g("arcgis-portal-replacement-item-redirect", W);
|
|
473
484
|
export {
|
|
474
|
-
|
|
485
|
+
W as ArcgisPortalReplacementItemRedirect
|
|
475
486
|
};
|