@youtyan/code-viewer 0.14.0 → 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 +50 -4
- package/dist/code-viewer.js +526 -99
- package/package.json +1 -1
- package/web/app.js +1949 -527
- package/web/index.html +3 -0
- package/web/style.css +142 -1
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;
|
|
@@ -15014,6 +15121,7 @@ body.app-panel-docked .app-panel.app-panel-open {
|
|
|
15014
15121
|
`web-src/test/docked-page-height.test.ts`。 */
|
|
15015
15122
|
|
|
15016
15123
|
.tools-sheet,
|
|
15124
|
+
.search-sheet,
|
|
15017
15125
|
.terminal-sheet {
|
|
15018
15126
|
flex: 1 1 auto;
|
|
15019
15127
|
min-width: 0;
|
|
@@ -15026,9 +15134,42 @@ body.app-panel-docked .app-panel.app-panel-open {
|
|
|
15026
15134
|
/* パネルの中ではタブで 1 つだけ出す。閉じている側は本当に消す
|
|
15027
15135
|
(右ドロワーの頃はスライドのために display を残していた)。 */
|
|
15028
15136
|
.tools-sheet[hidden],
|
|
15137
|
+
.search-sheet[hidden],
|
|
15029
15138
|
.terminal-sheet[hidden] {
|
|
15030
15139
|
display: none;
|
|
15031
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
|
+
}
|
|
15032
15173
|
|
|
15033
15174
|
/* ドロワー左端の掴みしろ。annotation パネルのリサイザーと同じ作り (境界を
|
|
15034
15175
|
またぐ 8px の透明な帯) だが、ドロワーが画面の大半を覆って端が分かりにくい
|