@draftbit/core 46.8.2-fee87c.2 → 46.9.1-1cf4d4.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.
- package/lib/commonjs/components/Markdown.js +30 -0
- package/lib/commonjs/components/Shadow.js +46 -0
- package/lib/commonjs/components/TabView/TabView.js +22 -6
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/mappings/FlashList.js +2 -8
- package/lib/commonjs/mappings/Markdown.js +27 -0
- package/lib/commonjs/mappings/Shadow.js +102 -0
- package/lib/commonjs/mappings/TabView.js +6 -5
- package/lib/commonjs/mappings/TabViewItem.js +5 -3
- package/lib/module/components/Markdown.js +20 -0
- package/lib/module/components/Shadow.js +38 -0
- package/lib/module/components/TabView/TabView.js +22 -5
- package/lib/module/index.js +2 -0
- package/lib/module/mappings/FlashList.js +3 -9
- package/lib/module/mappings/Markdown.js +20 -0
- package/lib/module/mappings/Shadow.js +95 -0
- package/lib/module/mappings/TabView.js +7 -6
- package/lib/module/mappings/TabViewItem.js +6 -4
- package/lib/typescript/src/components/Markdown.d.ts +8 -0
- package/lib/typescript/src/components/Markdown.d.ts.map +1 -0
- package/lib/typescript/src/components/Shadow.d.ts +24 -0
- package/lib/typescript/src/components/Shadow.d.ts.map +1 -0
- package/lib/typescript/src/components/TabView/TabView.d.ts.map +1 -1
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +1 -1
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlashList.d.ts +0 -6
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Markdown.d.ts +20 -0
- package/lib/typescript/src/mappings/Markdown.d.ts.map +1 -0
- package/lib/typescript/src/mappings/Shadow.d.ts +173 -0
- package/lib/typescript/src/mappings/Shadow.d.ts.map +1 -0
- package/lib/typescript/src/mappings/TabView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/TabViewItem.d.ts.map +1 -1
- package/package.json +5 -3
- package/src/components/Markdown.js +10 -0
- package/src/components/Markdown.tsx +22 -0
- package/src/components/Shadow.js +16 -0
- package/src/components/Shadow.tsx +62 -0
- package/src/components/TabView/TabView.js +16 -7
- package/src/components/TabView/TabView.tsx +25 -7
- package/src/components/TabView/TabViewItem.tsx +1 -1
- package/src/index.js +2 -0
- package/src/index.tsx +3 -0
- package/src/mappings/FlashList.js +9 -9
- package/src/mappings/FlashList.ts +9 -9
- package/src/mappings/Markdown.js +25 -0
- package/src/mappings/Markdown.ts +32 -0
- package/src/mappings/Shadow.js +95 -0
- package/src/mappings/Shadow.ts +104 -0
- package/src/mappings/TabView.js +11 -5
- package/src/mappings/TabView.ts +11 -5
- package/src/mappings/TabViewItem.js +4 -2
- package/src/mappings/TabViewItem.ts +4 -1
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { TabView, TabBar, SceneMap, } from "react-native-tab-view";
|
|
3
|
-
import TabViewItem from "./TabViewItem";
|
|
4
3
|
import { withTheme } from "../../theming";
|
|
4
|
+
import { extractStyles } from "../../utilities";
|
|
5
5
|
const TabViewComponent = ({ Icon, onIndexChanged, onEndReached, tabBarPosition, keyboardDismissMode, swipeEnabled, scrollEnabled, activeColor, inactiveColor, pressColor, indicatorColor, tabsBackgroundColor, style, theme, children, }) => {
|
|
6
6
|
const [index, setIndex] = React.useState(0);
|
|
7
7
|
const [routes, setRoutes] = React.useState([]);
|
|
8
8
|
const [tabScenes, setTabScenes] = React.useState({});
|
|
9
|
+
const { textStyles, viewStyles } = extractStyles(style);
|
|
10
|
+
//Check type of child using props
|
|
11
|
+
//Regular '.type' cannot work because Draftbit strips the type in Draft view
|
|
12
|
+
const instanceOfTabViewItemProps = (object) => {
|
|
13
|
+
return "title" in object;
|
|
14
|
+
};
|
|
9
15
|
//Populate routes and scenes based on children
|
|
10
16
|
React.useEffect(() => {
|
|
11
17
|
const newRoutes = [];
|
|
12
18
|
const scenes = {};
|
|
13
19
|
React.Children.toArray(children)
|
|
14
|
-
.filter((child) => React.isValidElement(child) && child.
|
|
20
|
+
.filter((child) => React.isValidElement(child) && instanceOfTabViewItemProps(child.props))
|
|
15
21
|
.forEach((item, idx) => {
|
|
16
22
|
const child = item;
|
|
17
23
|
newRoutes.push({
|
|
@@ -35,11 +41,14 @@ const TabViewComponent = ({ Icon, onIndexChanged, onEndReached, tabBarPosition,
|
|
|
35
41
|
const renderTabBar = (props) => {
|
|
36
42
|
return (React.createElement(TabBar, { ...props, activeColor: activeColor || theme.colors.primary, inactiveColor: inactiveColor || theme.colors.divider, pressColor: pressColor || theme.colors.primary, scrollEnabled: scrollEnabled, indicatorStyle: {
|
|
37
43
|
backgroundColor: indicatorColor || theme.colors.primary,
|
|
38
|
-
}, renderIcon: ({ route, color }) => (route === null || route === void 0 ? void 0 : route.icon) ? (React.createElement(Icon, { name: route.icon, color: color, size:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
] }));
|
|
44
|
+
}, labelStyle: textStyles, renderIcon: ({ route, color }) => (route === null || route === void 0 ? void 0 : route.icon) ? (React.createElement(Icon, { name: route.icon, color: color, size: 16 })) : null, style: {
|
|
45
|
+
backgroundColor: tabsBackgroundColor || theme.colors.background,
|
|
46
|
+
} }));
|
|
42
47
|
};
|
|
43
|
-
|
|
48
|
+
//Cannot render TabView without at least one tab
|
|
49
|
+
if (!routes.length) {
|
|
50
|
+
return React.createElement(React.Fragment, null);
|
|
51
|
+
}
|
|
52
|
+
return (React.createElement(TabView, { style: [viewStyles], navigationState: { index, routes }, renderScene: SceneMap(tabScenes), renderTabBar: renderTabBar, onIndexChange: indexChangeHandler, tabBarPosition: tabBarPosition, keyboardDismissMode: keyboardDismissMode, swipeEnabled: swipeEnabled }));
|
|
44
53
|
};
|
|
45
54
|
export default withTheme(TabViewComponent);
|
|
@@ -9,10 +9,11 @@ import {
|
|
|
9
9
|
Route,
|
|
10
10
|
} from "react-native-tab-view";
|
|
11
11
|
|
|
12
|
-
import
|
|
12
|
+
import { TabViewItemProps } from "./TabViewItem";
|
|
13
13
|
import type { IconSlot } from "../../interfaces/Icon";
|
|
14
14
|
import { withTheme } from "../../theming";
|
|
15
15
|
import type { Theme } from "../../styles/DefaultTheme";
|
|
16
|
+
import { extractStyles } from "../../utilities";
|
|
16
17
|
|
|
17
18
|
type TabBarProps = SceneRendererProps & {
|
|
18
19
|
navigationState: NavigationState<any>;
|
|
@@ -57,6 +58,16 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
|
|
|
57
58
|
const [routes, setRoutes] = React.useState<Route[]>([]);
|
|
58
59
|
const [tabScenes, setTabScenes] = React.useState({});
|
|
59
60
|
|
|
61
|
+
const { textStyles, viewStyles } = extractStyles(style);
|
|
62
|
+
|
|
63
|
+
//Check type of child using props
|
|
64
|
+
//Regular '.type' cannot work because Draftbit strips the type in Draft view
|
|
65
|
+
const instanceOfTabViewItemProps = (
|
|
66
|
+
object: any
|
|
67
|
+
): object is TabViewItemProps => {
|
|
68
|
+
return "title" in object;
|
|
69
|
+
};
|
|
70
|
+
|
|
60
71
|
//Populate routes and scenes based on children
|
|
61
72
|
React.useEffect(() => {
|
|
62
73
|
const newRoutes: Route[] = [];
|
|
@@ -64,7 +75,8 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
|
|
|
64
75
|
|
|
65
76
|
React.Children.toArray(children)
|
|
66
77
|
.filter(
|
|
67
|
-
(child) =>
|
|
78
|
+
(child) =>
|
|
79
|
+
React.isValidElement(child) && instanceOfTabViewItemProps(child.props)
|
|
68
80
|
)
|
|
69
81
|
.forEach((item: any, idx) => {
|
|
70
82
|
const child = item as React.ReactElement;
|
|
@@ -100,21 +112,27 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
|
|
|
100
112
|
indicatorStyle={{
|
|
101
113
|
backgroundColor: indicatorColor || theme.colors.primary,
|
|
102
114
|
}}
|
|
115
|
+
labelStyle={textStyles}
|
|
103
116
|
renderIcon={({ route, color }) =>
|
|
104
117
|
route?.icon ? (
|
|
105
|
-
<Icon name={route.icon} color={color} size={
|
|
118
|
+
<Icon name={route.icon} color={color} size={16} />
|
|
106
119
|
) : null
|
|
107
120
|
}
|
|
108
|
-
style={
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
]}
|
|
121
|
+
style={{
|
|
122
|
+
backgroundColor: tabsBackgroundColor || theme.colors.background,
|
|
123
|
+
}}
|
|
112
124
|
/>
|
|
113
125
|
);
|
|
114
126
|
};
|
|
115
127
|
|
|
128
|
+
//Cannot render TabView without at least one tab
|
|
129
|
+
if (!routes.length) {
|
|
130
|
+
return <></>;
|
|
131
|
+
}
|
|
132
|
+
|
|
116
133
|
return (
|
|
117
134
|
<TabView
|
|
135
|
+
style={[viewStyles]}
|
|
118
136
|
navigationState={{ index, routes }}
|
|
119
137
|
renderScene={SceneMap(tabScenes)}
|
|
120
138
|
renderTabBar={renderTabBar}
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { StyleProp, ViewStyle, StyleSheet, View } from "react-native";
|
|
3
3
|
|
|
4
4
|
//Props used by parent (TabView) to create tabs
|
|
5
|
-
interface TabViewItemProps {
|
|
5
|
+
export interface TabViewItemProps {
|
|
6
6
|
title: string;
|
|
7
7
|
icon?: string;
|
|
8
8
|
accessibilityLabel?: string;
|
package/src/index.js
CHANGED
|
@@ -31,8 +31,10 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
|
+
export { default as Shadow } from "./components/Shadow";
|
|
34
35
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
36
|
export { TabView, TabViewItem } from "./components/TabView";
|
|
37
|
+
export { default as Markdown } from "./components/Markdown";
|
|
36
38
|
/* Deprecated: Fix or Delete! */
|
|
37
39
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
38
40
|
export { default as Picker } from "./components/Picker/Picker";
|
package/src/index.tsx
CHANGED
|
@@ -51,9 +51,12 @@ export {
|
|
|
51
51
|
RadioButtonFieldGroup,
|
|
52
52
|
} from "./components/RadioButton/index";
|
|
53
53
|
|
|
54
|
+
export { default as Shadow } from "./components/Shadow";
|
|
55
|
+
|
|
54
56
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
55
57
|
|
|
56
58
|
export { TabView, TabViewItem } from "./components/TabView";
|
|
59
|
+
export { default as Markdown } from "./components/Markdown";
|
|
57
60
|
|
|
58
61
|
/* Deprecated: Fix or Delete! */
|
|
59
62
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp,
|
|
1
|
+
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, GROUPS, Triggers, createActionProp, createStaticNumberProp, createColorProp, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = [
|
|
3
3
|
{
|
|
4
4
|
name: "Masonry List",
|
|
@@ -6,10 +6,10 @@ export const SEED_DATA = [
|
|
|
6
6
|
description: "Masonry Flashlist by Shopify",
|
|
7
7
|
packageName: "@shopify/flash-list",
|
|
8
8
|
category: COMPONENT_TYPES.data,
|
|
9
|
-
stylesPanelSections:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
stylesPanelSections: [
|
|
10
|
+
StylesPanelSections.Background,
|
|
11
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
12
|
+
],
|
|
13
13
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
14
14
|
props: {
|
|
15
15
|
onRefresh: createActionProp(),
|
|
@@ -57,10 +57,10 @@ export const SEED_DATA = [
|
|
|
57
57
|
description: "Flashlist by Shopify",
|
|
58
58
|
packageName: "@shopify/flash-list",
|
|
59
59
|
category: COMPONENT_TYPES.data,
|
|
60
|
-
stylesPanelSections:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
stylesPanelSections: [
|
|
61
|
+
StylesPanelSections.Background,
|
|
62
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
63
|
+
],
|
|
64
64
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
65
65
|
props: {
|
|
66
66
|
onRefresh: createActionProp(),
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
createNumColumnsType,
|
|
4
4
|
createStaticBoolProp,
|
|
5
5
|
createNumberProp,
|
|
6
|
-
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
7
6
|
GROUPS,
|
|
8
7
|
Triggers,
|
|
9
8
|
createActionProp,
|
|
10
9
|
createStaticNumberProp,
|
|
11
10
|
createColorProp,
|
|
11
|
+
StylesPanelSections,
|
|
12
12
|
} from "@draftbit/types";
|
|
13
13
|
|
|
14
14
|
export const SEED_DATA = [
|
|
@@ -18,10 +18,10 @@ export const SEED_DATA = [
|
|
|
18
18
|
description: "Masonry Flashlist by Shopify",
|
|
19
19
|
packageName: "@shopify/flash-list",
|
|
20
20
|
category: COMPONENT_TYPES.data,
|
|
21
|
-
stylesPanelSections:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
stylesPanelSections: [
|
|
22
|
+
StylesPanelSections.Background,
|
|
23
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
24
|
+
],
|
|
25
25
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
26
26
|
props: {
|
|
27
27
|
onRefresh: createActionProp(),
|
|
@@ -72,10 +72,10 @@ export const SEED_DATA = [
|
|
|
72
72
|
description: "Flashlist by Shopify",
|
|
73
73
|
packageName: "@shopify/flash-list",
|
|
74
74
|
category: COMPONENT_TYPES.data,
|
|
75
|
-
stylesPanelSections:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
stylesPanelSections: [
|
|
76
|
+
StylesPanelSections.Background,
|
|
77
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
78
|
+
],
|
|
79
79
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
80
80
|
props: {
|
|
81
81
|
onRefresh: createActionProp(),
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, FORM_TYPES, GROUPS, PROP_TYPES, StylesPanelSections, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Markdown",
|
|
4
|
+
tag: "Markdown",
|
|
5
|
+
description: "A component that renders markdown",
|
|
6
|
+
category: COMPONENT_TYPES.text,
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.Typography,
|
|
9
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
10
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
11
|
+
StylesPanelSections.Effects,
|
|
12
|
+
],
|
|
13
|
+
props: {
|
|
14
|
+
children: {
|
|
15
|
+
group: GROUPS.data,
|
|
16
|
+
label: "Markdown Text",
|
|
17
|
+
description: "Markdown text to be rendered ",
|
|
18
|
+
editable: true,
|
|
19
|
+
required: true,
|
|
20
|
+
formType: FORM_TYPES.string,
|
|
21
|
+
propType: PROP_TYPES.STRING,
|
|
22
|
+
defaultValue: "### Markdown",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
FORM_TYPES,
|
|
4
|
+
GROUPS,
|
|
5
|
+
PROP_TYPES,
|
|
6
|
+
StylesPanelSections,
|
|
7
|
+
} from "@draftbit/types";
|
|
8
|
+
|
|
9
|
+
export const SEED_DATA = {
|
|
10
|
+
name: "Markdown",
|
|
11
|
+
tag: "Markdown",
|
|
12
|
+
description: "A component that renders markdown",
|
|
13
|
+
category: COMPONENT_TYPES.text,
|
|
14
|
+
stylesPanelSections: [
|
|
15
|
+
StylesPanelSections.Typography,
|
|
16
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
17
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
18
|
+
StylesPanelSections.Effects,
|
|
19
|
+
],
|
|
20
|
+
props: {
|
|
21
|
+
children: {
|
|
22
|
+
group: GROUPS.data,
|
|
23
|
+
label: "Markdown Text",
|
|
24
|
+
description: "Markdown text to be rendered ",
|
|
25
|
+
editable: true,
|
|
26
|
+
required: true,
|
|
27
|
+
formType: FORM_TYPES.string,
|
|
28
|
+
propType: PROP_TYPES.STRING,
|
|
29
|
+
defaultValue: "### Markdown",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, CONTAINER_COMPONENT_STYLES_SECTIONS, createColorProp, createStaticNumberProp, createStaticBoolProp, createDisabledProp, GROUPS, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Shadow",
|
|
4
|
+
tag: "Shadow",
|
|
5
|
+
description: "A cross-platform, universal shadow.",
|
|
6
|
+
category: COMPONENT_TYPES.view,
|
|
7
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
+
props: {
|
|
9
|
+
disabled: createDisabledProp({
|
|
10
|
+
description: "Disables the shadow.",
|
|
11
|
+
}),
|
|
12
|
+
startColor: createColorProp({
|
|
13
|
+
label: "Start Color",
|
|
14
|
+
description: "The initial gradient color of the shadow.",
|
|
15
|
+
defaultValue: null,
|
|
16
|
+
}),
|
|
17
|
+
endColor: createColorProp({
|
|
18
|
+
label: "End Color",
|
|
19
|
+
description: "The final gradient color of the shadow.",
|
|
20
|
+
defaultValue: null,
|
|
21
|
+
}),
|
|
22
|
+
distance: createStaticNumberProp({
|
|
23
|
+
label: "Distance",
|
|
24
|
+
description: "The distance of the shadow.",
|
|
25
|
+
}),
|
|
26
|
+
paintInside: createStaticBoolProp({
|
|
27
|
+
label: "Paint Inside",
|
|
28
|
+
description: "Apply the shadow below/inside the content.",
|
|
29
|
+
defaultValue: false,
|
|
30
|
+
}),
|
|
31
|
+
stretch: createStaticBoolProp({
|
|
32
|
+
label: "Stretch",
|
|
33
|
+
description: "Force children to occupy all available horizontal space.",
|
|
34
|
+
defaultValue: null,
|
|
35
|
+
}),
|
|
36
|
+
offsetX: createStaticNumberProp({
|
|
37
|
+
label: "Offset X",
|
|
38
|
+
description: "Moves the shadow in the x direction",
|
|
39
|
+
defeaultValue: 0,
|
|
40
|
+
}),
|
|
41
|
+
offsetY: createStaticNumberProp({
|
|
42
|
+
label: "Offset Y",
|
|
43
|
+
description: "Moves the shadow in the y direction",
|
|
44
|
+
defeaultValue: 0,
|
|
45
|
+
}),
|
|
46
|
+
showShadowSideStart: createStaticBoolProp({
|
|
47
|
+
label: "Show Shadow Start",
|
|
48
|
+
description: "Whether to show shadow on the start side or not",
|
|
49
|
+
defaultValue: true,
|
|
50
|
+
group: GROUPS.advanced,
|
|
51
|
+
}),
|
|
52
|
+
showShadowSideEnd: createStaticBoolProp({
|
|
53
|
+
label: "Show Shadow End",
|
|
54
|
+
description: "Whether to show shadow on the end side or not",
|
|
55
|
+
defaultValue: true,
|
|
56
|
+
group: GROUPS.advanced,
|
|
57
|
+
}),
|
|
58
|
+
showShadowSideTop: createStaticBoolProp({
|
|
59
|
+
label: "Show Shadow Top",
|
|
60
|
+
description: "Whether to show shadow on the top side or not",
|
|
61
|
+
defaultValue: true,
|
|
62
|
+
group: GROUPS.advanced,
|
|
63
|
+
}),
|
|
64
|
+
showShadowSideBottom: createStaticBoolProp({
|
|
65
|
+
label: "Show Shadow Bottom",
|
|
66
|
+
description: "Whether to show shadow on the bottom side or not",
|
|
67
|
+
defaultValue: true,
|
|
68
|
+
group: GROUPS.advanced,
|
|
69
|
+
}),
|
|
70
|
+
showShadowCornerTopStart: createStaticBoolProp({
|
|
71
|
+
label: "Show Shadow Top Start Corner",
|
|
72
|
+
description: "Whether to show shadow on the top start corner or not",
|
|
73
|
+
defaultValue: true,
|
|
74
|
+
group: GROUPS.advanced,
|
|
75
|
+
}),
|
|
76
|
+
showShadowCornerTopEnd: createStaticBoolProp({
|
|
77
|
+
label: "Show Shadow Top End Corner",
|
|
78
|
+
description: "Whether to show shadow on the top end corner or not",
|
|
79
|
+
defaultValue: true,
|
|
80
|
+
group: GROUPS.advanced,
|
|
81
|
+
}),
|
|
82
|
+
showShadowCornerBottomStart: createStaticBoolProp({
|
|
83
|
+
label: "Show Shadow Bottom Start Corner",
|
|
84
|
+
description: "Whether to show shadow on the bottom start corner or not",
|
|
85
|
+
defaultValue: true,
|
|
86
|
+
group: GROUPS.advanced,
|
|
87
|
+
}),
|
|
88
|
+
showShadowCornerBottomEnd: createStaticBoolProp({
|
|
89
|
+
label: "Show Shadow Bottom End Corner",
|
|
90
|
+
description: "Whether to show shadow on the bottom end corner or not",
|
|
91
|
+
defaultValue: true,
|
|
92
|
+
group: GROUPS.advanced,
|
|
93
|
+
}),
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
4
|
+
createColorProp,
|
|
5
|
+
createStaticNumberProp,
|
|
6
|
+
createStaticBoolProp,
|
|
7
|
+
createDisabledProp,
|
|
8
|
+
GROUPS,
|
|
9
|
+
} from "@draftbit/types";
|
|
10
|
+
|
|
11
|
+
export const SEED_DATA = {
|
|
12
|
+
name: "Shadow",
|
|
13
|
+
tag: "Shadow",
|
|
14
|
+
description: "A cross-platform, universal shadow.",
|
|
15
|
+
category: COMPONENT_TYPES.view,
|
|
16
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
17
|
+
props: {
|
|
18
|
+
disabled: createDisabledProp({
|
|
19
|
+
description: "Disables the shadow.",
|
|
20
|
+
}),
|
|
21
|
+
startColor: createColorProp({
|
|
22
|
+
label: "Start Color",
|
|
23
|
+
description: "The initial gradient color of the shadow.",
|
|
24
|
+
defaultValue: null,
|
|
25
|
+
}),
|
|
26
|
+
endColor: createColorProp({
|
|
27
|
+
label: "End Color",
|
|
28
|
+
description: "The final gradient color of the shadow.",
|
|
29
|
+
defaultValue: null,
|
|
30
|
+
}),
|
|
31
|
+
distance: createStaticNumberProp({
|
|
32
|
+
label: "Distance",
|
|
33
|
+
description: "The distance of the shadow.",
|
|
34
|
+
}),
|
|
35
|
+
paintInside: createStaticBoolProp({
|
|
36
|
+
label: "Paint Inside",
|
|
37
|
+
description: "Apply the shadow below/inside the content.",
|
|
38
|
+
defaultValue: false,
|
|
39
|
+
}),
|
|
40
|
+
stretch: createStaticBoolProp({
|
|
41
|
+
label: "Stretch",
|
|
42
|
+
description: "Force children to occupy all available horizontal space.",
|
|
43
|
+
defaultValue: null,
|
|
44
|
+
}),
|
|
45
|
+
offsetX: createStaticNumberProp({
|
|
46
|
+
label: "Offset X",
|
|
47
|
+
description: "Moves the shadow in the x direction",
|
|
48
|
+
defeaultValue: 0,
|
|
49
|
+
}),
|
|
50
|
+
offsetY: createStaticNumberProp({
|
|
51
|
+
label: "Offset Y",
|
|
52
|
+
description: "Moves the shadow in the y direction",
|
|
53
|
+
defeaultValue: 0,
|
|
54
|
+
}),
|
|
55
|
+
showShadowSideStart: createStaticBoolProp({
|
|
56
|
+
label: "Show Shadow Start",
|
|
57
|
+
description: "Whether to show shadow on the start side or not",
|
|
58
|
+
defaultValue: true,
|
|
59
|
+
group: GROUPS.advanced,
|
|
60
|
+
}),
|
|
61
|
+
showShadowSideEnd: createStaticBoolProp({
|
|
62
|
+
label: "Show Shadow End",
|
|
63
|
+
description: "Whether to show shadow on the end side or not",
|
|
64
|
+
defaultValue: true,
|
|
65
|
+
group: GROUPS.advanced,
|
|
66
|
+
}),
|
|
67
|
+
showShadowSideTop: createStaticBoolProp({
|
|
68
|
+
label: "Show Shadow Top",
|
|
69
|
+
description: "Whether to show shadow on the top side or not",
|
|
70
|
+
defaultValue: true,
|
|
71
|
+
group: GROUPS.advanced,
|
|
72
|
+
}),
|
|
73
|
+
showShadowSideBottom: createStaticBoolProp({
|
|
74
|
+
label: "Show Shadow Bottom",
|
|
75
|
+
description: "Whether to show shadow on the bottom side or not",
|
|
76
|
+
defaultValue: true,
|
|
77
|
+
group: GROUPS.advanced,
|
|
78
|
+
}),
|
|
79
|
+
showShadowCornerTopStart: createStaticBoolProp({
|
|
80
|
+
label: "Show Shadow Top Start Corner",
|
|
81
|
+
description: "Whether to show shadow on the top start corner or not",
|
|
82
|
+
defaultValue: true,
|
|
83
|
+
group: GROUPS.advanced,
|
|
84
|
+
}),
|
|
85
|
+
showShadowCornerTopEnd: createStaticBoolProp({
|
|
86
|
+
label: "Show Shadow Top End Corner",
|
|
87
|
+
description: "Whether to show shadow on the top end corner or not",
|
|
88
|
+
defaultValue: true,
|
|
89
|
+
group: GROUPS.advanced,
|
|
90
|
+
}),
|
|
91
|
+
showShadowCornerBottomStart: createStaticBoolProp({
|
|
92
|
+
label: "Show Shadow Bottom Start Corner",
|
|
93
|
+
description: "Whether to show shadow on the bottom start corner or not",
|
|
94
|
+
defaultValue: true,
|
|
95
|
+
group: GROUPS.advanced,
|
|
96
|
+
}),
|
|
97
|
+
showShadowCornerBottomEnd: createStaticBoolProp({
|
|
98
|
+
label: "Show Shadow Bottom End Corner",
|
|
99
|
+
description: "Whether to show shadow on the bottom end corner or not",
|
|
100
|
+
defaultValue: true,
|
|
101
|
+
group: GROUPS.advanced,
|
|
102
|
+
}),
|
|
103
|
+
},
|
|
104
|
+
};
|
package/src/mappings/TabView.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createTextEnumProp, createColorProp,
|
|
1
|
+
import { COMPONENT_TYPES, createTextEnumProp, createColorProp, StylesPanelSections, Triggers, createActionProp, createStaticBoolProp, GROUPS, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Tab View",
|
|
4
4
|
tag: "TabView",
|
|
5
5
|
description: "Tab view container",
|
|
6
6
|
category: COMPONENT_TYPES.swiper,
|
|
7
7
|
stylesPanelSections: [
|
|
8
|
-
|
|
8
|
+
StylesPanelSections.Size,
|
|
9
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
10
|
+
StylesPanelSections.Position,
|
|
11
|
+
StylesPanelSections.Effects,
|
|
12
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
9
13
|
StylesPanelSections.Background,
|
|
14
|
+
StylesPanelSections.Typography,
|
|
10
15
|
],
|
|
11
16
|
triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
|
|
12
17
|
props: {
|
|
@@ -36,9 +41,9 @@ export const SEED_DATA = {
|
|
|
36
41
|
defaultValue: true,
|
|
37
42
|
}),
|
|
38
43
|
scrollEnabled: createStaticBoolProp({
|
|
39
|
-
label: "Scroll Enabled",
|
|
44
|
+
label: "Tab Scroll Enabled",
|
|
40
45
|
description: "Whether scrolling of tabs is enabled or not",
|
|
41
|
-
defaultValue:
|
|
46
|
+
defaultValue: false,
|
|
42
47
|
}),
|
|
43
48
|
activeColor: createColorProp({
|
|
44
49
|
label: "Active Color",
|
|
@@ -52,8 +57,9 @@ export const SEED_DATA = {
|
|
|
52
57
|
}),
|
|
53
58
|
pressColor: createColorProp({
|
|
54
59
|
label: "Press Color",
|
|
55
|
-
description: "Color of ripple when pressed
|
|
60
|
+
description: "Color of ripple when pressed",
|
|
56
61
|
defaultValue: "primary",
|
|
62
|
+
group: GROUPS.android,
|
|
57
63
|
}),
|
|
58
64
|
indicatorColor: createColorProp({
|
|
59
65
|
label: "Indicator Color",
|
package/src/mappings/TabView.ts
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
COMPONENT_TYPES,
|
|
3
3
|
createTextEnumProp,
|
|
4
4
|
createColorProp,
|
|
5
|
-
BLOCK_STYLES_SECTIONS,
|
|
6
5
|
StylesPanelSections,
|
|
7
6
|
Triggers,
|
|
8
7
|
createActionProp,
|
|
9
8
|
createStaticBoolProp,
|
|
9
|
+
GROUPS,
|
|
10
10
|
} from "@draftbit/types";
|
|
11
11
|
|
|
12
12
|
export const SEED_DATA = {
|
|
@@ -15,8 +15,13 @@ export const SEED_DATA = {
|
|
|
15
15
|
description: "Tab view container",
|
|
16
16
|
category: COMPONENT_TYPES.swiper,
|
|
17
17
|
stylesPanelSections: [
|
|
18
|
-
|
|
18
|
+
StylesPanelSections.Size,
|
|
19
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
20
|
+
StylesPanelSections.Position,
|
|
21
|
+
StylesPanelSections.Effects,
|
|
22
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
19
23
|
StylesPanelSections.Background,
|
|
24
|
+
StylesPanelSections.Typography,
|
|
20
25
|
],
|
|
21
26
|
triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
|
|
22
27
|
props: {
|
|
@@ -46,9 +51,9 @@ export const SEED_DATA = {
|
|
|
46
51
|
defaultValue: true,
|
|
47
52
|
}),
|
|
48
53
|
scrollEnabled: createStaticBoolProp({
|
|
49
|
-
label: "Scroll Enabled",
|
|
54
|
+
label: "Tab Scroll Enabled",
|
|
50
55
|
description: "Whether scrolling of tabs is enabled or not",
|
|
51
|
-
defaultValue:
|
|
56
|
+
defaultValue: false,
|
|
52
57
|
}),
|
|
53
58
|
activeColor: createColorProp({
|
|
54
59
|
label: "Active Color",
|
|
@@ -62,8 +67,9 @@ export const SEED_DATA = {
|
|
|
62
67
|
}),
|
|
63
68
|
pressColor: createColorProp({
|
|
64
69
|
label: "Press Color",
|
|
65
|
-
description: "Color of ripple when pressed
|
|
70
|
+
description: "Color of ripple when pressed",
|
|
66
71
|
defaultValue: "primary",
|
|
72
|
+
group: GROUPS.android,
|
|
67
73
|
}),
|
|
68
74
|
indicatorColor: createColorProp({
|
|
69
75
|
label: "Indicator Color",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createTextProp, createIconProp, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createTextProp, createIconProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Tab View Item",
|
|
4
4
|
tag: "TabViewItem",
|
|
@@ -12,8 +12,9 @@ export const SEED_DATA = {
|
|
|
12
12
|
title: createTextProp({
|
|
13
13
|
label: "Title",
|
|
14
14
|
description: "Title of tab item",
|
|
15
|
-
defaultValue:
|
|
15
|
+
defaultValue: "Title",
|
|
16
16
|
required: true,
|
|
17
|
+
group: GROUPS.basic,
|
|
17
18
|
}),
|
|
18
19
|
icon: createIconProp({
|
|
19
20
|
defaultValue: null,
|
|
@@ -23,6 +24,7 @@ export const SEED_DATA = {
|
|
|
23
24
|
label: "Accessibility Label",
|
|
24
25
|
description: "Accessibility Label",
|
|
25
26
|
defaultValue: null,
|
|
27
|
+
group: GROUPS.accessibility,
|
|
26
28
|
}),
|
|
27
29
|
},
|
|
28
30
|
};
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
createTextProp,
|
|
4
4
|
createIconProp,
|
|
5
5
|
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
6
|
+
GROUPS,
|
|
6
7
|
} from "@draftbit/types";
|
|
7
8
|
|
|
8
9
|
export const SEED_DATA = {
|
|
@@ -19,8 +20,9 @@ export const SEED_DATA = {
|
|
|
19
20
|
title: createTextProp({
|
|
20
21
|
label: "Title",
|
|
21
22
|
description: "Title of tab item",
|
|
22
|
-
defaultValue:
|
|
23
|
+
defaultValue: "Title",
|
|
23
24
|
required: true,
|
|
25
|
+
group: GROUPS.basic,
|
|
24
26
|
}),
|
|
25
27
|
icon: createIconProp({
|
|
26
28
|
defaultValue: null,
|
|
@@ -30,6 +32,7 @@ export const SEED_DATA = {
|
|
|
30
32
|
label: "Accessibility Label",
|
|
31
33
|
description: "Accessibility Label",
|
|
32
34
|
defaultValue: null,
|
|
35
|
+
group: GROUPS.accessibility,
|
|
33
36
|
}),
|
|
34
37
|
},
|
|
35
38
|
};
|