Add icons to browser file tree

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
Rūdolfs Ošiņš
2023-08-28 12:03:19 +02:00
parent ea1f23c4a2
commit 3bd13196d9
6 changed files with 254 additions and 198 deletions
+193 -160
View File
@@ -20,6 +20,9 @@
| "ellipsis"
| "exclamation"
| "exclamation-circle"
| "file"
| "folder"
| "folder-open"
| "fork"
| "gear"
| "issue"
@@ -27,8 +30,7 @@
| "moon"
| "network"
| "patch"
| "sun"
| "twitter";
| "sun";
</script>
<style>
@@ -63,6 +65,98 @@
14.4512 16.8417 14.6464 16.6464L18.9393 12.3536C19.1346 12.1583 19.1346
11.8417 18.9393 11.6464L14.6464 7.35355C14.4512 7.15829 14.4512 6.84171
14.6464 6.64645Z" />
{:else if name === "chat"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M5 6.5C4.72386 6.5 4.5
6.72386 4.5 7V16C4.5 16.2761 4.72386 16.5 5 16.5H14.5147C16.2386 16.5 17.8919
17.1848 19.1109 18.4038L19.5 18.7929V7C19.5 6.72386 19.2761 6.5 19 6.5H5ZM3.5
7C3.5 6.17157 4.17157 5.5 5 5.5H19C19.8284 5.5 20.5 6.17157 20.5 7V20C20.5
20.2022 20.3782 20.3845 20.1913 20.4619C20.0045 20.5393 19.7894 20.4966
19.6464 20.3536L18.4038 19.1109C17.3724 18.0795 15.9734 17.5 14.5147
17.5H5C4.17157 17.5 3.5 16.8284 3.5 16V7ZM7.5 10C7.5 9.72386 7.72386 9.5 8
9.5H16C16.2761 9.5 16.5 9.72386 16.5 10C16.5 10.2761 16.2761 10.5 16
10.5H8C7.72386 10.5 7.5 10.2761 7.5 10ZM7.5 13C7.5 12.7239 7.72386 12.5 8
12.5H13C13.2761 12.5 13.5 12.7239 13.5 13C13.5 13.2761 13.2761 13.5 13
13.5H8C7.72386 13.5 7.5 13.2761 7.5 13Z" />
{:else if name === "checkmark"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M18.2941 6.59564C18.5174 6.75806 18.5668 7.07076 18.4044
7.29409L11.781 16.4012C10.8775 17.6436 9.07768 17.7848 7.99142
16.6985L5.64645 14.3536C5.45118 14.1583 5.45118 13.8417 5.64645
13.6465C5.84171 13.4512 6.15829 13.4512 6.35355 13.6465L8.69852
15.9914C9.35028 16.6432 10.4302 16.5584 10.9723 15.813L17.5956
6.70592C17.7581 6.48259 18.0708 6.43322 18.2941 6.59564Z" />
{:else if name === "checkmark-small"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M16.2481 8.56588C16.4878 8.70288 16.5711 9.00831 16.4341
9.24807L13.0837 15.1113C12.593 15.9701 11.42 16.1271 10.7207
15.4278L8.64645 13.3536C8.45118 13.1583 8.45118 12.8417 8.64645
12.6464C8.84171 12.4512 9.15829 12.4512 9.35355 12.6464L11.4278
14.7207C11.6609 14.9538 12.0519 14.9014 12.2154 14.6152L15.5659
8.75193C15.7029 8.51217 16.0083 8.42887 16.2481 8.56588Z" />
{:else if name === "chevron-down"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M16.3536 9.64645C16.5488 9.84171 16.5488 10.1583 16.3536
10.3536L13.0607 13.6464C12.4749 14.2322 11.5251 14.2322 10.9393
13.6464L7.64645 10.3536C7.45118 10.1583 7.45118 9.84171 7.64645
9.64645C7.84171 9.45118 8.15829 9.45118 8.35355 9.64645L11.6464
12.9393C11.8417 13.1346 12.1583 13.1346 12.3536 12.9393L15.6464
9.64645C15.8417 9.45118 16.1583 9.45118 16.3536 9.64645Z" />
{:else if name === "chevron-left"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M14.3536 16.3536C14.1583 16.5488 13.8417 16.5488 13.6464
16.3536L10.3536 13.0607C9.76777 12.4749 9.76777 11.5251 10.3536
10.9393L13.6464 7.64645C13.8417 7.45119 14.1583 7.45119 14.3536
7.64645C14.5488 7.84171 14.5488 8.15829 14.3536 8.35355L11.0607
11.6464C10.8654 11.8417 10.8654 12.1583 11.0607 12.3536L14.3536
15.6464C14.5488 15.8417 14.5488 16.1583 14.3536 16.3536Z" />
{:else if name === "chevron-left-right"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M9.35353 6.64645C9.54879 6.84171 9.54879 7.15829 9.35353
7.35355L5.06064 11.6465L5.06062 11.6465C4.86537 11.8417 4.86537 12.1583
5.06062 12.3535L5.06064 12.3535L9.35353 16.6464C9.54879 16.8417 9.54879
17.1583 9.35353 17.3536C9.15826 17.5488 8.84168 17.5488 8.64642
17.3536L4.35354 13.0607C3.76774 12.4749 3.76773 11.5251 4.35353
10.9393C4.35353 10.9393 4.35354 10.9393 4.35354 10.9393L8.64642
6.64645C8.84168 6.45118 9.15826 6.45118 9.35353 6.64645ZM14.6464
6.64645C14.8417 6.45118 15.1583 6.45118 15.3535 6.64645L19.6464
10.9393C20.2322 11.5251 20.2322 12.4749 19.6464 13.0607L15.3535
17.3536C15.1583 17.5488 14.8417 17.5488 14.6464 17.3536C14.4512 17.1583
14.4512 16.8417 14.6464 16.6464L18.9393 12.3535C19.1346 12.1583 19.1346
11.8417 18.9393 11.6465L14.6464 7.35355C14.4512 7.15829 14.4512 6.84171
14.6464 6.64645Z" />
{:else if name === "chevron-right"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M9.64645 7.64645C9.84171 7.45118 10.1583 7.45118 10.3536
7.64645L13.6464 10.9393C14.2322 11.5251 14.2322 12.4749 13.6464
13.0607L10.3536 16.3536C10.1583 16.5488 9.84171 16.5488 9.64645
16.3536C9.45118 16.1583 9.45118 15.8417 9.64645 15.6464L12.9393
12.3536C13.1346 12.1583 13.1346 11.8417 12.9393 11.6464L9.64645
8.35355C9.45118 8.15829 9.45118 7.84171 9.64645 7.64645Z" />
{:else if name === "chevron-up"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M7.64645 14.3536C7.45118 14.1583 7.45118 13.8417 7.64645
13.6464L10.9393 10.3536C11.5251 9.76777 12.4749 9.76777 13.0607
10.3536L16.3536 13.6464C16.5488 13.8417 16.5488 14.1583 16.3536
14.3536C16.1583 14.5488 15.8417 14.5488 15.6464 14.3536L12.3536
11.0607C12.1583 10.8654 11.8417 10.8654 11.6464 11.0607L8.35355
14.3536C8.15829 14.5488 7.84171 14.5488 7.64645 14.3536Z" />
{:else if name === "clipboard"}
<path
fill-rule="evenodd"
@@ -99,21 +193,18 @@
10 12.5V10ZM11.5 13C11.2239 13 11 12.7761 11 12.5V6.5C11 6.22386 11.2239
6 11.5 6H17.5C17.7761 6 18 6.22386 18 6.5V12.5C18 12.7761 17.7761 13 17.5
13H11.5Z" />
{:else if name === "chat"}
{:else if name === "cross"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M5 6.5C4.72386 6.5 4.5
6.72386 4.5 7V16C4.5 16.2761 4.72386 16.5 5 16.5H14.5147C16.2386 16.5 17.8919
17.1848 19.1109 18.4038L19.5 18.7929V7C19.5 6.72386 19.2761 6.5 19 6.5H5ZM3.5
7C3.5 6.17157 4.17157 5.5 5 5.5H19C19.8284 5.5 20.5 6.17157 20.5 7V20C20.5
20.2022 20.3782 20.3845 20.1913 20.4619C20.0045 20.5393 19.7894 20.4966
19.6464 20.3536L18.4038 19.1109C17.3724 18.0795 15.9734 17.5 14.5147
17.5H5C4.17157 17.5 3.5 16.8284 3.5 16V7ZM7.5 10C7.5 9.72386 7.72386 9.5 8
9.5H16C16.2761 9.5 16.5 9.72386 16.5 10C16.5 10.2761 16.2761 10.5 16
10.5H8C7.72386 10.5 7.5 10.2761 7.5 10ZM7.5 13C7.5 12.7239 7.72386 12.5 8
12.5H13C13.2761 12.5 13.5 12.7239 13.5 13C13.5 13.2761 13.2761 13.5 13
13.5H8C7.72386 13.5 7.5 13.2761 7.5 13Z" />
d="M5.64645 5.64645C5.84171 5.45118 6.15829 5.45118 6.35355 5.64645L12
11.2929L17.6464 5.64645C17.8417 5.45118 18.1583 5.45118 18.3536
5.64645C18.5488 5.84171 18.5488 6.15829 18.3536 6.35355L12.7071 12L18.3536
17.6464C18.5488 17.8417 18.5488 18.1583 18.3536 18.3536C18.1583 18.5488
17.8417 18.5488 17.6464 18.3536L12 12.7071L6.35355 18.3536C6.15829 18.5488
5.84171 18.5488 5.64645 18.3536C5.45118 18.1583 5.45118 17.8417 5.64645
17.6464L11.2929 12L5.64645 6.35355C5.45118 6.15829 5.45118 5.84171 5.64645
5.64645Z" />
{:else if name === "diff"}
<path d="M12.5 10.5H15V9.5H12.5V7H11.5V9.5H9V10.5H11.5V13H12.5V10.5Z" />
<path d="M15 16.5H9V15.5H15V16.5Z" />
@@ -170,75 +261,83 @@
<path
d="M12 18C12.5523 18 13 17.5523 13 17C13 16.4477 12.5523 16 12 16C11.4477
16 11 16.4477 11 17C11 17.5523 11.4477 18 12 18Z" />
{:else if name === "chevron-down"}
{:else if name === "file"}
<path
d="M9 6.5C8.72386 6.5 8.5 6.72386 8.5 7C8.5 7.27614 8.72386 7.5 9
7.5H11C11.2761 7.5 11.5 7.27614 11.5 7C11.5 6.72386 11.2761 6.5 11 6.5H9Z" />
<path
d="M9 10.5C8.72386 10.5 8.5 10.7239 8.5 11C8.5 11.2761 8.72386 11.5 9
11.5H15C15.2761 11.5 15.5 11.2761 15.5 11C15.5 10.7239 15.2761 10.5 15
10.5H9Z" />
<path
d="M9 13.5C8.72386 13.5 8.5 13.7239 8.5 14C8.5 14.2761 8.72386 14.5 9
14.5H13C13.2761 14.5 13.5 14.2761 13.5 14C13.5 13.7239 13.2761 13.5 13
13.5H9Z" />
<path
d="M9 16.5C8.72386 16.5 8.5 16.7239 8.5 17C8.5 17.2761 8.72386 17.5 9
17.5H14C14.2761 17.5 14.5 17.2761 14.5 17C14.5 16.7239 14.2761 16.5 14
16.5H9Z" />
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M16.3536 9.64645C16.5488 9.84171 16.5488 10.1583 16.3536
10.3536L13.0607 13.6464C12.4749 14.2322 11.5251 14.2322 10.9393
13.6464L7.64645 10.3536C7.45118 10.1583 7.45118 9.84171 7.64645
9.64645C7.84171 9.45118 8.15829 9.45118 8.35355 9.64645L11.6464
12.9393C11.8417 13.1346 12.1583 13.1346 12.3536 12.9393L15.6464
9.64645C15.8417 9.45118 16.1583 9.45118 16.3536 9.64645Z" />
{:else if name === "chevron-up"}
d="M7 3.5C6.17157 3.5 5.5
4.17157 5.5 5V19C5.5 19.8284 6.17157 20.5 7 20.5H17C17.8284 20.5 18.5
19.8284 18.5 19V8.87566C18.5 8.17792 18.2084 7.51192 17.6957
7.03865L14.5804 4.16299C14.1186 3.73671 13.5132 3.5 12.8847 3.5H7ZM6.5
5C6.5 4.72386 6.72386 4.5 7 4.5H12.8847C13.2618 4.5 13.625 4.64203 13.9021
4.8978L17.0174 7.77346C17.325 8.05742 17.5 8.45702 17.5 8.87566V19C17.5
19.2761 17.2761 19.5 17 19.5H7C6.72386 19.5 6.5 19.2761 6.5 19V5Z" />
{:else if name === "folder"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M7.64645 14.3536C7.45118 14.1583 7.45118 13.8417 7.64645
13.6464L10.9393 10.3536C11.5251 9.76777 12.4749 9.76777 13.0607
10.3536L16.3536 13.6464C16.5488 13.8417 16.5488 14.1583 16.3536
14.3536C16.1583 14.5488 15.8417 14.5488 15.6464 14.3536L12.3536
11.0607C12.1583 10.8654 11.8417 10.8654 11.6464 11.0607L8.35355
14.3536C8.15829 14.5488 7.84171 14.5488 7.64645 14.3536Z" />
{:else if name === "cross"}
d="M20.5 17C20.5 17.8284
19.8284 18.5 19 18.5H5C4.17157 18.5 3.5 17.8284 3.5 17V6C3.5 5.17157
4.17157 4.5 5 4.5H10.382C10.9501 4.5 11.4695 4.821 11.7236
5.32918L12.1708 6.22361C12.2555 6.393 12.4286 6.5 12.618 6.5H19C19.8284
6.5 20.5 7.17157 20.5 8V17ZM4.5 6C4.5 5.72386 4.72386 5.5 5
5.5H10.382C10.5714 5.5 10.7445 5.607 10.8292 5.77639L11.2764
6.67082C11.5305 7.179 12.0499 7.5 12.618 7.5H19C19.2761 7.5 19.5
7.72386 19.5 8V9.99982C19.0822 9.68597 18.5628 9.5 18 9.5H4.5V6ZM4.5
10.5V17C4.5 17.2761 4.72386 17.5 5 17.5H19C19.2761 17.5 19.5 17.2761
19.5 17V12C19.5 11.1716 18.8284 10.5 18 10.5H4.5Z" />
{:else if name === "folder-open"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M5.64645 5.64645C5.84171 5.45118 6.15829 5.45118 6.35355 5.64645L12
11.2929L17.6464 5.64645C17.8417 5.45118 18.1583 5.45118 18.3536
5.64645C18.5488 5.84171 18.5488 6.15829 18.3536 6.35355L12.7071 12L18.3536
17.6464C18.5488 17.8417 18.5488 18.1583 18.3536 18.3536C18.1583 18.5488
17.8417 18.5488 17.6464 18.3536L12 12.7071L6.35355 18.3536C6.15829 18.5488
5.84171 18.5488 5.64645 18.3536C5.45118 18.1583 5.45118 17.8417 5.64645
17.6464L11.2929 12L5.64645 6.35355C5.45118 6.15829 5.45118 5.84171 5.64645
5.64645Z" />
{:else if name === "chevron-left"}
d="M4.92602 18.5C4.14221 18.5
3.49055 17.8965 3.43043 17.115L2.58428 6.11504C2.51727 5.24385 3.2061 4.5
4.07986 4.5H9.38195C9.95011 4.5 10.4695 4.821 10.7236 5.32918L11.1708
6.22361C11.2555 6.393 11.4286 6.5 11.618 6.5H18.0868C18.8626 6.5 19.5104
7.09158 19.5806 7.86419L19.7293 9.5H19.8672C20.7695 9.5 21.4675 10.2908
21.3556 11.1861L20.6056 17.1861C20.5118 17.9367 19.8737 18.5 19.1172
18.5H4.92602ZM3.58133 6.03835C3.559 5.74795 3.78861 5.5 4.07986
5.5H9.38195C9.57134 5.5 9.74447 5.607 9.82916 5.77639L10.2764
6.67082C10.5305 7.179 11.0499 7.5 11.618 7.5H18.0868C18.3454 7.5 18.5613
7.69719 18.5847 7.95473L18.7252 9.5H6.88278C6.12629 9.5 5.48819 10.0633
5.39436 10.8139L4.57642 17.3575C4.49247 17.2754 4.43713 17.1637 4.42749
17.0383L3.58133 6.03835ZM5.56638 17.5H19.1172C19.3694 17.5 19.5821 17.3122
19.6133 17.062L20.3633 11.062C20.4007 10.7636 20.168 10.5 19.8672
10.5H6.88278C6.63061 10.5 6.41791 10.6878 6.38664 10.938L5.56638 17.5Z" />
{:else if name === "fork"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M14.3536 16.3536C14.1583 16.5488 13.8417 16.5488 13.6464
16.3536L10.3536 13.0607C9.76777 12.4749 9.76777 11.5251 10.3536
10.9393L13.6464 7.64645C13.8417 7.45119 14.1583 7.45119 14.3536
7.64645C14.5488 7.84171 14.5488 8.15829 14.3536 8.35355L11.0607
11.6464C10.8654 11.8417 10.8654 12.1583 11.0607 12.3536L14.3536
15.6464C14.5488 15.8417 14.5488 16.1583 14.3536 16.3536Z" />
{:else if name === "chevron-left-right"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M9.35353 6.64645C9.54879 6.84171 9.54879 7.15829 9.35353
7.35355L5.06064 11.6465L5.06062 11.6465C4.86537 11.8417 4.86537 12.1583
5.06062 12.3535L5.06064 12.3535L9.35353 16.6464C9.54879 16.8417 9.54879
17.1583 9.35353 17.3536C9.15826 17.5488 8.84168 17.5488 8.64642
17.3536L4.35354 13.0607C3.76774 12.4749 3.76773 11.5251 4.35353
10.9393C4.35353 10.9393 4.35354 10.9393 4.35354 10.9393L8.64642
6.64645C8.84168 6.45118 9.15826 6.45118 9.35353 6.64645ZM14.6464
6.64645C14.8417 6.45118 15.1583 6.45118 15.3535 6.64645L19.6464
10.9393C20.2322 11.5251 20.2322 12.4749 19.6464 13.0607L15.3535
17.3536C15.1583 17.5488 14.8417 17.5488 14.6464 17.3536C14.4512 17.1583
14.4512 16.8417 14.6464 16.6464L18.9393 12.3535C19.1346 12.1583 19.1346
11.8417 18.9393 11.6465L14.6464 7.35355C14.4512 7.15829 14.4512 6.84171
14.6464 6.64645Z" />
{:else if name === "chevron-right"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M9.64645 7.64645C9.84171 7.45118 10.1583 7.45118 10.3536
7.64645L13.6464 10.9393C14.2322 11.5251 14.2322 12.4749 13.6464
13.0607L10.3536 16.3536C10.1583 16.5488 9.84171 16.5488 9.64645
16.3536C9.45118 16.1583 9.45118 15.8417 9.64645 15.6464L12.9393
12.3536C13.1346 12.1583 13.1346 11.8417 12.9393 11.6464L9.64645
8.35355C9.45118 8.15829 9.45118 7.84171 9.64645 7.64645Z" />
d="M3.5 6C3.5 4.61929 4.61929 3.5 6 3.5C7.38071 3.5 8.5 4.61929 8.5 6C8.5
7.20948 7.64112 8.21836 6.5 8.44999V11C6.5 11.2761 6.72386 11.5 7
11.5H17C17.2761 11.5 17.5 11.2761 17.5 11V8.44999C16.3589 8.21836 15.5
7.20948 15.5 6C15.5 4.61929 16.6193 3.5 18 3.5C19.3807 3.5 20.5 4.61929
20.5 6C20.5 7.20948 19.6411 8.21836 18.5 8.44999V11C18.5 11.8284 17.8284
12.5 17 12.5H12.5V15.55C13.6411 15.7816 14.5 16.7905 14.5 18C14.5 19.3807
13.3807 20.5 12 20.5C10.6193 20.5 9.5 19.3807 9.5 18C9.5 16.7905 10.3589
15.7816 11.5 15.55V12.5H7C6.17157 12.5 5.5 11.8284 5.5 11V8.44999C4.35888
8.21836 3.5 7.20948 3.5 6ZM6 4.5C5.17157 4.5 4.5 5.17157 4.5 6C4.5
6.82843 5.17157 7.5 6 7.5C6.82843 7.5 7.5 6.82843 7.5 6C7.5 5.17157
6.82843 4.5 6 4.5ZM18 4.5C17.1716 4.5 16.5 5.17157 16.5 6C16.5 6.82843
17.1716 7.5 18 7.5C18.8284 7.5 19.5 6.82843 19.5 6C19.5 5.17157 18.8284
4.5 18 4.5ZM12 16.5C11.1716 16.5 10.5 17.1716 10.5 18C10.5 18.8284
11.1716 19.5 12 19.5C12.8284 19.5 13.5 18.8284 13.5 18C13.5 17.1716
12.8284 16.5 12 16.5Z" />
{:else if name === "gear"}
<path
fill-rule="evenodd"
@@ -304,25 +403,32 @@
7.11647C17.6068 7.20145 17.7119 7.25681 17.8262 7.27313L20.1405
7.60374C20.299 7.89648 20.4413 8.19742 20.5669 8.50522C20.6794 8.78098
20.7785 9.06225 20.8638 9.34803L19.4565 11.2216Z" />
{:else if name === "fork"}
{:else if name === "issue"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M3.5 6C3.5 4.61929 4.61929 3.5 6 3.5C7.38071 3.5 8.5 4.61929 8.5 6C8.5
7.20948 7.64112 8.21836 6.5 8.44999V11C6.5 11.2761 6.72386 11.5 7
11.5H17C17.2761 11.5 17.5 11.2761 17.5 11V8.44999C16.3589 8.21836 15.5
7.20948 15.5 6C15.5 4.61929 16.6193 3.5 18 3.5C19.3807 3.5 20.5 4.61929
20.5 6C20.5 7.20948 19.6411 8.21836 18.5 8.44999V11C18.5 11.8284 17.8284
12.5 17 12.5H12.5V15.55C13.6411 15.7816 14.5 16.7905 14.5 18C14.5 19.3807
13.3807 20.5 12 20.5C10.6193 20.5 9.5 19.3807 9.5 18C9.5 16.7905 10.3589
15.7816 11.5 15.55V12.5H7C6.17157 12.5 5.5 11.8284 5.5 11V8.44999C4.35888
8.21836 3.5 7.20948 3.5 6ZM6 4.5C5.17157 4.5 4.5 5.17157 4.5 6C4.5
6.82843 5.17157 7.5 6 7.5C6.82843 7.5 7.5 6.82843 7.5 6C7.5 5.17157
6.82843 4.5 6 4.5ZM18 4.5C17.1716 4.5 16.5 5.17157 16.5 6C16.5 6.82843
17.1716 7.5 18 7.5C18.8284 7.5 19.5 6.82843 19.5 6C19.5 5.17157 18.8284
4.5 18 4.5ZM12 16.5C11.1716 16.5 10.5 17.1716 10.5 18C10.5 18.8284
11.1716 19.5 12 19.5C12.8284 19.5 13.5 18.8284 13.5 18C13.5 17.1716
12.8284 16.5 12 16.5Z" />
d="M2.5 12C2.5 6.75328
6.75329 2.49998 12 2.49998C17.2467 2.49998 21.5 6.75328 21.5 12C21.5
17.2467 17.2467 21.5 12 21.5C6.75329 21.5 2.5 17.2467 2.5 12ZM12
3.49998C7.30558 3.49998 3.5 7.30556 3.5 12C3.5 16.6944 7.30558 20.5 12
20.5C16.6944 20.5 20.5 16.6944 20.5 12C20.5 7.30556 16.6944 3.49998 12
3.49998Z" />
<path
d="M10.5 12C10.5 12.8284 11.1716 13.5 12 13.5C12.8284 13.5 13.5
12.8284 13.5 12C13.5 11.1716 12.8284 10.5 12 10.5C11.1716 10.5 10.5 11.1716
10.5 12Z" />
{:else if name === "magnifying-glass"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M11 6.5C8.51472 6.5 6.5
8.51472 6.5 11C6.5 13.4853 8.51472 15.5 11 15.5C13.4853 15.5 15.5 13.4853
15.5 11C15.5 8.51472 13.4853 6.5 11 6.5ZM5.5 11C5.5 7.96243 7.96243 5.5 11
5.5C14.0376 5.5 16.5 7.96243 16.5 11C16.5 12.3387 16.0217 13.5658 15.2266
14.5195L19.3536 18.6464C19.5488 18.8417 19.5488 19.1583 19.3536
19.3536C19.1583 19.5488 18.8417 19.5488 18.6464 19.3536L14.5195
15.2266C13.5658 16.0217 12.3387 16.5 11 16.5C7.96243 16.5 5.5 14.0376 5.5
11Z" />
{:else if name === "moon"}
<path
fill-rule="evenodd"
@@ -402,26 +508,6 @@
16.5ZM18 16.5C17.1716 16.5 16.5 17.1716 16.5 18C16.5 18.8284 17.1716 19.5
18 19.5C18.8284 19.5 19.5 18.8284 19.5 18C19.5 17.1716 18.8284 16.5 18
16.5Z" />
{:else if name === "checkmark"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M18.2941 6.59564C18.5174 6.75806 18.5668 7.07076 18.4044
7.29409L11.781 16.4012C10.8775 17.6436 9.07768 17.7848 7.99142
16.6985L5.64645 14.3536C5.45118 14.1583 5.45118 13.8417 5.64645
13.6465C5.84171 13.4512 6.15829 13.4512 6.35355 13.6465L8.69852
15.9914C9.35028 16.6432 10.4302 16.5584 10.9723 15.813L17.5956
6.70592C17.7581 6.48259 18.0708 6.43322 18.2941 6.59564Z" />
{:else if name === "checkmark-small"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M16.2481 8.56588C16.4878 8.70288 16.5711 9.00831 16.4341
9.24807L13.0837 15.1113C12.593 15.9701 11.42 16.1271 10.7207
15.4278L8.64645 13.3536C8.45118 13.1583 8.45118 12.8417 8.64645
12.6464C8.84171 12.4512 9.15829 12.4512 9.35355 12.6464L11.4278
14.7207C11.6609 14.9538 12.0519 14.9014 12.2154 14.6152L15.5659
8.75193C15.7029 8.51217 16.0083 8.42887 16.2481 8.56588Z" />
{:else if name === "sun"}
<path
fill-rule="evenodd"
@@ -480,59 +566,6 @@
18.7175L16.5962 17.3033C16.4009 17.108 16.4009 16.7915 16.5962
16.5962C16.7915 16.4009 17.108 16.4009 17.3033 16.5962L18.7175
18.0104C18.9128 18.2057 18.9128 18.5223 18.7175 18.7175Z" />
{:else if name === "twitter"}
<path
clip-rule="evenodd"
fill-rule="evenodd"
d="m5.5228 5.4809c0.13886 0.00675 0.26343 0.087463 0.32634 0.21144 1.08
2.1284 2.6203 3.5913 4.862 4.2088v-0.47702c0-1.8169 1.4729-3.2898
3.2898-3.2898 1.1961 0 2.2689 0.56288 2.8469 1.5482h2.7652c0.16263 0 0.30793
0.1017 0.36366 0.25453 0.05566 0.15283 0.0098 0.32417-0.11464 0.42881l-2.5734
2.1625c-0.04079 1.6914-0.6455 3.5129-1.7259 4.9881-1.2652 1.7277-3.2027
3.0031-5.6713 3.0031-2.4028
0-3.8426-0.92007-4.6769-1.8739-0.41221-0.47133-0.66961-0.94259-0.82448-1.2974-0.077555-0.17765-0.12983-0.3272-0.16319-0.43441-0.016689-0.05364-0.028687-0.09676-0.036769-0.12772-0.00405-0.01548-0.00711-0.02794-0.0093-0.03716l-0.00265-0.0113-8.515e-4
-0.0038-3.096e-4 -0.0014-1.316e-4 -6.19e-4c-5.42e-5 -2.33e-4 -1.084e-4
-4.65e-4 0.3781-0.08267l-0.37821 0.08221c-0.024863-0.11441 0.00341-0.23393
0.076873-0.32511 0.073475-0.09111 0.18426-0.14413
0.30134-0.14413h2.3072c-0.87844-0.64588-1.7455-1.5204-2.2917-2.612-0.80618-1.6109-0.88662-3.6435
0.60706-5.9904 0.074644-0.11729 0.20646-0.18553 0.34532-0.17877zm-0.42433
9.5552c3.561e-4 7.74e-4 7.044e-4 0.0016 0.00106 0.0024 0.13017 0.29833 0.34822
0.69791 0.69767 1.0974 0.68907 0.78785 1.9174 1.6095 4.0942 1.6095 2.1745 0
3.8969-1.1162 5.0467-2.6864 1.0242-1.3984 1.5785-3.1389 1.5785-4.713 0-0.11431
0.05055-0.22277 0.13802-0.29631l1.8961-1.5933h-1.9347c-0.14847
0-0.28385-0.084955-0.34849-0.21865-0.39749-0.82249-1.2464-1.3295-2.2666-1.3295-1.3894
0-2.5157 1.1263-2.5157 2.5157v0.96759c0 0.21372-0.17332 0.38704-0.38704
0.38704-0.01664
0-0.03298-0.0011-0.04908-0.0031-0.01757-0.0013-0.03522-0.0039-0.05295-0.0077-2.5186-0.54599-4.2771-2.0072-5.5042-4.1128-0.9927
1.8701-0.84393 3.4204-0.22929 4.6486 0.6925 1.3838 2.004 2.4102 3.1211 3.0036
0.15696 0.08337 0.23697 0.26295 0.19401 0.43534-0.042953 0.17246-0.19784
0.29353-0.37557 0.29353z" />
{:else if name === "issue"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M2.5 12C2.5 6.75328
6.75329 2.49998 12 2.49998C17.2467 2.49998 21.5 6.75328 21.5 12C21.5
17.2467 17.2467 21.5 12 21.5C6.75329 21.5 2.5 17.2467 2.5 12ZM12
3.49998C7.30558 3.49998 3.5 7.30556 3.5 12C3.5 16.6944 7.30558 20.5 12
20.5C16.6944 20.5 20.5 16.6944 20.5 12C20.5 7.30556 16.6944 3.49998 12
3.49998Z" />
<path
d="M10.5 12C10.5 12.8284 11.1716 13.5 12 13.5C12.8284 13.5 13.5
12.8284 13.5 12C13.5 11.1716 12.8284 10.5 12 10.5C11.1716 10.5 10.5 11.1716
10.5 12Z" />
{:else if name === "magnifying-glass"}
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M11 6.5C8.51472 6.5 6.5
8.51472 6.5 11C6.5 13.4853 8.51472 15.5 11 15.5C13.4853 15.5 15.5 13.4853
15.5 11C15.5 8.51472 13.4853 6.5 11 6.5ZM5.5 11C5.5 7.96243 7.96243 5.5 11
5.5C14.0376 5.5 16.5 7.96243 16.5 11C16.5 12.3387 16.0217 13.5658 15.2266
14.5195L19.3536 18.6464C19.5488 18.8417 19.5488 19.1583 19.3536
19.3536C19.1583 19.5488 18.8417 19.5488 18.6464 19.3536L14.5195
15.2266C13.5658 16.0217 12.3387 16.5 11 16.5C7.96243 16.5 5.5 14.0376 5.5
11Z" />
{:else}
{unreachable(name)}
{/if}
+11 -1
View File
@@ -1,4 +1,6 @@
<script lang="ts">
import Icon from "@app/components/Icon.svelte";
export let active: boolean;
export let name: string;
</script>
@@ -9,7 +11,6 @@
border-radius: var(--border-radius-small);
cursor: pointer;
display: flex;
justify-content: space-between;
line-height: 1.5em;
margin: 0.125rem 0;
padding: 0.25rem;
@@ -33,8 +34,17 @@
overflow: hidden;
max-width: 24ch;
}
.icon-container {
color: var(--color-foreground-5);
display: flex;
justify-content: center;
align-items: center;
}
</style>
<div class="file" class:active>
<div class="icon-container">
<Icon name="file" />
</div>
<span class="name">{name}</span>
</div>
+20 -7
View File
@@ -7,6 +7,7 @@
import Link from "@app/components/Link.svelte";
import File from "./File.svelte";
import Icon from "@app/components/Icon.svelte";
export let baseUrl: BaseUrl;
export let currentPath: string;
@@ -43,7 +44,7 @@
cursor: pointer;
padding: 0.25rem;
margin: 0.125rem 0;
color: var(--color-foreground-6);
color: var(--color-foreground-5);
user-select: none;
line-height: 1.5rem;
white-space: nowrap;
@@ -60,23 +61,35 @@
.container {
padding-left: 0.5rem;
margin: 0;
margin: 0 0 0 0.5rem;
}
.loading {
display: inline-block;
padding: 0.5rem 0;
}
.icon-container {
display: flex;
justify-content: center;
align-items: center;
}
</style>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="folder" on:click={onClick}>
<span class="folder-name">{name}/</span>
<div class="icon-container">
{#if expanded}
<Icon name="folder-open" />
{:else}
<Icon name="folder" />
{/if}
</div>
<span class="folder-name">{name}</span>
</div>
<div class="container">
{#if expanded}
{#if expanded}
<div class="container">
{#await tree}
<span class="loading"><Loading noDelay small margins /></span>
{:then tree}
@@ -112,5 +125,5 @@
{/each}
{/if}
{/await}
{/if}
</div>
</div>
{/if}
+3 -3
View File
@@ -99,7 +99,7 @@ test.describe("project page navigation", () => {
await page.getByText(".hidden").click();
await expect(page).toHaveURL(`${projectTreeURL}/.hidden`);
await page.getByText("bin/").click();
await page.getByText("bin").click();
await page.getByText("true").click();
await expect(page).toHaveURL(`${projectTreeURL}/bin/true`);
@@ -126,7 +126,7 @@ test.describe("project page navigation", () => {
await page.getByText(".hidden").click();
await expect(page).toHaveURL(`${projectTreeURL}/tree/.hidden`);
await page.getByText("bin/").click();
await page.getByText("bin").click();
await page.getByText("true").click();
await expect(page).toHaveURL(`${projectTreeURL}/tree/bin/true`);
@@ -150,7 +150,7 @@ test.describe("project page navigation", () => {
await page.getByText(".hidden").click();
await expect(page).toHaveURL(`${projectTreeURL}/.hidden`);
await page.getByText("bin/").click();
await page.getByText("bin").click();
await page.getByText("true").click();
await expect(page).toHaveURL(`${projectTreeURL}/bin/true`);
+3 -3
View File
@@ -99,7 +99,7 @@ test.describe("project page navigation", () => {
await page.getByText(".hidden").click();
await expect(page).toHaveURL(`${projectTreeURL}/.hidden`);
await page.getByText("bin/").click();
await page.getByText("bin").click();
await page.getByText("true").click();
await expect(page).toHaveURL(`${projectTreeURL}/bin/true`);
@@ -126,7 +126,7 @@ test.describe("project page navigation", () => {
await page.getByText(".hidden").click();
await expect(page).toHaveURL(`${projectTreeURL}/tree/.hidden`);
await page.getByText("bin/").click();
await page.getByText("bin").click();
await page.getByText("true").click();
await expect(page).toHaveURL(`${projectTreeURL}/tree/bin/true`);
@@ -150,7 +150,7 @@ test.describe("project page navigation", () => {
await page.getByText(".hidden").click();
await expect(page).toHaveURL(`${projectTreeURL}/.hidden`);
await page.getByText("bin/").click();
await page.getByText("bin").click();
await page.getByText("true").click();
await expect(page).toHaveURL(`${projectTreeURL}/bin/true`);
+24 -24
View File
@@ -82,14 +82,14 @@ test("show source tree at specific revision", async ({ page }) => {
await expect(page.getByTitle("Current branch")).toContainText(
"335dd6dc89b535a4a31e9422c803199bb6b0a09a",
);
await expect(page.locator(".source-tree")).toHaveText("bin/ src/");
await expect(page.locator(".source-tree")).toHaveText("bin src");
await expectCounts({ commits: 2, contributors: 1 }, page);
});
test("source file highlighting", async ({ page }) => {
await page.goto(sourceBrowsingUrl);
await page.getByText("src/").click();
await page.getByText("src").click();
await page.getByText("true.c").click();
await expect(page.getByText("return")).toHaveCSS(
@@ -125,15 +125,15 @@ test("navigate deep file hierarchies", async ({ page }) => {
const sourceTree = page.locator(".source-tree");
await sourceTree.getByText("deep/").click();
await sourceTree.getByText("directory/").click();
await sourceTree.getByText("hierarchy/").click();
await sourceTree.getByText("is/").click();
await sourceTree.getByText("entirely/").click();
await sourceTree.getByText("possible/").click();
await sourceTree.getByText("in/").nth(1).click();
await sourceTree.getByText("git/").click();
await sourceTree.getByText("repositories/").click();
await sourceTree.getByText("deep").click();
await sourceTree.getByText("directory").click();
await sourceTree.getByText("hierarchy").click();
await sourceTree.getByText("is").click();
await sourceTree.getByText("entirely").click();
await sourceTree.getByText("possible").click();
await sourceTree.getByText("in").nth(1).click();
await sourceTree.getByText("git").click();
await sourceTree.getByText("repositories").click();
await sourceTree.getByText(".gitkeep").click();
await expect(
page.getByText("0801ace Add a deeply nested directory tree"),
@@ -146,15 +146,15 @@ test("navigate deep file hierarchies", async ({ page }) => {
const sourceTree = page.locator(".source-tree");
await expect(sourceTree.getByText("deep/")).toBeVisible();
await expect(sourceTree.getByText("directory/")).toBeVisible();
await expect(sourceTree.getByText("hierarchy/")).toBeVisible();
await expect(sourceTree.getByText("is/")).toBeVisible();
await expect(sourceTree.getByText("entirely/")).toBeVisible();
await expect(sourceTree.getByText("possible/")).toBeVisible();
await expect(sourceTree.getByText("in/").nth(1)).toBeVisible();
await expect(sourceTree.getByText("git/")).toBeVisible();
await expect(sourceTree.getByText("repositories/")).toBeVisible();
await expect(sourceTree.getByText("deep")).toBeVisible();
await expect(sourceTree.getByText("directory")).toBeVisible();
await expect(sourceTree.getByText("hierarchy")).toBeVisible();
await expect(sourceTree.getByText("is")).toBeVisible();
await expect(sourceTree.getByText("entirely")).toBeVisible();
await expect(sourceTree.getByText("possible")).toBeVisible();
await expect(sourceTree.getByText("in").nth(1)).toBeVisible();
await expect(sourceTree.getByText("git").nth(1)).toBeVisible();
await expect(sourceTree.getByText("repositories")).toBeVisible();
await expect(sourceTree.getByText(".gitkeep")).toBeVisible();
await expect(
@@ -167,7 +167,7 @@ test("files with special characters in the filename", async ({ page }) => {
await page.goto(sourceBrowsingUrl);
const sourceTree = page.locator(".source-tree");
await sourceTree.getByText("special/").click();
await sourceTree.getByText("special").click();
await sourceTree.getByText("+plus+").click();
await expect(page.locator(".file-name")).toContainText("+plus");
@@ -209,7 +209,7 @@ test("files with special characters in the filename", async ({ page }) => {
test("binary files", async ({ page }) => {
await page.goto(sourceBrowsingUrl);
await page.getByText("bin/").click();
await page.getByText("bin").click();
await page.getByText("true").click();
await expect(page.getByText("Binary content")).toBeVisible();
@@ -218,7 +218,7 @@ test("binary files", async ({ page }) => {
test("empty files", async ({ page }) => {
await page.goto(sourceBrowsingUrl);
await page.getByText("special/").click();
await page.getByText("special").click();
await page.getByText("_underscore_").click();
await expect(page.getByText("Empty file")).toBeVisible();
@@ -403,7 +403,7 @@ test.describe("browser error handling", () => {
await page.goto(sourceBrowsingUrl);
const sourceTree = page.locator(".source-tree");
await sourceTree.getByText("src/").click();
await sourceTree.getByText("src").click();
await expect(page.getByText("Not able to expand directory")).toBeVisible();
});