Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ configure({
const withContextProvider: DecoratorFn = (Story, context) => {
const theme = context.globals.theme;

// хак для установки темы в доке
// to set theme in docs
context.parameters.backgrounds.default = theme;
context.globals.backgrounds = {
value: theme === 'light' ? 'white' : 'black',
};
context.globals.background = theme;

// TODO: в будущем возможно появится вариант изменять динамически тему доки, нужно будет перейти на новый способ
// TODO: to switch docs theme dynamically in the future
// context.parameters.docs.theme = theme === 'light' ? CommonTheme.light : CommonTheme.dark;

return (
Expand Down Expand Up @@ -71,7 +71,7 @@ export const parameters = {
// actions: {
// argTypesRegex: '^on.*',
// },
jsx: {showFunctions: true}, // Для того, чтобы функции отображались в сорцах
jsx: {showFunctions: true}, // to show function in sources
viewport: {
viewports: MINIMAL_VIEWPORTS,
},
Expand Down
4 changes: 2 additions & 2 deletions .storybook/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const CloudTheme = create({
inputTextColor: 'black',
inputBorderRadius: 4,

brandUrl: 'https://github.com/yandex-cloud/page-constructor',
brandUrl: 'https://github.com/gravity-ui/page-constructor',
brandTitle: `<div style="font-size: 18px; color: #027bf3; font-weight: 600; margin-top: -6px; margin-bottom: 2px;">Page Constructor</div>
<div style="font-size: 14px;color: #7d7d7d;font-weight: 400;">Yandex.Cloud websites components</div>`,
<div style="font-size: 14px;color: #7d7d7d;font-weight: 400;">Yandex.Cloud website components</div>`,
});
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ npm install @gravity-ui/page-constructor

При создании страниц используется компонентный подход: страница составляется из набора готовых блоков, которые могут быть расположены в произвольном порядке. Каждому блоку соответсвует определенный тип и набор параметров во входных данных.

Формат входных данных и список доступных блоков можно посмотреть в [документации](http://localhost:7009/?path=/story/информация--containers).
Формат входных данных и список доступных блоков можно посмотреть в [документации](http://localhost:7009/?path=/story/information--containers).

### Начало работы

Expand Down Expand Up @@ -115,8 +115,8 @@ interface Metrika = {

```typescript
export interface LoadableConfigItem {
fetch: FetchLoadableData; // функция загрузки данных
component: React.ComponentType; //блок, в который нужно передать загруженные данные
fetch: FetchLoadableData; // data loading method
component: React.ComponentType; //blog to pass loaded data
}

type FetchLoadableData<TData = any> = (blockKey: string) => Promise<TData>;
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Banner/__stories__/Banner.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {PageConstructor} from '../../../containers/PageConstructor';
import yfm from '@doc-tools/transform';

export default {
title: 'Блоки/Banner',
title: 'Blocks/Banner',
component: Banner,
args: {
theme: 'light',
Expand Down
14 changes: 7 additions & 7 deletions src/blocks/CardLayout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

На данный момент поддерживаются следующие блоки:

- [`BasicCard` - основная карточка](?path=/story/компоненты-карточки-basiccard--default&viewMode=docs)
- [`Partner` - карточка партнера](?path=/story/компоненты-карточки-partner--default&viewMode=docs)
- [`Price Detailed` - тарифы](?path=/story/компоненты-карточки-pricedetailed--marked-list&viewMode=docs)
- [`BackgroundCard` - карточка с бэкграундом](?path=/story/компоненты-карточки-backgroundcard--default&viewMode=docs)
- [`CardWithImage` - карточка с фотографией над заголовком](?path=/story/компоненты-карточки-cardwithimage--default&viewMode=docs)
- [`NewsCard` - карточка новостей](?path=/story/компоненты-карточки-newscard--default&viewMode=docs)
- [`TutorialCard` - карточка с иконкой](?path=/story/компоненты-карточки-tutorialcard--default&viewMode=docs)
- [`BasicCard` - основная карточка](?path=/story/components-cards-basiccard--default&viewMode=docs)
- [`Partner` - карточка партнера](?path=/story/components-cards-partner--default&viewMode=docs)
- [`Price Detailed` - тарифы](?path=/story/components-cards-pricedetailed--marked-list&viewMode=docs)
- [`BackgroundCard` - карточка с бэкграундом](?path=/story/components-cards-backgroundcard--default&viewMode=docs)
- [`CardWithImage` - карточка с фотографией над заголовком](?path=/story/components-cards-cardwithimage--default&viewMode=docs)
- [`NewsCard` - карточка новостей](?path=/story/components-cards-newscard--default&viewMode=docs)
- [`TutorialCard` - карточка с иконкой](?path=/story/components-cards-tutorialcard--default&viewMode=docs)
2 changes: 1 addition & 1 deletion src/blocks/CardLayout/__stories__/CardLayout.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {BlockType, CardLayoutBlockModel, SubBlockType} from '../../../models';
import {PageConstructor} from '../../../containers/PageConstructor/PageConstructor';

export default {
title: 'Блоки/CardLayout',
title: 'Blocks/CardLayout',
component: CardLayout,
} as Meta;

Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Companies/__stories__/Companies.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {BlockType, CompaniesBlockModel} from '../../../models';
import {PageConstructor} from '../../../containers/PageConstructor/PageConstructor';

export default {
title: 'Блоки/Companies',
title: 'Blocks/Companies',
component: Companies,
} as Meta;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {PageConstructor} from '../../../containers/PageConstructor/PageConstruct
import yfm from '@doc-tools/transform';

export default {
title: 'Блоки/ContentLayout',
title: 'Blocks/ContentLayout',
component: Content,
} as Meta;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ExtendedFeatures from '../ExtendedFeatures';
import {PageConstructor} from '../../../containers/PageConstructor/PageConstructor';

export default {
title: 'Блоки/ExtendedFeatures',
title: 'Blocks/ExtendedFeatures',
component: ExtendedFeatures,
args: {
colSizes: {
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Header/__stories__/Header.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import yfm from '@doc-tools/transform';
import {PageConstructor} from '../../../containers/PageConstructor';

export default {
title: 'Блоки/Header',
title: 'Blocks/Header',
component: Header,
args: {
image: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import HeaderSlider from '../HeaderSlider';
import {PageConstructor} from '../../../containers/PageConstructor/PageConstructor';

export default {
title: 'Блоки/HeaderSlider',
title: 'Blocks/HeaderSlider',
component: HeaderSlider,
args: {
dots: true,
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Icons/__stories__/Icons.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {BlockType, IconsBlockModel} from '../../../models';
import {PageConstructor} from '../../../containers/PageConstructor/PageConstructor';

export default {
title: 'Блоки/Icons',
title: 'Blocks/Icons',
component: Icons,
} as Meta;

Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Info/__stories__/Info.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Info from '../Info';
import {PageConstructor} from '../../../containers/PageConstructor/PageConstructor';

export default {
title: 'Блоки/Info',
title: 'Blocks/Info',
component: Info,
} as Meta;

Expand Down
2 changes: 1 addition & 1 deletion src/blocks/LinkTable/__stories__/LinkTable.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {PageConstructor} from '../../../containers/PageConstructor/PageConstruct

export default {
component: LinkTable,
title: 'Блоки/LinkTable',
title: 'Blocks/LinkTable',
} as Meta;

const DefaultTemplate: Story<LinkTableBlockModel> = (args) => (
Expand Down
8 changes: 4 additions & 4 deletions src/blocks/Media/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

`description: строка` - описание;

[`button: Button` - кнопка](?path=/story/информация--common-types&viewMode=docs#button---кнопка)
[`button: Button` - кнопка](?path=/story/information--common-types&viewMode=docs#button---button)

[`media: Media` - описание медиа](?path=/story/информация--common-types&viewMode=docs#media---изображениевидеоdatalens)
[`media: Media` - описание медиа](?path=/story/information--common-types&viewMode=docs#media---picvideodatalens)

`direction: 'media-content' | 'content-media'` - относительное расположение медиа и контента

Expand All @@ -18,6 +18,6 @@

`additionalInfo?: string` - серый текст (с поддержкой yfm)

[`links?: Link[]` - массив с объектами ссылок](?path=/story/информация--common-types&viewMode=docs#link---ссылка)
[`links?: Link[]` - массив с объектами ссылок](?path=/story/information--common-types&viewMode=docs#link---link)

[`buttons?: Button[]` - массив с объектами кнопок](?path=/story/информация--common-types&viewMode=docs#button---кнопка)
[`buttons?: Button[]` - массив с объектами кнопок](?path=/story/information--common-types&viewMode=docs#button---button)
2 changes: 1 addition & 1 deletion src/blocks/Media/__stories__/Media.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {PageConstructor} from '../../../containers/PageConstructor/PageConstruct
import yfm from '@doc-tools/transform';

export default {
title: 'Блоки/Media',
title: 'Blocks/Media',
component: Media,
args: {
largeMedia: false,
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Preview/__stories__/Preview.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {BlockType, PreviewBlockModel, PreviewItemType, MediaVideoType} from '../
import {PageConstructor} from '../../../containers/PageConstructor/PageConstructor';

export default {
title: 'Блоки/Preview',
title: 'Blocks/Preview',
component: Preview,
args: {
stopVideo: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {BlockType, PromoFeaturesBlockModel} from '../../../models';
import {PageConstructor} from '../../../containers/PageConstructor';

export default {
title: 'Блоки/PromoFeaturesBlock',
title: 'Blocks/PromoFeaturesBlock',
component: PromoFeaturesBlock,
args: {
theme: 'default',
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/Questions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

`additionalInfo?: string` - серый текст (с поддержкой yfm)

`links?: Link[]` - массив с объектами ссылок, см. раздел [Контент-блоки](?path=/story/информация--common-types&viewMode=docs)
`links?: Link[]` - массив с объектами ссылок, см. раздел [Content-blocks](?path=/story/information--common-types&viewMode=docs)

`buttons?: Button[]` - массив с объектами кнопок, см. раздел [Контент-блоки](?path=/story/информация--common-types&viewMode=docs)
`buttons?: Button[]` - массив с объектами кнопок, см. раздел [Content-blocks](?path=/story/information--common-types&viewMode=docs)

`items: QuestionItem[]`

- `title: string` - заголовок вопроса(справа)
- `text: string` - текст вопроса
- `link?: Link` - ссылка под текстом см. раздел [Link](http://localhost:7009/?path=/docs/компоненты-кнопки-и-ссылки-link--default)
- `link?: Link` - ссылка под текстом см. раздел [Link](http://localhost:7009/?path=/docs/components-links-and-buttons-link--default)
- `listStyle?: 'dash' | 'disk'` - если текст содержит список, то он может быть либо с тире (dash), либо с точками (disk)
2 changes: 1 addition & 1 deletion src/blocks/Questions/__stories__/Questions.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {PageConstructor} from '../../../containers/PageConstructor/PageConstruct
import yfm from '@doc-tools/transform';

export default {
title: 'Блоки/Questions',
title: 'Blocks/Questions',
component: QuestionsBlock,
args: {
type: BlockType.QuestionsBlock,
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Security/__stories__/Security.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {BlockType, SecurityBlockModel} from '../../../models';
import {PageConstructor} from '../../../containers/PageConstructor';

export default {
title: 'Блоки/Security',
title: 'Blocks/Security',
component: Security,
args: {
theme: 'dark',
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Simple/__stories__/Simple.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {PageConstructor} from '../../../containers/PageConstructor/PageConstruct

export default {
component: Simple,
title: 'Блоки/Simple',
title: 'Blocks/Simple',
} as Meta;

const DefaultTemplate: Story<SimpleBlockModel> = (args) => (
Expand Down
14 changes: 7 additions & 7 deletions src/blocks/Slider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
На данный момент поддерживаются следующие блоки:

- `Quote` - цитата
- [`BasicCard` - основная карточка](?path=/story/компоненты-карточки-basiccard--default&viewMode=docs)
- [`BasicCard` - основная карточка](?path=/story/components-cards-basiccard--default&viewMode=docs)
- [`Banner` - баннер](?path=/story/блоки-banner--default&viewMode=docs)
- [`Partner` - карточка партнера](?path=/story/компоненты-карточки-partner--default&viewMode=docs)
- [`Price Detailed` - тарифы](?path=/story/компоненты-карточки-pricedetailed--marked-list&viewMode=docs)
- [`BackgroundCard` - карточка с бэкграундом](?path=/story/компоненты-карточки-backgroundcard--default&viewMode=docs)
- [`CardWithImage` - карточка с фотографией над заголовком](?path=/story/компоненты-карточки-cardwithimage--default&viewMode=docs)
- [`Partner` - карточка партнера](?path=/story/components-cards-partner--default&viewMode=docs)
- [`Price Detailed` - тарифы](?path=/story/components-cards-pricedetailed--marked-list&viewMode=docs)
- [`BackgroundCard` - карточка с бэкграундом](?path=/story/components-cards-backgroundcard--default&viewMode=docs)
- [`CardWithImage` - карточка с фотографией над заголовком](?path=/story/components-cards-cardwithimage--default&viewMode=docs)
- [`MediaCard` - карточка с картинкой](?path=/story/блоки-media--default&viewMode=docs)
- [`NewsCard` - карточка новостей](?path=/story/компоненты-карточки-newscard--default&viewMode=docs)
- [`TutorialCard` - карточка с иконкой](?path=/story/компоненты-карточки-tutorialcard--default&viewMode=docs)
- [`NewsCard` - карточка новостей](?path=/story/components-cards-newscard--default&viewMode=docs)
- [`TutorialCard` - карточка с иконкой](?path=/story/components-cards-tutorialcard--default&viewMode=docs)
2 changes: 1 addition & 1 deletion src/blocks/Slider/__stories__/Slider.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {PageConstructor} from '../../../containers/PageConstructor/PageConstruct
import yfm from '@doc-tools/transform';

export default {
title: 'Блоки/Slider',
title: 'Blocks/Slider',
component: Slider,
args: {
dots: true,
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Table/__stories__/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {BlockType, TableBlockModel} from '../../../models';

export default {
component: Table,
title: 'Блоки/Table',
title: 'Blocks/Table',
} as Meta;

const DefaultTemplate: Story<TableBlockModel> = (args) => (
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Tabs/__stories__/Tabs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {PageConstructor} from '../../../containers/PageConstructor/PageConstruct
import yfm from '@doc-tools/transform';

export default {
title: 'Блоки/Tabs',
title: 'Blocks/Tabs',
component: Tabs,
argTypes: {
description: {control: 'text'},
Expand Down
4 changes: 2 additions & 2 deletions src/demo/DocsWithReadme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const DocsWithReadme = () => {
const fileName = context?.parameters?.fileName;
const kind = context.kind;
let isComponent = false;
if (kind && /Компоненты|Блоки|Саб-блоки\//.test(kind)) {
if (kind && /Components|Blocks|Sub-blocks\//.test(kind)) {
isComponent = true;
}

Expand All @@ -47,7 +47,7 @@ export const DocsWithReadme = () => {
target="_blank"
rel="noopener noreferrer"
>
<img src="https://badger.yandex-team.ru/custom/[Исходники]/[Bitbucket][green]/badge.svg" />
<img src="https://badger.yandex-team.ru/custom/[Source]/[Bitbucket][green]/badge.svg" />
</a>
);
}
Expand Down
14 changes: 7 additions & 7 deletions src/demo/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const BLOCKS = 'Блоки';
export const COMPONENTS = 'Компоненты';
export const CONTAINERS = 'Контейнеры';
export const BUTTONS_LINKS = 'Кнопки и ссылки';
export const CARDS = 'Карточки';
export const HEADERS = 'Разновидности Header-ов';
export const MEDIA = 'Картинки, видео, DataLens';
export const BLOCKS = 'Blocks';
export const COMPONENTS = 'Components';
export const CONTAINERS = 'Containers';
export const BUTTONS_LINKS = 'Links and buttons';
export const CARDS = 'Cards';
export const HEADERS = 'Headers';
export const MEDIA = 'Pics, video, DataLens';
2 changes: 1 addition & 1 deletion src/models/constructor-items/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export interface AnchorProps {
}

/**
* @deprecated Сomponent VideoBlock will be deleted, which uses this logic
* @deprecated Component VideoBlock will be deleted, which uses this logic
*/
interface LoopProps {
start: number;
Expand Down
Loading