@arcgis/ai-components 5.2.0-next.77 → 5.2.0-next.78
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/3LILAJUD.js +2 -0
- package/dist/cdn/{TYZ3FRGW.js → 3ORURUNE.js} +6 -6
- package/dist/cdn/4F7Y4RNW.js +2 -0
- package/dist/cdn/{B6CJG5UH.js → 6U4GTCLJ.js} +14 -14
- package/dist/cdn/ADJ63EDN.js +3 -0
- package/dist/cdn/ATFNWFKG.js +2 -0
- package/dist/cdn/{FZ4CURWW.js → BGD2CCRJ.js} +1 -1
- package/dist/cdn/{2SQKAJ73.js → BS3HNSXX.js} +1 -1
- package/dist/cdn/CZLLPKMS.js +2 -0
- package/dist/cdn/EBNVLMUU.js +2 -0
- package/dist/cdn/{GPZJANRQ.js → ERNYKCUJ.js} +1 -1
- package/dist/cdn/G5XE5D36.js +2 -0
- package/dist/cdn/{UB6PAQZ7.js → GAPKW32H.js} +1 -1
- package/dist/cdn/{U3XIDLHO.js → HPU6K67Y.js} +1 -1
- package/dist/cdn/{DOXBIASP.js → I7KCB7KE.js} +1 -1
- package/dist/cdn/{JSMNXHYG.js → IIIUSDQR.js} +1 -1
- package/dist/cdn/{EZYONVBU.js → J7OJABFU.js} +1 -1
- package/dist/cdn/LXQFE5PJ.js +2 -0
- package/dist/cdn/NLEBWLVV.js +2 -0
- package/dist/cdn/ORRMONGJ.js +2 -0
- package/dist/cdn/{GOKLRL6M.js → PBMQI4MV.js} +1 -1
- package/dist/cdn/{GZGDLURS.js → PKJY7FBV.js} +1 -1
- package/dist/cdn/QUMNJVKX.js +2 -0
- package/dist/cdn/{DUSILSNJ.js → XHGVCL22.js} +3 -3
- package/dist/cdn/XLHTQ7CF.js +2 -0
- package/dist/cdn/{H6IJRTHM.js → YWULKUQV.js} +1 -1
- package/dist/cdn/{RCFAXADI.js → YYSRYOHL.js} +1 -1
- package/dist/cdn/ZWBFTKHF.js +2 -0
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +52 -55
- package/dist/chunks/converterUtils.js +66 -48
- package/dist/components/arcgis-assistant/customElement.d.ts +30 -1
- package/dist/components/arcgis-assistant/customElement.js +133 -135
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.js +10 -11
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
- package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message/customElement.js +9 -8
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.js +11 -10
- package/dist/components/arcgis-assistant-message-text/customElement.js +4 -4
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-user-message/customElement.js +13 -10
- 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 +4 -4
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/package.json +5 -5
- package/dist/cdn/2GH3K5JP.js +0 -2
- package/dist/cdn/2Y4DTOGT.js +0 -2
- package/dist/cdn/3S5G5SIX.js +0 -2
- package/dist/cdn/5TI2F5XX.js +0 -2
- package/dist/cdn/DCSZPL7R.js +0 -2
- package/dist/cdn/FSGIG7UN.js +0 -2
- package/dist/cdn/GLBE7OW2.js +0 -2
- package/dist/cdn/KKLAQF3Z.js +0 -2
- package/dist/cdn/KLYNL2ZT.js +0 -2
- package/dist/cdn/LZP3OBKS.js +0 -3
- package/dist/cdn/OKMZQXBQ.js +0 -2
- package/dist/cdn/T4ECSHM7.js +0 -2
- package/dist/cdn/WSHWQDO2.js +0 -2
- package/dist/cdn/XRE5USHA.js +0 -2
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c
|
|
3
|
-
import { css as
|
|
2
|
+
import { c } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as a, html as e } from "lit";
|
|
4
4
|
import { LitElement as l, createEvent as s } from "@arcgis/lumina";
|
|
5
5
|
import { u as r } from "../../chunks/useT9n.js";
|
|
6
|
-
const n =
|
|
6
|
+
const n = a`:host{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
7
|
class o extends l {
|
|
8
8
|
constructor() {
|
|
9
|
-
super(...arguments), this
|
|
9
|
+
super(...arguments), this._messages = r({ blocking: !0 }), this._selectedOptions = [], this.arcgisCancel = s(), this.arcgisSubmit = s();
|
|
10
10
|
}
|
|
11
11
|
static {
|
|
12
|
-
this.properties = { type: 1, message: 1, options: 0 };
|
|
12
|
+
this.properties = { _selectedOptions: 16, type: 1, message: 1, options: 0 };
|
|
13
13
|
}
|
|
14
14
|
static {
|
|
15
15
|
this.styles = n;
|
|
16
16
|
}
|
|
17
|
-
#t;
|
|
18
17
|
_renderInterruptOptions() {
|
|
19
18
|
switch (this.type) {
|
|
20
19
|
case "single-select":
|
|
21
|
-
return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${(t) => this
|
|
20
|
+
return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${(t) => this._selectedOptions = t.target.selectedItems[0]?.value}>${this.options?.map((t) => e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;
|
|
22
21
|
case "multi-select":
|
|
23
|
-
return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${(t) => this
|
|
22
|
+
return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${(t) => this._selectedOptions = t.target.selectedItems.map((i) => i.value)}>${this.options?.map((t) => e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;
|
|
24
23
|
case "boolean-choice":
|
|
25
24
|
return null;
|
|
26
25
|
case "text-input":
|
|
27
|
-
return e`<calcite-input .label=${this._messages.enterTextLabel} @calciteInputInput=${(t) => this
|
|
26
|
+
return e`<calcite-input .label=${this._messages.enterTextLabel} @calciteInputInput=${(t) => this._selectedOptions = t.target.value}></calcite-input>`;
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
render() {
|
|
31
|
-
return e`<calcite-panel .description=${this.message}><div class="interrupt-content">${this._renderInterruptOptions()}</div
|
|
30
|
+
return e`<calcite-panel .description=${this.message}><div class="interrupt-content">${this._renderInterruptOptions()}</div>${this.type === "boolean-choice" ? e`<calcite-button slot=footer-end appearance=outline @click=${() => this.arcgisSubmit.emit(!1)}>${this._messages.declineButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${() => this.arcgisSubmit.emit(!0)}>${this._messages.approveButtonLabel}</calcite-button>` : e`<calcite-button slot=footer-end appearance=outline @click=${() => this.arcgisCancel.emit()}>${this._messages.cancelButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid .disabled=${!this._selectedOptions.length} @click=${() => this.arcgisSubmit.emit(this._selectedOptions)}>${this._messages.submitButtonLabel}</calcite-button>`}</calcite-panel>`;
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
|
-
|
|
33
|
+
c("arcgis-assistant-interrupt", o);
|
|
35
34
|
export {
|
|
36
35
|
o as ArcgisAssistantInterrupt
|
|
37
36
|
};
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as r } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { css as a, html as i } from "lit";
|
|
4
|
+
import { LitElement as l } from "@arcgis/lumina";
|
|
5
|
+
import { u as n } from "../../chunks/useT9n.js";
|
|
6
|
+
const c = a`.interrupt-details{word-wrap:break-word}.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)}`;
|
|
7
|
+
class p extends l {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments), this._messages = n({ blocking: !0 });
|
|
10
|
+
}
|
|
7
11
|
static {
|
|
8
12
|
this.properties = { interrupts: 0 };
|
|
9
13
|
}
|
|
10
14
|
static {
|
|
11
|
-
this.styles =
|
|
15
|
+
this.styles = c;
|
|
12
16
|
}
|
|
13
17
|
render() {
|
|
14
|
-
return this.interrupts?.length ?
|
|
18
|
+
return this.interrupts?.length ? i`<calcite-block collapsible expanded .heading=${this._messages.assistantQuestions}><div class="interrupts-container">${this.interrupts?.map(({ interrupt: s, response: t }) => i`<div class="interrupt-details"><div>Q: ${s.message}</div><ul>${Array.isArray(t) ? t.length ? t.map((e) => i`<li>${e}</li>`) : i`<li>${this._messages.questionSkipped}</li>` : i`<li>${t != null ? String(t) : this._messages.questionSkipped}</li>`}</ul></div>`)}</div></calcite-block>` : null;
|
|
15
19
|
}
|
|
16
20
|
}
|
|
17
|
-
r("arcgis-assistant-interrupt-preview",
|
|
21
|
+
r("arcgis-assistant-interrupt-preview", p);
|
|
18
22
|
export {
|
|
19
|
-
|
|
23
|
+
p as ArcgisAssistantInterruptPreview
|
|
20
24
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
3
|
import type { AssistantMessage } from "../arcgis-assistant/types.js";
|
|
4
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Renders a single assistant response message shell. Pass one assistant message object and let it host body and footer actions.
|
|
7
8
|
* Offers a reusable assistant-message layout with icon, content, and footer slot regions.
|
|
8
9
|
*/
|
|
9
10
|
export abstract class ArcgisAssistantMessage extends LitElement {
|
|
11
|
+
/** @internal */
|
|
12
|
+
protected _messages: { loadingLabel: string; } & T9nMeta<{ loadingLabel: string; }>;
|
|
10
13
|
/** @default false */
|
|
11
14
|
accessor assistantAvatarEnabled: boolean;
|
|
12
15
|
/** @default false */
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { c as o } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as l, html as e } from "lit";
|
|
4
4
|
import { LitElement as c, nothing as d } from "@arcgis/lumina";
|
|
5
|
-
import {
|
|
5
|
+
import { u as g } from "../../chunks/useT9n.js";
|
|
6
|
+
import { useSlottableRequest as m } from "@arcgis/lumina/controllers";
|
|
6
7
|
import { g as r } from "../../chunks/slottableRequestUtils.js";
|
|
7
|
-
const
|
|
8
|
+
const p = 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%;min-width:0;gap:var(--calcite-spacing-md)}.content{display:flex;flex-direction:column;min-width:0;gap:var(--calcite-spacing-sm)}.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
9
|
function b({ message: t }) {
|
|
9
10
|
const s = /* @__PURE__ */ new Map();
|
|
10
11
|
return t && t.blocks?.forEach((a, i) => {
|
|
@@ -14,15 +15,15 @@ function b({ message: t }) {
|
|
|
14
15
|
}
|
|
15
16
|
}), s;
|
|
16
17
|
}
|
|
17
|
-
class
|
|
18
|
+
class u extends c {
|
|
18
19
|
constructor() {
|
|
19
|
-
super(...arguments), this.
|
|
20
|
+
super(...arguments), this._messages = g({ blocking: !0 }), this.arcgisSlottableRequest = m(this, ["message"], b), this.feedbackEnabled = !1, this.logEnabled = !1, this.copyEnabled = !1, this.readAloudEnabled = !1, this.footerDisabled = !1, this.assistantAvatarEnabled = !1;
|
|
20
21
|
}
|
|
21
22
|
static {
|
|
22
23
|
this.properties = { _isStreaming: 16, feedbackEnabled: 5, logEnabled: 5, copyEnabled: 5, readAloudEnabled: 5, footerDisabled: 5, message: 0, assistantAvatarEnabled: 5 };
|
|
23
24
|
}
|
|
24
25
|
static {
|
|
25
|
-
this.styles =
|
|
26
|
+
this.styles = p;
|
|
26
27
|
}
|
|
27
28
|
get _isStreaming() {
|
|
28
29
|
return !!this.message?.isStreaming;
|
|
@@ -36,10 +37,10 @@ class p extends c {
|
|
|
36
37
|
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>`;
|
|
37
38
|
}
|
|
38
39
|
render() {
|
|
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
|
|
40
|
+
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=${this._messages.loadingLabel} inline></calcite-loader></div>` : null}${!this.footerDisabled && !this._isStreaming ? e`<slot name=footer>${this._renderFooter()}</slot>` : null}</div></div>`;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
o("arcgis-assistant-message",
|
|
43
|
+
o("arcgis-assistant-message", u);
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
u as ArcgisAssistantMessage
|
|
45
46
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
3
|
import type { AssistantMessage } from "../arcgis-assistant/types.js";
|
|
4
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Shows in-progress assistant response UI. Use it to display thinking or loading state while work is running.
|
|
7
8
|
* Offers a default loading message shell with icon/content slot overrides.
|
|
8
9
|
*/
|
|
9
10
|
export abstract class ArcgisAssistantMessageLoading extends LitElement {
|
|
11
|
+
/** @internal */
|
|
12
|
+
protected _messages: { loadingLabel: string; } & T9nMeta<{ loadingLabel: string; }>;
|
|
10
13
|
/** @default false */
|
|
11
14
|
accessor assistantAvatarEnabled: boolean;
|
|
12
15
|
accessor interrupts: AssistantMessage["interrupts"] | undefined;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { c as a } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as e, html as s } from "lit";
|
|
4
|
+
import { LitElement as t } from "@arcgis/lumina";
|
|
5
|
+
import { u as i } from "../../chunks/useT9n.js";
|
|
6
|
+
const n = 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}}`;
|
|
7
|
+
class o extends t {
|
|
7
8
|
constructor() {
|
|
8
|
-
super(...arguments), this.loading = !1, this.loadingMessage = "", this.assistantAvatarEnabled = !1;
|
|
9
|
+
super(...arguments), this._messages = i({ blocking: !0 }), this.loading = !1, this.loadingMessage = "", this.assistantAvatarEnabled = !1;
|
|
9
10
|
}
|
|
10
11
|
static {
|
|
11
12
|
this.properties = { loading: 5, loadingMessage: 1, assistantAvatarEnabled: 5, interrupts: 0 };
|
|
12
13
|
}
|
|
13
14
|
static {
|
|
14
|
-
this.styles =
|
|
15
|
+
this.styles = n;
|
|
15
16
|
}
|
|
16
17
|
render() {
|
|
17
|
-
return this.loading ?
|
|
18
|
+
return this.loading ? s`<arcgis-assistant-message .assistantAvatarEnabled=${this.assistantAvatarEnabled} footer-disabled>${this.assistantAvatarEnabled ? s`<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=${this._messages.loadingLabel} 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
19
|
}
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
a("arcgis-assistant-message-loading", o);
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
+
o as ArcgisAssistantMessageLoading
|
|
23
24
|
};
|
|
@@ -3,17 +3,17 @@ import { c as r } from "../../chunks/runtime.js";
|
|
|
3
3
|
import { css as i, html as t } from "lit";
|
|
4
4
|
import { LitElement as c } from "@arcgis/lumina";
|
|
5
5
|
import { unsafeHTML as a } from "lit/directives/unsafe-html.js";
|
|
6
|
-
import { a as
|
|
7
|
-
const
|
|
6
|
+
import { a as n, p as o } from "../../chunks/converterUtils.js";
|
|
7
|
+
const s = i`.container{color:var(--calcite-color-text-1);min-width:0}.content{min-width:0;overflow-wrap:anywhere}.content>*{margin:0}.content>*+*{margin-block-start:var(--calcite-spacing-sm)}.content :is(ol,ul){padding-inline-start:var(--calcite-spacing-lg)}.content>calcite-table{display:block;max-width:100%}.content pre{background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);color:var(--calcite-color-text-1);direction:ltr;max-width:100%;overflow:auto}.content pre code{display:block;white-space:pre;font-family:var(--calcite-code-family)}.part{animation:part-reveal calc(3 * var(--calcite-animation-timing)) ease-out}@keyframes part-reveal{0%{opacity:0;transform:translateY(var(--calcite-size-fixed-xxs))}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.part{animation:none}}`;
|
|
8
8
|
class l extends c {
|
|
9
9
|
static {
|
|
10
10
|
this.properties = { content: 1, parts: 0 };
|
|
11
11
|
}
|
|
12
12
|
static {
|
|
13
|
-
this.styles =
|
|
13
|
+
this.styles = s;
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
return t`<div class="container"><div class="content">${this.parts?.map((e) => t`<span class="part">${a(
|
|
16
|
+
return t`<div class="container"><div class="content">${this.parts?.map((e) => t`<span class="part">${a(n(e))}</span>`) ?? a(o(this.content))}</div></div>`;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
r("arcgis-assistant-message-text", l);
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
2
|
+
import { c as a } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as e, html as t } from "lit";
|
|
4
4
|
import { LitElement as i } from "@arcgis/lumina";
|
|
5
5
|
import { p as r } from "../../chunks/converterUtils.js";
|
|
6
|
-
import { unsafeHTML as
|
|
7
|
-
const
|
|
8
|
-
class
|
|
6
|
+
import { unsafeHTML as s } from "lit/directives/unsafe-html.js";
|
|
7
|
+
const c = e`:host{display:block;min-width:0}.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;max-width:100%;min-width:0;margin-left:auto;justify-content:flex-end}.container>div:first-child{min-width:0}.avatar{display:flex;align-items:center;justify-content:center}.content{min-width:0;overflow-wrap:anywhere;>*{margin:0}>*+*{margin-block-start:var(--calcite-spacing-sm)}:is(ol,ul){padding-inline-start:var(--calcite-spacing-lg)}>calcite-table{display:block;max-width:100%}pre{background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);color:var(--calcite-color-text-1);direction:ltr;max-width:100%;overflow:auto}pre code{display:block;white-space:pre;font-family:var(--calcite-code-family)}}@container (min-width: 480px){.container{max-width:80%}}`;
|
|
8
|
+
class n extends i {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments), this.userAvatarEnabled = !1;
|
|
11
|
+
}
|
|
9
12
|
static {
|
|
10
|
-
this.properties = { content: 1, user: 1, message: 0 };
|
|
13
|
+
this.properties = { content: 1, user: 1, message: 0, userAvatarEnabled: 5 };
|
|
11
14
|
}
|
|
12
15
|
static {
|
|
13
|
-
this.styles =
|
|
16
|
+
this.styles = c;
|
|
14
17
|
}
|
|
15
18
|
_getContent() {
|
|
16
19
|
return this.message?.role === "user" ? this.message.content : this.content;
|
|
17
20
|
}
|
|
18
21
|
render() {
|
|
19
|
-
return
|
|
22
|
+
return t`<div class="container"><div><slot name=content><div class="content">${s(r(this._getContent()))}</div></slot></div>${this.userAvatarEnabled ? t`<slot name=icon><div class="avatar"><calcite-avatar .fullName=${this.user} scale=s></calcite-avatar></div></slot>` : null}</div>`;
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
|
-
|
|
25
|
+
a("arcgis-assistant-user-message", n);
|
|
23
26
|
export {
|
|
24
|
-
|
|
27
|
+
n as ArcgisAssistantUserMessage
|
|
25
28
|
};
|