markshelf 0.9.0 → 0.10.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.
Files changed (70) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +4 -4
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  10. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  12. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  13. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  14. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  15. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  16. package/.next/standalone/.next/server/app/api/asset/route.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/api/diff/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/file/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/graph/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/raw/[...path]/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/timeline/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/tree/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/watch/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/index.html +1 -1
  27. package/.next/standalone/.next/server/app/index.rsc +4 -4
  28. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  29. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  30. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  31. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  33. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0eg7wjh-6h9jf._.js +3 -3
  34. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  35. package/.next/standalone/.next/server/pages/404.html +1 -1
  36. package/.next/standalone/.next/server/pages/500.html +1 -1
  37. package/.next/standalone/.next/server/preview-props.json +3 -3
  38. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  40. package/.next/standalone/.next/static/chunks/02_z8-kntf2e4.css +2 -0
  41. package/.next/standalone/.next/static/chunks/{1gbw1b68p1p8h.js → 1ua1fu_k5awqp.js} +3 -3
  42. package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.5-Markdown/343/203/254/343/203/263/343/203/200/343/203/252/343/203/263/343/202/260.md +2 -2
  43. package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.7-/343/203/221/343/203/215/343/203/253/343/203/252/343/202/265/343/202/244/343/202/266/343/203/274.md +1 -1
  44. package/.next/standalone/docs//344/273/225/346/247/230/SPEC5-/346/260/270/347/266/232/345/214/226/SPEC5.1-localStorage.md +1 -1
  45. package/.next/standalone/package-lock.json +2 -2
  46. package/.next/standalone/package.json +1 -1
  47. package/.next/standalone/src/app/markdown.css +27 -3
  48. package/.next/standalone/src/app/page.tsx +6 -6
  49. package/.next/standalone/src/components/DetailPanel.tsx +5 -5
  50. package/.next/standalone/src/components/DiffView.tsx +2 -2
  51. package/.next/standalone/src/components/HistoryPanel.tsx +6 -6
  52. package/.next/standalone/src/components/LinkGraph.tsx +7 -7
  53. package/.next/standalone/src/components/Markdown.tsx +3 -0
  54. package/.next/standalone/src/components/MermaidBlock.tsx +11 -4
  55. package/.next/standalone/src/components/PreviewPopup.tsx +4 -4
  56. package/.next/standalone/src/components/SearchBar.tsx +6 -6
  57. package/.next/standalone/src/components/TableOfContents.tsx +2 -2
  58. package/.next/standalone/src/components/TimelinePanel.tsx +12 -12
  59. package/.next/standalone/src/components/TreeView.tsx +2 -2
  60. package/.next/static/chunks/02_z8-kntf2e4.css +2 -0
  61. package/.next/static/chunks/{1gbw1b68p1p8h.js → 1ua1fu_k5awqp.js} +3 -3
  62. package/package.json +1 -1
  63. package/.next/standalone/.next/static/chunks/0wr6kk5jmu7qu.css +0 -2
  64. package/.next/static/chunks/0wr6kk5jmu7qu.css +0 -2
  65. /package/.next/standalone/.next/static/{9u-UWrYhqOePy2N3WxC2_ → hlozoUs5sRChnfDObLvv_}/_buildManifest.js +0 -0
  66. /package/.next/standalone/.next/static/{9u-UWrYhqOePy2N3WxC2_ → hlozoUs5sRChnfDObLvv_}/_clientMiddlewareManifest.js +0 -0
  67. /package/.next/standalone/.next/static/{9u-UWrYhqOePy2N3WxC2_ → hlozoUs5sRChnfDObLvv_}/_ssgManifest.js +0 -0
  68. /package/.next/static/{9u-UWrYhqOePy2N3WxC2_ → hlozoUs5sRChnfDObLvv_}/_buildManifest.js +0 -0
  69. /package/.next/static/{9u-UWrYhqOePy2N3WxC2_ → hlozoUs5sRChnfDObLvv_}/_clientMiddlewareManifest.js +0 -0
  70. /package/.next/static/{9u-UWrYhqOePy2N3WxC2_ → hlozoUs5sRChnfDObLvv_}/_ssgManifest.js +0 -0
@@ -7,8 +7,8 @@
7
7
  - 実装: `src/components/Markdown.tsx`(`react-markdown` + `remark-gfm` + `rehype-highlight`)
8
8
  - GitHub Flavored Markdown(テーブル・タスクリスト・打ち消し線・脚注)を有効化
9
9
  - スタイルは `src/app/markdown.css`(GitHub 風の閲覧テーマ。md-reader を参考)。`variant` で 2 種類を切り替える
10
- - `reader`(本文表示): 本文 16px・行間 1.8、最大幅 860px で中央寄せ。h1/h2 に下線
11
- - `compact`(プレビューポップアップ、既定): 本文 12px の詰めた表示。コードのコピーボタンは出さない
10
+ - `reader`(本文表示): 本文 16px・行間 1.8、文章は最大幅 860px で中央寄せ(読みやすい行長を保つため)。コードブロック・表・Mermaid 図は内容が収まらない場合のみ最大 1200px(表示領域内)まで中央からはみ出して広がる。h1/h2 に下線
11
+ - `compact`(プレビューポップアップ、既定): 本文 14px の詰めた表示。コードのコピーボタンは出さない
12
12
  - アラート: GitHub と同じ `> [!NOTE]`(TIP / IMPORTANT / WARNING / CAUTION、大文字小文字は区別しない)を `src/lib/remarkAlerts.ts` で検出し、色付きの枠とアイコン付きタイトルで表示。マーカーは行に単独で書いたときだけ有効(`> [!NOTE] 本文` は通常の引用)
13
13
  - テーブルは横スクロール可能な枠で囲み、ヘッダー背景・縞模様・ホバー強調を付ける
14
14
  - 見出しはカスタムコンポーネントに置き換え、`src/lib/markdown.ts` の `parseHeadings()` で採番した ID を付与(目次のアンカーと一致。[SPEC3.3 TableOfContents](SPEC3.3-TableOfContents.md))
@@ -5,7 +5,7 @@
5
5
  ## 設計
6
6
 
7
7
  - 左ツリーと DetailPanel の間、DetailPanel 内本文と目次の間にドラッグハンドルを置く
8
- - ツリー幅は `src/app/page.tsx` が `treeWidth` ステートで管理し、`localStorage['markshelf:treeWidth']`(デフォルト 260px)に永続化
8
+ - ツリー幅は `src/app/page.tsx` が `treeWidth` ステートで管理し、`localStorage['markshelf:treeWidth']`(デフォルト 300px)に永続化
9
9
  - 目次幅は `src/components/DetailPanel.tsx` が管理し、`localStorage['markshelf:tocWidth']`(デフォルト 176px)に永続化
10
10
  - ドラッグ中は `document` の `mousemove`/`mouseup` を監視してリアルタイムに幅を更新、終端で localStorage に書き込む
11
11
  - 最小値・最大値でクランプして極端なレイアウト崩れを防ぐ
@@ -6,7 +6,7 @@
6
6
 
7
7
  | キー | 保存場所 | 用途 | デフォルト | 関連要件 |
8
8
  |------|---------|------|-----------|---------|
9
- | `markshelf:treeWidth` | `src/app/page.tsx` | 左ツリーパネルの幅 (px) | `260` | [REQ3.4](../../要件定義/REQ3-プレビューとツリー/REQ3.4-パネルリサイザー.md) |
9
+ | `markshelf:treeWidth` | `src/app/page.tsx` | 左ツリーパネルの幅 (px) | `300` | [REQ3.4](../../要件定義/REQ3-プレビューとツリー/REQ3.4-パネルリサイザー.md) |
10
10
  | `markshelf:tocWidth` | `src/components/DetailPanel.tsx` | 目次パネルの幅 (px) | `176` | [REQ3.4](../../要件定義/REQ3-プレビューとツリー/REQ3.4-パネルリサイザー.md) |
11
11
  | `markshelf:treeExpanded` | `src/components/TreeView.tsx` | ツリーの展開状態(フォルダパスの集合) | トップレベルの README 付きフォルダを展開 | [REQ3.2](../../要件定義/REQ3-プレビューとツリー/REQ3.2-ツリービュー.md) |
12
12
  | `markshelf:linkGraphDepth` | `src/components/LinkGraph.tsx` | リンクグラフで辿る深さ(1/2/3/`all`) | `1` | [REQ2.2](../../要件定義/REQ2-リンクグラフ/REQ2.2-階層切替.md) |
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "markshelf",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "markshelf",
9
- "version": "0.9.0",
9
+ "version": "0.10.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@tailwindcss/typography": "^0.5.20",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markshelf",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Structured markdown viewer for git repositories",
5
5
  "license": "MIT",
6
6
  "author": "sksp.work",
@@ -27,14 +27,38 @@
27
27
  font-feature-settings: "palt" 0;
28
28
  }
29
29
 
30
+ /*
31
+ * Reader layout: prose keeps a ~52 字/行 measure (860px), while wide blocks
32
+ * (code, tables, Mermaid) may break out up to 1200px when their content
33
+ * needs it. Narrow wide-blocks still line up with the prose column.
34
+ */
30
35
  .md-reader {
31
- max-width: 860px;
32
- margin: 0 auto;
36
+ --md-measure: 860px;
37
+ --md-wide: 1200px;
33
38
  font-size: 16px;
34
39
  }
40
+ .md-reader > * {
41
+ max-width: var(--md-measure);
42
+ margin-left: auto;
43
+ margin-right: auto;
44
+ }
45
+ .md-reader > .md-code,
46
+ .md-reader > .md-table-wrap,
47
+ .md-reader > .md-mermaid {
48
+ width: fit-content;
49
+ min-width: min(100%, var(--md-measure));
50
+ max-width: min(100%, var(--md-wide));
51
+ }
52
+ /* Give the diagram its natural width so fit-content above can measure it. */
53
+ .md-reader > .md-mermaid svg {
54
+ display: block;
55
+ width: var(--mermaid-w, 100%);
56
+ max-width: 100% !important;
57
+ margin: 0 auto;
58
+ }
35
59
 
36
60
  .md-compact {
37
- font-size: 12px;
61
+ font-size: 14px;
38
62
  line-height: 1.7;
39
63
  }
40
64
 
@@ -31,7 +31,7 @@ export default function Home() {
31
31
  const [tree, setTree] = useState<TreeEntry[]>([]);
32
32
  const [root, setRoot] = useState<string>("");
33
33
  const [selectedPath, setSelectedPath] = useState<string | null>(null);
34
- const [treeWidth, setTreeWidth] = useState(260);
34
+ const [treeWidth, setTreeWidth] = useState(300);
35
35
  const [showTimeline, setShowTimeline] = useState(false);
36
36
  const [backStack, setBackStack] = useState<string[]>([]);
37
37
  const [forwardStack, setForwardStack] = useState<string[]>([]);
@@ -105,7 +105,7 @@ export default function Home() {
105
105
 
106
106
  useEffect(() => {
107
107
  const saved = localStorage.getItem("markshelf:treeWidth");
108
- if (saved) setTreeWidth(Number(saved) || 260);
108
+ if (saved) setTreeWidth(Number(saved) || 300);
109
109
  }, []);
110
110
 
111
111
  const fileRefs = useMemo(() => {
@@ -163,18 +163,18 @@ export default function Home() {
163
163
  return (
164
164
  <div className="h-screen flex flex-col">
165
165
  <header className="h-11 border-b border-[var(--border-default)] bg-[var(--bg-surface)] flex items-center px-5 shrink-0 gap-3">
166
- <span className="font-semibold text-[15px] tracking-tight leading-none">
166
+ <span className="font-semibold text-[16px] tracking-tight leading-none">
167
167
  Mark<span className="text-[var(--brand-primary)]">Shelf</span>
168
168
  </span>
169
169
  {root && (
170
- <span className="text-[11px] text-[var(--text-muted)] font-[var(--font-mono)] truncate leading-none">
170
+ <span className="text-[12px] text-[var(--text-muted)] font-[var(--font-mono)] truncate leading-none">
171
171
  {root}
172
172
  </span>
173
173
  )}
174
174
  <div className="ml-auto">
175
175
  <button
176
176
  onClick={() => setShowTimeline(!showTimeline)}
177
- className={`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[12px] font-medium transition-colors ${
177
+ className={`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[14px] font-medium transition-colors ${
178
178
  showTimeline
179
179
  ? "bg-[var(--brand-primary)] text-white"
180
180
  : "text-[var(--text-muted)] hover:bg-[var(--bg-muted)] hover:text-[var(--text-secondary)]"
@@ -218,7 +218,7 @@ export default function Home() {
218
218
  canGoForward={canGoForward}
219
219
  />
220
220
  ) : (
221
- <div className="p-6 text-[var(--text-muted)] text-sm flex items-center justify-center h-full">
221
+ <div className="p-6 text-[var(--text-muted)] text-[14px] flex items-center justify-center h-full">
222
222
  ファイルをクリックして内容を表示
223
223
  </div>
224
224
  )}
@@ -175,14 +175,14 @@ export function DetailPanel({ filePath, fileRefs, folders, onNavigate, onGoBack,
175
175
  <ArrowRight size={14} />
176
176
  </button>
177
177
  )}
178
- <h2 className="font-semibold text-[14px] leading-snug truncate text-[var(--text-primary)]">
178
+ <h2 className="font-semibold text-[16px] leading-snug truncate text-[var(--text-primary)]">
179
179
  {fileName}
180
180
  </h2>
181
181
  </div>
182
182
  <div className="flex gap-1">
183
183
  <button
184
184
  onClick={() => setTab("content")}
185
- className={`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[12px] font-medium transition-colors ${
185
+ className={`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[14px] font-medium transition-colors ${
186
186
  tab === "content"
187
187
  ? "bg-[var(--brand-primary)] text-white"
188
188
  : "text-[var(--text-muted)] hover:bg-[var(--bg-muted)] hover:text-[var(--text-secondary)]"
@@ -193,7 +193,7 @@ export function DetailPanel({ filePath, fileRefs, folders, onNavigate, onGoBack,
193
193
  </button>
194
194
  <button
195
195
  onClick={() => setTab("history")}
196
- className={`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[12px] font-medium transition-colors ${
196
+ className={`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[14px] font-medium transition-colors ${
197
197
  tab === "history"
198
198
  ? "bg-[var(--brand-primary)] text-white"
199
199
  : "text-[var(--text-muted)] hover:bg-[var(--bg-muted)] hover:text-[var(--text-secondary)]"
@@ -204,7 +204,7 @@ export function DetailPanel({ filePath, fileRefs, folders, onNavigate, onGoBack,
204
204
  </button>
205
205
  <button
206
206
  onClick={() => setTab("links")}
207
- className={`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[12px] font-medium transition-colors ${
207
+ className={`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[14px] font-medium transition-colors ${
208
208
  tab === "links"
209
209
  ? "bg-[var(--brand-primary)] text-white"
210
210
  : "text-[var(--text-muted)] hover:bg-[var(--bg-muted)] hover:text-[var(--text-secondary)]"
@@ -277,7 +277,7 @@ export function DetailPanel({ filePath, fileRefs, folders, onNavigate, onGoBack,
277
277
  )}
278
278
  </div>
279
279
  ) : (
280
- <div className="flex-1 p-4 text-[var(--text-muted)] text-sm">読み込み中...</div>
280
+ <div className="flex-1 p-4 text-[var(--text-muted)] text-[14px]">読み込み中...</div>
281
281
  )
282
282
  ) : tab === "history" ? (
283
283
  <div className="flex-1 overflow-y-auto" ref={scrollRef}>
@@ -20,11 +20,11 @@ export function DiffView({ filePath, hash }: Props) {
20
20
  }, [filePath, hash]);
21
21
 
22
22
  if (diff === null) {
23
- return <div className="text-[12px] text-[var(--text-muted)] py-2">差分を読み込み中...</div>;
23
+ return <div className="text-[14px] text-[var(--text-muted)] py-2">差分を読み込み中...</div>;
24
24
  }
25
25
 
26
26
  return (
27
- <pre className="text-[11px] font-[var(--font-mono)] bg-[var(--bg-muted)] rounded-lg p-3 overflow-x-auto leading-[1.7] border border-[var(--border-default)]">
27
+ <pre className="text-[12px] font-[var(--font-mono)] bg-[var(--bg-muted)] rounded-lg p-3 overflow-x-auto leading-[1.7] border border-[var(--border-default)]">
28
28
  {diff.split("\n").filter((line) =>
29
29
  !line.startsWith("diff --git") &&
30
30
  !line.startsWith("index ") &&
@@ -37,11 +37,11 @@ export function HistoryPanel({ filePath }: Props) {
37
37
  }, [filePath, refreshTick]);
38
38
 
39
39
  if (loading) {
40
- return <div className="p-4 text-[var(--text-muted)] text-[13px]">読み込み中...</div>;
40
+ return <div className="p-4 text-[var(--text-muted)] text-[14px]">読み込み中...</div>;
41
41
  }
42
42
 
43
43
  if (history.length === 0) {
44
- return <div className="p-4 text-[var(--text-muted)] text-[13px]">変更履歴がありません(git 管理外の可能性)</div>;
44
+ return <div className="p-4 text-[var(--text-muted)] text-[14px]">変更履歴がありません(git 管理外の可能性)</div>;
45
45
  }
46
46
 
47
47
  function formatDate(iso: string): string {
@@ -69,19 +69,19 @@ export function HistoryPanel({ filePath }: Props) {
69
69
  <GitCommit size={13} className="text-[var(--text-muted)] mt-0.5 shrink-0" />
70
70
  <div className="min-w-0 flex-1">
71
71
  <div className="flex items-center gap-2">
72
- <span className="text-[11px] font-[var(--font-mono)] text-[var(--brand-primary)] leading-none">
72
+ <span className="text-[12px] font-[var(--font-mono)] text-[var(--brand-primary)] leading-none">
73
73
  {commit.hashShort}
74
74
  </span>
75
- <span className="text-[11px] text-[var(--text-muted)] leading-none">
75
+ <span className="text-[12px] text-[var(--text-muted)] leading-none">
76
76
  {formatDate(commit.date)}
77
77
  </span>
78
78
  {commit.author && (
79
- <span className="text-[11px] text-[var(--text-muted)] leading-none">
79
+ <span className="text-[12px] text-[var(--text-muted)] leading-none">
80
80
  {commit.author}
81
81
  </span>
82
82
  )}
83
83
  </div>
84
- <p className="text-[12px] text-[var(--text-secondary)] mt-1 leading-snug line-clamp-2">
84
+ <p className="text-[14px] text-[var(--text-secondary)] mt-1 leading-snug line-clamp-2">
85
85
  {commit.message}
86
86
  </p>
87
87
  </div>
@@ -239,7 +239,7 @@ export function LinkGraph({ currentPath, folders, onNavigate, onPreviewShow, onP
239
239
  label: "data(label)",
240
240
  "text-valign": "bottom",
241
241
  "text-halign": "center",
242
- "font-size": "11px",
242
+ "font-size": "12px",
243
243
  "font-family": "var(--font-sans)",
244
244
  color: "#4a5060",
245
245
  "text-margin-y": 6,
@@ -423,14 +423,14 @@ export function LinkGraph({ currentPath, folders, onNavigate, onPreviewShow, onP
423
423
  return (
424
424
  <div className="h-full flex flex-col relative">
425
425
  <div className="flex items-center gap-1.5 px-3 py-2 shrink-0">
426
- <span className="text-[11px] text-[var(--text-muted)] mr-1">表示範囲</span>
426
+ <span className="text-[12px] text-[var(--text-muted)] mr-1">表示範囲</span>
427
427
  {DEPTH_OPTIONS.map((opt) => {
428
428
  const active = depth === opt.value;
429
429
  return (
430
430
  <button
431
431
  key={opt.label}
432
432
  onClick={() => changeDepth(opt.value)}
433
- className={`px-2 py-0.5 rounded-md text-[11px] font-medium transition-colors ${
433
+ className={`px-2 py-0.5 rounded-md text-[12px] font-medium transition-colors ${
434
434
  active
435
435
  ? "bg-[var(--brand-primary)] text-white"
436
436
  : "text-[var(--text-muted)] hover:bg-[var(--bg-muted)] hover:text-[var(--text-secondary)]"
@@ -443,7 +443,7 @@ export function LinkGraph({ currentPath, folders, onNavigate, onPreviewShow, onP
443
443
  <div className="ml-auto relative" ref={filterPopoverRef}>
444
444
  <button
445
445
  onClick={() => setShowFilter((v) => !v)}
446
- className={`flex items-center gap-1 px-2 py-0.5 rounded-md text-[11px] font-medium transition-colors ${
446
+ className={`flex items-center gap-1 px-2 py-0.5 rounded-md text-[12px] font-medium transition-colors ${
447
447
  excluded.length > 0
448
448
  ? "bg-[var(--brand-primary)] text-white"
449
449
  : "text-[var(--text-muted)] hover:bg-[var(--bg-muted)] hover:text-[var(--text-secondary)]"
@@ -457,7 +457,7 @@ export function LinkGraph({ currentPath, folders, onNavigate, onPreviewShow, onP
457
457
  {showFilter && (
458
458
  <div className="absolute right-0 top-full mt-1 w-56 max-h-72 overflow-y-auto bg-[var(--bg-surface)] border border-[var(--border-default)] rounded-md shadow-lg z-20 py-1">
459
459
  {folders.length === 0 ? (
460
- <div className="px-3 py-2 text-[11px] text-[var(--text-muted)]">
460
+ <div className="px-3 py-2 text-[12px] text-[var(--text-muted)]">
461
461
  フォルダがありません
462
462
  </div>
463
463
  ) : (
@@ -466,7 +466,7 @@ export function LinkGraph({ currentPath, folders, onNavigate, onPreviewShow, onP
466
466
  return (
467
467
  <label
468
468
  key={f.path}
469
- className="flex items-center gap-2 px-3 py-1 text-[12px] cursor-pointer hover:bg-[var(--bg-muted)]"
469
+ className="flex items-center gap-2 px-3 py-1 text-[14px] cursor-pointer hover:bg-[var(--bg-muted)]"
470
470
  style={{ paddingLeft: `${12 + f.depth * 12}px` }}
471
471
  >
472
472
  <input
@@ -485,7 +485,7 @@ export function LinkGraph({ currentPath, folders, onNavigate, onPreviewShow, onP
485
485
  </div>
486
486
  </div>
487
487
  {(loading || empty) && (
488
- <div className="absolute inset-0 flex items-center justify-center text-[13px] text-[var(--text-muted)] z-10 bg-[var(--bg-surface)]">
488
+ <div className="absolute inset-0 flex items-center justify-center text-[14px] text-[var(--text-muted)] z-10 bg-[var(--bg-surface)]">
489
489
  {loading ? "グラフを構築中..." : "このドキュメントへのリンクはありません"}
490
490
  </div>
491
491
  )}
@@ -356,6 +356,9 @@ export function Markdown({
356
356
  ? (children.props.className ?? "")
357
357
  : "";
358
358
  const language = /language-([\w+#-]+)/.exec(codeClass)?.[1] ?? null;
359
+ // The `code` override above turns mermaid into a MermaidBlock; render it
360
+ // bare so the diagram is a direct child of .md-body (and can go wide).
361
+ if (language === "mermaid") return <>{children}</>;
359
362
  return <CodeBlock language={language}>{children}</CodeBlock>;
360
363
  },
361
364
  blockquote: ({ children, node }) => {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
3
+ import { useCallback, useEffect, useLayoutEffect, useRef, useState, type CSSProperties } from "react";
4
4
  import { createPortal } from "react-dom";
5
5
  import mermaid from "mermaid";
6
6
  import { Maximize2, Minus, Plus, RotateCcw, X } from "lucide-react";
@@ -54,22 +54,29 @@ export function MermaidBlock({ code }: { code: string }) {
54
54
 
55
55
  if (error) {
56
56
  return (
57
- <div className="border border-red-200 bg-red-50 rounded p-3 text-xs text-red-700">
57
+ <div className="border border-red-200 bg-red-50 rounded p-3 text-[12px] text-red-700">
58
58
  <div className="font-medium mb-1">Mermaid エラー</div>
59
59
  <pre className="whitespace-pre-wrap">{code}</pre>
60
60
  </div>
61
61
  );
62
62
  }
63
63
 
64
+ // Mermaid emits width="100%" + style="max-width: Npx"; N is the diagram's
65
+ // natural width, which the reader layout needs to size the block.
66
+ const naturalWidth = svg ? Number(/max-width:\s*([\d.]+)px/.exec(svg)?.[1]) || null : null;
67
+
64
68
  if (!svg) {
65
69
  return (
66
- <div className="text-xs text-[var(--text-muted)] py-2">図を描画中...</div>
70
+ <div className="text-[12px] text-[var(--text-muted)] py-2">図を描画中...</div>
67
71
  );
68
72
  }
69
73
 
70
74
  return (
71
75
  <>
72
- <div className="group relative my-2">
76
+ <div
77
+ className="md-mermaid group relative my-2"
78
+ style={naturalWidth ? ({ "--mermaid-w": `${naturalWidth}px` } as CSSProperties) : undefined}
79
+ >
73
80
  <div
74
81
  ref={containerRef}
75
82
  className="overflow-x-auto cursor-zoom-in"
@@ -126,7 +126,7 @@ export function PreviewPopup({ path, position, onNavigate, onMouseEnter, onMouse
126
126
  <div className="sticky top-0 bg-[var(--bg-surface)] border-b border-[var(--border-default)] px-3 py-2 flex items-center gap-2">
127
127
  <button
128
128
  onClick={() => onNavigate(path)}
129
- className="text-xs font-medium text-[var(--brand-primary)] hover:underline truncate flex items-center gap-1"
129
+ className="text-[14px] font-medium text-[var(--brand-primary)] hover:underline truncate flex items-center gap-1"
130
130
  >
131
131
  {displayName}
132
132
  <ExternalLink size={10} />
@@ -134,9 +134,9 @@ export function PreviewPopup({ path, position, onNavigate, onMouseEnter, onMouse
134
134
  </div>
135
135
  <div className="p-3">
136
136
  {loading ? (
137
- <div className="text-xs text-[var(--text-muted)]">読み込み中...</div>
137
+ <div className="text-[12px] text-[var(--text-muted)]">読み込み中...</div>
138
138
  ) : content ? (
139
- <div className="text-[11px]">
139
+ <div className="text-[14px]">
140
140
  <Markdown
141
141
  fileRefs={fileRefs}
142
142
  currentPath={path}
@@ -146,7 +146,7 @@ export function PreviewPopup({ path, position, onNavigate, onMouseEnter, onMouse
146
146
  >{content}</Markdown>
147
147
  </div>
148
148
  ) : (
149
- <div className="text-xs text-[var(--text-muted)]">プレビューを表示できません</div>
149
+ <div className="text-[12px] text-[var(--text-muted)]">プレビューを表示できません</div>
150
150
  )}
151
151
  </div>
152
152
  </div>
@@ -97,7 +97,7 @@ export function SearchBar({ onSelect }: Props) {
97
97
  onChange={(e) => handleChange(e.target.value)}
98
98
  onFocus={() => { if (results.length > 0) setIsOpen(true); }}
99
99
  placeholder="ドキュメントを検索..."
100
- className="w-full pl-8 pr-8 py-1.5 text-[12px] leading-normal rounded-md border border-[var(--border-default)] bg-[var(--bg-surface)] text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:ring-1 focus:ring-[var(--brand-primary)] focus:border-[var(--brand-primary)] transition-shadow"
100
+ className="w-full pl-8 pr-8 py-1.5 text-[14px] leading-normal rounded-md border border-[var(--border-default)] bg-[var(--bg-surface)] text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:ring-1 focus:ring-[var(--brand-primary)] focus:border-[var(--brand-primary)] transition-shadow"
101
101
  />
102
102
  {query && (
103
103
  <button
@@ -112,11 +112,11 @@ export function SearchBar({ onSelect }: Props) {
112
112
  {isOpen && (
113
113
  <div className="absolute left-4 right-4 top-full mt-1 z-40 bg-[var(--bg-surface)] border border-[var(--border-default)] rounded-lg shadow-lg max-h-80 overflow-y-auto">
114
114
  {isSearching ? (
115
- <div className="p-3 text-xs text-[var(--text-muted)] text-center">
115
+ <div className="p-3 text-[12px] text-[var(--text-muted)] text-center">
116
116
  検索中...
117
117
  </div>
118
118
  ) : results.length === 0 ? (
119
- <div className="p-3 text-xs text-[var(--text-muted)] text-center">
119
+ <div className="p-3 text-[12px] text-[var(--text-muted)] text-center">
120
120
  該当するドキュメントが見つかりません
121
121
  </div>
122
122
  ) : (
@@ -126,16 +126,16 @@ export function SearchBar({ onSelect }: Props) {
126
126
  onClick={() => handleSelect(r.path)}
127
127
  className="w-full text-left px-3 py-2 hover:bg-[var(--bg-muted)] border-b border-[var(--border-default)] last:border-b-0 transition-colors"
128
128
  >
129
- <div className="text-[12px] font-medium text-[var(--text-primary)] truncate leading-snug">
129
+ <div className="text-[14px] font-medium text-[var(--text-primary)] truncate leading-snug">
130
130
  {r.displayName}
131
131
  </div>
132
- <div className="text-[10px] text-[var(--text-muted)] font-[var(--font-mono)] truncate mb-1 leading-normal">
132
+ <div className="text-[12px] text-[var(--text-muted)] font-[var(--font-mono)] truncate mb-1 leading-normal">
133
133
  {r.path}
134
134
  </div>
135
135
  {r.matches.slice(0, 2).map((m) => (
136
136
  <div
137
137
  key={m.line}
138
- className="text-[10px] text-[var(--text-secondary)] truncate leading-relaxed"
138
+ className="text-[12px] text-[var(--text-secondary)] truncate leading-relaxed"
139
139
  >
140
140
  <span className="text-[var(--text-muted)] mr-1">L{m.line}</span>
141
141
  <HighlightMatch text={m.text} query={query} />
@@ -60,14 +60,14 @@ export function TableOfContents({ headings, scrollContainer }: Props) {
60
60
 
61
61
  return (
62
62
  <nav className="py-3 px-2 space-y-px">
63
- <div className="text-[10px] font-medium text-[var(--text-muted)] tracking-wider uppercase px-1.5 mb-1.5">
63
+ <div className="text-[12px] font-medium text-[var(--text-muted)] tracking-wider uppercase px-1.5 mb-1.5">
64
64
  目次
65
65
  </div>
66
66
  {headings.map((h) => (
67
67
  <button
68
68
  key={h.id}
69
69
  onClick={() => handleClick(h.id)}
70
- className={`block w-full text-left text-[11px] leading-relaxed py-0.5 truncate transition-colors rounded px-1.5 ${
70
+ className={`block w-full text-left text-[14px] leading-relaxed py-0.5 truncate transition-colors rounded px-1.5 ${
71
71
  activeId === h.id
72
72
  ? "text-[var(--brand-primary)] font-medium bg-blue-50"
73
73
  : "text-[var(--text-muted)] hover:text-[var(--text-secondary)] hover:bg-[var(--bg-hover)]"
@@ -87,10 +87,10 @@ export function TimelinePanel({ onNavigate, onClose }: Props) {
87
87
  >
88
88
  <div className="flex items-center gap-2 px-5 py-3 border-b border-[var(--border-default)] shrink-0">
89
89
  <Clock size={14} className="text-[var(--brand-primary)]" />
90
- <h2 className="font-semibold text-[14px] text-[var(--text-primary)]">
90
+ <h2 className="font-semibold text-[16px] text-[var(--text-primary)]">
91
91
  変更タイムライン
92
92
  </h2>
93
- <span className="text-[11px] text-[var(--text-muted)]">
93
+ <span className="text-[12px] text-[var(--text-muted)]">
94
94
  リポジトリ全体の変更履歴
95
95
  </span>
96
96
  <button
@@ -104,18 +104,18 @@ export function TimelinePanel({ onNavigate, onClose }: Props) {
104
104
 
105
105
  <div className="flex-1 overflow-y-auto">
106
106
  {loading ? (
107
- <div className="h-full flex items-center justify-center text-[13px] text-[var(--text-muted)]">
107
+ <div className="h-full flex items-center justify-center text-[14px] text-[var(--text-muted)]">
108
108
  タイムラインを読み込み中...
109
109
  </div>
110
110
  ) : entries.length === 0 ? (
111
- <div className="h-full flex items-center justify-center text-[13px] text-[var(--text-muted)]">
111
+ <div className="h-full flex items-center justify-center text-[14px] text-[var(--text-muted)]">
112
112
  変更履歴がありません
113
113
  </div>
114
114
  ) : (
115
115
  Array.from(grouped.entries()).map(([dateKey, dateEntries]) => (
116
116
  <div key={dateKey}>
117
117
  <div className="sticky top-0 z-10 bg-[var(--bg-base)] border-b border-[var(--border-default)] px-4 py-1.5">
118
- <span className="text-[11px] font-medium text-[var(--text-muted)] tracking-wide">
118
+ <span className="text-[12px] font-medium text-[var(--text-muted)] tracking-wide">
119
119
  {dateKey}
120
120
  </span>
121
121
  </div>
@@ -132,23 +132,23 @@ export function TimelinePanel({ onNavigate, onClose }: Props) {
132
132
  <GitCommit size={13} className="text-[var(--text-muted)] mt-0.5 shrink-0" />
133
133
  <div className="min-w-0 flex-1">
134
134
  <div className="flex items-center gap-2">
135
- <span className="text-[11px] font-[var(--font-mono)] text-[var(--brand-primary)] leading-none">
135
+ <span className="text-[12px] font-[var(--font-mono)] text-[var(--brand-primary)] leading-none">
136
136
  {entry.hashShort}
137
137
  </span>
138
- <span className="text-[11px] text-[var(--text-muted)] leading-none">
138
+ <span className="text-[12px] text-[var(--text-muted)] leading-none">
139
139
  {formatTime(entry.date)}
140
140
  </span>
141
141
  {entry.author && (
142
- <span className="text-[11px] text-[var(--text-muted)] leading-none">
142
+ <span className="text-[12px] text-[var(--text-muted)] leading-none">
143
143
  {entry.author}
144
144
  </span>
145
145
  )}
146
146
  </div>
147
- <p className="text-[12px] text-[var(--text-secondary)] mt-1 leading-snug line-clamp-2">
147
+ <p className="text-[14px] text-[var(--text-secondary)] mt-1 leading-snug line-clamp-2">
148
148
  {entry.message}
149
149
  </p>
150
150
  <div className="flex items-center gap-1 mt-1.5">
151
- <span className="text-[10px] text-[var(--text-muted)]">
151
+ <span className="text-[12px] text-[var(--text-muted)]">
152
152
  {entry.files.length}件のドキュメント変更
153
153
  </span>
154
154
  </div>
@@ -192,12 +192,12 @@ export function TimelinePanel({ onNavigate, onClose }: Props) {
192
192
  />
193
193
  <button
194
194
  onClick={() => onNavigate(file)}
195
- className="text-[11px] text-[var(--text-secondary)] hover:text-[var(--brand-primary)] truncate text-left"
195
+ className="text-[12px] text-[var(--text-secondary)] hover:text-[var(--brand-primary)] truncate text-left"
196
196
  title={file}
197
197
  >
198
198
  {displayName}
199
199
  </button>
200
- <span className="text-[10px] text-[var(--text-muted)] truncate ml-auto opacity-0 group-hover:opacity-100 transition-opacity">
200
+ <span className="text-[12px] text-[var(--text-muted)] truncate ml-auto opacity-0 group-hover:opacity-100 transition-opacity">
201
201
  {file}
202
202
  </span>
203
203
  </div>
@@ -136,7 +136,7 @@ export function TreeView({ entries, selectedPath, onSelect }: Props) {
136
136
  />
137
137
  ))}
138
138
  {entries.length === 0 && (
139
- <div className="text-[var(--text-muted)] text-[13px] p-4 text-center">
139
+ <div className="text-[var(--text-muted)] text-[14px] p-4 text-center">
140
140
  マークダウンファイルが見つかりません
141
141
  </div>
142
142
  )}
@@ -194,7 +194,7 @@ function TreeNode({
194
194
  onClick={handleClick}
195
195
  className={`
196
196
  flex items-center gap-1.5 cursor-pointer select-none
197
- h-7 pr-2 text-[12px] leading-none transition-colors
197
+ h-8 pr-2 text-[14px] leading-none transition-colors
198
198
  ${isSelected
199
199
  ? "bg-[var(--brand-primary)]/10 text-[var(--text-primary)]"
200
200
  : "text-[var(--text-secondary)] hover:bg-[var(--bg-hover)]"