@gravity-ui/blog-constructor 6.6.0 → 6.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.
@@ -25,7 +25,7 @@ const breadcrumbsGoals = (0, common_1.prepareAnalyticsEvent)({
|
|
25
25
|
});
|
26
26
|
const Meta = (props) => {
|
27
27
|
const { paddingTop = 'l', paddingBottom = 'l', theme = 'light', qa } = props;
|
28
|
-
const { post } = (0, react_1.useContext)(PostPageContext_1.PostPageContext);
|
28
|
+
const { post, breadcrumbs: customBreadcrumbs } = (0, react_1.useContext)(PostPageContext_1.PostPageContext);
|
29
29
|
const { locale } = (0, react_1.useContext)(LocaleContext_1.LocaleContext);
|
30
30
|
const qaAttributes = (0, common_1.getQaAttributes)(qa, 'post-info');
|
31
31
|
const { getBlogPath = common_1.getBlogPath } = (0, react_1.useContext)(SettingsContext_1.SettingsContext);
|
@@ -37,7 +37,7 @@ const Meta = (props) => {
|
|
37
37
|
[paddings_1.PaddingsDirections.top]: paddingTop,
|
38
38
|
[paddings_1.PaddingsDirections.bottom]: paddingBottom,
|
39
39
|
}, qa: qaAttributes.wrapper },
|
40
|
-
breadcrumbs && (react_1.default.createElement(page_constructor_1.HeaderBreadcrumbs, { items: breadcrumbs.items, className: b('breadcrumbs'), theme: theme })),
|
40
|
+
breadcrumbs && (react_1.default.createElement(page_constructor_1.HeaderBreadcrumbs, { items: (customBreadcrumbs === null || customBreadcrumbs === void 0 ? void 0 : customBreadcrumbs.items) || breadcrumbs.items, className: b('breadcrumbs'), theme: theme })),
|
41
41
|
title && (react_1.default.createElement(page_constructor_1.YFMWrapper, { content: title, modifiers: {
|
42
42
|
blogBreadcrumbs: true,
|
43
43
|
resetPaddings: true,
|
@@ -39,7 +39,7 @@ type GetBreadcrumbsProps = {
|
|
39
39
|
blogPath: string;
|
40
40
|
};
|
41
41
|
export declare const getBlogPath: (pathPrefix: string) => string;
|
42
|
-
export declare
|
42
|
+
export declare function getBreadcrumbs({ tags, blogPath }: GetBreadcrumbsProps): HeaderBreadCrumbsProps;
|
43
43
|
export declare const getMergedAnalyticsEvents: (analyticEvents: AnalyticsEventsProp, existringEvents?: AnalyticsEventsProp) => {
|
44
44
|
name: string;
|
45
45
|
type?: string | undefined;
|
@@ -60,7 +60,7 @@ const getBlogPath = (pathPrefix) => {
|
|
60
60
|
return `${prefix}/blog`;
|
61
61
|
};
|
62
62
|
exports.getBlogPath = getBlogPath;
|
63
|
-
|
63
|
+
function getBreadcrumbs({ tags, blogPath }) {
|
64
64
|
const breadcrumbs = {
|
65
65
|
items: [{ text: (0, i18n_1.i18n)(i18n_1.Keyset.TitleBreadcrumbs), url: blogPath }],
|
66
66
|
theme: 'light',
|
@@ -72,7 +72,7 @@ const getBreadcrumbs = ({ tags, blogPath }) => {
|
|
72
72
|
breadcrumbs.items.push({ text: tag.name, url: tag.url });
|
73
73
|
}
|
74
74
|
return breadcrumbs;
|
75
|
-
}
|
75
|
+
}
|
76
76
|
exports.getBreadcrumbs = getBreadcrumbs;
|
77
77
|
const getArrayOfEvents = (events) => {
|
78
78
|
if (!events) {
|
@@ -22,7 +22,7 @@ const breadcrumbsGoals = prepareAnalyticsEvent({
|
|
22
22
|
});
|
23
23
|
export const Meta = (props) => {
|
24
24
|
const { paddingTop = 'l', paddingBottom = 'l', theme = 'light', qa } = props;
|
25
|
-
const { post } = useContext(PostPageContext);
|
25
|
+
const { post, breadcrumbs: customBreadcrumbs } = useContext(PostPageContext);
|
26
26
|
const { locale } = useContext(LocaleContext);
|
27
27
|
const qaAttributes = getQaAttributes(qa, 'post-info');
|
28
28
|
const { getBlogPath = getDefaultBlogPath } = useContext(SettingsContext);
|
@@ -34,7 +34,7 @@ export const Meta = (props) => {
|
|
34
34
|
[PaddingsDirections.top]: paddingTop,
|
35
35
|
[PaddingsDirections.bottom]: paddingBottom,
|
36
36
|
}, qa: qaAttributes.wrapper },
|
37
|
-
breadcrumbs && (React.createElement(HeaderBreadcrumbs, { items: breadcrumbs.items, className: b('breadcrumbs'), theme: theme })),
|
37
|
+
breadcrumbs && (React.createElement(HeaderBreadcrumbs, { items: (customBreadcrumbs === null || customBreadcrumbs === void 0 ? void 0 : customBreadcrumbs.items) || breadcrumbs.items, className: b('breadcrumbs'), theme: theme })),
|
38
38
|
title && (React.createElement(YFMWrapper, { content: title, modifiers: {
|
39
39
|
blogBreadcrumbs: true,
|
40
40
|
resetPaddings: true,
|
@@ -39,7 +39,7 @@ type GetBreadcrumbsProps = {
|
|
39
39
|
blogPath: string;
|
40
40
|
};
|
41
41
|
export declare const getBlogPath: (pathPrefix: string) => string;
|
42
|
-
export declare
|
42
|
+
export declare function getBreadcrumbs({ tags, blogPath }: GetBreadcrumbsProps): HeaderBreadCrumbsProps;
|
43
43
|
export declare const getMergedAnalyticsEvents: (analyticEvents: AnalyticsEventsProp, existringEvents?: AnalyticsEventsProp) => {
|
44
44
|
name: string;
|
45
45
|
type?: string | undefined;
|
@@ -52,7 +52,7 @@ export const getBlogPath = (pathPrefix) => {
|
|
52
52
|
const prefix = pathPrefix ? `/${pathPrefix}` : '';
|
53
53
|
return `${prefix}/blog`;
|
54
54
|
};
|
55
|
-
export
|
55
|
+
export function getBreadcrumbs({ tags, blogPath }) {
|
56
56
|
const breadcrumbs = {
|
57
57
|
items: [{ text: i18n(Keyset.TitleBreadcrumbs), url: blogPath }],
|
58
58
|
theme: 'light',
|
@@ -64,7 +64,7 @@ export const getBreadcrumbs = ({ tags, blogPath }) => {
|
|
64
64
|
breadcrumbs.items.push({ text: tag.name, url: tag.url });
|
65
65
|
}
|
66
66
|
return breadcrumbs;
|
67
|
-
}
|
67
|
+
}
|
68
68
|
const getArrayOfEvents = (events) => {
|
69
69
|
if (!events) {
|
70
70
|
return [];
|