@doyourjob/gravity-ui-page-constructor 5.31.157 → 5.31.158
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/Header/Header.js +11 -2
- package/build/cjs/models/constructor-items/blocks.d.ts +4 -0
- package/build/esm/blocks/Header/Header.js +11 -2
- package/build/esm/models/constructor-items/blocks.d.ts +4 -0
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +4 -0
- package/widget/index.js +1 -1
|
@@ -30,7 +30,7 @@ const Background = ({ background, isMobile }) => {
|
|
|
30
30
|
const FullWidthBackground = ({ background }) => (react_1.default.createElement("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background === null || background === void 0 ? void 0 : background.color } }));
|
|
31
31
|
// eslint-disable-next-line complexity
|
|
32
32
|
const HeaderBlock = (props) => {
|
|
33
|
-
const { title, switchingTitle, topTags, bottomTags, overtitle, description, buttons, stock, stockPrice, stockShares, image, video, width = 's', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, renderTitle, children, mediaView = 'full', backgroundEffect, headerSpace, } = props;
|
|
33
|
+
const { title, switchingTitle, topTags, bottomTags, overtitle, description, buttons, stock, stockPrice, stockShares, image, video, width = 's', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, renderTitle, children, mediaView = 'full', backgroundEffect, headerSpace, backLink, } = props;
|
|
34
34
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
35
35
|
const { backButton, blockTag } = (0, react_1.useContext)(headerContext_1.HeaderContext);
|
|
36
36
|
const theme = (0, theme_1.useTheme)();
|
|
@@ -44,6 +44,15 @@ const HeaderBlock = (props) => {
|
|
|
44
44
|
const fullWidth = (backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.fullWidth) || (backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.fullWidthMedia);
|
|
45
45
|
const titleId = (0, uikit_1.useUniqId)();
|
|
46
46
|
const headerRef = (0, react_1.useRef)(null);
|
|
47
|
+
const backButtonItem = (0, react_1.useMemo)(() => {
|
|
48
|
+
if (backLink) {
|
|
49
|
+
return { link: backLink.url, text: backLink.title };
|
|
50
|
+
}
|
|
51
|
+
if (verticalOffset !== '0' && !breadcrumbs) {
|
|
52
|
+
return backButton;
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
}, [backButton, backLink, breadcrumbs, verticalOffset]);
|
|
47
56
|
return (react_1.default.createElement("header", { ref: headerRef, className: b({
|
|
48
57
|
['has-media']: hasRightSideImage,
|
|
49
58
|
['full-width']: fullWidth,
|
|
@@ -56,7 +65,7 @@ const HeaderBlock = (props) => {
|
|
|
56
65
|
backgroundEffect && backgroundEffect.firstSrc && backgroundEffect.secondSrc && (react_1.default.createElement(components_1.BackgroundEffect, Object.assign({}, backgroundEffect, { attachRef: headerRef }))),
|
|
57
66
|
react_1.default.createElement(grid_1.Grid, { containerClass: b('container-fluid') },
|
|
58
67
|
react_1.default.createElement(Breadcrumbs_1.default, { breadcrumbs: breadcrumbs, theme: textTheme }),
|
|
59
|
-
react_1.default.createElement(BackButton_1.default, { backButton:
|
|
68
|
+
react_1.default.createElement(BackButton_1.default, { backButton: backButtonItem, theme: textTheme }),
|
|
60
69
|
react_1.default.createElement(grid_1.Row, null,
|
|
61
70
|
react_1.default.createElement(grid_1.Col, { reset: true, className: b('content-wrapper') },
|
|
62
71
|
react_1.default.createElement(grid_1.Row, null,
|
|
@@ -209,6 +209,10 @@ export interface HeaderBlockProps {
|
|
|
209
209
|
theme?: 'light' | 'dark';
|
|
210
210
|
verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';
|
|
211
211
|
breadcrumbs?: HeaderBreadCrumbsProps;
|
|
212
|
+
backLink?: {
|
|
213
|
+
url: string;
|
|
214
|
+
title: string;
|
|
215
|
+
};
|
|
212
216
|
status?: JSX.Element;
|
|
213
217
|
renderTitle?: (title: string) => React.ReactNode;
|
|
214
218
|
backgroundEffect?: {
|
|
@@ -27,7 +27,7 @@ const Background = ({ background, isMobile }) => {
|
|
|
27
27
|
const FullWidthBackground = ({ background }) => (React.createElement("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background === null || background === void 0 ? void 0 : background.color } }));
|
|
28
28
|
// eslint-disable-next-line complexity
|
|
29
29
|
export const HeaderBlock = (props) => {
|
|
30
|
-
const { title, switchingTitle, topTags, bottomTags, overtitle, description, buttons, stock, stockPrice, stockShares, image, video, width = 's', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, renderTitle, children, mediaView = 'full', backgroundEffect, headerSpace, } = props;
|
|
30
|
+
const { title, switchingTitle, topTags, bottomTags, overtitle, description, buttons, stock, stockPrice, stockShares, image, video, width = 's', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, renderTitle, children, mediaView = 'full', backgroundEffect, headerSpace, backLink, } = props;
|
|
31
31
|
const isMobile = useContext(MobileContext);
|
|
32
32
|
const { backButton, blockTag } = useContext(HeaderContext);
|
|
33
33
|
const theme = useTheme();
|
|
@@ -41,6 +41,15 @@ export const HeaderBlock = (props) => {
|
|
|
41
41
|
const fullWidth = (backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.fullWidth) || (backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.fullWidthMedia);
|
|
42
42
|
const titleId = useUniqId();
|
|
43
43
|
const headerRef = useRef(null);
|
|
44
|
+
const backButtonItem = useMemo(() => {
|
|
45
|
+
if (backLink) {
|
|
46
|
+
return { link: backLink.url, text: backLink.title };
|
|
47
|
+
}
|
|
48
|
+
if (verticalOffset !== '0' && !breadcrumbs) {
|
|
49
|
+
return backButton;
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
}, [backButton, backLink, breadcrumbs, verticalOffset]);
|
|
44
53
|
return (React.createElement("header", { ref: headerRef, className: b({
|
|
45
54
|
['has-media']: hasRightSideImage,
|
|
46
55
|
['full-width']: fullWidth,
|
|
@@ -53,7 +62,7 @@ export const HeaderBlock = (props) => {
|
|
|
53
62
|
backgroundEffect && backgroundEffect.firstSrc && backgroundEffect.secondSrc && (React.createElement(BackgroundEffect, Object.assign({}, backgroundEffect, { attachRef: headerRef }))),
|
|
54
63
|
React.createElement(Grid, { containerClass: b('container-fluid') },
|
|
55
64
|
React.createElement(Breadcrumbs, { breadcrumbs: breadcrumbs, theme: textTheme }),
|
|
56
|
-
React.createElement(BackButton, { backButton:
|
|
65
|
+
React.createElement(BackButton, { backButton: backButtonItem, theme: textTheme }),
|
|
57
66
|
React.createElement(Row, null,
|
|
58
67
|
React.createElement(Col, { reset: true, className: b('content-wrapper') },
|
|
59
68
|
React.createElement(Row, null,
|
|
@@ -209,6 +209,10 @@ export interface HeaderBlockProps {
|
|
|
209
209
|
theme?: 'light' | 'dark';
|
|
210
210
|
verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';
|
|
211
211
|
breadcrumbs?: HeaderBreadCrumbsProps;
|
|
212
|
+
backLink?: {
|
|
213
|
+
url: string;
|
|
214
|
+
title: string;
|
|
215
|
+
};
|
|
212
216
|
status?: JSX.Element;
|
|
213
217
|
renderTitle?: (title: string) => React.ReactNode;
|
|
214
218
|
backgroundEffect?: {
|
package/package.json
CHANGED
|
@@ -209,6 +209,10 @@ export interface HeaderBlockProps {
|
|
|
209
209
|
theme?: 'light' | 'dark';
|
|
210
210
|
verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';
|
|
211
211
|
breadcrumbs?: HeaderBreadCrumbsProps;
|
|
212
|
+
backLink?: {
|
|
213
|
+
url: string;
|
|
214
|
+
title: string;
|
|
215
|
+
};
|
|
212
216
|
status?: JSX.Element;
|
|
213
217
|
renderTitle?: (title: string) => React.ReactNode;
|
|
214
218
|
backgroundEffect?: {
|