@atlaskit/editor-plugin-placeholder
Version:
Placeholder plugin for @atlaskit/editor-core.
37 lines (36 loc) • 1.79 kB
TypeScript
import type { DocNode } from '@atlaskit/adf-schema/doc';
import type { EditorCommand } from '@atlaskit/editor-common/types/editor-command';
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types/next-editor-plugin';
import type { CollabEditPlugin } from '@atlaskit/editor-plugin-collab-edit/collabEditPluginType';
import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition/compositionPluginType';
import type { FocusPlugin } from '@atlaskit/editor-plugin-focus/focusPluginType';
import type { ShowDiffPlugin } from '@atlaskit/editor-plugin-show-diff/show-diff-plugin-type';
import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead/type-ahead-plugin-type';
import type { PlaceholderPromptAnimationOptions } from './pm-plugins/types';
export interface PlaceholderPluginOptions {
emptyLinePlaceholder?: string;
enableLoadingSpinner?: boolean;
isPlaceholderHidden?: boolean;
isRovoLLMEnabled?: boolean;
placeholder?: string;
placeholderADF?: DocNode;
placeholderBracketHint?: string;
placeholderPromptAnimationOptions?: PlaceholderPromptAnimationOptions;
placeholderPrompts?: string[];
withEmptyParagraph?: boolean;
}
export type PlaceholderPlugin = NextEditorPlugin<'placeholder', {
commands: {
setAnimatingPlaceholderPrompts: (placeholderPrompts: string[]) => EditorCommand;
setPlaceholder: (placeholder: string) => EditorCommand;
setPlaceholderHidden: (isPlaceholderHidden: boolean) => EditorCommand;
};
dependencies: [
FocusPlugin,
CompositionPlugin,
TypeAheadPlugin,
OptionalPlugin<ShowDiffPlugin>,
OptionalPlugin<CollabEditPlugin>
];
pluginConfiguration: PlaceholderPluginOptions | undefined;
}>;