UNPKG

@atlaskit/editor-plugin-find-replace

Version:

find replace plugin for @atlaskit/editor-core

58 lines (57 loc) 1.99 kB
/** * @jsxRuntime classic * @jsx jsx */ import React from 'react'; import { jsx } from '@emotion/react'; import type { IntlShape } from 'react-intl'; import type { DispatchAnalyticsEvent, TRIGGER_METHOD } from '@atlaskit/editor-common/analytics'; import type { MatchCaseProps } from '../types'; export type FindReplaceProps = { count: { index: number; total: number; totalReplaceable?: number; }; dispatchAnalyticsEvent?: DispatchAnalyticsEvent; findText?: string; focusToolbarButton?: () => void; intl?: IntlShape; isReplaceable?: boolean; onCancel: ({ triggerMethod, }: { triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.TOOLBAR | TRIGGER_METHOD.BUTTON; }) => void; onFind: (findText?: string) => void; onFindBlur: () => void; onFindNext: ({ triggerMethod, }: { triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.BUTTON; }) => void; onFindPrev: ({ triggerMethod, }: { triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.BUTTON; }) => void; onReplace: ({ triggerMethod, replaceText, }: { replaceText: string; triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.BUTTON; }) => void; onReplaceAll: ({ replaceText }: { replaceText: string; }) => void; replaceText?: string; shouldFocus: boolean; } & MatchCaseProps; declare class FindReplace extends React.PureComponent<FindReplaceProps> { private findTextfield; private replaceTextfield?; private modalRef; constructor(props: FindReplaceProps); state: { findTyped: boolean; }; setFindTyped: (value: boolean) => void; setFindTextfieldRef: (findTextfieldRef: React.RefObject<HTMLInputElement>) => void; setReplaceTextfieldRef: (replaceTextfieldRef: React.RefObject<HTMLInputElement>) => void; setFocusToFind: () => void; setFocusToReplace: () => void; render(): jsx.JSX.Element; } export default FindReplace;