Replace svelte components with node views

This commit is contained in:
Jon Staab
2025-02-04 20:00:19 -08:00
parent 506276f594
commit fd99866b1e
16 changed files with 129 additions and 91 deletions
+3 -4
View File
@@ -1,15 +1,14 @@
import {asClassComponent} from "svelte/legacy"
import {mount} from "svelte"
import type {Writable} from "svelte/store"
import {get} from "svelte/store"
import {Editor, SvelteNodeViewRenderer} from "svelte-tiptap"
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 {getSetting, userSettingValues} from "@app/state"
import {MentionNodeView} from "./MentionNodeView"
import ProfileSuggestion from "./ProfileSuggestion.svelte"
import EditMention from "./EditMention.svelte"
export const getUploadType = () => getSetting<"nip96" | "blossom">("upload_type")
@@ -78,7 +77,7 @@ export const makeEditor = ({
},
nprofile: {
extend: {
addNodeView: () => SvelteNodeViewRenderer(asClassComponent(EditMention)),
addNodeView: () => MentionNodeView,
addProseMirrorPlugins() {
return [
MentionSuggestion({