Skip to content

Commit bbb43b2

Browse files
committed
fix: merge main into fix/tooltip-hidden-under-toolbar
2 parents 8361dc8 + 5f7165b commit bbb43b2

File tree

392 files changed

+7303
-9258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

392 files changed

+7303
-9258
lines changed

.babelrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
}
1111
],
1212
"@babel/preset-typescript",
13-
"@babel/preset-react"
13+
["@babel/preset-react", {
14+
"runtime": "automatic"
15+
}]
1416
],
1517
"plugins": []
1618
}

.eslintrc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
"plugins": ["lodash"],
1010
"rules": {
1111
"lodash/import-scope": [2, "method"],
12-
"jsx-a11y/no-autofocus": "warn"
12+
"jsx-a11y/no-autofocus": "warn",
13+
"@typescript-eslint/no-import-type-side-effects": "error",
14+
"@typescript-eslint/consistent-type-imports": [2, {
15+
"fixStyle": "inline-type-imports"
16+
}],
17+
"@typescript-eslint/no-unused-vars": [2, {
18+
"argsIgnorePattern": "^_",
19+
"varsIgnorePattern": "^_",
20+
"caughtErrors": "none"
21+
}]
1322
}
1423
}

.storybook/preview.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import type {Preview} from '@storybook/react';
22
import {MINIMAL_VIEWPORTS} from '@storybook/addon-viewport';
33
import {withThemeProvider} from '../demo/hocs/withThemeProvider';
44
import {withLang} from '../demo/hocs/withLang';
5+
import {withToaster} from '../demo/hocs/withToaster';
56

67
const preview: Preview = {
7-
decorators: [withThemeProvider, withLang],
8+
decorators: [withThemeProvider, withLang, withToaster],
89
parameters: {
910
jsx: {showFunctions: true}, // To show functions in sources
1011
viewport: {

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,51 @@
11
# Changelog
22

3+
## [15.0.0](https://github.com/gravity-ui/markdown-editor/compare/v14.12.2...v15.0.0) (2025-02-11)
4+
5+
See [the migration guide here](https://github.com/gravity-ui/markdown-editor/discussions/610).
6+
7+
### ⚠ BREAKING CHANGES
8+
9+
* markdown-editor@15 ([#604](https://github.com/gravity-ui/markdown-editor/issues/604))
10+
* `@gravity-ui/uikit` updated to v7
11+
* removed `toaster` prop from `<MarkdownEditorView />` component
12+
* removed deprecated props from `useMarkdownEditor()` hook
13+
* removed generics from `useMarkdownEditor()` and `UseMarkdownEditorProps`
14+
* removed deprecated `PluginPriority` field from `ExtensionBuilder`
15+
* removed deprecated constants with node and mark names; similarly for attributes
16+
* removed deprecated `<YfmHtml />` and `YfmHtmlProps`
17+
* removed deprecated `disabledPopoverVisible` field from `ToolbarItemData` type
18+
* removed `typesVersions` from `package.json`
19+
* build react-jsx using new jsx-transform
20+
* dropped support of `[email protected]`; changed minimal `react@16` version: `^16.14.0`
21+
* changed build target to ES2022
22+
* dropped support of `@diplodoc/transform` lower then `^4.43.0`
23+
* dropped support of `@diplodoc/cut-extension` lower then `^0.5.0`
24+
* added `@diplodoc/file-extension` to peer dependencies
25+
* updated `SerializerMarkToken` — parent parameter now uses `Node` instead of `Fragment`
26+
27+
### Features
28+
29+
* moved `lodash` to dependencies
30+
* updated `codemirror` packages to latest versions
31+
* updated `prosemirror` packages to latest versions
32+
* added sourcemaps for builded files
33+
34+
## [14.12.2](https://github.com/gravity-ui/markdown-editor/compare/v14.12.0...v14.12.2) (2025-02-11)
35+
36+
37+
### chore
38+
39+
* release 14.12.2 ([12a8ef1](https://github.com/gravity-ui/markdown-editor/commit/12a8ef1d6a4b8fba5f9741d0d974a8549992acc6))
40+
41+
## [14.12.0](https://github.com/gravity-ui/markdown-editor/compare/v14.11.2...v14.12.0) (2025-02-11)
42+
43+
44+
### Features
45+
46+
* **actions:** add heading previews ([#582](https://github.com/gravity-ui/markdown-editor/issues/582)) ([0bf2af1](https://github.com/gravity-ui/markdown-editor/commit/0bf2af1a65c52f82559930e1f31dab78f9c16b34))
47+
* **core:** added preserving and managing original markdown formatting for YfmTable ([#558](https://github.com/gravity-ui/markdown-editor/issues/558)) ([59549eb](https://github.com/gravity-ui/markdown-editor/commit/59549ebb4ee04296ae32e68c4e6289559d037330))
48+
349
## [14.11.2](https://github.com/gravity-ui/markdown-editor/compare/v14.11.1...v14.11.2) (2025-02-07)
450

551

README-ru.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ npm install @gravity-ui/markdown-editor
3030
```tsx
3131
import React from 'react';
3232
import {useMarkdownEditor, MarkdownEditorView} from '@gravity-ui/markdown-editor';
33-
import {toaster} from '@gravity-ui/uikit/toaster-singleton-react-18';
3433

3534
function Editor({onSubmit}) {
3635
const editor = useMarkdownEditor({allowHTML: false});
@@ -48,11 +47,12 @@ function Editor({onSubmit}) {
4847
};
4948
}, [onSubmit]);
5049

51-
return <MarkdownEditorView stickyToolbar autofocus toaster={toaster} editor={editor} />;
50+
return <MarkdownEditorView stickyToolbar autofocus editor={editor} />;
5251
}
5352
```
5453

5554
Полезные ссылки:
55+
5656
- [Как подключить редактор в Create React App](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-install-create-react-app--docs)
5757
- [Как добавить предварительный просмотр для режима разметки](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-develop-preview--docs)
5858
- [Как добавить расширение HTML](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-connect-html-block--docs)
@@ -84,20 +84,19 @@ configure({
8484

8585
Обязательно сделайте вызов `configure()` из [UIKit](https://github.com/gravity-ui/uikit?tab=readme-ov-file#i18n) и других UI-библиотек.
8686

87-
### Система z-index
87+
### Система z-index
8888

8989
В этом проекте используется система z-index для управления слоями элементов. Ниже приведены определенные уровни и их значения:
9090

9191
| level | z-index value |
92-
|---------------------|---------------|
92+
| ------------------- | ------------- |
9393
| background | -1 |
9494
| default | 0 |
9595
| forefront | 1 |
9696
| img-settings-button | 2 |
9797
| table-view-button | 100 |
9898
| table-cell-button | 110 |
99-
| sticky-toolbar | 2000 |
100-
| tooltip | 2100 |
99+
| sticky-toolbar | 990 |
101100

102101
### Использование
103102

@@ -107,7 +106,7 @@ configure({
107106
@use 'styles/mixins.scss';
108107

109108
.tooltip {
110-
@include mixins.z-index('tooltip');
109+
@include mixins.z-index('forefront');
111110
}
112111
```
113112

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ To set up styling and theme see [UIKit docs](https://github.com/gravity-ui/uikit
3030
```tsx
3131
import React from 'react';
3232
import {useMarkdownEditor, MarkdownEditorView} from '@gravity-ui/markdown-editor';
33-
import {toaster} from '@gravity-ui/uikit/toaster-singleton-react-18';
3433

3534
function Editor({onSubmit}) {
3635
const editor = useMarkdownEditor({allowHTML: false});
@@ -48,10 +47,12 @@ function Editor({onSubmit}) {
4847
};
4948
}, [onSubmit]);
5049

51-
return <MarkdownEditorView stickyToolbar autofocus toaster={toaster} editor={editor} />;
50+
return <MarkdownEditorView stickyToolbar autofocus editor={editor} />;
5251
}
5352
```
53+
5454
Read more:
55+
5556
- [How to connect the editor in the Create React App](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-install-create-react-app--docs)
5657
- [How to add preview for markup mode](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-develop-preview--docs)
5758
- [How to add HTML extension](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-connect-html-block--docs)
@@ -62,13 +63,13 @@ Read more:
6263
- [How to add text binding extension in markdown](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-develop-extension-with-popup--docs)
6364

6465
### Development
66+
6567
To start the dev storybook
6668

6769
```shell
6870
npm start
6971
```
7072

71-
7273
### i18n
7374

7475
To set up internationalization, you just need to use the `configure`:
@@ -88,15 +89,14 @@ Don't forget to call `configure()` from [UIKit](https://github.com/gravity-ui/ui
8889
This project uses a z-index map to control the layers of elements. Defined levels:
8990

9091
| level | z-index value |
91-
|---------------------|---------------|
92+
| ------------------- | ------------- |
9293
| background | -1 |
9394
| default | 0 |
9495
| forefront | 1 |
9596
| img-settings-button | 2 |
9697
| table-view-button | 100 |
9798
| table-cell-button | 110 |
98-
| sticky-toolbar | 2000 |
99-
| tooltip | 2100 |
99+
| sticky-toolbar | 990 |
100100

101101
### Usage
102102

@@ -106,7 +106,7 @@ To apply z-index to components, use the z-index mixin, passing the key as an arg
106106
@use 'styles/mixins.scss';
107107

108108
.tooltip {
109-
@include mixins.z-index('tooltip');
109+
@include mixins.z-index('forefront');
110110
}
111111
```
112112

demo/.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "@gravity-ui/eslint-config/client"
2+
"extends": ["@gravity-ui/eslint-config/client", "plugin:react/jsx-runtime"]
33
}

demo/components/PMSelection.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
1+
import {useLayoutEffect} from 'react';
22

3-
import {EditorView} from 'prosemirror-view';
3+
import type {EditorView} from 'prosemirror-view';
44
import {useEffectOnce, useUpdate} from 'react-use';
55

66
import {
@@ -23,7 +23,7 @@ export function WysiwygSelection({editor, className}: WysiwygSelectionProps) {
2323

2424
const view = editor?.currentMode === 'wysiwyg' && editor._wysiwygView;
2525

26-
React.useLayoutEffect(() => {
26+
useLayoutEffect(() => {
2727
if (!editor) return undefined;
2828
editor.on(
2929
// @ts-expect-error TODO: add public event for selection change

0 commit comments

Comments
 (0)