@gravity-ui/page-constructor 2.1.1 → 2.2.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build/cjs/blocks/index.d.ts +0 -2
  3. package/build/cjs/blocks/index.js +1 -5
  4. package/build/cjs/blocks/validators.d.ts +0 -2
  5. package/build/cjs/blocks/validators.js +0 -2
  6. package/build/cjs/components/HTML/HTML.d.ts +1 -1
  7. package/build/cjs/components/ReactPlayer/ReactPlayer.js +3 -1
  8. package/build/cjs/components/ReactPlayer/utils.d.ts +1 -0
  9. package/build/cjs/components/ReactPlayer/utils.js +24 -0
  10. package/build/cjs/constructor-items.d.ts +0 -6
  11. package/build/cjs/constructor-items.js +0 -6
  12. package/build/cjs/hooks/index.d.ts +0 -1
  13. package/build/cjs/hooks/index.js +1 -3
  14. package/build/cjs/models/constructor-items/blocks.d.ts +2 -23
  15. package/build/cjs/models/constructor-items/blocks.js +0 -2
  16. package/build/cjs/models/constructor-items/common.d.ts +0 -14
  17. package/build/cjs/models/constructor-items/common.js +1 -6
  18. package/build/cjs/models/constructor-items/sub-blocks.d.ts +9 -25
  19. package/build/cjs/models/constructor-items/sub-blocks.js +6 -7
  20. package/build/cjs/schema/index.js +2 -4
  21. package/build/cjs/schema/validators/blocks.d.ts +0 -2
  22. package/build/cjs/schema/validators/blocks.js +0 -2
  23. package/build/cjs/schema/validators/sub-blocks.d.ts +0 -1
  24. package/build/cjs/schema/validators/sub-blocks.js +0 -1
  25. package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +0 -1
  26. package/build/cjs/sub-blocks/index.d.ts +0 -1
  27. package/build/cjs/sub-blocks/index.js +1 -3
  28. package/build/cjs/text-transform/blocks.js +0 -32
  29. package/build/cjs/utils/index.d.ts +0 -1
  30. package/build/cjs/utils/index.js +0 -1
  31. package/build/esm/blocks/index.d.ts +0 -2
  32. package/build/esm/blocks/index.js +0 -2
  33. package/build/esm/blocks/validators.d.ts +0 -2
  34. package/build/esm/blocks/validators.js +0 -2
  35. package/build/esm/components/HTML/HTML.d.ts +1 -1
  36. package/build/esm/components/ReactPlayer/ReactPlayer.js +3 -1
  37. package/build/esm/components/ReactPlayer/utils.d.ts +1 -0
  38. package/build/esm/components/ReactPlayer/utils.js +20 -0
  39. package/build/esm/constructor-items.d.ts +0 -6
  40. package/build/esm/constructor-items.js +2 -8
  41. package/build/esm/hooks/index.d.ts +0 -1
  42. package/build/esm/hooks/index.js +0 -1
  43. package/build/esm/models/constructor-items/blocks.d.ts +2 -23
  44. package/build/esm/models/constructor-items/blocks.js +0 -2
  45. package/build/esm/models/constructor-items/common.d.ts +0 -14
  46. package/build/esm/models/constructor-items/common.js +0 -5
  47. package/build/esm/models/constructor-items/sub-blocks.d.ts +9 -25
  48. package/build/esm/models/constructor-items/sub-blocks.js +6 -7
  49. package/build/esm/schema/index.js +4 -6
  50. package/build/esm/schema/validators/blocks.d.ts +0 -2
  51. package/build/esm/schema/validators/blocks.js +0 -2
  52. package/build/esm/schema/validators/sub-blocks.d.ts +0 -1
  53. package/build/esm/schema/validators/sub-blocks.js +0 -1
  54. package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +0 -1
  55. package/build/esm/sub-blocks/index.d.ts +0 -1
  56. package/build/esm/sub-blocks/index.js +0 -1
  57. package/build/esm/text-transform/blocks.js +0 -32
  58. package/build/esm/utils/index.d.ts +0 -1
  59. package/build/esm/utils/index.js +0 -1
  60. package/package.json +5 -2
  61. package/server/models/constructor-items/blocks.d.ts +2 -23
  62. package/server/models/constructor-items/blocks.js +0 -2
  63. package/server/models/constructor-items/common.d.ts +0 -14
  64. package/server/models/constructor-items/common.js +1 -6
  65. package/server/models/constructor-items/sub-blocks.d.ts +9 -25
  66. package/server/models/constructor-items/sub-blocks.js +6 -7
  67. package/server/text-transform/blocks.js +0 -32
  68. package/server/utils/index.d.ts +0 -1
  69. package/server/utils/index.js +0 -1
  70. package/build/cjs/blocks/Preview/MediaContent/MediaContent.css +0 -50
  71. package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +0 -13
  72. package/build/cjs/blocks/Preview/MediaContent/MediaContent.js +0 -49
  73. package/build/cjs/blocks/Preview/MediaContent/PreviewContent.css +0 -106
  74. package/build/cjs/blocks/Preview/MediaContent/PreviewContent.d.ts +0 -11
  75. package/build/cjs/blocks/Preview/MediaContent/PreviewContent.js +0 -17
  76. package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.css +0 -54
  77. package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.d.ts +0 -9
  78. package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.js +0 -13
  79. package/build/cjs/blocks/Preview/Preview.css +0 -50
  80. package/build/cjs/blocks/Preview/Preview.d.ts +0 -3
  81. package/build/cjs/blocks/Preview/Preview.js +0 -130
  82. package/build/cjs/blocks/Preview/schema.d.ts +0 -40
  83. package/build/cjs/blocks/Preview/schema.js +0 -53
  84. package/build/cjs/blocks/Simple/Simple.css +0 -22
  85. package/build/cjs/blocks/Simple/Simple.d.ts +0 -3
  86. package/build/cjs/blocks/Simple/Simple.js +0 -22
  87. package/build/cjs/blocks/Simple/schema.d.ts +0 -68
  88. package/build/cjs/blocks/Simple/schema.js +0 -14
  89. package/build/cjs/context/breakpointContext/breakpointContext.d.ts +0 -2
  90. package/build/cjs/context/breakpointContext/breakpointContext.js +0 -7
  91. package/build/cjs/context/breakpointContext/index.d.ts +0 -1
  92. package/build/cjs/context/breakpointContext/index.js +0 -4
  93. package/build/cjs/hooks/useIntersection.d.ts +0 -1
  94. package/build/cjs/hooks/useIntersection.js +0 -21
  95. package/build/cjs/sub-blocks/CardWithImage/CardWithImage.css +0 -19
  96. package/build/cjs/sub-blocks/CardWithImage/CardWithImage.d.ts +0 -3
  97. package/build/cjs/sub-blocks/CardWithImage/CardWithImage.js +0 -16
  98. package/build/cjs/sub-blocks/CardWithImage/schema.d.ts +0 -154
  99. package/build/cjs/sub-blocks/CardWithImage/schema.js +0 -46
  100. package/build/cjs/utils/scroll.d.ts +0 -15
  101. package/build/cjs/utils/scroll.js +0 -34
  102. package/build/esm/blocks/Preview/MediaContent/MediaContent.css +0 -50
  103. package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +0 -14
  104. package/build/esm/blocks/Preview/MediaContent/MediaContent.js +0 -47
  105. package/build/esm/blocks/Preview/MediaContent/PreviewContent.css +0 -106
  106. package/build/esm/blocks/Preview/MediaContent/PreviewContent.d.ts +0 -12
  107. package/build/esm/blocks/Preview/MediaContent/PreviewContent.js +0 -15
  108. package/build/esm/blocks/Preview/MediaContent/PreviewMedia.css +0 -54
  109. package/build/esm/blocks/Preview/MediaContent/PreviewMedia.d.ts +0 -10
  110. package/build/esm/blocks/Preview/MediaContent/PreviewMedia.js +0 -11
  111. package/build/esm/blocks/Preview/Preview.css +0 -50
  112. package/build/esm/blocks/Preview/Preview.d.ts +0 -4
  113. package/build/esm/blocks/Preview/Preview.js +0 -126
  114. package/build/esm/blocks/Preview/schema.d.ts +0 -40
  115. package/build/esm/blocks/Preview/schema.js +0 -50
  116. package/build/esm/blocks/Simple/Simple.css +0 -22
  117. package/build/esm/blocks/Simple/Simple.d.ts +0 -4
  118. package/build/esm/blocks/Simple/Simple.js +0 -18
  119. package/build/esm/blocks/Simple/schema.d.ts +0 -68
  120. package/build/esm/blocks/Simple/schema.js +0 -11
  121. package/build/esm/context/breakpointContext/breakpointContext.d.ts +0 -2
  122. package/build/esm/context/breakpointContext/breakpointContext.js +0 -3
  123. package/build/esm/context/breakpointContext/index.d.ts +0 -1
  124. package/build/esm/context/breakpointContext/index.js +0 -1
  125. package/build/esm/hooks/useIntersection.d.ts +0 -1
  126. package/build/esm/hooks/useIntersection.js +0 -17
  127. package/build/esm/sub-blocks/CardWithImage/CardWithImage.css +0 -19
  128. package/build/esm/sub-blocks/CardWithImage/CardWithImage.d.ts +0 -4
  129. package/build/esm/sub-blocks/CardWithImage/CardWithImage.js +0 -14
  130. package/build/esm/sub-blocks/CardWithImage/schema.d.ts +0 -154
  131. package/build/esm/sub-blocks/CardWithImage/schema.js +0 -43
  132. package/build/esm/utils/scroll.d.ts +0 -15
  133. package/build/esm/utils/scroll.js +0 -30
  134. package/server/utils/scroll.d.ts +0 -15
  135. package/server/utils/scroll.js +0 -34
@@ -1,154 +0,0 @@
1
- export declare const CardWithImageItem: {
2
- additionalProperties: boolean;
3
- required: string[];
4
- properties: {
5
- image: {
6
- type: string;
7
- };
8
- description: {
9
- type: string;
10
- contentType: string;
11
- };
12
- disableCompress: {
13
- type: string;
14
- };
15
- border: {
16
- type: string;
17
- };
18
- fullScreen: {
19
- type: string;
20
- };
21
- links: {
22
- type: string;
23
- items: {
24
- type: string;
25
- properties: {
26
- when: {
27
- type: string;
28
- };
29
- };
30
- };
31
- };
32
- title: {
33
- oneOf: ({
34
- type: string;
35
- additionalProperties: boolean;
36
- required: string[];
37
- properties: {
38
- text: {
39
- type: string;
40
- contentType: string;
41
- };
42
- textSize: {
43
- type: string;
44
- enum: string[];
45
- };
46
- url: {
47
- type: string;
48
- };
49
- resetMargin: {
50
- type: string;
51
- };
52
- };
53
- } | {
54
- type: string;
55
- contentType: string;
56
- })[];
57
- };
58
- additionalInfo: {
59
- type: string;
60
- contentType: string;
61
- };
62
- buttons: {
63
- type: string;
64
- items: {
65
- type: string;
66
- properties: {
67
- when: {
68
- type: string;
69
- };
70
- };
71
- };
72
- };
73
- type: {};
74
- when: {};
75
- };
76
- };
77
- export declare const CardWithImage: {
78
- 'card-with-image': {
79
- additionalProperties: boolean;
80
- required: string[];
81
- properties: {
82
- image: {
83
- type: string;
84
- };
85
- description: {
86
- type: string;
87
- contentType: string;
88
- };
89
- disableCompress: {
90
- type: string;
91
- };
92
- border: {
93
- type: string;
94
- };
95
- fullScreen: {
96
- type: string;
97
- };
98
- links: {
99
- type: string;
100
- items: {
101
- type: string;
102
- properties: {
103
- when: {
104
- type: string;
105
- };
106
- };
107
- };
108
- };
109
- title: {
110
- oneOf: ({
111
- type: string;
112
- additionalProperties: boolean;
113
- required: string[];
114
- properties: {
115
- text: {
116
- type: string;
117
- contentType: string;
118
- };
119
- textSize: {
120
- type: string;
121
- enum: string[];
122
- };
123
- url: {
124
- type: string;
125
- };
126
- resetMargin: {
127
- type: string;
128
- };
129
- };
130
- } | {
131
- type: string;
132
- contentType: string;
133
- })[];
134
- };
135
- additionalInfo: {
136
- type: string;
137
- contentType: string;
138
- };
139
- buttons: {
140
- type: string;
141
- items: {
142
- type: string;
143
- properties: {
144
- when: {
145
- type: string;
146
- };
147
- };
148
- };
149
- };
150
- type: {};
151
- when: {};
152
- };
153
- };
154
- };
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CardWithImage = exports.CardWithImageItem = void 0;
4
- const lodash_1 = require("lodash");
5
- const common_1 = require("../../schema/validators/common");
6
- const utils_1 = require("../../schema/validators/utils");
7
- const schema_1 = require("../../sub-blocks/Content/schema");
8
- const CardWithImageContentProps = (0, lodash_1.omit)(schema_1.ContentBase, ['links', 'size', 'text', 'theme']);
9
- const CardWithImageLinks = {
10
- type: 'object',
11
- additionalProperties: false,
12
- required: ['title', 'link'],
13
- properties: Object.assign(Object.assign({}, common_1.BaseProps), { title: {
14
- type: 'string',
15
- contentType: 'text',
16
- }, link: {
17
- type: 'string',
18
- }, arrow: {
19
- type: 'boolean',
20
- }, theme: {
21
- type: 'string',
22
- enum: ['back', 'file-link', 'normal'],
23
- }, textSize: {
24
- type: 'string',
25
- enum: common_1.textSize,
26
- } }),
27
- };
28
- exports.CardWithImageItem = {
29
- additionalProperties: false,
30
- required: ['image'],
31
- properties: Object.assign(Object.assign(Object.assign({}, common_1.BaseProps), CardWithImageContentProps), { image: {
32
- type: 'string',
33
- }, description: {
34
- type: 'string',
35
- contentType: 'yfm',
36
- }, disableCompress: {
37
- type: 'boolean',
38
- }, border: {
39
- type: 'boolean',
40
- }, fullScreen: {
41
- type: 'boolean',
42
- }, links: (0, utils_1.filteredArray)(CardWithImageLinks) }),
43
- };
44
- exports.CardWithImage = {
45
- 'card-with-image': exports.CardWithImageItem,
46
- };
@@ -1,15 +0,0 @@
1
- export declare enum ScrollDirection {
2
- HORIZONTAL = "scrollLeft",
3
- VERTICAL = "scrollTop"
4
- }
5
- export interface ScrollReverseParams {
6
- distance?: number;
7
- }
8
- export interface ScrollOptions {
9
- distance: number;
10
- timeSeconds: number;
11
- speed: number;
12
- direction?: ScrollDirection;
13
- reverseParams?: ScrollReverseParams;
14
- }
15
- export declare function doSmoothScroll(element: HTMLDivElement, startPosition: number, scrollOptions: ScrollOptions): void;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.doSmoothScroll = exports.ScrollDirection = void 0;
4
- var ScrollDirection;
5
- (function (ScrollDirection) {
6
- ScrollDirection["HORIZONTAL"] = "scrollLeft";
7
- ScrollDirection["VERTICAL"] = "scrollTop";
8
- })(ScrollDirection = exports.ScrollDirection || (exports.ScrollDirection = {}));
9
- function doSmoothScroll(element, startPosition, scrollOptions) {
10
- const { distance, timeSeconds, speed, direction = ScrollDirection.HORIZONTAL, reverseParams, } = scrollOptions;
11
- let scrollShift = 0;
12
- let currentTimeChanges = 0;
13
- const changeScrollFunction = getChangeScrollFunction(direction, Boolean(reverseParams));
14
- const scrollDistance = (reverseParams === null || reverseParams === void 0 ? void 0 : reverseParams.distance) || distance;
15
- const timeChanges = getTimeChanges(scrollDistance, timeSeconds, speed);
16
- while (scrollShift < scrollDistance) {
17
- window.setTimeout(changeScrollFunction, currentTimeChanges, element, scrollShift, startPosition);
18
- currentTimeChanges += timeChanges;
19
- scrollShift++;
20
- }
21
- }
22
- exports.doSmoothScroll = doSmoothScroll;
23
- function getChangeScrollFunction(direction, isReverse) {
24
- return (element, scrollPosition, startPosition) => {
25
- element[direction] = isReverse
26
- ? startPosition - scrollPosition
27
- : startPosition + scrollPosition;
28
- };
29
- }
30
- function getTimeChanges(distance, timeSeconds, acceleration) {
31
- const physicalSpeed = distance / timeSeconds;
32
- const programSpeedMilliseconds = (1 / physicalSpeed) * 1000;
33
- return programSpeedMilliseconds / acceleration;
34
- }
@@ -1,50 +0,0 @@
1
- /* use this for style redefinitions to awoid problems with
2
- unpredictable css rules order in build */
3
- .pc-preview-media-content-block__header {
4
- margin-bottom: 24px;
5
- }
6
- .pc-preview-media-content-block__menu {
7
- padding: 0;
8
- }
9
- .pc-preview-media-content-block__title {
10
- font-size: var(--yc-text-display-1-font-size);
11
- line-height: var(--yc-text-display-1-line-height);
12
- font-weight: 500;
13
- position: relative;
14
- }
15
- .pc-preview-media-content-block__description {
16
- font-size: var(--yc-text-body-2-font-size);
17
- line-height: var(--yc-text-body-2-line-height);
18
- margin-top: 12px;
19
- position: relative;
20
- }
21
- .pc-preview-media-content-block__content, .pc-preview-media-content-block__media {
22
- padding: 0;
23
- }
24
- @media (max-width: 769px) {
25
- .pc-preview-media-content-block__menu.col {
26
- overflow-y: auto;
27
- margin-bottom: 16px;
28
- padding: 0;
29
- }
30
- .pc-preview-media-content-block__content-wrapper {
31
- width: fit-content;
32
- display: flex;
33
- }
34
- .pc-preview-media-content-block__content-wrapper div.preview-content-block__content-wrapper:first-child div.preview-content-block__content_active {
35
- margin-left: 0;
36
- }
37
- .pc-preview-media-content-block__content-wrapper div.preview-content-block__content-wrapper:last-child div.preview-content-block__content_active {
38
- margin-right: 0;
39
- }
40
- }
41
- @media (min-width: 577px) and (max-width: 769px) {
42
- .pc-preview-media-content-block__header, .pc-preview-media-content-block__content-wrapper {
43
- padding: 0 32px;
44
- }
45
- }
46
- @media (max-width: 577px) {
47
- .pc-preview-media-content-block__header, .pc-preview-media-content-block__content-wrapper {
48
- padding: 0 20px;
49
- }
50
- }
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { PreviewItemProps, PreviewRatioMediaContent, Refable } from '../../../models';
3
- import './MediaContent.css';
4
- interface MediaContentProps extends Refable<HTMLDivElement> {
5
- items: PreviewItemProps[];
6
- title: string;
7
- description?: string;
8
- ratioMediaContent?: PreviewRatioMediaContent;
9
- switching: boolean;
10
- isActiveBlock: (id: number, isMediaBlock?: boolean) => boolean;
11
- showMediaContent: (id: number) => void;
12
- }
13
- declare const MediaContent: React.ForwardRefExoticComponent<Pick<MediaContentProps, "title" | "items" | "description" | "ratioMediaContent" | "switching" | "isActiveBlock" | "showMediaContent"> & React.RefAttributes<HTMLDivElement>>;
14
- export default MediaContent;
@@ -1,47 +0,0 @@
1
- import React, { forwardRef, Fragment, useContext, useEffect, useState } from 'react';
2
- import { block, getThemedValue } from '../../../utils';
3
- import { Col, GridColumnSize } from '../../../grid';
4
- import { YFMWrapper, HTML } from '../../../components/';
5
- import PreviewContent from './PreviewContent';
6
- import PreviewMedia from './PreviewMedia';
7
- import { ThemeValueContext } from '../../../context/theme/ThemeValueContext';
8
- import './MediaContent.css';
9
- const b = block('preview-media-content-block');
10
- const MediaContent = forwardRef((props, ref) => {
11
- const { items, title, description = '', switching, ratioMediaContent = '1-1', isActiveBlock, showMediaContent, } = props;
12
- const { themeValue: theme } = useContext(ThemeValueContext);
13
- const [mediaSizes, setMediaSizes] = useState({ [GridColumnSize.All]: 12 });
14
- const [contentSizes, setContentSizes] = useState({ [GridColumnSize.All]: 12 });
15
- useEffect(() => {
16
- const [mediaSize, contentSize] = ratioMediaContent.split('-');
17
- const blockSize = 12 / (Number(mediaSize) + Number(contentSize));
18
- const updatedMediaSizes = Object.assign(Object.assign({}, mediaSizes), { [GridColumnSize.Md]: blockSize * Number(mediaSize) });
19
- setMediaSizes(updatedMediaSizes);
20
- const updatedContentSizes = Object.assign(Object.assign({}, contentSizes), { [GridColumnSize.Md]: blockSize * Number(contentSize) });
21
- setContentSizes(updatedContentSizes);
22
- // eslint-disable-next-line react-hooks/exhaustive-deps
23
- }, [ratioMediaContent]);
24
- const contentComponents = [];
25
- const mediaComponents = [];
26
- items.forEach((item, id) => {
27
- const { content, media } = item;
28
- const isActive = isActiveBlock(id);
29
- const contentMods = { active: isActive };
30
- const mediaMods = { active: isActiveBlock(id, true) };
31
- const onClick = () => showMediaContent(id);
32
- contentComponents.push(React.createElement(PreviewContent, Object.assign({ key: id, id: id }, content, { switching: switching, onClick: onClick, mods: contentMods })));
33
- mediaComponents.push(React.createElement(PreviewMedia, { key: id, id: id, media: media && getThemedValue(media, theme), play: isActive, mods: mediaMods }));
34
- });
35
- return (React.createElement(Fragment, null,
36
- React.createElement(Col, { sizes: contentSizes, className: b('content') },
37
- React.createElement("div", { className: b('header') },
38
- React.createElement("h2", { className: b('title') },
39
- React.createElement(HTML, null, title)),
40
- description && (React.createElement("div", { className: b('description') },
41
- React.createElement(YFMWrapper, { content: description, modifiers: { constructor: true } })))),
42
- React.createElement(Col, { ref: ref, className: b('menu') },
43
- React.createElement("div", { className: b('content-wrapper') }, contentComponents))),
44
- React.createElement(Col, { sizes: mediaSizes, className: b('media') }, mediaComponents)));
45
- });
46
- MediaContent.displayName = 'MediaContent';
47
- export default MediaContent;
@@ -1,106 +0,0 @@
1
- .pc-preview-content-block__title {
2
- margin: 0;
3
- }
4
-
5
- /* use this for style redefinitions to awoid problems with
6
- unpredictable css rules order in build */
7
- .pc-preview-content-block__content {
8
- height: 100%;
9
- display: block;
10
- cursor: pointer;
11
- border-radius: var(--pc-border-radius);
12
- overflow: hidden;
13
- position: relative;
14
- background: var(--yc-color-base-background);
15
- }
16
- .pc-preview-content-block__content > .pc-preview-content-block__description {
17
- overflow: hidden;
18
- }
19
- .pc-preview-content-block__loader-block {
20
- height: 100%;
21
- width: 0%;
22
- background: var(--yc-color-base-background);
23
- position: absolute;
24
- top: 0;
25
- left: 0;
26
- }
27
- .pc-preview-content-block__loader-block_auto {
28
- transition: background-color 1s ease, width 300ms linear;
29
- }
30
- .pc-preview-content-block__loader-block_active {
31
- background-color: var(--yc-color-promo-highlight-sky);
32
- width: 100%;
33
- }
34
- .pc-preview-content-block__loader-block_active.pc-preview-content-block__loader-block_auto {
35
- transition: background-color 1s ease, width 5s linear;
36
- }
37
- .pc-preview-content-block__title {
38
- font-size: var(--yc-text-header-1-font-size);
39
- line-height: var(--yc-text-header-1-line-height);
40
- color: var(--pc-text-header-color);
41
- font-weight: var(--yc-text-accent-font-weight);
42
- position: relative;
43
- }
44
- .pc-preview-content-block__description {
45
- font-size: var(--yc-text-body-2-font-size);
46
- line-height: var(--yc-text-body-2-line-height);
47
- position: relative;
48
- }
49
- @media (min-width: 769px) {
50
- .pc-preview-content-block__content {
51
- padding: 16px 24px;
52
- margin: 0;
53
- transition: background-color 0.5s ease-in, margin-top 300ms ease, margin-bottom 300ms ease;
54
- }
55
- .pc-preview-content-block__content > .pc-preview-content-block__description {
56
- height: 0px;
57
- transition: height 300ms ease, padding-top 300ms ease;
58
- }
59
- .pc-preview-content-block__content > .pc-preview-content-block__description > span {
60
- color: transparent;
61
- transition: color 300ms ease;
62
- }
63
- .pc-preview-content-block__content > .pc-preview-content-block__title:hover {
64
- color: var(--yc-color-text-link);
65
- }
66
- .pc-preview-content-block__content_active {
67
- padding: 24px;
68
- margin: 16px 0;
69
- background: var(--yc-color-promo-base-silver);
70
- transition: background-color 300ms ease-in, margin 300ms ease, padding 300ms ease;
71
- }
72
- .pc-preview-content-block__content_active > .pc-preview-content-block__description {
73
- padding-top: 12px;
74
- }
75
- .pc-preview-content-block__content_active > .pc-preview-content-block__description > span {
76
- color: var(--yc-color-text-primary);
77
- }
78
- .pc-preview-content-block__content_active > .pc-preview-content-block__title:hover {
79
- color: var(--yc-color-text-primary);
80
- }
81
- }
82
- @media (max-width: 769px) {
83
- .pc-preview-content-block__content {
84
- width: 275px;
85
- padding: 24px;
86
- padding-bottom: 32px;
87
- transition: background-color 0.5s ease-in;
88
- }
89
- .pc-preview-content-block__content_active {
90
- margin: 0 16px;
91
- background: var(--yc-color-promo-base-silver);
92
- transition: background-color 300ms ease-in;
93
- }
94
- .pc-preview-content-block__content > .pc-preview-content-block__description {
95
- padding-top: 12px;
96
- }
97
- .pc-preview-content-block__content > .pc-preview-content-block__description > span {
98
- color: var(--yc-color-text-primary);
99
- }
100
- .pc-preview-content-block__content > .pc-preview-content-block__description {
101
- display: block;
102
- }
103
- .pc-preview-content-block .preview-block__row_reverse__content {
104
- margin-left: 0;
105
- }
106
- }
@@ -1,12 +0,0 @@
1
- import { Modifiers } from '../../../models';
2
- import './PreviewContent.css';
3
- interface PreviewContentProps {
4
- id: number;
5
- title: string;
6
- description?: string;
7
- switching: boolean;
8
- onClick: () => void;
9
- mods: Modifiers | null;
10
- }
11
- declare const PreviewContent: (props: PreviewContentProps) => JSX.Element;
12
- export default PreviewContent;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { block } from '../../../utils';
3
- import YFMWrapper from '../../../components/YFMWrapper/YFMWrapper';
4
- import './PreviewContent.css';
5
- const b = block('preview-content-block');
6
- const PreviewContent = (props) => {
7
- const { id, title, description = '', switching, onClick, mods } = props;
8
- return (React.createElement("div", { key: id, className: b('content-wrapper') },
9
- React.createElement("div", { className: b('content', mods), onClick: onClick },
10
- React.createElement("div", { className: b('loader-block', Object.assign(Object.assign({}, mods), { auto: switching })) }),
11
- React.createElement("h2", { className: b('title') }, title),
12
- description && (React.createElement("div", { className: b('description') },
13
- React.createElement(YFMWrapper, { content: description, modifiers: { constructor: true } }))))));
14
- };
15
- export default PreviewContent;
@@ -1,54 +0,0 @@
1
- .pc-preview-media-block__title {
2
- margin: 0;
3
- }
4
-
5
- /* use this for style redefinitions to awoid problems with
6
- unpredictable css rules order in build */
7
- @media (min-width: 769px) {
8
- .pc-preview-media-block.pc-AnimateBlock .pc-preview-media-block __media, .pc-AnimateBlock .pc-preview-media-block .pc-preview-media-block __media {
9
- position: relative;
10
- top: 100px;
11
- opacity: 0;
12
- }
13
- .pc-preview-media-block.pc-AnimateBlock.animate .pc-preview-media-block __media, .pc-AnimateBlock .pc-preview-media-block.animate .pc-preview-media-block __media {
14
- top: 0;
15
- opacity: 1;
16
- transition: top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
17
- transition-delay: 0s;
18
- }
19
- }
20
- .pc-preview-media-block__title {
21
- font-size: var(--yc-text-display-2-font-size);
22
- line-height: var(--yc-text-display-2-line-height);
23
- color: var(--pc-text-header-color);
24
- font-weight: var(--yc-text-accent-font-weight);
25
- }
26
- @media (max-width: 576px) {
27
- .pc-preview-media-block__title {
28
- font-size: var(--yc-text-display-1-font-size);
29
- line-height: var(--yc-text-display-1-line-height);
30
- }
31
- }
32
- .pc-preview-media-block__media {
33
- box-shadow: 0 2px 8px var(--pc-color-sfx-shadow), 0 4px 24px var(--pc-color-sfx-shadow);
34
- overflow-x: hidden;
35
- border-radius: var(--pc-border-radius);
36
- overflow: hidden;
37
- display: none;
38
- }
39
- .pc-preview-media-block__media img {
40
- width: 100%;
41
- }
42
- .pc-preview-media-block__media img,
43
- .pc-preview-media-block__media video,
44
- .pc-preview-media-block__media iframe {
45
- border-radius: var(--pc-border-radius);
46
- }
47
- .pc-preview-media-block__media_active {
48
- display: block;
49
- }
50
- @media (max-width: 769px) {
51
- .pc-preview-media-block__media_active {
52
- width: 100%;
53
- }
54
- }
@@ -1,10 +0,0 @@
1
- import { MediaProps, Modifiers } from '../../../models';
2
- import './PreviewMedia.css';
3
- interface PreviewMediaProps {
4
- id: number;
5
- media: MediaProps;
6
- play: boolean;
7
- mods: Modifiers | null;
8
- }
9
- declare const PreviewMedia: (props: PreviewMediaProps) => JSX.Element;
10
- export default PreviewMedia;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { block } from '../../../utils';
3
- import Media from '../../../components/Media/Media';
4
- import './PreviewMedia.css';
5
- const b = block('preview-media-block');
6
- const PreviewMedia = (props) => {
7
- const { id, media, play, mods } = props;
8
- return (React.createElement("div", { key: id, className: b('media', mods) },
9
- React.createElement(Media, Object.assign({}, media, { playVideo: play }))));
10
- };
11
- export default PreviewMedia;
@@ -1,50 +0,0 @@
1
- /* use this for style redefinitions to awoid problems with
2
- unpredictable css rules order in build */
3
- .pc-preview-block__row > * {
4
- height: fit-content;
5
- margin: auto;
6
- }
7
- .pc-preview-block__row_reverse {
8
- flex-direction: row-reverse;
9
- }
10
- .pc-preview-block__row > .col.pc-preview-media-content-block__media {
11
- padding: 0 16px;
12
- }
13
- @media (min-width: 769px) {
14
- .pc-preview-block__row {
15
- display: flex;
16
- }
17
- .pc-preview-block__row > .col.pc-preview-media-content-block__content {
18
- padding: 0 48px 0 16px;
19
- }
20
- .pc-preview-block__row_reverse > .col.pc-preview-media-content-block__content {
21
- padding: 0 16px 0 48px;
22
- }
23
- }
24
- @media (min-width: 577px) and (max-width: 769px) {
25
- .pc-preview-block__row_reverse {
26
- flex-direction: row;
27
- }
28
- .pc-preview-block__row > .col.pc-preview-media-content-block__content {
29
- padding: 0;
30
- }
31
- .pc-preview-block__row > .col.pc-preview-media-content-block__media {
32
- padding: 0 32px;
33
- }
34
- .pc-preview-block .pc-preview-block__row_reverse.row, .pc-preview-block .pc-preview-block__row.row {
35
- margin-left: -32px;
36
- margin-right: -32px;
37
- }
38
- }
39
- @media (max-width: 577px) {
40
- .pc-preview-block__row > .col.pc-preview-media-content-block__content {
41
- padding: 0;
42
- }
43
- .pc-preview-block__row > .col.pc-preview-media-content-block__media {
44
- padding: 0 20px;
45
- }
46
- .pc-preview-block .pc-preview-block__row_reverse.row, .pc-preview-block .pc-preview-block__row.row {
47
- margin-left: -20px;
48
- margin-right: -20px;
49
- }
50
- }
@@ -1,4 +0,0 @@
1
- import { PreviewBlockProps } from '../../models';
2
- import './Preview.css';
3
- export declare const PreviewBlock: (props: PreviewBlockProps) => JSX.Element;
4
- export default PreviewBlock;