Filtering panel (#48)
|
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- Added filtering panel for filtering results by repository and by language. ([#48](https://github.com/sourcebot-dev/sourcebot/pull/48))
|
||||
|
||||
## [2.1.1] - 2024-10-25
|
||||
|
||||
### Fixed
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
"embla-carousel-auto-scroll": "^8.3.0",
|
||||
"embla-carousel-react": "^8.3.0",
|
||||
"escape-string-regexp": "^5.0.0",
|
||||
"fuse.js": "^7.0.0",
|
||||
"http-status-codes": "^2.3.0",
|
||||
"lucide-react": "^0.435.0",
|
||||
"next": "14.2.10",
|
||||
|
|
|
|||
1
packages/web/public/languages/file_type_assembly.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><linearGradient id="a" x1="836.63" y1="36.205" x2="843.802" y2="14.48" gradientTransform="translate(525.922 30.249) rotate(180) scale(0.607 0.607)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset="1" stop-color="#fff" stop-opacity="0.275"/></linearGradient></defs><title>file_type_assembly</title><path d="M16,2c-1.246,3.056-2,5.057-3.391,8.022A21.884,21.884,0,0,0,16.2,13.156a14.858,14.858,0,0,1-4-2.283C10.43,14.579,7.646,19.855,2,30c5.186-2.994,9.012-4.648,12.691-4.966V24.2h-.834v-.837h.834V24.2h1.675V22.521H14.691v-.834h-.834V20.013h.834v-.834h1.675v.834H17.2v.837h-.837v-.837H14.691v1.675h1.675v.834H17.2V24.2h-.837v.783c3.98.1,8.006,1.772,13.634,5.021-.863-1.589-1.636-3.021-2.372-4.385a25.526,25.526,0,0,0-4.833-3.333A14.436,14.436,0,0,1,26.65,23.8C19.17,9.872,18.565,8.02,16,2ZM10.511,19.179h1.671v.834h.837v5.021h-.837V22.521H10.511v2.512H9.673V20.013h.837Zm0,.834v1.675h1.671V20.013Zm7.526-.834h.837v.834h.837v.837h.834v-.837h.837v-.834h.837v5.855h-.837V20.85h-.837v.837h-.834V20.85h-.837v4.184h-.837Z" style="fill:#0000bf"/><path d="M23.881,18.642c-6.069-8.237-7.476-14.876-7.832-16.461A175.217,175.217,0,0,0,23.881,18.642Z" style="fill:#fff;fill-opacity:0.165680468082428"/><path d="M16.051,2.12,15.6,3.227c-.159.391-.311.765-.461,1.131s-.3.724-.448,1.077-.3.7-.448,1.053-.3.706-.465,1.066-.329.729-.506,1.111-.362.778-.561,1.193c-.028.057-.061.123-.089.181A21.872,21.872,0,0,0,16.2,13.156a14.879,14.879,0,0,1-3.989-2.276l-.14.287c-.065.133-.144.283-.212.42l-.106.219c-.878,1.793-2.006,3.984-3.524,6.822,3.551-2,7.381-4.887,14.338-2.4-.349-.661-.67-1.28-.971-1.863s-.581-1.128-.841-1.644-.5-1-.725-1.463-.433-.9-.629-1.313-.38-.818-.554-1.2-.339-.754-.5-1.118S18.047,6.9,17.9,6.546s-.291-.709-.434-1.066c-.036-.091-.073-.186-.109-.277C16.949,4.247,16.536,3.258,16.051,2.12Z" style="fill:url(#a)"/></svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
1
packages/web/public/languages/file_type_c3.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_c3</title><path d="M29,10.232a2.387,2.387,0,0,0-.318-1.244,2.451,2.451,0,0,0-.936-.879Q22.552,5.241,17.353,2.376A2.642,2.642,0,0,0,14.59,2.4c-1.378.779-8.275,4.565-10.331,5.706A2.287,2.287,0,0,0,3,10.231V21.77a2.4,2.4,0,0,0,.3,1.22,2.434,2.434,0,0,0,.954.9c2.056,1.141,8.954,4.927,10.332,5.706a2.642,2.642,0,0,0,2.763.026q5.19-2.871,10.386-5.733a2.444,2.444,0,0,0,.955-.9,2.4,2.4,0,0,0,.3-1.22V10.232" style="fill:#a9b9cb"/><path d="M28.549,23.171a2.126,2.126,0,0,0,.147-.182,2.4,2.4,0,0,0,.3-1.22V10.232a2.387,2.387,0,0,0-.318-1.244c-.036-.059-.089-.105-.13-.16L16,16Z" style="fill:#8b97a3"/><path d="M28.549,23.171,16,16,3.451,23.171a2.435,2.435,0,0,0,.809.72c2.056,1.141,8.954,4.927,10.332,5.706a2.642,2.642,0,0,0,2.763.026q5.19-2.871,10.386-5.733A2.43,2.43,0,0,0,28.549,23.171Z" style="fill:#7f8b99"/><path d="M19.6,18.02a4.121,4.121,0,1,1-.027-4.087l3.615-2.073A8.309,8.309,0,0,0,7.7,16a8.216,8.216,0,0,0,1.1,4.117A8.319,8.319,0,0,0,23.211,20.1L19.6,18.02" style="fill:#fff"/></svg>
|
||||
|
After Width: | Height: | Size: 1 KiB |
1
packages/web/public/languages/file_type_cpp3.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_cpp3</title><path d="M29,10.232a2.387,2.387,0,0,0-.318-1.244,2.451,2.451,0,0,0-.936-.879Q22.552,5.241,17.353,2.376A2.642,2.642,0,0,0,14.59,2.4c-1.378.779-8.275,4.565-10.331,5.706A2.287,2.287,0,0,0,3,10.231V21.77a2.4,2.4,0,0,0,.3,1.22,2.434,2.434,0,0,0,.954.9c2.056,1.141,8.954,4.927,10.332,5.706a2.642,2.642,0,0,0,2.763.026q5.19-2.871,10.386-5.733a2.444,2.444,0,0,0,.955-.9,2.4,2.4,0,0,0,.3-1.22V10.232" style="fill:#659ad2"/><path d="M28.549,23.171a2.126,2.126,0,0,0,.147-.182,2.4,2.4,0,0,0,.3-1.22V10.232a2.387,2.387,0,0,0-.318-1.244c-.036-.059-.089-.105-.13-.16L16,16Z" style="fill:#00599c"/><path d="M28.549,23.171,16,16,3.451,23.171a2.435,2.435,0,0,0,.809.72c2.056,1.141,8.954,4.927,10.332,5.706a2.642,2.642,0,0,0,2.763.026q5.19-2.871,10.386-5.733A2.43,2.43,0,0,0,28.549,23.171Z" style="fill:#004482"/><path d="M19.6,18.02a4.121,4.121,0,1,1-.027-4.087l3.615-2.073A8.309,8.309,0,0,0,7.7,16a8.216,8.216,0,0,0,1.1,4.117A8.319,8.319,0,0,0,23.211,20.1L19.6,18.02" style="fill:#fff"/><polygon points="24.076 15.538 23.15 15.538 23.15 14.617 22.225 14.617 22.225 15.538 21.299 15.538 21.299 16.461 22.225 16.461 22.225 17.381 23.15 17.381 23.15 16.461 24.076 16.461 24.076 15.538" style="fill:#fff"/><polygon points="27.549 15.538 26.623 15.538 26.623 14.617 25.697 14.617 25.697 15.538 24.771 15.538 24.771 16.461 25.697 16.461 25.697 17.381 26.623 17.381 26.623 16.461 27.549 16.461 27.549 15.538" style="fill:#fff"/></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
1
packages/web/public/languages/file_type_csharp2.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_csharp2</title><path d="M29,10.232a2.387,2.387,0,0,0-.318-1.244,2.451,2.451,0,0,0-.936-.879Q22.552,5.241,17.353,2.376A2.642,2.642,0,0,0,14.59,2.4c-1.378.779-8.275,4.565-10.331,5.706A2.287,2.287,0,0,0,3,10.231V21.77a2.4,2.4,0,0,0,.3,1.22,2.434,2.434,0,0,0,.954.9c2.056,1.141,8.954,4.927,10.332,5.706a2.642,2.642,0,0,0,2.763.026q5.19-2.871,10.386-5.733a2.444,2.444,0,0,0,.955-.9,2.4,2.4,0,0,0,.3-1.22V10.232" style="fill:#4e994a"/><path d="M28.549,23.171a2.126,2.126,0,0,0,.147-.182,2.4,2.4,0,0,0,.3-1.22V10.232a2.387,2.387,0,0,0-.318-1.244c-.036-.059-.089-.105-.13-.16L16,16Z" style="fill:#358230"/><path d="M28.549,23.171,16,16,3.451,23.171a2.435,2.435,0,0,0,.809.72c2.056,1.141,8.954,4.927,10.332,5.706a2.642,2.642,0,0,0,2.763.026q5.19-2.871,10.386-5.733A2.43,2.43,0,0,0,28.549,23.171Z" style="fill:#1a7515"/><path d="M19.6,18.02a4.121,4.121,0,1,1-.027-4.087l3.615-2.073A8.309,8.309,0,0,0,7.7,16a8.216,8.216,0,0,0,1.1,4.117A8.319,8.319,0,0,0,23.211,20.1L19.6,18.02" style="fill:#fff"/><path d="M27.67,15.271V14.033H26.663V13.027H25.424v1.006H23.916V13.027H22.677v1.006H21.669v1.238h1.006v1.513H21.669v1.237h1.006v1.006h1.239V18.021h1.509v1.006h1.239V18.021h1.006V16.784h-1V15.271Zm-2.246,1.513H23.916V15.271h1.508Z" style="fill:#fff"/></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
1
packages/web/public/languages/file_type_css.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_css</title><polygon points="5.902 27.201 3.656 2 28.344 2 26.095 27.197 15.985 30 5.902 27.201" style="fill:#1572b6"/><polygon points="16 27.858 24.17 25.593 26.092 4.061 16 4.061 16 27.858" style="fill:#33a9dc"/><polygon points="16 13.191 20.09 13.191 20.372 10.026 16 10.026 16 6.935 16.011 6.935 23.75 6.935 23.676 7.764 22.917 16.282 16 16.282 16 13.191" style="fill:#fff"/><polygon points="16.019 21.218 16.005 21.222 12.563 20.292 12.343 17.827 10.67 17.827 9.24 17.827 9.673 22.68 16.004 24.438 16.019 24.434 16.019 21.218" style="fill:#ebebeb"/><polygon points="19.827 16.151 19.455 20.29 16.008 21.22 16.008 24.436 22.344 22.68 22.391 22.158 22.928 16.151 19.827 16.151" style="fill:#fff"/><polygon points="16.011 6.935 16.011 8.855 16.011 10.018 16.011 10.026 8.555 10.026 8.555 10.026 8.545 10.026 8.483 9.331 8.342 7.764 8.268 6.935 16.011 6.935" style="fill:#ebebeb"/><polygon points="16 13.191 16 15.111 16 16.274 16 16.282 12.611 16.282 12.611 16.282 12.601 16.282 12.539 15.587 12.399 14.02 12.325 13.191 16 13.191" style="fill:#ebebeb"/></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
1
packages/web/public/languages/file_type_dartlang.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_dartlang</title><path d="M16.739,2.037a1.314,1.314,0,0,0-.916.377l-.013.01L7.22,7.389l8.566,8.566v.006l10.3,10.3,1.963-3.536L20.968,5.728l-3.3-3.3a1.307,1.307,0,0,0-.927-.388Z" style="fill:#66c3fa"/><path d="M7.25,7.35,2.288,15.931l-.01.013a1.322,1.322,0,0,0-.378.919,1.3,1.3,0,0,0,.387.924L6.4,21.9l16.084,6.327,3.636-2.02-.1-.1-.025,0-10.083-10.1H15.9L7.25,7.35Z" style="fill:#215896"/><path d="M7.192,7.362l8.764,8.773h.013l10.087,10.1,3.839-.732L29.9,14.14l-4.054-3.973a6.521,6.521,0,0,0-3.624-1.616l0-.044L7.192,7.362Z" style="fill:#235997"/><path d="M7.256,7.411l8.768,8.768v.013L26.116,26.284l-.734,3.839H14.022l-3.971-4.056a6.522,6.522,0,0,1-1.614-3.625l-.044,0L7.256,7.411Z" style="fill:#58b6f0"/></svg>
|
||||
|
After Width: | Height: | Size: 789 B |
1
packages/web/public/languages/file_type_go.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 254.5 225"><title>file_type_go</title><path d="M-46.926,89c-.621,0-.777-.311-.466-.777l3.262-4.194a2.225,2.225,0,0,1,1.708-.777H13.026c.621,0,.777.466.466.932l-2.64,4.038a2.367,2.367,0,0,1-1.553.932Z" style="fill:#00acd7"/><path d="M-70.379,103.285c-.621,0-.777-.311-.466-.777l3.262-4.194a2.225,2.225,0,0,1,1.708-.777H4.95a.714.714,0,0,1,.777.932L4.484,102.2a1.358,1.358,0,0,1-1.4.932Z" style="fill:#00acd7"/><path d="M-32.792,117.574c-.621,0-.777-.466-.466-.932l2.174-3.883a2.06,2.06,0,0,1,1.553-.932H1.533c.621,0,.932.466.932,1.087l-.311,3.728a1.167,1.167,0,0,1-1.087,1.087Z" style="fill:#00acd7"/><path d="M128.426,86.2c-9.785,2.485-16.464,4.349-26.093,6.834-2.33.621-2.485.777-4.5-1.553-2.33-2.64-4.038-4.349-7.3-5.9-9.785-4.815-19.259-3.417-28.112,2.33-10.561,6.834-16,16.929-15.842,29.51.155,12.425,8.7,22.676,20.968,24.385,10.561,1.4,19.414-2.33,26.4-10.251,1.4-1.708,2.64-3.572,4.194-5.747H68.163c-3.262,0-4.038-2.019-2.951-4.659,2.019-4.815,5.747-12.891,7.921-16.929a4.194,4.194,0,0,1,3.883-2.485h56.535c-.311,4.194-.311,8.387-.932,12.581a66.239,66.239,0,0,1-12.736,30.442C108.7,159.51,94.1,168.673,75.618,171.158c-15.221,2.019-29.355-.932-41.78-10.251a48.785,48.785,0,0,1-19.725-34.48c-2.019-16.929,2.951-32.15,13.2-45.508C38.342,66.475,52.942,57.312,70.8,54.05c14.6-2.64,28.578-.932,41.159,7.61a48.686,48.686,0,0,1,18.017,21.9C130.911,84.958,130.289,85.735,128.426,86.2Z" style="fill:#00acd7"/><path d="M179.835,172.09c-14.134-.311-27.025-4.349-37.9-13.668a48.711,48.711,0,0,1-16.774-29.976c-2.8-17.551,2.019-33.082,12.581-46.905,11.338-14.91,25.006-22.676,43.488-25.938,15.842-2.8,30.753-1.243,44.265,7.921,12.27,8.387,19.88,19.725,21.9,34.635,2.64,20.968-3.417,38.052-17.861,52.652a71.17,71.17,0,0,1-37.276,19.88C188.067,171.469,183.874,171.624,179.835,172.09ZM216.8,109.343a44.7,44.7,0,0,0-.466-5.125c-2.8-15.376-16.929-24.074-31.684-20.657-14.444,3.262-23.763,12.425-27.18,27.025a25.579,25.579,0,0,0,14.289,29.355c8.542,3.728,17.085,3.262,25.317-.932C209.345,132.64,216.024,122.7,216.8,109.343Z" style="fill:#00acd7"/></svg>
|
||||
|
After Width: | Height: | Size: 2 KiB |
1
packages/web/public/languages/file_type_haskell.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_haskell</title><polygon points="2 25.882 8.588 16 2 6.118 6.941 6.118 13.529 16 6.941 25.882 2 25.882" style="fill:#453a62"/><polygon points="8.588 25.882 15.177 16 8.588 6.118 13.529 6.118 26.706 25.882 21.765 25.882 17.647 19.706 13.529 25.882 8.588 25.882" style="fill:#5e5086"/><polygon points="24.51 20.118 22.314 16.824 30 16.823 30 20.118 24.51 20.118" style="fill:#8f4e8b"/><polygon points="21.216 15.177 19.02 11.883 30 11.882 30 15.177 21.216 15.177" style="fill:#8f4e8b"/></svg>
|
||||
|
After Width: | Height: | Size: 566 B |
1
packages/web/public/languages/file_type_html.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_html</title><polygon points="5.902 27.201 3.655 2 28.345 2 26.095 27.197 15.985 30 5.902 27.201" style="fill:#e44f26"/><polygon points="16 27.858 24.17 25.593 26.092 4.061 16 4.061 16 27.858" style="fill:#f1662a"/><polygon points="16 13.407 11.91 13.407 11.628 10.242 16 10.242 16 7.151 15.989 7.151 8.25 7.151 8.324 7.981 9.083 16.498 16 16.498 16 13.407" style="fill:#ebebeb"/><polygon points="16 21.434 15.986 21.438 12.544 20.509 12.324 18.044 10.651 18.044 9.221 18.044 9.654 22.896 15.986 24.654 16 24.65 16 21.434" style="fill:#ebebeb"/><polygon points="15.989 13.407 15.989 16.498 19.795 16.498 19.437 20.507 15.989 21.437 15.989 24.653 22.326 22.896 22.372 22.374 23.098 14.237 23.174 13.407 22.341 13.407 15.989 13.407" style="fill:#fff"/><polygon points="15.989 7.151 15.989 9.071 15.989 10.235 15.989 10.242 23.445 10.242 23.445 10.242 23.455 10.242 23.517 9.548 23.658 7.981 23.732 7.151 15.989 7.151" style="fill:#fff"/></svg>
|
||||
|
After Width: | Height: | Size: 1,017 B |
1
packages/web/public/languages/file_type_java.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_java</title><path d="M12.325,23.654s-1.07.622.761.833a16.023,16.023,0,0,0,5.8-.246,10.088,10.088,0,0,0,1.541.752c-5.481,2.349-12.405-.136-8.1-1.339" style="fill:#5382a1"/><path d="M11.656,20.588s-1.2.888.633,1.078a22.618,22.618,0,0,0,7.481-.359,3.32,3.32,0,0,0,1.152.7c-6.627,1.938-14.009.153-9.266-1.421" style="fill:#5382a1"/><path d="M17.3,15.388a2.051,2.051,0,0,1-.355,2.954s3.429-1.77,1.854-3.987c-1.471-2.067-2.6-3.095,3.508-6.636,0,0-9.586,2.394-5.007,7.669" style="fill:#5382a1"/><path d="M24.552,25.921s.792.652-.872,1.157c-3.164.958-13.168,1.248-15.948.038-1-.435.874-1.038,1.464-1.164a3.8,3.8,0,0,1,.966-.108c-1.111-.783-7.181,1.537-3.083,2.2,11.176,1.812,20.372-.816,17.473-2.124" style="fill:#5382a1"/><path d="M12.84,17.412s-5.089,1.209-1.8,1.648a38.225,38.225,0,0,0,6.731-.072c2.106-.178,4.221-.555,4.221-.555a8.934,8.934,0,0,0-1.28.685c-5.168,1.359-15.151.727-12.277-.663a9.629,9.629,0,0,1,4.407-1.042" style="fill:#5382a1"/><path d="M21.969,22.515c5.253-2.73,2.824-5.353,1.129-5a3.932,3.932,0,0,0-.6.161.957.957,0,0,1,.449-.346c3.354-1.179,5.933,3.478-1.083,5.322a.458.458,0,0,0,.106-.138" style="fill:#5382a1"/><path d="M18.8,2s2.909,2.91-2.759,7.386c-4.546,3.59-1.037,5.637,0,7.975-2.653-2.394-4.6-4.5-3.294-6.463C14.664,8.019,19.976,6.623,18.8,2" style="fill:#5382a1"/><path d="M13.356,29.912c5.042.323,12.786-.179,12.969-2.565,0,0-.353.9-4.167,1.623a41.458,41.458,0,0,1-12.76.2s.645.533,3.959.746" style="fill:#5382a1"/></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
1
packages/web/public/languages/file_type_js_official.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_js_official</title><rect x="2" y="2" width="28" height="28" style="fill:#f5de19"/><path d="M20.809,23.875a2.866,2.866,0,0,0,2.6,1.6c1.09,0,1.787-.545,1.787-1.3,0-.9-.716-1.222-1.916-1.747l-.658-.282c-1.9-.809-3.16-1.822-3.16-3.964,0-1.973,1.5-3.476,3.853-3.476a3.889,3.889,0,0,1,3.742,2.107L25,18.128A1.789,1.789,0,0,0,23.311,17a1.145,1.145,0,0,0-1.259,1.128c0,.789.489,1.109,1.618,1.6l.658.282c2.236.959,3.5,1.936,3.5,4.133,0,2.369-1.861,3.667-4.36,3.667a5.055,5.055,0,0,1-4.795-2.691Zm-9.295.228c.413.733.789,1.353,1.693,1.353.864,0,1.41-.338,1.41-1.653V14.856h2.631v8.982c0,2.724-1.6,3.964-3.929,3.964a4.085,4.085,0,0,1-3.947-2.4Z"/></svg>
|
||||
|
After Width: | Height: | Size: 719 B |
1
packages/web/public/languages/file_type_json.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_json</title><path d="M4.014,14.976a2.51,2.51,0,0,0,1.567-.518A2.377,2.377,0,0,0,6.386,13.1,15.261,15.261,0,0,0,6.6,10.156q.012-2.085.075-2.747a5.236,5.236,0,0,1,.418-1.686,3.025,3.025,0,0,1,.755-1.018A3.046,3.046,0,0,1,9,4.125,6.762,6.762,0,0,1,10.544,4h.7V5.96h-.387a2.338,2.338,0,0,0-1.723.468A3.4,3.4,0,0,0,8.709,8.52a36.054,36.054,0,0,1-.137,4.133,4.734,4.734,0,0,1-.768,2.06A4.567,4.567,0,0,1,6.1,16a3.809,3.809,0,0,1,1.992,1.754,8.861,8.861,0,0,1,.618,3.865q0,2.435.05,2.9A1.755,1.755,0,0,0,9.264,25.7a2.639,2.639,0,0,0,1.592.337h.387V28h-.7a5.655,5.655,0,0,1-1.773-.2,2.97,2.97,0,0,1-1.324-.93,3.353,3.353,0,0,1-.681-1.63A24.175,24.175,0,0,1,6.6,22.006,16.469,16.469,0,0,0,6.386,18.9a2.408,2.408,0,0,0-.805-1.361,2.489,2.489,0,0,0-1.567-.524Z" style="fill:#f5de19"/><path d="M27.986,17.011a2.489,2.489,0,0,0-1.567.524,2.408,2.408,0,0,0-.805,1.361,16.469,16.469,0,0,0-.212,3.109,24.175,24.175,0,0,1-.169,3.234,3.353,3.353,0,0,1-.681,1.63,2.97,2.97,0,0,1-1.324.93,5.655,5.655,0,0,1-1.773.2h-.7V26.04h.387a2.639,2.639,0,0,0,1.592-.337,1.755,1.755,0,0,0,.506-1.186q.05-.462.05-2.9a8.861,8.861,0,0,1,.618-3.865A3.809,3.809,0,0,1,25.9,16a4.567,4.567,0,0,1-1.7-1.286,4.734,4.734,0,0,1-.768-2.06,36.054,36.054,0,0,1-.137-4.133,3.4,3.4,0,0,0-.425-2.092,2.338,2.338,0,0,0-1.723-.468h-.387V4h.7A6.762,6.762,0,0,1,23,4.125a3.046,3.046,0,0,1,1.149.581,3.025,3.025,0,0,1,.755,1.018,5.236,5.236,0,0,1,.418,1.686q.062.662.075,2.747a15.261,15.261,0,0,0,.212,2.947,2.377,2.377,0,0,0,.805,1.355,2.51,2.51,0,0,0,1.567.518Z" style="fill:#f5de19"/></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
1
packages/web/public/languages/file_type_julia.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_julia</title><circle cx="8.309" cy="22.592" r="5.86" style="fill:#d5635c"/><path d="M8.309,28.9a6.309,6.309,0,1,1,6.309-6.309A6.316,6.316,0,0,1,8.309,28.9Zm0-11.719a5.41,5.41,0,1,0,5.41,5.41A5.416,5.416,0,0,0,8.309,17.182Z" style="fill:#cb3c33"/><circle cx="16" cy="9.408" r="5.86" style="fill:#60ad51"/><path d="M16,15.717a6.309,6.309,0,1,1,6.309-6.309A6.316,6.316,0,0,1,16,15.717ZM16,4a5.41,5.41,0,1,0,5.41,5.41A5.416,5.416,0,0,0,16,4Z" style="fill:#389826"/><circle cx="23.691" cy="22.592" r="5.86" style="fill:#aa79c1"/><path d="M23.691,28.9A6.309,6.309,0,1,1,30,22.592,6.316,6.316,0,0,1,23.691,28.9Zm0-11.719a5.41,5.41,0,1,0,5.41,5.41A5.416,5.416,0,0,0,23.691,17.182Z" style="fill:#9558b2"/></svg>
|
||||
|
After Width: | Height: | Size: 779 B |
1
packages/web/public/languages/file_type_kotlin.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><linearGradient id="a" x1="311.336" y1="1452.064" x2="283.342" y2="1480.058" gradientTransform="translate(-281.4 -1450)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#e44857"/><stop offset="0.47" stop-color="#9d4b9d"/><stop offset="1" stop-color="#6d5faa"/></linearGradient></defs><title>file_type_kotlin</title><path d="M30,30H2V2H30L16,16Z" style="fill:url(#a)"/></svg>
|
||||
|
After Width: | Height: | Size: 495 B |
1
packages/web/public/languages/file_type_lua.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_lua</title><path d="M16.5,30l-.011-.321c.4-.014.8-.045,1.19-.094l.039.319C17.312,29.952,16.9,29.984,16.5,30Zm-1.222-.011c-.4-.021-.814-.061-1.216-.118l.045-.318c.393.055.793.094,1.188.115ZM18.92,29.7l-.067-.314c.387-.083.776-.184,1.155-.3l.094.307C19.714,29.511,19.316,29.615,18.92,29.7Zm-6.063-.053c-.4-.091-.791-.2-1.177-.326l.1-.306c.377.122.764.23,1.15.319Zm8.4-.665-.121-.3c.364-.148.728-.314,1.08-.493l.006,0,.145.286,0,0C22,28.661,21.626,28.831,21.253,28.982Zm-10.718-.088c-.374-.158-.745-.335-1.1-.524l.15-.284c.35.186.713.358,1.078.512Zm12.893-1.021-.17-.273c.337-.21.668-.437.984-.675l.193.257C24.111,27.425,23.772,27.658,23.428,27.873ZM8.379,27.751c-.341-.22-.676-.459-1-.708l.2-.253c.312.243.64.476.972.691Zm17-1.346-.215-.239c.294-.265.58-.546.851-.836l.235.219C25.972,25.846,25.679,26.134,25.378,26.4ZM6.454,26.252c-.3-.276-.585-.569-.856-.87l.239-.215c.265.294.547.58.836.85ZM27.041,24.62l-.253-.2c.244-.312.476-.639.692-.972l.27.175C27.529,23.966,27.29,24.3,27.041,24.62ZM4.82,24.439c-.244-.324-.476-.662-.692-1.007l.272-.17c.21.337.438.668.676.984Zm23.547-1.867-.284-.151c.186-.35.358-.713.513-1.078l.3.125C28.735,21.843,28.558,22.214,28.368,22.572Zm-24.841-.2-.006-.012c-.183-.359-.352-.728-.5-1.1l.3-.121c.147.362.312.724.491,1.074l.006.012ZM29.32,20.325l-.306-.1c.122-.377.23-.764.319-1.15l.313.072C29.555,19.543,29.446,19.939,29.32,20.325ZM2.608,20.107c-.12-.388-.223-.786-.308-1.182l.314-.067c.083.387.184.776.3,1.155ZM29.87,17.946l-.318-.045c.056-.393.094-.793.115-1.188l.321.017C29.967,17.135,29.927,17.544,29.87,17.946ZM2.1,17.72c-.05-.4-.082-.812-.1-1.218l.321-.011c.014.4.046.8.094,1.19Zm27.582-2.2c-.014-.4-.045-.8-.093-1.19l.319-.039c.049.4.082.813.1,1.218ZM2.331,15.3,2.01,15.28c.021-.405.061-.814.117-1.216l.318.045C2.39,14.5,2.352,14.9,2.331,15.3Zm27.057-2.144c-.083-.387-.184-.776-.3-1.155L29.4,11.9c.119.388.223.786.307,1.183ZM2.663,12.934l-.313-.072c.091-.4.2-.791.326-1.177l.306.1C2.859,12.161,2.752,12.548,2.663,12.934Zm26.026-2.062c-.149-.366-.315-.732-.5-1.086l.286-.146c.185.363.355.736.507,1.111ZM3.4,10.665l-.3-.125c.158-.374.334-.745.524-1.1l.284.15C3.724,9.937,3.552,10.3,3.4,10.665ZM4.513,8.557l-.27-.174c.22-.341.458-.676.707-1l.254.2C4.961,7.9,4.728,8.224,4.513,8.557ZM5.977,6.676l-.235-.219c.276-.3.569-.585.87-.857l.215.239C6.533,6.1,6.247,6.386,5.977,6.676Zm1.77-1.6-.193-.257c.323-.244.662-.477,1.007-.692l.17.272C8.394,4.614,8.063,4.841,7.747,5.079Zm15.705-.558-.018-.012.175-.27.018.011Zm-1.047-.616c-.35-.186-.713-.358-1.078-.512l.125-.3c.374.158.745.334,1.1.524ZM9.769,3.815l-.146-.286.018-.009c.356-.181.724-.349,1.093-.5l.121.3c-.361.147-.72.311-1.068.488Zm10.44-.838c-.377-.122-.764-.229-1.151-.317l.072-.313c.4.091.792.2,1.178.325Zm-8.229-.06-.094-.307c.388-.119.786-.223,1.182-.308l.067.314C12.747,2.7,12.359,2.8,11.98,2.917Zm5.9-.473c-.393-.055-.793-.092-1.188-.113l.016-.321c.405.021.814.059,1.216.115Zm-3.572-.026-.04-.319c.4-.05.812-.083,1.218-.1l.012.321C15.106,2.337,14.705,2.369,14.312,2.418Z" style="fill:gray"/><circle cx="16" cy="15.998" r="10.708" style="fill:navy"/><circle cx="20.435" cy="11.562" r="3.136" style="fill:#fff"/><circle cx="26.708" cy="5.29" r="3.137" style="fill:navy"/><path d="M13.1,21.352v-.79H9.629V14.326h-.9v7.026H13.1" style="fill:#fff"/><path d="M17.916,21.352V16.3h-.8v2.785c0,1.031-.54,1.706-1.378,1.706A.95.95,0,0,1,14.7,19.8V16.3h-.8v3.817c0,.838.626,1.378,1.609,1.378a1.863,1.863,0,0,0,1.687-.925v.781h.723" style="fill:#fff"/><path d="M23.791,21.333v-.607a.664.664,0,0,1-.173.019c-.279,0-.434-.145-.434-.4V17.536c0-.9-.655-1.378-1.9-1.378-1.224,0-1.976.472-2.024,1.638h.81c.067-.617.434-.9,1.185-.9.723,0,1.128.27,1.128.752v.212c0,.337-.2.482-.838.559a5.763,5.763,0,0,0-1.619.308,1.327,1.327,0,0,0-.887,1.311c0,.916.636,1.455,1.658,1.455a2.363,2.363,0,0,0,1.715-.742.855.855,0,0,0,.829.665,1.967,1.967,0,0,0,.549-.087m-1.407-1.725a1.366,1.366,0,0,1-1.513,1.185c-.626,0-.993-.222-.993-.771,0-.53.357-.761,1.214-.887a4,4,0,0,0,1.291-.279v.752" style="fill:#fff"/></svg>
|
||||
|
After Width: | Height: | Size: 4 KiB |
1
packages/web/public/languages/file_type_markdown.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_markdown</title><rect x="2.5" y="7.955" width="27" height="16.091" style="fill:none;stroke:#755838"/><polygon points="5.909 20.636 5.909 11.364 8.636 11.364 11.364 14.773 14.091 11.364 16.818 11.364 16.818 20.636 14.091 20.636 14.091 15.318 11.364 18.727 8.636 15.318 8.636 20.636 5.909 20.636" style="fill:#755838"/><polygon points="22.955 20.636 18.864 16.136 21.591 16.136 21.591 11.364 24.318 11.364 24.318 16.136 27.045 16.136 22.955 20.636" style="fill:#755838"/></svg>
|
||||
|
After Width: | Height: | Size: 552 B |
1
packages/web/public/languages/file_type_matlab.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><linearGradient id="a" x1="16.803" y1="16.631" x2="15.013" y2="22.411" gradientTransform="matrix(1, 0, 0, -1, 0, 32)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#512"/><stop offset="0.23" stop-color="#523"/><stop offset="0.36" stop-color="#534"/><stop offset="0.51" stop-color="#645"/><stop offset="0.66" stop-color="#568"/><stop offset="0.84" stop-color="#29d"/></linearGradient><linearGradient id="b" x1="29.71" y1="18.983" x2="11.71" y2="14.563" gradientUnits="userSpaceOnUse"><stop offset="0.081" stop-color="#c33"/><stop offset="0.189" stop-color="#de5239"/><stop offset="0.313" stop-color="#f06e3e"/><stop offset="0.421" stop-color="#fa8042"/><stop offset="0.5" stop-color="#fe8643"/><stop offset="0.58" stop-color="#fa7f42"/><stop offset="0.696" stop-color="#ef6c3e"/><stop offset="0.833" stop-color="#dc4c37"/><stop offset="0.916" stop-color="#cf3633"/></linearGradient></defs><title>file_type_matlab</title><path d="M2,17.55l7.97-3.22a20.7,20.7,0,0,1,2.72-2.95c.66-.35,1.9-.16,4.17-2.98,2.2-2.75,2.9-5.1,3.93-5.1,1.63,0,2.83,3.52,4.65,8.85A115.629,115.629,0,0,0,30,24.12c-1.9-1.77-3.52-3.68-5.37-3.63-1.72.04-3.63,2.08-5.72,4.7-1.66,2.1-3.86,3.54-4.72,3.51,0,0-2.22-6.28-4.08-7.3a2.641,2.641,0,0,0-2.39.2L2,17.54Z" style="fill:#49d"/><path d="M19.8,4.02c-.67.9-1.48,2.55-2.94,4.38-2.27,2.82-3.5,2.63-4.17,2.98a19.674,19.674,0,0,0-2.72,2.95l3.3,2.41c2.8-3.82,4.3-7.96,5.47-10.64A13.579,13.579,0,0,1,19.8,4.02Z" style="fill:url(#a)"/><path d="M20.8,3.3c-2.18,0-3.67,11.48-11.72,17.89,2.26-.37,4.22,5.24,5.12,7.51,4-.68,7.2-8.33,10.43-8.21,1.85.07,3.47,1.86,5.37,3.63C25.66,15,23.63,3.3,20.8,3.3Z" style="fill:url(#b)"/></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
1
packages/web/public/languages/file_type_objectivec.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_objectivec</title><path d="M11.29,15.976a8.892,8.892,0,0,0,1.039,4.557,4.818,4.818,0,0,0,5.579,2.13,3.789,3.789,0,0,0,2.734-3.181c.095-.535.1-.54.1-.54,1.537.222,4.014.582,5.55.8l-.1.389A9.958,9.958,0,0,1,23.8,24.9a8.35,8.35,0,0,1-4.747,2.378,12.925,12.925,0,0,1-7.322-.725,8.98,8.98,0,0,1-5.106-5.524A14.353,14.353,0,0,1,6.642,10.9a9.323,9.323,0,0,1,7.929-6.24,11.812,11.812,0,0,1,5.9.491,8.467,8.467,0,0,1,5.456,6.1c.083.311.1.369.1.369-1.709.311-3.821.705-5.518,1.075C20.186,11,19.387,9.666,17.678,9.25a4.656,4.656,0,0,0-5.853,3.158,9.28,9.28,0,0,0-.341,1.273A10.89,10.89,0,0,0,11.29,15.976Z" style="fill:#c2c2c2"/><polygon points="2.033 30 2.033 2 7.967 2 7.967 4.227 4.723 4.227 4.723 27.773 7.967 27.773 7.967 30 2.033 30" style="fill:#c2c2c2"/><polygon points="29.967 29.999 24.033 29.999 24.033 27.771 27.277 27.771 27.277 4.226 24.033 4.226 24.033 1.999 29.967 1.999 29.967 29.999" style="fill:#c2c2c2"/></svg>
|
||||
|
After Width: | Height: | Size: 996 B |
1
packages/web/public/languages/file_type_ocaml.svg
Normal file
|
After Width: | Height: | Size: 5 KiB |
1
packages/web/public/languages/file_type_perl.svg
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
1
packages/web/public/languages/file_type_php3.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_php3</title><path d="M7.6,13.791a2.352,2.352,0,0,1,1.745.483,1.916,1.916,0,0,1,.207,1.66,2.78,2.78,0,0,1-.918,1.748,3.375,3.375,0,0,1-2.07.529h-1.4L6.024,13.8ZM2,22.677H4.3l.545-2.8H6.812A7.049,7.049,0,0,0,8.956,19.6a4.06,4.06,0,0,0,1.53-.918A4.585,4.585,0,0,0,11.93,16.1a3.288,3.288,0,0,0-.55-2.922A3.671,3.671,0,0,0,8.47,12.129H4.057Z" style="fill:#8993be"/><path d="M13.617,9.323H15.9l-.553,2.8h2.031a3.956,3.956,0,0,1,2.645.669,2.213,2.213,0,0,1,.436,2.167l-.954,4.909H17.195l.908-4.667a1.267,1.267,0,0,0-.114-1.086,1.6,1.6,0,0,0-1.144-.286H15.022l-1.175,6.044H11.559Z" style="fill:#8993be"/><path d="M25.539,13.791a2.352,2.352,0,0,1,1.745.483,1.916,1.916,0,0,1,.207,1.66,2.78,2.78,0,0,1-.918,1.748,3.375,3.375,0,0,1-2.074.529H23.1l.858-4.416Zm-5.6,8.886h2.3l.545-2.8h1.968A7.049,7.049,0,0,0,26.9,19.6a4.06,4.06,0,0,0,1.53-.918A4.585,4.585,0,0,0,29.869,16.1a3.288,3.288,0,0,0-.55-2.922,3.671,3.671,0,0,0-2.909-1.046h-4.42Z" style="fill:#8993be"/></svg>
|
||||
|
After Width: | Height: | Size: 1 KiB |
1
packages/web/public/languages/file_type_powershell.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><linearGradient id="a" x1="23.325" y1="-118.543" x2="7.26" y2="-104.193" gradientTransform="matrix(1, 0, 0, -1, 0, -96)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#5391fe"/><stop offset="1" stop-color="#3e6dbf"/></linearGradient><linearGradient id="b" x1="7.1" y1="-104.002" x2="23.001" y2="-118.292" xlink:href="#a"/></defs><title>file_type_powershell</title><path d="M3.174,26.589a1.154,1.154,0,0,1-.928-.423,1.234,1.234,0,0,1-.21-1.052L6.233,6.78A1.8,1.8,0,0,1,7.914,5.41H28.826a1.157,1.157,0,0,1,.928.423,1.235,1.235,0,0,1,.21,1.052l-4.2,18.335a1.8,1.8,0,0,1-1.681,1.37H3.174Z" style="fill-rule:evenodd;fill:url(#a)"/><path d="M7.914,5.646H28.826a.913.913,0,0,1,.908,1.187l-4.2,18.334a1.575,1.575,0,0,1-1.451,1.187H3.174a.913.913,0,0,1-.908-1.187l4.2-18.334A1.574,1.574,0,0,1,7.914,5.646Z" style="fill-rule:evenodd;fill:url(#b)"/><path d="M16.04,21.544h5.086a1.118,1.118,0,0,1,0,2.234H16.04a1.118,1.118,0,0,1,0-2.234Z" style="fill:#2c5591;fill-rule:evenodd"/><path d="M19.339,16.578a1.762,1.762,0,0,1-.591.6L9.309,23.953a1.224,1.224,0,0,1-1.438-1.977l8.512-6.164v-.126L11.035,10a1.224,1.224,0,0,1,1.782-1.672l6.418,6.827A1.166,1.166,0,0,1,19.339,16.578Z" style="fill:#2c5591;fill-rule:evenodd"/><path d="M19.1,16.342a1.749,1.749,0,0,1-.59.6L9.074,23.718a1.225,1.225,0,0,1-1.439-1.977l8.513-6.164V15.45L10.8,9.761a1.224,1.224,0,0,1,1.783-1.672L19,14.916A1.162,1.162,0,0,1,19.1,16.342Z" style="fill:#fff;fill-rule:evenodd"/><path d="M15.9,21.412h5.086a1.059,1.059,0,1,1,0,2.118H15.9a1.059,1.059,0,1,1,0-2.118Z" style="fill:#fff;fill-rule:evenodd"/></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
1
packages/web/public/languages/file_type_python.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><linearGradient id="a" x1="-133.268" y1="-202.91" x2="-133.198" y2="-202.84" gradientTransform="translate(25243.061 38519.17) scale(189.38 189.81)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#387eb8"/><stop offset="1" stop-color="#366994"/></linearGradient><linearGradient id="b" x1="-133.575" y1="-203.203" x2="-133.495" y2="-203.133" gradientTransform="translate(25309.061 38583.42) scale(189.38 189.81)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffe052"/><stop offset="1" stop-color="#ffc331"/></linearGradient></defs><title>file_type_python</title><path d="M15.885,2.1c-7.1,0-6.651,3.07-6.651,3.07V8.36h6.752v1H6.545S2,8.8,2,16.005s4.013,6.912,4.013,6.912H8.33V19.556s-.13-4.013,3.9-4.013h6.762s3.772.06,3.772-3.652V5.8s.572-3.712-6.842-3.712h0ZM12.153,4.237a1.214,1.214,0,1,1-1.183,1.244v-.02a1.214,1.214,0,0,1,1.214-1.214h0Z" style="fill:url(#a)"/><path d="M16.085,29.91c7.1,0,6.651-3.08,6.651-3.08V23.65H15.985v-1h9.47S30,23.158,30,15.995s-4.013-6.912-4.013-6.912H23.64V12.4s.13,4.013-3.9,4.013H12.975S9.2,16.356,9.2,20.068V26.2s-.572,3.712,6.842,3.712h.04Zm3.732-2.147A1.214,1.214,0,1,1,21,26.519v.03a1.214,1.214,0,0,1-1.214,1.214h.03Z" style="fill:url(#b)"/></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
1
packages/web/public/languages/file_type_r.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><linearGradient id="a" x1="-134.811" y1="-103.284" x2="-134.772" y2="-103.323" gradientTransform="matrix(721.094, 0, 0, -482.937, 97213.595, -49874.512)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#cbced0"/><stop offset="1" stop-color="#84838b"/></linearGradient><linearGradient id="b" x1="-135.378" y1="-102.985" x2="-135.339" y2="-103.024" gradientTransform="matrix(398, 0, 0, -406.124, 53893, -41812.836)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#276dc3"/><stop offset="1" stop-color="#165caa"/></linearGradient></defs><title>file_type_r</title><path d="M16,23.956c-7.732,0-14-4.2-14-9.376S8.268,5.2,16,5.2,30,9.4,30,14.58,23.732,23.956,16,23.956ZM18.143,8.87C12.266,8.87,7.5,11.74,7.5,15.28s4.764,6.41,10.641,6.41,10.214-1.962,10.214-6.41S24.02,8.87,18.143,8.87Z" style="fill:url(#a)"/><path d="M23.321,19.726a10.545,10.545,0,0,1,1.34.5,2.591,2.591,0,0,1,.68.485,1.835,1.835,0,0,1,.311.447l3.339,5.63-5.4,0-2.524-4.74a6.1,6.1,0,0,0-.835-1.145.879.879,0,0,0-.641-.291H18.311v6.173l-4.776,0V11.026h9.591S27.5,11.1,27.5,15.261,23.321,19.726,23.321,19.726Zm-2.077-5.28-2.891,0v2.681h2.893a1.323,1.323,0,0,0,1.34-1.364A1.247,1.247,0,0,0,21.244,14.447Z" style="fill:url(#b)"/></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
1
packages/web/public/languages/file_type_ruby.svg
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
1
packages/web/public/languages/file_type_rust.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><radialGradient id="a" cx="-492.035" cy="-883.37" r="13.998" gradientTransform="matrix(0.866, -0.5, -0.3, -0.52, 177.106, -689.033)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7d7d7d"/><stop offset="0.267" stop-color="#7e7c7a"/><stop offset="0.45" stop-color="#817871"/><stop offset="0.608" stop-color="#867162"/><stop offset="0.753" stop-color="#8d684c"/><stop offset="0.886" stop-color="#965c30"/><stop offset="1" stop-color="#a04f12"/></radialGradient></defs><title>file_type_rust</title><path d="M15.124,5.3a.832.832,0,1,1,.832.832h0a.831.831,0,0,1-.832-.832M5.2,12.834a.832.832,0,1,1,.832.832h0a.832.832,0,0,1-.832-.832m19.856.039a.832.832,0,1,1,.832.832.831.831,0,0,1-.832-.832h0M7.605,14.013a.76.76,0,0,0,.386-1l-.369-.835H9.074v6.545H6.144a10.247,10.247,0,0,1-.332-3.911Zm6.074.161V12.245h3.458c.179,0,1.261.206,1.261,1.016,0,.672-.83.913-1.513.913ZM8.958,24.561a.832.832,0,1,1,.832.832.831.831,0,0,1-.832-.832h0m12.331.039a.832.832,0,1,1,.832.832.832.832,0,0,1-.832-.832h0m.257-1.887a.758.758,0,0,0-.9.584l-.418,1.949a10.249,10.249,0,0,1-8.545-.041l-.417-1.949a.759.759,0,0,0-.9-.583h0l-1.721.37a10.233,10.233,0,0,1-.89-1.049h8.374c.095,0,.158-.017.158-.1V18.928c0-.086-.063-.1-.158-.1h-2.45V16.947h2.649a1.665,1.665,0,0,1,1.629,1.412c.105.413.336,1.757.494,2.187.157.483.8,1.447,1.482,1.447h4.323a10.243,10.243,0,0,1-.949,1.1Zm4.65-7.821a10.261,10.261,0,0,1,.022,1.779H25.167c-.105,0-.148.069-.148.172v.483c0,1.136-.641,1.384-1.2,1.447-.535.06-1.128-.224-1.2-.551a3.616,3.616,0,0,0-1.671-2.808c1.03-.654,2.1-1.619,2.1-2.911A3.292,3.292,0,0,0,21.44,9.8a4.559,4.559,0,0,0-2.2-.724H8.367A10.246,10.246,0,0,1,14.1,5.84l1.282,1.344a.758.758,0,0,0,1.072.026h0l1.434-1.372a10.248,10.248,0,0,1,7.015,5l-.982,2.217a.761.761,0,0,0,.386,1Zm2.448.036-.033-.343,1.011-.943a.42.42,0,0,0-.013-.595.428.428,0,0,0-.121-.081L28.2,12.483l-.1-.334.806-1.12a.422.422,0,0,0-.13-.581.43.43,0,0,0-.133-.055l-1.363-.222-.164-.306.573-1.257a.419.419,0,0,0-.236-.544.426.426,0,0,0-.146-.029l-1.383.048L25.7,7.819l.318-1.347a.421.421,0,0,0-.343-.487.435.435,0,0,0-.144,0L24.183,6.3l-.266-.219L23.966,4.7a.421.421,0,0,0-.431-.411.426.426,0,0,0-.141.028l-1.257.573-.306-.164-.222-1.363a.421.421,0,0,0-.5-.318.43.43,0,0,0-.133.055l-1.121.806-.333-.1-.483-1.293a.421.421,0,0,0-.555-.215.442.442,0,0,0-.12.08L17.418,3.39l-.343-.033L16.347,2.18a.421.421,0,0,0-.688,0l-.728,1.177-.343.033-.943-1.012a.421.421,0,0,0-.595.015.442.442,0,0,0-.08.12L12.483,3.8l-.333.1-1.12-.8a.422.422,0,0,0-.581.13.43.43,0,0,0-.055.133l-.222,1.363-.306.164L8.608,4.317a.421.421,0,0,0-.544.239.444.444,0,0,0-.028.144l.048,1.383L7.818,6.3,6.471,5.984a.421.421,0,0,0-.487.343.435.435,0,0,0,0,.144L6.3,7.819l-.218.265L4.7,8.036a.422.422,0,0,0-.383.573L4.89,9.866l-.164.306-1.363.222a.42.42,0,0,0-.318.5.43.43,0,0,0,.055.133l.806,1.12-.1.334-1.293.483a.421.421,0,0,0-.215.555.414.414,0,0,0,.081.121l1.011.943-.033.343-1.177.728a.421.421,0,0,0,0,.688l1.177.728.033.343-1.011.943a.421.421,0,0,0,.015.595.436.436,0,0,0,.119.08l1.293.483.1.334L3.1,20.972a.421.421,0,0,0,.131.581.43.43,0,0,0,.133.055l1.363.222.164.307-.573,1.257a.422.422,0,0,0,.24.545.438.438,0,0,0,.143.028l1.383-.048.219.266-.317,1.348a.42.42,0,0,0,.341.486.4.4,0,0,0,.146,0L7.818,25.7l.266.218L8.035,27.3a.419.419,0,0,0,.429.41.413.413,0,0,0,.143-.028l1.257-.573.306.164.222,1.362a.421.421,0,0,0,.5.319.407.407,0,0,0,.133-.055l1.12-.807.334.1.483,1.292a.422.422,0,0,0,.556.214.436.436,0,0,0,.119-.08l.943-1.011.343.034.728,1.177a.422.422,0,0,0,.588.1.413.413,0,0,0,.1-.1l.728-1.177.343-.034.943,1.011a.421.421,0,0,0,.595-.015.436.436,0,0,0,.08-.119l.483-1.292.334-.1,1.12.807a.421.421,0,0,0,.581-.131.43.43,0,0,0,.055-.133l.222-1.362.306-.164,1.257.573a.421.421,0,0,0,.544-.239.438.438,0,0,0,.028-.143l-.048-1.384.265-.218,1.347.317a.421.421,0,0,0,.487-.34.447.447,0,0,0,0-.146L25.7,24.183l.218-.266,1.383.048a.421.421,0,0,0,.41-.431.4.4,0,0,0-.028-.142l-.573-1.257.164-.307,1.363-.222a.421.421,0,0,0,.319-.5.434.434,0,0,0-.056-.135l-.806-1.12.1-.334,1.293-.483a.42.42,0,0,0,.215-.554.414.414,0,0,0-.081-.121l-1.011-.943.033-.343,1.177-.728a.421.421,0,0,0,0-.688Z" style="fill:url(#a)"/></svg>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
1
packages/web/public/languages/file_type_shell.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_shell</title><path d="M29.4,27.6H2.5V4.5H29.4Zm-25.9-1H28.4V5.5H3.5Z" style="fill:#d9b400"/><polygon points="6.077 19.316 5.522 18.484 10.366 15.255 5.479 11.184 6.12 10.416 12.035 15.344 6.077 19.316" style="fill:#d9b400"/><rect x="12.7" y="18.2" width="7.8" height="1" style="fill:#d9b400"/><rect x="2.5" y="5.5" width="26.9" height="1.9" style="fill:#d9b400"/></svg>
|
||||
|
After Width: | Height: | Size: 446 B |
1
packages/web/public/languages/file_type_swift.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><linearGradient id="a" x1="-134.494" y1="-171.82" x2="-134.497" y2="-171.89" gradientTransform="matrix(240, 0, 0, -205.6, 32295, -35312.585)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f88535"/><stop offset="1" stop-color="#fd2221"/></linearGradient></defs><title>file_type_swift</title><path d="M19.422,4.007s6.217,3.554,7.844,9.2c1.466,5.1.292,7.534.292,7.534a8.915,8.915,0,0,1,1.742,2.8,4.825,4.825,0,0,1,.29,4.453s-.1-2.08-3.2-2.511c-2.841-.4-3.874,2.366-9.3,2.232A18.435,18.435,0,0,1,2,19.354C4.651,20.8,8.124,23.045,12.449,22.7s5.228-1.674,5.228-1.674A66.9,66.9,0,0,1,4.891,7.643c3.4,2.845,11.822,8.507,11.626,8.363A75.826,75.826,0,0,1,8.092,6.24S20.728,16.629,21.745,16.563c.418-.861,2.579-5.318-2.324-12.557Z" style="fill:url(#a)"/></svg>
|
||||
|
After Width: | Height: | Size: 873 B |
1
packages/web/public/languages/file_type_tex.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_tex</title><path d="M11.333,13.122c-.128-1.562-.241-2.756-2.287-2.756H7.91v8.4h2.145v.611l-3.083-.029-3.082.029v-.611H6.034v-8.4H4.884c-2.046,0-2.159,1.208-2.287,2.756H2l.284-3.367h9.362l.284,3.367h-.6Z" style="fill:#cfcfcf"/><path d="M19.289,22.53H10.41V21.92h1.506V13.467H10.41v-.611h8.637l.412,3.367h-.6c-.213-1.833-.682-2.756-2.855-2.756H13.791V17.2h.838c1.364,0,1.505-.6,1.505-1.662h.6v3.935h-.6c0-1.08-.142-1.662-1.505-1.662h-.838v4.106h2.216c2.472,0,3-1.108,3.3-3.225h.6Z" style="fill:#cfcfcf"/><path d="M27.727,19.186c-.54,0-1.96,0-2.415.029V18.6h1.179l-2.557-3.552-2.529,3.381A4.1,4.1,0,0,0,22.7,18.6v.611c-.355-.029-1.576-.029-2.017-.029-.4,0-1.548,0-1.875.029V18.6h.383a7.459,7.459,0,0,0,.824-.043c.5-.043.54-.085.667-.256L23.536,14.5l-3.153-4.418H19V9.47c.384.028,1.79.028,2.273.028.582,0,1.918,0,2.429-.028v.611H22.528l2.117,2.955,2.074-2.784a4.1,4.1,0,0,0-1.293-.17V9.47c.356.028,1.591.028,2.032.028.4,0,1.534,0,1.861-.028v.611h-.369a5.264,5.264,0,0,0-.838.043c-.469.043-.526.071-.667.256l-2.4,3.21L28.636,18.6H30v.611C29.645,19.186,28.182,19.186,27.727,19.186Z" style="fill:#cfcfcf"/></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
1
packages/web/public/languages/file_type_text.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_text</title><path d="M22.038,2H6.375a1.755,1.755,0,0,0-1.75,1.75v24.5A1.755,1.755,0,0,0,6.375,30h19.25a1.755,1.755,0,0,0,1.75-1.75V6.856Zm.525,2.844,1.663,1.531H22.563ZM6.375,28.25V3.75H20.813V8.125h4.813V28.25Z" style="fill:#c2c2c2"/><rect x="8.125" y="15.097" width="13.076" height="1.75" style="fill:#829ec2"/><rect x="8.125" y="24.439" width="9.762" height="1.75" style="fill:#829ec2"/><rect x="8.125" y="19.763" width="15.75" height="1.75" style="fill:#829ec2"/><rect x="8.125" y="10.23" width="15.75" height="1.75" style="fill:#829ec2"/></svg>
|
||||
|
After Width: | Height: | Size: 626 B |
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_typescript_official</title><rect x="2" y="2" width="28" height="28" rx="1.312" style="fill:#3178c6"/><path d="M18.245,23.759v3.068a6.492,6.492,0,0,0,1.764.575,11.56,11.56,0,0,0,2.146.192,9.968,9.968,0,0,0,2.088-.211,5.11,5.11,0,0,0,1.735-.7,3.542,3.542,0,0,0,1.181-1.266,4.469,4.469,0,0,0,.186-3.394,3.409,3.409,0,0,0-.717-1.117,5.236,5.236,0,0,0-1.123-.877,12.027,12.027,0,0,0-1.477-.734q-.6-.249-1.08-.484a5.5,5.5,0,0,1-.813-.479,2.089,2.089,0,0,1-.516-.518,1.091,1.091,0,0,1-.181-.618,1.039,1.039,0,0,1,.162-.571,1.4,1.4,0,0,1,.459-.436,2.439,2.439,0,0,1,.726-.283,4.211,4.211,0,0,1,.956-.1,5.942,5.942,0,0,1,.808.058,6.292,6.292,0,0,1,.856.177,5.994,5.994,0,0,1,.836.3,4.657,4.657,0,0,1,.751.422V13.9a7.509,7.509,0,0,0-1.525-.4,12.426,12.426,0,0,0-1.9-.129,8.767,8.767,0,0,0-2.064.235,5.239,5.239,0,0,0-1.716.733,3.655,3.655,0,0,0-1.171,1.271,3.731,3.731,0,0,0-.431,1.845,3.588,3.588,0,0,0,.789,2.34,6,6,0,0,0,2.395,1.639q.63.26,1.175.509a6.458,6.458,0,0,1,.942.517,2.463,2.463,0,0,1,.626.585,1.2,1.2,0,0,1,.23.719,1.1,1.1,0,0,1-.144.552,1.269,1.269,0,0,1-.435.441,2.381,2.381,0,0,1-.726.292,4.377,4.377,0,0,1-1.018.105,5.773,5.773,0,0,1-1.969-.35A5.874,5.874,0,0,1,18.245,23.759Zm-5.154-7.638h4V13.594H5.938v2.527H9.92V27.375h3.171Z" style="fill:#fff;fill-rule:evenodd"/></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
1
packages/web/public/languages/file_type_yaml.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_yaml</title><path d="M2,12.218c.755,0,1.51-.008,2.264,0l.053.038Q5.7,13.638,7.078,15.014c.891-.906,1.8-1.794,2.7-2.7.053-.052.11-.113.192-.1.608,0,1.215,0,1.823,0a1.4,1.4,0,0,1,.353.019c-.7.67-1.377,1.369-2.069,2.05L5.545,18.8c-.331.324-.648.663-.989.975-.754.022-1.511.007-2.266.007,1.223-1.209,2.431-2.433,3.658-3.637C4.627,14.841,3.318,13.525,2,12.218Z" style="fill:#ffe885"/><path d="M12.7,12.218c.613,0,1.226,0,1.839,0q0,3.783,0,7.566c-.611,0-1.222.012-1.832-.008,0-1.664,0-3.329,0-4.994-1.6,1.607-3.209,3.2-4.811,4.8-.089.08-.166.217-.305.194-.824-.006-1.649,0-2.474,0Q8.916,16,12.7,12.218Z" style="fill:#ffe885"/><path d="M14.958,12.22c.47-.009.939,0,1.409,0,.836.853,1.69,1.689,2.536,2.532q1.268-1.267,2.539-2.532.7,0,1.4,0-.008,3.784,0,7.567c-.471,0-.943.006-1.414,0q.008-2.387,0-4.773c-.844.843-1.676,1.7-2.526,2.536-.856-.835-1.687-1.695-2.532-2.541,0,1.594-.006,3.188.006,4.781-.472,0-.943.005-1.415,0Q14.958,16,14.958,12.22Z" style="fill:#ffe885"/><path d="M23.259,12.217c.472,0,.944-.007,1.416,0q-.007,3.083,0,6.166c1.26,0,2.521,0,3.782,0,.063.006.144-.012.191.045.448.454.907.9,1.353,1.354q-3.371.007-6.741,0Q23.267,16,23.259,12.217Z" style="fill:#ffe885"/></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
1
packages/web/public/languages/file_type_zig.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_zig</title><polygon points="5.733 19.731 5.733 12.264 8.533 12.264 8.533 8.531 2 8.531 2 23.464 5.547 23.464 8.907 19.731 5.733 19.731" style="fill:#f7a41d"/><polygon points="26.453 8.531 23.093 12.264 26.267 12.264 26.267 19.731 23.467 19.731 23.467 23.464 30 23.464 30 8.531 26.453 8.531" style="fill:#f7a41d"/><polygon points="26.875 6.707 20.513 8.531 9.467 8.531 9.467 12.264 16.847 12.264 5.115 25.293 11.497 23.464 22.533 23.464 22.533 19.731 15.148 19.731 26.875 6.707" style="fill:#f7a41d"/></svg>
|
||||
|
After Width: | Height: | Size: 583 B |
|
|
@ -85,4 +85,12 @@
|
|||
|
||||
.cm-editor .cm-searchMatch-selected {
|
||||
border: solid;
|
||||
}
|
||||
|
||||
.truncate-start {
|
||||
direction: rtl;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
|
@ -64,7 +64,7 @@ const RepositoryBadge = ({
|
|||
repoIcon: <Image
|
||||
src={info.icon}
|
||||
alt={info.costHostName}
|
||||
className={`w-4 h-4 ${info.iconClassname}`}
|
||||
className={`w-4 h-4 ${info.iconClassName}`}
|
||||
/>,
|
||||
repoName: info.repoName,
|
||||
repoLink: info.repoLink,
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ export const CodePreview = ({
|
|||
}: CodePreviewProps) => {
|
||||
const editorRef = useRef<ReactCodeMirrorRef>(null);
|
||||
|
||||
const [ keymapType ] = useKeymapType();
|
||||
const { theme } = useThemeNormalized();
|
||||
const [keymapType] = useKeymapType();
|
||||
const { theme } = useThemeNormalized();
|
||||
const [gutterWidth, setGutterWidth] = useState(0);
|
||||
|
||||
const keymapExtension = useExtensionWithDependency(
|
||||
|
|
@ -109,7 +109,9 @@ export const CodePreview = ({
|
|||
|
||||
return (
|
||||
<div className="flex flex-col h-full">
|
||||
<div className="flex flex-row bg-cyan-200 dark:bg-cyan-900 items-center justify-between pr-3 py-0.5 border">
|
||||
<div className="flex flex-row bg-cyan-200 dark:bg-cyan-900 items-center justify-between pr-3 py-0.5">
|
||||
|
||||
{/* Gutter icon */}
|
||||
<div className="flex flex-row">
|
||||
<div
|
||||
style={{ width: `${gutterWidth}px` }}
|
||||
|
|
@ -117,20 +119,27 @@ export const CodePreview = ({
|
|||
>
|
||||
<FileIcon className="h-4 w-4" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* File path */}
|
||||
<div className="flex-1 overflow-hidden">
|
||||
<span
|
||||
className={clsx("", {
|
||||
"cursor-pointer text-blue-500 hover:underline" : file?.link
|
||||
className={clsx("block truncate-start", {
|
||||
"cursor-pointer text-blue-500 hover:underline": file?.link
|
||||
})}
|
||||
onClick={() => {
|
||||
if (file?.link) {
|
||||
window.open(file.link, "_blank");
|
||||
}
|
||||
}}
|
||||
title={file?.filepath}
|
||||
>
|
||||
{file?.filepath}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex flex-row gap-1 items-center">
|
||||
|
||||
<div className="flex flex-row gap-1 items-center pl-2">
|
||||
{/* Match selector */}
|
||||
{file && file.matches.length > 0 && (
|
||||
<>
|
||||
<p className="text-sm">{`${selectedMatchIndex + 1} of ${ranges.length}`}</p>
|
||||
|
|
@ -154,6 +163,8 @@ export const CodePreview = ({
|
|||
</Button>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* Close button */}
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
|
|
|
|||
67
packages/web/src/app/search/components/filterPanel/entry.tsx
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
'use client';
|
||||
|
||||
import { QuestionMarkCircledIcon } from "@radix-ui/react-icons";
|
||||
import clsx from "clsx";
|
||||
import Image from "next/image";
|
||||
|
||||
export type Entry = {
|
||||
key: string;
|
||||
displayName: string;
|
||||
count: number;
|
||||
isSelected: boolean;
|
||||
icon?: string;
|
||||
iconAltText?: string;
|
||||
iconClassName?: string;
|
||||
}
|
||||
|
||||
interface EntryProps {
|
||||
entry: Entry,
|
||||
onClicked: () => void
|
||||
}
|
||||
|
||||
export const Entry = ({
|
||||
entry: {
|
||||
isSelected,
|
||||
icon,
|
||||
iconAltText,
|
||||
iconClassName,
|
||||
displayName,
|
||||
count,
|
||||
},
|
||||
onClicked,
|
||||
}: EntryProps) => {
|
||||
|
||||
return (
|
||||
<div
|
||||
className={clsx("flex flex-row items-center justify-between py-0.5 px-2 cursor-pointer rounded-md gap-2 select-none",
|
||||
{
|
||||
"hover:bg-gray-200 dark:hover:bg-gray-700": !isSelected,
|
||||
"bg-blue-200 dark:bg-blue-400": isSelected,
|
||||
}
|
||||
)}
|
||||
onClick={() => onClicked()}
|
||||
>
|
||||
<div className="flex flex-row items-center gap-1">
|
||||
{icon ? (
|
||||
<Image
|
||||
src={icon}
|
||||
alt={iconAltText ?? ''}
|
||||
className={`w-4 h-4 flex-shrink-0 ${iconClassName}`}
|
||||
/>
|
||||
) : (
|
||||
<QuestionMarkCircledIcon className="w-4 h-4 flex-shrink-0" />
|
||||
)}
|
||||
<p className="text-wrap">{displayName}</p>
|
||||
</div>
|
||||
<p>{count}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export const compareEntries = (a: Entry, b: Entry) => {
|
||||
if (a.isSelected !== b.isSelected) {
|
||||
return a.isSelected ? 1 : -1;
|
||||
}
|
||||
|
||||
return a.count - b.count;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
'use client';
|
||||
|
||||
import { useMemo, useState } from "react";
|
||||
import { compareEntries, Entry } from "./entry";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { ScrollArea } from "@/components/ui/scroll-area";
|
||||
import Fuse from "fuse.js";
|
||||
|
||||
interface FilterProps {
|
||||
title: string,
|
||||
searchPlaceholder: string,
|
||||
entries: Entry[],
|
||||
onEntryClicked: (key: string) => void,
|
||||
}
|
||||
|
||||
export const Filter = ({
|
||||
title,
|
||||
searchPlaceholder,
|
||||
entries,
|
||||
onEntryClicked,
|
||||
}: FilterProps) => {
|
||||
const [searchFilter, setSearchFilter] = useState<string>("");
|
||||
|
||||
const filteredEntries = useMemo(() => {
|
||||
if (searchFilter === "") {
|
||||
return entries;
|
||||
}
|
||||
|
||||
const fuse = new Fuse(entries, {
|
||||
keys: ["displayName"],
|
||||
threshold: 0.3,
|
||||
});
|
||||
|
||||
const result = fuse.search(searchFilter);
|
||||
return result.map((result) => result.item);
|
||||
}, [entries, searchFilter]);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2 p-1">
|
||||
<h2 className="text-sm font-semibold">{title}</h2>
|
||||
<Input
|
||||
placeholder={searchPlaceholder}
|
||||
className="h-8"
|
||||
onChange={(event) => setSearchFilter(event.target.value)}
|
||||
/>
|
||||
|
||||
<ScrollArea
|
||||
className="overflow-hidden"
|
||||
>
|
||||
<div
|
||||
className="flex flex-col gap-0.5 text-sm h-full max-h-80 px-0.5"
|
||||
>
|
||||
{filteredEntries
|
||||
.sort((entryA, entryB) => compareEntries(entryB, entryA))
|
||||
.map((entry) => (
|
||||
<Entry
|
||||
key={entry.key}
|
||||
entry={entry}
|
||||
onClicked={() => onEntryClicked(entry.key)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
147
packages/web/src/app/search/components/filterPanel/index.tsx
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
'use client';
|
||||
|
||||
import { SearchResultFile } from "@/lib/types";
|
||||
import { getRepoCodeHostInfo } from "@/lib/utils";
|
||||
import { SetStateAction, useCallback, useEffect, useState } from "react";
|
||||
import { Entry } from "./entry";
|
||||
import { Filter } from "./filter";
|
||||
import { getLanguageIcon } from "./languageIcons";
|
||||
|
||||
interface FilePanelProps {
|
||||
matches: SearchResultFile[];
|
||||
onFilterChanged: (filteredMatches: SearchResultFile[]) => void,
|
||||
}
|
||||
|
||||
export const FilterPanel = ({
|
||||
matches,
|
||||
onFilterChanged,
|
||||
}: FilePanelProps) => {
|
||||
const [repos, setRepos] = useState<Record<string, Entry>>({});
|
||||
const [languages, setLanguages] = useState<Record<string, Entry>>({});
|
||||
|
||||
useEffect(() => {
|
||||
const _repos = aggregateMatches(
|
||||
"Repository",
|
||||
matches,
|
||||
(key) => {
|
||||
const info = getRepoCodeHostInfo(key);
|
||||
return {
|
||||
key,
|
||||
displayName: info?.repoName ?? key,
|
||||
count: 0,
|
||||
isSelected: false,
|
||||
icon: info?.icon,
|
||||
iconAltText: info?.costHostName,
|
||||
iconClassName: info?.iconClassName,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
setRepos(_repos);
|
||||
}, [matches, setRepos]);
|
||||
|
||||
useEffect(() => {
|
||||
const _languages = aggregateMatches(
|
||||
"Language",
|
||||
matches,
|
||||
(key) => {
|
||||
// @todo: Get language icons
|
||||
return {
|
||||
key,
|
||||
displayName: key,
|
||||
count: 0,
|
||||
isSelected: false,
|
||||
icon: getLanguageIcon(key),
|
||||
} satisfies Entry;
|
||||
}
|
||||
)
|
||||
|
||||
setLanguages(_languages);
|
||||
}, [matches, setLanguages]);
|
||||
|
||||
const onEntryClicked = useCallback((
|
||||
key: string,
|
||||
setter: (value: SetStateAction<Record<string, Entry>>) => void,
|
||||
) => {
|
||||
setter((values) => ({
|
||||
...values,
|
||||
[key]: {
|
||||
...values[key],
|
||||
isSelected: !values[key].isSelected,
|
||||
},
|
||||
}));
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const selectedRepos = new Set(
|
||||
Object.entries(repos)
|
||||
.filter(([_, { isSelected }]) => isSelected)
|
||||
.map(([key]) => key)
|
||||
);
|
||||
|
||||
const selectedLanguages = new Set(
|
||||
Object.entries(languages)
|
||||
.filter(([_, { isSelected }]) => isSelected)
|
||||
.map(([key]) => key)
|
||||
);
|
||||
|
||||
const filteredMatches = matches.filter((match) =>
|
||||
(
|
||||
(selectedRepos.size === 0 ? true : selectedRepos.has(match.Repository)) &&
|
||||
(selectedLanguages.size === 0 ? true : selectedLanguages.has(match.Language))
|
||||
)
|
||||
);
|
||||
|
||||
onFilterChanged(filteredMatches);
|
||||
}, [matches, repos, languages]);
|
||||
|
||||
return (
|
||||
<div className="p-3 flex flex-col gap-3">
|
||||
<h1 className="text-lg font-semibold">Filter Results</h1>
|
||||
|
||||
<Filter
|
||||
title="By Repository"
|
||||
searchPlaceholder="Filter repositories"
|
||||
entries={Object.values(repos)}
|
||||
onEntryClicked={(key) => onEntryClicked(key, setRepos)}
|
||||
/>
|
||||
|
||||
<Filter
|
||||
title="By Language"
|
||||
searchPlaceholder="Filter languages"
|
||||
entries={Object.values(languages)}
|
||||
onEntryClicked={(key) => onEntryClicked(key, setLanguages)}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/* Aggregates `matches` by the given `propName`. The result is a record
|
||||
* of `Entry` objects, where the key is the aggregated `propName` and
|
||||
* the value is the entry created by `createEntry`. Example:
|
||||
*
|
||||
* "repo1": {
|
||||
* "count": 22,
|
||||
* ...
|
||||
* },
|
||||
* "repo2": {
|
||||
* "count": 9,
|
||||
* ...
|
||||
* }
|
||||
*/
|
||||
const aggregateMatches = (
|
||||
propName: 'Repository' | 'Language',
|
||||
matches: SearchResultFile[],
|
||||
createEntry: (key: string) => Entry
|
||||
) => {
|
||||
return matches
|
||||
.map((match) => match[propName])
|
||||
.filter((key) => key.length > 0)
|
||||
.reduce((aggregation, key) => {
|
||||
if (!aggregation[key]) {
|
||||
aggregation[key] = createEntry(key);
|
||||
}
|
||||
aggregation[key].count += 1;
|
||||
return aggregation;
|
||||
}, {} as Record<string, Entry>)
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
import JavaScriptIcon from "@/public/languages/file_type_js_official.svg";
|
||||
import TypeScriptIcon from "@/public/languages/file_type_typescript_official.svg";
|
||||
import GoIcon from "@/public/languages/file_type_go.svg";
|
||||
import MarkdownIcon from "@/public/languages/file_type_markdown.svg";
|
||||
import CIcon from "@/public/languages/file_type_c3.svg";
|
||||
import CppIcon from "@/public/languages/file_type_cpp3.svg";
|
||||
import CSharpIcon from "@/public/languages/file_type_csharp2.svg";
|
||||
import CSSIcon from "@/public/languages/file_type_css.svg";
|
||||
import HTMLIcon from "@/public/languages/file_type_html.svg";
|
||||
import JavaIcon from "@/public/languages/file_type_java.svg";
|
||||
import JSONIcon from "@/public/languages/file_type_json.svg";
|
||||
import PythonIcon from "@/public/languages/file_type_python.svg";
|
||||
import RubyIcon from "@/public/languages/file_type_ruby.svg";
|
||||
import RustIcon from "@/public/languages/file_type_rust.svg";
|
||||
import YAMLIcon from "@/public/languages/file_type_yaml.svg";
|
||||
import KotlinIcon from "@/public/languages/file_type_kotlin.svg";
|
||||
import SwiftIcon from "@/public/languages/file_type_swift.svg";
|
||||
import PHPIcon from "@/public/languages/file_type_php3.svg";
|
||||
import RIcon from "@/public/languages/file_type_r.svg";
|
||||
import MatlabIcon from "@/public/languages/file_type_matlab.svg";
|
||||
import ObjectiveCIcon from "@/public/languages/file_type_objectivec.svg";
|
||||
import LuaIcon from "@/public/languages/file_type_lua.svg";
|
||||
import DartIcon from "@/public/languages/file_type_dartlang.svg";
|
||||
import HaskellIcon from "@/public/languages/file_type_haskell.svg";
|
||||
import PerlIcon from "@/public/languages/file_type_perl.svg";
|
||||
import ShellIcon from "@/public/languages/file_type_shell.svg";
|
||||
import ZigIcon from "@/public/languages/file_type_zig.svg";
|
||||
import JuliaIcon from "@/public/languages/file_type_julia.svg";
|
||||
import OcamlIcon from "@/public/languages/file_type_ocaml.svg";
|
||||
import TextIcon from "@/public/languages/file_type_text.svg";
|
||||
import PowershellIcon from "@/public/languages/file_type_powershell.svg";
|
||||
import TexIcon from "@/public/languages/file_type_tex.svg";
|
||||
import AssemblyIcon from "@/public/languages/file_type_assembly.svg";
|
||||
|
||||
export const getLanguageIcon = (language: string) => {
|
||||
switch (language.toLowerCase()) {
|
||||
case "tsx":
|
||||
case "typescript":
|
||||
return TypeScriptIcon;
|
||||
case "jsx":
|
||||
case "javascript":
|
||||
return JavaScriptIcon;
|
||||
case "go":
|
||||
return GoIcon;
|
||||
case "markdown":
|
||||
return MarkdownIcon;
|
||||
case "c":
|
||||
return CIcon;
|
||||
case "c++":
|
||||
return CppIcon;
|
||||
case "python":
|
||||
return PythonIcon;
|
||||
case "c#":
|
||||
return CSharpIcon;
|
||||
case "html":
|
||||
return HTMLIcon;
|
||||
case "css":
|
||||
return CSSIcon;
|
||||
case "java":
|
||||
return JavaIcon;
|
||||
case "json with comments":
|
||||
case "json":
|
||||
return JSONIcon;
|
||||
case "ruby":
|
||||
return RubyIcon;
|
||||
case "rust":
|
||||
return RustIcon;
|
||||
case "yaml":
|
||||
return YAMLIcon;
|
||||
case "kotlin":
|
||||
return KotlinIcon;
|
||||
case "swift":
|
||||
return SwiftIcon;
|
||||
case "php":
|
||||
return PHPIcon;
|
||||
case "r":
|
||||
return RIcon;
|
||||
case "matlab":
|
||||
return MatlabIcon;
|
||||
case "objective-c":
|
||||
return ObjectiveCIcon;
|
||||
case "lua":
|
||||
return LuaIcon;
|
||||
case "dart":
|
||||
return DartIcon;
|
||||
case "haskell":
|
||||
return HaskellIcon;
|
||||
case "perl":
|
||||
return PerlIcon;
|
||||
case "makefile":
|
||||
case "shell":
|
||||
return ShellIcon;
|
||||
case "zig":
|
||||
return ZigIcon;
|
||||
case "julia":
|
||||
return JuliaIcon;
|
||||
case "ocaml":
|
||||
return OcamlIcon;
|
||||
case "text":
|
||||
return TextIcon;
|
||||
case "powershell":
|
||||
return PowershellIcon;
|
||||
case "tex":
|
||||
return TexIcon;
|
||||
case "assembly":
|
||||
return AssemblyIcon;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ export const FileMatchContainer = ({
|
|||
repoIcon: <Image
|
||||
src={info.icon}
|
||||
alt={info.costHostName}
|
||||
className={`w-4 h-4 ${info.iconClassname}`}
|
||||
className={`w-4 h-4 ${info.iconClassName}`}
|
||||
/>
|
||||
}
|
||||
}
|
||||
|
|
@ -95,12 +95,12 @@ export const FileMatchContainer = ({
|
|||
return (
|
||||
<div>
|
||||
<div
|
||||
className="sticky top-0 bg-cyan-200 dark:bg-cyan-900 primary-foreground px-2 py-0.5 flex flex-row items-center justify-between border cursor-pointer z-10"
|
||||
className="sticky top-0 bg-cyan-200 dark:bg-cyan-900 primary-foreground px-2 py-0.5 flex flex-row items-center justify-between cursor-pointer z-10"
|
||||
onClick={() => {
|
||||
onOpenFile();
|
||||
}}
|
||||
>
|
||||
<div className="flex flex-row gap-2 items-center">
|
||||
<div className="flex flex-row gap-2 items-center w-full overflow-hidden">
|
||||
{repoIcon}
|
||||
<span
|
||||
className={clsx("font-medium", {
|
||||
|
|
@ -115,17 +115,21 @@ export const FileMatchContainer = ({
|
|||
{repoName}
|
||||
</span>
|
||||
<span>·</span>
|
||||
{!fileNameRange ? (
|
||||
<span>{file.FileName}</span>
|
||||
) : (
|
||||
<span>
|
||||
{file.FileName.slice(0, fileNameRange.from)}
|
||||
<span className="bg-yellow-200 dark:bg-blue-700">
|
||||
{file.FileName.slice(fileNameRange.from, fileNameRange.to)}
|
||||
</span>
|
||||
{file.FileName.slice(fileNameRange.to)}
|
||||
<div className="flex-1 flex items-center overflow-hidden">
|
||||
<span className="inline-block w-full truncate-start">
|
||||
{!fileNameRange ?
|
||||
file.FileName
|
||||
: (
|
||||
<>
|
||||
{file.FileName.slice(0, fileNameRange.from)}
|
||||
<span className="bg-yellow-200 dark:bg-blue-700">
|
||||
{file.FileName.slice(fileNameRange.from, fileNameRange.to)}
|
||||
</span>
|
||||
{file.FileName.slice(fileNameRange.to)}
|
||||
</>
|
||||
)}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{matches.map((match, index) => (
|
||||
|
|
|
|||
|
|
@ -5,25 +5,27 @@ import {
|
|||
ResizablePanel,
|
||||
ResizablePanelGroup,
|
||||
} from "@/components/ui/resizable";
|
||||
import { ScrollArea } from "@/components/ui/scroll-area";
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import useCaptureEvent from "@/hooks/useCaptureEvent";
|
||||
import { useNonEmptyQueryParam } from "@/hooks/useNonEmptyQueryParam";
|
||||
import { SearchQueryParams, SearchResultFile } from "@/lib/types";
|
||||
import { createPathWithQueryParams } from "@/lib/utils";
|
||||
import { SymbolIcon } from "@radix-ui/react-icons";
|
||||
import { Scrollbar } from "@radix-ui/react-scroll-area";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import Image from "next/image";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import logoDark from "../../../public/sb_logo_dark.png";
|
||||
import logoLight from "../../../public/sb_logo_light.png";
|
||||
import { search } from "../api/(client)/client";
|
||||
import { SearchBar } from "../searchBar";
|
||||
import { SettingsDropdown } from "../settingsDropdown";
|
||||
import useCaptureEvent from "@/hooks/useCaptureEvent";
|
||||
import { CodePreviewPanel } from "./components/codePreviewPanel";
|
||||
import { FilterPanel } from "./components/filterPanel";
|
||||
import { SearchResultsPanel } from "./components/searchResultsPanel";
|
||||
import { SearchQueryParams, SearchResultFile } from "@/lib/types";
|
||||
import { ScrollArea } from "@/components/ui/scroll-area";
|
||||
import { Scrollbar } from "@radix-ui/react-scroll-area";
|
||||
import { ImperativePanelHandle } from "react-resizable-panels";
|
||||
|
||||
const DEFAULT_MAX_MATCH_DISPLAY_COUNT = 200;
|
||||
|
||||
|
|
@ -33,9 +35,6 @@ export default function SearchPage() {
|
|||
const _maxMatchDisplayCount = parseInt(useNonEmptyQueryParam(SearchQueryParams.maxMatchDisplayCount) ?? `${DEFAULT_MAX_MATCH_DISPLAY_COUNT}`);
|
||||
const maxMatchDisplayCount = isNaN(_maxMatchDisplayCount) ? DEFAULT_MAX_MATCH_DISPLAY_COUNT : _maxMatchDisplayCount;
|
||||
|
||||
const [selectedMatchIndex, setSelectedMatchIndex] = useState(0);
|
||||
const [selectedFile, setSelectedFile] = useState<SearchResultFile | undefined>(undefined);
|
||||
|
||||
const captureEvent = useCaptureEvent();
|
||||
|
||||
const { data: searchResponse, isLoading } = useQuery({
|
||||
|
|
@ -151,80 +150,148 @@ export default function SearchPage() {
|
|||
/>
|
||||
</div>
|
||||
<Separator />
|
||||
<div className="bg-accent py-1 px-2 flex flex-row items-center gap-4">
|
||||
{
|
||||
isLoading ? (
|
||||
<p className="text-sm font-medium">Loading...</p>
|
||||
) : fileMatches.length > 0 && searchResponse ? (
|
||||
<p className="text-sm font-medium">{`[${searchDurationMs} ms] Displaying ${numMatches} of ${searchResponse.Result.MatchCount} matches in ${fileMatches.length} ${fileMatches.length > 1 ? 'files' : 'file'}`}</p>
|
||||
) : (
|
||||
<p className="text-sm font-medium">No results</p>
|
||||
)
|
||||
}
|
||||
{isMoreResultsButtonVisible && !isLoading && (
|
||||
<div
|
||||
className="cursor-pointer text-blue-500 text-sm hover:underline"
|
||||
onClick={onLoadMoreResults}
|
||||
>
|
||||
(load more)
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{!isLoading && (
|
||||
<div className="bg-accent py-1 px-2 flex flex-row items-center gap-4">
|
||||
{
|
||||
fileMatches.length > 0 && searchResponse ? (
|
||||
<p className="text-sm font-medium">{`[${searchDurationMs} ms] Displaying ${numMatches} of ${searchResponse.Result.MatchCount} matches in ${fileMatches.length} ${fileMatches.length > 1 ? 'files' : 'file'}`}</p>
|
||||
) : (
|
||||
<p className="text-sm font-medium">No results</p>
|
||||
)
|
||||
}
|
||||
{isMoreResultsButtonVisible && (
|
||||
<div
|
||||
className="cursor-pointer text-blue-500 text-sm hover:underline"
|
||||
onClick={onLoadMoreResults}
|
||||
>
|
||||
(load more)
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<Separator />
|
||||
</div>
|
||||
|
||||
{/* Search Results & Code Preview */}
|
||||
<ResizablePanelGroup direction="horizontal">
|
||||
<ResizablePanel minSize={20}>
|
||||
{isLoading ? (
|
||||
<div className="flex flex-col items-center justify-center h-full gap-2">
|
||||
<SymbolIcon className="h-6 w-6 animate-spin" />
|
||||
<p className="font-semibold text-center">Searching...</p>
|
||||
</div>
|
||||
) : fileMatches.length > 0 ? (
|
||||
<ScrollArea
|
||||
className="h-full"
|
||||
>
|
||||
<SearchResultsPanel
|
||||
fileMatches={fileMatches}
|
||||
onOpenFileMatch={(fileMatch) => {
|
||||
setSelectedFile(fileMatch);
|
||||
}}
|
||||
onMatchIndexChanged={(matchIndex) => {
|
||||
setSelectedMatchIndex(matchIndex);
|
||||
}}
|
||||
/>
|
||||
{isMoreResultsButtonVisible && (
|
||||
<div className="p-3">
|
||||
<span
|
||||
className="cursor-pointer text-blue-500 hover:underline"
|
||||
onClick={onLoadMoreResults}
|
||||
>
|
||||
Load more results
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
<Scrollbar orientation="vertical" />
|
||||
</ScrollArea>
|
||||
) : (
|
||||
<div className="flex flex-col items-center justify-center h-full">
|
||||
<p className="text-sm text-muted-foreground">No results found</p>
|
||||
</div>
|
||||
)}
|
||||
</ResizablePanel>
|
||||
<ResizableHandle withHandle={selectedFile !== undefined} />
|
||||
<ResizablePanel
|
||||
minSize={20}
|
||||
hidden={!selectedFile}
|
||||
>
|
||||
<CodePreviewPanel
|
||||
fileMatch={selectedFile}
|
||||
onClose={() => setSelectedFile(undefined)}
|
||||
selectedMatchIndex={selectedMatchIndex}
|
||||
onSelectedMatchIndexChange={setSelectedMatchIndex}
|
||||
/>
|
||||
</ResizablePanel>
|
||||
</ResizablePanelGroup>
|
||||
{isLoading ? (
|
||||
<div className="flex flex-col items-center justify-center h-full gap-2">
|
||||
<SymbolIcon className="h-6 w-6 animate-spin" />
|
||||
<p className="font-semibold text-center">Searching...</p>
|
||||
</div>
|
||||
) : (
|
||||
<PanelGroup
|
||||
fileMatches={fileMatches}
|
||||
isMoreResultsButtonVisible={isMoreResultsButtonVisible}
|
||||
onLoadMoreResults={onLoadMoreResults}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
interface PanelGroupProps {
|
||||
fileMatches: SearchResultFile[];
|
||||
isMoreResultsButtonVisible?: boolean;
|
||||
onLoadMoreResults: () => void;
|
||||
}
|
||||
|
||||
const PanelGroup = ({
|
||||
fileMatches,
|
||||
isMoreResultsButtonVisible,
|
||||
onLoadMoreResults,
|
||||
}: PanelGroupProps) => {
|
||||
const [selectedMatchIndex, setSelectedMatchIndex] = useState(0);
|
||||
const [selectedFile, setSelectedFile] = useState<SearchResultFile | undefined>(undefined);
|
||||
const [filteredFileMatches, setFilteredFileMatches] = useState<SearchResultFile[]>(fileMatches);
|
||||
|
||||
const codePreviewPanelRef = useRef<ImperativePanelHandle>(null);
|
||||
useEffect(() => {
|
||||
if (selectedFile) {
|
||||
codePreviewPanelRef.current?.expand();
|
||||
} else {
|
||||
codePreviewPanelRef.current?.collapse();
|
||||
}
|
||||
}, [selectedFile]);
|
||||
|
||||
return (
|
||||
<ResizablePanelGroup
|
||||
direction="horizontal"
|
||||
>
|
||||
{/* ~~ Filter panel ~~ */}
|
||||
<ResizablePanel
|
||||
minSize={20}
|
||||
maxSize={30}
|
||||
defaultSize={20}
|
||||
collapsible={true}
|
||||
id={'filter-panel'}
|
||||
order={1}
|
||||
>
|
||||
<FilterPanel
|
||||
matches={fileMatches}
|
||||
onFilterChanged={(filteredFileMatches) => {
|
||||
setFilteredFileMatches(filteredFileMatches)
|
||||
}}
|
||||
/>
|
||||
</ResizablePanel>
|
||||
<ResizableHandle
|
||||
className="bg-accent w-1 transition-colors delay-50 data-[resize-handle-state=drag]:bg-accent-foreground data-[resize-handle-state=hover]:bg-accent-foreground"
|
||||
/>
|
||||
|
||||
{/* ~~ Search results ~~ */}
|
||||
<ResizablePanel
|
||||
minSize={10}
|
||||
id={'search-results-panel'}
|
||||
order={2}
|
||||
>
|
||||
{filteredFileMatches.length > 0 ? (
|
||||
<ScrollArea
|
||||
className="h-full"
|
||||
>
|
||||
<SearchResultsPanel
|
||||
fileMatches={filteredFileMatches}
|
||||
onOpenFileMatch={(fileMatch) => {
|
||||
setSelectedFile(fileMatch);
|
||||
}}
|
||||
onMatchIndexChanged={(matchIndex) => {
|
||||
setSelectedMatchIndex(matchIndex);
|
||||
}}
|
||||
/>
|
||||
{isMoreResultsButtonVisible && (
|
||||
<div className="p-3">
|
||||
<span
|
||||
className="cursor-pointer text-blue-500 hover:underline"
|
||||
onClick={onLoadMoreResults}
|
||||
>
|
||||
Load more results
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
<Scrollbar orientation="vertical" />
|
||||
</ScrollArea>
|
||||
) : (
|
||||
<div className="flex flex-col items-center justify-center h-full">
|
||||
<p className="text-sm text-muted-foreground">No results found</p>
|
||||
</div>
|
||||
)}
|
||||
</ResizablePanel>
|
||||
<ResizableHandle
|
||||
withHandle={selectedFile !== undefined}
|
||||
/>
|
||||
|
||||
{/* ~~ Code preview ~~ */}
|
||||
<ResizablePanel
|
||||
ref={codePreviewPanelRef}
|
||||
minSize={10}
|
||||
collapsible={true}
|
||||
id={'code-preview-panel'}
|
||||
order={3}
|
||||
>
|
||||
<CodePreviewPanel
|
||||
fileMatch={selectedFile}
|
||||
onClose={() => setSelectedFile(undefined)}
|
||||
selectedMatchIndex={selectedMatchIndex}
|
||||
onSelectedMatchIndexChange={setSelectedMatchIndex}
|
||||
/>
|
||||
</ResizablePanel>
|
||||
</ResizablePanelGroup>
|
||||
)
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ type CodeHostInfo = {
|
|||
costHostName: string;
|
||||
repoLink: string;
|
||||
icon: string;
|
||||
iconClassname?: string;
|
||||
iconClassName?: string;
|
||||
}
|
||||
|
||||
export const getRepoCodeHostInfo = (repoName: string): CodeHostInfo | undefined => {
|
||||
|
|
@ -46,7 +46,7 @@ export const getRepoCodeHostInfo = (repoName: string): CodeHostInfo | undefined
|
|||
costHostName: "GitHub",
|
||||
repoLink: `https://${repoName}`,
|
||||
icon: githubLogo,
|
||||
iconClassname: "dark:invert",
|
||||
iconClassName: "dark:invert",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@
|
|||
}
|
||||
],
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
"@/*": ["./src/*"],
|
||||
"@/public/*": ["./public/*"]
|
||||
}
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||
|
|
|
|||
|
|
@ -2739,6 +2739,11 @@ functions-have-names@^1.2.3:
|
|||
resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834"
|
||||
integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==
|
||||
|
||||
fuse.js@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-7.0.0.tgz#6573c9fcd4c8268e403b4fc7d7131ffcf99a9eb2"
|
||||
integrity sha512-14F4hBIxqKvD4Zz/XjDc3y94mNZN6pRv3U13Udo0lNLCWRBUsrMv2xwcF/y/Z5sV6+FQW+/ow68cHpm4sunt8Q==
|
||||
|
||||
get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.2, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd"
|
||||
|
|
|
|||