Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
The bundled @font-face uses family "Material Symbols Outlined", matching the
.material-symbols-outlined rule defined later in this file. */
@import "material-symbols/outlined.css";
/* react18-json-view (request/response JSON tree in RequestLoggerDetail) — imported here
instead of in the component so node:test / esbuild never see a .css import. */
@import "react18-json-view/src/style.css";
@import "react18-json-view/src/dark.css";
@source "../../node_modules/fumadocs-ui/css/generated/*.css";

/* Keep Tailwind v4 from scanning the entire repository. The UI lives in the
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/messages/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -11253,6 +11253,11 @@
"detail": {
"collapse": "Thu gọn {title}",
"expand": "Mở rộng {title}",
"collapseAllLevels": "Thu gọn tất cả",
"collapseOneLevel": "Thu gọn một cấp",
"currentExpandLevel": "Cấp mở rộng hiện tại",
"expandOneLevel": "Mở rộng một cấp",
"expandAllLevels": "Mở rộng tất cả",
"copyTitle": "Sao chép {title}",
"copied": "Đã sao chép!",
"copy": "Sao chép",
Expand Down
4 changes: 1 addition & 3 deletions src/shared/components/RequestLoggerDetail.sections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import { useState, useEffect, useRef, useMemo } from "react";
import { useTranslations } from "next-intl";
import JsonView from "react18-json-view";
import "react18-json-view/src/style.css";
import "react18-json-view/src/dark.css";
import { JsonView } from "@/shared/components/jsonView";
import { ChatBubble } from "@/app/(dashboard)/dashboard/tools/traffic-inspector/components/chat/ChatBubble";
import { buildRequestTurns, buildResponseTurns } from "@/mitm/inspector/conversationNormalizer";
import type { InterceptedRequest, NormalizedTurn } from "@/mitm/inspector/types";
Expand Down
4 changes: 1 addition & 3 deletions src/shared/components/RequestLoggerDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import { useState, useEffect, useMemo, useRef } from "react";
import { useLocale, useTranslations } from "next-intl";
import JsonView from "react18-json-view";
import "react18-json-view/src/style.css";
import "react18-json-view/src/dark.css";
import { JsonView } from "@/shared/components/jsonView";
import {
PROVIDER_COLORS,
getHttpStatusStyle as getStatusStyle,
Expand Down
9 changes: 9 additions & 0 deletions src/shared/components/jsonView.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import JsonViewModule from "react18-json-view";

// react18-json-view ships no `exports` map: bundlers take the ESM `module` build and hand
// over the component, but node ESM (node:test) resolves the CJS `main`, where the default
// import is the whole module namespace. Same interop as redisQuotaStore / keytar-reader.
// Its stylesheets are @imported from src/app/globals.css — never import CSS here or in the
// components (node:test and the browser-bundle check cannot load .css).
export const JsonView = ((JsonViewModule as unknown as { default?: typeof JsonViewModule })
.default ?? JsonViewModule) as typeof JsonViewModule;
Loading