@arcgis/portal-components 5.2.0-next.1 → 5.2.0-next.11
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/2CA7QHVV.js +2 -0
- package/dist/cdn/{ZTHTFEYA.js → 2V5S6KBL.js} +1 -1
- package/dist/cdn/2X4VWQ5E.js +2 -0
- package/dist/cdn/{AQWTJKUH.js → 3MQIRMUM.js} +9 -7
- package/dist/cdn/{LAFNDBTQ.js → 4BGBBW4V.js} +1 -1
- package/dist/cdn/4VRIZNFA.js +2 -0
- package/dist/cdn/6AGZRMJC.js +2 -0
- package/dist/cdn/6W2IHKCA.js +2 -0
- package/dist/cdn/{DHHSKOUY.js → BMUU2S5H.js} +1 -1
- package/dist/cdn/{CI5ENGVT.js → CTVWAEEO.js} +1 -1
- package/dist/cdn/{WOZDQW3S.js → DB6O5DIG.js} +1 -1
- package/dist/cdn/DFTUMKSN.js +3 -0
- package/dist/cdn/{RNLVNDGG.js → G3AK2CRM.js} +1 -1
- package/dist/cdn/GS6MPCDK.js +2 -0
- package/dist/cdn/{5DPWJ7DI.js → IKOAI6C7.js} +1 -1
- package/dist/cdn/JVKWYKZR.js +2 -0
- package/dist/cdn/{N6G6Z7BF.js → KL4LVBFR.js} +188 -88
- package/dist/cdn/{GHQ3ZW4U.js → MLPVRTHY.js} +1 -1
- package/dist/cdn/{YG5YYL6X.js → OMD65KRY.js} +1 -1
- package/dist/cdn/QGFU75HM.js +3 -0
- package/dist/cdn/{K3HS2LQ7.js → QN3ZQLFB.js} +1 -1
- package/dist/cdn/{OQDPULPD.js → ROCZLAYA.js} +1 -1
- package/dist/cdn/SB25M4FP.js +2 -0
- package/dist/cdn/{GT26WGJS.js → SXZRHHXC.js} +1 -1
- package/dist/cdn/{53MSUMA3.js → TBYTYYJJ.js} +16 -0
- package/dist/cdn/VHSATYO4.js +65 -0
- package/dist/cdn/{G47ZZQYL.js → VQU2EEJR.js} +1 -1
- package/dist/cdn/{YMPTDKT6.js → W3ZB6MHE.js} +1 -1
- package/dist/cdn/{2UUZHENH.js → WSNLUGEP.js} +1 -1
- package/dist/cdn/{BEHLBKKM.js → XFFD6YY5.js} +1 -1
- package/dist/cdn/{JNRN6DTV.js → XLHPYPQY.js} +1 -1
- package/dist/cdn/{LQ3DMZ3K.js → YKHMRMUE.js} +1 -1
- package/dist/cdn/{QNUYUNEY.js → Z73H62GB.js} +1 -1
- 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/groups2.js +86 -0
- package/dist/chunks/portal.js +48 -8
- package/dist/chunks/user2.js +26 -25
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +640 -335
- 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 -41
- 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 +7 -3
- package/dist/types/lumina.d.ts +25 -0
- package/dist/types/preact.d.ts +29 -0
- package/dist/types/react.d.ts +33 -0
- package/dist/types/stencil.d.ts +25 -0
- 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/GNOZCQ34.js +0 -2
- package/dist/cdn/KEKBRUUC.js +0 -2
- package/dist/cdn/SM4GWLRA.js +0 -66
- package/dist/cdn/TMYTUOSS.js +0 -2
|
@@ -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/groups2.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-container{width:100%}.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,7 +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",
|
|
44
|
+
"Parquet Feature Layer",
|
|
43
45
|
"PDF",
|
|
44
46
|
"Real Time Analytic",
|
|
45
47
|
"Route Layer",
|
|
@@ -59,7 +61,7 @@ const $ = S`.thumbnail-container{width:100%}.replacement-container{margin:.5rem}
|
|
|
59
61
|
"Web Scene",
|
|
60
62
|
"WFS",
|
|
61
63
|
"Workflow"
|
|
62
|
-
],
|
|
64
|
+
], D = [
|
|
63
65
|
"3DInsetMap",
|
|
64
66
|
"3DScene",
|
|
65
67
|
"3DViz",
|
|
@@ -141,16 +143,16 @@ const $ = S`.thumbnail-container{width:100%}.replacement-container{margin:.5rem}
|
|
|
141
143
|
"View",
|
|
142
144
|
"Viewer",
|
|
143
145
|
"ZoneLookup"
|
|
144
|
-
],
|
|
146
|
+
], L = (i) => {
|
|
145
147
|
if (!i)
|
|
146
148
|
return !1;
|
|
147
|
-
const e =
|
|
149
|
+
const e = D.some((t) => {
|
|
148
150
|
const r = t.includes(".html"), a = `/apps/${t}${r ? "" : "/"}`;
|
|
149
151
|
return decodeURIComponent(i.url)?.includes(a);
|
|
150
152
|
});
|
|
151
153
|
return i.type === "Web Mapping Application" && !!i.url && e;
|
|
152
154
|
};
|
|
153
|
-
function
|
|
155
|
+
function x(i) {
|
|
154
156
|
const e = [
|
|
155
157
|
"Cascade",
|
|
156
158
|
"MapTour",
|
|
@@ -161,9 +163,9 @@ function U(i) {
|
|
|
161
163
|
"SwipeSpyglass",
|
|
162
164
|
"Story Map"
|
|
163
165
|
];
|
|
164
|
-
return i.type === "Web Mapping Application" && (
|
|
166
|
+
return i.type === "Web Mapping Application" && (B(e, i) || F(i));
|
|
165
167
|
}
|
|
166
|
-
function
|
|
168
|
+
function F(i) {
|
|
167
169
|
return [
|
|
168
170
|
"Cascade",
|
|
169
171
|
"MapTour",
|
|
@@ -177,17 +179,17 @@ function D(i) {
|
|
|
177
179
|
return decodeURIComponent(i.url)?.includes(r);
|
|
178
180
|
});
|
|
179
181
|
}
|
|
180
|
-
function
|
|
182
|
+
function B(i, e) {
|
|
181
183
|
return i?.some((t) => e?.typeKeywords?.includes(t));
|
|
182
184
|
}
|
|
183
|
-
function
|
|
184
|
-
return !!i &&
|
|
185
|
+
function E(i) {
|
|
186
|
+
return !!i && j.some((e) => i.type === e);
|
|
185
187
|
}
|
|
186
188
|
function d(i) {
|
|
187
|
-
const e =
|
|
188
|
-
return
|
|
189
|
+
const e = V(i);
|
|
190
|
+
return f(`assets/portal-item-thumbnail/${e}`);
|
|
189
191
|
}
|
|
190
|
-
function
|
|
192
|
+
function V(i) {
|
|
191
193
|
const e = i.type?.toLowerCase(), t = i.typeKeywords || [];
|
|
192
194
|
switch (e) {
|
|
193
195
|
case "web mapping application":
|
|
@@ -347,8 +349,8 @@ function x(i) {
|
|
|
347
349
|
return "default.avif";
|
|
348
350
|
}
|
|
349
351
|
}
|
|
350
|
-
function
|
|
351
|
-
const { restUrl: r } = i, a =
|
|
352
|
+
function H(i, e, t) {
|
|
353
|
+
const { restUrl: r } = i, a = G(i), s = a ? `token=${a}` : "", o = `${r}/content/items/${e.id}`;
|
|
352
354
|
if (e.thumbnail) {
|
|
353
355
|
const c = e.thumbnailUrl;
|
|
354
356
|
if (c) {
|
|
@@ -360,36 +362,44 @@ function F(i, e, t) {
|
|
|
360
362
|
return `${o}/data?${s}`;
|
|
361
363
|
return d(e);
|
|
362
364
|
}
|
|
363
|
-
function
|
|
365
|
+
function G(i) {
|
|
364
366
|
return (
|
|
365
367
|
// @ts-ignore
|
|
366
368
|
i?.credential?.token || i?.token || i?.user?.credential?.token || i?.portalUser?.token || ""
|
|
367
369
|
);
|
|
368
370
|
}
|
|
369
|
-
function
|
|
371
|
+
function _({
|
|
370
372
|
portal: i,
|
|
371
373
|
usePortalHostname: e
|
|
372
374
|
}) {
|
|
373
375
|
const { customBaseUrl: t, portalHostname: r, urlKey: a } = i, { protocol: s } = window.location, o = !e && a ? `${a}.${t}` : r;
|
|
374
376
|
return `${s}//${o}`;
|
|
375
377
|
}
|
|
378
|
+
async function O(i) {
|
|
379
|
+
if (!i?.user)
|
|
380
|
+
return [];
|
|
381
|
+
const e = `${T(i)}portals/self/signinSettings`;
|
|
382
|
+
return (await C(e, {
|
|
383
|
+
query: { f: "json" }
|
|
384
|
+
}))?.data.blockedApps || [];
|
|
385
|
+
}
|
|
376
386
|
const u = 5e3;
|
|
377
|
-
class
|
|
387
|
+
class W extends v {
|
|
378
388
|
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 =
|
|
389
|
+
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 }) => {
|
|
390
|
+
const a = _({ portal: e, usePortalHostname: !this.user });
|
|
381
391
|
return a ? `${`${a}/home`}/item.html?id=${t}${r ? "&performRedirectAction=true" : ""}` : "";
|
|
382
392
|
}, this.performRedirectAction = () => {
|
|
383
393
|
window.open(this.getItemDetailsUrl({ portal: this.portal, itemId: this.replacementId, redirect: !0 }), "_self");
|
|
384
394
|
}, this.viewItemDetailsPage = () => {
|
|
385
395
|
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 =
|
|
396
|
+
}, 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
397
|
}
|
|
388
398
|
static {
|
|
389
399
|
this.properties = { item: 16, replacementItem: 16, redirectAction: 16, supportsReplacement: 16, redirectCancelled: 16, open: 16, redirectTimeRemaining: 16, itemId: 1, portal: 0, user: 0 };
|
|
390
400
|
}
|
|
391
401
|
static {
|
|
392
|
-
this.styles =
|
|
402
|
+
this.styles = U;
|
|
393
403
|
}
|
|
394
404
|
async setFocus() {
|
|
395
405
|
this.primaryActionRef.value?.setFocus();
|
|
@@ -416,7 +426,7 @@ class H extends g {
|
|
|
416
426
|
this.cancelTimer(), this.redirectCancelled = !0;
|
|
417
427
|
}
|
|
418
428
|
isItemRetired(e) {
|
|
419
|
-
return
|
|
429
|
+
return L(e) || x(e);
|
|
420
430
|
}
|
|
421
431
|
async initItem() {
|
|
422
432
|
if (!this.itemId)
|
|
@@ -426,7 +436,7 @@ class H extends g {
|
|
|
426
436
|
portal: t
|
|
427
437
|
});
|
|
428
438
|
this.item = await a?.load();
|
|
429
|
-
const s = await
|
|
439
|
+
const s = await I(e, t, {
|
|
430
440
|
relationshipType: "ReplacementItem2Item",
|
|
431
441
|
direction: "reverse"
|
|
432
442
|
}, !0), o = s.data?.relatedItems?.[0];
|
|
@@ -438,8 +448,10 @@ class H extends g {
|
|
|
438
448
|
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
449
|
replacementItem: this.hasInaccessibleReplacementItem ? {} : n || null
|
|
440
450
|
}), this.replacementItem = n;
|
|
441
|
-
const p =
|
|
442
|
-
this.itemOwnerName = p ?
|
|
451
|
+
const p = this.replacementItem?.owner ?? (a?.owner || null);
|
|
452
|
+
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);
|
|
453
|
+
const h = $(this.replacementItem, await O(this.portal), this.portal?.isPortal ?? !1);
|
|
454
|
+
this.canRedirect = this.supportsReplacement && this.replacementItemSupportsOpenActions && !h, this.replacementId = n?.id || null, this.canRedirect && this.setupTimer({
|
|
443
455
|
onComplete: () => r()
|
|
444
456
|
}), this.open = !0;
|
|
445
457
|
}
|
|
@@ -457,19 +469,19 @@ class H extends g {
|
|
|
457
469
|
}
|
|
458
470
|
renderCard(e) {
|
|
459
471
|
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) ??
|
|
472
|
+
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
473
|
}
|
|
462
474
|
render() {
|
|
463
475
|
const { open: e, messages: t, item: r, replacementItem: a, supportsReplacement: s, canRedirect: o, redirectCancelled: c } = this;
|
|
464
476
|
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">${
|
|
477
|
+
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
478
|
this.cancelRedirect();
|
|
467
479
|
}}>${t.cancelRedirection}</calcite-button>` || ""}<calcite-button slot=footer-end @click=${() => {
|
|
468
480
|
this.cancelTimer(), o ? this.performRedirectAction() : this.viewItemDetailsPage();
|
|
469
|
-
}} .iconEnd=${o ? void 0 : "launch"}
|
|
481
|
+
}} .iconEnd=${o ? void 0 : "launch"} ${k(this.primaryActionRef)}>${this.getRedirectActionMessage()}</calcite-button></calcite-dialog>`;
|
|
470
482
|
}
|
|
471
483
|
}
|
|
472
|
-
|
|
484
|
+
g("arcgis-portal-replacement-item-redirect", W);
|
|
473
485
|
export {
|
|
474
|
-
|
|
486
|
+
W as ArcgisPortalReplacementItemRedirect
|
|
475
487
|
};
|