Skip to main content

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:

ParameterTypeDescription
attributesIframeAttributes

Returns:

CommandFunction

method addYouTubeVideo

Add a YouTube embedded iFrame to the editor.

Signature:

addYouTubeVideo(props: CreateYouTubeIframeProps): CommandFunction;

Parameters:

ParameterTypeDescription
propsCreateYouTubeIframeProps

Returns:

CommandFunction

method createNodeSpec

Signature:

createNodeSpec(extra: ApplySchemaAttributes, override: NodeSpecOverride): NodeExtensionSpec;

Parameters:

ParameterTypeDescription
extraApplySchemaAttributes
overrideNodeSpecOverride

Returns:

NodeExtensionSpec

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:

ParameterTypeDescription
srcstring

Returns:

CommandFunction

method updateYouTubeVideo

Update the YouTube video iFrame.

Signature:

updateYouTubeVideo(props: CreateYouTubeIframeProps): CommandFunction;

Parameters:

ParameterTypeDescription
propsCreateYouTubeIframeProps

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