forked from coracle/flotilla
Work on compose
This commit is contained in:
+19
-2
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user