@gravity-ui/page-constructor 3.0.0-alpha.5 → 3.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/CHANGELOG.md +74 -0
- package/README.md +1 -1
- package/build/cjs/blocks/CardLayout/CardLayout.js +1 -1
- package/build/cjs/blocks/CardLayout/schema.d.ts +2 -2
- package/build/cjs/blocks/CardLayout/schema.js +1 -1
- package/build/cjs/blocks/FilterBlock/FilterBlock.js +9 -13
- package/build/cjs/blocks/Header/schema.d.ts +9 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
- package/build/cjs/blocks/Media/schema.d.ts +6 -0
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
- package/build/cjs/blocks/Tabs/schema.d.ts +3 -0
- package/build/cjs/components/BackgroundImage/BackgroundImage.js +2 -2
- package/build/cjs/components/BlockBase/BlockBase.d.ts +3 -2
- package/build/cjs/components/BlockBase/BlockBase.js +4 -2
- package/build/cjs/components/FullscreenImage/{FullScreenImage.css → FullscreenImage.css} +13 -13
- package/build/cjs/components/FullscreenImage/FullscreenImage.d.ts +3 -3
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +7 -7
- package/build/cjs/components/FullscreenImage/i18n/index.js +1 -1
- package/build/cjs/components/FullscreenMedia/FullscreenMedia.d.ts +9 -0
- package/build/cjs/components/FullscreenMedia/{FullScreenMedia.js → FullscreenMedia.js} +5 -5
- package/build/cjs/components/Image/Image.d.ts +1 -0
- package/build/cjs/components/Image/Image.js +2 -2
- package/build/cjs/components/Media/FullscreenVideo/FullscreenVideo.d.ts +4 -0
- package/build/cjs/components/Media/FullscreenVideo/FullscreenVideo.js +10 -0
- package/build/cjs/components/Media/Image/Image.d.ts +1 -0
- package/build/cjs/components/Media/Image/Image.js +10 -3
- package/build/cjs/components/Media/Media.js +25 -5
- package/build/cjs/components/Media/Video/Video.d.ts +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.d.ts +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.js +3 -3
- package/build/cjs/components/index.d.ts +1 -1
- package/build/cjs/components/index.js +3 -3
- package/build/cjs/constructor-items.d.ts +1 -1
- package/build/cjs/containers/Loadable/Loadable.d.ts +2 -2
- package/build/cjs/containers/PageConstructor/PageConstructor.js +5 -3
- package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +3 -2
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +5 -5
- package/build/cjs/context/innerContext/InnerContext.d.ts +2 -1
- package/build/cjs/customization/BlockDecoration.d.ts +3 -0
- package/build/cjs/customization/BlockDecoration.js +22 -0
- package/build/cjs/editor/Components/AddBlock/AddBlock.css +82 -0
- package/build/cjs/editor/Components/AddBlock/AddBlock.d.ts +7 -0
- package/build/cjs/editor/Components/AddBlock/AddBlock.js +43 -0
- package/build/cjs/editor/Components/EditBlock/EditBlock.css +47 -0
- package/build/cjs/editor/Components/EditBlock/EditBlock.d.ts +4 -0
- package/build/cjs/editor/Components/EditBlock/EditBlock.js +32 -0
- package/build/cjs/editor/Containers/Editor.d.ts +2 -0
- package/build/cjs/editor/Containers/Editor.js +24 -0
- package/build/cjs/editor/data/index.d.ts +13 -0
- package/build/cjs/editor/data/index.js +27 -0
- package/build/cjs/editor/data/previews/default-preview.d.ts +3 -0
- package/build/cjs/editor/data/previews/default-preview.js +18 -0
- package/build/cjs/editor/data/previews/header-block.d.ts +3 -0
- package/build/cjs/editor/data/previews/header-block.js +19 -0
- package/build/cjs/editor/index.d.ts +2 -0
- package/build/cjs/editor/index.js +7 -0
- package/build/cjs/editor/store/index.d.ts +15 -0
- package/build/cjs/editor/store/index.js +32 -0
- package/build/cjs/editor/store/reducer.d.ts +41 -0
- package/build/cjs/editor/store/reducer.js +59 -0
- package/build/cjs/editor/store/utils.d.ts +12 -0
- package/build/cjs/editor/store/utils.js +34 -0
- package/build/cjs/editor/styles/mixins.css +0 -0
- package/build/cjs/editor/styles/variables.css +0 -0
- package/build/cjs/editor/types/index.d.ts +17 -0
- package/build/cjs/editor/types/index.js +2 -0
- package/build/cjs/editor/utils/index.d.ts +11 -0
- package/build/cjs/editor/utils/index.js +12 -0
- package/build/cjs/grid/Col/Col.d.ts +1 -1
- package/build/cjs/hooks/useMetrika.js +0 -7
- package/build/cjs/icons/Fullscreen.d.ts +2 -0
- package/build/cjs/icons/{FullScreen.js → Fullscreen.js} +3 -3
- package/build/cjs/icons/index.d.ts +1 -1
- package/build/cjs/icons/index.js +1 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +2 -12
- package/build/cjs/models/constructor-items/blocks.js +0 -2
- package/build/cjs/models/constructor-items/common.d.ts +2 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +1 -1
- package/build/cjs/models/constructor.d.ts +4 -1
- package/build/cjs/models/customization.d.ts +9 -0
- package/build/cjs/models/customization.js +2 -0
- package/build/cjs/models/index.d.ts +1 -0
- package/build/cjs/models/index.js +1 -0
- package/build/cjs/schema/index.js +0 -1
- package/build/cjs/schema/validators/common.d.ts +3 -0
- package/build/cjs/schema/validators/common.js +3 -0
- package/build/cjs/sub-blocks/Content/Content.js +2 -2
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +4 -4
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +4 -1
- package/build/cjs/sub-blocks/LayoutItem/schema.js +1 -1
- package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +2 -2
- package/build/cjs/sub-blocks/LayoutItem/utils.js +6 -6
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +7 -0
- package/build/cjs/sub-blocks/MediaCard/schema.js +1 -1
- package/build/cjs/text-transform/transformers.js +2 -4
- package/build/cjs/utils/blocks.d.ts +4 -1
- package/build/cjs/utils/blocks.js +11 -1
- package/build/esm/blocks/CardLayout/CardLayout.js +1 -1
- package/build/esm/blocks/CardLayout/schema.d.ts +2 -2
- package/build/esm/blocks/CardLayout/schema.js +1 -1
- package/build/esm/blocks/FilterBlock/FilterBlock.js +10 -14
- package/build/esm/blocks/Header/schema.d.ts +9 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
- package/build/esm/blocks/Media/schema.d.ts +6 -0
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
- package/build/esm/blocks/Tabs/Tabs.js +2 -2
- package/build/esm/blocks/Tabs/schema.d.ts +3 -0
- package/build/esm/components/BackgroundImage/BackgroundImage.js +2 -2
- package/build/esm/components/BlockBase/BlockBase.d.ts +3 -2
- package/build/esm/components/BlockBase/BlockBase.js +4 -2
- package/build/esm/components/FullscreenImage/{FullScreenImage.css → FullscreenImage.css} +13 -13
- package/build/esm/components/FullscreenImage/FullscreenImage.d.ts +4 -4
- package/build/esm/components/FullscreenImage/FullscreenImage.js +9 -9
- package/build/esm/components/FullscreenImage/i18n/index.js +1 -1
- package/build/esm/components/FullscreenMedia/FullscreenMedia.d.ts +10 -0
- package/build/esm/components/FullscreenMedia/{FullScreenMedia.js → FullscreenMedia.js} +7 -7
- package/build/esm/components/Image/Image.d.ts +1 -0
- package/build/esm/components/Image/Image.js +2 -2
- package/build/esm/components/Media/FullscreenVideo/FullscreenVideo.d.ts +4 -0
- package/build/esm/components/Media/FullscreenVideo/FullscreenVideo.js +7 -0
- package/build/esm/components/Media/Image/Image.d.ts +1 -0
- package/build/esm/components/Media/Image/Image.js +12 -5
- package/build/esm/components/Media/Media.js +25 -5
- package/build/esm/components/Media/Video/Video.d.ts +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.d.ts +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.js +3 -3
- package/build/esm/components/index.d.ts +1 -1
- package/build/esm/components/index.js +1 -1
- package/build/esm/constructor-items.d.ts +1 -1
- package/build/esm/containers/Loadable/Loadable.d.ts +2 -2
- package/build/esm/containers/PageConstructor/PageConstructor.js +6 -4
- package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +3 -2
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +5 -5
- package/build/esm/context/innerContext/InnerContext.d.ts +2 -1
- package/build/esm/customization/BlockDecoration.d.ts +3 -0
- package/build/esm/customization/BlockDecoration.js +17 -0
- package/build/esm/editor/Components/AddBlock/AddBlock.css +82 -0
- package/build/esm/editor/Components/AddBlock/AddBlock.d.ts +8 -0
- package/build/esm/editor/Components/AddBlock/AddBlock.js +41 -0
- package/build/esm/editor/Components/EditBlock/EditBlock.css +47 -0
- package/build/esm/editor/Components/EditBlock/EditBlock.d.ts +5 -0
- package/build/esm/editor/Components/EditBlock/EditBlock.js +30 -0
- package/build/esm/editor/Containers/Editor.d.ts +2 -0
- package/build/esm/editor/Containers/Editor.js +20 -0
- package/build/esm/editor/data/index.d.ts +13 -0
- package/build/esm/editor/data/index.js +24 -0
- package/build/esm/editor/data/previews/default-preview.d.ts +3 -0
- package/build/esm/editor/data/previews/default-preview.js +15 -0
- package/build/esm/editor/data/previews/header-block.d.ts +3 -0
- package/build/esm/editor/data/previews/header-block.js +16 -0
- package/build/esm/editor/index.d.ts +2 -0
- package/build/esm/editor/index.js +2 -0
- package/build/esm/editor/store/index.d.ts +15 -0
- package/build/esm/editor/store/index.js +28 -0
- package/build/esm/editor/store/reducer.d.ts +41 -0
- package/build/esm/editor/store/reducer.js +55 -0
- package/build/esm/editor/store/utils.d.ts +12 -0
- package/build/esm/editor/store/utils.js +26 -0
- package/build/esm/editor/styles/mixins.css +0 -0
- package/build/esm/editor/styles/variables.css +0 -0
- package/build/esm/editor/types/index.d.ts +17 -0
- package/build/esm/editor/types/index.js +1 -0
- package/build/esm/editor/utils/index.d.ts +11 -0
- package/build/esm/editor/utils/index.js +6 -0
- package/build/esm/grid/Col/Col.d.ts +1 -1
- package/build/esm/hooks/useMetrika.js +0 -7
- package/build/esm/icons/Fullscreen.d.ts +2 -0
- package/build/esm/icons/{FullScreen.js → Fullscreen.js} +1 -1
- package/build/esm/icons/index.d.ts +1 -1
- package/build/esm/icons/index.js +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +2 -12
- package/build/esm/models/constructor-items/blocks.js +0 -2
- package/build/esm/models/constructor-items/common.d.ts +2 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +1 -1
- package/build/esm/models/constructor.d.ts +4 -1
- package/build/esm/models/customization.d.ts +9 -0
- package/build/esm/models/customization.js +1 -0
- package/build/esm/models/index.d.ts +1 -0
- package/build/esm/models/index.js +1 -0
- package/build/esm/schema/index.js +0 -1
- package/build/esm/schema/validators/common.d.ts +3 -0
- package/build/esm/schema/validators/common.js +3 -0
- package/build/esm/sub-blocks/Content/Content.js +2 -3
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +6 -6
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +4 -1
- package/build/esm/sub-blocks/LayoutItem/schema.js +1 -1
- package/build/esm/sub-blocks/LayoutItem/utils.d.ts +2 -2
- package/build/esm/sub-blocks/LayoutItem/utils.js +3 -3
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +7 -0
- package/build/esm/sub-blocks/MediaCard/schema.js +2 -2
- package/build/esm/text-transform/transformers.js +2 -4
- package/build/esm/utils/blocks.d.ts +4 -1
- package/build/esm/utils/blocks.js +7 -0
- package/package.json +4 -6
- package/server/models/constructor-items/blocks.d.ts +2 -12
- package/server/models/constructor-items/blocks.js +0 -2
- package/server/models/constructor-items/common.d.ts +2 -1
- package/server/models/constructor-items/sub-blocks.d.ts +1 -1
- package/server/models/constructor.d.ts +4 -1
- package/server/models/customization.d.ts +9 -0
- package/server/models/customization.js +2 -0
- package/server/models/index.d.ts +1 -0
- package/server/models/index.js +1 -0
- package/server/text-transform/transformers.js +2 -4
- package/server/utils/blocks.d.ts +4 -1
- package/server/utils/blocks.js +11 -1
- package/styles/styles.css +0 -196
- package/styles/styles.scss +0 -1
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.d.ts +0 -9
- package/build/cjs/icons/FullScreen.d.ts +0 -2
- package/build/esm/components/FullscreenMedia/FullScreenMedia.d.ts +0 -10
- package/build/esm/icons/FullScreen.d.ts +0 -2
- package/styles/fonts.scss +0 -223
- /package/build/cjs/components/FullscreenMedia/{FullScreenMedia.css → FullscreenMedia.css} +0 -0
- /package/build/esm/components/FullscreenMedia/{FullScreenMedia.css → FullscreenMedia.css} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,79 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.0.0](https://github.com/gravity-ui/page-constructor/compare/v2.22.2...v3.0.0) (2023-06-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* remove Preview block ([#235](https://github.com/gravity-ui/page-constructor/issues/235)), use Tabs block
|
|
9
|
+
* remove Simple block ([#228](https://github.com/gravity-ui/page-constructor/issues/228)), use ContentLayout block
|
|
10
|
+
* remove CardWithImage sub-block ([#236](https://github.com/gravity-ui/page-constructor/issues/236)), use LayoutItem sub-block
|
|
11
|
+
* remove Security block ([#321](https://github.com/gravity-ui/page-constructor/issues/321)), use ContentLayout block
|
|
12
|
+
* remove LinkTable block ([#325](https://github.com/gravity-ui/page-constructor/issues/325)), use ContentLayout block
|
|
13
|
+
* remove TutorialCard sub-block ([#331](https://github.com/gravity-ui/page-constructor/issues/331)), use BasicCard sub-block
|
|
14
|
+
* remove hook HeightCalculator ([#328](https://github.com/gravity-ui/page-constructor/issues/328))
|
|
15
|
+
* remove Partner sub-block ([#335](https://github.com/gravity-ui/page-constructor/issues/335)), use BasicCard sub-block
|
|
16
|
+
* remove NewsCard sub-block ([#342](https://github.com/gravity-ui/page-constructor/issues/342)), use BasicCard sub-block
|
|
17
|
+
* remove component Footnotes ([#343](https://github.com/gravity-ui/page-constructor/issues/343)), use ContentLayout block
|
|
18
|
+
* remove component BlockHeader ([#341](https://github.com/gravity-ui/page-constructor/issues/341)), use component Title
|
|
19
|
+
* remove property `fullScreen` from components ([#366](https://github.com/gravity-ui/page-constructor/issues/366)), use property `fullscreen`
|
|
20
|
+
* rename component FullScreenMedia to FullscreenMedia ([#366](https://github.com/gravity-ui/page-constructor/issues/366))
|
|
21
|
+
* rename icon name FullScreen to Fullscreen ([#366](https://github.com/gravity-ui/page-constructor/issues/366))
|
|
22
|
+
* remove property `showFullScreenIcon` from FullscreenMedia ([#366](https://github.com/gravity-ui/page-constructor/issues/366)), use property `showFullscreenIcon`
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### refactor
|
|
26
|
+
|
|
27
|
+
* refactor text-transform functions ([#225](https://github.com/gravity-ui/page-constructor/issues/225))
|
|
28
|
+
|
|
29
|
+
## [2.22.2](https://github.com/gravity-ui/page-constructor/compare/v2.22.1...v2.22.2) (2023-06-01)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* **MediaBlock:** add border property into schema ([#371](https://github.com/gravity-ui/page-constructor/issues/371)) ([5365791](https://github.com/gravity-ui/page-constructor/commit/5365791550bdb2ed8258d9582605e620ab0e1b11))
|
|
35
|
+
|
|
36
|
+
## [2.22.1](https://github.com/gravity-ui/page-constructor/compare/v2.22.0...v2.22.1) (2023-06-01)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* filter block nesting ([#364](https://github.com/gravity-ui/page-constructor/issues/364)) ([5b62522](https://github.com/gravity-ui/page-constructor/commit/5b62522e5e34eeacbb2fb9ec6de957bba69cd758))
|
|
42
|
+
|
|
43
|
+
## [2.22.0](https://github.com/gravity-ui/page-constructor/compare/v2.21.0...v2.22.0) (2023-05-31)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Features
|
|
47
|
+
|
|
48
|
+
* **Media:** add fullscreen video ([#345](https://github.com/gravity-ui/page-constructor/issues/345)) ([516a9a8](https://github.com/gravity-ui/page-constructor/commit/516a9a8423d710b6ecad33046121c489fa876e30))
|
|
49
|
+
|
|
50
|
+
## [2.21.0](https://github.com/gravity-ui/page-constructor/compare/v2.20.1...v2.21.0) (2023-05-29)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Features
|
|
54
|
+
|
|
55
|
+
* remove metrika goals from pixel events ([#355](https://github.com/gravity-ui/page-constructor/issues/355)) ([1a0ddae](https://github.com/gravity-ui/page-constructor/commit/1a0ddae92e4862665c64652c0da27cee9085d286))
|
|
56
|
+
|
|
57
|
+
## [2.20.1](https://github.com/gravity-ui/page-constructor/compare/v2.20.0...v2.20.1) (2023-05-29)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Bug Fixes
|
|
61
|
+
|
|
62
|
+
* editor scroll ([#352](https://github.com/gravity-ui/page-constructor/issues/352)) ([9fbbefe](https://github.com/gravity-ui/page-constructor/commit/9fbbefec311a0017eab7533b0b26bbddf97ff453))
|
|
63
|
+
|
|
64
|
+
## [2.20.0](https://github.com/gravity-ui/page-constructor/compare/v2.19.0...v2.20.0) (2023-05-25)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
### Features
|
|
68
|
+
|
|
69
|
+
* add page structure editor ([8d1dafe](https://github.com/gravity-ui/page-constructor/commit/8d1dafe964a9af3c7f5ad0e6039cccf2d24da64f))
|
|
70
|
+
* Edit mode ([#347](https://github.com/gravity-ui/page-constructor/issues/347)) ([8d1dafe](https://github.com/gravity-ui/page-constructor/commit/8d1dafe964a9af3c7f5ad0e6039cccf2d24da64f))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### Bug Fixes
|
|
74
|
+
|
|
75
|
+
* customization types import fix ([#350](https://github.com/gravity-ui/page-constructor/issues/350)) ([206306f](https://github.com/gravity-ui/page-constructor/commit/206306f95d87ae428538b27dca08f78cb4de9430))
|
|
76
|
+
|
|
3
77
|
## [2.19.0](https://github.com/gravity-ui/page-constructor/compare/v2.18.0...v2.19.0) (2023-05-23)
|
|
4
78
|
|
|
5
79
|
|
package/README.md
CHANGED
|
@@ -183,7 +183,7 @@ Sub-blocks are components that can be used in the block `children` property. In
|
|
|
183
183
|
- Add it to `enum` or `selectCases` in the `schema/index.ts` file.
|
|
184
184
|
|
|
185
185
|
6. In the block directory, add the `README.md` file with a description of input parameters.
|
|
186
|
-
7. In the block directory add storybook demo in `__stories__` folder.
|
|
186
|
+
7. In the block directory add storybook demo in `__stories__` folder. All demo content for story should be placed in `data.json` at story dir. The generic `Story` must accept the type of block props, otherwise incorrect block props will be displayed in Storybook.
|
|
187
187
|
|
|
188
188
|
### Themes
|
|
189
189
|
|
|
@@ -12,6 +12,6 @@ const DEFAULT_SIZES = {
|
|
|
12
12
|
};
|
|
13
13
|
const b = (0, utils_1.block)('card-layout-block');
|
|
14
14
|
const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, }) => (react_1.default.createElement(components_1.AnimateBlock, { className: b(), animate: animated },
|
|
15
|
-
react_1.default.createElement(components_1.Title, { title: title, subtitle: description }),
|
|
15
|
+
(title || description) && react_1.default.createElement(components_1.Title, { title: title, subtitle: description }),
|
|
16
16
|
react_1.default.createElement(grid_1.Row, null, react_1.default.Children.map(children, (child, index) => (react_1.default.createElement(grid_1.Col, { key: index, sizes: colSizes, className: b('item') }, child))))));
|
|
17
17
|
exports.default = CardLayout;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const CardLayoutProps: {
|
|
2
2
|
additionalProperties: boolean;
|
|
3
|
-
required:
|
|
3
|
+
required: never[];
|
|
4
4
|
properties: {
|
|
5
5
|
colSizes: {
|
|
6
6
|
type: string;
|
|
@@ -76,7 +76,7 @@ export declare const CardLayoutProps: {
|
|
|
76
76
|
export declare const CardLayoutBlock: {
|
|
77
77
|
'card-layout-block': {
|
|
78
78
|
additionalProperties: boolean;
|
|
79
|
-
required:
|
|
79
|
+
required: never[];
|
|
80
80
|
properties: {
|
|
81
81
|
colSizes: {
|
|
82
82
|
type: string;
|
|
@@ -4,7 +4,7 @@ exports.CardLayoutBlock = exports.CardLayoutProps = void 0;
|
|
|
4
4
|
const common_1 = require("../../schema/validators/common");
|
|
5
5
|
exports.CardLayoutProps = {
|
|
6
6
|
additionalProperties: false,
|
|
7
|
-
required: [
|
|
7
|
+
required: [],
|
|
8
8
|
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, common_1.BlockBaseProps), common_1.AnimatableProps), common_1.BlockHeaderProps), { colSizes: common_1.containerSizesObject, children: common_1.ChildrenCardsProps }),
|
|
9
9
|
};
|
|
10
10
|
exports.CardLayoutBlock = {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const __1 = require("..");
|
|
5
6
|
const components_1 = require("../../components");
|
|
6
7
|
const ButtonTabs_1 = tslib_1.__importDefault(require("../../components/ButtonTabs/ButtonTabs"));
|
|
7
|
-
const
|
|
8
|
+
const ConstructorItem_1 = require("../../containers/PageConstructor/components/ConstructorItem");
|
|
8
9
|
const grid_1 = require("../../grid");
|
|
9
|
-
const models_1 = require("../../models");
|
|
10
10
|
const utils_1 = require("../../utils");
|
|
11
11
|
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
12
12
|
const b = (0, utils_1.block)('filter-block');
|
|
@@ -24,25 +24,21 @@ const FilterBlock = ({ title, description, tags, tagButtonSize, allTag, items, c
|
|
|
24
24
|
? tabButtons[0].id
|
|
25
25
|
: selectedTag;
|
|
26
26
|
}, [tabButtons, selectedTag]);
|
|
27
|
-
const
|
|
27
|
+
const cards = (0, react_1.useMemo)(() => {
|
|
28
28
|
const itemsToShow = actualTag
|
|
29
29
|
? items.filter((item) => item.tags.includes(actualTag))
|
|
30
30
|
: items;
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
type: models_1.BlockType.CardLayoutBlock,
|
|
34
|
-
title: '',
|
|
35
|
-
colSizes: colSizes,
|
|
36
|
-
children: itemsToShow.map((item) => item.card),
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
}, [actualTag, items, colSizes]);
|
|
31
|
+
return itemsToShow.map((item) => item.card);
|
|
32
|
+
}, [actualTag, items]);
|
|
40
33
|
return (react_1.default.createElement(components_1.AnimateBlock, { className: b(), animate: animated },
|
|
41
34
|
title && (react_1.default.createElement(components_1.Title, { className: b('title', { centered: centered }), title: title, subtitle: description })),
|
|
42
35
|
tabButtons.length && (react_1.default.createElement(grid_1.Row, null,
|
|
43
36
|
react_1.default.createElement(grid_1.Col, null,
|
|
44
37
|
react_1.default.createElement(ButtonTabs_1.default, { className: b('tabs', { centered: centered }), items: tabButtons, activeTab: selectedTag, onSelectTab: setSelectedTag, tabSize: tagButtonSize })))),
|
|
45
38
|
react_1.default.createElement(grid_1.Row, { className: b('block-container') },
|
|
46
|
-
react_1.default.createElement(
|
|
39
|
+
react_1.default.createElement(__1.CardLayoutBlock, { title: "", colSizes: colSizes }, cards.map((card, index) => {
|
|
40
|
+
const key = (0, utils_1.getBlockKey)(card, index);
|
|
41
|
+
return react_1.default.createElement(ConstructorItem_1.ConstructorItem, { data: card, blockKey: key, key: key });
|
|
42
|
+
})))));
|
|
47
43
|
};
|
|
48
44
|
exports.default = FilterBlock;
|
|
@@ -137,6 +137,9 @@ export declare const HeaderBackgroundProps: {
|
|
|
137
137
|
type: string;
|
|
138
138
|
})[];
|
|
139
139
|
};
|
|
140
|
+
fullscreen: {
|
|
141
|
+
type: string;
|
|
142
|
+
};
|
|
140
143
|
};
|
|
141
144
|
};
|
|
142
145
|
export declare const HeaderProperties: {
|
|
@@ -424,6 +427,9 @@ export declare const HeaderProperties: {
|
|
|
424
427
|
type: string;
|
|
425
428
|
})[];
|
|
426
429
|
};
|
|
430
|
+
fullscreen: {
|
|
431
|
+
type: string;
|
|
432
|
+
};
|
|
427
433
|
};
|
|
428
434
|
} | {
|
|
429
435
|
type: string;
|
|
@@ -757,6 +763,9 @@ export declare const HeaderBlock: {
|
|
|
757
763
|
type: string;
|
|
758
764
|
})[];
|
|
759
765
|
};
|
|
766
|
+
fullscreen: {
|
|
767
|
+
type: string;
|
|
768
|
+
};
|
|
760
769
|
};
|
|
761
770
|
} | {
|
|
762
771
|
type: string;
|
|
@@ -131,6 +131,9 @@ export declare const Media: {
|
|
|
131
131
|
type: string;
|
|
132
132
|
})[];
|
|
133
133
|
};
|
|
134
|
+
fullscreen: {
|
|
135
|
+
type: string;
|
|
136
|
+
};
|
|
134
137
|
};
|
|
135
138
|
};
|
|
136
139
|
export declare const MediaBlockBaseProps: {
|
|
@@ -608,6 +611,9 @@ export declare const MediaBlock: {
|
|
|
608
611
|
type: string;
|
|
609
612
|
})[];
|
|
610
613
|
};
|
|
614
|
+
fullscreen: {
|
|
615
|
+
type: string;
|
|
616
|
+
};
|
|
611
617
|
};
|
|
612
618
|
};
|
|
613
619
|
description: {
|
|
@@ -6,8 +6,8 @@ const utils_1 = require("../../utils");
|
|
|
6
6
|
const Image_1 = tslib_1.__importDefault(require("../Image/Image"));
|
|
7
7
|
const b = (0, utils_1.block)('storage-background-image');
|
|
8
8
|
const BackgroundImage = (props) => {
|
|
9
|
-
const { children, src, desktop, className, imageClassName, style, hide } = props;
|
|
10
|
-
return (react_1.default.createElement("div", { className: b(null, className), style: style },
|
|
9
|
+
const { children, src, desktop, className, imageClassName, style, hide, qa } = props;
|
|
10
|
+
return (react_1.default.createElement("div", { className: b(null, className), style: style, "data-qa": qa },
|
|
11
11
|
(src || desktop) && !hide && react_1.default.createElement(Image_1.default, Object.assign({}, props, { className: b('img', imageClassName) })),
|
|
12
12
|
children && react_1.default.createElement("div", { className: b('container') }, children)));
|
|
13
13
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { BlockBaseProps, ClassNameProps } from '../../models';
|
|
3
|
+
declare const BlockBase: (props: PropsWithChildren<BlockBaseProps & ClassNameProps>) => JSX.Element;
|
|
3
4
|
export default BlockBase;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const BlockDecoration_1 = require("../../customization/BlockDecoration");
|
|
5
6
|
const grid_1 = require("../../grid");
|
|
6
7
|
const utils_1 = require("../../utils");
|
|
7
8
|
const Anchor_1 = tslib_1.__importDefault(require("../Anchor/Anchor"));
|
|
@@ -9,7 +10,8 @@ const b = (0, utils_1.block)('block-base');
|
|
|
9
10
|
const BlockBase = (props) => {
|
|
10
11
|
const { anchor, visible, children, className, resetPaddings, qa } = props;
|
|
11
12
|
return (react_1.default.createElement(grid_1.Col, { className: b({ ['reset-paddings']: resetPaddings }, className), visible: visible, reset: true, dataQa: qa },
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
react_1.default.createElement(BlockDecoration_1.BlockDecoration, null,
|
|
14
|
+
anchor && react_1.default.createElement(Anchor_1.default, { id: anchor.url, className: b('anchor') }),
|
|
15
|
+
children)));
|
|
14
16
|
};
|
|
15
17
|
exports.default = BlockBase;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
-
.pc-
|
|
3
|
+
.pc-fullscreen-image__image {
|
|
4
4
|
cursor: pointer;
|
|
5
5
|
}
|
|
6
|
-
.pc-
|
|
6
|
+
.pc-fullscreen-image__image-wrapper {
|
|
7
7
|
position: relative;
|
|
8
8
|
}
|
|
9
|
-
.pc-
|
|
9
|
+
.pc-fullscreen-image__modal-content {
|
|
10
10
|
position: relative;
|
|
11
11
|
}
|
|
12
|
-
.pc-
|
|
12
|
+
.pc-fullscreen-image__modal-image {
|
|
13
13
|
display: block;
|
|
14
14
|
max-width: 1232px;
|
|
15
15
|
max-height: 70vh;
|
|
16
16
|
overflow: hidden;
|
|
17
17
|
}
|
|
18
|
-
.pc-
|
|
18
|
+
.pc-fullscreen-image__modal .yc-modal__content, .pc-fullscreen-image__modal-image {
|
|
19
19
|
border-radius: var(--pc-border-radius);
|
|
20
20
|
}
|
|
21
|
-
.pc-
|
|
21
|
+
.pc-fullscreen-image__icon-wrapper {
|
|
22
22
|
display: flex;
|
|
23
23
|
align-items: center;
|
|
24
24
|
justify-content: center;
|
|
@@ -33,28 +33,28 @@ unpredictable css rules order in build */
|
|
|
33
33
|
opacity: 0;
|
|
34
34
|
transition: 0.3s;
|
|
35
35
|
}
|
|
36
|
-
.pc-
|
|
36
|
+
.pc-fullscreen-image__icon-wrapper_visible {
|
|
37
37
|
opacity: 1;
|
|
38
38
|
}
|
|
39
|
-
.pc-
|
|
39
|
+
.pc-fullscreen-image__icon {
|
|
40
40
|
color: var(--yc-color-text-hint);
|
|
41
41
|
}
|
|
42
|
-
.pc-
|
|
42
|
+
.pc-fullscreen-image__icon_hover:hover {
|
|
43
43
|
color: var(--yc-color-text-secondary);
|
|
44
44
|
}
|
|
45
45
|
@media (max-width: 1185px) {
|
|
46
|
-
.pc-
|
|
46
|
+
.pc-fullscreen-image__modal-image {
|
|
47
47
|
width: 100%;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
@media (max-width: 1081px) {
|
|
51
|
-
.pc-
|
|
51
|
+
.pc-fullscreen-image__image {
|
|
52
52
|
pointer-events: none;
|
|
53
53
|
}
|
|
54
|
-
.pc-
|
|
54
|
+
.pc-fullscreen-image__icon-wrapper {
|
|
55
55
|
display: none;
|
|
56
56
|
}
|
|
57
|
-
.pc-
|
|
57
|
+
.pc-fullscreen-image__modal {
|
|
58
58
|
display: none !important; /* stylelint-disable-line declaration-no-important */
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { ImageProps } from '../Image/Image';
|
|
3
|
-
export interface
|
|
3
|
+
export interface FullscreenImageProps extends ImageProps {
|
|
4
4
|
imageClassName?: string;
|
|
5
5
|
modalImageClass?: string;
|
|
6
6
|
imageStyle?: CSSProperties;
|
|
7
7
|
}
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
8
|
+
declare const FullscreenImage: (props: FullscreenImageProps) => JSX.Element;
|
|
9
|
+
export default FullscreenImage;
|
|
@@ -7,26 +7,26 @@ const icons_1 = require("../../icons");
|
|
|
7
7
|
const utils_1 = require("../../utils");
|
|
8
8
|
const Image_1 = tslib_1.__importDefault(require("../Image/Image"));
|
|
9
9
|
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
10
|
-
const b = (0, utils_1.block)('
|
|
10
|
+
const b = (0, utils_1.block)('fullscreen-image');
|
|
11
11
|
const FULL_SCREEN_ICON_SIZE = 18;
|
|
12
12
|
const CLOSE_ICON_SIZE = 30;
|
|
13
|
-
const
|
|
13
|
+
const FullscreenImage = (props) => {
|
|
14
14
|
const { imageClassName, modalImageClass, imageStyle, alt = (0, i18n_1.default)('img-alt') } = props;
|
|
15
15
|
const [isOpened, setIsOpened] = (0, react_1.useState)(false);
|
|
16
16
|
const [isMouseEnter, setIsMouseEnter] = (0, react_1.useState)(false);
|
|
17
17
|
const openModal = () => setIsOpened(true);
|
|
18
18
|
const closeModal = () => setIsOpened(false);
|
|
19
|
-
const
|
|
20
|
-
const
|
|
19
|
+
const showFullscreenIcon = () => setIsMouseEnter(true);
|
|
20
|
+
const hideFullscreenIcon = () => setIsMouseEnter(false);
|
|
21
21
|
return (react_1.default.createElement("div", { className: b() },
|
|
22
|
-
react_1.default.createElement("div", { className: b('image-wrapper'), onMouseEnter:
|
|
22
|
+
react_1.default.createElement("div", { className: b('image-wrapper'), onMouseEnter: showFullscreenIcon, onMouseLeave: hideFullscreenIcon },
|
|
23
23
|
react_1.default.createElement(Image_1.default, Object.assign({}, props, { alt: alt, className: b('image', imageClassName), onClick: openModal, style: imageStyle })),
|
|
24
24
|
react_1.default.createElement("div", { className: b('icon-wrapper', { visible: isMouseEnter }), onClick: openModal },
|
|
25
|
-
react_1.default.createElement(uikit_1.Icon, { data: icons_1.
|
|
25
|
+
react_1.default.createElement(uikit_1.Icon, { data: icons_1.Fullscreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') }))),
|
|
26
26
|
isOpened && (react_1.default.createElement(uikit_1.Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
|
|
27
27
|
react_1.default.createElement("div", { className: b('modal-content') },
|
|
28
28
|
react_1.default.createElement("div", { className: b('icon-wrapper', { visible: true }), onClick: closeModal },
|
|
29
29
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.PreviewClose, width: CLOSE_ICON_SIZE, height: CLOSE_ICON_SIZE, className: b('icon', { hover: true }) })),
|
|
30
30
|
react_1.default.createElement(Image_1.default, Object.assign({}, props, { className: b('modal-image', modalImageClass) })))))));
|
|
31
31
|
};
|
|
32
|
-
exports.default =
|
|
32
|
+
exports.default = FullscreenImage;
|
|
@@ -4,5 +4,5 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const registerKeyset_1 = require("../../../utils/registerKeyset");
|
|
5
5
|
const en_json_1 = tslib_1.__importDefault(require("./en.json"));
|
|
6
6
|
const ru_json_1 = tslib_1.__importDefault(require("./ru.json"));
|
|
7
|
-
const COMPONENT = '
|
|
7
|
+
const COMPONENT = 'FullscreenImage';
|
|
8
8
|
exports.default = (0, registerKeyset_1.registerKeyset)({ en: en_json_1.default, ru: ru_json_1.default }, COMPONENT);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MediaAllProps } from '../Media/Media';
|
|
3
|
+
export type ChildMediaRenderProps = Pick<MediaAllProps, 'fullscreen' | 'imageClassName' | 'videoClassName' | 'youtubeClassName' | 'className'>;
|
|
4
|
+
export interface FullscreenMediaProps {
|
|
5
|
+
showFullscreenIcon?: boolean;
|
|
6
|
+
children: (props?: ChildMediaRenderProps) => JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
declare const FullscreenMedia: ({ children, showFullscreenIcon }: FullscreenMediaProps) => JSX.Element;
|
|
9
|
+
export default FullscreenMedia;
|
|
@@ -10,7 +10,7 @@ const b = (0, utils_1.block)('full-screen-media');
|
|
|
10
10
|
const FULL_SCREEN_ICON_SIZE = 18;
|
|
11
11
|
const CLOSE_ICON_SIZE = 30;
|
|
12
12
|
const getMediaClass = (type) => b('modal-media', { type });
|
|
13
|
-
const
|
|
13
|
+
const FullscreenMedia = ({ children, showFullscreenIcon = true }) => {
|
|
14
14
|
const [isOpened, setIsOpened] = (0, react_1.useState)(false);
|
|
15
15
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
16
16
|
const openModal = (e) => {
|
|
@@ -24,8 +24,8 @@ const FullScreenMedia = ({ children, showFullScreenIcon = true }) => {
|
|
|
24
24
|
return (react_1.default.createElement("div", { className: b() },
|
|
25
25
|
react_1.default.createElement("div", { className: b('media-wrapper'), onClickCapture: openModal },
|
|
26
26
|
children({ className: b('inline-media') }),
|
|
27
|
-
|
|
28
|
-
react_1.default.createElement(uikit_1.Icon, { data: icons_1.
|
|
27
|
+
showFullscreenIcon && (react_1.default.createElement("div", { className: b('icon-wrapper'), onClickCapture: openModal },
|
|
28
|
+
react_1.default.createElement(uikit_1.Icon, { data: icons_1.Fullscreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') })))),
|
|
29
29
|
isOpened && (react_1.default.createElement(uikit_1.Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
|
|
30
30
|
react_1.default.createElement("div", { className: b('modal-content') },
|
|
31
31
|
react_1.default.createElement("div", { className: b('icon-wrapper', { visible: true }), onClick: closeModal },
|
|
@@ -34,7 +34,7 @@ const FullScreenMedia = ({ children, showFullScreenIcon = true }) => {
|
|
|
34
34
|
imageClassName: getMediaClass('image'),
|
|
35
35
|
videoClassName: getMediaClass('video'),
|
|
36
36
|
youtubeClassName: getMediaClass('youtube'),
|
|
37
|
-
|
|
37
|
+
fullscreen: true,
|
|
38
38
|
}))))));
|
|
39
39
|
};
|
|
40
|
-
exports.default =
|
|
40
|
+
exports.default = FullscreenMedia;
|
|
@@ -5,6 +5,7 @@ export interface ImageProps extends Partial<ImageObjectProps>, Partial<ImageDevi
|
|
|
5
5
|
className?: string;
|
|
6
6
|
onClick?: MouseEventHandler;
|
|
7
7
|
containerClassName?: string;
|
|
8
|
+
qa?: string;
|
|
8
9
|
}
|
|
9
10
|
declare const Image: (props: ImageProps) => JSX.Element | null;
|
|
10
11
|
export default Image;
|
|
@@ -12,7 +12,7 @@ const checkWebP = (src) => {
|
|
|
12
12
|
};
|
|
13
13
|
const Image = (props) => {
|
|
14
14
|
const projectSettings = (0, react_1.useContext)(projectSettingsContext_1.ProjectSettingsContext);
|
|
15
|
-
const { src: imageSrc, alt = (0, i18n_1.default)('img-alt'), disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, } = props;
|
|
15
|
+
const { src: imageSrc, alt = (0, i18n_1.default)('img-alt'), disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, qa, } = props;
|
|
16
16
|
const [imgLoadingError, setImgLoadingError] = (0, react_1.useState)(false);
|
|
17
17
|
const src = imageSrc || desktop;
|
|
18
18
|
if (!src) {
|
|
@@ -22,7 +22,7 @@ const Image = (props) => {
|
|
|
22
22
|
disableCompress ||
|
|
23
23
|
!(0, imageCompress_1.isCompressible)(src) ||
|
|
24
24
|
imgLoadingError;
|
|
25
|
-
return (react_1.default.createElement("picture", { className: containerClassName },
|
|
25
|
+
return (react_1.default.createElement("picture", { className: containerClassName, "data-qa": qa },
|
|
26
26
|
mobile && (react_1.default.createElement(react_1.Fragment, null,
|
|
27
27
|
!disableWebp && (react_1.default.createElement("source", { srcSet: checkWebP(mobile), type: "image/webp", media: `(max-width: ${constants_1.BREAKPOINTS.sm}px)` })),
|
|
28
28
|
react_1.default.createElement("source", { srcSet: mobile, media: `(max-width: ${constants_1.BREAKPOINTS.sm}px)` }))),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const FullscreenMedia_1 = tslib_1.__importDefault(require("../../FullscreenMedia/FullscreenMedia"));
|
|
6
|
+
const Video_1 = tslib_1.__importDefault(require("../Video/Video"));
|
|
7
|
+
const FullscreenVideo = (props) => {
|
|
8
|
+
return (react_1.default.createElement(FullscreenMedia_1.default, null, (classNames) => react_1.default.createElement(Video_1.default, Object.assign({}, props, classNames))));
|
|
9
|
+
};
|
|
10
|
+
exports.default = FullscreenVideo;
|
|
@@ -13,7 +13,7 @@ const Image_1 = tslib_1.__importDefault(require("../../Image/Image"));
|
|
|
13
13
|
const utils_2 = require("./utils");
|
|
14
14
|
const b = (0, utils_1.block)('media-component-image');
|
|
15
15
|
const Image = (props) => {
|
|
16
|
-
const { parallax, image, height, imageClassName, isBackground, hasVideoFallback, video } = props;
|
|
16
|
+
const { parallax, image, height, imageClassName, isBackground, hasVideoFallback, video, fullscreen, } = props;
|
|
17
17
|
const [scrollY, setScrollY] = (0, react_1.useState)(0);
|
|
18
18
|
const [{ springScrollY }, springSetScrollY] = (0, react_spring_1.useSpring)(() => ({
|
|
19
19
|
springScrollY: 0,
|
|
@@ -34,10 +34,10 @@ const Image = (props) => {
|
|
|
34
34
|
parallaxInterpolate = springScrollY.interpolate((value) => `translateY(-${Number(value) / parallaxLevel}px)`);
|
|
35
35
|
}
|
|
36
36
|
const imageClass = b('item', { withVideo: Boolean(video) && !hasVideoFallback }, imageClassName);
|
|
37
|
-
const
|
|
37
|
+
const renderFullscreenImage = (item) => {
|
|
38
38
|
const itemData = (0, utils_2.getMediaImage)(item);
|
|
39
39
|
return (react_1.default.createElement(FullscreenImage_1.default, Object.assign({ key: itemData.alt }, itemData, { imageClassName: imageClass, imageStyle: { height } })));
|
|
40
|
-
}
|
|
40
|
+
};
|
|
41
41
|
const imageBackground = (oneImage) => {
|
|
42
42
|
const imageData = (0, utils_2.getMediaImage)(oneImage);
|
|
43
43
|
return (react_1.default.createElement(react_spring_1.animated.div, { style: { transform: parallaxInterpolate } },
|
|
@@ -47,9 +47,16 @@ const Image = (props) => {
|
|
|
47
47
|
const imageData = (0, utils_2.getMediaImage)(oneImage);
|
|
48
48
|
return react_1.default.createElement(Image_1.default, Object.assign({}, imageData, { className: imageClass, style: { height } }));
|
|
49
49
|
};
|
|
50
|
+
const imageSlider = (imageArray) => {
|
|
51
|
+
const fullscreenItem = fullscreen === undefined || fullscreen;
|
|
52
|
+
return (react_1.default.createElement(Slider_1.default, { slidesToShow: 1, type: models_1.SliderType.MediaCard }, imageArray.map((item) => fullscreenItem ? renderFullscreenImage(item) : imageOnly(item))));
|
|
53
|
+
};
|
|
50
54
|
if (Array.isArray(image)) {
|
|
51
55
|
return imageSlider(image);
|
|
52
56
|
}
|
|
57
|
+
if (fullscreen) {
|
|
58
|
+
return renderFullscreenImage(image);
|
|
59
|
+
}
|
|
53
60
|
return isBackground ? imageBackground(image) : imageOnly(image);
|
|
54
61
|
};
|
|
55
62
|
exports.default = Image;
|
|
@@ -6,23 +6,43 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const VideoBlock_1 = tslib_1.__importDefault(require("../VideoBlock/VideoBlock"));
|
|
8
8
|
const DataLens_1 = tslib_1.__importDefault(require("./DataLens/DataLens"));
|
|
9
|
+
const FullscreenVideo_1 = tslib_1.__importDefault(require("./FullscreenVideo/FullscreenVideo"));
|
|
9
10
|
const Image_1 = tslib_1.__importDefault(require("./Image/Image"));
|
|
10
11
|
const Video_1 = tslib_1.__importDefault(require("./Video/Video"));
|
|
11
12
|
const b = (0, utils_1.block)('Media');
|
|
12
13
|
const Media = (props) => {
|
|
13
|
-
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika,
|
|
14
|
+
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, fullscreen, analyticsEvents, } = props;
|
|
14
15
|
const { className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, } = props;
|
|
15
16
|
const [hasVideoFallback, setHasVideoFallback] = (0, react_1.useState)(false);
|
|
16
17
|
const content = (0, react_1.useMemo)(() => {
|
|
17
18
|
let result = [];
|
|
18
19
|
if (image) {
|
|
19
|
-
result.push(react_1.default.createElement(Image_1.default, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback }));
|
|
20
|
+
result.push(react_1.default.createElement(Image_1.default, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback, fullscreen: fullscreen }));
|
|
20
21
|
}
|
|
21
22
|
if (video) {
|
|
22
|
-
|
|
23
|
+
const videoProps = {
|
|
24
|
+
key: 'video',
|
|
25
|
+
video,
|
|
26
|
+
videoClassName,
|
|
27
|
+
height,
|
|
28
|
+
metrika,
|
|
29
|
+
analyticsEvents,
|
|
30
|
+
playVideo,
|
|
31
|
+
previewImg,
|
|
32
|
+
playButton,
|
|
33
|
+
customBarControlsClassName,
|
|
34
|
+
hasVideoFallback,
|
|
35
|
+
setHasVideoFallback,
|
|
36
|
+
};
|
|
37
|
+
if (fullscreen) {
|
|
38
|
+
result.push(react_1.default.createElement(FullscreenVideo_1.default, Object.assign({}, videoProps)));
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
result.push(react_1.default.createElement(Video_1.default, Object.assign({}, videoProps)));
|
|
42
|
+
}
|
|
23
43
|
}
|
|
24
44
|
if (youtube) {
|
|
25
|
-
result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height,
|
|
45
|
+
result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullscreen: fullscreen }));
|
|
26
46
|
}
|
|
27
47
|
if (dataLens) {
|
|
28
48
|
result = react_1.default.createElement(DataLens_1.default, { dataLens: dataLens });
|
|
@@ -46,7 +66,7 @@ const Media = (props) => {
|
|
|
46
66
|
playButton,
|
|
47
67
|
customBarControlsClassName,
|
|
48
68
|
youtubeClassName,
|
|
49
|
-
|
|
69
|
+
fullscreen,
|
|
50
70
|
]);
|
|
51
71
|
return (react_1.default.createElement("div", { className: b(null, className), style: { backgroundColor: color } }, content));
|
|
52
72
|
};
|
|
@@ -10,6 +10,6 @@ interface InnerVideoProps {
|
|
|
10
10
|
setHasVideoFallback: React.Dispatch<boolean>;
|
|
11
11
|
hasVideoFallback: boolean;
|
|
12
12
|
}
|
|
13
|
-
type VideoAllProps = VideoAdditionProps & MediaComponentVideoProps & InnerVideoProps;
|
|
13
|
+
export type VideoAllProps = VideoAdditionProps & MediaComponentVideoProps & InnerVideoProps;
|
|
14
14
|
declare const Video: (props: VideoAllProps) => JSX.Element | null;
|
|
15
15
|
export default Video;
|