Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Start dock

Smaug#673933da8beec72d
diff --git a/frontend/components/MediumView.vue b/frontend/components/MediumView.vue
index 86c9ff94..c7c792b8 100644
--- a/frontend/components/MediumView.vue
+++ b/frontend/components/MediumView.vue
@@ -7,7 +7,7 @@
<script setup lang="ts">
const { isOpened, paneWidth, isResizing } = useSidebar();
const mediumContainer = ref<HTMLElement | null>(null);
-const marginLeft = computed(() => (isMobile() || !isOpened.value ? '16px' : `${paneWidth.value + 16}px`));
+const marginLeft = computed(() => (isMobile() || !isOpened.value ? '12px' : `${paneWidth.value + 12}px`));
const transition = computed(() => (isResizing.value ? 'none' : 'padding-left 0.3s'));
</script>
diff --git a/frontend/components/Sidebar/Dock.vue b/frontend/components/Sidebar/Dock.vue
new file mode 100644
index 00000000..9c4ff1e0
--- /dev/null
+++ b/frontend/components/Sidebar/Dock.vue
@@ -0,0 +1,58 @@
+<template>
+ <div class="dock">
+ <NuxtLink to="/dashboard">
+ <Icon name="dashboard" fill="var(--font-color-dark)" :big="true" />
+ </NuxtLink>
+ <NuxtLink to="/dashboard/categories">
+ <Icon name="categories" fill="var(--font-color-dark)" :big="true" />
+ </NuxtLink>
+ <NuxtLink to="/dashboard/cdn">
+ <Icon name="cdn" fill="var(--font-color-dark)" :big="true" />
+ </NuxtLink>
+ <NuxtLink to="/dashboard/settings">
+ <Icon name="settings" fill="var(--font-color-dark)" :big="true" />
+ </NuxtLink>
+ <NuxtLink to="/dashboard/import">
+ <Icon name="import" fill="var(--font-color-dark)" :big="true" />
+ </NuxtLink>
+ <div style="margin-top: auto">
+ <NuxtLink to="#" @click="closeDock">
+ <Icon name="arrow_close" fill="var(--font-color-dark)" :big="true" />
+ </NuxtLink>
+ </div>
+ </div>
+</template>
+
+<style scoped lang="scss">
+.dock {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ padding: 1.2rem 0.3rem;
+ border-right: 1px solid var(--border-color);
+}
+a {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 40px;
+ height: 40px;
+ &:hover {
+ &:deep(svg) {
+ fill: var(--blue);
+ }
+ }
+}
+a.router-link-exact-active {
+ &:deep(svg) {
+ fill: var(--blue);
+ }
+}
+</style>
+
+<script setup lang="ts">
+function closeDock() {
+ useSidebar().isDockOpened.value = false;
+ usePreferencesStore().set({ key: 'hideDock', value: false });
+}
+</script>
diff --git a/frontend/components/Sidebar/Resizable.vue b/frontend/components/Sidebar/Resizable.vue
index e28cb612..1ae23c7e 100644
--- a/frontend/components/Sidebar/Resizable.vue
+++ b/frontend/components/Sidebar/Resizable.vue
@@ -1,7 +1,7 @@
<template>
<nav :class="{ open: isOpened }">
<div class="sidebar no-select">
- <div :style="{ width: panewidthCSS, maxHeight: '100%', overflowY: 'scroll' }">
+ <div :style="{ width: panewidthCSS, display: 'flex' }">
<slot></slot>
</div>
<div class="separator" @mousedown="startResize"></div>
diff --git a/frontend/components/Sidebar/Sidebar.vue b/frontend/components/Sidebar/Sidebar.vue
index e71c3dca..5bc4dbb5 100644
--- a/frontend/components/Sidebar/Sidebar.vue
+++ b/frontend/components/Sidebar/Sidebar.vue
@@ -1,6 +1,7 @@
<template>
<div :class="{ 'sidebar-mask': isMobile() && isOpened }"></div>
<Resizable>
+ <Dock v-if="!isMobile() && isDockOpened" />
<div class="sidebar" :class="{ compact: preferences.get('compactMode') }">
<section class="header">
<span class="name">
@@ -40,8 +41,9 @@ import IconClose from './IconClose.vue';
import Search from './Search.vue';
import { navigationItems } from './helpers';
import NewCategoryModal from '../../pages/dashboard/categories/_modals/CreateCategoryModal.vue';
+import Dock from './Dock.vue';
-const { isOpened, hasSidebar } = useSidebar();
+const { isOpened, hasSidebar, isDockOpened } = useSidebar();
const categoriesStore = useCategoriesStore();
const preferences = usePreferencesStore();
const userStore = useUserStore();
@@ -98,6 +100,8 @@ const onClick = () => {
onMounted(() => {
hasSidebar.value = true;
+ isDockOpened.value = preferences.get('hideDock');
+ console.log(isDockOpened.value);
if (isMobile()) return document.addEventListener('click', handleClickOutside);
// ELSE: Desktop
isOpened.value = true;
@@ -113,6 +117,13 @@ onBeforeUnmount(() => {
<style scoped lang="scss">
.sidebar {
padding: 0.5rem 0.7rem;
+ max-height: 100%;
+ overflow-y: scroll;
+ width: 100%;
+ font-family: Inter;
+ * {
+ font-family: Inter;
+ }
}
.header {
@@ -183,7 +194,7 @@ onBeforeUnmount(() => {
}
.compact:deep(.item) {
font-size: 15px;
- padding: 0 2.5px;
+ padding: 0 3px;
margin: 0;
}
diff --git a/frontend/components/Sidebar/SidebarItem.vue b/frontend/components/Sidebar/SidebarItem.vue
index 6fc0e485..dc37a96a 100644
--- a/frontend/components/Sidebar/SidebarItem.vue
+++ b/frontend/components/Sidebar/SidebarItem.vue
@@ -91,7 +91,7 @@ const drop = async (event: DragEvent) => {
align-items: center;
padding: 0 2.5px;
margin: 2.5px 0;
- border-radius: 7px;
+ border-radius: 5px;
color: var(--font-color);
cursor: pointer;
width: 98%;
diff --git a/frontend/composables/Sidebar.ts b/frontend/composables/Sidebar.ts
index eb861e7f..3547306f 100644
--- a/frontend/composables/Sidebar.ts
+++ b/frontend/composables/Sidebar.ts
@@ -1,6 +1,7 @@
const isOpened = ref(false);
+const isDockOpened = ref(true);
const hasSidebar = ref(false);
-const paneWidth = ref(360); // initial width of pane 1
+const paneWidth = ref(isMobile() || !isDockOpened ? 350 : 380); // initial width of pane 1
const isResizing = ref(false);
const workspaceId = ref<string | null>(null);
@@ -14,5 +15,6 @@ export function useSidebar() {
paneWidth,
isResizing,
workspaceId,
+ isDockOpened,
};
}
diff --git a/frontend/helpers/icons.ts b/frontend/helpers/icons.ts
index 82d0be0e..7cd0e3fc 100644
--- a/frontend/helpers/icons.ts
+++ b/frontend/helpers/icons.ts
@@ -2,12 +2,14 @@ const icons = {
add_file: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M440-240h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520v-200H240v640h480v-440H520ZM240-800v200-200 640-640Z"/></svg>`,
add_folder: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M560-320h80v-80h80v-80h-80v-80h-80v80h-80v80h80v80ZM160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Zm0-80h640v-400H447l-80-80H160v480Zm0 0v-480 480Z"/></svg>`,
archive: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><rect x="2.5" y="2.5" width="11" height="11" rx="1.5" fill="var(--grey-bg)" stroke="var(--grey)"/><rect x="6" y="4" width="2" height="2" rx="0.5" fill="var(--grey)"/><rect x="6" y="8" width="2" height="2" rx="0.5" fill="var(--grey)"/><rect x="8" y="10" width="2" height="2" rx="0.5" fill="var(--grey)"/><rect x="8" y="6" width="2" height="2" rx="0.5" fill="var(--grey)"/></svg>`,
+ arrow_close: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M440-240 200-480l240-240 56 56-183 184 183 184-56 56Zm264 0L464-480l240-240 56 56-183 184 183 184-56 56Z"/></svg>`,
backup: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M260-160q-91 0-155.5-63T40-377q0-78 47-139t123-78q17-72 85-137t145-65q33 0 56.5 23.5T520-716v242l64-62 56 56-160 160-160-160 56-56 64 62v-242q-76 14-118 73.5T280-520h-20q-58 0-99 41t-41 99q0 58 41 99t99 41h480q42 0 71-29t29-71q0-42-29-71t-71-29h-60v-80q0-48-22-89.5T600-680v-93q74 35 117 103.5T760-520q69 8 114.5 59.5T920-340q0 75-52.5 127.5T740-160H260Zm220-358Z"/></svg>`,
categories: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M320-320h480v-480h-80v280l-100-60-100 60v-280H320v480Zm0 80q-33 0-56.5-23.5T240-320v-480q0-33 23.5-56.5T320-880h480q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H320ZM160-80q-33 0-56.5-23.5T80-160v-560h80v560h560v80H160Zm360-720h200-200Zm-200 0h480-480Z"/></svg>`,
cdn: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M485-440h163q26 0 44-18t18-44q0-26-18-44.5T648-565h-2q-5-32-29-53.5T560-640q-26 0-47 13.5T481-590q-30 2-50.5 23.5T410-515q0 30 21.5 52.5T485-440ZM120-120q-33 0-56.5-23.5T40-200v-520h80v520h680v80H120Zm160-160q-33 0-56.5-23.5T200-360v-440q0-33 23.5-56.5T280-880h200l80 80h280q33 0 56.5 23.5T920-720v360q0 33-23.5 56.5T840-280H280Zm0-80h560v-360H527l-80-80H280v440Zm0 0v-440 440Z"/></svg>`,
close: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"stroke-linecap="round" stroke-linejoin="round" class="h-4 w-4"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg>`,
collapse: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="m480-500 160-160H320l160 160Zm280-340q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560ZM200-320v120h560v-120H200Zm560-80v-360H200v360h560Zm-560 80v120-120Z"/></svg>`,
copy: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--font-color)"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"/></svg>`,
+ dashboard: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z"/></svg>`,
delete: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--font-color)"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z" /></svg>`,
draft: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path style="fill:var(--teal)" d="M240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520v-200H240v640h480v-440H520ZM240-800v200-200 640-640Z"/></svg>`,
edit: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--font-color)"><path d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"/></svg>`,
diff --git a/frontend/helpers/importations.ts b/frontend/helpers/importations.ts
index fbe656be..843b7014 100644
--- a/frontend/helpers/importations.ts
+++ b/frontend/helpers/importations.ts
@@ -1,4 +1,4 @@
-import type { Category, DB_Category, DB_Document, DB_Ressource } from '~/stores';
+import type { DB_Category, DB_Document, DB_Ressource } from '~/stores';
interface ImportationStructure {
documents: DB_Document[];
diff --git a/frontend/pages/dashboard/categories/index.vue b/frontend/pages/dashboard/categories/index.vue
index 519bba78..b4c763d7 100644
--- a/frontend/pages/dashboard/categories/index.vue
+++ b/frontend/pages/dashboard/categories/index.vue
@@ -63,10 +63,6 @@ header {
font-size: 15px;
font-weight: bold;
}
-.card-component {
- display: block;
- margin: 2px 0;
-}
@media screen and (max-width: 768px) {
header {
flex-direction: column;
diff --git a/frontend/pages/dashboard/docs/[id].vue b/frontend/pages/dashboard/docs/[id].vue
index a917654c..257cb57b 100644
--- a/frontend/pages/dashboard/docs/[id].vue
+++ b/frontend/pages/dashboard/docs/[id].vue
@@ -1,5 +1,5 @@
<template>
- <div v-if="article?.id" style="width: 100%; padding: 0 1rem">
+ <div v-if="article?.id" style="width: 100%; padding: 0 0.5rem">
<div style="display: flex; justify-content: space-between">
<div style="width: 100%; max-width: 980px; margin: auto">
<DocumentCardHeader :doc="article" style="margin-bottom: 20px" />
diff --git a/frontend/pages/dashboard/settings/_views/preferences.vue b/frontend/pages/dashboard/settings/_views/preferences.vue
index f8565674..d57d524f 100644
--- a/frontend/pages/dashboard/settings/_views/preferences.vue
+++ b/frontend/pages/dashboard/settings/_views/preferences.vue
@@ -84,6 +84,12 @@ const options = ref<{ label: string; options: Option[] }[]>([
value: Boolean(preferencesStore.get('compactMode')),
storageKey: 'compactMode',
},
+ {
+ label: 'View dock',
+ type: 'toggle',
+ value: Boolean(preferencesStore.get('hideDock')),
+ storageKey: 'hideDock',
+ },
{
label: 'Normalize file icons',
type: 'toggle',
diff --git a/frontend/stores/preferences.store.ts b/frontend/stores/preferences.store.ts
index cd91bd9f..f286ceaf 100644
--- a/frontend/stores/preferences.store.ts
+++ b/frontend/stores/preferences.store.ts
@@ -1,6 +1,6 @@
/* Store to save user local preferences */
/* Only local settings with localStorage but no db or requests */
-export type PreferenceKey = 'printMode' | 'darkMode' | 'hideTOC' | 'compactMode' | 'hideSidebarRessources' | 'normalizeFileIcons' | 'datatableItemsCount';
+export type PreferenceKey = 'printMode' | 'darkMode' | 'hideTOC' | 'compactMode' | 'hideSidebarRessources' | 'normalizeFileIcons' | 'datatableItemsCount' | 'hideDock';
export interface Preference {
key: PreferenceKey;
value: any;
diff --git a/frontend/styles/_variables.scss b/frontend/styles/_variables.scss
index e758910e..e77b959e 100644
--- a/frontend/styles/_variables.scss
+++ b/frontend/styles/_variables.scss
@@ -38,14 +38,14 @@ $primary-dark: color.adjust(#007aff, $lightness: -10%);
--bg-contrast: #f0f6fb;
--bg-contrast-2: #ECF2FF;
--selection-color: #dde3e9;
- --font-color: #1f2937;
+ --font-color: #3c4450;
--font-color-dark: #374151;
--font-color-light: #6b7280;
--border-color: rgba(0, 0, 0, 0.1);
// COLORS \\
--grey: #666;
- --grey-bg: rgb(240, 240, 240);
+ --grey-bg: #EFEEEA;
--blue: #007aff;
--blue-bg: #cce0ff;
--blue-border: rgba(0, 123, 255, 0.3);
diff --git a/frontend/styles/components.scss b/frontend/styles/components.scss
index 0b748eaf..75da6f9b 100644
--- a/frontend/styles/components.scss
+++ b/frontend/styles/components.scss
@@ -11,7 +11,7 @@
.card-component {
display: block;
- margin: 2px 0;
+ margin: 8px 0;
width: 100%;
gap: 16px;
padding: 24px;