Skip to main content

preset-core

package @remirror/preset-core

function corePreset()

The core preset is included by default when creating an editor with @remirror/react.

It comes with the the following extensions.

  • HistoryExtension - for undo and redo functionality - DocExtension - provides the top level prosemirror node. - TextExtension - provides the prosemirror text node - ParagraphExtension - provides the prosemirror paragraph node - PositionerExtension - set up automatic position checking and creation of virtual nodes from any part of the editor.

Signature:

export declare function corePreset(options?: GetStaticAndDynamic<CorePresetOptions>): CorePreset[];

Parameters:

ParameterTypeDescription
optionsGetStaticAndDynamic<CorePresetOptions>(Optional)

Returns:

CorePreset[]

function createCoreManager()

Create a manager with the core preset already applied.

Signature:

export declare function createCoreManager<Extension extends AnyExtension>(extensions: Extension[] | (() => Extension[]), options?: CreateCoreManagerOptions): RemirrorManager<Extension | CorePreset | BuiltinPreset>;

Parameters:

ParameterTypeDescription
extensionsExtension[] | (() => Extension[])
optionsCreateCoreManagerOptions(Optional)

Returns:

RemirrorManager<Extension | CorePreset | BuiltinPreset>

interface CorePresetOptions

The options for the core preset.

Signature:

export interface CorePresetOptions extends DocOptions, PositionerOptions, HistoryOptions 

Extends: DocOptions, PositionerOptions, HistoryOptions

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

property excludeExtensions

You can exclude one or multiple extensions from the [[corePreset]] function by passing their extension names in excludeExtensions.

When using the yjs extension it is important to exclude the history extension to prevent issues with collaborative editing mode.

Signature:

excludeExtensions?: Static<ExcludeExtensionKey[]>;

interface CreateCoreManagerOptions

Signature:

export interface CreateCoreManagerOptions extends Remirror.ManagerSettings 

Extends: Remirror.ManagerSettings

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

property core

The core preset options.

Signature:

core?: GetStaticAndDynamic<CorePresetOptions>;

type CorePreset

Signature:

export type CorePreset = HistoryExtension | GapCursorExtension | DocExtension | TextExtension | ParagraphExtension | PositionerExtension | EventsExtension;