@arcgis/portal-components 5.2.0-next.4 → 5.2.0-next.41
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/2C475EKD.js +2 -0
- package/dist/cdn/3J46PXFF.js +3 -0
- package/dist/cdn/3MBOA5WF.js +2 -0
- package/dist/cdn/{GQFWFZXP.js → 3OBIA66A.js} +1 -1
- package/dist/cdn/3Z3ZPFGJ.js +2 -0
- package/dist/cdn/5NMFQE4U.js +2 -0
- package/dist/cdn/{7WZHZP6U.js → 63THOLAY.js} +9 -3
- package/dist/cdn/6AGZRMJC.js +2 -0
- package/dist/cdn/6DYBW2C6.js +2 -0
- package/dist/cdn/6RK4FBHZ.js +2 -0
- package/dist/cdn/6W2IHKCA.js +2 -0
- package/dist/cdn/7E5GJIZV.js +2 -0
- package/dist/cdn/AL57LV4E.js +2 -0
- package/dist/cdn/{LQ3DMZ3K.js → AXM6XCZD.js} +1 -1
- package/dist/cdn/AYR65LXN.js +65 -0
- package/dist/cdn/BUJPYZSX.js +2 -0
- package/dist/cdn/{DKBTJJMW.js → C7ZFXRPS.js} +1 -1
- package/dist/cdn/D76KMXZD.js +2 -0
- package/dist/cdn/DFTUMKSN.js +3 -0
- package/dist/cdn/DZJMNZY6.js +451 -0
- package/dist/cdn/EI6BAXCQ.js +2 -0
- package/dist/cdn/EVMYGWC6.js +637 -0
- package/dist/cdn/FXIP4QXJ.js +2 -0
- package/dist/cdn/GE75KDIM.js +2 -0
- package/dist/cdn/GJTJLK6T.js +2 -0
- package/dist/cdn/GKOXTQHB.js +2 -0
- package/dist/cdn/GQMPPCEL.js +2 -0
- package/dist/cdn/GXJU3U7U.js +2 -0
- package/dist/cdn/HMBSJR37.js +2 -0
- package/dist/cdn/HZ5W3DBR.js +2 -0
- package/dist/cdn/{V2EOXGK2.js → I234NUZ5.js} +1 -1
- package/dist/cdn/I5HSJRM3.js +2 -0
- package/dist/cdn/IBP5XPD5.js +2 -0
- package/dist/cdn/IC65R4QE.js +2 -0
- package/dist/cdn/IHSJ4MKS.js +2 -0
- package/dist/cdn/IJ3CLFAU.js +22 -0
- package/dist/cdn/IWUJRI4G.js +2 -0
- package/dist/cdn/{ZTHTFEYA.js → IXVR3KMC.js} +1 -1
- package/dist/cdn/{QNUYUNEY.js → JS45DWQ3.js} +1 -1
- package/dist/cdn/{DHHSKOUY.js → JV23HJTE.js} +1 -1
- package/dist/cdn/{LAFNDBTQ.js → JYIPREIH.js} +1 -1
- package/dist/cdn/JZKBUYPV.js +2 -0
- package/dist/cdn/KM5XGRXL.js +2 -0
- package/dist/cdn/{3PAHY5KA.js → KNRJ3WXR.js} +1 -1
- package/dist/cdn/L4DRNGOL.js +2 -0
- package/dist/cdn/{F6V7MLPY.js → L6KBBJEC.js} +1 -1
- package/dist/cdn/NJ2WDAJM.js +2 -0
- package/dist/cdn/NWIIOJEG.js +2 -0
- package/dist/cdn/{53MSUMA3.js → OT4PZJNB.js} +17 -1
- package/dist/cdn/POIXW2OA.js +2 -0
- package/dist/cdn/QE4CNVDQ.js +34 -0
- package/dist/cdn/{AQWTJKUH.js → QKCV7CY2.js} +10 -8
- package/dist/cdn/RKNDXSVK.js +2 -0
- package/dist/cdn/SLTFLCVR.js +99 -0
- package/dist/cdn/SUPKZF5M.js +2 -0
- package/dist/cdn/{GT26WGJS.js → SXZRHHXC.js} +1 -1
- package/dist/cdn/TJAX7J4T.js +2 -0
- package/dist/cdn/{DXCPWJU4.js → TKCE4WYE.js} +1 -1
- package/dist/cdn/U3FVMN32.js +2 -0
- package/dist/cdn/UZLQALHY.js +2 -0
- package/dist/cdn/{RR4BIAPA.js → V4EYW3O6.js} +1 -1
- package/dist/cdn/{74XFARCV.js → VW7DSKPH.js} +1 -1
- package/dist/cdn/W2SYL7IJ.js +71 -0
- package/dist/cdn/{W6PSG4GX.js → W4FGRGLV.js} +10 -5
- package/dist/cdn/{SYJSVUUR.js → W4SAWMXS.js} +1 -1
- package/dist/cdn/WBZLQZYR.js +134 -0
- package/dist/cdn/WGZZB2DJ.js +2 -0
- package/dist/cdn/WO23VQK3.js +2 -0
- package/dist/cdn/{2UUZHENH.js → WSNLUGEP.js} +1 -1
- package/dist/cdn/WSWHK6LB.js +2 -0
- package/dist/cdn/{WOZDQW3S.js → WX65MRDH.js} +1 -1
- package/dist/cdn/XEK22IDA.js +2 -0
- package/dist/cdn/ZPIXIG3Z.js +2 -0
- package/dist/cdn/ZVFNCDG5.js +2 -0
- package/dist/cdn/assets/portal-browser/t9n/messages.en.json +1 -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/dom.js +36 -0
- package/dist/chunks/functionalities.js +5 -4
- package/dist/chunks/groups.js +7 -83
- package/dist/chunks/item2.js +86 -0
- package/dist/chunks/portal.js +48 -8
- package/dist/chunks/store.js +18 -0
- package/dist/chunks/ui.js +10 -0
- 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-browser/customElement.d.ts +235 -0
- package/dist/components/arcgis-portal-browser/customElement.js +201 -0
- package/dist/components/arcgis-portal-browser/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser/index.js +6 -0
- package/dist/components/arcgis-portal-browser/utils/store.d.ts +31 -0
- package/dist/components/arcgis-portal-browser/utils/types.d.ts +18 -0
- package/dist/components/arcgis-portal-browser-actions/customElement.d.ts +187 -0
- package/dist/components/arcgis-portal-browser-actions/customElement.js +70 -0
- package/dist/components/arcgis-portal-browser-actions/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-actions/index.js +6 -0
- package/dist/components/arcgis-portal-browser-actions/types.d.ts +9 -0
- package/dist/components/arcgis-portal-browser-filter/customElement.d.ts +226 -0
- package/dist/components/arcgis-portal-browser-filter/customElement.js +32 -0
- package/dist/components/arcgis-portal-browser-filter/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-filter/index.js +4 -0
- package/dist/components/arcgis-portal-browser-filter-date/customElement.d.ts +233 -0
- package/dist/components/arcgis-portal-browser-filter-date/customElement.js +117 -0
- package/dist/components/arcgis-portal-browser-filter-date/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-filter-date/index.js +5 -0
- package/dist/components/arcgis-portal-browser-filter-status/customElement.d.ts +193 -0
- package/dist/components/arcgis-portal-browser-filter-status/customElement.js +56 -0
- package/dist/components/arcgis-portal-browser-filter-status/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-filter-status/index.js +5 -0
- package/dist/components/arcgis-portal-browser-filters/customElement.d.ts +7 -0
- package/dist/components/arcgis-portal-browser-filters/customElement.js +29 -0
- package/dist/components/arcgis-portal-browser-filters/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-filters/index.js +2 -0
- package/dist/components/arcgis-portal-browser-pagination/customElement.d.ts +194 -0
- package/dist/components/arcgis-portal-browser-pagination/customElement.js +51 -0
- package/dist/components/arcgis-portal-browser-pagination/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-pagination/index.js +2 -0
- package/dist/components/arcgis-portal-browser-search/customElement.d.ts +195 -0
- package/dist/components/arcgis-portal-browser-search/customElement.js +65 -0
- package/dist/components/arcgis-portal-browser-search/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-search/index.js +3 -0
- package/dist/components/arcgis-portal-browser-sort/customElement.d.ts +196 -0
- package/dist/components/arcgis-portal-browser-sort/customElement.js +93 -0
- package/dist/components/arcgis-portal-browser-sort/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-sort/index.js +9 -0
- package/dist/components/arcgis-portal-browser-sort/utils.d.ts +3 -0
- package/dist/components/arcgis-portal-browser-top-bar/customElement.d.ts +184 -0
- package/dist/components/arcgis-portal-browser-top-bar/customElement.js +51 -0
- package/dist/components/arcgis-portal-browser-top-bar/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-top-bar/index.js +3 -0
- package/dist/components/arcgis-portal-browser-view/customElement.d.ts +21 -0
- package/dist/components/arcgis-portal-browser-view/customElement.js +30 -0
- package/dist/components/arcgis-portal-browser-view/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-view/index.js +5 -0
- 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 +183 -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 +224 -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 +122 -2
- package/dist/loader.js +19 -4
- package/dist/types/group.d.ts +13 -13
- package/dist/types/item.d.ts +77 -2
- package/dist/types/lumina.d.ts +93 -1
- package/dist/types/preact.d.ts +108 -1
- package/dist/types/react.d.ts +123 -1
- package/dist/types/search.d.ts +27 -0
- package/dist/types/stencil.d.ts +93 -1
- package/dist/types/tracking.d.ts +10 -0
- package/dist/types/user.d.ts +2 -2
- package/package.json +11 -11
- package/dist/cdn/5DPWJ7DI.js +0 -2
- package/dist/cdn/5VSDGPHH.js +0 -2
- package/dist/cdn/72N3KAXN.js +0 -2
- package/dist/cdn/ANPXRYLV.js +0 -5
- package/dist/cdn/B7633S2A.js +0 -422
- package/dist/cdn/BEHLBKKM.js +0 -2
- package/dist/cdn/CI5ENGVT.js +0 -2
- package/dist/cdn/EVDOPN3G.js +0 -54
- package/dist/cdn/G47ZZQYL.js +0 -2
- package/dist/cdn/GAHILDQF.js +0 -45
- package/dist/cdn/GHQ3ZW4U.js +0 -2
- package/dist/cdn/GNOZCQ34.js +0 -2
- package/dist/cdn/JNRN6DTV.js +0 -2
- package/dist/cdn/K3HS2LQ7.js +0 -2
- package/dist/cdn/KEKBRUUC.js +0 -2
- package/dist/cdn/N6G6Z7BF.js +0 -516
- package/dist/cdn/OQDPULPD.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/YIMNOUTF.js +0 -2
- package/dist/cdn/YL7PGYWC.js +0 -5
- package/dist/cdn/YMPTDKT6.js +0 -2
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type Portal from "@arcgis/core/portal/Portal.js";
|
|
3
|
+
import type PortalItem from "@arcgis/core/portal/PortalItem.js";
|
|
4
|
+
import type PortalUser from "@arcgis/core/portal/PortalUser.js";
|
|
5
|
+
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
6
|
+
import type { InternalUIAction } from "../../types/tracking.js";
|
|
7
|
+
import type { Scale } from "../../types/ui.js";
|
|
8
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
9
|
+
|
|
10
|
+
export abstract class ArcgisPortalUserPopup extends LitElement {
|
|
11
|
+
/**
|
|
12
|
+
* Choose outline for a full-width outlined button.
|
|
13
|
+
*
|
|
14
|
+
* @default "transparent"
|
|
15
|
+
*/
|
|
16
|
+
accessor appearance: "outline" | "transparent";
|
|
17
|
+
/**
|
|
18
|
+
* Set to true to hide avatar from screen readers.
|
|
19
|
+
*
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
accessor avatarAriaHidden: boolean | undefined;
|
|
23
|
+
/** Fully qualified path to portal home root. */
|
|
24
|
+
accessor baseUrl: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* @default false
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
accessor checkOnline: boolean | undefined;
|
|
30
|
+
/** Optional full name fallback if user information does not include it. */
|
|
31
|
+
accessor fullName: string | undefined;
|
|
32
|
+
/** Passing an item will show org info for publicly verified items, user info for standard items. */
|
|
33
|
+
accessor item: PortalItem | undefined;
|
|
34
|
+
/** @internal */
|
|
35
|
+
protected messages: {
|
|
36
|
+
expand: string;
|
|
37
|
+
showLess: string;
|
|
38
|
+
homepage: string;
|
|
39
|
+
gallery: string;
|
|
40
|
+
profile: string;
|
|
41
|
+
groups: string;
|
|
42
|
+
items: string;
|
|
43
|
+
viewAll: string;
|
|
44
|
+
loadingUserInformation: string;
|
|
45
|
+
itemManagedBy: string;
|
|
46
|
+
} & T9nMeta<{
|
|
47
|
+
expand: string;
|
|
48
|
+
showLess: string;
|
|
49
|
+
homepage: string;
|
|
50
|
+
gallery: string;
|
|
51
|
+
profile: string;
|
|
52
|
+
groups: string;
|
|
53
|
+
items: string;
|
|
54
|
+
viewAll: string;
|
|
55
|
+
loadingUserInformation: string;
|
|
56
|
+
itemManagedBy: string;
|
|
57
|
+
}>;
|
|
58
|
+
/** The current portal instance. */
|
|
59
|
+
accessor portal: Portal;
|
|
60
|
+
/**
|
|
61
|
+
* Scale of the component.
|
|
62
|
+
*
|
|
63
|
+
* @default "m"
|
|
64
|
+
*/
|
|
65
|
+
accessor scale: Scale;
|
|
66
|
+
/**
|
|
67
|
+
* Set to false to hide the avatar and show username only.
|
|
68
|
+
*
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
accessor showAvatar: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Set to false to show only the avatar.
|
|
74
|
+
*
|
|
75
|
+
* @default true
|
|
76
|
+
*/
|
|
77
|
+
accessor showName: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Set to true to show username in description.
|
|
80
|
+
*
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
accessor showUsername: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Set to true to underline the name.
|
|
86
|
+
*
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
accessor underline: boolean | undefined;
|
|
90
|
+
/** Passing a user will always show thumbnail for that user (use either user or item). */
|
|
91
|
+
accessor user: PortalUser | undefined;
|
|
92
|
+
/** Passing a username will perform a fetch for the user information on load. */
|
|
93
|
+
accessor username: string | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Allow the name to wrap lines (max 2).
|
|
96
|
+
*
|
|
97
|
+
* @default false
|
|
98
|
+
*/
|
|
99
|
+
accessor wrap: boolean | undefined;
|
|
100
|
+
/** The z-index of the popover. */
|
|
101
|
+
accessor zIndex: number | undefined;
|
|
102
|
+
openPopup(): Promise<void>;
|
|
103
|
+
setFocus(): Promise<void>;
|
|
104
|
+
readonly arcgisUserPopupClose: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
105
|
+
/** Fires on internal component interaction - used by telemetry. */
|
|
106
|
+
readonly arcgisUserPopupInternalUIAction: import("@arcgis/lumina").TargetedEvent<this, InternalUIAction>;
|
|
107
|
+
readonly "@eventTypes": {
|
|
108
|
+
arcgisUserPopupClose: ArcgisPortalUserPopup["arcgisUserPopupClose"]["detail"];
|
|
109
|
+
arcgisUserPopupInternalUIAction: ArcgisPortalUserPopup["arcgisUserPopupInternalUIAction"]["detail"];
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { c as N } from "../../chunks/runtime.js";
|
|
3
|
+
import { LitElement as A, createEvent as y, safeClassMap as k, safeStyleMap as B } from "@arcgis/lumina";
|
|
4
|
+
import { css as R, html as u } from "lit";
|
|
5
|
+
import { createRef as U, ref as I } from "lit/directives/ref.js";
|
|
6
|
+
import { u as L } from "../../chunks/useT9n.js";
|
|
7
|
+
import { a as _, r as $, f as w } from "../../chunks/user2.js";
|
|
8
|
+
import { g as H } from "../../chunks/user.js";
|
|
9
|
+
import { s as T, a as z } from "../../chunks/dom.js";
|
|
10
|
+
import { g as x } from "../../chunks/portal.js";
|
|
11
|
+
function C(e) {
|
|
12
|
+
const r = /(https?:\/\/[^\s]+)/gu;
|
|
13
|
+
return e?.replace(r, (o) => `<a href="${o}" target="_blank">${o}</a>`);
|
|
14
|
+
}
|
|
15
|
+
function M(e) {
|
|
16
|
+
return e?.replace(/(?:\r)/gu, " ").replace(/(?:\n)/gu, " ");
|
|
17
|
+
}
|
|
18
|
+
function q(e) {
|
|
19
|
+
return e?.replace(/(?: )/gu, "\r").replace(/(?: )/gu, `
|
|
20
|
+
`);
|
|
21
|
+
}
|
|
22
|
+
function F(e) {
|
|
23
|
+
return e?.replace(/ | | |\r\n|\r|\n/gu, "<br>");
|
|
24
|
+
}
|
|
25
|
+
function S(e) {
|
|
26
|
+
return F(M(C(q(e))));
|
|
27
|
+
}
|
|
28
|
+
function E(e) {
|
|
29
|
+
return e?.endsWith("/") ? e.slice(0, e.length - 1) : e;
|
|
30
|
+
}
|
|
31
|
+
const G = R`:host{display:flex}.button{display:flex;align-items:center;max-width:100%;cursor:pointer;white-space:normal;border-style:none;padding:0;font-size:.75rem;color:var(--calcite-color-text-2);outline:2px solid transparent;outline-offset:2px;transition-property:all;outline-color:transparent;background:transparent;font-family:inherit;line-height:1.5;&:focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px}}.button--outline{box-sizing:border-box;width:100%;padding:.5rem .75rem;transition-property:all;border:1px solid var(--calcite-color-border-3);&:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}}.name{overflow:hidden;white-space:nowrap;margin-inline-start:.5rem;text-overflow:ellipsis}.popover__wrapper{background-color:var(--calcite-color-foreground-1);width:min(32rem,80vw)}.popover__header{padding:1.25rem 1rem}.popover__avatar{max-width:100%}.popover__content{padding:.5rem 1rem 1.25rem}.popover__description{margin:0;overflow:auto;padding:0;padding-bottom:1rem;font-size:.875rem;color:var(--calcite-color-text-2);max-height:21.25rem}.popover__fade{position:relative;z-index:10;margin-bottom:.25rem;display:block;height:1rem;width:100%;background:linear-gradient(to bottom,transparent,var(--calcite-color-foreground-1) 100%);margin-top:-1rem}.popover__buttons{display:grid;grid-auto-flow:column;grid-gap:.5rem}.popover__buttons--no-description{padding-top:1rem}.popover__button{min-width:0px}.popover__loader{--calcite-loader-padding: 0}`;
|
|
32
|
+
async function D(e, r, o, s, t) {
|
|
33
|
+
const a = e.portal?.portalHostname || s?.portalHostname || s?.restUrl?.replace("/sharing/rest", ""), n = t ? `https://www.arcgis.com/sharing/rest/portals/${r}` : `https://${a}/sharing/rest/portals/${r}`;
|
|
34
|
+
if (!a && !t)
|
|
35
|
+
return null;
|
|
36
|
+
const i = t ? { disableIdentityLookup: !0, addTokenManually: !1 } : {}, l = await $({ url: n, portal: s, options: i }), { urlKey: m, thumbnail: p, customBaseUrl: c } = l, f = `https://${m}.${c}/`, h = p ? `${f}sharing/rest/portals/self/resources/${p}` : null;
|
|
37
|
+
let d = "", v = "";
|
|
38
|
+
try {
|
|
39
|
+
const g = await $({
|
|
40
|
+
url: `${n}/resources/localizedOrgProperties`,
|
|
41
|
+
portal: s,
|
|
42
|
+
params: { start: 1, num: 100 },
|
|
43
|
+
options: i
|
|
44
|
+
});
|
|
45
|
+
if (g) {
|
|
46
|
+
const b = g[o] || g.default;
|
|
47
|
+
d = b.name, v = b.description;
|
|
48
|
+
}
|
|
49
|
+
} catch {
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
name: d || l.name,
|
|
53
|
+
description: T(v || l.description),
|
|
54
|
+
url: `${f}home/`,
|
|
55
|
+
thumbnail: h
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
async function J(e, r, o, s) {
|
|
59
|
+
const t = e.sourceJSON?.orgId ?? e.portal?.id ?? o?.id;
|
|
60
|
+
return await _({
|
|
61
|
+
requester: async () => await D(e, t, r, o, s),
|
|
62
|
+
key: "verified",
|
|
63
|
+
id: t
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
const O = (e) => (
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
68
|
+
e?.sourceJSON?.contentStatus === "public_authoritative"
|
|
69
|
+
);
|
|
70
|
+
async function K(e, r, o, s) {
|
|
71
|
+
if (O(e)) {
|
|
72
|
+
const t = e.owner || "", a = await J(e, o, r, s);
|
|
73
|
+
if (!a)
|
|
74
|
+
return await w(t, r, s);
|
|
75
|
+
const { description: n, name: i, thumbnail: l, url: m } = a;
|
|
76
|
+
return {
|
|
77
|
+
description: n ? z(n) : "",
|
|
78
|
+
fullName: i,
|
|
79
|
+
username: t,
|
|
80
|
+
thumbnail: l,
|
|
81
|
+
id: e.portal.id,
|
|
82
|
+
url: m
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return await w(e.owner || "", r, s);
|
|
86
|
+
}
|
|
87
|
+
async function V(e, r, o) {
|
|
88
|
+
const s = o ? "https://www.arcgis.com/sharing/rest/" : x(r), t = o ? { disableIdentityLookup: !0, addTokenManually: !1 } : {};
|
|
89
|
+
return await _({
|
|
90
|
+
requester: async () => await $({
|
|
91
|
+
url: `${s}community/groups`,
|
|
92
|
+
portal: r,
|
|
93
|
+
params: {
|
|
94
|
+
q: `(owner:"${e}")`,
|
|
95
|
+
num: 100
|
|
96
|
+
},
|
|
97
|
+
options: t
|
|
98
|
+
}),
|
|
99
|
+
key: "userGroups",
|
|
100
|
+
id: e
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
async function W(e, r, o) {
|
|
104
|
+
const s = o ? "https://www.arcgis.com/sharing/rest/" : x(r), t = o ? { disableIdentityLookup: !0, addTokenManually: !1 } : {};
|
|
105
|
+
return await _({
|
|
106
|
+
requester: async () => (await $({
|
|
107
|
+
url: `${s}search`,
|
|
108
|
+
portal: r,
|
|
109
|
+
params: {
|
|
110
|
+
q: `(owner:"${e}") -typekeywords:"recyclebin"`,
|
|
111
|
+
num: 1
|
|
112
|
+
},
|
|
113
|
+
options: t
|
|
114
|
+
})).total,
|
|
115
|
+
key: "userItemsTotal",
|
|
116
|
+
id: e
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function P({
|
|
120
|
+
baseUrl: e,
|
|
121
|
+
user: r,
|
|
122
|
+
type: o
|
|
123
|
+
}) {
|
|
124
|
+
const s = E(e), t = encodeURIComponent(r.username || "");
|
|
125
|
+
return t ? `${s}/${o}.html?user=${t}` : `${s}/${o}.html`;
|
|
126
|
+
}
|
|
127
|
+
class j extends A {
|
|
128
|
+
constructor() {
|
|
129
|
+
super(...arguments), this.messages = L({ blocking: !0 }), this.buttonRef = U(), this.popoverRef = U(), this.isPopoverOpen = !1, this.scale = "m", this.showAvatar = !0, this.showName = !0, this.showUsername = !1, this.appearance = "transparent", this.arcgisUserPopupInternalUIAction = y(), this.arcgisUserPopupClose = y();
|
|
130
|
+
}
|
|
131
|
+
static {
|
|
132
|
+
this.properties = { itemUserInfo: 16, groups: 16, total: 16, isPopoverOpen: 16, user: 0, username: 1, fullName: 1, item: 0, scale: 3, portal: 0, baseUrl: 1, underline: 5, showAvatar: 5, showName: 5, showUsername: 5, wrap: 5, appearance: 1, zIndex: 9, avatarAriaHidden: 5, checkOnline: 5 };
|
|
133
|
+
}
|
|
134
|
+
static {
|
|
135
|
+
this.styles = G;
|
|
136
|
+
}
|
|
137
|
+
async setFocus() {
|
|
138
|
+
this.buttonRef.value?.focus();
|
|
139
|
+
}
|
|
140
|
+
async openPopup() {
|
|
141
|
+
this.buttonRef.value?.click();
|
|
142
|
+
}
|
|
143
|
+
connectedCallback() {
|
|
144
|
+
super.connectedCallback(), this.init();
|
|
145
|
+
}
|
|
146
|
+
updated(r) {
|
|
147
|
+
r.has("isPopoverOpen") && this.isPopoverOpen && this.setPopoverOpen(!0);
|
|
148
|
+
}
|
|
149
|
+
get resolvedBaseUrl() {
|
|
150
|
+
return this.baseUrl || `${this.portal.url}/home`;
|
|
151
|
+
}
|
|
152
|
+
async init() {
|
|
153
|
+
const { item: r, username: o, portal: s, fullName: t, messages: a } = this;
|
|
154
|
+
if (!(!a._lang || !s)) {
|
|
155
|
+
if (r) {
|
|
156
|
+
this.itemUserInfo = await K(r, s, a._lang, this.checkOnline);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (o) {
|
|
160
|
+
const n = await w(o, s, this.checkOnline);
|
|
161
|
+
!n.fullName && t && (n.fullName = t), this.itemUserInfo = n;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async fetchItemsAndGroups() {
|
|
166
|
+
const { user: r, itemUserInfo: o, item: s, portal: t, username: a, checkOnline: n } = this, i = a || r?.username || s?.owner || o?.username;
|
|
167
|
+
if (!(!i || !t)) {
|
|
168
|
+
if (!this.groups) {
|
|
169
|
+
const l = await V(i, t, n);
|
|
170
|
+
this.groups = l;
|
|
171
|
+
}
|
|
172
|
+
this.total = await W(i, t, n);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
setPopoverOpen(r) {
|
|
176
|
+
requestAnimationFrame(() => {
|
|
177
|
+
this.popoverRef.value && (this.popoverRef.value.open = r);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
openLink(r, o) {
|
|
181
|
+
r.preventDefault(), window.open(o, "_blank");
|
|
182
|
+
}
|
|
183
|
+
renderOrgButtons(r) {
|
|
184
|
+
const { messages: o } = this, t = (r.url || this.resolvedBaseUrl).replace(/\/$/u, "");
|
|
185
|
+
return u`<calcite-button appearance=outline-fill kind=neutral .href=${t} target=_blank @click=${(a) => this.openLink(a, t)}>${o.homepage}</calcite-button><calcite-button appearance=outline-fill kind=neutral .href=${`${t}/gallery.html`} target=_blank @click=${(a) => this.openLink(a, `${t}/gallery.html`)}>${o.gallery}</calcite-button>`;
|
|
186
|
+
}
|
|
187
|
+
renderUserButtons(r) {
|
|
188
|
+
const { total: o, groups: s, messages: t } = this, a = r.username || "";
|
|
189
|
+
if (typeof o != "number" || !s)
|
|
190
|
+
return u`<calcite-loader .label=${t.loadingUserInformation} scale=s class="popover__loader"></calcite-loader>`;
|
|
191
|
+
const i = P({ baseUrl: this.resolvedBaseUrl, user: { username: a }, type: "groups" }), l = P({ baseUrl: this.resolvedBaseUrl, user: { username: a }, type: "content" }), m = `${this.resolvedBaseUrl.replace(/\/$/u, "")}/user.html?user=${encodeURIComponent(a)}`;
|
|
192
|
+
return u`${!!s.total && u`<calcite-button class="popover__button" appearance=outline-fill kind=neutral .href=${i} target=_blank @click=${(p) => {
|
|
193
|
+
this.openLink(p, i), this.arcgisUserPopupInternalUIAction.emit({ category: "profile popup", action: "view all groups" });
|
|
194
|
+
}}>${t.groups.replace("${number}", new Intl.NumberFormat(t._lang).format(s.total))}</calcite-button>` || ""}${!!o && u`<calcite-button class="popover__button" appearance=outline-fill kind=neutral .href=${l} target=_blank @click=${(p) => {
|
|
195
|
+
this.openLink(p, l), this.arcgisUserPopupInternalUIAction.emit({ category: "profile popup", action: "view all content" });
|
|
196
|
+
}}>${t.items.replace("${number}", new Intl.NumberFormat(t._lang).format(o))}</calcite-button>` || ""}<calcite-button class="popover__button" appearance=outline-fill kind=neutral .href=${m} target=_blank @click=${(p) => {
|
|
197
|
+
this.openLink(p, m), this.arcgisUserPopupInternalUIAction.emit({ category: "profile popup", action: "view profile" });
|
|
198
|
+
}}>${t.profile}</calcite-button>`;
|
|
199
|
+
}
|
|
200
|
+
render() {
|
|
201
|
+
const { user: r, itemUserInfo: o, portal: s, item: t, appearance: a, scale: n, isPopoverOpen: i, showName: l, showUsername: m, messages: p } = this, c = r || o;
|
|
202
|
+
if (!p._lang || !c)
|
|
203
|
+
return u`<arcgis-portal-user-avatar scale=s show-name .checkOnline=${this.checkOnline}></arcgis-portal-user-avatar>`;
|
|
204
|
+
const f = O(t), h = c.username || "", d = S(c.description || "") || "", v = H(c, p._lang), g = f ? p.itemManagedBy.replace("${username}", h) : h;
|
|
205
|
+
return u`<button class=${k({
|
|
206
|
+
button: !0,
|
|
207
|
+
"button--outline": a === "outline"
|
|
208
|
+
})} @click=${() => {
|
|
209
|
+
this.isPopoverOpen || (this.isPopoverOpen = !0), this.fetchItemsAndGroups();
|
|
210
|
+
}} ${I(this.buttonRef)}><slot><arcgis-portal-user-avatar .user=${c} .scale=${n} .portal=${s} .showName=${l} .description=${m ? h : ""} .hideAvatar=${!this.showAvatar} .underline=${this.underline} .checkOnline=${this.checkOnline} .wrap=${this.wrap}></arcgis-portal-user-avatar></slot></button>${i && this.buttonRef.value && c && u`<calcite-popover class="popover" .label=${v} pointer-disabled .referenceElement=${this.buttonRef.value} placement=auto .id=${`${h}-popover`} auto-close style=${B({ "--calcite-popover-z-index": this.zIndex?.toString() || "12" })} @calcitePopoverOpen=${() => {
|
|
211
|
+
this.arcgisUserPopupInternalUIAction.emit({ category: "profile popup", action: "open profile popup" });
|
|
212
|
+
}} @calcitePopoverClose=${() => {
|
|
213
|
+
this.isPopoverOpen = !1, this.arcgisUserPopupClose.emit();
|
|
214
|
+
}} @keydown=${(b) => {
|
|
215
|
+
b.key === "Escape" && setTimeout(() => {
|
|
216
|
+
this.buttonRef.value?.focus();
|
|
217
|
+
}, 200);
|
|
218
|
+
}} ${I(this.popoverRef)}><div class="popover__wrapper"><div class="popover__header"><arcgis-portal-user-avatar class="popover__avatar" .user=${c} scale=l .portal=${s} show-name .description=${g} .checkOnline=${this.checkOnline}></arcgis-portal-user-avatar></div><div class="popover__content">${!!d && u`<p class="popover__description">${d}</p>` || ""}${!!d && u`<div class="popover__fade"></div>` || ""}<div class=${k({ popover__buttons: !0, "popover__buttons--no-description": !d })}>${f ? this.renderOrgButtons(c) : this.renderUserButtons(c)}</div></div></div></calcite-popover>` || ""}`;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
N("arcgis-portal-user-popup", j);
|
|
222
|
+
export {
|
|
223
|
+
j as ArcgisPortalUserPopup
|
|
224
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "@esri/calcite-components/components/calcite-button";
|
|
2
|
+
import "@esri/calcite-components/components/calcite-loader";
|
|
3
|
+
import "../arcgis-portal-user-avatar/index.js";
|
|
4
|
+
import "@esri/calcite-components/components/calcite-popover";
|
|
5
|
+
export * from "./customElement.js";
|
|
@@ -6,7 +6,7 @@ export abstract class ArcgisPortalVoiceInput extends LitElement {
|
|
|
6
6
|
/**
|
|
7
7
|
* Language for speech recognition (e.g., 'en-US', 'es-ES'). If not provided, the browser's default language will be used.
|
|
8
8
|
*
|
|
9
|
-
* @see https://developer.mozilla.org/
|
|
9
|
+
* @see https://developer.mozilla.org/docs/Web/API/SpeechRecognition/lang
|
|
10
10
|
*/
|
|
11
11
|
accessor language: string | undefined;
|
|
12
12
|
clearText(): Promise<void>;
|