@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
|
@@ -177,6 +177,84 @@ export declare const tabsItem: {
|
|
|
177
177
|
type: string;
|
|
178
178
|
enum: string[];
|
|
179
179
|
};
|
|
180
|
+
analyticsEvents: {
|
|
181
|
+
anyOf: ({
|
|
182
|
+
type: string;
|
|
183
|
+
additionalProperties: {
|
|
184
|
+
type: string;
|
|
185
|
+
};
|
|
186
|
+
required: string[];
|
|
187
|
+
properties: {
|
|
188
|
+
name: {
|
|
189
|
+
type: string;
|
|
190
|
+
};
|
|
191
|
+
type: {
|
|
192
|
+
type: string;
|
|
193
|
+
};
|
|
194
|
+
counters: {
|
|
195
|
+
type: string;
|
|
196
|
+
additionalProperties: boolean;
|
|
197
|
+
required: never[];
|
|
198
|
+
properties: {
|
|
199
|
+
include: {
|
|
200
|
+
type: string;
|
|
201
|
+
items: {
|
|
202
|
+
type: string;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
exclude: {
|
|
206
|
+
type: string;
|
|
207
|
+
items: {
|
|
208
|
+
type: string;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
context: {
|
|
214
|
+
type: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
} | {
|
|
218
|
+
type: string;
|
|
219
|
+
items: {
|
|
220
|
+
type: string;
|
|
221
|
+
additionalProperties: {
|
|
222
|
+
type: string;
|
|
223
|
+
};
|
|
224
|
+
required: string[];
|
|
225
|
+
properties: {
|
|
226
|
+
name: {
|
|
227
|
+
type: string;
|
|
228
|
+
};
|
|
229
|
+
type: {
|
|
230
|
+
type: string;
|
|
231
|
+
};
|
|
232
|
+
counters: {
|
|
233
|
+
type: string;
|
|
234
|
+
additionalProperties: boolean;
|
|
235
|
+
required: never[];
|
|
236
|
+
properties: {
|
|
237
|
+
include: {
|
|
238
|
+
type: string;
|
|
239
|
+
items: {
|
|
240
|
+
type: string;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
exclude: {
|
|
244
|
+
type: string;
|
|
245
|
+
items: {
|
|
246
|
+
type: string;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
context: {
|
|
252
|
+
type: string;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
})[];
|
|
257
|
+
};
|
|
180
258
|
type: {};
|
|
181
259
|
when: {};
|
|
182
260
|
};
|
|
@@ -5,16 +5,18 @@ 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");
|
|
8
9
|
const hooks_1 = require("../../hooks");
|
|
9
10
|
const models_1 = require("../../models");
|
|
10
11
|
const COMPONENT_NAME = 'backlink';
|
|
11
12
|
function BackLink(props) {
|
|
12
13
|
const { history } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
13
|
-
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick,
|
|
14
|
+
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, } = props;
|
|
15
|
+
const context = (0, react_1.useContext)(blockPositionContext_1.BlockPositionContext);
|
|
14
16
|
const handleAnalytics = (0, hooks_1.useAnalytics)({
|
|
15
17
|
name: 'back-link-click',
|
|
16
18
|
type: models_1.PredefinedEventTypes.Default,
|
|
17
|
-
context: context,
|
|
19
|
+
context: context || COMPONENT_NAME,
|
|
18
20
|
target: url,
|
|
19
21
|
});
|
|
20
22
|
const backActionHandler = (0, react_1.useCallback)(async () => {
|
|
@@ -7,10 +7,10 @@ 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");
|
|
10
11
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
11
12
|
const hooks_1 = require("../../hooks");
|
|
12
13
|
const icons_1 = require("../../icons");
|
|
13
|
-
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
14
14
|
const COMPONENT_NAME = 'button';
|
|
15
15
|
const b = (0, utils_1.block)('button-block');
|
|
16
16
|
const Button = (props) => {
|
|
@@ -26,9 +26,6 @@ const Button = (props) => {
|
|
|
26
26
|
target: url,
|
|
27
27
|
}), [context, url]);
|
|
28
28
|
const handleAnalytics = (0, hooks_1.useAnalytics)(defaultEvent);
|
|
29
|
-
const blockPosition = (0, react_1.useContext)(blockPositionContext_1.BlockPositionContext);
|
|
30
|
-
// eslint-disable-next-line no-console
|
|
31
|
-
console.log({ blockPosition }, props);
|
|
32
29
|
const onClick = (0, react_1.useCallback)(() => {
|
|
33
30
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
34
31
|
handleAnalytics(analyticsEvents);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactElement, HTMLAttributeAnchorTarget } from 'react';
|
|
2
2
|
import { ButtonPixel, CardBaseProps as CardBaseParams, ImageProps, MetrikaGoal, WithChildren } from '../../models';
|
|
3
|
-
import {
|
|
4
|
-
export interface CardBaseProps extends CardBaseParams {
|
|
3
|
+
import { AnalyticsEventsBase } from '../../models/common';
|
|
4
|
+
export interface CardBaseProps extends AnalyticsEventsBase, CardBaseParams {
|
|
5
5
|
className?: string;
|
|
6
6
|
bodyClassName?: string;
|
|
7
7
|
contentClassName?: string;
|
|
@@ -10,8 +10,6 @@ export interface CardBaseProps extends CardBaseParams {
|
|
|
10
10
|
target?: HTMLAttributeAnchorTarget;
|
|
11
11
|
metrikaGoals?: MetrikaGoal;
|
|
12
12
|
pixelEvents?: ButtonPixel;
|
|
13
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
14
|
-
context?: string;
|
|
15
13
|
}
|
|
16
14
|
export interface CardHeaderBaseProps {
|
|
17
15
|
className?: string;
|
|
@@ -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;
|
|
@@ -1,6 +1,36 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/* use this for style redefinitions to awoid problems with
|
|
3
|
+
unpredictable css rules order in build */
|
|
1
4
|
.pc-header-breadcrumbs {
|
|
2
5
|
z-index: 11;
|
|
3
6
|
}
|
|
7
|
+
.pc-header-breadcrumbs__item {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
}
|
|
10
|
+
.pc-header-breadcrumbs__text {
|
|
11
|
+
font-size: var(--yc-text-body-2-font-size);
|
|
12
|
+
line-height: var(--yc-text-body-2-line-height);
|
|
13
|
+
outline: none;
|
|
14
|
+
color: var(--yc-color-text-link);
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
color: var(--yc-color-text-secondary);
|
|
18
|
+
}
|
|
19
|
+
.utilityfocus .pc-header-breadcrumbs__text:focus {
|
|
20
|
+
outline: 2px solid #ffdb4d;
|
|
21
|
+
}
|
|
22
|
+
.pc-header-breadcrumbs__text:hover, .pc-header-breadcrumbs__text:active {
|
|
23
|
+
--pc-text-header-color: var(--yc-color-text-link-hover);
|
|
24
|
+
color: var(--yc-color-text-link-hover);
|
|
25
|
+
}
|
|
26
|
+
.pc-header-breadcrumbs__text:after {
|
|
27
|
+
content: " / ";
|
|
28
|
+
margin: 0 8px 0 6px;
|
|
29
|
+
color: var(--yc-color-text-secondary);
|
|
30
|
+
}
|
|
31
|
+
.pc-header-breadcrumbs__text:hover {
|
|
32
|
+
color: var(--yc-color-text-primary);
|
|
33
|
+
}
|
|
4
34
|
.pc-header-breadcrumbs_theme_dark .pc-header-breadcrumbs__text {
|
|
5
35
|
color: var(--yc-color-text-light-secondary);
|
|
6
36
|
}
|
|
@@ -3,10 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
|
-
const
|
|
6
|
+
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
7
7
|
const b = (0, utils_1.block)('header-breadcrumbs');
|
|
8
8
|
function HeaderBreadcrumbs(props) {
|
|
9
9
|
const { items, metrikaGoals, pixelEvents, theme = 'light', className } = props;
|
|
10
|
-
|
|
10
|
+
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
11
|
+
const onClick = () => {
|
|
12
|
+
handleMetrika({ metrikaGoals, pixelEvents });
|
|
13
|
+
};
|
|
14
|
+
return (react_1.default.createElement("div", { className: b({ theme }, className) }, items.map((item) => (react_1.default.createElement("div", { className: b('item'), key: item.url },
|
|
15
|
+
react_1.default.createElement("a", { href: item.url, className: b('text'), onClick: onClick }, item.text))))));
|
|
11
16
|
}
|
|
12
17
|
exports.default = HeaderBreadcrumbs;
|
|
@@ -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,9 +10,9 @@ 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");
|
|
13
14
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
14
15
|
const hooks_1 = require("../../hooks");
|
|
15
|
-
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
16
16
|
const b = (0, utils_1.block)('link-block');
|
|
17
17
|
const WORD_JOINER_SYM = '\u200b';
|
|
18
18
|
function getArrowSize(size) {
|
|
@@ -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;
|
|
@@ -46,7 +46,7 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
46
46
|
const defaultEvent = (0, react_1.useMemo)(() => ({
|
|
47
47
|
name: 'react-player-controls-click',
|
|
48
48
|
type: models_1.PredefinedEventTypes.Default,
|
|
49
|
-
context
|
|
49
|
+
context,
|
|
50
50
|
}), [context]);
|
|
51
51
|
const handleAnalytics = (0, hooks_1.useAnalytics)(defaultEvent);
|
|
52
52
|
(0, react_1.useImperativeHandle)(originRef, () => ({
|
|
@@ -4,6 +4,7 @@ exports.getHeight = exports.AUTOPLAY_ATTRIBUTES = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
7
8
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
8
9
|
const utils_1 = require("../../utils");
|
|
9
10
|
const Image_1 = tslib_1.__importDefault(require("../Image/Image"));
|
|
@@ -18,7 +19,6 @@ exports.AUTOPLAY_ATTRIBUTES = {
|
|
|
18
19
|
mute: 1,
|
|
19
20
|
};
|
|
20
21
|
const b = (0, utils_1.block)('VideoBlock');
|
|
21
|
-
const iframeId = 'video-block';
|
|
22
22
|
function getVideoSrc(stream, record) {
|
|
23
23
|
if (!stream && !record) {
|
|
24
24
|
return null;
|
|
@@ -38,14 +38,14 @@ function getHeight(width) {
|
|
|
38
38
|
}
|
|
39
39
|
exports.getHeight = getHeight;
|
|
40
40
|
const VideoBlock = (props) => {
|
|
41
|
-
const { stream, record, attributes, className, id, previewImg, playButton, height } = props;
|
|
41
|
+
const { stream, record, attributes, className, id, previewImg, playButton, height, fullScreen } = props;
|
|
42
42
|
const src = getVideoSrc(stream, record);
|
|
43
43
|
const ref = (0, react_1.useRef)(null);
|
|
44
44
|
const iframeRef = (0, react_1.useRef)();
|
|
45
45
|
const [hidePreview, setHidePreview] = (0, react_1.useState)(false);
|
|
46
46
|
const norender = (!stream && !record) || !src;
|
|
47
47
|
const [currentHeight, setCurrentHeight] = (0, react_1.useState)(height || undefined);
|
|
48
|
-
const fullId =
|
|
48
|
+
const fullId = id || (0, uuid_1.v4)();
|
|
49
49
|
const onPreviewClick = (0, react_1.useCallback)(() => {
|
|
50
50
|
if (iframeRef.current) {
|
|
51
51
|
iframeRef.current.src = `${src}?${(0, utils_1.getPageSearchParams)(Object.assign(Object.assign({}, exports.AUTOPLAY_ATTRIBUTES), (attributes || {})))}`;
|
|
@@ -66,12 +66,8 @@ const VideoBlock = (props) => {
|
|
|
66
66
|
if (norender) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
const prevPageVideo = document.getElementById(fullId);
|
|
70
69
|
const fullSrc = `${src}?${(0, utils_1.getPageSearchParams)(attributes || {})}`;
|
|
71
|
-
if (
|
|
72
|
-
prevPageVideo.src = fullSrc;
|
|
73
|
-
}
|
|
74
|
-
else if (ref.current) {
|
|
70
|
+
if (ref.current && !iframeRef.current) {
|
|
75
71
|
const iframe = document.createElement('iframe');
|
|
76
72
|
iframe.id = fullId;
|
|
77
73
|
iframe.src = fullSrc;
|
|
@@ -83,14 +79,14 @@ const VideoBlock = (props) => {
|
|
|
83
79
|
ref.current.appendChild(iframe);
|
|
84
80
|
iframeRef.current = iframe;
|
|
85
81
|
}
|
|
86
|
-
}, [stream, record, norender, src, fullId, attributes, iframeRef]);
|
|
82
|
+
}, [stream, record, norender, src, fullId, attributes, iframeRef, fullScreen]);
|
|
87
83
|
(0, react_1.useEffect)(() => {
|
|
88
84
|
setHidePreview(false);
|
|
89
85
|
}, [src, setHidePreview]);
|
|
90
86
|
if (norender) {
|
|
91
87
|
return null;
|
|
92
88
|
}
|
|
93
|
-
return (react_1.default.createElement("div", { className: b(null, className), ref: ref, style: { height: currentHeight } }, previewImg && !hidePreview && (react_1.default.createElement("div", { className: b('preview'), onClick: onPreviewClick },
|
|
89
|
+
return (react_1.default.createElement("div", { className: b(null, className), ref: ref, style: { height: currentHeight } }, previewImg && !hidePreview && !fullScreen && (react_1.default.createElement("div", { className: b('preview'), onClick: onPreviewClick },
|
|
94
90
|
react_1.default.createElement(Image_1.default, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper') }),
|
|
95
91
|
playButton || (react_1.default.createElement("button", { className: b('button') },
|
|
96
92
|
react_1.default.createElement(uikit_1.Icon, { className: b('icon'), data: icons_1.PlayVideo, size: 24 })))))));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PixelEvent } from '../../models';
|
|
2
|
-
import {
|
|
2
|
+
import { AnalyticsEventsBase } from '../../models/common';
|
|
3
3
|
export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
|
|
4
|
-
export interface YandexFormProps {
|
|
4
|
+
export interface YandexFormProps extends AnalyticsEventsBase {
|
|
5
5
|
id: number | string;
|
|
6
6
|
containerId?: string;
|
|
7
7
|
theme?: string;
|
|
@@ -15,8 +15,6 @@ export interface YandexFormProps {
|
|
|
15
15
|
onLoad?: () => void;
|
|
16
16
|
metrikaGoals?: string | string[];
|
|
17
17
|
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
18
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
19
|
-
context?: string;
|
|
20
18
|
}
|
|
21
19
|
declare const YandexForm: (props: YandexFormProps) => JSX.Element;
|
|
22
20
|
export default YandexForm;
|