@gravity-ui/page-constructor 4.1.2 → 4.4.1
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 +7 -3
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +1 -1
- package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.css +50 -0
- package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.d.ts +2 -0
- package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +27 -0
- package/build/cjs/blocks/Questions/Questions.css +0 -48
- package/build/cjs/blocks/Questions/Questions.js +7 -27
- package/build/cjs/blocks/Questions/models.d.ts +10 -0
- package/build/cjs/blocks/Questions/models.js +13 -0
- package/build/cjs/components/BackLink/BackLink.d.ts +2 -1
- package/build/cjs/components/BackLink/BackLink.js +2 -2
- package/build/cjs/components/FileLink/FileLink.js +2 -2
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +1 -1
- package/build/cjs/components/FullscreenImage/i18n/en.json +2 -1
- package/build/cjs/components/FullscreenImage/i18n/ru.json +2 -1
- package/build/cjs/components/HTML/HTML.d.ts +3 -1
- package/build/cjs/components/HTML/HTML.js +2 -1
- package/build/cjs/components/Image/i18n/en.json +1 -1
- package/build/cjs/components/Image/i18n/ru.json +1 -1
- package/build/cjs/components/Link/Link.d.ts +2 -2
- package/build/cjs/components/Link/Link.js +6 -6
- package/build/cjs/components/Media/Media.js +1 -2
- package/build/cjs/components/Media/Video/Video.js +3 -3
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +4 -3
- package/build/cjs/components/ReactPlayer/i18n/en.json +3 -0
- package/build/cjs/components/ReactPlayer/i18n/index.d.ts +2 -0
- package/build/cjs/components/ReactPlayer/i18n/index.js +8 -0
- package/build/cjs/components/ReactPlayer/i18n/ru.json +3 -0
- package/build/cjs/components/Table/Table.js +11 -5
- package/build/cjs/components/YFMWrapper/YFMWrapper.d.ts +3 -3
- package/build/cjs/components/YFMWrapper/YFMWrapper.js +1 -1
- package/build/cjs/components/constants.d.ts +0 -4
- package/build/cjs/components/constants.js +1 -5
- package/build/cjs/grid/Col/Col.d.ts +3 -4
- package/build/cjs/grid/Col/Col.js +2 -2
- package/build/cjs/models/constructor-items/blocks.d.ts +8 -0
- package/build/cjs/models/constructor-items/common.d.ts +11 -4
- package/build/cjs/sub-blocks/Content/ContentList/ContentList.js +11 -1
- package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +1 -0
- package/build/cjs/utils/blocks.d.ts +1 -1
- package/build/cjs/utils/blocks.js +2 -2
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +7 -3
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +1 -1
- package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.css +50 -0
- package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.d.ts +3 -0
- package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +23 -0
- package/build/esm/blocks/Questions/Questions.css +0 -48
- package/build/esm/blocks/Questions/Questions.js +6 -26
- package/build/esm/blocks/Questions/models.d.ts +10 -0
- package/build/esm/blocks/Questions/models.js +10 -0
- package/build/esm/components/BackLink/BackLink.d.ts +2 -1
- package/build/esm/components/BackLink/BackLink.js +2 -2
- package/build/esm/components/FileLink/FileLink.js +2 -2
- package/build/esm/components/FullscreenImage/FullscreenImage.js +1 -1
- package/build/esm/components/FullscreenImage/i18n/en.json +2 -1
- package/build/esm/components/FullscreenImage/i18n/ru.json +2 -1
- package/build/esm/components/HTML/HTML.d.ts +3 -1
- package/build/esm/components/HTML/HTML.js +2 -1
- package/build/esm/components/Image/i18n/en.json +1 -1
- package/build/esm/components/Image/i18n/ru.json +1 -1
- package/build/esm/components/Link/Link.d.ts +2 -2
- package/build/esm/components/Link/Link.js +7 -7
- package/build/esm/components/Media/Media.js +1 -2
- package/build/esm/components/Media/Video/Video.js +3 -3
- package/build/esm/components/ReactPlayer/ReactPlayer.js +4 -3
- package/build/esm/components/ReactPlayer/i18n/en.json +3 -0
- package/build/esm/components/ReactPlayer/i18n/index.d.ts +2 -0
- package/build/esm/components/ReactPlayer/i18n/index.js +5 -0
- package/build/esm/components/ReactPlayer/i18n/ru.json +3 -0
- package/build/esm/components/Table/Table.js +11 -5
- package/build/esm/components/YFMWrapper/YFMWrapper.d.ts +3 -3
- package/build/esm/components/YFMWrapper/YFMWrapper.js +1 -1
- package/build/esm/components/constants.d.ts +0 -4
- package/build/esm/components/constants.js +0 -4
- package/build/esm/grid/Col/Col.d.ts +3 -4
- package/build/esm/grid/Col/Col.js +2 -2
- package/build/esm/models/constructor-items/blocks.d.ts +8 -0
- package/build/esm/models/constructor-items/common.d.ts +11 -4
- package/build/esm/sub-blocks/Content/ContentList/ContentList.js +11 -1
- package/build/esm/sub-blocks/LayoutItem/utils.d.ts +1 -0
- package/build/esm/utils/blocks.d.ts +1 -1
- package/build/esm/utils/blocks.js +2 -2
- package/package.json +3 -3
- package/server/components/constants.d.ts +0 -4
- package/server/components/constants.js +1 -5
- package/server/models/constructor-items/blocks.d.ts +8 -0
- package/server/models/constructor-items/common.d.ts +11 -4
- package/server/utils/blocks.d.ts +1 -1
- package/server/utils/blocks.js +2 -2
- package/widget/index.js +1 -1
|
@@ -10,6 +10,7 @@ import { PlayVideo } from '../../icons';
|
|
|
10
10
|
import { DefaultEventNames, MediaVideoControlsType, PlayButtonThemes, PlayButtonType, PredefinedEventTypes, } from '../../models';
|
|
11
11
|
import { block } from '../../utils';
|
|
12
12
|
import CustomBarControls from './CustomBarControls';
|
|
13
|
+
import i18n from './i18n';
|
|
13
14
|
import { checkYoutubeVideos } from './utils';
|
|
14
15
|
import './ReactPlayer.css';
|
|
15
16
|
const b = block('ReactPlayer');
|
|
@@ -18,7 +19,7 @@ const FPS = 60;
|
|
|
18
19
|
export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
19
20
|
const isMobile = useContext(MobileContext);
|
|
20
21
|
const { metrika } = useContext(MetrikaContext);
|
|
21
|
-
const { src, previewImgUrl, loop = false, controls = MediaVideoControlsType.Default, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, metrika: videoMetrika, analyticsEvents, height, } = props;
|
|
22
|
+
const { src, previewImgUrl, loop = false, controls = MediaVideoControlsType.Default, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, metrika: videoMetrika, analyticsEvents, height, ariaLabel, } = props;
|
|
22
23
|
const { type = PlayButtonType.Default, theme = PlayButtonThemes.Blue, text, className: buttonClassName, } = playButton || {};
|
|
23
24
|
const autoPlay = Boolean(!isMobile && !previewImgUrl && props.autoplay);
|
|
24
25
|
const mute = initiallyMuted || autoPlay;
|
|
@@ -102,7 +103,7 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
102
103
|
playButtonContent = React.createElement(Icon, { className: b('icon'), data: PlayVideo, size: 24 });
|
|
103
104
|
break;
|
|
104
105
|
}
|
|
105
|
-
return (React.createElement("button", { className: b('button', { theme, text: Boolean(text) }, buttonClassName) }, playButtonContent));
|
|
106
|
+
return (React.createElement("button", { className: b('button', { theme, text: Boolean(text) }, buttonClassName), "aria-label": i18n('play') }, playButtonContent));
|
|
106
107
|
}, [type, theme, text, buttonClassName]);
|
|
107
108
|
const changeMute = useCallback((isMuted) => {
|
|
108
109
|
if (isMuted && playerRef) {
|
|
@@ -192,7 +193,7 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
192
193
|
}, elapsedTimePercent: elapsedTimePercent }));
|
|
193
194
|
}, [controls, isPlaying, customBarControlsClassName, changeMute]);
|
|
194
195
|
return (React.createElement("div", { className: b({ wrapper: !currentHeight }, className), ref: ref, onClick: handleClick },
|
|
195
|
-
React.createElement(ReactPlayer, { className: b('player'), url: videoSrc, muted: muted, controls: controls === MediaVideoControlsType.Default, height: currentHeight || '100%', width: width || '100%', light: previewImgUrl, playing: isPlaying, playIcon: playIcon, progressInterval: FPS, onClickPreview: handleClickPreview, onStart: onStart, onReady: setPlayerRef, onPlay: onPlay, onPause: onPause, onProgress: onProgress, onEnded: onEnded }),
|
|
196
|
+
React.createElement(ReactPlayer, { className: b('player'), url: videoSrc, muted: muted, controls: controls === MediaVideoControlsType.Default, height: currentHeight || '100%', width: width || '100%', light: previewImgUrl, playing: isPlaying, playIcon: playIcon, progressInterval: FPS, onClickPreview: handleClickPreview, onStart: onStart, onReady: setPlayerRef, onPlay: onPlay, onPause: onPause, onProgress: onProgress, onEnded: onEnded, "aria-label": ariaLabel }),
|
|
196
197
|
renderCustomBarControls(muted, playedPercent)));
|
|
197
198
|
});
|
|
198
199
|
function getHeight(width) {
|
|
@@ -2,28 +2,34 @@ import React from 'react';
|
|
|
2
2
|
import { HTML, YFMWrapper } from '../';
|
|
3
3
|
import { block } from '../../utils';
|
|
4
4
|
import './Table.css';
|
|
5
|
+
function getMarkerId(index) {
|
|
6
|
+
if (isNaN(index)) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
return `marker-${index}`;
|
|
10
|
+
}
|
|
5
11
|
const b = block('table');
|
|
6
12
|
export default class Table extends React.Component {
|
|
7
13
|
render() {
|
|
8
|
-
const { content, legend, marker = 'disk', className } = this.props;
|
|
14
|
+
const { content, legend, marker = 'disk', className, caption } = this.props;
|
|
9
15
|
if (!content || !content.length || !content[0].length) {
|
|
10
16
|
return null;
|
|
11
17
|
}
|
|
12
|
-
return (React.createElement("div", { className: b(null, className) },
|
|
18
|
+
return (React.createElement("div", { className: b(null, className), role: 'table', "aria-label": caption },
|
|
13
19
|
this.renderTable(content, marker, legend),
|
|
14
20
|
legend && this.renderLegend(legend, marker)));
|
|
15
21
|
}
|
|
16
22
|
renderTable(content, marker, legend) {
|
|
17
23
|
const justify = this.getDefaultJustify(content, this.props.justify);
|
|
18
|
-
return (React.createElement("div", { className: b('table') }, content.map((row, i) => (React.createElement("div", { key: i, className: b('row') }, row.map((cell, j) => (React.createElement("div", { key: j, className: b('cell', { justify: justify[j] }) }, legend && i && j ? (this.renderMarker(marker, cell)) : (React.createElement(HTML, null, cell))))))))));
|
|
24
|
+
return (React.createElement("div", { className: b('table'), role: 'rowgroup' }, content.map((row, i) => (React.createElement("div", { key: i, className: b('row'), role: 'row' }, row.map((cell, j) => (React.createElement("div", { key: j, className: b('cell', { justify: justify[j] }), role: 'cell' }, legend && i && j ? (this.renderMarker(marker, cell)) : (React.createElement(HTML, null, cell))))))))));
|
|
19
25
|
}
|
|
20
26
|
renderMarker(type, cell) {
|
|
21
|
-
return React.createElement("div", { className: b('marker', { type, index: String(cell) }) });
|
|
27
|
+
return (React.createElement("div", { "aria-labelledby": getMarkerId(Number(cell)), className: b('marker', { type, index: String(cell) }) }));
|
|
22
28
|
}
|
|
23
29
|
renderLegend(legend, marker) {
|
|
24
30
|
return (React.createElement("div", { className: b('legend') }, legend.map((item, index) => (React.createElement("div", { key: item, className: b('legend-item') },
|
|
25
31
|
this.renderMarker(marker, String(index)),
|
|
26
|
-
React.createElement(YFMWrapper, { className: b('legent-item-text'), content: item, modifiers: { constructor: true } }))))));
|
|
32
|
+
React.createElement(YFMWrapper, { className: b('legent-item-text'), content: item, modifiers: { constructor: true }, id: getMarkerId(index) }))))));
|
|
27
33
|
}
|
|
28
34
|
getDefaultJustify(content, justify) {
|
|
29
35
|
return justify || new Array(content[0].length).fill('center');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ClassNameProps, Modifiers } from '../../models';
|
|
2
|
-
export interface YFMWrapperProps {
|
|
3
|
-
className?: string;
|
|
2
|
+
export interface YFMWrapperProps extends ClassNameProps {
|
|
4
3
|
content: string;
|
|
5
4
|
modifiers?: Modifiers;
|
|
6
5
|
itemProp?: string;
|
|
6
|
+
id?: string;
|
|
7
7
|
}
|
|
8
|
-
declare const YFMWrapper: ({ content, modifiers, className, itemProp, }: YFMWrapperProps
|
|
8
|
+
declare const YFMWrapper: ({ content, modifiers, className, itemProp, id }: YFMWrapperProps) => JSX.Element;
|
|
9
9
|
export default YFMWrapper;
|
|
@@ -5,5 +5,5 @@ import block from 'bem-cn-lite';
|
|
|
5
5
|
import toSnakeCase from 'snakecase-keys';
|
|
6
6
|
import { HTML } from '../../components';
|
|
7
7
|
const yfm = block('yfm');
|
|
8
|
-
const YFMWrapper = ({ content, modifiers, className, itemProp, }) => (React.createElement(HTML, { className: yfm(modifiers ? toSnakeCase(modifiers) : {}, className), itemProp: itemProp }, content));
|
|
8
|
+
const YFMWrapper = ({ content, modifiers, className, itemProp, id }) => (React.createElement(HTML, { className: yfm(modifiers ? toSnakeCase(modifiers) : {}, className), itemProp: itemProp, id: id }, content));
|
|
9
9
|
export default YFMWrapper;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
|
-
import { QAProps, Refable } from '../../models
|
|
3
|
-
import { WithChildren } from '../../models/react';
|
|
2
|
+
import { QAProps, Refable, Roleable, WithChildren } from '../../models';
|
|
4
3
|
import { GridColumnClassParams } from '../types';
|
|
5
|
-
export interface GridColumnProps extends GridColumnClassParams, Refable<HTMLDivElement>, QAProps {
|
|
4
|
+
export interface GridColumnProps extends GridColumnClassParams, Refable<HTMLDivElement>, QAProps, Roleable {
|
|
6
5
|
style?: CSSProperties;
|
|
7
6
|
children?: React.ReactNode;
|
|
8
7
|
}
|
|
9
|
-
export declare const Col: React.ForwardRefExoticComponent<Pick<WithChildren<GridColumnProps>, "style" | "children" | "sizes" | "className" | "hidden" | "qa" | "reset" | "visible" | "offsets" | "orders" | "alignSelf" | "justifyContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const Col: React.ForwardRefExoticComponent<Pick<WithChildren<GridColumnProps>, "style" | "children" | "sizes" | "className" | "hidden" | "role" | "qa" | "reset" | "visible" | "offsets" | "orders" | "alignSelf" | "justifyContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -2,7 +2,7 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import { getColClass } from '../utils';
|
|
4
4
|
export const Col = forwardRef((props, ref) => {
|
|
5
|
-
const { children, style, qa } = props, rest = __rest(props, ["children", "style", "qa"]);
|
|
6
|
-
return (React.createElement("div", { ref: ref, className: getColClass(rest), style: style, "data-qa": qa }, children));
|
|
5
|
+
const { children, style, qa, role } = props, rest = __rest(props, ["children", "style", "qa", "role"]);
|
|
6
|
+
return (React.createElement("div", { ref: ref, className: getColClass(rest), style: style, "data-qa": qa, role: role }, children));
|
|
7
7
|
});
|
|
8
8
|
Col.displayName = 'Col';
|
|
@@ -141,6 +141,10 @@ export interface QuestionItem {
|
|
|
141
141
|
export interface QuestionsProps extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
|
|
142
142
|
items: QuestionItem[];
|
|
143
143
|
}
|
|
144
|
+
export interface QuestionBlockItemProps extends QuestionItem {
|
|
145
|
+
isOpened: boolean;
|
|
146
|
+
onClick: () => void;
|
|
147
|
+
}
|
|
144
148
|
export interface BannerBlockProps extends BannerCardProps, Animatable {
|
|
145
149
|
}
|
|
146
150
|
export interface CompaniesBlockProps extends Animatable {
|
|
@@ -185,6 +189,10 @@ export interface TableProps {
|
|
|
185
189
|
legend?: string[];
|
|
186
190
|
justify?: Justify[];
|
|
187
191
|
marker?: LegendTableMarkerType;
|
|
192
|
+
/**
|
|
193
|
+
* Only as accessible name, not displayed explicitly
|
|
194
|
+
*/
|
|
195
|
+
caption?: string;
|
|
188
196
|
}
|
|
189
197
|
export interface TableBlockProps {
|
|
190
198
|
title: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
1
|
+
import React, { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ButtonView, ButtonProps as UikitButtonProps } from '@gravity-ui/uikit';
|
|
3
|
-
import { ThemeSupporting } from '../../utils
|
|
3
|
+
import { ThemeSupporting } from '../../utils';
|
|
4
4
|
import { AnalyticsEventsBase, ClassNameProps, PixelEventType, QAProps } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
@@ -61,6 +61,12 @@ export interface Stylable {
|
|
|
61
61
|
export interface Animatable {
|
|
62
62
|
animated?: boolean;
|
|
63
63
|
}
|
|
64
|
+
export interface Tabbable {
|
|
65
|
+
tabIndex?: number;
|
|
66
|
+
}
|
|
67
|
+
export interface Roleable {
|
|
68
|
+
role?: React.AriaRole;
|
|
69
|
+
}
|
|
64
70
|
export interface Background {
|
|
65
71
|
image?: string;
|
|
66
72
|
color?: string;
|
|
@@ -106,7 +112,7 @@ export interface MediaVideoProps extends AnalyticsEventsBase {
|
|
|
106
112
|
controls?: MediaVideoControlsType;
|
|
107
113
|
metrika?: MetrikaVideo;
|
|
108
114
|
}
|
|
109
|
-
export interface LinkProps extends AnalyticsEventsBase, Stylable {
|
|
115
|
+
export interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {
|
|
110
116
|
url: string;
|
|
111
117
|
text?: string;
|
|
112
118
|
textSize?: TextSize;
|
|
@@ -117,7 +123,7 @@ export interface LinkProps extends AnalyticsEventsBase, Stylable {
|
|
|
117
123
|
metrikaGoals?: MetrikaGoal;
|
|
118
124
|
pixelEvents?: ButtonPixel;
|
|
119
125
|
}
|
|
120
|
-
export interface FileLinkProps extends ClassNameProps {
|
|
126
|
+
export interface FileLinkProps extends ClassNameProps, Tabbable {
|
|
121
127
|
href: string;
|
|
122
128
|
text: ReactNode;
|
|
123
129
|
type?: FileLinkType;
|
|
@@ -157,6 +163,7 @@ export interface MediaVideoProps {
|
|
|
157
163
|
playButton?: PlayButtonProps;
|
|
158
164
|
controls?: MediaVideoControlsType;
|
|
159
165
|
metrika?: MetrikaVideo;
|
|
166
|
+
ariaLabel?: string;
|
|
160
167
|
}
|
|
161
168
|
export type ThemedMediaVideoProps = ThemeSupporting<MediaVideoProps>;
|
|
162
169
|
export interface MediaComponentVideoProps extends AnalyticsEventsBase {
|
|
@@ -7,6 +7,15 @@ import { useTheme } from '../../../context/theme';
|
|
|
7
7
|
import { block, getThemedValue } from '../../../utils';
|
|
8
8
|
import './ContentList.css';
|
|
9
9
|
const b = block('content-list');
|
|
10
|
+
function getHeadingLevel(size) {
|
|
11
|
+
switch (size) {
|
|
12
|
+
case 's':
|
|
13
|
+
return 'h4';
|
|
14
|
+
case 'l':
|
|
15
|
+
default:
|
|
16
|
+
return 'h3';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
10
19
|
const ContentList = ({ list, size }) => {
|
|
11
20
|
const theme = useTheme();
|
|
12
21
|
return (React.createElement("div", { className: b({ size }) }, list === null || list === void 0 ? void 0 : list.map((item) => {
|
|
@@ -16,7 +25,8 @@ const ContentList = ({ list, size }) => {
|
|
|
16
25
|
return (React.createElement("div", { className: b('item'), key: uuidv4() },
|
|
17
26
|
React.createElement(Image, Object.assign({}, iconData, { className: b('icon') })),
|
|
18
27
|
React.createElement("div", null,
|
|
19
|
-
title &&
|
|
28
|
+
title &&
|
|
29
|
+
React.createElement(getHeadingLevel(size), { className: b('title') }, title),
|
|
20
30
|
text && (React.createElement(YFMWrapper, { className: b('text'), content: text, modifiers: { constructor: true } })))));
|
|
21
31
|
})));
|
|
22
32
|
};
|
|
@@ -23,6 +23,7 @@ export declare const getLayoutItemLinks: (links: LayoutItemProps['content']['lin
|
|
|
23
23
|
target?: string | undefined;
|
|
24
24
|
}[] | undefined;
|
|
25
25
|
className?: string | undefined;
|
|
26
|
+
tabIndex?: number | undefined;
|
|
26
27
|
}[] | undefined;
|
|
27
28
|
export declare const hasFullscreen: ({ dataLens, image }: MediaProps) => boolean;
|
|
28
29
|
export declare const showFullscreenIcon: ({ youtube }: MediaProps) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConstructorBlock, CustomConfig, PCShareSocialNetwork, TextSize } from '../models';
|
|
2
|
-
export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "
|
|
2
|
+
export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "h3" | "h4";
|
|
3
3
|
export declare function hasBlockTag(content: string): boolean;
|
|
4
4
|
export declare function getBlockKey(block: ConstructorBlock, index: number): string;
|
|
5
5
|
export declare const getCustomBlockTypes: ({ blocks, headers }?: CustomConfig) => string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.4.1",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
},
|
|
104
104
|
"peerDependencies": {
|
|
105
105
|
"@doc-tools/transform": "^3.3.2",
|
|
106
|
-
"@gravity-ui/uikit": "^5.1
|
|
106
|
+
"@gravity-ui/uikit": "^5.4.1",
|
|
107
107
|
"react": "^16.0.0 || ^17.0.0 || ^18.0.0"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"@gravity-ui/prettier-config": "^1.0.1",
|
|
120
120
|
"@gravity-ui/stylelint-config": "^1.0.0",
|
|
121
121
|
"@gravity-ui/tsconfig": "^1.0.0",
|
|
122
|
-
"@gravity-ui/uikit": "^5.1
|
|
122
|
+
"@gravity-ui/uikit": "^5.4.1",
|
|
123
123
|
"@storybook/addon-actions": "^7.1.0",
|
|
124
124
|
"@storybook/addon-essentials": "^7.1.0",
|
|
125
125
|
"@storybook/addon-knobs": "^7.0.2",
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HEADER_HEIGHT = exports.
|
|
3
|
+
exports.HEADER_HEIGHT = exports.UIKIT_ROOT_CLASS = exports.DEFAULT_THEME = void 0;
|
|
4
4
|
const models_1 = require("../models");
|
|
5
5
|
exports.DEFAULT_THEME = models_1.Theme.Light;
|
|
6
6
|
exports.UIKIT_ROOT_CLASS = 'g-root';
|
|
7
|
-
exports.KEY = {
|
|
8
|
-
ENTER: 'Enter',
|
|
9
|
-
TAB: 'Tab',
|
|
10
|
-
};
|
|
11
7
|
exports.HEADER_HEIGHT = 64;
|
|
@@ -141,6 +141,10 @@ export interface QuestionItem {
|
|
|
141
141
|
export interface QuestionsProps extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
|
|
142
142
|
items: QuestionItem[];
|
|
143
143
|
}
|
|
144
|
+
export interface QuestionBlockItemProps extends QuestionItem {
|
|
145
|
+
isOpened: boolean;
|
|
146
|
+
onClick: () => void;
|
|
147
|
+
}
|
|
144
148
|
export interface BannerBlockProps extends BannerCardProps, Animatable {
|
|
145
149
|
}
|
|
146
150
|
export interface CompaniesBlockProps extends Animatable {
|
|
@@ -185,6 +189,10 @@ export interface TableProps {
|
|
|
185
189
|
legend?: string[];
|
|
186
190
|
justify?: Justify[];
|
|
187
191
|
marker?: LegendTableMarkerType;
|
|
192
|
+
/**
|
|
193
|
+
* Only as accessible name, not displayed explicitly
|
|
194
|
+
*/
|
|
195
|
+
caption?: string;
|
|
188
196
|
}
|
|
189
197
|
export interface TableBlockProps {
|
|
190
198
|
title: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
1
|
+
import React, { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ButtonView, ButtonProps as UikitButtonProps } from '@gravity-ui/uikit';
|
|
3
|
-
import { ThemeSupporting } from '../../utils
|
|
3
|
+
import { ThemeSupporting } from '../../utils';
|
|
4
4
|
import { AnalyticsEventsBase, ClassNameProps, PixelEventType, QAProps } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
@@ -61,6 +61,12 @@ export interface Stylable {
|
|
|
61
61
|
export interface Animatable {
|
|
62
62
|
animated?: boolean;
|
|
63
63
|
}
|
|
64
|
+
export interface Tabbable {
|
|
65
|
+
tabIndex?: number;
|
|
66
|
+
}
|
|
67
|
+
export interface Roleable {
|
|
68
|
+
role?: React.AriaRole;
|
|
69
|
+
}
|
|
64
70
|
export interface Background {
|
|
65
71
|
image?: string;
|
|
66
72
|
color?: string;
|
|
@@ -106,7 +112,7 @@ export interface MediaVideoProps extends AnalyticsEventsBase {
|
|
|
106
112
|
controls?: MediaVideoControlsType;
|
|
107
113
|
metrika?: MetrikaVideo;
|
|
108
114
|
}
|
|
109
|
-
export interface LinkProps extends AnalyticsEventsBase, Stylable {
|
|
115
|
+
export interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {
|
|
110
116
|
url: string;
|
|
111
117
|
text?: string;
|
|
112
118
|
textSize?: TextSize;
|
|
@@ -117,7 +123,7 @@ export interface LinkProps extends AnalyticsEventsBase, Stylable {
|
|
|
117
123
|
metrikaGoals?: MetrikaGoal;
|
|
118
124
|
pixelEvents?: ButtonPixel;
|
|
119
125
|
}
|
|
120
|
-
export interface FileLinkProps extends ClassNameProps {
|
|
126
|
+
export interface FileLinkProps extends ClassNameProps, Tabbable {
|
|
121
127
|
href: string;
|
|
122
128
|
text: ReactNode;
|
|
123
129
|
type?: FileLinkType;
|
|
@@ -157,6 +163,7 @@ export interface MediaVideoProps {
|
|
|
157
163
|
playButton?: PlayButtonProps;
|
|
158
164
|
controls?: MediaVideoControlsType;
|
|
159
165
|
metrika?: MetrikaVideo;
|
|
166
|
+
ariaLabel?: string;
|
|
160
167
|
}
|
|
161
168
|
export type ThemedMediaVideoProps = ThemeSupporting<MediaVideoProps>;
|
|
162
169
|
export interface MediaComponentVideoProps extends AnalyticsEventsBase {
|
package/server/utils/blocks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConstructorBlock, CustomConfig, PCShareSocialNetwork, TextSize } from '../models';
|
|
2
|
-
export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "
|
|
2
|
+
export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "h3" | "h4";
|
|
3
3
|
export declare function hasBlockTag(content: string): boolean;
|
|
4
4
|
export declare function getBlockKey(block: ConstructorBlock, index: number): string;
|
|
5
5
|
export declare const getCustomBlockTypes: ({ blocks, headers }?: CustomConfig) => string[];
|