diff --git a/package-lock.json b/package-lock.json index 52ff87b..b37b545 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@mdi/font": "^7.4.47", "@supabase/supabase-js": "^2.41.1", + "@types/markdown-it": "^14.1.2", "@vee-validate/i18n": "^4.12.6", "@vee-validate/rules": "^4.12.6", "@vueuse/core": "^10.9.0", @@ -880,6 +881,28 @@ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" }, + "node_modules/@types/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", + "license": "MIT" + }, + "node_modules/@types/markdown-it": { + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", + "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", + "license": "MIT", + "dependencies": { + "@types/linkify-it": "^5", + "@types/mdurl": "^2" + } + }, + "node_modules/@types/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", + "license": "MIT" + }, "node_modules/@types/node": { "version": "20.12.7", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", diff --git a/package.json b/package.json index 9969537..a0bd654 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@mdi/font": "^7.4.47", "@supabase/supabase-js": "^2.41.1", + "@types/markdown-it": "^14.1.2", "@vee-validate/i18n": "^4.12.6", "@vee-validate/rules": "^4.12.6", "@vueuse/core": "^10.9.0", diff --git a/src/components/memoEntry/MemoEntry.vue b/src/components/memoEntry/MemoEntry.vue index 5dc092f..d77647e 100644 --- a/src/components/memoEntry/MemoEntry.vue +++ b/src/components/memoEntry/MemoEntry.vue @@ -270,7 +270,6 @@ const i18n = useI18n(); const { alert } = useNotifications(); const { - files, open: openImageDialog, reset: resetFileDialog, onChange: onFileDialogChange @@ -379,9 +378,9 @@ const interactionDisabled = computed(() => props.disabled || props.readonly || s onFileDialogChange(async (files) => { if (files) { - for (const file of files) { - if (file.size < MAX_FILE_SIZE) { - (state.files as File[]).push(file); + for (let i = 0; i < files.length; i++) { + if (files[i].size < MAX_FILE_SIZE) { + (state.files as File[]).push(files[i]); } else { alert({ text: "File too big! (Max 10MB)", diff --git a/src/views/Resources.vue b/src/views/Resources.vue index 7436fc4..0da36c2 100644 --- a/src/views/Resources.vue +++ b/src/views/Resources.vue @@ -168,7 +168,7 @@ const extensions = computed(() => { }); const groupedFiles = computed>(() => { - const groups = {}; + const groups: Record = {}; const extensions = new Set(state.files.map((f) => getExtensionFromFileName(f.name))); for (const extension of extensions) { diff --git a/src/vue-smooth-dnd.d.ts b/src/vue-smooth-dnd.d.ts new file mode 100644 index 0000000..f94dba9 --- /dev/null +++ b/src/vue-smooth-dnd.d.ts @@ -0,0 +1,59 @@ +declare module "vue3-smooth-dnd" { + import Vue from "vue"; + + type Payload = any; + + interface DropResult { + removedIndex: number; + addedIndex: number; + payload: Payload; + element: Element; + } + + interface DragEvent { + isSource: boolean; + payload: Payload; + willAcceptDrop: boolean; + } + + interface NodeDescription { + value: string; + props: Vue.VNodeData; + } + + interface ContainerProps { + orientation?: string; + behaviour?: string; + tag?: string | NodeDescription; + groupName?: string; + lockAxis?: string; + dragHandleSelector?: string; + nonDragAreaSelector?: string; + dragBeginDelay?: number; + animationDuration?: number; + autoScrollEnabled?: boolean; + dragClass?: string; + dropClass?: string; + removeOnDropOut?: boolean; + getChildPayload?: (index: number) => Payload; + shouldAnimateDrop?: (sourceContainerOptions: ContainerProps, payload: Payload) => boolean; + shouldAcceptDrop?: (sourceContainerOptions: ContainerProps, payload: Payload) => boolean; + getGhostParent: () => Element; + onDragStart?: (dragEvent: DragEvent) => void; + onDragEnd?: (dragEvent: DragEvent) => void; + onDrop?: (dropResult: DropResult) => void; + onDragEnter?: () => void; + onDragLeave?: () => void; + onDropReady?: (dropResult: DropResult) => void; + } + + class Container extends Vue { + props: ContainerProps; + } + + class Draggable extends Vue { + props: { + tag?: string | NodeDescription; + }; + } +} diff --git a/tsconfig.json b/tsconfig.json index fab094c..3f76013 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ESNext", "jsx": "preserve", - "lib": ["DOM", "ESNext"], + "lib": ["DOM", "ESNext", "dom.iterable"], "baseUrl": ".", "module": "ESNext", "moduleResolution": "bundler",