@youtyan/code-viewer 0.1.25 → 0.1.27
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 +7 -13
- package/dist/code-viewer.js +449 -60
- package/package.json +1 -1
- package/web/app.js +594 -49
- package/web/index.html +5 -2
- package/web/style.css +144 -12
package/web/index.html
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<header id="global-header">
|
|
22
22
|
<a class="brand" href="/" aria-label="Repository home">
|
|
23
23
|
<img class="brand-icon" src="/favicon.png" alt="" width="20" height="20" />
|
|
24
|
-
<span class="title">
|
|
24
|
+
<span class="title" id="project-title">repository</span>
|
|
25
25
|
</a>
|
|
26
26
|
<nav class="app-menu" aria-label="Views">
|
|
27
27
|
<a class="app-menu-item active" data-route="repo" href="/">Repository</a>
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
<button id="theme" title="toggle theme">🌗</button>
|
|
33
33
|
<span id="status" class="status"></span>
|
|
34
34
|
<a class="global-help-link" data-route="help" href="/help">Help</a>
|
|
35
|
+
<span class="product-label" aria-hidden="true">code viewer</span>
|
|
35
36
|
</div>
|
|
36
37
|
</header>
|
|
37
38
|
<header id="topbar">
|
|
@@ -124,7 +125,9 @@
|
|
|
124
125
|
<div class="scope-settings-section">
|
|
125
126
|
<strong class="scope-settings-section-title">Excluded directories</strong>
|
|
126
127
|
<label for="scope-omit-dirs">Skip these directory names while browsing and searching</label>
|
|
127
|
-
<textarea id="scope-omit-dirs" rows="
|
|
128
|
+
<textarea id="scope-omit-dirs" rows="6" spellcheck="false"></textarea>
|
|
129
|
+
<label for="scope-exclude-names">Hide these file or directory names completely</label>
|
|
130
|
+
<textarea id="scope-exclude-names" rows="4" spellcheck="false"></textarea>
|
|
128
131
|
<p id="scope-omit-source"></p>
|
|
129
132
|
<div class="scope-settings-actions">
|
|
130
133
|
<button id="scope-omit-reset" type="button">Reset</button>
|
package/web/style.css
CHANGED
|
@@ -101,6 +101,7 @@ html, body {
|
|
|
101
101
|
margin: 0; padding: 0;
|
|
102
102
|
background: var(--bg); color: var(--fg);
|
|
103
103
|
--code-font-size: 12px;
|
|
104
|
+
--markdown-font-size: calc(var(--code-font-size) + 2px);
|
|
104
105
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
|
|
105
106
|
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
|
106
107
|
font-size: 14px;
|
|
@@ -282,9 +283,11 @@ body[data-code-font-size="xlarge"] { --code-font-size: 15px; }
|
|
|
282
283
|
.brand {
|
|
283
284
|
display: flex; align-items: center; gap: 9px;
|
|
284
285
|
font-weight: 600;
|
|
285
|
-
font-size:
|
|
286
|
+
font-size: 15px;
|
|
286
287
|
color: var(--fg);
|
|
287
|
-
|
|
288
|
+
min-width: 0;
|
|
289
|
+
max-width: min(34vw, 420px);
|
|
290
|
+
flex: 0 1 auto;
|
|
288
291
|
text-decoration: none;
|
|
289
292
|
}
|
|
290
293
|
.brand:hover { color: var(--fg); text-decoration: none; }
|
|
@@ -294,7 +297,12 @@ body[data-code-font-size="xlarge"] { --code-font-size: 15px; }
|
|
|
294
297
|
display: block;
|
|
295
298
|
border-radius: 5px;
|
|
296
299
|
}
|
|
297
|
-
.brand .title {
|
|
300
|
+
.brand .title {
|
|
301
|
+
min-width: 0;
|
|
302
|
+
overflow: hidden;
|
|
303
|
+
text-overflow: ellipsis;
|
|
304
|
+
white-space: nowrap;
|
|
305
|
+
}
|
|
298
306
|
|
|
299
307
|
.app-menu {
|
|
300
308
|
display: flex;
|
|
@@ -366,6 +374,13 @@ body[data-code-font-size="xlarge"] { --code-font-size: 15px; }
|
|
|
366
374
|
gap: 8px;
|
|
367
375
|
flex: 0 0 auto;
|
|
368
376
|
}
|
|
377
|
+
.product-label {
|
|
378
|
+
color: var(--fg-muted);
|
|
379
|
+
font-size: 12px;
|
|
380
|
+
font-weight: 600;
|
|
381
|
+
line-height: 1;
|
|
382
|
+
white-space: nowrap;
|
|
383
|
+
}
|
|
369
384
|
.global-actions #theme,
|
|
370
385
|
.global-icon-action {
|
|
371
386
|
display: inline-flex;
|
|
@@ -1171,10 +1186,11 @@ body.gdp-resizing * { user-select: none !important; }
|
|
|
1171
1186
|
font: inherit;
|
|
1172
1187
|
font-size: 12.5px;
|
|
1173
1188
|
}
|
|
1174
|
-
#scope-omit-dirs
|
|
1189
|
+
#scope-omit-dirs,
|
|
1190
|
+
#scope-exclude-names {
|
|
1175
1191
|
box-sizing: border-box;
|
|
1176
1192
|
width: 100%;
|
|
1177
|
-
min-height:
|
|
1193
|
+
min-height: 110px;
|
|
1178
1194
|
resize: vertical;
|
|
1179
1195
|
border: 1px solid var(--border-muted);
|
|
1180
1196
|
border-radius: 6px;
|
|
@@ -2297,6 +2313,12 @@ table.d2h-diff-table tr.gdp-diff-line-target > td:first-child {
|
|
|
2297
2313
|
.gdp-upload-panel.failed {
|
|
2298
2314
|
border-color: var(--danger);
|
|
2299
2315
|
}
|
|
2316
|
+
.gdp-upload-error {
|
|
2317
|
+
min-height: 18px;
|
|
2318
|
+
color: var(--danger);
|
|
2319
|
+
font-size: 12px;
|
|
2320
|
+
line-height: 18px;
|
|
2321
|
+
}
|
|
2300
2322
|
.gdp-upload-copy {
|
|
2301
2323
|
min-width: 0;
|
|
2302
2324
|
color: var(--fg-muted);
|
|
@@ -2541,6 +2563,7 @@ table.d2h-diff-table tr.gdp-diff-line-target > td:first-child {
|
|
|
2541
2563
|
display: flex;
|
|
2542
2564
|
align-items: center;
|
|
2543
2565
|
min-width: 0;
|
|
2566
|
+
flex: 0 1 auto;
|
|
2544
2567
|
gap: 4px;
|
|
2545
2568
|
padding-top: 2px;
|
|
2546
2569
|
overflow: hidden;
|
|
@@ -2590,6 +2613,13 @@ table.d2h-diff-table tr.gdp-diff-line-target > td:first-child {
|
|
|
2590
2613
|
flex-shrink: 0;
|
|
2591
2614
|
color: var(--fg-muted);
|
|
2592
2615
|
}
|
|
2616
|
+
.gdp-file-detail-header .gdp-trash-path {
|
|
2617
|
+
flex-shrink: 0;
|
|
2618
|
+
color: var(--danger);
|
|
2619
|
+
}
|
|
2620
|
+
.gdp-file-detail-header .gdp-create-dir {
|
|
2621
|
+
flex-shrink: 0;
|
|
2622
|
+
}
|
|
2593
2623
|
.gdp-file-detail-meta {
|
|
2594
2624
|
display: flex;
|
|
2595
2625
|
align-items: center;
|
|
@@ -2629,7 +2659,7 @@ table.d2h-diff-table tr.gdp-diff-line-target > td:first-child {
|
|
|
2629
2659
|
padding: 24px 32px 40px;
|
|
2630
2660
|
color: var(--fg);
|
|
2631
2661
|
overflow-wrap: break-word;
|
|
2632
|
-
font-size:
|
|
2662
|
+
font-size: var(--markdown-font-size);
|
|
2633
2663
|
line-height: 1.75;
|
|
2634
2664
|
}
|
|
2635
2665
|
.gdp-html-preview {
|
|
@@ -2692,7 +2722,7 @@ table.d2h-diff-table tr.gdp-diff-line-target > td:first-child {
|
|
|
2692
2722
|
margin: 0;
|
|
2693
2723
|
}
|
|
2694
2724
|
.gdp-markdown-toc a {
|
|
2695
|
-
display:
|
|
2725
|
+
display: block;
|
|
2696
2726
|
min-height: 28px;
|
|
2697
2727
|
padding: 5px 10px 5px 12px;
|
|
2698
2728
|
border-left: 3px solid transparent;
|
|
@@ -2701,8 +2731,6 @@ table.d2h-diff-table tr.gdp-diff-line-target > td:first-child {
|
|
|
2701
2731
|
overflow: hidden;
|
|
2702
2732
|
overflow-wrap: anywhere;
|
|
2703
2733
|
text-decoration: none;
|
|
2704
|
-
-webkit-box-orient: vertical;
|
|
2705
|
-
-webkit-line-clamp: 2;
|
|
2706
2734
|
transition:
|
|
2707
2735
|
background-color 0.06s ease,
|
|
2708
2736
|
border-color 0.06s ease,
|
|
@@ -2736,6 +2764,14 @@ table.d2h-diff-table tr.gdp-diff-line-target > td:first-child {
|
|
|
2736
2764
|
font-weight: 600;
|
|
2737
2765
|
}
|
|
2738
2766
|
.gdp-markdown-preview h1,
|
|
2767
|
+
.gdp-markdown-preview h2,
|
|
2768
|
+
.gdp-markdown-preview h3,
|
|
2769
|
+
.gdp-markdown-preview h4,
|
|
2770
|
+
.gdp-markdown-preview h5,
|
|
2771
|
+
.gdp-markdown-preview h6 {
|
|
2772
|
+
scroll-margin-top: calc(var(--global-header-h) + 120px);
|
|
2773
|
+
}
|
|
2774
|
+
.gdp-markdown-preview h1,
|
|
2739
2775
|
.gdp-markdown-preview h2 {
|
|
2740
2776
|
padding-bottom: 0.3em;
|
|
2741
2777
|
border-bottom: 1px solid var(--border-muted);
|
|
@@ -3136,9 +3172,6 @@ body.gdp-file-detail-page #empty {
|
|
|
3136
3172
|
padding-left: 0;
|
|
3137
3173
|
padding-right: 0;
|
|
3138
3174
|
}
|
|
3139
|
-
.gdp-repo-breadcrumb {
|
|
3140
|
-
flex: 1;
|
|
3141
|
-
}
|
|
3142
3175
|
.gdp-repo-breadcrumb button {
|
|
3143
3176
|
max-width: 260px;
|
|
3144
3177
|
border: 0;
|
|
@@ -3257,6 +3290,105 @@ body.gdp-file-detail-page #empty {
|
|
|
3257
3290
|
font-size: 12px;
|
|
3258
3291
|
white-space: nowrap;
|
|
3259
3292
|
}
|
|
3293
|
+
.gdp-context-menu {
|
|
3294
|
+
position: fixed;
|
|
3295
|
+
z-index: 1000;
|
|
3296
|
+
min-width: 180px;
|
|
3297
|
+
padding: 6px;
|
|
3298
|
+
border: 1px solid var(--border);
|
|
3299
|
+
border-radius: 6px;
|
|
3300
|
+
background: var(--bg);
|
|
3301
|
+
box-shadow: 0 8px 24px rgba(31, 35, 40, 0.18);
|
|
3302
|
+
}
|
|
3303
|
+
.gdp-context-menu button {
|
|
3304
|
+
width: 100%;
|
|
3305
|
+
min-height: 30px;
|
|
3306
|
+
padding: 5px 8px;
|
|
3307
|
+
border: 0;
|
|
3308
|
+
border-radius: 4px;
|
|
3309
|
+
background: transparent;
|
|
3310
|
+
color: var(--fg);
|
|
3311
|
+
font: inherit;
|
|
3312
|
+
font-size: 13px;
|
|
3313
|
+
text-align: left;
|
|
3314
|
+
cursor: pointer;
|
|
3315
|
+
}
|
|
3316
|
+
.gdp-context-menu button:hover {
|
|
3317
|
+
background: var(--bg-soft);
|
|
3318
|
+
}
|
|
3319
|
+
.gdp-context-menu .danger {
|
|
3320
|
+
color: var(--danger);
|
|
3321
|
+
}
|
|
3322
|
+
.gdp-trash-dialog-backdrop {
|
|
3323
|
+
position: fixed;
|
|
3324
|
+
inset: 0;
|
|
3325
|
+
z-index: 1100;
|
|
3326
|
+
display: flex;
|
|
3327
|
+
align-items: flex-start;
|
|
3328
|
+
justify-content: center;
|
|
3329
|
+
padding-top: min(14vh, 120px);
|
|
3330
|
+
background: rgba(31, 35, 40, 0.18);
|
|
3331
|
+
}
|
|
3332
|
+
[data-theme="dark"] .gdp-trash-dialog-backdrop {
|
|
3333
|
+
background: rgba(1, 4, 9, 0.45);
|
|
3334
|
+
}
|
|
3335
|
+
.gdp-trash-dialog {
|
|
3336
|
+
width: min(420px, calc(100vw - 32px));
|
|
3337
|
+
border: 1px solid var(--border);
|
|
3338
|
+
border-radius: 8px;
|
|
3339
|
+
background: var(--bg);
|
|
3340
|
+
box-shadow: 0 16px 48px rgba(31, 35, 40, 0.28);
|
|
3341
|
+
}
|
|
3342
|
+
.gdp-trash-dialog-title {
|
|
3343
|
+
padding: 14px 16px 0;
|
|
3344
|
+
color: var(--fg);
|
|
3345
|
+
font-size: 15px;
|
|
3346
|
+
font-weight: 600;
|
|
3347
|
+
}
|
|
3348
|
+
.gdp-trash-dialog-body {
|
|
3349
|
+
padding: 8px 16px 14px;
|
|
3350
|
+
color: var(--fg-muted);
|
|
3351
|
+
font-size: 13px;
|
|
3352
|
+
line-height: 1.5;
|
|
3353
|
+
overflow-wrap: anywhere;
|
|
3354
|
+
}
|
|
3355
|
+
.gdp-create-dir-input {
|
|
3356
|
+
display: block;
|
|
3357
|
+
width: 100%;
|
|
3358
|
+
height: 32px;
|
|
3359
|
+
margin-top: 10px;
|
|
3360
|
+
padding: 0 10px;
|
|
3361
|
+
border: 1px solid var(--border);
|
|
3362
|
+
border-radius: 6px;
|
|
3363
|
+
background: var(--bg);
|
|
3364
|
+
color: var(--fg);
|
|
3365
|
+
font: inherit;
|
|
3366
|
+
}
|
|
3367
|
+
.gdp-create-dir-input:focus {
|
|
3368
|
+
outline: 2px solid var(--accent-subtle);
|
|
3369
|
+
border-color: var(--accent);
|
|
3370
|
+
}
|
|
3371
|
+
.gdp-create-dir-error {
|
|
3372
|
+
min-height: 18px;
|
|
3373
|
+
margin-top: 6px;
|
|
3374
|
+
color: var(--danger);
|
|
3375
|
+
font-size: 12px;
|
|
3376
|
+
line-height: 18px;
|
|
3377
|
+
}
|
|
3378
|
+
.gdp-trash-dialog-actions {
|
|
3379
|
+
display: flex;
|
|
3380
|
+
justify-content: flex-end;
|
|
3381
|
+
gap: 8px;
|
|
3382
|
+
padding: 12px 16px;
|
|
3383
|
+
border-top: 1px solid var(--border-muted);
|
|
3384
|
+
}
|
|
3385
|
+
.gdp-trash-dialog-danger {
|
|
3386
|
+
border-color: var(--danger);
|
|
3387
|
+
color: var(--danger);
|
|
3388
|
+
}
|
|
3389
|
+
.gdp-trash-dialog-danger:hover {
|
|
3390
|
+
background: var(--diff-del-bg);
|
|
3391
|
+
}
|
|
3260
3392
|
.gdp-repo-empty {
|
|
3261
3393
|
padding: 32px;
|
|
3262
3394
|
color: var(--fg-muted);
|