Skip to content

Commit 2e602da

Browse files
authored
Merge branch 'main' into fix/tooltip-hidden-under-toolbar
2 parents bbb43b2 + f18510a commit 2e602da

13 files changed

+317
-366
lines changed

package-lock.json

Lines changed: 296 additions & 342 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
"jsdom": "25.0.1",
259259
"lowlight": "3.0.0",
260260
"markdown-it-testgen": "^0.1.6",
261-
"mermaid": "10.9.0",
261+
"mermaid": "10.9.3",
262262
"npm-run-all": "^4.1.5",
263263
"postcss": "^8.4.27",
264264
"prettier": "3.1.1",

src/bundle/config/markup.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import {icons} from './icons';
6262
import {HeadingPreview} from './previews/HeadingPreview';
6363

6464
export type {
65+
MToolbarBaseProps,
6566
MToolbarData,
6667
MToolbarItemData,
6768
MToolbarSingleItemData,

src/bundle/config/wysiwyg.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {
4141
} from './w-heading-config';
4242

4343
export type {
44+
WToolbarBaseProps,
4445
WToolbarData,
4546
WToolbarItemData,
4647
WToolbarSingleItemData,

src/bundle/toolbar/ToolbarButtonWithPopupMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from '@gravity-ui/uikit';
1313

1414
import {cn} from '../../classname';
15-
import type {Action, ActionStorage} from '../../core';
15+
import type {Action} from '../../core';
1616
import {groupBy, isFunction} from '../../lodash';
1717
import {useBooleanState, useElementState} from '../../react-utils/hooks';
1818
import {type ToolbarBaseProps, type ToolbarIconData, ToolbarTooltipDelay} from '../../toolbar';
@@ -32,7 +32,7 @@ export type MenuItem = {
3232
};
3333

3434
export type ToolbarButtonWithPopupMenuProps = Omit<
35-
ToolbarBaseProps<ActionStorage> &
35+
ToolbarBaseProps<never> &
3636
Pick<PopupProps, 'disablePortal'> & {
3737
icon: ToolbarIconData;
3838
iconClassName?: string;

src/bundle/toolbar/ToolbarSelect.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ import {
88
} from '@gravity-ui/uikit';
99

1010
import {cn} from '../../classname';
11-
import type {ActionStorage} from '../../core';
1211
import {isFunction} from '../../lodash';
1312

14-
import type {ToolbarBaseProps, WToolbarItemData} from './types';
13+
import type {WToolbarBaseProps, WToolbarItemData} from './types';
1514

1615
import './ToolbarSelect.scss';
1716

1817
const b = cn('toolbar-select');
1918

20-
export type ToolbarSelectProps = ToolbarBaseProps<ActionStorage> &
19+
export type ToolbarSelectProps = WToolbarBaseProps &
2120
Pick<SelectProps, 'disablePortal'> & {
2221
items: WToolbarItemData[];
2322
};

src/bundle/toolbar/markup/MToolbarColors.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import {colorify} from '../../../markup/commands';
2-
import type {CodeEditor} from '../../../markup/editor';
32
import {ToolbarColors} from '../custom/ToolbarColors';
4-
import type {ToolbarBaseProps} from '../types';
3+
import type {MToolbarBaseProps} from '../types';
54

6-
export type MToolbarColorsProps = ToolbarBaseProps<CodeEditor>;
5+
export type MToolbarColorsProps = MToolbarBaseProps;
76

87
export const MToolbarColors: React.FC<MToolbarColorsProps> = ({
98
className,

src/bundle/toolbar/markup/MToolbarFilePopup.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import {type FileItem, insertFiles} from '../../../markup/commands';
2-
import type {CodeEditor} from '../../../markup/editor';
3-
import type {ToolbarBaseProps} from '../../../toolbar';
42
import {ToolbarFilePopup, type ToolbarFilePopupProps} from '../custom/ToolbarFilePopup';
3+
import type {MToolbarBaseProps} from '../types';
54

65
import {useMarkupToolbarContext} from './context';
76

8-
export type MToolbarFilePopupProps = ToolbarBaseProps<CodeEditor> &
7+
export type MToolbarFilePopupProps = MToolbarBaseProps &
98
Pick<ToolbarFilePopupProps, 'anchorElement'> & {
109
hide: () => void;
1110
};

src/bundle/toolbar/markup/MToolbarImagePopup.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import isNumber from 'is-number';
22

33
import {IMG_MAX_HEIGHT, type ImageItem, getImageDimensions, insertImages} from '../../../markup';
4-
import type {CodeEditor} from '../../../markup/editor';
5-
import type {ToolbarBaseProps} from '../../../toolbar';
64
import type {UploadSuccessItem} from '../../../utils';
75
import {type ToolbarImagePopuProps, ToolbarImagePopup} from '../custom/ToolbarImagePopup';
6+
import type {MToolbarBaseProps} from '../types';
87

98
import {useMarkupToolbarContext} from './context';
109

1110
const noop = (err: unknown) => {
1211
console.error(err);
1312
};
1413

15-
export type MToolbarImagePopupProps = ToolbarBaseProps<CodeEditor> &
14+
export type MToolbarImagePopupProps = MToolbarBaseProps &
1615
Pick<ToolbarImagePopuProps, 'anchorElement'> & {
1716
hide: () => void;
1817
};

src/bundle/toolbar/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {ActionStorage} from '../../core';
22
import type {CodeEditor} from '../../markup';
33
import type {ToolbarListButtonData} from '../../toolbar';
44
import type {
5+
ToolbarBaseProps,
56
ToolbarButtonPopupData,
67
ToolbarData,
78
ToolbarGroupData,
@@ -15,6 +16,7 @@ import type {
1516

1617
export * from '../../toolbar/types';
1718

19+
export type WToolbarBaseProps = ToolbarBaseProps<ActionStorage>;
1820
export type WToolbarData = ToolbarData<ActionStorage>;
1921
export type WToolbarItemData = ToolbarItemData<ActionStorage>;
2022
export type WToolbarSingleItemData = ToolbarSingleItemData<ActionStorage>;
@@ -24,6 +26,7 @@ export type WToolbarListButtonData = ToolbarListButtonData<ActionStorage>;
2426
export type WToolbarListItemData = ToolbarListItemData<ActionStorage>;
2527
export type WToolbarListButtonItemData = ToolbarListButtonItemData<ActionStorage>;
2628

29+
export type MToolbarBaseProps = ToolbarBaseProps<CodeEditor>;
2730
export type MToolbarData = ToolbarData<CodeEditor>;
2831
export type MToolbarItemData = ToolbarItemData<CodeEditor>;
2932
export type MToolbarSingleItemData = ToolbarSingleItemData<CodeEditor>;

0 commit comments

Comments
 (0)