@draftbit/core 46.9.1-258aa2.2 → 46.9.1-2a60b8.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 (58) hide show
  1. package/lib/commonjs/components/Container.js +4 -15
  2. package/lib/commonjs/components/YotubePlayer.js +38 -0
  3. package/lib/commonjs/constants.js +1 -1
  4. package/lib/commonjs/index.js +7 -19
  5. package/lib/commonjs/mappings/YoutubePlayer.js +44 -0
  6. package/lib/module/components/Accordion/AccordionItem.js +25 -4
  7. package/lib/module/components/YotubePlayer.js +30 -0
  8. package/lib/module/index.js +1 -1
  9. package/lib/module/mappings/YoutubePlayer.js +37 -0
  10. package/lib/typescript/src/components/YotubePlayer.d.ts +12 -0
  11. package/lib/typescript/src/components/YotubePlayer.d.ts.map +1 -0
  12. package/lib/typescript/src/index.d.ts +1 -1
  13. package/lib/typescript/src/index.d.ts.map +1 -1
  14. package/lib/typescript/src/mappings/YoutubePlayer.d.ts +37 -0
  15. package/lib/typescript/src/mappings/YoutubePlayer.d.ts.map +1 -0
  16. package/package.json +6 -4
  17. package/src/components/YotubePlayer.js +10 -0
  18. package/src/components/YotubePlayer.tsx +38 -0
  19. package/src/index.js +1 -1
  20. package/src/index.tsx +1 -1
  21. package/src/mappings/YoutubePlayer.js +37 -0
  22. package/src/mappings/YoutubePlayer.ts +43 -0
  23. package/lib/commonjs/components/Table/Table.js +0 -91
  24. package/lib/commonjs/components/Table/TableCell.js +0 -49
  25. package/lib/commonjs/components/Table/TableCommon.js +0 -30
  26. package/lib/commonjs/components/Table/TableRow.js +0 -61
  27. package/lib/commonjs/components/Table/index.js +0 -27
  28. package/lib/commonjs/mappings/Table.js +0 -135
  29. package/lib/module/components/Table/Table.js +0 -83
  30. package/lib/module/components/Table/TableCell.js +0 -41
  31. package/lib/module/components/Table/TableCommon.js +0 -21
  32. package/lib/module/components/Table/TableRow.js +0 -53
  33. package/lib/module/components/Table/index.js +0 -3
  34. package/lib/module/mappings/Table.js +0 -128
  35. package/lib/typescript/src/components/Table/Table.d.ts +0 -19
  36. package/lib/typescript/src/components/Table/Table.d.ts.map +0 -1
  37. package/lib/typescript/src/components/Table/TableCell.d.ts +0 -9
  38. package/lib/typescript/src/components/Table/TableCell.d.ts.map +0 -1
  39. package/lib/typescript/src/components/Table/TableCommon.d.ts +0 -20
  40. package/lib/typescript/src/components/Table/TableCommon.d.ts.map +0 -1
  41. package/lib/typescript/src/components/Table/TableRow.d.ts +0 -14
  42. package/lib/typescript/src/components/Table/TableRow.d.ts.map +0 -1
  43. package/lib/typescript/src/components/Table/index.d.ts +0 -4
  44. package/lib/typescript/src/components/Table/index.d.ts.map +0 -1
  45. package/lib/typescript/src/mappings/Table.d.ts +0 -327
  46. package/lib/typescript/src/mappings/Table.d.ts.map +0 -1
  47. package/src/components/Table/Table.js +0 -64
  48. package/src/components/Table/Table.tsx +0 -136
  49. package/src/components/Table/TableCell.js +0 -31
  50. package/src/components/Table/TableCell.tsx +0 -63
  51. package/src/components/Table/TableCommon.js +0 -12
  52. package/src/components/Table/TableCommon.ts +0 -40
  53. package/src/components/Table/TableRow.js +0 -37
  54. package/src/components/Table/TableRow.tsx +0 -77
  55. package/src/components/Table/index.js +0 -3
  56. package/src/components/Table/index.tsx +0 -3
  57. package/src/mappings/Table.js +0 -145
  58. package/src/mappings/Table.ts +0 -164
@@ -1,40 +0,0 @@
1
- import React from "react";
2
- import { ViewStyle } from "react-native";
3
-
4
- type BorderStyle = "solid" | "dotted" | "dashed";
5
-
6
- export const TableStyleContext = React.createContext<TableStyleProps>({});
7
-
8
- export interface TableStyleProps {
9
- borderWidth?: number;
10
- borderColor?: string;
11
- borderStyle?: BorderStyle;
12
- cellVerticalPadding?: number;
13
- cellHorizontalPadding?: number;
14
- }
15
-
16
- export interface TableProps extends TableStyleProps {
17
- drawTopBorder?: boolean;
18
- drawBottomBorder?: boolean;
19
- drawStartBorder?: boolean;
20
- drawEndBorder?: boolean;
21
- }
22
-
23
- export function generateBorderStyles({
24
- borderColor,
25
- borderWidth,
26
- borderStyle,
27
- drawTopBorder,
28
- drawBottomBorder,
29
- drawStartBorder,
30
- drawEndBorder,
31
- }: TableProps): ViewStyle {
32
- return {
33
- borderColor,
34
- borderStyle,
35
- borderTopWidth: drawTopBorder ? borderWidth : 0,
36
- borderBottomWidth: drawBottomBorder ? borderWidth : 0,
37
- borderStartWidth: drawStartBorder ? borderWidth : 0,
38
- borderEndWidth: drawEndBorder ? borderWidth : 0,
39
- };
40
- }
@@ -1,37 +0,0 @@
1
- import React from "react";
2
- import { View, StyleSheet } from "react-native";
3
- import { generateBorderStyles, TableStyleContext, } from "./TableCommon";
4
- import { withTheme } from "../../theming";
5
- const TableRow = ({ borderWidth, borderColor, borderStyle, drawTopBorder = false, drawBottomBorder = true, drawStartBorder = true, drawEndBorder = false, cellVerticalPadding, cellHorizontalPadding, isTableHeader = false, children, style, theme, }) => {
6
- const parentContextValue = React.useContext(TableStyleContext);
7
- //Create context to use and pass to children based on own props or fall back to parent provided context
8
- const contextValue = {
9
- borderColor: borderColor || parentContextValue.borderColor,
10
- borderStyle: borderStyle || parentContextValue.borderStyle,
11
- borderWidth: borderWidth || parentContextValue.borderWidth,
12
- cellHorizontalPadding: cellHorizontalPadding || parentContextValue.cellHorizontalPadding,
13
- cellVerticalPadding: cellVerticalPadding || parentContextValue.cellVerticalPadding,
14
- };
15
- const borderViewStyle = generateBorderStyles({
16
- borderColor: contextValue.borderColor,
17
- borderWidth: contextValue.borderWidth,
18
- borderStyle: contextValue.borderStyle,
19
- drawTopBorder,
20
- drawBottomBorder,
21
- drawStartBorder,
22
- drawEndBorder,
23
- });
24
- return (React.createElement(TableStyleContext.Provider, { value: contextValue },
25
- React.createElement(View, { style: [
26
- borderViewStyle,
27
- isTableHeader ? { backgroundColor: theme.colors.primary } : {},
28
- style,
29
- styles.cellsContainer,
30
- ] }, children)));
31
- };
32
- const styles = StyleSheet.create({
33
- cellsContainer: {
34
- flexDirection: "row",
35
- },
36
- });
37
- export default withTheme(TableRow);
@@ -1,77 +0,0 @@
1
- import React from "react";
2
- import { View, StyleProp, ViewStyle, StyleSheet } from "react-native";
3
- import {
4
- generateBorderStyles,
5
- TableProps,
6
- TableStyleContext,
7
- TableStyleProps,
8
- } from "./TableCommon";
9
- import { Theme } from "../../styles/DefaultTheme";
10
- import { withTheme } from "../../theming";
11
-
12
- export interface Props extends TableProps {
13
- isTableHeader?: boolean;
14
- style?: StyleProp<ViewStyle>;
15
- theme: Theme;
16
- }
17
-
18
- const TableRow: React.FC<React.PropsWithChildren<Props>> = ({
19
- borderWidth,
20
- borderColor,
21
- borderStyle,
22
- drawTopBorder = false,
23
- drawBottomBorder = true,
24
- drawStartBorder = true,
25
- drawEndBorder = false,
26
- cellVerticalPadding,
27
- cellHorizontalPadding,
28
- isTableHeader = false,
29
- children,
30
- style,
31
- theme,
32
- }) => {
33
- const parentContextValue = React.useContext(TableStyleContext);
34
-
35
- //Create context to use and pass to children based on own props or fall back to parent provided context
36
- const contextValue: TableStyleProps = {
37
- borderColor: borderColor || parentContextValue.borderColor,
38
- borderStyle: borderStyle || parentContextValue.borderStyle,
39
- borderWidth: borderWidth || parentContextValue.borderWidth,
40
- cellHorizontalPadding:
41
- cellHorizontalPadding || parentContextValue.cellHorizontalPadding,
42
- cellVerticalPadding:
43
- cellVerticalPadding || parentContextValue.cellVerticalPadding,
44
- };
45
-
46
- const borderViewStyle = generateBorderStyles({
47
- borderColor: contextValue.borderColor,
48
- borderWidth: contextValue.borderWidth,
49
- borderStyle: contextValue.borderStyle,
50
- drawTopBorder,
51
- drawBottomBorder,
52
- drawStartBorder,
53
- drawEndBorder,
54
- });
55
- return (
56
- <TableStyleContext.Provider value={contextValue}>
57
- <View
58
- style={[
59
- borderViewStyle,
60
- isTableHeader ? { backgroundColor: theme.colors.primary } : {},
61
- style,
62
- styles.cellsContainer,
63
- ]}
64
- >
65
- {children}
66
- </View>
67
- </TableStyleContext.Provider>
68
- );
69
- };
70
-
71
- const styles = StyleSheet.create({
72
- cellsContainer: {
73
- flexDirection: "row",
74
- },
75
- });
76
-
77
- export default withTheme(TableRow);
@@ -1,3 +0,0 @@
1
- export { default as Table } from "./Table";
2
- export { default as TableRow } from "./TableRow";
3
- export { default as TableCell } from "./TableCell";
@@ -1,3 +0,0 @@
1
- export { default as Table } from "./Table";
2
- export { default as TableRow } from "./TableRow";
3
- export { default as TableCell } from "./TableCell";
@@ -1,145 +0,0 @@
1
- import { COMPONENT_TYPES, StylesPanelSections, createColorProp, createStaticBoolProp, createStaticNumberProp, createTextEnumProp, } from "@draftbit/types";
2
- const SHARED_SEED_DATA_PROPS = {
3
- borderWidth: createStaticNumberProp({
4
- label: "Border Width",
5
- description: "Specifies the width of the border. Passed down to child Table(Row/Cell) components unless overridden",
6
- required: false,
7
- defaultValue: null,
8
- }),
9
- borderColor: createColorProp({
10
- label: "Border Color",
11
- description: "Specifies the color of the border. Passed down to child Table(Row/Cell) components unless overridden",
12
- defaultValue: null,
13
- }),
14
- borderStyle: createTextEnumProp({
15
- label: "Border Style",
16
- description: "Specifies the style of the border. Passed down to child Table(Row/Cell) components unless overridden",
17
- options: ["solid", "dotted", "dashed"],
18
- defaultValue: null,
19
- }),
20
- drawTopBorder: createStaticBoolProp({
21
- label: "Draw Top Border",
22
- description: "Whether to draw the top border at this layer of the Table tree or not",
23
- defaultValue: false,
24
- }),
25
- drawBottomBorder: createStaticBoolProp({
26
- label: "Draw Bottom Border",
27
- description: "Whether to draw the bottom border at this layer of the Table tree or not",
28
- defaultValue: false,
29
- }),
30
- drawStartBorder: createStaticBoolProp({
31
- label: "Draw Start Border",
32
- description: "Whether to draw the start border at this layer of the Table tree or not",
33
- defaultValue: false,
34
- }),
35
- drawEndBorder: createStaticBoolProp({
36
- label: "Draw End Border",
37
- description: "Whether to draw the end border at this layer of the Table tree or not",
38
- defaultValue: false,
39
- }),
40
- cellVerticalPadding: createStaticNumberProp({
41
- label: "Cell Vertical Padding",
42
- description: "Specifies the vertical padding of the cell. Passed down to TableCell components unless overridden",
43
- required: false,
44
- defaultValue: null,
45
- }),
46
- cellHorizontalPadding: createStaticNumberProp({
47
- label: "Cell Horizontal Padding",
48
- description: "Specifies the horizontal padding of the cell. Passed down to TableCell components unless overridden",
49
- required: false,
50
- defaultValue: null,
51
- }),
52
- };
53
- export const SEED_DATA = [
54
- {
55
- name: "Table",
56
- tag: "Table",
57
- description: "Top level table container",
58
- category: COMPONENT_TYPES.table,
59
- stylesPanelSections: [
60
- StylesPanelSections.Size,
61
- StylesPanelSections.Margins,
62
- StylesPanelSections.Position,
63
- StylesPanelSections.Effects,
64
- StylesPanelSections.Background,
65
- StylesPanelSections.LayoutSelectedItem,
66
- ],
67
- layout: {
68
- flex: 1,
69
- },
70
- props: {
71
- ...SHARED_SEED_DATA_PROPS,
72
- borderWidth: { ...SHARED_SEED_DATA_PROPS.borderWidth, defaultValue: 1 },
73
- borderColor: {
74
- ...SHARED_SEED_DATA_PROPS.borderColor,
75
- defaultValue: "divider",
76
- },
77
- borderStyle: {
78
- ...SHARED_SEED_DATA_PROPS.borderStyle,
79
- defaultValue: "solid",
80
- },
81
- drawTopBorder: {
82
- ...SHARED_SEED_DATA_PROPS.drawTopBorder,
83
- defaultValue: true,
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
- },
94
- },
95
- {
96
- name: "Table Row",
97
- tag: "TableRow",
98
- description: "Table Row container",
99
- category: COMPONENT_TYPES.table,
100
- stylesPanelSections: [StylesPanelSections.Background],
101
- props: {
102
- ...SHARED_SEED_DATA_PROPS,
103
- drawStartBorder: {
104
- ...SHARED_SEED_DATA_PROPS.drawStartBorder,
105
- defaultValue: true,
106
- },
107
- drawBottomBorder: {
108
- ...SHARED_SEED_DATA_PROPS.drawBottomBorder,
109
- defaultValue: true,
110
- },
111
- isTableHeader: createStaticBoolProp({
112
- label: "Header",
113
- description: "Whether this row is a header or not (changes background and sticks while scrolling)",
114
- defaultValue: false,
115
- }),
116
- },
117
- },
118
- {
119
- name: "Table Cell",
120
- tag: "TableCell",
121
- description: "Table Cell container",
122
- category: COMPONENT_TYPES.table,
123
- stylesPanelSections: [
124
- StylesPanelSections.LayoutFlexItems,
125
- StylesPanelSections.LayoutSelectedItem,
126
- StylesPanelSections.LayoutContent,
127
- StylesPanelSections.Background,
128
- StylesPanelSections.Size,
129
- StylesPanelSections.MarginsAndPaddings,
130
- StylesPanelSections.Position,
131
- StylesPanelSections.Effects,
132
- ],
133
- layout: {
134
- flex: 1,
135
- flexDirection: "row",
136
- },
137
- props: {
138
- ...SHARED_SEED_DATA_PROPS,
139
- drawEndBorder: {
140
- ...SHARED_SEED_DATA_PROPS.drawEndBorder,
141
- defaultValue: true,
142
- },
143
- },
144
- },
145
- ];
@@ -1,164 +0,0 @@
1
- import {
2
- COMPONENT_TYPES,
3
- StylesPanelSections,
4
- createColorProp,
5
- createStaticBoolProp,
6
- createStaticNumberProp,
7
- createTextEnumProp,
8
- } from "@draftbit/types";
9
-
10
- const SHARED_SEED_DATA_PROPS = {
11
- borderWidth: createStaticNumberProp({
12
- label: "Border Width",
13
- description:
14
- "Specifies the width of the border. Passed down to child Table(Row/Cell) components unless overridden",
15
- required: false,
16
- defaultValue: null,
17
- }),
18
- borderColor: createColorProp({
19
- label: "Border Color",
20
- description:
21
- "Specifies the color of the border. Passed down to child Table(Row/Cell) components unless overridden",
22
- defaultValue: null,
23
- }),
24
- borderStyle: createTextEnumProp({
25
- label: "Border Style",
26
- description:
27
- "Specifies the style of the border. Passed down to child Table(Row/Cell) components unless overridden",
28
- options: ["solid", "dotted", "dashed"],
29
- defaultValue: null,
30
- }),
31
- drawTopBorder: createStaticBoolProp({
32
- label: "Draw Top Border",
33
- description:
34
- "Whether to draw the top border at this layer of the Table tree or not",
35
- defaultValue: false,
36
- }),
37
- drawBottomBorder: createStaticBoolProp({
38
- label: "Draw Bottom Border",
39
- description:
40
- "Whether to draw the bottom border at this layer of the Table tree or not",
41
- defaultValue: false,
42
- }),
43
- drawStartBorder: createStaticBoolProp({
44
- label: "Draw Start Border",
45
- description:
46
- "Whether to draw the start border at this layer of the Table tree or not",
47
- defaultValue: false,
48
- }),
49
- drawEndBorder: createStaticBoolProp({
50
- label: "Draw End Border",
51
- description:
52
- "Whether to draw the end border at this layer of the Table tree or not",
53
- defaultValue: false,
54
- }),
55
- cellVerticalPadding: createStaticNumberProp({
56
- label: "Cell Vertical Padding",
57
- description:
58
- "Specifies the vertical padding of the cell. Passed down to TableCell components unless overridden",
59
- required: false,
60
- defaultValue: null,
61
- }),
62
- cellHorizontalPadding: createStaticNumberProp({
63
- label: "Cell Horizontal Padding",
64
- description:
65
- "Specifies the horizontal padding of the cell. Passed down to TableCell components unless overridden",
66
- required: false,
67
- defaultValue: null,
68
- }),
69
- };
70
-
71
- export const SEED_DATA = [
72
- {
73
- name: "Table",
74
- tag: "Table",
75
- description: "Top level table container",
76
- category: COMPONENT_TYPES.table,
77
- stylesPanelSections: [
78
- StylesPanelSections.Size,
79
- StylesPanelSections.Margins,
80
- StylesPanelSections.Position,
81
- StylesPanelSections.Effects,
82
- StylesPanelSections.Background,
83
- StylesPanelSections.LayoutSelectedItem,
84
- ],
85
- layout: {
86
- flex: 1,
87
- },
88
- props: {
89
- ...SHARED_SEED_DATA_PROPS,
90
- borderWidth: { ...SHARED_SEED_DATA_PROPS.borderWidth, defaultValue: 1 },
91
- borderColor: {
92
- ...SHARED_SEED_DATA_PROPS.borderColor,
93
- defaultValue: "divider",
94
- },
95
- borderStyle: {
96
- ...SHARED_SEED_DATA_PROPS.borderStyle,
97
- defaultValue: "solid",
98
- },
99
- drawTopBorder: {
100
- ...SHARED_SEED_DATA_PROPS.drawTopBorder,
101
- defaultValue: true,
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
- },
112
- },
113
- {
114
- name: "Table Row",
115
- tag: "TableRow",
116
- description: "Table Row container",
117
- category: COMPONENT_TYPES.table,
118
- stylesPanelSections: [StylesPanelSections.Background],
119
- props: {
120
- ...SHARED_SEED_DATA_PROPS,
121
- drawStartBorder: {
122
- ...SHARED_SEED_DATA_PROPS.drawStartBorder,
123
- defaultValue: true,
124
- },
125
- drawBottomBorder: {
126
- ...SHARED_SEED_DATA_PROPS.drawBottomBorder,
127
- defaultValue: true,
128
- },
129
- isTableHeader: createStaticBoolProp({
130
- label: "Header",
131
- description:
132
- "Whether this row is a header or not (changes background and sticks while scrolling)",
133
- defaultValue: false,
134
- }),
135
- },
136
- },
137
- {
138
- name: "Table Cell",
139
- tag: "TableCell",
140
- description: "Table Cell container",
141
- category: COMPONENT_TYPES.table,
142
- stylesPanelSections: [
143
- StylesPanelSections.LayoutFlexItems,
144
- StylesPanelSections.LayoutSelectedItem,
145
- StylesPanelSections.LayoutContent,
146
- StylesPanelSections.Background,
147
- StylesPanelSections.Size,
148
- StylesPanelSections.MarginsAndPaddings,
149
- StylesPanelSections.Position,
150
- StylesPanelSections.Effects,
151
- ],
152
- layout: {
153
- flex: 1,
154
- flexDirection: "row",
155
- },
156
- props: {
157
- ...SHARED_SEED_DATA_PROPS,
158
- drawEndBorder: {
159
- ...SHARED_SEED_DATA_PROPS.drawEndBorder,
160
- defaultValue: true,
161
- },
162
- },
163
- },
164
- ];