extension-embed
package @remirror/extension-embed
class IframeExtension
An extension for the remirror editor.
Signature:
export declare class IframeExtension extends NodeExtension<IframeOptions>
Extends: NodeExtension<IframeOptions>
(Some inherited members may not be shown because they are not represented in the documentation.)
property name
Signature:
get name(): "iframe";
method addIframe
Add a custom iFrame to the editor.
Signature:
addIframe(attributes: IframeAttributes): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
attributes | IframeAttributes |
Returns:
CommandFunction
method addYouTubeVideo
Add a YouTube embedded iFrame to the editor.
Signature:
addYouTubeVideo(props: CreateYouTubeIframeProps): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
props | CreateYouTubeIframeProps |
Returns:
CommandFunction
method createNodeSpec
Signature:
createNodeSpec(extra: ApplySchemaAttributes, override: NodeSpecOverride): NodeExtensionSpec;
Parameters:
Parameter | Type | Description |
---|---|---|
extra | ApplySchemaAttributes | |
override | NodeSpecOverride |
Returns:
method createNodeViews
Signature:
createNodeViews(): NodeViewMethod | Record<string, NodeViewMethod>;
Returns:
NodeViewMethod | Record<string, NodeViewMethod>
method createTags
Signature:
createTags(): "block"[];
Returns:
"block"[]
method updateIframeSource
Update the iFrame source for the currently selected video.
Signature:
updateIframeSource(src: string): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
src | string |
Returns:
CommandFunction
method updateYouTubeVideo
Update the YouTube video iFrame.
Signature:
updateYouTubeVideo(props: CreateYouTubeIframeProps): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
props | CreateYouTubeIframeProps |
Returns:
CommandFunction
interface IframeOptions
Signature:
export interface IframeOptions
property class
The class to add to the iframe.
Signature:
class?: Static<string>;
property defaultSource
The default source to use for the iframe.
Signature:
defaultSource?: Static<string>;
property enableResizing
Enable resizing.
If true, the iframe node will be rendered by nodeView
instead of toDOM
.
Signature:
enableResizing: boolean;
type IframeAttributes
Signature:
export type IframeAttributes = ProsemirrorAttributes<{
src: string;
frameBorder?: number | string;
allowFullScreen?: 'true' | boolean;
width?: number;
height?: number;
type?: LiteralUnion<'youtube', string>;
}>;
References: ProsemirrorAttributes