@gravity-ui/page-constructor 1.14.0-alpha.0 → 1.14.0-alpha.1
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MetrikaContextProps } from '../../context/metrikaContext';
|
|
2
|
+
import { AnalyticsContextProps } from '../../context/analyticsContext';
|
|
2
3
|
import { ProjectSettingsContextProps } from '../../context/projectSettingsContext';
|
|
3
4
|
import { SSRContextProps } from '../../context/ssrContext';
|
|
4
5
|
import { LocaleContextProps } from '../../context/localeContext';
|
|
@@ -13,5 +14,6 @@ export interface PageConstructorProviderProps {
|
|
|
13
14
|
ssrConfig?: SSRContextProps;
|
|
14
15
|
theme?: ConstructorTheme;
|
|
15
16
|
projectSettings?: ProjectSettingsContextProps;
|
|
17
|
+
analytics?: AnalyticsContextProps;
|
|
16
18
|
}
|
|
17
19
|
export declare const PageConstructorProvider: (props: WithChildren<PageConstructorProviderProps>) => JSX.Element;
|
|
@@ -4,6 +4,7 @@ exports.PageConstructorProvider = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const metrikaContext_1 = require("../../context/metrikaContext");
|
|
7
|
+
const analyticsContext_1 = require("../../context/analyticsContext");
|
|
7
8
|
const mobileContext_1 = require("../../context/mobileContext");
|
|
8
9
|
const projectSettingsContext_1 = require("../../context/projectSettingsContext");
|
|
9
10
|
const ssrContext_1 = require("../../context/ssrContext");
|
|
@@ -12,7 +13,7 @@ const locationContext_1 = require("../../context/locationContext");
|
|
|
12
13
|
const ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
|
|
13
14
|
const constants_1 = require("../../components/constants");
|
|
14
15
|
const PageConstructorProvider = (props) => {
|
|
15
|
-
const { isMobile, locale = {}, location = {}, metrika = {}, ssrConfig = {}, projectSettings = {}, theme = constants_1.DEFAULT_THEME, children, } = props;
|
|
16
|
+
const { isMobile, locale = {}, location = {}, metrika = {}, analytics = {}, ssrConfig = {}, projectSettings = {}, theme = constants_1.DEFAULT_THEME, children, } = props;
|
|
16
17
|
/* eslint-disable react/jsx-key */
|
|
17
18
|
const context = [
|
|
18
19
|
react_1.default.createElement(ThemeValueContext_1.ThemeValueContext.Provider, { value: { themeValue: theme } }),
|
|
@@ -21,6 +22,7 @@ const PageConstructorProvider = (props) => {
|
|
|
21
22
|
react_1.default.createElement(locationContext_1.LocationContext.Provider, { value: location }),
|
|
22
23
|
react_1.default.createElement(mobileContext_1.MobileContext.Provider, { value: Boolean(isMobile) }),
|
|
23
24
|
react_1.default.createElement(metrikaContext_1.MetrikaContext.Provider, { value: metrika }),
|
|
25
|
+
react_1.default.createElement(analyticsContext_1.AnalyticsContext.Provider, { value: analytics }),
|
|
24
26
|
react_1.default.createElement(ssrContext_1.SSRContext.Provider, { value: { isServer: ssrConfig === null || ssrConfig === void 0 ? void 0 : ssrConfig.isServer } }),
|
|
25
27
|
].reduceRight((prev, provider) => react_1.default.cloneElement(provider, {}, prev), children);
|
|
26
28
|
/* eslint-enable react/jsx-key */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MetrikaContextProps } from '../../context/metrikaContext';
|
|
2
|
+
import { AnalyticsContextProps } from '../../context/analyticsContext';
|
|
2
3
|
import { ProjectSettingsContextProps } from '../../context/projectSettingsContext';
|
|
3
4
|
import { SSRContextProps } from '../../context/ssrContext';
|
|
4
5
|
import { LocaleContextProps } from '../../context/localeContext';
|
|
@@ -13,5 +14,6 @@ export interface PageConstructorProviderProps {
|
|
|
13
14
|
ssrConfig?: SSRContextProps;
|
|
14
15
|
theme?: ConstructorTheme;
|
|
15
16
|
projectSettings?: ProjectSettingsContextProps;
|
|
17
|
+
analytics?: AnalyticsContextProps;
|
|
16
18
|
}
|
|
17
19
|
export declare const PageConstructorProvider: (props: WithChildren<PageConstructorProviderProps>) => JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
2
|
import { MetrikaContext } from '../../context/metrikaContext';
|
|
3
|
+
import { AnalyticsContext } from '../../context/analyticsContext';
|
|
3
4
|
import { MobileContext } from '../../context/mobileContext';
|
|
4
5
|
import { ProjectSettingsContext, } from '../../context/projectSettingsContext';
|
|
5
6
|
import { SSRContext } from '../../context/ssrContext';
|
|
@@ -8,7 +9,7 @@ import { LocationContext } from '../../context/locationContext';
|
|
|
8
9
|
import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
|
|
9
10
|
import { DEFAULT_THEME } from '../../components/constants';
|
|
10
11
|
export const PageConstructorProvider = (props) => {
|
|
11
|
-
const { isMobile, locale = {}, location = {}, metrika = {}, ssrConfig = {}, projectSettings = {}, theme = DEFAULT_THEME, children, } = props;
|
|
12
|
+
const { isMobile, locale = {}, location = {}, metrika = {}, analytics = {}, ssrConfig = {}, projectSettings = {}, theme = DEFAULT_THEME, children, } = props;
|
|
12
13
|
/* eslint-disable react/jsx-key */
|
|
13
14
|
const context = [
|
|
14
15
|
React.createElement(ThemeValueContext.Provider, { value: { themeValue: theme } }),
|
|
@@ -17,6 +18,7 @@ export const PageConstructorProvider = (props) => {
|
|
|
17
18
|
React.createElement(LocationContext.Provider, { value: location }),
|
|
18
19
|
React.createElement(MobileContext.Provider, { value: Boolean(isMobile) }),
|
|
19
20
|
React.createElement(MetrikaContext.Provider, { value: metrika }),
|
|
21
|
+
React.createElement(AnalyticsContext.Provider, { value: analytics }),
|
|
20
22
|
React.createElement(SSRContext.Provider, { value: { isServer: ssrConfig === null || ssrConfig === void 0 ? void 0 : ssrConfig.isServer } }),
|
|
21
23
|
].reduceRight((prev, provider) => React.cloneElement(provider, {}, prev), children);
|
|
22
24
|
/* eslint-enable react/jsx-key */
|