Skip to content

Commit f49eca8

Browse files
author
Полеводин Дмитрий Игоревич (4094029)
committed
fix: merge main
2 parents 9a3ccfd + 8b65ebd commit f49eca8

File tree

334 files changed

+5865
-974
lines changed

Some content is hidden

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

334 files changed

+5865
-974
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: PR Visual Tests Report
2+
3+
on:
4+
workflow_run:
5+
workflows: ['PR Visual Tests']
6+
types:
7+
- completed
8+
9+
jobs:
10+
comment:
11+
name: Create GitHub Comment
12+
if: github.event.workflow_run.event == 'pull_request'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Download Artifacts
16+
uses: actions/download-artifact@v4
17+
with:
18+
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
19+
run-id: ${{ github.event.workflow_run.id }}
20+
- name: Extract PR Number
21+
id: pr
22+
run: echo "::set-output name=id::$(<pr/pr-id.txt)"
23+
shell: bash
24+
- name: Install AWS CLI
25+
uses: unfor19/install-aws-cli-action@v1
26+
with:
27+
version: 2.22.35
28+
arch: amd64
29+
- name: Upload to S3
30+
env:
31+
AWS_ACCESS_KEY_ID: ${{ secrets.STORYBOOK_S3_KEY_ID }}
32+
AWS_SECRET_ACCESS_KEY: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
33+
AWS_DEFAULT_REGION: ru-central1
34+
AWS_EC2_METADATA_DISABLED: true
35+
run: aws s3 cp playwright-report s3://playwright-reports/markdown-editor/pulls/${{ steps.pr.outputs.id}}/ --endpoint-url=https://storage.yandexcloud.net --recursive
36+
shell: bash
37+
- name: Create Comment
38+
uses: marocchino/sticky-pull-request-comment@v2
39+
with:
40+
GITHUB_TOKEN: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
41+
number: ${{ steps.pr.outputs.id }}
42+
header: visual tests report
43+
message: '[Visual Tests Report](https://storage.yandexcloud.net/playwright-reports/markdown-editor/pulls/${{ steps.pr.outputs.id }}/index.html) is ready.'

.github/workflows/pr-visual-tests.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: PR Visual Tests
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
visual_tests:
8+
name: Visual Tests
9+
runs-on: ubuntu-latest
10+
container:
11+
image: mcr.microsoft.com/playwright:v1.49.0-jammy
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
cache: npm
18+
- name: Install Packages
19+
run: npm ci
20+
- name: Run Visual Tests
21+
run: npm run playwright
22+
env:
23+
CI: 'true'
24+
- name: Upload Playwright Report
25+
if: always()
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: playwright-report
29+
path: ./playwright-report
30+
retention-days: 1
31+
- name: Save PR ID
32+
if: always()
33+
run: |
34+
pr="${{ github.event.pull_request.number }}"
35+
echo $pr > ./pr-id.txt
36+
shell: bash
37+
- name: Create PR Artifact
38+
if: always()
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: pr
42+
path: ./pr-id.txt

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@ temp/
1717

1818
# build
1919
.cache
20+
.cache*
2021
build/
2122
coverage/
2223
storybook-static/
2324
.eslintcache
2425
demo/docs
26+
27+
# tests
28+
playwright-report*
29+
test-results/
30+

.storybook/main.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import {resolve} from 'node:path';
12
import webpack from 'webpack';
23
import type {StorybookConfig} from '@storybook/react-webpack5';
34
import pkg from '../package.json';
5+
import tsConfig from '../tsconfig.json';
46

57
const config: StorybookConfig = {
68
framework: {
@@ -26,6 +28,16 @@ const config: StorybookConfig = {
2628
}),
2729
);
2830

31+
config.resolve ||= {};
32+
config.resolve.alias ||= {};
33+
34+
const baseUrl = resolve(__dirname, '..', tsConfig.compilerOptions.baseUrl);
35+
const paths = tsConfig.compilerOptions.paths;
36+
37+
for (const alias in paths) {
38+
config.resolve.alias[alias] = resolve(baseUrl, paths[alias][0])
39+
}
40+
2941
return config;
3042
},
3143
};

.storybook/manager.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@ import {themes} from './theme';
33

44
addons.setConfig({
55
theme: themes.light,
6-
sidebar: {
7-
collapsedRoots: ['docs'],
8-
},
96
});

CHANGELOG.md

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

3+
## [15.7.0](https://github.com/gravity-ui/markdown-editor/compare/v15.6.1...v15.7.0) (2025-04-15)
4+
5+
6+
### Features
7+
8+
* **deps:** updated prosemirror-view to 1.38.0 ([#717](https://github.com/gravity-ui/markdown-editor/issues/717)) ([dbae4a8](https://github.com/gravity-ui/markdown-editor/commit/dbae4a8e7b967530e578b4b76342997664028f44))
9+
10+
## [15.6.1](https://github.com/gravity-ui/markdown-editor/compare/v15.6.0...v15.6.1) (2025-04-14)
11+
12+
13+
### Bug Fixes
14+
15+
* **deps:** updated codemirror, prosemirror, lezer versions ([#715](https://github.com/gravity-ui/markdown-editor/issues/715)) ([c2e4a8e](https://github.com/gravity-ui/markdown-editor/commit/c2e4a8e7f8a069942730eebe06dc37a0cb1854a2))
16+
17+
## [15.6.0](https://github.com/gravity-ui/markdown-editor/compare/v15.5.1...v15.6.0) (2025-04-07)
18+
19+
20+
### Features
21+
22+
* **toolbar:** show current heading level in editor toolbar ([#696](https://github.com/gravity-ui/markdown-editor/issues/696)) ([bac13dc](https://github.com/gravity-ui/markdown-editor/commit/bac13dc95af7d60f8e75be5014a32277144ba505))
23+
24+
25+
### Bug Fixes
26+
27+
* **Clipboard:** fixed trimContent ([#709](https://github.com/gravity-ui/markdown-editor/issues/709)) ([d325e39](https://github.com/gravity-ui/markdown-editor/commit/d325e39f5006cae7e69ae13468a3b92b9539c631))
28+
29+
## [15.5.1](https://github.com/gravity-ui/markdown-editor/compare/v15.5.0...v15.5.1) (2025-03-31)
30+
31+
32+
### Bug Fixes
33+
34+
* **QuoteLink:** fixed cjs build ([#701](https://github.com/gravity-ui/markdown-editor/issues/701)) ([d1a2270](https://github.com/gravity-ui/markdown-editor/commit/d1a2270aeba67879b5fe5ce84281b2c01ee43c6c))
35+
36+
## [15.5.0](https://github.com/gravity-ui/markdown-editor/compare/v15.4.2...v15.5.0) (2025-03-31)
37+
38+
39+
### Features
40+
41+
* **Lists:** added sinkOnlySelectedListItem ([#687](https://github.com/gravity-ui/markdown-editor/issues/687)) ([6f54ee7](https://github.com/gravity-ui/markdown-editor/commit/6f54ee7b0244587230a61c764c6a80d6ade3fda1))
42+
* **QuoteLink:** added QuoteLink additional extension for wysiwyg mode ([#667](https://github.com/gravity-ui/markdown-editor/issues/667)) ([138120a](https://github.com/gravity-ui/markdown-editor/commit/138120ac63725bd3f11720ccc216263f6cd96642))
43+
* **wysiwyg:** allow to disable `markdown-it-attrs` in yfm preset ([#690](https://github.com/gravity-ui/markdown-editor/issues/690)) ([da1c209](https://github.com/gravity-ui/markdown-editor/commit/da1c20949ec83d1395ee77d0313f7f4cb0d8d084))
44+
45+
46+
### Bug Fixes
47+
48+
* **bundle:** added qa-attributes ([c16aa59](https://github.com/gravity-ui/markdown-editor/commit/c16aa5994f6edfbaf8df513ef2f0b03e463e37cb))
49+
* import of sanitize ([#700](https://github.com/gravity-ui/markdown-editor/issues/700)) ([8ad83fa](https://github.com/gravity-ui/markdown-editor/commit/8ad83fab6e849840a30c25430c51c035efb1cf6f))
50+
* sanitize default import ([#698](https://github.com/gravity-ui/markdown-editor/issues/698)) ([878ed96](https://github.com/gravity-ui/markdown-editor/commit/878ed96199b2af8b9b3764e90c3d611b0b51f337))
51+
52+
## [15.4.2](https://github.com/gravity-ui/markdown-editor/compare/v15.4.1...v15.4.2) (2025-03-17)
53+
54+
55+
### Bug Fixes
56+
57+
* **view:** setupRuntimeConfig is not a function on old html-extension peer ([#685](https://github.com/gravity-ui/markdown-editor/issues/685)) ([9b44af4](https://github.com/gravity-ui/markdown-editor/commit/9b44af47aa5e41094f6fe9d39a6886ea75887e6c))
58+
59+
## [15.4.1](https://github.com/gravity-ui/markdown-editor/compare/v15.4.0...v15.4.1) (2025-03-14)
60+
61+
62+
### Bug Fixes
63+
64+
* **link:** fixed link cursor focus ([#648](https://github.com/gravity-ui/markdown-editor/issues/648)) ([c4797ef](https://github.com/gravity-ui/markdown-editor/commit/c4797efa456eb32f01afbe832d1c4b2a1d26c854))
65+
* **Mermaid:** removed unnecessary consolelog in nodeview ([#681](https://github.com/gravity-ui/markdown-editor/issues/681)) ([dadecdb](https://github.com/gravity-ui/markdown-editor/commit/dadecdb70b2a030a1bca0e38df7ae18acf6224f1))
66+
* use primitive boolean type in `useSharedEditingState` hook ([#682](https://github.com/gravity-ui/markdown-editor/issues/682)) ([e476365](https://github.com/gravity-ui/markdown-editor/commit/e476365c153665ba2cd70f01866c52e0b010069e))
67+
68+
## [15.4.0](https://github.com/gravity-ui/markdown-editor/compare/v15.3.1...v15.4.0) (2025-03-13)
69+
70+
71+
### Features
72+
73+
* **Mermaid:** use shared state to manage editing state ([8568fb9](https://github.com/gravity-ui/markdown-editor/commit/8568fb94acc190aa20dd5c276156b5c9cee86e43))
74+
* **react-utils:** added helper hook for manage shared editing state ([b1b4e6b](https://github.com/gravity-ui/markdown-editor/commit/b1b4e6b268df017b1929cd7fdc4664226fe15388))
75+
* **utils:** added helpers to generating and validating entity ids ([280d8ed](https://github.com/gravity-ui/markdown-editor/commit/280d8edf1aa115d233f42953be3d29a133c9143c))
76+
* **view:** added option to control HTML block runtimes ([#674](https://github.com/gravity-ui/markdown-editor/issues/674)) ([ad03230](https://github.com/gravity-ui/markdown-editor/commit/ad0323059a6e1c42280995e054af0db83d90687d))
77+
* **wysiwyg:** implemented shared state extension ([d3de016](https://github.com/gravity-ui/markdown-editor/commit/d3de016c9b40021d783f3b8de48dc5d44d1df4ee))
78+
* **YfmHtmlBlock:** use shared state to manage editing state ([a63b121](https://github.com/gravity-ui/markdown-editor/commit/a63b1214f1450d2b14870705ce9d263db2405ed4))
79+
80+
81+
### Bug Fixes
82+
83+
* **Clipboard:** correct handling of pasting into code ([#678](https://github.com/gravity-ui/markdown-editor/issues/678)) ([ea31ecc](https://github.com/gravity-ui/markdown-editor/commit/ea31ecc01baec650b1199c593f58b99c49cd6f39))
84+
* get actual range when selecting item in suggests (command menu, emoji suggest) ([#673](https://github.com/gravity-ui/markdown-editor/issues/673)) ([d70644a](https://github.com/gravity-ui/markdown-editor/commit/d70644a0e557465e0a27d2122175a5b894517616))
85+
86+
## [15.3.1](https://github.com/gravity-ui/markdown-editor/compare/v15.3.0...v15.3.1) (2025-03-07)
87+
88+
89+
### Bug Fixes
90+
91+
* **CodeBlock:** resolved async import loading for CodeBlockHighlight ([#672](https://github.com/gravity-ui/markdown-editor/issues/672)) ([2f68e16](https://github.com/gravity-ui/markdown-editor/commit/2f68e163e77d43d48bdba32fc4ff3290c77b1d40))
92+
* **gpt:** added onClose props in plugin for markup mode ([#669](https://github.com/gravity-ui/markdown-editor/issues/669)) ([689cc20](https://github.com/gravity-ui/markdown-editor/commit/689cc2067dfe9ccac531beee107feacaea90ae70))
93+
94+
## [15.3.0](https://github.com/gravity-ui/markdown-editor/compare/v15.2.2...v15.3.0) (2025-03-05)
95+
96+
97+
### Features
98+
99+
* **Clipboard:** added trim empty list items before copying ([#658](https://github.com/gravity-ui/markdown-editor/issues/658)) ([ed88851](https://github.com/gravity-ui/markdown-editor/commit/ed88851821de069d9c6f1b2dfa4891580057937a))
100+
* **Lists:** improved collapsing of empty list items with nested lists ([#653](https://github.com/gravity-ui/markdown-editor/issues/653)) ([c828137](https://github.com/gravity-ui/markdown-editor/commit/c828137f726a80722772583bf5f6a2985b51021e))
101+
* **YfmHtmlBlock:** added compatibility for sanitize named export ([#668](https://github.com/gravity-ui/markdown-editor/issues/668)) ([e76af56](https://github.com/gravity-ui/markdown-editor/commit/e76af563426c75aea80ee8168176f9c8563f4030))
102+
103+
## [15.2.2](https://github.com/gravity-ui/markdown-editor/compare/v15.2.1...v15.2.2) (2025-02-27)
104+
105+
106+
### Bug Fixes
107+
108+
* **Color:** fixed import of color md plugin ([#661](https://github.com/gravity-ui/markdown-editor/issues/661)) ([d260605](https://github.com/gravity-ui/markdown-editor/commit/d2606052c366d3f01c31cbb62bb460757171fa86))
109+
110+
## [15.2.1](https://github.com/gravity-ui/markdown-editor/compare/v15.2.0...v15.2.1) (2025-02-26)
111+
112+
113+
### Bug Fixes
114+
115+
* added file extensions to full-path imports for esm-build ([#651](https://github.com/gravity-ui/markdown-editor/issues/651)) ([2bfcd5d](https://github.com/gravity-ui/markdown-editor/commit/2bfcd5de0ebf66427f733c7cc94327cf34d4ec4e))
116+
* **Emoji:** added file extension to plugin import path ([#654](https://github.com/gravity-ui/markdown-editor/issues/654)) ([77d3c0c](https://github.com/gravity-ui/markdown-editor/commit/77d3c0c85ab4347bcf6c0146a7bfd74f81cb01f1))
117+
3118
## [15.2.0](https://github.com/gravity-ui/markdown-editor/compare/v15.1.0...v15.2.0) (2025-02-21)
4119

5120

README-ru.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ function Editor({onSubmit}) {
5252
```
5353

5454
Полезные ссылки:
55-
56-
- [Как подключить редактор в Create React App](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-install-create-react-app--docs)
57-
- [Как добавить предварительный просмотр для режима разметки](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-develop-preview--docs)
58-
- [Как добавить расширение HTML](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-connect-html-block--docs)
59-
- [Как добавить расширение Latex](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-connect-latex-extension--docs)
60-
- [Как добавить расширение Mermaid](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-connect-mermaid-extension--docs)
55+
- [Как подключить редактор в Create React App](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-getting-started-create-react-app--docs)
56+
- [Как добавить предварительный просмотр для режима разметки](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-getting-started-preview--docs)
57+
- [Как добавить расширение HTML](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-extensions-html-block--docs)
58+
- [Как добавить расширение Latex](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-extensions-latex-extension--docs)
59+
- [Как добавить расширение Mermaid](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-extensions-mermaid-extension--docs)
6160
- [Как создать собственное расширение](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-develop-extension-creation--docs)
62-
- [Как добавить расширение GPT](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-connect-gpt--docs)
61+
- [Как добавить расширение GPT](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-extensions-gpt--docs)
6362
- [Как добавить расширение привязки текста в Markdown](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-develop-extension-with-popup--docs)
6463

64+
6565
### Разработка
6666

6767
Для запуска Storybook в режиме разработки выполните следующую команду:

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,24 @@ function Editor({onSubmit}) {
5050
return <MarkdownEditorView stickyToolbar autofocus editor={editor} />;
5151
}
5252
```
53-
5453
Read more:
55-
56-
- [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)
57-
- [How to add preview for markup mode](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-develop-preview--docs)
58-
- [How to add HTML extension](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-connect-html-block--docs)
59-
- [How to add Latex extension](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-connect-latex-extension--docs)
60-
- [How to add Mermaid extension](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-connect-mermaid-extension--docs)
54+
- [How to connect the editor in the Create React App](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-getting-started-create-react-app--docs)
55+
- [How to add preview for markup mode](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-getting-started-preview--docs)
56+
- [How to add HTML extension](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-extensions-html-block--docs)
57+
- [How to add Latex extension](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-extensions-latex-extension--docs)
58+
- [How to add Mermaid extension](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-extensions-mermaid-extension--docs)
6159
- [How to write extension](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-develop-extension-creation--docs)
62-
- [How to add GPT extension](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-connect-gpt--docs)
60+
- [How to add GPT extension](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-extensions-gpt--docs)
6361
- [How to add text binding extension in markdown](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-develop-extension-with-popup--docs)
6462

6563
### Development
66-
6764
To start the dev storybook
6865

6966
```shell
7067
npm start
7168
```
7269

70+
7371
### i18n
7472

7573
To set up internationalization, you just need to use the `configure`:

demo/components/PMSelection.tsx

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

3-
import type {EditorView} from 'prosemirror-view';
43
import {useEffectOnce, useUpdate} from 'react-use';
54

5+
import type {EditorView} from '#pm/view';
66
import {
77
type ClassNameProps,
88
type MarkdownEditorInstance,
99
isNodeSelection,
1010
isTextSelection,
1111
isWholeSelection,
12-
} from '../../src';
12+
} from 'src/index';
1313

1414
export type WysiwygSelectionProps = ClassNameProps & {
1515
editor: MarkdownEditorInstance;

demo/components/Playground.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../node_modules/@gravity-ui/uikit/styles/mixins';
1+
@use '@gravity-ui/uikit/styles/mixins' as uikit;
22

33
.playground {
44
max-width: 1296px;
@@ -12,15 +12,15 @@
1212

1313
text-align: center;
1414

15-
@include text-header-2();
15+
@include uikit.text-header-2();
1616
}
1717

1818
&__version {
1919
position: absolute;
2020
right: 0;
2121
bottom: 0;
2222

23-
@include text-code-inline-1();
23+
@include uikit.text-code-inline-1();
2424
}
2525

2626
&__markup {
@@ -29,6 +29,8 @@
2929
margin: 0;
3030
padding: 5px 10px;
3131

32+
font-family: var(--g-font-family-monospace);
33+
3234
background-color: var(--g-color-base-generic);
3335
}
3436

0 commit comments

Comments
 (0)