extension-diff
package @remirror/extension-diff
class DiffExtension
An extension for the remirror editor. CHANGE ME.
Signature:
export declare class DiffExtension extends PlainExtension<DiffOptions>
Extends: PlainExtension<DiffOptions>
(Some inherited members may not be shown because they are not represented in the documentation.)
property name
Signature:
get name(): "diff";
method commitChange
Add a commit to the transaction history.
Signature:
commitChange(message: string): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
message | string |
Returns:
CommandFunction
method createPlugin
Create the custom change tracking plugin.
This has been adapted from the prosemirror website demo. https://github.com/ProseMirror/website/blob/master/example/track/index.js
Signature:
createPlugin(): CreateExtensionPlugin;
Returns:
CreateExtensionPlugin
method getCommit
Get the commit by it's index
Signature:
getCommit(id: CommitId): Helper<Commit>;
Parameters:
Parameter | Type | Description |
---|---|---|
id | CommitId |
Returns:
Helper<Commit>
method getCommits
Get the full list of tracked commit changes
Signature:
getCommits(): Helper<Commit[]>;
Returns:
Helper<Commit[]>
method highlightCommit
Highlight the provided commit.
Signature:
highlightCommit(commit: Commit | CommitId): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
commit | Commit | CommitId |
Returns:
CommandFunction
method removeHighlightedCommit
Remove the highlight from the commit.
Signature:
removeHighlightedCommit(commit: Commit | CommitId): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
commit | Commit | CommitId |
Returns:
CommandFunction
method revertCommit
Revert a commit which was added to the transaction history.
Signature:
revertCommit(commit?: Commit): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
commit | Commit | (Optional) |
Returns:
CommandFunction
interface DiffOptions
Signature:
export interface DiffOptions
property blameMarkerClass
Signature:
blameMarkerClass?: Static<string>;
property onDeselectCommits
Called when commits are deselected.
Signature:
onDeselectCommits?: Handler<(selections: HandlerProps[]) => void>;
property onMouseLeaveCommit
A handler that is called whenever a tracked change was being hovered is no longer hovered.
Signature:
onMouseLeaveCommit?: Handler<(props: HandlerProps) => void>;
property onMouseOverCommit
A handler that is called whenever a tracked change is hovered over in the editor.
Signature:
onMouseOverCommit?: Handler<(props: HandlerProps) => void>;
property onSelectCommits
Called when the commit is part of the current text selection. Called with an array of possible selection.
Signature:
onSelectCommits?: Handler<(selections: HandlerProps[], previousSelections?: HandlerProps[]) => void>;
property revertMessage
Signature:
revertMessage?: (message: string) => string;
interface DiffPluginState
Signature:
export interface DiffPluginState extends TrackedStateProps, HighlightStateProps
Extends: TrackedStateProps, HighlightStateProps
(Some inherited members may not be shown because they are not represented in the documentation.)
interface HandlerProps
Signature:
export interface HandlerProps extends FromToProps
Extends: FromToProps
property commit
The commit.
Signature:
commit: Commit;
property from
The starting position in the document.
Signature:
from: number;
property to
The ending position in the document.
Signature:
to: number;