Remove editor, use welshman editor again

This commit is contained in:
Jon Staab
2025-02-04 20:29:12 -08:00
parent fd99866b1e
commit 565ccb399a
18 changed files with 44 additions and 1016 deletions
+6 -6
View File
@@ -1,14 +1,14 @@
import type {NodeViewProps} from '@tiptap/core'
import type {NodeViewProps} from "@tiptap/core"
import {deriveProfileDisplay} from "@welshman/app"
export const MentionNodeView = ({node}: NodeViewProps) => {
const dom = document.createElement('span')
const dom = document.createElement("span")
const display = deriveProfileDisplay(node.attrs.pubkey)
dom.classList.add('tiptap-object')
dom.classList.add("tiptap-object")
const unsubDisplay = display.subscribe($display => {
dom.textContent = '@' + $display
dom.textContent = "@" + $display
})
return {
@@ -17,10 +17,10 @@ export const MentionNodeView = ({node}: NodeViewProps) => {
unsubDisplay()
},
selectNode() {
dom.classList.add('tiptap-active')
dom.classList.add("tiptap-active")
},
deselectNode() {
dom.classList.remove('tiptap-active')
dom.classList.remove("tiptap-active")
},
}
}
+3 -1
View File
@@ -1,3 +1,5 @@
import "@welshman/editor/index.css"
import {mount} from "svelte"
import type {Writable} from "svelte/store"
import {get} from "svelte/store"
@@ -5,7 +7,7 @@ import {Editor} from "@tiptap/core"
import {ctx} from "@welshman/lib"
import type {StampedEvent} from "@welshman/util"
import {signer, profileSearch} from "@welshman/app"
import {MentionSuggestion, WelshmanExtension} from "@lib/editor"
import {MentionSuggestion, WelshmanExtension} from "@welshman/editor"
import {getSetting, userSettingValues} from "@app/state"
import {MentionNodeView} from "./MentionNodeView"
import ProfileSuggestion from "./ProfileSuggestion.svelte"