Skip to content

Commit dc2c34f

Browse files
author
Juli Ovechkina
authored
feat!: page-constructor 3.0.0 stable (#374)
1 parent 6b5457e commit dc2c34f

File tree

126 files changed

+673
-3279
lines changed

Some content is hidden

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

126 files changed

+673
-3279
lines changed

CHANGELOG.md

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

3+
## [3.0.0](2023-06-05)
4+
5+
6+
### ⚠ BREAKING CHANGES
7+
8+
* remove Preview block ([#235](https://github.com/gravity-ui/page-constructor/issues/235)), use Tabs block
9+
* remove Simple block ([#228](https://github.com/gravity-ui/page-constructor/issues/228)), use ContentLayout block
10+
* remove CardWithImage sub-block ([#236](https://github.com/gravity-ui/page-constructor/issues/236)), use LayoutItem sub-block
11+
* remove Security block ([#321](https://github.com/gravity-ui/page-constructor/issues/321)), use ContentLayout block
12+
* remove LinkTable block ([#325](https://github.com/gravity-ui/page-constructor/issues/325)), use ContentLayout block
13+
* remove TutorialCard sub-block ([#331](https://github.com/gravity-ui/page-constructor/issues/331)), use BasicCard sub-block
14+
* remove hook HeightCalculator ([#328](https://github.com/gravity-ui/page-constructor/issues/328))
15+
* remove Partner sub-block ([#335](https://github.com/gravity-ui/page-constructor/issues/335)), use BasicCard sub-block
16+
* remove NewsCard sub-block ([#342](https://github.com/gravity-ui/page-constructor/issues/342)), use BasicCard sub-block
17+
* remove component Footnotes ([#343](https://github.com/gravity-ui/page-constructor/issues/343)), use ContentLayout block
18+
* remove component BlockHeader ([#341](https://github.com/gravity-ui/page-constructor/issues/341)), use component Title
19+
* remove property `fullScreen` from components ([#366](https://github.com/gravity-ui/page-constructor/issues/366)), use property `fullscreen`
20+
21+
22+
### refactor
23+
24+
* refactor text-transform functions ([#225](https://github.com/gravity-ui/page-constructor/issues/225))
25+
326
## [2.22.2](https://github.com/gravity-ui/page-constructor/compare/v2.22.1...v2.22.2) (2023-06-01)
427

528

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export interface PageContent extends Animatable {
5454
blocks: Block[];
5555
menu?: Menu;
5656
background?: MediaProps;
57-
footnotes?: string[];
5857
}
5958

6059
interface Custom {

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gravity-ui/page-constructor",
3-
"version": "2.22.2",
3+
"version": "3.0.0-beta.0",
44
"description": "Gravity UI Page Constructor",
55
"license": "MIT",
66
"repository": {

src/blocks/CardLayout/CardLayout.tsx

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

3-
import {AnimateBlock, BlockHeader} from '../../components';
3+
import {AnimateBlock, Title} from '../../components';
44
import {Col, GridColumnSizesType, Row} from '../../grid';
55
import {CardLayoutBlockProps as CardLayoutBlockParams, WithChildren} from '../../models';
66
import {block} from '../../utils';
@@ -24,7 +24,7 @@ const CardLayout: React.FC<CardLayoutBlockProps> = ({
2424
children,
2525
}) => (
2626
<AnimateBlock className={b()} animate={animated}>
27-
{(title || description) && <BlockHeader title={title} description={description} />}
27+
{(title || description) && <Title title={title} subtitle={description} />}
2828
<Row>
2929
{React.Children.map(children, (child, index) => (
3030
<Col key={index} sizes={colSizes} className={b('item')}>

src/blocks/CardLayout/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
The following blocks are currently supported:
1818

1919
- [`BasicCard` — Basic card](?path=/story/components-cards-basiccard--default&viewMode=docs)
20-
- [`Partner` — Partner card](?path=/story/components-cards-partner--default&viewMode=docs)
2120
- [`Price Detailed` — Pricing](?path=/story/components-cards-pricedetailed--marked-list&viewMode=docs)
2221
- [`BackgroundCard` — Background card](?path=/story/components-cards-backgroundcard--default&viewMode=docs)
23-
- [`CardWithImage` — Card with a picture above the title (deprecated)](?path=/story/components-cards-cardwithimage--default&viewMode=docs)
24-
- [`LayoutItem` — Component part of `Layout` component, consists with `Media` and `Content`](?path=/story/components-cards-cardwithimage--default&viewMode=docs)
25-
- [`NewsCard` — News card](?path=/story/components-cards-newscard--default&viewMode=docs)
26-
- [`TutorialCard` — Card with an icon](?path=/story/components-cards-tutorialcard--default&viewMode=docs)
22+
- [`LayoutItem` — Component part of `Layout` component, consists with `Media` and `Content`](?path=/story/components-cards-layoutitem--default&viewMode=docs)

src/blocks/CardLayout/__stories__/CardLayout.stories.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import {PageConstructor} from '../../../containers/PageConstructor';
66
import {
77
CardLayoutBlockModel,
88
CardLayoutBlockProps,
9-
CardWithImageModel,
10-
CardWithImageProps,
9+
LayoutItemModel,
10+
LayoutItemProps,
1111
SubBlockModels,
1212
} from '../../../models';
1313
import CardLayout from '../CardLayout';
@@ -19,10 +19,10 @@ export default {
1919
component: CardLayout,
2020
} as Meta;
2121

22-
const createCardArray: (count: number, shared: Partial<CardWithImageProps>) => SubBlockModels[] = (
22+
const createCardArray: (count: number, shared: LayoutItemProps) => SubBlockModels[] = (
2323
count,
2424
shared,
25-
) => Array.from({length: count}, () => ({...shared} as CardWithImageModel));
25+
) => Array.from({length: count}, () => ({...shared} as LayoutItemModel));
2626

2727
const DefaultTemplate: Story<CardLayoutBlockModel> = (args) => (
2828
<PageConstructor content={{blocks: [args]}} />

src/blocks/CardLayout/__stories__/data.json

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
22
"default": {
33
"card": {
4-
"type": "card-with-image",
5-
"image": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img-mini_4-12_light.png",
6-
"title": "Lorem&nbsp;ipsum",
7-
"description": "Dolor sit amet"
4+
"type": "layout-item",
5+
"media": {
6+
"image": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img-mini_4-12_light.png"
7+
},
8+
"content": {
9+
"title": "Lorem&nbsp;ipsum",
10+
"text": "Dolor sit amet"
11+
}
812
},
913
"content": {
1014
"type": "card-layout-block",
@@ -15,10 +19,14 @@
1519
"colSizes": {
1620
"four": {
1721
"card": {
18-
"type": "card-with-image",
19-
"image": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img-mini_3-12_light.png",
20-
"title": "Lorem&nbsp;ipsum",
21-
"description": "Dolor sit amet"
22+
"type": "layout-item",
23+
"media": {
24+
"image": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img-mini_3-12_light.png"
25+
},
26+
"content": {
27+
"title": "Lorem&nbsp;ipsum",
28+
"text": "Dolor sit amet"
29+
}
2230
},
2331
"description": "Four cards in a row on the desktop, three cards in a row on a tablet, two cards in a row on a mobile phone.",
2432
"colSizes": {
@@ -29,10 +37,14 @@
2937
},
3038
"two": {
3139
"card": {
32-
"type": "card-with-image",
33-
"image": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img-mini_6-12_light.png",
34-
"title": "Lorem&nbsp;ipsum",
35-
"description": "Dolor sit amet"
40+
"type": "layout-item",
41+
"media": {
42+
"image": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img-mini_6-12_light.png"
43+
},
44+
"content": {
45+
"title": "Lorem&nbsp;ipsum",
46+
"text": "Dolor sit amet"
47+
}
3648
},
3749
"description": "Two cards in a row on all devices",
3850
"colSizes": {

src/blocks/ExtendedFeatures/ExtendedFeatures.tsx

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

3-
import {AnimateBlock, BlockHeader, HTML} from '../../components/';
3+
import {AnimateBlock, HTML, Title} from '../../components/';
44
import Image from '../../components/Image/Image';
55
import {getMediaImage} from '../../components/Media/Image/utils';
66
import {ThemeValueContext} from '../../context/theme/ThemeValueContext';
@@ -30,7 +30,7 @@ export const ExtendedFeaturesBlock = ({
3030

3131
return (
3232
<AnimateBlock className={b()} animate={animated}>
33-
<BlockHeader title={title} description={description} className={b('header')} />
33+
<Title title={title} subtitle={description} className={b('header')} />
3434
<div className={b('items')}>
3535
<Row>
3636
{items.map(

src/blocks/FilterBlock/FilterBlock.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, {useMemo, useState} from 'react';
22

33
import {CardLayoutBlock} from '..';
4-
import {AnimateBlock, BlockHeader} from '../../components';
4+
import {AnimateBlock, Title} from '../../components';
55
import ButtonTabs, {ButtonTabsItemProps} from '../../components/ButtonTabs/ButtonTabs';
66
import {ConstructorItem} from '../../containers/PageConstructor/components/ConstructorItem';
77
import {Col, Row} from '../../grid';
@@ -53,10 +53,10 @@ const FilterBlock: React.FC<FilterBlockProps> = ({
5353
return (
5454
<AnimateBlock className={b()} animate={animated}>
5555
{title && (
56-
<BlockHeader
56+
<Title
5757
className={b('title', {centered: centered})}
5858
title={title}
59-
description={description}
59+
subtitle={description}
6060
/>
6161
)}
6262
{tabButtons.length && (

0 commit comments

Comments
 (0)