Skip to content

Commit cb95045

Browse files
committed
feat(desk): add page transitions
1 parent 0a575a4 commit cb95045

File tree

22 files changed

+217
-249
lines changed

22 files changed

+217
-249
lines changed

packages/desktop/app.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ interface Plugin {
1616
window.clientConfig = {
1717
useCase: () => Promise.reject('Not implemented'),
1818
open: {
19-
url: () => true,
19+
url: () => Promise.reject('Not implemented'),
20+
directory: () => Promise.reject('Not implemented'),
2021
},
2122
}
2223

packages/desktop/components.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ declare module '@vue/runtime-core' {
3939
VTab: typeof import('./components/v-tab.vue')['default']
4040
VTabItem: typeof import('./components/v-tab-item.vue')['default']
4141
VTable: typeof import('./components/v-table.vue')['default']
42-
VTd: typeof import('./components/v-td.vue')['default']
42+
VTd: typeof import('./components/VTd.vue')['default']
4343
VTextarea: typeof import('./components/v-textarea.vue')['default']
44-
VTh: typeof import('./components/v-th.vue')['default']
45-
VTr: typeof import('./components/v-tr.vue')['default']
44+
VTh: typeof import('./components/VTh.vue')['default']
45+
VTr: typeof import('./components/VTr.vue')['default']
4646
}
4747
}

packages/desktop/components/v-tr.vue renamed to packages/desktop/components/VTr.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import { toCssMeasurement } from '@composables/utils'
3-
import { computed } from 'vue'
43
54
const props = defineProps({
65
height: {

packages/desktop/modules/collection/components/CTable.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ function showActions(event: MouseEvent, id: string) {
227227
v-model="columns"
228228
handle=".drag"
229229
item-key="id"
230-
tag="v-tr"
231-
:component-data="{ height: 41 }"
230+
tag="tr"
231+
:component-data="{ class: 'h-[41px]' }"
232232
>
233233
<template #item="{ element: c, index }">
234234
<v-th
@@ -242,9 +242,9 @@ function showActions(event: MouseEvent, id: string) {
242242
>
243243
<v-btn
244244
v-if="c.id === '_actions_right'"
245-
size="h-8 w-8 text-xs"
245+
size="sm"
246246
class="text-t-secondary"
247-
text
247+
mode="text"
248248
@click="store.column.create(collectionId)"
249249
>
250250
<v-icon name="plus" />
@@ -295,7 +295,7 @@ function showActions(event: MouseEvent, id: string) {
295295
class="flex justify-center opacity-0 group-hover/item:opacity-100"
296296
>
297297
<v-btn
298-
size="py-1 px-2 text-xs"
298+
size="sm"
299299
color="b-secondary"
300300
:to="`/collections/${collectionId}/items/${data.item.id}`"
301301
data-test-id="actions-btn"

packages/desktop/modules/collection/components/CViewGroup.vue

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,11 @@ function isTable(id: string) {
174174
<template #activator="{ attrs, toggle }">
175175
<v-btn
176176
v-bind="attrs"
177-
text
178-
size="text-sm h-[45px]"
179-
tile
180-
color="hover:text-t-primary"
177+
mode="text"
181178
class="drag overflow-hidden whitespace-pre"
182179
:class="[
183-
isActive(id)
184-
? 'text-t-primary'
185-
: 'text-t-secondary',
186-
index === 0 ? 'pl-0 pr-4' : 'px-4',
180+
isActive(id) ? '' : 'text-t-secondary',
181+
index === 0 ? '-ml-4' : '',
187182
]"
188183
@click="showMenu(id, toggle)"
189184
>
@@ -213,11 +208,9 @@ function isTable(id: string) {
213208
<v-menu offset-y close-on-content-click>
214209
<template #activator="{ attrs }">
215210
<v-btn
216-
text
217-
size="text-sm px-4 h-[45px]"
218-
tile
219-
color="border-b border-transparent hover:bg-b-secondary/50 text-t-secondary overflow-hidden whitespace-pre"
211+
mode="text"
220212
:class="!view.viewIds.length ? 'min-w-[150px]' : ''"
213+
class="text-t-secondary overflow-hidden whitespace-pre"
221214
v-bind="attrs"
222215
>
223216
<template v-if="!view.viewIds.length">

packages/desktop/modules/collection/pages/CSingle.vue

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
11
import { Router } from 'vue-router'
22

33
export default (router: Router) => {
4-
router.addRoute({
5-
path: '/collections/:collectionId',
6-
component: () => import('./pages/CSingle.vue'),
7-
props: true,
8-
})
9-
10-
router.addRoute({
4+
router.addRoute('main', {
115
path: '/collections',
12-
component: () => import('@modules/entry/ELayout.vue'),
13-
children: [
14-
{
15-
path: '',
16-
component: () => import('./pages/CList.vue'),
17-
props: true,
18-
},
19-
{
20-
path: ':collectionId',
21-
component: () => import('./pages/CSingle.vue'),
22-
props: true,
23-
},
24-
],
6+
name: 'collections',
7+
component: () => import('./pages/CList.vue'),
258
})
269
}

packages/desktop/modules/entry/ELayout.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,9 @@ watch(() => props.entryId, check, {
3838
</script>
3939

4040
<template>
41-
<LLayout :hide-toolbar="!store.layout.toolbar" />
41+
<v-layout use-percentage>
42+
<v-layout-content>
43+
<router-view />
44+
</v-layout-content>
45+
</v-layout>
4246
</template>

packages/desktop/modules/entry/pages/EFolder.vue

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import DirectoryEntry from '@core/entities/directory-entry'
66
import { useI18n } from 'vue-i18n'
77
import { useStore } from '../store'
88
9-
import VTr from '@components/v-tr.vue'
9+
import VTr from '@components/VTr.vue'
1010
import LToolbar from '@modules/layout/components/LToolbar.vue'
1111
import EEntryIcon from '../components/EEntryIcon.vue'
1212
import { onKeyStroke } from '@vueuse/core'
@@ -253,38 +253,35 @@ async function onEnter(item: DirectoryEntry) {
253253

254254
<template>
255255
<v-layout use-percentage>
256-
<l-toolbar>
257-
<template #append-navigation>
258-
<v-btn text size="sm" @click="setEntries">
259-
<v-icon name="rotate" />
260-
</v-btn>
261-
<v-menu v-model="menu" offset-y>
262-
<template #activator="{ attrs }">
263-
<v-btn text size="sm" v-bind="attrs">
264-
<v-icon name="plus" />
265-
</v-btn>
266-
</template>
267-
268-
<v-card color="b-secondary">
269-
<v-list-item @click="addFile">
270-
{{ $t('addEntity', [$t('file')]) }}
271-
</v-list-item>
272-
<v-list-item @click="addFolder">
273-
{{ $t('addEntity', [$t('folder')]) }}
274-
</v-list-item>
275-
</v-card>
276-
</v-menu>
277-
</template>
278-
279-
<template #append-links>
280-
<v-input
281-
v-model="search"
282-
:placeholder="$t('search') + '...'"
283-
flat
284-
class="ml-auto w-full max-w-[300px] mr-4"
285-
/>
286-
</template>
287-
</l-toolbar>
256+
<v-layout-toolbar class="px-7 border-b border-lines">
257+
<v-btn mode="text" size="sm" @click="setEntries">
258+
<v-icon name="rotate" />
259+
</v-btn>
260+
261+
<v-menu v-model="menu" offset-y>
262+
<template #activator="{ attrs }">
263+
<v-btn mode="text" size="sm" v-bind="attrs">
264+
<v-icon name="plus" />
265+
</v-btn>
266+
</template>
267+
268+
<v-card color="b-secondary">
269+
<v-list-item @click="addFile">
270+
{{ $t('addEntity', [$t('file')]) }}
271+
</v-list-item>
272+
<v-list-item @click="addFolder">
273+
{{ $t('addEntity', [$t('folder')]) }}
274+
</v-list-item>
275+
</v-card>
276+
</v-menu>
277+
278+
<v-input
279+
v-model="search"
280+
:placeholder="$t('search') + '...'"
281+
class="ml-2 w-full max-w-[300px] mr-4"
282+
size="sm"
283+
/>
284+
</v-layout-toolbar>
288285

289286
<v-layout-content class="overflow-auto h-[calc(100vh_-_45px)]">
290287
<div v-if="loading" class="flex w-full h-full items-center justify-center">
@@ -333,7 +330,7 @@ async function onEnter(item: DirectoryEntry) {
333330
/>
334331

335332
<v-btn
336-
text
333+
mode="text"
337334
size="sm"
338335
color="info"
339336
class="ml-auto text-t-secondary opacity-0 group-hover:opacity-100"
@@ -343,7 +340,7 @@ async function onEnter(item: DirectoryEntry) {
343340
</v-btn>
344341

345342
<v-btn
346-
text
343+
mode="text"
347344
size="sm"
348345
color="danger"
349346
class="text-t-secondary opacity-0 group-hover:opacity-100"

packages/desktop/modules/entry/pages/EMarkdown.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const modeLabels: Record<typeof mode.value, string> = {
118118
</script>
119119
<template>
120120
<v-layout :id="path" use-percentage v-bind="bindings.root">
121-
<v-layout-toolbar v-if="!hideActions" class="border-b border-b-lines">
121+
<v-layout-toolbar class="border-b border-b-lines">
122122
<div class="flex pl-6 pr-7 w-full">
123123
<v-menu offset-y :close-on-content-click="true">
124124
<template #activator="{ attrs }">
@@ -139,13 +139,15 @@ const modeLabels: Record<typeof mode.value, string> = {
139139
</v-menu>
140140

141141
<template v-if="['edit', 'side-by-side'].includes(mode)">
142-
<v-btn size="sm" text @click="setPreview">
142+
<v-btn size="sm" mode="text" @click="setPreview">
143143
<v-icon name="arrows-rotate" />
144144
</v-btn>
145-
<v-btn size="sm" text @click="save">
145+
<v-btn size="sm" mode="text" @click="save">
146146
<v-icon name="save" />
147147
</v-btn>
148148
</template>
149+
150+
<slot name="append-actions" />
149151
</div>
150152
</v-layout-toolbar>
151153

packages/desktop/modules/entry/router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Router } from 'vue-router'
22

33
export default (router: Router) => {
4-
router.addRoute({
4+
router.addRoute('main', {
55
path: '/entries',
66
component: () => import('./ELayout.vue'),
77
props: true,

packages/desktop/modules/item/pages/ISingle.vue

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -81,33 +81,29 @@ watch(() => props.itemId, setContentPath, {
8181
})
8282
</script>
8383
<template>
84-
<l-layout hide-toolbar>
85-
<l-toolbar>
86-
<template #append-links>
87-
<v-btn text size="sm" class="ml-auto" @click="drawer = !drawer">
88-
<v-icon name="cog" />
89-
</v-btn>
90-
</template>
91-
</l-toolbar>
92-
93-
<v-layout v-if="item" use-percentage>
94-
<v-layout-drawer v-model="drawer" class="border-l border-lines px-4 py-4" right>
95-
<i-value
96-
v-for="c in columns"
97-
:key="c.id"
98-
:column-id="c.id"
99-
:collection-id="collectionId"
100-
:item-id="item.id"
101-
:label="c.label"
102-
:type="c.type"
103-
edit
104-
class="mb-4 last:mb-0"
105-
/>
106-
</v-layout-drawer>
107-
108-
<v-layout-content v-if="contentPath">
109-
<e-markdown ref="editorRef" :path="contentPath" :doc:scope="{ item }" />
110-
</v-layout-content>
111-
</v-layout>
112-
</l-layout>
84+
<v-layout use-percentage>
85+
<v-layout-drawer v-if="item" v-model="drawer" class="border-l border-lines px-4 py-4" right>
86+
<i-value
87+
v-for="c in columns"
88+
:key="c.id"
89+
:column-id="c.id"
90+
:collection-id="collectionId"
91+
:item-id="item.id"
92+
:label="c.label"
93+
:type="c.type"
94+
edit
95+
class="mb-4 last:mb-0"
96+
/>
97+
</v-layout-drawer>
98+
99+
<v-layout-content v-if="contentPath">
100+
<e-markdown ref="editorRef" :path="contentPath" :doc:scope="{ item }">
101+
<template #append-actions>
102+
<v-btn mode="text" size="sm" @click="drawer = !drawer">
103+
<v-icon name="cog" />
104+
</v-btn>
105+
</template>
106+
</e-markdown>
107+
</v-layout-content>
108+
</v-layout>
113109
</template>

0 commit comments

Comments
 (0)