@gravity-ui/page-constructor 3.16.0 → 4.0.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/README.md +1 -1
- package/build/cjs/blocks/Companies/Companies.css +5 -5
- package/build/cjs/blocks/Companies/Companies.js +3 -3
- package/build/cjs/blocks/ContentLayout/ContentLayout.css +4 -4
- package/build/cjs/blocks/ContentLayout/ContentLayout.js +1 -3
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.css +16 -16
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +3 -3
- package/build/cjs/blocks/Header/Header.css +22 -22
- package/build/cjs/blocks/Header/Header.js +2 -2
- package/build/cjs/blocks/Icons/Icons.css +2 -2
- package/build/cjs/blocks/Info/Info.css +1 -1
- package/build/cjs/blocks/Info/Info.js +3 -3
- package/build/cjs/blocks/Media/Media.js +2 -2
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.css +13 -13
- package/build/cjs/blocks/Questions/Questions.css +12 -12
- package/build/cjs/blocks/Share/Share.css +14 -12
- package/build/cjs/blocks/Slider/Arrow/Arrow.css +4 -4
- package/build/cjs/blocks/Slider/Slider.css +10 -10
- package/build/cjs/blocks/Table/Table.css +5 -5
- package/build/cjs/blocks/Tabs/Tabs.css +6 -6
- package/build/cjs/blocks/Tabs/Tabs.js +2 -2
- package/build/cjs/components/Anchor/Anchor.d.ts +2 -3
- package/build/cjs/components/AnimateBlock/AnimateBlock.d.ts +2 -3
- package/build/cjs/components/Author/Author.css +8 -8
- package/build/cjs/components/Author/Author.js +2 -2
- package/build/cjs/components/BlockBase/BlockBase.d.ts +2 -2
- package/build/cjs/components/BlockBase/BlockBase.js +1 -1
- package/build/cjs/components/Button/Button.css +4 -0
- package/build/cjs/components/Button/Button.d.ts +2 -3
- package/build/cjs/components/Button/Button.js +3 -2
- package/build/cjs/components/ButtonTabs/ButtonTabs.css +4 -0
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +2 -3
- package/build/cjs/components/CardBase/CardBase.css +6 -6
- package/build/cjs/components/Control/Control.css +9 -9
- package/build/cjs/components/ErrorWrapper/ErrorWrapper.css +3 -3
- package/build/cjs/components/FileLink/FileLink.css +16 -56
- package/build/cjs/components/FileLink/FileLink.js +18 -1
- package/build/cjs/components/FullWidthBackground/FullWidthBackground.css +1 -1
- package/build/cjs/components/FullscreenImage/FullscreenImage.css +3 -3
- package/build/cjs/components/FullscreenMedia/FullscreenMedia.css +3 -3
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +11 -11
- package/build/cjs/components/Image/Image.d.ts +2 -3
- package/build/cjs/components/Link/Link.css +13 -13
- package/build/cjs/components/Media/Video/Video.js +1 -0
- package/build/cjs/components/MetaInfo/MetaInfo.css +2 -2
- package/build/cjs/components/OverflowScroller/OverflowScroller.css +1 -1
- package/build/cjs/components/ReactPlayer/CustomBarControls.css +1 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.css +2 -2
- package/build/cjs/components/Table/Table.css +8 -8
- package/build/cjs/components/Title/Title.css +4 -4
- package/build/cjs/components/Title/TitleItem.css +19 -19
- package/build/cjs/components/Title/TitleItem.d.ts +2 -3
- package/build/cjs/components/Title/TitleItem.js +2 -2
- package/build/cjs/components/UnpublishedLabel/UnpublishedLabel.css +5 -5
- package/build/cjs/components/VideoBlock/VideoBlock.css +2 -2
- package/build/cjs/components/constants.d.ts +3 -1
- package/build/cjs/components/constants.js +4 -2
- package/build/cjs/containers/PageConstructor/PageConstructor.css +50 -30
- package/build/cjs/containers/PageConstructor/PageConstructor.js +6 -3
- package/build/cjs/containers/PageConstructor/Provider.d.ts +2 -3
- package/build/cjs/containers/PageConstructor/Provider.js +2 -2
- package/build/cjs/context/theme/ThemeContext.d.ts +2 -3
- package/build/cjs/context/theme/ThemeContext.js +0 -1
- package/build/cjs/context/theme/index.d.ts +0 -1
- package/build/cjs/context/theme/index.js +0 -1
- package/build/cjs/context/theme/useTheme.d.ts +1 -1
- package/build/cjs/context/theme/useTheme.js +2 -2
- package/build/cjs/context/theme/withTheme.js +1 -1
- package/build/cjs/editor/components/AddBlock/AddBlock.css +6 -5
- package/build/cjs/editor/components/AddBlock/AddBlock.js +1 -1
- package/build/cjs/editor/components/ControlPanel/ControlPanel.css +12 -5
- package/build/cjs/editor/components/ControlPanel/ControlPanel.d.ts +4 -2
- package/build/cjs/editor/components/ControlPanel/ControlPanel.js +16 -9
- package/build/cjs/editor/components/EditBlock/EditBlock.css +2 -2
- package/build/cjs/editor/components/ErrorBoundary/ErrorBoundary.css +2 -2
- package/build/cjs/editor/components/Layout/Layout.css +11 -9
- package/build/cjs/editor/components/Layout/Layout.d.ts +4 -1
- package/build/cjs/editor/components/Layout/Layout.js +2 -2
- package/build/cjs/editor/components/NotFoundBlock/NotFoundBlock.css +4 -4
- package/build/cjs/editor/containers/Editor/Editor.js +5 -5
- package/build/cjs/editor/containers/Form/Form.css +12 -12
- package/build/cjs/editor/data/previews/default-preview.js +1 -1
- package/build/cjs/editor/data/previews/header-block.js +5 -5
- package/build/cjs/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.css +1 -1
- package/build/cjs/editor/store/index.d.ts +3 -1
- package/build/cjs/editor/store/index.js +7 -2
- package/build/cjs/editor/store/reducer.d.ts +8 -2
- package/build/cjs/editor/store/reducer.js +4 -1
- package/build/cjs/editor/styles/root.css +6 -4
- package/build/cjs/grid/Col/Col.d.ts +3 -4
- package/build/cjs/grid/Col/Col.js +2 -2
- package/build/cjs/grid/Grid/Grid.css +1 -1
- package/build/cjs/models/common.d.ts +4 -0
- package/build/cjs/models/common.js +5 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +0 -4
- package/build/cjs/models/constructor-items/common.d.ts +3 -5
- package/build/cjs/navigation/components/DesktopNavigation/DesktopNavigation.css +4 -4
- package/build/cjs/navigation/components/Logo/Logo.css +3 -3
- package/build/cjs/navigation/components/Logo/Logo.js +3 -3
- package/build/cjs/navigation/components/MobileNavigation/MobileNavigation.css +7 -7
- package/build/cjs/navigation/components/Navigation/Navigation.css +2 -2
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.css +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.css +2 -2
- package/build/cjs/navigation/components/NavigationPopup/NavigationPopup.css +5 -5
- package/build/cjs/navigation/components/NavigationPopup/NavigationPopup.js +1 -1
- package/build/cjs/navigation/components/SocialIcon/SocialIcon.css +3 -3
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.css +4 -4
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +3 -3
- package/build/cjs/sub-blocks/BannerCard/BannerCard.css +16 -16
- package/build/cjs/sub-blocks/BannerCard/BannerCard.js +3 -3
- package/build/cjs/sub-blocks/Content/Content.css +22 -22
- package/build/cjs/sub-blocks/Content/ContentList/ContentList.css +6 -6
- package/build/cjs/sub-blocks/Content/ContentList/ContentList.js +3 -3
- package/build/cjs/sub-blocks/Divider/Divider.css +1 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +39 -39
- package/build/cjs/sub-blocks/HubspotForm/index.js +2 -2
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +1 -1
- package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.css +2 -2
- package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.css +17 -29
- package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.js +18 -1
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.css +7 -7
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.css +5 -5
- package/build/cjs/sub-blocks/Quote/Quote.css +10 -10
- package/build/cjs/sub-blocks/Quote/Quote.js +2 -2
- package/build/cjs/utils/theme.d.ts +1 -1
- package/build/esm/blocks/Companies/Companies.css +5 -5
- package/build/esm/blocks/Companies/Companies.js +3 -3
- package/build/esm/blocks/ContentLayout/ContentLayout.css +4 -4
- package/build/esm/blocks/ContentLayout/ContentLayout.js +1 -3
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.css +16 -16
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +3 -3
- package/build/esm/blocks/Header/Header.css +22 -22
- package/build/esm/blocks/Header/Header.js +2 -2
- package/build/esm/blocks/Icons/Icons.css +2 -2
- package/build/esm/blocks/Info/Info.css +1 -1
- package/build/esm/blocks/Info/Info.js +3 -3
- package/build/esm/blocks/Media/Media.js +3 -3
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.css +13 -13
- package/build/esm/blocks/Questions/Questions.css +12 -12
- package/build/esm/blocks/Share/Share.css +14 -12
- package/build/esm/blocks/Slider/Arrow/Arrow.css +4 -4
- package/build/esm/blocks/Slider/Slider.css +10 -10
- package/build/esm/blocks/Table/Table.css +5 -5
- package/build/esm/blocks/Tabs/Tabs.css +6 -6
- package/build/esm/blocks/Tabs/Tabs.js +3 -3
- package/build/esm/components/Anchor/Anchor.d.ts +2 -3
- package/build/esm/components/AnimateBlock/AnimateBlock.d.ts +2 -3
- package/build/esm/components/Author/Author.css +8 -8
- package/build/esm/components/Author/Author.js +2 -2
- package/build/esm/components/BlockBase/BlockBase.d.ts +2 -2
- package/build/esm/components/BlockBase/BlockBase.js +1 -1
- package/build/esm/components/Button/Button.css +4 -0
- package/build/esm/components/Button/Button.d.ts +2 -3
- package/build/esm/components/Button/Button.js +4 -3
- package/build/esm/components/ButtonTabs/ButtonTabs.css +4 -0
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +2 -3
- package/build/esm/components/CardBase/CardBase.css +6 -6
- package/build/esm/components/Control/Control.css +9 -9
- package/build/esm/components/ErrorWrapper/ErrorWrapper.css +3 -3
- package/build/esm/components/FileLink/FileLink.css +16 -56
- package/build/esm/components/FileLink/FileLink.js +18 -1
- package/build/esm/components/FullWidthBackground/FullWidthBackground.css +1 -1
- package/build/esm/components/FullscreenImage/FullscreenImage.css +3 -3
- package/build/esm/components/FullscreenMedia/FullscreenMedia.css +3 -3
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +11 -11
- package/build/esm/components/Image/Image.d.ts +2 -3
- package/build/esm/components/Link/Link.css +13 -13
- package/build/esm/components/Media/Video/Video.js +1 -0
- package/build/esm/components/MetaInfo/MetaInfo.css +2 -2
- package/build/esm/components/OverflowScroller/OverflowScroller.css +1 -1
- package/build/esm/components/ReactPlayer/CustomBarControls.css +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.css +2 -2
- package/build/esm/components/Table/Table.css +8 -8
- package/build/esm/components/Title/Title.css +4 -4
- package/build/esm/components/Title/TitleItem.css +19 -19
- package/build/esm/components/Title/TitleItem.d.ts +2 -3
- package/build/esm/components/Title/TitleItem.js +2 -2
- package/build/esm/components/UnpublishedLabel/UnpublishedLabel.css +5 -5
- package/build/esm/components/VideoBlock/VideoBlock.css +2 -2
- package/build/esm/components/constants.d.ts +3 -1
- package/build/esm/components/constants.js +3 -1
- package/build/esm/containers/PageConstructor/PageConstructor.css +50 -30
- package/build/esm/containers/PageConstructor/PageConstructor.js +7 -4
- package/build/esm/containers/PageConstructor/Provider.d.ts +2 -3
- package/build/esm/containers/PageConstructor/Provider.js +2 -2
- package/build/esm/context/theme/ThemeContext.d.ts +2 -3
- package/build/esm/context/theme/ThemeContext.js +0 -1
- package/build/esm/context/theme/index.d.ts +0 -1
- package/build/esm/context/theme/index.js +0 -1
- package/build/esm/context/theme/useTheme.d.ts +1 -1
- package/build/esm/context/theme/useTheme.js +2 -2
- package/build/esm/context/theme/withTheme.js +1 -1
- package/build/esm/editor/components/AddBlock/AddBlock.css +6 -5
- package/build/esm/editor/components/AddBlock/AddBlock.js +1 -1
- package/build/esm/editor/components/ControlPanel/ControlPanel.css +12 -5
- package/build/esm/editor/components/ControlPanel/ControlPanel.d.ts +4 -2
- package/build/esm/editor/components/ControlPanel/ControlPanel.js +17 -10
- package/build/esm/editor/components/EditBlock/EditBlock.css +2 -2
- package/build/esm/editor/components/ErrorBoundary/ErrorBoundary.css +2 -2
- package/build/esm/editor/components/Layout/Layout.css +11 -9
- package/build/esm/editor/components/Layout/Layout.d.ts +4 -1
- package/build/esm/editor/components/Layout/Layout.js +2 -2
- package/build/esm/editor/components/NotFoundBlock/NotFoundBlock.css +4 -4
- package/build/esm/editor/containers/Editor/Editor.js +5 -5
- package/build/esm/editor/containers/Form/Form.css +12 -12
- package/build/esm/editor/data/previews/default-preview.js +1 -1
- package/build/esm/editor/data/previews/header-block.js +5 -5
- package/build/esm/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.css +1 -1
- package/build/esm/editor/store/index.d.ts +3 -1
- package/build/esm/editor/store/index.js +8 -3
- package/build/esm/editor/store/reducer.d.ts +8 -2
- package/build/esm/editor/store/reducer.js +3 -0
- package/build/esm/editor/styles/root.css +6 -4
- package/build/esm/grid/Col/Col.d.ts +3 -4
- package/build/esm/grid/Col/Col.js +2 -2
- package/build/esm/grid/Grid/Grid.css +1 -1
- package/build/esm/models/common.d.ts +4 -0
- package/build/esm/models/common.js +4 -0
- package/build/esm/models/constructor-items/blocks.d.ts +0 -4
- package/build/esm/models/constructor-items/common.d.ts +3 -5
- package/build/esm/navigation/components/DesktopNavigation/DesktopNavigation.css +4 -4
- package/build/esm/navigation/components/Logo/Logo.css +3 -3
- package/build/esm/navigation/components/Logo/Logo.js +3 -3
- package/build/esm/navigation/components/MobileNavigation/MobileNavigation.css +7 -7
- package/build/esm/navigation/components/Navigation/Navigation.css +2 -2
- package/build/esm/navigation/components/NavigationItem/NavigationItem.css +1 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.css +1 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.css +2 -2
- package/build/esm/navigation/components/NavigationPopup/NavigationPopup.css +5 -5
- package/build/esm/navigation/components/NavigationPopup/NavigationPopup.js +1 -1
- package/build/esm/navigation/components/SocialIcon/SocialIcon.css +3 -3
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.css +4 -4
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +3 -3
- package/build/esm/sub-blocks/BannerCard/BannerCard.css +16 -16
- package/build/esm/sub-blocks/BannerCard/BannerCard.js +3 -3
- package/build/esm/sub-blocks/Content/Content.css +22 -22
- package/build/esm/sub-blocks/Content/ContentList/ContentList.css +6 -6
- package/build/esm/sub-blocks/Content/ContentList/ContentList.js +3 -3
- package/build/esm/sub-blocks/Divider/Divider.css +1 -1
- package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +39 -39
- package/build/esm/sub-blocks/HubspotForm/index.js +2 -2
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +1 -1
- package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.css +2 -2
- package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.css +17 -29
- package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.js +18 -1
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.css +7 -7
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.css +5 -5
- package/build/esm/sub-blocks/Quote/Quote.css +10 -10
- package/build/esm/sub-blocks/Quote/Quote.js +3 -3
- package/build/esm/utils/theme.d.ts +1 -1
- package/package.json +7 -5
- package/server/components/constants.d.ts +3 -1
- package/server/components/constants.js +4 -2
- package/server/models/common.d.ts +4 -0
- package/server/models/common.js +5 -1
- package/server/models/constructor-items/blocks.d.ts +0 -4
- package/server/models/constructor-items/common.d.ts +3 -5
- package/server/utils/theme.d.ts +1 -1
- package/styles/colors/dark.scss +6 -0
- package/styles/colors/light.scss +6 -0
- package/styles/colors/social.scss +10 -0
- package/styles/mixins.scss +21 -25
- package/styles/root.scss +28 -14
- package/styles/storybook/common.scss +6 -6
- package/styles/storybook/palette.scss +6 -6
- package/styles/storybook/typography.scss +46 -46
- package/styles/styles.css +15 -15
- package/styles/variables.scss +0 -8
- package/styles/yfm.scss +12 -12
- package/widget/index.js +1 -1
- package/build/cjs/context/theme/ThemeProvider.d.ts +0 -22
- package/build/cjs/context/theme/ThemeProvider.js +0 -49
- package/build/cjs/context/theme/ThemeValueContext.d.ts +0 -7
- package/build/cjs/context/theme/ThemeValueContext.js +0 -9
- package/build/cjs/context/theme/useThemeValue.d.ts +0 -2
- package/build/cjs/context/theme/useThemeValue.js +0 -11
- package/build/esm/context/theme/ThemeProvider.d.ts +0 -22
- package/build/esm/context/theme/ThemeProvider.js +0 -44
- package/build/esm/context/theme/ThemeValueContext.d.ts +0 -7
- package/build/esm/context/theme/ThemeValueContext.js +0 -5
- package/build/esm/context/theme/useThemeValue.d.ts +0 -2
- package/build/esm/context/theme/useThemeValue.js +0 -6
|
@@ -9,7 +9,7 @@ function withTheme(WrappedComponent) {
|
|
|
9
9
|
const componentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
10
10
|
return _a = class WithThemeComponent extends react_1.default.Component {
|
|
11
11
|
render() {
|
|
12
|
-
return
|
|
12
|
+
return react_1.default.createElement(WrappedComponent, Object.assign({}, this.props, { theme: this.context.theme }));
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
_a.displayName = `withTheme(${componentName})`,
|
|
@@ -3,7 +3,7 @@ unpredictable css rules order in build */
|
|
|
3
3
|
.pc-add-block {
|
|
4
4
|
position: absolute;
|
|
5
5
|
bottom: 32px;
|
|
6
|
-
left: calc(50% + var(--editor-left-column-width) / 2);
|
|
6
|
+
left: calc(50% + var(--pc-editor-left-column-width) / 2);
|
|
7
7
|
transform: translateX(-50%);
|
|
8
8
|
z-index: 110;
|
|
9
9
|
}
|
|
@@ -23,8 +23,8 @@ unpredictable css rules order in build */
|
|
|
23
23
|
transition: transform 0.2s;
|
|
24
24
|
width: 76px;
|
|
25
25
|
height: 40px;
|
|
26
|
-
color: var(--
|
|
27
|
-
background-color: var(--
|
|
26
|
+
color: var(--g-color-text-primary);
|
|
27
|
+
background-color: var(--pc-editor-base-color);
|
|
28
28
|
border-radius: 8px;
|
|
29
29
|
}
|
|
30
30
|
.pc-add-block__button:hover {
|
|
@@ -71,10 +71,11 @@ unpredictable css rules order in build */
|
|
|
71
71
|
height: 74px;
|
|
72
72
|
border-radius: var(--pc-border-radius);
|
|
73
73
|
margin-right: 16px;
|
|
74
|
+
color: var(--pc-editor-base-color);
|
|
74
75
|
}
|
|
75
76
|
.pc-add-block__popup .pc-add-block__title {
|
|
76
|
-
font-size: var(--
|
|
77
|
-
line-height: var(--
|
|
77
|
+
font-size: var(--g-text-body-2-font-size);
|
|
78
|
+
line-height: var(--g-text-body-2-line-height);
|
|
78
79
|
}
|
|
79
80
|
.pc-add-block__popup .pc-add-block__title,
|
|
80
81
|
.pc-add-block__popup .pc-add-block__description {
|
|
@@ -22,7 +22,7 @@ const AddBlock = ({ onAdd, className }) => {
|
|
|
22
22
|
setSearch('');
|
|
23
23
|
} },
|
|
24
24
|
react_1.default.createElement(icons_1.Plus, { className: b('icon') })),
|
|
25
|
-
isOpened && (react_1.default.createElement(uikit_1.Popup, { anchorRef: ref, open: isOpened,
|
|
25
|
+
isOpened && (react_1.default.createElement(uikit_1.Popup, { anchorRef: ref, open: isOpened, contentClassName: b('popup'), placement: "top", offset: [0, 24], onOutsideClick: () => setIsOpened(false) },
|
|
26
26
|
react_1.default.createElement("div", { className: b('search') },
|
|
27
27
|
react_1.default.createElement(uikit_1.TextInput, { placeholder: "search", type: "text", value: search, size: "l", onUpdate: (value) => setSearch(value) })),
|
|
28
28
|
react_1.default.createElement("div", { className: b('blocks') }, blocks.map((blockName) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
3
|
.pc-control-panel {
|
|
4
|
-
display:
|
|
5
|
-
|
|
4
|
+
display: grid;
|
|
5
|
+
grid-template-columns: repeat(3, 1fr);
|
|
6
6
|
width: 100%;
|
|
7
|
-
height: var(--editor-header-height);
|
|
7
|
+
height: var(--pc-editor-header-height);
|
|
8
8
|
padding: 8px 20px;
|
|
9
|
-
background-color: var(--
|
|
10
|
-
border: 1px var(--
|
|
9
|
+
background-color: var(--g-color-base-background);
|
|
10
|
+
border: 1px var(--g-color-line-generic);
|
|
11
11
|
border-style: solid none;
|
|
12
12
|
}
|
|
13
13
|
.pc-control-panel__icon {
|
|
@@ -24,4 +24,11 @@ unpredictable css rules order in build */
|
|
|
24
24
|
.pc-control-panel__mode-switch {
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
|
+
place-self: center;
|
|
28
|
+
}
|
|
29
|
+
.pc-control-panel__theme-switch {
|
|
30
|
+
place-self: center end;
|
|
31
|
+
display: flex;
|
|
32
|
+
gap: 12px;
|
|
33
|
+
align-items: center;
|
|
27
34
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { ClassNameProps } from '../../../models';
|
|
1
|
+
import { ClassNameProps, Theme } from '../../../models';
|
|
2
2
|
import { ViewModeItem } from '../../types';
|
|
3
3
|
export interface ControlPanelProps extends ClassNameProps {
|
|
4
4
|
viewMode?: ViewModeItem;
|
|
5
5
|
onViewModeChange: (viewMode: ViewModeItem) => void;
|
|
6
|
+
theme: Theme;
|
|
7
|
+
onThemeChange: (theme: Theme) => void;
|
|
6
8
|
}
|
|
7
|
-
declare const ControlPanel: ({ viewMode, onViewModeChange, className, }: ControlPanelProps) => JSX.Element;
|
|
9
|
+
declare const ControlPanel: ({ viewMode, onViewModeChange, className, theme, onThemeChange, }: ControlPanelProps) => JSX.Element;
|
|
8
10
|
export default ControlPanel;
|
|
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const icons_1 = require("@gravity-ui/icons");
|
|
6
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
|
+
const models_1 = require("../../../models");
|
|
7
8
|
const utils_1 = require("../../../utils");
|
|
8
9
|
const Tablet_1 = require("../../icons/Tablet");
|
|
9
10
|
const types_1 = require("../../types");
|
|
@@ -16,13 +17,19 @@ const ControlPanelViewModeIcons = {
|
|
|
16
17
|
[types_1.ViewModeItem.Tablet]: Tablet_1.Tablet,
|
|
17
18
|
[types_1.ViewModeItem.Mobile]: icons_1.Smartphone,
|
|
18
19
|
};
|
|
19
|
-
const ControlPanel = ({ viewMode = types_1.ViewModeItem.Edititng, onViewModeChange, className, }) =>
|
|
20
|
-
react_1.default.createElement("div", { className: b(
|
|
21
|
-
react_1.default.createElement("
|
|
22
|
-
react_1.default.createElement(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
const ControlPanel = ({ viewMode = types_1.ViewModeItem.Edititng, onViewModeChange, className, theme, onThemeChange, }) => {
|
|
21
|
+
return (react_1.default.createElement("div", { className: b(null, className) },
|
|
22
|
+
react_1.default.createElement("div", null),
|
|
23
|
+
react_1.default.createElement("div", { className: b('mode-switch') },
|
|
24
|
+
react_1.default.createElement("span", null, (0, i18n_1.default)('mode')),
|
|
25
|
+
react_1.default.createElement(uikit_1.RadioButton, { className: b('radio-button'), value: viewMode, onUpdate: (value) => onViewModeChange(value) }, Object.values(types_1.ViewModeItem).map((item) => {
|
|
26
|
+
const Icon = ControlPanelViewModeIcons[item];
|
|
27
|
+
return (react_1.default.createElement(uikit_1.RadioButton.Option, { key: item, value: item },
|
|
28
|
+
react_1.default.createElement("span", { className: b('icon') },
|
|
29
|
+
react_1.default.createElement(Icon, { width: ICON_SIZE, height: ICON_SIZE }))));
|
|
30
|
+
}))),
|
|
31
|
+
react_1.default.createElement("div", { className: b('theme-switch') },
|
|
32
|
+
react_1.default.createElement("span", null, (0, i18n_1.default)('Theme')),
|
|
33
|
+
react_1.default.createElement(uikit_1.Select, { value: [theme], onUpdate: (value) => onThemeChange(value[0]) }, Object.values(models_1.Theme).map((item) => (react_1.default.createElement(uikit_1.Select.Option, { key: item, value: item }, models_1.themeNames[item])))))));
|
|
34
|
+
};
|
|
28
35
|
exports.default = ControlPanel;
|
|
@@ -9,7 +9,7 @@ unpredictable css rules order in build */
|
|
|
9
9
|
z-index: 11;
|
|
10
10
|
}
|
|
11
11
|
.pc-edit-block_active .pc-edit-block__controls {
|
|
12
|
-
border: 4px solid var(--
|
|
12
|
+
border: 4px solid var(--pc-editor-base-color);
|
|
13
13
|
}
|
|
14
14
|
.pc-edit-block__controls {
|
|
15
15
|
position: absolute;
|
|
@@ -45,7 +45,7 @@ unpredictable css rules order in build */
|
|
|
45
45
|
width: 48px;
|
|
46
46
|
height: 32px;
|
|
47
47
|
border-radius: 8px;
|
|
48
|
-
background-color: var(--
|
|
48
|
+
background-color: var(--pc-editor-control-color);
|
|
49
49
|
}
|
|
50
50
|
.pc-edit-block__control:hover {
|
|
51
51
|
transform: scale(1.1);
|
|
@@ -4,7 +4,7 @@ unpredictable css rules order in build */
|
|
|
4
4
|
display: flex;
|
|
5
5
|
width: 100%;
|
|
6
6
|
padding: 32px;
|
|
7
|
-
background-color: var(--
|
|
7
|
+
background-color: var(--g-color-base-background);
|
|
8
8
|
border-radius: var(--pc-border-radius);
|
|
9
9
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.06), 0px 4px 24px rgba(0, 0, 0, 0.06);
|
|
10
10
|
}
|
|
@@ -13,7 +13,7 @@ unpredictable css rules order in build */
|
|
|
13
13
|
}
|
|
14
14
|
.pc-error-boundary__error {
|
|
15
15
|
display: block;
|
|
16
|
-
color: var(--
|
|
16
|
+
color: var(--g-color-text-danger);
|
|
17
17
|
max-height: 160px;
|
|
18
18
|
overflow: auto;
|
|
19
19
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
-
|
|
4
|
-
--editor-header-height: 48px;
|
|
5
|
-
--editor-divider-width: 12px;
|
|
6
|
-
--editor-
|
|
3
|
+
body {
|
|
4
|
+
--pc-editor-header-height: 48px;
|
|
5
|
+
--pc-editor-divider-width: 12px;
|
|
6
|
+
--pc-editor-base-color: var(--g-color-base-brand);
|
|
7
|
+
--pc-editor-control-color: var(--g-color-private-yellow-400-solid);
|
|
8
|
+
--pc-editor-left-column-width: calc(400px + var(--pc-editor-divider-width));
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
.pc-editor-layout__left, .pc-editor-layout__right {
|
|
10
|
-
--
|
|
11
|
-
height: calc(100vh - var(--editor-header-height));
|
|
12
|
-
max-height: calc(100vh - var(--editor-header-height));
|
|
12
|
+
--g-scrollbar-width: 0;
|
|
13
|
+
height: calc(100vh - var(--pc-editor-header-height));
|
|
14
|
+
max-height: calc(100vh - var(--pc-editor-header-height));
|
|
13
15
|
overflow-y: auto;
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -30,8 +32,8 @@ unpredictable css rules order in build */
|
|
|
30
32
|
.pc-editor-layout__left {
|
|
31
33
|
flex: 0 0 auto;
|
|
32
34
|
padding: 24px 16px;
|
|
33
|
-
width: var(--editor-left-column-width);
|
|
34
|
-
border-right: var(--editor-divider-width) solid var(--
|
|
35
|
+
width: var(--pc-editor-left-column-width);
|
|
36
|
+
border-right: var(--pc-editor-divider-width) solid var(--g-color-line-generic);
|
|
35
37
|
overflow-x: auto;
|
|
36
38
|
}
|
|
37
39
|
.pc-editor-layout__right {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { Theme } from '../../../models';
|
|
2
3
|
import { ViewModeItem } from '../../types';
|
|
3
4
|
export interface LayoutProps {
|
|
4
5
|
mode: ViewModeItem;
|
|
5
6
|
onModeChange: (mode: ViewModeItem) => void;
|
|
7
|
+
theme: Theme;
|
|
8
|
+
onThemeChange: (theme: Theme) => void;
|
|
6
9
|
}
|
|
7
10
|
declare const Layout: {
|
|
8
|
-
({ children, mode, onModeChange }: PropsWithChildren<LayoutProps>): JSX.Element;
|
|
11
|
+
({ children, mode, onModeChange, theme, onThemeChange, }: PropsWithChildren<LayoutProps>): JSX.Element;
|
|
9
12
|
Left: React.FC<{
|
|
10
13
|
children?: React.ReactNode;
|
|
11
14
|
}>;
|
|
@@ -9,7 +9,7 @@ const DeviceEmulation_1 = tslib_1.__importDefault(require("../DeviceEmulation/De
|
|
|
9
9
|
const b = (0, utils_1.block)('editor-layout');
|
|
10
10
|
const Left = () => null;
|
|
11
11
|
const Right = () => null;
|
|
12
|
-
const Layout = ({ children, mode, onModeChange }) => {
|
|
12
|
+
const Layout = ({ children, mode, onModeChange, theme, onThemeChange, }) => {
|
|
13
13
|
let left, right;
|
|
14
14
|
const isEditingMode = mode === types_1.ViewModeItem.Edititng;
|
|
15
15
|
function handleChild(child) {
|
|
@@ -26,7 +26,7 @@ const Layout = ({ children, mode, onModeChange }) => {
|
|
|
26
26
|
react_1.Children.forEach(children, handleChild);
|
|
27
27
|
}
|
|
28
28
|
return (react_1.default.createElement("div", { className: b() },
|
|
29
|
-
react_1.default.createElement(ControlPanel_1.default, { viewMode: mode, onViewModeChange: onModeChange, className: b('panel') }),
|
|
29
|
+
react_1.default.createElement(ControlPanel_1.default, { viewMode: mode, onViewModeChange: onModeChange, className: b('panel'), theme: theme, onThemeChange: onThemeChange }),
|
|
30
30
|
react_1.default.createElement("div", { className: b('container') },
|
|
31
31
|
react_1.default.createElement(react_1.Fragment, null,
|
|
32
32
|
left && react_1.default.createElement("div", { className: b('left') }, left),
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.pc-not-found-block:hover {
|
|
6
|
-
box-shadow: 0px 4px 24px var(--
|
|
6
|
+
box-shadow: 0px 4px 24px var(--g-color-sfx-shadow), 0px 2px 8px var(--g-color-sfx-shadow);
|
|
7
7
|
cursor: pointer;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
/* use this for style redefinitions to awoid problems with
|
|
11
11
|
unpredictable css rules order in build */
|
|
12
12
|
.pc-not-found-block {
|
|
13
|
-
font-size: var(--
|
|
14
|
-
line-height: var(--
|
|
13
|
+
font-size: var(--g-text-display-1-font-size);
|
|
14
|
+
line-height: var(--g-text-display-1-line-height);
|
|
15
15
|
display: flex;
|
|
16
16
|
align-items: center;
|
|
17
17
|
justify-content: center;
|
|
18
18
|
height: 200px;
|
|
19
|
-
background-color: var(--
|
|
19
|
+
background-color: var(--pc-color-highlight-silver);
|
|
20
20
|
border-radius: var(--pc-border-radius);
|
|
21
21
|
}
|
|
@@ -17,7 +17,7 @@ const utils_1 = require("../../utils");
|
|
|
17
17
|
const Form_1 = require("../Form/Form");
|
|
18
18
|
const Editor = (_a) => {
|
|
19
19
|
var { customSchema, onChange, providerProps, transformContent, deviceEmulationSettings } = _a, rest = tslib_1.__rest(_a, ["customSchema", "onChange", "providerProps", "transformContent", "deviceEmulationSettings"]);
|
|
20
|
-
const { content, activeBlockIndex, errorBoundaryState, viewMode, onContentUpdate, onViewModeUpdate, onAdd, onSelect, injectEditBlockProps, } = (0, store_1.useEditorState)(rest);
|
|
20
|
+
const { content, activeBlockIndex, errorBoundaryState, viewMode, theme, onContentUpdate, onViewModeUpdate, onAdd, onSelect, injectEditBlockProps, onThemeUpdate, } = (0, store_1.useEditorState)(rest);
|
|
21
21
|
const formSpecs = (0, useFormSpec_1.default)(customSchema);
|
|
22
22
|
const isEditingMode = viewMode === types_1.ViewModeItem.Edititng;
|
|
23
23
|
const transformedContent = (0, react_1.useMemo)(() => (transformContent ? transformContent(content, { viewMode }) : content), [content, transformContent, viewMode]);
|
|
@@ -48,19 +48,19 @@ const Editor = (_a) => {
|
|
|
48
48
|
content: transformedContent,
|
|
49
49
|
custom: rest.custom,
|
|
50
50
|
},
|
|
51
|
-
providerProps: Object.assign(Object.assign({}, providerProps), { isMobile: (0, utils_1.checkIsMobile)(viewMode) }),
|
|
51
|
+
providerProps: Object.assign(Object.assign({}, providerProps), { isMobile: (0, utils_1.checkIsMobile)(viewMode), theme }),
|
|
52
52
|
deviceEmulationSettings,
|
|
53
|
-
}), [providerProps, rest.custom, viewMode, transformedContent, deviceEmulationSettings]);
|
|
53
|
+
}), [providerProps, rest.custom, viewMode, transformedContent, deviceEmulationSettings, theme]);
|
|
54
54
|
(0, react_1.useEffect)(() => {
|
|
55
55
|
onChange === null || onChange === void 0 ? void 0 : onChange(content);
|
|
56
56
|
}, [content, onChange]);
|
|
57
57
|
return (react_1.default.createElement(context_1.EditorContext.Provider, { value: context },
|
|
58
|
-
react_1.default.createElement(Layout_1.default, { mode: viewMode, onModeChange: onViewModeUpdate },
|
|
58
|
+
react_1.default.createElement(Layout_1.default, { mode: viewMode, onModeChange: onViewModeUpdate, theme: theme, onThemeChange: onThemeUpdate },
|
|
59
59
|
isEditingMode && (react_1.default.createElement(Layout_1.default.Left, null,
|
|
60
60
|
react_1.default.createElement(Form_1.Form, { content: content, onChange: onContentUpdate, activeBlockIndex: activeBlockIndex, onSelect: onSelect, spec: formSpecs }))),
|
|
61
61
|
react_1.default.createElement(Layout_1.default.Right, null,
|
|
62
62
|
react_1.default.createElement(ErrorBoundary_1.ErrorBoundary, { key: errorBoundaryState },
|
|
63
|
-
react_1.default.createElement(PageConstructor_1.PageConstructorProvider, Object.assign({}, providerProps),
|
|
63
|
+
react_1.default.createElement(PageConstructor_1.PageConstructorProvider, Object.assign({}, providerProps, { theme: theme }),
|
|
64
64
|
react_1.default.createElement(PageConstructor_1.PageConstructor, Object.assign({}, outgoingProps)))),
|
|
65
65
|
isEditingMode && react_1.default.createElement(AddBlock_1.default, { onAdd: onAdd })))));
|
|
66
66
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
3
|
.pc-editor-form {
|
|
4
|
-
--top-level-font-size: var(--
|
|
5
|
-
--top-level-line-height: var(--
|
|
6
|
-
--block-level-complex-propery-font-size: var(--
|
|
7
|
-
--block-level-complex-property-line-height: var(--
|
|
8
|
-
--complex-property-font-size: var(--
|
|
9
|
-
--complex-property-line-height: var(--
|
|
10
|
-
--property-font-size: var(--
|
|
11
|
-
--property-line-height: var(--
|
|
4
|
+
--top-level-font-size: var(--g-text-display-2-font-size);
|
|
5
|
+
--top-level-line-height: var(--g-text-display-2-line-height);
|
|
6
|
+
--block-level-complex-propery-font-size: var(--g-text-body-3-font-size);
|
|
7
|
+
--block-level-complex-property-line-height: var(--g-text-body-3-line-height);
|
|
8
|
+
--complex-property-font-size: var(--g-text-body-2-font-size);
|
|
9
|
+
--complex-property-line-height: var(--g-text-body-2-line-height);
|
|
10
|
+
--property-font-size: var(--g-text-body-1-font-size);
|
|
11
|
+
--property-line-height: var(--g-text-body-1-line-height);
|
|
12
12
|
--input-min-width: 150px;
|
|
13
13
|
--property-title-width: 96px;
|
|
14
14
|
--button-height: 48px;
|
|
@@ -63,7 +63,7 @@ unpredictable css rules order in build */
|
|
|
63
63
|
line-height: var(--header-line-height);
|
|
64
64
|
}
|
|
65
65
|
.pc-editor-form .df-simple-vertical-accordeon__header .yc-button {
|
|
66
|
-
--
|
|
66
|
+
--g-button-height: var(--button-height);
|
|
67
67
|
display: flex;
|
|
68
68
|
justify-content: center;
|
|
69
69
|
align-items: center;
|
|
@@ -71,7 +71,7 @@ unpredictable css rules order in build */
|
|
|
71
71
|
.pc-editor-form .df-simple-vertical-accordeon__header .yc-button .yc-button__icon-inner > svg {
|
|
72
72
|
width: var(--icon-size);
|
|
73
73
|
height: var(--icon-size);
|
|
74
|
-
color: var(--
|
|
74
|
+
color: var(--g-color-text-hint);
|
|
75
75
|
}
|
|
76
76
|
.pc-editor-form .df-simple-vertical-accordeon__header .yc-button .yc-button__icon_side_right ~ .yc-button__text {
|
|
77
77
|
margin-right: var(--icon-margin);
|
|
@@ -90,7 +90,7 @@ unpredictable css rules order in build */
|
|
|
90
90
|
padding-top: 4px;
|
|
91
91
|
padding-bottom: 4px;
|
|
92
92
|
padding-left: 12px;
|
|
93
|
-
border-left: 1px solid var(--
|
|
93
|
+
border-left: 1px solid var(--g-color-line-generic-accent);
|
|
94
94
|
}
|
|
95
95
|
.pc-editor-form .df-simple-vertical-accordeon_branch .df-simple-vertical-accordeon__body {
|
|
96
96
|
padding-left: 12px;
|
|
@@ -104,7 +104,7 @@ unpredictable css rules order in build */
|
|
|
104
104
|
margin-top: 12px;
|
|
105
105
|
}
|
|
106
106
|
.pc-editor-form__tabs {
|
|
107
|
-
--
|
|
107
|
+
--g-color-base-brand: var(--pc-color-base-neon);
|
|
108
108
|
margin-bottom: 20px;
|
|
109
109
|
}
|
|
110
110
|
.pc-editor-form__block-form {
|
|
@@ -13,6 +13,6 @@ const DefaultPreview = (props) => (react_1.default.createElement("svg", Object.a
|
|
|
13
13
|
react_1.default.createElement("rect", { x: "14.7674", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "#E7E7E7" }),
|
|
14
14
|
react_1.default.createElement("rect", { x: "33.6977", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "white" }),
|
|
15
15
|
react_1.default.createElement("rect", { x: "52.6279", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "white" }),
|
|
16
|
-
react_1.default.createElement("rect", { x: "78.4418", y: "9.60464", width: "56.7907", height: "56.7907", rx: "5.16279", fill: "
|
|
16
|
+
react_1.default.createElement("rect", { x: "78.4418", y: "9.60464", width: "56.7907", height: "56.7907", rx: "5.16279", fill: "currentColor" }),
|
|
17
17
|
react_1.default.createElement("rect", { x: "0.5", y: "0.5", width: "149", height: "75", rx: "8.5", stroke: "black", strokeOpacity: "0.1" })));
|
|
18
18
|
exports.default = DefaultPreview;
|
|
@@ -5,15 +5,15 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
5
5
|
const svg_1 = require("../../../utils/svg");
|
|
6
6
|
const Header = (props) => (react_1.default.createElement("svg", Object.assign({ width: "150", height: "76", viewBox: "0 0 150 76", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, svg_1.a11yHiddenSvgProps, props),
|
|
7
7
|
react_1.default.createElement("rect", { x: "1", y: "1", width: "148", height: "74", rx: "8", fill: "white" }),
|
|
8
|
-
react_1.default.createElement("rect", { x: "4.44174", y: "9.60464", width: "141.116", height: "56.7907", rx: "5.16279", fill: "
|
|
8
|
+
react_1.default.createElement("rect", { x: "4.44174", y: "9.60464", width: "141.116", height: "56.7907", rx: "5.16279", fill: "currentColor" }),
|
|
9
9
|
react_1.default.createElement("rect", { x: "14.7674", y: "21.6512", width: "28.3953", height: "6.88372", rx: "0.860465", fill: "white" }),
|
|
10
|
-
react_1.default.createElement("rect", { x: "43.1628", y: "21.6512", width: "28.3953", height: "6.88372", rx: "0.860465", fill: "
|
|
10
|
+
react_1.default.createElement("rect", { x: "43.1628", y: "21.6512", width: "28.3953", height: "6.88372", rx: "0.860465", fill: "currentColor" }),
|
|
11
11
|
react_1.default.createElement("rect", { x: "14.7674", y: "31.9767", width: "56.7907", height: "3.44186", rx: "0.860465", fill: "white" }),
|
|
12
12
|
react_1.default.createElement("rect", { x: "14.7674", y: "37.1395", width: "56.7907", height: "3.44186", rx: "0.860465", fill: "white" }),
|
|
13
13
|
react_1.default.createElement("rect", { x: "14.7674", y: "42.3023", width: "56.7907", height: "3.44186", rx: "0.860465", fill: "white" }),
|
|
14
14
|
react_1.default.createElement("rect", { x: "14.7674", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "white" }),
|
|
15
|
-
react_1.default.createElement("rect", { x: "33.6976", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "
|
|
16
|
-
react_1.default.createElement("rect", { x: "52.6279", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "
|
|
17
|
-
react_1.default.createElement("rect", { x: "78.4418", y: "9.60464", width: "56.7907", height: "56.7907", rx: "5.16279", fill: "
|
|
15
|
+
react_1.default.createElement("rect", { x: "33.6976", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "currentColor" }),
|
|
16
|
+
react_1.default.createElement("rect", { x: "52.6279", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "currentColor" }),
|
|
17
|
+
react_1.default.createElement("rect", { x: "78.4418", y: "9.60464", width: "56.7907", height: "56.7907", rx: "5.16279", fill: "currentColor" }),
|
|
18
18
|
react_1.default.createElement("rect", { x: "0.5", y: "0.5", width: "149", height: "75", rx: "8.5", stroke: "black", strokeOpacity: "0.1" })));
|
|
19
19
|
exports.default = Header;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
margin-top: 4px;
|
|
15
15
|
margin-bottom: 20px;
|
|
16
16
|
margin-left: 5px;
|
|
17
|
-
border-left: 1px solid var(--
|
|
17
|
+
border-left: 1px solid var(--g-color-line-generic-accent);
|
|
18
18
|
}
|
|
19
19
|
.pc-one-of-custom .df-group-indent > .df-use-search:empty {
|
|
20
20
|
display: none;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Block, BlockDecorationProps, PageContent } from '../../models';
|
|
1
|
+
import { Block, BlockDecorationProps, PageContent, Theme } from '../../models';
|
|
2
2
|
import { EditBlockProps, EditorProps, ViewModeItem } from '../types';
|
|
3
3
|
export type EditorBlockId = number | string;
|
|
4
4
|
export declare function useEditorState({ content: intialContent, custom }: Omit<EditorProps, 'children'>): {
|
|
@@ -6,9 +6,11 @@ export declare function useEditorState({ content: intialContent, custom }: Omit<
|
|
|
6
6
|
content: PageContent;
|
|
7
7
|
errorBoundaryState: number;
|
|
8
8
|
viewMode: ViewModeItem;
|
|
9
|
+
theme: Theme;
|
|
9
10
|
injectEditBlockProps: ({ type, index: relativeIndex, children, ...rest }: BlockDecorationProps) => EditBlockProps;
|
|
10
11
|
onAdd: (block: Block) => void;
|
|
11
12
|
onSelect: (index: number) => void;
|
|
12
13
|
onContentUpdate: (newContent: PageContent) => void;
|
|
13
14
|
onViewModeUpdate: (newViewMode: ViewModeItem) => void;
|
|
15
|
+
onThemeUpdate: (newTheme: Theme) => void;
|
|
14
16
|
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useEditorState = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const constants_1 = require("../../components/constants");
|
|
6
7
|
const models_1 = require("../../models");
|
|
7
8
|
const utils_1 = require("../../utils");
|
|
8
9
|
const EditBlock_1 = require("../components/EditBlock/EditBlock");
|
|
@@ -10,11 +11,12 @@ const types_1 = require("../types");
|
|
|
10
11
|
const reducer_1 = require("./reducer");
|
|
11
12
|
const utils_2 = require("./utils");
|
|
12
13
|
function useEditorState({ content: intialContent, custom }) {
|
|
13
|
-
const [{ activeBlockIndex, content, errorBoundaryState, viewMode }, dispatch] = (0, react_1.useReducer)(reducer_1.reducer, {
|
|
14
|
+
const [{ activeBlockIndex, content, errorBoundaryState, viewMode, theme }, dispatch] = (0, react_1.useReducer)(reducer_1.reducer, {
|
|
14
15
|
activeBlockIndex: 0,
|
|
15
16
|
errorBoundaryState: 0,
|
|
16
17
|
content: (0, utils_2.addEditorProps)(intialContent),
|
|
17
18
|
viewMode: types_1.ViewModeItem.Edititng,
|
|
19
|
+
theme: constants_1.DEFAULT_THEME,
|
|
18
20
|
});
|
|
19
21
|
return (0, react_1.useMemo)(() => {
|
|
20
22
|
const headerBlockTypes = [...models_1.HeaderBlockTypes, ...(0, utils_1.getCustomHeaderTypes)(custom)];
|
|
@@ -37,6 +39,7 @@ function useEditorState({ content: intialContent, custom }) {
|
|
|
37
39
|
const onSelect = (index) => dispatch({ type: reducer_1.SELECT_BLOCK, payload: index });
|
|
38
40
|
const onContentUpdate = (newContent) => dispatch({ type: reducer_1.UPDATE_CONTENT, payload: newContent });
|
|
39
41
|
const onViewModeUpdate = (newViewMode) => dispatch({ type: reducer_1.UPDATE_VIEW_MODE, payload: newViewMode });
|
|
42
|
+
const onThemeUpdate = (newTheme) => dispatch({ type: reducer_1.UPDATE_THEME, payload: newTheme });
|
|
40
43
|
const injectEditBlockProps = (_a) => {
|
|
41
44
|
var { type, index: relativeIndex = 0, children } = _a, rest = tslib_1.__rest(_a, ["type", "index", "children"]);
|
|
42
45
|
const orderedBlocksStartIndex = contentHasHeader ? 1 : 0;
|
|
@@ -71,12 +74,14 @@ function useEditorState({ content: intialContent, custom }) {
|
|
|
71
74
|
content,
|
|
72
75
|
errorBoundaryState,
|
|
73
76
|
viewMode,
|
|
77
|
+
theme,
|
|
74
78
|
injectEditBlockProps,
|
|
75
79
|
onAdd,
|
|
76
80
|
onSelect,
|
|
77
81
|
onContentUpdate,
|
|
78
82
|
onViewModeUpdate,
|
|
83
|
+
onThemeUpdate,
|
|
79
84
|
};
|
|
80
|
-
}, [content, activeBlockIndex, errorBoundaryState, custom, viewMode]);
|
|
85
|
+
}, [content, activeBlockIndex, errorBoundaryState, custom, viewMode, theme]);
|
|
81
86
|
}
|
|
82
87
|
exports.useEditorState = useEditorState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Block, PageContent } from '../../models';
|
|
1
|
+
import { Block, PageContent, Theme } from '../../models';
|
|
2
2
|
import { ViewModeItem } from '../types';
|
|
3
3
|
export type EditorBlockId = number | string;
|
|
4
4
|
interface EditorState {
|
|
@@ -6,6 +6,7 @@ interface EditorState {
|
|
|
6
6
|
activeBlockIndex: number;
|
|
7
7
|
errorBoundaryState: number;
|
|
8
8
|
viewMode: ViewModeItem;
|
|
9
|
+
theme: Theme;
|
|
9
10
|
}
|
|
10
11
|
interface OrderBlockParams {
|
|
11
12
|
oldIndex: number;
|
|
@@ -23,6 +24,7 @@ export declare const SET_REGION = "SET_REGION";
|
|
|
23
24
|
export declare const ORDER_BLOCK = "ORDER_BLOCK";
|
|
24
25
|
export declare const UPDATE_CONTENT = "UPDATE_CONTENT";
|
|
25
26
|
export declare const UPDATE_VIEW_MODE = "UPDATE_VIEW_MODE";
|
|
27
|
+
export declare const UPDATE_THEME = "UPDATE_THEME";
|
|
26
28
|
interface SelectBlock {
|
|
27
29
|
type: typeof SELECT_BLOCK;
|
|
28
30
|
payload: number;
|
|
@@ -51,6 +53,10 @@ interface UpdateViewMode {
|
|
|
51
53
|
type: typeof UPDATE_VIEW_MODE;
|
|
52
54
|
payload: ViewModeItem;
|
|
53
55
|
}
|
|
54
|
-
|
|
56
|
+
interface UpdateTheme {
|
|
57
|
+
type: typeof UPDATE_THEME;
|
|
58
|
+
payload: Theme;
|
|
59
|
+
}
|
|
60
|
+
export type EditorAction = SelectBlock | DeleteBlock | CopyBlock | AddBlock | OrderBlock | UpdateContent | UpdateViewMode | UpdateTheme;
|
|
55
61
|
export declare const reducer: (state: EditorState, action: EditorAction) => EditorState;
|
|
56
62
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reducer = exports.UPDATE_VIEW_MODE = exports.UPDATE_CONTENT = exports.ORDER_BLOCK = exports.SET_REGION = exports.ADD_BLOCK = exports.COPY_BLOCK = exports.DELETE_BLOCK = exports.SELECT_BLOCK = void 0;
|
|
3
|
+
exports.reducer = exports.UPDATE_THEME = exports.UPDATE_VIEW_MODE = exports.UPDATE_CONTENT = exports.ORDER_BLOCK = exports.SET_REGION = exports.ADD_BLOCK = exports.COPY_BLOCK = exports.DELETE_BLOCK = exports.SELECT_BLOCK = void 0;
|
|
4
4
|
const utils_1 = require("./utils");
|
|
5
5
|
// actions
|
|
6
6
|
exports.SELECT_BLOCK = 'SELECT_BLOCK';
|
|
@@ -11,6 +11,7 @@ exports.SET_REGION = 'SET_REGION';
|
|
|
11
11
|
exports.ORDER_BLOCK = 'ORDER_BLOCK';
|
|
12
12
|
exports.UPDATE_CONTENT = 'UPDATE_CONTENT';
|
|
13
13
|
exports.UPDATE_VIEW_MODE = 'UPDATE_VIEW_MODE';
|
|
14
|
+
exports.UPDATE_THEME = 'UPDATE_THEME';
|
|
14
15
|
// reducer
|
|
15
16
|
const reducer = (state, action) => {
|
|
16
17
|
const { content } = state;
|
|
@@ -38,6 +39,8 @@ const reducer = (state, action) => {
|
|
|
38
39
|
}
|
|
39
40
|
case exports.UPDATE_VIEW_MODE:
|
|
40
41
|
return Object.assign(Object.assign({}, state), { viewMode: action.payload });
|
|
42
|
+
case exports.UPDATE_THEME:
|
|
43
|
+
return Object.assign(Object.assign({}, state), { theme: action.payload });
|
|
41
44
|
default:
|
|
42
45
|
return state;
|
|
43
46
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
--editor-header-height: 48px;
|
|
3
|
-
--editor-divider-width: 12px;
|
|
4
|
-
--editor-
|
|
1
|
+
body {
|
|
2
|
+
--pc-editor-header-height: 48px;
|
|
3
|
+
--pc-editor-divider-width: 12px;
|
|
4
|
+
--pc-editor-base-color: var(--g-color-base-brand);
|
|
5
|
+
--pc-editor-control-color: var(--g-color-private-yellow-400-solid);
|
|
6
|
+
--pc-editor-left-column-width: calc(400px + var(--pc-editor-divider-width));
|
|
5
7
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
|
-
import { Refable } from '../../models/common';
|
|
2
|
+
import { QAProps, Refable } from '../../models/common';
|
|
3
3
|
import { WithChildren } from '../../models/react';
|
|
4
4
|
import { GridColumnClassParams } from '../types';
|
|
5
|
-
export interface GridColumnProps extends GridColumnClassParams, Refable<HTMLDivElement
|
|
5
|
+
export interface GridColumnProps extends GridColumnClassParams, Refable<HTMLDivElement>, QAProps {
|
|
6
6
|
style?: CSSProperties;
|
|
7
|
-
dataQa?: string;
|
|
8
7
|
children?: React.ReactNode;
|
|
9
8
|
}
|
|
10
|
-
export declare const Col: React.ForwardRefExoticComponent<Pick<WithChildren<GridColumnProps>, "style" | "children" | "
|
|
9
|
+
export declare const Col: React.ForwardRefExoticComponent<Pick<WithChildren<GridColumnProps>, "style" | "children" | "sizes" | "className" | "hidden" | "qa" | "reset" | "visible" | "offsets" | "orders" | "alignSelf" | "justifyContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
exports.Col = (0, react_1.forwardRef)((props, ref) => {
|
|
8
|
-
const { children, style,
|
|
9
|
-
return (react_1.default.createElement("div", { ref: ref, className: (0, utils_1.getColClass)(rest), style: style, "data-qa":
|
|
8
|
+
const { children, style, qa } = props, rest = tslib_1.__rest(props, ["children", "style", "qa"]);
|
|
9
|
+
return (react_1.default.createElement("div", { ref: ref, className: (0, utils_1.getColClass)(rest), style: style, "data-qa": qa }, children));
|
|
10
10
|
});
|
|
11
11
|
exports.Col.displayName = 'Col';
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
.pc-Grid_debug .container-fluid,
|
|
18
18
|
.pc-Grid_debug [class*=col-] {
|
|
19
19
|
box-sizing: border-box;
|
|
20
|
-
border: 1px solid var(--
|
|
20
|
+
border: 1px solid var(--g-color-line-generic);
|
|
21
21
|
}
|
|
22
22
|
@media only screen and (max-width: 577px) {
|
|
23
23
|
.pc-Grid .container,
|
|
@@ -7,6 +7,7 @@ export declare enum Theme {
|
|
|
7
7
|
Light = "light",
|
|
8
8
|
Dark = "dark"
|
|
9
9
|
}
|
|
10
|
+
export declare const themeNames: Record<Theme, string>;
|
|
10
11
|
/**
|
|
11
12
|
* @deprecated Pixel will be deleted
|
|
12
13
|
*/
|
|
@@ -63,6 +64,9 @@ export interface Metrika {
|
|
|
63
64
|
export interface ClassNameProps {
|
|
64
65
|
className?: string;
|
|
65
66
|
}
|
|
67
|
+
export interface QAProps {
|
|
68
|
+
qa?: string;
|
|
69
|
+
}
|
|
66
70
|
export type Timeout = ReturnType<typeof setTimeout> | undefined;
|
|
67
71
|
export declare enum PredefinedEventTypes {
|
|
68
72
|
Default = "default-event",
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultEventNames = exports.PredefinedEventTypes = exports.PixelEventType = exports.Theme = void 0;
|
|
3
|
+
exports.DefaultEventNames = exports.PredefinedEventTypes = exports.PixelEventType = exports.themeNames = exports.Theme = void 0;
|
|
4
4
|
var Theme;
|
|
5
5
|
(function (Theme) {
|
|
6
6
|
Theme["Light"] = "light";
|
|
7
7
|
Theme["Dark"] = "dark";
|
|
8
8
|
})(Theme = exports.Theme || (exports.Theme = {}));
|
|
9
|
+
exports.themeNames = {
|
|
10
|
+
[Theme.Light]: 'Light',
|
|
11
|
+
[Theme.Dark]: 'Dark',
|
|
12
|
+
};
|
|
9
13
|
/**
|
|
10
14
|
* @deprecated Pixel will be deleted from package
|
|
11
15
|
*/
|