Skip to content

Commit a034c63

Browse files
authored
Merge branch 'main' into fix/link-popup-short-selection
2 parents fd6aab9 + ba23367 commit a034c63

122 files changed

Lines changed: 2445 additions & 485 deletions

File tree

Some content is hidden

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

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ updates:
4040
- dependency-name: "*"
4141
update-types:
4242
- "version-update:semver-major"
43+
- dependency-name: "@diplodoc/*"
44+
- dependency-name: "@gravity-ui/*"
4345

4446
# npm — demo
4547
- package-ecosystem: npm
@@ -52,10 +54,16 @@ updates:
5254
patterns:
5355
- "@storybook/*"
5456
- "storybook"
57+
playwright:
58+
patterns:
59+
- "@playwright/*"
60+
- "playwright"
5561
ignore:
5662
- dependency-name: "*"
5763
update-types:
5864
- "version-update:semver-major"
65+
- dependency-name: "@diplodoc/*"
66+
- dependency-name: "@gravity-ui/*"
5967

6068
# npm — packages/*
6169
- package-ecosystem: npm
@@ -78,6 +86,8 @@ updates:
7886
- dependency-name: "*"
7987
update-types:
8088
- "version-update:semver-major"
89+
- dependency-name: "@diplodoc/*"
90+
- dependency-name: "@gravity-ui/*"
8191

8292
# npm — infra/*
8393
- package-ecosystem: npm

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
options:
1616
- 'packages/editor'
1717
- 'packages/latex-extension'
18+
- 'packages/page-constructor-extension'
1819
tag:
1920
description: 'Publish with tag'
2021
required: true

.release-please/config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"bump-minor-pre-major": true,
55
"bump-patch-for-minor-pre-major": true,
66
"separate-pull-requests": true,
7+
"bootstrap-sha": "0aaeb738572e33accc35a39caf646bcb1724b834",
78
"changelog-sections": [
89
{"type": "feat", "section": "Features", "hidden": false},
910
{"type": "fix", "section": "Bug Fixes", "hidden": false},
@@ -12,6 +13,7 @@
1213
],
1314
"packages": {
1415
"packages/editor": {},
15-
"packages/latex-extension": {}
16+
"packages/latex-extension": {},
17+
"packages/page-constructor-extension": {}
1618
}
1719
}

.release-please/manifest.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"packages/editor": "15.38.1",
3-
"packages/latex-extension": "0.1.0"
2+
"packages/editor": "15.40.0",
3+
"packages/latex-extension": "0.1.0",
4+
"packages/page-constructor-extension": "0.1.0"
45
}

demo/.storybook/main.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ const config: StorybookConfig = {
5050
process: require.resolve('process/browser'),
5151
};
5252

53+
config.ignoreWarnings ||= [];
54+
config.ignoreWarnings.push(/\.js\.map$/);
55+
config.module ||= {};
56+
config.module.rules ||= [];
57+
config.module.rules.push({
58+
test: /\.(js|css)\.map$/,
59+
include: /node_modules/,
60+
type: 'asset/resource' as const,
61+
generator: {emit: false},
62+
});
63+
5364
config.watchOptions ||= {};
5465
config.watchOptions.ignored = /node_modules([\\]+|\/)+(?!@gravity-ui\/markdown-editor)/;
5566

demo/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@
2626
"@diplodoc/html-extension": "catalog:peer-diplodoc",
2727
"@diplodoc/latex-extension": "catalog:peer-diplodoc",
2828
"@diplodoc/mermaid-extension": "catalog:peer-diplodoc",
29+
"@diplodoc/page-constructor-extension": "catalog:peer-diplodoc",
2930
"@diplodoc/quote-link-extension": "catalog:peer-diplodoc",
3031
"@diplodoc/tabs-extension": "catalog:peer-diplodoc",
3132
"@diplodoc/transform": "catalog:peer-diplodoc",
3233
"@gravity-ui/components": "catalog:peer-gravity",
3334
"@gravity-ui/markdown-editor": "workspace:*",
3435
"@gravity-ui/markdown-editor-latex-extension": "workspace:*",
36+
"@gravity-ui/markdown-editor-page-constructor-extension": "workspace:*",
37+
"@gravity-ui/page-constructor": "catalog:peer-gravity",
3538
"@gravity-ui/uikit": "catalog:peer-gravity",
3639
"markdown-it": "catalog:peers"
3740
},

demo/src/components/Playground.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import {
3232
wLatexBlockItemData,
3333
wLatexInlineItemData,
3434
} from '@gravity-ui/markdown-editor-latex-extension/configs';
35+
import {YfmPageConstructorExtension} from '@gravity-ui/markdown-editor-page-constructor-extension';
36+
import {wYfmPageConstructorItemData} from '@gravity-ui/markdown-editor-page-constructor-extension/configs';
3537
import {Button, DropdownMenu} from '@gravity-ui/uikit';
3638

3739
import {getPlugins} from '../defaults/md-plugins';
@@ -54,6 +56,7 @@ const wCommandMenuConfig = wysiwygToolbarConfigs.wCommandMenuConfig.concat(
5456
wLatexInlineItemData,
5557
wLatexBlockItemData,
5658
wysiwygToolbarConfigs.wMermaidItemData,
59+
wYfmPageConstructorItemData,
5760
wysiwygToolbarConfigs.wYfmHtmlBlockItemData,
5861
);
5962

@@ -211,6 +214,16 @@ export const Playground = memo<PlaygroundProps>((props) => {
211214
},
212215
theme: {dark: 'dark', light: 'forest'},
213216
})
217+
.use(YfmPageConstructorExtension, {
218+
autoSave: {
219+
enabled:
220+
storyAdditionalControls?.yfmPageConstructorAutoSaveEnabled ??
221+
true,
222+
delay:
223+
storyAdditionalControls?.yfmPageConstructorAutoSaveDelay ??
224+
1000,
225+
},
226+
})
214227
.use(FoldingHeading)
215228
.use(YfmHtmlBlock, {
216229
useConfig: useYfmHtmlBlockStyles,

demo/src/components/SplitModePreview.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,26 @@ import {
1111
withMermaid,
1212
} from '@gravity-ui/markdown-editor/view/hocs/withMermaid/index.js';
1313
import {withYfmHtmlBlock} from '@gravity-ui/markdown-editor/view/hocs/withYfmHtml/index.js';
14+
import {withYfmPageConstructor} from '@gravity-ui/markdown-editor-page-constructor-extension/view';
1415
import {useThemeValue} from '@gravity-ui/uikit';
1516
import type MarkdownIt from 'markdown-it';
1617

17-
import {LATEX_RUNTIME, MERMAID_RUNTIME, YFM_HTML_BLOCK_RUNTIME} from '../defaults/md-plugins';
18+
import {
19+
LATEX_RUNTIME,
20+
MERMAID_RUNTIME,
21+
PAGE_CONSTRUCTOR_RUNTIME,
22+
YFM_HTML_BLOCK_RUNTIME,
23+
} from '../defaults/md-plugins';
1824
import useYfmHtmlBlockStyles from '../hooks/useYfmHtmlBlockStyles';
1925

2026
const ML_ATTR = 'data-ml';
2127
const mermaidConfig: MermaidConfig = {theme: 'forest'};
2228

2329
const Preview = withMermaid({runtime: MERMAID_RUNTIME})(
2430
withLatex({runtime: LATEX_RUNTIME})(
25-
withYfmHtmlBlock({runtime: YFM_HTML_BLOCK_RUNTIME})(YfmStaticView),
31+
withYfmPageConstructor({runtime: PAGE_CONSTRUCTOR_RUNTIME})(
32+
withYfmHtmlBlock({runtime: YFM_HTML_BLOCK_RUNTIME})(YfmStaticView),
33+
),
2634
),
2735
);
2836

demo/src/defaults/md-plugins.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import '@diplodoc/folding-headings-extension/runtime';
55
import {transform as yfmHtmlBlock} from '@diplodoc/html-extension';
66
import {transform as latex} from '@diplodoc/latex-extension';
77
import {transform as mermaid} from '@diplodoc/mermaid-extension';
8+
import {transform as yfmPageConstructor} from '@diplodoc/page-constructor-extension';
89
import {transform as yfmTabs} from '@diplodoc/tabs-extension';
910
import anchors from '@diplodoc/transform/lib/plugins/anchors';
1011
import checkbox from '@diplodoc/transform/lib/plugins/checkbox';
@@ -30,6 +31,7 @@ import type {PluginWithParams} from 'markdown-it/lib';
3031
export const LATEX_RUNTIME = 'extension:latex';
3132
export const MERMAID_RUNTIME = 'extension:mermaid';
3233
export const YFM_HTML_BLOCK_RUNTIME = 'extension:yfm-html-block';
34+
export const PAGE_CONSTRUCTOR_RUNTIME = 'extension:page-constructor';
3335

3436
type GetPluginsOptions = {
3537
directiveSyntax?: RenderPreviewParams['directiveSyntax'];
@@ -88,6 +90,7 @@ export function getPlugins({
8890
latex({bundle: false, validate: false, runtime: LATEX_RUNTIME}),
8991
mark,
9092
mermaid({bundle: false, runtime: MERMAID_RUNTIME}),
93+
yfmPageConstructor({bundle: false, runtime: PAGE_CONSTRUCTOR_RUNTIME}),
9194
sub,
9295
yfmHtmlBlock({
9396
bundle: false,

demo/src/stories/yfm/YFM.stories.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,14 @@ export const MermaidDiagram: Story = {
8787
},
8888
},
8989
};
90+
91+
export const YfmPageConstructor: Story = {
92+
name: 'YFM Page Constructor',
93+
args: {
94+
initial: markup.yfmPageConstructor,
95+
storyAdditionalControls: {
96+
yfmPageConstructorAutoSaveEnabled: true,
97+
yfmPageConstructorAutoSaveDelay: 500,
98+
},
99+
},
100+
};

0 commit comments

Comments
 (0)