@draftbit/core 46.9.1-db63a0.2 → 46.9.1-deddd4.2

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 (60) hide show
  1. package/lib/commonjs/components/BottomSheet/BottomSheet.js +88 -0
  2. package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +464 -0
  3. package/lib/commonjs/components/BottomSheet/index.js +13 -0
  4. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
  5. package/lib/commonjs/components/Checkbox/CheckboxRow.js +23 -6
  6. package/lib/commonjs/components/Checkbox/context.js +1 -1
  7. package/lib/commonjs/components/Container.js +4 -15
  8. package/lib/commonjs/components/Table/Table.js +36 -4
  9. package/lib/commonjs/components/YotubePlayer.js +38 -0
  10. package/lib/commonjs/hooks.js +1 -2
  11. package/lib/commonjs/index.js +14 -0
  12. package/lib/commonjs/mappings/BottomSheet.js +70 -0
  13. package/lib/commonjs/mappings/Table.js +16 -3
  14. package/lib/commonjs/mappings/YoutubePlayer.js +44 -0
  15. package/lib/module/components/BottomSheet/BottomSheet.js +80 -0
  16. package/lib/module/components/BottomSheet/BottomSheetComponent.js +470 -0
  17. package/lib/module/components/BottomSheet/index.js +1 -0
  18. package/lib/module/components/Table/Table.js +36 -5
  19. package/lib/module/components/YotubePlayer.js +30 -0
  20. package/lib/module/index.js +2 -0
  21. package/lib/module/mappings/BottomSheet.js +63 -0
  22. package/lib/module/mappings/Table.js +16 -3
  23. package/lib/module/mappings/YoutubePlayer.js +37 -0
  24. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +20 -0
  25. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -0
  26. package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts +170 -0
  27. package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts.map +1 -0
  28. package/lib/typescript/src/components/BottomSheet/index.d.ts +2 -0
  29. package/lib/typescript/src/components/BottomSheet/index.d.ts.map +1 -0
  30. package/lib/typescript/src/components/Table/Table.d.ts +3 -3
  31. package/lib/typescript/src/components/Table/Table.d.ts.map +1 -1
  32. package/lib/typescript/src/components/YotubePlayer.d.ts +12 -0
  33. package/lib/typescript/src/components/YotubePlayer.d.ts.map +1 -0
  34. package/lib/typescript/src/index.d.ts +2 -0
  35. package/lib/typescript/src/index.d.ts.map +1 -1
  36. package/lib/typescript/src/mappings/BottomSheet.d.ts +115 -0
  37. package/lib/typescript/src/mappings/BottomSheet.d.ts.map +1 -0
  38. package/lib/typescript/src/mappings/Table.d.ts +22 -12
  39. package/lib/typescript/src/mappings/Table.d.ts.map +1 -1
  40. package/lib/typescript/src/mappings/YoutubePlayer.d.ts +37 -0
  41. package/lib/typescript/src/mappings/YoutubePlayer.d.ts.map +1 -0
  42. package/package.json +8 -4
  43. package/src/components/BottomSheet/BottomSheet.js +56 -0
  44. package/src/components/BottomSheet/BottomSheet.tsx +120 -0
  45. package/src/components/BottomSheet/BottomSheetComponent.js +437 -0
  46. package/src/components/BottomSheet/BottomSheetComponent.tsx +895 -0
  47. package/src/components/BottomSheet/index.js +1 -0
  48. package/src/components/BottomSheet/index.ts +1 -0
  49. package/src/components/Table/Table.js +34 -5
  50. package/src/components/Table/Table.tsx +51 -11
  51. package/src/components/YotubePlayer.js +10 -0
  52. package/src/components/YotubePlayer.tsx +38 -0
  53. package/src/index.js +2 -0
  54. package/src/index.tsx +4 -0
  55. package/src/mappings/BottomSheet.js +63 -0
  56. package/src/mappings/BottomSheet.ts +77 -0
  57. package/src/mappings/Table.js +15 -2
  58. package/src/mappings/Table.ts +16 -2
  59. package/src/mappings/YoutubePlayer.js +37 -0
  60. package/src/mappings/YoutubePlayer.ts +43 -0
@@ -0,0 +1 @@
1
+ export { default as BottomSheet } from "./BottomSheet";
@@ -0,0 +1 @@
1
+ export { default as BottomSheet } from "./BottomSheet";
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { ScrollView, View, StyleSheet, } from "react-native";
3
3
  import { withTheme } from "../../theming";
4
4
  import { generateBorderStyles, TableStyleContext, } from "./TableCommon";
5
- const Table = ({ theme, borderWidth = 1, borderColor = theme.colors.divider, borderStyle = "solid", drawTopBorder = true, drawBottomBorder = false, drawStartBorder = false, drawEndBorder = false, cellVerticalPadding = 10, cellHorizontalPadding = 10, data, keyExtractor, renderItem, children: childrenProp, style, }) => {
5
+ const Table = ({ theme, borderWidth = 1, borderColor = theme.colors.divider, borderStyle = "solid", drawTopBorder = true, drawBottomBorder = false, drawStartBorder = false, drawEndBorder = false, cellVerticalPadding = 10, cellHorizontalPadding = 10, data, keyExtractor, renderItem, children: childrenProp, style, ...rest }) => {
6
6
  //Both 'renderItem' and 'data' are optional to allow direct children. But if one is included, both need to be included
7
7
  if ((data && !renderItem) || (renderItem && !data)) {
8
8
  throw new Error("'renderItem' and 'data' need to both be provided to render from 'data'. Either remove them entirley or include both");
@@ -33,8 +33,37 @@ const Table = ({ theme, borderWidth = 1, borderColor = theme.colors.divider, bor
33
33
  ? dataAsChildren
34
34
  : React.Children.toArray(childrenProp);
35
35
  const validChildren = React.useMemo(() => children.filter((item) => React.isValidElement(item)), [children]);
36
- const childrenWithoutHeader = React.useMemo(() => validChildren.filter((item) => !isTableHeader(item.props)), [validChildren, isTableHeader]);
37
- const headers = React.useMemo(() => validChildren.filter((item) => isTableHeader(item.props)), [validChildren, isTableHeader]);
36
+ const childrenWithoutHeader = React.useMemo(() => {
37
+ const flattenedWithoutNestedHeaders = validChildren.map((item) => {
38
+ const nestedChildren = React.Children.toArray(item.props.children);
39
+ //Header can be nested in React.Fragment when in renderItem
40
+ const nestedHeaders = nestedChildren.filter((child) => isTableHeader(child.props));
41
+ if (nestedHeaders === null || nestedHeaders === void 0 ? void 0 : nestedHeaders.length) {
42
+ //New element excluding header children
43
+ return React.cloneElement(item, {
44
+ children: nestedChildren.filter((child) => !isTableHeader(child.props)),
45
+ });
46
+ }
47
+ return item;
48
+ });
49
+ return flattenedWithoutNestedHeaders.filter((item) => !isTableHeader(item.props));
50
+ }, [validChildren, isTableHeader]);
51
+ const header = React.useMemo(() => {
52
+ const flattenedPossibleHeaders = validChildren.map((item) => {
53
+ const nestedChildren = React.Children.toArray(item.props.children);
54
+ //Header can be nested in React.Fragment when in renderItem
55
+ const nestedHeaders = nestedChildren.filter((child) => isTableHeader(child.props));
56
+ if (nestedHeaders === null || nestedHeaders === void 0 ? void 0 : nestedHeaders.length) {
57
+ return nestedHeaders[0];
58
+ }
59
+ return item;
60
+ });
61
+ const allHeaders = flattenedPossibleHeaders.filter((item) => isTableHeader(item.props));
62
+ if (allHeaders.length) {
63
+ return allHeaders[0]; //Only 1 header taken
64
+ }
65
+ return null;
66
+ }, [validChildren, isTableHeader]);
38
67
  const contextValue = {
39
68
  borderColor,
40
69
  borderStyle,
@@ -53,8 +82,8 @@ const Table = ({ theme, borderWidth = 1, borderColor = theme.colors.divider, bor
53
82
  });
54
83
  return (React.createElement(TableStyleContext.Provider, { value: contextValue },
55
84
  React.createElement(View, { style: [styles.container, borderViewStyle, style] },
56
- React.createElement(React.Fragment, null, headers),
57
- React.createElement(ScrollView, null, childrenWithoutHeader))));
85
+ React.createElement(React.Fragment, null, header),
86
+ React.createElement(ScrollView, { ...rest }, childrenWithoutHeader))));
58
87
  };
59
88
  const styles = StyleSheet.create({
60
89
  container: {
@@ -5,6 +5,7 @@ import {
5
5
  ViewStyle,
6
6
  View,
7
7
  StyleSheet,
8
+ ScrollViewProps,
8
9
  } from "react-native";
9
10
  import { Theme } from "../../styles/DefaultTheme";
10
11
  import { withTheme } from "../../theming";
@@ -15,7 +16,7 @@ import {
15
16
  TableStyleProps,
16
17
  } from "./TableCommon";
17
18
 
18
- export interface Props<T> extends TableProps {
19
+ export interface Props<T> extends TableProps, ScrollViewProps {
19
20
  data?: Array<T>;
20
21
  keyExtractor?: (item: T, index: number) => string;
21
22
  renderItem?: ({ item, index }: { item: T; index: number }) => JSX.Element;
@@ -39,6 +40,7 @@ const Table = <T extends object>({
39
40
  renderItem,
40
41
  children: childrenProp,
41
42
  style,
43
+ ...rest
42
44
  }: React.PropsWithChildren<Props<T>>) => {
43
45
  //Both 'renderItem' and 'data' are optional to allow direct children. But if one is included, both need to be included
44
46
  if ((data && !renderItem) || (renderItem && !data)) {
@@ -89,15 +91,53 @@ const Table = <T extends object>({
89
91
  [children]
90
92
  );
91
93
 
92
- const childrenWithoutHeader = React.useMemo(
93
- () => validChildren.filter((item) => !isTableHeader(item.props)),
94
- [validChildren, isTableHeader]
95
- );
94
+ const childrenWithoutHeader = React.useMemo(() => {
95
+ const flattenedWithoutNestedHeaders = validChildren.map((item) => {
96
+ const nestedChildren = React.Children.toArray(
97
+ item.props.children
98
+ ) as any[];
99
+ //Header can be nested in React.Fragment when in renderItem
100
+ const nestedHeaders = nestedChildren.filter((child: any) =>
101
+ isTableHeader(child.props)
102
+ );
103
+ if (nestedHeaders?.length) {
104
+ //New element excluding header children
105
+ return React.cloneElement(item, {
106
+ children: nestedChildren.filter(
107
+ (child: any) => !isTableHeader(child.props)
108
+ ),
109
+ });
110
+ }
111
+ return item;
112
+ });
96
113
 
97
- const headers = React.useMemo(
98
- () => validChildren.filter((item) => isTableHeader(item.props)),
99
- [validChildren, isTableHeader]
100
- );
114
+ return flattenedWithoutNestedHeaders.filter(
115
+ (item) => !isTableHeader(item.props)
116
+ );
117
+ }, [validChildren, isTableHeader]);
118
+
119
+ const header = React.useMemo(() => {
120
+ const flattenedPossibleHeaders = validChildren.map((item) => {
121
+ const nestedChildren = React.Children.toArray(
122
+ item.props.children
123
+ ) as any[];
124
+ //Header can be nested in React.Fragment when in renderItem
125
+ const nestedHeaders = nestedChildren.filter((child: any) =>
126
+ isTableHeader(child.props)
127
+ );
128
+ if (nestedHeaders?.length) {
129
+ return nestedHeaders[0];
130
+ }
131
+ return item;
132
+ });
133
+ const allHeaders = flattenedPossibleHeaders.filter((item) =>
134
+ isTableHeader(item.props)
135
+ );
136
+ if (allHeaders.length) {
137
+ return allHeaders[0]; //Only 1 header taken
138
+ }
139
+ return null;
140
+ }, [validChildren, isTableHeader]);
101
141
 
102
142
  const contextValue: TableStyleProps = {
103
143
  borderColor,
@@ -120,8 +160,8 @@ const Table = <T extends object>({
120
160
  return (
121
161
  <TableStyleContext.Provider value={contextValue}>
122
162
  <View style={[styles.container, borderViewStyle, style]}>
123
- <>{headers}</>
124
- <ScrollView>{childrenWithoutHeader}</ScrollView>
163
+ <>{header}</>
164
+ <ScrollView {...rest}>{childrenWithoutHeader}</ScrollView>
125
165
  </View>
126
166
  </TableStyleContext.Provider>
127
167
  );
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import YoutubePlayerComponent from "react-native-youtube-iframe";
3
+ import { extractStyles } from "../utilities";
4
+ const YoutubePlayer = ({ videoId, playlist, mute = false, autoplay = false, style, }) => {
5
+ const { viewStyles } = extractStyles(style);
6
+ const { height, width } = viewStyles;
7
+ const defaultVideoId = "nwMUpDESXrI";
8
+ return (React.createElement(YoutubePlayerComponent, { height: height, width: width, play: autoplay, videoId: !videoId && !playlist ? defaultVideoId : videoId, playList: playlist, mute: mute, webViewStyle: style }));
9
+ };
10
+ export default YoutubePlayer;
@@ -0,0 +1,38 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ import YoutubePlayerComponent from "react-native-youtube-iframe";
4
+ import { extractStyles } from "../utilities";
5
+
6
+ interface YoutubePlayerProps {
7
+ videoId?: string;
8
+ playlist?: string;
9
+ mute?: boolean;
10
+ autoplay?: boolean;
11
+ style?: StyleProp<ViewStyle>;
12
+ }
13
+
14
+ const YoutubePlayer: React.FC<YoutubePlayerProps> = ({
15
+ videoId,
16
+ playlist,
17
+ mute = false,
18
+ autoplay = false,
19
+ style,
20
+ }) => {
21
+ const { viewStyles } = extractStyles(style);
22
+ const { height, width } = viewStyles;
23
+ const defaultVideoId = "nwMUpDESXrI";
24
+
25
+ return (
26
+ <YoutubePlayerComponent
27
+ height={height}
28
+ width={width}
29
+ play={autoplay}
30
+ videoId={!videoId && !playlist ? defaultVideoId : videoId}
31
+ playList={playlist}
32
+ mute={mute}
33
+ webViewStyle={style}
34
+ />
35
+ );
36
+ };
37
+
38
+ export default YoutubePlayer;
package/src/index.js CHANGED
@@ -35,6 +35,8 @@ export { default as Shadow } from "./components/Shadow";
35
35
  export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
36
36
  export { TabView, TabViewItem } from "./components/TabView";
37
37
  export { default as Markdown } from "./components/Markdown";
38
+ export { BottomSheet } from "./components/BottomSheet";
39
+ export { default as YoutubePlayer } from "./components/YotubePlayer";
38
40
  export { Table, TableRow, TableCell } from "./components/Table";
39
41
  /* Deprecated: Fix or Delete! */
40
42
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
package/src/index.tsx CHANGED
@@ -58,6 +58,10 @@ export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
58
58
  export { TabView, TabViewItem } from "./components/TabView";
59
59
  export { default as Markdown } from "./components/Markdown";
60
60
 
61
+ export { BottomSheet } from "./components/BottomSheet";
62
+
63
+ export { default as YoutubePlayer } from "./components/YotubePlayer";
64
+
61
65
  export { Table, TableRow, TableCell } from "./components/Table";
62
66
 
63
67
  /* Deprecated: Fix or Delete! */
@@ -0,0 +1,63 @@
1
+ import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Bottom Sheet",
4
+ tag: "BottomSheet",
5
+ description: "A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
6
+ category: COMPONENT_TYPES.bottomsheet,
7
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
+ triggers: [Triggers.OnSettle],
9
+ props: {
10
+ onSettle: createActionProp({
11
+ label: "On settle",
12
+ description: "Action to execute when sheet settles on a snap point",
13
+ }),
14
+ snapPoints: createArrayProp({
15
+ label: "Snap points",
16
+ description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
17
+ defaultValue: ["10%", "50%", "80%"],
18
+ }),
19
+ initialSnapIndex: createStaticNumberProp({
20
+ label: "Initial snap index",
21
+ description: "Index of the snap point to be used as the initial point",
22
+ defaultValue: 0,
23
+ required: false,
24
+ }),
25
+ showHandle: createStaticBoolProp({
26
+ label: "Show handle",
27
+ description: "Whether to show the top sheet handle or not",
28
+ defaultValue: true,
29
+ }),
30
+ handleColor: createColorProp({
31
+ label: "Handle color",
32
+ description: "Color of the top handle",
33
+ defaultValue: "divider",
34
+ }),
35
+ topBorderRadius: createStaticNumberProp({
36
+ label: "Top border radius",
37
+ description: "Border radius of top corners",
38
+ defaultValue: 20,
39
+ required: false,
40
+ }),
41
+ borderWidth: createStaticNumberProp({
42
+ label: "Border width",
43
+ description: "Width of bottom sheet borders",
44
+ defaultValue: 1,
45
+ required: false,
46
+ }),
47
+ borderColor: createColorProp({
48
+ label: "Border color",
49
+ description: "Color of bottom sheet borders",
50
+ defaultValue: "divider",
51
+ }),
52
+ showsVerticalScrollIndicator: createStaticBoolProp({
53
+ label: "Show Vertical Scroll Indicator",
54
+ description: "When true, shows a vertical scroll indicator. The default value is true.",
55
+ defaultValue: true,
56
+ }),
57
+ bounces: createStaticBoolProp({
58
+ label: "Bounce",
59
+ description: "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
60
+ defaultValue: true,
61
+ }),
62
+ },
63
+ };
@@ -0,0 +1,77 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createStaticBoolProp,
4
+ CONTAINER_COMPONENT_STYLES_SECTIONS,
5
+ Triggers,
6
+ createActionProp,
7
+ createColorProp,
8
+ createStaticNumberProp,
9
+ createArrayProp,
10
+ } from "@draftbit/types";
11
+
12
+ export const SEED_DATA = {
13
+ name: "Bottom Sheet",
14
+ tag: "BottomSheet",
15
+ description:
16
+ "A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
17
+ category: COMPONENT_TYPES.bottomsheet,
18
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
19
+ triggers: [Triggers.OnSettle],
20
+ props: {
21
+ onSettle: createActionProp({
22
+ label: "On settle",
23
+ description: "Action to execute when sheet settles on a snap point",
24
+ }),
25
+ snapPoints: createArrayProp({
26
+ label: "Snap points",
27
+ description:
28
+ "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
29
+ defaultValue: ["10%", "50%", "80%"],
30
+ }),
31
+ initialSnapIndex: createStaticNumberProp({
32
+ label: "Initial snap index",
33
+ description: "Index of the snap point to be used as the initial point",
34
+ defaultValue: 0,
35
+ required: false,
36
+ }),
37
+ showHandle: createStaticBoolProp({
38
+ label: "Show handle",
39
+ description: "Whether to show the top sheet handle or not",
40
+ defaultValue: true,
41
+ }),
42
+ handleColor: createColorProp({
43
+ label: "Handle color",
44
+ description: "Color of the top handle",
45
+ defaultValue: "divider",
46
+ }),
47
+ topBorderRadius: createStaticNumberProp({
48
+ label: "Top border radius",
49
+ description: "Border radius of top corners",
50
+ defaultValue: 20,
51
+ required: false,
52
+ }),
53
+ borderWidth: createStaticNumberProp({
54
+ label: "Border width",
55
+ description: "Width of bottom sheet borders",
56
+ defaultValue: 1,
57
+ required: false,
58
+ }),
59
+ borderColor: createColorProp({
60
+ label: "Border color",
61
+ description: "Color of bottom sheet borders",
62
+ defaultValue: "divider",
63
+ }),
64
+ showsVerticalScrollIndicator: createStaticBoolProp({
65
+ label: "Show Vertical Scroll Indicator",
66
+ description:
67
+ "When true, shows a vertical scroll indicator. The default value is true.",
68
+ defaultValue: true,
69
+ }),
70
+ bounces: createStaticBoolProp({
71
+ label: "Bounce",
72
+ description:
73
+ "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
74
+ defaultValue: true,
75
+ }),
76
+ },
77
+ };
@@ -41,13 +41,13 @@ const SHARED_SEED_DATA_PROPS = {
41
41
  label: "Cell Vertical Padding",
42
42
  description: "Specifies the vertical padding of the cell. Passed down to TableCell components unless overridden",
43
43
  required: false,
44
- defaultValue: 10,
44
+ defaultValue: null,
45
45
  }),
46
46
  cellHorizontalPadding: createStaticNumberProp({
47
47
  label: "Cell Horizontal Padding",
48
48
  description: "Specifies the horizontal padding of the cell. Passed down to TableCell components unless overridden",
49
49
  required: false,
50
- defaultValue: 10,
50
+ defaultValue: null,
51
51
  }),
52
52
  };
53
53
  export const SEED_DATA = [
@@ -82,6 +82,19 @@ export const SEED_DATA = [
82
82
  ...SHARED_SEED_DATA_PROPS.drawTopBorder,
83
83
  defaultValue: true,
84
84
  },
85
+ cellVerticalPadding: {
86
+ ...SHARED_SEED_DATA_PROPS.cellVerticalPadding,
87
+ defaultValue: 10,
88
+ },
89
+ cellHorizontalPadding: {
90
+ ...SHARED_SEED_DATA_PROPS.cellHorizontalPadding,
91
+ defaultValue: 10,
92
+ },
93
+ showsVerticalScrollIndicator: createStaticBoolProp({
94
+ label: "Show Vertical Scroll Indicator",
95
+ description: "When true, shows a vertical scroll indicator. The default value is true.",
96
+ defaultValue: true,
97
+ }),
85
98
  },
86
99
  },
87
100
  {
@@ -57,14 +57,14 @@ const SHARED_SEED_DATA_PROPS = {
57
57
  description:
58
58
  "Specifies the vertical padding of the cell. Passed down to TableCell components unless overridden",
59
59
  required: false,
60
- defaultValue: 10,
60
+ defaultValue: null,
61
61
  }),
62
62
  cellHorizontalPadding: createStaticNumberProp({
63
63
  label: "Cell Horizontal Padding",
64
64
  description:
65
65
  "Specifies the horizontal padding of the cell. Passed down to TableCell components unless overridden",
66
66
  required: false,
67
- defaultValue: 10,
67
+ defaultValue: null,
68
68
  }),
69
69
  };
70
70
 
@@ -100,6 +100,20 @@ export const SEED_DATA = [
100
100
  ...SHARED_SEED_DATA_PROPS.drawTopBorder,
101
101
  defaultValue: true,
102
102
  },
103
+ cellVerticalPadding: {
104
+ ...SHARED_SEED_DATA_PROPS.cellVerticalPadding,
105
+ defaultValue: 10,
106
+ },
107
+ cellHorizontalPadding: {
108
+ ...SHARED_SEED_DATA_PROPS.cellHorizontalPadding,
109
+ defaultValue: 10,
110
+ },
111
+ showsVerticalScrollIndicator: createStaticBoolProp({
112
+ label: "Show Vertical Scroll Indicator",
113
+ description:
114
+ "When true, shows a vertical scroll indicator. The default value is true.",
115
+ defaultValue: true,
116
+ }),
103
117
  },
104
118
  },
105
119
  {
@@ -0,0 +1,37 @@
1
+ import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, createStaticBoolProp, createTextProp, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Youtube Player",
4
+ tag: "YoutubePlayer",
5
+ description: "Plays a youtube video form a Youtube video or playlist id",
6
+ doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
7
+ code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
8
+ category: COMPONENT_TYPES.media,
9
+ stylesPanelSections: BLOCK_STYLES_SECTIONS,
10
+ layout: {
11
+ height: 250,
12
+ },
13
+ props: {
14
+ videoId: createTextProp({
15
+ label: "Video ID",
16
+ description: "VideoId of the Youtube video.",
17
+ defaultValue: null,
18
+ }),
19
+ playlist: createTextProp({
20
+ label: "Playlist",
21
+ description: "Playlist of the Youtube videos.",
22
+ defaultValue: null,
23
+ }),
24
+ mute: createStaticBoolProp({
25
+ label: "Mute Audio",
26
+ description: "Mute the audio of the video.",
27
+ defaultValue: false,
28
+ required: false,
29
+ }),
30
+ autoplay: createStaticBoolProp({
31
+ label: "Auto Play",
32
+ description: "Autoplay the video on load.",
33
+ defaultValue: false,
34
+ required: false,
35
+ }),
36
+ },
37
+ };
@@ -0,0 +1,43 @@
1
+ import {
2
+ BLOCK_STYLES_SECTIONS,
3
+ COMPONENT_TYPES,
4
+ createStaticBoolProp,
5
+ createTextProp,
6
+ } from "@draftbit/types";
7
+
8
+ export const SEED_DATA = {
9
+ name: "Youtube Player",
10
+ tag: "YoutubePlayer",
11
+ description: "Plays a youtube video form a Youtube video or playlist id",
12
+ doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
13
+ code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
14
+ category: COMPONENT_TYPES.media,
15
+ stylesPanelSections: BLOCK_STYLES_SECTIONS,
16
+ layout: {
17
+ height: 250,
18
+ },
19
+ props: {
20
+ videoId: createTextProp({
21
+ label: "Video ID",
22
+ description: "VideoId of the Youtube video.",
23
+ defaultValue: null,
24
+ }),
25
+ playlist: createTextProp({
26
+ label: "Playlist",
27
+ description: "Playlist of the Youtube videos.",
28
+ defaultValue: null,
29
+ }),
30
+ mute: createStaticBoolProp({
31
+ label: "Mute Audio",
32
+ description: "Mute the audio of the video.",
33
+ defaultValue: false,
34
+ required: false,
35
+ }),
36
+ autoplay: createStaticBoolProp({
37
+ label: "Auto Play",
38
+ description: "Autoplay the video on load.",
39
+ defaultValue: false,
40
+ required: false,
41
+ }),
42
+ },
43
+ };