Skip to main content

extension-bidi

package @remirror/extension-bidi

class BidiExtension

An extension which adds bi-directional text support to your editor. This is the best way to support languages which are read from right-to-left.

Signature:

export declare class BidiExtension extends PlainExtension<BidiOptions> 

Extends: PlainExtension<BidiOptions>

(Some inherited members may not be shown because they are not represented in the documentation.)

property name

Signature:

get name(): "bidi";

method createAttributes

Add the bidi property to the top level editor attributes doc.

Signature:

createAttributes(): ProsemirrorAttributes;

Returns:

ProsemirrorAttributes

method createPlugin

Create the plugin that ensures the node has the correct dir value on each state update.

Signature:

createPlugin(): CreateExtensionPlugin<boolean>;

Returns:

CreateExtensionPlugin<boolean>

method createSchemaAttributes

Add the dir to all the inner node types.

Signature:

createSchemaAttributes(): IdentifierSchemaAttributes[];

Returns:

IdentifierSchemaAttributes[]

method onSetOptions

Signature:

protected onSetOptions(props: OnSetOptionsProps<BidiOptions>): void;

Parameters:

ParameterTypeDescription
propsOnSetOptionsProps<BidiOptions>

Returns:

void

method setTextDirection

Signature:

setTextDirection(dir: 'ltr' | 'rtl' | undefined, options?: SetTextDirectionOptions): CommandFunction;

Parameters:

ParameterTypeDescription
dir'ltr' | 'rtl' | undefined
optionsSetTextDirectionOptions(Optional)

Returns:

CommandFunction

interface BidiOptions

Signature:

export interface BidiOptions 

property autoUpdate

Whether or not the extension should automatically infer the direction as you type.

Signature:

autoUpdate?: boolean;

property defaultDirection

This is the direction that is used when the algorithm is not quite sure.

Signature:

defaultDirection?: AcceptUndefined<'ltr' | 'rtl'>;

property excludeNodes

The names of the nodes to exclude.

Signature:

excludeNodes?: Static<string[]>;