diff --git a/components/CanvasEditor.vue b/components/CanvasEditor.vue index 526547a..a6b5cb8 100644 --- a/components/CanvasEditor.vue +++ b/components/CanvasEditor.vue @@ -1,5 +1,5 @@ + \ No newline at end of file diff --git a/components/base/DraggableTree.vue b/components/base/DraggableTree.vue index 9ad7ac5..3decca2 100644 --- a/components/base/DraggableTree.vue +++ b/components/base/DraggableTree.vue @@ -1,6 +1,6 @@ - + - + @@ -22,4 +22,15 @@ const { delay = 500, disabled = false, side = 'bottom', align = 'center', trigge }>(); const emits = defineEmits(['open']); +const canOpen = ref(true); + +if(triggerKey) +{ + const magicKeys = useMagicKeys(); + const keys = magicKeys[triggerKey]; + + watch(keys, (v) => { + canOpen.value = v; + }, { immediate: true, }); +} \ No newline at end of file diff --git a/components/base/Select.vue b/components/base/Select.vue index 35afcfd..a1ea1e7 100644 --- a/components/base/Select.vue +++ b/components/base/Select.vue @@ -12,7 +12,7 @@ + class="min-w-[160px] bg-light-20 dark:bg-dark-20 will-change-[opacity,transform] z-50"> diff --git a/components/base/Tree.vue b/components/base/Tree.vue index 31fb96f..7081a52 100644 --- a/components/base/Tree.vue +++ b/components/base/Tree.vue @@ -1,6 +1,6 @@ - - + + diff --git a/components/page/Markdown.vue b/components/page/Markdown.vue index 0ede7ee..6194f92 100644 --- a/components/page/Markdown.vue +++ b/components/page/Markdown.vue @@ -20,7 +20,7 @@ if(overview.value && !overview.value.content) - + diff --git a/components/prose/FakeA.vue b/components/prose/FakeA.vue index 81db22f..6ac885a 100644 --- a/components/prose/FakeA.vue +++ b/components/prose/FakeA.vue @@ -1,3 +1,27 @@ - - \ No newline at end of file + + + + + + + + + + + + + + \ No newline at end of file diff --git a/composables/useUserSession.ts b/composables/useUserSession.ts index c9998f7..b0de3fa 100644 --- a/composables/useUserSession.ts +++ b/composables/useUserSession.ts @@ -7,7 +7,6 @@ const useContentFetch = (force: boolean) => useContent().fetch(force); /** * Composable to get back the user session and utils around it. - * @see https://github.com/atinux/nuxt-auth-utils */ export function useUserSession(): UserSessionComposable { const sessionState = useSessionState() diff --git a/layouts/default.vue b/layouts/default.vue index 8d500d6..71b271e 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,84 +1,59 @@ - - + + - + - Accueil + + + + d[any] + - - - - - - - - - - - - - - - - + + Parcourir les projets + Créer du contenu + + + + Se connecter + Créer un compte + + + {{ user!.username }} + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + Projet - + - - + + - + {{ item.value.title }} - + - + Roadmap - Mentions légales - Copyright Peaceultime - 2024 + Copyright Peaceultime - 2025 diff --git a/pages/explore/edit/index.vue b/pages/explore/edit/index.vue index b2ec22f..8e79d8f 100644 --- a/pages/explore/edit/index.vue +++ b/pages/explore/edit/index.vue @@ -5,99 +5,74 @@ - - + + - + + + + + d[any] + - - + + {{ user!.username }} - - - - - - - - - - + + + + Quitter + Enregistrer + + + + + - - - - - - - Modifications non enregistrées - - - - - - - - Supprimer {{ selected.title }} et tous ces enfants ? - - { navigation = tree.remove(navigation, getPath(selected!)); selected = undefined; }">Oui - Non - - - - - - - - - - - - - - - - - - - {{ item.value.title }} + + + + + + {{ item.value.title }} + @@ -113,7 +88,7 @@ + Roadmap - Mentions légales + Copyright Peaceultime - 2025 + @@ -157,14 +136,35 @@ }" class="mx-0 font-mono"/> {{ getPath(selected) }}/ - - - + + + + + + Oui + Non + + + + + + + preferences.markdown.editing = (v as 'reading' | 'editing' | 'split')"> + + + + + + + + + + @@ -175,15 +175,23 @@ {{ contentError }} - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -207,8 +215,9 @@ import { Icon } from '@iconify/vue/dist/iconify.js'; import type { Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/dist/types/tree-item'; import { iconByType, convertContentFromText, convertContentToText, DEFAULT_CONTENT,parsePath } from '#shared/general.util'; -import type { CanvasContent, ExploreContent, FileType, TreeItem } from '~/types/content'; +import type { ExploreContent, FileType, TreeItem } from '~/types/content'; import FakeA from '~/components/prose/FakeA.vue'; +import type { Preferences } from '~/types/general'; export type TreeItemEditable = TreeItem & { @@ -223,6 +232,8 @@ definePageMeta({ layout: 'null', }); +const { user } = useUserSession(); + const router = useRouter(); const open = ref(true), topOpen = ref(true); @@ -234,6 +245,8 @@ const navigation = ref(transform(JSON.parse(JSON.stringify(p const selected = ref(), edited = ref(false); const contentStatus = ref<'idle' | 'pending' | 'success' | 'error'>('idle'), contentError = ref(); +const preferences = useCookie('preferences', { default: () => ({ markdown: { editing: 'split' }, canvas: { snap: true, size: 32 } }), watch: true, maxAge: 60*60*24*31 }); + watch(selected, async (value, old) => { if(selected.value) { @@ -284,10 +297,10 @@ watch(debounced, () => { sessionStorage.setItem(`editing:${encodeURIComponent(selected.value.path)}`, typeof debounced.value === 'string' ? debounced.value : JSON.stringify(debounced.value)); }); useShortcuts({ - meta_s: { usingInput: true, handler: () => save(false) }, - meta_n: { usingInput: true, handler: () => add('markdown') }, - meta_shift_n: { usingInput: true, handler: () => add('folder') }, - meta_shift_z: { usingInput: true, handler: () => router.push({ name: 'explore-path', params: { path: 'index' } }) } + meta_s: { usingInput: true, handler: () => save(false), prevent: true }, + meta_n: { usingInput: true, handler: () => add('markdown'), prevent: true }, + meta_shift_n: { usingInput: true, handler: () => add('folder'), prevent: true }, + meta_shift_z: { usingInput: true, handler: () => router.push({ name: 'explore-path', params: { path: 'index' } }), prevent: true } }) const tree = { diff --git a/pages/index.vue b/pages/index.vue index 56b30fa..c2a7848 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -2,7 +2,5 @@ d[any] - Accueil - - Bienvenue - + Bienvenue \ No newline at end of file diff --git a/public/logo.dark.svg b/public/logo.dark.svg index a677d37..ae2fec5 100644 --- a/public/logo.dark.svg +++ b/public/logo.dark.svg @@ -1,20 +1,13 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/public/logo.light.svg b/public/logo.light.svg index 09bcb73..129f07f 100644 --- a/public/logo.light.svg +++ b/public/logo.light.svg @@ -1,20 +1,13 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/types/general.d.ts b/types/general.d.ts new file mode 100644 index 0000000..05368ec --- /dev/null +++ b/types/general.d.ts @@ -0,0 +1,15 @@ +export type Preferences = { + markdown: MarkdownPreferences, + canvas: CanvasPreferences, +} & GeneralPreferences; + +type GeneralPreferences = { + +}; +type MarkdownPreferences = { + editing: 'split' |'reading' | 'editing'; +}; +type CanvasPreferences = { + snap: boolean; + size?: number; +}; \ No newline at end of file
Copyright Peaceultime - 2024
Copyright Peaceultime - 2025
{{ getPath(selected) }}/