@draftbit/core 46.12.1-07ad46.2 → 46.12.1-0e8f23.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/ActionSheet/index.js.map +1 -1
- package/lib/commonjs/components/AspectRatio.js +2 -16
- package/lib/commonjs/components/AspectRatio.js.map +1 -1
- package/lib/commonjs/components/AvatarEdit.js +4 -15
- package/lib/commonjs/components/AvatarEdit.js.map +1 -1
- package/lib/commonjs/components/Banner.js +4 -23
- package/lib/commonjs/components/Banner.js.map +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +18 -3
- package/lib/commonjs/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +73 -120
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/Button.js +10 -32
- package/lib/commonjs/components/Button.js.map +1 -1
- package/lib/commonjs/components/Card.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +22 -5
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +6 -23
- package/lib/commonjs/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Container.js +4 -15
- package/lib/commonjs/components/Container.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponentType.js.map +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/lib/commonjs/components/DeckSwiper/index.js.map +1 -1
- package/lib/commonjs/components/Divider.js +1 -12
- package/lib/commonjs/components/Divider.js.map +1 -1
- package/lib/commonjs/components/Elevation.js +2 -13
- package/lib/commonjs/components/Elevation.js.map +1 -1
- package/lib/commonjs/components/FAB.js +4 -19
- package/lib/commonjs/components/FAB.js.map +1 -1
- package/lib/commonjs/components/FieldSearchBarFull.js +2 -1
- package/lib/commonjs/components/FieldSearchBarFull.js.map +1 -1
- package/lib/commonjs/components/FormRow.js +3 -17
- package/lib/commonjs/components/FormRow.js.map +1 -1
- package/lib/commonjs/components/Image.js +2 -16
- package/lib/commonjs/components/Image.js.map +1 -1
- package/lib/commonjs/components/Justification.js +1 -2
- package/lib/commonjs/components/Justification.js.map +1 -1
- package/lib/commonjs/components/Layout.js +19 -39
- package/lib/commonjs/components/Layout.js.map +1 -1
- package/lib/commonjs/components/Markdown.js.map +1 -1
- package/lib/commonjs/components/NumberInput.js +3 -11
- package/lib/commonjs/components/NumberInput.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.android.js +21 -4
- package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerTypes.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalConsumer.js +2 -1
- package/lib/commonjs/components/Portal/PortalConsumer.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalHost.js +14 -43
- package/lib/commonjs/components/Portal/PortalHost.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalManager.js +8 -34
- package/lib/commonjs/components/Portal/PortalManager.js.map +1 -1
- package/lib/commonjs/components/Pressable.js +2 -15
- package/lib/commonjs/components/Pressable.js.map +1 -1
- package/lib/commonjs/components/ProgressBar.js +7 -36
- package/lib/commonjs/components/ProgressBar.js.map +1 -1
- package/lib/commonjs/components/ProgressIndicator.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +2 -14
- package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +1 -10
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +4 -16
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +5 -23
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/components/ResizeMode.js +1 -2
- package/lib/commonjs/components/ResizeMode.js.map +1 -1
- package/lib/commonjs/components/Row.js.map +1 -1
- package/lib/commonjs/components/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/commonjs/components/SVG.js.map +1 -1
- package/lib/commonjs/components/ScreenContainer.js +6 -23
- package/lib/commonjs/components/ScreenContainer.js.map +1 -1
- package/lib/commonjs/components/Slider.js +4 -21
- package/lib/commonjs/components/Slider.js.map +1 -1
- package/lib/commonjs/components/StarRating.js +4 -22
- package/lib/commonjs/components/StarRating.js.map +1 -1
- package/lib/commonjs/components/StepIndicator.js +18 -57
- package/lib/commonjs/components/StepIndicator.js.map +1 -1
- package/lib/commonjs/components/SwipeableView/SwipeableView.js +155 -0
- package/lib/commonjs/components/SwipeableView/SwipeableView.js.map +1 -0
- package/lib/commonjs/components/SwipeableView/SwipeableViewButton.js +13 -0
- package/lib/commonjs/components/SwipeableView/SwipeableViewButton.js.map +1 -0
- package/lib/commonjs/components/SwipeableView/SwipeableViewSwipeHandler.js +13 -0
- package/lib/commonjs/components/SwipeableView/SwipeableViewSwipeHandler.js.map +1 -0
- package/lib/commonjs/components/SwipeableView/index.js +28 -0
- package/lib/commonjs/components/SwipeableView/index.js.map +1 -0
- package/lib/commonjs/components/Swiper/Swiper.js.map +1 -1
- package/lib/commonjs/components/Swiper/SwiperItem.js.map +1 -1
- package/lib/commonjs/components/Switch.js +10 -19
- package/lib/commonjs/components/Switch.js.map +1 -1
- package/lib/commonjs/components/TabView/TabView.js +7 -14
- package/lib/commonjs/components/TabView/TabView.js.map +1 -1
- package/lib/commonjs/components/TabView/TabViewItem.js.map +1 -1
- package/lib/commonjs/components/Table/Table.js +5 -6
- package/lib/commonjs/components/Table/Table.js.map +1 -1
- package/lib/commonjs/components/Table/TableCommon.js.map +1 -1
- package/lib/commonjs/components/Table/TableRow.js +2 -1
- package/lib/commonjs/components/Table/TableRow.js.map +1 -1
- package/lib/commonjs/components/Text.js +4 -50
- package/lib/commonjs/components/Text.js.map +1 -1
- package/lib/commonjs/components/TextField.js +28 -76
- package/lib/commonjs/components/TextField.js.map +1 -1
- package/lib/commonjs/components/ToggleButton.js +2 -14
- package/lib/commonjs/components/ToggleButton.js.map +1 -1
- package/lib/commonjs/components/Touchable.js +2 -15
- package/lib/commonjs/components/Touchable.js.map +1 -1
- package/lib/commonjs/components/Touchable.web.js.map +1 -1
- package/lib/commonjs/components/Typography.js.map +1 -1
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.native.js.map +1 -1
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayerProps.js.map +1 -1
- package/lib/commonjs/components/useAuthState.js.map +1 -1
- package/lib/commonjs/index.js +19 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/BottomSheet.js +37 -9
- package/lib/commonjs/mappings/BottomSheet.js.map +1 -1
- package/lib/commonjs/mappings/FlatList.js +0 -3
- package/lib/commonjs/mappings/FlatList.js.map +1 -1
- package/lib/commonjs/mappings/MapMarker.js +15 -0
- package/lib/commonjs/mappings/MapMarker.js.map +1 -1
- package/lib/commonjs/mappings/MapView.js +5 -0
- package/lib/commonjs/mappings/MapView.js.map +1 -1
- package/lib/commonjs/mappings/SwipeableView.js +183 -0
- package/lib/commonjs/mappings/SwipeableView.js.map +1 -0
- package/lib/commonjs/utilities.js +27 -2
- package/lib/commonjs/utilities.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.js +18 -3
- package/lib/module/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/module/components/SwipeableView/SwipeableView.js +147 -0
- package/lib/module/components/SwipeableView/SwipeableView.js.map +1 -0
- package/lib/module/components/SwipeableView/SwipeableViewButton.js +6 -0
- package/lib/module/components/SwipeableView/SwipeableViewButton.js.map +1 -0
- package/lib/module/components/SwipeableView/SwipeableViewSwipeHandler.js +6 -0
- package/lib/module/components/SwipeableView/SwipeableViewSwipeHandler.js.map +1 -0
- package/lib/module/components/SwipeableView/index.js +4 -0
- package/lib/module/components/SwipeableView/index.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappings/BottomSheet.js +38 -10
- package/lib/module/mappings/BottomSheet.js.map +1 -1
- package/lib/module/mappings/FlatList.js +0 -3
- package/lib/module/mappings/FlatList.js.map +1 -1
- package/lib/module/mappings/MapMarker.js +16 -1
- package/lib/module/mappings/MapMarker.js.map +1 -1
- package/lib/module/mappings/MapView.js +6 -1
- package/lib/module/mappings/MapView.js.map +1 -1
- package/lib/module/mappings/SwipeableView.js +175 -0
- package/lib/module/mappings/SwipeableView.js.map +1 -0
- package/lib/module/utilities.js +18 -0
- package/lib/module/utilities.js.map +1 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +6 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/components/SwipeableView/SwipeableView.d.ts +29 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableView.d.ts.map +1 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableViewButton.d.ts +13 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableViewButton.d.ts.map +1 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableViewSwipeHandler.d.ts +13 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableViewSwipeHandler.d.ts.map +1 -0
- package/lib/typescript/src/components/SwipeableView/index.d.ts +4 -0
- package/lib/typescript/src/components/SwipeableView/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/BottomSheet.d.ts +48 -4
- package/lib/typescript/src/mappings/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +0 -3
- package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapMarker.d.ts +32 -0
- package/lib/typescript/src/mappings/MapMarker.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapView.d.ts +11 -0
- package/lib/typescript/src/mappings/MapView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/SwipeableView.d.ts +426 -0
- package/lib/typescript/src/mappings/SwipeableView.d.ts.map +1 -0
- package/lib/typescript/src/utilities.d.ts +6 -0
- package/lib/typescript/src/utilities.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/components/BottomSheet/BottomSheet.js +17 -2
- package/src/components/BottomSheet/BottomSheet.tsx +32 -4
- package/src/components/SwipeableView/SwipeableView.js +117 -0
- package/src/components/SwipeableView/SwipeableView.tsx +299 -0
- package/src/components/SwipeableView/SwipeableViewButton.js +5 -0
- package/src/components/SwipeableView/SwipeableViewButton.tsx +18 -0
- package/src/components/SwipeableView/SwipeableViewSwipeHandler.js +5 -0
- package/src/components/SwipeableView/SwipeableViewSwipeHandler.tsx +20 -0
- package/src/components/SwipeableView/index.js +3 -0
- package/src/components/SwipeableView/index.tsx +3 -0
- package/src/index.js +1 -0
- package/src/index.tsx +6 -0
- package/src/mappings/BottomSheet.js +37 -9
- package/src/mappings/BottomSheet.ts +43 -8
- package/src/mappings/FlatList.js +0 -3
- package/src/mappings/FlatList.ts +0 -3
- package/src/mappings/MapMarker.js +16 -1
- package/src/mappings/MapMarker.ts +20 -0
- package/src/mappings/MapView.js +6 -1
- package/src/mappings/MapView.ts +8 -0
- package/src/mappings/SwipeableView.js +181 -0
- package/src/mappings/SwipeableView.ts +210 -0
- package/src/utilities.js +41 -0
- package/src/utilities.ts +71 -0
|
@@ -7,6 +7,9 @@ import {
|
|
|
7
7
|
createColorProp,
|
|
8
8
|
createStaticNumberProp,
|
|
9
9
|
createArrayProp,
|
|
10
|
+
GROUPS,
|
|
11
|
+
createTextEnumProp,
|
|
12
|
+
FORM_TYPES,
|
|
10
13
|
} from "@draftbit/types";
|
|
11
14
|
|
|
12
15
|
export const SEED_DATA = {
|
|
@@ -22,17 +25,35 @@ export const SEED_DATA = {
|
|
|
22
25
|
label: "On settle",
|
|
23
26
|
description: "Action to execute when sheet settles on a snap point",
|
|
24
27
|
}),
|
|
25
|
-
|
|
26
|
-
label: "
|
|
28
|
+
topSnapPosition: createStaticNumberProp({
|
|
29
|
+
label: "Top snap position",
|
|
27
30
|
description:
|
|
28
|
-
"
|
|
29
|
-
defaultValue:
|
|
31
|
+
"Top most postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
32
|
+
defaultValue: "10%",
|
|
33
|
+
required: false,
|
|
34
|
+
formType: FORM_TYPES.numeric,
|
|
30
35
|
}),
|
|
31
|
-
|
|
32
|
-
label: "
|
|
33
|
-
description:
|
|
34
|
-
|
|
36
|
+
middleSnapPosition: createStaticNumberProp({
|
|
37
|
+
label: "Middle snap position",
|
|
38
|
+
description:
|
|
39
|
+
"Middle postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
40
|
+
defaultValue: "50%",
|
|
35
41
|
required: false,
|
|
42
|
+
formType: FORM_TYPES.numeric,
|
|
43
|
+
}),
|
|
44
|
+
bottomSnapPosition: createStaticNumberProp({
|
|
45
|
+
label: "Bottom snap position",
|
|
46
|
+
description:
|
|
47
|
+
"Bottom most postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
48
|
+
defaultValue: "80%",
|
|
49
|
+
required: false,
|
|
50
|
+
formType: FORM_TYPES.numeric,
|
|
51
|
+
}),
|
|
52
|
+
initialSnapPosition: createTextEnumProp({
|
|
53
|
+
label: "Initial snap position",
|
|
54
|
+
description: "Initial snap position that bottom sheet will snap to",
|
|
55
|
+
options: ["top", "middle", "bottom"],
|
|
56
|
+
defaultValue: "bottom",
|
|
36
57
|
}),
|
|
37
58
|
showHandle: createStaticBoolProp({
|
|
38
59
|
label: "Show handle",
|
|
@@ -73,5 +94,19 @@ export const SEED_DATA = {
|
|
|
73
94
|
"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
95
|
defaultValue: true,
|
|
75
96
|
}),
|
|
97
|
+
snapPoints: createArrayProp({
|
|
98
|
+
label: "Custom Snap points",
|
|
99
|
+
description:
|
|
100
|
+
"An array of numerical values (that represent distance from the top) where bottom sheet can snap to. Accepts numbers and percentages (minimum 2 snap points). Overrides snap position props",
|
|
101
|
+
defaultValue: null,
|
|
102
|
+
}),
|
|
103
|
+
initialSnapIndex: createStaticNumberProp({
|
|
104
|
+
label: "Initial snap index",
|
|
105
|
+
description:
|
|
106
|
+
"Index of the snap point to be used as the initial point. Overrides initial snap position",
|
|
107
|
+
defaultValue: null,
|
|
108
|
+
required: false,
|
|
109
|
+
group: GROUPS.advanced,
|
|
110
|
+
}),
|
|
76
111
|
},
|
|
77
112
|
};
|
package/src/mappings/FlatList.js
CHANGED
|
@@ -5,9 +5,6 @@ export const SEED_DATA = {
|
|
|
5
5
|
description: "A basic List component",
|
|
6
6
|
category: COMPONENT_TYPES.data,
|
|
7
7
|
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
-
layout: {
|
|
9
|
-
flex: 1,
|
|
10
|
-
},
|
|
11
8
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
12
9
|
props: {
|
|
13
10
|
onRefresh: createActionProp(),
|
package/src/mappings/FlatList.ts
CHANGED
|
@@ -15,9 +15,6 @@ export const SEED_DATA = {
|
|
|
15
15
|
description: "A basic List component",
|
|
16
16
|
category: COMPONENT_TYPES.data,
|
|
17
17
|
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
18
|
-
layout: {
|
|
19
|
-
flex: 1,
|
|
20
|
-
},
|
|
21
18
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
22
19
|
props: {
|
|
23
20
|
onRefresh: createActionProp(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createTextProp, GROUPS, StylesPanelSections, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createActionProp, createBoolProp, createColorProp, createImageProp, createNumberProp, createStaticNumberProp, createTextProp, GROUPS, StylesPanelSections, Triggers, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Map Marker",
|
|
4
4
|
tag: "MapMarker",
|
|
@@ -11,7 +11,9 @@ export const SEED_DATA = {
|
|
|
11
11
|
StylesPanelSections.Effects,
|
|
12
12
|
],
|
|
13
13
|
layout: {},
|
|
14
|
+
triggers: [Triggers.OnPress],
|
|
14
15
|
props: {
|
|
16
|
+
onPress: createActionProp(),
|
|
15
17
|
latitude: createNumberProp({
|
|
16
18
|
label: "Latitude",
|
|
17
19
|
description: "The latitude in which the marker is located",
|
|
@@ -48,5 +50,18 @@ export const SEED_DATA = {
|
|
|
48
50
|
label: "Pin Color",
|
|
49
51
|
description: "Sets the color of the marker",
|
|
50
52
|
}),
|
|
53
|
+
pinImage: createImageProp({
|
|
54
|
+
label: "Pin image",
|
|
55
|
+
description: "Image to be used instead of the default pin",
|
|
56
|
+
editable: true,
|
|
57
|
+
required: false,
|
|
58
|
+
defaultValue: null,
|
|
59
|
+
}),
|
|
60
|
+
pinImageSize: createStaticNumberProp({
|
|
61
|
+
label: "Pin image size",
|
|
62
|
+
description: "The size of pin image. Only applies when using custom pin image",
|
|
63
|
+
required: false,
|
|
64
|
+
defaultValue: 50,
|
|
65
|
+
}),
|
|
51
66
|
},
|
|
52
67
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMPONENT_TYPES,
|
|
3
|
+
createActionProp,
|
|
3
4
|
createBoolProp,
|
|
4
5
|
createColorProp,
|
|
6
|
+
createImageProp,
|
|
5
7
|
createNumberProp,
|
|
8
|
+
createStaticNumberProp,
|
|
6
9
|
createTextProp,
|
|
7
10
|
GROUPS,
|
|
8
11
|
StylesPanelSections,
|
|
12
|
+
Triggers,
|
|
9
13
|
} from "@draftbit/types";
|
|
10
14
|
|
|
11
15
|
export const SEED_DATA = {
|
|
@@ -20,7 +24,9 @@ export const SEED_DATA = {
|
|
|
20
24
|
StylesPanelSections.Effects,
|
|
21
25
|
],
|
|
22
26
|
layout: {},
|
|
27
|
+
triggers: [Triggers.OnPress],
|
|
23
28
|
props: {
|
|
29
|
+
onPress: createActionProp(),
|
|
24
30
|
latitude: createNumberProp({
|
|
25
31
|
label: "Latitude",
|
|
26
32
|
description: "The latitude in which the marker is located",
|
|
@@ -58,5 +64,19 @@ export const SEED_DATA = {
|
|
|
58
64
|
label: "Pin Color",
|
|
59
65
|
description: "Sets the color of the marker",
|
|
60
66
|
}),
|
|
67
|
+
pinImage: createImageProp({
|
|
68
|
+
label: "Pin image",
|
|
69
|
+
description: "Image to be used instead of the default pin",
|
|
70
|
+
editable: true,
|
|
71
|
+
required: false,
|
|
72
|
+
defaultValue: null,
|
|
73
|
+
}),
|
|
74
|
+
pinImageSize: createStaticNumberProp({
|
|
75
|
+
label: "Pin image size",
|
|
76
|
+
description:
|
|
77
|
+
"The size of pin image. Only applies when using custom pin image",
|
|
78
|
+
required: false,
|
|
79
|
+
defaultValue: 50,
|
|
80
|
+
}),
|
|
61
81
|
},
|
|
62
82
|
};
|
package/src/mappings/MapView.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createTextProp, GROUPS, FORM_TYPES, PROP_TYPES, StylesPanelSections, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createTextProp, GROUPS, FORM_TYPES, PROP_TYPES, StylesPanelSections, Triggers, createActionProp, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Map View",
|
|
4
4
|
tag: "MapView",
|
|
@@ -11,7 +11,12 @@ export const SEED_DATA = {
|
|
|
11
11
|
width: "100%",
|
|
12
12
|
height: "100%",
|
|
13
13
|
},
|
|
14
|
+
triggers: [Triggers.OnRegionChange],
|
|
14
15
|
props: {
|
|
16
|
+
onRegionChange: createActionProp({
|
|
17
|
+
label: "On region changed",
|
|
18
|
+
description: "Action to execute when map panning stops and region changes",
|
|
19
|
+
}),
|
|
15
20
|
provider: {
|
|
16
21
|
formType: FORM_TYPES.flatArray,
|
|
17
22
|
propType: PROP_TYPES.STRING,
|
package/src/mappings/MapView.ts
CHANGED
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
FORM_TYPES,
|
|
9
9
|
PROP_TYPES,
|
|
10
10
|
StylesPanelSections,
|
|
11
|
+
Triggers,
|
|
12
|
+
createActionProp,
|
|
11
13
|
} from "@draftbit/types";
|
|
12
14
|
|
|
13
15
|
export const SEED_DATA = {
|
|
@@ -22,7 +24,13 @@ export const SEED_DATA = {
|
|
|
22
24
|
width: "100%",
|
|
23
25
|
height: "100%",
|
|
24
26
|
},
|
|
27
|
+
triggers: [Triggers.OnRegionChange],
|
|
25
28
|
props: {
|
|
29
|
+
onRegionChange: createActionProp({
|
|
30
|
+
label: "On region changed",
|
|
31
|
+
description:
|
|
32
|
+
"Action to execute when map panning stops and region changes",
|
|
33
|
+
}),
|
|
26
34
|
provider: {
|
|
27
35
|
formType: FORM_TYPES.flatArray,
|
|
28
36
|
propType: PROP_TYPES.STRING,
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createStaticNumberProp, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, StylesPanelSections, GROUPS, createBoolProp, createTextProp, createIconProp, createTextEnumProp, createColorProp, Triggers, createActionProp, } from "@draftbit/types";
|
|
2
|
+
export const SHARED_SEED_DATA_PROPS = {
|
|
3
|
+
title: createTextProp({
|
|
4
|
+
label: "Title",
|
|
5
|
+
description: "Title of button/swipeable",
|
|
6
|
+
defaultValue: "Swipeable",
|
|
7
|
+
required: true,
|
|
8
|
+
group: GROUPS.basic,
|
|
9
|
+
}),
|
|
10
|
+
side: createTextEnumProp({
|
|
11
|
+
label: "Side",
|
|
12
|
+
description: "Side where button/swipeable is added",
|
|
13
|
+
options: ["left", "right"],
|
|
14
|
+
defaultValue: "left",
|
|
15
|
+
required: true,
|
|
16
|
+
}),
|
|
17
|
+
icon: createIconProp({
|
|
18
|
+
defaultValue: null,
|
|
19
|
+
required: false,
|
|
20
|
+
}),
|
|
21
|
+
iconSize: createStaticNumberProp({
|
|
22
|
+
label: "Icon size",
|
|
23
|
+
description: "Size of icon",
|
|
24
|
+
defaultValue: 25,
|
|
25
|
+
required: false,
|
|
26
|
+
}),
|
|
27
|
+
backgroundColor: createColorProp({
|
|
28
|
+
label: "Background color",
|
|
29
|
+
description: "Color of button/swipeable background",
|
|
30
|
+
defaultValue: "primary",
|
|
31
|
+
}),
|
|
32
|
+
color: createColorProp({
|
|
33
|
+
label: "Color",
|
|
34
|
+
description: "Color of text and icon of button/swipeable",
|
|
35
|
+
defaultValue: "surface",
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
export const SEED_DATA = [
|
|
39
|
+
{
|
|
40
|
+
name: "Swipeable View",
|
|
41
|
+
tag: "SwipeableView",
|
|
42
|
+
doc_link: "https://github.com/jemise111/react-native-swipe-list-view/blob/master/docs/SwipeRow.md",
|
|
43
|
+
description: "A swipeable view that is able to show hidden buttons and/or handle swipe events",
|
|
44
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
45
|
+
stylesPanelSections: [
|
|
46
|
+
...CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
47
|
+
StylesPanelSections.Typography,
|
|
48
|
+
],
|
|
49
|
+
layout: {
|
|
50
|
+
overflow: "hidden",
|
|
51
|
+
flexDirection: "row",
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
padding: 10,
|
|
54
|
+
},
|
|
55
|
+
props: {
|
|
56
|
+
closeOnPress: createStaticBoolProp({
|
|
57
|
+
label: "Close on press",
|
|
58
|
+
description: "Whether the view should be closed/dismissed when pressed",
|
|
59
|
+
defaultValue: true,
|
|
60
|
+
}),
|
|
61
|
+
swipeActivationPercentage: createStaticNumberProp({
|
|
62
|
+
label: "Swipe activation percentage",
|
|
63
|
+
description: "Percentage of swipe completion needed to trigger onSwipe. Overriden by 'Left activation value' and 'Right activation value'",
|
|
64
|
+
defaultValue: 80,
|
|
65
|
+
required: false,
|
|
66
|
+
}),
|
|
67
|
+
disableLeftSwipe: createBoolProp({
|
|
68
|
+
label: "Disable left swipe",
|
|
69
|
+
description: "Whether left swipe is enabled or not",
|
|
70
|
+
defaultValue: true,
|
|
71
|
+
}),
|
|
72
|
+
disableRightSwipe: createBoolProp({
|
|
73
|
+
label: "Disable right swipe",
|
|
74
|
+
description: "Whether right swipe is enabled or not",
|
|
75
|
+
defaultValue: true,
|
|
76
|
+
}),
|
|
77
|
+
leftOpenValue: createStaticNumberProp({
|
|
78
|
+
label: "Left open value",
|
|
79
|
+
description: "The X translation value that left swipe snaps to (positive value). Defaults to half view width",
|
|
80
|
+
group: GROUPS.advanced,
|
|
81
|
+
required: false,
|
|
82
|
+
}),
|
|
83
|
+
rightOpenValue: createStaticNumberProp({
|
|
84
|
+
label: "Right open value",
|
|
85
|
+
description: "The X translation value that right swipe snaps to (negative value). Defaults to negative half view width",
|
|
86
|
+
group: GROUPS.advanced,
|
|
87
|
+
required: false,
|
|
88
|
+
}),
|
|
89
|
+
leftActivationValue: createStaticNumberProp({
|
|
90
|
+
label: "Left activation value",
|
|
91
|
+
description: "The X translation value that triggers onSwipe when surpassed (positive value). Defaults to 80% of half view width",
|
|
92
|
+
group: GROUPS.advanced,
|
|
93
|
+
required: false,
|
|
94
|
+
}),
|
|
95
|
+
rightActivationValue: createStaticNumberProp({
|
|
96
|
+
label: "Right activation value",
|
|
97
|
+
description: "The X translation value that triggers onSwipe when surpassed (negative value). Defaults to negative 80% of half view width",
|
|
98
|
+
group: GROUPS.advanced,
|
|
99
|
+
required: false,
|
|
100
|
+
}),
|
|
101
|
+
stopLeftSwipe: createStaticNumberProp({
|
|
102
|
+
label: "Stop left swipe",
|
|
103
|
+
description: "The maximum X translation value that is swipable from left (positive value). Defaults to half view width",
|
|
104
|
+
group: GROUPS.advanced,
|
|
105
|
+
required: false,
|
|
106
|
+
}),
|
|
107
|
+
stopRightSwipe: createStaticNumberProp({
|
|
108
|
+
label: "Stop right swipe",
|
|
109
|
+
description: "The maximum X translation value that is swipable from right (negative value). Defaults to negative half view width",
|
|
110
|
+
group: GROUPS.advanced,
|
|
111
|
+
required: false,
|
|
112
|
+
}),
|
|
113
|
+
directionalDistanceChangeThreshold: createStaticNumberProp({
|
|
114
|
+
label: "Change threshold",
|
|
115
|
+
description: "Change the sensitivity of the swipe on the view",
|
|
116
|
+
group: GROUPS.advanced,
|
|
117
|
+
required: false,
|
|
118
|
+
}),
|
|
119
|
+
friction: createStaticNumberProp({
|
|
120
|
+
label: "Friction",
|
|
121
|
+
description: "Controls the 'bounciness' of the swipe animation",
|
|
122
|
+
defaultValue: 20,
|
|
123
|
+
group: GROUPS.advanced,
|
|
124
|
+
required: false,
|
|
125
|
+
}),
|
|
126
|
+
tension: createStaticNumberProp({
|
|
127
|
+
label: "Change threshold",
|
|
128
|
+
description: "Controls the tension/speed of the swipe animation",
|
|
129
|
+
group: GROUPS.advanced,
|
|
130
|
+
required: false,
|
|
131
|
+
}),
|
|
132
|
+
swipeToOpenVelocityContribution: createStaticNumberProp({
|
|
133
|
+
label: "Swipe Velocity Contribution",
|
|
134
|
+
description: "Describes how much the ending velocity of the gesture affects whether the swipe will result in the item being closed or open. A velocity factor of 0 (the default) means that the velocity will have no bearing on whether the swipe settles on a closed or open position and it'll just take into consideration the swipeToOpenPercent. Ideal values for this prop tend to be between 5 and 15",
|
|
135
|
+
group: GROUPS.advanced,
|
|
136
|
+
required: false,
|
|
137
|
+
}),
|
|
138
|
+
swipeToOpenPercent: createStaticNumberProp({
|
|
139
|
+
label: "Swipe to open percentage",
|
|
140
|
+
description: "What % of the left/right does the user need to swipe past to trigger the view opening",
|
|
141
|
+
group: GROUPS.advanced,
|
|
142
|
+
defaultValue: 50,
|
|
143
|
+
required: false,
|
|
144
|
+
}),
|
|
145
|
+
swipeToClosePercent: createStaticNumberProp({
|
|
146
|
+
label: "Swipe to close percentage",
|
|
147
|
+
description: "What % of the left/right does the user need to swipe past to trigger the view closing",
|
|
148
|
+
group: GROUPS.advanced,
|
|
149
|
+
defaultValue: 50,
|
|
150
|
+
required: false,
|
|
151
|
+
}),
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "Swipeable View Button",
|
|
156
|
+
tag: "SwipeableViewButton",
|
|
157
|
+
description: "Button to be rendered under a Swipeable View",
|
|
158
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
159
|
+
stylesPanelSections: [],
|
|
160
|
+
triggers: [Triggers.OnPress],
|
|
161
|
+
props: {
|
|
162
|
+
...SHARED_SEED_DATA_PROPS,
|
|
163
|
+
onPress: createActionProp(),
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "Swipeable View Swipe Handler",
|
|
168
|
+
tag: "SwipeableViewSwipeHandler",
|
|
169
|
+
description: "Component that renders and handles swipe of Swipeable View",
|
|
170
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
171
|
+
stylesPanelSections: [],
|
|
172
|
+
triggers: [Triggers.OnSwipe],
|
|
173
|
+
props: {
|
|
174
|
+
...SHARED_SEED_DATA_PROPS,
|
|
175
|
+
onSwipe: createActionProp({
|
|
176
|
+
label: "On swipe",
|
|
177
|
+
description: "Called when Swipeable View swiped in the direction this is configured to",
|
|
178
|
+
}),
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
];
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createStaticNumberProp,
|
|
4
|
+
createStaticBoolProp,
|
|
5
|
+
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
6
|
+
StylesPanelSections,
|
|
7
|
+
GROUPS,
|
|
8
|
+
createBoolProp,
|
|
9
|
+
createTextProp,
|
|
10
|
+
createIconProp,
|
|
11
|
+
createTextEnumProp,
|
|
12
|
+
createColorProp,
|
|
13
|
+
Triggers,
|
|
14
|
+
createActionProp,
|
|
15
|
+
} from "@draftbit/types";
|
|
16
|
+
|
|
17
|
+
export const SHARED_SEED_DATA_PROPS = {
|
|
18
|
+
title: createTextProp({
|
|
19
|
+
label: "Title",
|
|
20
|
+
description: "Title of button/swipeable",
|
|
21
|
+
defaultValue: "Swipeable",
|
|
22
|
+
required: true,
|
|
23
|
+
group: GROUPS.basic,
|
|
24
|
+
}),
|
|
25
|
+
side: createTextEnumProp({
|
|
26
|
+
label: "Side",
|
|
27
|
+
description: "Side where button/swipeable is added",
|
|
28
|
+
options: ["left", "right"],
|
|
29
|
+
defaultValue: "left",
|
|
30
|
+
required: true,
|
|
31
|
+
}),
|
|
32
|
+
icon: createIconProp({
|
|
33
|
+
defaultValue: null,
|
|
34
|
+
required: false,
|
|
35
|
+
}),
|
|
36
|
+
iconSize: createStaticNumberProp({
|
|
37
|
+
label: "Icon size",
|
|
38
|
+
description: "Size of icon",
|
|
39
|
+
defaultValue: 25,
|
|
40
|
+
required: false,
|
|
41
|
+
}),
|
|
42
|
+
backgroundColor: createColorProp({
|
|
43
|
+
label: "Background color",
|
|
44
|
+
description: "Color of button/swipeable background",
|
|
45
|
+
defaultValue: "primary",
|
|
46
|
+
}),
|
|
47
|
+
color: createColorProp({
|
|
48
|
+
label: "Color",
|
|
49
|
+
description: "Color of text and icon of button/swipeable",
|
|
50
|
+
defaultValue: "surface",
|
|
51
|
+
}),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const SEED_DATA = [
|
|
55
|
+
{
|
|
56
|
+
name: "Swipeable View",
|
|
57
|
+
tag: "SwipeableView",
|
|
58
|
+
doc_link:
|
|
59
|
+
"https://github.com/jemise111/react-native-swipe-list-view/blob/master/docs/SwipeRow.md",
|
|
60
|
+
description:
|
|
61
|
+
"A swipeable view that is able to show hidden buttons and/or handle swipe events",
|
|
62
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
63
|
+
stylesPanelSections: [
|
|
64
|
+
...CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
65
|
+
StylesPanelSections.Typography,
|
|
66
|
+
],
|
|
67
|
+
layout: {
|
|
68
|
+
overflow: "hidden",
|
|
69
|
+
flexDirection: "row",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
padding: 10,
|
|
72
|
+
},
|
|
73
|
+
props: {
|
|
74
|
+
closeOnPress: createStaticBoolProp({
|
|
75
|
+
label: "Close on press",
|
|
76
|
+
description: "Whether the view should be closed/dismissed when pressed",
|
|
77
|
+
defaultValue: true,
|
|
78
|
+
}),
|
|
79
|
+
swipeActivationPercentage: createStaticNumberProp({
|
|
80
|
+
label: "Swipe activation percentage",
|
|
81
|
+
description:
|
|
82
|
+
"Percentage of swipe completion needed to trigger onSwipe. Overriden by 'Left activation value' and 'Right activation value'",
|
|
83
|
+
defaultValue: 80,
|
|
84
|
+
required: false,
|
|
85
|
+
}),
|
|
86
|
+
disableLeftSwipe: createBoolProp({
|
|
87
|
+
label: "Disable left swipe",
|
|
88
|
+
description: "Whether left swipe is enabled or not",
|
|
89
|
+
defaultValue: true,
|
|
90
|
+
}),
|
|
91
|
+
disableRightSwipe: createBoolProp({
|
|
92
|
+
label: "Disable right swipe",
|
|
93
|
+
description: "Whether right swipe is enabled or not",
|
|
94
|
+
defaultValue: true,
|
|
95
|
+
}),
|
|
96
|
+
leftOpenValue: createStaticNumberProp({
|
|
97
|
+
label: "Left open value",
|
|
98
|
+
description:
|
|
99
|
+
"The X translation value that left swipe snaps to (positive value). Defaults to half view width",
|
|
100
|
+
group: GROUPS.advanced,
|
|
101
|
+
required: false,
|
|
102
|
+
}),
|
|
103
|
+
rightOpenValue: createStaticNumberProp({
|
|
104
|
+
label: "Right open value",
|
|
105
|
+
description:
|
|
106
|
+
"The X translation value that right swipe snaps to (negative value). Defaults to negative half view width",
|
|
107
|
+
group: GROUPS.advanced,
|
|
108
|
+
required: false,
|
|
109
|
+
}),
|
|
110
|
+
leftActivationValue: createStaticNumberProp({
|
|
111
|
+
label: "Left activation value",
|
|
112
|
+
description:
|
|
113
|
+
"The X translation value that triggers onSwipe when surpassed (positive value). Defaults to 80% of half view width",
|
|
114
|
+
group: GROUPS.advanced,
|
|
115
|
+
required: false,
|
|
116
|
+
}),
|
|
117
|
+
rightActivationValue: createStaticNumberProp({
|
|
118
|
+
label: "Right activation value",
|
|
119
|
+
description:
|
|
120
|
+
"The X translation value that triggers onSwipe when surpassed (negative value). Defaults to negative 80% of half view width",
|
|
121
|
+
group: GROUPS.advanced,
|
|
122
|
+
required: false,
|
|
123
|
+
}),
|
|
124
|
+
stopLeftSwipe: createStaticNumberProp({
|
|
125
|
+
label: "Stop left swipe",
|
|
126
|
+
description:
|
|
127
|
+
"The maximum X translation value that is swipable from left (positive value). Defaults to half view width",
|
|
128
|
+
group: GROUPS.advanced,
|
|
129
|
+
required: false,
|
|
130
|
+
}),
|
|
131
|
+
stopRightSwipe: createStaticNumberProp({
|
|
132
|
+
label: "Stop right swipe",
|
|
133
|
+
description:
|
|
134
|
+
"The maximum X translation value that is swipable from right (negative value). Defaults to negative half view width",
|
|
135
|
+
group: GROUPS.advanced,
|
|
136
|
+
required: false,
|
|
137
|
+
}),
|
|
138
|
+
directionalDistanceChangeThreshold: createStaticNumberProp({
|
|
139
|
+
label: "Change threshold",
|
|
140
|
+
description: "Change the sensitivity of the swipe on the view",
|
|
141
|
+
group: GROUPS.advanced,
|
|
142
|
+
required: false,
|
|
143
|
+
}),
|
|
144
|
+
friction: createStaticNumberProp({
|
|
145
|
+
label: "Friction",
|
|
146
|
+
description: "Controls the 'bounciness' of the swipe animation",
|
|
147
|
+
defaultValue: 20,
|
|
148
|
+
group: GROUPS.advanced,
|
|
149
|
+
required: false,
|
|
150
|
+
}),
|
|
151
|
+
tension: createStaticNumberProp({
|
|
152
|
+
label: "Change threshold",
|
|
153
|
+
description: "Controls the tension/speed of the swipe animation",
|
|
154
|
+
group: GROUPS.advanced,
|
|
155
|
+
required: false,
|
|
156
|
+
}),
|
|
157
|
+
swipeToOpenVelocityContribution: createStaticNumberProp({
|
|
158
|
+
label: "Swipe Velocity Contribution",
|
|
159
|
+
description:
|
|
160
|
+
"Describes how much the ending velocity of the gesture affects whether the swipe will result in the item being closed or open. A velocity factor of 0 (the default) means that the velocity will have no bearing on whether the swipe settles on a closed or open position and it'll just take into consideration the swipeToOpenPercent. Ideal values for this prop tend to be between 5 and 15",
|
|
161
|
+
group: GROUPS.advanced,
|
|
162
|
+
required: false,
|
|
163
|
+
}),
|
|
164
|
+
swipeToOpenPercent: createStaticNumberProp({
|
|
165
|
+
label: "Swipe to open percentage",
|
|
166
|
+
description:
|
|
167
|
+
"What % of the left/right does the user need to swipe past to trigger the view opening",
|
|
168
|
+
group: GROUPS.advanced,
|
|
169
|
+
defaultValue: 50,
|
|
170
|
+
required: false,
|
|
171
|
+
}),
|
|
172
|
+
swipeToClosePercent: createStaticNumberProp({
|
|
173
|
+
label: "Swipe to close percentage",
|
|
174
|
+
description:
|
|
175
|
+
"What % of the left/right does the user need to swipe past to trigger the view closing",
|
|
176
|
+
group: GROUPS.advanced,
|
|
177
|
+
defaultValue: 50,
|
|
178
|
+
required: false,
|
|
179
|
+
}),
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: "Swipeable View Button",
|
|
184
|
+
tag: "SwipeableViewButton",
|
|
185
|
+
description: "Button to be rendered under a Swipeable View",
|
|
186
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
187
|
+
stylesPanelSections: [],
|
|
188
|
+
triggers: [Triggers.OnPress],
|
|
189
|
+
props: {
|
|
190
|
+
...SHARED_SEED_DATA_PROPS,
|
|
191
|
+
onPress: createActionProp(),
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "Swipeable View Swipe Handler",
|
|
196
|
+
tag: "SwipeableViewSwipeHandler",
|
|
197
|
+
description: "Component that renders and handles swipe of Swipeable View",
|
|
198
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
199
|
+
stylesPanelSections: [],
|
|
200
|
+
triggers: [Triggers.OnSwipe],
|
|
201
|
+
props: {
|
|
202
|
+
...SHARED_SEED_DATA_PROPS,
|
|
203
|
+
onSwipe: createActionProp({
|
|
204
|
+
label: "On swipe",
|
|
205
|
+
description:
|
|
206
|
+
"Called when Swipeable View swiped in the direction this is configured to",
|
|
207
|
+
}),
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
];
|
package/src/utilities.js
CHANGED
|
@@ -65,6 +65,47 @@ export function extractBorderAndMarginStyles(style, additionalBorderStyles, addi
|
|
|
65
65
|
]), identity);
|
|
66
66
|
return { borderStyles, marginStyles };
|
|
67
67
|
}
|
|
68
|
+
export const flexItemStyleNames = [
|
|
69
|
+
"alignSelf",
|
|
70
|
+
"flexBasis",
|
|
71
|
+
"flexShrink",
|
|
72
|
+
"flexGrow",
|
|
73
|
+
"flex",
|
|
74
|
+
];
|
|
75
|
+
export function extractFlexItemStyles(style, additionalFlexItemStyles) {
|
|
76
|
+
const flatStyle = StyleSheet.flatten(style || {});
|
|
77
|
+
const flexItemStyles = pickBy(pick(flatStyle, [
|
|
78
|
+
...flexItemStyleNames,
|
|
79
|
+
...(additionalFlexItemStyles ? additionalFlexItemStyles : []),
|
|
80
|
+
]), identity);
|
|
81
|
+
return flexItemStyles;
|
|
82
|
+
}
|
|
83
|
+
export const positionStyleNames = [
|
|
84
|
+
"position",
|
|
85
|
+
"left",
|
|
86
|
+
"right",
|
|
87
|
+
"top",
|
|
88
|
+
"bottom",
|
|
89
|
+
"zIndex",
|
|
90
|
+
"overflow",
|
|
91
|
+
];
|
|
92
|
+
export function extractPositionStyles(style, additionalPositionStyles) {
|
|
93
|
+
const flatStyle = StyleSheet.flatten(style || {});
|
|
94
|
+
const positionStyles = pickBy(pick(flatStyle, [
|
|
95
|
+
...positionStyleNames,
|
|
96
|
+
...(additionalPositionStyles ? additionalPositionStyles : []),
|
|
97
|
+
]), identity);
|
|
98
|
+
return positionStyles;
|
|
99
|
+
}
|
|
100
|
+
export const effectsStyleNames = ["opacity", "elevation"];
|
|
101
|
+
export function extractEffectStyles(style, additionalEffectStyles) {
|
|
102
|
+
const flatStyle = StyleSheet.flatten(style || {});
|
|
103
|
+
const effectStyles = pickBy(pick(flatStyle, [
|
|
104
|
+
...effectsStyleNames,
|
|
105
|
+
...(additionalEffectStyles ? additionalEffectStyles : []),
|
|
106
|
+
]), identity);
|
|
107
|
+
return effectStyles;
|
|
108
|
+
}
|
|
68
109
|
export const sizeStyleNames = ["width", "height"];
|
|
69
110
|
export function extractSizeStyles(style, additionalSizeStyles) {
|
|
70
111
|
const flatStyle = StyleSheet.flatten(style || {});
|