Stop trying to use editor to view notes

This commit is contained in:
Jon Staab
2024-09-24 11:03:19 -07:00
parent 256a70d6fb
commit 148208f072
8 changed files with 12 additions and 67 deletions
+1 -35
View File
@@ -52,7 +52,6 @@ type EditorOptions = {
loading: Writable<boolean>
getPubkeyHints: (pubkey: string) => string[]
submitOnEnter?: boolean
content?: string
autofocus?: boolean
}
@@ -80,11 +79,10 @@ export const getEditorOptions = ({
loading,
getPubkeyHints,
submitOnEnter,
content = "",
autofocus = false,
}: EditorOptions) => ({
content,
autofocus,
content: "",
extensions: [
Code,
CodeBlock,
@@ -141,36 +139,4 @@ export const getEditorOptions = ({
},
}),
],
// onTransaction() {
// // @ts-ignore
// console.log(this.getJSON())
// }
})
type ViewOptions = {
content: string
}
export const getViewOptions = ({content}: ViewOptions) => ({
content,
editable: false,
shouldRerenderOnTransaction: false,
extensions: [
Code,
CodeBlock,
Document,
Paragraph,
Text,
LinkExtension.extend({
addNodeView: () => SvelteNodeViewRenderer(EditLink),
}),
Bolt11Extension.extend(asInline({addNodeView: () => SvelteNodeViewRenderer(EditBolt11)})),
NProfileExtension.extend({
addNodeView: () => SvelteNodeViewRenderer(EditMention),
}),
NEventExtension.extend(asInline({addNodeView: () => SvelteNodeViewRenderer(EditEvent)})),
NAddrExtension.extend(asInline({addNodeView: () => SvelteNodeViewRenderer(EditEvent)})),
ImageExtension.extend(asInline({addNodeView: () => SvelteNodeViewRenderer(EditImage)})),
VideoExtension.extend(asInline({addNodeView: () => SvelteNodeViewRenderer(EditVideo)})),
],
})