@atlaskit/editor-plugin-placeholder
Version:
Placeholder plugin for @atlaskit/editor-core.
28 lines (27 loc) • 1.72 kB
TypeScript
import type { DocNode } from '@atlaskit/adf-schema';
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
import type { CreatePlaceholderStateProps, PlaceHolderState, UserInteractionState } from './types';
export declare function getPlaceholderState(editorState: EditorState): PlaceHolderState;
export declare function setPlaceHolderState({ placeholderText, pos, placeholderPrompts, typedAndDeleted, userHadTyped, canShowOnEmptyParagraph, showOnEmptyParagraph, contextPlaceholderADF, }: {
canShowOnEmptyParagraph?: boolean;
contextPlaceholderADF?: DocNode;
placeholderPrompts?: string[];
placeholderText?: string;
pos?: number;
showOnEmptyParagraph?: boolean;
typedAndDeleted?: boolean;
userHadTyped?: boolean;
}): PlaceHolderState;
export declare const emptyPlaceholder: ({ placeholderText, placeholderPrompts, userHadTyped, pos, canShowOnEmptyParagraph, showOnEmptyParagraph, }: {
canShowOnEmptyParagraph?: boolean;
placeholderPrompts?: string[];
placeholderText: string | undefined;
pos?: number;
showOnEmptyParagraph?: boolean;
userHadTyped?: boolean;
}) => PlaceHolderState;
export declare function createPlaceHolderStateFrom({ isInitial, isEditorFocused, editorState, isTypeAheadOpen, defaultPlaceholderText, intl, bracketPlaceholderText, emptyLinePlaceholder, placeholderADF, placeholderPrompts, typedAndDeleted, userHadTyped, isPlaceholderHidden, withEmptyParagraph, showOnEmptyParagraph, }: CreatePlaceholderStateProps): PlaceHolderState;
export declare function calculateUserInteractionState({ placeholderState, oldEditorState, newEditorState, }: UserInteractionState): {
typedAndDeleted: boolean;
userHadTyped: boolean;
};