@gravity-ui/page-constructor 3.6.1 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +10 -0
- package/build/cjs/blocks/Tabs/Tabs.d.ts +1 -1
- package/build/cjs/blocks/Tabs/Tabs.js +2 -2
- package/build/cjs/blocks/Tabs/schema.d.ts +4 -0
- package/build/cjs/blocks/Tabs/schema.js +4 -1
- package/build/cjs/components/BlockBase/BlockBase.d.ts +3 -2
- package/build/cjs/constructor-items.d.ts +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +3 -2
- package/build/cjs/grid/Col/Col.d.ts +1 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +1 -2
- package/build/cjs/models/customization.d.ts +5 -2
- package/build/esm/blocks/Tabs/Tabs.d.ts +1 -1
- package/build/esm/blocks/Tabs/Tabs.js +2 -2
- package/build/esm/blocks/Tabs/schema.d.ts +4 -0
- package/build/esm/blocks/Tabs/schema.js +5 -2
- package/build/esm/components/BlockBase/BlockBase.d.ts +3 -2
- package/build/esm/constructor-items.d.ts +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +3 -2
- package/build/esm/grid/Col/Col.d.ts +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +1 -2
- package/build/esm/models/customization.d.ts +5 -2
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +1 -2
- package/server/models/customization.d.ts +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.7.0](https://github.com/gravity-ui/page-constructor/compare/v3.6.2...v3.7.0) (2023-06-21)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **Tabs:** provide an to change tab text size ([#417](https://github.com/gravity-ui/page-constructor/issues/417)) ([005a686](https://github.com/gravity-ui/page-constructor/commit/005a68662ecc29ee07eff7d958a27842c38206f7))
|
|
9
|
+
|
|
10
|
+
## [3.6.2](https://github.com/gravity-ui/page-constructor/compare/v3.6.1...v3.6.2) (2023-06-19)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* block base inner types ([#413](https://github.com/gravity-ui/page-constructor/issues/413)) ([616d387](https://github.com/gravity-ui/page-constructor/commit/616d387833330ec7ef4cddc0f2f31d164d4a1477))
|
|
16
|
+
|
|
3
17
|
## [3.6.1](https://github.com/gravity-ui/page-constructor/compare/v3.6.0...v3.6.1) (2023-06-19)
|
|
4
18
|
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -325,6 +325,16 @@ When you receive the approval of your pull-request from the code owners and pass
|
|
|
325
325
|
4. Check your changes in CHANGELOG.md and approve robot's PR.
|
|
326
326
|
5. Squash and merge PR. You can see release process on [the Actions tab](https://github.com/gravity-ui/page-constructor/actions).
|
|
327
327
|
|
|
328
|
+
### Alpha versions release
|
|
329
|
+
|
|
330
|
+
If you want to release alpha version of the package from your branch you can do it manually:
|
|
331
|
+
|
|
332
|
+
1. Go to tab Actions
|
|
333
|
+
2. Select workflow "Release alpha version" on the left page's side
|
|
334
|
+
3. You can see on the right side the button "Run workflow". Here you can choose the branch.
|
|
335
|
+
4. You can also see field with manually version. If you release alpha in your branch for the first time, do not set anything here. After first release you have to set the new version manually because we don't change package.json in case that the branch can expire very soon. Use the prefix `alpha` in you manual version otherwise you will get error.
|
|
336
|
+
5. Push "Run workflow" and wait until the action will finish. You can release versions as many as you want but do not abuse it and release versions if you really need it. In other cases use [npm pack](https://docs.npmjs.com/cli/v7/commands/npm-pack).
|
|
337
|
+
|
|
328
338
|
### Beta-major versions release
|
|
329
339
|
|
|
330
340
|
If you want to release a new major version, you will probably need for a beta versions before a stable one, please do the following:
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TabsBlockProps } from '../../models';
|
|
2
|
-
export declare const TabsBlock: ({ items, title, description, animated, tabsColSizes, centered, direction, }: TabsBlockProps) => JSX.Element;
|
|
2
|
+
export declare const TabsBlock: ({ items, title, description, animated, tabsColSizes, centered, direction, contentSize, }: TabsBlockProps) => JSX.Element;
|
|
3
3
|
export default TabsBlock;
|
|
@@ -15,7 +15,7 @@ const grid_1 = require("../../grid");
|
|
|
15
15
|
const sub_blocks_1 = require("../../sub-blocks");
|
|
16
16
|
const utils_2 = require("../../utils");
|
|
17
17
|
const b = (0, utils_2.block)('tabs-block');
|
|
18
|
-
const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', }) => {
|
|
18
|
+
const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', contentSize = 's', }) => {
|
|
19
19
|
var _a;
|
|
20
20
|
const [activeTab, setActiveTab] = (0, react_1.useState)(items[0].tabName);
|
|
21
21
|
const [play, setPlay] = (0, react_1.useState)(false);
|
|
@@ -37,7 +37,7 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
|
|
|
37
37
|
react_1.default.createElement("div", { className: b('content-wrapper', {
|
|
38
38
|
margin: Boolean(((activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) || imageProps) && !isReverse),
|
|
39
39
|
}) },
|
|
40
|
-
react_1.default.createElement(sub_blocks_1.Content, { title: activeTabData.title, text: activeTabData.text, additionalInfo: activeTabData.additionalInfo, size:
|
|
40
|
+
react_1.default.createElement(sub_blocks_1.Content, { title: activeTabData.title, text: activeTabData.text, additionalInfo: activeTabData.additionalInfo, size: contentSize, links: [
|
|
41
41
|
...(activeTabData.link ? [activeTabData.link] : []),
|
|
42
42
|
...(activeTabData.links || []),
|
|
43
43
|
], buttons: activeTabData.buttons, colSizes: { all: 12 } }))));
|
|
@@ -31,6 +31,9 @@ exports.TabsBlock = {
|
|
|
31
31
|
properties: Object.assign(Object.assign(Object.assign({}, common_1.BlockBaseProps), common_1.BlockHeaderProps), { tabsColSizes: common_1.containerSizesArray.reduce((acc, size) => (Object.assign(Object.assign({}, acc), { [size]: common_1.sizeNumber })), {}), direction: {
|
|
32
32
|
type: 'string',
|
|
33
33
|
enum: common_1.mediaDirection,
|
|
34
|
-
}, centered: { type: 'boolean' }, items: (0, utils_1.filteredArray)(exports.tabsItem)
|
|
34
|
+
}, centered: { type: 'boolean' }, items: (0, utils_1.filteredArray)(exports.tabsItem), contentSize: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
enum: common_1.contentSizes,
|
|
37
|
+
} }),
|
|
35
38
|
},
|
|
36
39
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { BlockBaseProps, ClassNameProps } from '../../models';
|
|
3
|
-
|
|
2
|
+
import { BlockBaseProps, BlockDecorationProps, ClassNameProps } from '../../models';
|
|
3
|
+
export type BlockBaseFullProps = BlockBaseProps & BlockDecorationProps & ClassNameProps & PropsWithChildren;
|
|
4
|
+
declare const BlockBase: (props: BlockBaseFullProps) => JSX.Element;
|
|
4
5
|
export default BlockBase;
|
|
@@ -8,7 +8,7 @@ export declare const blockMap: {
|
|
|
8
8
|
"media-block": (props: import("./models").MediaBlockProps) => JSX.Element;
|
|
9
9
|
"info-block": (props: import("./models").InfoBlockProps) => JSX.Element;
|
|
10
10
|
"table-block": (props: import("./models").TableBlockProps) => JSX.Element;
|
|
11
|
-
"tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction, }: import("./models").TabsBlockProps) => JSX.Element;
|
|
11
|
+
"tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction, contentSize, }: import("./models").TabsBlockProps) => JSX.Element;
|
|
12
12
|
"header-block": (props: import("./models").WithChildren<import("./models").HeaderBlockProps & import("./models").ClassNameProps>) => JSX.Element;
|
|
13
13
|
"icons-block": ({ title, size, items }: import("./models").IconsBlockProps) => JSX.Element;
|
|
14
14
|
"header-slider-block": ({ items, arrows, ...props }: import("./models").HeaderSliderBlockProps) => JSX.Element;
|
package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { BlockBaseFullProps } from '../../../../components/BlockBase/BlockBase';
|
|
3
|
+
import { Block, WithChildren } from '../../../../models';
|
|
4
|
+
interface ConstructorBlockProps extends Pick<BlockBaseFullProps, 'index'> {
|
|
4
5
|
data: Block;
|
|
5
6
|
}
|
|
6
7
|
export declare const ConstructorBlock: React.FC<WithChildren<ConstructorBlockProps>>;
|
|
@@ -7,4 +7,4 @@ export interface GridColumnProps extends GridColumnClassParams, Refable<HTMLDivE
|
|
|
7
7
|
dataQa?: string;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
export declare const Col: React.ForwardRefExoticComponent<Pick<WithChildren<GridColumnProps>, "style" | "children" | "className" | "
|
|
10
|
+
export declare const Col: React.ForwardRefExoticComponent<Pick<WithChildren<GridColumnProps>, "style" | "children" | "className" | "reset" | "visible" | "sizes" | "offsets" | "orders" | "hidden" | "alignSelf" | "justifyContent" | "dataQa"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -30,8 +30,6 @@ export interface Childable {
|
|
|
30
30
|
children?: SubBlock[];
|
|
31
31
|
}
|
|
32
32
|
export interface BlockBaseProps {
|
|
33
|
-
type: BlockType;
|
|
34
|
-
index?: number;
|
|
35
33
|
anchor?: AnchorProps;
|
|
36
34
|
visible?: GridColumnSize;
|
|
37
35
|
resetPaddings?: boolean;
|
|
@@ -212,6 +210,7 @@ export interface TabsBlockProps extends Animatable {
|
|
|
212
210
|
centered?: boolean;
|
|
213
211
|
direction?: MediaDirection;
|
|
214
212
|
items: TabsBlockItem[];
|
|
213
|
+
contentSize?: ContentSize;
|
|
215
214
|
}
|
|
216
215
|
export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {
|
|
217
216
|
title?: TitleItemProps | string;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
2
|
+
import { BlockType } from './constructor-items';
|
|
3
|
+
export interface BlockDecorationProps extends PropsWithChildren {
|
|
4
|
+
type: BlockType;
|
|
5
|
+
index?: number;
|
|
6
|
+
}
|
|
4
7
|
export type BlockDecorator = (props: BlockDecorationProps) => React.ReactElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TabsBlockProps } from '../../models';
|
|
2
2
|
import './Tabs.css';
|
|
3
|
-
export declare const TabsBlock: ({ items, title, description, animated, tabsColSizes, centered, direction, }: TabsBlockProps) => JSX.Element;
|
|
3
|
+
export declare const TabsBlock: ({ items, title, description, animated, tabsColSizes, centered, direction, contentSize, }: TabsBlockProps) => JSX.Element;
|
|
4
4
|
export default TabsBlock;
|
|
@@ -12,7 +12,7 @@ import { Content } from '../../sub-blocks';
|
|
|
12
12
|
import { block, getThemedValue } from '../../utils';
|
|
13
13
|
import './Tabs.css';
|
|
14
14
|
const b = block('tabs-block');
|
|
15
|
-
export const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', }) => {
|
|
15
|
+
export const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', contentSize = 's', }) => {
|
|
16
16
|
var _a;
|
|
17
17
|
const [activeTab, setActiveTab] = useState(items[0].tabName);
|
|
18
18
|
const [play, setPlay] = useState(false);
|
|
@@ -34,7 +34,7 @@ export const TabsBlock = ({ items, title, description, animated, tabsColSizes, c
|
|
|
34
34
|
React.createElement("div", { className: b('content-wrapper', {
|
|
35
35
|
margin: Boolean(((activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) || imageProps) && !isReverse),
|
|
36
36
|
}) },
|
|
37
|
-
React.createElement(Content, { title: activeTabData.title, text: activeTabData.text, additionalInfo: activeTabData.additionalInfo, size:
|
|
37
|
+
React.createElement(Content, { title: activeTabData.title, text: activeTabData.text, additionalInfo: activeTabData.additionalInfo, size: contentSize, links: [
|
|
38
38
|
...(activeTabData.link ? [activeTabData.link] : []),
|
|
39
39
|
...(activeTabData.links || []),
|
|
40
40
|
], buttons: activeTabData.buttons, colSizes: { all: 12 } }))));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import { ImageProps } from '../../components/Image/schema';
|
|
3
|
-
import { BlockBaseProps, BlockHeaderProps, LinkProps, MediaProps, containerSizesArray, mediaDirection, sizeNumber, withTheme, } from '../../schema/validators/common';
|
|
3
|
+
import { BlockBaseProps, BlockHeaderProps, LinkProps, MediaProps, containerSizesArray, contentSizes, mediaDirection, sizeNumber, withTheme, } from '../../schema/validators/common';
|
|
4
4
|
import { filteredArray } from '../../schema/validators/utils';
|
|
5
5
|
import { ContentBase } from '../../sub-blocks/Content/schema';
|
|
6
6
|
const TabsItemContentProps = _.omit(ContentBase, ['size', 'colSizes', 'centered', 'theme']);
|
|
@@ -27,6 +27,9 @@ export const TabsBlock = {
|
|
|
27
27
|
properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), BlockHeaderProps), { tabsColSizes: containerSizesArray.reduce((acc, size) => (Object.assign(Object.assign({}, acc), { [size]: sizeNumber })), {}), direction: {
|
|
28
28
|
type: 'string',
|
|
29
29
|
enum: mediaDirection,
|
|
30
|
-
}, centered: { type: 'boolean' }, items: filteredArray(tabsItem)
|
|
30
|
+
}, centered: { type: 'boolean' }, items: filteredArray(tabsItem), contentSize: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
enum: contentSizes,
|
|
33
|
+
} }),
|
|
31
34
|
},
|
|
32
35
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { BlockBaseProps, ClassNameProps } from '../../models';
|
|
2
|
+
import { BlockBaseProps, BlockDecorationProps, ClassNameProps } from '../../models';
|
|
3
3
|
import './BlockBase.css';
|
|
4
|
-
|
|
4
|
+
export type BlockBaseFullProps = BlockBaseProps & BlockDecorationProps & ClassNameProps & PropsWithChildren;
|
|
5
|
+
declare const BlockBase: (props: BlockBaseFullProps) => JSX.Element;
|
|
5
6
|
export default BlockBase;
|
|
@@ -8,7 +8,7 @@ export declare const blockMap: {
|
|
|
8
8
|
"media-block": (props: import("./models").MediaBlockProps) => JSX.Element;
|
|
9
9
|
"info-block": (props: import("./models").InfoBlockProps) => JSX.Element;
|
|
10
10
|
"table-block": (props: import("./models").TableBlockProps) => JSX.Element;
|
|
11
|
-
"tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction, }: import("./models").TabsBlockProps) => JSX.Element;
|
|
11
|
+
"tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction, contentSize, }: import("./models").TabsBlockProps) => JSX.Element;
|
|
12
12
|
"header-block": (props: import("./models").WithChildren<import("./models").HeaderBlockProps & import("./models").ClassNameProps>) => JSX.Element;
|
|
13
13
|
"icons-block": ({ title, size, items }: import("./models").IconsBlockProps) => JSX.Element;
|
|
14
14
|
"header-slider-block": ({ items, arrows, ...props }: import("./models").HeaderSliderBlockProps) => JSX.Element;
|
package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { BlockBaseFullProps } from '../../../../components/BlockBase/BlockBase';
|
|
3
|
+
import { Block, WithChildren } from '../../../../models';
|
|
4
|
+
interface ConstructorBlockProps extends Pick<BlockBaseFullProps, 'index'> {
|
|
4
5
|
data: Block;
|
|
5
6
|
}
|
|
6
7
|
export declare const ConstructorBlock: React.FC<WithChildren<ConstructorBlockProps>>;
|
|
@@ -7,4 +7,4 @@ export interface GridColumnProps extends GridColumnClassParams, Refable<HTMLDivE
|
|
|
7
7
|
dataQa?: string;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
export declare const Col: React.ForwardRefExoticComponent<Pick<WithChildren<GridColumnProps>, "style" | "children" | "className" | "
|
|
10
|
+
export declare const Col: React.ForwardRefExoticComponent<Pick<WithChildren<GridColumnProps>, "style" | "children" | "className" | "reset" | "visible" | "sizes" | "offsets" | "orders" | "hidden" | "alignSelf" | "justifyContent" | "dataQa"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -30,8 +30,6 @@ export interface Childable {
|
|
|
30
30
|
children?: SubBlock[];
|
|
31
31
|
}
|
|
32
32
|
export interface BlockBaseProps {
|
|
33
|
-
type: BlockType;
|
|
34
|
-
index?: number;
|
|
35
33
|
anchor?: AnchorProps;
|
|
36
34
|
visible?: GridColumnSize;
|
|
37
35
|
resetPaddings?: boolean;
|
|
@@ -212,6 +210,7 @@ export interface TabsBlockProps extends Animatable {
|
|
|
212
210
|
centered?: boolean;
|
|
213
211
|
direction?: MediaDirection;
|
|
214
212
|
items: TabsBlockItem[];
|
|
213
|
+
contentSize?: ContentSize;
|
|
215
214
|
}
|
|
216
215
|
export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {
|
|
217
216
|
title?: TitleItemProps | string;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
2
|
+
import { BlockType } from './constructor-items';
|
|
3
|
+
export interface BlockDecorationProps extends PropsWithChildren {
|
|
4
|
+
type: BlockType;
|
|
5
|
+
index?: number;
|
|
6
|
+
}
|
|
4
7
|
export type BlockDecorator = (props: BlockDecorationProps) => React.ReactElement;
|
package/package.json
CHANGED
|
@@ -30,8 +30,6 @@ export interface Childable {
|
|
|
30
30
|
children?: SubBlock[];
|
|
31
31
|
}
|
|
32
32
|
export interface BlockBaseProps {
|
|
33
|
-
type: BlockType;
|
|
34
|
-
index?: number;
|
|
35
33
|
anchor?: AnchorProps;
|
|
36
34
|
visible?: GridColumnSize;
|
|
37
35
|
resetPaddings?: boolean;
|
|
@@ -212,6 +210,7 @@ export interface TabsBlockProps extends Animatable {
|
|
|
212
210
|
centered?: boolean;
|
|
213
211
|
direction?: MediaDirection;
|
|
214
212
|
items: TabsBlockItem[];
|
|
213
|
+
contentSize?: ContentSize;
|
|
215
214
|
}
|
|
216
215
|
export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {
|
|
217
216
|
title?: TitleItemProps | string;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
2
|
+
import { BlockType } from './constructor-items';
|
|
3
|
+
export interface BlockDecorationProps extends PropsWithChildren {
|
|
4
|
+
type: BlockType;
|
|
5
|
+
index?: number;
|
|
6
|
+
}
|
|
4
7
|
export type BlockDecorator = (props: BlockDecorationProps) => React.ReactElement;
|