π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
Types fixes
Smaug67393c56e248d971
diff --git a/frontend/app/components/MarkdownEditor/ColorPickerModal.vue b/frontend/app/components/MarkdownEditor/ColorPickerModal.vueindex a7d02c3f..489af270 100644--- a/frontend/app/components/MarkdownEditor/ColorPickerModal.vue+++ b/frontend/app/components/MarkdownEditor/ColorPickerModal.vue@@ -7,7 +7,7 @@<h4 class="section-title">Quick Colors</h4><div class="swatches"><button- v-for="color in availableColors"+ v-for="color in appColors":key="color"class="swatch":class="{ 'primary-color': color === 'primary' }"@@ -86,6 +86,7 @@<script setup lang="ts">import EditorAppHeader from './EditorAppHeader.vue';+import { appColors } from '~/helpers/constants';import { hsvToHex } from '~/helpers/colors';const props = defineProps<{ onColorSelect: (color: string) => void }>();const emit = defineEmits<{ (e: 'close'): void }>();@@ -100,8 +101,6 @@ const hue = ref(0),const selectedWheelColor = ref('#FF0000');const cursorPosition = ref({ x: 150, y: 75 });-const availableColors = ['primary', ...Array.from({ length: 8 }, (_, i) => getAppAccent(i))];-const selectColor = (color: string) => {props.onColorSelect(color);emit('close');diff --git a/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue b/frontend/app/components/MarkdownEditor/ImageSelectorModal.vueindex 83f3046f..3afe971c 100644--- a/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue+++ b/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue@@ -2,7 +2,7 @@<div class="modal-ctn"><EditorAppHeader icon="image" title="Select Image" subtitle="Choose an image to insert into your document." /><div class="modal-content">- <AppDrop ref="dropComponent" @select="submitFile" />+ <AppDrop ref="dropComponent" @select="submitFile as (file: File) => void" /><Loader v-if="isLoading" style="margin: 12px auto" /><p v-if="uploadError" class="error">{{ uploadError }}</p><div class="search-bar">diff --git a/frontend/app/composables/useSidebar.ts b/frontend/app/composables/useSidebar.tsindex 942a8cd4..eab53ef8 100644--- a/frontend/app/composables/useSidebar.ts+++ b/frontend/app/composables/useSidebar.ts@@ -10,27 +10,22 @@ const isResizing = ref(false);const workspaceId = ref<string | undefined>(undefined);const active_id = ref<string | null>(null);+const { isMobile } = useDevice();+const toggleSidebar = () => (isOpened.value = !isOpened.value);// Lazy-initialized references (only set once when useSidebar is first called)let _sidebarTreeRef: ReturnType<typeof useSidebarTree> | null = null;-let _preferencesRef: ReturnType<typeof usePreferences> | null = null;+const preferences = usePreferences();let _filtered: ComputedRef<Item[]> | null = null;-let _paneWidth: ComputedRef<number> | null = null;+const paneWidth = ref(isMobile.value ? 340 : 390);export function useSidebar() {- const { isMobile } = useDevice();-// Lazy init: only create these onceif (!_sidebarTreeRef) {_sidebarTreeRef = useSidebarTree();}- if (!_preferencesRef) {- _preferencesRef = usePreferences();- }- if (!_paneWidth) {- _paneWidth = computed(() => (isMobile.value ? 340 : 390));- }+if (!_filtered) {/** Filter tree items based on selected workspace and preferences */_filtered = computed(() => {@@ -39,7 +34,7 @@ export function useSidebar() {if (found) return found.childrens || [];if (workspaceId.value === 'shared') return tree.value.filter(i => i.data && i.data.shared);- if (!_preferencesRef!.get('displayUncategorizedResources').value) return tree.value.filter(i => i.data && i.data.role != 4); // hide uncategorized+ if (!preferences.get('displayUncategorizedResources').value) return tree.value.filter(i => i.data && i.data.role != 4); // hide uncategorizedreturn tree.value;});}@@ -49,7 +44,7 @@ export function useSidebar() {toggleSidebar,isOpened,hasSidebar,- paneWidth: _paneWidth,+ paneWidth,isResizing,workspaceId,active_id,diff --git a/frontend/app/helpers/markdown/container.ts b/frontend/app/helpers/markdown/container.tsindex 604f06f4..2a6b84eb 100644--- a/frontend/app/helpers/markdown/container.ts+++ b/frontend/app/helpers/markdown/container.ts@@ -2,6 +2,9 @@ import type MarkdownIt from 'markdown-it';import container from 'markdown-it-container';import type { RenderRule } from 'markdown-it/lib/renderer.mjs';+// eslint-disable-next-line @typescript-eslint/no-explicit-any+const containerPlugin_ = container as any;+export const containerPlugin = (md: MarkdownIt) => {md.use(...createContainer('green', 'TIP', md)).use(...createContainer('grey', 'INFO', md))@@ -16,11 +19,11 @@ export const containerPlugin = (md: MarkdownIt) => {.use(...createInvisibleContainer('column'));};-type ContainerArgs = [typeof container, string, { render: RenderRule }];+type ContainerArgs = [typeof containerPlugin_, string, { render: RenderRule }];function createContainer(klass: string, defaultTitle: string, md: MarkdownIt): ContainerArgs {return [- container,+ containerPlugin_,klass,{render(tokens, idx) {@@ -42,7 +45,7 @@ function createContainer(klass: string, defaultTitle: string, md: MarkdownIt): Cfunction createInvisibleContainer(klass: string): ContainerArgs {return [- container,+ containerPlugin_,klass,{render(tokens, idx) {diff --git a/frontend/app/helpers/markdown/containers-svg.ts b/frontend/app/helpers/markdown/containers-svg.tsindex 5f7ce70d..59adcef0 100644--- a/frontend/app/helpers/markdown/containers-svg.ts+++ b/frontend/app/helpers/markdown/containers-svg.ts@@ -3,6 +3,8 @@ import type MarkdownIt from 'markdown-it';import container from 'markdown-it-container';import { svg_info, svg_warning, containerOpen } from './constants';+const containerPlugin = container as any;+export const containerSvg = (md: MarkdownIt) => {const containers = [{ name: 'definition', color: 'red', icon: svg_info },@@ -15,7 +17,7 @@ export const containerSvg = (md: MarkdownIt) => {];containers.forEach(({ name, color, icon }) => {- md.use(container, name, {+ md.use(containerPlugin, name, {validate(params: string) {// Autorise le pattern `nom + titre`return params.trim().match(new RegExp(`^${name}\\s+(.*)$`));diff --git a/frontend/app/pages/dashboard/import.vue b/frontend/app/pages/dashboard/import.vueindex 71287106..d9d3df83 100644--- a/frontend/app/pages/dashboard/import.vue+++ b/frontend/app/pages/dashboard/import.vue@@ -7,7 +7,7 @@You can import documents from a previous export. If you don't have export, you can create a new one from the<NuxtLink to="/dashboard/settings?p=backup" style="color: var(--primary)">settings</NuxtLink> page.</p>- <AppDrop ref="dropComponent" @select="handleFileSelect" />+ <AppDrop ref="dropComponent" @select="handleFileSelect as (file: File) => void" /><div class="submit"><AppButton type="primary" :disabled="!selectedFile" @click="submit">Analyse file</AppButton></div>