hale-commenting-system 2.0.2 → 2.0.4
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/README.md +16 -207
- package/bin/detect.d.ts +1 -0
- package/bin/detect.js +62 -0
- package/bin/generators.d.ts +18 -0
- package/bin/generators.js +193 -0
- package/bin/hale-commenting.js +4 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +61 -0
- package/bin/onboarding.d.ts +1 -0
- package/bin/onboarding.js +170 -0
- package/bin/postinstall.d.ts +2 -0
- package/bin/postinstall.js +65 -0
- package/bin/validators.d.ts +2 -0
- package/bin/validators.js +66 -0
- package/dist/cli/detect.d.ts +1 -0
- package/dist/cli/detect.js +62 -0
- package/dist/cli/generators.d.ts +18 -0
- package/dist/cli/generators.js +193 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +61 -0
- package/dist/cli/onboarding.d.ts +1 -0
- package/dist/cli/onboarding.js +170 -0
- package/dist/cli/postinstall.d.ts +2 -0
- package/dist/cli/postinstall.js +65 -0
- package/dist/cli/validators.d.ts +2 -0
- package/dist/cli/validators.js +66 -0
- package/dist/components/CommentOverlay.d.ts +2 -0
- package/dist/components/CommentOverlay.js +101 -0
- package/dist/components/CommentPanel.d.ts +6 -0
- package/dist/components/CommentPanel.js +334 -0
- package/dist/components/CommentPin.d.ts +11 -0
- package/dist/components/CommentPin.js +64 -0
- package/dist/components/DetailsTab.d.ts +2 -0
- package/dist/components/DetailsTab.js +380 -0
- package/dist/components/FloatingWidget.d.ts +8 -0
- package/dist/components/FloatingWidget.js +128 -0
- package/dist/components/JiraTab.d.ts +2 -0
- package/dist/components/JiraTab.js +507 -0
- package/dist/contexts/CommentContext.d.ts +30 -0
- package/dist/contexts/CommentContext.js +891 -0
- package/dist/contexts/GitHubAuthContext.d.ts +13 -0
- package/dist/contexts/GitHubAuthContext.js +96 -0
- package/dist/index.d.ts +10 -97
- package/dist/index.js +26 -789
- package/dist/services/githubAdapter.d.ts +56 -0
- package/dist/services/githubAdapter.js +321 -0
- package/dist/types/index.d.ts +25 -0
- package/dist/types/index.js +2 -0
- package/dist/utils/version.d.ts +1 -0
- package/dist/utils/version.js +23 -0
- package/package.json +39 -38
- package/templates/webpack-middleware.js +226 -0
- package/cli/dist/index.js +0 -370
- package/cli/dist/index.js.map +0 -1
- package/dist/index.d.mts +0 -97
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -762
- package/dist/index.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,790 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
CommentDrawer: () => CommentDrawer,
|
|
34
|
-
CommentOverlay: () => CommentOverlay,
|
|
35
|
-
CommentPin: () => CommentPin,
|
|
36
|
-
CommentProvider: () => CommentProvider,
|
|
37
|
-
GitHubAuthProvider: () => GitHubAuthProvider,
|
|
38
|
-
GitLabAuthProvider: () => GitLabAuthProvider,
|
|
39
|
-
VersionProvider: () => VersionProvider,
|
|
40
|
-
useComments: () => useComments,
|
|
41
|
-
useGitHubAuth: () => useGitHubAuth,
|
|
42
|
-
useGitLabAuth: () => useGitLabAuth,
|
|
43
|
-
useVersion: () => useVersion
|
|
44
|
-
});
|
|
45
|
-
module.exports = __toCommonJS(index_exports);
|
|
46
|
-
|
|
47
|
-
// src/components/CommentOverlay.tsx
|
|
48
|
-
var React3 = __toESM(require("react"));
|
|
49
|
-
var import_react_router_dom = require("react-router-dom");
|
|
50
|
-
|
|
51
|
-
// src/contexts/CommentContext.tsx
|
|
52
|
-
var React = __toESM(require("react"));
|
|
53
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
54
|
-
var CommentContext = React.createContext(void 0);
|
|
55
|
-
var STORAGE_KEY = "hale-threads";
|
|
56
|
-
var SHOW_PINS_KEY = "hale-show-pins";
|
|
57
|
-
var ENABLE_COMMENTING_KEY = "hale-enable-commenting";
|
|
58
|
-
var migrateOldComments = () => {
|
|
59
|
-
try {
|
|
60
|
-
const oldThreadsKey = localStorage.getItem("apollo-threads");
|
|
61
|
-
const oldCommentsKey = localStorage.getItem("apollo-comments");
|
|
62
|
-
if (oldThreadsKey) {
|
|
63
|
-
const parsed = JSON.parse(oldThreadsKey);
|
|
64
|
-
const cleanThreads = parsed.map((t) => ({
|
|
65
|
-
id: t.id,
|
|
66
|
-
x: t.x,
|
|
67
|
-
y: t.y,
|
|
68
|
-
route: t.route,
|
|
69
|
-
comments: t.comments.map((c) => ({
|
|
70
|
-
id: c.id,
|
|
71
|
-
text: c.text || "",
|
|
72
|
-
createdAt: c.createdAt,
|
|
73
|
-
author: c.author
|
|
74
|
-
})),
|
|
75
|
-
version: t.version
|
|
76
|
-
}));
|
|
77
|
-
localStorage.setItem(STORAGE_KEY, JSON.stringify(cleanThreads));
|
|
78
|
-
localStorage.removeItem("apollo-threads");
|
|
79
|
-
return cleanThreads;
|
|
80
|
-
}
|
|
81
|
-
if (oldCommentsKey) {
|
|
82
|
-
const parsed = JSON.parse(oldCommentsKey);
|
|
83
|
-
const threads = parsed.map((oldComment) => ({
|
|
84
|
-
id: oldComment.id,
|
|
85
|
-
x: oldComment.x,
|
|
86
|
-
y: oldComment.y,
|
|
87
|
-
route: oldComment.route,
|
|
88
|
-
comments: [
|
|
89
|
-
{
|
|
90
|
-
id: `${oldComment.id}-comment-0`,
|
|
91
|
-
text: oldComment.text || "",
|
|
92
|
-
createdAt: oldComment.createdAt
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
}));
|
|
96
|
-
localStorage.setItem(STORAGE_KEY, JSON.stringify(threads));
|
|
97
|
-
localStorage.removeItem("apollo-comments");
|
|
98
|
-
return threads;
|
|
99
|
-
}
|
|
100
|
-
} catch (error) {
|
|
101
|
-
console.error("Failed to migrate old comments:", error);
|
|
102
|
-
}
|
|
103
|
-
return [];
|
|
104
|
-
};
|
|
105
|
-
var CommentProvider = ({ children }) => {
|
|
106
|
-
const [threads, setThreads] = React.useState(() => {
|
|
107
|
-
try {
|
|
108
|
-
const stored = localStorage.getItem(STORAGE_KEY);
|
|
109
|
-
if (stored) {
|
|
110
|
-
return JSON.parse(stored);
|
|
111
|
-
}
|
|
112
|
-
return migrateOldComments();
|
|
113
|
-
} catch (error) {
|
|
114
|
-
console.error("Failed to load threads from localStorage:", error);
|
|
115
|
-
return [];
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
const [showPins, setShowPins] = React.useState(() => {
|
|
119
|
-
try {
|
|
120
|
-
const stored = localStorage.getItem(SHOW_PINS_KEY);
|
|
121
|
-
if (stored !== null) return stored === "true";
|
|
122
|
-
const oldKey = localStorage.getItem("apollo-show-pins");
|
|
123
|
-
return oldKey === "true";
|
|
124
|
-
} catch (error) {
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
const [enableCommenting, setEnableCommenting] = React.useState(() => {
|
|
129
|
-
try {
|
|
130
|
-
const stored = localStorage.getItem(ENABLE_COMMENTING_KEY);
|
|
131
|
-
if (stored !== null) return stored === "true";
|
|
132
|
-
const oldKey = localStorage.getItem("apollo-enable-commenting");
|
|
133
|
-
return oldKey === "true";
|
|
134
|
-
} catch (error) {
|
|
135
|
-
return false;
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
React.useEffect(() => {
|
|
139
|
-
try {
|
|
140
|
-
localStorage.setItem(STORAGE_KEY, JSON.stringify(threads));
|
|
141
|
-
} catch (error) {
|
|
142
|
-
console.error("Failed to save threads to localStorage:", error);
|
|
143
|
-
}
|
|
144
|
-
}, [threads]);
|
|
145
|
-
React.useEffect(() => {
|
|
146
|
-
try {
|
|
147
|
-
localStorage.setItem(SHOW_PINS_KEY, String(showPins));
|
|
148
|
-
} catch (error) {
|
|
149
|
-
console.error("Failed to save showPins to localStorage:", error);
|
|
150
|
-
}
|
|
151
|
-
}, [showPins]);
|
|
152
|
-
React.useEffect(() => {
|
|
153
|
-
try {
|
|
154
|
-
localStorage.setItem(ENABLE_COMMENTING_KEY, String(enableCommenting));
|
|
155
|
-
} catch (error) {
|
|
156
|
-
console.error("Failed to save enableCommenting to localStorage:", error);
|
|
157
|
-
}
|
|
158
|
-
}, [enableCommenting]);
|
|
159
|
-
const toggleShowPins = React.useCallback(() => {
|
|
160
|
-
setShowPins((prev) => !prev);
|
|
161
|
-
}, []);
|
|
162
|
-
const toggleEnableCommenting = React.useCallback(() => {
|
|
163
|
-
setEnableCommenting((prev) => !prev);
|
|
164
|
-
}, []);
|
|
165
|
-
const addThread = React.useCallback((x, y, route, version) => {
|
|
166
|
-
const threadId = `thread-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
167
|
-
const newThread = {
|
|
168
|
-
id: threadId,
|
|
169
|
-
x,
|
|
170
|
-
y,
|
|
171
|
-
route,
|
|
172
|
-
comments: [],
|
|
173
|
-
version
|
|
174
|
-
};
|
|
175
|
-
setThreads((prev) => [...prev, newThread]);
|
|
176
|
-
return threadId;
|
|
177
|
-
}, []);
|
|
178
|
-
const addReply = React.useCallback((threadId, text) => {
|
|
179
|
-
const commentId = `${threadId}-comment-${Date.now()}`;
|
|
180
|
-
const newComment = {
|
|
181
|
-
id: commentId,
|
|
182
|
-
text,
|
|
183
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
184
|
-
};
|
|
185
|
-
setThreads(
|
|
186
|
-
(prev) => prev.map((t) => {
|
|
187
|
-
if (t.id === threadId) {
|
|
188
|
-
return {
|
|
189
|
-
...t,
|
|
190
|
-
comments: [...t.comments, newComment]
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
return t;
|
|
194
|
-
})
|
|
195
|
-
);
|
|
196
|
-
}, []);
|
|
197
|
-
const updateComment = React.useCallback((threadId, commentId, text) => {
|
|
198
|
-
setThreads(
|
|
199
|
-
(prev) => prev.map((t) => {
|
|
200
|
-
if (t.id === threadId) {
|
|
201
|
-
return {
|
|
202
|
-
...t,
|
|
203
|
-
comments: t.comments.map(
|
|
204
|
-
(c) => c.id === commentId ? { ...c, text } : c
|
|
205
|
-
)
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
return t;
|
|
209
|
-
})
|
|
210
|
-
);
|
|
211
|
-
}, []);
|
|
212
|
-
const deleteComment = React.useCallback((threadId, commentId) => {
|
|
213
|
-
setThreads(
|
|
214
|
-
(prev) => prev.map((t) => {
|
|
215
|
-
if (t.id === threadId) {
|
|
216
|
-
return {
|
|
217
|
-
...t,
|
|
218
|
-
comments: t.comments.filter((c) => c.id !== commentId)
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
return t;
|
|
222
|
-
})
|
|
223
|
-
);
|
|
224
|
-
}, []);
|
|
225
|
-
const deleteThread = React.useCallback((threadId) => {
|
|
226
|
-
setThreads((prev) => prev.filter((t) => t.id !== threadId));
|
|
227
|
-
}, []);
|
|
228
|
-
const clearAllThreads = React.useCallback(() => {
|
|
229
|
-
setThreads([]);
|
|
230
|
-
}, []);
|
|
231
|
-
const getThreadsForRoute = React.useCallback((route, version) => {
|
|
232
|
-
return threads.filter((thread) => {
|
|
233
|
-
const routeMatch = thread.route === route;
|
|
234
|
-
const threadVersion = thread.version || "3";
|
|
235
|
-
const versionMatch = !version || threadVersion === version;
|
|
236
|
-
return routeMatch && versionMatch;
|
|
237
|
-
});
|
|
238
|
-
}, [threads]);
|
|
239
|
-
const value = React.useMemo(
|
|
240
|
-
() => ({
|
|
241
|
-
threads,
|
|
242
|
-
showPins,
|
|
243
|
-
enableCommenting,
|
|
244
|
-
toggleShowPins,
|
|
245
|
-
toggleEnableCommenting,
|
|
246
|
-
addThread,
|
|
247
|
-
addReply,
|
|
248
|
-
updateComment,
|
|
249
|
-
deleteComment,
|
|
250
|
-
deleteThread,
|
|
251
|
-
clearAllThreads,
|
|
252
|
-
getThreadsForRoute
|
|
253
|
-
}),
|
|
254
|
-
[threads, showPins, enableCommenting, toggleShowPins, toggleEnableCommenting, addThread, addReply, updateComment, deleteComment, deleteThread, clearAllThreads, getThreadsForRoute]
|
|
255
|
-
);
|
|
256
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommentContext.Provider, { value, children });
|
|
257
|
-
};
|
|
258
|
-
var useComments = () => {
|
|
259
|
-
const context = React.useContext(CommentContext);
|
|
260
|
-
if (!context) {
|
|
261
|
-
throw new Error("useComments must be used within a CommentProvider");
|
|
262
|
-
}
|
|
263
|
-
return context;
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
// src/contexts/VersionContext.tsx
|
|
267
|
-
var React2 = __toESM(require("react"));
|
|
268
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
269
|
-
var VersionContext = React2.createContext(void 0);
|
|
270
|
-
var VERSION_STORAGE_KEY = "hale-current-version";
|
|
271
|
-
var VersionProvider = ({ children }) => {
|
|
272
|
-
const [currentVersion, setCurrentVersionState] = React2.useState(() => {
|
|
273
|
-
try {
|
|
274
|
-
const stored = localStorage.getItem(VERSION_STORAGE_KEY);
|
|
275
|
-
return stored || "3";
|
|
276
|
-
} catch (error) {
|
|
277
|
-
console.error("Failed to load version from localStorage:", error);
|
|
278
|
-
return "3";
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
React2.useEffect(() => {
|
|
282
|
-
try {
|
|
283
|
-
localStorage.setItem(VERSION_STORAGE_KEY, currentVersion);
|
|
284
|
-
} catch (error) {
|
|
285
|
-
console.error("Failed to save version to localStorage:", error);
|
|
286
|
-
}
|
|
287
|
-
}, [currentVersion]);
|
|
288
|
-
const setCurrentVersion = React2.useCallback((version) => {
|
|
289
|
-
setCurrentVersionState(version);
|
|
290
|
-
}, []);
|
|
291
|
-
const value = React2.useMemo(
|
|
292
|
-
() => ({
|
|
293
|
-
currentVersion,
|
|
294
|
-
setCurrentVersion
|
|
295
|
-
}),
|
|
296
|
-
[currentVersion, setCurrentVersion]
|
|
297
|
-
);
|
|
298
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(VersionContext.Provider, { value, children });
|
|
299
|
-
};
|
|
300
|
-
var useVersion = () => {
|
|
301
|
-
const context = React2.useContext(VersionContext);
|
|
302
|
-
if (!context) {
|
|
303
|
-
throw new Error("useVersion must be used within a VersionProvider");
|
|
304
|
-
}
|
|
305
|
-
return context;
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
// src/components/CommentPin.tsx
|
|
309
|
-
var import_react_core = require("@patternfly/react-core");
|
|
310
|
-
var import_react_icons = require("@patternfly/react-icons");
|
|
311
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
312
|
-
var CommentPin = ({
|
|
313
|
-
thread,
|
|
314
|
-
onPinClick,
|
|
315
|
-
isSelected = false
|
|
316
|
-
}) => {
|
|
317
|
-
const commentCount = thread.comments.length;
|
|
318
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
319
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("style", { children: `
|
|
320
|
-
@keyframes pulse {
|
|
321
|
-
0%, 100% { opacity: 1; }
|
|
322
|
-
50% { opacity: 0.5; }
|
|
323
|
-
}
|
|
324
|
-
` }),
|
|
325
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
326
|
-
import_react_core.Button,
|
|
327
|
-
{
|
|
328
|
-
id: `comment-pin-${thread.id}`,
|
|
329
|
-
variant: "plain",
|
|
330
|
-
"aria-label": `Comment thread with ${commentCount} ${commentCount === 1 ? "comment" : "comments"}`,
|
|
331
|
-
onClick: (e) => {
|
|
332
|
-
e.stopPropagation();
|
|
333
|
-
onPinClick();
|
|
334
|
-
},
|
|
335
|
-
style: {
|
|
336
|
-
position: "absolute",
|
|
337
|
-
left: `${thread.x}px`,
|
|
338
|
-
top: `${thread.y}px`,
|
|
339
|
-
transform: "translate(-50%, -50%)",
|
|
340
|
-
width: "32px",
|
|
341
|
-
height: "32px",
|
|
342
|
-
borderRadius: "50%",
|
|
343
|
-
backgroundColor: "#C9190B",
|
|
344
|
-
color: "white",
|
|
345
|
-
border: isSelected ? "3px solid #0066CC" : "2px solid white",
|
|
346
|
-
boxShadow: isSelected ? "0 0 0 2px #0066CC, 0 4px 12px rgba(0, 0, 0, 0.4)" : "0 2px 8px rgba(0, 0, 0, 0.3)",
|
|
347
|
-
padding: 0,
|
|
348
|
-
display: "flex",
|
|
349
|
-
alignItems: "center",
|
|
350
|
-
justifyContent: "center",
|
|
351
|
-
cursor: "pointer",
|
|
352
|
-
zIndex: isSelected ? 1001 : 1e3,
|
|
353
|
-
transition: "all 0.2s ease",
|
|
354
|
-
fontSize: commentCount > 1 ? "0.7rem" : void 0
|
|
355
|
-
},
|
|
356
|
-
children: commentCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { fontWeight: "bold", fontSize: "0.75rem" }, children: "0" }) : commentCount === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_icons.CommentIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { fontWeight: "bold" }, children: commentCount })
|
|
357
|
-
}
|
|
358
|
-
)
|
|
359
|
-
] });
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
// src/components/CommentOverlay.tsx
|
|
363
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
364
|
-
var CommentOverlay = ({
|
|
365
|
-
selectedThreadId,
|
|
366
|
-
onThreadSelect
|
|
367
|
-
}) => {
|
|
368
|
-
const location = (0, import_react_router_dom.useLocation)();
|
|
369
|
-
const { showPins, enableCommenting, addThread, getThreadsForRoute } = useComments();
|
|
370
|
-
const { currentVersion } = useVersion();
|
|
371
|
-
const overlayRef = React3.useRef(null);
|
|
372
|
-
const currentRouteThreads = React3.useMemo(
|
|
373
|
-
() => getThreadsForRoute(location.pathname, currentVersion),
|
|
374
|
-
[getThreadsForRoute, location.pathname, currentVersion]
|
|
375
|
-
);
|
|
376
|
-
const handleOverlayClick = React3.useCallback(
|
|
377
|
-
(event) => {
|
|
378
|
-
if (!enableCommenting) return;
|
|
379
|
-
if (event.target === overlayRef.current) {
|
|
380
|
-
const rect = overlayRef.current.getBoundingClientRect();
|
|
381
|
-
const x = event.clientX - rect.left;
|
|
382
|
-
const y = event.clientY - rect.top;
|
|
383
|
-
const newThreadId = addThread(x, y, location.pathname, currentVersion);
|
|
384
|
-
onThreadSelect(newThreadId);
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
[enableCommenting, addThread, location.pathname, currentVersion, onThreadSelect]
|
|
388
|
-
);
|
|
389
|
-
if (!showPins && !enableCommenting) {
|
|
390
|
-
return null;
|
|
391
|
-
}
|
|
392
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
393
|
-
"div",
|
|
394
|
-
{
|
|
395
|
-
ref: overlayRef,
|
|
396
|
-
id: "comment-overlay",
|
|
397
|
-
onClick: handleOverlayClick,
|
|
398
|
-
style: {
|
|
399
|
-
position: "absolute",
|
|
400
|
-
top: 0,
|
|
401
|
-
left: 0,
|
|
402
|
-
right: 0,
|
|
403
|
-
bottom: 0,
|
|
404
|
-
pointerEvents: enableCommenting ? "auto" : "none",
|
|
405
|
-
cursor: enableCommenting ? "crosshair" : "default",
|
|
406
|
-
zIndex: 999
|
|
407
|
-
},
|
|
408
|
-
children: showPins && currentRouteThreads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
409
|
-
"div",
|
|
410
|
-
{
|
|
411
|
-
style: { pointerEvents: "auto" },
|
|
412
|
-
onClick: (e) => e.stopPropagation(),
|
|
413
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
414
|
-
CommentPin,
|
|
415
|
-
{
|
|
416
|
-
thread,
|
|
417
|
-
onPinClick: () => onThreadSelect(thread.id),
|
|
418
|
-
isSelected: thread.id === selectedThreadId
|
|
419
|
-
}
|
|
420
|
-
)
|
|
421
|
-
},
|
|
422
|
-
thread.id
|
|
423
|
-
))
|
|
424
|
-
}
|
|
425
|
-
);
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
// src/components/CommentDrawer.tsx
|
|
429
|
-
var React5 = __toESM(require("react"));
|
|
430
|
-
var import_react_core2 = require("@patternfly/react-core");
|
|
431
|
-
var import_react_icons2 = require("@patternfly/react-icons");
|
|
432
|
-
var import_react_router_dom2 = require("react-router-dom");
|
|
433
|
-
|
|
434
|
-
// src/contexts/GitLabAuthContext.tsx
|
|
435
|
-
var React4 = __toESM(require("react"));
|
|
436
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
437
|
-
var GitLabAuthContext = React4.createContext(void 0);
|
|
438
|
-
var GitLabAuthProvider = ({ children }) => {
|
|
439
|
-
const value = {
|
|
440
|
-
user: null,
|
|
441
|
-
isAuthenticated: false,
|
|
442
|
-
login: () => {
|
|
443
|
-
console.log("GitLab login not available in local mode");
|
|
444
|
-
},
|
|
445
|
-
logout: () => {
|
|
446
|
-
console.log("GitLab logout not available in local mode");
|
|
447
|
-
},
|
|
448
|
-
getToken: () => null
|
|
449
|
-
};
|
|
450
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GitLabAuthContext.Provider, { value, children });
|
|
451
|
-
};
|
|
452
|
-
var useGitLabAuth = () => {
|
|
453
|
-
const ctx = React4.useContext(GitLabAuthContext);
|
|
454
|
-
if (!ctx) {
|
|
455
|
-
throw new Error("useGitLabAuth must be used within a GitLabAuthProvider");
|
|
456
|
-
}
|
|
457
|
-
return ctx;
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
// src/components/CommentDrawer.tsx
|
|
461
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
462
|
-
var CommentDrawer = ({
|
|
463
|
-
children,
|
|
464
|
-
selectedThreadId,
|
|
465
|
-
onThreadSelect
|
|
466
|
-
}) => {
|
|
467
|
-
const location = (0, import_react_router_dom2.useLocation)();
|
|
468
|
-
const {
|
|
469
|
-
getThreadsForRoute,
|
|
470
|
-
addReply,
|
|
471
|
-
updateComment,
|
|
472
|
-
deleteComment,
|
|
473
|
-
deleteThread,
|
|
474
|
-
enableCommenting
|
|
475
|
-
} = useComments();
|
|
476
|
-
const { currentVersion } = useVersion();
|
|
477
|
-
const { isAuthenticated: isGitLabAuthenticated } = useGitLabAuth();
|
|
478
|
-
const [editingCommentId, setEditingCommentId] = React5.useState(null);
|
|
479
|
-
const [editText, setEditText] = React5.useState("");
|
|
480
|
-
const [replyText, setReplyText] = React5.useState("");
|
|
481
|
-
const replyTextAreaRef = React5.useRef(null);
|
|
482
|
-
const [threadSummaries, setThreadSummaries] = React5.useState({});
|
|
483
|
-
const [loadingSummary, setLoadingSummary] = React5.useState(false);
|
|
484
|
-
const [summaryExpanded, setSummaryExpanded] = React5.useState(true);
|
|
485
|
-
const currentRouteThreads = getThreadsForRoute(location.pathname, currentVersion);
|
|
486
|
-
const selectedThread = currentRouteThreads.find((t) => t.id === selectedThreadId);
|
|
487
|
-
const isDrawerOpen = selectedThreadId !== null && selectedThread !== void 0;
|
|
488
|
-
React5.useEffect(() => {
|
|
489
|
-
if (!isDrawerOpen || !enableCommenting) return;
|
|
490
|
-
const timer = setTimeout(() => {
|
|
491
|
-
replyTextAreaRef.current?.focus();
|
|
492
|
-
}, 100);
|
|
493
|
-
return () => clearTimeout(timer);
|
|
494
|
-
}, [isDrawerOpen, enableCommenting, selectedThreadId]);
|
|
495
|
-
const handleEdit = (commentId, text) => {
|
|
496
|
-
setEditingCommentId(commentId);
|
|
497
|
-
setEditText(text);
|
|
498
|
-
};
|
|
499
|
-
const handleSave = async (threadId, commentId) => {
|
|
500
|
-
await updateComment(threadId, commentId, editText);
|
|
501
|
-
setEditingCommentId(null);
|
|
502
|
-
};
|
|
503
|
-
const handleAddReply = async () => {
|
|
504
|
-
if (selectedThreadId && replyText.trim()) {
|
|
505
|
-
await addReply(selectedThreadId, replyText);
|
|
506
|
-
setReplyText("");
|
|
507
|
-
}
|
|
508
|
-
};
|
|
509
|
-
const handleDeleteThread = async () => {
|
|
510
|
-
if (selectedThreadId && window.confirm("Delete this entire thread and all its comments?")) {
|
|
511
|
-
await deleteThread(selectedThreadId);
|
|
512
|
-
onThreadSelect(null);
|
|
513
|
-
}
|
|
514
|
-
};
|
|
515
|
-
const handleSummarizeThread = async () => {
|
|
516
|
-
console.log("AI features not available in local-only mode");
|
|
517
|
-
};
|
|
518
|
-
const handleDeleteComment = async (threadId, commentId) => {
|
|
519
|
-
if (window.confirm("Delete this comment?")) {
|
|
520
|
-
await deleteComment(threadId, commentId);
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
const formatDate = (isoDate) => {
|
|
524
|
-
const date = new Date(isoDate);
|
|
525
|
-
return date.toLocaleString(void 0, {
|
|
526
|
-
month: "short",
|
|
527
|
-
day: "numeric",
|
|
528
|
-
hour: "2-digit",
|
|
529
|
-
minute: "2-digit"
|
|
530
|
-
});
|
|
531
|
-
};
|
|
532
|
-
const panelContent = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_core2.DrawerPanelContent, { isResizable: true, defaultSize: "400px", minSize: "300px", children: [
|
|
533
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_core2.DrawerHead, { children: [
|
|
534
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_core2.Title, { headingLevel: "h2", size: "xl", children: [
|
|
535
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_icons2.CommentIcon, { style: { marginRight: "0.5rem", color: "#C9190B" } }),
|
|
536
|
-
"Thread"
|
|
537
|
-
] }) }),
|
|
538
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.DrawerActions, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.DrawerCloseButton, { onClick: () => onThreadSelect(null) }) })
|
|
539
|
-
] }),
|
|
540
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.DrawerContentBody, { style: { padding: "1rem" }, children: !selectedThread ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_core2.EmptyState, { children: [
|
|
541
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_icons2.CommentIcon, { style: { fontSize: "3rem", color: "var(--pf-v6-global--Color--200)", marginBottom: "1rem" } }),
|
|
542
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.Title, { headingLevel: "h3", size: "lg", children: "No thread selected" }),
|
|
543
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.EmptyStateBody, { children: "Click a pin to view its comments." })
|
|
544
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "1rem" }, children: [
|
|
545
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.Card, { isCompact: true, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_core2.CardBody, { children: [
|
|
546
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { fontSize: "0.875rem", marginBottom: "0.5rem" }, children: [
|
|
547
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: "Location:" }),
|
|
548
|
-
" (",
|
|
549
|
-
Math.round(selectedThread.x),
|
|
550
|
-
", ",
|
|
551
|
-
Math.round(selectedThread.y),
|
|
552
|
-
")"
|
|
553
|
-
] }),
|
|
554
|
-
selectedThread.version && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { fontSize: "0.875rem", marginBottom: "0.5rem" }, children: [
|
|
555
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: "Version:" }),
|
|
556
|
-
" ",
|
|
557
|
-
selectedThread.version
|
|
558
|
-
] }),
|
|
559
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { fontSize: "0.875rem", marginBottom: "0.5rem" }, children: [
|
|
560
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: "Comments:" }),
|
|
561
|
-
" ",
|
|
562
|
-
selectedThread.comments.length
|
|
563
|
-
] }),
|
|
564
|
-
selectedThread.comments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
565
|
-
import_react_core2.Button,
|
|
566
|
-
{
|
|
567
|
-
id: `ai-summarize-thread-${selectedThread.id}`,
|
|
568
|
-
variant: "secondary",
|
|
569
|
-
size: "sm",
|
|
570
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_icons2.MagicIcon, {}),
|
|
571
|
-
onClick: handleSummarizeThread,
|
|
572
|
-
isLoading: loadingSummary,
|
|
573
|
-
isDisabled: loadingSummary,
|
|
574
|
-
style: { marginTop: "0.5rem" },
|
|
575
|
-
children: loadingSummary ? "Generating..." : "AI Summarize Thread"
|
|
576
|
-
}
|
|
577
|
-
),
|
|
578
|
-
enableCommenting && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
579
|
-
import_react_core2.Button,
|
|
580
|
-
{
|
|
581
|
-
id: `delete-thread-${selectedThread.id}`,
|
|
582
|
-
variant: "danger",
|
|
583
|
-
size: "sm",
|
|
584
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_icons2.TimesIcon, {}),
|
|
585
|
-
onClick: handleDeleteThread,
|
|
586
|
-
style: { marginTop: "0.5rem", marginLeft: selectedThread.comments.length > 0 ? "0.5rem" : "0" },
|
|
587
|
-
children: "Delete Thread"
|
|
588
|
-
}
|
|
589
|
-
)
|
|
590
|
-
] }) }),
|
|
591
|
-
threadSummaries[selectedThread.id] && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
592
|
-
import_react_core2.Alert,
|
|
593
|
-
{
|
|
594
|
-
variant: "info",
|
|
595
|
-
isInline: true,
|
|
596
|
-
title: "AI Summary",
|
|
597
|
-
actionClose: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
598
|
-
import_react_core2.Button,
|
|
599
|
-
{
|
|
600
|
-
variant: "plain",
|
|
601
|
-
onClick: () => {
|
|
602
|
-
const newSummaries = { ...threadSummaries };
|
|
603
|
-
delete newSummaries[selectedThread.id];
|
|
604
|
-
setThreadSummaries(newSummaries);
|
|
605
|
-
},
|
|
606
|
-
"aria-label": "Clear summary",
|
|
607
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_icons2.TimesIcon, {})
|
|
608
|
-
}
|
|
609
|
-
),
|
|
610
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
611
|
-
import_react_core2.ExpandableSection,
|
|
612
|
-
{
|
|
613
|
-
toggleText: summaryExpanded ? "Hide summary" : "Show summary",
|
|
614
|
-
onToggle: (_event, isExpanded) => setSummaryExpanded(isExpanded),
|
|
615
|
-
isExpanded: summaryExpanded,
|
|
616
|
-
isIndented: true,
|
|
617
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: "0.875rem", lineHeight: "1.5" }, children: threadSummaries[selectedThread.id] })
|
|
618
|
-
}
|
|
619
|
-
)
|
|
620
|
-
}
|
|
621
|
-
),
|
|
622
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.Divider, {}),
|
|
623
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "1rem" }, children: selectedThread.comments.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_core2.EmptyState, { children: [
|
|
624
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.Title, { headingLevel: "h4", size: "md", children: "No comments yet" }),
|
|
625
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.EmptyStateBody, { children: enableCommenting ? "Add a reply below to start the conversation." : "Enable commenting to add replies." })
|
|
626
|
-
] }) : selectedThread.comments.map((comment, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_core2.Card, { isCompact: true, children: [
|
|
627
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_core2.CardTitle, { children: [
|
|
628
|
-
"Comment #",
|
|
629
|
-
index + 1,
|
|
630
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { fontSize: "0.75rem", color: "var(--pf-v6-global--Color--200)", fontWeight: "normal" }, children: [
|
|
631
|
-
comment.author && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { style: { marginRight: "0.5rem" }, children: [
|
|
632
|
-
"@",
|
|
633
|
-
comment.author
|
|
634
|
-
] }),
|
|
635
|
-
formatDate(comment.createdAt)
|
|
636
|
-
] })
|
|
637
|
-
] }),
|
|
638
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.CardBody, { children: editingCommentId === comment.id ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
639
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
640
|
-
import_react_core2.TextArea,
|
|
641
|
-
{
|
|
642
|
-
id: `edit-comment-${comment.id}`,
|
|
643
|
-
value: editText,
|
|
644
|
-
onChange: (_event, value) => setEditText(value),
|
|
645
|
-
rows: 3,
|
|
646
|
-
style: { marginBottom: "0.5rem" },
|
|
647
|
-
onKeyDown: (e) => {
|
|
648
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
649
|
-
e.preventDefault();
|
|
650
|
-
handleSave(selectedThread.id, comment.id);
|
|
651
|
-
}
|
|
652
|
-
if (e.key === "Escape") {
|
|
653
|
-
setEditingCommentId(null);
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
),
|
|
658
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", gap: "0.5rem" }, children: [
|
|
659
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
660
|
-
import_react_core2.Button,
|
|
661
|
-
{
|
|
662
|
-
id: `save-comment-${comment.id}`,
|
|
663
|
-
variant: "primary",
|
|
664
|
-
size: "sm",
|
|
665
|
-
onClick: () => handleSave(selectedThread.id, comment.id),
|
|
666
|
-
children: "Save"
|
|
667
|
-
}
|
|
668
|
-
),
|
|
669
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
670
|
-
import_react_core2.Button,
|
|
671
|
-
{
|
|
672
|
-
id: `cancel-edit-${comment.id}`,
|
|
673
|
-
variant: "link",
|
|
674
|
-
size: "sm",
|
|
675
|
-
onClick: () => setEditingCommentId(null),
|
|
676
|
-
children: "Cancel"
|
|
677
|
-
}
|
|
678
|
-
)
|
|
679
|
-
] })
|
|
680
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
681
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { marginBottom: "0.75rem", whiteSpace: "pre-wrap" }, children: comment.text || /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("em", { style: { color: "var(--pf-v6-global--Color--200)" }, children: "No text" }) }),
|
|
682
|
-
enableCommenting && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", gap: "0.5rem" }, children: [
|
|
683
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
684
|
-
import_react_core2.Button,
|
|
685
|
-
{
|
|
686
|
-
id: `edit-comment-btn-${comment.id}`,
|
|
687
|
-
variant: "secondary",
|
|
688
|
-
size: "sm",
|
|
689
|
-
onClick: () => handleEdit(comment.id, comment.text),
|
|
690
|
-
children: "Edit"
|
|
691
|
-
}
|
|
692
|
-
),
|
|
693
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
694
|
-
import_react_core2.Button,
|
|
695
|
-
{
|
|
696
|
-
id: `delete-comment-btn-${comment.id}`,
|
|
697
|
-
variant: "danger",
|
|
698
|
-
size: "sm",
|
|
699
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_icons2.TimesIcon, {}),
|
|
700
|
-
onClick: () => handleDeleteComment(selectedThread.id, comment.id),
|
|
701
|
-
children: "Delete"
|
|
702
|
-
}
|
|
703
|
-
)
|
|
704
|
-
] })
|
|
705
|
-
] }) })
|
|
706
|
-
] }, comment.id)) }),
|
|
707
|
-
enableCommenting && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
708
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.Divider, {}),
|
|
709
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_core2.Card, { isCompact: true, children: [
|
|
710
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_core2.CardTitle, { children: [
|
|
711
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_icons2.PlusCircleIcon, { style: { marginRight: "0.5rem" } }),
|
|
712
|
-
"Add Reply"
|
|
713
|
-
] }),
|
|
714
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_core2.CardBody, { children: [
|
|
715
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
716
|
-
import_react_core2.TextArea,
|
|
717
|
-
{
|
|
718
|
-
ref: replyTextAreaRef,
|
|
719
|
-
id: `reply-textarea-${selectedThread.id}`,
|
|
720
|
-
value: replyText,
|
|
721
|
-
onChange: (_event, value) => setReplyText(value),
|
|
722
|
-
placeholder: "Enter your reply...",
|
|
723
|
-
rows: 3,
|
|
724
|
-
style: { marginBottom: "0.5rem" },
|
|
725
|
-
onKeyDown: (e) => {
|
|
726
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
727
|
-
e.preventDefault();
|
|
728
|
-
handleAddReply();
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
),
|
|
733
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
734
|
-
import_react_core2.Button,
|
|
735
|
-
{
|
|
736
|
-
id: `add-reply-${selectedThread.id}`,
|
|
737
|
-
variant: "primary",
|
|
738
|
-
size: "sm",
|
|
739
|
-
onClick: handleAddReply,
|
|
740
|
-
isDisabled: !replyText.trim(),
|
|
741
|
-
children: "Add Reply"
|
|
742
|
-
}
|
|
743
|
-
)
|
|
744
|
-
] })
|
|
745
|
-
] })
|
|
746
|
-
] })
|
|
747
|
-
] }) })
|
|
748
|
-
] });
|
|
749
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.Drawer, { isExpanded: isDrawerOpen, isInline: true, position: "right", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.DrawerContent, { panelContent, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_core2.DrawerContentBody, { children }) }) });
|
|
750
|
-
};
|
|
751
|
-
|
|
752
|
-
// src/contexts/GitHubAuthContext.tsx
|
|
753
|
-
var React6 = __toESM(require("react"));
|
|
754
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
755
|
-
var GitHubAuthContext = React6.createContext(void 0);
|
|
756
|
-
var GitHubAuthProvider = ({ children }) => {
|
|
757
|
-
const value = {
|
|
758
|
-
user: null,
|
|
759
|
-
isAuthenticated: false,
|
|
760
|
-
login: () => {
|
|
761
|
-
console.log("GitHub login not available in local mode");
|
|
762
|
-
},
|
|
763
|
-
logout: () => {
|
|
764
|
-
console.log("GitHub logout not available in local mode");
|
|
765
|
-
}
|
|
766
|
-
};
|
|
767
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GitHubAuthContext.Provider, { value, children });
|
|
768
|
-
};
|
|
769
|
-
var useGitHubAuth = () => {
|
|
770
|
-
const context = React6.useContext(GitHubAuthContext);
|
|
771
|
-
if (context === void 0) {
|
|
772
|
-
throw new Error("useGitHubAuth must be used within a GitHubAuthProvider");
|
|
773
|
-
}
|
|
774
|
-
return context;
|
|
775
|
-
};
|
|
776
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
777
|
-
0 && (module.exports = {
|
|
778
|
-
CommentDrawer,
|
|
779
|
-
CommentOverlay,
|
|
780
|
-
CommentPin,
|
|
781
|
-
CommentProvider,
|
|
782
|
-
GitHubAuthProvider,
|
|
783
|
-
GitLabAuthProvider,
|
|
784
|
-
VersionProvider,
|
|
785
|
-
useComments,
|
|
786
|
-
useGitHubAuth,
|
|
787
|
-
useGitLabAuth,
|
|
788
|
-
useVersion
|
|
789
|
-
});
|
|
790
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isGitHubConfigured = exports.githubAdapter = exports.FloatingWidget = exports.JiraTab = exports.DetailsTab = exports.CommentPanel = exports.CommentPin = exports.CommentOverlay = exports.useGitHubAuth = exports.GitHubAuthProvider = exports.useComments = exports.CommentProvider = void 0;
|
|
4
|
+
// Contexts
|
|
5
|
+
var CommentContext_1 = require("./contexts/CommentContext");
|
|
6
|
+
Object.defineProperty(exports, "CommentProvider", { enumerable: true, get: function () { return CommentContext_1.CommentProvider; } });
|
|
7
|
+
Object.defineProperty(exports, "useComments", { enumerable: true, get: function () { return CommentContext_1.useComments; } });
|
|
8
|
+
var GitHubAuthContext_1 = require("./contexts/GitHubAuthContext");
|
|
9
|
+
Object.defineProperty(exports, "GitHubAuthProvider", { enumerable: true, get: function () { return GitHubAuthContext_1.GitHubAuthProvider; } });
|
|
10
|
+
Object.defineProperty(exports, "useGitHubAuth", { enumerable: true, get: function () { return GitHubAuthContext_1.useGitHubAuth; } });
|
|
11
|
+
// Components
|
|
12
|
+
var CommentOverlay_1 = require("./components/CommentOverlay");
|
|
13
|
+
Object.defineProperty(exports, "CommentOverlay", { enumerable: true, get: function () { return CommentOverlay_1.CommentOverlay; } });
|
|
14
|
+
var CommentPin_1 = require("./components/CommentPin");
|
|
15
|
+
Object.defineProperty(exports, "CommentPin", { enumerable: true, get: function () { return CommentPin_1.CommentPin; } });
|
|
16
|
+
var CommentPanel_1 = require("./components/CommentPanel");
|
|
17
|
+
Object.defineProperty(exports, "CommentPanel", { enumerable: true, get: function () { return CommentPanel_1.CommentPanel; } });
|
|
18
|
+
var DetailsTab_1 = require("./components/DetailsTab");
|
|
19
|
+
Object.defineProperty(exports, "DetailsTab", { enumerable: true, get: function () { return DetailsTab_1.DetailsTab; } });
|
|
20
|
+
var JiraTab_1 = require("./components/JiraTab");
|
|
21
|
+
Object.defineProperty(exports, "JiraTab", { enumerable: true, get: function () { return JiraTab_1.JiraTab; } });
|
|
22
|
+
var FloatingWidget_1 = require("./components/FloatingWidget");
|
|
23
|
+
Object.defineProperty(exports, "FloatingWidget", { enumerable: true, get: function () { return FloatingWidget_1.FloatingWidget; } });
|
|
24
|
+
// Services
|
|
25
|
+
var githubAdapter_1 = require("./services/githubAdapter");
|
|
26
|
+
Object.defineProperty(exports, "githubAdapter", { enumerable: true, get: function () { return githubAdapter_1.githubAdapter; } });
|
|
27
|
+
Object.defineProperty(exports, "isGitHubConfigured", { enumerable: true, get: function () { return githubAdapter_1.isGitHubConfigured; } });
|