9311652bed
* Embed a tweet by URL * Clean up imports * Prevent tweetId from getting interpreted as a number * Use a single place to embed iframe, Youtube, and Tweets * Support Manifold and Metaculus embeds * Remove unused import * Simplify Manifold paste logic * Clean up embed rewrite code * Add back comment * Rejigger config so tsx is only in web/ * Clean up comment * Revert unnecessary tsconfig change * Fix placeholder * Lighten placeholder
14 lines
434 B
TypeScript
14 lines
434 B
TypeScript
import { Node } from '@tiptap/core'
|
|
import { ReactNodeViewRenderer } from '@tiptap/react'
|
|
import { TiptapTweetNode } from 'common/util/tiptap-tweet-type'
|
|
import WrappedTwitterTweetEmbed from './tweet-embed'
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-ignore
|
|
export default Node.create<TweetOptions>({
|
|
...TiptapTweetNode,
|
|
addNodeView() {
|
|
return ReactNodeViewRenderer(WrappedTwitterTweetEmbed)
|
|
},
|
|
})
|