Skip to content

Commit 06d4c6c

Browse files
authored
fix(plugins): mark TooltipButtonPlugin and TooltipSelectPlugin deprecated (#621)
1 parent 4dfb4fc commit 06d4c6c

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

src/plugins/TooltipButton/TooltipButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import {Button, Icon, Popup, type PopupPlacement, type PopupProps} from '@gravit
55

66
import {useBooleanState, useElementState} from '../../react-utils';
77

8+
/** @deprecated */
89
type TooltipButtonProps = Pick<PopupProps, 'onOutsideClick'> & {
910
domElem: HTMLElement | null;
1011
children?: React.ReactNode;
1112
};
1213

14+
/** @deprecated */
1315
export const TooltipButton: React.FC<TooltipButtonProps> = ({
1416
domElem,
1517
children,

src/plugins/TooltipButton/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,28 @@ import {
1010

1111
import {TooltipButton} from './TooltipButton';
1212

13+
/** @deprecated */
1314
type ButtonContent = (
1415
view: EditorView,
1516
node: BaseTooltipNode,
1617
toggleEdit: () => void,
1718
) => React.ReactElement;
1819

20+
/** @deprecated */
1921
type FormContent = (
2022
view: EditorView,
2123
node: BaseTooltipNode,
2224
onChange?: TooltipOnChangeCallback,
2325
) => React.ReactElement;
2426

27+
/** @deprecated */
2528
interface TooltipMenuOptions extends BaseTooltipPluginOptions {
2629
disableHideOnBlur?: boolean;
2730
buttonContent: ButtonContent;
2831
formContent: FormContent;
2932
}
3033

34+
/** @deprecated */
3135
export class TooltipButtonPluginView extends BaseTooltipPluginView {
3236
private enableHideOnBlur?: boolean;
3337
private forceEdit = false;

src/plugins/TooltipSelect/TooltipSelect.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212

1313
import {useBooleanState} from '../../react-utils';
1414

15+
/** @deprecated */
1516
type TooltipButtonProps = Pick<PopupProps, 'onOutsideClick'> & {
1617
domRef: HTMLElement | null;
1718
buttonTitle?: string;
@@ -20,6 +21,7 @@ type TooltipButtonProps = Pick<PopupProps, 'onOutsideClick'> & {
2021
withSearch?: boolean;
2122
};
2223

24+
/** @deprecated */
2325
export const TooltipButton: React.FC<TooltipButtonProps> = ({
2426
domRef,
2527
buttonTitle = 'Settings',

src/plugins/TooltipSelect/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010

1111
import {TooltipButton} from './TooltipSelect';
1212

13+
/** @deprecated */
1314
interface TooltipSelectOptions extends BaseTooltipPluginOptions {
1415
buttonText?: (node: Node) => string;
1516
items?: SelectOption[] | SelectOptionGroup[];
@@ -18,6 +19,7 @@ interface TooltipSelectOptions extends BaseTooltipPluginOptions {
1819
disableHideOnBlur?: boolean;
1920
}
2021

22+
/** @deprecated */
2123
export class TooltipSelectPluginView extends BaseTooltipPluginView {
2224
private buttonText?: (node: Node) => string;
2325
private items?: SelectOption[] | SelectOptionGroup[];

src/plugins/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
export * as BaseTooltipPlugin from './BaseTooltip';
2+
/** @deprecated */
23
export * as TooltipButtonPlugin from './TooltipButton';
4+
/** @deprecated */
35
export * as TooltipSelectPlugin from './TooltipSelect';

0 commit comments

Comments
 (0)