@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
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = tslib_1.
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const loadHubspotScript_1 = tslib_1.__importDefault(require("./loadHubspotScript"));
|
|
6
6
|
const hooks_1 = require("../../hooks");
|
|
7
7
|
const HubspotFormContainer = (props) => {
|
|
8
|
-
const { className, formId, formInstanceId, portalId, region, formClassName, } = props;
|
|
8
|
+
const { className, formId, formInstanceId, portalId, region, formClassName, createDOMElement, } = props;
|
|
9
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
10
|
+
const hsContainerRef = (0, react_1.useRef)();
|
|
9
11
|
const containerId = formInstanceId
|
|
10
12
|
? `hubspot-form-${formId}-${formInstanceId}`
|
|
11
13
|
: `hubspot-form-${formId}`;
|
|
12
|
-
|
|
13
|
-
(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const createForm = () => {
|
|
15
|
+
if (containerRef.current && !hsContainerRef.current && createDOMElement) {
|
|
16
|
+
hsContainerRef.current = document.createElement('div');
|
|
17
|
+
containerRef.current.id = '';
|
|
18
|
+
hsContainerRef.current.id = containerId;
|
|
19
|
+
containerRef.current.appendChild(hsContainerRef.current);
|
|
20
|
+
}
|
|
21
|
+
if (!createDOMElement || hsContainerRef.current) {
|
|
17
22
|
if (window.hbspt) {
|
|
18
23
|
window.hbspt.forms.create({
|
|
19
24
|
region,
|
|
@@ -24,8 +29,21 @@ const HubspotFormContainer = (props) => {
|
|
|
24
29
|
formInstanceId,
|
|
25
30
|
});
|
|
26
31
|
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
(0, hooks_1.useMount)(() => {
|
|
35
|
+
(async () => {
|
|
36
|
+
if (!window.hbspt) {
|
|
37
|
+
await (0, loadHubspotScript_1.default)();
|
|
38
|
+
}
|
|
39
|
+
createForm();
|
|
27
40
|
})();
|
|
41
|
+
return () => {
|
|
42
|
+
if (createDOMElement && containerRef.current && containerRef.current.lastChild) {
|
|
43
|
+
containerRef.current.removeChild(containerRef.current.lastChild);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
28
46
|
});
|
|
29
|
-
return react_1.default.createElement("div", { className: className, id: containerId });
|
|
47
|
+
return react_1.default.createElement("div", { className: className, id: containerId, ref: containerRef });
|
|
30
48
|
};
|
|
31
49
|
exports.default = HubspotFormContainer;
|
|
@@ -5,16 +5,16 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
const ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
|
|
7
7
|
const mobileContext_1 = require("../../context/mobileContext");
|
|
8
|
+
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
8
9
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
9
10
|
const models_1 = require("../../models");
|
|
10
11
|
const hooks_1 = require("../../hooks");
|
|
11
12
|
const HubspotFormContainer_1 = tslib_1.__importDefault(require("./HubspotFormContainer"));
|
|
12
|
-
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
13
13
|
const b = (0, utils_1.block)('hubspot-form');
|
|
14
14
|
const HubspotForm = (props) => {
|
|
15
15
|
const { className, theme: themeProp, isMobile: isMobileProp, formId, formInstanceId, portalId, region, formClassName, pixelEvents,
|
|
16
16
|
// hubspotEvents, // TODO: decide how to handle them
|
|
17
|
-
analyticsEvents, onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, } = props;
|
|
17
|
+
analyticsEvents, onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, createDOMElement, onSubmitError, } = props;
|
|
18
18
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
19
19
|
const context = (0, react_1.useContext)(blockPositionContext_1.BlockPositionContext);
|
|
20
20
|
const defaultEvent = (0, react_1.useMemo)(() => ({
|
|
@@ -31,6 +31,7 @@ const HubspotForm = (props) => {
|
|
|
31
31
|
onBeforeLoad,
|
|
32
32
|
onBeforeSubmit,
|
|
33
33
|
onLoad,
|
|
34
|
+
onSubmitError,
|
|
34
35
|
onSubmit: (e) => {
|
|
35
36
|
handleMetrika === null || handleMetrika === void 0 ? void 0 : handleMetrika({ pixelEvents });
|
|
36
37
|
handleAnalytics(analyticsEvents);
|
|
@@ -45,8 +46,9 @@ const HubspotForm = (props) => {
|
|
|
45
46
|
handleAnalytics,
|
|
46
47
|
analyticsEvents,
|
|
47
48
|
onSubmit,
|
|
49
|
+
onSubmitError,
|
|
48
50
|
]);
|
|
49
51
|
(0, hooks_1.useHandleHubspotEvents)(handlers, formId);
|
|
50
|
-
return (react_1.default.createElement(HubspotFormContainer_1.default, { key: [formClassName, formId, formInstanceId, portalId, region].join(), className: b({ theme, mobile }, className), formClassName: formClassName, formId: formId, portalId: portalId, formInstanceId: formInstanceId, region: region }));
|
|
52
|
+
return (react_1.default.createElement(HubspotFormContainer_1.default, { createDOMElement: createDOMElement, key: [formClassName, formId, formInstanceId, portalId, region].join(), className: b({ theme, mobile }, className), formClassName: formClassName, formId: formId, portalId: portalId, formInstanceId: formInstanceId, region: region }));
|
|
51
53
|
};
|
|
52
54
|
exports.default = HubspotForm;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-layout-item__media {
|
|
4
|
+
width: 100%;
|
|
5
|
+
display: block;
|
|
6
|
+
border-radius: var(--pc-border-radius);
|
|
7
|
+
}
|
|
8
|
+
.pc-layout-item__media_border {
|
|
9
|
+
border: 1px solid var(--yc-color-line-generic);
|
|
10
|
+
}
|
|
11
|
+
.pc-layout-item__meta-info {
|
|
12
|
+
margin: 16px 0 -8px 0;
|
|
13
|
+
}
|
|
14
|
+
.pc-layout-item__content {
|
|
15
|
+
margin: 16px 16px 0 0;
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 components_1 = require("../../components");
|
|
7
|
+
const utils_2 = require("./utils");
|
|
8
|
+
const __1 = require("..");
|
|
9
|
+
const b = (0, utils_1.block)('layout-item');
|
|
10
|
+
const LayoutItem = (_a) => {
|
|
11
|
+
var _b = _a.content, { links } = _b, content = tslib_1.__rest(_b, ["links"]), { metaInfo, media, border, fullScreen, className } = _a;
|
|
12
|
+
return (react_1.default.createElement("div", { className: b(null, className) },
|
|
13
|
+
fullScreen && (0, utils_2.hasFullScreen)(media) ? (react_1.default.createElement(components_1.FullScreenMedia, { showFullScreenIcon: (0, utils_2.showFullScreenIcon)(media) }, (_a = {}) => {
|
|
14
|
+
var { className: mediaClassName } = _a, fullScreenMediaProps = tslib_1.__rest(_a, ["className"]);
|
|
15
|
+
return (react_1.default.createElement(components_1.Media, Object.assign({}, media, fullScreenMediaProps, { className: b('media', { border }, mediaClassName) })));
|
|
16
|
+
})) : (react_1.default.createElement(components_1.Media, Object.assign({}, media, { className: b('media', { border }) }))),
|
|
17
|
+
metaInfo && react_1.default.createElement(components_1.MetaInfo, { items: metaInfo, className: b('meta-info') }),
|
|
18
|
+
react_1.default.createElement("div", { className: b('content') },
|
|
19
|
+
react_1.default.createElement(__1.Content, Object.assign({}, content, { links: (0, utils_2.getLayoutItemLinks)(links), size: "s", colSizes: { all: 12, md: 12 } })))));
|
|
20
|
+
};
|
|
21
|
+
exports.default = LayoutItem;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
export declare const LayoutItem: {
|
|
2
|
+
type: string;
|
|
3
|
+
additionalProperties: boolean;
|
|
4
|
+
required: string[];
|
|
5
|
+
properties: {
|
|
6
|
+
media: {
|
|
7
|
+
color: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
image: {
|
|
11
|
+
anyOf: ({
|
|
12
|
+
oneOf: ({
|
|
13
|
+
type: string;
|
|
14
|
+
properties: {
|
|
15
|
+
when: {
|
|
16
|
+
type: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
} | {
|
|
20
|
+
type: string;
|
|
21
|
+
pattern: string;
|
|
22
|
+
})[];
|
|
23
|
+
} | {
|
|
24
|
+
type: string;
|
|
25
|
+
items: {
|
|
26
|
+
oneOf: ({
|
|
27
|
+
type: string;
|
|
28
|
+
properties: {
|
|
29
|
+
when: {
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
} | {
|
|
34
|
+
type: string;
|
|
35
|
+
pattern: string;
|
|
36
|
+
})[];
|
|
37
|
+
};
|
|
38
|
+
})[];
|
|
39
|
+
};
|
|
40
|
+
video: {
|
|
41
|
+
type: string;
|
|
42
|
+
additionalProperties: boolean;
|
|
43
|
+
required: string[];
|
|
44
|
+
properties: {
|
|
45
|
+
src: {
|
|
46
|
+
type: string;
|
|
47
|
+
items: {
|
|
48
|
+
type: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
loop: {
|
|
52
|
+
anyOf: ({
|
|
53
|
+
type: string;
|
|
54
|
+
additionalProperties: boolean;
|
|
55
|
+
required: string[];
|
|
56
|
+
properties: {
|
|
57
|
+
start: {
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
end: {
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
} | {
|
|
65
|
+
type: string;
|
|
66
|
+
})[];
|
|
67
|
+
};
|
|
68
|
+
type: {
|
|
69
|
+
type: string;
|
|
70
|
+
enum: string[];
|
|
71
|
+
};
|
|
72
|
+
muted: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
playing: {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
elapsedTime: {
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
playIcon: {
|
|
82
|
+
type: string;
|
|
83
|
+
additionalProperties: boolean;
|
|
84
|
+
properties: {
|
|
85
|
+
type: {
|
|
86
|
+
type: string;
|
|
87
|
+
enum: string[];
|
|
88
|
+
};
|
|
89
|
+
theme: {
|
|
90
|
+
type: string;
|
|
91
|
+
enum: string[];
|
|
92
|
+
};
|
|
93
|
+
text: {
|
|
94
|
+
type: string;
|
|
95
|
+
contentType: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
controls: {
|
|
100
|
+
type: string;
|
|
101
|
+
enum: string[];
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
youtube: {
|
|
106
|
+
type: string;
|
|
107
|
+
};
|
|
108
|
+
parallax: {
|
|
109
|
+
type: string;
|
|
110
|
+
};
|
|
111
|
+
height: {
|
|
112
|
+
type: string;
|
|
113
|
+
};
|
|
114
|
+
previewImg: {
|
|
115
|
+
type: string;
|
|
116
|
+
};
|
|
117
|
+
dataLens: {
|
|
118
|
+
oneOf: ({
|
|
119
|
+
type: string;
|
|
120
|
+
additionalProperties: boolean;
|
|
121
|
+
required: string[];
|
|
122
|
+
properties: {
|
|
123
|
+
id: {
|
|
124
|
+
type: string;
|
|
125
|
+
};
|
|
126
|
+
theme: {
|
|
127
|
+
type: string;
|
|
128
|
+
enum: string[];
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
type: string;
|
|
133
|
+
})[];
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
content: Partial<{
|
|
137
|
+
title: {
|
|
138
|
+
oneOf: ({
|
|
139
|
+
type: string;
|
|
140
|
+
additionalProperties: boolean;
|
|
141
|
+
required: string[];
|
|
142
|
+
properties: {
|
|
143
|
+
text: {
|
|
144
|
+
type: string;
|
|
145
|
+
contentType: string;
|
|
146
|
+
};
|
|
147
|
+
textSize: {
|
|
148
|
+
type: string;
|
|
149
|
+
enum: string[];
|
|
150
|
+
};
|
|
151
|
+
url: {
|
|
152
|
+
type: string;
|
|
153
|
+
};
|
|
154
|
+
resetMargin: {
|
|
155
|
+
type: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
} | {
|
|
159
|
+
type: string;
|
|
160
|
+
contentType: string;
|
|
161
|
+
})[];
|
|
162
|
+
};
|
|
163
|
+
text: {
|
|
164
|
+
type: string;
|
|
165
|
+
contentType: string;
|
|
166
|
+
};
|
|
167
|
+
additionalInfo: {
|
|
168
|
+
type: string;
|
|
169
|
+
contentType: string;
|
|
170
|
+
};
|
|
171
|
+
size: {
|
|
172
|
+
type: string;
|
|
173
|
+
enum: string[];
|
|
174
|
+
};
|
|
175
|
+
links: {
|
|
176
|
+
type: string;
|
|
177
|
+
items: {
|
|
178
|
+
type: string;
|
|
179
|
+
properties: {
|
|
180
|
+
when: {
|
|
181
|
+
type: string;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
buttons: {
|
|
187
|
+
type: string;
|
|
188
|
+
items: {
|
|
189
|
+
type: string;
|
|
190
|
+
properties: {
|
|
191
|
+
when: {
|
|
192
|
+
type: string;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
theme: {
|
|
198
|
+
type: string;
|
|
199
|
+
enum: string[];
|
|
200
|
+
};
|
|
201
|
+
}>;
|
|
202
|
+
metaInfo: {
|
|
203
|
+
type: string;
|
|
204
|
+
items: {
|
|
205
|
+
type: string;
|
|
206
|
+
contentType: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
border: {
|
|
210
|
+
type: string;
|
|
211
|
+
};
|
|
212
|
+
fullScreen: {
|
|
213
|
+
type: string;
|
|
214
|
+
};
|
|
215
|
+
type: {};
|
|
216
|
+
when: {};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LayoutItem = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const common_1 = require("../../schema/validators/common");
|
|
7
|
+
const schema_1 = require("../../sub-blocks/Content/schema");
|
|
8
|
+
const schema_2 = tslib_1.__importDefault(require("../../components/MetaInfo/schema"));
|
|
9
|
+
exports.LayoutItem = {
|
|
10
|
+
type: 'object',
|
|
11
|
+
additionalProperties: false,
|
|
12
|
+
required: ['content', 'media'],
|
|
13
|
+
properties: Object.assign(Object.assign({}, common_1.BaseProps), { media: common_1.MediaProps, content: (0, lodash_1.omit)(schema_1.ContentBase, ['colSize', 'size', 'centered']), metaInfo: schema_2.default, border: {
|
|
14
|
+
type: 'boolean',
|
|
15
|
+
}, fullScreen: {
|
|
16
|
+
type: 'boolean',
|
|
17
|
+
} }),
|
|
18
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LayoutItemProps, LinkTheme, MediaProps } from '../../models';
|
|
2
|
+
export declare const getLayoutItemLinks: (links: LayoutItemProps['content']['links']) => {
|
|
3
|
+
url: string;
|
|
4
|
+
text?: string | undefined;
|
|
5
|
+
textSize?: import("../../models").TextSize | undefined;
|
|
6
|
+
theme: LinkTheme;
|
|
7
|
+
colorTheme?: import("../../models").TextTheme | undefined;
|
|
8
|
+
arrow?: boolean | undefined;
|
|
9
|
+
target?: string | undefined;
|
|
10
|
+
metrikaGoals?: import("../../models").MetrikaGoal | undefined;
|
|
11
|
+
pixelEvents?: import("../../models").ButtonPixel | undefined;
|
|
12
|
+
context?: string | undefined;
|
|
13
|
+
analyticsEvents?: {
|
|
14
|
+
name: string;
|
|
15
|
+
type?: string | undefined;
|
|
16
|
+
counters?: import("../../models").AnalyticsCounters | undefined;
|
|
17
|
+
context?: string | undefined;
|
|
18
|
+
target?: string | undefined;
|
|
19
|
+
} | {
|
|
20
|
+
name: string;
|
|
21
|
+
type?: string | undefined;
|
|
22
|
+
counters?: import("../../models").AnalyticsCounters | undefined;
|
|
23
|
+
context?: string | undefined;
|
|
24
|
+
target?: string | undefined;
|
|
25
|
+
}[] | undefined;
|
|
26
|
+
className?: string | undefined;
|
|
27
|
+
}[] | undefined;
|
|
28
|
+
export declare const hasFullScreen: ({ dataLens, image }: MediaProps) => boolean;
|
|
29
|
+
export declare const showFullScreenIcon: ({ youtube }: MediaProps) => boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.showFullScreenIcon = exports.hasFullScreen = exports.getLayoutItemLinks = void 0;
|
|
4
|
+
const getLayoutItemLinks = (links) => links === null || links === void 0 ? void 0 : links.map((link) => (Object.assign({ theme: 'normal' }, link)));
|
|
5
|
+
exports.getLayoutItemLinks = getLayoutItemLinks;
|
|
6
|
+
const hasFullScreen = ({ dataLens, image }) => {
|
|
7
|
+
// datalens and slider media card don't support fullScreen mode
|
|
8
|
+
return !(dataLens || Array.isArray(image));
|
|
9
|
+
};
|
|
10
|
+
exports.hasFullScreen = hasFullScreen;
|
|
11
|
+
const showFullScreenIcon = ({ youtube }) => !youtube;
|
|
12
|
+
exports.showFullScreenIcon = showFullScreenIcon;
|
|
@@ -7,16 +7,16 @@ const utils_1 = require("../../utils");
|
|
|
7
7
|
const models_1 = require("../../models");
|
|
8
8
|
const components_1 = require("../../components");
|
|
9
9
|
const ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
|
|
10
|
+
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
10
11
|
const utils_2 = require("../../components/Media/Image/utils");
|
|
11
12
|
const hooks_1 = require("../../hooks");
|
|
12
|
-
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
13
13
|
const b = (0, utils_1.block)('quote');
|
|
14
14
|
const Quote = (props) => {
|
|
15
15
|
const { theme: textTheme = 'light', color, image, border = 'shadow', text, logo, author, url, buttonText, } = props;
|
|
16
16
|
const { themeValue: theme } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
|
|
17
|
+
const context = (0, react_1.useContext)(blockPositionContext_1.BlockPositionContext);
|
|
17
18
|
const imageThemed = (0, utils_1.getThemedValue)(image, theme);
|
|
18
19
|
const imageData = (0, utils_2.getMediaImage)(imageThemed);
|
|
19
|
-
const context = (0, react_1.useContext)(blockPositionContext_1.BlockPositionContext);
|
|
20
20
|
const defaultEvent = (0, react_1.useMemo)(() => ({
|
|
21
21
|
name: 'quote-button-click',
|
|
22
22
|
type: models_1.PredefinedEventTypes.Default,
|
|
@@ -18,8 +18,6 @@ exports.Quote = {
|
|
|
18
18
|
}, url: {
|
|
19
19
|
type: 'string',
|
|
20
20
|
pattern: schema_1.urlPattern,
|
|
21
|
-
}, theme: common_1.ThemeProps, author: common_1.authorItem,
|
|
22
|
-
type: 'string',
|
|
23
|
-
} }),
|
|
21
|
+
}, theme: common_1.ThemeProps, author: common_1.authorItem }),
|
|
24
22
|
},
|
|
25
23
|
};
|
|
@@ -7,6 +7,7 @@ export { default as MediaCard } from './MediaCard/MediaCard';
|
|
|
7
7
|
export { default as BannerCard } from './BannerCard/BannerCard';
|
|
8
8
|
export { default as TutorialCard } from './TutorialCard/TutorialCard';
|
|
9
9
|
export { default as CardWithImage } from './CardWithImage/CardWithImage';
|
|
10
|
+
export { default as LayoutItem } from './LayoutItem/LayoutItem';
|
|
10
11
|
export { default as BackgroundCard } from './BackgroundCard/BackgroundCard';
|
|
11
12
|
export { default as BasicCard } from './BasicCard/BasicCard';
|
|
12
13
|
export { default as Content } from './Content/Content';
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HubspotForm = exports.Content = exports.BasicCard = exports.BackgroundCard = exports.CardWithImage = exports.TutorialCard = exports.BannerCard = exports.MediaCard = exports.PriceDetailed = exports.Partner = exports.NewsCard = exports.Quote = exports.Divider = void 0;
|
|
6
|
+
exports.HubspotForm = exports.Content = exports.BasicCard = exports.BackgroundCard = exports.LayoutItem = exports.CardWithImage = exports.TutorialCard = exports.BannerCard = exports.MediaCard = exports.PriceDetailed = exports.Partner = exports.NewsCard = exports.Quote = exports.Divider = void 0;
|
|
7
7
|
var Divider_1 = require("./Divider/Divider");
|
|
8
8
|
Object.defineProperty(exports, "Divider", { enumerable: true, get: function () { return __importDefault(Divider_1).default; } });
|
|
9
9
|
var Quote_1 = require("./Quote/Quote");
|
|
@@ -22,6 +22,8 @@ var TutorialCard_1 = require("./TutorialCard/TutorialCard");
|
|
|
22
22
|
Object.defineProperty(exports, "TutorialCard", { enumerable: true, get: function () { return __importDefault(TutorialCard_1).default; } });
|
|
23
23
|
var CardWithImage_1 = require("./CardWithImage/CardWithImage");
|
|
24
24
|
Object.defineProperty(exports, "CardWithImage", { enumerable: true, get: function () { return __importDefault(CardWithImage_1).default; } });
|
|
25
|
+
var LayoutItem_1 = require("./LayoutItem/LayoutItem");
|
|
26
|
+
Object.defineProperty(exports, "LayoutItem", { enumerable: true, get: function () { return __importDefault(LayoutItem_1).default; } });
|
|
25
27
|
var BackgroundCard_1 = require("./BackgroundCard/BackgroundCard");
|
|
26
28
|
Object.defineProperty(exports, "BackgroundCard", { enumerable: true, get: function () { return __importDefault(BackgroundCard_1).default; } });
|
|
27
29
|
var BasicCard_1 = require("./BasicCard/BasicCard");
|
|
@@ -144,6 +144,23 @@ const config = {
|
|
|
144
144
|
transformer: typografTransformer,
|
|
145
145
|
},
|
|
146
146
|
],
|
|
147
|
+
[models_1.SubBlockType.LayoutItem]: [
|
|
148
|
+
{
|
|
149
|
+
fields: ['content'],
|
|
150
|
+
parser: parseContentLayout,
|
|
151
|
+
transformer: yfmTransformer,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
fields: ['content'],
|
|
155
|
+
parser: parseContentLayoutTitle,
|
|
156
|
+
transformer: typografTransformer,
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
fields: ['metaInfo'],
|
|
160
|
+
parser: (0, exports.createItemsParser)([]),
|
|
161
|
+
transformer: typografTransformer,
|
|
162
|
+
},
|
|
163
|
+
],
|
|
147
164
|
[models_1.SubBlockType.Quote]: {
|
|
148
165
|
fields: ['text'],
|
|
149
166
|
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;
|
|
@@ -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
|
}
|
|
@@ -270,9 +270,6 @@ export declare const BannerCardProps: {
|
|
|
270
270
|
required: string[];
|
|
271
271
|
};
|
|
272
272
|
};
|
|
273
|
-
context: {
|
|
274
|
-
type: string;
|
|
275
|
-
};
|
|
276
273
|
animated: {
|
|
277
274
|
type: string;
|
|
278
275
|
};
|
|
@@ -553,9 +550,6 @@ export declare const BannerBlock: {
|
|
|
553
550
|
required: string[];
|
|
554
551
|
};
|
|
555
552
|
};
|
|
556
|
-
context: {
|
|
557
|
-
type: string;
|
|
558
|
-
};
|
|
559
553
|
animated: {
|
|
560
554
|
type: string;
|
|
561
555
|
};
|
|
@@ -837,9 +831,6 @@ export declare const BannerCard: {
|
|
|
837
831
|
required: string[];
|
|
838
832
|
};
|
|
839
833
|
};
|
|
840
|
-
context: {
|
|
841
|
-
type: string;
|
|
842
|
-
};
|
|
843
834
|
animated: {
|
|
844
835
|
type: string;
|
|
845
836
|
};
|
|
@@ -17,9 +17,7 @@ export const BannerCardProps = {
|
|
|
17
17
|
}), theme: ThemeProps, width: {
|
|
18
18
|
type: 'string',
|
|
19
19
|
enum: ['s', 'm', 'l'],
|
|
20
|
-
}, button: ButtonBlock,
|
|
21
|
-
type: 'string',
|
|
22
|
-
} }),
|
|
20
|
+
}, button: ButtonBlock }),
|
|
23
21
|
};
|
|
24
22
|
export const BannerBlock = {
|
|
25
23
|
'banner-block': BannerCardProps,
|