@gravity-ui/page-constructor 1.26.0-alpha.2 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/build/cjs/blocks/Header/Header.js +2 -5
- package/build/cjs/blocks/Icons/Icons.js +1 -1
- package/build/cjs/blocks/Map/schema.d.ts +0 -12
- package/build/cjs/blocks/Share/Share.js +1 -2
- package/build/cjs/components/BackLink/BackLink.js +1 -2
- package/build/cjs/components/Button/Button.js +1 -2
- package/build/cjs/components/FileLink/FileLink.js +1 -2
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -2
- package/build/cjs/components/Link/Link.js +1 -2
- package/build/cjs/components/Map/GoogleMap.js +7 -5
- package/build/cjs/components/Map/Map.css +5 -0
- package/build/cjs/components/Map/YMap/YMap.d.ts +4 -2
- package/build/cjs/components/Map/YMap/YMap.js +18 -10
- package/build/cjs/components/Map/YMap/YandexMap.js +18 -9
- package/build/cjs/components/Title/Title.js +1 -2
- package/build/cjs/components/index.d.ts +0 -1
- package/build/cjs/components/index.js +1 -3
- package/build/cjs/constructor-items.d.ts +0 -1
- package/build/cjs/constructor-items.js +0 -1
- package/build/cjs/models/constructor-items/common.d.ts +0 -79
- package/build/cjs/models/constructor-items/common.js +1 -14
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -6
- package/build/cjs/models/constructor-items/sub-blocks.js +0 -1
- package/build/cjs/navigation/components/NavigationItem/components/GithubButton/GithubButton.js +1 -2
- package/build/cjs/navigation/components/SocialIcon/SocialIcon.js +1 -1
- package/build/cjs/schema/index.js +1 -3
- package/build/cjs/schema/validators/common.d.ts +0 -6
- package/build/cjs/schema/validators/common.js +0 -4
- package/build/cjs/schema/validators/sub-blocks.d.ts +0 -1
- package/build/cjs/schema/validators/sub-blocks.js +0 -1
- package/build/cjs/sub-blocks/Quote/Quote.js +1 -1
- package/build/cjs/sub-blocks/index.d.ts +0 -1
- package/build/cjs/sub-blocks/index.js +1 -3
- package/build/cjs/text-transform/blocks.js +0 -27
- package/build/esm/blocks/Header/Header.js +3 -6
- package/build/esm/blocks/Icons/Icons.js +2 -2
- package/build/esm/blocks/Map/schema.d.ts +0 -12
- package/build/esm/blocks/Share/Share.js +1 -2
- package/build/esm/components/BackLink/BackLink.js +1 -2
- package/build/esm/components/Button/Button.js +1 -2
- package/build/esm/components/FileLink/FileLink.js +1 -2
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -2
- package/build/esm/components/Link/Link.js +1 -2
- package/build/esm/components/Map/GoogleMap.js +7 -5
- package/build/esm/components/Map/Map.css +5 -0
- package/build/esm/components/Map/YMap/YMap.d.ts +4 -2
- package/build/esm/components/Map/YMap/YMap.js +18 -10
- package/build/esm/components/Map/YMap/YandexMap.js +18 -9
- package/build/esm/components/Title/Title.js +1 -2
- package/build/esm/components/index.d.ts +0 -1
- package/build/esm/components/index.js +0 -1
- package/build/esm/constructor-items.d.ts +0 -1
- package/build/esm/constructor-items.js +1 -2
- package/build/esm/models/constructor-items/common.d.ts +0 -79
- package/build/esm/models/constructor-items/common.js +0 -13
- package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -6
- package/build/esm/models/constructor-items/sub-blocks.js +0 -1
- package/build/esm/navigation/components/NavigationItem/components/GithubButton/GithubButton.js +1 -2
- package/build/esm/navigation/components/SocialIcon/SocialIcon.js +2 -2
- package/build/esm/schema/index.js +2 -4
- package/build/esm/schema/validators/common.d.ts +0 -6
- package/build/esm/schema/validators/common.js +0 -4
- package/build/esm/schema/validators/sub-blocks.d.ts +0 -1
- package/build/esm/schema/validators/sub-blocks.js +0 -1
- package/build/esm/sub-blocks/Quote/Quote.js +2 -2
- package/build/esm/sub-blocks/index.d.ts +0 -1
- package/build/esm/sub-blocks/index.js +0 -1
- package/build/esm/text-transform/blocks.js +0 -27
- package/package.json +10 -6
- package/server/models/constructor-items/common.d.ts +0 -79
- package/server/models/constructor-items/common.js +1 -14
- package/server/models/constructor-items/sub-blocks.d.ts +2 -6
- package/server/models/constructor-items/sub-blocks.js +0 -1
- package/server/text-transform/blocks.js +0 -27
- package/build/cjs/components/LinkBase/LinkBase.d.ts +0 -3
- package/build/cjs/components/LinkBase/LinkBase.js +0 -18
- package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.css +0 -35
- package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.d.ts +0 -12
- package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +0 -60
- package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.css +0 -62
- package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.d.ts +0 -10
- package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.js +0 -54
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetailed.d.ts +0 -3
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetailed.js +0 -22
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/List.css +0 -11
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/List.d.ts +0 -7
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/List.js +0 -15
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.css +0 -20
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.d.ts +0 -8
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.js +0 -15
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.css +0 -43
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.d.ts +0 -11
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.js +0 -56
- package/build/cjs/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.css +0 -9
- package/build/cjs/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.d.ts +0 -10
- package/build/cjs/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +0 -15
- package/build/cjs/sub-blocks/PriceDetailed/schema.d.ts +0 -93
- package/build/cjs/sub-blocks/PriceDetailed/schema.js +0 -155
- package/build/esm/components/LinkBase/LinkBase.d.ts +0 -3
- package/build/esm/components/LinkBase/LinkBase.js +0 -16
- package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.css +0 -35
- package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.d.ts +0 -13
- package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +0 -58
- package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.css +0 -62
- package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.d.ts +0 -11
- package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.js +0 -52
- package/build/esm/sub-blocks/PriceDetailed/PriceDetailed.d.ts +0 -3
- package/build/esm/sub-blocks/PriceDetailed/PriceDetailed.js +0 -19
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/List.css +0 -11
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/List.d.ts +0 -8
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/List.js +0 -13
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.css +0 -20
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.d.ts +0 -9
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.js +0 -13
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.css +0 -43
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.d.ts +0 -12
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.js +0 -54
- package/build/esm/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.css +0 -9
- package/build/esm/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.d.ts +0 -11
- package/build/esm/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +0 -13
- package/build/esm/sub-blocks/PriceDetailed/schema.d.ts +0 -93
- package/build/esm/sub-blocks/PriceDetailed/schema.js +0 -152
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.0.0](https://github.com/gravity-ui/page-constructor/compare/v1.25.2...v2.0.0) (2023-03-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* update uikit up to 4, update react up to 18([#134](https://github.com/gravity-ui/page-constructor/issues/134)) (#212)
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* map-block changing the logic of zoom and center ([#219](https://github.com/gravity-ui/page-constructor/issues/219)) ([d332844](https://github.com/gravity-ui/page-constructor/commit/d33284425878cdbfacdf7813826d909e9ab696cb))
|
|
13
|
+
* update uikit up to 4, update react up to 18([#134](https://github.com/gravity-ui/page-constructor/issues/134)) ([#212](https://github.com/gravity-ui/page-constructor/issues/212)) ([377b1f5](https://github.com/gravity-ui/page-constructor/commit/377b1f59c25d08458082232075e2e7bcfe84fe5c))
|
|
14
|
+
|
|
3
15
|
## [1.25.2](https://github.com/gravity-ui/page-constructor/compare/v1.25.1...v1.25.2) (2023-03-21)
|
|
4
16
|
|
|
5
17
|
|
|
@@ -59,11 +59,8 @@ const HeaderBlock = (props) => {
|
|
|
59
59
|
description && (react_1.default.createElement("h5", { className: b('description') },
|
|
60
60
|
react_1.default.createElement(YFMWrapper_1.default, { content: description, modifiers: { constructor: true } }))),
|
|
61
61
|
buttons && (react_1.default.createElement("div", { className: b('buttons'), "data-qa": "header-buttons" }, buttons &&
|
|
62
|
-
buttons.map((button, index) => (
|
|
63
|
-
|
|
64
|
-
react_1.default.createElement(components_1.Button, Object.assign({ key: index, className: b('button'), size: "xl" }, button))
|
|
65
|
-
// </RouterLink>
|
|
66
|
-
)))),
|
|
62
|
+
buttons.map((button, index) => (react_1.default.createElement(components_1.RouterLink, { href: button.url, key: index },
|
|
63
|
+
react_1.default.createElement(components_1.Button, Object.assign({ key: index, className: b('button'), size: "xl" }, button))))))),
|
|
67
64
|
children))),
|
|
68
65
|
hasRightSideImage && (react_1.default.createElement(components_1.Media, { className: b('media', { [curImageSize]: true }), videoClassName: b('video'), imageClassName: b('image'), video: videoThemed, image: imageThemed })))))));
|
|
69
66
|
};
|
|
@@ -10,7 +10,7 @@ const Icons = ({ title, size = 's', items }) => {
|
|
|
10
10
|
const { hostname } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
11
11
|
return (react_1.default.createElement("div", { className: b({ size }) },
|
|
12
12
|
title && react_1.default.createElement(components_1.BlockHeader, { className: b('header'), title: title, colSizes: { all: 12 } }),
|
|
13
|
-
items.map((item) => (react_1.default.createElement(
|
|
13
|
+
items.map((item) => (react_1.default.createElement("a", Object.assign({ className: b('item'), key: item.url, href: item.url }, (0, utils_1.getLinkProps)(item.url, hostname)),
|
|
14
14
|
react_1.default.createElement(components_1.Image, { className: b('image'), src: item.src }),
|
|
15
15
|
react_1.default.createElement("p", { className: b('text') }, item.text))))));
|
|
16
16
|
};
|
|
@@ -6,12 +6,6 @@ export declare const Map: {
|
|
|
6
6
|
zoom: {
|
|
7
7
|
type: string;
|
|
8
8
|
};
|
|
9
|
-
center: {
|
|
10
|
-
type: string;
|
|
11
|
-
items: {
|
|
12
|
-
type: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
9
|
address: {
|
|
16
10
|
type: string;
|
|
17
11
|
};
|
|
@@ -70,12 +64,6 @@ export declare const MapBlock: {
|
|
|
70
64
|
zoom: {
|
|
71
65
|
type: string;
|
|
72
66
|
};
|
|
73
|
-
center: {
|
|
74
|
-
type: string;
|
|
75
|
-
items: {
|
|
76
|
-
type: string;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
67
|
address: {
|
|
80
68
|
type: string;
|
|
81
69
|
};
|
|
@@ -13,7 +13,6 @@ const Twitter_1 = require("../../icons/Twitter");
|
|
|
13
13
|
const Linkedin_1 = require("../../icons/Linkedin");
|
|
14
14
|
const Vk_1 = require("../../icons/Vk");
|
|
15
15
|
const Telegram_1 = require("../../icons/Telegram");
|
|
16
|
-
const components_1 = require("../../components");
|
|
17
16
|
const icons = {
|
|
18
17
|
facebook: Facebook_1.Facebook,
|
|
19
18
|
twitter: Twitter_1.Twitter,
|
|
@@ -32,7 +31,7 @@ const Share = ({ items, title }) => {
|
|
|
32
31
|
const url = (0, utils_1.getAbsolutePath)(hostname, pathname);
|
|
33
32
|
const socialUrl = (0, utils_1.getShareLink)(url, type);
|
|
34
33
|
const icon = icons[type];
|
|
35
|
-
return (react_1.default.createElement(uikit_1.Button, { key: type, view: "flat", size: "l", target: "_blank", href: socialUrl,
|
|
34
|
+
return (react_1.default.createElement(uikit_1.Button, { key: type, view: "flat", size: "l", target: "_blank", href: socialUrl, className: b('item', { type: type.toLowerCase() }), onClick: handleButtonClick }, icon && react_1.default.createElement(uikit_1.Icon, { data: icon, size: 24, className: b('icon', { type }) })));
|
|
36
35
|
}))));
|
|
37
36
|
};
|
|
38
37
|
exports.default = Share;
|
|
@@ -7,7 +7,6 @@ const icons_1 = require("../../icons");
|
|
|
7
7
|
const locationContext_1 = require("../../context/locationContext");
|
|
8
8
|
const hooks_1 = require("../../hooks");
|
|
9
9
|
const models_1 = require("../../models");
|
|
10
|
-
const RouterLink_1 = tslib_1.__importDefault(require("../RouterLink/RouterLink"));
|
|
11
10
|
function BackLink(props) {
|
|
12
11
|
const { history } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
13
12
|
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, } = props;
|
|
@@ -27,7 +26,7 @@ function BackLink(props) {
|
|
|
27
26
|
history.push({ pathname: url });
|
|
28
27
|
}
|
|
29
28
|
}, [handleAnalytics, history, onClick, url]);
|
|
30
|
-
return (react_1.default.createElement(uikit_1.Button, {
|
|
29
|
+
return (react_1.default.createElement(uikit_1.Button, { className: className, view: theme === 'special' ? 'flat-contrast' : 'flat-secondary', size: size, href: shouldHandleBackAction ? undefined : url, onClick: shouldHandleBackAction ? backActionHandler : undefined },
|
|
31
30
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.ArrowSidebar, size: 24 }),
|
|
32
31
|
react_1.default.createElement("span", null, title)));
|
|
33
32
|
}
|
|
@@ -10,7 +10,6 @@ const localeContext_1 = require("../../context/localeContext/localeContext");
|
|
|
10
10
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
11
11
|
const hooks_1 = require("../../hooks");
|
|
12
12
|
const icons_1 = require("../../icons");
|
|
13
|
-
const RouterLink_1 = tslib_1.__importDefault(require("../RouterLink/RouterLink"));
|
|
14
13
|
const b = (0, utils_1.block)('button-block');
|
|
15
14
|
const Button = (props) => {
|
|
16
15
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
@@ -43,7 +42,7 @@ const Button = (props) => {
|
|
|
43
42
|
image = undefined;
|
|
44
43
|
}
|
|
45
44
|
const buttonTheme = theme === 'scale' ? 'accent' : theme;
|
|
46
|
-
return (react_1.default.createElement(uikit_1.Button, Object.assign({ className: buttonClass, view: (0, utils_2.toCommonView)(buttonTheme), size: (0, utils_2.toCommonSize)(size), href: url ? (0, utils_1.setUrlTld)(url, tld) : undefined
|
|
45
|
+
return (react_1.default.createElement(uikit_1.Button, Object.assign({ className: buttonClass, view: (0, utils_2.toCommonView)(buttonTheme), size: (0, utils_2.toCommonSize)(size), href: url ? (0, utils_1.setUrlTld)(url, tld) : undefined }, buttonProps),
|
|
47
46
|
icon && buttonImg.position === 'left' ? icon : null,
|
|
48
47
|
react_1.default.createElement("span", { className: b('content') },
|
|
49
48
|
image && buttonImg.position === 'left' ? image : null,
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
7
7
|
const locationContext_1 = require("../../context/locationContext");
|
|
8
|
-
const LinkBase_1 = tslib_1.__importDefault(require("../LinkBase/LinkBase"));
|
|
9
8
|
const b = (0, utils_1.block)('file-link');
|
|
10
9
|
const FIGMA_URL = 'https://www.figma.com';
|
|
11
10
|
var FileExtension;
|
|
@@ -32,6 +31,6 @@ const FileLink = (props) => {
|
|
|
32
31
|
return (react_1.default.createElement("div", { className: b({ ext: fileExt, type, size: textSize, theme }, className) },
|
|
33
32
|
Object.values(FileExtension).includes(fileExt) && (react_1.default.createElement("div", { className: b('file-label') }, fileExt)),
|
|
34
33
|
react_1.default.createElement("div", { className: b('link') },
|
|
35
|
-
react_1.default.createElement(
|
|
34
|
+
react_1.default.createElement("a", Object.assign({ href: href }, (0, utils_1.getLinkProps)(href, hostname), { onClick: onClick }), text))));
|
|
36
35
|
};
|
|
37
36
|
exports.default = FileLink;
|
|
@@ -4,7 +4,6 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
7
|
-
const LinkBase_1 = tslib_1.__importDefault(require("../LinkBase/LinkBase"));
|
|
8
7
|
const b = (0, utils_1.block)('header-breadcrumbs');
|
|
9
8
|
function HeaderBreadcrumbs(props) {
|
|
10
9
|
const { items, metrikaGoals, pixelEvents, theme = 'light', className } = props;
|
|
@@ -13,6 +12,6 @@ function HeaderBreadcrumbs(props) {
|
|
|
13
12
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
14
13
|
};
|
|
15
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 },
|
|
16
|
-
react_1.default.createElement(
|
|
15
|
+
react_1.default.createElement("a", { href: item.url, className: b('text'), onClick: onClick }, item.text))))));
|
|
17
16
|
}
|
|
18
17
|
exports.default = HeaderBreadcrumbs;
|
|
@@ -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 icons_1 = require("../../icons");
|
|
9
|
-
const LinkBase_1 = tslib_1.__importDefault(require("../LinkBase/LinkBase"));
|
|
10
9
|
const FileLink_1 = tslib_1.__importDefault(require("../FileLink/FileLink"));
|
|
11
10
|
const BackLink_1 = tslib_1.__importDefault(require("../BackLink/BackLink"));
|
|
12
11
|
const localeContext_1 = require("../../context/localeContext/localeContext");
|
|
@@ -49,7 +48,7 @@ const LinkBlock = (props) => {
|
|
|
49
48
|
case 'normal': {
|
|
50
49
|
const linkProps = (0, utils_1.getLinkProps)(url, hostname, target);
|
|
51
50
|
const content = children || text;
|
|
52
|
-
return (react_1.default.createElement(
|
|
51
|
+
return (react_1.default.createElement("a", Object.assign({ className: b('link', { theme: colorTheme, 'has-arrow': arrow }), href: href, onClick: onClick }, linkProps), arrow ? (react_1.default.createElement(react_1.Fragment, null,
|
|
53
52
|
react_1.default.createElement("span", { className: b('content') }, content),
|
|
54
53
|
WORD_JOINER_SYM,
|
|
55
54
|
react_1.default.createElement(uikit_1.Icon, { className: b('arrow'), data: icons_1.Chevron, size: getArrowSize(textSize) }))) : (content)));
|
|
@@ -8,18 +8,20 @@ const mapsContext_1 = require("../../context/mapsContext/mapsContext");
|
|
|
8
8
|
const localeContext_1 = require("../../context/localeContext/localeContext");
|
|
9
9
|
const mobileContext_1 = require("../../context/mobileContext");
|
|
10
10
|
const helpers_1 = require("./helpers");
|
|
11
|
+
const configure_1 = require("../../utils/configure");
|
|
11
12
|
const b = (0, utils_1.block)('map');
|
|
12
|
-
function getScriptSrc(
|
|
13
|
-
|
|
13
|
+
function getScriptSrc(params) {
|
|
14
|
+
const { apiKey, scriptSrc, address, lang, zoom } = params;
|
|
15
|
+
return `${scriptSrc}?key=${apiKey}&language=${lang}${zoom ? '&zoom=' + zoom : ''}&q=${encodeURI(address)}`;
|
|
14
16
|
}
|
|
15
17
|
const GoogleMap = (props) => {
|
|
16
|
-
const { address } = props;
|
|
18
|
+
const { address, zoom } = props;
|
|
17
19
|
const { apiKey, scriptSrc } = (0, react_1.useContext)(mapsContext_1.MapsContext);
|
|
18
|
-
const { lang =
|
|
20
|
+
const { lang = configure_1.Lang.Ru } = (0, react_1.useContext)(localeContext_1.LocaleContext);
|
|
19
21
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
20
22
|
const [height, setHeight] = (0, react_1.useState)(undefined);
|
|
21
23
|
const ref = (0, react_1.useRef)(null);
|
|
22
|
-
const src = (0, react_1.useMemo)(() => getScriptSrc(apiKey, scriptSrc, address, lang), [apiKey, scriptSrc, address, lang]);
|
|
24
|
+
const src = (0, react_1.useMemo)(() => getScriptSrc({ apiKey, scriptSrc, address, lang, zoom }), [apiKey, scriptSrc, address, lang, zoom]);
|
|
23
25
|
(0, react_1.useEffect)(() => {
|
|
24
26
|
const updateSize = lodash_1.default.debounce(() => {
|
|
25
27
|
if (ref.current) {
|
|
@@ -7,9 +7,13 @@ unpredictable css rules order in build */
|
|
|
7
7
|
overflow: hidden;
|
|
8
8
|
display: flex;
|
|
9
9
|
}
|
|
10
|
+
.pc-map_hidden {
|
|
11
|
+
opacity: 0;
|
|
12
|
+
}
|
|
10
13
|
.pc-map__spinner {
|
|
11
14
|
margin: 0 auto;
|
|
12
15
|
align-self: center;
|
|
16
|
+
position: absolute;
|
|
13
17
|
}
|
|
14
18
|
.pc-map__wrapper {
|
|
15
19
|
min-height: 300px;
|
|
@@ -17,4 +21,5 @@ unpredictable css rules order in build */
|
|
|
17
21
|
flex-direction: column;
|
|
18
22
|
align-items: center;
|
|
19
23
|
justify-content: center;
|
|
24
|
+
position: relative;
|
|
20
25
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { YMapMarker } from '../../../models';
|
|
1
|
+
import { YMapProps, YMapMarker } from '../../../models';
|
|
2
|
+
type PlacemarksProps = Pick<YMapProps, 'zoom' | 'markers'>;
|
|
2
3
|
export declare class YMap {
|
|
3
4
|
private ymap;
|
|
4
5
|
private mapRef;
|
|
5
6
|
private coords;
|
|
6
7
|
constructor(ymap: Ymaps.Map, mapRef: HTMLDivElement | null);
|
|
7
|
-
showPlacemarks(
|
|
8
|
+
showPlacemarks(props: PlacemarksProps): Promise<void>;
|
|
8
9
|
findAddress(marker: YMapMarker): Promise<void>;
|
|
9
10
|
findCoordinate(marker: YMapMarker): void;
|
|
10
11
|
private drawPlaceMarkStyle;
|
|
11
12
|
private recalcZoomAndCenter;
|
|
12
13
|
private clearOldPlacemarks;
|
|
13
14
|
}
|
|
15
|
+
export {};
|
|
@@ -22,9 +22,9 @@ class YMap {
|
|
|
22
22
|
this.ymap = ymap;
|
|
23
23
|
this.mapRef = mapRef;
|
|
24
24
|
}
|
|
25
|
-
async showPlacemarks(
|
|
25
|
+
async showPlacemarks(props) {
|
|
26
26
|
this.clearOldPlacemarks();
|
|
27
|
-
for (const marker of markers) {
|
|
27
|
+
for (const marker of props.markers) {
|
|
28
28
|
if (marker.address) {
|
|
29
29
|
await this.findAddress(marker);
|
|
30
30
|
}
|
|
@@ -32,7 +32,7 @@ class YMap {
|
|
|
32
32
|
this.findCoordinate(marker);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
this.recalcZoomAndCenter();
|
|
35
|
+
this.recalcZoomAndCenter(props);
|
|
36
36
|
}
|
|
37
37
|
async findAddress(marker) {
|
|
38
38
|
try {
|
|
@@ -52,10 +52,7 @@ class YMap {
|
|
|
52
52
|
this.ymap.geoObjects.add(geoObject);
|
|
53
53
|
}
|
|
54
54
|
drawPlaceMarkStyle(geoObject, marker) {
|
|
55
|
-
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const { iconColor, preset = DEFAULT_PLACEMARKS_PRESET } = marker.label;
|
|
55
|
+
const { iconColor, preset = DEFAULT_PLACEMARKS_PRESET } = marker.label || {};
|
|
59
56
|
let localIconColor = iconColor;
|
|
60
57
|
// You can set the preset option together with the iconColor option only if it not a 'Stretchy' preset
|
|
61
58
|
if (!preset.includes('Stretchy') && !iconColor) {
|
|
@@ -68,9 +65,10 @@ class YMap {
|
|
|
68
65
|
}
|
|
69
66
|
});
|
|
70
67
|
}
|
|
71
|
-
recalcZoomAndCenter() {
|
|
68
|
+
recalcZoomAndCenter(props) {
|
|
72
69
|
var _a, _b;
|
|
73
70
|
const coordsLength = this.coords.length;
|
|
71
|
+
const { zoom = 0 } = props;
|
|
74
72
|
if (!coordsLength) {
|
|
75
73
|
return;
|
|
76
74
|
}
|
|
@@ -79,10 +77,20 @@ class YMap {
|
|
|
79
77
|
leftBottom = [Math.min(leftBottom[0], point[0]), Math.min(leftBottom[1], point[1])];
|
|
80
78
|
rightTop = [Math.max(rightTop[0], point[0]), Math.max(rightTop[1], point[1])];
|
|
81
79
|
});
|
|
82
|
-
|
|
80
|
+
let newMapParams = {
|
|
81
|
+
zoom,
|
|
82
|
+
center: [],
|
|
83
|
+
};
|
|
84
|
+
if (zoom) {
|
|
85
|
+
// compute only the center
|
|
86
|
+
newMapParams.center = window.ymaps.util.bounds.getCenter([leftBottom, rightTop]);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
newMapParams = window.ymaps.util.bounds.getCenterAndZoom([leftBottom, rightTop], [(_a = this.mapRef) === null || _a === void 0 ? void 0 : _a.clientWidth, (_b = this.mapRef) === null || _b === void 0 ? void 0 : _b.clientHeight], undefined, { margin: DEFAULT_MAP_CONTROL_BUTTON_HEIGHT });
|
|
90
|
+
}
|
|
83
91
|
this.ymap.setCenter(newMapParams.center);
|
|
84
92
|
// Use default zoom for one placemark
|
|
85
|
-
if (coordsLength > 1) {
|
|
93
|
+
if (coordsLength > 1 && !zoom) {
|
|
86
94
|
this.ymap.setZoom(newMapParams.zoom);
|
|
87
95
|
}
|
|
88
96
|
}
|
|
@@ -16,8 +16,12 @@ const helpers_1 = require("../helpers");
|
|
|
16
16
|
const b = (0, utils_1.block)('map');
|
|
17
17
|
const DEFAULT_CONTAINER_ID = 'ymap';
|
|
18
18
|
const DEFAULT_ZOOM = 9;
|
|
19
|
+
// Center - is a required parameter for creating a new map
|
|
20
|
+
// We use this init center to create a map
|
|
21
|
+
// The real center of the map will be calculated later, using the coordinates of the markers
|
|
22
|
+
const INITIAL_CENTER = [0, 0];
|
|
19
23
|
const YandexMap = (props) => {
|
|
20
|
-
const { markers, zoom,
|
|
24
|
+
const { markers, zoom, id } = props;
|
|
21
25
|
const { apiKey, scriptSrc, nonce } = (0, react_1.useContext)(mapsContext_1.MapsContext);
|
|
22
26
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
23
27
|
const { lang = 'ru' } = (0, react_1.useContext)(localeContext_1.LocaleContext);
|
|
@@ -26,6 +30,7 @@ const YandexMap = (props) => {
|
|
|
26
30
|
const [height, setHeight] = (0, react_1.useState)(undefined);
|
|
27
31
|
const ref = (0, react_1.useRef)(null);
|
|
28
32
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
33
|
+
const [ready, setReady] = (0, react_1.useState)(false);
|
|
29
34
|
const [attemptsIndex, setAttemptsIndex] = (0, react_1.useState)(0);
|
|
30
35
|
const onTryAgain = (0, react_1.useCallback)(() => {
|
|
31
36
|
setAttemptsIndex(attemptsIndex + 1);
|
|
@@ -33,20 +38,17 @@ const YandexMap = (props) => {
|
|
|
33
38
|
(0, react_1.useEffect)(() => {
|
|
34
39
|
(async function () {
|
|
35
40
|
var _a;
|
|
36
|
-
if (!center) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
41
|
setLoading(true);
|
|
40
42
|
await YandexMapApiLoader_1.YMapsApiLoader.loadApi(apiKey, scriptSrc, lang, nonce);
|
|
41
43
|
(_a = window.ymaps) === null || _a === void 0 ? void 0 : _a.ready(() => {
|
|
42
44
|
setYmaps(new YMap_1.YMap(new window.ymaps.Map(containerId, {
|
|
43
|
-
center,
|
|
45
|
+
center: INITIAL_CENTER,
|
|
44
46
|
zoom: zoom || DEFAULT_ZOOM,
|
|
45
47
|
}, { autoFitToViewport: 'always' }), ref.current));
|
|
46
48
|
});
|
|
47
49
|
setLoading(false);
|
|
48
50
|
})();
|
|
49
|
-
}, [apiKey, lang, scriptSrc, containerId, zoom,
|
|
51
|
+
}, [apiKey, lang, scriptSrc, containerId, zoom, nonce, attemptsIndex, setLoading]);
|
|
50
52
|
(0, react_1.useEffect)(() => {
|
|
51
53
|
const updateSize = lodash_1.default.debounce(() => {
|
|
52
54
|
if (ref.current) {
|
|
@@ -61,12 +63,19 @@ const YandexMap = (props) => {
|
|
|
61
63
|
}, [markers, ymap, setYmaps, isMobile]);
|
|
62
64
|
(0, react_1.useEffect)(() => {
|
|
63
65
|
if (ymap) {
|
|
64
|
-
|
|
66
|
+
// show with computed center and placemarks
|
|
67
|
+
const showPlacemarks = async () => {
|
|
68
|
+
await ymap.showPlacemarks({ markers, zoom });
|
|
69
|
+
setReady(true);
|
|
70
|
+
};
|
|
71
|
+
showPlacemarks();
|
|
65
72
|
}
|
|
66
73
|
});
|
|
67
|
-
if (!
|
|
74
|
+
if (!markers)
|
|
68
75
|
return null;
|
|
69
76
|
return (react_1.default.createElement(ErrorWrapper_1.default, { isError: YandexMapApiLoader_1.YMapsApiLoader.status === YandexMapApiLoader_1.MapApiStatus.Error, text: (0, i18n_1.default)('map-load-error'), buttonText: (0, i18n_1.default)('map-try-again'), handler: onTryAgain, className: b('wrapper') },
|
|
70
|
-
react_1.default.createElement("div", {
|
|
77
|
+
react_1.default.createElement("div", { className: b('wrapper') },
|
|
78
|
+
react_1.default.createElement("div", { id: containerId, className: b({ hidden: !ready }), ref: ref, style: { height } }),
|
|
79
|
+
loading ? react_1.default.createElement(uikit_1.Spin, { size: "xl", className: b('spinner') }) : null)));
|
|
71
80
|
};
|
|
72
81
|
exports.default = YandexMap;
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const Anchor_1 = tslib_1.__importDefault(require("../Anchor/Anchor"));
|
|
8
|
-
const LinkBase_1 = tslib_1.__importDefault(require("../LinkBase/LinkBase"));
|
|
9
8
|
const __1 = require("../");
|
|
10
9
|
const locationContext_1 = require("../../context/locationContext");
|
|
11
10
|
const mobileContext_1 = require("../../context/mobileContext");
|
|
@@ -41,7 +40,7 @@ const Title = (props) => {
|
|
|
41
40
|
content = textMarkup;
|
|
42
41
|
}
|
|
43
42
|
else if (url) {
|
|
44
|
-
content = (react_1.default.createElement(
|
|
43
|
+
content = (react_1.default.createElement("a", Object.assign({ className: b('link'), href: url }, (0, utils_1.getLinkProps)(url, hostname), { onClick: onClick }), insideClickableContent));
|
|
45
44
|
}
|
|
46
45
|
else if (onClick) {
|
|
47
46
|
content = (react_1.default.createElement("span", { className: b('link'), onClick: onClick }, insideClickableContent));
|
|
@@ -17,7 +17,6 @@ export { default as HeaderBreadcrumbs } from './HeaderBreadcrumbs/HeaderBreadcru
|
|
|
17
17
|
export { default as HeightCalculator } from './HeightCalculator/HeightCalculator';
|
|
18
18
|
export { default as Image } from './Image/Image';
|
|
19
19
|
export { default as Link } from './Link/Link';
|
|
20
|
-
export { default as LinkBase } from './LinkBase/LinkBase';
|
|
21
20
|
export { default as Links } from './Link/Links';
|
|
22
21
|
export { default as Media } from './Media/Media';
|
|
23
22
|
export { default as OutsideClick } from './OutsideClick/OutsideClick';
|
|
@@ -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.FullScreenMedia = exports.MetaInfo = exports.HTML = exports.RouterLink = exports.Author = exports.OverflowScroller = exports.Control = exports.YandexForm = exports.YFMWrapper = exports.VideoBlock = exports.UnpublishedLabel = exports.ToggleArrow = exports.Title = exports.Table = exports.ReactPlayer = exports.OutsideClick = exports.Media = exports.Links = exports.
|
|
6
|
+
exports.FullScreenMedia = exports.MetaInfo = exports.HTML = exports.RouterLink = exports.Author = exports.OverflowScroller = exports.Control = exports.YandexForm = exports.YFMWrapper = exports.VideoBlock = exports.UnpublishedLabel = exports.ToggleArrow = exports.Title = exports.Table = exports.ReactPlayer = exports.OutsideClick = exports.Media = exports.Links = exports.Link = exports.Image = exports.HeightCalculator = exports.HeaderBreadcrumbs = exports.FullWidthBackground = exports.FullscreenImage = exports.Foldable = exports.FileLink = exports.ErrorWrapper = exports.CardBase = exports.Button = exports.BlockHeader = exports.BlockBase = exports.BalancedMasonry = exports.BackLink = exports.BackgroundMedia = exports.BackgroundImage = exports.AnimateBlock = exports.Anchor = void 0;
|
|
7
7
|
var Anchor_1 = require("./Anchor/Anchor");
|
|
8
8
|
Object.defineProperty(exports, "Anchor", { enumerable: true, get: function () { return __importDefault(Anchor_1).default; } });
|
|
9
9
|
var AnimateBlock_1 = require("./AnimateBlock/AnimateBlock");
|
|
@@ -42,8 +42,6 @@ var Image_1 = require("./Image/Image");
|
|
|
42
42
|
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return __importDefault(Image_1).default; } });
|
|
43
43
|
var Link_1 = require("./Link/Link");
|
|
44
44
|
Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return __importDefault(Link_1).default; } });
|
|
45
|
-
var LinkBase_1 = require("./LinkBase/LinkBase");
|
|
46
|
-
Object.defineProperty(exports, "LinkBase", { enumerable: true, get: function () { return __importDefault(LinkBase_1).default; } });
|
|
47
45
|
var Links_1 = require("./Link/Links");
|
|
48
46
|
Object.defineProperty(exports, "Links", { enumerable: true, get: function () { return __importDefault(Links_1).default; } });
|
|
49
47
|
var Media_1 = require("./Media/Media");
|
|
@@ -32,7 +32,6 @@ export declare const subBlockMap: {
|
|
|
32
32
|
* @deprecated Will be removed, use basic card instead
|
|
33
33
|
*/
|
|
34
34
|
partner: ({ text, logo, url, border }: import("./models").PartnerProps) => JSX.Element;
|
|
35
|
-
"price-detailed": (props: import("./models").PriceDetailedProps) => JSX.Element;
|
|
36
35
|
"media-card": ({ border, ...mediaProps }: import("./models").MediaCardProps) => JSX.Element;
|
|
37
36
|
"banner-card": (props: import("./models").BannerCardProps) => JSX.Element;
|
|
38
37
|
"news-card": (props: import("./models").NewsCardProps) => JSX.Element;
|
|
@@ -38,7 +38,6 @@ exports.subBlockMap = {
|
|
|
38
38
|
* @deprecated Will be removed, use basic card instead
|
|
39
39
|
*/
|
|
40
40
|
[models_1.SubBlockType.Partner]: sub_blocks_1.Partner,
|
|
41
|
-
[models_1.SubBlockType.PriceDetailed]: sub_blocks_1.PriceDetailed,
|
|
42
41
|
[models_1.SubBlockType.MediaCard]: sub_blocks_1.MediaCard,
|
|
43
42
|
[models_1.SubBlockType.BannerCard]: sub_blocks_1.BannerCard,
|
|
44
43
|
[models_1.SubBlockType.NewsCard]: sub_blocks_1.NewsCard,
|
|
@@ -6,17 +6,6 @@ export declare enum AuthorType {
|
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
8
8
|
}
|
|
9
|
-
export declare enum PriceDetailsType {
|
|
10
|
-
MARKED_LIST = "marked-list",
|
|
11
|
-
SETTINGS = "settings"
|
|
12
|
-
}
|
|
13
|
-
export declare enum PriceLabelColor {
|
|
14
|
-
BLUE = "blue",
|
|
15
|
-
GREEN = "green",
|
|
16
|
-
YELLOW = "yellow",
|
|
17
|
-
PURPLE = "purple",
|
|
18
|
-
RED = "red"
|
|
19
|
-
}
|
|
20
9
|
export declare enum PreviewItemType {
|
|
21
10
|
Video = "video",
|
|
22
11
|
Image = "image"
|
|
@@ -48,7 +37,6 @@ export type ColumnsCount = 1 | 2 | 3 | 4;
|
|
|
48
37
|
export type LegendTableMarkerType = 'disk';
|
|
49
38
|
export type LinkTheme = 'file-link' | 'normal' | 'back' | 'underline';
|
|
50
39
|
export type MediaDirection = 'media-content' | 'content-media';
|
|
51
|
-
export type PriceDescriptionColor = 'cornflower' | 'black';
|
|
52
40
|
export type PreviewRatioMediaContent = '2-1' | '1-1';
|
|
53
41
|
export type ContentSize = 's' | 'l';
|
|
54
42
|
export type ContentTextSize = 's' | 'm' | 'l';
|
|
@@ -111,8 +99,6 @@ export interface MediaVideoProps extends AnalyticsEventsBase {
|
|
|
111
99
|
controls?: MediaVideoControlsType;
|
|
112
100
|
metrika?: MetrikaVideo;
|
|
113
101
|
}
|
|
114
|
-
export interface LinkBaseProps extends React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
|
|
115
|
-
}
|
|
116
102
|
export interface LinkProps extends AnalyticsEventsBase, Stylable {
|
|
117
103
|
url: string;
|
|
118
104
|
text?: string;
|
|
@@ -191,7 +177,6 @@ export interface MediaProps extends Animatable, Partial<MediaComponentDataLensPr
|
|
|
191
177
|
export type Coordinate = number[];
|
|
192
178
|
export interface MapBaseProps {
|
|
193
179
|
zoom?: number;
|
|
194
|
-
center?: Coordinate;
|
|
195
180
|
}
|
|
196
181
|
export interface GMapProps extends MapBaseProps {
|
|
197
182
|
address: string;
|
|
@@ -199,7 +184,6 @@ export interface GMapProps extends MapBaseProps {
|
|
|
199
184
|
export interface YMapProps extends MapBaseProps {
|
|
200
185
|
markers: YMapMarker[];
|
|
201
186
|
id: string;
|
|
202
|
-
center: Coordinate;
|
|
203
187
|
}
|
|
204
188
|
export interface YMapMarker {
|
|
205
189
|
address?: string;
|
|
@@ -275,69 +259,6 @@ export type CardBorder = 'shadow' | 'line' | 'none';
|
|
|
275
259
|
export interface CardBaseProps {
|
|
276
260
|
border?: CardBorder;
|
|
277
261
|
}
|
|
278
|
-
export interface PriceDescriptionProps {
|
|
279
|
-
title: string;
|
|
280
|
-
detailedTitle?: string;
|
|
281
|
-
description: string;
|
|
282
|
-
label?: {
|
|
283
|
-
color: PriceLabelColor;
|
|
284
|
-
text?: string;
|
|
285
|
-
size?: TextSize;
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
export interface PriceDetailsSettingsProps {
|
|
289
|
-
title: string;
|
|
290
|
-
description: string;
|
|
291
|
-
}
|
|
292
|
-
export interface PriceDetailsListProps {
|
|
293
|
-
text: string;
|
|
294
|
-
}
|
|
295
|
-
export interface PriceDetailsProps {
|
|
296
|
-
items?: PriceDetailsSettingsProps[] | PriceDetailsListProps[];
|
|
297
|
-
}
|
|
298
|
-
export interface PriceItemProps extends PriceDetailsProps, PriceDescriptionProps {
|
|
299
|
-
}
|
|
300
|
-
export interface PriceFoldableDetailsProps {
|
|
301
|
-
title: string;
|
|
302
|
-
size?: TextSize;
|
|
303
|
-
titleColor?: PriceDescriptionColor;
|
|
304
|
-
}
|
|
305
|
-
export interface PriceDetailedProps extends CardBaseProps {
|
|
306
|
-
items: PriceItemProps[];
|
|
307
|
-
description?: {
|
|
308
|
-
titleSize?: TextSize;
|
|
309
|
-
descriptionSize?: TextSize;
|
|
310
|
-
titleColor?: PriceDescriptionColor;
|
|
311
|
-
};
|
|
312
|
-
details?: {
|
|
313
|
-
titleSize?: TextSize;
|
|
314
|
-
descriptionSize?: TextSize;
|
|
315
|
-
};
|
|
316
|
-
priceType?: PriceDetailsType;
|
|
317
|
-
numberGroupItems?: 3 | 4 | 5;
|
|
318
|
-
isCombined?: boolean;
|
|
319
|
-
useMixedView?: boolean;
|
|
320
|
-
foldable?: PriceFoldableDetailsProps;
|
|
321
|
-
labelsDefaultText?: Record<PriceLabelColor, string>;
|
|
322
|
-
}
|
|
323
|
-
export interface PriceDetailedProps extends CardBaseProps {
|
|
324
|
-
items: PriceItemProps[];
|
|
325
|
-
description?: {
|
|
326
|
-
titleSize?: TextSize;
|
|
327
|
-
descriptionSize?: TextSize;
|
|
328
|
-
titleColor?: PriceDescriptionColor;
|
|
329
|
-
};
|
|
330
|
-
details?: {
|
|
331
|
-
titleSize?: TextSize;
|
|
332
|
-
descriptionSize?: TextSize;
|
|
333
|
-
};
|
|
334
|
-
priceType?: PriceDetailsType;
|
|
335
|
-
numberGroupItems?: 3 | 4 | 5;
|
|
336
|
-
isCombined?: boolean;
|
|
337
|
-
useMixedView?: boolean;
|
|
338
|
-
foldable?: PriceFoldableDetailsProps;
|
|
339
|
-
labelsDefaultText?: Record<PriceLabelColor, string>;
|
|
340
|
-
}
|
|
341
262
|
export interface AuthorProps {
|
|
342
263
|
author: AuthorItem;
|
|
343
264
|
className?: string;
|
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MediaVideoControlsType = exports.MediaVideoType = exports.PlayButtonThemes = exports.PlayButtonType = exports.PreviewItemType = exports.
|
|
3
|
+
exports.MediaVideoControlsType = exports.MediaVideoType = exports.PlayButtonThemes = exports.PlayButtonType = exports.PreviewItemType = exports.AuthorType = void 0;
|
|
4
4
|
// enums
|
|
5
5
|
var AuthorType;
|
|
6
6
|
(function (AuthorType) {
|
|
7
7
|
AuthorType["Column"] = "column";
|
|
8
8
|
AuthorType["Line"] = "line";
|
|
9
9
|
})(AuthorType = exports.AuthorType || (exports.AuthorType = {}));
|
|
10
|
-
var PriceDetailsType;
|
|
11
|
-
(function (PriceDetailsType) {
|
|
12
|
-
PriceDetailsType["MARKED_LIST"] = "marked-list";
|
|
13
|
-
PriceDetailsType["SETTINGS"] = "settings";
|
|
14
|
-
})(PriceDetailsType = exports.PriceDetailsType || (exports.PriceDetailsType = {}));
|
|
15
|
-
var PriceLabelColor;
|
|
16
|
-
(function (PriceLabelColor) {
|
|
17
|
-
PriceLabelColor["BLUE"] = "blue";
|
|
18
|
-
PriceLabelColor["GREEN"] = "green";
|
|
19
|
-
PriceLabelColor["YELLOW"] = "yellow";
|
|
20
|
-
PriceLabelColor["PURPLE"] = "purple";
|
|
21
|
-
PriceLabelColor["RED"] = "red";
|
|
22
|
-
})(PriceLabelColor = exports.PriceLabelColor || (exports.PriceLabelColor = {}));
|
|
23
10
|
var PreviewItemType;
|
|
24
11
|
(function (PreviewItemType) {
|
|
25
12
|
PreviewItemType["Video"] = "video";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClassNameProps } from '../../models';
|
|
2
2
|
import { ThemeSupporting } from '../../utils';
|
|
3
3
|
import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
|
|
4
|
-
import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, LinkProps, MediaProps,
|
|
4
|
+
import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, LinkProps, MediaProps, TextTheme, Themable, ThemedImage } from './common';
|
|
5
5
|
import { ContentBlockProps } from './blocks';
|
|
6
6
|
import { AnalyticsEventsBase, PixelEvent } from '../common';
|
|
7
7
|
export declare enum SubBlockType {
|
|
@@ -12,7 +12,6 @@ export declare enum SubBlockType {
|
|
|
12
12
|
* @deprecated Will be moved to params use BasicCard instead
|
|
13
13
|
*/
|
|
14
14
|
Partner = "partner",
|
|
15
|
-
PriceDetailed = "price-detailed",
|
|
16
15
|
MediaCard = "media-card",
|
|
17
16
|
BannerCard = "banner-card",
|
|
18
17
|
/**
|
|
@@ -162,9 +161,6 @@ export type BackgroundCardModel = {
|
|
|
162
161
|
export type PartnerModel = {
|
|
163
162
|
type: SubBlockType.Partner;
|
|
164
163
|
} & PartnerProps;
|
|
165
|
-
export type PriceDetailedModel = {
|
|
166
|
-
type: SubBlockType.PriceDetailed;
|
|
167
|
-
} & PriceDetailedProps;
|
|
168
164
|
export type MediaCardModel = {
|
|
169
165
|
type: SubBlockType.MediaCard;
|
|
170
166
|
} & MediaCardProps;
|
|
@@ -177,5 +173,5 @@ export type BannerCardModel = {
|
|
|
177
173
|
export type BasicCardModel = {
|
|
178
174
|
type: SubBlockType.BasicCard;
|
|
179
175
|
} & BasicCardProps;
|
|
180
|
-
export type SubBlockModels = DividerModel | QuoteModel | NewsCardModel | PartnerModel |
|
|
176
|
+
export type SubBlockModels = DividerModel | QuoteModel | NewsCardModel | PartnerModel | MediaCardModel | TutorialCardModel | CardWithImageModel | BackgroundCardModel | HubspotFormModel | BannerCardModel | BasicCardModel;
|
|
181
177
|
export type SubBlock = SubBlockModels;
|
|
@@ -10,7 +10,6 @@ var SubBlockType;
|
|
|
10
10
|
* @deprecated Will be moved to params use BasicCard instead
|
|
11
11
|
*/
|
|
12
12
|
SubBlockType["Partner"] = "partner";
|
|
13
|
-
SubBlockType["PriceDetailed"] = "price-detailed";
|
|
14
13
|
SubBlockType["MediaCard"] = "media-card";
|
|
15
14
|
SubBlockType["BannerCard"] = "banner-card";
|
|
16
15
|
/**
|