@gravity-ui/page-constructor 2.17.0 → 3.0.0-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.
- package/CHANGELOG.md +0 -7
- package/build/cjs/blocks/index.d.ts +0 -4
- package/build/cjs/blocks/index.js +1 -9
- package/build/cjs/blocks/validators.d.ts +0 -4
- package/build/cjs/blocks/validators.js +0 -4
- package/build/cjs/components/index.d.ts +0 -1
- package/build/cjs/components/index.js +1 -3
- package/build/cjs/constructor-items.d.ts +0 -16
- package/build/cjs/constructor-items.js +0 -16
- package/build/cjs/hooks/index.d.ts +1 -1
- package/build/cjs/hooks/index.js +3 -3
- package/build/cjs/models/constructor-items/blocks.d.ts +2 -50
- package/build/cjs/models/constructor-items/blocks.js +0 -4
- package/build/cjs/models/constructor-items/common.d.ts +0 -14
- package/build/cjs/models/constructor-items/common.js +1 -6
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +5 -46
- package/build/cjs/models/constructor-items/sub-blocks.js +2 -11
- package/build/cjs/schema/index.js +2 -8
- package/build/cjs/schema/validators/blocks.d.ts +0 -4
- package/build/cjs/schema/validators/blocks.js +0 -4
- package/build/cjs/schema/validators/sub-blocks.d.ts +0 -3
- package/build/cjs/schema/validators/sub-blocks.js +0 -3
- package/build/cjs/sub-blocks/index.d.ts +0 -3
- package/build/cjs/sub-blocks/index.js +1 -7
- package/build/cjs/text-transform/{blocks.d.ts → common.d.ts} +1 -4
- package/build/cjs/text-transform/common.js +31 -0
- package/build/cjs/text-transform/config.d.ts +28 -0
- package/build/cjs/text-transform/config.js +291 -0
- package/build/cjs/text-transform/index.d.ts +3 -1
- package/build/cjs/text-transform/index.js +3 -1
- package/build/cjs/text-transform/transformers.d.ts +16 -0
- package/build/cjs/text-transform/transformers.js +61 -0
- package/build/cjs/utils/index.d.ts +0 -1
- package/build/cjs/utils/index.js +0 -1
- package/build/esm/blocks/index.d.ts +0 -4
- package/build/esm/blocks/index.js +0 -4
- package/build/esm/blocks/validators.d.ts +0 -4
- package/build/esm/blocks/validators.js +0 -4
- package/build/esm/components/index.d.ts +0 -1
- package/build/esm/components/index.js +0 -1
- package/build/esm/constructor-items.d.ts +0 -16
- package/build/esm/constructor-items.js +2 -18
- package/build/esm/hooks/index.d.ts +1 -1
- package/build/esm/hooks/index.js +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +2 -50
- package/build/esm/models/constructor-items/blocks.js +0 -4
- package/build/esm/models/constructor-items/common.d.ts +0 -14
- package/build/esm/models/constructor-items/common.js +0 -5
- package/build/esm/models/constructor-items/sub-blocks.d.ts +5 -46
- package/build/esm/models/constructor-items/sub-blocks.js +2 -11
- package/build/esm/schema/index.js +4 -10
- package/build/esm/schema/validators/blocks.d.ts +0 -4
- package/build/esm/schema/validators/blocks.js +0 -4
- package/build/esm/schema/validators/sub-blocks.d.ts +0 -3
- package/build/esm/schema/validators/sub-blocks.js +0 -3
- package/build/esm/sub-blocks/index.d.ts +0 -3
- package/build/esm/sub-blocks/index.js +0 -3
- package/build/esm/text-transform/{blocks.d.ts → common.d.ts} +1 -4
- package/build/esm/text-transform/common.js +25 -0
- package/build/esm/text-transform/config.d.ts +28 -0
- package/build/esm/text-transform/{blocks.js → config.js} +15 -123
- package/build/esm/text-transform/index.d.ts +3 -1
- package/build/esm/text-transform/index.js +3 -1
- package/build/esm/text-transform/transformers.d.ts +16 -0
- package/build/esm/text-transform/transformers.js +56 -0
- package/build/esm/utils/index.d.ts +0 -1
- package/build/esm/utils/index.js +0 -1
- package/package.json +4 -1
- package/server/models/constructor-items/blocks.d.ts +2 -50
- package/server/models/constructor-items/blocks.js +0 -4
- package/server/models/constructor-items/common.d.ts +0 -14
- package/server/models/constructor-items/common.js +1 -6
- package/server/models/constructor-items/sub-blocks.d.ts +5 -46
- package/server/models/constructor-items/sub-blocks.js +2 -11
- package/server/text-transform/{blocks.d.ts → common.d.ts} +1 -4
- package/server/text-transform/common.js +31 -0
- package/server/text-transform/config.d.ts +28 -0
- package/server/text-transform/config.js +301 -0
- package/server/text-transform/index.d.ts +3 -1
- package/server/text-transform/index.js +3 -1
- package/server/text-transform/transformers.d.ts +16 -0
- package/server/text-transform/transformers.js +63 -0
- package/server/utils/index.d.ts +0 -1
- package/server/utils/index.js +0 -1
- package/build/cjs/blocks/LinkTable/LinkTable.css +0 -3
- package/build/cjs/blocks/LinkTable/LinkTable.d.ts +0 -3
- package/build/cjs/blocks/LinkTable/LinkTable.js +0 -22
- package/build/cjs/blocks/LinkTable/schema.d.ts +0 -77
- package/build/cjs/blocks/LinkTable/schema.js +0 -15
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.css +0 -50
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +0 -13
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.js +0 -49
- package/build/cjs/blocks/Preview/MediaContent/PreviewContent.css +0 -106
- package/build/cjs/blocks/Preview/MediaContent/PreviewContent.d.ts +0 -11
- package/build/cjs/blocks/Preview/MediaContent/PreviewContent.js +0 -17
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.css +0 -54
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.d.ts +0 -9
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.js +0 -13
- package/build/cjs/blocks/Preview/Preview.css +0 -50
- package/build/cjs/blocks/Preview/Preview.d.ts +0 -3
- package/build/cjs/blocks/Preview/Preview.js +0 -130
- package/build/cjs/blocks/Preview/schema.d.ts +0 -40
- package/build/cjs/blocks/Preview/schema.js +0 -53
- package/build/cjs/blocks/Security/Security.css +0 -142
- package/build/cjs/blocks/Security/Security.d.ts +0 -3
- package/build/cjs/blocks/Security/Security.js +0 -29
- package/build/cjs/blocks/Security/schema.d.ts +0 -170
- package/build/cjs/blocks/Security/schema.js +0 -32
- package/build/cjs/blocks/Simple/Simple.css +0 -22
- package/build/cjs/blocks/Simple/Simple.d.ts +0 -3
- package/build/cjs/blocks/Simple/Simple.js +0 -22
- package/build/cjs/blocks/Simple/schema.d.ts +0 -68
- package/build/cjs/blocks/Simple/schema.js +0 -14
- package/build/cjs/components/HeightCalculator/HeightCalculator.css +0 -9
- package/build/cjs/components/HeightCalculator/HeightCalculator.d.ts +0 -10
- package/build/cjs/components/HeightCalculator/HeightCalculator.js +0 -44
- package/build/cjs/context/breakpointContext/breakpointContext.d.ts +0 -2
- package/build/cjs/context/breakpointContext/breakpointContext.js +0 -7
- package/build/cjs/context/breakpointContext/index.d.ts +0 -1
- package/build/cjs/context/breakpointContext/index.js +0 -4
- package/build/cjs/hooks/useIntersection.d.ts +0 -1
- package/build/cjs/hooks/useIntersection.js +0 -21
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.css +0 -19
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.d.ts +0 -3
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.js +0 -16
- package/build/cjs/sub-blocks/CardWithImage/schema.d.ts +0 -154
- package/build/cjs/sub-blocks/CardWithImage/schema.js +0 -46
- package/build/cjs/sub-blocks/Partner/Partner.css +0 -8
- package/build/cjs/sub-blocks/Partner/Partner.d.ts +0 -3
- package/build/cjs/sub-blocks/Partner/Partner.js +0 -15
- package/build/cjs/sub-blocks/Partner/schema.d.ts +0 -30
- package/build/cjs/sub-blocks/Partner/schema.js +0 -17
- package/build/cjs/sub-blocks/TutorialCard/TutorialCard.css +0 -20
- package/build/cjs/sub-blocks/TutorialCard/TutorialCard.d.ts +0 -3
- package/build/cjs/sub-blocks/TutorialCard/TutorialCard.js +0 -23
- package/build/cjs/sub-blocks/TutorialCard/schema.d.ts +0 -34
- package/build/cjs/sub-blocks/TutorialCard/schema.js +0 -20
- package/build/cjs/text-transform/blocks.js +0 -404
- package/build/cjs/utils/scroll.d.ts +0 -15
- package/build/cjs/utils/scroll.js +0 -35
- package/build/esm/blocks/LinkTable/LinkTable.css +0 -3
- package/build/esm/blocks/LinkTable/LinkTable.d.ts +0 -4
- package/build/esm/blocks/LinkTable/LinkTable.js +0 -21
- package/build/esm/blocks/LinkTable/schema.d.ts +0 -77
- package/build/esm/blocks/LinkTable/schema.js +0 -12
- package/build/esm/blocks/Preview/MediaContent/MediaContent.css +0 -50
- package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +0 -14
- package/build/esm/blocks/Preview/MediaContent/MediaContent.js +0 -47
- package/build/esm/blocks/Preview/MediaContent/PreviewContent.css +0 -106
- package/build/esm/blocks/Preview/MediaContent/PreviewContent.d.ts +0 -12
- package/build/esm/blocks/Preview/MediaContent/PreviewContent.js +0 -15
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.css +0 -54
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.d.ts +0 -10
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.js +0 -11
- package/build/esm/blocks/Preview/Preview.css +0 -50
- package/build/esm/blocks/Preview/Preview.d.ts +0 -4
- package/build/esm/blocks/Preview/Preview.js +0 -126
- package/build/esm/blocks/Preview/schema.d.ts +0 -40
- package/build/esm/blocks/Preview/schema.js +0 -50
- package/build/esm/blocks/Security/Security.css +0 -142
- package/build/esm/blocks/Security/Security.d.ts +0 -4
- package/build/esm/blocks/Security/Security.js +0 -25
- package/build/esm/blocks/Security/schema.d.ts +0 -170
- package/build/esm/blocks/Security/schema.js +0 -28
- package/build/esm/blocks/Simple/Simple.css +0 -22
- package/build/esm/blocks/Simple/Simple.d.ts +0 -4
- package/build/esm/blocks/Simple/Simple.js +0 -18
- package/build/esm/blocks/Simple/schema.d.ts +0 -68
- package/build/esm/blocks/Simple/schema.js +0 -11
- package/build/esm/components/HeightCalculator/HeightCalculator.css +0 -9
- package/build/esm/components/HeightCalculator/HeightCalculator.d.ts +0 -11
- package/build/esm/components/HeightCalculator/HeightCalculator.js +0 -42
- package/build/esm/context/breakpointContext/breakpointContext.d.ts +0 -2
- package/build/esm/context/breakpointContext/breakpointContext.js +0 -3
- package/build/esm/context/breakpointContext/index.d.ts +0 -1
- package/build/esm/context/breakpointContext/index.js +0 -1
- package/build/esm/hooks/useIntersection.d.ts +0 -1
- package/build/esm/hooks/useIntersection.js +0 -17
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.css +0 -19
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.d.ts +0 -4
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.js +0 -14
- package/build/esm/sub-blocks/CardWithImage/schema.d.ts +0 -154
- package/build/esm/sub-blocks/CardWithImage/schema.js +0 -43
- package/build/esm/sub-blocks/Partner/Partner.css +0 -8
- package/build/esm/sub-blocks/Partner/Partner.d.ts +0 -4
- package/build/esm/sub-blocks/Partner/Partner.js +0 -13
- package/build/esm/sub-blocks/Partner/schema.d.ts +0 -30
- package/build/esm/sub-blocks/Partner/schema.js +0 -14
- package/build/esm/sub-blocks/TutorialCard/TutorialCard.css +0 -20
- package/build/esm/sub-blocks/TutorialCard/TutorialCard.d.ts +0 -4
- package/build/esm/sub-blocks/TutorialCard/TutorialCard.js +0 -21
- package/build/esm/sub-blocks/TutorialCard/schema.d.ts +0 -34
- package/build/esm/sub-blocks/TutorialCard/schema.js +0 -17
- package/build/esm/utils/scroll.d.ts +0 -15
- package/build/esm/utils/scroll.js +0 -31
- package/server/text-transform/blocks.js +0 -417
- package/server/utils/scroll.d.ts +0 -15
- package/server/utils/scroll.js +0 -35
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
export declare const SecurityBlock: {
|
|
2
|
-
'security-block': {
|
|
3
|
-
additionalProperties: boolean;
|
|
4
|
-
required: string[];
|
|
5
|
-
properties: {
|
|
6
|
-
theme: {
|
|
7
|
-
type: string;
|
|
8
|
-
enum: string[];
|
|
9
|
-
};
|
|
10
|
-
backgroundColor: {
|
|
11
|
-
type: string;
|
|
12
|
-
};
|
|
13
|
-
title: {
|
|
14
|
-
type: string;
|
|
15
|
-
contentType: string;
|
|
16
|
-
};
|
|
17
|
-
media: {
|
|
18
|
-
type: string;
|
|
19
|
-
additionalProperties: boolean;
|
|
20
|
-
required: never[];
|
|
21
|
-
properties: {
|
|
22
|
-
color: {
|
|
23
|
-
type: string;
|
|
24
|
-
};
|
|
25
|
-
image: {
|
|
26
|
-
anyOf: ({
|
|
27
|
-
oneOf: ({
|
|
28
|
-
type: string;
|
|
29
|
-
properties: {
|
|
30
|
-
when: {
|
|
31
|
-
type: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
} | {
|
|
35
|
-
type: string;
|
|
36
|
-
pattern: string;
|
|
37
|
-
})[];
|
|
38
|
-
} | {
|
|
39
|
-
type: string;
|
|
40
|
-
items: {
|
|
41
|
-
oneOf: ({
|
|
42
|
-
type: string;
|
|
43
|
-
properties: {
|
|
44
|
-
when: {
|
|
45
|
-
type: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
} | {
|
|
49
|
-
type: string;
|
|
50
|
-
pattern: string;
|
|
51
|
-
})[];
|
|
52
|
-
};
|
|
53
|
-
})[];
|
|
54
|
-
};
|
|
55
|
-
video: {
|
|
56
|
-
type: string;
|
|
57
|
-
additionalProperties: boolean;
|
|
58
|
-
required: string[];
|
|
59
|
-
properties: {
|
|
60
|
-
src: {
|
|
61
|
-
type: string;
|
|
62
|
-
items: {
|
|
63
|
-
type: string;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
loop: {
|
|
67
|
-
anyOf: ({
|
|
68
|
-
type: string;
|
|
69
|
-
additionalProperties: boolean;
|
|
70
|
-
required: string[];
|
|
71
|
-
properties: {
|
|
72
|
-
start: {
|
|
73
|
-
type: string;
|
|
74
|
-
};
|
|
75
|
-
end: {
|
|
76
|
-
type: string;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
} | {
|
|
80
|
-
type: string;
|
|
81
|
-
})[];
|
|
82
|
-
};
|
|
83
|
-
type: {
|
|
84
|
-
type: string;
|
|
85
|
-
enum: string[];
|
|
86
|
-
};
|
|
87
|
-
muted: {
|
|
88
|
-
type: string;
|
|
89
|
-
};
|
|
90
|
-
playing: {
|
|
91
|
-
type: string;
|
|
92
|
-
};
|
|
93
|
-
elapsedTime: {
|
|
94
|
-
type: string;
|
|
95
|
-
};
|
|
96
|
-
playIcon: {
|
|
97
|
-
type: string;
|
|
98
|
-
additionalProperties: boolean;
|
|
99
|
-
properties: {
|
|
100
|
-
type: {
|
|
101
|
-
type: string;
|
|
102
|
-
enum: string[];
|
|
103
|
-
};
|
|
104
|
-
theme: {
|
|
105
|
-
type: string;
|
|
106
|
-
enum: string[];
|
|
107
|
-
};
|
|
108
|
-
text: {
|
|
109
|
-
type: string;
|
|
110
|
-
contentType: string;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
controls: {
|
|
115
|
-
type: string;
|
|
116
|
-
enum: string[];
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
youtube: {
|
|
121
|
-
type: string;
|
|
122
|
-
};
|
|
123
|
-
parallax: {
|
|
124
|
-
type: string;
|
|
125
|
-
};
|
|
126
|
-
height: {
|
|
127
|
-
type: string;
|
|
128
|
-
};
|
|
129
|
-
previewImg: {
|
|
130
|
-
type: string;
|
|
131
|
-
};
|
|
132
|
-
dataLens: {
|
|
133
|
-
oneOf: ({
|
|
134
|
-
type: string;
|
|
135
|
-
additionalProperties: boolean;
|
|
136
|
-
required: string[];
|
|
137
|
-
properties: {
|
|
138
|
-
id: {
|
|
139
|
-
type: string;
|
|
140
|
-
};
|
|
141
|
-
theme: {
|
|
142
|
-
type: string;
|
|
143
|
-
enum: string[];
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
} | {
|
|
147
|
-
type: string;
|
|
148
|
-
})[];
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
points: {
|
|
153
|
-
type: string;
|
|
154
|
-
items: {
|
|
155
|
-
type: string;
|
|
156
|
-
properties: {
|
|
157
|
-
when: {
|
|
158
|
-
type: string;
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
animated: {
|
|
164
|
-
type: string;
|
|
165
|
-
};
|
|
166
|
-
type: {};
|
|
167
|
-
when: {};
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import { AnimatableProps, BaseProps, LinkProps, ThemeProps } from '../../schema/validators/common';
|
|
3
|
-
import { filteredArray } from '../../schema/validators/utils';
|
|
4
|
-
import { Media } from '../Media/schema';
|
|
5
|
-
export const SecurityBlock = {
|
|
6
|
-
'security-block': {
|
|
7
|
-
additionalProperties: false,
|
|
8
|
-
required: ['title', 'media'],
|
|
9
|
-
properties: Object.assign(Object.assign(Object.assign({}, BaseProps), AnimatableProps), { theme: ThemeProps, backgroundColor: {
|
|
10
|
-
type: 'string',
|
|
11
|
-
}, title: {
|
|
12
|
-
type: 'string',
|
|
13
|
-
contentType: 'text',
|
|
14
|
-
}, media: Media, points: filteredArray({
|
|
15
|
-
type: 'object',
|
|
16
|
-
properties: {
|
|
17
|
-
img: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
},
|
|
20
|
-
text: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
contentType: 'text',
|
|
23
|
-
},
|
|
24
|
-
link: _.pick(LinkProps, ['text', 'url']),
|
|
25
|
-
},
|
|
26
|
-
}) }),
|
|
27
|
-
},
|
|
28
|
-
};
|
|
@@ -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,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
3
|
-
import BlockHeader from '../../components/BlockHeader/BlockHeader';
|
|
4
|
-
import YFMWrapper from '../../components/YFMWrapper/YFMWrapper';
|
|
5
|
-
import { block } from '../../utils';
|
|
6
|
-
import './Simple.css';
|
|
7
|
-
const b = block('simple-block');
|
|
8
|
-
export const SimpleBlock = (props) => {
|
|
9
|
-
const { title, description, animated = true, children } = props;
|
|
10
|
-
const blockHeader = title && React.createElement(BlockHeader, { title: title });
|
|
11
|
-
return (React.createElement(AnimateBlock, { className: b(), animate: animated },
|
|
12
|
-
React.createElement("div", null,
|
|
13
|
-
blockHeader,
|
|
14
|
-
React.createElement("div", { className: b('description') },
|
|
15
|
-
React.createElement(YFMWrapper, { content: description, modifiers: { constructor: true } })),
|
|
16
|
-
React.createElement("div", { className: b('animate-block') }, children))));
|
|
17
|
-
};
|
|
18
|
-
export default 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,11 +0,0 @@
|
|
|
1
|
-
import { AnimatableProps, BlockBaseProps, ChildrenProps, TitleProps, } from '../../schema/validators/common';
|
|
2
|
-
export const SimpleBlock = {
|
|
3
|
-
'simple-block': {
|
|
4
|
-
additionalProperties: false,
|
|
5
|
-
required: ['title', 'description'],
|
|
6
|
-
properties: Object.assign(Object.assign(Object.assign({ title: TitleProps, description: {
|
|
7
|
-
type: 'string',
|
|
8
|
-
contentType: 'yfm',
|
|
9
|
-
} }, BlockBaseProps), AnimatableProps), { children: ChildrenProps }),
|
|
10
|
-
},
|
|
11
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { WithChildren } from '../../models';
|
|
2
|
-
import './HeightCalculator.css';
|
|
3
|
-
export interface HeightCalculatorProps {
|
|
4
|
-
onCalculate: (height: number) => void;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Will be removed, use the useHeightCalculator hook instead.
|
|
8
|
-
* @returns The HeightCalculator component.
|
|
9
|
-
*/
|
|
10
|
-
declare const HeightCalculator: ({ onCalculate, children }: WithChildren<HeightCalculatorProps>) => JSX.Element | null;
|
|
11
|
-
export default HeightCalculator;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React, { Children, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
-
import _ from 'lodash';
|
|
3
|
-
import { block } from '../../utils';
|
|
4
|
-
import './HeightCalculator.css';
|
|
5
|
-
const b = block('height-calculator');
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Will be removed, use the useHeightCalculator hook instead.
|
|
8
|
-
* @returns The HeightCalculator component.
|
|
9
|
-
*/
|
|
10
|
-
const HeightCalculator = ({ onCalculate, children }) => {
|
|
11
|
-
const [isCalculating, setIsCalculating] = useState(true);
|
|
12
|
-
const container = useRef(null);
|
|
13
|
-
const itemRefs = useMemo(() => {
|
|
14
|
-
var _a;
|
|
15
|
-
return (_a = Children.map(children, () => React.createRef())) !== null && _a !== void 0 ? _a : [];
|
|
16
|
-
}, [children]);
|
|
17
|
-
const calculateContainerHeight = useCallback(() => {
|
|
18
|
-
if (container && container.current && itemRefs.length) {
|
|
19
|
-
const maxHeight = Math.max(...itemRefs.map((tabRef) => {
|
|
20
|
-
if (tabRef && tabRef.current) {
|
|
21
|
-
return tabRef.current.offsetHeight;
|
|
22
|
-
}
|
|
23
|
-
return 0;
|
|
24
|
-
}));
|
|
25
|
-
onCalculate(maxHeight);
|
|
26
|
-
setIsCalculating(false);
|
|
27
|
-
}
|
|
28
|
-
}, [itemRefs, onCalculate]);
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
const handleResize = _.debounce(() => {
|
|
31
|
-
setIsCalculating(true);
|
|
32
|
-
calculateContainerHeight();
|
|
33
|
-
}, 1000);
|
|
34
|
-
calculateContainerHeight();
|
|
35
|
-
window.addEventListener('resize', handleResize, { passive: true });
|
|
36
|
-
return () => window.removeEventListener('resize', handleResize);
|
|
37
|
-
}, [calculateContainerHeight]);
|
|
38
|
-
return isCalculating ? (React.createElement("div", { className: b(), ref: container }, Children.map(children, (child, index) => {
|
|
39
|
-
return (React.createElement("div", { className: b('item-wrapper'), ref: itemRefs[index], key: index }, child));
|
|
40
|
-
}))) : null;
|
|
41
|
-
};
|
|
42
|
-
export default HeightCalculator;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './breakpointContext';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './breakpointContext';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useIntersection: (element?: Element, startMargin?: string, threshold?: number) => boolean;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
export const useIntersection = (element, startMargin = '0px', threshold = 0.2) => {
|
|
3
|
-
const [isVisible, setState] = useState(false);
|
|
4
|
-
useEffect(() => {
|
|
5
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
6
|
-
setState(entry.isIntersecting);
|
|
7
|
-
}, {
|
|
8
|
-
rootMargin: startMargin,
|
|
9
|
-
threshold,
|
|
10
|
-
});
|
|
11
|
-
if (element) {
|
|
12
|
-
observer.observe(element);
|
|
13
|
-
}
|
|
14
|
-
return () => element && observer.unobserve(element);
|
|
15
|
-
}, [element, startMargin, threshold]);
|
|
16
|
-
return isVisible;
|
|
17
|
-
};
|
|
@@ -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,4 +0,0 @@
|
|
|
1
|
-
import { CardWithImageProps } from '../../models';
|
|
2
|
-
import './CardWithImage.css';
|
|
3
|
-
declare const CardWithImage: ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }: CardWithImageProps) => JSX.Element;
|
|
4
|
-
export default CardWithImage;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Content } from '../';
|
|
3
|
-
import { FullscreenImage, Image } from '../../components';
|
|
4
|
-
import { block } from '../../utils';
|
|
5
|
-
import './CardWithImage.css';
|
|
6
|
-
const b = block('card-with-image');
|
|
7
|
-
const CardWithImage = ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }) => {
|
|
8
|
-
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 })));
|
|
9
|
-
return (React.createElement("div", { className: b(null, className) },
|
|
10
|
-
React.createElement("div", { className: b('image', { border }) }, fullScreen ? (React.createElement(FullscreenImage, { src: image, imageClassName: b('image-item'), disableCompress: disableCompress })) : (React.createElement(Image, { className: b('image-item'), src: image, alt: 'card-image', disableCompress: disableCompress }))),
|
|
11
|
-
React.createElement("div", { className: b('content') },
|
|
12
|
-
React.createElement(Content, { title: title, text: description, links: unifiedLinks, additionalInfo: additionalInfo, buttons: buttons, size: "s", colSizes: { all: 12, md: 12 } }))));
|
|
13
|
-
};
|
|
14
|
-
export 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
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { omit } from 'lodash';
|
|
2
|
-
import { BaseProps, textSize } from '../../schema/validators/common';
|
|
3
|
-
import { filteredArray } from '../../schema/validators/utils';
|
|
4
|
-
import { ContentBase } from '../../sub-blocks/Content/schema';
|
|
5
|
-
const CardWithImageContentProps = omit(ContentBase, ['links', 'size', 'text', 'theme']);
|
|
6
|
-
const CardWithImageLinks = {
|
|
7
|
-
type: 'object',
|
|
8
|
-
additionalProperties: false,
|
|
9
|
-
required: ['title', 'link'],
|
|
10
|
-
properties: Object.assign(Object.assign({}, BaseProps), { title: {
|
|
11
|
-
type: 'string',
|
|
12
|
-
contentType: 'text',
|
|
13
|
-
}, link: {
|
|
14
|
-
type: 'string',
|
|
15
|
-
}, arrow: {
|
|
16
|
-
type: 'boolean',
|
|
17
|
-
}, theme: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
enum: ['back', 'file-link', 'normal'],
|
|
20
|
-
}, textSize: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
enum: textSize,
|
|
23
|
-
} }),
|
|
24
|
-
};
|
|
25
|
-
export const CardWithImageItem = {
|
|
26
|
-
additionalProperties: false,
|
|
27
|
-
required: ['image'],
|
|
28
|
-
properties: Object.assign(Object.assign(Object.assign({}, BaseProps), CardWithImageContentProps), { image: {
|
|
29
|
-
type: 'string',
|
|
30
|
-
}, description: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
contentType: 'yfm',
|
|
33
|
-
}, disableCompress: {
|
|
34
|
-
type: 'boolean',
|
|
35
|
-
}, border: {
|
|
36
|
-
type: 'boolean',
|
|
37
|
-
}, fullScreen: {
|
|
38
|
-
type: 'boolean',
|
|
39
|
-
}, links: filteredArray(CardWithImageLinks) }),
|
|
40
|
-
};
|
|
41
|
-
export const CardWithImage = {
|
|
42
|
-
'card-with-image': CardWithImageItem,
|
|
43
|
-
};
|