@draftbit/core 47.1.1-8b0b37.2 → 47.1.1-ace71d.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/Button.js +2 -2
- package/lib/commonjs/components/IconButton.js +4 -2
- package/lib/commonjs/components/NumberInput.js +1 -1
- package/lib/commonjs/components/Pressable.js +2 -2
- package/lib/commonjs/components/Touchable.js +2 -2
- package/lib/commonjs/mappings/Button.js +2 -2
- package/lib/commonjs/mappings/DatePicker.js +1 -1
- package/lib/commonjs/mappings/FlashList.js +28 -4
- package/lib/commonjs/mappings/FlatList.js +14 -0
- package/lib/commonjs/mappings/IconButton.js +4 -6
- package/lib/commonjs/mappings/MapView.js +3 -1
- package/lib/commonjs/mappings/ScrollView.js +7 -1
- package/lib/commonjs/mappings/TextField.js +2 -2
- package/lib/commonjs/mappings/Touchable.js +9 -2
- package/lib/module/components/Button.js +2 -2
- package/lib/module/components/CardBlock.js +4 -14
- package/lib/module/components/CircularProgress.js +8 -28
- package/lib/module/components/IconButton.js +4 -2
- package/lib/module/components/Image.js +2 -18
- package/lib/module/components/NumberInput.js +1 -1
- package/lib/module/components/Picker/PickerComponent.android.js +3 -21
- package/lib/module/components/Pressable.js +2 -2
- package/lib/module/components/RadioButton/context.js +1 -1
- package/lib/module/components/Touchable.js +2 -2
- package/lib/module/hooks.js +2 -1
- package/lib/module/mappings/Button.js +2 -2
- package/lib/module/mappings/DatePicker.js +1 -1
- package/lib/module/mappings/FlashList.js +29 -5
- package/lib/module/mappings/FlatList.js +15 -1
- package/lib/module/mappings/IconButton.js +5 -7
- package/lib/module/mappings/MapView.js +3 -1
- package/lib/module/mappings/ScrollView.js +8 -2
- package/lib/module/mappings/TextField.js +2 -2
- package/lib/module/mappings/Touchable.js +10 -3
- package/lib/typescript/src/components/IconButton.d.ts +2 -0
- package/lib/typescript/src/components/IconButton.d.ts.map +1 -1
- package/lib/typescript/src/components/Pressable.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/mappings/DatePicker.d.ts +1 -1
- package/lib/typescript/src/mappings/FlashList.d.ts +57 -8
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +30 -0
- package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/IconButton.d.ts +20 -10
- package/lib/typescript/src/mappings/IconButton.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapView.d.ts +2 -0
- package/lib/typescript/src/mappings/MapView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ScrollView.d.ts +21 -0
- package/lib/typescript/src/mappings/ScrollView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Touchable.d.ts +20 -0
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/Button.js +1 -1
- package/src/components/Button.tsx +2 -2
- package/src/components/IconButton.js +2 -2
- package/src/components/IconButton.tsx +6 -2
- package/src/components/NumberInput.js +1 -1
- package/src/components/NumberInput.tsx +1 -1
- package/src/components/Pressable.js +1 -1
- package/src/components/Pressable.tsx +2 -2
- package/src/components/Touchable.js +1 -1
- package/src/components/Touchable.tsx +2 -2
- package/src/mappings/Button.js +2 -2
- package/src/mappings/Button.ts +2 -2
- package/src/mappings/DatePicker.js +1 -1
- package/src/mappings/DatePicker.ts +1 -1
- package/src/mappings/FlashList.js +29 -5
- package/src/mappings/FlashList.ts +33 -5
- package/src/mappings/FlatList.js +15 -1
- package/src/mappings/FlatList.ts +17 -0
- package/src/mappings/IconButton.js +5 -7
- package/src/mappings/IconButton.ts +5 -7
- package/src/mappings/MapView.js +2 -0
- package/src/mappings/MapView.ts +2 -0
- package/src/mappings/ScrollView.js +8 -2
- package/src/mappings/ScrollView.ts +10 -1
- package/src/mappings/TextField.js +2 -2
- package/src/mappings/TextField.ts +2 -2
- package/src/mappings/Touchable.js +10 -3
- package/src/mappings/Touchable.ts +12 -2
|
@@ -22,6 +22,8 @@ type Props = {
|
|
|
22
22
|
onPress: () => void;
|
|
23
23
|
theme: Theme;
|
|
24
24
|
style?: StyleProp<ViewStyle>;
|
|
25
|
+
activeOpacity?: number;
|
|
26
|
+
disabledOpacity?: number;
|
|
25
27
|
} & PressableProps &
|
|
26
28
|
IconSlot;
|
|
27
29
|
|
|
@@ -30,11 +32,13 @@ const IconButton: React.FC<React.PropsWithChildren<Props>> = ({
|
|
|
30
32
|
icon,
|
|
31
33
|
color: customColor,
|
|
32
34
|
size = 32,
|
|
33
|
-
disabled
|
|
35
|
+
disabled,
|
|
34
36
|
loading = false,
|
|
35
37
|
onPress,
|
|
36
38
|
theme,
|
|
37
39
|
style,
|
|
40
|
+
activeOpacity = 0.8,
|
|
41
|
+
disabledOpacity = 0.8,
|
|
38
42
|
...props
|
|
39
43
|
}) => {
|
|
40
44
|
const iconColor = customColor || theme.colors.primary;
|
|
@@ -47,7 +51,7 @@ const IconButton: React.FC<React.PropsWithChildren<Props>> = ({
|
|
|
47
51
|
return [
|
|
48
52
|
styles.container,
|
|
49
53
|
{
|
|
50
|
-
opacity: pressed
|
|
54
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1,
|
|
51
55
|
width: size,
|
|
52
56
|
height: size,
|
|
53
57
|
alignItems: "center",
|
|
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
|
|
|
2
2
|
import { TextInput } from "react-native";
|
|
3
3
|
import { isString, isNumber, isNaN } from "lodash";
|
|
4
4
|
const NumberInput = ({ onChangeText, value, defaultValue, ...props }) => {
|
|
5
|
-
const [currentStringNumberValue, setCurrentStringNumberValue] = useState("
|
|
5
|
+
const [currentStringNumberValue, setCurrentStringNumberValue] = useState("");
|
|
6
6
|
const formatValueToStringNumber = (valueToFormat) => {
|
|
7
7
|
if (valueToFormat != null) {
|
|
8
8
|
if (isString(valueToFormat) && valueToFormat !== "") {
|
|
@@ -14,7 +14,7 @@ const NumberInput: FC<Props> = ({
|
|
|
14
14
|
defaultValue,
|
|
15
15
|
...props
|
|
16
16
|
}) => {
|
|
17
|
-
const [currentStringNumberValue, setCurrentStringNumberValue] = useState("
|
|
17
|
+
const [currentStringNumberValue, setCurrentStringNumberValue] = useState("");
|
|
18
18
|
|
|
19
19
|
const formatValueToStringNumber = (valueToFormat?: number | string) => {
|
|
20
20
|
if (valueToFormat != null) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Pressable as NativePressable, } from "react-native";
|
|
3
|
-
export default function Pressable({ children, disabled, onPress, activeOpacity, disabledOpacity, delayLongPress, hitSlop, style, ...props }) {
|
|
3
|
+
export default function Pressable({ children, disabled, onPress, activeOpacity = 0.8, disabledOpacity = 0.8, delayLongPress, hitSlop, style, ...props }) {
|
|
4
4
|
return (React.createElement(NativePressable, { onPress: onPress, disabled: disabled, delayLongPress: delayLongPress ? delayLongPress : 500, hitSlop: hitSlop ? hitSlop : 8, style: ({ pressed }) => {
|
|
5
5
|
return [
|
|
6
6
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Pressable } from "react-native";
|
|
3
|
-
export default function Touchable({ children, disabled, onPress, activeOpacity, disabledOpacity, delayLongPress, hitSlop, style, ...props }) {
|
|
3
|
+
export default function Touchable({ children, disabled, onPress, activeOpacity = 0.8, disabledOpacity = 0.8, delayLongPress, hitSlop, style, ...props }) {
|
|
4
4
|
return (React.createElement(Pressable, { disabled: disabled, onPress: onPress, delayLongPress: delayLongPress ? delayLongPress : 500, hitSlop: hitSlop ? hitSlop : 8, style: ({ pressed }) => {
|
|
5
5
|
return [
|
|
6
6
|
{
|
package/src/mappings/Button.js
CHANGED
|
@@ -17,7 +17,7 @@ const SEED_DATA_PROPS = {
|
|
|
17
17
|
activeOpacity: createStaticNumberProp({
|
|
18
18
|
label: "Active Opacity",
|
|
19
19
|
description: "Opacity of the button when active.",
|
|
20
|
-
defaultValue:
|
|
20
|
+
defaultValue: null,
|
|
21
21
|
min: 0,
|
|
22
22
|
max: 1,
|
|
23
23
|
step: 0.01,
|
|
@@ -27,7 +27,7 @@ const SEED_DATA_PROPS = {
|
|
|
27
27
|
disabledOpacity: createStaticNumberProp({
|
|
28
28
|
label: "Disabled Opacity",
|
|
29
29
|
description: "Opacity of the button when disabled.",
|
|
30
|
-
defaultValue:
|
|
30
|
+
defaultValue: null,
|
|
31
31
|
min: 0,
|
|
32
32
|
max: 1,
|
|
33
33
|
step: 0.01,
|
package/src/mappings/Button.ts
CHANGED
|
@@ -28,7 +28,7 @@ const SEED_DATA_PROPS = {
|
|
|
28
28
|
activeOpacity: createStaticNumberProp({
|
|
29
29
|
label: "Active Opacity",
|
|
30
30
|
description: "Opacity of the button when active.",
|
|
31
|
-
defaultValue:
|
|
31
|
+
defaultValue: null,
|
|
32
32
|
min: 0,
|
|
33
33
|
max: 1,
|
|
34
34
|
step: 0.01,
|
|
@@ -38,7 +38,7 @@ const SEED_DATA_PROPS = {
|
|
|
38
38
|
disabledOpacity: createStaticNumberProp({
|
|
39
39
|
label: "Disabled Opacity",
|
|
40
40
|
description: "Opacity of the button when disabled.",
|
|
41
|
-
defaultValue:
|
|
41
|
+
defaultValue: null,
|
|
42
42
|
min: 0,
|
|
43
43
|
max: 1,
|
|
44
44
|
step: 0.01,
|
|
@@ -151,7 +151,7 @@ export const SEED_DATA = [
|
|
|
151
151
|
category: COMPONENT_TYPES.input,
|
|
152
152
|
layout: null,
|
|
153
153
|
triggers: [Triggers.OnDateChange],
|
|
154
|
-
|
|
154
|
+
stylesPanelSections: [
|
|
155
155
|
StylesPanelSections.Typography,
|
|
156
156
|
StylesPanelSections.Background,
|
|
157
157
|
StylesPanelSections.Size,
|
|
@@ -165,7 +165,7 @@ export const SEED_DATA = [
|
|
|
165
165
|
category: COMPONENT_TYPES.input,
|
|
166
166
|
layout: null,
|
|
167
167
|
triggers: [Triggers.OnDateChange],
|
|
168
|
-
|
|
168
|
+
stylesPanelSections: [
|
|
169
169
|
StylesPanelSections.Typography,
|
|
170
170
|
StylesPanelSections.Background,
|
|
171
171
|
StylesPanelSections.Size,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, Triggers, createActionProp, createStaticNumberProp, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, Triggers, createActionProp, createStaticNumberProp, createColorProp, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = [
|
|
3
3
|
{
|
|
4
4
|
name: "Masonry List",
|
|
@@ -25,10 +25,6 @@ export const SEED_DATA = [
|
|
|
25
25
|
step: 1,
|
|
26
26
|
precision: 0,
|
|
27
27
|
}),
|
|
28
|
-
optimizeItemArrangement: createStaticBoolProp({
|
|
29
|
-
label: "Optimize Item Arrangement",
|
|
30
|
-
description: "If enabled, MasonryFlashList will try to reduce difference in column height by modifying item order. If true, specifying overrideItemLayout is required. Default value is false.",
|
|
31
|
-
}),
|
|
32
28
|
initialNumToRender: createStaticNumberProp({
|
|
33
29
|
label: "Initial Num To Render",
|
|
34
30
|
description: "How many items to render in the initial batch",
|
|
@@ -39,6 +35,20 @@ export const SEED_DATA = [
|
|
|
39
35
|
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
40
36
|
defaultValue: 0.5,
|
|
41
37
|
}),
|
|
38
|
+
refreshColor: createColorProp({
|
|
39
|
+
label: "Refreshing Color",
|
|
40
|
+
description: "Color of the refresh indicator",
|
|
41
|
+
}),
|
|
42
|
+
showsHorizontalScrollIndicator: createStaticBoolProp({
|
|
43
|
+
label: "Show Horizontal Scroll Indicator",
|
|
44
|
+
description: "When true, shows a horizontal scroll indicator. The default value is true.",
|
|
45
|
+
defaultValue: true,
|
|
46
|
+
}),
|
|
47
|
+
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
48
|
+
label: "Show Vertical Scroll Indicator",
|
|
49
|
+
description: "When true, shows a vertical scroll indicator. The default value is true.",
|
|
50
|
+
defaultValue: true,
|
|
51
|
+
}),
|
|
42
52
|
},
|
|
43
53
|
},
|
|
44
54
|
{
|
|
@@ -84,6 +94,20 @@ export const SEED_DATA = [
|
|
|
84
94
|
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
85
95
|
defaultValue: 0.5,
|
|
86
96
|
}),
|
|
97
|
+
refreshColor: createColorProp({
|
|
98
|
+
label: "Refreshing Color",
|
|
99
|
+
description: "Color of the refresh indicator",
|
|
100
|
+
}),
|
|
101
|
+
showsHorizontalScrollIndicator: createStaticBoolProp({
|
|
102
|
+
label: "Show Horizontal Scroll Indicator",
|
|
103
|
+
description: "When true, shows a horizontal scroll indicator. The default value is true.",
|
|
104
|
+
defaultValue: true,
|
|
105
|
+
}),
|
|
106
|
+
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
107
|
+
label: "Show Vertical Scroll Indicator",
|
|
108
|
+
description: "When true, shows a vertical scroll indicator. The default value is true.",
|
|
109
|
+
defaultValue: true,
|
|
110
|
+
}),
|
|
87
111
|
},
|
|
88
112
|
},
|
|
89
113
|
];
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
Triggers,
|
|
9
9
|
createActionProp,
|
|
10
10
|
createStaticNumberProp,
|
|
11
|
+
createColorProp,
|
|
11
12
|
} from "@draftbit/types";
|
|
12
13
|
|
|
13
14
|
export const SEED_DATA = [
|
|
@@ -36,11 +37,6 @@ export const SEED_DATA = [
|
|
|
36
37
|
step: 1,
|
|
37
38
|
precision: 0,
|
|
38
39
|
}),
|
|
39
|
-
optimizeItemArrangement: createStaticBoolProp({
|
|
40
|
-
label: "Optimize Item Arrangement",
|
|
41
|
-
description:
|
|
42
|
-
"If enabled, MasonryFlashList will try to reduce difference in column height by modifying item order. If true, specifying overrideItemLayout is required. Default value is false.",
|
|
43
|
-
}),
|
|
44
40
|
initialNumToRender: createStaticNumberProp({
|
|
45
41
|
label: "Initial Num To Render",
|
|
46
42
|
description: "How many items to render in the initial batch",
|
|
@@ -52,6 +48,22 @@ export const SEED_DATA = [
|
|
|
52
48
|
"How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
53
49
|
defaultValue: 0.5,
|
|
54
50
|
}),
|
|
51
|
+
refreshColor: createColorProp({
|
|
52
|
+
label: "Refreshing Color",
|
|
53
|
+
description: "Color of the refresh indicator",
|
|
54
|
+
}),
|
|
55
|
+
showsHorizontalScrollIndicator: createStaticBoolProp({
|
|
56
|
+
label: "Show Horizontal Scroll Indicator",
|
|
57
|
+
description:
|
|
58
|
+
"When true, shows a horizontal scroll indicator. The default value is true.",
|
|
59
|
+
defaultValue: true,
|
|
60
|
+
}),
|
|
61
|
+
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
62
|
+
label: "Show Vertical Scroll Indicator",
|
|
63
|
+
description:
|
|
64
|
+
"When true, shows a vertical scroll indicator. The default value is true.",
|
|
65
|
+
defaultValue: true,
|
|
66
|
+
}),
|
|
55
67
|
},
|
|
56
68
|
},
|
|
57
69
|
{
|
|
@@ -98,6 +110,22 @@ export const SEED_DATA = [
|
|
|
98
110
|
"How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
99
111
|
defaultValue: 0.5,
|
|
100
112
|
}),
|
|
113
|
+
refreshColor: createColorProp({
|
|
114
|
+
label: "Refreshing Color",
|
|
115
|
+
description: "Color of the refresh indicator",
|
|
116
|
+
}),
|
|
117
|
+
showsHorizontalScrollIndicator: createStaticBoolProp({
|
|
118
|
+
label: "Show Horizontal Scroll Indicator",
|
|
119
|
+
description:
|
|
120
|
+
"When true, shows a horizontal scroll indicator. The default value is true.",
|
|
121
|
+
defaultValue: true,
|
|
122
|
+
}),
|
|
123
|
+
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
124
|
+
label: "Show Vertical Scroll Indicator",
|
|
125
|
+
description:
|
|
126
|
+
"When true, shows a vertical scroll indicator. The default value is true.",
|
|
127
|
+
defaultValue: true,
|
|
128
|
+
}),
|
|
101
129
|
},
|
|
102
130
|
},
|
|
103
131
|
];
|
package/src/mappings/FlatList.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createStaticNumberProp, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createStaticNumberProp, createColorProp, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "List",
|
|
4
4
|
tag: "FlatList",
|
|
@@ -33,5 +33,19 @@ export const SEED_DATA = {
|
|
|
33
33
|
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
34
34
|
defaultValue: 0.5,
|
|
35
35
|
}),
|
|
36
|
+
refreshColor: createColorProp({
|
|
37
|
+
label: "Refreshing Color",
|
|
38
|
+
description: "Color of the refresh indicator",
|
|
39
|
+
}),
|
|
40
|
+
showsHorizontalScrollIndicator: createStaticBoolProp({
|
|
41
|
+
label: "Show Horizontal Scroll Indicator",
|
|
42
|
+
description: "When true, shows a horizontal scroll indicator. The default value is true.",
|
|
43
|
+
defaultValue: true,
|
|
44
|
+
}),
|
|
45
|
+
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
46
|
+
label: "Show Vertical Scroll Indicator",
|
|
47
|
+
description: "When true, shows a vertical scroll indicator. The default value is true.",
|
|
48
|
+
defaultValue: true,
|
|
49
|
+
}),
|
|
36
50
|
},
|
|
37
51
|
};
|
package/src/mappings/FlatList.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Triggers,
|
|
7
7
|
createActionProp,
|
|
8
8
|
createStaticNumberProp,
|
|
9
|
+
createColorProp,
|
|
9
10
|
} from "@draftbit/types";
|
|
10
11
|
|
|
11
12
|
export const SEED_DATA = {
|
|
@@ -43,5 +44,21 @@ export const SEED_DATA = {
|
|
|
43
44
|
"How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
44
45
|
defaultValue: 0.5,
|
|
45
46
|
}),
|
|
47
|
+
refreshColor: createColorProp({
|
|
48
|
+
label: "Refreshing Color",
|
|
49
|
+
description: "Color of the refresh indicator",
|
|
50
|
+
}),
|
|
51
|
+
showsHorizontalScrollIndicator: createStaticBoolProp({
|
|
52
|
+
label: "Show Horizontal Scroll Indicator",
|
|
53
|
+
description:
|
|
54
|
+
"When true, shows a horizontal scroll indicator. The default value is true.",
|
|
55
|
+
defaultValue: true,
|
|
56
|
+
}),
|
|
57
|
+
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
58
|
+
label: "Show Vertical Scroll Indicator",
|
|
59
|
+
description:
|
|
60
|
+
"When true, shows a vertical scroll indicator. The default value is true.",
|
|
61
|
+
defaultValue: true,
|
|
62
|
+
}),
|
|
46
63
|
},
|
|
47
64
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, GROUPS, createIconProp, createColorProp, createNumberProp,
|
|
1
|
+
import { COMPONENT_TYPES, GROUPS, createIconProp, createColorProp, createNumberProp, createActionProp, Triggers, StylesPanelSections, createDisabledProp, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Icon Button",
|
|
4
4
|
tag: "IconButton",
|
|
5
5
|
category: COMPONENT_TYPES.button,
|
|
6
6
|
layout: {},
|
|
7
|
-
triggers: [Triggers.OnPress],
|
|
7
|
+
triggers: [Triggers.OnPress, Triggers.OnLongPress],
|
|
8
8
|
stylesPanelSections: [
|
|
9
9
|
StylesPanelSections.Margins,
|
|
10
10
|
StylesPanelSections.Effects,
|
|
@@ -12,22 +12,20 @@ export const SEED_DATA = {
|
|
|
12
12
|
],
|
|
13
13
|
props: {
|
|
14
14
|
onPress: createActionProp(),
|
|
15
|
+
onLongPress: createActionProp(),
|
|
16
|
+
disabled: createDisabledProp(),
|
|
15
17
|
icon: createIconProp(),
|
|
16
18
|
color: createColorProp({
|
|
17
19
|
label: "Color",
|
|
18
20
|
group: GROUPS.basic,
|
|
19
21
|
}),
|
|
20
|
-
disabled: createBoolProp({
|
|
21
|
-
label: "Disabled",
|
|
22
|
-
group: GROUPS.basic,
|
|
23
|
-
}),
|
|
24
22
|
size: createNumberProp({
|
|
25
23
|
group: GROUPS.basic,
|
|
26
24
|
label: "Size",
|
|
27
25
|
description: "Width and height of your icon",
|
|
28
26
|
defaultValue: 32,
|
|
29
27
|
min: 16,
|
|
30
|
-
max:
|
|
28
|
+
max: 256,
|
|
31
29
|
step: 1,
|
|
32
30
|
precision: 0,
|
|
33
31
|
}),
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
createIconProp,
|
|
5
5
|
createColorProp,
|
|
6
6
|
createNumberProp,
|
|
7
|
-
createBoolProp,
|
|
8
7
|
createActionProp,
|
|
9
8
|
Triggers,
|
|
10
9
|
StylesPanelSections,
|
|
10
|
+
createDisabledProp,
|
|
11
11
|
} from "@draftbit/types";
|
|
12
12
|
|
|
13
13
|
export const SEED_DATA = {
|
|
@@ -15,7 +15,7 @@ export const SEED_DATA = {
|
|
|
15
15
|
tag: "IconButton",
|
|
16
16
|
category: COMPONENT_TYPES.button,
|
|
17
17
|
layout: {},
|
|
18
|
-
triggers: [Triggers.OnPress],
|
|
18
|
+
triggers: [Triggers.OnPress, Triggers.OnLongPress],
|
|
19
19
|
stylesPanelSections: [
|
|
20
20
|
StylesPanelSections.Margins,
|
|
21
21
|
StylesPanelSections.Effects,
|
|
@@ -23,22 +23,20 @@ export const SEED_DATA = {
|
|
|
23
23
|
],
|
|
24
24
|
props: {
|
|
25
25
|
onPress: createActionProp(),
|
|
26
|
+
onLongPress: createActionProp(),
|
|
27
|
+
disabled: createDisabledProp(),
|
|
26
28
|
icon: createIconProp(),
|
|
27
29
|
color: createColorProp({
|
|
28
30
|
label: "Color",
|
|
29
31
|
group: GROUPS.basic,
|
|
30
32
|
}),
|
|
31
|
-
disabled: createBoolProp({
|
|
32
|
-
label: "Disabled",
|
|
33
|
-
group: GROUPS.basic,
|
|
34
|
-
}),
|
|
35
33
|
size: createNumberProp({
|
|
36
34
|
group: GROUPS.basic,
|
|
37
35
|
label: "Size",
|
|
38
36
|
description: "Width and height of your icon",
|
|
39
37
|
defaultValue: 32,
|
|
40
38
|
min: 16,
|
|
41
|
-
max:
|
|
39
|
+
max: 256,
|
|
42
40
|
step: 1,
|
|
43
41
|
precision: 0,
|
|
44
42
|
}),
|
package/src/mappings/MapView.js
CHANGED
package/src/mappings/MapView.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Scroll View",
|
|
4
4
|
tag: "ScrollView",
|
|
@@ -6,7 +6,9 @@ export const SEED_DATA = {
|
|
|
6
6
|
category: COMPONENT_TYPES.view,
|
|
7
7
|
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
8
|
layout: {},
|
|
9
|
+
triggers: [Triggers.OnRefresh],
|
|
9
10
|
props: {
|
|
11
|
+
onRefresh: createActionProp(),
|
|
10
12
|
horizontal: createStaticBoolProp({
|
|
11
13
|
label: "Horizontal",
|
|
12
14
|
description: "Render your list horizontally",
|
|
@@ -15,7 +17,7 @@ export const SEED_DATA = {
|
|
|
15
17
|
showsHorizontalScrollIndicator: createStaticBoolProp({
|
|
16
18
|
label: "Show Horizontal Scroll Indicator",
|
|
17
19
|
description: "When true, shows a horizontal scroll indicator. The default value is true.",
|
|
18
|
-
defaultValue:
|
|
20
|
+
defaultValue: true,
|
|
19
21
|
}),
|
|
20
22
|
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
21
23
|
label: "Show Vertical Scroll Indicator",
|
|
@@ -27,5 +29,9 @@ export const SEED_DATA = {
|
|
|
27
29
|
description: "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
|
|
28
30
|
defaultValue: true,
|
|
29
31
|
}),
|
|
32
|
+
refreshColor: createColorProp({
|
|
33
|
+
label: "Refreshing Color",
|
|
34
|
+
description: "Color of the refresh indicator",
|
|
35
|
+
}),
|
|
30
36
|
},
|
|
31
37
|
};
|
|
@@ -2,6 +2,9 @@ import {
|
|
|
2
2
|
COMPONENT_TYPES,
|
|
3
3
|
createStaticBoolProp,
|
|
4
4
|
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
5
|
+
Triggers,
|
|
6
|
+
createActionProp,
|
|
7
|
+
createColorProp,
|
|
5
8
|
} from "@draftbit/types";
|
|
6
9
|
|
|
7
10
|
export const SEED_DATA = {
|
|
@@ -11,7 +14,9 @@ export const SEED_DATA = {
|
|
|
11
14
|
category: COMPONENT_TYPES.view,
|
|
12
15
|
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
13
16
|
layout: {},
|
|
17
|
+
triggers: [Triggers.OnRefresh],
|
|
14
18
|
props: {
|
|
19
|
+
onRefresh: createActionProp(),
|
|
15
20
|
horizontal: createStaticBoolProp({
|
|
16
21
|
label: "Horizontal",
|
|
17
22
|
description: "Render your list horizontally",
|
|
@@ -21,7 +26,7 @@ export const SEED_DATA = {
|
|
|
21
26
|
label: "Show Horizontal Scroll Indicator",
|
|
22
27
|
description:
|
|
23
28
|
"When true, shows a horizontal scroll indicator. The default value is true.",
|
|
24
|
-
defaultValue:
|
|
29
|
+
defaultValue: true,
|
|
25
30
|
}),
|
|
26
31
|
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
27
32
|
label: "Show Vertical Scroll Indicator",
|
|
@@ -35,5 +40,9 @@ export const SEED_DATA = {
|
|
|
35
40
|
"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.",
|
|
36
41
|
defaultValue: true,
|
|
37
42
|
}),
|
|
43
|
+
refreshColor: createColorProp({
|
|
44
|
+
label: "Refreshing Color",
|
|
45
|
+
description: "Color of the refresh indicator",
|
|
46
|
+
}),
|
|
38
47
|
},
|
|
39
48
|
};
|
|
@@ -306,7 +306,7 @@ export const SEED_DATA = [
|
|
|
306
306
|
...SEED_DATA_PROPS,
|
|
307
307
|
type: {
|
|
308
308
|
label: "Appearance",
|
|
309
|
-
description: "Type of
|
|
309
|
+
description: "Type of Field",
|
|
310
310
|
formType: FORM_TYPES.flatArray,
|
|
311
311
|
propType: PROP_TYPES.STRING,
|
|
312
312
|
defaultValue: "solid",
|
|
@@ -357,7 +357,7 @@ export const SEED_DATA = [
|
|
|
357
357
|
...SEED_DATA_PROPS,
|
|
358
358
|
type: {
|
|
359
359
|
label: "Appearance",
|
|
360
|
-
description: "Type of
|
|
360
|
+
description: "Type of Field",
|
|
361
361
|
formType: FORM_TYPES.flatArray,
|
|
362
362
|
propType: PROP_TYPES.STRING,
|
|
363
363
|
defaultValue: "solid",
|
|
@@ -328,7 +328,7 @@ export const SEED_DATA = [
|
|
|
328
328
|
...SEED_DATA_PROPS,
|
|
329
329
|
type: {
|
|
330
330
|
label: "Appearance",
|
|
331
|
-
description: "Type of
|
|
331
|
+
description: "Type of Field",
|
|
332
332
|
formType: FORM_TYPES.flatArray,
|
|
333
333
|
propType: PROP_TYPES.STRING,
|
|
334
334
|
defaultValue: "solid",
|
|
@@ -380,7 +380,7 @@ export const SEED_DATA = [
|
|
|
380
380
|
...SEED_DATA_PROPS,
|
|
381
381
|
type: {
|
|
382
382
|
label: "Appearance",
|
|
383
|
-
description: "Type of
|
|
383
|
+
description: "Type of Field",
|
|
384
384
|
formType: FORM_TYPES.flatArray,
|
|
385
385
|
propType: PROP_TYPES.STRING,
|
|
386
386
|
defaultValue: "solid",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections, createDisabledProp, GROUPS, createStaticBoolProp, } from "@draftbit/types";
|
|
2
2
|
const SEED_DATA_PROPS = {
|
|
3
3
|
stylesPanelSections: [
|
|
4
4
|
StylesPanelSections.Size,
|
|
@@ -10,10 +10,11 @@ const SEED_DATA_PROPS = {
|
|
|
10
10
|
props: {
|
|
11
11
|
onPress: createActionProp(),
|
|
12
12
|
onLongPress: createActionProp(),
|
|
13
|
+
disabled: createDisabledProp(),
|
|
13
14
|
activeOpacity: createStaticNumberProp({
|
|
14
15
|
label: "Active Opacity",
|
|
15
16
|
description: "The opacity when the button is pressed.",
|
|
16
|
-
defaultValue:
|
|
17
|
+
defaultValue: null,
|
|
17
18
|
min: 0,
|
|
18
19
|
max: 1,
|
|
19
20
|
step: 0.01,
|
|
@@ -23,7 +24,7 @@ const SEED_DATA_PROPS = {
|
|
|
23
24
|
disabledOpacity: createStaticNumberProp({
|
|
24
25
|
label: "Disabled Opacity",
|
|
25
26
|
description: "The opacity when the button is disabled.",
|
|
26
|
-
defaultValue:
|
|
27
|
+
defaultValue: null,
|
|
27
28
|
min: 0,
|
|
28
29
|
max: 1,
|
|
29
30
|
step: 0.01,
|
|
@@ -40,6 +41,12 @@ const SEED_DATA_PROPS = {
|
|
|
40
41
|
description: "Sets additional distance outside of element in which a press can be detected.",
|
|
41
42
|
required: false,
|
|
42
43
|
}),
|
|
44
|
+
android_disableSound: createStaticBoolProp({
|
|
45
|
+
label: "Disable Sound",
|
|
46
|
+
description: "Disable the Android sound effect.",
|
|
47
|
+
defaultValue: null,
|
|
48
|
+
group: GROUPS.android,
|
|
49
|
+
}),
|
|
43
50
|
},
|
|
44
51
|
};
|
|
45
52
|
export const SEED_DATA = [
|
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
Triggers,
|
|
5
5
|
createStaticNumberProp,
|
|
6
6
|
StylesPanelSections,
|
|
7
|
+
createDisabledProp,
|
|
8
|
+
GROUPS,
|
|
9
|
+
createStaticBoolProp,
|
|
7
10
|
} from "@draftbit/types";
|
|
8
11
|
|
|
9
12
|
const SEED_DATA_PROPS = {
|
|
@@ -17,10 +20,11 @@ const SEED_DATA_PROPS = {
|
|
|
17
20
|
props: {
|
|
18
21
|
onPress: createActionProp(),
|
|
19
22
|
onLongPress: createActionProp(),
|
|
23
|
+
disabled: createDisabledProp(),
|
|
20
24
|
activeOpacity: createStaticNumberProp({
|
|
21
25
|
label: "Active Opacity",
|
|
22
26
|
description: "The opacity when the button is pressed.",
|
|
23
|
-
defaultValue:
|
|
27
|
+
defaultValue: null,
|
|
24
28
|
min: 0,
|
|
25
29
|
max: 1,
|
|
26
30
|
step: 0.01,
|
|
@@ -30,7 +34,7 @@ const SEED_DATA_PROPS = {
|
|
|
30
34
|
disabledOpacity: createStaticNumberProp({
|
|
31
35
|
label: "Disabled Opacity",
|
|
32
36
|
description: "The opacity when the button is disabled.",
|
|
33
|
-
defaultValue:
|
|
37
|
+
defaultValue: null,
|
|
34
38
|
min: 0,
|
|
35
39
|
max: 1,
|
|
36
40
|
step: 0.01,
|
|
@@ -49,6 +53,12 @@ const SEED_DATA_PROPS = {
|
|
|
49
53
|
"Sets additional distance outside of element in which a press can be detected.",
|
|
50
54
|
required: false,
|
|
51
55
|
}),
|
|
56
|
+
android_disableSound: createStaticBoolProp({
|
|
57
|
+
label: "Disable Sound",
|
|
58
|
+
description: "Disable the Android sound effect.",
|
|
59
|
+
defaultValue: null,
|
|
60
|
+
group: GROUPS.android,
|
|
61
|
+
}),
|
|
52
62
|
},
|
|
53
63
|
};
|
|
54
64
|
|