@impakers/debug 1.4.15 → 1.4.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/react.js +44 -45
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +44 -45
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.mjs
CHANGED
|
@@ -2125,6 +2125,14 @@ async function fetchFeedbacks(endpoint, url, options = {}) {
|
|
|
2125
2125
|
return data.tasks || [];
|
|
2126
2126
|
}, options);
|
|
2127
2127
|
}
|
|
2128
|
+
async function fetchAllFeedbacks(endpoint, options = {}) {
|
|
2129
|
+
const cacheKey = getAllFeedbacksCacheKey();
|
|
2130
|
+
return readWithCache(cacheKey, async () => {
|
|
2131
|
+
const res = await apiFetch(`${endpoint}?url=__all__`);
|
|
2132
|
+
const data = await res.json();
|
|
2133
|
+
return data.tasks || [];
|
|
2134
|
+
}, options);
|
|
2135
|
+
}
|
|
2128
2136
|
async function revalidateFeedbacks(endpoint, url) {
|
|
2129
2137
|
const cacheKey = getFeedbacksCacheKey(url);
|
|
2130
2138
|
return revalidateCache(cacheKey, async () => {
|
|
@@ -2444,16 +2452,18 @@ var styles_module_default3 = classNames3;
|
|
|
2444
2452
|
|
|
2445
2453
|
// src/components/comment-thread/index.tsx
|
|
2446
2454
|
import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2447
|
-
function
|
|
2448
|
-
const
|
|
2455
|
+
function formatTime(dateStr) {
|
|
2456
|
+
const date = new Date(dateStr);
|
|
2457
|
+
const diff = Date.now() - date.getTime();
|
|
2458
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
2459
|
+
const abs = `${pad(date.getMonth() + 1)}.${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
|
|
2449
2460
|
const m = Math.floor(diff / 6e4);
|
|
2450
|
-
if (m < 1) return
|
|
2451
|
-
if (m < 60) return `${m}m`;
|
|
2461
|
+
if (m < 1) return `${abs} (just now)`;
|
|
2462
|
+
if (m < 60) return `${abs} (${m}m)`;
|
|
2452
2463
|
const h = Math.floor(m / 60);
|
|
2453
|
-
if (h < 24) return `${h}h`;
|
|
2464
|
+
if (h < 24) return `${abs} (${h}h)`;
|
|
2454
2465
|
const d = Math.floor(h / 24);
|
|
2455
|
-
|
|
2456
|
-
return new Date(dateStr).toLocaleDateString("ko-KR", { month: "short", day: "numeric" });
|
|
2466
|
+
return `${abs} (${d}d)`;
|
|
2457
2467
|
}
|
|
2458
2468
|
function getInitials(name) {
|
|
2459
2469
|
return name.slice(0, 1).toUpperCase();
|
|
@@ -2632,7 +2642,7 @@ function CommentThread({
|
|
|
2632
2642
|
/* @__PURE__ */ jsxs4("div", { className: styles_module_default3.headerInfo, children: [
|
|
2633
2643
|
/* @__PURE__ */ jsxs4("div", { className: styles_module_default3.headerTop, children: [
|
|
2634
2644
|
/* @__PURE__ */ jsx4("span", { className: styles_module_default3.authorName, children: task.authorName || currentUserName }),
|
|
2635
|
-
/* @__PURE__ */ jsx4("span", { className: styles_module_default3.timestamp, children:
|
|
2645
|
+
/* @__PURE__ */ jsx4("span", { className: styles_module_default3.timestamp, children: formatTime(task.createdAt) })
|
|
2636
2646
|
] }),
|
|
2637
2647
|
/* @__PURE__ */ jsx4("div", { className: styles_module_default3.title, children: feedbackTitle })
|
|
2638
2648
|
] }),
|
|
@@ -2645,7 +2655,7 @@ function CommentThread({
|
|
|
2645
2655
|
/* @__PURE__ */ jsxs4("div", { className: styles_module_default3.commentContent, children: [
|
|
2646
2656
|
/* @__PURE__ */ jsxs4("div", { className: styles_module_default3.commentTop, children: [
|
|
2647
2657
|
/* @__PURE__ */ jsx4("span", { className: styles_module_default3.commentAuthor, children: comment.authorName }),
|
|
2648
|
-
/* @__PURE__ */ jsx4("span", { className: styles_module_default3.commentTime, children:
|
|
2658
|
+
/* @__PURE__ */ jsx4("span", { className: styles_module_default3.commentTime, children: formatTime(comment.createdAt) })
|
|
2649
2659
|
] }),
|
|
2650
2660
|
comment.content && /* @__PURE__ */ jsx4("div", { className: styles_module_default3.commentText, children: comment.content }),
|
|
2651
2661
|
comment.imageUrl && comment.imageUrl !== "loading..." && /* @__PURE__ */ jsx4(
|
|
@@ -3038,16 +3048,18 @@ function FilePreviewModal({
|
|
|
3038
3048
|
] }) })
|
|
3039
3049
|
] }) });
|
|
3040
3050
|
}
|
|
3041
|
-
function
|
|
3042
|
-
const
|
|
3051
|
+
function formatTime2(dateStr) {
|
|
3052
|
+
const date = new Date(dateStr);
|
|
3053
|
+
const diff = Date.now() - date.getTime();
|
|
3054
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
3055
|
+
const abs = `${pad(date.getMonth() + 1)}.${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
|
|
3043
3056
|
const m = Math.floor(diff / 6e4);
|
|
3044
|
-
if (m < 1) return
|
|
3045
|
-
if (m < 60) return `${m}m`;
|
|
3057
|
+
if (m < 1) return `${abs} (just now)`;
|
|
3058
|
+
if (m < 60) return `${abs} (${m}m)`;
|
|
3046
3059
|
const h = Math.floor(m / 60);
|
|
3047
|
-
if (h < 24) return `${h}h`;
|
|
3060
|
+
if (h < 24) return `${abs} (${h}h)`;
|
|
3048
3061
|
const d = Math.floor(h / 24);
|
|
3049
|
-
|
|
3050
|
-
return new Date(dateStr).toLocaleDateString("ko-KR", { month: "short", day: "numeric" });
|
|
3062
|
+
return `${abs} (${d}d)`;
|
|
3051
3063
|
}
|
|
3052
3064
|
function getInitials2(name) {
|
|
3053
3065
|
return name.slice(0, 1).toUpperCase();
|
|
@@ -3164,7 +3176,7 @@ function InboxPanel({
|
|
|
3164
3176
|
/* @__PURE__ */ jsxs6("div", { children: [
|
|
3165
3177
|
/* @__PURE__ */ jsxs6("div", { className: styles_module_default5.cardMeta, children: [
|
|
3166
3178
|
/* @__PURE__ */ jsx6("span", { className: styles_module_default5.cardAuthor, children: selectedItem.authorName }),
|
|
3167
|
-
/* @__PURE__ */ jsx6("span", { className: styles_module_default5.cardTime, children:
|
|
3179
|
+
/* @__PURE__ */ jsx6("span", { className: styles_module_default5.cardTime, children: formatTime2(selectedItem.createdAt) })
|
|
3168
3180
|
] }),
|
|
3169
3181
|
/* @__PURE__ */ jsx6("div", { className: styles_module_default5.detailTitle, children: selectedItem.title.replace(/^\[피드백\]\s*/, "") })
|
|
3170
3182
|
] })
|
|
@@ -3178,7 +3190,7 @@ function InboxPanel({
|
|
|
3178
3190
|
/* @__PURE__ */ jsxs6("div", { className: styles_module_default5.commentBody, children: [
|
|
3179
3191
|
/* @__PURE__ */ jsxs6("div", { className: styles_module_default5.commentMeta, children: [
|
|
3180
3192
|
/* @__PURE__ */ jsx6("span", { className: styles_module_default5.commentAuthorName, children: c.authorName }),
|
|
3181
|
-
/* @__PURE__ */ jsx6("span", { className: styles_module_default5.commentTime, children:
|
|
3193
|
+
/* @__PURE__ */ jsx6("span", { className: styles_module_default5.commentTime, children: formatTime2(c.createdAt) })
|
|
3182
3194
|
] }),
|
|
3183
3195
|
c.content && /* @__PURE__ */ jsx6("div", { className: styles_module_default5.commentContent, children: c.content }),
|
|
3184
3196
|
c.imageUrl && /* @__PURE__ */ jsx6(
|
|
@@ -3307,7 +3319,7 @@ function InboxPanel({
|
|
|
3307
3319
|
/* @__PURE__ */ jsx6("div", { className: styles_module_default5.cardAvatar, children: getInitials2(item.authorName) }),
|
|
3308
3320
|
/* @__PURE__ */ jsx6("div", { className: styles_module_default5.cardInfo, children: /* @__PURE__ */ jsxs6("div", { className: styles_module_default5.cardMeta, children: [
|
|
3309
3321
|
/* @__PURE__ */ jsx6("span", { className: styles_module_default5.cardAuthor, children: item.authorName }),
|
|
3310
|
-
/* @__PURE__ */ jsx6("span", { className: styles_module_default5.cardTime, children:
|
|
3322
|
+
/* @__PURE__ */ jsx6("span", { className: styles_module_default5.cardTime, children: formatTime2(item.createdAt) })
|
|
3311
3323
|
] }) })
|
|
3312
3324
|
] }),
|
|
3313
3325
|
/* @__PURE__ */ jsx6("div", { className: styles_module_default5.cardTitle, children: item.title.replace(/^\[피드백\]\s*/, "") }),
|
|
@@ -3607,6 +3619,7 @@ function DebugWidget({ endpoint, getUser, onHide }) {
|
|
|
3607
3619
|
const [activeThread, setActiveThread] = useState5(null);
|
|
3608
3620
|
const [threadComments, setThreadComments] = useState5({});
|
|
3609
3621
|
const [serverTasks, setServerTasks] = useState5([]);
|
|
3622
|
+
const [allServerTasks, setAllServerTasks] = useState5([]);
|
|
3610
3623
|
const [showInbox, setShowInbox] = useState5(false);
|
|
3611
3624
|
const [showSettings, setShowSettings] = useState5(false);
|
|
3612
3625
|
const [settings, setSettings] = useState5(() => loadSettings());
|
|
@@ -3640,6 +3653,8 @@ function DebugWidget({ endpoint, getUser, onHide }) {
|
|
|
3640
3653
|
startDelayedCapture();
|
|
3641
3654
|
} else if (id === "inbox") {
|
|
3642
3655
|
setShowInbox(true);
|
|
3656
|
+
fetchAllFeedbacks(endpoint, { staleWhileRevalidate: true }).then(setAllServerTasks).catch(() => {
|
|
3657
|
+
});
|
|
3643
3658
|
if (isActive) {
|
|
3644
3659
|
setIsActive(false);
|
|
3645
3660
|
document.documentElement.classList.remove("impakers-selecting");
|
|
@@ -4181,32 +4196,16 @@ function DebugWidget({ endpoint, getUser, onHide }) {
|
|
|
4181
4196
|
createdAt: task.createdAt,
|
|
4182
4197
|
commentCount: task.commentCount || 0
|
|
4183
4198
|
}));
|
|
4184
|
-
const allRouteItems = (() => {
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
items.push({
|
|
4195
|
-
id: a.id,
|
|
4196
|
-
title: a.comment || "\uD53C\uB4DC\uBC31",
|
|
4197
|
-
status: "todo",
|
|
4198
|
-
priority: "medium",
|
|
4199
|
-
authorName: getUser?.()?.name ? String(getUser().name) : "\uC775\uBA85",
|
|
4200
|
-
feedbackUrl: route,
|
|
4201
|
-
createdAt: new Date(a.timestamp).toISOString(),
|
|
4202
|
-
commentCount: (threadComments[a.id] || []).length
|
|
4203
|
-
});
|
|
4204
|
-
}
|
|
4205
|
-
}
|
|
4206
|
-
} catch {
|
|
4207
|
-
}
|
|
4208
|
-
return items.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
4209
|
-
})();
|
|
4199
|
+
const allRouteItems = allServerTasks.map((task) => ({
|
|
4200
|
+
id: task.id,
|
|
4201
|
+
title: task.title || "\uD53C\uB4DC\uBC31",
|
|
4202
|
+
status: task.status,
|
|
4203
|
+
priority: task.priority,
|
|
4204
|
+
authorName: task.authorName || "\uC775\uBA85",
|
|
4205
|
+
feedbackUrl: task.feedbackUrl || "",
|
|
4206
|
+
createdAt: task.createdAt,
|
|
4207
|
+
commentCount: task.commentCount || 0
|
|
4208
|
+
}));
|
|
4210
4209
|
return createPortal3(
|
|
4211
4210
|
/* @__PURE__ */ jsxs8("div", { "data-impakers-debug": "", children: [
|
|
4212
4211
|
/* @__PURE__ */ jsx8(
|