@gravity-ui/page-constructor 2.2.0 → 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 (131) hide show
  1. package/CHANGELOG.md +7 -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/utils.js +13 -12
  8. package/build/cjs/constructor-items.d.ts +0 -6
  9. package/build/cjs/constructor-items.js +0 -6
  10. package/build/cjs/hooks/index.d.ts +0 -1
  11. package/build/cjs/hooks/index.js +1 -3
  12. package/build/cjs/models/constructor-items/blocks.d.ts +2 -23
  13. package/build/cjs/models/constructor-items/blocks.js +0 -2
  14. package/build/cjs/models/constructor-items/common.d.ts +0 -14
  15. package/build/cjs/models/constructor-items/common.js +1 -6
  16. package/build/cjs/models/constructor-items/sub-blocks.d.ts +9 -25
  17. package/build/cjs/models/constructor-items/sub-blocks.js +6 -7
  18. package/build/cjs/schema/index.js +2 -4
  19. package/build/cjs/schema/validators/blocks.d.ts +0 -2
  20. package/build/cjs/schema/validators/blocks.js +0 -2
  21. package/build/cjs/schema/validators/sub-blocks.d.ts +0 -1
  22. package/build/cjs/schema/validators/sub-blocks.js +0 -1
  23. package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +0 -1
  24. package/build/cjs/sub-blocks/index.d.ts +0 -1
  25. package/build/cjs/sub-blocks/index.js +1 -3
  26. package/build/cjs/text-transform/blocks.js +0 -32
  27. package/build/cjs/utils/index.d.ts +0 -1
  28. package/build/cjs/utils/index.js +0 -1
  29. package/build/esm/blocks/index.d.ts +0 -2
  30. package/build/esm/blocks/index.js +0 -2
  31. package/build/esm/blocks/validators.d.ts +0 -2
  32. package/build/esm/blocks/validators.js +0 -2
  33. package/build/esm/components/HTML/HTML.d.ts +1 -1
  34. package/build/esm/components/ReactPlayer/utils.js +13 -12
  35. package/build/esm/constructor-items.d.ts +0 -6
  36. package/build/esm/constructor-items.js +2 -8
  37. package/build/esm/hooks/index.d.ts +0 -1
  38. package/build/esm/hooks/index.js +0 -1
  39. package/build/esm/models/constructor-items/blocks.d.ts +2 -23
  40. package/build/esm/models/constructor-items/blocks.js +0 -2
  41. package/build/esm/models/constructor-items/common.d.ts +0 -14
  42. package/build/esm/models/constructor-items/common.js +0 -5
  43. package/build/esm/models/constructor-items/sub-blocks.d.ts +9 -25
  44. package/build/esm/models/constructor-items/sub-blocks.js +6 -7
  45. package/build/esm/schema/index.js +4 -6
  46. package/build/esm/schema/validators/blocks.d.ts +0 -2
  47. package/build/esm/schema/validators/blocks.js +0 -2
  48. package/build/esm/schema/validators/sub-blocks.d.ts +0 -1
  49. package/build/esm/schema/validators/sub-blocks.js +0 -1
  50. package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +0 -1
  51. package/build/esm/sub-blocks/index.d.ts +0 -1
  52. package/build/esm/sub-blocks/index.js +0 -1
  53. package/build/esm/text-transform/blocks.js +0 -32
  54. package/build/esm/utils/index.d.ts +0 -1
  55. package/build/esm/utils/index.js +0 -1
  56. package/package.json +4 -1
  57. package/server/models/constructor-items/blocks.d.ts +2 -23
  58. package/server/models/constructor-items/blocks.js +0 -2
  59. package/server/models/constructor-items/common.d.ts +0 -14
  60. package/server/models/constructor-items/common.js +1 -6
  61. package/server/models/constructor-items/sub-blocks.d.ts +9 -25
  62. package/server/models/constructor-items/sub-blocks.js +6 -7
  63. package/server/text-transform/blocks.js +0 -32
  64. package/server/utils/index.d.ts +0 -1
  65. package/server/utils/index.js +0 -1
  66. package/build/cjs/blocks/Preview/MediaContent/MediaContent.css +0 -50
  67. package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +0 -13
  68. package/build/cjs/blocks/Preview/MediaContent/MediaContent.js +0 -49
  69. package/build/cjs/blocks/Preview/MediaContent/PreviewContent.css +0 -106
  70. package/build/cjs/blocks/Preview/MediaContent/PreviewContent.d.ts +0 -11
  71. package/build/cjs/blocks/Preview/MediaContent/PreviewContent.js +0 -17
  72. package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.css +0 -54
  73. package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.d.ts +0 -9
  74. package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.js +0 -13
  75. package/build/cjs/blocks/Preview/Preview.css +0 -50
  76. package/build/cjs/blocks/Preview/Preview.d.ts +0 -3
  77. package/build/cjs/blocks/Preview/Preview.js +0 -130
  78. package/build/cjs/blocks/Preview/schema.d.ts +0 -40
  79. package/build/cjs/blocks/Preview/schema.js +0 -53
  80. package/build/cjs/blocks/Simple/Simple.css +0 -22
  81. package/build/cjs/blocks/Simple/Simple.d.ts +0 -3
  82. package/build/cjs/blocks/Simple/Simple.js +0 -22
  83. package/build/cjs/blocks/Simple/schema.d.ts +0 -68
  84. package/build/cjs/blocks/Simple/schema.js +0 -14
  85. package/build/cjs/context/breakpointContext/breakpointContext.d.ts +0 -2
  86. package/build/cjs/context/breakpointContext/breakpointContext.js +0 -7
  87. package/build/cjs/context/breakpointContext/index.d.ts +0 -1
  88. package/build/cjs/context/breakpointContext/index.js +0 -4
  89. package/build/cjs/hooks/useIntersection.d.ts +0 -1
  90. package/build/cjs/hooks/useIntersection.js +0 -21
  91. package/build/cjs/sub-blocks/CardWithImage/CardWithImage.css +0 -19
  92. package/build/cjs/sub-blocks/CardWithImage/CardWithImage.d.ts +0 -3
  93. package/build/cjs/sub-blocks/CardWithImage/CardWithImage.js +0 -16
  94. package/build/cjs/sub-blocks/CardWithImage/schema.d.ts +0 -154
  95. package/build/cjs/sub-blocks/CardWithImage/schema.js +0 -46
  96. package/build/cjs/utils/scroll.d.ts +0 -15
  97. package/build/cjs/utils/scroll.js +0 -34
  98. package/build/esm/blocks/Preview/MediaContent/MediaContent.css +0 -50
  99. package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +0 -14
  100. package/build/esm/blocks/Preview/MediaContent/MediaContent.js +0 -47
  101. package/build/esm/blocks/Preview/MediaContent/PreviewContent.css +0 -106
  102. package/build/esm/blocks/Preview/MediaContent/PreviewContent.d.ts +0 -12
  103. package/build/esm/blocks/Preview/MediaContent/PreviewContent.js +0 -15
  104. package/build/esm/blocks/Preview/MediaContent/PreviewMedia.css +0 -54
  105. package/build/esm/blocks/Preview/MediaContent/PreviewMedia.d.ts +0 -10
  106. package/build/esm/blocks/Preview/MediaContent/PreviewMedia.js +0 -11
  107. package/build/esm/blocks/Preview/Preview.css +0 -50
  108. package/build/esm/blocks/Preview/Preview.d.ts +0 -4
  109. package/build/esm/blocks/Preview/Preview.js +0 -126
  110. package/build/esm/blocks/Preview/schema.d.ts +0 -40
  111. package/build/esm/blocks/Preview/schema.js +0 -50
  112. package/build/esm/blocks/Simple/Simple.css +0 -22
  113. package/build/esm/blocks/Simple/Simple.d.ts +0 -4
  114. package/build/esm/blocks/Simple/Simple.js +0 -18
  115. package/build/esm/blocks/Simple/schema.d.ts +0 -68
  116. package/build/esm/blocks/Simple/schema.js +0 -11
  117. package/build/esm/context/breakpointContext/breakpointContext.d.ts +0 -2
  118. package/build/esm/context/breakpointContext/breakpointContext.js +0 -3
  119. package/build/esm/context/breakpointContext/index.d.ts +0 -1
  120. package/build/esm/context/breakpointContext/index.js +0 -1
  121. package/build/esm/hooks/useIntersection.d.ts +0 -1
  122. package/build/esm/hooks/useIntersection.js +0 -17
  123. package/build/esm/sub-blocks/CardWithImage/CardWithImage.css +0 -19
  124. package/build/esm/sub-blocks/CardWithImage/CardWithImage.d.ts +0 -4
  125. package/build/esm/sub-blocks/CardWithImage/CardWithImage.js +0 -14
  126. package/build/esm/sub-blocks/CardWithImage/schema.d.ts +0 -154
  127. package/build/esm/sub-blocks/CardWithImage/schema.js +0 -43
  128. package/build/esm/utils/scroll.d.ts +0 -15
  129. package/build/esm/utils/scroll.js +0 -30
  130. package/server/utils/scroll.d.ts +0 -15
  131. package/server/utils/scroll.js +0 -34
@@ -1,13 +0,0 @@
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 utils_1 = require("../../../utils");
6
- const Media_1 = tslib_1.__importDefault(require("../../../components/Media/Media"));
7
- const b = (0, utils_1.block)('preview-media-block');
8
- const PreviewMedia = (props) => {
9
- const { id, media, play, mods } = props;
10
- return (react_1.default.createElement("div", { key: id, className: b('media', mods) },
11
- react_1.default.createElement(Media_1.default, Object.assign({}, media, { playVideo: play }))));
12
- };
13
- exports.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,3 +0,0 @@
1
- import { PreviewBlockProps } from '../../models';
2
- export declare const PreviewBlock: (props: PreviewBlockProps) => JSX.Element;
3
- export default PreviewBlock;
@@ -1,130 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PreviewBlock = void 0;
4
- const tslib_1 = require("tslib");
5
- const utils_1 = require("../../utils");
6
- const react_1 = tslib_1.__importStar(require("react"));
7
- const breakpointContext_1 = require("../../context/breakpointContext");
8
- const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
9
- const MediaContent_1 = tslib_1.__importDefault(require("./MediaContent/MediaContent"));
10
- const grid_1 = require("../../grid");
11
- const constants_1 = require("../../constants");
12
- const useIntersection_1 = require("../../hooks/useIntersection");
13
- const b = (0, utils_1.block)('preview-block');
14
- const SWITCHING_INTERVAL = 5 * 1000;
15
- const WIDTH_MENU_ITEM_MD_SIZE = 275;
16
- const INDENT_MENU_ITEM_MD_SIZE = 16;
17
- const SCROLL_ITEM_SECONDS = 1;
18
- const SCROLL_ITEM_SPEED = 2;
19
- const CLASSNAME_DESCRIPTION_YFM_BLOCK = 'yfm';
20
- const CLASSNAME_CONTENT_WRAPPER = 'preview-media-content-block__content-wrapper';
21
- const INDENT_BETWEEN_TITLE_DESCRIPTION = 16;
22
- const PreviewBlock = (props) => {
23
- const { direction = 'content-media', animated, items, title, description, ratioMediaContent = '1-1', stopVideo = false,
24
- // TODO YDB-server doesn't see previewRef.current and doesn't update the component CLOUDFRONT-9395
25
- showImmediately = false, } = props;
26
- const breakpoint = (0, react_1.useContext)(breakpointContext_1.BreakpointContext);
27
- const isDesktop = breakpoint >= constants_1.BREAKPOINTS.md;
28
- const menuRef = react_1.default.useRef(null);
29
- const previewRef = react_1.default.useRef(null);
30
- const inViewport = (0, useIntersection_1.useIntersection)(previewRef.current);
31
- const [stopSwitching, setStopSwitching] = (0, react_1.useState)(stopVideo);
32
- const [activeSlide, setActiveSlide] = (0, react_1.useState)(-1);
33
- const [autoSwitchTimerId, setAutoSwitchTimerId] = (0, react_1.useState)(0);
34
- const isActiveBlock = (0, react_1.useCallback)((id, isMediaBlock = false) => {
35
- return isMediaBlock || inViewport ? activeSlide === id : false;
36
- }, [inViewport, activeSlide]);
37
- const changeActiveSlide = (0, react_1.useCallback)((params) => {
38
- const { current, nextSlide, currentSlide, timerId } = params;
39
- if (isDesktop) {
40
- changeDescriptionHeight(current, nextSlide, currentSlide);
41
- }
42
- else {
43
- changeMenuScroll(current, nextSlide, currentSlide);
44
- }
45
- setActiveSlide(nextSlide);
46
- clearTimeout(timerId);
47
- }, [isDesktop]);
48
- (0, react_1.useEffect)(() => {
49
- // TODO YDB-server doesn't see previewRef.current and doesn't update the component CLOUDFRONT-9395
50
- if (!items[activeSlide] && (showImmediately || inViewport)) {
51
- setActiveSlide(0);
52
- if (isDesktop) {
53
- changeDescriptionHeight(menuRef.current, 0);
54
- }
55
- }
56
- }, [inViewport, activeSlide, isDesktop, items, showImmediately]);
57
- (0, react_1.useEffect)(() => {
58
- if (stopSwitching || !inViewport) {
59
- return () => { };
60
- }
61
- const timerId = setTimeout(() => {
62
- if (stopSwitching) {
63
- clearTimeout(timerId);
64
- return;
65
- }
66
- const nextSlide = activeSlide + 1 >= items.length ? 0 : activeSlide + 1;
67
- changeActiveSlide({
68
- current: menuRef.current,
69
- nextSlide,
70
- currentSlide: activeSlide,
71
- timerId: timerId,
72
- });
73
- }, SWITCHING_INTERVAL);
74
- setAutoSwitchTimerId(timerId);
75
- return () => clearTimeout(timerId);
76
- }, [changeActiveSlide, activeSlide, items.length, stopSwitching, inViewport]);
77
- const showMediaContent = (0, react_1.useCallback)((nextSlide) => {
78
- changeActiveSlide({
79
- current: menuRef.current,
80
- nextSlide,
81
- currentSlide: activeSlide,
82
- timerId: autoSwitchTimerId,
83
- });
84
- setStopSwitching(true);
85
- }, [changeActiveSlide, activeSlide, autoSwitchTimerId]);
86
- return (react_1.default.createElement(AnimateBlock_1.default, { className: b(), animate: animated },
87
- react_1.default.createElement(grid_1.Row, { ref: previewRef, className: b('row', { reverse: direction === 'media-content' }) },
88
- react_1.default.createElement(MediaContent_1.default, { ref: menuRef, items: items, title: title, description: description, ratioMediaContent: ratioMediaContent, switching: !stopSwitching, isActiveBlock: isActiveBlock, showMediaContent: showMediaContent }))));
89
- };
90
- exports.PreviewBlock = PreviewBlock;
91
- function changeMenuScroll(element, nextSlide, activeSlide) {
92
- if (!element) {
93
- return;
94
- }
95
- const scrollPosition = element.scrollLeft;
96
- const endPosition = nextSlide === 0 ? 0 : nextSlide * WIDTH_MENU_ITEM_MD_SIZE + INDENT_MENU_ITEM_MD_SIZE;
97
- const distance = Math.abs(scrollPosition - endPosition);
98
- const isReverse = nextSlide === 0 || nextSlide < activeSlide;
99
- const scrollOptions = {
100
- distance,
101
- timeSeconds: SCROLL_ITEM_SECONDS,
102
- speed: SCROLL_ITEM_SPEED,
103
- reverseParams: isReverse ? { distance } : undefined,
104
- };
105
- (0, utils_1.doSmoothScroll)(element, scrollPosition, scrollOptions);
106
- }
107
- function changeDescriptionHeight(element, nextActiveSlide, prevActiveSlide = 0) {
108
- const contentWrapper = element === null || element === void 0 ? void 0 : element.getElementsByClassName(CLASSNAME_CONTENT_WRAPPER);
109
- if (!contentWrapper || contentWrapper.length === 0) {
110
- return;
111
- }
112
- const menuItems = contentWrapper[0].children;
113
- updateHeight(menuItems, nextActiveSlide);
114
- if (nextActiveSlide !== prevActiveSlide) {
115
- updateHeight(menuItems, prevActiveSlide, false);
116
- }
117
- }
118
- function updateHeight(menuItems, slide, isExpand = true) {
119
- const item = menuItems[slide];
120
- const yfmBlock = item.getElementsByClassName(CLASSNAME_DESCRIPTION_YFM_BLOCK)[0];
121
- if (yfmBlock) {
122
- const yfmBlockElement = yfmBlock;
123
- const yfmBlockHeight = yfmBlockElement.offsetHeight;
124
- const yfmBlockOffsetParent = yfmBlockElement.offsetParent;
125
- yfmBlockOffsetParent.style.height = isExpand
126
- ? `${yfmBlockHeight + INDENT_BETWEEN_TITLE_DESCRIPTION}px`
127
- : '0px';
128
- }
129
- }
130
- exports.default = exports.PreviewBlock;
@@ -1,40 +0,0 @@
1
- export declare const PreviewBlock: {
2
- 'preview-block': {
3
- additionalProperties: boolean;
4
- required: string[];
5
- properties: {
6
- title: {
7
- type: string;
8
- contentType: string;
9
- };
10
- description: {
11
- type: string;
12
- contentType: string;
13
- };
14
- direction: {
15
- type: string;
16
- enum: string[];
17
- };
18
- ratioMediaContent: {
19
- type: string;
20
- enum: string[];
21
- };
22
- items: {
23
- type: string;
24
- items: {
25
- type: string;
26
- properties: {
27
- when: {
28
- type: string;
29
- };
30
- };
31
- };
32
- };
33
- animated: {
34
- type: string;
35
- };
36
- type: {};
37
- when: {};
38
- };
39
- };
40
- };
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PreviewBlock = void 0;
4
- const utils_1 = require("../../schema/validators/utils");
5
- const common_1 = require("../../schema/validators/common");
6
- const schema_1 = require("../Media/schema");
7
- const previewRatioMediaContent = ['2-1', '1-1'];
8
- const PreviewContentItem = {
9
- additionalProperties: false,
10
- required: ['title', 'description'],
11
- properties: {
12
- title: {
13
- type: 'string',
14
- contentType: 'text',
15
- },
16
- description: {
17
- type: 'string',
18
- contentType: 'yfm',
19
- },
20
- },
21
- };
22
- const PreviewItem = {
23
- type: 'object',
24
- additionalProperties: false,
25
- required: ['type', 'media', 'content'],
26
- properties: {
27
- type: {
28
- type: 'string',
29
- enum: ['video', 'image'],
30
- },
31
- media: (0, common_1.withTheme)(schema_1.Media),
32
- content: PreviewContentItem,
33
- },
34
- };
35
- exports.PreviewBlock = {
36
- 'preview-block': {
37
- additionalProperties: false,
38
- required: ['title', 'items'],
39
- properties: Object.assign(Object.assign(Object.assign({}, common_1.BaseProps), common_1.AnimatableProps), { title: {
40
- type: 'string',
41
- contentType: 'text',
42
- }, description: {
43
- type: 'string',
44
- contentType: 'yfm',
45
- }, direction: {
46
- type: 'string',
47
- enum: common_1.mediaDirection,
48
- }, ratioMediaContent: {
49
- type: 'string',
50
- enum: previewRatioMediaContent,
51
- }, items: (0, utils_1.filteredArray)(PreviewItem) }),
52
- },
53
- };
@@ -1,22 +0,0 @@
1
- /* use this for style redefinitions to awoid problems with
2
- unpredictable css rules order in build */
3
- @media (min-width: 769px) {
4
- .pc-simple-block.pc-AnimateBlock .pc-simple-block__animate-block, .pc-AnimateBlock .pc-simple-block .pc-simple-block__animate-block {
5
- position: relative;
6
- top: 100px;
7
- opacity: 0;
8
- }
9
- .pc-simple-block.pc-AnimateBlock.animate .pc-simple-block__animate-block, .pc-AnimateBlock .pc-simple-block.animate .pc-simple-block__animate-block {
10
- top: 0;
11
- opacity: 1;
12
- 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);
13
- transition-delay: 0.5s;
14
- }
15
- }
16
- .pc-simple-block__animate-block {
17
- margin-top: 20px;
18
- }
19
- .pc-simple-block__description {
20
- margin-top: 16px;
21
- font-size: var(--yc-text-body-2-font-size);
22
- }
@@ -1,3 +0,0 @@
1
- import { SimpleBlockProps, WithChildren } from '../../models';
2
- export declare const SimpleBlock: (props: WithChildren<SimpleBlockProps>) => JSX.Element;
3
- export default SimpleBlock;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SimpleBlock = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importDefault(require("react"));
6
- const utils_1 = require("../../utils");
7
- const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
8
- const BlockHeader_1 = tslib_1.__importDefault(require("../../components/BlockHeader/BlockHeader"));
9
- const YFMWrapper_1 = tslib_1.__importDefault(require("../../components/YFMWrapper/YFMWrapper"));
10
- const b = (0, utils_1.block)('simple-block');
11
- const SimpleBlock = (props) => {
12
- const { title, description, animated = true, children } = props;
13
- const blockHeader = title && react_1.default.createElement(BlockHeader_1.default, { title: title });
14
- return (react_1.default.createElement(AnimateBlock_1.default, { className: b(), animate: animated },
15
- react_1.default.createElement("div", null,
16
- blockHeader,
17
- react_1.default.createElement("div", { className: b('description') },
18
- react_1.default.createElement(YFMWrapper_1.default, { content: description, modifiers: { constructor: true } })),
19
- react_1.default.createElement("div", { className: b('animate-block') }, children))));
20
- };
21
- exports.SimpleBlock = SimpleBlock;
22
- exports.default = exports.SimpleBlock;
@@ -1,68 +0,0 @@
1
- export declare const SimpleBlock: {
2
- 'simple-block': {
3
- additionalProperties: boolean;
4
- required: string[];
5
- properties: {
6
- children: {
7
- type: string;
8
- items: {
9
- $ref: string;
10
- };
11
- };
12
- animated: {
13
- type: string;
14
- };
15
- anchor: {
16
- type: string;
17
- additionalProperties: boolean;
18
- required: string[];
19
- properties: {
20
- text: {
21
- type: string;
22
- contentType: string;
23
- };
24
- url: {
25
- type: string;
26
- };
27
- };
28
- };
29
- visible: {
30
- type: string;
31
- enum: string[];
32
- };
33
- resetPaddings: {
34
- type: string;
35
- };
36
- context: {
37
- type: string;
38
- };
39
- type: {};
40
- when: {};
41
- title: {
42
- type: string;
43
- additionalProperties: boolean;
44
- required: string[];
45
- properties: {
46
- text: {
47
- type: string;
48
- contentType: string;
49
- };
50
- textSize: {
51
- type: string;
52
- enum: string[];
53
- };
54
- url: {
55
- type: string;
56
- };
57
- resetMargin: {
58
- type: string;
59
- };
60
- };
61
- };
62
- description: {
63
- type: string;
64
- contentType: string;
65
- };
66
- };
67
- };
68
- };
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SimpleBlock = void 0;
4
- const common_1 = require("../../schema/validators/common");
5
- exports.SimpleBlock = {
6
- 'simple-block': {
7
- additionalProperties: false,
8
- required: ['title', 'description'],
9
- properties: Object.assign(Object.assign(Object.assign({ title: common_1.TitleProps, description: {
10
- type: 'string',
11
- contentType: 'yfm',
12
- } }, common_1.BlockBaseProps), common_1.AnimatableProps), { children: common_1.ChildrenProps }),
13
- },
14
- };
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const BreakpointContext: React.Context<number>;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BreakpointContext = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importDefault(require("react"));
6
- const constants_1 = require("../../constants");
7
- exports.BreakpointContext = react_1.default.createContext(constants_1.BREAKPOINTS.sm);
@@ -1 +0,0 @@
1
- export * from './breakpointContext';
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./breakpointContext"), exports);
@@ -1 +0,0 @@
1
- export declare const useIntersection: (element?: Element, startMargin?: string, threshold?: number) => boolean;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useIntersection = void 0;
4
- const react_1 = require("react");
5
- const useIntersection = (element, startMargin = '0px', threshold = 0.2) => {
6
- const [isVisible, setState] = (0, react_1.useState)(false);
7
- (0, react_1.useEffect)(() => {
8
- const observer = new IntersectionObserver(([entry]) => {
9
- setState(entry.isIntersecting);
10
- }, {
11
- rootMargin: startMargin,
12
- threshold,
13
- });
14
- if (element) {
15
- observer.observe(element);
16
- }
17
- return () => element && observer.unobserve(element);
18
- }, [element, startMargin, threshold]);
19
- return isVisible;
20
- };
21
- exports.useIntersection = useIntersection;
@@ -1,19 +0,0 @@
1
- /* use this for style redefinitions to awoid problems with
2
- unpredictable css rules order in build */
3
- .pc-card-with-image__content {
4
- padding-right: 16px;
5
- }
6
- .pc-card-with-image__image {
7
- width: 100%;
8
- display: block;
9
- margin-bottom: 16px;
10
- border-radius: var(--pc-border-radius);
11
- }
12
- .pc-card-with-image__image_border {
13
- border: 1px solid var(--yc-color-line-generic);
14
- }
15
- .pc-card-with-image__image-item {
16
- width: 100%;
17
- display: block;
18
- border-radius: var(--pc-border-radius);
19
- }
@@ -1,3 +0,0 @@
1
- import { CardWithImageProps } from '../../models';
2
- declare const CardWithImage: ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }: CardWithImageProps) => JSX.Element;
3
- export default CardWithImage;
@@ -1,16 +0,0 @@
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 utils_1 = require("../../utils");
6
- const components_1 = require("../../components");
7
- const __1 = require("../");
8
- const b = (0, utils_1.block)('card-with-image');
9
- const CardWithImage = ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }) => {
10
- const unifiedLinks = links === null || links === void 0 ? void 0 : links.map((link) => (Object.assign(Object.assign({ theme: 'normal' }, link), { text: link.title, url: link.link })));
11
- return (react_1.default.createElement("div", { className: b(null, className) },
12
- react_1.default.createElement("div", { className: b('image', { border }) }, fullScreen ? (react_1.default.createElement(components_1.FullscreenImage, { src: image, imageClassName: b('image-item'), disableCompress: disableCompress })) : (react_1.default.createElement(components_1.Image, { className: b('image-item'), src: image, alt: 'card-image', disableCompress: disableCompress }))),
13
- react_1.default.createElement("div", { className: b('content') },
14
- react_1.default.createElement(__1.Content, { title: title, text: description, links: unifiedLinks, additionalInfo: additionalInfo, buttons: buttons, size: "s", colSizes: { all: 12, md: 12 } }))));
15
- };
16
- exports.default = CardWithImage;
@@ -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
- };