@gravity-ui/page-constructor 1.15.0-alpha.22 → 1.15.0-alpha.24
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 -35
- package/build/cjs/blocks/Share/Share.js +1 -7
- package/build/cjs/blocks/Slider/Arrow/Arrow.js +2 -2
- package/build/cjs/blocks/Slider/Slider.css +0 -4
- package/build/cjs/components/BackLink/BackLink.js +2 -9
- package/build/cjs/components/Button/Button.d.ts +0 -1
- package/build/cjs/components/Button/Button.js +1 -9
- package/build/cjs/components/CardBase/CardBase.js +1 -8
- 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/HeightCalculator/HeightCalculator.d.ts +4 -0
- package/build/cjs/components/HeightCalculator/HeightCalculator.js +4 -0
- package/build/cjs/components/Link/Link.js +1 -8
- 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 +2 -8
- 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.js +1 -7
- 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/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +6 -4
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -2
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +2 -4
- package/build/cjs/context/blockIdContext/blockIdContext.d.ts +3 -0
- package/build/cjs/context/{blockPositionContext/blockPositionContext.js → blockIdContext/blockIdContext.js} +2 -2
- package/build/cjs/context/blockIdContext/index.d.ts +1 -0
- package/build/cjs/context/{blockPositionContext → blockIdContext}/index.js +1 -1
- package/build/cjs/hooks/index.d.ts +1 -0
- package/build/cjs/hooks/index.js +1 -0
- package/build/cjs/hooks/useAnalyticsEvent.d.ts +7 -0
- package/build/cjs/hooks/useAnalyticsEvent.js +16 -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 +11 -0
- package/build/cjs/models/common.js +13 -1
- package/build/cjs/models/constructor-items/common.d.ts +1 -19
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +15 -0
- package/build/cjs/models/constructor-items/sub-blocks.js +4 -0
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +4 -5
- package/build/cjs/schema/index.js +1 -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/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 -9
- 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 +28 -0
- package/build/cjs/sub-blocks/LayoutItem/utils.js +12 -0
- package/build/cjs/sub-blocks/Quote/Quote.js +1 -8
- 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/analytics.d.ts +2 -0
- package/build/cjs/utils/analytics.js +17 -0
- package/build/cjs/utils/blocks.d.ts +0 -7
- package/build/cjs/utils/blocks.js +1 -5
- package/build/cjs/utils/hubspot.d.ts +2 -1
- package/build/cjs/utils/hubspot.js +5 -1
- package/build/cjs/utils/index.d.ts +1 -0
- package/build/cjs/utils/index.js +1 -0
- package/build/esm/blocks/Share/Share.js +4 -10
- package/build/esm/blocks/Slider/Arrow/Arrow.js +2 -2
- package/build/esm/blocks/Slider/Slider.css +0 -4
- package/build/esm/components/BackLink/BackLink.js +4 -11
- package/build/esm/components/Button/Button.d.ts +0 -1
- package/build/esm/components/Button/Button.js +4 -12
- package/build/esm/components/CardBase/CardBase.js +4 -11
- 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/HeightCalculator/HeightCalculator.d.ts +4 -0
- package/build/esm/components/HeightCalculator/HeightCalculator.js +4 -0
- package/build/esm/components/Link/Link.js +4 -11
- 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 +3 -9
- 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.js +4 -10
- 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/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +7 -5
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -2
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +2 -4
- package/build/esm/context/blockIdContext/blockIdContext.d.ts +3 -0
- package/build/esm/context/blockIdContext/blockIdContext.js +2 -0
- package/build/esm/context/blockIdContext/index.d.ts +1 -0
- package/build/esm/context/blockIdContext/index.js +1 -0
- package/build/esm/hooks/index.d.ts +1 -0
- package/build/esm/hooks/index.js +1 -0
- package/build/esm/hooks/useAnalyticsEvent.d.ts +7 -0
- package/build/esm/hooks/useAnalyticsEvent.js +12 -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 +11 -0
- package/build/esm/models/common.js +12 -0
- package/build/esm/models/constructor-items/common.d.ts +1 -19
- package/build/esm/models/constructor-items/sub-blocks.d.ts +15 -0
- package/build/esm/models/constructor-items/sub-blocks.js +4 -0
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +4 -5
- package/build/esm/schema/index.js +1 -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/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 +7 -11
- 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 +28 -0
- package/build/esm/sub-blocks/LayoutItem/utils.js +6 -0
- package/build/esm/sub-blocks/Quote/Quote.js +4 -11
- 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/analytics.d.ts +2 -0
- package/build/esm/utils/analytics.js +13 -0
- package/build/esm/utils/blocks.d.ts +0 -7
- package/build/esm/utils/blocks.js +0 -3
- package/build/esm/utils/hubspot.d.ts +2 -1
- package/build/esm/utils/hubspot.js +5 -1
- package/build/esm/utils/index.d.ts +1 -0
- package/build/esm/utils/index.js +1 -0
- package/package.json +5 -2
- package/server/models/common.d.ts +11 -0
- package/server/models/common.js +13 -1
- package/server/models/constructor-items/common.d.ts +1 -19
- package/server/models/constructor-items/sub-blocks.d.ts +15 -0
- package/server/models/constructor-items/sub-blocks.js +4 -0
- package/server/text-transform/blocks.js +17 -0
- package/server/utils/analytics.d.ts +2 -0
- package/server/utils/analytics.js +17 -0
- package/server/utils/blocks.d.ts +0 -7
- package/server/utils/blocks.js +1 -5
- package/server/utils/hubspot.d.ts +2 -1
- package/server/utils/hubspot.js +5 -1
- package/server/utils/index.d.ts +1 -0
- package/server/utils/index.js +1 -0
- package/styles/root.scss +1 -0
- package/build/cjs/context/blockPositionContext/blockPositionContext.d.ts +0 -3
- package/build/cjs/context/blockPositionContext/index.d.ts +0 -1
- package/build/esm/context/blockPositionContext/blockPositionContext.d.ts +0 -3
- package/build/esm/context/blockPositionContext/blockPositionContext.js +0 -2
- package/build/esm/context/blockPositionContext/index.d.ts +0 -1
- package/build/esm/context/blockPositionContext/index.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,93 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.16.2](https://github.com/gravity-ui/page-constructor/compare/v1.16.1...v1.16.2) (2023-02-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **HubspotForm:** required checkbox ([#154](https://github.com/gravity-ui/page-constructor/issues/154)) ([6c948d1](https://github.com/gravity-ui/page-constructor/commit/6c948d1a3511e16902e6808d83ac3f0ac14b6d9c))
|
|
9
|
+
|
|
10
|
+
## [1.16.1](https://github.com/gravity-ui/page-constructor/compare/v1.16.0...v1.16.1) (2023-02-14)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* youtube dimensions ratio for large screens ([#151](https://github.com/gravity-ui/page-constructor/issues/151)) ([5ee3c9c](https://github.com/gravity-ui/page-constructor/commit/5ee3c9cabe641bd437a02d137528424df7fd2c5a))
|
|
16
|
+
|
|
17
|
+
## [1.16.0](https://github.com/gravity-ui/page-constructor/compare/v1.15.4...v1.16.0) (2023-02-14)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **HubspotForm:** add render outside virtual dom ([#138](https://github.com/gravity-ui/page-constructor/issues/138)) ([1b8694c](https://github.com/gravity-ui/page-constructor/commit/1b8694c6893df63ffabab84779febad57362804c))
|
|
23
|
+
|
|
24
|
+
## [1.15.4](https://github.com/gravity-ui/page-constructor/compare/v1.15.3...v1.15.4) (2023-02-13)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* freeze-es-5-ext ([#146](https://github.com/gravity-ui/page-constructor/issues/146)) ([72ca5f9](https://github.com/gravity-ui/page-constructor/commit/72ca5f90dee5b3a45d895695416b3398a46973b4))
|
|
30
|
+
|
|
31
|
+
## [1.15.3](https://github.com/gravity-ui/page-constructor/compare/v1.15.2...v1.15.3) (2023-02-10)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* fullscreen icon hide ([#141](https://github.com/gravity-ui/page-constructor/issues/141)) ([dfec755](https://github.com/gravity-ui/page-constructor/commit/dfec75544102299d0f82b72dbb5f334759a63cb0))
|
|
37
|
+
|
|
38
|
+
## [1.15.2](https://github.com/gravity-ui/page-constructor/compare/v1.15.1...v1.15.2) (2023-02-10)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
* add layout item to card stories ([#143](https://github.com/gravity-ui/page-constructor/issues/143)) ([078c7f2](https://github.com/gravity-ui/page-constructor/commit/078c7f24e1e6a620ad57b929f08dd703092463f5))
|
|
44
|
+
|
|
45
|
+
## [1.15.1](https://github.com/gravity-ui/page-constructor/compare/v1.15.0...v1.15.1) (2023-02-10)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Bug Fixes
|
|
49
|
+
|
|
50
|
+
* change meta info tag to h4 ([#140](https://github.com/gravity-ui/page-constructor/issues/140)) ([8cd84bd](https://github.com/gravity-ui/page-constructor/commit/8cd84bd5e313b41caf240b1ff155a9698ec9c17a))
|
|
51
|
+
|
|
52
|
+
## [1.15.0](https://github.com/gravity-ui/page-constructor/compare/v1.14.4...v1.15.0) (2023-02-10)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Features
|
|
56
|
+
|
|
57
|
+
* add handler for submit error in hubspot forms ([#135](https://github.com/gravity-ui/page-constructor/issues/135)) ([5f9b7a8](https://github.com/gravity-ui/page-constructor/commit/5f9b7a89996b0d2237d62ffccbea6d08f19a8d35))
|
|
58
|
+
|
|
59
|
+
## [1.14.4](https://github.com/gravity-ui/page-constructor/compare/v1.14.3...v1.14.4) (2023-02-10)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Bug Fixes
|
|
63
|
+
|
|
64
|
+
* changelog ([#136](https://github.com/gravity-ui/page-constructor/issues/136)) ([a07c738](https://github.com/gravity-ui/page-constructor/commit/a07c738e09898a952e63e1f0712cc9a31076cc1c))
|
|
65
|
+
|
|
66
|
+
## [1.14.3](https://github.com/gravity-ui/page-constructor/compare/v1.14.2...v1.14.3) (2023-02-10)
|
|
67
|
+
|
|
68
|
+
### Features
|
|
69
|
+
|
|
70
|
+
* LayoutItem was added and CardWithImage was deprecated ([#132](https://github.com/gravity-ui/page-constructor/issues/132))([4abebb5](https://github.com/gravity-ui/page-constructor/commit/4abebb573e12d0976d61541e2f33c17f3d25453a))
|
|
71
|
+
|
|
72
|
+
### Bug Fixes
|
|
73
|
+
|
|
74
|
+
* remove unused card types ([#130](https://github.com/gravity-ui/page-constructor/issues/130)) ([22da2fa](https://github.com/gravity-ui/page-constructor/commit/22da2fadd433e12e84cf8afd238c369cff5f2c24))
|
|
75
|
+
|
|
76
|
+
## [1.14.2](https://github.com/gravity-ui/page-constructor/compare/v1.14.1...v1.14.2) (2023-02-02)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Bug Fixes
|
|
80
|
+
|
|
81
|
+
* **HubspotForm:** border-radius ([#128](https://github.com/gravity-ui/page-constructor/issues/128)) ([437344b](https://github.com/gravity-ui/page-constructor/commit/437344b510cbde11bdf6e3a3ceb914fb0818a016))
|
|
82
|
+
|
|
83
|
+
## [1.14.1](https://github.com/gravity-ui/page-constructor/compare/v1.14.0...v1.14.1) (2023-02-01)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### Bug Fixes
|
|
87
|
+
|
|
88
|
+
* enable addons menu by default ([7772a55](https://github.com/gravity-ui/page-constructor/commit/7772a554950643d7cdbb86a8dedade6f916ae176))
|
|
89
|
+
* **Storybook:** fix links ([#123](https://github.com/gravity-ui/page-constructor/issues/123)) ([10cfe80](https://github.com/gravity-ui/page-constructor/commit/10cfe8054178bd577014dfff83033ff0c0dd9add))
|
|
90
|
+
|
|
3
91
|
## [1.14.0](https://github.com/gravity-ui/page-constructor/compare/v1.13.2...v1.14.0) (2023-01-25)
|
|
4
92
|
|
|
5
93
|
|
package/README.md
CHANGED
|
@@ -82,18 +82,6 @@ interface SSR {
|
|
|
82
82
|
isServer?: boolean;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
type AnalyticsCounters = {
|
|
86
|
-
include?: string[];
|
|
87
|
-
exclude?: string[];
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
type AnalyticsEvent<T = {}> = T & {
|
|
91
|
-
name: string;
|
|
92
|
-
type?: string;
|
|
93
|
-
counters?: AnalyticsCounters;
|
|
94
|
-
context?: string;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
85
|
interface NavigationData {
|
|
98
86
|
logo: NavigationLogo;
|
|
99
87
|
header: HeaderData;
|
|
@@ -244,11 +232,6 @@ function sendEvents(events: MyEventType []) {
|
|
|
244
232
|
An event object has only one required field - `name`. It also has predefined fields, which serve to help manage complex logic. For example, `counter.include` can help to send event in a particular counter if several analytics systems are used in a project.
|
|
245
233
|
|
|
246
234
|
```ts
|
|
247
|
-
type AnalyticsCounters = {
|
|
248
|
-
include?: string[];
|
|
249
|
-
exclude?: string[];
|
|
250
|
-
};
|
|
251
|
-
|
|
252
235
|
type AnalyticsEvent<T = {}> = T & {
|
|
253
236
|
name: string;
|
|
254
237
|
type?: string;
|
|
@@ -261,7 +244,7 @@ It is possible to configure an event type needed for a project.
|
|
|
261
244
|
|
|
262
245
|
```ts
|
|
263
246
|
type MyEventType = AnalyticsEvent<{
|
|
264
|
-
|
|
247
|
+
[key: string]?: string; // only a 'string' type is supported
|
|
265
248
|
}>;
|
|
266
249
|
```
|
|
267
250
|
|
|
@@ -271,8 +254,8 @@ It is possible to configure an event to which an analytics system to sent.
|
|
|
271
254
|
|
|
272
255
|
```ts
|
|
273
256
|
type AnalyticsCounters = {
|
|
274
|
-
include?: string[];
|
|
275
|
-
exclude?: string[];
|
|
257
|
+
include?: string[]; // array of analytics counter ids that will be applied
|
|
258
|
+
exclude?: string[]; // array of analytics counter ids that will not be applied
|
|
276
259
|
};
|
|
277
260
|
```
|
|
278
261
|
|
|
@@ -283,21 +266,6 @@ Pass `context` value to define place in a project where an event is fired.
|
|
|
283
266
|
Use selector below or create logic that serves project needs.
|
|
284
267
|
|
|
285
268
|
```ts
|
|
286
|
-
// utils.ts
|
|
287
|
-
const isCounterAllowed = (counter: Counter, counters?: AnalyticsCounters) => {
|
|
288
|
-
if (!counters) {
|
|
289
|
-
return true;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
if (counters.exclude?.includes(counter)) {
|
|
293
|
-
return false;
|
|
294
|
-
} else if (counters.include?.includes(counter)) {
|
|
295
|
-
return true;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
return false;
|
|
299
|
-
};
|
|
300
|
-
|
|
301
269
|
// analyticsHandler.ts
|
|
302
270
|
if (isCounterAllowed(counterName, counters)) {
|
|
303
271
|
analyticsCounter.reachGoal(counterName, name, parameters);
|
|
@@ -6,7 +6,6 @@ const uikit_1 = require("@gravity-ui/uikit");
|
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const models_1 = require("../../models");
|
|
8
8
|
const locationContext_1 = require("../../context/locationContext");
|
|
9
|
-
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
10
9
|
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
11
10
|
const hooks_1 = require("../../hooks");
|
|
12
11
|
const Facebook_1 = require("../../icons/Facebook");
|
|
@@ -24,12 +23,7 @@ const icons = {
|
|
|
24
23
|
const b = (0, utils_1.block)('share-block');
|
|
25
24
|
const Share = ({ items, title }) => {
|
|
26
25
|
const { pathname, hostname } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
27
|
-
const
|
|
28
|
-
const defaultEvent = (0, react_1.useMemo)(() => ({
|
|
29
|
-
name: 'share-button-click',
|
|
30
|
-
type: models_1.PredefinedEventTypes.Default,
|
|
31
|
-
context,
|
|
32
|
-
}), [context]);
|
|
26
|
+
const defaultEvent = (0, hooks_1.useAnalyticsEvent)(models_1.DefaultEventNames.ShareButton);
|
|
33
27
|
const handleAnalytics = (0, hooks_1.useAnalytics)(defaultEvent);
|
|
34
28
|
const handleButtonClick = (0, react_1.useCallback)(() => handleAnalytics(), [handleAnalytics]);
|
|
35
29
|
return (react_1.default.createElement("div", { className: b() },
|
|
@@ -5,8 +5,8 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
5
5
|
const utils_1 = require("../../../utils");
|
|
6
6
|
const ToggleArrow_1 = tslib_1.__importDefault(require("../../../components/ToggleArrow/ToggleArrow"));
|
|
7
7
|
const b = (0, utils_1.block)('slider-block-arrow');
|
|
8
|
-
const Arrow = ({ type, handleClick, className, size = 16 }) => (react_1.default.createElement("div", { className: b({ type }, className)
|
|
9
|
-
react_1.default.createElement("button", { className: b('button') },
|
|
8
|
+
const Arrow = ({ type, handleClick, className, size = 16 }) => (react_1.default.createElement("div", { className: b({ type }, className) },
|
|
9
|
+
react_1.default.createElement("button", { className: b('button'), onClick: () => handleClick && handleClick(type) },
|
|
10
10
|
react_1.default.createElement("div", { className: b('icon-wrapper') },
|
|
11
11
|
react_1.default.createElement(ToggleArrow_1.default, { size: size, type: 'horizontal', iconType: "navigation", className: b('icon') })))));
|
|
12
12
|
exports.default = Arrow;
|
|
@@ -179,11 +179,7 @@ unpredictable css rules order in build */
|
|
|
179
179
|
}
|
|
180
180
|
.pc-SliderBlock_type_media-card .slick-arrow {
|
|
181
181
|
display: none;
|
|
182
|
-
height: 100%;
|
|
183
182
|
width: 64px;
|
|
184
|
-
top: 0;
|
|
185
|
-
}
|
|
186
|
-
.pc-SliderBlock_type_media-card .slick-arrow button {
|
|
187
183
|
top: 50%;
|
|
188
184
|
transform: translate(0, -50%);
|
|
189
185
|
}
|
|
@@ -5,20 +5,13 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
6
|
const icons_1 = require("../../icons");
|
|
7
7
|
const locationContext_1 = require("../../context/locationContext");
|
|
8
|
-
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
9
8
|
const hooks_1 = require("../../hooks");
|
|
10
9
|
const models_1 = require("../../models");
|
|
11
|
-
const COMPONENT_NAME = 'backlink';
|
|
12
10
|
function BackLink(props) {
|
|
13
11
|
const { history } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
14
12
|
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, } = props;
|
|
15
|
-
const
|
|
16
|
-
const handleAnalytics = (0, hooks_1.useAnalytics)(
|
|
17
|
-
name: 'back-link-click',
|
|
18
|
-
type: models_1.PredefinedEventTypes.Default,
|
|
19
|
-
context: context || COMPONENT_NAME,
|
|
20
|
-
target: url,
|
|
21
|
-
});
|
|
13
|
+
const defaultEvent = (0, hooks_1.useAnalyticsEvent)(models_1.DefaultEventNames.ShareButton, url);
|
|
14
|
+
const handleAnalytics = (0, hooks_1.useAnalytics)(defaultEvent);
|
|
22
15
|
const backActionHandler = (0, react_1.useCallback)(async () => {
|
|
23
16
|
handleAnalytics();
|
|
24
17
|
if (!history) {
|
|
@@ -7,24 +7,16 @@ const utils_1 = require("../../utils");
|
|
|
7
7
|
const models_1 = require("../../models");
|
|
8
8
|
const utils_2 = require("./utils");
|
|
9
9
|
const localeContext_1 = require("../../context/localeContext/localeContext");
|
|
10
|
-
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
11
10
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
12
11
|
const hooks_1 = require("../../hooks");
|
|
13
12
|
const icons_1 = require("../../icons");
|
|
14
|
-
const COMPONENT_NAME = 'button';
|
|
15
13
|
const b = (0, utils_1.block)('button-block');
|
|
16
14
|
const Button = (props) => {
|
|
17
15
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
18
16
|
const { lang, tld } = (0, react_1.useContext)(localeContext_1.LocaleContext);
|
|
19
17
|
const { className, metrikaGoals, pixelEvents, analyticsEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text } = props, rest = tslib_1.__rest(props, ["className", "metrikaGoals", "pixelEvents", "analyticsEvents", "size", "theme", "url", "img", "onClick", "text"]);
|
|
20
|
-
const context = (0, react_1.useContext)(blockPositionContext_1.BlockPositionContext);
|
|
21
18
|
const defaultImgPosition = 'left';
|
|
22
|
-
const defaultEvent = (0,
|
|
23
|
-
name: 'button-click',
|
|
24
|
-
type: models_1.PredefinedEventTypes.Default,
|
|
25
|
-
context: context || COMPONENT_NAME,
|
|
26
|
-
target: url,
|
|
27
|
-
}), [context, url]);
|
|
19
|
+
const defaultEvent = (0, hooks_1.useAnalyticsEvent)(models_1.DefaultEventNames.Button, url);
|
|
28
20
|
const handleAnalytics = (0, hooks_1.useAnalytics)(defaultEvent);
|
|
29
21
|
const onClick = (0, react_1.useCallback)(() => {
|
|
30
22
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
@@ -4,7 +4,6 @@ exports.Layout = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
|
-
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
8
7
|
const BackgroundImage_1 = tslib_1.__importDefault(require("../BackgroundImage/BackgroundImage"));
|
|
9
8
|
const RouterLink_1 = tslib_1.__importDefault(require("../RouterLink/RouterLink"));
|
|
10
9
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
@@ -17,13 +16,7 @@ const Footer = () => null;
|
|
|
17
16
|
const Layout = (props) => {
|
|
18
17
|
const { className, bodyClassName, metrikaGoals, pixelEvents, analyticsEvents, contentClassName, children, url, target, border = 'shadow', } = props;
|
|
19
18
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
20
|
-
const
|
|
21
|
-
const defaultEvent = (0, react_1.useMemo)(() => ({
|
|
22
|
-
name: 'card-base-click',
|
|
23
|
-
type: common_1.PredefinedEventTypes.Default,
|
|
24
|
-
context,
|
|
25
|
-
target: url,
|
|
26
|
-
}), [context, url]);
|
|
19
|
+
const defaultEvent = (0, hooks_1.useAnalyticsEvent)(common_1.DefaultEventNames.CardBase, url);
|
|
27
20
|
const handleAnalytics = (0, hooks_1.useAnalytics)(defaultEvent);
|
|
28
21
|
let header, content, footer, image, headerClass, footerClass;
|
|
29
22
|
function handleChild(child) {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
-
.pc-foldable-
|
|
3
|
+
.pc-foldable-block {
|
|
4
4
|
height: 0;
|
|
5
5
|
overflow-y: hidden;
|
|
6
6
|
transition: height 300ms, margin-bottom 300ms;
|
|
7
|
+
}
|
|
8
|
+
.pc-foldable-block__content-container {
|
|
9
|
+
overflow: auto;
|
|
7
10
|
}
|
|
@@ -3,21 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
|
-
const
|
|
6
|
+
const useHeightCalculator_1 = tslib_1.__importDefault(require("../../hooks/useHeightCalculator"));
|
|
7
7
|
const b = (0, utils_1.block)('foldable-block');
|
|
8
8
|
const Foldable = ({ isOpened, children, className }) => {
|
|
9
|
+
const blockRef = (0, react_1.useRef)(null);
|
|
9
10
|
const contentRef = (0, react_1.useRef)(null);
|
|
10
|
-
const
|
|
11
|
-
const onHeightCalculation = (0, react_1.useCallback)((height) => {
|
|
12
|
-
setContentHeight(height);
|
|
13
|
-
}, []);
|
|
11
|
+
const contentHeight = (0, useHeightCalculator_1.default)(contentRef);
|
|
14
12
|
(0, react_1.useEffect)(() => {
|
|
15
|
-
if (
|
|
16
|
-
|
|
13
|
+
if (blockRef && blockRef.current) {
|
|
14
|
+
blockRef.current.style.height = isOpened && contentHeight ? `${contentHeight}px` : '0';
|
|
17
15
|
}
|
|
18
16
|
}, [isOpened, contentHeight]);
|
|
19
|
-
return (react_1.default.createElement("div", { className: b(
|
|
20
|
-
react_1.default.createElement("div", { ref: contentRef, className: b('content-container'
|
|
21
|
-
react_1.default.createElement(HeightCalculator_1.default, { onCalculate: onHeightCalculation }, children)));
|
|
17
|
+
return (react_1.default.createElement("div", { ref: blockRef, className: b({ open: isOpened }, className) },
|
|
18
|
+
react_1.default.createElement("div", { ref: contentRef, className: b('content-container') }, children)));
|
|
22
19
|
};
|
|
23
20
|
exports.default = Foldable;
|
|
@@ -7,23 +7,25 @@ const utils_1 = require("../../utils");
|
|
|
7
7
|
const Image_1 = tslib_1.__importDefault(require("../Image/Image"));
|
|
8
8
|
const icons_1 = require("../../icons");
|
|
9
9
|
const b = (0, utils_1.block)('FullScreenImage');
|
|
10
|
+
const FULL_SCREEN_ICON_SIZE = 18;
|
|
11
|
+
const CLOSE_ICON_SIZE = 30;
|
|
10
12
|
const FullScreenImage = (props) => {
|
|
11
13
|
const { imageClassName, modalImageClass, imageStyle } = props;
|
|
12
14
|
const [isOpened, setIsOpened] = (0, react_1.useState)(false);
|
|
13
15
|
const [isMouseEnter, setIsMouseEnter] = (0, react_1.useState)(false);
|
|
14
|
-
const openModal = (
|
|
15
|
-
const closeModal = (
|
|
16
|
-
const showFullScreenIcon = (
|
|
17
|
-
const hideFullScreenIcon = (
|
|
16
|
+
const openModal = () => setIsOpened(true);
|
|
17
|
+
const closeModal = () => setIsOpened(false);
|
|
18
|
+
const showFullScreenIcon = () => setIsMouseEnter(true);
|
|
19
|
+
const hideFullScreenIcon = () => setIsMouseEnter(false);
|
|
18
20
|
return (react_1.default.createElement("div", { className: b() },
|
|
19
21
|
react_1.default.createElement("div", { className: b('image-wrapper'), onMouseEnter: showFullScreenIcon, onMouseLeave: hideFullScreenIcon },
|
|
20
22
|
react_1.default.createElement(Image_1.default, Object.assign({}, props, { className: b('image', imageClassName), onClick: openModal, style: imageStyle })),
|
|
21
23
|
react_1.default.createElement("div", { className: b('icon-wrapper', { visible: isMouseEnter }), onClick: openModal },
|
|
22
|
-
react_1.default.createElement(uikit_1.Icon, { data: icons_1.FullScreen, width:
|
|
24
|
+
react_1.default.createElement(uikit_1.Icon, { data: icons_1.FullScreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') }))),
|
|
23
25
|
isOpened && (react_1.default.createElement(uikit_1.Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
|
|
24
26
|
react_1.default.createElement("div", { className: b('modal-content') },
|
|
25
27
|
react_1.default.createElement("div", { className: b('icon-wrapper', { visible: true }), onClick: closeModal },
|
|
26
|
-
react_1.default.createElement(uikit_1.Icon, { data: icons_1.PreviewClose, width:
|
|
28
|
+
react_1.default.createElement(uikit_1.Icon, { data: icons_1.PreviewClose, width: CLOSE_ICON_SIZE, height: CLOSE_ICON_SIZE, className: b('icon', { hover: true }) })),
|
|
27
29
|
react_1.default.createElement(Image_1.default, Object.assign({}, props, { className: b('modal-image', modalImageClass) })))))));
|
|
28
30
|
};
|
|
29
31
|
exports.default = FullScreenImage;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-full-screen-media__modal-media_type_youtube, .pc-full-screen-media__modal-media_type_video video, .pc-full-screen-media__modal-media_type_image {
|
|
4
|
+
display: block;
|
|
5
|
+
position: relative;
|
|
6
|
+
width: 100%;
|
|
7
|
+
max-width: 1232px;
|
|
8
|
+
max-height: 70vh;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.pc-full-screen-media__media {
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
}
|
|
14
|
+
.pc-full-screen-media__media-wrapper {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
.pc-full-screen-media__modal-content {
|
|
19
|
+
position: relative;
|
|
20
|
+
}
|
|
21
|
+
.pc-full-screen-media__inline-media {
|
|
22
|
+
transform: translateZ(0);
|
|
23
|
+
}
|
|
24
|
+
.pc-full-screen-media__modal-media {
|
|
25
|
+
border-radius: var(--pc-border-radius);
|
|
26
|
+
}
|
|
27
|
+
.pc-full-screen-media__modal-media_type_youtube {
|
|
28
|
+
width: min(65vw, 1232px);
|
|
29
|
+
height: calc(min(65vw, 1232px) * 9 / 16);
|
|
30
|
+
}
|
|
31
|
+
.pc-full-screen-media__modal .yc-modal__content, .pc-full-screen-media__modal-image {
|
|
32
|
+
border-radius: var(--pc-border-radius);
|
|
33
|
+
}
|
|
34
|
+
.pc-full-screen-media__icon-wrapper {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
position: absolute;
|
|
39
|
+
right: 16px;
|
|
40
|
+
top: 16px;
|
|
41
|
+
width: 36px;
|
|
42
|
+
height: 36px;
|
|
43
|
+
border-radius: 8px;
|
|
44
|
+
background-color: var(--yc-color-base-simple-hover-solid);
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
z-index: 10;
|
|
47
|
+
}
|
|
48
|
+
.pc-full-screen-media__modal-content .pc-full-screen-media__icon-wrapper, .pc-full-screen-media__media-wrapper .pc-full-screen-media__icon-wrapper {
|
|
49
|
+
opacity: 0;
|
|
50
|
+
transition: opacity 0.3s;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
}
|
|
53
|
+
.pc-full-screen-media__modal-content:hover .pc-full-screen-media__icon-wrapper, .pc-full-screen-media__media-wrapper:hover .pc-full-screen-media__icon-wrapper {
|
|
54
|
+
opacity: 1;
|
|
55
|
+
pointer-events: inherit;
|
|
56
|
+
}
|
|
57
|
+
.pc-full-screen-media__icon {
|
|
58
|
+
color: var(--yc-color-text-hint);
|
|
59
|
+
}
|
|
60
|
+
.pc-full-screen-media__icon_hover:hover {
|
|
61
|
+
color: var(--yc-color-text-secondary);
|
|
62
|
+
}
|
|
63
|
+
@media (max-width: 577px) {
|
|
64
|
+
.pc-full-screen-media__icon-wrapper {
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
.pc-full-screen-media__modal {
|
|
68
|
+
display: none !important; /* stylelint-disable-line declaration-no-important */
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MediaAllProps } from '../Media/Media';
|
|
3
|
+
export type ChildMediaRenderProps = Pick<MediaAllProps, 'fullScreen' | 'imageClassName' | 'videoClassName' | 'youtubeClassName' | 'className'>;
|
|
4
|
+
export interface FullScreenMediaProps {
|
|
5
|
+
showFullScreenIcon?: boolean;
|
|
6
|
+
children: (props?: ChildMediaRenderProps) => JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
declare const FullScreenMedia: ({ children, showFullScreenIcon }: FullScreenMediaProps) => JSX.Element;
|
|
9
|
+
export default FullScreenMedia;
|
|
@@ -0,0 +1,40 @@
|
|
|
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 uikit_1 = require("@gravity-ui/uikit");
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
7
|
+
const icons_1 = require("../../icons");
|
|
8
|
+
const mobileContext_1 = require("../../context/mobileContext");
|
|
9
|
+
const b = (0, utils_1.block)('full-screen-media');
|
|
10
|
+
const FULL_SCREEN_ICON_SIZE = 18;
|
|
11
|
+
const CLOSE_ICON_SIZE = 30;
|
|
12
|
+
const getMediaClass = (type) => b('modal-media', { type });
|
|
13
|
+
const FullScreenMedia = ({ children, showFullScreenIcon = true }) => {
|
|
14
|
+
const [isOpened, setIsOpened] = (0, react_1.useState)(false);
|
|
15
|
+
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
16
|
+
const openModal = (e) => {
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
setIsOpened(true);
|
|
19
|
+
};
|
|
20
|
+
const closeModal = () => setIsOpened(false);
|
|
21
|
+
if (isMobile) {
|
|
22
|
+
return children();
|
|
23
|
+
}
|
|
24
|
+
return (react_1.default.createElement("div", { className: b() },
|
|
25
|
+
react_1.default.createElement("div", { className: b('media-wrapper'), onClickCapture: openModal },
|
|
26
|
+
children({ className: b('inline-media') }),
|
|
27
|
+
showFullScreenIcon && (react_1.default.createElement("div", { className: b('icon-wrapper'), onClickCapture: openModal },
|
|
28
|
+
react_1.default.createElement(uikit_1.Icon, { data: icons_1.FullScreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') })))),
|
|
29
|
+
isOpened && (react_1.default.createElement(uikit_1.Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
|
|
30
|
+
react_1.default.createElement("div", { className: b('modal-content') },
|
|
31
|
+
react_1.default.createElement("div", { className: b('icon-wrapper', { visible: true }), onClick: closeModal },
|
|
32
|
+
react_1.default.createElement(uikit_1.Icon, { data: icons_1.PreviewClose, width: CLOSE_ICON_SIZE, height: CLOSE_ICON_SIZE, className: b('icon', { hover: true }) })),
|
|
33
|
+
children({
|
|
34
|
+
imageClassName: getMediaClass('image'),
|
|
35
|
+
videoClassName: getMediaClass('video'),
|
|
36
|
+
youtubeClassName: getMediaClass('youtube'),
|
|
37
|
+
fullScreen: true,
|
|
38
|
+
}))))));
|
|
39
|
+
};
|
|
40
|
+
exports.default = FullScreenMedia;
|
|
@@ -2,5 +2,9 @@ import { WithChildren } from '../../models';
|
|
|
2
2
|
export interface HeightCalculatorProps {
|
|
3
3
|
onCalculate: (height: number) => void;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Will be removed, use the useHeightCalculator hook instead.
|
|
7
|
+
* @returns The HeightCalculator component.
|
|
8
|
+
*/
|
|
5
9
|
declare const HeightCalculator: ({ onCalculate, children }: WithChildren<HeightCalculatorProps>) => JSX.Element | null;
|
|
6
10
|
export default HeightCalculator;
|
|
@@ -5,6 +5,10 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const b = (0, utils_1.block)('height-calculator');
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Will be removed, use the useHeightCalculator hook instead.
|
|
10
|
+
* @returns The HeightCalculator component.
|
|
11
|
+
*/
|
|
8
12
|
const HeightCalculator = ({ onCalculate, children }) => {
|
|
9
13
|
const [isCalculating, setIsCalculating] = (0, react_1.useState)(true);
|
|
10
14
|
const container = (0, react_1.useRef)(null);
|
|
@@ -10,7 +10,6 @@ const FileLink_1 = tslib_1.__importDefault(require("../FileLink/FileLink"));
|
|
|
10
10
|
const BackLink_1 = tslib_1.__importDefault(require("../BackLink/BackLink"));
|
|
11
11
|
const localeContext_1 = require("../../context/localeContext/localeContext");
|
|
12
12
|
const locationContext_1 = require("../../context/locationContext/locationContext");
|
|
13
|
-
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
14
13
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
15
14
|
const hooks_1 = require("../../hooks");
|
|
16
15
|
const b = (0, utils_1.block)('link-block');
|
|
@@ -30,13 +29,7 @@ function getArrowSize(size) {
|
|
|
30
29
|
const LinkBlock = (props) => {
|
|
31
30
|
const { text, url, arrow, metrikaGoals, pixelEvents, analyticsEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, } = props;
|
|
32
31
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
33
|
-
const
|
|
34
|
-
const defaultEvent = (0, react_1.useMemo)(() => ({
|
|
35
|
-
name: 'link-click',
|
|
36
|
-
type: models_1.PredefinedEventTypes.Default,
|
|
37
|
-
context,
|
|
38
|
-
target: url,
|
|
39
|
-
}), [context, url]);
|
|
32
|
+
const defaultEvent = (0, hooks_1.useAnalyticsEvent)(models_1.DefaultEventNames.Link, url);
|
|
40
33
|
const handleAnalytics = (0, hooks_1.useAnalytics)(defaultEvent);
|
|
41
34
|
const { hostname } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
42
35
|
const { tld } = (0, react_1.useContext)(localeContext_1.LocaleContext);
|
|
@@ -10,7 +10,7 @@ const Video_1 = tslib_1.__importDefault(require("./Video/Video"));
|
|
|
10
10
|
const VideoBlock_1 = tslib_1.__importDefault(require("../VideoBlock/VideoBlock"));
|
|
11
11
|
const b = (0, utils_1.block)('Media');
|
|
12
12
|
const Media = (props) => {
|
|
13
|
-
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, analyticsEvents, } = props;
|
|
13
|
+
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullScreen, analyticsEvents, } = props;
|
|
14
14
|
const { className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, } = props;
|
|
15
15
|
const [hasVideoFallback, setHasVideoFallback] = (0, react_1.useState)(false);
|
|
16
16
|
const content = (0, react_1.useMemo)(() => {
|
|
@@ -22,7 +22,7 @@ const Media = (props) => {
|
|
|
22
22
|
result.push(react_1.default.createElement(Video_1.default, { key: "video", video: video, videoClassName: videoClassName, height: height, metrika: metrika, analyticsEvents: analyticsEvents, playVideo: playVideo, previewImg: previewImg, playButton: playButton, customBarControlsClassName: customBarControlsClassName, hasVideoFallback: hasVideoFallback, setHasVideoFallback: setHasVideoFallback }));
|
|
23
23
|
}
|
|
24
24
|
if (youtube) {
|
|
25
|
-
result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height }));
|
|
25
|
+
result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullScreen: fullScreen }));
|
|
26
26
|
}
|
|
27
27
|
if (dataLens) {
|
|
28
28
|
result = react_1.default.createElement(DataLens_1.default, { dataLens: dataLens });
|
|
@@ -46,6 +46,7 @@ const Media = (props) => {
|
|
|
46
46
|
playButton,
|
|
47
47
|
customBarControlsClassName,
|
|
48
48
|
youtubeClassName,
|
|
49
|
+
fullScreen,
|
|
49
50
|
]);
|
|
50
51
|
return (react_1.default.createElement("div", { className: b(null, className), style: { backgroundColor: color } }, content));
|
|
51
52
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-meta-info {
|
|
4
|
+
font-size: var(--yc-text-body-2-font-size);
|
|
5
|
+
line-height: var(--yc-text-body-2-line-height);
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
font-weight: 500;
|
|
9
|
+
color: var(--pc-media-card-meta-info-color);
|
|
10
|
+
}
|
|
11
|
+
.pc-meta-info__item:not(:first-child) {
|
|
12
|
+
margin-left: 16px;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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 utils_1 = require("../../utils");
|
|
6
|
+
const b = (0, utils_1.block)('meta-info');
|
|
7
|
+
const MetaInfo = ({ items, className }) => (react_1.default.createElement("h4", { className: b(null, className) }, items.map((metaInfoItem) => (react_1.default.createElement("div", { key: metaInfoItem, className: b('item') }, metaInfoItem)))));
|
|
8
|
+
exports.default = MetaInfo;
|