markshelf 0.9.0 → 0.11.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.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +4 -4
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/asset/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/diff/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/file/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/graph/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/raw/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/timeline/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tree/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/watch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{1q96_modules_mermaid_dist_chunks_mermaid_core_sizeCapture-INFHLROL_mjs_1mq1p9flxqx65._.js → 1q96_modules_mermaid_dist_chunks_mermaid_core_sizeCapture-INFHLROL_mjs_0n7fl1p64pm80._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0eg7wjh-6h9jf._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_1c68lxafmnoad._.js → node_modules_05xv86nhwtok_._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_1q6uhrxleh9ri._.js → node_modules_0bphz1ntvilz2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_0-kltcyqgad7k._.js → node_modules_0e-p093ipnrj1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_1j6p_d23zw2ot._.js → node_modules_1b-k62nuxau-t._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_20npetuy1mdty._.js → node_modules_1d14kgv67ciol._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_0jxaz2e5w2cuj._.js → node_modules_1o7t0lhsrm1v3._.js} +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/{1gbw1b68p1p8h.js → 0e2w94odese5_.js} +3 -3
- package/.next/standalone/.next/static/chunks/3v55-nfuvvipt.css +2 -0
- 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 +4 -3
- 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
- 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
- package/.next/standalone/package-lock.json +2 -2
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/src/app/markdown.css +27 -3
- package/.next/standalone/src/app/page.tsx +6 -6
- package/.next/standalone/src/components/DetailPanel.tsx +5 -5
- package/.next/standalone/src/components/DiffView.tsx +2 -2
- package/.next/standalone/src/components/HistoryPanel.tsx +6 -6
- package/.next/standalone/src/components/LinkGraph.tsx +7 -7
- package/.next/standalone/src/components/Markdown.tsx +3 -0
- package/.next/standalone/src/components/MermaidBlock.tsx +145 -36
- package/.next/standalone/src/components/PreviewPopup.tsx +4 -4
- package/.next/standalone/src/components/SearchBar.tsx +6 -6
- package/.next/standalone/src/components/TableOfContents.tsx +2 -2
- package/.next/standalone/src/components/TimelinePanel.tsx +12 -12
- package/.next/standalone/src/components/TreeView.tsx +2 -2
- package/.next/static/chunks/{1gbw1b68p1p8h.js → 0e2w94odese5_.js} +3 -3
- package/.next/static/chunks/3v55-nfuvvipt.css +2 -0
- package/package.json +1 -1
- package/.next/standalone/.next/static/chunks/0wr6kk5jmu7qu.css +0 -2
- package/.next/static/chunks/0wr6kk5jmu7qu.css +0 -2
- /package/.next/standalone/.next/static/{9u-UWrYhqOePy2N3WxC2_ → Qp-y1uxXBYKw6ABgA28qK}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{9u-UWrYhqOePy2N3WxC2_ → Qp-y1uxXBYKw6ABgA28qK}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{9u-UWrYhqOePy2N3WxC2_ → Qp-y1uxXBYKw6ABgA28qK}/_ssgManifest.js +0 -0
- /package/.next/static/{9u-UWrYhqOePy2N3WxC2_ → Qp-y1uxXBYKw6ABgA28qK}/_buildManifest.js +0 -0
- /package/.next/static/{9u-UWrYhqOePy2N3WxC2_ → Qp-y1uxXBYKw6ABgA28qK}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{9u-UWrYhqOePy2N3WxC2_ → Qp-y1uxXBYKw6ABgA28qK}/_ssgManifest.js +0 -0
|
@@ -1,39 +1,114 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore, type CSSProperties } from "react";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import mermaid from "mermaid";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
import { Minus, Plus, RotateCcw, X } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
// ---- Layout preference ----------------------------------------------------
|
|
9
|
+
// Mermaid 12 changed the default layout engine from dagre to ELK. Users can
|
|
10
|
+
// pick the engine from the zoom modal; the choice is shared by every diagram
|
|
11
|
+
// on the page and persisted in localStorage.
|
|
12
|
+
const LAYOUTS = [
|
|
13
|
+
{ value: "elk", label: "ELK", title: "ELK レイアウト(Mermaid 12 の標準)" },
|
|
14
|
+
{ value: "dagre", label: "dagre", title: "dagre レイアウト(Mermaid 11 以前の標準)" },
|
|
15
|
+
] as const;
|
|
16
|
+
type MermaidLayout = (typeof LAYOUTS)[number]["value"];
|
|
17
|
+
const DEFAULT_LAYOUT: MermaidLayout = "elk";
|
|
18
|
+
|
|
19
|
+
const LAYOUT_KEY = "markshelf:mermaidLayout";
|
|
20
|
+
const layoutListeners = new Set<() => void>();
|
|
21
|
+
let layoutOverride: MermaidLayout | null = null;
|
|
22
|
+
|
|
23
|
+
function readLayout(): MermaidLayout {
|
|
24
|
+
try {
|
|
25
|
+
const saved = localStorage.getItem(LAYOUT_KEY);
|
|
26
|
+
return LAYOUTS.some((l) => l.value === saved) ? (saved as MermaidLayout) : DEFAULT_LAYOUT;
|
|
27
|
+
} catch {
|
|
28
|
+
return DEFAULT_LAYOUT;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function setLayout(value: MermaidLayout) {
|
|
33
|
+
try {
|
|
34
|
+
if (value === DEFAULT_LAYOUT) localStorage.removeItem(LAYOUT_KEY);
|
|
35
|
+
else localStorage.setItem(LAYOUT_KEY, value);
|
|
36
|
+
} catch {
|
|
37
|
+
// storage unavailable: keep the in-memory choice working for this page
|
|
38
|
+
}
|
|
39
|
+
layoutOverride = value;
|
|
40
|
+
layoutListeners.forEach((l) => l());
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function subscribeLayout(listener: () => void) {
|
|
44
|
+
layoutListeners.add(listener);
|
|
45
|
+
const onStorage = (e: StorageEvent) => {
|
|
46
|
+
if (e.key === LAYOUT_KEY) {
|
|
47
|
+
layoutOverride = null;
|
|
48
|
+
listener();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
window.addEventListener("storage", onStorage);
|
|
52
|
+
return () => {
|
|
53
|
+
layoutListeners.delete(listener);
|
|
54
|
+
window.removeEventListener("storage", onStorage);
|
|
55
|
+
};
|
|
19
56
|
}
|
|
20
57
|
|
|
21
|
-
|
|
58
|
+
function useMermaidLayout(): MermaidLayout {
|
|
59
|
+
return useSyncExternalStore(
|
|
60
|
+
subscribeLayout,
|
|
61
|
+
() => layoutOverride ?? readLayout(),
|
|
62
|
+
() => DEFAULT_LAYOUT,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// ---- Rendering ------------------------------------------------------------
|
|
67
|
+
// mermaid.initialize() is global, so (re)initialize and render inside one
|
|
68
|
+
// serialized queue to keep each diagram's settings from leaking into another.
|
|
69
|
+
let renderQueue: Promise<unknown> = Promise.resolve();
|
|
70
|
+
let renderSeq = 0;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Each render gets a fresh element id: re-rendering (e.g. after switching the
|
|
74
|
+
* layout) while an SVG with the same id is still in the DOM makes Mermaid
|
|
75
|
+
* measure the wrong element and emit an empty diagram.
|
|
76
|
+
*/
|
|
77
|
+
function renderDiagram(code: string, layout: MermaidLayout) {
|
|
78
|
+
const id = `mermaid-${++renderSeq}`;
|
|
79
|
+
const job = renderQueue.then(() => {
|
|
80
|
+
mermaid.initialize({
|
|
81
|
+
startOnLoad: false,
|
|
82
|
+
theme: "default",
|
|
83
|
+
securityLevel: "loose",
|
|
84
|
+
fontFamily: "system-ui, sans-serif",
|
|
85
|
+
// A top-level layout would also override swimlane diagrams, which need
|
|
86
|
+
// their own engine, so pin that one back.
|
|
87
|
+
...(layout === DEFAULT_LAYOUT ? {} : { layout, swimlane: { layout: "swimlane" } }),
|
|
88
|
+
});
|
|
89
|
+
return mermaid.render(id, code).catch((e) => {
|
|
90
|
+
// Clean up any error element mermaid might have injected
|
|
91
|
+
document.getElementById("d" + id)?.remove();
|
|
92
|
+
throw e;
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
renderQueue = job.catch(() => undefined);
|
|
96
|
+
return job;
|
|
97
|
+
}
|
|
22
98
|
|
|
23
99
|
export function MermaidBlock({ code }: { code: string }) {
|
|
24
100
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
25
101
|
const [svg, setSvg] = useState<string | null>(null);
|
|
26
102
|
const [error, setError] = useState<string | null>(null);
|
|
27
103
|
const [expanded, setExpanded] = useState(false);
|
|
28
|
-
const
|
|
104
|
+
const layout = useMermaidLayout();
|
|
29
105
|
|
|
30
106
|
useEffect(() => {
|
|
31
107
|
let cancelled = false;
|
|
32
|
-
ensureInit();
|
|
33
108
|
|
|
34
109
|
(async () => {
|
|
35
110
|
try {
|
|
36
|
-
const { svg: rendered } = await
|
|
111
|
+
const { svg: rendered } = await renderDiagram(code, layout);
|
|
37
112
|
if (!cancelled) {
|
|
38
113
|
setSvg(rendered);
|
|
39
114
|
setError(null);
|
|
@@ -43,33 +118,37 @@ export function MermaidBlock({ code }: { code: string }) {
|
|
|
43
118
|
setError(e instanceof Error ? e.message : "Mermaid render error");
|
|
44
119
|
setSvg(null);
|
|
45
120
|
}
|
|
46
|
-
// Clean up any error element mermaid might have injected
|
|
47
|
-
const errEl = document.getElementById("d" + idRef.current);
|
|
48
|
-
errEl?.remove();
|
|
49
121
|
}
|
|
50
122
|
})();
|
|
51
123
|
|
|
52
124
|
return () => { cancelled = true; };
|
|
53
|
-
}, [code]);
|
|
125
|
+
}, [code, layout]);
|
|
54
126
|
|
|
55
127
|
if (error) {
|
|
56
128
|
return (
|
|
57
|
-
<div className="border border-red-200 bg-red-50 rounded p-3 text-
|
|
129
|
+
<div className="border border-red-200 bg-red-50 rounded p-3 text-[12px] text-red-700">
|
|
58
130
|
<div className="font-medium mb-1">Mermaid エラー</div>
|
|
59
131
|
<pre className="whitespace-pre-wrap">{code}</pre>
|
|
60
132
|
</div>
|
|
61
133
|
);
|
|
62
134
|
}
|
|
63
135
|
|
|
136
|
+
// Mermaid emits width="100%" + style="max-width: Npx"; N is the diagram's
|
|
137
|
+
// natural width, which the reader layout needs to size the block.
|
|
138
|
+
const naturalWidth = svg ? Number(/max-width:\s*([\d.]+)px/.exec(svg)?.[1]) || null : null;
|
|
139
|
+
|
|
64
140
|
if (!svg) {
|
|
65
141
|
return (
|
|
66
|
-
<div className="text-
|
|
142
|
+
<div className="text-[12px] text-[var(--text-muted)] py-2">図を描画中...</div>
|
|
67
143
|
);
|
|
68
144
|
}
|
|
69
145
|
|
|
70
146
|
return (
|
|
71
147
|
<>
|
|
72
|
-
<div
|
|
148
|
+
<div
|
|
149
|
+
className="md-mermaid my-2"
|
|
150
|
+
style={naturalWidth ? ({ "--mermaid-w": `${naturalWidth}px` } as CSSProperties) : undefined}
|
|
151
|
+
>
|
|
73
152
|
<div
|
|
74
153
|
ref={containerRef}
|
|
75
154
|
className="overflow-x-auto cursor-zoom-in"
|
|
@@ -77,17 +156,15 @@ export function MermaidBlock({ code }: { code: string }) {
|
|
|
77
156
|
onClick={() => setExpanded(true)}
|
|
78
157
|
dangerouslySetInnerHTML={{ __html: svg }}
|
|
79
158
|
/>
|
|
80
|
-
<button
|
|
81
|
-
type="button"
|
|
82
|
-
onClick={() => setExpanded(true)}
|
|
83
|
-
className="absolute top-1 right-1 p-1 rounded bg-[var(--bg-surface)]/90 border border-[var(--border-default)] text-[var(--text-muted)] hover:text-[var(--text-secondary)] opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity"
|
|
84
|
-
title="拡大表示"
|
|
85
|
-
aria-label="図を拡大表示"
|
|
86
|
-
>
|
|
87
|
-
<Maximize2 size={14} />
|
|
88
|
-
</button>
|
|
89
159
|
</div>
|
|
90
|
-
{expanded &&
|
|
160
|
+
{expanded && (
|
|
161
|
+
<MermaidModal
|
|
162
|
+
svg={svg}
|
|
163
|
+
layout={layout}
|
|
164
|
+
onLayoutChange={setLayout}
|
|
165
|
+
onClose={() => setExpanded(false)}
|
|
166
|
+
/>
|
|
167
|
+
)}
|
|
91
168
|
</>
|
|
92
169
|
);
|
|
93
170
|
}
|
|
@@ -104,7 +181,17 @@ function naturalSize(svgEl: SVGSVGElement): { w: number; h: number } {
|
|
|
104
181
|
return { w: r.width || 800, h: r.height || 600 };
|
|
105
182
|
}
|
|
106
183
|
|
|
107
|
-
function MermaidModal({
|
|
184
|
+
function MermaidModal({
|
|
185
|
+
svg,
|
|
186
|
+
layout,
|
|
187
|
+
onLayoutChange,
|
|
188
|
+
onClose,
|
|
189
|
+
}: {
|
|
190
|
+
svg: string;
|
|
191
|
+
layout: MermaidLayout;
|
|
192
|
+
onLayoutChange: (layout: MermaidLayout) => void;
|
|
193
|
+
onClose: () => void;
|
|
194
|
+
}) {
|
|
108
195
|
const viewportRef = useRef<HTMLDivElement>(null);
|
|
109
196
|
const contentRef = useRef<HTMLDivElement>(null);
|
|
110
197
|
const sizeRef = useRef<{ w: number; h: number } | null>(null);
|
|
@@ -222,6 +309,28 @@ function MermaidModal({ svg, onClose }: { svg: string; onClose: () => void }) {
|
|
|
222
309
|
<button className={btn} onClick={() => setScale(initialScale)} title="リセット (0)">
|
|
223
310
|
<RotateCcw size={14} />
|
|
224
311
|
</button>
|
|
312
|
+
<div className="ml-3 flex items-center gap-1" role="radiogroup" aria-label="レイアウト">
|
|
313
|
+
<span className="text-[12px] text-[var(--text-muted)]">レイアウト</span>
|
|
314
|
+
<div className="flex rounded border border-[var(--border-default)] overflow-hidden">
|
|
315
|
+
{LAYOUTS.map((l) => (
|
|
316
|
+
<button
|
|
317
|
+
key={l.value}
|
|
318
|
+
type="button"
|
|
319
|
+
role="radio"
|
|
320
|
+
aria-checked={layout === l.value}
|
|
321
|
+
className={`px-2 py-0.5 text-[12px] transition-colors ${
|
|
322
|
+
layout === l.value
|
|
323
|
+
? "bg-[var(--bg-muted)] text-[var(--text-secondary)] font-medium"
|
|
324
|
+
: "text-[var(--text-muted)] hover:bg-[var(--bg-muted)] hover:text-[var(--text-secondary)]"
|
|
325
|
+
}`}
|
|
326
|
+
onClick={() => onLayoutChange(l.value)}
|
|
327
|
+
title={l.title}
|
|
328
|
+
>
|
|
329
|
+
{l.label}
|
|
330
|
+
</button>
|
|
331
|
+
))}
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
225
334
|
<button className={`${btn} ml-auto`} onClick={onClose} title="閉じる (Esc)">
|
|
226
335
|
<X size={16} />
|
|
227
336
|
</button>
|
|
@@ -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-
|
|
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-
|
|
137
|
+
<div className="text-[12px] text-[var(--text-muted)]">読み込み中...</div>
|
|
138
138
|
) : content ? (
|
|
139
|
-
<div className="text-[
|
|
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-
|
|
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-[
|
|
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-
|
|
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-
|
|
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-[
|
|
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-[
|
|
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-[
|
|
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-[
|
|
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-[
|
|
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-[
|
|
90
|
+
<h2 className="font-semibold text-[16px] text-[var(--text-primary)]">
|
|
91
91
|
変更タイムライン
|
|
92
92
|
</h2>
|
|
93
|
-
<span className="text-[
|
|
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-[
|
|
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-[
|
|
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-[
|
|
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-[
|
|
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-[
|
|
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-[
|
|
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-[
|
|
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-[
|
|
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-[
|
|
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-[
|
|
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-[
|
|
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-
|
|
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)]"
|