@gravity-ui/page-constructor 1.15.0-alpha.21 → 1.15.0-alpha.23
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 +88 -0
- package/README.md +3 -15
- package/build/cjs/blocks/Banner/schema.d.ts +0 -9
- package/build/cjs/blocks/Banner/schema.js +1 -3
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +78 -0
- package/build/cjs/blocks/Header/schema.d.ts +0 -156
- package/build/cjs/blocks/Header/schema.js +0 -4
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +0 -78
- package/build/cjs/blocks/Info/schema.d.ts +0 -3
- package/build/cjs/blocks/Info/schema.js +0 -2
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +1 -2
- package/build/cjs/blocks/Preview/schema.d.ts +0 -3
- package/build/cjs/blocks/Preview/schema.js +1 -3
- package/build/cjs/blocks/Security/schema.d.ts +0 -3
- package/build/cjs/blocks/Security/schema.js +1 -3
- package/build/cjs/blocks/Slider/Arrow/Arrow.js +2 -2
- package/build/cjs/blocks/Slider/Slider.css +0 -4
- package/build/cjs/blocks/Tabs/schema.d.ts +78 -0
- package/build/cjs/components/BackLink/BackLink.d.ts +0 -1
- package/build/cjs/components/BackLink/BackLink.js +4 -2
- package/build/cjs/components/Button/Button.js +1 -4
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +0 -1
- package/build/cjs/components/CardBase/CardBase.d.ts +2 -4
- package/build/cjs/components/Foldable/Foldable.css +4 -1
- package/build/cjs/components/Foldable/Foldable.js +7 -10
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +8 -6
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.css +70 -0
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.d.ts +9 -0
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.js +40 -0
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +30 -0
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +7 -2
- package/build/cjs/components/HeightCalculator/HeightCalculator.d.ts +4 -0
- package/build/cjs/components/HeightCalculator/HeightCalculator.js +4 -0
- package/build/cjs/components/Link/Link.js +1 -1
- package/build/cjs/components/Media/Media.js +3 -2
- package/build/cjs/components/MetaInfo/MetaInfo.css +13 -0
- package/build/cjs/components/MetaInfo/MetaInfo.d.ts +6 -0
- package/build/cjs/components/MetaInfo/MetaInfo.js +8 -0
- package/build/cjs/components/MetaInfo/schema.d.ts +8 -0
- package/build/cjs/components/MetaInfo/schema.js +10 -0
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.d.ts +1 -0
- package/build/cjs/components/VideoBlock/VideoBlock.js +6 -10
- package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -4
- package/build/cjs/components/YandexForm/YandexForm.js +2 -2
- package/build/cjs/components/index.d.ts +2 -0
- package/build/cjs/components/index.js +5 -1
- package/build/cjs/constructor-items.d.ts +4 -0
- package/build/cjs/constructor-items.js +4 -0
- package/build/cjs/containers/PageConstructor/PageConstructor.css +1 -0
- package/build/cjs/hooks/useHeightCalculator.d.ts +6 -0
- package/build/cjs/hooks/useHeightCalculator.js +27 -0
- package/build/cjs/models/common.d.ts +3 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +0 -10
- package/build/cjs/models/constructor-items/common.d.ts +6 -30
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +18 -7
- package/build/cjs/models/constructor-items/sub-blocks.js +4 -0
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +5 -3
- package/build/cjs/schema/index.js +1 -0
- package/build/cjs/schema/validators/common.d.ts +78 -0
- package/build/cjs/schema/validators/common.js +2 -0
- package/build/cjs/schema/validators/sub-blocks.d.ts +1 -0
- package/build/cjs/schema/validators/sub-blocks.js +1 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +0 -3
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +0 -2
- package/build/cjs/sub-blocks/BannerCard/BannerCard.js +2 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +14 -9
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +1 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.js +26 -8
- package/build/cjs/sub-blocks/HubspotForm/index.js +5 -3
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +16 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +3 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +21 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +218 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.js +18 -0
- package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +29 -0
- package/build/cjs/sub-blocks/LayoutItem/utils.js +12 -0
- package/build/cjs/sub-blocks/Quote/Quote.js +2 -2
- package/build/cjs/sub-blocks/Quote/schema.d.ts +0 -3
- package/build/cjs/sub-blocks/Quote/schema.js +1 -3
- package/build/cjs/sub-blocks/index.d.ts +1 -0
- package/build/cjs/sub-blocks/index.js +3 -1
- package/build/cjs/text-transform/blocks.js +17 -0
- package/build/cjs/utils/hubspot.d.ts +2 -1
- package/build/cjs/utils/hubspot.js +5 -1
- package/build/esm/blocks/Banner/schema.d.ts +0 -9
- package/build/esm/blocks/Banner/schema.js +1 -3
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +78 -0
- package/build/esm/blocks/Header/schema.d.ts +0 -156
- package/build/esm/blocks/Header/schema.js +0 -4
- package/build/esm/blocks/HeaderSlider/schema.d.ts +0 -78
- package/build/esm/blocks/Info/schema.d.ts +0 -3
- package/build/esm/blocks/Info/schema.js +0 -2
- package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +1 -2
- package/build/esm/blocks/Preview/schema.d.ts +0 -3
- package/build/esm/blocks/Preview/schema.js +1 -3
- package/build/esm/blocks/Security/schema.d.ts +0 -3
- package/build/esm/blocks/Security/schema.js +1 -3
- package/build/esm/blocks/Slider/Arrow/Arrow.js +2 -2
- package/build/esm/blocks/Slider/Slider.css +0 -4
- package/build/esm/blocks/Tabs/schema.d.ts +78 -0
- package/build/esm/components/BackLink/BackLink.d.ts +0 -1
- package/build/esm/components/BackLink/BackLink.js +4 -2
- package/build/esm/components/Button/Button.js +1 -4
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +0 -1
- package/build/esm/components/CardBase/CardBase.d.ts +2 -4
- package/build/esm/components/Foldable/Foldable.css +4 -1
- package/build/esm/components/Foldable/Foldable.js +8 -11
- package/build/esm/components/FullscreenImage/FullscreenImage.js +9 -7
- package/build/esm/components/FullscreenMedia/FullScreenMedia.css +70 -0
- package/build/esm/components/FullscreenMedia/FullScreenMedia.d.ts +10 -0
- package/build/esm/components/FullscreenMedia/FullScreenMedia.js +38 -0
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +30 -0
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +7 -2
- package/build/esm/components/HeightCalculator/HeightCalculator.d.ts +4 -0
- package/build/esm/components/HeightCalculator/HeightCalculator.js +4 -0
- package/build/esm/components/Link/Link.js +1 -1
- package/build/esm/components/Media/Media.js +3 -2
- package/build/esm/components/MetaInfo/MetaInfo.css +13 -0
- package/build/esm/components/MetaInfo/MetaInfo.d.ts +7 -0
- package/build/esm/components/MetaInfo/MetaInfo.js +6 -0
- package/build/esm/components/MetaInfo/schema.d.ts +8 -0
- package/build/esm/components/MetaInfo/schema.js +8 -0
- package/build/esm/components/ReactPlayer/ReactPlayer.js +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.d.ts +1 -0
- package/build/esm/components/VideoBlock/VideoBlock.js +6 -10
- package/build/esm/components/YandexForm/YandexForm.d.ts +2 -4
- package/build/esm/components/YandexForm/YandexForm.js +2 -2
- package/build/esm/components/index.d.ts +2 -0
- package/build/esm/components/index.js +2 -0
- package/build/esm/constructor-items.d.ts +4 -0
- package/build/esm/constructor-items.js +5 -1
- package/build/esm/containers/PageConstructor/PageConstructor.css +1 -0
- package/build/esm/hooks/useHeightCalculator.d.ts +6 -0
- package/build/esm/hooks/useHeightCalculator.js +24 -0
- package/build/esm/models/common.d.ts +3 -0
- package/build/esm/models/constructor-items/blocks.d.ts +0 -10
- package/build/esm/models/constructor-items/common.d.ts +6 -30
- package/build/esm/models/constructor-items/sub-blocks.d.ts +18 -7
- package/build/esm/models/constructor-items/sub-blocks.js +4 -0
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +5 -3
- package/build/esm/schema/index.js +1 -0
- package/build/esm/schema/validators/common.d.ts +78 -0
- package/build/esm/schema/validators/common.js +2 -0
- package/build/esm/schema/validators/sub-blocks.d.ts +1 -0
- package/build/esm/schema/validators/sub-blocks.js +1 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +0 -3
- package/build/esm/sub-blocks/BackgroundCard/schema.js +0 -2
- package/build/esm/sub-blocks/BannerCard/BannerCard.js +3 -2
- package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +14 -9
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +1 -1
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.js +26 -8
- package/build/esm/sub-blocks/HubspotForm/index.js +5 -3
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +16 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +4 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +20 -0
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +218 -0
- package/build/esm/sub-blocks/LayoutItem/schema.js +14 -0
- package/build/esm/sub-blocks/LayoutItem/utils.d.ts +29 -0
- package/build/esm/sub-blocks/LayoutItem/utils.js +6 -0
- package/build/esm/sub-blocks/Quote/Quote.js +2 -2
- package/build/esm/sub-blocks/Quote/schema.d.ts +0 -3
- package/build/esm/sub-blocks/Quote/schema.js +1 -3
- package/build/esm/sub-blocks/index.d.ts +1 -0
- package/build/esm/sub-blocks/index.js +1 -0
- package/build/esm/text-transform/blocks.js +17 -0
- package/build/esm/utils/hubspot.d.ts +2 -1
- package/build/esm/utils/hubspot.js +5 -1
- package/package.json +5 -2
- package/server/models/common.d.ts +3 -0
- package/server/models/constructor-items/blocks.d.ts +0 -10
- package/server/models/constructor-items/common.d.ts +6 -30
- package/server/models/constructor-items/sub-blocks.d.ts +18 -7
- package/server/models/constructor-items/sub-blocks.js +4 -0
- package/server/text-transform/blocks.js +17 -0
- package/server/utils/hubspot.d.ts +2 -1
- package/server/utils/hubspot.js +5 -1
- package/styles/root.scss +1 -0
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.css +0 -30
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.d.ts +0 -12
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.js +0 -28
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.css +0 -30
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.d.ts +0 -13
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.js +0 -25
|
@@ -3,7 +3,7 @@ import { ThemeSupporting } from '../../utils';
|
|
|
3
3
|
import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
|
|
4
4
|
import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, LinkProps, MediaProps, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
|
|
5
5
|
import { ContentBlockProps } from './blocks';
|
|
6
|
-
import {
|
|
6
|
+
import { AnalyticsEventsBase, PixelEvent } from '../common';
|
|
7
7
|
export declare enum SubBlockType {
|
|
8
8
|
Divider = "divider",
|
|
9
9
|
Quote = "quote",
|
|
@@ -19,7 +19,11 @@ export declare enum SubBlockType {
|
|
|
19
19
|
* @deprecated Will be moved to params use BasicCard instead
|
|
20
20
|
*/
|
|
21
21
|
TutorialCard = "tutoral-card",
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use LayoutItem
|
|
24
|
+
*/
|
|
22
25
|
CardWithImage = "card-with-image",
|
|
26
|
+
LayoutItem = "layout-item",
|
|
23
27
|
BackgroundCard = "background-card",
|
|
24
28
|
BasicCard = "basic-card",
|
|
25
29
|
Content = "content",
|
|
@@ -34,7 +38,7 @@ export interface DividerProps {
|
|
|
34
38
|
size?: DividerSize;
|
|
35
39
|
border?: boolean;
|
|
36
40
|
}
|
|
37
|
-
export interface HubspotFormProps extends HubspotEventHandlers {
|
|
41
|
+
export interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsBase {
|
|
38
42
|
className?: string;
|
|
39
43
|
theme?: ContentTheme;
|
|
40
44
|
isMobile?: boolean;
|
|
@@ -61,8 +65,7 @@ export interface HubspotFormProps extends HubspotEventHandlers {
|
|
|
61
65
|
onLoad?: (arg: HubspotEventData) => void;
|
|
62
66
|
pixelEvents?: string | string[] | PixelEvent | PixelEvent[] | ButtonPixel;
|
|
63
67
|
hubspotEvents?: string[];
|
|
64
|
-
|
|
65
|
-
context?: string;
|
|
68
|
+
createDOMElement?: boolean;
|
|
66
69
|
}
|
|
67
70
|
export interface PartnerProps extends CardBaseProps {
|
|
68
71
|
text: string;
|
|
@@ -78,7 +81,6 @@ export interface QuoteProps extends Themable, CardBaseProps {
|
|
|
78
81
|
author?: AuthorItem;
|
|
79
82
|
buttonText?: string;
|
|
80
83
|
theme?: TextTheme;
|
|
81
|
-
context?: string;
|
|
82
84
|
}
|
|
83
85
|
export interface NewsCardData {
|
|
84
86
|
id: number;
|
|
@@ -113,7 +115,6 @@ export interface BannerCardProps {
|
|
|
113
115
|
color?: ThemeSupporting<string>;
|
|
114
116
|
theme?: TextTheme;
|
|
115
117
|
button: Pick<ButtonProps, 'text' | 'url' | 'target'>;
|
|
116
|
-
context?: string;
|
|
117
118
|
}
|
|
118
119
|
export interface MediaCardProps extends MediaProps, CardBaseProps {
|
|
119
120
|
}
|
|
@@ -121,7 +122,7 @@ export interface CardWithImageLinkProps extends Omit<LinkProps, 'text' | 'url'>
|
|
|
121
122
|
title: string;
|
|
122
123
|
link: string;
|
|
123
124
|
}
|
|
124
|
-
export interface CardWithImageProps extends ClassNameProps, Pick<ContentBlockProps, 'title' | 'additionalInfo' | 'buttons' | 'theme'
|
|
125
|
+
export interface CardWithImageProps extends ClassNameProps, Pick<ContentBlockProps, 'title' | 'additionalInfo' | 'buttons' | 'theme'> {
|
|
125
126
|
image: string;
|
|
126
127
|
description?: string;
|
|
127
128
|
disableCompress?: boolean;
|
|
@@ -129,6 +130,13 @@ export interface CardWithImageProps extends ClassNameProps, Pick<ContentBlockPro
|
|
|
129
130
|
fullScreen?: boolean;
|
|
130
131
|
links?: CardWithImageLinkProps[];
|
|
131
132
|
}
|
|
133
|
+
export interface LayoutItemProps extends ClassNameProps {
|
|
134
|
+
content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size'>;
|
|
135
|
+
media: MediaProps;
|
|
136
|
+
metaInfo?: string[];
|
|
137
|
+
border?: boolean;
|
|
138
|
+
fullScreen?: boolean;
|
|
139
|
+
}
|
|
132
140
|
export type DividerModel = {
|
|
133
141
|
type: SubBlockType.Divider;
|
|
134
142
|
} & DividerProps;
|
|
@@ -141,6 +149,9 @@ export type NewsCardModel = {
|
|
|
141
149
|
export type CardWithImageModel = {
|
|
142
150
|
type: SubBlockType.CardWithImage;
|
|
143
151
|
} & CardWithImageProps;
|
|
152
|
+
export type LayoutItemModel = {
|
|
153
|
+
type: SubBlockType.CardWithImage;
|
|
154
|
+
} & LayoutItemProps;
|
|
144
155
|
export type TutorialCardModel = {
|
|
145
156
|
type: SubBlockType.TutorialCard;
|
|
146
157
|
} & TutorialCardProps;
|
|
@@ -17,7 +17,11 @@ var SubBlockType;
|
|
|
17
17
|
* @deprecated Will be moved to params use BasicCard instead
|
|
18
18
|
*/
|
|
19
19
|
SubBlockType["TutorialCard"] = "tutoral-card";
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use LayoutItem
|
|
22
|
+
*/
|
|
20
23
|
SubBlockType["CardWithImage"] = "card-with-image";
|
|
24
|
+
SubBlockType["LayoutItem"] = "layout-item";
|
|
21
25
|
SubBlockType["BackgroundCard"] = "background-card";
|
|
22
26
|
SubBlockType["BasicCard"] = "basic-card";
|
|
23
27
|
SubBlockType["Content"] = "content";
|
|
@@ -157,6 +157,23 @@ const config = {
|
|
|
157
157
|
transformer: typografTransformer,
|
|
158
158
|
},
|
|
159
159
|
],
|
|
160
|
+
[models_1.SubBlockType.LayoutItem]: [
|
|
161
|
+
{
|
|
162
|
+
fields: ['content'],
|
|
163
|
+
parser: parseContentLayout,
|
|
164
|
+
transformer: yfmTransformer,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
fields: ['content'],
|
|
168
|
+
parser: parseContentLayoutTitle,
|
|
169
|
+
transformer: typografTransformer,
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
fields: ['metaInfo'],
|
|
173
|
+
parser: (0, exports.createItemsParser)([]),
|
|
174
|
+
transformer: typografTransformer,
|
|
175
|
+
},
|
|
176
|
+
],
|
|
160
177
|
[models_1.SubBlockType.Quote]: {
|
|
161
178
|
fields: ['text'],
|
|
162
179
|
transformer: typografTransformer,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type HubspotEventName = 'onBeforeFormInit' | 'onFormReady' | 'onFormSubmit' | 'onFormSubmitted' | `_${string}`;
|
|
1
|
+
export type HubspotEventName = 'onBeforeFormInit' | 'onFormReady' | 'onFormSubmit' | 'onFormSubmitted' | 'onFormError' | `_${string}`;
|
|
2
2
|
export interface HubspotEventData {
|
|
3
3
|
type: HubspotEventName | string;
|
|
4
4
|
eventName: HubspotEventName;
|
|
@@ -11,6 +11,7 @@ export interface HubspotEventHandlers {
|
|
|
11
11
|
onBeforeSubmit?: (arg: HubspotEventData) => void;
|
|
12
12
|
onSubmit?: (arg: HubspotEventData) => void;
|
|
13
13
|
onLoad?: (arg: HubspotEventData) => void;
|
|
14
|
+
onSubmitError?: (arg: HubspotEventData) => void;
|
|
14
15
|
}
|
|
15
16
|
export declare function loopBackHabspotEvents(formId: string): ({ data, source, origin }: MessageEvent) => void;
|
|
16
17
|
export declare function handleHubspotEvents(handlers: HubspotEventHandlers, formId: string): ({ data }: MessageEvent) => void;
|
package/server/utils/hubspot.js
CHANGED
|
@@ -25,7 +25,7 @@ function loopBackHabspotEvents(formId) {
|
|
|
25
25
|
exports.loopBackHabspotEvents = loopBackHabspotEvents;
|
|
26
26
|
function handleHubspotEvents(handlers, formId) {
|
|
27
27
|
return ({ data }) => {
|
|
28
|
-
var _a, _b, _c, _d;
|
|
28
|
+
var _a, _b, _c, _d, _e;
|
|
29
29
|
if (!isHubspotEventData(data)) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
@@ -49,6 +49,10 @@ function handleHubspotEvents(handlers, formId) {
|
|
|
49
49
|
(_d = handlers.onSubmit) === null || _d === void 0 ? void 0 : _d.call(handlers, data);
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
|
+
case 'onFormError': {
|
|
53
|
+
(_e = handlers.onSubmitError) === null || _e === void 0 ? void 0 : _e.call(handlers, data);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
52
56
|
default:
|
|
53
57
|
break;
|
|
54
58
|
}
|
package/styles/root.scss
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
--pc-monochrome-button-background-color-hover: #393939;
|
|
18
18
|
--pc-monochrome-button-color: var(--yc-color-text-light-primary);
|
|
19
19
|
--pc-text-header-color: var(--yc-color-text-primary);
|
|
20
|
+
--pc-media-card-meta-info-color: var(--yc-color-text-secondary);
|
|
20
21
|
|
|
21
22
|
&.yc-root_theme_dark {
|
|
22
23
|
--pc-color-sfx-shadow: var(--yc-color-sfx-shadow);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
@charset "UTF-8";
|
|
2
|
-
/* use this for style redefinitions to awoid problems with
|
|
3
|
-
unpredictable css rules order in build */
|
|
4
|
-
.pc-header-breadcrumbs-item__item {
|
|
5
|
-
display: inline-block;
|
|
6
|
-
}
|
|
7
|
-
.pc-header-breadcrumbs-item__text {
|
|
8
|
-
font-size: var(--yc-text-body-2-font-size);
|
|
9
|
-
line-height: var(--yc-text-body-2-line-height);
|
|
10
|
-
outline: none;
|
|
11
|
-
color: var(--yc-color-text-link);
|
|
12
|
-
text-decoration: none;
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
color: var(--yc-color-text-secondary);
|
|
15
|
-
}
|
|
16
|
-
.utilityfocus .pc-header-breadcrumbs-item__text:focus {
|
|
17
|
-
outline: 2px solid #ffdb4d;
|
|
18
|
-
}
|
|
19
|
-
.pc-header-breadcrumbs-item__text:hover, .pc-header-breadcrumbs-item__text:active {
|
|
20
|
-
--pc-text-header-color: var(--yc-color-text-link-hover);
|
|
21
|
-
color: var(--yc-color-text-link-hover);
|
|
22
|
-
}
|
|
23
|
-
.pc-header-breadcrumbs-item__text:after {
|
|
24
|
-
content: " / ";
|
|
25
|
-
margin: 0 8px 0 6px;
|
|
26
|
-
color: var(--yc-color-text-secondary);
|
|
27
|
-
}
|
|
28
|
-
.pc-header-breadcrumbs-item__text:hover {
|
|
29
|
-
color: var(--yc-color-text-primary);
|
|
30
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { AnalyticsEvent, ButtonPixel, MetrikaGoal } from '../../models';
|
|
3
|
-
type HeaderBreadcrumbsItemProps = {
|
|
4
|
-
url: string;
|
|
5
|
-
text: ReactNode;
|
|
6
|
-
metrikaGoals?: MetrikaGoal;
|
|
7
|
-
pixelEvents?: ButtonPixel;
|
|
8
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
9
|
-
context?: string;
|
|
10
|
-
};
|
|
11
|
-
export default function HeaderBreadcrumbsItem({ url, text, metrikaGoals, pixelEvents, analyticsEvents, }: HeaderBreadcrumbsItemProps): JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
-
const utils_1 = require("../../utils");
|
|
6
|
-
const models_1 = require("../../models");
|
|
7
|
-
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
8
|
-
const hooks_1 = require("../../hooks");
|
|
9
|
-
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
10
|
-
const b = (0, utils_1.block)('header-breadcrumbs-item');
|
|
11
|
-
function HeaderBreadcrumbsItem({ url, text, metrikaGoals, pixelEvents, analyticsEvents, }) {
|
|
12
|
-
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
13
|
-
const context = (0, react_1.useContext)(blockPositionContext_1.BlockPositionContext);
|
|
14
|
-
const defaultEvent = (0, react_1.useMemo)(() => ({
|
|
15
|
-
name: 'header-breadcrumbs-click',
|
|
16
|
-
type: models_1.PredefinedEventTypes.Default,
|
|
17
|
-
context: context,
|
|
18
|
-
target: url,
|
|
19
|
-
}), [context, url]);
|
|
20
|
-
const handleAnalytics = (0, hooks_1.useAnalytics)(defaultEvent);
|
|
21
|
-
const onClick = () => {
|
|
22
|
-
handleMetrika({ metrikaGoals, pixelEvents });
|
|
23
|
-
handleAnalytics(analyticsEvents);
|
|
24
|
-
};
|
|
25
|
-
return (react_1.default.createElement("div", { className: b('item'), key: url },
|
|
26
|
-
react_1.default.createElement("a", { href: url, className: b('text'), onClick: onClick }, text)));
|
|
27
|
-
}
|
|
28
|
-
exports.default = HeaderBreadcrumbsItem;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
@charset "UTF-8";
|
|
2
|
-
/* use this for style redefinitions to awoid problems with
|
|
3
|
-
unpredictable css rules order in build */
|
|
4
|
-
.pc-header-breadcrumbs-item__item {
|
|
5
|
-
display: inline-block;
|
|
6
|
-
}
|
|
7
|
-
.pc-header-breadcrumbs-item__text {
|
|
8
|
-
font-size: var(--yc-text-body-2-font-size);
|
|
9
|
-
line-height: var(--yc-text-body-2-line-height);
|
|
10
|
-
outline: none;
|
|
11
|
-
color: var(--yc-color-text-link);
|
|
12
|
-
text-decoration: none;
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
color: var(--yc-color-text-secondary);
|
|
15
|
-
}
|
|
16
|
-
.utilityfocus .pc-header-breadcrumbs-item__text:focus {
|
|
17
|
-
outline: 2px solid #ffdb4d;
|
|
18
|
-
}
|
|
19
|
-
.pc-header-breadcrumbs-item__text:hover, .pc-header-breadcrumbs-item__text:active {
|
|
20
|
-
--pc-text-header-color: var(--yc-color-text-link-hover);
|
|
21
|
-
color: var(--yc-color-text-link-hover);
|
|
22
|
-
}
|
|
23
|
-
.pc-header-breadcrumbs-item__text:after {
|
|
24
|
-
content: " / ";
|
|
25
|
-
margin: 0 8px 0 6px;
|
|
26
|
-
color: var(--yc-color-text-secondary);
|
|
27
|
-
}
|
|
28
|
-
.pc-header-breadcrumbs-item__text:hover {
|
|
29
|
-
color: var(--yc-color-text-primary);
|
|
30
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { AnalyticsEvent, ButtonPixel, MetrikaGoal } from '../../models';
|
|
3
|
-
import './HeaderBreadcrumbsItem.css';
|
|
4
|
-
type HeaderBreadcrumbsItemProps = {
|
|
5
|
-
url: string;
|
|
6
|
-
text: ReactNode;
|
|
7
|
-
metrikaGoals?: MetrikaGoal;
|
|
8
|
-
pixelEvents?: ButtonPixel;
|
|
9
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
10
|
-
context?: string;
|
|
11
|
-
};
|
|
12
|
-
export default function HeaderBreadcrumbsItem({ url, text, metrikaGoals, pixelEvents, analyticsEvents, }: HeaderBreadcrumbsItemProps): JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, { useContext, useMemo } from 'react';
|
|
2
|
-
import { block } from '../../utils';
|
|
3
|
-
import { PredefinedEventTypes } from '../../models';
|
|
4
|
-
import { useMetrika } from '../../hooks/useMetrika';
|
|
5
|
-
import { useAnalytics } from '../../hooks';
|
|
6
|
-
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
7
|
-
import './HeaderBreadcrumbsItem.css';
|
|
8
|
-
const b = block('header-breadcrumbs-item');
|
|
9
|
-
export default function HeaderBreadcrumbsItem({ url, text, metrikaGoals, pixelEvents, analyticsEvents, }) {
|
|
10
|
-
const handleMetrika = useMetrika();
|
|
11
|
-
const context = useContext(BlockPositionContext);
|
|
12
|
-
const defaultEvent = useMemo(() => ({
|
|
13
|
-
name: 'header-breadcrumbs-click',
|
|
14
|
-
type: PredefinedEventTypes.Default,
|
|
15
|
-
context: context,
|
|
16
|
-
target: url,
|
|
17
|
-
}), [context, url]);
|
|
18
|
-
const handleAnalytics = useAnalytics(defaultEvent);
|
|
19
|
-
const onClick = () => {
|
|
20
|
-
handleMetrika({ metrikaGoals, pixelEvents });
|
|
21
|
-
handleAnalytics(analyticsEvents);
|
|
22
|
-
};
|
|
23
|
-
return (React.createElement("div", { className: b('item'), key: url },
|
|
24
|
-
React.createElement("a", { href: url, className: b('text'), onClick: onClick }, text)));
|
|
25
|
-
}
|