Skip to content

Commit

Permalink
feat!: yfm instead of html (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
niktverd committed Dec 23, 2024
1 parent 538d721 commit 7ac1634
Show file tree
Hide file tree
Showing 44 changed files with 563 additions and 215 deletions.
23 changes: 23 additions & 0 deletions .storybook/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
import yfm from '@diplodoc/transform';
import {TitleItemProps} from '../src';

export const yfmTransform = (content: string) => yfm(content).result.html;
export const yfmTransformInline = (content: string) =>
yfm(content, {renderInline: true}).result.html;
export const transformTitle = (title: string | TitleItemProps) => {
if (!title) {
return undefined;
}

if (typeof title === 'string') {
return yfmTransformInline(title);
}

const {text, ...rest} = title;

return {...rest, text: yfmTransformInline(text)};
};
export const transformOptionalTitle = (title?: string | TitleItemProps) => {
if (!title) {
return undefined;
}

return transformTitle(title);
};
242 changes: 188 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"uuid": "^9.0.0"
},
"peerDependencies": {
"@diplodoc/transform": "^4.10.4",
"@diplodoc/transform": "^4.28.2",
"@gravity-ui/uikit": "^6.0.0",
"react": "^16.0.0 || ^17.0.0 || ^18.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,4 @@
- `npm run playwright:docker` - run tests using docker
- `npm run playwright:docker:update` - update screenshots using docker
- `npm run playwright:docker:clear-cache` - clear node_modules cache for docker container and clear cache vite
- `npx playwright show-report ./playwright-report-docker` - show report
1 change: 0 additions & 1 deletion playwright/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ const config: PlaywrightTestConfig = {
icon: true,
},
}),

commonjs(),
],
resolve: {
Expand Down
Loading

0 comments on commit 7ac1634

Please sign in to comment.