diff --git a/packages/vuerd-app/src/components/Icon.vue b/packages/vuerd-app/src/components/Icon.vue
index 2e42091c..b342e7a5 100644
--- a/packages/vuerd-app/src/components/Icon.vue
+++ b/packages/vuerd-app/src/components/Icon.vue
@@ -49,6 +49,7 @@ export default defineComponent({
diff --git a/packages/vuerd-app/src/components/Sash.vue b/packages/vuerd-app/src/components/Sash.vue
index d35c456e..0ac1008e 100644
--- a/packages/vuerd-app/src/components/Sash.vue
+++ b/packages/vuerd-app/src/components/Sash.vue
@@ -1,4 +1,4 @@
-
+
+.sash(:class="classMap" :style="styleMap" @mousedown="onMousedown")
+ .line-container(:class="classMap")
+ .line(:class="classMap" :style="lineStyleMap")
+
+
diff --git a/packages/vuerd-app/src/components/editor/Editor.vue b/packages/vuerd-app/src/components/editor/Editor.vue
index 2f606e80..e9dff548 100644
--- a/packages/vuerd-app/src/components/editor/Editor.vue
+++ b/packages/vuerd-app/src/components/editor/Editor.vue
@@ -1,5 +1,5 @@
-.editor(:style="styleMap" @dragover.prevent="onDragover" @drop.prevent)
+.editor(
+ :style="styleMap"
+ ref="elRef"
+ @dragover.prevent="onDragover"
+ @drop.prevent
+)
SplitView(:node="root")
diff --git a/packages/vuerd-app/src/components/editor/SplitView.vue b/packages/vuerd-app/src/components/editor/SplitView.vue
index 4d992ace..7b5dc8de 100644
--- a/packages/vuerd-app/src/components/editor/SplitView.vue
+++ b/packages/vuerd-app/src/components/editor/SplitView.vue
@@ -28,10 +28,9 @@ export default defineComponent({
let lastClientX = 0;
let lastClientY = 0;
- const getClassMap = (node: ViewNode, index: number) => ({
+ const getClassMap = (node: ViewNode) => ({
vertical: node.vertical,
horizontal: node.horizontal,
- left: node.vertical && index,
});
const getStyleMap = (node: ViewNode) => ({
@@ -124,14 +123,12 @@ export default defineComponent({
if (props.node.vertical) {
if (movementX < 0) {
- // left
moveWidth(
event,
props.node.children[index - 1],
props.node.children[index]
);
} else {
- // right
moveWidth(
event,
props.node.children[index],
@@ -140,14 +137,12 @@ export default defineComponent({
}
} else if (props.node.horizontal) {
if (movementY < 0) {
- // top
moveHeight(
event,
props.node.children[index - 1],
props.node.children[index]
);
} else {
- // bottom
moveHeight(
event,
props.node.children[index],
@@ -168,11 +163,10 @@ export default defineComponent({
-.split-view(:class="getClassMap(node, 0)" :style="getStyleMap(node)")
+.split-view(:class="getClassMap(node)" :style="getStyleMap(node)")
.view(
v-for="(childNode, index) in node.children"
:key="childNode.id"
- :class="getClassMap(childNode, index)"
:style="getStyleMap(childNode)"
)
Sash(
@@ -200,14 +194,6 @@ export default defineComponent({
.view {
position: relative;
-
- &.left {
- border-left: var(--sash-background) solid 1px;
- }
-
- &.top {
- border-top: var(--sash-background) solid 1px;
- }
}
}
diff --git a/packages/vuerd-app/src/components/editor/ViewerTab.vue b/packages/vuerd-app/src/components/editor/ViewerTab.vue
index 2c2d9777..1b762f81 100644
--- a/packages/vuerd-app/src/components/editor/ViewerTab.vue
+++ b/packages/vuerd-app/src/components/editor/ViewerTab.vue
@@ -42,9 +42,9 @@ export default defineComponent({
height: `${SIZE_VIEW_TAB_HEIGHT}px`,
}));
- let draggableListener: Subscription[] = [];
+ const draggable$: Subject = new Subject();
let dragenter$: Observable | null = null;
- let draggable$: Subject = new Subject();
+ let draggableListener: Subscription[] = [];
let subDragenter: Subscription | null | undefined = null;
let subDraggable: Subscription | null | undefined = null;
@@ -89,7 +89,7 @@ export default defineComponent({
viewActions.tabDraggableStart(tab);
emit('dragstart', event);
eventBus.emit(Bus.EditorTab.draggableStart);
- eventBus.emit(Bus.TreeNode.draggableStart);
+ eventBus.emit(Bus.OpenFile.draggableStart);
eventBus.emit(Bus.Editor.dragstart);
event.dataTransfer && event.dataTransfer.setData('text/plain', tab.id);
};
@@ -97,7 +97,7 @@ export default defineComponent({
const onDragend = () => {
eventBus.emit(Bus.EditorViewer.dropEnd, viewState.draggableTab);
eventBus.emit(Bus.EditorTab.draggableEnd);
- eventBus.emit(Bus.TreeNode.draggableEnd);
+ eventBus.emit(Bus.OpenFile.draggableEnd);
eventBus.emit(Bus.Editor.dragend);
viewActions.tabDraggableEnd();
};
@@ -242,7 +242,7 @@ export default defineComponent({
.name {
padding-right: 7px;
- font-size: 0.875rem;
+ @apply text-sm;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
diff --git a/packages/vuerd-app/src/components/sidebar/Sidebar.vue b/packages/vuerd-app/src/components/sidebar/Sidebar.vue
index c5fca31e..4e946df7 100644
--- a/packages/vuerd-app/src/components/sidebar/Sidebar.vue
+++ b/packages/vuerd-app/src/components/sidebar/Sidebar.vue
@@ -1,6 +1,6 @@
+
+
+.open-file.scrollbar
+ ul(v-for="(group, i) in groups" :key="group.id")
+ li
+ span.arrow(v-if="groups.length !== 1")
+ .none-arrow
+ span.group-title(v-if="groups.length !== 1") Group {{i + 1}}
+ transition-group(name="tab" tag="ul")
+ li.draggable(
+ v-for="tab in group.tabs"
+ :key="tab.id"
+ :data-id="tab.id"
+ :data-view-id="group.id"
+ )
+ span.arrow(@click.stop="onClose(group, tab)")
+ Icon(:size="12" prefix="mdi" name="close")
+ span.node(
+ :class="getClassMap(group, tab)"
+ draggable="true"
+ @click="onActive(group, tab)"
+ @mousedown="onMousedown"
+ @dragstart="onDragstart($event, group, tab)"
+ @dragend="onDragend"
+ )
+ span.name {{tab.name}}
+
+
+
diff --git a/packages/vuerd-app/src/components/sidebar/TreeNode.vue b/packages/vuerd-app/src/components/sidebar/explorer/TreeNode.vue
similarity index 96%
rename from packages/vuerd-app/src/components/sidebar/TreeNode.vue
rename to packages/vuerd-app/src/components/sidebar/explorer/TreeNode.vue
index 1dd5e6a4..95fddeba 100644
--- a/packages/vuerd-app/src/components/sidebar/TreeNode.vue
+++ b/packages/vuerd-app/src/components/sidebar/explorer/TreeNode.vue
@@ -12,8 +12,10 @@ import Icon from '@/components/Icon.vue';
import { validFileName } from '@/helpers';
import { useViewStore } from '@/store/view';
+const defaultPaddingLeft = 6;
const paddingLeft = 10;
-const getPaddingLeft = (depth: number) => depth * paddingLeft;
+const getPaddingLeft = (depth: number) =>
+ depth * paddingLeft + defaultPaddingLeft;
const foldTypes = [TreeNodeType.root, TreeNodeType.folder];
export default defineComponent({
diff --git a/packages/vuerd-app/src/config/vuerd.config.ts b/packages/vuerd-app/src/config/vuerd.config.ts
index 3f1aaf74..399f9a65 100644
--- a/packages/vuerd-app/src/config/vuerd.config.ts
+++ b/packages/vuerd-app/src/config/vuerd.config.ts
@@ -1,4 +1,5 @@
import 'vuerd';
+import 'vuerd/theme/one-dark-pro.css';
import { generateTemplatePanel } from '@vuerd/plugin-generate-template';
import { extension } from 'vuerd';
diff --git a/packages/vuerd-app/src/helpers/eventBus.helper.ts b/packages/vuerd-app/src/helpers/eventBus.helper.ts
index c71a29bb..d84ebd18 100644
--- a/packages/vuerd-app/src/helpers/eventBus.helper.ts
+++ b/packages/vuerd-app/src/helpers/eventBus.helper.ts
@@ -51,9 +51,15 @@ enum TreeNode {
draggableEnd = 'TreeNode.draggableEnd',
}
+enum OpenFile {
+ draggableStart = 'OpenFile.draggableStart',
+ draggableEnd = 'OpenFile.draggableEnd',
+}
+
export const Bus = {
EditorTab,
EditorViewer,
Editor,
TreeNode,
+ OpenFile,
};
diff --git a/packages/vuerd-app/src/store/ui/theme.store.ts b/packages/vuerd-app/src/store/ui/theme.store.ts
index cafa5a03..3402a996 100644
--- a/packages/vuerd-app/src/store/ui/theme.store.ts
+++ b/packages/vuerd-app/src/store/ui/theme.store.ts
@@ -59,6 +59,7 @@ export const state = reactive({
},
sash: {
background: 'black',
+ foreground: 'rgba(90, 99, 117)',
},
drop: {
background: '#9DA5B4',