@youtyan/code-viewer 0.13.1 → 0.15.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/README.md +60 -6
- package/dist/code-viewer.js +526 -99
- package/package.json +1 -1
- package/web/app.js +2242 -541
- package/web/index.html +3 -0
- package/web/style.css +221 -4
package/web/index.html
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
<a class="app-menu-item" data-route="help" href="/help">Settings & Help</a>
|
|
39
39
|
</nav>
|
|
40
40
|
<div class="global-actions">
|
|
41
|
+
<button id="search-btn" class="global-icon-action" title="search files (Ctrl+K) · Shift+click: grep (Ctrl+G)" aria-label="search files (Ctrl+K) · Shift+click: grep (Ctrl+G)"><span class="goi-icon" aria-hidden="true"></span></button>
|
|
41
42
|
<button id="annotations-toggle" class="global-icon-action" title="code annotations" aria-label="code annotations"><span class="goi-icon" aria-hidden="true"></span><span id="annotations-count" hidden></span></button>
|
|
42
43
|
<button id="doctor-btn" class="global-icon-action" title="environment doctor" aria-label="environment doctor"><span class="goi-icon" aria-hidden="true"></span><span id="doctor-badge" class="doctor-badge" hidden></span></button>
|
|
43
44
|
<span class="global-actions-sep" aria-hidden="true"></span>
|
|
@@ -215,6 +216,7 @@
|
|
|
215
216
|
<div class="app-panel-tabs" role="tablist" aria-label="panel">
|
|
216
217
|
<button type="button" id="panel-tab-terminal" class="app-panel-tab" role="tab" data-panel="terminal" data-route="terminal" aria-selected="false">Terminal</button>
|
|
217
218
|
<button type="button" id="panel-tab-tools" class="app-panel-tab" role="tab" data-panel="tools" data-route="tools" aria-selected="false">Tools</button>
|
|
219
|
+
<button type="button" id="panel-tab-search" class="app-panel-tab" role="tab" data-panel="search" data-route="search" aria-selected="false">Search</button>
|
|
218
220
|
<span class="app-panel-spacer"></span>
|
|
219
221
|
<div class="seg app-panel-layout-switch" role="group" aria-label="panel layout">
|
|
220
222
|
<button type="button" data-panel-layout="overlay" class="active" aria-pressed="true">Overlay</button>
|
|
@@ -224,6 +226,7 @@
|
|
|
224
226
|
</div>
|
|
225
227
|
<div class="app-panel-bodies">
|
|
226
228
|
<aside id="tools-sheet" class="tools-sheet" hidden aria-hidden="true" inert aria-label="tools"></aside>
|
|
229
|
+
<aside id="search-sheet" class="search-sheet" hidden aria-hidden="true" inert aria-label="search results"></aside>
|
|
227
230
|
<aside id="terminal-sheet" class="terminal-sheet" hidden aria-hidden="true" inert aria-label="terminal"></aside>
|
|
228
231
|
</div>
|
|
229
232
|
</section>
|
package/web/style.css
CHANGED
|
@@ -303,6 +303,9 @@ body[data-code-font-size="xlarge"] {
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
.gdp-palette-label {
|
|
306
|
+
display: flex;
|
|
307
|
+
align-items: center;
|
|
308
|
+
gap: 6px;
|
|
306
309
|
padding: 12px 16px 0;
|
|
307
310
|
color: var(--fg-muted);
|
|
308
311
|
font-size: 12px;
|
|
@@ -1064,6 +1067,21 @@ body.gdp-diff-page #repo-target-wrap {
|
|
|
1064
1067
|
padding: 10px 10px 0;
|
|
1065
1068
|
background: var(--bg);
|
|
1066
1069
|
}
|
|
1070
|
+
/* Recently picked refs, same pill idiom as the quick chips. */
|
|
1071
|
+
.rp-recent {
|
|
1072
|
+
display: flex;
|
|
1073
|
+
flex-wrap: wrap;
|
|
1074
|
+
gap: 6px;
|
|
1075
|
+
padding: 8px 10px 0;
|
|
1076
|
+
background: var(--bg);
|
|
1077
|
+
}
|
|
1078
|
+
.rp-recent[hidden] { display: none; }
|
|
1079
|
+
.rp-chip-recent {
|
|
1080
|
+
max-width: 180px;
|
|
1081
|
+
overflow: hidden;
|
|
1082
|
+
text-overflow: ellipsis;
|
|
1083
|
+
white-space: nowrap;
|
|
1084
|
+
}
|
|
1067
1085
|
.rp-chip {
|
|
1068
1086
|
/* Compact quick-fill pills; .current uses the same tinted-active idiom
|
|
1069
1087
|
as the topbar toggles and header nav. */
|
|
@@ -1850,12 +1868,100 @@ body.gdp-history-page #topbar .ref-pickers {
|
|
|
1850
1868
|
}
|
|
1851
1869
|
.history-item .meta2 {
|
|
1852
1870
|
display: flex;
|
|
1853
|
-
|
|
1871
|
+
flex-wrap: wrap;
|
|
1872
|
+
gap: 4px 8px;
|
|
1854
1873
|
color: var(--fg-muted);
|
|
1855
1874
|
font-size: var(--ui-font-sm);
|
|
1856
1875
|
margin-top: 2px;
|
|
1857
1876
|
}
|
|
1858
1877
|
.history-item .sha { font-family: "Monaspace Neon", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; }
|
|
1878
|
+
/* Branch / tag decorations and the merge marker on a commit row. Chips
|
|
1879
|
+
share the .rp-chip pill idiom; colour only, so the row height is stable. */
|
|
1880
|
+
/* Chips take their own line under sha / author / date so the meta row keeps
|
|
1881
|
+
its width and the chips flow horizontally in the narrow panel. */
|
|
1882
|
+
.history-item .history-refs {
|
|
1883
|
+
display: flex;
|
|
1884
|
+
flex-wrap: wrap;
|
|
1885
|
+
gap: 4px;
|
|
1886
|
+
flex-basis: 100%;
|
|
1887
|
+
min-width: 0;
|
|
1888
|
+
}
|
|
1889
|
+
.history-ref {
|
|
1890
|
+
display: inline-block;
|
|
1891
|
+
max-width: 160px;
|
|
1892
|
+
overflow: hidden;
|
|
1893
|
+
text-overflow: ellipsis;
|
|
1894
|
+
white-space: nowrap;
|
|
1895
|
+
padding: 0 6px;
|
|
1896
|
+
border: 1px solid var(--border);
|
|
1897
|
+
border-radius: 999px;
|
|
1898
|
+
background: var(--bg);
|
|
1899
|
+
color: var(--fg-muted);
|
|
1900
|
+
font-size: var(--ui-font-sm);
|
|
1901
|
+
font-family: "Monaspace Neon", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
|
|
1902
|
+
line-height: 16px;
|
|
1903
|
+
}
|
|
1904
|
+
.history-ref-head {
|
|
1905
|
+
border-color: var(--accent);
|
|
1906
|
+
background: var(--accent-subtle);
|
|
1907
|
+
color: var(--accent);
|
|
1908
|
+
}
|
|
1909
|
+
.history-ref-tag {
|
|
1910
|
+
border-color: color-mix(in srgb, var(--warning, #9a6700) 55%, var(--border));
|
|
1911
|
+
color: var(--warning, #9a6700);
|
|
1912
|
+
}
|
|
1913
|
+
.history-ref-merge {
|
|
1914
|
+
font-style: italic;
|
|
1915
|
+
}
|
|
1916
|
+
/* Rows inside a Shift+click range: tint only, the selected row keeps its
|
|
1917
|
+
accent bar. */
|
|
1918
|
+
.history-item-in-range {
|
|
1919
|
+
background: color-mix(in srgb, var(--accent-subtle) 35%, transparent);
|
|
1920
|
+
}
|
|
1921
|
+
/* Older / newer revision stepper in the file header. Same icon-button idiom
|
|
1922
|
+
as the path copy button; a disabled side only fades (no size change). */
|
|
1923
|
+
.gdp-file-revision-nav {
|
|
1924
|
+
display: inline-flex;
|
|
1925
|
+
gap: 2px;
|
|
1926
|
+
margin-left: 6px;
|
|
1927
|
+
}
|
|
1928
|
+
.gdp-file-revision-btn:disabled {
|
|
1929
|
+
opacity: 0.35;
|
|
1930
|
+
cursor: default;
|
|
1931
|
+
}
|
|
1932
|
+
.gdp-file-revision-btn:disabled:hover {
|
|
1933
|
+
background: transparent;
|
|
1934
|
+
color: var(--fg-muted);
|
|
1935
|
+
}
|
|
1936
|
+
#history-commit-info .hci-actions,
|
|
1937
|
+
.history-commit-info .hci-actions {
|
|
1938
|
+
display: inline-flex;
|
|
1939
|
+
flex-wrap: wrap;
|
|
1940
|
+
align-items: center;
|
|
1941
|
+
gap: 6px;
|
|
1942
|
+
margin-left: auto;
|
|
1943
|
+
}
|
|
1944
|
+
#history-commit-info .hci-copy,
|
|
1945
|
+
.history-commit-info .hci-copy {
|
|
1946
|
+
width: 26px;
|
|
1947
|
+
padding: 0;
|
|
1948
|
+
justify-content: center;
|
|
1949
|
+
}
|
|
1950
|
+
#history-commit-info .hci-copy.copied,
|
|
1951
|
+
.history-commit-info .hci-copy.copied { color: var(--success, var(--accent)); }
|
|
1952
|
+
#history-commit-info .hci-copy.failed,
|
|
1953
|
+
.history-commit-info .hci-copy.failed { color: var(--danger); }
|
|
1954
|
+
#history-commit-info .hci-parent[aria-pressed="true"],
|
|
1955
|
+
.history-commit-info .hci-parent[aria-pressed="true"] {
|
|
1956
|
+
border-color: var(--accent);
|
|
1957
|
+
background: var(--accent-subtle);
|
|
1958
|
+
color: var(--accent);
|
|
1959
|
+
}
|
|
1960
|
+
#history-commit-info .hci-compare-label,
|
|
1961
|
+
.history-commit-info .hci-compare-label {
|
|
1962
|
+
color: var(--fg-muted);
|
|
1963
|
+
font-size: 12px;
|
|
1964
|
+
}
|
|
1859
1965
|
.history-status {
|
|
1860
1966
|
padding: 10px 14px;
|
|
1861
1967
|
color: var(--fg-muted);
|
|
@@ -3725,6 +3831,7 @@ table.d2h-diff-table td.d2h-code-side-linenumber {
|
|
|
3725
3831
|
#line-ref-pill-github-actions[hidden] {
|
|
3726
3832
|
display: none;
|
|
3727
3833
|
}
|
|
3834
|
+
#line-ref-pill-history,
|
|
3728
3835
|
#line-ref-pill-github-open,
|
|
3729
3836
|
#line-ref-pill-github-copy {
|
|
3730
3837
|
display: inline-flex;
|
|
@@ -10464,6 +10571,14 @@ body.journal-task-editor-resizing * {
|
|
|
10464
10571
|
.db-grid-header-wrap {
|
|
10465
10572
|
flex-shrink: 0;
|
|
10466
10573
|
overflow: hidden;
|
|
10574
|
+
/* 本文 (.db-grid-viewport) の縦スクロールバーが食う幅を、右端に透明な
|
|
10575
|
+
border として空ける。空けないと「見える幅」が本文だけ狭くなり、本文が
|
|
10576
|
+
右へ余分にスクロールできてしまう。ヘッダは scrollLeft を同期しても
|
|
10577
|
+
そこまで追随できず、右端で列がスクロールバー幅ぶんずれる。
|
|
10578
|
+
scrollbar-gutter は overflow:hidden だと見た目の幅しか縮まず、
|
|
10579
|
+
スクロール範囲は縮まないので使えない (実測済み)。
|
|
10580
|
+
幅は table-grid.ts が実測して --db-grid-scrollbar-w に入れる。 */
|
|
10581
|
+
border-right: var(--db-grid-scrollbar-w, 0px) solid transparent;
|
|
10467
10582
|
border-bottom: 2px solid var(--border);
|
|
10468
10583
|
background: var(--bg-soft);
|
|
10469
10584
|
}
|
|
@@ -10508,6 +10623,20 @@ body.journal-task-editor-resizing * {
|
|
|
10508
10623
|
flex: 1;
|
|
10509
10624
|
overflow: auto;
|
|
10510
10625
|
position: relative;
|
|
10626
|
+
/* 行が少なくて縦スクロールバーが出ないときも幅を変えない。ここを可変に
|
|
10627
|
+
すると、ヘッダ / フィルタ行に渡す --db-grid-scrollbar-w が行数やフィルタで
|
|
10628
|
+
変わり、列の位置が動く。 */
|
|
10629
|
+
scrollbar-gutter: stable;
|
|
10630
|
+
}
|
|
10631
|
+
/* 矢印キーでセルを移動するため viewport 自体がフォーカスを受け取る
|
|
10632
|
+
(tabIndex=0)。セルをクリックするたびに枠が出ると常時ノイズになるので、
|
|
10633
|
+
キーボードで到達したときだけリングを出す。親の .db-grid が
|
|
10634
|
+
overflow:hidden なので外側に描くと切れる → inset で内側に描く。 */
|
|
10635
|
+
.db-grid-viewport:focus {
|
|
10636
|
+
outline: none;
|
|
10637
|
+
}
|
|
10638
|
+
.db-grid-viewport:focus-visible {
|
|
10639
|
+
box-shadow: inset var(--db-focus-ring);
|
|
10511
10640
|
}
|
|
10512
10641
|
|
|
10513
10642
|
.db-grid-spacer {
|
|
@@ -11097,6 +11226,8 @@ html[data-theme="dark"] .db-schema-table tr.pk-row {
|
|
|
11097
11226
|
.db-grid-filter-row-wrap {
|
|
11098
11227
|
flex-shrink: 0;
|
|
11099
11228
|
overflow: hidden;
|
|
11229
|
+
/* ヘッダと同じ理由でスクロールバー幅を空ける (.db-grid-header-wrap 参照)。 */
|
|
11230
|
+
border-right: var(--db-grid-scrollbar-w, 0px) solid transparent;
|
|
11100
11231
|
border-bottom: 1px solid var(--border);
|
|
11101
11232
|
background: var(--bg-soft);
|
|
11102
11233
|
}
|
|
@@ -11276,6 +11407,23 @@ html[data-theme="dark"] .db-schema-table tr.pk-row {
|
|
|
11276
11407
|
white-space: pre-wrap;
|
|
11277
11408
|
word-break: break-word;
|
|
11278
11409
|
}
|
|
11410
|
+
/* shiki は `<span style="--shiki-light:#xxx;--shiki-dark:#yyy">` の inline
|
|
11411
|
+
CSS 変数で token 色を出すので、light / dark でそれぞれ参照する。
|
|
11412
|
+
明示テーマ (html[data-theme]) を OS 設定より後に置いて優先させる。 */
|
|
11413
|
+
.db-grid-detail-json span[style] {
|
|
11414
|
+
color: var(--shiki-light);
|
|
11415
|
+
}
|
|
11416
|
+
@media (prefers-color-scheme: dark) {
|
|
11417
|
+
.db-grid-detail-json span[style] {
|
|
11418
|
+
color: var(--shiki-dark);
|
|
11419
|
+
}
|
|
11420
|
+
}
|
|
11421
|
+
html[data-theme="light"] .db-grid-detail-json span[style] {
|
|
11422
|
+
color: var(--shiki-light);
|
|
11423
|
+
}
|
|
11424
|
+
html[data-theme="dark"] .db-grid-detail-json span[style] {
|
|
11425
|
+
color: var(--shiki-dark);
|
|
11426
|
+
}
|
|
11279
11427
|
|
|
11280
11428
|
/* ---------- Foreign-key related data ---------- */
|
|
11281
11429
|
.db-grid-header-fk-icon {
|
|
@@ -11373,13 +11521,32 @@ html[data-theme="dark"] .db-schema-table tr.pk-row {
|
|
|
11373
11521
|
}
|
|
11374
11522
|
|
|
11375
11523
|
.db-related-list {
|
|
11376
|
-
|
|
11524
|
+
/* 既定 / 下限 / 上限は table-grid.ts が持つ。ここは JS 実行前の初回描画用の
|
|
11525
|
+
fallback だけ (ui-layout: CSS と TS に同じ数値を書かない)。 */
|
|
11526
|
+
width: var(--db-related-list-w, 200px);
|
|
11377
11527
|
flex-shrink: 0;
|
|
11378
11528
|
overflow: auto;
|
|
11379
|
-
border-right: 1px solid var(--border);
|
|
11380
11529
|
padding: 4px;
|
|
11381
11530
|
}
|
|
11382
11531
|
|
|
11532
|
+
/* リストとグリッドの間の掴みしろ。境界線の役目も兼ねるので、リスト側の
|
|
11533
|
+
border-right はこちらへ移してある (二重線にしない)。 */
|
|
11534
|
+
.db-related-list-resize {
|
|
11535
|
+
flex: 0 0 auto;
|
|
11536
|
+
width: 5px;
|
|
11537
|
+
cursor: col-resize;
|
|
11538
|
+
background: var(--border);
|
|
11539
|
+
background-clip: content-box;
|
|
11540
|
+
border-left: 2px solid transparent;
|
|
11541
|
+
border-right: 2px solid transparent;
|
|
11542
|
+
}
|
|
11543
|
+
.db-related-list-resize:hover,
|
|
11544
|
+
.db-related-list-resize:focus-visible,
|
|
11545
|
+
.db-related-panel.db-related-list-resizing .db-related-list-resize {
|
|
11546
|
+
background: var(--accent);
|
|
11547
|
+
outline: none;
|
|
11548
|
+
}
|
|
11549
|
+
|
|
11383
11550
|
.db-related-list-item {
|
|
11384
11551
|
display: flex;
|
|
11385
11552
|
flex-direction: column;
|
|
@@ -11410,6 +11577,17 @@ html[data-theme="dark"] .db-schema-table tr.pk-row {
|
|
|
11410
11577
|
display: inline-flex;
|
|
11411
11578
|
align-items: baseline;
|
|
11412
11579
|
gap: 6px;
|
|
11580
|
+
/* 項目の幅を超えたら省略記号にする。min-width:0 が無いと flex 子は
|
|
11581
|
+
内容幅より縮まず、はみ出したまま折り返す。 */
|
|
11582
|
+
max-width: 100%;
|
|
11583
|
+
min-width: 0;
|
|
11584
|
+
}
|
|
11585
|
+
|
|
11586
|
+
.db-related-list-table {
|
|
11587
|
+
min-width: 0;
|
|
11588
|
+
overflow: hidden;
|
|
11589
|
+
text-overflow: ellipsis;
|
|
11590
|
+
white-space: nowrap;
|
|
11413
11591
|
}
|
|
11414
11592
|
/* 方向アイコンを name の前に出す: outgoing は → (自分→他テーブル)、
|
|
11415
11593
|
incoming は ← (他テーブル→自分の PK)。テキスト 1 文字なのでフォントに
|
|
@@ -11430,7 +11608,12 @@ html[data-theme="dark"] .db-schema-table tr.pk-row {
|
|
|
11430
11608
|
.db-related-list-via {
|
|
11431
11609
|
font-size: 11px;
|
|
11432
11610
|
color: var(--fg-muted);
|
|
11433
|
-
|
|
11611
|
+
/* break-all だと "sample_association_table.sa / mple_column_id = 12" の
|
|
11612
|
+
ように語の途中で折り返って読めなくなる。1 行で省略し、全文は title で出す。 */
|
|
11613
|
+
max-width: 100%;
|
|
11614
|
+
overflow: hidden;
|
|
11615
|
+
text-overflow: ellipsis;
|
|
11616
|
+
white-space: nowrap;
|
|
11434
11617
|
}
|
|
11435
11618
|
|
|
11436
11619
|
.db-related-grid-host {
|
|
@@ -14938,6 +15121,7 @@ body.app-panel-docked .app-panel.app-panel-open {
|
|
|
14938
15121
|
`web-src/test/docked-page-height.test.ts`。 */
|
|
14939
15122
|
|
|
14940
15123
|
.tools-sheet,
|
|
15124
|
+
.search-sheet,
|
|
14941
15125
|
.terminal-sheet {
|
|
14942
15126
|
flex: 1 1 auto;
|
|
14943
15127
|
min-width: 0;
|
|
@@ -14950,9 +15134,42 @@ body.app-panel-docked .app-panel.app-panel-open {
|
|
|
14950
15134
|
/* パネルの中ではタブで 1 つだけ出す。閉じている側は本当に消す
|
|
14951
15135
|
(右ドロワーの頃はスライドのために display を残していた)。 */
|
|
14952
15136
|
.tools-sheet[hidden],
|
|
15137
|
+
.search-sheet[hidden],
|
|
14953
15138
|
.terminal-sheet[hidden] {
|
|
14954
15139
|
display: none;
|
|
14955
15140
|
}
|
|
15141
|
+
/* Search results sheet: query row, palette-style controls, scrolling list. */
|
|
15142
|
+
.search-results-head {
|
|
15143
|
+
display: flex;
|
|
15144
|
+
align-items: center;
|
|
15145
|
+
gap: 8px;
|
|
15146
|
+
flex: 0 0 auto;
|
|
15147
|
+
padding: 6px 10px 0;
|
|
15148
|
+
}
|
|
15149
|
+
.search-results-input {
|
|
15150
|
+
flex: 1 1 auto;
|
|
15151
|
+
min-width: 0;
|
|
15152
|
+
height: var(--ui-control-md);
|
|
15153
|
+
border: 1px solid var(--border);
|
|
15154
|
+
border-radius: 8px;
|
|
15155
|
+
background: var(--bg);
|
|
15156
|
+
color: var(--fg);
|
|
15157
|
+
font: inherit;
|
|
15158
|
+
font-size: var(--ui-font-md);
|
|
15159
|
+
padding: 0 10px;
|
|
15160
|
+
outline: none;
|
|
15161
|
+
}
|
|
15162
|
+
.search-results-input:focus {
|
|
15163
|
+
border-color: var(--accent);
|
|
15164
|
+
box-shadow: 0 0 0 3px var(--accent-muted);
|
|
15165
|
+
}
|
|
15166
|
+
.search-results-controls { padding: 6px 10px 0; }
|
|
15167
|
+
.search-results-status { padding: 6px 10px; }
|
|
15168
|
+
.search-results-list {
|
|
15169
|
+
flex: 1 1 auto;
|
|
15170
|
+
min-height: 0;
|
|
15171
|
+
overflow: auto;
|
|
15172
|
+
}
|
|
14956
15173
|
|
|
14957
15174
|
/* ドロワー左端の掴みしろ。annotation パネルのリサイザーと同じ作り (境界を
|
|
14958
15175
|
またぐ 8px の透明な帯) だが、ドロワーが画面の大半を覆って端が分かりにくい
|