Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: version 6 #1028

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {Theme} from '../src';
import {GlobalThemeController} from './theme/utils/global-theme-controller';

import '../styles/styles.scss';
import '@gravity-ui/uikit/styles/fonts.css';

const withContextProvider: Decorator = (Story, context) => {
const theme = context.globals.theme;
Expand Down
2 changes: 2 additions & 0 deletions .storybook/stories/documentation/Blocks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ _[Common field types](?id=documentation-types&viewMode=docs)_

## [Share](?path=/story/blocks-share--docs&viewMode=docs)

## [<s>SliderOld</s>](?path=/story/blocks-sliderold-deprecated--docs&viewMode=docs) (Deprecated, use Slider instead)

## [Slider](?path=/story/blocks-slider--docs&viewMode=docs)

## [Table](?path=/story/blocks-table--docs&viewMode=docs)
Expand Down
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);
};
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ To use mixins and constructor style variables when creating custom blocks, add i
@import '~@gravity-ui/page-constructor/styles/styles.scss';
```

To use default font, add import in your file:

```css
@import '~@gravity-ui/page-constructor/styles/fonts.scss';
```

### Loadable blocks

It's sometimes necessary that a block renders itself based on data to be loaded. In this case, loadable blocks are used.
Expand Down
Loading
Loading