From 7a277f2c55a9710da073c3beda24f1a334eef01c Mon Sep 17 00:00:00 2001 From: corsacca Date: Fri, 24 Apr 2026 14:33:04 +0100 Subject: [PATCH] fix ts issues --- .gitignore | 2 ++ app/pages/admin/pages/categories/[id].vue | 1 - app/pages/research/[slug]/resources.vue | 2 +- app/utils/tiptapGeneralResources.ts | 2 ++ app/utils/tiptapImage.ts | 2 ++ app/utils/tiptapUupgsList.ts | 2 ++ app/utils/tiptapVerse.ts | 10 ++++++---- 7 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4a7f73a2..26cab8bf 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ logs .env .env.* !.env.example + +plans \ No newline at end of file diff --git a/app/pages/admin/pages/categories/[id].vue b/app/pages/admin/pages/categories/[id].vue index 164d0646..d36d997b 100644 --- a/app/pages/admin/pages/categories/[id].vue +++ b/app/pages/admin/pages/categories/[id].vue @@ -7,7 +7,6 @@ // "Edit" button/link don't get hijacked into a drag. import { ENABLED_LANGUAGES } from '~~/config/languages' -// @ts-expect-error — vuedraggable ships without type declarations. import draggable from 'vuedraggable' definePageMeta({ diff --git a/app/pages/research/[slug]/resources.vue b/app/pages/research/[slug]/resources.vue index 98b940f9..b6666660 100644 --- a/app/pages/research/[slug]/resources.vue +++ b/app/pages/research/[slug]/resources.vue @@ -8,7 +8,7 @@ import type { Uupg, ValueLabel } from '~/types/uupg' -interface UupgDetail extends Uupg { +interface UupgDetail extends Omit { country_code?: ValueLabel rop1?: ValueLabel error?: string diff --git a/app/utils/tiptapGeneralResources.ts b/app/utils/tiptapGeneralResources.ts index 3da6eea8..b31dae49 100644 --- a/app/utils/tiptapGeneralResources.ts +++ b/app/utils/tiptapGeneralResources.ts @@ -1,3 +1,5 @@ +/// + // Custom Tiptap node for the shortcode/placeholder. // Mirrors the UupgsListNode pattern: the editor treats it as an atom // block; generateHTML serializes to a neutral placeholder div; the diff --git a/app/utils/tiptapImage.ts b/app/utils/tiptapImage.ts index 171d8efe..9e655eaf 100644 --- a/app/utils/tiptapImage.ts +++ b/app/utils/tiptapImage.ts @@ -1,3 +1,5 @@ +/// + // Extends @tiptap/extension-image with an `align` attribute so authors // can left/center/right-align block images from the editor toolbar. The // align value renders as an inline style on the element (instead diff --git a/app/utils/tiptapUupgsList.ts b/app/utils/tiptapUupgsList.ts index 60ab674a..1b01c342 100644 --- a/app/utils/tiptapUupgsList.ts +++ b/app/utils/tiptapUupgsList.ts @@ -1,3 +1,5 @@ +/// + // Custom Tiptap node that preserves the Lit custom element // across the HTML→JSON→HTML round-trip. WP's [uupg_list] shortcode // renders this tag directly into page content; without a Tiptap node diff --git a/app/utils/tiptapVerse.ts b/app/utils/tiptapVerse.ts index 0837ea2b..cd184572 100644 --- a/app/utils/tiptapVerse.ts +++ b/app/utils/tiptapVerse.ts @@ -1,3 +1,5 @@ +/// + // Verse block — styled container for a scripture quotation with an // editable reference ("e.g. John 3:16") shown at the top of the block // in the editor and rendered as a citation below the text on the @@ -9,11 +11,11 @@ // framework-agnostic and `generateHTML` on the server stays Vue-free. // The view never runs during `generateHTML`; only the editor mounts it. -import { Node, mergeAttributes } from '@tiptap/core' +import { Node as TiptapNode, mergeAttributes } from '@tiptap/core' export const VERSE_CLASS = 'doxa-verse' -export const Verse = Node.create({ +export const Verse = TiptapNode.create({ name: 'verse', group: 'block', content: 'block+', @@ -103,7 +105,7 @@ export const Verse = Node.create({ } refInput.addEventListener('blur', commitReference) - refInput.addEventListener('keydown', (e) => { + refInput.addEventListener('keydown', (e: KeyboardEvent) => { if (e.key === 'Enter') { e.preventDefault() refInput.blur() @@ -117,7 +119,7 @@ export const Verse = Node.create({ // the input keeps clipboard + key events local to the input. const LOCAL_EVENTS = ['paste', 'copy', 'cut', 'drop', 'dragstart', 'beforeinput', 'input', 'keydown', 'keypress', 'keyup', 'mousedown', 'click'] as const for (const ev of LOCAL_EVENTS) { - refInput.addEventListener(ev, (e) => e.stopPropagation()) + refInput.addEventListener(ev, (e: Event) => e.stopPropagation()) } return {