@arcgis/portal-components 6.0.0-next.34 → 6.0.0-next.35
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/{Q2LXJOVS.js → 2OBYOLPM.js} +1 -1
- package/dist/cdn/{XI3ERUXD.js → IKRGN33H.js} +12 -12
- package/dist/cdn/IWQ5I2DD.js +2 -0
- package/dist/cdn/K7DHGCZI.js +70 -0
- package/dist/cdn/assets/portal-navigation/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +14 -0
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +411 -376
- package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.d.ts +3 -1
- package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.js +34 -62
- package/dist/components/arcgis-portal-ai-assistant-interrupt/index.js +2 -5
- package/dist/components/arcgis-portal-delete-items/customElement.js +1 -1
- package/dist/components/arcgis-portal-navigation/customElement.d.ts +0 -4
- package/dist/components/arcgis-portal-navigation/customElement.js +208 -208
- package/dist/components/arcgis-portal-navigation/index.js +0 -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/loader.js +2 -2
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +8 -8
- package/dist/cdn/4DPS57A4.js +0 -2
- package/dist/cdn/LSWV67YC.js +0 -70
|
@@ -30,7 +30,7 @@ export abstract class ArcgisPortalAiAssistantInterrupt extends LitElement {
|
|
|
30
30
|
textInputLabel: string;
|
|
31
31
|
}>;
|
|
32
32
|
accessor entityRequest: PortalEntitySelectionRequest | undefined;
|
|
33
|
-
accessor message:
|
|
33
|
+
accessor message: InterruptType["message"] | undefined;
|
|
34
34
|
accessor options: InterruptType["options"];
|
|
35
35
|
/** @internal */
|
|
36
36
|
protected pickerMessages: {
|
|
@@ -68,6 +68,8 @@ export abstract class ArcgisPortalAiAssistantInterrupt extends LitElement {
|
|
|
68
68
|
}>;
|
|
69
69
|
accessor portal: Portal | undefined;
|
|
70
70
|
accessor requestId: string | undefined;
|
|
71
|
+
/** @default false */
|
|
72
|
+
accessor showOtherOption: boolean;
|
|
71
73
|
accessor type: InterruptType["type"];
|
|
72
74
|
readonly arcgisCancel: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
73
75
|
readonly arcgisSubmit: import("@arcgis/lumina").TargetedEvent<this, string[] | boolean | string>;
|
|
@@ -1,91 +1,63 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { keyed as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import
|
|
6
|
-
import { css as
|
|
7
|
-
import { createRef as
|
|
8
|
-
import { unsafeHTML as
|
|
9
|
-
import { marked as
|
|
10
|
-
import { u
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class x extends d {
|
|
2
|
+
import { c as h } from "../../chunks/runtime.js";
|
|
3
|
+
import { keyed as c } from "lit/directives/keyed.js";
|
|
4
|
+
import { LitElement as y, createEvent as o, nothing as g } from "@arcgis/lumina";
|
|
5
|
+
import f from "@esri/arcgis-html-sanitizer";
|
|
6
|
+
import { css as b, html as t } from "lit";
|
|
7
|
+
import { createRef as l, ref as p } from "lit/directives/ref.js";
|
|
8
|
+
import { unsafeHTML as v } from "lit/directives/unsafe-html.js";
|
|
9
|
+
import { marked as d } from "marked";
|
|
10
|
+
import { u } from "../../chunks/useT9n.js";
|
|
11
|
+
import { t as k } from "../../chunks/portalEntitySelection.js";
|
|
12
|
+
const $ = b`:host{container-type:inline-size;display:block;min-inline-size:0}.interrupt-container{display:flex;flex-direction:column;gap:.75rem}.interrupt-actions,.interrupt-buttons{display:flex;justify-content:flex-end;gap:.5rem}.interrupt-message{white-space:normal}.interrupt-message :where(p){margin:0}.interrupt-message :where(ul,ol){margin:0;padding-inline-start:1.25rem}.entity-interrupt{background:var(--calcite-color-foreground-1);border-block-start:2px solid var(--calcite-color-brand);gap:0}.entity-heading{align-items:center;display:flex;gap:.75rem;padding:1rem 1rem .75rem}.entity-heading-icon{color:var(--calcite-color-brand);flex:none}.entity-heading-content{display:grid;gap:.25rem;min-inline-size:0}.entity-eyebrow{color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-relative-sm);line-height:1.25}.entity-question{color:var(--calcite-color-text-1);font-size:var(--calcite-font-size-relative-md);font-weight:500;line-height:1.4;overflow-wrap:anywhere}.interrupt-picker{--arcgis-portal-entity-picker-results-max-block-size: min(22rem, 40vh);--arcgis-portal-entity-picker-selection-display: none;box-sizing:border-box;padding:0 1rem .75rem}.entity-interrupt .interrupt-actions{align-items:center;border-block-start:1px solid var(--calcite-color-border-3);display:grid;gap:.75rem;grid-template-columns:minmax(0,1fr) auto;min-block-size:2.25rem;padding:.625rem 1rem}.entity-selection{align-items:center;color:var(--calcite-color-text-2);display:flex;font-size:var(--calcite-font-size-relative-base);gap:.5rem;min-inline-size:0}.entity-selection calcite-icon{color:var(--calcite-color-status-success);flex:none}.entity-selection-label{flex:1;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@container (max-width: 24rem){.entity-heading{padding:.875rem .75rem .625rem}.interrupt-picker{padding:0 .75rem .625rem}.entity-interrupt .interrupt-actions{gap:.5rem;grid-template-columns:minmax(0,1fr);padding:.625rem .75rem}.entity-selection:empty{display:none}}`;
|
|
13
|
+
d.use({ gfm: !0, breaks: !0, async: !1 });
|
|
14
|
+
const w = new f();
|
|
15
|
+
class x extends y {
|
|
17
16
|
constructor() {
|
|
18
|
-
super(...arguments), this
|
|
17
|
+
super(...arguments), this._messages = u({ blocking: !0 }), this.pickerMessages = u({ blocking: !0, name: "portal-entity-picker" }), this.pickerRef = l(), this.interruptRef = l(), this.requestKey = 0, this.selectedEntity = null, this.selectionSubmitted = !1, this.showOtherOption = !1, this.arcgisCancel = o(), this.arcgisSubmit = o();
|
|
19
18
|
}
|
|
20
19
|
static {
|
|
21
|
-
this.properties = { selectedEntity: 16, selectionSubmitted: 16, type: 1, message: 1, options: 0, portal: 0, entityRequest: 0, requestId: 1 };
|
|
20
|
+
this.properties = { selectedEntity: 16, selectionSubmitted: 16, type: 1, message: 1, options: 0, showOtherOption: 5, portal: 0, entityRequest: 0, requestId: 1 };
|
|
22
21
|
}
|
|
23
22
|
static {
|
|
24
|
-
this.styles =
|
|
23
|
+
this.styles = $;
|
|
25
24
|
}
|
|
26
|
-
#e;
|
|
27
25
|
get selectedReference() {
|
|
28
|
-
return this.selectedEntity && this.selectedEntity.entityType === this.entityRequest?.entityType ?
|
|
26
|
+
return this.selectedEntity && this.selectedEntity.entityType === this.entityRequest?.entityType ? k(this.selectedEntity) : void 0;
|
|
29
27
|
}
|
|
30
28
|
willUpdate(e) {
|
|
31
|
-
(e.has("entityRequest") || e.has("requestId") || e.has("portal")) && (this.
|
|
29
|
+
(e.has("entityRequest") || e.has("requestId") || e.has("portal")) && (this.requestKey += 1, this.selectedEntity = null, this.selectionSubmitted = !1);
|
|
32
30
|
}
|
|
33
31
|
updated(e) {
|
|
34
|
-
this.isConnected &&
|
|
32
|
+
this.isConnected && (e.has("entityRequest") || e.has("requestId") || e.has("portal") || e.has("type")) && (this.entityRequest ? this.focusPicker() : this.interruptRef.value?.setFocus());
|
|
35
33
|
}
|
|
36
34
|
async focusPicker() {
|
|
37
35
|
const e = this.pickerRef.value;
|
|
38
36
|
e && (await e.componentOnReady(), this.isConnected && this.pickerRef.value === e && await e.setFocus());
|
|
39
37
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (!e || this.selectionSubmitted)
|
|
44
|
-
return;
|
|
45
|
-
this.selectionSubmitted = !0, this.arcgisSubmit.emit(JSON.stringify(e));
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
this.arcgisSubmit.emit(this.type === "boolean-choice" ? !0 : this.#e);
|
|
38
|
+
submitEntitySelection() {
|
|
39
|
+
const e = this.selectedReference;
|
|
40
|
+
!e || this.selectionSubmitted || (this.selectionSubmitted = !0, this.arcgisSubmit.emit(JSON.stringify(e)));
|
|
49
41
|
}
|
|
50
42
|
_renderMessageContent() {
|
|
51
|
-
const e = this.message ?? "", i =
|
|
52
|
-
return
|
|
53
|
-
}
|
|
54
|
-
_renderInterruptInput() {
|
|
55
|
-
const { _messages: e, type: i, options: n } = this;
|
|
56
|
-
switch (i) {
|
|
57
|
-
case "single-select":
|
|
58
|
-
return s`<calcite-list class="interrupt-list" .label=${e.singleSelectLabel} selection-mode=single-persist @calciteListChange=${(t) => this.#e = t.target.selectedItems[0]?.value}>${n?.map((t) => s`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;
|
|
59
|
-
case "multi-select":
|
|
60
|
-
return s`<calcite-list class="interrupt-list" .label=${e.multiSelectLabel} selection-mode=multiple @calciteListChange=${(t) => this.#e = t.target.selectedItems.map((r) => r.value)}>${n?.map((t) => s`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;
|
|
61
|
-
case "text-input":
|
|
62
|
-
return s`<calcite-input class="interrupt-input" .label=${e.textInputLabel} @calciteInputInput=${(t) => this.#e = t.target.value}></calcite-input>`;
|
|
63
|
-
case "boolean-choice":
|
|
64
|
-
return null;
|
|
65
|
-
default:
|
|
66
|
-
return b(i);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
_renderInterruptButtons(e = !1) {
|
|
70
|
-
const { _messages: i, type: n, selectedReference: t } = this, r = n === "boolean-choice";
|
|
71
|
-
return s`<div class="interrupt-buttons"><calcite-button .appearance=${e ? "transparent" : "outline"} .kind=${e ? "neutral" : void 0} @click=${() => this.arcgisCancel.emit()}>${r ? i.cancelButton : i.skipButton}</calcite-button><calcite-button appearance=solid .iconEnd=${e ? "arrow-right" : void 0} .disabled=${e && (!t || this.selectionSubmitted)} @click=${this.submit}>${r ? i.confirmButton : i.submitButton}</calcite-button></div>`;
|
|
43
|
+
const e = this.message ?? "", i = d.parse(e, { async: !1 });
|
|
44
|
+
return w.sanitize(i);
|
|
72
45
|
}
|
|
73
46
|
_renderEntityInterrupt(e) {
|
|
74
|
-
const { _messages: i, selectedReference: n } =
|
|
75
|
-
return
|
|
76
|
-
!this.selectionSubmitted && (!
|
|
77
|
-
}} ${
|
|
47
|
+
const { _messages: i, selectedReference: s } = this, { entityType: n, searchTerm: m, picker: r } = e;
|
|
48
|
+
return t`<div class="interrupt-container entity-interrupt"><div class="entity-heading"><calcite-icon class="entity-heading-icon" .icon=${n === "user" ? "user" : n === "group" ? "group" : "file"} scale=m></calcite-icon><div class="entity-heading-content"><span class="entity-eyebrow">${i.titleInput}</span><div class="interrupt-message entity-question">${v(this._renderMessageContent())}</div></div></div>${this.portal && c(this.requestKey, t`<arcgis-portal-entity-picker class="interrupt-picker" .portal=${this.portal} .entityType=${n} .initialSearchTerm=${m ?? ""} .query=${r?.query} .initialScope=${r?.initialScope ?? "all"} .scopeSelectionDisabled=${r?.scopeSelectionDisabled ?? !1} mode=inline icon=search .selected=${this.selectedEntity} @arcgisSelectionChange=${({ detail: a }) => {
|
|
49
|
+
!this.selectionSubmitted && (!a || a.entityType === this.entityRequest?.entityType) && (this.selectedEntity = a);
|
|
50
|
+
}} ${p(this.pickerRef)}></arcgis-portal-entity-picker>`) || ""}<div class="interrupt-actions"><div class="entity-selection" role=status>${s && t`<calcite-icon icon=check-circle scale=s></calcite-icon><span class="entity-selection-label" title=${s.label ?? g}>${s.label}</span><calcite-button appearance=transparent .disabled=${this.selectionSubmitted} icon-start=x kind=neutral .label=${this.pickerMessages.clearSelection} scale=s @click=${() => {
|
|
78
51
|
this.selectedEntity = null, this.pickerRef.value?.setFocus();
|
|
79
|
-
}}></calcite-button>` || ""}</div
|
|
52
|
+
}}></calcite-button>` || ""}</div><div class="interrupt-buttons"><calcite-button appearance=transparent kind=neutral @click=${() => this.arcgisCancel.emit()}>${i.cancelButton}</calcite-button><calcite-button appearance=solid icon-end=arrow-right .disabled=${!s || this.selectionSubmitted} @click=${this.submitEntitySelection}>${i.submitButton}</calcite-button></div></div></div>`;
|
|
80
53
|
}
|
|
81
54
|
render() {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return s`<div class="interrupt-container"><calcite-notice open kind=neutral width=full><div slot=title>${i === "boolean-choice" ? e.titleConfirm : e.titleInput}</div><div slot=message class="interrupt-message">${a(this._renderMessageContent())}</div></calcite-notice>${this._renderInterruptInput()}<div class="interrupt-actions">${this._renderInterruptButtons()}</div></div>`;
|
|
55
|
+
return this.entityRequest ? this._renderEntityInterrupt(this.entityRequest) : t`<div class="interrupt-container">${c(this.requestKey, t`<arcgis-assistant-interrupt .type=${this.type} .message=${this.message} .options=${this.options} .showOtherOption=${this.showOtherOption} @arcgisSubmit=${(e) => {
|
|
56
|
+
e.stopPropagation(), this.arcgisSubmit.emit(e.detail);
|
|
57
|
+
}} ${p(this.interruptRef)}>${this.type !== "boolean-choice" && t`<calcite-button slot=footer-actions appearance=outline @click=${() => this.arcgisCancel.emit()}>${this._messages.cancelButton}</calcite-button>` || ""}</arcgis-assistant-interrupt>`)}</div>`;
|
|
86
58
|
}
|
|
87
59
|
}
|
|
88
|
-
|
|
60
|
+
h("arcgis-portal-ai-assistant-interrupt", x);
|
|
89
61
|
export {
|
|
90
62
|
x as ArcgisPortalAiAssistantInterrupt
|
|
91
63
|
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import "@esri/calcite-components/components/calcite-list";
|
|
2
|
-
import "@esri/calcite-components/components/calcite-list-item";
|
|
3
|
-
import "@esri/calcite-components/components/calcite-input";
|
|
4
|
-
import "@esri/calcite-components/components/calcite-button";
|
|
5
1
|
import "@esri/calcite-components/components/calcite-icon";
|
|
6
2
|
import "../arcgis-portal-entity-picker/index.js";
|
|
7
|
-
import "@esri/calcite-components/components/calcite-
|
|
3
|
+
import "@esri/calcite-components/components/calcite-button";
|
|
4
|
+
import "@arcgis/ai-components/components/arcgis-assistant-interrupt";
|
|
8
5
|
export * from "./customElement.js";
|
|
@@ -575,7 +575,7 @@ class Ie extends q {
|
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
renderBucket({ icon: t, label: e, description: s, link: i, additionalContent: r, dangerIcon: l = !1, bucket: c }) {
|
|
578
|
-
return d`<calcite-block class=${S({ "single-item-bucket": (this.items.length ? this.items : this.itemIds).length === 1 })} scale=l expanded><div class="bucket__content"><calcite-icon class=${S({ bucket__icon: !0, "bucket__icon--danger": l })} scale=l .icon=${t}></calcite-icon><div class="bucket__details"><div class="bucket__header"><span class="bucket__label">${e}</span><span>${this.renderBucketItems(c)}</span></div>${s && d`<span class="bucket__description">${s}</span>` || ""}${i && d`<div class="bucket__link"><calcite-link .href=${i.href} target=_blank icon-
|
|
578
|
+
return d`<calcite-block class=${S({ "single-item-bucket": (this.items.length ? this.items : this.itemIds).length === 1 })} scale=l expanded><div class="bucket__content"><calcite-icon class=${S({ bucket__icon: !0, "bucket__icon--danger": l })} scale=l .icon=${t}></calcite-icon><div class="bucket__details"><div class="bucket__header"><span class="bucket__label">${e}</span><span>${this.renderBucketItems(c)}</span></div>${s && d`<span class="bucket__description">${s}</span>` || ""}${i && d`<div class="bucket__link"><calcite-link .href=${i.href} target=_blank icon-end=launch>${i.text ?? this.messages.moreInfo}</calcite-link></div>` || ""}${r}</div></div></calcite-block>`;
|
|
579
579
|
}
|
|
580
580
|
renderBucketItems(t = []) {
|
|
581
581
|
return this.renderItemLinks(t.map(({ item: e }) => e));
|
|
@@ -135,8 +135,6 @@ export abstract class ArcGISPortalNavigation extends LitElement {
|
|
|
135
135
|
cancel: string;
|
|
136
136
|
delete: string;
|
|
137
137
|
noAppResults: string;
|
|
138
|
-
noAppResultsDescriptionOrg: string;
|
|
139
|
-
noAppsDescriptionPublic: string;
|
|
140
138
|
noAppsAvailable: string;
|
|
141
139
|
noAppsAvailableDescription: string;
|
|
142
140
|
new: string;
|
|
@@ -335,8 +333,6 @@ export abstract class ArcGISPortalNavigation extends LitElement {
|
|
|
335
333
|
cancel: string;
|
|
336
334
|
delete: string;
|
|
337
335
|
noAppResults: string;
|
|
338
|
-
noAppResultsDescriptionOrg: string;
|
|
339
|
-
noAppsDescriptionPublic: string;
|
|
340
336
|
noAppsAvailable: string;
|
|
341
337
|
noAppsAvailableDescription: string;
|
|
342
338
|
new: string;
|