@arcgis/coding-components 4.34.0-next.2 → 4.34.0-next.20
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/arcade-coding-assistant/useArcadeAssistant.d.ts +8 -0
- package/dist/addons.js +32 -24
- package/dist/cdn/{53T47RFW.js → 2U6SPEPF.js} +1 -1
- package/dist/cdn/{EPRGELI2.js → 45QNRGTD.js} +2 -2
- package/dist/cdn/{PHSJYUKP.js → 57CDFPZD.js} +2 -2
- package/dist/cdn/{GEPPK2KM.js → 5GYGHKHE.js} +2 -2
- package/dist/cdn/5NBKQJZT.js +4 -0
- package/dist/cdn/62FPMEAD.js +4 -0
- package/dist/cdn/{DTQI2YNL.js → 6JBFRP6R.js} +2 -2
- package/dist/cdn/{DPUOX5U2.js → 6VIVKLOZ.js} +2 -2
- package/dist/cdn/{EBAB6Z7D.js → 6WQTTI45.js} +2 -2
- package/dist/cdn/{SV2I7E4T.js → 7HY5VYGF.js} +2 -2
- package/dist/cdn/{5MJ6OCXW.js → AA3RGNQS.js} +2 -2
- package/dist/cdn/{63BBC3VB.js → AHR7GKY2.js} +2 -2
- package/dist/cdn/{OYQNFJYV.js → AZMX3VES.js} +2 -2
- package/dist/cdn/{AJEAVY5R.js → B3RX47JG.js} +2 -2
- package/dist/cdn/DEKYLQNY.js +4 -0
- package/dist/cdn/{ZP7HITSD.js → EDUNCSRH.js} +2 -2
- package/dist/cdn/{H3AOOCUQ.js → ESKBVYWY.js} +2 -2
- package/dist/cdn/{MJ6BGN2Z.js → FGWNYKSK.js} +1 -1
- package/dist/cdn/{EQ263JIA.js → FQ4S4MQL.js} +2 -2
- package/dist/cdn/{4KPG4EZR.js → GABNNDZF.js} +2 -2
- package/dist/cdn/{HZ736LSE.js → GRFYSFDO.js} +2 -2
- package/dist/cdn/{HQCDMOT4.js → GUC6RWPA.js} +2 -2
- package/dist/cdn/{COFAYLCM.js → H6EJ7K2K.js} +4 -4
- package/dist/cdn/{HW3L5Z2O.js → HHHXBLRQ.js} +1 -1
- package/dist/cdn/{B6WGMTJM.js → HIGL4D2T.js} +2 -2
- package/dist/cdn/{ZY3GSTCF.js → KGEEW2PR.js} +1 -1
- package/dist/cdn/{IMTR2WF4.js → L6GPKURV.js} +2 -2
- package/dist/cdn/{66HHSXAC.js → LBPEDG5M.js} +2 -2
- package/dist/cdn/{LVTZL6CJ.js → M33T4JQ5.js} +2 -2
- package/dist/cdn/{ETGXYFDH.js → MEHDX2XS.js} +2 -2
- package/dist/cdn/{35MNEKXS.js → NOPW2E56.js} +2 -2
- package/dist/cdn/{BR6G5324.js → PMOJTLUN.js} +2 -2
- package/dist/cdn/{DYVV7BMI.js → PRPEY5QL.js} +2 -2
- package/dist/cdn/{SJCBFNAF.js → UIANLPRF.js} +2 -2
- package/dist/cdn/{3VTVCVWK.js → UZVY3XUV.js} +2 -2
- package/dist/cdn/{HYB234PM.js → WMRVSEEP.js} +2 -2
- package/dist/cdn/{FECUZT65.js → WYZY5PNX.js} +2 -2
- package/dist/cdn/{K772MGDL.js → XZSJLWYI.js} +1 -1
- package/dist/cdn/{B675FOE5.js → YEYPHDKV.js} +2 -2
- package/dist/cdn/{JVRARS6T.js → YTIS32Z5.js} +2 -2
- package/dist/cdn/{LDNGUQKH.js → ZZGOLIME.js} +2 -2
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +58147 -57403
- 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 +212 -156
- package/dist/components/arcgis-arcade-coding-assistant/functional.d.ts +46 -4
- package/dist/components/arcgis-arcade-coding-assistant/index.d.ts +10 -5
- package/dist/components/arcgis-arcade-coding-assistant/index.js +10 -5
- 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 +5 -5
- package/dist/docs/docs.json +5 -5
- 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/LWNFDMZO.js +0 -4
- package/dist/cdn/R4LX2QTT.js +0 -5
|
@@ -1,136 +1,174 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as q } from "../../chunks/runtime.js";
|
|
2
2
|
import { html as n } from "lit-html";
|
|
3
|
-
import {
|
|
4
|
-
import { ref as
|
|
5
|
-
import
|
|
6
|
-
import { u as
|
|
7
|
-
import { b as
|
|
3
|
+
import { nothing as P, LitElement as V } from "@arcgis/lumina";
|
|
4
|
+
import { ref as _, createRef as D } from "lit/directives/ref.js";
|
|
5
|
+
import j from "@arcgis/core/identity/IdentityManager.js";
|
|
6
|
+
import { u as z } from "../../chunks/useT9n.js";
|
|
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
|
|
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.34/esri/copyright.txt for details.
|
|
18
|
-
v4.34.0-next.
|
|
19
|
-
const
|
|
20
|
-
function
|
|
19
|
+
v4.34.0-next.20 */
|
|
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}`;
|
|
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:
|
|
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,
|
|
36
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 b =
|
|
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
|
|
62
|
-
async function
|
|
63
|
-
let
|
|
60
|
+
d.push(p);
|
|
61
|
+
const T = p.conversationId, M = p.inquiryId;
|
|
62
|
+
let w = p.sequenceNumber;
|
|
63
|
+
async function F() {
|
|
64
|
+
let f = 0;
|
|
64
65
|
const b = 25;
|
|
65
|
-
for (;
|
|
66
|
-
await new Promise((
|
|
67
|
-
const
|
|
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
|
|
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
|
|
112
|
+
function K({ messages: i }) {
|
|
110
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 n`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-
|
|
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
|
|
118
|
+
function Z({ errorMessage: i }) {
|
|
116
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
|
|
121
|
+
function ee({ active: i, setActive: e, messages: t }) {
|
|
119
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 n`<div class="text-area-wrapper"><calcite-text-area resize=
|
|
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>`;
|
|
132
|
+
}
|
|
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>`;
|
|
135
|
+
}
|
|
136
|
+
function C({ assistantsEnabled: i, messages: e, slot: t }) {
|
|
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>`;
|
|
129
148
|
}
|
|
130
|
-
function
|
|
131
|
-
return n`<calcite-
|
|
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>`;
|
|
132
151
|
}
|
|
133
|
-
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 = [
|
|
134
172
|
"your_comments",
|
|
135
173
|
"user_evaluation",
|
|
136
174
|
"question",
|
|
@@ -141,146 +179,164 @@ const Z = "arcade_generation", ee = "ArcadeCodeRequest", te = "visualization", i
|
|
|
141
179
|
"context",
|
|
142
180
|
"extras"
|
|
143
181
|
];
|
|
144
|
-
let
|
|
145
|
-
class
|
|
182
|
+
let E = [], I = !0;
|
|
183
|
+
class pe extends V {
|
|
146
184
|
constructor() {
|
|
147
|
-
super(...arguments), this.textAreaRef = D(), this.messages =
|
|
148
|
-
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 };
|
|
149
187
|
}, this.handleFeedbackSheetClose = () => {
|
|
150
|
-
this.
|
|
188
|
+
this.feedback = { active: !1, value: void 0, text: "", item: void 0 };
|
|
151
189
|
}, this.handleFeedbackSubmit = async () => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (!this.feedbackService) {
|
|
155
|
-
const c = new _({
|
|
156
|
-
url: this.feedbackServiceUrl
|
|
157
|
-
});
|
|
158
|
-
await c.load();
|
|
159
|
-
const r = c.fields, a = [];
|
|
160
|
-
if (se.forEach((l) => {
|
|
161
|
-
r.some((d) => d.name === l) || a.push(l);
|
|
162
|
-
}), a.length > 0) {
|
|
163
|
-
console.error(`Missing the following fields in feedback service: ${a.join(", ")}.
|
|
164
|
-
Feedback will not be logged.`), this.handleFeedbackSheetClose();
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
this.feedbackService = c;
|
|
168
|
-
}
|
|
169
|
-
const e = this.getModel(), t = e ? await this.getProfileAndMetadata(e.uri) : void 0, s = {
|
|
170
|
-
user_evaluation: this.feedbackValue,
|
|
171
|
-
your_comments: this.feedbackText,
|
|
172
|
-
question: this.question,
|
|
173
|
-
answer: this.history[0]?.script ?? "",
|
|
174
|
-
useragent: navigator.userAgent,
|
|
175
|
-
_source: ie,
|
|
176
|
-
version: this.appVersion ?? "",
|
|
177
|
-
// TODO: this comes from app
|
|
178
|
-
context: t ? JSON.stringify(t) : "",
|
|
179
|
-
extras: t?.profileName ?? ""
|
|
180
|
-
}, o = new z({
|
|
181
|
-
attributes: s
|
|
182
|
-
});
|
|
183
|
-
try {
|
|
184
|
-
await this.feedbackService?.applyEdits({
|
|
185
|
-
addFeatures: [o]
|
|
186
|
-
});
|
|
187
|
-
} catch (c) {
|
|
188
|
-
console.error("Error submitting feedback:", c);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
190
|
+
const e = await this.ensureFeedbackService();
|
|
191
|
+
if (!e) {
|
|
191
192
|
this.handleFeedbackSheetClose();
|
|
193
|
+
return;
|
|
192
194
|
}
|
|
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,
|
|
198
|
+
question: this.question,
|
|
199
|
+
answer: this.feedback.item?.script ?? "",
|
|
200
|
+
useragent: navigator.userAgent,
|
|
201
|
+
_source: le,
|
|
202
|
+
version: this.appVersion ?? "",
|
|
203
|
+
context: a ? JSON.stringify(a) : "",
|
|
204
|
+
extras: a?.profileName ?? "",
|
|
205
|
+
conversation_id: this.feedback.item?.conversationId ?? ""
|
|
206
|
+
};
|
|
207
|
+
try {
|
|
208
|
+
await e.applyEdits({ addFeatures: [new G({ attributes: c })] });
|
|
209
|
+
} catch (o) {
|
|
210
|
+
console.error("Error submitting feedback:", o);
|
|
211
|
+
}
|
|
212
|
+
this.handleFeedbackSheetClose();
|
|
193
213
|
}, this.handleClose = (e) => {
|
|
194
214
|
this.closed = !0, this.closePanel?.(e);
|
|
195
215
|
}, this.setQuestion = (e) => {
|
|
196
216
|
this.question = e;
|
|
197
|
-
}, 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;
|
|
198
220
|
}
|
|
199
221
|
static {
|
|
200
|
-
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 };
|
|
201
223
|
}
|
|
202
224
|
static {
|
|
203
|
-
this.styles =
|
|
225
|
+
this.styles = Q;
|
|
204
226
|
}
|
|
205
227
|
async destroy() {
|
|
206
228
|
}
|
|
207
229
|
connectedCallback() {
|
|
208
|
-
super.connectedCallback(), this.history =
|
|
230
|
+
super.connectedCallback(), this.history = E, this.splashActive = I;
|
|
209
231
|
}
|
|
210
232
|
disconnectedCallback() {
|
|
211
|
-
super.disconnectedCallback(),
|
|
233
|
+
super.disconnectedCallback(), E = this.history, I = this.splashActive;
|
|
234
|
+
}
|
|
235
|
+
async ensureFeedbackService() {
|
|
236
|
+
if (this._feedbackService)
|
|
237
|
+
return this._feedbackService;
|
|
238
|
+
if (!this.feedbackServiceUrl)
|
|
239
|
+
return;
|
|
240
|
+
const e = new W({ url: this.feedbackServiceUrl });
|
|
241
|
+
await e.load();
|
|
242
|
+
const t = de.filter((a) => !e.fields.some((c) => c.name === a));
|
|
243
|
+
if (t.length > 0) {
|
|
244
|
+
console.error(`Missing the following fields in feedback service: ${t.join(", ")}. Feedback will not be logged.`);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
return this._feedbackService = e, e;
|
|
212
248
|
}
|
|
213
249
|
getModel() {
|
|
214
250
|
return this.editorRef.editorInstance?.getModel();
|
|
215
251
|
}
|
|
216
252
|
async submitQuestion() {
|
|
217
253
|
if (this.question) {
|
|
218
|
-
this.
|
|
254
|
+
this.isSubmitting = !0;
|
|
219
255
|
try {
|
|
220
256
|
const e = await this.getToken(), t = this.getModel();
|
|
221
257
|
if (!t)
|
|
222
258
|
return;
|
|
223
|
-
const { profileName:
|
|
259
|
+
const { profileName: a, metadata: c } = await this.getProfileAndMetadata(t.uri), r = (await J({
|
|
224
260
|
baseUrl: this.serviceUrl,
|
|
225
|
-
skillId:
|
|
261
|
+
skillId: oe,
|
|
226
262
|
message: this.question,
|
|
227
263
|
authToken: e,
|
|
228
264
|
context: {
|
|
229
|
-
kind:
|
|
265
|
+
kind: re,
|
|
230
266
|
context: {
|
|
231
|
-
profile_name:
|
|
232
|
-
metadata:
|
|
267
|
+
profile_name: a,
|
|
268
|
+
metadata: c
|
|
233
269
|
}
|
|
234
270
|
}
|
|
235
|
-
})).find((
|
|
271
|
+
})).find((s) => s.context?.kind === "ArcadeCodeResponse");
|
|
236
272
|
if (!r)
|
|
237
273
|
return;
|
|
238
274
|
r.context?.kind === "ArcadeCodeResponse" && (this.history.unshift({
|
|
239
275
|
script: r?.context?.arcadeCode?.code,
|
|
240
276
|
error: void 0,
|
|
241
|
-
question: this.question
|
|
277
|
+
question: this.question,
|
|
278
|
+
profile: a,
|
|
279
|
+
conversationId: r.conversationId
|
|
242
280
|
}), this.isViewingResult = !0, this.errorMessage = void 0);
|
|
243
281
|
} catch (e) {
|
|
244
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);
|
|
245
283
|
} finally {
|
|
246
|
-
this.
|
|
284
|
+
this.isSubmitting = !1;
|
|
247
285
|
}
|
|
248
286
|
}
|
|
249
287
|
}
|
|
250
288
|
async getToken() {
|
|
251
|
-
const { token: e } = await
|
|
289
|
+
const { token: e } = await j.getCredential(this.orgBaseUrl);
|
|
252
290
|
return e;
|
|
253
291
|
}
|
|
254
292
|
async getProfileAndMetadata(e) {
|
|
255
|
-
let t =
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
const
|
|
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");
|
|
261
299
|
let r = [];
|
|
262
|
-
return
|
|
263
|
-
name:
|
|
264
|
-
type:
|
|
265
|
-
alias:
|
|
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
|
|
266
304
|
}))), { profileName: t, metadata: r };
|
|
267
305
|
}
|
|
268
306
|
render() {
|
|
269
|
-
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}>${
|
|
270
|
-
|
|
271
|
-
}}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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>`;
|
|
281
337
|
}
|
|
282
338
|
}
|
|
283
|
-
|
|
339
|
+
q("arcgis-arcade-coding-assistant", pe);
|
|
284
340
|
export {
|
|
285
|
-
|
|
341
|
+
pe as ArcgisArcadeCodingAssistant
|
|
286
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;
|
|
@@ -90,8 +91,8 @@ declare const strings: (value: {
|
|
|
90
91
|
export declare function AboutDisplay({ messages }: {
|
|
91
92
|
messages: Partial<ReturnType<typeof strings>>;
|
|
92
93
|
}): JsxNode;
|
|
93
|
-
export declare function DisclaimerDisplay({
|
|
94
|
-
|
|
94
|
+
export declare function DisclaimerDisplay({ popoverContent }: {
|
|
95
|
+
popoverContent: JsxNode;
|
|
95
96
|
}): JsxNode;
|
|
96
97
|
export declare function ErrorDisplay({ errorMessage }: {
|
|
97
98
|
errorMessage?: 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;
|
|
@@ -123,4 +125,44 @@ export declare function FeedbackSheetDisplay({ open, setOpen, messages, feedback
|
|
|
123
125
|
setFeedbackText: (val: string) => void;
|
|
124
126
|
onSubmit: () => void;
|
|
125
127
|
}): JsxNode;
|
|
128
|
+
export declare function InfoDisplay({ assistantsEnabled, messages, slot, }: {
|
|
129
|
+
assistantsEnabled: boolean;
|
|
130
|
+
messages: Partial<ReturnType<typeof strings>>;
|
|
131
|
+
slot?: HTMLCalciteBlockElement["slot"];
|
|
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;
|
|
126
168
|
export {};
|