Work on compose

This commit is contained in:
Jon Staab
2024-08-22 16:16:35 -07:00
parent 91fbc260eb
commit dc4dcb1ea2
12 changed files with 159 additions and 129 deletions
+19 -2
View File
@@ -1,3 +1,20 @@
import type {JSONContent} from '@tiptap/core'
export {createSuggestions} from '@lib/tiptap/Suggestions'
export {LinkExtension} from '@lib/tiptap/LinkExtension'
export {Mention} from '@lib//tiptap/Mention'
export {Topic} from '@lib//tiptap/Topic'
export const findNodes = (json: JSONContent, type: string) => {
const results: JSONContent[] = []
for (const node of json.content || []) {
if (node.type === type) {
results.push(node)
}
for (const result of findNodes(node, type)) {
results.push(result)
}
}
return results
}