Skip to content

Commit b9b5fff

Browse files
authored
feat: update schemas for Table and Media blocks (#628)
* feat: added video new parameters and caption parameter to the schema
1 parent 2609ca9 commit b9b5fff

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

src/blocks/Table/schema.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ export const TableBlock = {
5353
type: 'string',
5454
enum: ['disk', 'tick'],
5555
},
56+
caption: {
57+
type: 'string',
58+
},
5659
},
5760
},
5861
},

src/schema/validators/common.ts

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import {ImageProps, imageUrlPattern} from '../../components/Image/schema';
2-
import {Theme} from '../../models';
2+
import {
3+
CustomControlsButtonPositioning,
4+
CustomControlsType,
5+
MediaVideoControlsType,
6+
Theme,
7+
} from '../../models';
38

49
import {AnalyticsEventSchema} from './event';
510
import {pixelEvents} from './pixel';
@@ -14,12 +19,21 @@ export const contentTextWidth = ['s', 'm', 'l'];
1419
export const videoTypes = ['default', 'player'];
1520
export const playIconTypes = ['default', 'text'];
1621
export const playIconThemes = ['blue', 'grey'];
17-
export const videoControlsTypes = ['default', 'custom'];
22+
export const videoControlsTypes = [MediaVideoControlsType.Default, MediaVideoControlsType.Custom];
1823
export const fileLinkTypes = ['vertical', 'horizontal'];
1924

2025
export const dividerEnum = {enum: [0, 'xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'xxxl']};
2126
export const sizeNumber = {type: 'number', maximum: 12, minimum: 1};
2227
export const contentThemes = ['default', 'dark', 'light'];
28+
export const customControlsType = [
29+
CustomControlsType.WithMuteButton,
30+
CustomControlsType.WithPlayPauseButton,
31+
];
32+
export const customControlsButtonPositioning = [
33+
CustomControlsButtonPositioning.Center,
34+
CustomControlsButtonPositioning.Left,
35+
CustomControlsButtonPositioning.Right,
36+
];
2337

2438
export const BaseProps = {
2539
type: {},
@@ -98,6 +112,24 @@ export const PlayButtonProps = {
98112
},
99113
};
100114

115+
export const CustomControlsOptionsProps = {
116+
type: 'object',
117+
additionalProperties: false,
118+
properties: {
119+
type: {
120+
type: 'string',
121+
enum: customControlsType,
122+
},
123+
muteButtonShown: {
124+
type: 'boolean',
125+
},
126+
positioning: {
127+
type: 'string',
128+
enum: customControlsButtonPositioning,
129+
},
130+
},
131+
};
132+
101133
export const VideoProps = {
102134
type: 'object',
103135
additionalProperties: false,
@@ -139,6 +171,10 @@ export const VideoProps = {
139171
type: 'string',
140172
enum: videoControlsTypes,
141173
},
174+
customControlsOptions: CustomControlsOptionsProps,
175+
ariaLabel: {
176+
type: 'string',
177+
},
142178
},
143179
};
144180

0 commit comments

Comments
 (0)