Skip to content

Commit

Permalink
feat: add logo for more parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed May 15, 2024
1 parent 1092a50 commit 64b45d4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
16 changes: 16 additions & 0 deletions components/IconPreview.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script setup lang="ts">
defineProps<{
value: string
}>()
</script>

<template>
<img
v-if="value.startsWith('https://')"
:src="value"
w="1.2em"
h="1.2em"
object-contain
/>
<div v-else :class="value" />
</template>
2 changes: 1 addition & 1 deletion components/ParserSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function changeParser(parser: string) {
<template>
<VMenu :class="{ dark: isDark }" flex>
<button flex="~ gap-1" items-center>
<div :class="currentParser.icon" />
<IconPreview :value="currentParser.icon" />
<span font-mono>{{ currentParser.label }}</span>
</button>
<template #popper>
Expand Down
2 changes: 1 addition & 1 deletion components/dropdown/DropdownItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const handleClick = (evt: MouseEvent) => {
@click="handleClick"
>
<div flex="~ gap-2" items-center>
<div v-if="icon" :class="icon" />
<IconPreview v-if="icon" :value="icon" />
<slot>{{ text }}</slot>
<div v-if="!checked" h-1.2em w-1.2em />
</div>
Expand Down
3 changes: 1 addition & 2 deletions composables/language/javascript/acorn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import type * as Acorn from 'acorn'
export const acorn: Parser<typeof Acorn, Acorn.Options> = {
id: 'acorn',
label: 'Acorn',
// @unocss-include
icon: 'i-vscode-icons:file-type-js-official',
icon: 'https://raw.githubusercontent.com/acornjs/acorn/master/logo.svg',
link: 'https://github.com/acornjs/acorn',
options: {
configurable: true,
Expand Down
3 changes: 1 addition & 2 deletions composables/language/javascript/eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export const espree: Parser<any, any> = {
export const tsEslint: Parser<typeof TsEslint, TsEslint.ParserOptions> = {
id: 'typescript-eslint',
label: '@typescript-eslint/parser',
// @unocss-include
icon: 'i-vscode-icons:file-type-eslint',
icon: 'https://typescript-eslint.io/img/logo.svg',
link: 'https://typescript-eslint.io/packages/parser/',
options: {
configurable: true,
Expand Down
3 changes: 1 addition & 2 deletions composables/language/javascript/oxc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import type * as Oxc from '@oxc-parser/wasm/web/oxc_parser_wasm'
export const oxc: Parser<typeof Oxc, Partial<Oxc.ParserOptions>> = {
id: 'oxc',
label: 'Oxc',
// @unocss-include
icon: 'i-vscode-icons:file-type-js-official',
icon: 'https://raw.githubusercontent.com/oxc-project/oxc-assets/main/logo-square-min.png',
link: 'https://oxc-project.github.io/docs/guide/usage/parser.html',
options: {
configurable: true,
Expand Down

0 comments on commit 64b45d4

Please sign in to comment.