@arcgis/ai-components 5.1.0-next.127 → 5.1.0-next.129
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/{IUAAPMMA.js → 32S235WW.js} +1 -1
- package/dist/cdn/{5H7BG46R.js → 3352JWU3.js} +2 -2
- package/dist/cdn/{BOP6HXCW.js → 43BXVTTX.js} +1 -1
- package/dist/cdn/{7J26XD64.js → 45WQFXC6.js} +1 -1
- package/dist/cdn/5BWAWCMA.js +2 -0
- package/dist/cdn/{PYVVZRRJ.js → 6HIZCLMG.js} +1 -1
- package/dist/cdn/6MS2XN27.js +2 -0
- package/dist/cdn/7UAGCI6W.js +166 -0
- package/dist/cdn/{J2F4YIQI.js → COFOUGFJ.js} +2 -2
- package/dist/cdn/CY2AOS7J.js +2 -0
- package/dist/cdn/DPCBYJAM.js +2 -0
- package/dist/cdn/{M5ZB2XU3.js → DQIMHH5V.js} +1 -1
- package/dist/cdn/DXWRFET6.js +2 -0
- package/dist/cdn/{KX7OG7DL.js → E4TOTVRI.js} +5 -3
- package/dist/cdn/{3GJNNEHV.js → EX6NWXUF.js} +1 -1
- package/dist/cdn/F2QU4HAK.js +2 -0
- package/dist/cdn/H4ENPGSI.js +2 -0
- package/dist/cdn/{6QA7CIBO.js → HFQQORS4.js} +1 -1
- package/dist/cdn/HWSIV5DK.js +2 -0
- package/dist/cdn/{XLFCW5OF.js → IFB2ASIW.js} +1 -1
- package/dist/cdn/{KLIA4JYQ.js → LYJY5QUA.js} +1 -1
- package/dist/cdn/M7C6Y752.js +2 -0
- package/dist/cdn/{FXWTEFFD.js → MEM7FGVU.js} +1 -1
- package/dist/cdn/{MLQKBQSG.js → P5M2HNJ7.js} +1 -1
- package/dist/cdn/{QEYLJYK7.js → P7EGIU6K.js} +1 -1
- package/dist/cdn/{7XQKBW4A.js → PW4XPFSA.js} +1 -1
- package/dist/cdn/{M56MGI7M.js → SOCUKQVO.js} +1 -1
- package/dist/cdn/TOYQ22PR.js +2 -0
- package/dist/cdn/VVG5FDCY.js +2 -0
- package/dist/cdn/{4SZDSAFW.js → ZR5WU3UB.js} +1 -1
- package/dist/cdn/ZSLJX22Z.js +3 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +1099 -1055
- package/dist/chunks/arcgisKnowledgeGraph.js +82 -65
- package/dist/chunks/slottableRequestUtils.js +3 -7
- package/dist/components/arcgis-assistant/customElement.d.ts +15 -0
- package/dist/components/arcgis-assistant/customElement.js +227 -127
- package/dist/components/arcgis-assistant/index.js +2 -3
- package/dist/components/arcgis-assistant/types.d.ts +14 -1
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +2 -1
- package/dist/components/arcgis-assistant-chat/customElement.js +7 -7
- package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
- package/dist/components/arcgis-assistant-interrupt/customElement.js +13 -9
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +20 -0
- package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
- package/dist/components/arcgis-assistant-message/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-message/customElement.js +28 -26
- package/dist/components/arcgis-assistant-message/index.js +2 -0
- package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
- package/dist/components/arcgis-assistant-message-block/index.js +1 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +4 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -8
- package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
- package/dist/components/arcgis-assistant-user-message/customElement.js +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/loader.js +6 -5
- package/dist/orchestrator/registry/agentRegistry.d.ts +33 -0
- package/dist/types/lumina.d.ts +6 -5
- package/dist/types/preact.d.ts +6 -5
- package/dist/types/react.d.ts +6 -5
- package/dist/types/stencil.d.ts +6 -5
- package/dist/utils/index.d.ts +2 -1
- package/package.json +5 -5
- package/dist/cdn/2TKDD7IY.js +0 -2
- package/dist/cdn/7VV6WZYQ.js +0 -166
- package/dist/cdn/7Z6WK75Y.js +0 -3
- package/dist/cdn/ASFDOICU.js +0 -2
- package/dist/cdn/EUNEQNYC.js +0 -2
- package/dist/cdn/GHPDN2L7.js +0 -2
- package/dist/cdn/KDUG6AWZ.js +0 -2
- package/dist/cdn/MM4TFFXX.js +0 -2
- package/dist/cdn/RBLFCUDD.js +0 -2
- package/dist/cdn/SRNPZKME.js +0 -2
- package/dist/cdn/YGW7TUNX.js +0 -2
- package/dist/cdn/ZTRICLZY.js +0 -2
|
@@ -16,6 +16,8 @@ export abstract class ArcgisAssistantChatEntry extends LitElement {
|
|
|
16
16
|
protected _messages: { entryPlaceholder: string; } & T9nMeta<{ entryPlaceholder: string; }>;
|
|
17
17
|
/** @default false */
|
|
18
18
|
accessor awaitingResponse: boolean;
|
|
19
|
+
/** @default false */
|
|
20
|
+
accessor disabled: boolean;
|
|
19
21
|
accessor entryPlaceholder: string | undefined;
|
|
20
22
|
/** @default "" */
|
|
21
23
|
accessor inputValue: string;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { createRef as
|
|
6
|
-
import { u as
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { c as d } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as p, html as c } from "lit";
|
|
4
|
+
import { LitElement as f, createEvent as l, safeClassMap as g } from "@arcgis/lumina";
|
|
5
|
+
import { createRef as u, ref as h } from "lit/directives/ref.js";
|
|
6
|
+
import { u as m } from "../../chunks/useT9n.js";
|
|
7
|
+
import y from "@arcgis/core/core/Collection.js";
|
|
8
|
+
import { classes as v } from "@arcgis/toolkit/dom";
|
|
9
|
+
const b = p`:host{--calcite-text-area-border-color: var(--calcite-color-border-1);--calcite-text-area-divider-color: var(--calcite-color-border-1);--calcite-text-area-corner-radius: var(--calcite-border-radius)}.input-container{display:flex;flex-direction:column}.footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.status-indicator{width:9px;height:9px;border-radius:100%;background-color:var(--calcite-color-status-success)}.status-indicator[data-status=working]{background-color:var(--calcite-color-status-warning)}.status-indicator[data-status=error]{background-color:var(--calcite-color-status-danger)}.status-text{text-transform:capitalize}.focused{--calcite-text-area-shadow: var(--calcite-shadow-sm)}`;
|
|
10
|
+
class w extends f {
|
|
10
11
|
constructor() {
|
|
11
|
-
super(...arguments), this.#s =
|
|
12
|
+
super(...arguments), this.#s = u(), this.#i = u(), this.#t = -1, this.#e = "", this.#a = (t) => {
|
|
12
13
|
t.stopPropagation();
|
|
13
14
|
const s = t.detail;
|
|
14
15
|
this._setDraftValue(s.value), s.focusInput && this.#s.value && this.#s.value.setFocus();
|
|
15
16
|
}, this.#r = (t) => {
|
|
16
17
|
const s = t.target.value ?? "";
|
|
17
18
|
this.inputValue = s, this.#e = s;
|
|
18
|
-
}, this._messages =
|
|
19
|
+
}, this._messages = m({ blocking: !0 }), this._inFocus = !1, this.keyboardShortcutsDisabled = !1, this.awaitingResponse = !1, this.inputValue = "", this.voiceInputEnabled = !1, this.messages = new y([]), this.disabled = !1, this.arcgisCancel = l(), this.arcgisSubmit = l();
|
|
19
20
|
}
|
|
20
21
|
static {
|
|
21
|
-
this.properties = { _userMessages: 16, keyboardShortcutsDisabled: 5, entryPlaceholder: 1, awaitingResponse: 5, inputValue: 1, status: 1, voiceInputEnabled: 5, messages: 0 };
|
|
22
|
+
this.properties = { _inFocus: 16, _userMessages: 16, keyboardShortcutsDisabled: 5, entryPlaceholder: 1, awaitingResponse: 5, inputValue: 1, status: 1, voiceInputEnabled: 5, messages: 0, disabled: 5 };
|
|
22
23
|
}
|
|
23
24
|
static {
|
|
24
|
-
this.styles =
|
|
25
|
+
this.styles = b;
|
|
25
26
|
}
|
|
26
27
|
#s;
|
|
27
28
|
#i;
|
|
@@ -54,8 +55,8 @@ class v extends g {
|
|
|
54
55
|
const e = this._userMessages;
|
|
55
56
|
if (e.length === 0)
|
|
56
57
|
return;
|
|
57
|
-
const r = a.value ?? "",
|
|
58
|
-
if (!(i == null ||
|
|
58
|
+
const r = a.value ?? "", o = a.shadowRoot?.querySelector("textarea"), i = o?.selectionStart, n = o?.selectionEnd;
|
|
59
|
+
if (!(i == null || n == null) && !(i !== n || t === "up" && i !== 0 || t === "down" && i !== r.length)) {
|
|
59
60
|
if (t === "up") {
|
|
60
61
|
this.#t === -1 ? (this.#e = r, this.#t = e.length - 1) : this.#t = Math.max(0, this.#t - 1), this.inputValue = e[this.#t] ?? "", s.preventDefault();
|
|
61
62
|
return;
|
|
@@ -66,13 +67,19 @@ class v extends g {
|
|
|
66
67
|
_setDraftValue(t) {
|
|
67
68
|
this.inputValue = t, this.#t = -1, this.#e = t;
|
|
68
69
|
}
|
|
70
|
+
_onFocusIn() {
|
|
71
|
+
this._inFocus = !0;
|
|
72
|
+
}
|
|
73
|
+
_onFocusOut() {
|
|
74
|
+
this._inFocus = !1;
|
|
75
|
+
}
|
|
69
76
|
render() {
|
|
70
|
-
return
|
|
77
|
+
return c`<div class="input-container"><calcite-text-area class=${g(v({ focused: this._inFocus }))} .value=${this.inputValue} .placeholder=${this.entryPlaceholder ?? this._messages.entryPlaceholder} resize=vertical @calciteTextAreaInput=${this.#r} .disabled=${this.disabled} @keydown=${async (t) => {
|
|
71
78
|
t.altKey || t.ctrlKey || t.metaKey || t.shiftKey || this.keyboardShortcutsDisabled || (t.key === "Enter" ? (t.preventDefault(), await this.submitMessage()) : t.key === "ArrowUp" ? await this._navigateHistory("up", t) : t.key === "ArrowDown" && await this._navigateHistory("down", t));
|
|
72
|
-
}} ${h(this.#s)}><div slot=footer-start class="footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="footer-end">${this.voiceInputEnabled ?
|
|
79
|
+
}} @focusin=${this._onFocusIn} @focusout=${this._onFocusOut} ${h(this.#s)}><div slot=footer-start class="footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="footer-end">${this.voiceInputEnabled ? c`<arcgis-assistant-speech-input .awaitingResponse=${this.awaitingResponse} .inputValue=${this.inputValue} ${h(this.#i)}></arcgis-assistant-speech-input>` : null}<slot name=entry-actions-end></slot></div></calcite-text-area></div>`;
|
|
73
80
|
}
|
|
74
81
|
}
|
|
75
|
-
|
|
82
|
+
d("arcgis-assistant-chat-entry", w);
|
|
76
83
|
export {
|
|
77
|
-
|
|
84
|
+
w as ArcgisAssistantChatEntry
|
|
78
85
|
};
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as a } from "../../chunks/runtime.js";
|
|
3
|
-
import { html as e } from "lit";
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { u as
|
|
6
|
-
|
|
3
|
+
import { css as c, html as e } from "lit";
|
|
4
|
+
import { LitElement as l, createEvent as i } from "@arcgis/lumina";
|
|
5
|
+
import { u as r } from "../../chunks/useT9n.js";
|
|
6
|
+
const n = c`:host{width:100%;padding:var(--calcite-spacing-md);background:var(--calcite-panel-background-color, var(--calcite-color-background))}calcite-panel{border-radius:var(--calcite-dialog-corner-radius, var(--calcite-corner-radius-sm));border:0 solid var(--calcite-color-brand);border-block-start-width:4px;box-shadow:var(--calcite-shadow-md);width:100%;--calcite-panel-border-color: none}.interrupt-content{padding:0 var(--calcite-spacing-md);background:var(--calcite-color-foreground-1)}`;
|
|
7
|
+
class o extends l {
|
|
7
8
|
constructor() {
|
|
8
|
-
super(...arguments), this.#t = [], this._messages =
|
|
9
|
+
super(...arguments), this.#t = [], this._messages = r({ blocking: !0 }), this.arcgisCancel = i(), this.arcgisSubmit = i();
|
|
9
10
|
}
|
|
10
11
|
static {
|
|
11
12
|
this.properties = { type: 1, message: 1, options: 0 };
|
|
12
13
|
}
|
|
14
|
+
static {
|
|
15
|
+
this.styles = n;
|
|
16
|
+
}
|
|
13
17
|
#t;
|
|
14
18
|
_renderInterruptOptions() {
|
|
15
19
|
switch (this.type) {
|
|
16
20
|
case "single-select":
|
|
17
21
|
return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${(t) => this.#t = t.target.selectedItems[0]?.value}>${this.options?.map((t) => e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;
|
|
18
22
|
case "multi-select":
|
|
19
|
-
return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${(t) => this.#t = t.target.selectedItems.map((
|
|
23
|
+
return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${(t) => this.#t = t.target.selectedItems.map((s) => s.value)}>${this.options?.map((t) => e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;
|
|
20
24
|
case "boolean-choice":
|
|
21
25
|
return null;
|
|
22
26
|
case "text-input":
|
|
@@ -24,10 +28,10 @@ class n extends c {
|
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
render() {
|
|
27
|
-
return e`<calcite-panel .description=${this.message}>${this._renderInterruptOptions()}
|
|
31
|
+
return e`<calcite-panel .description=${this.message}><div class="interrupt-content">${this._renderInterruptOptions()}</div><calcite-button slot=footer-end appearance=outline @click=${() => this.arcgisCancel.emit()}>${this._messages.cancelButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${() => this.arcgisSubmit.emit(this.type === "boolean-choice" ? !0 : this.#t)}>${this._messages.submitButtonLabel}</calcite-button></calcite-panel>`;
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
|
-
a("arcgis-assistant-interrupt",
|
|
34
|
+
a("arcgis-assistant-interrupt", o);
|
|
31
35
|
export {
|
|
32
|
-
|
|
36
|
+
o as ArcgisAssistantInterrupt
|
|
33
37
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { c as r } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as l, html as t } from "lit";
|
|
4
|
+
import { LitElement as a } from "@arcgis/lumina";
|
|
5
|
+
const n = l`.interrupt-details ul{margin-block:var(--calcite-spacing-xxs) 0;padding-inline-start:var(--calcite-spacing-xxl)}.interrupt-details li{margin-block:0}.interrupts-container{display:flex;flex-direction:column;gap:var(--calcite-spacing-lg)}`;
|
|
6
|
+
class c extends a {
|
|
7
|
+
static {
|
|
8
|
+
this.properties = { interrupts: 0 };
|
|
9
|
+
}
|
|
10
|
+
static {
|
|
11
|
+
this.styles = n;
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return this.interrupts?.length ? t`<calcite-block collapsible expanded heading="Assistant Questions"><div class="interrupts-container">${this.interrupts?.map(({ interrupt: s, response: i }) => t`<div class="interrupt-details"><div>Q: ${s.message}</div><ul>${Array.isArray(i) ? i.length ? i.map((e) => t`<li>${e}</li>`) : t`<li>(Question skipped)</li>` : t`<li>${i != null ? String(i) : "(Question skipped)"}</li>`}</ul></div>`)}</div></calcite-block>` : null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
r("arcgis-assistant-interrupt-preview", c);
|
|
18
|
+
export {
|
|
19
|
+
c as ArcgisAssistantInterruptPreview
|
|
20
|
+
};
|
|
@@ -7,6 +7,8 @@ import type { AssistantMessage } from "../arcgis-assistant/types.js";
|
|
|
7
7
|
* Offers a reusable assistant-message layout with icon, content, and footer slot regions.
|
|
8
8
|
*/
|
|
9
9
|
export abstract class ArcgisAssistantMessage extends LitElement {
|
|
10
|
+
/** @default false */
|
|
11
|
+
accessor assistantAvatarEnabled: boolean;
|
|
10
12
|
/** @default false */
|
|
11
13
|
accessor copyEnabled: boolean;
|
|
12
14
|
/** @default false */
|
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { useSlottableRequest as
|
|
6
|
-
import { g as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}), e;
|
|
2
|
+
import { c as o } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as l, html as e } from "lit";
|
|
4
|
+
import { LitElement as c, nothing as d } from "@arcgis/lumina";
|
|
5
|
+
import { useSlottableRequest as g } from "@arcgis/lumina/controllers";
|
|
6
|
+
import { g as r } from "../../chunks/slottableRequestUtils.js";
|
|
7
|
+
const m = l`:host{display:block;container-type:inline-size}.container{display:flex;flex-direction:column;align-items:flex-start;gap:var(--calcite-spacing-sm);width:100%;text-align:left}.icon{padding:var(--calcite-spacing-sm);border-radius:var(--calcite-spacing-xl);background:var(--calcite-color-brand);color:var(--calcite-color-foreground-1)}.content-container{display:flex;flex:1;flex-direction:column;width:100%;gap:var(--calcite-spacing-md)}.content,.blocks{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm)}.block-pending{display:flex;justify-content:center;align-items:center;padding:var(--calcite-spacing-sm);background:linear-gradient(90deg,color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent),color-mix(in srgb,var(--calcite-color-foreground-3) 85%,transparent),color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent));background-size:200% 100%;animation:assistant-message-loading-shimmer 2s ease-in-out infinite;border-radius:var(--calcite-border-radius);min-height:100px}.message-error{font-style:italic}@container (min-width: 480px){.container{max-width:80%}}@keyframes assistant-message-loading-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.block-pending{animation:none}}`;
|
|
8
|
+
function b({ message: t }) {
|
|
9
|
+
const s = /* @__PURE__ */ new Map();
|
|
10
|
+
return t && t.blocks?.forEach((a, i) => {
|
|
11
|
+
if (!a.isPending) {
|
|
12
|
+
const n = r(t.id, i);
|
|
13
|
+
s.set(n, { data: { block: a, index: i, message: t }, name: "block", slotName: n });
|
|
14
|
+
}
|
|
15
|
+
}), s;
|
|
17
16
|
}
|
|
18
|
-
class
|
|
17
|
+
class p extends c {
|
|
19
18
|
constructor() {
|
|
20
|
-
super(...arguments), this.arcgisSlottableRequest =
|
|
19
|
+
super(...arguments), this.arcgisSlottableRequest = g(this, ["message"], b), this.feedbackEnabled = !1, this.logEnabled = !1, this.copyEnabled = !1, this.readAloudEnabled = !1, this.footerDisabled = !1, this.assistantAvatarEnabled = !1;
|
|
21
20
|
}
|
|
22
21
|
static {
|
|
23
|
-
this.properties = { feedbackEnabled: 5, logEnabled: 5, copyEnabled: 5, readAloudEnabled: 5, footerDisabled: 5, message: 0 };
|
|
22
|
+
this.properties = { _isStreaming: 16, feedbackEnabled: 5, logEnabled: 5, copyEnabled: 5, readAloudEnabled: 5, footerDisabled: 5, message: 0, assistantAvatarEnabled: 5 };
|
|
24
23
|
}
|
|
25
24
|
static {
|
|
26
|
-
this.styles =
|
|
25
|
+
this.styles = m;
|
|
26
|
+
}
|
|
27
|
+
get _isStreaming() {
|
|
28
|
+
return !!this.message?.isStreaming;
|
|
27
29
|
}
|
|
28
30
|
_renderContent() {
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
31
|
+
const s = this.message, a = s?.id;
|
|
32
|
+
if (a)
|
|
33
|
+
return e`<div class="content"><arcgis-assistant-interrupt-preview .interrupts=${this.message?.interrupts}></arcgis-assistant-interrupt-preview>${s.blocks?.length ? e`<div class="blocks">${s.blocks.map((i, n) => i.isPending && i.type !== "text" ? e`<div class="block-pending"></div>` : e`<slot name=${r(a, n) ?? d}></slot>`)}</div>` : null}</div>`;
|
|
32
34
|
}
|
|
33
35
|
_renderFooter() {
|
|
34
|
-
return
|
|
36
|
+
return e`<arcgis-assistant-message-footer .message=${this.message} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled}></arcgis-assistant-message-footer>`;
|
|
35
37
|
}
|
|
36
38
|
render() {
|
|
37
|
-
return
|
|
39
|
+
return e`<div class="container">${this.assistantAvatarEnabled ? e`<slot name=icon><calcite-icon icon=effects class="icon" scale=s></calcite-icon></slot>` : null}<div class="content-container"><slot name=content>${this._renderContent()}</slot>${this.message?.error ? e`<div class="message-error">${this.message.error}</div>` : null}${this._isStreaming ? e`<div class="streaming-indicator"><calcite-loader label=loading inline></calcite-loader></div>` : null}${!this.footerDisabled && !this._isStreaming ? e`<slot name=footer>${this._renderFooter()}</slot>` : null}</div></div>`;
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
|
-
|
|
42
|
+
o("arcgis-assistant-message", p);
|
|
41
43
|
export {
|
|
42
|
-
|
|
44
|
+
p as ArcgisAssistantMessage
|
|
43
45
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "../arcgis-assistant-interrupt-preview/index.js";
|
|
1
2
|
import "../arcgis-assistant-message-footer/index.js";
|
|
2
3
|
import "@esri/calcite-components/components/calcite-icon";
|
|
4
|
+
import "@esri/calcite-components/components/calcite-loader";
|
|
3
5
|
export * from "./customElement.js";
|
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as i, html as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
const
|
|
6
|
-
class
|
|
2
|
+
import { c as n } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as i, html as r } from "lit";
|
|
4
|
+
import { LitElement as o } from "@arcgis/lumina";
|
|
5
|
+
const p = i`:host{display:block}`;
|
|
6
|
+
class c extends o {
|
|
7
7
|
static {
|
|
8
8
|
this.properties = { block: 0 };
|
|
9
9
|
}
|
|
10
10
|
static {
|
|
11
|
-
this.styles =
|
|
11
|
+
this.styles = p;
|
|
12
12
|
}
|
|
13
13
|
_renderSuggestedPrompts(s) {
|
|
14
14
|
if (s.type !== "suggested-prompts")
|
|
15
15
|
return null;
|
|
16
|
-
const t = s.data?.prompts, e = Array.isArray(t) ? t.filter((
|
|
17
|
-
return e.length ?
|
|
16
|
+
const t = s.data?.prompts, e = Array.isArray(t) ? t.filter((a) => typeof a == "string") : [];
|
|
17
|
+
return e.length ? r`<arcgis-assistant-suggested-prompts .prompts=${e}></arcgis-assistant-suggested-prompts>` : null;
|
|
18
18
|
}
|
|
19
19
|
_renderBlock(s) {
|
|
20
|
-
|
|
20
|
+
switch (s.type) {
|
|
21
|
+
case "suggested-prompts":
|
|
22
|
+
return this._renderSuggestedPrompts(s);
|
|
23
|
+
case "text":
|
|
24
|
+
return r`<arcgis-assistant-message-text .content=${s.data?.content}></arcgis-assistant-message-text>`;
|
|
25
|
+
default:
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
21
28
|
}
|
|
22
29
|
render() {
|
|
23
30
|
return this.block ? this._renderBlock(this.block) : null;
|
|
24
31
|
}
|
|
25
32
|
}
|
|
26
|
-
|
|
33
|
+
n("arcgis-assistant-message-block", c);
|
|
27
34
|
export {
|
|
28
|
-
|
|
35
|
+
c as ArcgisAssistantMessageBlock
|
|
29
36
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
|
+
import type { AssistantMessage } from "../arcgis-assistant/types.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Shows in-progress assistant response UI. Use it to display thinking or loading state while work is running.
|
|
6
7
|
* Offers a default loading message shell with icon/content slot overrides.
|
|
7
8
|
*/
|
|
8
9
|
export abstract class ArcgisAssistantMessageLoading extends LitElement {
|
|
10
|
+
/** @default false */
|
|
11
|
+
accessor assistantAvatarEnabled: boolean;
|
|
12
|
+
accessor interrupts: AssistantMessage["interrupts"] | undefined;
|
|
9
13
|
/** @default false */
|
|
10
14
|
accessor loading: boolean;
|
|
11
15
|
/** @default "" */
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as e, html as
|
|
2
|
+
import { c as s } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as e, html as a } from "lit";
|
|
4
4
|
import { LitElement as i } from "@arcgis/lumina";
|
|
5
5
|
const t = e`:host{display:contents}.icon{padding:var(--calcite-spacing-sm);border-radius:var(--calcite-spacing-xl);background:var(--calcite-color-brand);color:var(--calcite-color-foreground-1)}.loading-container{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);padding:0 var(--calcite-spacing-sm)}.loading{display:flex;align-items:center;gap:var(--calcite-spacing-sm)}.text{font-style:italic;word-wrap:break-word;word-break:break-all;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical}.skeleton-block{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);width:100%}.skeleton-text{display:block;height:.95em;border-radius:var(--calcite-border-radius);background:linear-gradient(90deg,color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent),color-mix(in srgb,var(--calcite-color-foreground-3) 85%,transparent),color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent));background-size:200% 100%;animation:assistant-message-loading-shimmer 1.2s ease-in-out infinite;width:85%}.skeleton-text:last-child{width:70%}@keyframes assistant-message-loading-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.skeleton-text{animation:none}}`;
|
|
6
|
-
class
|
|
6
|
+
class n extends i {
|
|
7
7
|
constructor() {
|
|
8
|
-
super(...arguments), this.loading = !1, this.loadingMessage = "";
|
|
8
|
+
super(...arguments), this.loading = !1, this.loadingMessage = "", this.assistantAvatarEnabled = !1;
|
|
9
9
|
}
|
|
10
10
|
static {
|
|
11
|
-
this.properties = { loading: 5, loadingMessage: 1 };
|
|
11
|
+
this.properties = { loading: 5, loadingMessage: 1, assistantAvatarEnabled: 5, interrupts: 0 };
|
|
12
12
|
}
|
|
13
13
|
static {
|
|
14
14
|
this.styles = t;
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
return this.loading ?
|
|
17
|
+
return this.loading ? a`<arcgis-assistant-message footer-disabled>${this.assistantAvatarEnabled ? a`<slot name=icon slot=icon><calcite-icon class="icon" icon=effects scale=s></calcite-icon></slot>` : null}<slot name=content slot=content><arcgis-assistant-interrupt-preview .interrupts=${this.interrupts}></arcgis-assistant-interrupt-preview><div class="loading-container"><div class="loading"><calcite-loader label=loading inline></calcite-loader><div class="text">${this.loadingMessage}</div></div><div class="skeleton-block"><span class="skeleton-text"></span><span class="skeleton-text"></span></div></div></slot></arcgis-assistant-message>` : null;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
s("arcgis-assistant-message-loading", n);
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
n as ArcgisAssistantMessageLoading
|
|
23
23
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as i, html as
|
|
2
|
+
import { c as s } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as i, html as e } from "lit";
|
|
4
4
|
import { LitElement as r, createEvent as l } from "@arcgis/lumina";
|
|
5
|
-
import { u as
|
|
6
|
-
const
|
|
5
|
+
import { u as a } from "../../chunks/useT9n.js";
|
|
6
|
+
const c = i`:host{display:block;max-width:100%}.group{max-width:100%}.prompt{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;cursor:pointer;font-weight:var(--calcite-font-weight-regular)}calcite-chip{max-width:100%}`;
|
|
7
7
|
class o extends r {
|
|
8
8
|
constructor() {
|
|
9
|
-
super(...arguments), this._messages =
|
|
9
|
+
super(...arguments), this._messages = a({ blocking: !0 }), this.prompts = [], this.arcgisPromptSelect = l();
|
|
10
10
|
}
|
|
11
11
|
static {
|
|
12
12
|
this.properties = { label: 1, prompts: 0 };
|
|
13
13
|
}
|
|
14
14
|
static {
|
|
15
|
-
this.styles =
|
|
15
|
+
this.styles = c;
|
|
16
16
|
}
|
|
17
17
|
_emitPromptSelect(t) {
|
|
18
18
|
this.arcgisPromptSelect.emit({ prompt: t });
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
return this.prompts.length ?
|
|
21
|
+
return this.prompts.length ? e`<calcite-chip-group class="group" .label=${this.label ?? this._messages.suggestedPromptsLabel}>${this.prompts.map((t) => e`<calcite-chip .value=${t} .label=${t} appearance=outline-fill kind=brand @calciteChipSelect=${() => this._emitPromptSelect(t)}><div class="prompt">${t}</div></calcite-chip>`)}</calcite-chip-group>` : null;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
s("arcgis-assistant-suggested-prompts", o);
|
|
25
25
|
export {
|
|
26
26
|
o as ArcgisAssistantSuggestedPrompts
|
|
27
27
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { c as t } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as e, html as s } from "lit";
|
|
4
4
|
import { LitElement as a } from "@arcgis/lumina";
|
|
5
|
-
const i = e`.container{display:flex;align-items:center;gap:var(--calcite-spacing-md);background:color-mix(in srgb,var(--calcite-color-brand)
|
|
5
|
+
const i = e`.container{display:flex;align-items:center;gap:var(--calcite-spacing-md);background:color-mix(in srgb,var(--calcite-color-brand) 15%,var(--calcite-color-foreground-1));color:var(--calcite-color-text-1);padding:var(--calcite-spacing-md);border-radius:var(--calcite-border-radius);width:fit-content;margin-left:auto;justify-content:flex-end}.avatar{display:flex;align-items:center;justify-content:center}@container (min-width: 480px){.container{max-width:80%}}`;
|
|
6
6
|
class r extends a {
|
|
7
7
|
static {
|
|
8
8
|
this.properties = { content: 1, user: 1, message: 0 };
|