@arcgis/coding-components 4.33.0-next.150 → 4.33.0-next.151
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/addons/arcade-coding-assistant/temporary-strings.d.ts +25 -0
- package/dist/addons.js +18 -10
- package/dist/cdn/{6XKML3NL.js → 2HQ55QOQ.js} +2 -2
- package/dist/cdn/{XUJ3QZ6S.js → 2VMEZJ7C.js} +2 -2
- package/dist/cdn/{IYCJQDLN.js → 4T2OTCQS.js} +2 -2
- package/dist/cdn/{7OE4P3FG.js → 6AJHHM4F.js} +2 -2
- package/dist/cdn/{AVVJB2NU.js → 6OD6Z622.js} +1 -1
- package/dist/cdn/{SY4SDRJF.js → 7AAQHP62.js} +2 -2
- package/dist/cdn/{4PDT53YO.js → AIPJ7DBR.js} +2 -2
- package/dist/cdn/{HBN7AGZ6.js → APO6RKET.js} +2 -2
- package/dist/cdn/{3GZRQS2N.js → BADABQJZ.js} +2 -2
- package/dist/cdn/{LGKX2AQY.js → BCMA3EB7.js} +2 -2
- package/dist/cdn/{J2YGSZ6C.js → BF6OI6YK.js} +2 -2
- package/dist/cdn/{56ICCW7Z.js → BJSKIYRO.js} +2 -2
- package/dist/cdn/{MTRIRUI6.js → C4YG5PJ5.js} +2 -2
- package/dist/cdn/{74FAXUGZ.js → C7JBSRC3.js} +1 -1
- package/dist/cdn/{35B2GIJU.js → EGQZ57T6.js} +1 -1
- package/dist/cdn/{D2XHDZFY.js → FFHMIZTT.js} +2 -2
- package/dist/cdn/{RXE7FSVN.js → FIIJOKKA.js} +2 -2
- package/dist/cdn/{YYIIN6MW.js → GM4Y2UNL.js} +2 -2
- package/dist/cdn/{Z5RJEDND.js → KO4PBGZQ.js} +1 -1
- package/dist/cdn/LKZKETI7.js +4 -0
- package/dist/cdn/{PVPRF7B4.js → LVNSPHRF.js} +2 -2
- package/dist/cdn/{ANTHLBOG.js → MLI23XSH.js} +2 -2
- package/dist/cdn/MMIGXEYT.js +4 -0
- package/dist/cdn/{QZ4MGA7E.js → N5CVITC3.js} +2 -2
- package/dist/cdn/{D7WLGIQ5.js → NWPOENOM.js} +2 -2
- package/dist/cdn/{L3HJHI6X.js → OC2FT2K5.js} +2 -2
- package/dist/cdn/{KPKOCO2O.js → OZ6ZD5VG.js} +2 -2
- package/dist/cdn/PCN3NQUL.js +4 -0
- package/dist/cdn/{H2T4AM4F.js → PZCYZ7IX.js} +2 -2
- package/dist/cdn/{M3EHQG7N.js → Q5OQDO6K.js} +2 -2
- package/dist/cdn/{NAVLBCWN.js → QD72Y6KR.js} +1 -1
- package/dist/cdn/{QSQOTIOO.js → QKJ6ILXG.js} +2 -2
- package/dist/cdn/{N4HIJJSD.js → RLAECZUK.js} +4 -4
- package/dist/cdn/{5DC2QCE4.js → SQFUBFLV.js} +2 -2
- package/dist/cdn/{BQ54MGAY.js → VZANX756.js} +2 -2
- package/dist/cdn/{KN6U24B3.js → VZNW3MMC.js} +2 -2
- package/dist/cdn/{2SNVOJYB.js → W3MUGXE5.js} +2 -2
- package/dist/cdn/{XQN5DJMT.js → WXHTSSPA.js} +2 -2
- package/dist/cdn/{6L6DJHL4.js → X56VCOPY.js} +2 -2
- package/dist/cdn/{D6OJWF67.js → X7GV5CND.js} +2 -2
- package/dist/cdn/{GWDFSDKO.js → YFM2HXY7.js} +2 -2
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +191 -194
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/arcade-defaults.js +1 -1
- package/dist/chunks/arcade-executor.js +1 -1
- package/dist/chunks/arcade-mode.js +1 -1
- package/dist/chunks/arcade-service-accessors.js +1 -1
- package/dist/chunks/editor.js +1 -1
- package/dist/chunks/fields.js +1 -1
- package/dist/chunks/language-defaults-base.js +1 -1
- package/dist/chunks/markdown.js +1 -1
- package/dist/chunks/monaco-importer.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/setup-monaco.js +1 -1
- package/dist/chunks/sql-expr-contribution.js +1 -1
- package/dist/chunks/sql-expr-defaults.js +1 -1
- package/dist/chunks/sql-expr-mode.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-arcade-coding-assistant/customElement.d.ts +2 -0
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +195 -137
- package/dist/components/arcgis-arcade-coding-assistant/functional.d.ts +39 -2
- package/dist/components/arcgis-arcade-coding-assistant/index.d.ts +7 -4
- package/dist/components/arcgis-arcade-coding-assistant/index.js +7 -4
- package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
- package/dist/components/arcgis-arcade-results/customElement.js +1 -1
- package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
- package/dist/components/arcgis-code-editor/customElement.js +1 -1
- package/dist/components/arcgis-editor-variables/customElement.js +1 -1
- package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
- package/dist/docs/api.json +2 -2
- package/dist/docs/docs.json +2 -2
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/package.json +5 -5
- package/dist/cdn/NFYZNGHO.js +0 -4
- package/dist/cdn/U2TKCKFR.js +0 -4
|
@@ -1,139 +1,174 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { html as
|
|
3
|
-
import { nothing as
|
|
4
|
-
import { ref as
|
|
1
|
+
import { c as q } from "../../chunks/runtime.js";
|
|
2
|
+
import { html as n } from "lit-html";
|
|
3
|
+
import { nothing as P, LitElement as V } from "@arcgis/lumina";
|
|
4
|
+
import { ref as _, createRef as D } from "lit/directives/ref.js";
|
|
5
5
|
import j from "@arcgis/core/identity/IdentityManager.js";
|
|
6
|
-
import { u as
|
|
6
|
+
import { u as z } from "../../chunks/useT9n.js";
|
|
7
7
|
import { b as O } from "../../chunks/arcade-defaults.js";
|
|
8
8
|
import { css as U } from "@lit/reactive-element/css-tag.js";
|
|
9
9
|
import "lit";
|
|
10
|
-
import
|
|
11
|
-
import { a as
|
|
10
|
+
import S from "@arcgis/core/request.js";
|
|
11
|
+
import { a as N, e as B } from "../../chunks/monaco-importer.js";
|
|
12
|
+
import { repeat as H } from "lit-html/directives/repeat.js";
|
|
12
13
|
import "@arcgis/components-utils";
|
|
13
|
-
import { unsafeHTML as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import { unsafeHTML as y } from "lit/directives/unsafe-html.js";
|
|
15
|
+
import W from "@arcgis/core/layers/FeatureLayer.js";
|
|
16
|
+
import G from "@arcgis/core/Graphic.js";
|
|
16
17
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
17
18
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
18
|
-
v4.33.0-next.
|
|
19
|
-
const
|
|
19
|
+
v4.33.0-next.151 */
|
|
20
|
+
const Q = U`:host(:not([closed])){flex:1 0 auto;border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box;max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);.response-actions{display:flex;align-items:center;padding:.5rem;gap:.5rem}.response-actions>div{display:flex;gap:.5rem}.prompt-list calcite-list-item{margin-block-end:.5rem;border-radius:var(--calcite-corner-radius-round);--calcite-color-border-3: transparent;overflow:hidden}.feedback-content{padding:1rem;display:flex;flex-direction:column;gap:.75rem}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: auto;--calcite-sheet-min-height: auto}calcite-chip[slot=header-actions-end]{align-self:center;margin-inline-end:.5rem}calcite-list-item:focus calcite-button{position:relative;top:-2px}.prompt-list calcite-list-item:last-of-type{margin-block-end:0}calcite-list{--calcite-color-foreground-1: transparent;background-color:transparent}calcite-list-item{--calcite-color-foreground-1: white}calcite-flow-item calcite-shell{background:transparent}calcite-block{width:100%;max-width:100%;align-self:flex-end;background-color:transparent}calcite-sheet{--calcite-sheet-scrim-background: rgba(200, 200, 200, .5)}.type-suggestion{--calcite-color-foreground-1: var(--calcite-color-foreground-current);--calcite-color-text-3: var(--calcite-color-text-2);--calcite-icon-color: var(--calcite-color-brand)}.type-history{--calcite-icon-color: var(--calcite-color-text-2)}.type-response{--calcite-icon-color: var(--calcite-color-brand);--calcite-font-family: monospace}.block-response{align-self:flex-start;margin-block-end:4rem;border-block-end:0;--calcite-block-text-color: var(--calcite-color-brand)}calcite-list-item calcite-button{margin-inline-end:.25rem}.type-docs{--calcite-color-foreground-1: var(--calcite-color-foreground-3);--calcite-icon-color: var(--calcite-color-text-1)}.type-error{--calcite-icon-color: var(--calcite-color-status-danger);--calcite-font-family: monospace;border:1px solid var(--calcite-color-status-danger)}#thumbs-up{margin-inline-start:auto;--calcite-icon-color: var(--calcite-color-border-input)}#thumbs-down{--calcite-icon-color: var(--calcite-color-border-input)}calcite-flow-item calcite-shell calcite-notice{margin-block:1rem}.no-space-block,.no-space-block[open]{margin:0}calcite-block[open]:last-of-type{border-block-end:0}.text-area-wrapper{display:flex;flex-direction:column;background:#fff;border-radius:var(--calcite-corner-radius-round);margin:.75rem;width:calc(100% - 1.5rem);overflow:hidden;max-width:calc(100% - 1.5rem);--calcite-color-border-input: transparent;--calcite-text-area-divider-color: transparent;position:sticky;align-self:flex-end;box-shadow:var(--calcite-shadow-sm);flex:none}.text-area-wrapper calcite-button:last-of-type{margin-inline-start:auto;align-self:flex-end}calcite-text-area{height:auto;min-height:5.75rem;overflow:hidden;border-radius:var(--calcite-corner-radius-round) var(--calcite-corner-radius-round) 0 0;--calcite-font-weight-normal: 500;font-weight:500;line-height:1.2}calcite-tooltip{--calcite-tooltip-z-index: 1000}.standalone-list{margin:1rem;width:calc(100% - 2rem)}.result-disclaimer{display:block;width:24rem;max-width:90%;margin:1rem auto;text-align:center;line-height:1.125rem;font-size:.875rem;font-style:italic}calcite-flow{height:100%}calcite-popover calcite-list{--calcite-list-background-color: transparent;--calcite-input-border-color: transparent}calcite-popover calcite-list calcite-filter{--calcite-spacing-sm: 0}.break-spaces{white-space:break-spaces}.feedback-button-container{margin-inline-start:auto;gap:0}.info-heading{font-size:var(--calcite-font-size-1);color:var(--calcite-color-text-1)}.welcome-display-graphic{width:100%;height:6rem;background:var(--calcite-color-foreground-current);position:relative;display:flex;align-items:center;justify-content:center;--calcite-icon-color: var(--calcite-color-brand)}.unstyled-shell{position:unset;inset:unset;display:unset;block-size:unset;inline-size:unset}.suggestion-chips{--calcite-chip-background-color: var(--calcite-color-foreground-current);--calcite-chip-text-color: var(--calcite-color-brand);calcite-chip{cursor:pointer}}#result-block{calcite-card-group{--calcite-card-group-gap: 1.25rem}calcite-card{--calcite-card-corner-radius: var(--calcite-corner-radius-round);--calcite-card-background-color: white;--calcite-card-border-color: transparent;width:100%}.positioned-code-content{display:flex;flex-direction:row;padding:.25rem .5rem;gap:.5rem}calcite-card [slot=title] calcite-chip{margin-block-start:.25rem}.code-response-wrapper{position:relative;background:var(--calcite-color-foreground-2);border-radius:var(--calcite-corner-radius-round)}.prior-prompt{margin:.25rem 0 .75rem;max-width:90%;padding:0}pre{font-size:12px;margin:0;padding:0;overflow-x:auto;font-family:Fira Mono,Consolas,Menlo,monospace;display:block;max-height:12rem;position:relative}code{display:block;margin:0;padding:0 1rem}.code-collapse{margin-inline-start:auto}}}:host([closed]){display:none}`;
|
|
20
21
|
function R(i) {
|
|
21
22
|
if (!i)
|
|
22
23
|
return;
|
|
23
24
|
const e = i.indexOf('{"error":');
|
|
24
25
|
if (e !== -1)
|
|
25
26
|
try {
|
|
26
|
-
const t = i.slice(e),
|
|
27
|
-
if (
|
|
28
|
-
return
|
|
27
|
+
const t = i.slice(e), a = JSON.parse(t);
|
|
28
|
+
if (a && typeof a == "object" && a.error)
|
|
29
|
+
return a.error;
|
|
29
30
|
} catch {
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
async function
|
|
34
|
-
const { baseUrl: e, skillId: t, message:
|
|
35
|
-
message:
|
|
36
|
-
context:
|
|
34
|
+
async function J(i) {
|
|
35
|
+
const { baseUrl: e, skillId: t, message: a, authToken: c, previousConversationId: o, context: r } = i, s = t ? `${e}/skills/${t}/chat` : `${e}/chat`, d = [], l = {
|
|
36
|
+
message: a,
|
|
37
|
+
context: r
|
|
37
38
|
};
|
|
38
|
-
|
|
39
|
-
let
|
|
39
|
+
o && (l.conversation_id = o);
|
|
40
|
+
let m;
|
|
40
41
|
try {
|
|
41
|
-
|
|
42
|
+
m = await S(s, {
|
|
42
43
|
method: "post",
|
|
43
44
|
headers: {
|
|
44
45
|
"Content-Type": "application/json",
|
|
45
|
-
token:
|
|
46
|
+
token: c
|
|
46
47
|
},
|
|
47
|
-
body: JSON.stringify(
|
|
48
|
+
body: JSON.stringify(l),
|
|
48
49
|
responseType: "json"
|
|
49
50
|
});
|
|
50
|
-
} catch (
|
|
51
|
-
const
|
|
52
|
-
`Failed to send message: ${
|
|
51
|
+
} catch (f) {
|
|
52
|
+
const b = f?.details?.rawResponse || f?.message || String(f), v = R(b), g = new Error(
|
|
53
|
+
`Failed to send message: ${a}. Response: ${b}`
|
|
53
54
|
);
|
|
54
|
-
throw
|
|
55
|
+
throw v && (g.arcadeAssistantError = v), g;
|
|
55
56
|
}
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
57
|
+
const p = m.data;
|
|
58
|
+
if (!p.hasMore)
|
|
58
59
|
throw new Error("Expected hasMore to be true");
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
let
|
|
60
|
+
d.push(p);
|
|
61
|
+
const T = p.conversationId, M = p.inquiryId;
|
|
62
|
+
let w = p.sequenceNumber;
|
|
62
63
|
async function F() {
|
|
63
|
-
let
|
|
64
|
-
const
|
|
65
|
-
for (;
|
|
66
|
-
await new Promise((
|
|
67
|
-
const
|
|
64
|
+
let f = 0;
|
|
65
|
+
const b = 25;
|
|
66
|
+
for (; f < b; ) {
|
|
67
|
+
await new Promise((h) => setTimeout(h, 1e3));
|
|
68
|
+
const v = L(T, w, M);
|
|
68
69
|
let g;
|
|
69
70
|
try {
|
|
70
|
-
g = await
|
|
71
|
+
g = await S(s, {
|
|
71
72
|
method: "post",
|
|
72
73
|
headers: {
|
|
73
74
|
"Content-Type": "application/json",
|
|
74
|
-
token:
|
|
75
|
+
token: c
|
|
75
76
|
},
|
|
76
|
-
body: JSON.stringify(
|
|
77
|
+
body: JSON.stringify(v),
|
|
77
78
|
responseType: "json"
|
|
78
79
|
});
|
|
79
|
-
} catch (
|
|
80
|
-
const
|
|
81
|
-
`Polling failed. Response: ${
|
|
80
|
+
} catch (h) {
|
|
81
|
+
const x = h?.details?.rawResponse || h?.message || String(h), $ = R(x), A = new Error(
|
|
82
|
+
`Polling failed. Response: ${x}`
|
|
82
83
|
);
|
|
83
|
-
throw
|
|
84
|
+
throw $ && (A.arcadeAssistantError = $), A;
|
|
84
85
|
}
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
const u = g.data;
|
|
87
|
+
if (u.context && u.context.kind === "ArcgisErrorAsContext" && u.context.error) {
|
|
88
|
+
const h = new Error(
|
|
89
|
+
u.context.error.message || "ArcGIS Assistant error"
|
|
89
90
|
);
|
|
90
|
-
|
|
91
|
+
throw h.arcadeAssistantError = { message: u.context.error.message ?? "ArcGIS Assistant error" }, h;
|
|
92
|
+
}
|
|
93
|
+
if (d.push(u), w = u.sequenceNumber, f++, !u.hasMore)
|
|
91
94
|
break;
|
|
92
95
|
}
|
|
93
|
-
if (
|
|
96
|
+
if (f === b)
|
|
94
97
|
throw new Error("Request timed out");
|
|
95
98
|
}
|
|
96
|
-
return await F(),
|
|
99
|
+
return await F(), d;
|
|
97
100
|
}
|
|
98
|
-
function
|
|
101
|
+
function L(i, e, t) {
|
|
99
102
|
return {
|
|
100
103
|
conversationId: i,
|
|
101
104
|
inquiryId: t,
|
|
102
105
|
ackSequenceNumber: e
|
|
103
106
|
};
|
|
104
107
|
}
|
|
105
|
-
const
|
|
106
|
-
const e = i.value.length, t = 72,
|
|
107
|
-
i.style.setProperty("--calcite-text-area-min-height", `${Math.min(
|
|
108
|
+
const Y = (i) => {
|
|
109
|
+
const e = i.value.length, t = 72, a = 180, c = i.offsetWidth, r = Math.max(1, Math.floor(c / 8)), s = Math.ceil(e / r), d = t + (s - 2) * 24;
|
|
110
|
+
i.style.setProperty("--calcite-text-area-min-height", `${Math.min(d, a)}px`);
|
|
108
111
|
};
|
|
109
|
-
function
|
|
110
|
-
return
|
|
112
|
+
function K({ messages: i }) {
|
|
113
|
+
return n`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${i.beta ?? "Beta"}>${i.beta ?? "Beta"}</calcite-chip>`;
|
|
111
114
|
}
|
|
112
|
-
function
|
|
113
|
-
return
|
|
115
|
+
function X({ popoverContent: i }) {
|
|
116
|
+
return n`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer overlay-positioning=fixed label=legal-disclaimer placement=bottom auto-close>${i}</calcite-popover>`;
|
|
114
117
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
118
|
+
function Z({ errorMessage: i }) {
|
|
119
|
+
return n`<calcite-input-message id=error-message status=invalid slot=footer-start icon=exclamation-mark-triangle scale=m>${i}</calcite-input-message>`;
|
|
117
120
|
}
|
|
118
|
-
function
|
|
119
|
-
return
|
|
121
|
+
function ee({ active: i, setActive: e, messages: t }) {
|
|
122
|
+
return n`<calcite-alert slot=alerts .open=${i} placement=bottom kind=success icon=check-circle-f auto-close @calciteAlertClose=${() => e(!1)} label=confirmation-alert><div slot=message>${t.expressionapplied ?? "Expression applied to editor."}</div></calcite-alert>`;
|
|
120
123
|
}
|
|
121
|
-
function
|
|
122
|
-
return
|
|
123
|
-
|
|
124
|
-
}} ${
|
|
125
|
-
|
|
126
|
-
}}>${
|
|
127
|
-
|
|
128
|
-
}}>${
|
|
124
|
+
function te({ isDisabled: i, isReadOnly: e, setQuestion: t, setIsViewingResult: a, textAreaRef: c, question: o, errorMessage: r, setErrorMessage: s, submitQuestion: d, messages: l, mode: m }) {
|
|
125
|
+
return n`<div class="text-area-wrapper"><calcite-text-area resize=vertical .readOnly=${i || e} class="styled-text-area" .placeholder=${l.askaquestion ?? `Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${o} @calciteTextAreaInput=${(p) => {
|
|
126
|
+
Y(p.target), t(p.target.value);
|
|
127
|
+
}} ${_(c)}>${r && Z({ errorMessage: r }) || ""}</calcite-text-area><div class="response-actions" slot=footer-end><calcite-button round kind=neutral .hidden=${m !== "refine"} icon-start=arrow-left appearance=solid .disabled=${i} @click=${async () => {
|
|
128
|
+
a(!1), t("");
|
|
129
|
+
}}>${l.startover ?? "Start Over"}</calcite-button><calcite-button round icon-end=effects appearance=solid .loading=${i} .disabled=${i} @click=${async () => {
|
|
130
|
+
s(o ? "" : l.enteraprompt ?? "Please enter a prompt"), await d();
|
|
131
|
+
}}>${m === "prompt" ? l.ask ?? "Generate" : l.refine ?? "Refine"}</calcite-button></div></div>`;
|
|
129
132
|
}
|
|
130
|
-
function
|
|
131
|
-
return
|
|
133
|
+
function ie({ open: i, setOpen: e, messages: t, feedbackValue: a, setFeedbackValue: c, feedbackText: o, setFeedbackText: r, onSubmit: s }) {
|
|
134
|
+
return n`<calcite-sheet class="feedback-sheet" .label=${t.feedback ?? "Feedback"} slot=sheets display-mode=float position=block-end .open=${i} @calciteSheetClose=${() => e(!1)}><calcite-panel .heading=${t.providefeedback ?? "Provide feedback"} .description=${t.experiencehelps ?? "Your experience helps guide future improvements"}><div class="feedback-content"><calcite-label>${t.experiencehelpful ?? "Was the assistant helpful?"}<calcite-segmented-control scale=l><calcite-segmented-control-item icon-start=thumbs-up .checked=${a === "good"} @click=${() => c("good")}></calcite-segmented-control-item><calcite-segmented-control-item icon-start=thumbs-down .checked=${a === "bad"} @click=${() => c("bad")}></calcite-segmented-control-item></calcite-segmented-control></calcite-label><calcite-label>${t.describeexperience ?? "Describe your experience"}<calcite-text-area resize=vertical .value=${o} @calciteTextAreaInput=${(d) => r(d.target.value)}></calcite-text-area></calcite-label></div><calcite-button slot=footer width=full @click=${s}>${t.submitfeedback ?? "Submit Feedback"}</calcite-button></calcite-panel></calcite-sheet>`;
|
|
132
135
|
}
|
|
133
136
|
function C({ assistantsEnabled: i, messages: e, slot: t }) {
|
|
134
|
-
return
|
|
137
|
+
return n`<calcite-block label=info slot=${t ?? P} expanded><calcite-chip .label=${e.new ?? "new"} kind=brand>${e.new}</calcite-chip><h1 class="info-heading">${e.introducing}</h1><p>${e.capabilities}</p>${!i && n`<p>${y(e.useofassistant?.replace("{aiassistants}", `<strong>${e.aiassistants ?? "Ai Assistants"}</strong>`))}<calcite-link href=https://doc.arcgis.com/en/arcgis-online/administer/configure-assistants.htm target=_blank icon-end=launch-2>${e.opensettings ?? "Open Settings"}</calcite-link></p>` || ""}</calcite-block>`;
|
|
138
|
+
}
|
|
139
|
+
function ae({ messages: i, onProceed: e, onExit: t }) {
|
|
140
|
+
return n`<calcite-scrim></calcite-scrim><calcite-dialog close-disabled placement=top .heading=${i.welcome} slot=dialogs open width-scale=m id=welcome-dialog><div class="welcome-display-graphic" slot=content-top><calcite-chip scale=l icon=effects label=effects></calcite-chip></div><calcite-notice scale=s open width=full><div slot=title>${i.beforeyougetstarted}</div></calcite-notice>• ${i.maybeincorrect} <br><br><span>${y(`• ${i.pleasereadhelp.replace("{helpTopic}", `<calcite-link href="https://doc.arcgis.com/en/arcgis-online/help/arcade-assistant.htm" target="_blank">${i.helptopic}</calcite-link>`)}`)}</span><br><div slot=content-bottom>${y(i.consultprivacy.replace(
|
|
141
|
+
"{privacyStatement}",
|
|
142
|
+
// TODO get correct link
|
|
143
|
+
`<calcite-link href="https://www.esri.com/en-us/privacy/arcgis-online-privacy-statement" target="_blank">${i.privacyStatement}</calcite-link>`
|
|
144
|
+
).replace("{privacySupplement}", `<calcite-link href="https://www.esri.com/en-us/privacy/arcgis-online-privacy-supplement" target="_blank">${i.privacySupplement}</calcite-link>`))}</div><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${i.proceed}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${t} kind=neutral>${i.exit}</calcite-button></calcite-dialog>`;
|
|
145
|
+
}
|
|
146
|
+
function se({ messages: i, suggestions: e, onSuggestionClick: t }) {
|
|
147
|
+
return n`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block><calcite-chip-group .label=${i.promptsuggestions} class="suggestion-chips">${H(e, (a) => a, (a) => n`<calcite-chip .label=${i.promptsuggestion} .value=${a} icon=effects @click=${() => t?.(a)}>${a}</calcite-chip>`)}</calcite-chip-group></calcite-block>`;
|
|
148
|
+
}
|
|
149
|
+
function ce({ hidden: i = !1, expanded: e = !1, messages: t, cards: a, heading: c, collapsible: o = !1, showEffectsIcon: r = !1 }) {
|
|
150
|
+
return n`<calcite-block .hidden=${i} id=result-block .heading=${c ?? t.besteffort ?? "Here is the assistant's best effort"} .expanded=${e} .collapsible=${o}>${r && n`<calcite-chip label slot=content-start icon=effects kind=brand></calcite-chip>` || ""}<calcite-card-group .label=${t.assistantresponses}>${a.map((s, d) => n`<calcite-card><div slot=title><div class="prior-prompt">${s.priorPrompt}</div><div class="code-response-wrapper"><div class="positioned-code-content">${s.chips?.map((l) => n`<calcite-chip .label=${l.label} .scale=${l.scale ?? "s"} .appearance=${l.appearance ?? "outline"} .icon=${l.icon}>${l.label}</calcite-chip>`)}</div><pre><code>${s.code}</code></pre></div></div><div slot=footer-start><calcite-button round icon-start=plus appearance=outline-fill class="add-to-editor-button" @click=${s.onAddToEditor}>${t.addtoeditor ?? "Add to editor"}</calcite-button><calcite-button round icon-start=copy-to-clipboard kind=neutral @click=${() => s.onCopy(d)}>${s.copySuccessIndex === d ? t.copied ?? "copied" : ""}</calcite-button></div><div slot=footer-end class="feedback-actions"><calcite-action .text=${t.thumbsup} scale=s icon=thumbs-up @click=${s.onThumbsUp}></calcite-action><calcite-action .text=${t.thumbsdown} scale=s icon=thumbs-down @click=${s.onThumbsDown}></calcite-action></div></calcite-card>`)}</calcite-card-group></calcite-block>`;
|
|
135
151
|
}
|
|
136
|
-
const
|
|
152
|
+
const k = {
|
|
153
|
+
welcome: "Welcome to the new assistant experience",
|
|
154
|
+
beforeyougetstarted: "Before you get started be aware:",
|
|
155
|
+
maybeincorrect: "AI generated code may occasionally be incorrect or biased. Review carefully.",
|
|
156
|
+
pleasereadhelp: "Please read the Arcade Assistant (beta) overview {helpTopic} for more details.",
|
|
157
|
+
consultprivacy: "Consult the {privacyStatement} and {privacySupplement}.",
|
|
158
|
+
privacyStatement: "privacy statement",
|
|
159
|
+
privacySupplement: "privacy supplement",
|
|
160
|
+
proceed: "Proceed",
|
|
161
|
+
exit: "Exit",
|
|
162
|
+
promptsuggestions: "Prompt suggestions",
|
|
163
|
+
promptsuggestion: "Prompt suggestion",
|
|
164
|
+
assistantresponses: "Assistant responses",
|
|
165
|
+
collapse: "Collapse",
|
|
166
|
+
thumbsup: "Thumbs up",
|
|
167
|
+
thumbsdown: "Thumbs down",
|
|
168
|
+
refine: "Refine",
|
|
169
|
+
startover: "Start over",
|
|
170
|
+
helptopic: "help topic"
|
|
171
|
+
}, oe = "arcade_generation", re = "ArcadeCodeRequest", ne = "visualization", le = "ArcadeAssistant", de = [
|
|
137
172
|
"your_comments",
|
|
138
173
|
"user_evaluation",
|
|
139
174
|
"question",
|
|
@@ -144,64 +179,67 @@ const te = "arcade_generation", ie = "ArcadeCodeRequest", se = "visualization",
|
|
|
144
179
|
"context",
|
|
145
180
|
"extras"
|
|
146
181
|
];
|
|
147
|
-
let E = [];
|
|
148
|
-
class
|
|
182
|
+
let E = [], I = !0;
|
|
183
|
+
class pe extends V {
|
|
149
184
|
constructor() {
|
|
150
|
-
super(...arguments), this.textAreaRef =
|
|
151
|
-
this.
|
|
185
|
+
super(...arguments), this.textAreaRef = D(), this.messages = z(), this._feedbackService = void 0, this.handleFeedbackButton = (e, t) => {
|
|
186
|
+
this.feedback.active && this.feedback.value === e ? this.feedback = { active: !1, value: void 0, text: "", item: void 0 } : this.feedback = { ...this.feedback, active: !0, value: e, item: t };
|
|
152
187
|
}, this.handleFeedbackSheetClose = () => {
|
|
153
|
-
this.
|
|
188
|
+
this.feedback = { active: !1, value: void 0, text: "", item: void 0 };
|
|
154
189
|
}, this.handleFeedbackSubmit = async () => {
|
|
155
190
|
const e = await this.ensureFeedbackService();
|
|
156
191
|
if (!e) {
|
|
157
192
|
this.handleFeedbackSheetClose();
|
|
158
193
|
return;
|
|
159
194
|
}
|
|
160
|
-
const t = this.getModel(),
|
|
161
|
-
user_evaluation: this.
|
|
162
|
-
your_comments: this.
|
|
195
|
+
const t = this.getModel(), a = t ? await this.getProfileAndMetadata(t.uri) : void 0, c = {
|
|
196
|
+
user_evaluation: this.feedback.value,
|
|
197
|
+
your_comments: this.feedback.text || void 0,
|
|
163
198
|
question: this.question,
|
|
164
|
-
answer: this.
|
|
199
|
+
answer: this.feedback.item?.script ?? "",
|
|
165
200
|
useragent: navigator.userAgent,
|
|
166
|
-
_source:
|
|
201
|
+
_source: le,
|
|
167
202
|
version: this.appVersion ?? "",
|
|
168
|
-
context:
|
|
169
|
-
extras:
|
|
203
|
+
context: a ? JSON.stringify(a) : "",
|
|
204
|
+
extras: a?.profileName ?? "",
|
|
205
|
+
conversation_id: this.feedback.item?.conversationId ?? ""
|
|
170
206
|
};
|
|
171
207
|
try {
|
|
172
|
-
await e.applyEdits({ addFeatures: [new
|
|
173
|
-
} catch (
|
|
174
|
-
console.error("Error submitting feedback:",
|
|
208
|
+
await e.applyEdits({ addFeatures: [new G({ attributes: c })] });
|
|
209
|
+
} catch (o) {
|
|
210
|
+
console.error("Error submitting feedback:", o);
|
|
175
211
|
}
|
|
176
212
|
this.handleFeedbackSheetClose();
|
|
177
213
|
}, this.handleClose = (e) => {
|
|
178
214
|
this.closed = !0, this.closePanel?.(e);
|
|
179
215
|
}, this.setQuestion = (e) => {
|
|
180
216
|
this.question = e;
|
|
181
|
-
}, this.
|
|
217
|
+
}, this.onSuggestionClick = (e) => {
|
|
218
|
+
this.textAreaRef.value && (this.textAreaRef.value.value = e, this.textAreaRef.value.setFocus(), this.setQuestion(e));
|
|
219
|
+
}, this.isViewingResult = !1, this.confirmationActive = !1, this.isSubmitting = !1, this.errorMessage = void 0, this.question = "", this.history = [], this.feedback = { active: !1, value: void 0, text: "", item: void 0 }, this.copySucessIndex = -1, this.splashActive = !0, this.assistantsEnabled = !1, this.closed = !1;
|
|
182
220
|
}
|
|
183
221
|
static {
|
|
184
|
-
this.properties = { isViewingResult: 16, confirmationActive: 16,
|
|
222
|
+
this.properties = { isViewingResult: 16, confirmationActive: 16, isSubmitting: 16, errorMessage: 16, question: 16, history: 16, feedback: 16, copySucessIndex: 16, splashActive: 16, closePanel: 0, insertText: 0, assistantsEnabled: 5, layer: [1, { type: Object }], orgBaseUrl: 1, serviceUrl: 1, closed: 7, editorRef: 0, feedbackServiceUrl: 1, appVersion: 1 };
|
|
185
223
|
}
|
|
186
224
|
static {
|
|
187
|
-
this.styles =
|
|
225
|
+
this.styles = Q;
|
|
188
226
|
}
|
|
189
227
|
async destroy() {
|
|
190
228
|
}
|
|
191
229
|
connectedCallback() {
|
|
192
|
-
super.connectedCallback(), this.history = E;
|
|
230
|
+
super.connectedCallback(), this.history = E, this.splashActive = I;
|
|
193
231
|
}
|
|
194
232
|
disconnectedCallback() {
|
|
195
|
-
super.disconnectedCallback(), E = this.history;
|
|
233
|
+
super.disconnectedCallback(), E = this.history, I = this.splashActive;
|
|
196
234
|
}
|
|
197
235
|
async ensureFeedbackService() {
|
|
198
236
|
if (this._feedbackService)
|
|
199
237
|
return this._feedbackService;
|
|
200
238
|
if (!this.feedbackServiceUrl)
|
|
201
239
|
return;
|
|
202
|
-
const e = new
|
|
240
|
+
const e = new W({ url: this.feedbackServiceUrl });
|
|
203
241
|
await e.load();
|
|
204
|
-
const t =
|
|
242
|
+
const t = de.filter((a) => !e.fields.some((c) => c.name === a));
|
|
205
243
|
if (t.length > 0) {
|
|
206
244
|
console.error(`Missing the following fields in feedback service: ${t.join(", ")}. Feedback will not be logged.`);
|
|
207
245
|
return;
|
|
@@ -213,35 +251,37 @@ class oe extends I {
|
|
|
213
251
|
}
|
|
214
252
|
async submitQuestion() {
|
|
215
253
|
if (this.question) {
|
|
216
|
-
this.
|
|
254
|
+
this.isSubmitting = !0;
|
|
217
255
|
try {
|
|
218
256
|
const e = await this.getToken(), t = this.getModel();
|
|
219
257
|
if (!t)
|
|
220
258
|
return;
|
|
221
|
-
const { profileName:
|
|
259
|
+
const { profileName: a, metadata: c } = await this.getProfileAndMetadata(t.uri), r = (await J({
|
|
222
260
|
baseUrl: this.serviceUrl,
|
|
223
|
-
skillId:
|
|
261
|
+
skillId: oe,
|
|
224
262
|
message: this.question,
|
|
225
263
|
authToken: e,
|
|
226
264
|
context: {
|
|
227
|
-
kind:
|
|
265
|
+
kind: re,
|
|
228
266
|
context: {
|
|
229
|
-
profile_name:
|
|
230
|
-
metadata:
|
|
267
|
+
profile_name: a,
|
|
268
|
+
metadata: c
|
|
231
269
|
}
|
|
232
270
|
}
|
|
233
|
-
})).find((
|
|
234
|
-
if (!
|
|
271
|
+
})).find((s) => s.context?.kind === "ArcadeCodeResponse");
|
|
272
|
+
if (!r)
|
|
235
273
|
return;
|
|
236
|
-
|
|
237
|
-
script:
|
|
274
|
+
r.context?.kind === "ArcadeCodeResponse" && (this.history.unshift({
|
|
275
|
+
script: r?.context?.arcadeCode?.code,
|
|
238
276
|
error: void 0,
|
|
239
|
-
question: this.question
|
|
240
|
-
|
|
277
|
+
question: this.question,
|
|
278
|
+
profile: a,
|
|
279
|
+
conversationId: r.conversationId
|
|
280
|
+
}), this.isViewingResult = !0, this.errorMessage = void 0);
|
|
241
281
|
} catch (e) {
|
|
242
282
|
typeof e == "object" && e && "arcadeAssistantError" in e ? this.errorMessage = e.arcadeAssistantError.message || this.messages.erroroccurred || "An error occurred." : e instanceof Error ? this.errorMessage = this.messages.erroroccurred ?? "An error occurred." : this.errorMessage = this.messages.erroroccurred || "An error occurred.", console.error("Error in Arcade Assistant:", e);
|
|
243
283
|
} finally {
|
|
244
|
-
this.
|
|
284
|
+
this.isSubmitting = !1;
|
|
245
285
|
}
|
|
246
286
|
}
|
|
247
287
|
}
|
|
@@ -250,35 +290,53 @@ class oe extends I {
|
|
|
250
290
|
return e;
|
|
251
291
|
}
|
|
252
292
|
async getProfileAndMetadata(e) {
|
|
253
|
-
let t =
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
let
|
|
260
|
-
return
|
|
261
|
-
name:
|
|
262
|
-
type:
|
|
263
|
-
alias:
|
|
264
|
-
}))), { profileName: t, metadata:
|
|
293
|
+
let t = ne;
|
|
294
|
+
const a = O.getEditorProfileForModel(e);
|
|
295
|
+
a?.loaded || await a?.loadSource();
|
|
296
|
+
const c = this.editorRef.profile;
|
|
297
|
+
c && "id" in c && (t = c.id);
|
|
298
|
+
const o = a?.definition?.variables?.find((s) => s.type === "feature");
|
|
299
|
+
let r = [];
|
|
300
|
+
return o?.definition && "fields" in o.definition && (r = o.definition.fields.map((s) => ({
|
|
301
|
+
name: s.name,
|
|
302
|
+
type: s.type,
|
|
303
|
+
alias: s.alias
|
|
304
|
+
}))), { profileName: t, metadata: r };
|
|
265
305
|
}
|
|
266
306
|
render() {
|
|
267
|
-
return this.closed ? null : this.assistantsEnabled ?
|
|
268
|
-
|
|
269
|
-
}}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
307
|
+
return this.closed ? null : this.assistantsEnabled ? n`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${K({ messages: this.messages })}${X({ popoverContent: C({ assistantsEnabled: this.assistantsEnabled, messages: this.messages }) })}<calcite-shell class="unstyled-shell">${this.splashActive && ae({ messages: { ...k, ...this.messages }, onProceed: () => {
|
|
308
|
+
this.splashActive = !1;
|
|
309
|
+
}, onExit: (e) => this.closePanel && this.closePanel(e) }) || ""}${ee({ active: this.confirmationActive, setActive: (e) => this.confirmationActive = e, messages: this.messages })}${te({ isDisabled: this.isSubmitting, isReadOnly: !1, setQuestion: this.setQuestion, setIsViewingResult: (e) => this.isViewingResult = e, mode: this.isViewingResult ? "refine" : "prompt", textAreaRef: this.textAreaRef, question: this.question, errorMessage: this.errorMessage, setErrorMessage: (e) => this.errorMessage = e, submitQuestion: this.submitQuestion.bind(this), messages: { ...k, ...this.messages } })}<calcite-block-group label="interactive blocks">${!this.isViewingResult && !this.isSubmitting && se({ messages: { ...this.messages, ...k }, suggestions: ["Round value to one decimal place", 'Return "Yes" if value > 10'], onSuggestionClick: this.onSuggestionClick }) || ""}<calcite-block .hidden=${!this.isSubmitting} .heading=${this.messages.generatingresponse ?? "Generating response..."}></calcite-block>${ce({ expanded: this.isViewingResult || this.history.length > 0, messages: { ...this.messages, ...k }, collapsible: !0, showEffectsIcon: this.isViewingResult, cards: this.history.reduce((e, t, a) => (!t.script || this.isViewingResult && a > 0 || (e.push({
|
|
310
|
+
priorPrompt: t.question,
|
|
311
|
+
code: N(t.script ?? "") || t.error || "",
|
|
312
|
+
chips: [
|
|
313
|
+
// TODO implement profile and layer chips
|
|
314
|
+
// {
|
|
315
|
+
// label: item.profile ?? defaultProfile,
|
|
316
|
+
// icon: "map-information",
|
|
317
|
+
// appearance: "outline",
|
|
318
|
+
// scale: "s",
|
|
319
|
+
// },
|
|
320
|
+
// { label: "1 layer", icon: "layer", appearance: "outline", scale: "s" },
|
|
321
|
+
],
|
|
322
|
+
onAddToEditor: () => {
|
|
323
|
+
B(this.editorRef.editorInstance, t.script ?? "", this.messages.disclaimercomment ?? "Expression generated by ArcGIS Arcade Assistant (beta)");
|
|
324
|
+
},
|
|
325
|
+
onCopy: (c) => {
|
|
326
|
+
const o = t.script ?? "";
|
|
327
|
+
o && navigator.clipboard.writeText(o).then(() => {
|
|
328
|
+
this.copySucessIndex = c, setTimeout(() => {
|
|
329
|
+
this.copySucessIndex = -1;
|
|
330
|
+
}, 1500);
|
|
331
|
+
});
|
|
332
|
+
},
|
|
333
|
+
onThumbsUp: () => this.handleFeedbackButton("good", t),
|
|
334
|
+
onThumbsDown: () => this.handleFeedbackButton("bad", t),
|
|
335
|
+
copySuccessIndex: this.copySucessIndex
|
|
336
|
+
}), this.isViewingResult), e), []), heading: this.isViewingResult ? this.messages.besteffort ?? "Here's the assistant's best effort" : this.messages.recentprompts ?? "Recent prompts", hidden: this.isViewingResult ? !this.isViewingResult : !1 })}</calcite-block-group><span class="result-disclaimer">${this.messages.reviewcodedisclaimer ?? "Review AI-generated code for accuracy, coherence, and relevance before using it."}</span>${this.feedback.active ? ie({ open: this.feedback.active, setOpen: this.handleFeedbackSheetClose, messages: this.messages, feedbackValue: this.feedback.value ?? "good", setFeedbackValue: (e) => this.feedback = { ...this.feedback, value: e }, feedbackText: this.feedback.text ?? "", setFeedbackText: (e) => this.feedback = { ...this.feedback, text: e }, onSubmit: this.handleFeedbackSubmit }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` : n`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${C({ slot: "content-top", messages: this.messages, assistantsEnabled: this.assistantsEnabled })}</calcite-flow-item></calcite-flow>`;
|
|
279
337
|
}
|
|
280
338
|
}
|
|
281
|
-
|
|
339
|
+
q("arcgis-arcade-coding-assistant", pe);
|
|
282
340
|
export {
|
|
283
|
-
|
|
341
|
+
pe as ArcgisArcadeCodingAssistant
|
|
284
342
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JsxNode } from '@arcgis/lumina';
|
|
2
|
+
import { temporaryStrings as TempStrings } from '../../addons/arcade-coding-assistant/temporary-strings.js';
|
|
2
3
|
import { Ref } from 'lit/directives/ref.js';
|
|
3
4
|
declare const strings: (value: {
|
|
4
5
|
arcadeassistant: string;
|
|
@@ -101,7 +102,7 @@ export declare function ConfirmationDisplay({ active, setActive, messages, }: {
|
|
|
101
102
|
setActive: (e: boolean) => void;
|
|
102
103
|
messages: Partial<ReturnType<typeof strings>>;
|
|
103
104
|
}): JsxNode;
|
|
104
|
-
export declare function SubmissionDisplay({ isDisabled, isReadOnly, setQuestion, setIsViewingResult, textAreaRef, question, errorMessage, setErrorMessage, submitQuestion, messages, }: {
|
|
105
|
+
export declare function SubmissionDisplay({ isDisabled, isReadOnly, setQuestion, setIsViewingResult, textAreaRef, question, errorMessage, setErrorMessage, submitQuestion, messages, mode, }: {
|
|
105
106
|
isDisabled: boolean;
|
|
106
107
|
isReadOnly: boolean;
|
|
107
108
|
setQuestion: (e: string) => void;
|
|
@@ -111,7 +112,8 @@ export declare function SubmissionDisplay({ isDisabled, isReadOnly, setQuestion,
|
|
|
111
112
|
errorMessage?: string;
|
|
112
113
|
setErrorMessage: (e: string) => void;
|
|
113
114
|
submitQuestion: () => Promise<void>;
|
|
114
|
-
messages: Partial<ReturnType<typeof strings
|
|
115
|
+
messages: Partial<ReturnType<typeof strings>> & typeof TempStrings;
|
|
116
|
+
mode: "prompt" | "refine";
|
|
115
117
|
}): JsxNode;
|
|
116
118
|
export declare function FeedbackSheetDisplay({ open, setOpen, messages, feedbackValue, setFeedbackValue, feedbackText, setFeedbackText, onSubmit, }: {
|
|
117
119
|
open: boolean;
|
|
@@ -128,4 +130,39 @@ export declare function InfoDisplay({ assistantsEnabled, messages, slot, }: {
|
|
|
128
130
|
messages: Partial<ReturnType<typeof strings>>;
|
|
129
131
|
slot?: HTMLCalciteBlockElement["slot"];
|
|
130
132
|
}): JsxNode;
|
|
133
|
+
export declare function SplashDisplay({ messages, onProceed, onExit, }: {
|
|
134
|
+
messages: Partial<ReturnType<typeof strings>> & typeof TempStrings;
|
|
135
|
+
onProceed: () => void;
|
|
136
|
+
onExit: (e: Event) => void;
|
|
137
|
+
}): JsxNode;
|
|
138
|
+
export declare function PromptSuggestionsDisplay({ messages, suggestions, onSuggestionClick, }: {
|
|
139
|
+
suggestions: string[];
|
|
140
|
+
onSuggestionClick: (value: string) => void;
|
|
141
|
+
messages: Partial<ReturnType<typeof strings>> & typeof TempStrings;
|
|
142
|
+
}): JsxNode;
|
|
143
|
+
export interface ResponseDisplayCardChip {
|
|
144
|
+
label: string;
|
|
145
|
+
icon?: string;
|
|
146
|
+
scale?: "l" | "m" | "s";
|
|
147
|
+
appearance?: "outline-fill" | "outline" | "solid";
|
|
148
|
+
}
|
|
149
|
+
export interface ResponseDisplayCard {
|
|
150
|
+
priorPrompt: string;
|
|
151
|
+
code: string;
|
|
152
|
+
chips?: ResponseDisplayCardChip[];
|
|
153
|
+
onAddToEditor: () => void;
|
|
154
|
+
onCopy: (index: number) => void;
|
|
155
|
+
onThumbsUp: () => void;
|
|
156
|
+
onThumbsDown: () => void;
|
|
157
|
+
copySuccessIndex?: number;
|
|
158
|
+
}
|
|
159
|
+
export declare function ResponseDisplay({ hidden, expanded, messages, cards, heading, collapsible, showEffectsIcon, }: {
|
|
160
|
+
hidden?: boolean;
|
|
161
|
+
expanded?: boolean;
|
|
162
|
+
heading?: string;
|
|
163
|
+
messages: Partial<ReturnType<typeof strings>> & typeof TempStrings;
|
|
164
|
+
cards: ResponseDisplayCard[];
|
|
165
|
+
showEffectsIcon?: boolean;
|
|
166
|
+
collapsible?: boolean;
|
|
167
|
+
}): JsxNode;
|
|
131
168
|
export {};
|
|
@@ -12,11 +12,14 @@ import "@esri/calcite-components/components/calcite-segmented-control";
|
|
|
12
12
|
import "@esri/calcite-components/components/calcite-segmented-control-item";
|
|
13
13
|
import "@esri/calcite-components/components/calcite-block";
|
|
14
14
|
import "@esri/calcite-components/components/calcite-link";
|
|
15
|
+
import "@esri/calcite-components/components/calcite-scrim";
|
|
16
|
+
import "@esri/calcite-components/components/calcite-dialog";
|
|
17
|
+
import "@esri/calcite-components/components/calcite-notice";
|
|
18
|
+
import "@esri/calcite-components/components/calcite-chip-group";
|
|
19
|
+
import "@esri/calcite-components/components/calcite-card-group";
|
|
20
|
+
import "@esri/calcite-components/components/calcite-card";
|
|
15
21
|
import "@esri/calcite-components/components/calcite-flow";
|
|
16
22
|
import "@esri/calcite-components/components/calcite-flow-item";
|
|
17
|
-
import "@esri/calcite-components/components/calcite-list";
|
|
18
|
-
import "@esri/calcite-components/components/calcite-list-item";
|
|
19
|
-
import "@esri/calcite-components/components/calcite-tooltip";
|
|
20
|
-
import "@esri/calcite-components/components/calcite-icon";
|
|
21
23
|
import "@esri/calcite-components/components/calcite-shell";
|
|
24
|
+
import "@esri/calcite-components/components/calcite-block-group";
|
|
22
25
|
export * from "./customElement.js";
|