Skip to content

Commit

Permalink
Merge branch 'dev' into dev-hmt
Browse files Browse the repository at this point in the history
  • Loading branch information
HoMeTownSoCool committed Dec 6, 2023
2 parents 81fa732 + b93de4b commit 1415e3a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
21 changes: 17 additions & 4 deletions components/PanelEditorFileSystemTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ const icon = computed(() => {
return getFileIcon(props.name!)
}
})
const folderCaret = computed(() => {
const icon = 'i-ph-caret-right transition-transform duration-300 op50'
if (props.directory) {
return isDirectoryOpen.value
? `${icon} rotate-90`
: icon
}
else {
return 'opacity-0'
}
})
</script>

<template>
Expand All @@ -85,23 +97,24 @@ const icon = computed(() => {
v-if="name"
hover="bg-active"
:style="{
paddingLeft: `${0.8 + 0.8 * (props.depth)}rem`,
paddingLeft: `${0.2 + 0.8 * (props.depth)}rem`,
}"
:class="isFileSelected ? 'bg-active' : 'saturate-0 text-faded'"
w-full flex items-center gap-2 px2 py1 text-left text-sm
w-full flex items-center gap-1 px2 py1 text-left text-sm
@click="handleClick"
>
<div :class="folderCaret" h-4 w-4 flex-none />
<div :class="icon" h-4 w-4 flex-none />
{{ name }}
<span ml1>{{ name }}</span>
</button>
<div v-if="directory" v-show="isDirectoryOpen">
<PanelEditorFileSystemTree
v-for="(child, chileName) in sortedDirectory"
:key="chileName"
v-model="selectedFile"
:name="chileName.toString()"
v-bind="child"
:depth="depth + 1"
v-bind="child"
/>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions composables/files-ignore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const INGORE_FILES: (string | RegExp)[] = [
'pnpm-lock.yaml',
'pnpm-workspace.yaml',
'node_modules',
/tsconfig\.json$/,
/^\./,
]
Expand Down

0 comments on commit 1415e3a

Please sign in to comment.