@sourcegraph/cody-web 0.19.0 → 0.20.0
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/{agent.worker-DPD_k696.mjs → agent.worker-C43kSzdJ.mjs} +2205 -1910
- package/dist/agent.worker.js +2 -2
- package/dist/{browser-Ct2FvU41.mjs → browser-C8qAwvsz.mjs} +3065 -2981
- package/dist/{git-log-LuZe_Ru4.mjs → git-log-CMMJVHUP.mjs} +2 -2
- package/dist/{index-B3HUdChN.mjs → index-CnAmRHEe.mjs} +2 -2
- package/dist/index.js +763 -510
- package/dist/style.css +117 -52
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
|
-
import { g as getDefaultExportFromCjs,
|
|
5
|
+
import { g as getDefaultExportFromCjs, L as Ls, k as ke$1, a as ks, F as Fi$1, _ as _s, b as ds, c as bs, i as ii$1, q as qe$1, y as ys, x as xi$1, K as K$2, J as J$2, R as R$3, e as ws, B as B$2, f as g$5, h as h$4, j as _i, S as Ss, l as Br, m as ln, n as bi$1, v as vn, o as xn, N as Nn, r as mn, s as li$1, u as n$1, z as ns, M as M$4, D as Ds, A as le$2, E as c$3, G as oe$2, H as z$1, I as yi$1, W as W$2, U as Ue$1, O as I$2, P as Se$2, Q as O$2, T as F$1, V as Ni$1, X as ee$1, Y as we$2, Z as b$2, $ as T$3, a0 as s$2, a1 as o$4, a2 as w$3, a3 as i$1, a4 as k$3, a5 as D$5, a6 as p$8, a7 as m$7, a8 as S$4, a9 as v$4, aa as P$2, ab as E$6, ac as Wi$1, ad as L$3, ae as d$2, af as a$3, ag as l$2, ah as f$2, ai as u$6, aj as r$5, ak as t$2, al as isRemoteWorkspaceProvider, am as FILE_CONTEXT_MENTION_PROVIDER, an as SYMBOL_CONTEXT_MENTION_PROVIDER, ao as REMOTE_REPOSITORY_PROVIDER_URI, ap as REMOTE_FILE_PROVIDER_URI, aq as REMOTE_DIRECTORY_PROVIDER_URI, ar as WEB_PROVIDER_URI, as as WORKSPACE_DIRECTORY_PROVIDER_URI, at as WORKSPACE_REPOSITORY_PROVIDER_URI, au as displayPath, av as displayLineRange, aw as displayPathDirname, ax as displayPathBasename, ay as IGNORED_FILE_WARNING_LABEL, az as LARGE_FILE_WARNING_LABEL, aA as Ei$1, aB as xe$2, aC as V$2, aD as Es, aE as U$2, aF as e, aG as Ns, aH as object, aI as literal, aJ as string$2, aK as gs, aL as serializeContextItem, aM as CONTEXT_ITEM_MENTION_NODE_TYPE, aN as contextItemMentionNodeDisplayText, C as ContextItemSource, aO as URI, aP as is, aQ as an, aR as qr, aS as _$2, aT as TEMPLATE_INPUT_NODE_TYPE, aU as N$2, aV as parseMentionQuery, aW as NO_SYMBOL_MATCHES_HELP_LABEL, aX as FILE_RANGE_TOOLTIP_LABEL, aY as Observable$1, aZ as createExtensionAPI, a_ as createMessageAPIForWebview, a$ as debounce, b0 as memoizeLastValue, b1 as toSerializedPromptEditorValue, b2 as ri$1, b3 as isEqual, b4 as scanForMentionTriggerInUserTextInput, b5 as fs, b6 as Ts, b7 as ps, b8 as getMentionOperations, b9 as forceHydration, ba as hydrateAfterPostMessage, bb as isSourcegraphToken, bc as trace, bd as context$1, be as SpanStatusCode, bf as FeatureFlag, bg as webviewOpenURIForContextItem, bh as isCodyProUser, bi as commonjsGlobal, bj as CodyIDE, bk as CodyTaskState, bl as cryptoJsExports, bm as isError, bn as RateLimitError, bo as CODY_FEEDBACK_URL, bp as isDefined, bq as upperFirst, br as lodashExports, bs as createContextItem, bt as CODE_SEARCH_PROVIDER_URI, bu as reformatBotMessageForChat, bv as isAbortErrorOrSocketHangUp, bw as ModelTag, bx as serializedPromptEditorStateFromChatMessage, by as contextItemsFromPromptEditorValue, bz as filterContextItemsFromPromptEditorValue, bA as pluralize$1, bB as CustomCommandType, bC as View, bD as isCodyProModel, bE as isWaitlistModel, bF as isDotCom, bG as ACCOUNT_USAGE_URL, bH as ACCOUNT_UPGRADE_URL, bI as getRelativeChatPeriod, bJ as isMacOS, bK as firstResultFromOperation, bL as textContentFromSerializedLexicalNode, bM as firstValueFrom, bN as skipPendingOperation, bO as FAST_CHAT_INPUT_TOKEN_BUDGET, bP as inputTextWithMappedContextChipsFromPromptEditorState, bQ as deserializeContextItem, bR as truncateTextStart, bS as CHAT_INPUT_TOKEN_BUDGET, bT as DOTCOM_WORKSPACE_UPGRADE_URL, bU as DOTCOM_WORKSPACE_LEARN_MORE_URL, bV as S2_URL, bW as browser, bX as isErrorLike, bY as PromptString, bZ as setDisplayPathEnvInfo } from "./browser-C8qAwvsz.mjs";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import React__default, { createContext, useContext, useMemo, useLayoutEffect, useEffect, forwardRef, useState, useCallback, useRef, Suspense, createElement, memo, useImperativeHandle, Children, isValidElement, cloneElement, Fragment as Fragment$1, useReducer } from "react";
|
|
8
8
|
var classnames = { exports: {} };
|
|
@@ -64,97 +64,6 @@ var classnames = { exports: {} };
|
|
|
64
64
|
})(classnames);
|
|
65
65
|
var classnamesExports = classnames.exports;
|
|
66
66
|
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
67
|
-
function m$6(e2) {
|
|
68
|
-
return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
|
|
69
|
-
}
|
|
70
|
-
m$6(function(e2) {
|
|
71
|
-
const t2 = new URLSearchParams();
|
|
72
|
-
t2.append("code", e2);
|
|
73
|
-
for (let e3 = 1; e3 < arguments.length; e3++) t2.append("v", arguments[e3]);
|
|
74
|
-
throw Error(`Minified Lexical error #${e2}; visit https://lexical.dev/docs/error?${t2} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
75
|
-
});
|
|
76
|
-
const x$5 = /* @__PURE__ */ new Map();
|
|
77
|
-
function w$2(e2) {
|
|
78
|
-
const t2 = {}, n2 = e2.split(";");
|
|
79
|
-
for (const e3 of n2) if ("" !== e3) {
|
|
80
|
-
const [n3, l2] = e3.split(/:([^]+)/);
|
|
81
|
-
n3 && l2 && (t2[n3.trim()] = l2.trim());
|
|
82
|
-
}
|
|
83
|
-
return t2;
|
|
84
|
-
}
|
|
85
|
-
function E$5(e2, n2) {
|
|
86
|
-
const l2 = e2.getStartEndPoints();
|
|
87
|
-
if (n2.isSelected(e2) && !n2.isSegmented() && !n2.isToken() && null !== l2) {
|
|
88
|
-
const [o2, r2] = l2, s2 = e2.isBackward(), i2 = o2.getNode(), c2 = r2.getNode(), f2 = n2.is(i2), u2 = n2.is(c2);
|
|
89
|
-
if (f2 || u2) {
|
|
90
|
-
const [l3, o3] = xi$1(e2), r3 = i2.is(c2), f3 = n2.is(s2 ? c2 : i2), u3 = n2.is(s2 ? i2 : c2);
|
|
91
|
-
let g2, a2 = 0;
|
|
92
|
-
if (r3) a2 = l3 > o3 ? o3 : l3, g2 = l3 > o3 ? l3 : o3;
|
|
93
|
-
else if (f3) {
|
|
94
|
-
a2 = s2 ? o3 : l3, g2 = void 0;
|
|
95
|
-
} else if (u3) {
|
|
96
|
-
a2 = 0, g2 = s2 ? l3 : o3;
|
|
97
|
-
}
|
|
98
|
-
return n2.__text = n2.__text.slice(a2, g2), n2;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return n2;
|
|
102
|
-
}
|
|
103
|
-
function I$1(e2) {
|
|
104
|
-
const t2 = e2.getStyle(), n2 = w$2(t2);
|
|
105
|
-
x$5.set(t2, n2);
|
|
106
|
-
}
|
|
107
|
-
function A$2(e2, t2) {
|
|
108
|
-
const l2 = qe$1(e2.focus, t2);
|
|
109
|
-
return _s(l2) && !l2.isIsolated() || ds(l2) && !l2.isInline() && !l2.canBeEmpty();
|
|
110
|
-
}
|
|
111
|
-
function L$2(e2, t2, n2, l2) {
|
|
112
|
-
e2.modify(t2 ? "extend" : "move", n2, l2);
|
|
113
|
-
}
|
|
114
|
-
function D$4(e2) {
|
|
115
|
-
const t2 = e2.anchor.getNode();
|
|
116
|
-
return "rtl" === (ys(t2) ? t2 : t2.getParentOrThrow()).getDirection();
|
|
117
|
-
}
|
|
118
|
-
function M$3(e2, t2, n2) {
|
|
119
|
-
const l2 = D$4(e2);
|
|
120
|
-
L$2(e2, t2, n2 ? !l2 : l2, "character");
|
|
121
|
-
}
|
|
122
|
-
function g$4(e2) {
|
|
123
|
-
return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
|
|
124
|
-
}
|
|
125
|
-
var p$7 = g$4(function(e2) {
|
|
126
|
-
const t2 = new URLSearchParams();
|
|
127
|
-
t2.append("code", e2);
|
|
128
|
-
for (let e3 = 1; e3 < arguments.length; e3++) t2.append("v", arguments[e3]);
|
|
129
|
-
throw Error(`Minified Lexical error #${e2}; visit https://lexical.dev/docs/error?${t2} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
130
|
-
});
|
|
131
|
-
const h$3 = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement, m$5 = h$3 && "documentMode" in document ? document.documentMode : null;
|
|
132
|
-
!(!h$3 || !("InputEvent" in window) || m$5) && "getTargetRanges" in new window.InputEvent("input");
|
|
133
|
-
function b$1(...e2) {
|
|
134
|
-
return () => {
|
|
135
|
-
for (let t2 = e2.length - 1; t2 >= 0; t2--) e2[t2]();
|
|
136
|
-
e2.length = 0;
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
function J$1(e2) {
|
|
140
|
-
const t2 = Q$2(e2, (e3) => ds(e3) && !e3.isInline());
|
|
141
|
-
return ds(t2) || p$7(4, e2.__key), t2;
|
|
142
|
-
}
|
|
143
|
-
const Q$2 = (e2, t2) => {
|
|
144
|
-
let n2 = e2;
|
|
145
|
-
for (; n2 !== ke$1() && null != n2; ) {
|
|
146
|
-
if (t2(n2)) return n2;
|
|
147
|
-
n2 = n2.getParent();
|
|
148
|
-
}
|
|
149
|
-
return null;
|
|
150
|
-
};
|
|
151
|
-
function te$1(e2, t2) {
|
|
152
|
-
return null !== e2 && Object.getPrototypeOf(e2).constructor.name === t2.name;
|
|
153
|
-
}
|
|
154
|
-
function oe$1(e2, t2) {
|
|
155
|
-
const n2 = e2.getFirstChild();
|
|
156
|
-
null !== n2 ? n2.insertBefore(t2) : e2.append(t2);
|
|
157
|
-
}
|
|
158
67
|
function r$4(e2) {
|
|
159
68
|
var t2, f2, n2 = "";
|
|
160
69
|
if ("string" == typeof e2 || "number" == typeof e2) n2 += e2;
|
|
@@ -187,8 +96,8 @@ function u$5() {
|
|
|
187
96
|
const e2 = useContext(l$1);
|
|
188
97
|
return null == e2 && t$1(8), e2;
|
|
189
98
|
}
|
|
190
|
-
const s$1 = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement, m$
|
|
191
|
-
function p$
|
|
99
|
+
const s$1 = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement, m$6 = s$1 ? useLayoutEffect : useEffect, u$4 = { tag: "history-merge" };
|
|
100
|
+
function p$7({ initialConfig: a2, children: c2 }) {
|
|
192
101
|
const p2 = useMemo(() => {
|
|
193
102
|
const { theme: t2, namespace: c3, nodes: l2, onError: d2, editorState: m2, html: p3 } = a2, f2 = o$3(null, t2), E2 = Ls({ editable: a2.editable, html: p3, namespace: c3, nodes: l2, onError: (e2) => d2(e2, E2), theme: t2 });
|
|
194
103
|
return function(e2, t3) {
|
|
@@ -218,7 +127,7 @@ function p$6({ initialConfig: a2, children: c2 }) {
|
|
|
218
127
|
}
|
|
219
128
|
}(E2, m2), [E2, f2];
|
|
220
129
|
}, []);
|
|
221
|
-
return m$
|
|
130
|
+
return m$6(() => {
|
|
222
131
|
const e2 = a2.editable, [t2] = p2;
|
|
223
132
|
t2.setEditable(void 0 === e2 || e2);
|
|
224
133
|
}, []), jsx(l$1.Provider, { value: p2, children: c2 });
|
|
@@ -250,7 +159,7 @@ function c$2(o2) {
|
|
|
250
159
|
}
|
|
251
160
|
return true;
|
|
252
161
|
}
|
|
253
|
-
function g$
|
|
162
|
+
function g$4(t2) {
|
|
254
163
|
return () => c$2(t2);
|
|
255
164
|
}
|
|
256
165
|
function d$1(t2) {
|
|
@@ -262,6 +171,97 @@ d$1(function(t2) {
|
|
|
262
171
|
for (let t3 = 1; t3 < arguments.length; t3++) e2.append("v", arguments[t3]);
|
|
263
172
|
throw Error(`Minified Lexical error #${t2}; visit https://lexical.dev/docs/error?${e2} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
264
173
|
});
|
|
174
|
+
function m$5(e2) {
|
|
175
|
+
return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
|
|
176
|
+
}
|
|
177
|
+
m$5(function(e2) {
|
|
178
|
+
const t2 = new URLSearchParams();
|
|
179
|
+
t2.append("code", e2);
|
|
180
|
+
for (let e3 = 1; e3 < arguments.length; e3++) t2.append("v", arguments[e3]);
|
|
181
|
+
throw Error(`Minified Lexical error #${e2}; visit https://lexical.dev/docs/error?${t2} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
182
|
+
});
|
|
183
|
+
const x$5 = /* @__PURE__ */ new Map();
|
|
184
|
+
function w$2(e2) {
|
|
185
|
+
const t2 = {}, n2 = e2.split(";");
|
|
186
|
+
for (const e3 of n2) if ("" !== e3) {
|
|
187
|
+
const [n3, l2] = e3.split(/:([^]+)/);
|
|
188
|
+
n3 && l2 && (t2[n3.trim()] = l2.trim());
|
|
189
|
+
}
|
|
190
|
+
return t2;
|
|
191
|
+
}
|
|
192
|
+
function E$5(e2, n2) {
|
|
193
|
+
const l2 = e2.getStartEndPoints();
|
|
194
|
+
if (n2.isSelected(e2) && !n2.isSegmented() && !n2.isToken() && null !== l2) {
|
|
195
|
+
const [o2, r2] = l2, s2 = e2.isBackward(), i2 = o2.getNode(), c2 = r2.getNode(), f2 = n2.is(i2), u2 = n2.is(c2);
|
|
196
|
+
if (f2 || u2) {
|
|
197
|
+
const [l3, o3] = xi$1(e2), r3 = i2.is(c2), f3 = n2.is(s2 ? c2 : i2), u3 = n2.is(s2 ? i2 : c2);
|
|
198
|
+
let g2, a2 = 0;
|
|
199
|
+
if (r3) a2 = l3 > o3 ? o3 : l3, g2 = l3 > o3 ? l3 : o3;
|
|
200
|
+
else if (f3) {
|
|
201
|
+
a2 = s2 ? o3 : l3, g2 = void 0;
|
|
202
|
+
} else if (u3) {
|
|
203
|
+
a2 = 0, g2 = s2 ? l3 : o3;
|
|
204
|
+
}
|
|
205
|
+
return n2.__text = n2.__text.slice(a2, g2), n2;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return n2;
|
|
209
|
+
}
|
|
210
|
+
function I$1(e2) {
|
|
211
|
+
const t2 = e2.getStyle(), n2 = w$2(t2);
|
|
212
|
+
x$5.set(t2, n2);
|
|
213
|
+
}
|
|
214
|
+
function A$2(e2, t2) {
|
|
215
|
+
const l2 = qe$1(e2.focus, t2);
|
|
216
|
+
return _s(l2) && !l2.isIsolated() || ds(l2) && !l2.isInline() && !l2.canBeEmpty();
|
|
217
|
+
}
|
|
218
|
+
function L$2(e2, t2, n2, l2) {
|
|
219
|
+
e2.modify(t2 ? "extend" : "move", n2, l2);
|
|
220
|
+
}
|
|
221
|
+
function D$4(e2) {
|
|
222
|
+
const t2 = e2.anchor.getNode();
|
|
223
|
+
return "rtl" === (ys(t2) ? t2 : t2.getParentOrThrow()).getDirection();
|
|
224
|
+
}
|
|
225
|
+
function M$3(e2, t2, n2) {
|
|
226
|
+
const l2 = D$4(e2);
|
|
227
|
+
L$2(e2, t2, n2 ? !l2 : l2, "character");
|
|
228
|
+
}
|
|
229
|
+
function g$3(e2) {
|
|
230
|
+
return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
|
|
231
|
+
}
|
|
232
|
+
var p$6 = g$3(function(e2) {
|
|
233
|
+
const t2 = new URLSearchParams();
|
|
234
|
+
t2.append("code", e2);
|
|
235
|
+
for (let e3 = 1; e3 < arguments.length; e3++) t2.append("v", arguments[e3]);
|
|
236
|
+
throw Error(`Minified Lexical error #${e2}; visit https://lexical.dev/docs/error?${t2} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
237
|
+
});
|
|
238
|
+
const h$3 = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement, m$4 = h$3 && "documentMode" in document ? document.documentMode : null;
|
|
239
|
+
!(!h$3 || !("InputEvent" in window) || m$4) && "getTargetRanges" in new window.InputEvent("input");
|
|
240
|
+
function b$1(...e2) {
|
|
241
|
+
return () => {
|
|
242
|
+
for (let t2 = e2.length - 1; t2 >= 0; t2--) e2[t2]();
|
|
243
|
+
e2.length = 0;
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function J$1(e2) {
|
|
247
|
+
const t2 = Q$2(e2, (e3) => ds(e3) && !e3.isInline());
|
|
248
|
+
return ds(t2) || p$6(4, e2.__key), t2;
|
|
249
|
+
}
|
|
250
|
+
const Q$2 = (e2, t2) => {
|
|
251
|
+
let n2 = e2;
|
|
252
|
+
for (; n2 !== ke$1() && null != n2; ) {
|
|
253
|
+
if (t2(n2)) return n2;
|
|
254
|
+
n2 = n2.getParent();
|
|
255
|
+
}
|
|
256
|
+
return null;
|
|
257
|
+
};
|
|
258
|
+
function te$1(e2, t2) {
|
|
259
|
+
return null !== e2 && Object.getPrototypeOf(e2).constructor.name === t2.name;
|
|
260
|
+
}
|
|
261
|
+
function oe$1(e2, t2) {
|
|
262
|
+
const n2 = e2.getFirstChild();
|
|
263
|
+
null !== n2 ? n2.insertBefore(t2) : e2.append(t2);
|
|
264
|
+
}
|
|
265
265
|
const m$3 = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement ? useLayoutEffect : useEffect;
|
|
266
266
|
function f$1({ editor: e2, ariaActiveDescendant: t2, ariaAutoComplete: i2, ariaControls: a2, ariaDescribedBy: d2, ariaExpanded: c2, ariaLabel: s2, ariaLabelledBy: u2, ariaMultiline: f2, ariaOwns: b2, ariaRequired: p2, autoCapitalize: x2, className: E2, id: v2, role: w2 = "textbox", spellCheck: y2 = true, style: C2, tabIndex: h2, "data-testid": L2, ...g2 }, D2) {
|
|
267
267
|
const [R2, k2] = useState(e2.isEditable()), q = useCallback((t3) => {
|
|
@@ -279,7 +279,7 @@ function f$1({ editor: e2, ariaActiveDescendant: t2, ariaAutoComplete: i2, ariaC
|
|
|
279
279
|
}
|
|
280
280
|
const b = forwardRef(f$1);
|
|
281
281
|
function p$5(e2) {
|
|
282
|
-
return e2.getEditorState().read(g$
|
|
282
|
+
return e2.getEditorState().read(g$4(e2.isComposing()));
|
|
283
283
|
}
|
|
284
284
|
const x$4 = forwardRef(E$4);
|
|
285
285
|
function E$4(t2, i2) {
|
|
@@ -7627,7 +7627,7 @@ function Tt(o2) {
|
|
|
7627
7627
|
}
|
|
7628
7628
|
const g = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement ? useLayoutEffect : useEffect;
|
|
7629
7629
|
function E$1(t2) {
|
|
7630
|
-
return t2.getEditorState().read(g$
|
|
7630
|
+
return t2.getEditorState().read(g$4(t2.isComposing()));
|
|
7631
7631
|
}
|
|
7632
7632
|
function h({ contentEditable: e2, placeholder: r2 = null, ErrorBoundary: n2 }) {
|
|
7633
7633
|
const [E2] = u$5(), h2 = function(t2, e3) {
|
|
@@ -7672,7 +7672,7 @@ const editor$2 = "_editor_s4gjm_1";
|
|
|
7672
7672
|
const contentEditable = "_content-editable_s4gjm_6";
|
|
7673
7673
|
const placeholder = "_placeholder_s4gjm_14";
|
|
7674
7674
|
const themeParagraph = "_theme-paragraph_s4gjm_29";
|
|
7675
|
-
const styles$
|
|
7675
|
+
const styles$A = {
|
|
7676
7676
|
editor: editor$2,
|
|
7677
7677
|
contentEditable,
|
|
7678
7678
|
placeholder,
|
|
@@ -8163,6 +8163,17 @@ const File = createLucideIcon("File", [
|
|
|
8163
8163
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
8164
8164
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
|
|
8165
8165
|
]);
|
|
8166
|
+
/**
|
|
8167
|
+
* @license lucide-react v0.378.0 - ISC
|
|
8168
|
+
*
|
|
8169
|
+
* This source code is licensed under the ISC license.
|
|
8170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
8171
|
+
*/
|
|
8172
|
+
const FilterX = createLucideIcon("FilterX", [
|
|
8173
|
+
["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
|
|
8174
|
+
["path", { d: "m22 3-5 5", key: "12jva0" }],
|
|
8175
|
+
["path", { d: "m17 3 5 5", key: "k36vhe" }]
|
|
8176
|
+
]);
|
|
8166
8177
|
/**
|
|
8167
8178
|
* @license lucide-react v0.378.0 - ISC
|
|
8168
8179
|
*
|
|
@@ -8340,6 +8351,23 @@ const MessagesSquare = createLucideIcon("MessagesSquare", [
|
|
|
8340
8351
|
["path", { d: "M14 9a2 2 0 0 1-2 2H6l-4 4V4c0-1.1.9-2 2-2h8a2 2 0 0 1 2 2z", key: "jj09z8" }],
|
|
8341
8352
|
["path", { d: "M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1", key: "1cx29u" }]
|
|
8342
8353
|
]);
|
|
8354
|
+
/**
|
|
8355
|
+
* @license lucide-react v0.378.0 - ISC
|
|
8356
|
+
*
|
|
8357
|
+
* This source code is licensed under the ISC license.
|
|
8358
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
8359
|
+
*/
|
|
8360
|
+
const OctagonX = createLucideIcon("OctagonX", [
|
|
8361
|
+
[
|
|
8362
|
+
"polygon",
|
|
8363
|
+
{
|
|
8364
|
+
points: "7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",
|
|
8365
|
+
key: "h1p8hx"
|
|
8366
|
+
}
|
|
8367
|
+
],
|
|
8368
|
+
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
8369
|
+
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
8370
|
+
]);
|
|
8343
8371
|
/**
|
|
8344
8372
|
* @license lucide-react v0.378.0 - ISC
|
|
8345
8373
|
*
|
|
@@ -8350,6 +8378,17 @@ const Option$2 = createLucideIcon("Option", [
|
|
|
8350
8378
|
["path", { d: "M3 3h6l6 18h6", key: "ph9rgk" }],
|
|
8351
8379
|
["path", { d: "M14 3h7", key: "16f0ms" }]
|
|
8352
8380
|
]);
|
|
8381
|
+
/**
|
|
8382
|
+
* @license lucide-react v0.378.0 - ISC
|
|
8383
|
+
*
|
|
8384
|
+
* This source code is licensed under the ISC license.
|
|
8385
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
8386
|
+
*/
|
|
8387
|
+
const PanelLeftClose = createLucideIcon("PanelLeftClose", [
|
|
8388
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
8389
|
+
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
8390
|
+
["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
|
|
8391
|
+
]);
|
|
8353
8392
|
/**
|
|
8354
8393
|
* @license lucide-react v0.378.0 - ISC
|
|
8355
8394
|
*
|
|
@@ -8581,7 +8620,7 @@ const title$1 = "_title_1ibg5_5";
|
|
|
8581
8620
|
const description = "_description_1ibg5_5";
|
|
8582
8621
|
const warning = "_warning_1ibg5_5";
|
|
8583
8622
|
const row$1 = "_row_1ibg5_11";
|
|
8584
|
-
const styles$
|
|
8623
|
+
const styles$z = {
|
|
8585
8624
|
title: title$1,
|
|
8586
8625
|
description,
|
|
8587
8626
|
warning,
|
|
@@ -8635,12 +8674,12 @@ const MentionMenuContextItemContent = ({ query, item: item2 }) => {
|
|
|
8635
8674
|
warning2 = "";
|
|
8636
8675
|
}
|
|
8637
8676
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8638
|
-
/* @__PURE__ */ jsxs("div", { className: styles$
|
|
8677
|
+
/* @__PURE__ */ jsxs("div", { className: styles$z.row, children: [
|
|
8639
8678
|
icon2 && /* @__PURE__ */ jsx("i", { className: `codicon codicon-${icon2}`, title: isSymbol ? item2.kind : "" }),
|
|
8640
|
-
/* @__PURE__ */ jsx("span", { className: clsx$1(styles$
|
|
8641
|
-
description2 && /* @__PURE__ */ jsx("span", { className: styles$
|
|
8679
|
+
/* @__PURE__ */ jsx("span", { className: clsx$1(styles$z.title, warning2 && styles$z.titleWithWarning), title: title2, children: displayName }),
|
|
8680
|
+
description2 && /* @__PURE__ */ jsx("span", { className: styles$z.description, title: description2, children: description2 })
|
|
8642
8681
|
] }),
|
|
8643
|
-
warning2 && /* @__PURE__ */ jsx("span", { className: styles$
|
|
8682
|
+
warning2 && /* @__PURE__ */ jsx("span", { className: styles$z.warning, children: warning2 })
|
|
8644
8683
|
] });
|
|
8645
8684
|
};
|
|
8646
8685
|
const MentionMenuProviderItemContent = ({ provider }) => {
|
|
@@ -8650,7 +8689,7 @@ const MentionMenuProviderItemContent = ({ provider }) => {
|
|
|
8650
8689
|
"a",
|
|
8651
8690
|
{
|
|
8652
8691
|
href: provider.id,
|
|
8653
|
-
className: clsx$1(styles$
|
|
8692
|
+
className: clsx$1(styles$z.row, "tw-text-inherit tw-w-full"),
|
|
8654
8693
|
title: provider.id,
|
|
8655
8694
|
target: "_blank",
|
|
8656
8695
|
rel: "noopener noreferrer",
|
|
@@ -8665,7 +8704,7 @@ const MentionMenuProviderItemContent = ({ provider }) => {
|
|
|
8665
8704
|
}
|
|
8666
8705
|
);
|
|
8667
8706
|
}
|
|
8668
|
-
return /* @__PURE__ */ jsxs("div", { className: styles$
|
|
8707
|
+
return /* @__PURE__ */ jsxs("div", { className: styles$z.row, title: provider.id, children: [
|
|
8669
8708
|
/* @__PURE__ */ jsx(Icon2, { size: 16, strokeWidth: 1.75 }),
|
|
8670
8709
|
provider.title ?? provider.id,
|
|
8671
8710
|
/* @__PURE__ */ jsx(ArrowRight, { size: 16, strokeWidth: 1.25, style: { opacity: "0.5" } })
|
|
@@ -8703,7 +8742,7 @@ const contextItemMentionNode = "_context-item-mention-node_1eamp_1";
|
|
|
8703
8742
|
const icon$1 = "_icon_1eamp_14";
|
|
8704
8743
|
const contextItemMentionChipNodeFocused = "_context-item-mention-chip-node--focused_1eamp_28";
|
|
8705
8744
|
const isTooLargeOrIgnored = "_is-too-large-or-ignored_1eamp_33";
|
|
8706
|
-
const styles$
|
|
8745
|
+
const styles$y = {
|
|
8707
8746
|
contextItemMentionNode,
|
|
8708
8747
|
icon: icon$1,
|
|
8709
8748
|
contextItemMentionChipNodeFocused,
|
|
@@ -8950,7 +8989,7 @@ const MentionComponent = ({ nodeKey, node: node2, tooltip, icon: Icon2, classNam
|
|
|
8950
8989
|
tooltip && /* @__PURE__ */ jsx(TooltipContent2, { children: tooltip })
|
|
8951
8990
|
] });
|
|
8952
8991
|
};
|
|
8953
|
-
const MENTION_CLASS_NAME = styles$
|
|
8992
|
+
const MENTION_CLASS_NAME = styles$y.contextItemMentionNode;
|
|
8954
8993
|
function convertContextItemMentionElement(domNode) {
|
|
8955
8994
|
const data = domNode.getAttribute(DOM_DATA_ATTR);
|
|
8956
8995
|
if (data !== null) {
|
|
@@ -9057,8 +9096,8 @@ class ContextItemMentionNode extends gs {
|
|
|
9057
9096
|
className: `${MENTION_NODE_CLASS_NAME} ${extraClassNamesForContextItem(
|
|
9058
9097
|
this.contextItem
|
|
9059
9098
|
)}`,
|
|
9060
|
-
focusedClassName: styles$
|
|
9061
|
-
iconClassName: styles$
|
|
9099
|
+
focusedClassName: styles$y.contextItemMentionChipNodeFocused,
|
|
9100
|
+
iconClassName: styles$y.icon
|
|
9062
9101
|
}
|
|
9063
9102
|
);
|
|
9064
9103
|
}
|
|
@@ -9077,7 +9116,7 @@ function $createContextItemMentionNode(contextItem2, { isFromInitialContext } =
|
|
|
9077
9116
|
function extraClassNamesForContextItem(contextItem2) {
|
|
9078
9117
|
const classNames2 = [];
|
|
9079
9118
|
if (contextItem2.isTooLarge || contextItem2.isIgnored) {
|
|
9080
|
-
classNames2.push(styles$
|
|
9119
|
+
classNames2.push(styles$y.isTooLargeOrIgnored);
|
|
9081
9120
|
}
|
|
9082
9121
|
return classNames2.join(" ");
|
|
9083
9122
|
}
|
|
@@ -9156,7 +9195,7 @@ const TemplateInputComponent = ({ editor: editor2, nodeKey, node: node2, classNa
|
|
|
9156
9195
|
};
|
|
9157
9196
|
const templateInputNode = "_template-input-node_14yoh_1";
|
|
9158
9197
|
const templateInputNodeFocused = "_template-input-node--focused_14yoh_16";
|
|
9159
|
-
const styles$
|
|
9198
|
+
const styles$x = {
|
|
9160
9199
|
templateInputNode,
|
|
9161
9200
|
templateInputNodeFocused
|
|
9162
9201
|
};
|
|
@@ -9189,8 +9228,8 @@ class TemplateInputNode extends gs {
|
|
|
9189
9228
|
editor: editor2,
|
|
9190
9229
|
nodeKey: this.getKey(),
|
|
9191
9230
|
node: this,
|
|
9192
|
-
className: `${styles$
|
|
9193
|
-
focusedClassName: `${styles$
|
|
9231
|
+
className: `${styles$x.templateInputNode}`,
|
|
9232
|
+
focusedClassName: `${styles$x.templateInputNodeFocused}`
|
|
9194
9233
|
}
|
|
9195
9234
|
);
|
|
9196
9235
|
}
|
|
@@ -9396,7 +9435,7 @@ function L({ options: e2, onQueryChange: n2, onSelectOption: o2, onOpen: r2, onC
|
|
|
9396
9435
|
}
|
|
9397
9436
|
const popoverDimensions = "_popover-dimensions_1uf3m_1";
|
|
9398
9437
|
const popover$1 = "_popover_1uf3m_1";
|
|
9399
|
-
const styles$
|
|
9438
|
+
const styles$w = {
|
|
9400
9439
|
popoverDimensions,
|
|
9401
9440
|
popover: popover$1
|
|
9402
9441
|
};
|
|
@@ -9410,12 +9449,12 @@ function contextItemID(item2) {
|
|
|
9410
9449
|
item2.range ? `${item2.range.start.line}:${item2.range.start.character}-${item2.range.end.line}:${item2.range.end.character}` : ""
|
|
9411
9450
|
]);
|
|
9412
9451
|
}
|
|
9413
|
-
const container$
|
|
9452
|
+
const container$3 = "_container_fr158_1";
|
|
9414
9453
|
const item$2 = "_item_fr158_8";
|
|
9415
9454
|
const contextItem$1 = "_context-item_fr158_9";
|
|
9416
9455
|
const experimental = "_experimental_fr158_17";
|
|
9417
|
-
const styles$
|
|
9418
|
-
container: container$
|
|
9456
|
+
const styles$v = {
|
|
9457
|
+
container: container$3,
|
|
9419
9458
|
item: item$2,
|
|
9420
9459
|
contextItem: contextItem$1,
|
|
9421
9460
|
experimental
|
|
@@ -9572,7 +9611,7 @@ const MentionMenu = ({
|
|
|
9572
9611
|
{
|
|
9573
9612
|
value: commandRowValue$1(provider),
|
|
9574
9613
|
onSelect: onProviderSelect,
|
|
9575
|
-
className: clsx$1(styles$
|
|
9614
|
+
className: clsx$1(styles$v.item, COMMAND_ROW_CLASS_NAME),
|
|
9576
9615
|
children: /* @__PURE__ */ jsx(MentionMenuProviderItemContent, { provider })
|
|
9577
9616
|
},
|
|
9578
9617
|
commandRowValue$1(provider)
|
|
@@ -9585,7 +9624,7 @@ const MentionMenu = ({
|
|
|
9585
9624
|
shouldFilter: false,
|
|
9586
9625
|
value: effectiveValueRow ? commandRowValue$1(effectiveValueRow) : void 0,
|
|
9587
9626
|
onValueChange: setValue,
|
|
9588
|
-
className: styles$
|
|
9627
|
+
className: styles$v.container,
|
|
9589
9628
|
label: "@-mention context",
|
|
9590
9629
|
ref: ref2,
|
|
9591
9630
|
"data-testid": "mention-menu",
|
|
@@ -9597,7 +9636,7 @@ const MentionMenu = ({
|
|
|
9597
9636
|
value: commandRowValue$1(item2),
|
|
9598
9637
|
disabled: item2.isIgnored,
|
|
9599
9638
|
onSelect: onCommandSelect,
|
|
9600
|
-
className: clsx$1(styles$
|
|
9639
|
+
className: clsx$1(styles$v.item, styles$v.contextItem, COMMAND_ROW_CLASS_NAME),
|
|
9601
9640
|
children: /* @__PURE__ */ jsx(MentionMenuContextItemContent, { query: mentionQuery, item: item2 })
|
|
9602
9641
|
},
|
|
9603
9642
|
commandRowValue$1(item2)
|
|
@@ -9664,7 +9703,7 @@ function getItemsHeading(parentItem, mentionQuery) {
|
|
|
9664
9703
|
{
|
|
9665
9704
|
className: clsx$1(
|
|
9666
9705
|
"tw-text-xs tw-rounded tw-px-2 tw-text-foreground",
|
|
9667
|
-
styles$
|
|
9706
|
+
styles$v.experimental
|
|
9668
9707
|
),
|
|
9669
9708
|
children: "Experimental"
|
|
9670
9709
|
}
|
|
@@ -9797,7 +9836,7 @@ function useMentionMenuParams() {
|
|
|
9797
9836
|
() => ({
|
|
9798
9837
|
params,
|
|
9799
9838
|
updateQuery,
|
|
9800
|
-
updateMentionMenuParams: (
|
|
9839
|
+
updateMentionMenuParams: (update2) => setParams((prev) => ({ ...prev, ...update2 }))
|
|
9801
9840
|
}),
|
|
9802
9841
|
[params, updateQuery]
|
|
9803
9842
|
);
|
|
@@ -9999,7 +10038,7 @@ const MentionsPlugin = memo(
|
|
|
9999
10038
|
// max height of the visible menu. This ensures that the menu does not
|
|
10000
10039
|
// flip orientation as the user is typing if it suddenly has less
|
|
10001
10040
|
// results. It also makes the positioning less glitchy.
|
|
10002
|
-
/* @__PURE__ */ jsx("div", { "data-at-mention-menu": "", className: clsx$1(styles$
|
|
10041
|
+
/* @__PURE__ */ jsx("div", { "data-at-mention-menu": "", className: clsx$1(styles$w.popoverDimensions), children: /* @__PURE__ */ jsx("div", { className: styles$w.popover, children: /* @__PURE__ */ jsx(
|
|
10003
10042
|
MentionMenu,
|
|
10004
10043
|
{
|
|
10005
10044
|
params,
|
|
@@ -10128,7 +10167,7 @@ const BaseEditor = ({
|
|
|
10128
10167
|
const initialConfig = useMemo(
|
|
10129
10168
|
() => ({
|
|
10130
10169
|
namespace: "BaseEditor",
|
|
10131
|
-
theme: { paragraph: styles$
|
|
10170
|
+
theme: { paragraph: styles$A.themeParagraph },
|
|
10132
10171
|
onError: (error2) => console.error(error2),
|
|
10133
10172
|
editorState: initialEditorState !== null ? JSON.stringify(initialEditorState) : void 0,
|
|
10134
10173
|
editable: !disabled2,
|
|
@@ -10136,18 +10175,18 @@ const BaseEditor = ({
|
|
|
10136
10175
|
}),
|
|
10137
10176
|
[]
|
|
10138
10177
|
);
|
|
10139
|
-
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("div", { className: styles$
|
|
10178
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("div", { className: styles$A.editor, children: /* @__PURE__ */ jsxs(p$7, { initialConfig, children: [
|
|
10140
10179
|
/* @__PURE__ */ jsx(
|
|
10141
10180
|
h,
|
|
10142
10181
|
{
|
|
10143
10182
|
contentEditable: /* @__PURE__ */ jsx(
|
|
10144
10183
|
x$4,
|
|
10145
10184
|
{
|
|
10146
|
-
className: clsx$1(styles$
|
|
10185
|
+
className: clsx$1(styles$A.contentEditable, contentEditableClassName),
|
|
10147
10186
|
ariaLabel
|
|
10148
10187
|
}
|
|
10149
10188
|
),
|
|
10150
|
-
placeholder: /* @__PURE__ */ jsx("div", { className: styles$
|
|
10189
|
+
placeholder: /* @__PURE__ */ jsx("div", { className: styles$A.placeholder, children: placeholder2 }),
|
|
10151
10190
|
ErrorBoundary: a$2
|
|
10152
10191
|
}
|
|
10153
10192
|
),
|
|
@@ -10170,7 +10209,7 @@ const BaseEditor = ({
|
|
|
10170
10209
|
const editor$1 = "_editor_pujow_6";
|
|
10171
10210
|
const seamless = "_seamless_pujow_16";
|
|
10172
10211
|
const disabled$1 = "_disabled_pujow_36";
|
|
10173
|
-
const styles$
|
|
10212
|
+
const styles$u = {
|
|
10174
10213
|
editor: editor$1,
|
|
10175
10214
|
seamless,
|
|
10176
10215
|
disabled: disabled$1
|
|
@@ -10224,16 +10263,52 @@ function getContextItemsForEditor(editor2) {
|
|
|
10224
10263
|
return nodes;
|
|
10225
10264
|
});
|
|
10226
10265
|
}
|
|
10227
|
-
function
|
|
10266
|
+
function walkContextItemMentionNodes(node2, visit2) {
|
|
10267
|
+
walkLexicalNodes(node2, (node22) => {
|
|
10268
|
+
if (node22 instanceof ContextItemMentionNode) {
|
|
10269
|
+
visit2(node22);
|
|
10270
|
+
}
|
|
10271
|
+
return true;
|
|
10272
|
+
});
|
|
10273
|
+
}
|
|
10274
|
+
function $insertMentions(items, position2, sep) {
|
|
10275
|
+
const nodesToInsert = lexicalNodesForContextItems(
|
|
10276
|
+
items,
|
|
10277
|
+
{
|
|
10278
|
+
isFromInitialContext: false
|
|
10279
|
+
},
|
|
10280
|
+
sep
|
|
10281
|
+
);
|
|
10282
|
+
const pNode = ks();
|
|
10283
|
+
switch (position2) {
|
|
10284
|
+
case "before": {
|
|
10285
|
+
pNode.append(...nodesToInsert);
|
|
10286
|
+
oe$1(ke$1(), pNode);
|
|
10287
|
+
break;
|
|
10288
|
+
}
|
|
10289
|
+
case "after": {
|
|
10290
|
+
pNode.append(
|
|
10291
|
+
ri$1(getWhitespace(ke$1())),
|
|
10292
|
+
...nodesToInsert,
|
|
10293
|
+
ri$1(sep)
|
|
10294
|
+
);
|
|
10295
|
+
Wi$1([pNode]);
|
|
10296
|
+
break;
|
|
10297
|
+
}
|
|
10298
|
+
}
|
|
10299
|
+
}
|
|
10300
|
+
function getWhitespace(root2) {
|
|
10301
|
+
const needsWhitespaceBefore = !/(^|\s)$/.test(root2.getTextContent());
|
|
10302
|
+
return needsWhitespaceBefore ? " " : "";
|
|
10303
|
+
}
|
|
10304
|
+
function update(editor2, updateFn) {
|
|
10228
10305
|
return new Promise((resolve) => {
|
|
10229
10306
|
editor2.update(
|
|
10230
10307
|
() => {
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
10234
|
-
|
|
10235
|
-
return true;
|
|
10236
|
-
});
|
|
10308
|
+
const result2 = updateFn();
|
|
10309
|
+
if (result2 === false) {
|
|
10310
|
+
resolve();
|
|
10311
|
+
}
|
|
10237
10312
|
},
|
|
10238
10313
|
{ onUpdate: resolve }
|
|
10239
10314
|
);
|
|
@@ -10341,32 +10416,30 @@ const PromptEditor = ({
|
|
|
10341
10416
|
});
|
|
10342
10417
|
},
|
|
10343
10418
|
appendText(text2) {
|
|
10344
|
-
|
|
10345
|
-
(
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
{ onUpdate: resolve }
|
|
10355
|
-
);
|
|
10356
|
-
}
|
|
10357
|
-
);
|
|
10419
|
+
if (!editorRef.current) {
|
|
10420
|
+
return Promise.resolve();
|
|
10421
|
+
}
|
|
10422
|
+
return update(editorRef.current, () => {
|
|
10423
|
+
const root2 = ke$1();
|
|
10424
|
+
root2.selectEnd();
|
|
10425
|
+
Wi$1([ri$1(`${getWhitespace(root2)}${text2}`)]);
|
|
10426
|
+
root2.selectEnd();
|
|
10427
|
+
return true;
|
|
10428
|
+
});
|
|
10358
10429
|
},
|
|
10359
10430
|
filterMentions(filter2) {
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10431
|
+
if (!editorRef.current) {
|
|
10432
|
+
return Promise.resolve();
|
|
10433
|
+
}
|
|
10434
|
+
return update(editorRef.current, () => {
|
|
10435
|
+
let updated = false;
|
|
10436
|
+
walkContextItemMentionNodes(ke$1(), (node2) => {
|
|
10366
10437
|
if (!filter2(node2.contextItem)) {
|
|
10367
10438
|
node2.remove();
|
|
10439
|
+
updated = true;
|
|
10368
10440
|
}
|
|
10369
|
-
})
|
|
10441
|
+
});
|
|
10442
|
+
return updated;
|
|
10370
10443
|
});
|
|
10371
10444
|
},
|
|
10372
10445
|
async addMentions(items, position2 = "after", sep = " ") {
|
|
@@ -10377,23 +10450,31 @@ const PromptEditor = ({
|
|
|
10377
10450
|
const newContextItems = items.map(serializeContextItem);
|
|
10378
10451
|
const existingMentions = getContextItemsForEditor(editor2);
|
|
10379
10452
|
const ops = getMentionOperations(existingMentions, newContextItems);
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10453
|
+
await update(editor2, () => {
|
|
10454
|
+
if (ops.modify.size + ops.delete.size === 0) {
|
|
10455
|
+
return false;
|
|
10456
|
+
}
|
|
10457
|
+
walkContextItemMentionNodes(ke$1(), (existing) => {
|
|
10458
|
+
const update2 = ops.modify.get(existing.contextItem);
|
|
10459
|
+
if (update2) {
|
|
10460
|
+
existing.replace($createContextItemMentionNode(update2));
|
|
10385
10461
|
}
|
|
10386
10462
|
if (ops.delete.has(existing.contextItem)) {
|
|
10387
10463
|
existing.remove();
|
|
10388
10464
|
}
|
|
10389
10465
|
});
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10466
|
+
return true;
|
|
10467
|
+
});
|
|
10468
|
+
return update(editor2, () => {
|
|
10469
|
+
if (ops.create.length === 0) {
|
|
10470
|
+
return false;
|
|
10471
|
+
}
|
|
10472
|
+
$insertMentions(ops.create, position2, sep);
|
|
10473
|
+
$selectEnd();
|
|
10474
|
+
return true;
|
|
10475
|
+
});
|
|
10395
10476
|
},
|
|
10396
|
-
async upsertMentions(items, position2 = "after", sep = " ") {
|
|
10477
|
+
async upsertMentions(items, position2 = "after", sep = " ", focusEditor = true) {
|
|
10397
10478
|
const editor2 = editorRef.current;
|
|
10398
10479
|
if (!editor2) {
|
|
10399
10480
|
return;
|
|
@@ -10408,50 +10489,65 @@ const PromptEditor = ({
|
|
|
10408
10489
|
toUpdate.set(key, item2);
|
|
10409
10490
|
}
|
|
10410
10491
|
}
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10492
|
+
await update(editor2, () => {
|
|
10493
|
+
if (toUpdate.size === 0) {
|
|
10494
|
+
return false;
|
|
10495
|
+
}
|
|
10496
|
+
walkContextItemMentionNodes(ke$1(), (existing) => {
|
|
10497
|
+
const update2 = toUpdate.get(getKeyForContextItem(existing.contextItem));
|
|
10498
|
+
if (update2) {
|
|
10499
|
+
existing.replace($createContextItemMentionNode(update2));
|
|
10416
10500
|
}
|
|
10417
10501
|
});
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10502
|
+
if (focusEditor) {
|
|
10503
|
+
$selectEnd();
|
|
10504
|
+
} else {
|
|
10505
|
+
we$2(null);
|
|
10506
|
+
}
|
|
10507
|
+
return true;
|
|
10508
|
+
});
|
|
10509
|
+
return update(editor2, () => {
|
|
10510
|
+
if (items.length === toUpdate.size) {
|
|
10511
|
+
return false;
|
|
10512
|
+
}
|
|
10513
|
+
$insertMentions(
|
|
10514
|
+
items.filter((item2) => !toUpdate.has(getKeyForContextItem(item2))),
|
|
10515
|
+
position2,
|
|
10516
|
+
sep
|
|
10517
|
+
);
|
|
10518
|
+
if (focusEditor) {
|
|
10519
|
+
$selectEnd();
|
|
10520
|
+
} else {
|
|
10521
|
+
we$2(null);
|
|
10522
|
+
}
|
|
10523
|
+
return true;
|
|
10524
|
+
});
|
|
10428
10525
|
},
|
|
10429
10526
|
setInitialContextMentions(items) {
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10527
|
+
const editor2 = editorRef.current;
|
|
10528
|
+
if (!editor2) {
|
|
10529
|
+
return Promise.resolve();
|
|
10530
|
+
}
|
|
10531
|
+
return update(editor2, () => {
|
|
10532
|
+
let updated = false;
|
|
10533
|
+
if (!hasSetInitialContext.current || isEditorContentOnlyInitialContext(editor2)) {
|
|
10534
|
+
if (isEditorContentOnlyInitialContext(editor2)) {
|
|
10535
|
+
ke$1().clear();
|
|
10536
|
+
updated = true;
|
|
10537
|
+
}
|
|
10538
|
+
const nodesToInsert = lexicalNodesForContextItems(items, {
|
|
10539
|
+
isFromInitialContext: true
|
|
10540
|
+
});
|
|
10541
|
+
if (items.length > 0) {
|
|
10542
|
+
nodesToInsert.push(ri$1(" "));
|
|
10543
|
+
updated = true;
|
|
10544
|
+
}
|
|
10545
|
+
we$2(ke$1().selectStart());
|
|
10546
|
+
Wi$1(nodesToInsert);
|
|
10547
|
+
$selectEnd();
|
|
10548
|
+
hasSetInitialContext.current = true;
|
|
10434
10549
|
}
|
|
10435
|
-
|
|
10436
|
-
() => {
|
|
10437
|
-
if (!hasSetInitialContext.current || isEditorContentOnlyInitialContext(editor2)) {
|
|
10438
|
-
if (isEditorContentOnlyInitialContext(editor2)) {
|
|
10439
|
-
ke$1().clear();
|
|
10440
|
-
}
|
|
10441
|
-
const nodesToInsert = lexicalNodesForContextItems(items, {
|
|
10442
|
-
isFromInitialContext: true
|
|
10443
|
-
});
|
|
10444
|
-
if (items.length > 0) {
|
|
10445
|
-
nodesToInsert.push(ri$1(" "));
|
|
10446
|
-
}
|
|
10447
|
-
we$2(ke$1().selectStart());
|
|
10448
|
-
Wi$1(nodesToInsert);
|
|
10449
|
-
$selectEnd();
|
|
10450
|
-
hasSetInitialContext.current = true;
|
|
10451
|
-
}
|
|
10452
|
-
},
|
|
10453
|
-
{ onUpdate: resolve }
|
|
10454
|
-
);
|
|
10550
|
+
return updated;
|
|
10455
10551
|
});
|
|
10456
10552
|
}
|
|
10457
10553
|
}),
|
|
@@ -10459,7 +10555,7 @@ const PromptEditor = ({
|
|
|
10459
10555
|
);
|
|
10460
10556
|
useSetGlobalPromptEditorConfig();
|
|
10461
10557
|
const onBaseEditorChange = useCallback(
|
|
10462
|
-
(_editorState, editor2
|
|
10558
|
+
(_editorState, editor2) => {
|
|
10463
10559
|
if (onChange) {
|
|
10464
10560
|
onChange(toSerializedPromptEditorValue(editor2));
|
|
10465
10561
|
}
|
|
@@ -10481,9 +10577,9 @@ const PromptEditor = ({
|
|
|
10481
10577
|
return /* @__PURE__ */ jsx(
|
|
10482
10578
|
BaseEditor,
|
|
10483
10579
|
{
|
|
10484
|
-
className: clsx$1(styles$
|
|
10485
|
-
[styles$
|
|
10486
|
-
[styles$
|
|
10580
|
+
className: clsx$1(styles$u.editor, editorClassName, {
|
|
10581
|
+
[styles$u.disabled]: disabled2,
|
|
10582
|
+
[styles$u.seamless]: seamless2
|
|
10487
10583
|
}),
|
|
10488
10584
|
contentEditableClassName,
|
|
10489
10585
|
initialEditorState: (initialEditorState == null ? void 0 : initialEditorState.lexicalEditorState) ?? null,
|
|
@@ -10501,44 +10597,6 @@ const PromptEditor = ({
|
|
|
10501
10597
|
function normalizeEditorStateJSON(value) {
|
|
10502
10598
|
return JSON.parse(JSON.stringify(value));
|
|
10503
10599
|
}
|
|
10504
|
-
function getWhitespace(root2) {
|
|
10505
|
-
const needsWhitespaceBefore = !/(^|\s)$/.test(root2.getTextContent());
|
|
10506
|
-
return needsWhitespaceBefore ? " " : "";
|
|
10507
|
-
}
|
|
10508
|
-
function insertMentions(editor2, items, position2, sep) {
|
|
10509
|
-
return new Promise(
|
|
10510
|
-
(resolve) => editor2.update(
|
|
10511
|
-
() => {
|
|
10512
|
-
const nodesToInsert = lexicalNodesForContextItems(
|
|
10513
|
-
items,
|
|
10514
|
-
{
|
|
10515
|
-
isFromInitialContext: false
|
|
10516
|
-
},
|
|
10517
|
-
sep
|
|
10518
|
-
);
|
|
10519
|
-
const pNode = ks();
|
|
10520
|
-
switch (position2) {
|
|
10521
|
-
case "before": {
|
|
10522
|
-
pNode.append(...nodesToInsert);
|
|
10523
|
-
oe$1(ke$1(), pNode);
|
|
10524
|
-
break;
|
|
10525
|
-
}
|
|
10526
|
-
case "after": {
|
|
10527
|
-
pNode.append(
|
|
10528
|
-
ri$1(getWhitespace(ke$1())),
|
|
10529
|
-
...nodesToInsert,
|
|
10530
|
-
ri$1(sep)
|
|
10531
|
-
);
|
|
10532
|
-
Wi$1([pNode]);
|
|
10533
|
-
break;
|
|
10534
|
-
}
|
|
10535
|
-
}
|
|
10536
|
-
$selectEnd();
|
|
10537
|
-
},
|
|
10538
|
-
{ onUpdate: resolve }
|
|
10539
|
-
)
|
|
10540
|
-
);
|
|
10541
|
-
}
|
|
10542
10600
|
function getKeyForContextItem(item2) {
|
|
10543
10601
|
let key = `${item2.uri.toString()}|${item2.type}`;
|
|
10544
10602
|
if (item2.type === "openctx") {
|
|
@@ -12482,7 +12540,7 @@ function observeMove(element2, onMove) {
|
|
|
12482
12540
|
refresh(true);
|
|
12483
12541
|
return cleanup;
|
|
12484
12542
|
}
|
|
12485
|
-
function autoUpdate(reference, floating,
|
|
12543
|
+
function autoUpdate(reference, floating, update2, options) {
|
|
12486
12544
|
if (options === void 0) {
|
|
12487
12545
|
options = {};
|
|
12488
12546
|
}
|
|
@@ -12496,12 +12554,12 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
12496
12554
|
const referenceEl = unwrapElement(reference);
|
|
12497
12555
|
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
|
|
12498
12556
|
ancestors.forEach((ancestor) => {
|
|
12499
|
-
ancestorScroll && ancestor.addEventListener("scroll",
|
|
12557
|
+
ancestorScroll && ancestor.addEventListener("scroll", update2, {
|
|
12500
12558
|
passive: true
|
|
12501
12559
|
});
|
|
12502
|
-
ancestorResize && ancestor.addEventListener("resize",
|
|
12560
|
+
ancestorResize && ancestor.addEventListener("resize", update2);
|
|
12503
12561
|
});
|
|
12504
|
-
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl,
|
|
12562
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2) : null;
|
|
12505
12563
|
let reobserveFrame = -1;
|
|
12506
12564
|
let resizeObserver = null;
|
|
12507
12565
|
if (elementResize) {
|
|
@@ -12515,7 +12573,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
12515
12573
|
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
12516
12574
|
});
|
|
12517
12575
|
}
|
|
12518
|
-
|
|
12576
|
+
update2();
|
|
12519
12577
|
});
|
|
12520
12578
|
if (referenceEl && !animationFrame) {
|
|
12521
12579
|
resizeObserver.observe(referenceEl);
|
|
@@ -12530,17 +12588,17 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
12530
12588
|
function frameLoop() {
|
|
12531
12589
|
const nextRefRect = getBoundingClientRect(reference);
|
|
12532
12590
|
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
12533
|
-
|
|
12591
|
+
update2();
|
|
12534
12592
|
}
|
|
12535
12593
|
prevRefRect = nextRefRect;
|
|
12536
12594
|
frameId = requestAnimationFrame(frameLoop);
|
|
12537
12595
|
}
|
|
12538
|
-
|
|
12596
|
+
update2();
|
|
12539
12597
|
return () => {
|
|
12540
12598
|
var _resizeObserver2;
|
|
12541
12599
|
ancestors.forEach((ancestor) => {
|
|
12542
|
-
ancestorScroll && ancestor.removeEventListener("scroll",
|
|
12543
|
-
ancestorResize && ancestor.removeEventListener("resize",
|
|
12600
|
+
ancestorScroll && ancestor.removeEventListener("scroll", update2);
|
|
12601
|
+
ancestorResize && ancestor.removeEventListener("resize", update2);
|
|
12544
12602
|
});
|
|
12545
12603
|
cleanupIo == null || cleanupIo();
|
|
12546
12604
|
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
@@ -12720,7 +12778,7 @@ function useFloating(options) {
|
|
|
12720
12778
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
12721
12779
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
12722
12780
|
const platformRef = useLatestRef(platform2);
|
|
12723
|
-
const
|
|
12781
|
+
const update2 = React.useCallback(() => {
|
|
12724
12782
|
if (!referenceRef.current || !floatingRef.current) {
|
|
12725
12783
|
return;
|
|
12726
12784
|
}
|
|
@@ -12766,11 +12824,11 @@ function useFloating(options) {
|
|
|
12766
12824
|
if (floatingEl) floatingRef.current = floatingEl;
|
|
12767
12825
|
if (referenceEl && floatingEl) {
|
|
12768
12826
|
if (whileElementsMountedRef.current) {
|
|
12769
|
-
return whileElementsMountedRef.current(referenceEl, floatingEl,
|
|
12827
|
+
return whileElementsMountedRef.current(referenceEl, floatingEl, update2);
|
|
12770
12828
|
}
|
|
12771
|
-
|
|
12829
|
+
update2();
|
|
12772
12830
|
}
|
|
12773
|
-
}, [referenceEl, floatingEl,
|
|
12831
|
+
}, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
12774
12832
|
const refs = React.useMemo(() => ({
|
|
12775
12833
|
reference: referenceRef,
|
|
12776
12834
|
floating: floatingRef,
|
|
@@ -12809,11 +12867,11 @@ function useFloating(options) {
|
|
|
12809
12867
|
}, [strategy, transform2, elements2.floating, data.x, data.y]);
|
|
12810
12868
|
return React.useMemo(() => ({
|
|
12811
12869
|
...data,
|
|
12812
|
-
update,
|
|
12870
|
+
update: update2,
|
|
12813
12871
|
refs,
|
|
12814
12872
|
elements: elements2,
|
|
12815
12873
|
floatingStyles
|
|
12816
|
-
}), [data,
|
|
12874
|
+
}), [data, update2, refs, elements2, floatingStyles]);
|
|
12817
12875
|
}
|
|
12818
12876
|
const $7e8f5cd07187803e$export$21b07c8f274aebd5 = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
12819
12877
|
const { children: children2, width = 10, height = 5, ...arrowProps } = props;
|
|
@@ -13939,7 +13997,7 @@ function createLruCache(maxCacheSize) {
|
|
|
13939
13997
|
let cacheSize = 0;
|
|
13940
13998
|
let cache2 = /* @__PURE__ */ new Map();
|
|
13941
13999
|
let previousCache = /* @__PURE__ */ new Map();
|
|
13942
|
-
function
|
|
14000
|
+
function update2(key, value) {
|
|
13943
14001
|
cache2.set(key, value);
|
|
13944
14002
|
cacheSize++;
|
|
13945
14003
|
if (cacheSize > maxCacheSize) {
|
|
@@ -13955,7 +14013,7 @@ function createLruCache(maxCacheSize) {
|
|
|
13955
14013
|
return value;
|
|
13956
14014
|
}
|
|
13957
14015
|
if ((value = previousCache.get(key)) !== void 0) {
|
|
13958
|
-
|
|
14016
|
+
update2(key, value);
|
|
13959
14017
|
return value;
|
|
13960
14018
|
}
|
|
13961
14019
|
},
|
|
@@ -13963,7 +14021,7 @@ function createLruCache(maxCacheSize) {
|
|
|
13963
14021
|
if (cache2.has(key)) {
|
|
13964
14022
|
cache2.set(key, value);
|
|
13965
14023
|
} else {
|
|
13966
|
-
|
|
14024
|
+
update2(key, value);
|
|
13967
14025
|
}
|
|
13968
14026
|
}
|
|
13969
14027
|
};
|
|
@@ -17946,7 +18004,7 @@ const CommandItem = React.forwardRef(({ className, tooltip, ...props }, ref2) =>
|
|
|
17946
18004
|
{
|
|
17947
18005
|
ref: ref2,
|
|
17948
18006
|
className: cn(
|
|
17949
|
-
"tw-relative tw-flex tw-cursor-pointer tw-select-none tw-items-center tw-py-3 tw-px-
|
|
18007
|
+
"tw-relative tw-flex tw-cursor-pointer tw-select-none tw-items-center tw-py-3 tw-px-3 tw-text-md tw-outline-none aria-selected:tw-bg-accent aria-selected:tw-text-accent-foreground hover:tw-bg-accent hover:tw-text-accent-foreground data-[disabled=true]:tw-pointer-events-none data-[disabled=true]:tw-opacity-50",
|
|
17950
18008
|
className
|
|
17951
18009
|
),
|
|
17952
18010
|
title: tooltip,
|
|
@@ -18083,11 +18141,11 @@ const COMMON_WRAPPERS = [
|
|
|
18083
18141
|
value: promptEditorConfig
|
|
18084
18142
|
}
|
|
18085
18143
|
];
|
|
18086
|
-
const outerContainer = "_outer-
|
|
18087
|
-
const errorContainer = "_error-
|
|
18088
|
-
const error$2 = "
|
|
18089
|
-
const closeBtn = "_close-
|
|
18090
|
-
const styles$
|
|
18144
|
+
const outerContainer = "_outer-container_1xpow_1";
|
|
18145
|
+
const errorContainer = "_error-container_1xpow_10";
|
|
18146
|
+
const error$2 = "_error_1xpow_10";
|
|
18147
|
+
const closeBtn = "_close-btn_1xpow_28";
|
|
18148
|
+
const styles$t = {
|
|
18091
18149
|
outerContainer,
|
|
18092
18150
|
errorContainer,
|
|
18093
18151
|
error: error$2,
|
|
@@ -19113,7 +19171,7 @@ const basename$1 = "_basename_1dh30_14";
|
|
|
19113
19171
|
const repoShortName = "_repoShortName_1dh30_18";
|
|
19114
19172
|
const dirname$1 = "_dirname_1dh30_23";
|
|
19115
19173
|
const range$1 = "_range_1dh30_28";
|
|
19116
|
-
const styles$
|
|
19174
|
+
const styles$s = {
|
|
19117
19175
|
path: path$2,
|
|
19118
19176
|
excluded,
|
|
19119
19177
|
basename: basename$1,
|
|
@@ -19222,7 +19280,7 @@ included from Sourcegraph search`;
|
|
|
19222
19280
|
/* @__PURE__ */ jsx(
|
|
19223
19281
|
"div",
|
|
19224
19282
|
{
|
|
19225
|
-
className: clsx$1(styles$
|
|
19283
|
+
className: clsx$1(styles$s.path, (isTooLarge || isIgnored) && styles$s.excluded),
|
|
19226
19284
|
"data-source": source2 || "unknown",
|
|
19227
19285
|
children: /* @__PURE__ */ jsx(
|
|
19228
19286
|
PrettyPrintedContextItem,
|
|
@@ -19257,7 +19315,7 @@ included from Sourcegraph search`;
|
|
|
19257
19315
|
/* @__PURE__ */ jsx(
|
|
19258
19316
|
"div",
|
|
19259
19317
|
{
|
|
19260
|
-
className: clsx$1(styles$
|
|
19318
|
+
className: clsx$1(styles$s.path, (isTooLarge || isIgnored) && styles$s.excluded),
|
|
19261
19319
|
"data-source": source2 || "unknown",
|
|
19262
19320
|
children: /* @__PURE__ */ jsx(
|
|
19263
19321
|
PrettyPrintedContextItem,
|
|
@@ -19284,14 +19342,14 @@ const PrettyPrintedContextItem = ({ path: path2, range: range2, repoShortName: r
|
|
|
19284
19342
|
const basename2 = path2.split(sep).pop() || "";
|
|
19285
19343
|
const dirname2 = path2.split(sep).slice(0, -1).join(sep);
|
|
19286
19344
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
19287
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
19288
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
19345
|
+
/* @__PURE__ */ jsx("span", { className: styles$s.basename, children: basename2 }),
|
|
19346
|
+
/* @__PURE__ */ jsx("span", { className: styles$s.range, children: range2 ? `:${range2}` : "" }),
|
|
19289
19347
|
" ",
|
|
19290
|
-
repoShortName2 && /* @__PURE__ */ jsxs("span", { className: styles$
|
|
19348
|
+
repoShortName2 && /* @__PURE__ */ jsxs("span", { className: styles$s.repoShortName, children: [
|
|
19291
19349
|
repoShortName2,
|
|
19292
19350
|
dirname2.length === 0 || dirname2.startsWith(sep) ? "" : sep
|
|
19293
19351
|
] }),
|
|
19294
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
19352
|
+
/* @__PURE__ */ jsx("span", { className: styles$s.dirname, children: dirname2 })
|
|
19295
19353
|
] });
|
|
19296
19354
|
};
|
|
19297
19355
|
function createCollection(name2) {
|
|
@@ -19946,7 +20004,7 @@ var Trigger2 = AccordionTrigger$1;
|
|
|
19946
20004
|
var Content2 = AccordionContent$1;
|
|
19947
20005
|
const accordionTrigger = "_accordion-trigger_12003_1";
|
|
19948
20006
|
const accordionTriggerChevron = "_accordion-trigger-chevron_12003_11";
|
|
19949
|
-
const styles$
|
|
20007
|
+
const styles$r = {
|
|
19950
20008
|
accordionTrigger,
|
|
19951
20009
|
accordionTriggerChevron
|
|
19952
20010
|
};
|
|
@@ -19957,7 +20015,7 @@ const AccordionTrigger = React.forwardRef(({ className, children: children2, ...
|
|
|
19957
20015
|
Trigger2,
|
|
19958
20016
|
{
|
|
19959
20017
|
ref: ref2,
|
|
19960
|
-
className: clsx$1(styles$
|
|
20018
|
+
className: clsx$1(styles$r.accordionTrigger, className),
|
|
19961
20019
|
...props,
|
|
19962
20020
|
children: [
|
|
19963
20021
|
children2,
|
|
@@ -19966,7 +20024,7 @@ const AccordionTrigger = React.forwardRef(({ className, children: children2, ...
|
|
|
19966
20024
|
{
|
|
19967
20025
|
className: cn(
|
|
19968
20026
|
"tw-h-8 tw-w-8 tw-text-muted-foreground",
|
|
19969
|
-
styles$
|
|
20027
|
+
styles$r.accordionTriggerChevron
|
|
19970
20028
|
)
|
|
19971
20029
|
}
|
|
19972
20030
|
)
|
|
@@ -20052,15 +20110,15 @@ function useUserAccountInfo() {
|
|
|
20052
20110
|
const dotsHolder = "_dots-holder_10c80_1";
|
|
20053
20111
|
const dot = "_dot_10c80_1";
|
|
20054
20112
|
const flash = "_flash_10c80_1";
|
|
20055
|
-
const styles$
|
|
20113
|
+
const styles$q = {
|
|
20056
20114
|
dotsHolder,
|
|
20057
20115
|
dot,
|
|
20058
20116
|
flash
|
|
20059
20117
|
};
|
|
20060
|
-
const LoadingDots = () => /* @__PURE__ */ jsxs("div", { className: styles$
|
|
20061
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
20062
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
20063
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
20118
|
+
const LoadingDots = () => /* @__PURE__ */ jsxs("div", { className: styles$q.dotsHolder, role: "status", "aria-busy": true, children: [
|
|
20119
|
+
/* @__PURE__ */ jsx("div", { className: styles$q.dot }),
|
|
20120
|
+
/* @__PURE__ */ jsx("div", { className: styles$q.dot }),
|
|
20121
|
+
/* @__PURE__ */ jsx("div", { className: styles$q.dot })
|
|
20064
20122
|
] });
|
|
20065
20123
|
const Cell = forwardRef((props, ref2) => {
|
|
20066
20124
|
const {
|
|
@@ -21955,7 +22013,7 @@ function one$1(state, node2, key) {
|
|
|
21955
22013
|
return mdxEsm(state, node2);
|
|
21956
22014
|
}
|
|
21957
22015
|
if (node2.type === "root") {
|
|
21958
|
-
return root$
|
|
22016
|
+
return root$8(state, node2, key);
|
|
21959
22017
|
}
|
|
21960
22018
|
if (node2.type === "text") {
|
|
21961
22019
|
return text$6(state, node2);
|
|
@@ -22021,7 +22079,7 @@ function mdxJsxElement(state, node2, key) {
|
|
|
22021
22079
|
state.schema = parentSchema;
|
|
22022
22080
|
return state.create(node2, type, props, key);
|
|
22023
22081
|
}
|
|
22024
|
-
function root$
|
|
22082
|
+
function root$8(state, node2, key) {
|
|
22025
22083
|
const props = {};
|
|
22026
22084
|
addChildren(props, createChildren(state, node2));
|
|
22027
22085
|
return state.create(node2, state.Fragment, props, key);
|
|
@@ -27341,7 +27399,7 @@ function paragraph$1(state, node2) {
|
|
|
27341
27399
|
state.patch(node2, result2);
|
|
27342
27400
|
return state.applyData(node2, result2);
|
|
27343
27401
|
}
|
|
27344
|
-
function root$
|
|
27402
|
+
function root$7(state, node2) {
|
|
27345
27403
|
const result2 = { type: "root", children: state.wrap(state.all(node2)) };
|
|
27346
27404
|
state.patch(node2, result2);
|
|
27347
27405
|
return state.applyData(node2, result2);
|
|
@@ -27505,7 +27563,7 @@ const handlers = {
|
|
|
27505
27563
|
list: list$2,
|
|
27506
27564
|
paragraph: paragraph$1,
|
|
27507
27565
|
// @ts-expect-error: root is different, but hard to type.
|
|
27508
|
-
root: root$
|
|
27566
|
+
root: root$7,
|
|
27509
27567
|
strong: strong$1,
|
|
27510
27568
|
table,
|
|
27511
27569
|
tableCell,
|
|
@@ -44828,7 +44886,7 @@ function transform(state, node2) {
|
|
|
44828
44886
|
return element(state, unsafe);
|
|
44829
44887
|
}
|
|
44830
44888
|
case "root": {
|
|
44831
|
-
return root$
|
|
44889
|
+
return root$6(state, unsafe);
|
|
44832
44890
|
}
|
|
44833
44891
|
case "text": {
|
|
44834
44892
|
return text$2(state, unsafe);
|
|
@@ -44888,7 +44946,7 @@ function element(state, unsafe) {
|
|
|
44888
44946
|
patch(node2, unsafe);
|
|
44889
44947
|
return node2;
|
|
44890
44948
|
}
|
|
44891
|
-
function root$
|
|
44949
|
+
function root$6(state, unsafe) {
|
|
44892
44950
|
const content2 = (
|
|
44893
44951
|
/** @type {Array<RootContent>} */
|
|
44894
44952
|
children$1(state, unsafe.children)
|
|
@@ -46315,7 +46373,7 @@ const phrasing = (
|
|
|
46315
46373
|
"textDirective"
|
|
46316
46374
|
])
|
|
46317
46375
|
);
|
|
46318
|
-
function root$
|
|
46376
|
+
function root$5(node2, _2, state, info) {
|
|
46319
46377
|
const hasPhrasing = node2.children.some(function(d2) {
|
|
46320
46378
|
return phrasing(d2);
|
|
46321
46379
|
});
|
|
@@ -46384,7 +46442,7 @@ const handle = {
|
|
|
46384
46442
|
list: list$1,
|
|
46385
46443
|
listItem: listItem$1,
|
|
46386
46444
|
paragraph,
|
|
46387
|
-
root: root$
|
|
46445
|
+
root: root$5,
|
|
46388
46446
|
strong,
|
|
46389
46447
|
text: text$1,
|
|
46390
46448
|
thematicBreak
|
|
@@ -51217,7 +51275,7 @@ const codiconLoading = "_codicon-loading_1kf9a_100";
|
|
|
51217
51275
|
const spin$1 = "_spin_1kf9a_1";
|
|
51218
51276
|
const content = "_content_1kf9a_116";
|
|
51219
51277
|
const fileNameContainer = "_file-name-container_1kf9a_216";
|
|
51220
|
-
const styles$
|
|
51278
|
+
const styles$p = {
|
|
51221
51279
|
buttonsContainer,
|
|
51222
51280
|
buttons,
|
|
51223
51281
|
button: button$1,
|
|
@@ -51236,7 +51294,7 @@ const styles$o = {
|
|
|
51236
51294
|
fileNameContainer
|
|
51237
51295
|
};
|
|
51238
51296
|
const spin = "_spin_56lwz_7";
|
|
51239
|
-
const styles$
|
|
51297
|
+
const styles$o = {
|
|
51240
51298
|
spin
|
|
51241
51299
|
};
|
|
51242
51300
|
const SaveCodeBlockIcon = '<svg role="img" height=16 width=16 viewBox="0 0 16 16" fill="currentColor"><path fillRule="evenodd" clipRule="evenodd" d="M9.5 1.1l3.4 3.5.1.4v2h-1V6H8V2H3v11h4v1H2.5l-.5-.5v-12l.5-.5h6.7l.3.1zM9 2v3h2.9L9 2zm4 14h-1v-3H9v-1h3V9h1v3h3v1h-3v3z"/></svg>';
|
|
@@ -51246,12 +51304,12 @@ const CheckCodeBlockIcon = '<svg role="img" height=16 width=16 viewBox="0 0 16 1
|
|
|
51246
51304
|
const ShieldIcon = '<svg role="img" height=16 width=16 viewBox="0 0 16 16" fill="currentColor"><path fillRule="evenodd" clipRule="evenodd" d="M8.24599 14.713C7.73426 14.4115 7.23234 14.0937 6.74099 13.76C6.23999 13.42 5.75799 13.053 5.29699 12.66C4.83899 12.265 4.40899 11.84 4.00899 11.386C3.60899 10.931 3.25599 10.436 2.95899 9.90801C2.66018 9.37408 2.42523 8.80684 2.25899 8.21801C2.08478 7.59364 1.99762 6.94821 1.99999 6.30001V3.10001L2.49999 2.60001C2.83299 2.60001 3.15599 2.58901 3.46999 2.56401C3.76599 2.54101 4.06099 2.49801 4.35199 2.43601C4.63599 2.37401 4.91399 2.28801 5.18399 2.18001C5.46799 2.06201 5.74099 1.91901 5.99999 1.75301C6.36712 1.5117 6.76546 1.32161 7.18399 1.18801C7.83322 1.00041 8.51476 0.95202 9.18399 1.04601C9.61431 1.10595 10.0321 1.2353 10.421 1.42901C10.62 1.52601 10.813 1.63301 11.001 1.75101C11.261 1.91801 11.536 2.06101 11.822 2.17901C12.092 2.28801 12.369 2.37301 12.653 2.43501C12.944 2.49701 13.24 2.54101 13.537 2.56401C13.848 2.58801 14.171 2.59901 14.504 2.59901L15.004 3.09901V6.29901C15.0074 6.94741 14.9212 7.59317 14.748 8.21801C14.5817 8.80683 14.3468 9.37406 14.048 9.90801C13.7501 10.4357 13.3982 10.931 12.998 11.386C12.598 11.838 12.169 12.263 11.712 12.656C11.2506 13.0499 10.7672 13.4172 10.264 13.756C9.7707 14.0903 9.26712 14.4091 8.75399 14.712H8.24599V14.713ZM2.99999 3.59001V6.30001C2.99599 6.85501 3.06999 7.41001 3.21999 7.94501C3.36397 8.45853 3.56875 8.95303 3.82999 9.41801C4.09299 9.88501 4.40499 10.323 4.75999 10.726C5.12999 11.143 5.52599 11.536 5.94799 11.9C6.37999 12.268 6.83099 12.612 7.29999 12.93C7.69999 13.197 8.09999 13.453 8.49999 13.699C8.89999 13.457 9.29999 13.201 9.69999 12.931C10.17 12.612 10.623 12.268 11.055 11.9C11.476 11.536 11.872 11.144 12.241 10.728C12.5951 10.3251 12.9068 9.88682 13.171 9.42001C13.432 8.95501 13.637 8.46001 13.781 7.94701C13.931 7.41001 14.004 6.85701 14.001 6.30001V3.59001C13.842 3.59001 13.688 3.57801 13.536 3.56701L13.457 3.56101C13.1148 3.53403 12.7748 3.48493 12.439 3.41401C11.7376 3.26082 11.0687 2.98528 10.463 2.60001C10.3073 2.50147 10.1464 2.41134 9.98099 2.33001C9.684 2.18399 9.3657 2.0861 9.03799 2.04001C8.51704 1.96366 7.98579 1.99981 7.47999 2.14601C7.14799 2.25401 6.83099 2.40601 6.53999 2.59801C6.22799 2.79801 5.89999 2.97001 5.55699 3.11101C5.23259 3.24045 4.89814 3.34313 4.55699 3.41801C4.22199 3.48801 3.88199 3.53801 3.53999 3.56401C3.36599 3.57401 3.18499 3.58401 2.99999 3.59001Z"/><path d="M7.89199 5.702L6.07499 7.53L7.89099 9.35L7.18399 10.057L5.01299 7.883V7.176L7.18299 4.997L7.89199 5.702Z"/><path d="M9.81 4.972L9.11 5.681L10.94 7.5L9.11 9.32L9.81 10.029L12 7.856V7.147L9.81 4.972Z"/></svg>';
|
|
51247
51305
|
const SparkleIcon = '<svg role="img" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M5.39804 10.8069C5.57428 10.9312 5.78476 10.9977 6.00043 10.9973C6.21633 10.9975 6.42686 10.93 6.60243 10.8043C6.77993 10.6739 6.91464 10.4936 6.98943 10.2863L7.43643 8.91335C7.55086 8.56906 7.74391 8.25615 8.00028 7.99943C8.25665 7.74272 8.56929 7.54924 8.91343 7.43435L10.3044 6.98335C10.4564 6.92899 10.5936 6.84019 10.7055 6.7239C10.8174 6.60762 10.9008 6.467 10.9492 6.31308C10.9977 6.15916 11.0098 5.99611 10.9847 5.83672C10.9596 5.67732 10.8979 5.52591 10.8044 5.39435C10.6703 5.20842 10.4794 5.07118 10.2604 5.00335L8.88543 4.55635C8.54091 4.44212 8.22777 4.24915 7.97087 3.99277C7.71396 3.73638 7.52035 3.42363 7.40543 3.07935L6.95343 1.69135C6.88113 1.48904 6.74761 1.31428 6.57143 1.19135C6.43877 1.09762 6.28607 1.03614 6.12548 1.01179C5.96489 0.987448 5.80083 1.00091 5.64636 1.05111C5.49188 1.1013 5.35125 1.18685 5.23564 1.30095C5.12004 1.41505 5.03265 1.55454 4.98043 1.70835L4.52343 3.10835C4.40884 3.44317 4.21967 3.74758 3.97022 3.9986C3.72076 4.24962 3.41753 4.44067 3.08343 4.55735L1.69243 5.00535C1.54065 5.05974 1.40352 5.14852 1.29177 5.26474C1.18001 5.38095 1.09666 5.52145 1.04824 5.67523C0.999819 5.82902 0.987639 5.99192 1.01265 6.1512C1.03767 6.31048 1.0992 6.46181 1.19243 6.59335C1.32027 6.7728 1.50105 6.90777 1.70943 6.97935L3.08343 7.42435C3.52354 7.57083 3.90999 7.84518 4.19343 8.21235C4.35585 8.42298 4.4813 8.65968 4.56443 8.91235L5.01643 10.3033C5.08846 10.5066 5.22179 10.6826 5.39804 10.8069ZM5.48343 3.39235L6.01043 2.01535L6.44943 3.39235C6.61312 3.8855 6.88991 4.33351 7.25767 4.70058C7.62544 5.06765 8.07397 5.34359 8.56743 5.50635L9.97343 6.03535L8.59143 6.48335C8.09866 6.64764 7.65095 6.92451 7.28382 7.29198C6.9167 7.65945 6.64026 8.10742 6.47643 8.60035L5.95343 9.97835L5.50443 8.59935C5.34335 8.10608 5.06943 7.65718 4.70443 7.28835C4.3356 6.92031 3.88653 6.64272 3.39243 6.47735L2.01443 5.95535L3.40043 5.50535C3.88672 5.33672 4.32775 5.05855 4.68943 4.69235C5.04901 4.32464 5.32049 3.88016 5.48343 3.39235ZM11.5353 14.8494C11.6713 14.9456 11.8337 14.9973 12.0003 14.9974C12.1654 14.9974 12.3264 14.9464 12.4613 14.8514C12.6008 14.7529 12.7058 14.6129 12.7613 14.4514L13.0093 13.6894C13.0625 13.5309 13.1515 13.3869 13.2693 13.2684C13.3867 13.1498 13.5307 13.0611 13.6893 13.0094L14.4613 12.7574C14.619 12.7029 14.7557 12.6004 14.8523 12.4644C14.9257 12.3614 14.9736 12.2424 14.9921 12.1173C15.0106 11.9922 14.9992 11.8645 14.9588 11.7447C14.9184 11.6249 14.8501 11.5163 14.7597 11.428C14.6692 11.3396 14.5591 11.2739 14.4383 11.2364L13.6743 10.9874C13.5162 10.9348 13.3724 10.8462 13.2544 10.7285C13.1364 10.6109 13.0473 10.4674 12.9943 10.3094L12.7423 9.53638C12.6886 9.37853 12.586 9.24191 12.4493 9.14638C12.3473 9.07343 12.2295 9.02549 12.1056 9.00642C11.9816 8.98736 11.8549 8.99772 11.7357 9.03665C11.6164 9.07558 11.508 9.142 11.4192 9.23054C11.3304 9.31909 11.2636 9.42727 11.2243 9.54638L10.9773 10.3084C10.925 10.466 10.8375 10.6097 10.7213 10.7284C10.6066 10.8449 10.4667 10.9335 10.3123 10.9874L9.53931 11.2394C9.38025 11.2933 9.2422 11.3959 9.1447 11.5326C9.04721 11.6694 8.99522 11.8333 8.99611 12.0013C8.99699 12.1692 9.0507 12.3326 9.14963 12.4683C9.24856 12.604 9.38769 12.7051 9.54731 12.7574L10.3103 13.0044C10.4692 13.0578 10.6136 13.1471 10.7323 13.2654C10.8505 13.3836 10.939 13.5283 10.9903 13.6874L11.2433 14.4614C11.2981 14.6178 11.4001 14.7534 11.5353 14.8494ZM10.6223 12.0564L10.4433 11.9974L10.6273 11.9334C10.9291 11.8284 11.2027 11.6556 11.4273 11.4284C11.6537 11.1994 11.8248 10.9216 11.9273 10.6164L11.9853 10.4384L12.0443 10.6194C12.1463 10.9261 12.3185 11.2047 12.5471 11.4332C12.7757 11.6617 13.0545 11.8336 13.3613 11.9354L13.5563 11.9984L13.3763 12.0574C13.0689 12.1596 12.7898 12.3322 12.5611 12.5616C12.3324 12.791 12.1606 13.0707 12.0593 13.3784L12.0003 13.5594L11.9423 13.3784C11.8409 13.0702 11.6687 12.7901 11.4394 12.5605C11.2102 12.3309 10.9303 12.1583 10.6223 12.0564Z"/></svg>';
|
|
51248
51306
|
const EllipsisIcon = '<svg role="img" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M4 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/></svg>';
|
|
51249
|
-
const SyncSpinIcon = `<svg class="${styles$
|
|
51307
|
+
const SyncSpinIcon = `<svg class="${styles$o.spin}" role="img" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.006 8.267L.78 9.5 0 8.73l2.09-2.07.76.01 2.09 2.12-.76.76-1.167-1.18a5 5 0 0 0 9.4 1.983l.813.597a6 6 0 0 1-11.22-2.683zm10.99-.466L11.76 6.55l-.76.76 2.09 2.11.76.01 2.09-2.07-.75-.76-1.194 1.18a6 6 0 0 0-11.11-2.92l.81.594a5 5 0 0 1 9.3 2.346z"/></svg>`;
|
|
51250
51308
|
const TickIcon = '<svg role="img" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.431 3.323l-8.47 10-.79-.036-3.35-4.77.818-.574 2.978 4.24 8.051-9.506.764.646z"/></svg>';
|
|
51251
51309
|
const CloseIcon = '<svg role="img" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z"/></svg>';
|
|
51252
51310
|
class GuardrailsStatusController {
|
|
51253
51311
|
constructor(container2) {
|
|
51254
|
-
__publicField(this, "statusSpinning", `<i class="codicon codicon-loading ${styles$
|
|
51312
|
+
__publicField(this, "statusSpinning", `<i class="codicon codicon-loading ${styles$p.codiconLoading}"></i>`);
|
|
51255
51313
|
__publicField(this, "statusPass", '<i class="codicon codicon-pass"></i>');
|
|
51256
51314
|
__publicField(this, "statusFailed", "Guardrails Check Failed");
|
|
51257
51315
|
__publicField(this, "statusUnavailable", "Guardrails API Error");
|
|
@@ -51262,13 +51320,13 @@ class GuardrailsStatusController {
|
|
|
51262
51320
|
this.findOrAppend(this.iconClass, () => {
|
|
51263
51321
|
const icon2 = document.createElement("div");
|
|
51264
51322
|
icon2.innerHTML = ShieldIcon;
|
|
51265
|
-
icon2.classList.add(styles$
|
|
51323
|
+
icon2.classList.add(styles$p.attributionIcon, this.iconClass);
|
|
51266
51324
|
icon2.setAttribute("data-testid", "attribution-indicator");
|
|
51267
51325
|
return icon2;
|
|
51268
51326
|
});
|
|
51269
51327
|
this.status = this.findOrAppend(this.statusClass, () => {
|
|
51270
51328
|
const status2 = document.createElement("div");
|
|
51271
|
-
status2.classList.add(styles$
|
|
51329
|
+
status2.classList.add(styles$p.status, this.statusClass);
|
|
51272
51330
|
return status2;
|
|
51273
51331
|
});
|
|
51274
51332
|
}
|
|
@@ -51294,7 +51352,7 @@ class GuardrailsStatusController {
|
|
|
51294
51352
|
* where attribution was found, and whether the attribution limit was hit.
|
|
51295
51353
|
*/
|
|
51296
51354
|
setFailure(repos, limitHit) {
|
|
51297
|
-
this.container.classList.add(styles$
|
|
51355
|
+
this.container.classList.add(styles$p.attributionIconFound);
|
|
51298
51356
|
this.container.title = this.tooltip(repos, limitHit);
|
|
51299
51357
|
this.status.innerHTML = this.statusFailed;
|
|
51300
51358
|
}
|
|
@@ -51304,7 +51362,7 @@ class GuardrailsStatusController {
|
|
|
51304
51362
|
* search is unavailable.
|
|
51305
51363
|
*/
|
|
51306
51364
|
setUnavailable(error2) {
|
|
51307
|
-
this.container.classList.add(styles$
|
|
51365
|
+
this.container.classList.add(styles$p.attributionIconUnavailable);
|
|
51308
51366
|
this.container.title = `Guardrails API error: ${error2.message}`;
|
|
51309
51367
|
this.status.innerHTML = this.statusUnavailable;
|
|
51310
51368
|
}
|
|
@@ -51328,12 +51386,12 @@ class GuardrailsStatusController {
|
|
|
51328
51386
|
}
|
|
51329
51387
|
function createButtons(preText, copyButtonOnSubmit, insertButtonOnSubmit) {
|
|
51330
51388
|
const container2 = document.createElement("div");
|
|
51331
|
-
container2.className = styles$
|
|
51389
|
+
container2.className = styles$p.buttonsContainer;
|
|
51332
51390
|
if (!copyButtonOnSubmit) {
|
|
51333
51391
|
return container2;
|
|
51334
51392
|
}
|
|
51335
51393
|
const buttons2 = document.createElement("div");
|
|
51336
|
-
buttons2.className = styles$
|
|
51394
|
+
buttons2.className = styles$p.buttons;
|
|
51337
51395
|
const codeBlockActions = {
|
|
51338
51396
|
copy: copyButtonOnSubmit,
|
|
51339
51397
|
insert: insertButtonOnSubmit
|
|
@@ -51371,12 +51429,12 @@ function createButtons(preText, copyButtonOnSubmit, insertButtonOnSubmit) {
|
|
|
51371
51429
|
}
|
|
51372
51430
|
function createButtonsExperimentalUI(preText, humanMessage, config, codeBlockName, copyButtonOnSubmit, insertButtonOnSubmit, smartApply, smartApplyId, smartApplyState) {
|
|
51373
51431
|
const container2 = document.createElement("div");
|
|
51374
|
-
container2.className = styles$
|
|
51432
|
+
container2.className = styles$p.buttonsContainer;
|
|
51375
51433
|
if (!copyButtonOnSubmit) {
|
|
51376
51434
|
return container2;
|
|
51377
51435
|
}
|
|
51378
51436
|
const buttons2 = document.createElement("div");
|
|
51379
|
-
buttons2.className = styles$
|
|
51437
|
+
buttons2.className = styles$p.buttons;
|
|
51380
51438
|
if (smartApply && smartApplyState === CodyTaskState.Applied && smartApplyId) {
|
|
51381
51439
|
const acceptButton = createAcceptButton(smartApplyId, smartApply);
|
|
51382
51440
|
const rejectButton = createRejectButton(smartApplyId, smartApply);
|
|
@@ -51412,7 +51470,7 @@ function createButtonsExperimentalUI(preText, humanMessage, config, codeBlockNam
|
|
|
51412
51470
|
function createInsertButton(preText, insertButtonOnSubmit) {
|
|
51413
51471
|
const button2 = document.createElement("button");
|
|
51414
51472
|
button2.title = "Insert Code at Cursor";
|
|
51415
|
-
button2.className = styles$
|
|
51473
|
+
button2.className = styles$p.button;
|
|
51416
51474
|
button2.innerHTML = InsertCodeBlockIcon;
|
|
51417
51475
|
if (insertButtonOnSubmit) {
|
|
51418
51476
|
button2.addEventListener("click", () => {
|
|
@@ -51424,7 +51482,7 @@ function createInsertButton(preText, insertButtonOnSubmit) {
|
|
|
51424
51482
|
function createSaveButton(preText, insertButtonOnSubmit) {
|
|
51425
51483
|
const button2 = document.createElement("button");
|
|
51426
51484
|
button2.title = "Save Code to New File...";
|
|
51427
|
-
button2.className = styles$
|
|
51485
|
+
button2.className = styles$p.button;
|
|
51428
51486
|
button2.innerHTML = SaveCodeBlockIcon;
|
|
51429
51487
|
if (insertButtonOnSubmit) {
|
|
51430
51488
|
button2.addEventListener("click", () => insertButtonOnSubmit(preText, true));
|
|
@@ -51433,7 +51491,7 @@ function createSaveButton(preText, insertButtonOnSubmit) {
|
|
|
51433
51491
|
}
|
|
51434
51492
|
function createCodeBlockActionButton(type, text2, title2, iconSvg, codeBlockActions) {
|
|
51435
51493
|
const button2 = document.createElement("button");
|
|
51436
|
-
const className = type === "copy" ? styles$
|
|
51494
|
+
const className = type === "copy" ? styles$p.copyButton : styles$p.insertButton;
|
|
51437
51495
|
button2.innerHTML = iconSvg;
|
|
51438
51496
|
button2.title = title2;
|
|
51439
51497
|
button2.className = className;
|
|
@@ -51466,24 +51524,24 @@ function createCodeBlockActionButton(type, text2, title2, iconSvg, codeBlockActi
|
|
|
51466
51524
|
function createCopyButton(preText, onCopy) {
|
|
51467
51525
|
const button2 = document.createElement("button");
|
|
51468
51526
|
button2.innerHTML = "Copy";
|
|
51469
|
-
button2.className = styles$
|
|
51527
|
+
button2.className = styles$p.button;
|
|
51470
51528
|
const iconContainer2 = document.createElement("div");
|
|
51471
|
-
iconContainer2.className = styles$
|
|
51529
|
+
iconContainer2.className = styles$p.iconContainer;
|
|
51472
51530
|
iconContainer2.innerHTML = CopyCodeBlockIcon;
|
|
51473
51531
|
button2.prepend(iconContainer2);
|
|
51474
51532
|
button2.addEventListener("click", () => {
|
|
51475
51533
|
iconContainer2.innerHTML = CheckCodeBlockIcon;
|
|
51476
|
-
iconContainer2.className = styles$
|
|
51534
|
+
iconContainer2.className = styles$p.iconContainer;
|
|
51477
51535
|
button2.innerHTML = "Copied";
|
|
51478
|
-
button2.className = styles$
|
|
51536
|
+
button2.className = styles$p.button;
|
|
51479
51537
|
button2.prepend(iconContainer2);
|
|
51480
51538
|
navigator.clipboard.writeText(preText).catch((error2) => console.error(error2));
|
|
51481
51539
|
onCopy(preText, "Button");
|
|
51482
51540
|
setTimeout(() => {
|
|
51483
51541
|
iconContainer2.innerHTML = CopyCodeBlockIcon;
|
|
51484
|
-
iconContainer2.className = styles$
|
|
51542
|
+
iconContainer2.className = styles$p.iconContainer;
|
|
51485
51543
|
button2.innerHTML = "Copy";
|
|
51486
|
-
button2.className = styles$
|
|
51544
|
+
button2.className = styles$p.button;
|
|
51487
51545
|
button2.prepend(iconContainer2);
|
|
51488
51546
|
}, 5e3);
|
|
51489
51547
|
console.log("Code: Copy to Clipboard", preText);
|
|
@@ -51492,13 +51550,13 @@ function createCopyButton(preText, onCopy) {
|
|
|
51492
51550
|
}
|
|
51493
51551
|
function createApplyButton(preText, humanMessage, smartApply, smartApplyId, smartApplyState, fileName) {
|
|
51494
51552
|
const button2 = document.createElement("button");
|
|
51495
|
-
button2.className = styles$
|
|
51553
|
+
button2.className = styles$p.button;
|
|
51496
51554
|
switch (smartApplyState) {
|
|
51497
51555
|
case "Working": {
|
|
51498
51556
|
button2.innerHTML = "Applying";
|
|
51499
51557
|
button2.disabled = true;
|
|
51500
51558
|
const iconContainer2 = document.createElement("div");
|
|
51501
|
-
iconContainer2.className = styles$
|
|
51559
|
+
iconContainer2.className = styles$p.iconContainer;
|
|
51502
51560
|
iconContainer2.innerHTML = SyncSpinIcon;
|
|
51503
51561
|
button2.prepend(iconContainer2);
|
|
51504
51562
|
break;
|
|
@@ -51506,7 +51564,7 @@ function createApplyButton(preText, humanMessage, smartApply, smartApplyId, smar
|
|
|
51506
51564
|
default: {
|
|
51507
51565
|
button2.innerHTML = "Apply";
|
|
51508
51566
|
const iconContainer2 = document.createElement("div");
|
|
51509
|
-
iconContainer2.className = styles$
|
|
51567
|
+
iconContainer2.className = styles$p.iconContainer;
|
|
51510
51568
|
iconContainer2.innerHTML = SparkleIcon;
|
|
51511
51569
|
button2.prepend(iconContainer2);
|
|
51512
51570
|
button2.addEventListener(
|
|
@@ -51519,11 +51577,11 @@ function createApplyButton(preText, humanMessage, smartApply, smartApplyId, smar
|
|
|
51519
51577
|
}
|
|
51520
51578
|
function createExecuteButton(command) {
|
|
51521
51579
|
const button2 = document.createElement("button");
|
|
51522
|
-
button2.className = styles$
|
|
51580
|
+
button2.className = styles$p.button;
|
|
51523
51581
|
button2.innerHTML = "Execute";
|
|
51524
51582
|
button2.title = "Send command to Terminal";
|
|
51525
51583
|
const iconContainer2 = document.createElement("div");
|
|
51526
|
-
iconContainer2.className = styles$
|
|
51584
|
+
iconContainer2.className = styles$p.iconContainer;
|
|
51527
51585
|
iconContainer2.innerHTML = '<i class="codicon codicon-terminal tw-align-middle"></i>';
|
|
51528
51586
|
button2.prepend(iconContainer2);
|
|
51529
51587
|
button2.addEventListener("click", () => {
|
|
@@ -51537,10 +51595,10 @@ function createExecuteButton(command) {
|
|
|
51537
51595
|
}
|
|
51538
51596
|
function createAcceptButton(id2, smartApply) {
|
|
51539
51597
|
const button2 = document.createElement("button");
|
|
51540
|
-
button2.className = styles$
|
|
51598
|
+
button2.className = styles$p.button;
|
|
51541
51599
|
button2.innerHTML = "Accept";
|
|
51542
51600
|
const iconContainer2 = document.createElement("div");
|
|
51543
|
-
iconContainer2.className = styles$
|
|
51601
|
+
iconContainer2.className = styles$p.iconContainer;
|
|
51544
51602
|
iconContainer2.innerHTML = TickIcon;
|
|
51545
51603
|
button2.prepend(iconContainer2);
|
|
51546
51604
|
button2.addEventListener("click", () => {
|
|
@@ -51550,10 +51608,10 @@ function createAcceptButton(id2, smartApply) {
|
|
|
51550
51608
|
}
|
|
51551
51609
|
function createRejectButton(id2, smartApply) {
|
|
51552
51610
|
const button2 = document.createElement("button");
|
|
51553
|
-
button2.className = styles$
|
|
51611
|
+
button2.className = styles$p.button;
|
|
51554
51612
|
button2.innerHTML = "Reject";
|
|
51555
51613
|
const iconContainer2 = document.createElement("div");
|
|
51556
|
-
iconContainer2.className = styles$
|
|
51614
|
+
iconContainer2.className = styles$p.iconContainer;
|
|
51557
51615
|
iconContainer2.innerHTML = CloseIcon;
|
|
51558
51616
|
button2.prepend(iconContainer2);
|
|
51559
51617
|
button2.addEventListener("click", () => {
|
|
@@ -51565,7 +51623,7 @@ function createActionsDropdown(preText) {
|
|
|
51565
51623
|
const button2 = document.createElement("button");
|
|
51566
51624
|
button2.innerHTML = EllipsisIcon;
|
|
51567
51625
|
button2.title = "More Actions...";
|
|
51568
|
-
button2.className = styles$
|
|
51626
|
+
button2.className = styles$p.button;
|
|
51569
51627
|
const vscodeContext = {
|
|
51570
51628
|
webviewSection: "codeblock-actions",
|
|
51571
51629
|
preventDefaultContextMenuItems: true,
|
|
@@ -51643,7 +51701,7 @@ const ChatMessageContent = ({
|
|
|
51643
51701
|
if (!(preElements == null ? void 0 : preElements.length) || !copyButtonOnSubmit) {
|
|
51644
51702
|
return;
|
|
51645
51703
|
}
|
|
51646
|
-
const existingButtons = rootRef.current.querySelectorAll(`.${styles$
|
|
51704
|
+
const existingButtons = rootRef.current.querySelectorAll(`.${styles$p.buttonsContainer}`);
|
|
51647
51705
|
for (const existingButton of existingButtons) {
|
|
51648
51706
|
existingButton.remove();
|
|
51649
51707
|
}
|
|
@@ -51677,11 +51735,11 @@ const ChatMessageContent = ({
|
|
|
51677
51735
|
);
|
|
51678
51736
|
}
|
|
51679
51737
|
const metadataContainer2 = document.createElement("div");
|
|
51680
|
-
metadataContainer2.classList.add(styles$
|
|
51738
|
+
metadataContainer2.classList.add(styles$p.metadataContainer);
|
|
51681
51739
|
buttons2.append(metadataContainer2);
|
|
51682
51740
|
if (guardrails) {
|
|
51683
51741
|
const container2 = document.createElement("div");
|
|
51684
|
-
container2.classList.add(styles$
|
|
51742
|
+
container2.classList.add(styles$p.attributionContainer);
|
|
51685
51743
|
metadataContainer2.append(container2);
|
|
51686
51744
|
if (!isMessageLoading) {
|
|
51687
51745
|
const g2 = new GuardrailsStatusController(container2);
|
|
@@ -51705,7 +51763,7 @@ const ChatMessageContent = ({
|
|
|
51705
51763
|
}
|
|
51706
51764
|
if (fileName) {
|
|
51707
51765
|
const fileNameContainer2 = document.createElement("div");
|
|
51708
|
-
fileNameContainer2.className = styles$
|
|
51766
|
+
fileNameContainer2.className = styles$p.fileNameContainer;
|
|
51709
51767
|
fileNameContainer2.textContent = getFileName(fileName);
|
|
51710
51768
|
fileNameContainer2.title = fileName;
|
|
51711
51769
|
metadataContainer2.append(fileNameContainer2);
|
|
@@ -51724,7 +51782,7 @@ const ChatMessageContent = ({
|
|
|
51724
51782
|
smartApplyInterceptor,
|
|
51725
51783
|
smartApplyStates
|
|
51726
51784
|
]);
|
|
51727
|
-
return /* @__PURE__ */ jsx("div", { ref: rootRef, "data-testid": "chat-message-content", children: /* @__PURE__ */ jsx(MarkdownFromCody, { className: clsx$1(styles$
|
|
51785
|
+
return /* @__PURE__ */ jsx("div", { ref: rootRef, "data-testid": "chat-message-content", children: /* @__PURE__ */ jsx(MarkdownFromCody, { className: clsx$1(styles$p.content, className), children: displayMarkdown }) });
|
|
51728
51786
|
};
|
|
51729
51787
|
const $global = function() {
|
|
51730
51788
|
if (typeof globalThis !== "undefined") {
|
|
@@ -63400,7 +63458,7 @@ const bannerContainer = "_banner-container_1qtot_55";
|
|
|
63400
63458
|
const banner = "_banner_1qtot_55";
|
|
63401
63459
|
const requestError = "_request-error_1qtot_128";
|
|
63402
63460
|
const requestErrorTitle = "_request-error-title_1qtot_141";
|
|
63403
|
-
const styles$
|
|
63461
|
+
const styles$n = {
|
|
63404
63462
|
errorItem,
|
|
63405
63463
|
icon,
|
|
63406
63464
|
body,
|
|
@@ -63424,8 +63482,8 @@ const ErrorItem = ({ error: error2, userInfo, postMessage }) => {
|
|
|
63424
63482
|
}
|
|
63425
63483
|
return /* @__PURE__ */ jsx(RequestErrorItem, { error: error2.message });
|
|
63426
63484
|
};
|
|
63427
|
-
const RequestErrorItem = ({ error: error2 }) => /* @__PURE__ */ jsxs("div", { className: styles$
|
|
63428
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
63485
|
+
const RequestErrorItem = ({ error: error2 }) => /* @__PURE__ */ jsxs("div", { className: styles$n.requestError, children: [
|
|
63486
|
+
/* @__PURE__ */ jsx("span", { className: styles$n.requestErrorTitle, children: "Request Failed: " }),
|
|
63429
63487
|
error2
|
|
63430
63488
|
] });
|
|
63431
63489
|
const RateLimitErrorItem = ({ error: error2, userInfo, postMessage }) => {
|
|
@@ -63458,9 +63516,9 @@ const RateLimitErrorItem = ({ error: error2, userInfo, postMessage }) => {
|
|
|
63458
63516
|
},
|
|
63459
63517
|
[postMessage, tier, telemetryRecorder]
|
|
63460
63518
|
);
|
|
63461
|
-
return /* @__PURE__ */ jsxs("div", { className: styles$
|
|
63462
|
-
canUpgrade && /* @__PURE__ */ jsx("div", { className: styles$
|
|
63463
|
-
/* @__PURE__ */ jsxs("div", { className: styles$
|
|
63519
|
+
return /* @__PURE__ */ jsxs("div", { className: styles$n.errorItem, children: [
|
|
63520
|
+
canUpgrade && /* @__PURE__ */ jsx("div", { className: styles$n.icon, children: "⚡️" }),
|
|
63521
|
+
/* @__PURE__ */ jsxs("div", { className: styles$n.body, children: [
|
|
63464
63522
|
/* @__PURE__ */ jsxs("header", { children: [
|
|
63465
63523
|
/* @__PURE__ */ jsx("h1", { children: canUpgrade ? "Upgrade to Cody Pro" : "Unable to Send Message" }),
|
|
63466
63524
|
/* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -63468,7 +63526,7 @@ const RateLimitErrorItem = ({ error: error2, userInfo, postMessage }) => {
|
|
|
63468
63526
|
canUpgrade && " Upgrade to Cody Pro for unlimited autocomplete suggestions, chat messages and commands."
|
|
63469
63527
|
] })
|
|
63470
63528
|
] }),
|
|
63471
|
-
/* @__PURE__ */ jsxs("div", { className: styles$
|
|
63529
|
+
/* @__PURE__ */ jsxs("div", { className: styles$n.actions, children: [
|
|
63472
63530
|
canUpgrade && /* @__PURE__ */ jsx(
|
|
63473
63531
|
VSCodeButton,
|
|
63474
63532
|
{
|
|
@@ -63487,12 +63545,12 @@ const RateLimitErrorItem = ({ error: error2, userInfo, postMessage }) => {
|
|
|
63487
63545
|
}
|
|
63488
63546
|
)
|
|
63489
63547
|
] }),
|
|
63490
|
-
error2.retryMessage && /* @__PURE__ */ jsx("p", { className: styles$
|
|
63548
|
+
error2.retryMessage && /* @__PURE__ */ jsx("p", { className: styles$n.retryMessage, children: error2.retryMessage })
|
|
63491
63549
|
] }),
|
|
63492
|
-
canUpgrade && /* @__PURE__ */ jsx("div", { className: styles$
|
|
63550
|
+
canUpgrade && /* @__PURE__ */ jsx("div", { className: styles$n.bannerContainer, children: /* @__PURE__ */ jsx(
|
|
63493
63551
|
"div",
|
|
63494
63552
|
{
|
|
63495
|
-
className: styles$
|
|
63553
|
+
className: styles$n.banner,
|
|
63496
63554
|
role: "button",
|
|
63497
63555
|
tabIndex: -1,
|
|
63498
63556
|
onClick: () => onButtonClick("upgrade", "upgrade"),
|
|
@@ -63505,7 +63563,7 @@ const RateLimitErrorItem = ({ error: error2, userInfo, postMessage }) => {
|
|
|
63505
63563
|
const feedbackButtons = "_feedback-buttons_16gni_1";
|
|
63506
63564
|
const feedbackButton = "_feedback-button_16gni_1";
|
|
63507
63565
|
const thumbsDownFeedbackContainer = "_thumbs-down-feedback-container_16gni_14";
|
|
63508
|
-
const styles$
|
|
63566
|
+
const styles$m = {
|
|
63509
63567
|
feedbackButtons,
|
|
63510
63568
|
feedbackButton,
|
|
63511
63569
|
thumbsDownFeedbackContainer
|
|
@@ -63522,12 +63580,12 @@ const FeedbackButtons = ({
|
|
|
63522
63580
|
},
|
|
63523
63581
|
[feedbackButtonsOnSubmit]
|
|
63524
63582
|
);
|
|
63525
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx$1(styles$
|
|
63583
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx$1(styles$m.feedbackButtons, className), children: [
|
|
63526
63584
|
!feedbackSubmitted && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
63527
63585
|
/* @__PURE__ */ jsx(
|
|
63528
63586
|
VSCodeButton,
|
|
63529
63587
|
{
|
|
63530
|
-
className: clsx$1("tw-text-muted-foreground", styles$
|
|
63588
|
+
className: clsx$1("tw-text-muted-foreground", styles$m.feedbackButton),
|
|
63531
63589
|
appearance: "icon",
|
|
63532
63590
|
type: "button",
|
|
63533
63591
|
onClick: () => onFeedbackBtnSubmit("thumbsUp"),
|
|
@@ -63538,7 +63596,7 @@ const FeedbackButtons = ({
|
|
|
63538
63596
|
/* @__PURE__ */ jsx(
|
|
63539
63597
|
VSCodeButton,
|
|
63540
63598
|
{
|
|
63541
|
-
className: clsx$1("tw-text-muted-foreground", styles$
|
|
63599
|
+
className: clsx$1("tw-text-muted-foreground", styles$m.feedbackButton),
|
|
63542
63600
|
appearance: "icon",
|
|
63543
63601
|
type: "button",
|
|
63544
63602
|
onClick: () => onFeedbackBtnSubmit("thumbsDown"),
|
|
@@ -63550,7 +63608,7 @@ const FeedbackButtons = ({
|
|
|
63550
63608
|
feedbackSubmitted === "thumbsUp" && /* @__PURE__ */ jsxs(
|
|
63551
63609
|
VSCodeButton,
|
|
63552
63610
|
{
|
|
63553
|
-
className: clsx$1(styles$
|
|
63611
|
+
className: clsx$1(styles$m.feedbackButton),
|
|
63554
63612
|
appearance: "icon",
|
|
63555
63613
|
type: "button",
|
|
63556
63614
|
disabled: true,
|
|
@@ -63561,11 +63619,11 @@ const FeedbackButtons = ({
|
|
|
63561
63619
|
]
|
|
63562
63620
|
}
|
|
63563
63621
|
),
|
|
63564
|
-
feedbackSubmitted === "thumbsDown" && /* @__PURE__ */ jsxs("span", { className: styles$
|
|
63622
|
+
feedbackSubmitted === "thumbsDown" && /* @__PURE__ */ jsxs("span", { className: styles$m.thumbsDownFeedbackContainer, children: [
|
|
63565
63623
|
/* @__PURE__ */ jsxs(
|
|
63566
63624
|
VSCodeButton,
|
|
63567
63625
|
{
|
|
63568
|
-
className: clsx$1(styles$
|
|
63626
|
+
className: clsx$1(styles$m.feedbackButton),
|
|
63569
63627
|
appearance: "icon",
|
|
63570
63628
|
type: "button",
|
|
63571
63629
|
disabled: true,
|
|
@@ -64193,18 +64251,18 @@ function highlightNodeHelper(currentNode, currentOffset, start, length) {
|
|
|
64193
64251
|
}
|
|
64194
64252
|
const code = "_code_1suzz_6";
|
|
64195
64253
|
const small = "_small_1suzz_13";
|
|
64196
|
-
const styles$
|
|
64254
|
+
const styles$l = {
|
|
64197
64255
|
code,
|
|
64198
64256
|
small
|
|
64199
64257
|
};
|
|
64200
|
-
const getFontWeightStyle = (weight) => clsx$1(styles$
|
|
64258
|
+
const getFontWeightStyle = (weight) => clsx$1(styles$l[`fontWeight${upperFirst(weight)}`]);
|
|
64201
64259
|
const Code = forwardRef(function Code2({ children: children2, as: Component = "code", size: size2, weight, className, ...props }, reference) {
|
|
64202
64260
|
return /* @__PURE__ */ jsx(
|
|
64203
64261
|
Component,
|
|
64204
64262
|
{
|
|
64205
64263
|
className: clsx$1(
|
|
64206
|
-
styles$
|
|
64207
|
-
size2 === "small" && styles$
|
|
64264
|
+
styles$l.code,
|
|
64265
|
+
size2 === "small" && styles$l.small,
|
|
64208
64266
|
weight && getFontWeightStyle(weight),
|
|
64209
64267
|
className
|
|
64210
64268
|
),
|
|
@@ -64217,7 +64275,7 @@ const Code = forwardRef(function Code2({ children: children2, as: Component = "c
|
|
|
64217
64275
|
const codeExcerpt = "_code-excerpt_1gr2h_1";
|
|
64218
64276
|
const codeExcerptError = "_code-excerpt-error_1gr2h_1";
|
|
64219
64277
|
const codeExcerptAlert = "_code-excerpt-alert_1gr2h_1";
|
|
64220
|
-
const styles$
|
|
64278
|
+
const styles$k = {
|
|
64221
64279
|
codeExcerpt,
|
|
64222
64280
|
codeExcerptError,
|
|
64223
64281
|
codeExcerptAlert
|
|
@@ -64294,7 +64352,7 @@ const CodeExcerpt = (props) => {
|
|
|
64294
64352
|
}
|
|
64295
64353
|
}
|
|
64296
64354
|
}, [highlightRanges, startLine, endLine, tableContainerElement, table2]);
|
|
64297
|
-
return /* @__PURE__ */ jsx(Code, { className: clsx$1(styles$
|
|
64355
|
+
return /* @__PURE__ */ jsx(Code, { className: clsx$1(styles$k.codeExcerpt, className), "data-code-excerpt": true, children: /* @__PURE__ */ jsx("div", { ref: setTableContainerElement, children: table2 }) });
|
|
64298
64356
|
};
|
|
64299
64357
|
const resultContainer = "_result-container_61rcx_12";
|
|
64300
64358
|
const header$2 = "_header_61rcx_32";
|
|
@@ -64312,7 +64370,7 @@ const titleInner = "_title-inner_61rcx_119";
|
|
|
64312
64370
|
const toggleMatchesButton = "_toggle-matches-button_61rcx_123";
|
|
64313
64371
|
const toggleMatchesButtonExpanded = "_toggle-matches-button--expanded_61rcx_1";
|
|
64314
64372
|
const toggleMatchesButtonText = "_toggle-matches-button-text_61rcx_1";
|
|
64315
|
-
const styles$
|
|
64373
|
+
const styles$j = {
|
|
64316
64374
|
resultContainer,
|
|
64317
64375
|
header: header$2,
|
|
64318
64376
|
headerTitle,
|
|
@@ -64331,7 +64389,7 @@ const styles$i = {
|
|
|
64331
64389
|
toggleMatchesButtonText
|
|
64332
64390
|
};
|
|
64333
64391
|
const chunk = "_chunk_1nj7l_1";
|
|
64334
|
-
const styles$
|
|
64392
|
+
const styles$i = {
|
|
64335
64393
|
chunk
|
|
64336
64394
|
};
|
|
64337
64395
|
const FileMatchChildren = (props) => {
|
|
@@ -64366,10 +64424,10 @@ const FileMatchChildren = (props) => {
|
|
|
64366
64424
|
"data-href": createCodeExcerptLink(group),
|
|
64367
64425
|
className: clsx$1(
|
|
64368
64426
|
"test-file-match-children-item",
|
|
64369
|
-
styles$
|
|
64370
|
-
styles$
|
|
64371
|
-
styles$
|
|
64372
|
-
styles$
|
|
64427
|
+
styles$i.chunk,
|
|
64428
|
+
styles$j.clickable,
|
|
64429
|
+
styles$j.focusableBlock,
|
|
64430
|
+
styles$j.horizontalDividerBetween
|
|
64373
64431
|
),
|
|
64374
64432
|
children: /* @__PURE__ */ jsx(
|
|
64375
64433
|
CodeExcerpt,
|
|
@@ -64714,7 +64772,7 @@ const FileMatchSearchResult = (props) => {
|
|
|
64714
64772
|
pathMatchRanges: result2.pathMatches ?? [],
|
|
64715
64773
|
fileURL,
|
|
64716
64774
|
repoDisplayName: repoDisplayName ? `${repoDisplayName}${revisionDisplayName ? `@${revisionDisplayName}` : ""}` : void 0,
|
|
64717
|
-
className: styles$
|
|
64775
|
+
className: styles$j.titleInner,
|
|
64718
64776
|
collapsed: hidden2,
|
|
64719
64777
|
onToggleCollapse: () => setHidden((current) => !current)
|
|
64720
64778
|
}
|
|
@@ -64760,13 +64818,13 @@ const FileMatchSearchResult = (props) => {
|
|
|
64760
64818
|
{
|
|
64761
64819
|
type: "button",
|
|
64762
64820
|
className: clsx$1(
|
|
64763
|
-
styles$
|
|
64764
|
-
styles$
|
|
64765
|
-
styles$
|
|
64766
|
-
{ [styles$
|
|
64821
|
+
styles$j.toggleMatchesButton,
|
|
64822
|
+
styles$j.focusableBlock,
|
|
64823
|
+
styles$j.clickable,
|
|
64824
|
+
{ [styles$j.toggleMatchesButtonExpanded]: expanded }
|
|
64767
64825
|
),
|
|
64768
64826
|
onClick: toggleExpand,
|
|
64769
|
-
children: /* @__PURE__ */ jsx("span", { className: styles$
|
|
64827
|
+
children: /* @__PURE__ */ jsx("span", { className: styles$j.toggleMatchesButtonText, children: expanded ? "Show less" : `Show ${hiddenMatchesCount} more ${pluralize(
|
|
64770
64828
|
"match",
|
|
64771
64829
|
hiddenMatchesCount,
|
|
64772
64830
|
"matches"
|
|
@@ -64800,20 +64858,20 @@ const ResultContainer = forwardRef(function ResultContainer2(props, reference) {
|
|
|
64800
64858
|
Component,
|
|
64801
64859
|
{
|
|
64802
64860
|
ref: reference,
|
|
64803
|
-
className: clsx$1(className, styles$
|
|
64861
|
+
className: clsx$1(className, styles$j.resultContainer, "tw-group"),
|
|
64804
64862
|
onClick: onResultClicked,
|
|
64805
64863
|
children: /* @__PURE__ */ jsxs("article", { children: [
|
|
64806
|
-
/* @__PURE__ */ jsxs("header", { className: styles$
|
|
64864
|
+
/* @__PURE__ */ jsxs("header", { className: styles$j.header, "data-result-header": true, children: [
|
|
64807
64865
|
/* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
|
|
64808
64866
|
resultType ? accessibleResultType[resultType] : "search",
|
|
64809
64867
|
" result,"
|
|
64810
64868
|
] }),
|
|
64811
|
-
/* @__PURE__ */ jsx("div", { className: clsx$1(styles$
|
|
64869
|
+
/* @__PURE__ */ jsx("div", { className: clsx$1(styles$j.headerTitle, titleClassName), children: title2 }),
|
|
64812
64870
|
formattedRepositoryStarCount && /* @__PURE__ */ jsx("span", { className: "d-flex align-items-center", children: /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: formattedRepositoryStarCount }) }),
|
|
64813
64871
|
actions2
|
|
64814
64872
|
] }),
|
|
64815
64873
|
rankingDebug && /* @__PURE__ */ jsx("div", { children: rankingDebug }),
|
|
64816
|
-
children2 && !collapsed && /* @__PURE__ */ jsx("div", { className: clsx$1(styles$
|
|
64874
|
+
children2 && !collapsed && /* @__PURE__ */ jsx("div", { className: clsx$1(styles$j.result, resultClassName), children: children2 })
|
|
64817
64875
|
] })
|
|
64818
64876
|
}
|
|
64819
64877
|
);
|
|
@@ -65115,15 +65173,26 @@ const labelVariants = cva(
|
|
|
65115
65173
|
const Label = React.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsx(Root$2, { ref: ref2, className: cn(labelVariants(), className), ...props }));
|
|
65116
65174
|
Label.displayName = Root$2.displayName;
|
|
65117
65175
|
const infoMessage = "_info-message_1hay9_1";
|
|
65118
|
-
const styles$
|
|
65176
|
+
const styles$h = {
|
|
65119
65177
|
infoMessage
|
|
65120
65178
|
};
|
|
65121
65179
|
const InfoMessage = ({ children: children2, className }) => {
|
|
65122
|
-
return /* @__PURE__ */ jsx("div", { className: cn(styles$
|
|
65180
|
+
return /* @__PURE__ */ jsx("div", { className: cn(styles$h.infoMessage, "tw-p-4 tw-rounded-sm", className), children: children2 });
|
|
65181
|
+
};
|
|
65182
|
+
const TELEMETRY_INTENT = {
|
|
65183
|
+
CHAT: 1,
|
|
65184
|
+
SEARCH: 2
|
|
65185
|
+
};
|
|
65186
|
+
const TELEMETRY_SEARCH_FILTER = {
|
|
65187
|
+
UNKNOWN: 1,
|
|
65188
|
+
REPO: 2,
|
|
65189
|
+
LANGUAGE: 3,
|
|
65190
|
+
FILE: 4,
|
|
65191
|
+
TYPE: 5
|
|
65123
65192
|
};
|
|
65124
65193
|
const filter = "_filter_u880r_1";
|
|
65125
65194
|
const selected = "_selected_u880r_5";
|
|
65126
|
-
const styles$
|
|
65195
|
+
const styles$g = {
|
|
65127
65196
|
filter,
|
|
65128
65197
|
selected
|
|
65129
65198
|
};
|
|
@@ -65132,6 +65201,7 @@ const SearchFilters = ({
|
|
|
65132
65201
|
selectedFilters,
|
|
65133
65202
|
onSelectedFiltersUpdate
|
|
65134
65203
|
}) => {
|
|
65204
|
+
const telemetryRecorder = useTelemetryRecorder();
|
|
65135
65205
|
const filterGroups = useMemo(() => {
|
|
65136
65206
|
const fields = [
|
|
65137
65207
|
"repo",
|
|
@@ -65151,9 +65221,15 @@ const SearchFilters = ({
|
|
|
65151
65221
|
}, [filters, selectedFilters]);
|
|
65152
65222
|
const onFilterSelect = useCallback(
|
|
65153
65223
|
(filter2) => {
|
|
65224
|
+
telemetryRecorder.recordEvent("onebox.filter", "clicked", {
|
|
65225
|
+
metadata: {
|
|
65226
|
+
filterType: getTelemetryFilterType(filter2)
|
|
65227
|
+
},
|
|
65228
|
+
privateMetadata: { value: filter2.value }
|
|
65229
|
+
});
|
|
65154
65230
|
onSelectedFiltersUpdate([...selectedFilters, filter2]);
|
|
65155
65231
|
},
|
|
65156
|
-
[selectedFilters, onSelectedFiltersUpdate]
|
|
65232
|
+
[selectedFilters, onSelectedFiltersUpdate, telemetryRecorder]
|
|
65157
65233
|
);
|
|
65158
65234
|
const onFilterDeselect = useCallback(
|
|
65159
65235
|
(filter2) => {
|
|
@@ -65210,10 +65286,10 @@ const SearchFilter = ({
|
|
|
65210
65286
|
"div",
|
|
65211
65287
|
{
|
|
65212
65288
|
className: classNames(
|
|
65213
|
-
styles$
|
|
65289
|
+
styles$g.filter,
|
|
65214
65290
|
"tw-flex tw-justify-between tw-items-center tw-py-2 tw-px-4 tw-rounded-md tw-cursor-pointer hover:tw-bg-accent hover:tw-text-accent-foreground",
|
|
65215
65291
|
{
|
|
65216
|
-
[styles$
|
|
65292
|
+
[styles$g.selected]: selected2
|
|
65217
65293
|
}
|
|
65218
65294
|
),
|
|
65219
65295
|
onClick: onClickHandler,
|
|
@@ -65227,6 +65303,20 @@ const SearchFilter = ({
|
|
|
65227
65303
|
);
|
|
65228
65304
|
};
|
|
65229
65305
|
const isFilterEqual = (a2, b2) => a2.kind === b2.kind && a2.value === b2.value;
|
|
65306
|
+
function getTelemetryFilterType(filter2) {
|
|
65307
|
+
switch (filter2.kind) {
|
|
65308
|
+
case "lang":
|
|
65309
|
+
return TELEMETRY_SEARCH_FILTER.LANGUAGE;
|
|
65310
|
+
case "type":
|
|
65311
|
+
return TELEMETRY_SEARCH_FILTER.TYPE;
|
|
65312
|
+
case "repo":
|
|
65313
|
+
return TELEMETRY_SEARCH_FILTER.REPO;
|
|
65314
|
+
case "file":
|
|
65315
|
+
return TELEMETRY_SEARCH_FILTER.FILE;
|
|
65316
|
+
default:
|
|
65317
|
+
return TELEMETRY_SEARCH_FILTER.UNKNOWN;
|
|
65318
|
+
}
|
|
65319
|
+
}
|
|
65230
65320
|
const SearchFiltersModal = ({
|
|
65231
65321
|
selectedFilters,
|
|
65232
65322
|
filters,
|
|
@@ -65264,6 +65354,26 @@ const SearchFiltersModal = ({
|
|
|
65264
65354
|
] })
|
|
65265
65355
|
] });
|
|
65266
65356
|
};
|
|
65357
|
+
const root$4 = "_root_fzfjq_1";
|
|
65358
|
+
const resultsContainer = "_results-container_fzfjq_6";
|
|
65359
|
+
const filtersSidebarHidden = "_filters-sidebar-hidden_fzfjq_9";
|
|
65360
|
+
const filtersSidebar = "_filters-sidebar_fzfjq_9";
|
|
65361
|
+
const filtersSidebarToggle = "_filters-sidebar-toggle_fzfjq_16";
|
|
65362
|
+
const container$2 = "_container_fzfjq_20";
|
|
65363
|
+
const filtersModalTrigger = "_filters-modal-trigger_fzfjq_30";
|
|
65364
|
+
const searchResultsHeader = "_search-results-header_fzfjq_43";
|
|
65365
|
+
const searchResultsHeaderLabel = "_search-results-header__label_fzfjq_52";
|
|
65366
|
+
const styles$f = {
|
|
65367
|
+
root: root$4,
|
|
65368
|
+
resultsContainer,
|
|
65369
|
+
filtersSidebarHidden,
|
|
65370
|
+
filtersSidebar,
|
|
65371
|
+
filtersSidebarToggle,
|
|
65372
|
+
container: container$2,
|
|
65373
|
+
filtersModalTrigger,
|
|
65374
|
+
searchResultsHeader,
|
|
65375
|
+
searchResultsHeaderLabel
|
|
65376
|
+
};
|
|
65267
65377
|
const DEFAULT_RESULTS_LIMIT = 10;
|
|
65268
65378
|
const SearchResults = ({
|
|
65269
65379
|
message: message2,
|
|
@@ -65272,7 +65382,8 @@ const SearchResults = ({
|
|
|
65272
65382
|
feedbackButtonsOnSubmit,
|
|
65273
65383
|
enableContextSelection
|
|
65274
65384
|
}) => {
|
|
65275
|
-
var _a;
|
|
65385
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i2, _j;
|
|
65386
|
+
const telemetryRecorder = useTelemetryRecorder();
|
|
65276
65387
|
const experimentalOneBoxDebug = useExperimentalOneBoxDebug();
|
|
65277
65388
|
const lastEditorRef = useContext(LastEditorContext);
|
|
65278
65389
|
const [selectedFollowUpResults, updateSelectedFollowUpResults] = useReducer(
|
|
@@ -65280,7 +65391,8 @@ const SearchResults = ({
|
|
|
65280
65391
|
/* @__PURE__ */ new Set()
|
|
65281
65392
|
);
|
|
65282
65393
|
const [showAll, setShowAll] = useState(false);
|
|
65283
|
-
const [
|
|
65394
|
+
const [showFiltersModal, setShowFiltersModal] = useState(false);
|
|
65395
|
+
const [showFiltersSidebar, setShowFiltersSidebar] = useState(true);
|
|
65284
65396
|
const totalResults = useMemo(
|
|
65285
65397
|
() => {
|
|
65286
65398
|
var _a2;
|
|
@@ -65305,7 +65417,7 @@ const SearchResults = ({
|
|
|
65305
65417
|
});
|
|
65306
65418
|
}, [initialResults]);
|
|
65307
65419
|
useLayoutEffect(() => {
|
|
65308
|
-
var _a2,
|
|
65420
|
+
var _a2, _b2;
|
|
65309
65421
|
if (!enableContextSelection) {
|
|
65310
65422
|
return;
|
|
65311
65423
|
}
|
|
@@ -65325,131 +65437,273 @@ const SearchResults = ({
|
|
|
65325
65437
|
}
|
|
65326
65438
|
}).filter(isDefined)
|
|
65327
65439
|
);
|
|
65328
|
-
(_a2 = lastEditorRef.current) == null ? void 0 : _a2.upsertMentions([contextItem2]);
|
|
65440
|
+
(_a2 = lastEditorRef.current) == null ? void 0 : _a2.upsertMentions([contextItem2], "before", " ", false);
|
|
65329
65441
|
} else {
|
|
65330
|
-
(
|
|
65442
|
+
(_b2 = lastEditorRef.current) == null ? void 0 : _b2.filterMentions(
|
|
65331
65443
|
(mention) => mention.type !== "openctx" || mention.providerUri !== CODE_SEARCH_PROVIDER_URI
|
|
65332
65444
|
);
|
|
65333
65445
|
}
|
|
65334
65446
|
}, [enableContextSelection, selectedFollowUpResults, lastEditorRef]);
|
|
65335
|
-
const handleSelectForContext = useCallback(
|
|
65336
|
-
|
|
65337
|
-
|
|
65338
|
-
|
|
65339
|
-
|
|
65340
|
-
|
|
65341
|
-
|
|
65447
|
+
const handleSelectForContext = useCallback(
|
|
65448
|
+
(selected2, result2) => {
|
|
65449
|
+
telemetryRecorder.recordEvent(
|
|
65450
|
+
"onebox.resultContext",
|
|
65451
|
+
selected2 ? "individualSelected" : "individualDeselected",
|
|
65452
|
+
{
|
|
65453
|
+
metadata: { resultRank: totalResults.indexOf(result2) }
|
|
65454
|
+
}
|
|
65455
|
+
);
|
|
65456
|
+
updateSelectedFollowUpResults({
|
|
65457
|
+
type: selected2 ? "add" : "remove",
|
|
65458
|
+
results: [result2]
|
|
65459
|
+
});
|
|
65460
|
+
},
|
|
65461
|
+
[totalResults, telemetryRecorder]
|
|
65462
|
+
);
|
|
65463
|
+
if (showFiltersModal) {
|
|
65342
65464
|
return /* @__PURE__ */ jsx(
|
|
65343
65465
|
SearchFiltersModal,
|
|
65344
65466
|
{
|
|
65345
65467
|
filters: ((_a = message2.search.response) == null ? void 0 : _a.results.dynamicFilters) || [],
|
|
65346
65468
|
selectedFilters: message2.search.selectedFilters || [],
|
|
65347
65469
|
onSelectedFiltersUpdate,
|
|
65348
|
-
close: () =>
|
|
65470
|
+
close: () => {
|
|
65471
|
+
telemetryRecorder.recordEvent("onebox.filterModal", "closed");
|
|
65472
|
+
setShowFiltersModal(false);
|
|
65473
|
+
}
|
|
65349
65474
|
}
|
|
65350
65475
|
);
|
|
65351
65476
|
}
|
|
65352
|
-
|
|
65353
|
-
|
|
65354
|
-
|
|
65355
|
-
|
|
65356
|
-
|
|
65357
|
-
|
|
65358
|
-
|
|
65359
|
-
|
|
65360
|
-
|
|
65361
|
-
"
|
|
65362
|
-
|
|
65363
|
-
|
|
65364
|
-
|
|
65365
|
-
|
|
65366
|
-
"Filters"
|
|
65367
|
-
] }),
|
|
65368
|
-
/* @__PURE__ */ jsxs("div", { className: "tw-flex tw-items-center tw-gap-4", children: [
|
|
65369
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: "search-results.select-all", children: "Add to context:" }),
|
|
65370
|
-
/* @__PURE__ */ jsx(
|
|
65371
|
-
"input",
|
|
65372
|
-
{
|
|
65373
|
-
type: "checkbox",
|
|
65374
|
-
id: "search-results.select-all",
|
|
65375
|
-
checked: selectedFollowUpResults.size === resultsToShow.length,
|
|
65376
|
-
disabled: !enableContextSelection,
|
|
65377
|
-
onChange: (event) => {
|
|
65378
|
-
if (event.target.checked) {
|
|
65379
|
-
updateSelectedFollowUpResults({
|
|
65380
|
-
type: "add",
|
|
65381
|
-
results: resultsToShow
|
|
65382
|
-
});
|
|
65383
|
-
} else {
|
|
65384
|
-
updateSelectedFollowUpResults({
|
|
65385
|
-
type: "init",
|
|
65386
|
-
results: []
|
|
65387
|
-
});
|
|
65388
|
-
}
|
|
65389
|
-
}
|
|
65390
|
-
}
|
|
65391
|
-
)
|
|
65392
|
-
] })
|
|
65393
|
-
] })
|
|
65394
|
-
] }),
|
|
65395
|
-
experimentalOneBoxDebug && message2.search.query && /* @__PURE__ */ jsxs(InfoMessage, { className: "tw-mt-4", children: [
|
|
65396
|
-
"Query: ",
|
|
65397
|
-
message2.search.query
|
|
65398
|
-
] }),
|
|
65399
|
-
experimentalOneBoxDebug && message2.search.queryWithSelectedFilters && /* @__PURE__ */ jsxs(InfoMessage, { className: "tw-mt-4", children: [
|
|
65400
|
-
"Query with selected filters: ",
|
|
65401
|
-
message2.search.queryWithSelectedFilters
|
|
65402
|
-
] }),
|
|
65403
|
-
!!resultsToShow && /* @__PURE__ */ jsx("ul", { className: "tw-list-none tw-flex tw-flex-col tw-gap-2 tw-pt-2", children: resultsToShow.map((result2, i2) => /* @__PURE__ */ jsx(
|
|
65404
|
-
"li",
|
|
65405
|
-
{
|
|
65406
|
-
children: /* @__PURE__ */ jsx(
|
|
65407
|
-
NLSResultSnippet,
|
|
65477
|
+
const onFilterSidebarClose = useCallback(() => {
|
|
65478
|
+
telemetryRecorder.recordEvent("onebox.filterSidebar", "closed");
|
|
65479
|
+
setShowFiltersSidebar(false);
|
|
65480
|
+
}, [telemetryRecorder]);
|
|
65481
|
+
return /* @__PURE__ */ jsx("div", { className: styles$f.root, children: /* @__PURE__ */ jsxs(
|
|
65482
|
+
"div",
|
|
65483
|
+
{
|
|
65484
|
+
className: classNames(
|
|
65485
|
+
styles$f.container,
|
|
65486
|
+
"tw-flex tw-gap-8 tw-items-start tw-justify-between"
|
|
65487
|
+
),
|
|
65488
|
+
children: [
|
|
65489
|
+
showFiltersSidebar && !!((_c = (_b = message2.search.response) == null ? void 0 : _b.results.dynamicFilters) == null ? void 0 : _c.length) && /* @__PURE__ */ jsxs(
|
|
65490
|
+
"div",
|
|
65408
65491
|
{
|
|
65409
|
-
|
|
65410
|
-
|
|
65411
|
-
|
|
65492
|
+
className: classNames(
|
|
65493
|
+
"tw-min-w-[250px] tw-w-[250px] tw-relative tw-mt-2 tw-p-4 tw-rounded-md",
|
|
65494
|
+
styles$f.filtersSidebar
|
|
65495
|
+
),
|
|
65496
|
+
children: [
|
|
65497
|
+
/* @__PURE__ */ jsx(
|
|
65498
|
+
"div",
|
|
65499
|
+
{
|
|
65500
|
+
className: "tw-absolute tw-top-2 tw-right-2",
|
|
65501
|
+
onClick: onFilterSidebarClose,
|
|
65502
|
+
onKeyDown: onFilterSidebarClose,
|
|
65503
|
+
role: "button",
|
|
65504
|
+
children: /* @__PURE__ */ jsx(PanelLeftClose, { className: "tw-size-8" })
|
|
65505
|
+
}
|
|
65506
|
+
),
|
|
65507
|
+
/* @__PURE__ */ jsx(
|
|
65508
|
+
SearchFilters,
|
|
65509
|
+
{
|
|
65510
|
+
filters: ((_d = message2.search.response) == null ? void 0 : _d.results.dynamicFilters) || [],
|
|
65511
|
+
selectedFilters: message2.search.selectedFilters || [],
|
|
65512
|
+
onSelectedFiltersUpdate
|
|
65513
|
+
}
|
|
65514
|
+
)
|
|
65515
|
+
]
|
|
65412
65516
|
}
|
|
65413
|
-
)
|
|
65414
|
-
|
|
65415
|
-
|
|
65416
|
-
)) }),
|
|
65417
|
-
/* @__PURE__ */ jsxs("div", { className: "tw-flex tw-justify-between tw-gap-4 tw-my-4", children: [
|
|
65418
|
-
/* @__PURE__ */ jsxs("div", { className: "tw-flex tw-items-center tw-gap-4", children: [
|
|
65419
|
-
!showAll && resultsToShow && totalResults && resultsToShow !== totalResults && /* @__PURE__ */ jsxs(
|
|
65420
|
-
Button$2,
|
|
65517
|
+
),
|
|
65518
|
+
!message2.text && !!message2.search.query ? /* @__PURE__ */ jsx("div", { className: "tw-flex-1", children: /* @__PURE__ */ jsx(LoadingDots, {}) }) : /* @__PURE__ */ jsxs(
|
|
65519
|
+
"div",
|
|
65421
65520
|
{
|
|
65422
|
-
|
|
65423
|
-
|
|
65424
|
-
|
|
65425
|
-
type: "add",
|
|
65426
|
-
results: totalResults.slice(resultsToShow.length)
|
|
65427
|
-
});
|
|
65428
|
-
},
|
|
65429
|
-
variant: "outline",
|
|
65521
|
+
className: classNames("tw-flex-1", styles$f.resultsContainer, {
|
|
65522
|
+
[styles$f.filtersSidebarHidden]: !showFiltersSidebar || !((_f = (_e = message2.search.response) == null ? void 0 : _e.results.dynamicFilters) == null ? void 0 : _f.length)
|
|
65523
|
+
}),
|
|
65430
65524
|
children: [
|
|
65431
|
-
/* @__PURE__ */
|
|
65432
|
-
|
|
65525
|
+
!!resultsToShow && /* @__PURE__ */ jsxs(
|
|
65526
|
+
"div",
|
|
65527
|
+
{
|
|
65528
|
+
className: classNames(
|
|
65529
|
+
"tw-flex tw-items-center tw-gap-4 tw-justify-between",
|
|
65530
|
+
styles$f.searchResultsHeader
|
|
65531
|
+
),
|
|
65532
|
+
children: [
|
|
65533
|
+
/* @__PURE__ */ jsxs("div", { className: "tw-flex tw-gap-2 tw-items-center tw-font-semibold tw-text-muted-foreground", children: [
|
|
65534
|
+
/* @__PURE__ */ jsx(Search, { className: "tw-size-8 tw-flex-shrink-0" }),
|
|
65535
|
+
"Displaying ",
|
|
65536
|
+
resultsToShow.length,
|
|
65537
|
+
" code search results"
|
|
65538
|
+
] }),
|
|
65539
|
+
/* @__PURE__ */ jsxs("div", { className: "tw-flex tw-gap-4", children: [
|
|
65540
|
+
!!((_h = (_g = message2.search.response) == null ? void 0 : _g.results.dynamicFilters) == null ? void 0 : _h.length) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
65541
|
+
/* @__PURE__ */ jsxs(
|
|
65542
|
+
Button$2,
|
|
65543
|
+
{
|
|
65544
|
+
onClick: () => {
|
|
65545
|
+
telemetryRecorder.recordEvent(
|
|
65546
|
+
"onebox.filterModal",
|
|
65547
|
+
"opened"
|
|
65548
|
+
);
|
|
65549
|
+
setShowFiltersModal(true);
|
|
65550
|
+
setShowFiltersSidebar(true);
|
|
65551
|
+
},
|
|
65552
|
+
variant: "outline",
|
|
65553
|
+
className: styles$f.filtersModalTrigger,
|
|
65554
|
+
children: [
|
|
65555
|
+
((_i2 = message2.search.selectedFilters) == null ? void 0 : _i2.length) ? /* @__PURE__ */ jsx(FilterX, { className: "tw-size-8" }) : /* @__PURE__ */ jsx(Filter, { className: "tw-size-8" }),
|
|
65556
|
+
/* @__PURE__ */ jsx("span", { className: styles$f.searchResultsHeaderLabel, children: "Filters" })
|
|
65557
|
+
]
|
|
65558
|
+
}
|
|
65559
|
+
),
|
|
65560
|
+
/* @__PURE__ */ jsxs(
|
|
65561
|
+
Button$2,
|
|
65562
|
+
{
|
|
65563
|
+
onClick: () => {
|
|
65564
|
+
setShowFiltersSidebar((open) => {
|
|
65565
|
+
telemetryRecorder.recordEvent(
|
|
65566
|
+
"onebox.filterSidebar",
|
|
65567
|
+
open ? "closed" : "opened"
|
|
65568
|
+
);
|
|
65569
|
+
return !open;
|
|
65570
|
+
});
|
|
65571
|
+
},
|
|
65572
|
+
variant: "outline",
|
|
65573
|
+
className: styles$f.filtersSidebarToggle,
|
|
65574
|
+
children: [
|
|
65575
|
+
((_j = message2.search.selectedFilters) == null ? void 0 : _j.length) ? /* @__PURE__ */ jsx(FilterX, { className: "tw-size-8" }) : /* @__PURE__ */ jsx(Filter, { className: "tw-size-8" }),
|
|
65576
|
+
/* @__PURE__ */ jsx("span", { className: styles$f.searchResultsHeaderLabel, children: "Filters" })
|
|
65577
|
+
]
|
|
65578
|
+
}
|
|
65579
|
+
)
|
|
65580
|
+
] }),
|
|
65581
|
+
/* @__PURE__ */ jsxs("div", { className: "tw-flex tw-items-center tw-gap-4", children: [
|
|
65582
|
+
/* @__PURE__ */ jsx(
|
|
65583
|
+
Label,
|
|
65584
|
+
{
|
|
65585
|
+
htmlFor: "search-results.select-all",
|
|
65586
|
+
className: styles$f.searchResultsHeaderLabel,
|
|
65587
|
+
children: "Add to context:"
|
|
65588
|
+
}
|
|
65589
|
+
),
|
|
65590
|
+
/* @__PURE__ */ jsx(
|
|
65591
|
+
"input",
|
|
65592
|
+
{
|
|
65593
|
+
type: "checkbox",
|
|
65594
|
+
id: "search-results.select-all",
|
|
65595
|
+
checked: selectedFollowUpResults.size === resultsToShow.length,
|
|
65596
|
+
disabled: !enableContextSelection,
|
|
65597
|
+
onChange: (event) => {
|
|
65598
|
+
const checked = event.target.checked;
|
|
65599
|
+
telemetryRecorder.recordEvent(
|
|
65600
|
+
"onebox.results",
|
|
65601
|
+
checked ? "selectAll" : "deselectAll"
|
|
65602
|
+
);
|
|
65603
|
+
if (checked) {
|
|
65604
|
+
updateSelectedFollowUpResults({
|
|
65605
|
+
type: "add",
|
|
65606
|
+
results: resultsToShow
|
|
65607
|
+
});
|
|
65608
|
+
} else {
|
|
65609
|
+
updateSelectedFollowUpResults({
|
|
65610
|
+
type: "init",
|
|
65611
|
+
results: []
|
|
65612
|
+
});
|
|
65613
|
+
}
|
|
65614
|
+
}
|
|
65615
|
+
}
|
|
65616
|
+
)
|
|
65617
|
+
] })
|
|
65618
|
+
] })
|
|
65619
|
+
]
|
|
65620
|
+
}
|
|
65621
|
+
),
|
|
65622
|
+
experimentalOneBoxDebug && message2.search.query && /* @__PURE__ */ jsxs(InfoMessage, { className: "tw-mt-4", children: [
|
|
65623
|
+
"Query: ",
|
|
65624
|
+
/* @__PURE__ */ jsx("code", { children: message2.search.query })
|
|
65625
|
+
] }),
|
|
65626
|
+
experimentalOneBoxDebug && message2.search.queryWithSelectedFilters && /* @__PURE__ */ jsxs(InfoMessage, { className: "tw-mt-4", children: [
|
|
65627
|
+
"Query with selected filters:",
|
|
65628
|
+
" ",
|
|
65629
|
+
/* @__PURE__ */ jsx("code", { children: message2.search.queryWithSelectedFilters })
|
|
65630
|
+
] }),
|
|
65631
|
+
resultsToShow.length ? /* @__PURE__ */ jsx("ul", { className: "tw-list-none tw-flex tw-flex-col tw-gap-2 tw-pt-2", children: resultsToShow.map((result2, i2) => /* @__PURE__ */ jsx(
|
|
65632
|
+
"li",
|
|
65633
|
+
{
|
|
65634
|
+
children: /* @__PURE__ */ jsx(
|
|
65635
|
+
NLSResultSnippet,
|
|
65636
|
+
{
|
|
65637
|
+
result: result2,
|
|
65638
|
+
selectedForContext: selectedFollowUpResults.has(result2),
|
|
65639
|
+
onSelectForContext: enableContextSelection ? handleSelectForContext : void 0
|
|
65640
|
+
}
|
|
65641
|
+
)
|
|
65642
|
+
},
|
|
65643
|
+
i2
|
|
65644
|
+
)) }) : /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-flex-col tw-gap-4 tw-justify-center tw-items-center tw-my-20 tw-text-muted-foreground", children: [
|
|
65645
|
+
/* @__PURE__ */ jsx(OctagonX, { className: "tw-size-8" }),
|
|
65646
|
+
/* @__PURE__ */ jsx("p", { children: "No search results found" })
|
|
65647
|
+
] }),
|
|
65648
|
+
/* @__PURE__ */ jsxs("div", { className: "tw-flex tw-justify-between tw-gap-4 tw-my-4", children: [
|
|
65649
|
+
/* @__PURE__ */ jsxs("div", { className: "tw-flex tw-items-center tw-gap-4", children: [
|
|
65650
|
+
!showAll && resultsToShow && totalResults && resultsToShow !== totalResults && /* @__PURE__ */ jsxs(
|
|
65651
|
+
Button$2,
|
|
65652
|
+
{
|
|
65653
|
+
onClick: () => {
|
|
65654
|
+
telemetryRecorder.recordEvent(
|
|
65655
|
+
"onebox.moreResults",
|
|
65656
|
+
"clicked",
|
|
65657
|
+
{
|
|
65658
|
+
metadata: {
|
|
65659
|
+
totalResults: totalResults.length,
|
|
65660
|
+
resultsAdded: totalResults.length - resultsToShow.length
|
|
65661
|
+
}
|
|
65662
|
+
}
|
|
65663
|
+
);
|
|
65664
|
+
setShowAll(true);
|
|
65665
|
+
updateSelectedFollowUpResults({
|
|
65666
|
+
type: "add",
|
|
65667
|
+
results: totalResults.slice(resultsToShow.length)
|
|
65668
|
+
});
|
|
65669
|
+
},
|
|
65670
|
+
variant: "outline",
|
|
65671
|
+
children: [
|
|
65672
|
+
/* @__PURE__ */ jsx(ArrowDown, { className: "tw-size-8" }),
|
|
65673
|
+
"More results"
|
|
65674
|
+
]
|
|
65675
|
+
}
|
|
65676
|
+
),
|
|
65677
|
+
showFeedbackButtons && feedbackButtonsOnSubmit && /* @__PURE__ */ jsx(FeedbackButtons, { feedbackButtonsOnSubmit })
|
|
65678
|
+
] }),
|
|
65679
|
+
/* @__PURE__ */ jsx(
|
|
65680
|
+
"a",
|
|
65681
|
+
{
|
|
65682
|
+
href: `${serverEndpoint}/search`,
|
|
65683
|
+
target: "_blank",
|
|
65684
|
+
rel: "noreferrer",
|
|
65685
|
+
className: "tw-text-foreground",
|
|
65686
|
+
onClick: () => {
|
|
65687
|
+
telemetryRecorder.recordEvent("onebox.codeSearch", "clicked", {
|
|
65688
|
+
metadata: {
|
|
65689
|
+
totalResults: totalResults.length,
|
|
65690
|
+
resultsAdded: totalResults.length - resultsToShow.length
|
|
65691
|
+
}
|
|
65692
|
+
});
|
|
65693
|
+
},
|
|
65694
|
+
children: /* @__PURE__ */ jsxs(Button$2, { variant: "outline", children: [
|
|
65695
|
+
"Code search ",
|
|
65696
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "tw-size-8" })
|
|
65697
|
+
] })
|
|
65698
|
+
}
|
|
65699
|
+
)
|
|
65700
|
+
] })
|
|
65433
65701
|
]
|
|
65434
65702
|
}
|
|
65435
|
-
)
|
|
65436
|
-
|
|
65437
|
-
|
|
65438
|
-
|
|
65439
|
-
"a",
|
|
65440
|
-
{
|
|
65441
|
-
href: `${serverEndpoint}/search`,
|
|
65442
|
-
target: "_blank",
|
|
65443
|
-
rel: "noreferrer",
|
|
65444
|
-
className: "tw-text-foreground",
|
|
65445
|
-
children: /* @__PURE__ */ jsxs(Button$2, { variant: "outline", children: [
|
|
65446
|
-
"Code search ",
|
|
65447
|
-
/* @__PURE__ */ jsx(ExternalLink, { className: "tw-size-8" })
|
|
65448
|
-
] })
|
|
65449
|
-
}
|
|
65450
|
-
)
|
|
65451
|
-
] })
|
|
65452
|
-
] });
|
|
65703
|
+
)
|
|
65704
|
+
]
|
|
65705
|
+
}
|
|
65706
|
+
) });
|
|
65453
65707
|
};
|
|
65454
65708
|
function selectedResultsReducer(state, action2) {
|
|
65455
65709
|
switch (action2.type) {
|
|
@@ -66263,7 +66517,7 @@ const PromptList = (props) => {
|
|
|
66263
66517
|
const allActions = showOnlyPromptInsertableCommands ? (result2 == null ? void 0 : result2.actions.filter((action2) => action2.actionType === "prompt" || action2.mode === "ask")) ?? [] : (result2 == null ? void 0 : result2.actions) ?? [];
|
|
66264
66518
|
const sortedActions = lastUsedSorting ? getSortedActions(filteredActions(allActions), lastUsedActions) : filteredActions(allActions);
|
|
66265
66519
|
const actions2 = showFirstNItems ? sortedActions.slice(0, showFirstNItems) : sortedActions;
|
|
66266
|
-
const inputPaddingClass = paddingLevels !== "none" ? paddingLevels === "middle" ? "!tw-p-0" : "!tw-p-
|
|
66520
|
+
const inputPaddingClass = paddingLevels !== "none" ? paddingLevels === "middle" ? "!tw-p-0" : "!tw-p-2" : "";
|
|
66267
66521
|
const itemPaddingClass = paddingLevels !== "none" ? paddingLevels === "middle" ? "!tw-px-6" : "!tw-px-8" : "";
|
|
66268
66522
|
const anyPromptFilterActive = !!Object.keys(promptFilters ?? {}).length;
|
|
66269
66523
|
return /* @__PURE__ */ jsx(
|
|
@@ -66592,22 +66846,22 @@ const PromptsFilter = (props) => {
|
|
|
66592
66846
|
};
|
|
66593
66847
|
return (
|
|
66594
66848
|
// we need the surrounding div to prevent the remaining content from jumping
|
|
66595
|
-
/* @__PURE__ */ jsx("div", { className: "tw-pl-
|
|
66596
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, onClick: () => setIsPromptTagsOpen(!isPromptTagsOpen), children: /* @__PURE__ */
|
|
66849
|
+
/* @__PURE__ */ jsx("div", { className: "tw-pl-6 tw-pt-6", children: /* @__PURE__ */ jsxs(Popover, { open: isPromptTagsOpen, onOpenChange: setIsPromptTagsOpen, children: [
|
|
66850
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, onClick: () => setIsPromptTagsOpen(!isPromptTagsOpen), children: /* @__PURE__ */ jsxs(
|
|
66597
66851
|
Button$2,
|
|
66598
66852
|
{
|
|
66599
66853
|
variant: "secondary",
|
|
66600
|
-
className: "tw-bg-popover tw-border tw-border-border
|
|
66601
|
-
children:
|
|
66602
|
-
/* @__PURE__ */ jsx(
|
|
66854
|
+
className: "tw-bg-popover tw-border tw-border-border !tw-justify-between",
|
|
66855
|
+
children: [
|
|
66856
|
+
/* @__PURE__ */ jsx("div", { className: "tw-flex tw-items-center", children: /* @__PURE__ */ jsx(
|
|
66603
66857
|
FilterContent,
|
|
66604
66858
|
{
|
|
66605
66859
|
value: selectedFilter.value,
|
|
66606
66860
|
nameOverride: selectedFilter.nameOverride
|
|
66607
66861
|
}
|
|
66608
|
-
),
|
|
66609
|
-
/* @__PURE__ */ jsx(ChevronDown, { size: 16 })
|
|
66610
|
-
]
|
|
66862
|
+
) }),
|
|
66863
|
+
/* @__PURE__ */ jsx(ChevronDown, { size: 16, className: "tw-text-muted-foreground" })
|
|
66864
|
+
]
|
|
66611
66865
|
}
|
|
66612
66866
|
) }),
|
|
66613
66867
|
/* @__PURE__ */ jsx(
|
|
@@ -66616,7 +66870,7 @@ const PromptsFilter = (props) => {
|
|
|
66616
66870
|
className: "tw-flex tw-flex-col tw-w-full !tw-p-0",
|
|
66617
66871
|
side: "bottom",
|
|
66618
66872
|
align: "start",
|
|
66619
|
-
children: /* @__PURE__ */ jsx("div", { className: "tw-w-[
|
|
66873
|
+
children: /* @__PURE__ */ jsx("div", { className: "tw-w-[240px]", children: /* @__PURE__ */ jsx(
|
|
66620
66874
|
Command,
|
|
66621
66875
|
{
|
|
66622
66876
|
loop: true,
|
|
@@ -66624,7 +66878,7 @@ const PromptsFilter = (props) => {
|
|
|
66624
66878
|
tabIndex: 0,
|
|
66625
66879
|
className: "focus:tw-outline-none",
|
|
66626
66880
|
children: /* @__PURE__ */ jsxs(CommandList, { children: [
|
|
66627
|
-
/* @__PURE__ */ jsx(CommandGroup, { children: /* @__PURE__ */ jsx(
|
|
66881
|
+
/* @__PURE__ */ jsx(CommandGroup, { className: "!tw-py-1", children: /* @__PURE__ */ jsx(
|
|
66628
66882
|
CommandLink,
|
|
66629
66883
|
{
|
|
66630
66884
|
href: `${serverEndpoint}prompts/new`,
|
|
@@ -66703,7 +66957,7 @@ const PromptsFilter = (props) => {
|
|
|
66703
66957
|
className: "tw-flex",
|
|
66704
66958
|
children: [
|
|
66705
66959
|
/* @__PURE__ */ jsx("span", { className: "tw-flex-grow", children: "Explore Prompt Library" }),
|
|
66706
|
-
/* @__PURE__ */ jsx(ExternalLink, { size: 16 })
|
|
66960
|
+
/* @__PURE__ */ jsx(ExternalLink, { size: 16, className: "tw-text-muted-foreground" })
|
|
66707
66961
|
]
|
|
66708
66962
|
}
|
|
66709
66963
|
) })
|
|
@@ -70381,12 +70635,11 @@ const TranscriptInteraction = memo((props) => {
|
|
|
70381
70635
|
onEditSubmit(intent);
|
|
70382
70636
|
telemetryRecorder.recordEvent("onebox.intentCorrection", "clicked", {
|
|
70383
70637
|
metadata: {
|
|
70384
|
-
|
|
70638
|
+
initialIntent: humanMessage.intent === "search" ? TELEMETRY_INTENT.SEARCH : TELEMETRY_INTENT.CHAT,
|
|
70639
|
+
selectedIntent: intent === "search" ? TELEMETRY_INTENT.SEARCH : TELEMETRY_INTENT.CHAT
|
|
70385
70640
|
},
|
|
70386
70641
|
privateMetadata: {
|
|
70387
|
-
|
|
70388
|
-
userSpecifiedIntent: intent,
|
|
70389
|
-
promptText: editorState.text
|
|
70642
|
+
query: editorState.text
|
|
70390
70643
|
}
|
|
70391
70644
|
});
|
|
70392
70645
|
}
|
|
@@ -71080,7 +71333,7 @@ const Notices = ({ user, isTeamsUpgradeCtaEnabled, instanceNotices }) => {
|
|
|
71080
71333
|
if (!activeNotice) {
|
|
71081
71334
|
return null;
|
|
71082
71335
|
}
|
|
71083
|
-
return /* @__PURE__ */ jsx("div", { className: "tw-flex tw-flex-col tw-mx-
|
|
71336
|
+
return /* @__PURE__ */ jsx("div", { className: "tw-flex tw-flex-col tw-mx-2 tw-my-2 tw-p-2 tw-gap-2", children: activeNotice.content });
|
|
71084
71337
|
};
|
|
71085
71338
|
const NoticeContent = ({
|
|
71086
71339
|
variant,
|
|
@@ -71165,12 +71418,12 @@ const MarkdownNotice = (props) => {
|
|
|
71165
71418
|
return /* @__PURE__ */ jsxs(
|
|
71166
71419
|
"div",
|
|
71167
71420
|
{
|
|
71168
|
-
className: "tw-bg-
|
|
71421
|
+
className: "tw-bg-subtle tw-ml-2 tw-mr-2 tw-border tw-border-border tw-relative tw-rounded-lg tw-flex tw-flex-col tw-gap-2 tw-pt-4 tw-pb-6 tw-px-6",
|
|
71169
71422
|
"data-markdown-notice": "",
|
|
71170
71423
|
children: [
|
|
71171
|
-
title2 && /* @__PURE__ */ jsx("h1", { className: "tw-text-
|
|
71172
|
-
/* @__PURE__ */ jsx(MarkdownFromCody, { children: message2 }),
|
|
71173
|
-
/* @__PURE__ */ jsx(Button$2, { variant: "ghost", onClick: onDismiss, className: "tw-absolute tw-top-
|
|
71424
|
+
title2 && /* @__PURE__ */ jsx("h1", { className: "tw-text-md tw-font-semibold tw-text-title tw-flex tw-flex-row tw-items-center tw-gap-3 tw-mt-1 tw-mb-2", children: title2 }),
|
|
71425
|
+
/* @__PURE__ */ jsx(MarkdownFromCody, { className: "tw-text-subtle tw-leading-tight", children: message2 }),
|
|
71426
|
+
/* @__PURE__ */ jsx(Button$2, { variant: "ghost", onClick: onDismiss, className: "tw-absolute tw-top-3 tw-right-2", children: /* @__PURE__ */ jsx(X$2, { size: "14" }) })
|
|
71174
71427
|
]
|
|
71175
71428
|
}
|
|
71176
71429
|
);
|
|
@@ -71365,7 +71618,7 @@ const CodyPanel = ({
|
|
|
71365
71618
|
defaultValue: View.Chat,
|
|
71366
71619
|
value: view,
|
|
71367
71620
|
orientation: "vertical",
|
|
71368
|
-
className: styles$
|
|
71621
|
+
className: styles$t.outerContainer,
|
|
71369
71622
|
children: [
|
|
71370
71623
|
/* @__PURE__ */ jsx(
|
|
71371
71624
|
Notices,
|
|
@@ -71437,15 +71690,15 @@ const CodyPanel = ({
|
|
|
71437
71690
|
}
|
|
71438
71691
|
) });
|
|
71439
71692
|
};
|
|
71440
|
-
const ErrorBanner = ({ errors, setErrors }) => /* @__PURE__ */ jsx("div", { className: styles$
|
|
71693
|
+
const ErrorBanner = ({ errors, setErrors }) => /* @__PURE__ */ jsx("div", { className: styles$t.errorContainer, children: errors.map((error2, i2) => (
|
|
71441
71694
|
// biome-ignore lint/suspicious/noArrayIndexKey: error strings might not be unique, so we have no natural id
|
|
71442
|
-
/* @__PURE__ */ jsxs("div", { className: styles$
|
|
71695
|
+
/* @__PURE__ */ jsxs("div", { className: styles$t.error, children: [
|
|
71443
71696
|
/* @__PURE__ */ jsx("span", { children: error2 }),
|
|
71444
71697
|
/* @__PURE__ */ jsx(
|
|
71445
71698
|
"button",
|
|
71446
71699
|
{
|
|
71447
71700
|
type: "button",
|
|
71448
|
-
className: styles$
|
|
71701
|
+
className: styles$t.closeBtn,
|
|
71449
71702
|
onClick: () => setErrors(errors.filter((e2) => e2 !== error2)),
|
|
71450
71703
|
children: "×"
|
|
71451
71704
|
}
|