@draftbit/core 47.2.1-a33ddf.2 → 47.2.1-d833e1.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 (81) hide show
  1. package/lib/commonjs/components/BottomSheet/BottomSheet.js +18 -3
  2. package/lib/commonjs/components/BottomSheet/BottomSheet.js.map +1 -1
  3. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +16 -3
  4. package/lib/commonjs/components/Checkbox/CheckboxGroup.js.map +1 -1
  5. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +22 -5
  6. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js.map +1 -1
  7. package/lib/commonjs/components/Checkbox/CheckboxRow.js +6 -23
  8. package/lib/commonjs/components/Checkbox/CheckboxRow.js.map +1 -1
  9. package/lib/commonjs/components/SwipeableView/SwipeableView.js +155 -0
  10. package/lib/commonjs/components/SwipeableView/SwipeableView.js.map +1 -0
  11. package/lib/commonjs/components/SwipeableView/SwipeableViewButton.js +13 -0
  12. package/lib/commonjs/components/SwipeableView/SwipeableViewButton.js.map +1 -0
  13. package/lib/commonjs/components/SwipeableView/SwipeableViewSwipeHandler.js +13 -0
  14. package/lib/commonjs/components/SwipeableView/SwipeableViewSwipeHandler.js.map +1 -0
  15. package/lib/commonjs/components/SwipeableView/index.js +28 -0
  16. package/lib/commonjs/components/SwipeableView/index.js.map +1 -0
  17. package/lib/commonjs/index.js +19 -0
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/commonjs/mappings/BottomSheet.js +37 -9
  20. package/lib/commonjs/mappings/BottomSheet.js.map +1 -1
  21. package/lib/commonjs/mappings/SwipeableView.js +183 -0
  22. package/lib/commonjs/mappings/SwipeableView.js.map +1 -0
  23. package/lib/commonjs/utilities.js +27 -2
  24. package/lib/commonjs/utilities.js.map +1 -1
  25. package/lib/module/components/BottomSheet/BottomSheet.js +18 -3
  26. package/lib/module/components/BottomSheet/BottomSheet.js.map +1 -1
  27. package/lib/module/components/SwipeableView/SwipeableView.js +147 -0
  28. package/lib/module/components/SwipeableView/SwipeableView.js.map +1 -0
  29. package/lib/module/components/SwipeableView/SwipeableViewButton.js +6 -0
  30. package/lib/module/components/SwipeableView/SwipeableViewButton.js.map +1 -0
  31. package/lib/module/components/SwipeableView/SwipeableViewSwipeHandler.js +6 -0
  32. package/lib/module/components/SwipeableView/SwipeableViewSwipeHandler.js.map +1 -0
  33. package/lib/module/components/SwipeableView/index.js +4 -0
  34. package/lib/module/components/SwipeableView/index.js.map +1 -0
  35. package/lib/module/constants.js +1 -1
  36. package/lib/module/index.js +1 -0
  37. package/lib/module/index.js.map +1 -1
  38. package/lib/module/mappings/BottomSheet.js +38 -10
  39. package/lib/module/mappings/BottomSheet.js.map +1 -1
  40. package/lib/module/mappings/SwipeableView.js +175 -0
  41. package/lib/module/mappings/SwipeableView.js.map +1 -0
  42. package/lib/module/mappings/TextArea.js.map +1 -1
  43. package/lib/module/utilities.js +18 -0
  44. package/lib/module/utilities.js.map +1 -1
  45. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +6 -1
  46. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -1
  47. package/lib/typescript/src/components/SwipeableView/SwipeableView.d.ts +29 -0
  48. package/lib/typescript/src/components/SwipeableView/SwipeableView.d.ts.map +1 -0
  49. package/lib/typescript/src/components/SwipeableView/SwipeableViewButton.d.ts +13 -0
  50. package/lib/typescript/src/components/SwipeableView/SwipeableViewButton.d.ts.map +1 -0
  51. package/lib/typescript/src/components/SwipeableView/SwipeableViewSwipeHandler.d.ts +13 -0
  52. package/lib/typescript/src/components/SwipeableView/SwipeableViewSwipeHandler.d.ts.map +1 -0
  53. package/lib/typescript/src/components/SwipeableView/index.d.ts +4 -0
  54. package/lib/typescript/src/components/SwipeableView/index.d.ts.map +1 -0
  55. package/lib/typescript/src/index.d.ts +1 -0
  56. package/lib/typescript/src/index.d.ts.map +1 -1
  57. package/lib/typescript/src/mappings/BottomSheet.d.ts +48 -4
  58. package/lib/typescript/src/mappings/BottomSheet.d.ts.map +1 -1
  59. package/lib/typescript/src/mappings/SwipeableView.d.ts +426 -0
  60. package/lib/typescript/src/mappings/SwipeableView.d.ts.map +1 -0
  61. package/lib/typescript/src/utilities.d.ts +6 -0
  62. package/lib/typescript/src/utilities.d.ts.map +1 -1
  63. package/package.json +4 -3
  64. package/src/components/BottomSheet/BottomSheet.js +17 -2
  65. package/src/components/BottomSheet/BottomSheet.tsx +32 -4
  66. package/src/components/SwipeableView/SwipeableView.js +117 -0
  67. package/src/components/SwipeableView/SwipeableView.tsx +299 -0
  68. package/src/components/SwipeableView/SwipeableViewButton.js +5 -0
  69. package/src/components/SwipeableView/SwipeableViewButton.tsx +18 -0
  70. package/src/components/SwipeableView/SwipeableViewSwipeHandler.js +5 -0
  71. package/src/components/SwipeableView/SwipeableViewSwipeHandler.tsx +20 -0
  72. package/src/components/SwipeableView/index.js +3 -0
  73. package/src/components/SwipeableView/index.tsx +3 -0
  74. package/src/index.js +1 -0
  75. package/src/index.tsx +6 -0
  76. package/src/mappings/BottomSheet.js +37 -9
  77. package/src/mappings/BottomSheet.ts +43 -8
  78. package/src/mappings/SwipeableView.js +181 -0
  79. package/src/mappings/SwipeableView.ts +210 -0
  80. package/src/utilities.js +41 -0
  81. package/src/utilities.ts +71 -0
@@ -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 || {});
package/src/utilities.ts CHANGED
@@ -98,6 +98,77 @@ export function extractBorderAndMarginStyles(
98
98
  return { borderStyles, marginStyles };
99
99
  }
100
100
 
101
+ export const flexItemStyleNames = [
102
+ "alignSelf",
103
+ "flexBasis",
104
+ "flexShrink",
105
+ "flexGrow",
106
+ "flex",
107
+ ];
108
+
109
+ export function extractFlexItemStyles(
110
+ style: StyleProp<any>,
111
+ additionalFlexItemStyles?: string[]
112
+ ) {
113
+ const flatStyle = StyleSheet.flatten(style || {});
114
+
115
+ const flexItemStyles = pickBy(
116
+ pick(flatStyle, [
117
+ ...flexItemStyleNames,
118
+ ...(additionalFlexItemStyles ? additionalFlexItemStyles : []),
119
+ ]),
120
+ identity
121
+ );
122
+
123
+ return flexItemStyles;
124
+ }
125
+
126
+ export const positionStyleNames = [
127
+ "position",
128
+ "left",
129
+ "right",
130
+ "top",
131
+ "bottom",
132
+ "zIndex",
133
+ "overflow",
134
+ ];
135
+
136
+ export function extractPositionStyles(
137
+ style: StyleProp<any>,
138
+ additionalPositionStyles?: string[]
139
+ ) {
140
+ const flatStyle = StyleSheet.flatten(style || {});
141
+
142
+ const positionStyles = pickBy(
143
+ pick(flatStyle, [
144
+ ...positionStyleNames,
145
+ ...(additionalPositionStyles ? additionalPositionStyles : []),
146
+ ]),
147
+ identity
148
+ );
149
+
150
+ return positionStyles;
151
+ }
152
+
153
+ export const effectsStyleNames = ["opacity", "elevation"];
154
+
155
+ export function extractEffectStyles(
156
+ style: StyleProp<any>,
157
+ additionalEffectStyles?: string[]
158
+ ) {
159
+ const flatStyle = StyleSheet.flatten(style || {});
160
+
161
+ const effectStyles = pickBy(
162
+ pick(flatStyle, [
163
+ ...effectsStyleNames,
164
+ ...(additionalEffectStyles ? additionalEffectStyles : []),
165
+ ]),
166
+ identity
167
+ );
168
+
169
+ return effectStyles;
170
+ }
171
+
101
172
  export const sizeStyleNames = ["width", "height"];
102
173
 
103
174
  export function extractSizeStyles(