@gravity-ui/page-constructor 3.0.0-alpha.1 → 3.0.0-alpha.2
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/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +1 -1
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +2 -2
- package/build/cjs/blocks/Slider/Slider.js +2 -2
- package/build/cjs/blocks/Tabs/Tabs.js +2 -2
- package/build/cjs/components/MediaBase/MediaBase.js +2 -2
- package/build/cjs/components/Title/Title.css +8 -103
- package/build/cjs/components/Title/Title.d.ts +5 -8
- package/build/cjs/components/Title/Title.js +15 -50
- package/build/cjs/components/Title/TitleItem.css +111 -0
- package/build/cjs/components/Title/TitleItem.d.ts +10 -0
- package/build/cjs/components/Title/TitleItem.js +57 -0
- package/build/cjs/components/index.d.ts +1 -1
- package/build/cjs/components/index.js +4 -4
- package/build/cjs/models/constructor-items/blocks.d.ts +8 -8
- package/build/cjs/models/constructor-items/common.d.ts +4 -4
- package/build/cjs/sub-blocks/Content/Content.js +3 -3
- package/build/cjs/text-transform/config.d.ts +2 -2
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +2 -2
- package/build/esm/blocks/Slider/Slider.js +2 -2
- package/build/esm/blocks/Tabs/Tabs.js +2 -2
- package/build/esm/components/MediaBase/MediaBase.js +2 -2
- package/build/esm/components/Title/Title.css +8 -103
- package/build/esm/components/Title/Title.d.ts +5 -8
- package/build/esm/components/Title/Title.js +17 -49
- package/build/esm/components/Title/TitleItem.css +111 -0
- package/build/esm/components/Title/TitleItem.d.ts +11 -0
- package/build/esm/components/Title/TitleItem.js +53 -0
- package/build/esm/components/index.d.ts +1 -1
- package/build/esm/components/index.js +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +8 -8
- package/build/esm/models/constructor-items/common.d.ts +4 -4
- package/build/esm/sub-blocks/Content/Content.js +3 -3
- package/build/esm/text-transform/config.d.ts +2 -2
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +8 -8
- package/server/models/constructor-items/common.d.ts +4 -4
- package/server/text-transform/config.d.ts +2 -2
- package/build/cjs/components/BlockHeader/BlockHeader.css +0 -16
- package/build/cjs/components/BlockHeader/BlockHeader.d.ts +0 -7
- package/build/cjs/components/BlockHeader/BlockHeader.js +0 -22
- package/build/esm/components/BlockHeader/BlockHeader.css +0 -16
- package/build/esm/components/BlockHeader/BlockHeader.d.ts +0 -8
- package/build/esm/components/BlockHeader/BlockHeader.js +0 -21
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ButtonSize } from '@gravity-ui/uikit';
|
|
3
3
|
import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
|
|
4
4
|
import { ThemeSupporting } from '../../utils';
|
|
5
|
-
import { AnchorProps, Animatable, BackgroundImageProps,
|
|
5
|
+
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, TitleProps } from './common';
|
|
6
6
|
import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
7
7
|
export declare enum BlockType {
|
|
8
8
|
PromoFeaturesBlock = "promo-features-block",
|
|
@@ -69,7 +69,7 @@ export interface SliderProps extends Childable, Animatable, LoadableChildren {
|
|
|
69
69
|
text: string;
|
|
70
70
|
size?: TextSize;
|
|
71
71
|
};
|
|
72
|
-
title?:
|
|
72
|
+
title?: TitleItemBaseProps;
|
|
73
73
|
description?: string;
|
|
74
74
|
autoplay?: number;
|
|
75
75
|
randomOrder?: boolean;
|
|
@@ -120,7 +120,7 @@ export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' |
|
|
|
120
120
|
}
|
|
121
121
|
export interface ExtendedFeaturesProps extends Animatable {
|
|
122
122
|
items: ExtendedFeaturesItem[];
|
|
123
|
-
title?:
|
|
123
|
+
title?: TitleItemProps | string;
|
|
124
124
|
description?: string;
|
|
125
125
|
colSizes?: GridColumnSizesType;
|
|
126
126
|
}
|
|
@@ -132,7 +132,7 @@ export interface PromoFeaturesItem {
|
|
|
132
132
|
}
|
|
133
133
|
export interface PromoFeaturesProps extends Animatable {
|
|
134
134
|
items: PromoFeaturesItem[];
|
|
135
|
-
title?:
|
|
135
|
+
title?: TitleItemProps | string;
|
|
136
136
|
description?: string;
|
|
137
137
|
theme?: 'grey' | 'default';
|
|
138
138
|
}
|
|
@@ -207,14 +207,14 @@ export interface TabsBlockItem extends Omit<ContentBlockProps, 'size' | 'colSize
|
|
|
207
207
|
caption?: string;
|
|
208
208
|
media?: ThemedMediaProps;
|
|
209
209
|
}
|
|
210
|
-
export interface TabsBlockProps extends
|
|
210
|
+
export interface TabsBlockProps extends TitleProps, Animatable {
|
|
211
211
|
tabsColSizes?: GridColumnSizesType;
|
|
212
212
|
centered?: boolean;
|
|
213
213
|
direction?: MediaDirection;
|
|
214
214
|
items: TabsBlockItem[];
|
|
215
215
|
}
|
|
216
216
|
export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {
|
|
217
|
-
title:
|
|
217
|
+
title: TitleItemProps | string;
|
|
218
218
|
description?: string;
|
|
219
219
|
colSizes?: GridColumnSizesType;
|
|
220
220
|
}
|
|
@@ -227,7 +227,7 @@ export type FilterItem = {
|
|
|
227
227
|
card: SubBlockModels;
|
|
228
228
|
};
|
|
229
229
|
export interface FilterBlockProps extends Animatable, LoadableChildren {
|
|
230
|
-
title?:
|
|
230
|
+
title?: TitleItemProps | string;
|
|
231
231
|
description?: string;
|
|
232
232
|
tags: FilterTag[];
|
|
233
233
|
items: FilterItem[];
|
|
@@ -257,7 +257,7 @@ export interface ContentLayoutBlockProps {
|
|
|
257
257
|
fileContent?: FileLinkProps[];
|
|
258
258
|
}
|
|
259
259
|
export interface ContentBlockProps {
|
|
260
|
-
title?:
|
|
260
|
+
title?: TitleItemBaseProps | string;
|
|
261
261
|
text?: string;
|
|
262
262
|
additionalInfo?: string;
|
|
263
263
|
links?: LinkProps[];
|
|
@@ -249,11 +249,11 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
|
|
|
249
249
|
metrikaGoals?: MetrikaGoal;
|
|
250
250
|
pixelEvents?: ButtonPixel;
|
|
251
251
|
}
|
|
252
|
-
export interface
|
|
252
|
+
export interface TitleItemProps extends Justifyable, TitleItemBaseProps {
|
|
253
253
|
navTitle?: string;
|
|
254
254
|
anchor?: string;
|
|
255
255
|
}
|
|
256
|
-
export interface
|
|
256
|
+
export interface TitleItemBaseProps {
|
|
257
257
|
text: string;
|
|
258
258
|
textSize?: TextSize;
|
|
259
259
|
url?: string;
|
|
@@ -334,8 +334,8 @@ export interface AuthorProps {
|
|
|
334
334
|
type?: AuthorType;
|
|
335
335
|
dataQa?: string;
|
|
336
336
|
}
|
|
337
|
-
export interface
|
|
338
|
-
title?:
|
|
337
|
+
export interface TitleProps {
|
|
338
|
+
title?: TitleItemProps | string;
|
|
339
339
|
description?: string;
|
|
340
340
|
}
|
|
341
341
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TitleItemProps } from '../models';
|
|
2
2
|
import { Parser, Transformer, TransformerRaw, typografTransformer, yfmTransformer } from './common';
|
|
3
3
|
export declare const blockHeaderTransformer: ({
|
|
4
4
|
fields: string[];
|
|
5
5
|
transformer: typeof typografTransformer;
|
|
6
|
-
parser: (transformer: Transformer, title:
|
|
6
|
+
parser: (transformer: Transformer, title: TitleItemProps | string) => string | {
|
|
7
7
|
text: string;
|
|
8
8
|
navTitle?: string | undefined;
|
|
9
9
|
anchor?: string | undefined;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* use this for style redefinitions to awoid problems with
|
|
2
|
-
unpredictable css rules order in build */
|
|
3
|
-
.pc-block-header__description {
|
|
4
|
-
margin-top: 12px;
|
|
5
|
-
}
|
|
6
|
-
.pc-block-header__description .yfm {
|
|
7
|
-
font-size: var(--yc-text-body-3-font-size);
|
|
8
|
-
line-height: var(--yc-text-body-3-line-height);
|
|
9
|
-
}
|
|
10
|
-
.pc-block-header__description_titleSize_s, .pc-block-header__description_titleSize_xs {
|
|
11
|
-
margin-top: 8px;
|
|
12
|
-
}
|
|
13
|
-
.pc-block-header__description_titleSize_s .yfm, .pc-block-header__description_titleSize_xs .yfm {
|
|
14
|
-
font-size: var(--yc-text-body-2-font-size);
|
|
15
|
-
line-height: var(--yc-text-body-2-line-height);
|
|
16
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GridColumnSizesType } from '../../grid';
|
|
2
|
-
import { BlockHeaderProps as BlockHeaderParams, ClassNameProps } from '../../models';
|
|
3
|
-
export interface BlockHeaderProps extends BlockHeaderParams {
|
|
4
|
-
colSizes?: GridColumnSizesType;
|
|
5
|
-
}
|
|
6
|
-
declare const BlockHeader: ({ title, description, className, colSizes, }: BlockHeaderProps & ClassNameProps) => JSX.Element | null;
|
|
7
|
-
export default BlockHeader;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
-
const __1 = require("../");
|
|
6
|
-
const grid_1 = require("../../grid");
|
|
7
|
-
const utils_1 = require("../../utils");
|
|
8
|
-
const YFMWrapper_1 = tslib_1.__importDefault(require("../YFMWrapper/YFMWrapper"));
|
|
9
|
-
const b = (0, utils_1.block)('block-header');
|
|
10
|
-
const BlockHeader = ({ title, description, className, colSizes = { all: 12, sm: 8 }, }) => {
|
|
11
|
-
if (!title && !description) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
const _a = !title || typeof title === 'string' ? { text: title } : title, { text } = _a, titleProps = tslib_1.__rest(_a, ["text"]);
|
|
15
|
-
return (react_1.default.createElement("div", { className: b(null, className) },
|
|
16
|
-
text && (react_1.default.createElement(grid_1.Col, { reset: true, sizes: colSizes },
|
|
17
|
-
react_1.default.createElement(__1.Title, Object.assign({ text: text }, titleProps)))),
|
|
18
|
-
description && (react_1.default.createElement(grid_1.Col, { reset: true, sizes: colSizes },
|
|
19
|
-
react_1.default.createElement("div", { className: b('description', { titleSize: titleProps === null || titleProps === void 0 ? void 0 : titleProps.textSize }) },
|
|
20
|
-
react_1.default.createElement(YFMWrapper_1.default, { content: description, modifiers: { constructor: true } }))))));
|
|
21
|
-
};
|
|
22
|
-
exports.default = BlockHeader;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* use this for style redefinitions to awoid problems with
|
|
2
|
-
unpredictable css rules order in build */
|
|
3
|
-
.pc-block-header__description {
|
|
4
|
-
margin-top: 12px;
|
|
5
|
-
}
|
|
6
|
-
.pc-block-header__description .yfm {
|
|
7
|
-
font-size: var(--yc-text-body-3-font-size);
|
|
8
|
-
line-height: var(--yc-text-body-3-line-height);
|
|
9
|
-
}
|
|
10
|
-
.pc-block-header__description_titleSize_s, .pc-block-header__description_titleSize_xs {
|
|
11
|
-
margin-top: 8px;
|
|
12
|
-
}
|
|
13
|
-
.pc-block-header__description_titleSize_s .yfm, .pc-block-header__description_titleSize_xs .yfm {
|
|
14
|
-
font-size: var(--yc-text-body-2-font-size);
|
|
15
|
-
line-height: var(--yc-text-body-2-line-height);
|
|
16
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GridColumnSizesType } from '../../grid';
|
|
2
|
-
import { BlockHeaderProps as BlockHeaderParams, ClassNameProps } from '../../models';
|
|
3
|
-
import './BlockHeader.css';
|
|
4
|
-
export interface BlockHeaderProps extends BlockHeaderParams {
|
|
5
|
-
colSizes?: GridColumnSizesType;
|
|
6
|
-
}
|
|
7
|
-
declare const BlockHeader: ({ title, description, className, colSizes, }: BlockHeaderProps & ClassNameProps) => JSX.Element | null;
|
|
8
|
-
export default BlockHeader;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Title } from '../';
|
|
4
|
-
import { Col } from '../../grid';
|
|
5
|
-
import { block } from '../../utils';
|
|
6
|
-
import YFMWrapper from '../YFMWrapper/YFMWrapper';
|
|
7
|
-
import './BlockHeader.css';
|
|
8
|
-
const b = block('block-header');
|
|
9
|
-
const BlockHeader = ({ title, description, className, colSizes = { all: 12, sm: 8 }, }) => {
|
|
10
|
-
if (!title && !description) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
const _a = !title || typeof title === 'string' ? { text: title } : title, { text } = _a, titleProps = __rest(_a, ["text"]);
|
|
14
|
-
return (React.createElement("div", { className: b(null, className) },
|
|
15
|
-
text && (React.createElement(Col, { reset: true, sizes: colSizes },
|
|
16
|
-
React.createElement(Title, Object.assign({ text: text }, titleProps)))),
|
|
17
|
-
description && (React.createElement(Col, { reset: true, sizes: colSizes },
|
|
18
|
-
React.createElement("div", { className: b('description', { titleSize: titleProps === null || titleProps === void 0 ? void 0 : titleProps.textSize }) },
|
|
19
|
-
React.createElement(YFMWrapper, { content: description, modifiers: { constructor: true } }))))));
|
|
20
|
-
};
|
|
21
|
-
export default BlockHeader;
|