@david-xpn/llm-ui-feedback 0.1.14 → 0.1.16
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/index.js +97 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +103 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ function getContrastColor(hexColor) {
|
|
|
52
52
|
|
|
53
53
|
// src/components/FloatingButton.tsx
|
|
54
54
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
55
|
-
function FloatingButton({ onPickClick, onPanelToggle, draftCount, panelOpen, position, buttonColor }) {
|
|
55
|
+
function FloatingButton({ onPickClick, onPanelToggle, draftCount, panelOpen, position, buttonColor, authenticated }) {
|
|
56
56
|
const isBottom = position.includes("bottom");
|
|
57
57
|
const isRight = position.includes("right");
|
|
58
58
|
const anchor = {
|
|
@@ -66,7 +66,7 @@ function FloatingButton({ onPickClick, onPanelToggle, draftCount, panelOpen, pos
|
|
|
66
66
|
gap: 8
|
|
67
67
|
};
|
|
68
68
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: anchor, children: [
|
|
69
|
-
|
|
69
|
+
authenticated && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
70
70
|
"button",
|
|
71
71
|
{
|
|
72
72
|
onClick: onPanelToggle,
|
|
@@ -96,7 +96,7 @@ function FloatingButton({ onPickClick, onPanelToggle, draftCount, panelOpen, pos
|
|
|
96
96
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2", y: "13", width: "2", height: "2", rx: "0.5", fill: "currentColor" }),
|
|
97
97
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "6", y: "13", width: "10", height: "2", rx: "0.5", fill: "currentColor" })
|
|
98
98
|
] }),
|
|
99
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
99
|
+
draftCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
100
100
|
"span",
|
|
101
101
|
{
|
|
102
102
|
style: {
|
|
@@ -549,7 +549,7 @@ function SidePanel({
|
|
|
549
549
|
"Feedback Session",
|
|
550
550
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { fontSize: 11, fontWeight: 400, color: "#9ca3af", marginLeft: 6 }, children: [
|
|
551
551
|
"v",
|
|
552
|
-
"0.1.
|
|
552
|
+
"0.1.16"
|
|
553
553
|
] })
|
|
554
554
|
] }),
|
|
555
555
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -982,6 +982,10 @@ function SubmitModal({ count, onSubmit, onCancel, onDone, submitting, submittedU
|
|
|
982
982
|
const [projects, setProjects] = (0, import_react5.useState)([]);
|
|
983
983
|
const [labels, setLabels] = (0, import_react5.useState)([]);
|
|
984
984
|
const [selectedProjectId, setSelectedProjectId] = (0, import_react5.useState)("");
|
|
985
|
+
const [projectSearch, setProjectSearch] = (0, import_react5.useState)("");
|
|
986
|
+
const [projectDropdownOpen, setProjectDropdownOpen] = (0, import_react5.useState)(false);
|
|
987
|
+
const projectInputRef = (0, import_react5.useRef)(null);
|
|
988
|
+
const projectDropdownRef = (0, import_react5.useRef)(null);
|
|
985
989
|
const [selectedLabelIds, setSelectedLabelIds] = (0, import_react5.useState)([]);
|
|
986
990
|
const [linearError, setLinearError] = (0, import_react5.useState)(null);
|
|
987
991
|
(0, import_react5.useEffect)(() => {
|
|
@@ -998,7 +1002,9 @@ function SubmitModal({ count, onSubmit, onCancel, onDone, submitting, submittedU
|
|
|
998
1002
|
if (cancelled) return;
|
|
999
1003
|
setProjects(p);
|
|
1000
1004
|
setLabels(l);
|
|
1001
|
-
if (p.length > 0)
|
|
1005
|
+
if (p.length > 0) {
|
|
1006
|
+
setSelectedProjectId(p[0].id);
|
|
1007
|
+
}
|
|
1002
1008
|
setLinearLoading(false);
|
|
1003
1009
|
});
|
|
1004
1010
|
}).catch((err) => {
|
|
@@ -1015,6 +1021,25 @@ function SubmitModal({ count, onSubmit, onCancel, onDone, submitting, submittedU
|
|
|
1015
1021
|
(0, import_react5.useEffect)(() => {
|
|
1016
1022
|
if (!ticketTitleEdited) setTicketTitle(title);
|
|
1017
1023
|
}, [title, ticketTitleEdited]);
|
|
1024
|
+
(0, import_react5.useEffect)(() => {
|
|
1025
|
+
function handleClickOutside(e) {
|
|
1026
|
+
if (projectDropdownRef.current && !projectDropdownRef.current.contains(e.target) && projectInputRef.current && !projectInputRef.current.contains(e.target)) {
|
|
1027
|
+
setProjectDropdownOpen(false);
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1031
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1032
|
+
}, []);
|
|
1033
|
+
const filteredProjects = projects.filter(
|
|
1034
|
+
(p) => p.name.toLowerCase().includes(projectSearch.toLowerCase())
|
|
1035
|
+
);
|
|
1036
|
+
const selectedProject = projects.find((p) => p.id === selectedProjectId);
|
|
1037
|
+
const projectDisplayName = (p) => p.name + (p.teams[0] ? ` \u2014 ${p.teams[0].key}` : "");
|
|
1038
|
+
const handleProjectSelect = (p) => {
|
|
1039
|
+
setSelectedProjectId(p.id);
|
|
1040
|
+
setProjectSearch("");
|
|
1041
|
+
setProjectDropdownOpen(false);
|
|
1042
|
+
};
|
|
1018
1043
|
const handleSubmit = () => {
|
|
1019
1044
|
if (!title.trim() || submitting) return;
|
|
1020
1045
|
if (createTicket && linearConfigured && ticketTitle.trim()) {
|
|
@@ -1046,7 +1071,8 @@ function SubmitModal({ count, onSubmit, onCancel, onDone, submitting, submittedU
|
|
|
1046
1071
|
border: "1px solid #d1d5db",
|
|
1047
1072
|
fontSize: 14,
|
|
1048
1073
|
boxSizing: "border-box",
|
|
1049
|
-
background: "#fff"
|
|
1074
|
+
background: "#fff",
|
|
1075
|
+
color: "#111827"
|
|
1050
1076
|
};
|
|
1051
1077
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1052
1078
|
"div",
|
|
@@ -1230,21 +1256,71 @@ function SubmitModal({ count, onSubmit, onCancel, onDone, submitting, submittedU
|
|
|
1230
1256
|
}
|
|
1231
1257
|
)
|
|
1232
1258
|
] }),
|
|
1233
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
1259
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { position: "relative" }, children: [
|
|
1234
1260
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { style: { display: "block", fontSize: 12, color: "#6b7280", marginBottom: 4 }, children: "Project" }),
|
|
1235
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
1236
|
-
"
|
|
1261
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1262
|
+
"input",
|
|
1263
|
+
{
|
|
1264
|
+
ref: projectInputRef,
|
|
1265
|
+
type: "text",
|
|
1266
|
+
value: projectDropdownOpen ? projectSearch : selectedProject ? projectDisplayName(selectedProject) : "",
|
|
1267
|
+
onChange: (e) => {
|
|
1268
|
+
setProjectSearch(e.target.value);
|
|
1269
|
+
setProjectDropdownOpen(true);
|
|
1270
|
+
},
|
|
1271
|
+
onFocus: () => {
|
|
1272
|
+
setProjectSearch("");
|
|
1273
|
+
setProjectDropdownOpen(true);
|
|
1274
|
+
},
|
|
1275
|
+
placeholder: "Search projects\u2026",
|
|
1276
|
+
style: inputStyle
|
|
1277
|
+
}
|
|
1278
|
+
),
|
|
1279
|
+
projectDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1280
|
+
"div",
|
|
1237
1281
|
{
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1282
|
+
ref: projectDropdownRef,
|
|
1283
|
+
style: {
|
|
1284
|
+
position: "absolute",
|
|
1285
|
+
top: "100%",
|
|
1286
|
+
left: 0,
|
|
1287
|
+
right: 0,
|
|
1288
|
+
maxHeight: 160,
|
|
1289
|
+
overflowY: "auto",
|
|
1290
|
+
background: "#fff",
|
|
1291
|
+
border: "1px solid #d1d5db",
|
|
1292
|
+
borderRadius: 8,
|
|
1293
|
+
boxShadow: "0 4px 12px rgba(0,0,0,0.12)",
|
|
1294
|
+
zIndex: 10,
|
|
1295
|
+
marginTop: 2
|
|
1296
|
+
},
|
|
1297
|
+
children: filteredProjects.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { padding: "8px 12px", fontSize: 13, color: "#9ca3af" }, children: "No matching projects" }) : filteredProjects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1298
|
+
"div",
|
|
1299
|
+
{
|
|
1300
|
+
onClick: () => handleProjectSelect(p),
|
|
1301
|
+
style: {
|
|
1302
|
+
padding: "8px 12px",
|
|
1303
|
+
fontSize: 13,
|
|
1304
|
+
cursor: "pointer",
|
|
1305
|
+
background: p.id === selectedProjectId ? "#eff6ff" : "#fff",
|
|
1306
|
+
color: "#111827"
|
|
1307
|
+
},
|
|
1308
|
+
onMouseEnter: (e) => {
|
|
1309
|
+
e.currentTarget.style.background = "#f3f4f6";
|
|
1310
|
+
},
|
|
1311
|
+
onMouseLeave: (e) => {
|
|
1312
|
+
e.currentTarget.style.background = p.id === selectedProjectId ? "#eff6ff" : "#fff";
|
|
1313
|
+
},
|
|
1314
|
+
children: [
|
|
1315
|
+
p.name,
|
|
1316
|
+
p.teams[0] && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { style: { color: "#9ca3af" }, children: [
|
|
1317
|
+
" \u2014 ",
|
|
1318
|
+
p.teams[0].key
|
|
1319
|
+
] })
|
|
1320
|
+
]
|
|
1321
|
+
},
|
|
1322
|
+
p.id
|
|
1323
|
+
))
|
|
1248
1324
|
}
|
|
1249
1325
|
)
|
|
1250
1326
|
] }),
|
|
@@ -1897,7 +1973,8 @@ function FeedbackWidget({
|
|
|
1897
1973
|
draftCount: state.drafts.length,
|
|
1898
1974
|
panelOpen: state.panelOpen,
|
|
1899
1975
|
position,
|
|
1900
|
-
buttonColor
|
|
1976
|
+
buttonColor,
|
|
1977
|
+
authenticated: session.status === "authenticated"
|
|
1901
1978
|
}
|
|
1902
1979
|
),
|
|
1903
1980
|
state.picking && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PickOverlay, { onPick: handlePick, onCancel: handleCancelPicking }),
|