Code cleanups and comments
This commit is contained in:
parent
41a78ea09c
commit
88662ee489
|
@ -13,14 +13,13 @@ export interface IframeOptions {
|
||||||
declare module '@tiptap/core' {
|
declare module '@tiptap/core' {
|
||||||
interface Commands<ReturnType> {
|
interface Commands<ReturnType> {
|
||||||
iframe: {
|
iframe: {
|
||||||
/**
|
|
||||||
* Add an iframe
|
|
||||||
*/
|
|
||||||
setIframe: (options: { src: string }) => ReturnType
|
setIframe: (options: { src: string }) => ReturnType
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// These classes style the outer wrapper and the inner iframe;
|
||||||
|
// Adopted from css in https://github.com/ueberdosis/tiptap/blob/main/demos/src/Experiments/Embeds/Vue/index.vue
|
||||||
const wrapperClasses = 'relative h-auto w-full overflow-hidden'
|
const wrapperClasses = 'relative h-auto w-full overflow-hidden'
|
||||||
const iframeClasses = 'absolute top-0 left-0 h-full w-full'
|
const iframeClasses = 'absolute top-0 left-0 h-full w-full'
|
||||||
|
|
||||||
|
@ -58,11 +57,7 @@ export default Node.create<IframeOptions>({
|
||||||
},
|
},
|
||||||
|
|
||||||
parseHTML() {
|
parseHTML() {
|
||||||
return [
|
return [{ tag: 'iframe' }]
|
||||||
{
|
|
||||||
tag: 'iframe',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
|
|
||||||
renderHTML({ HTMLAttributes }) {
|
renderHTML({ HTMLAttributes }) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user