@draftbit/core 47.0.1-ed6e56.2 → 47.1.1-1883fa.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 +3 -3
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -3
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +1 -2
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -2
- package/lib/commonjs/components/DatePicker/DatePicker.js +0 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.js +9 -3
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +1 -0
- package/lib/commonjs/components/DeprecatedButton.js +3 -27
- package/lib/commonjs/components/DeprecatedFAB.js +1 -2
- package/lib/commonjs/components/Pressable.js +37 -0
- package/lib/commonjs/components/Swiper/Swiper.js +2 -0
- package/lib/commonjs/components/Touchable.js +8 -3
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/mappings/Button.js +39 -10
- package/lib/commonjs/mappings/DatePicker.js +1 -1
- package/lib/commonjs/mappings/FlashList.js +79 -2
- package/lib/commonjs/mappings/FlatList.js +27 -0
- package/lib/commonjs/mappings/ScrollView.js +6 -0
- package/lib/commonjs/mappings/Swiper.js +2 -0
- package/lib/commonjs/mappings/TextField.js +2 -2
- package/lib/commonjs/mappings/Touchable.js +47 -7
- package/lib/module/components/Button.js +3 -3
- package/lib/module/components/Checkbox/Checkbox.js +2 -3
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +2 -3
- package/lib/module/components/Checkbox/CheckboxRow.js +2 -3
- package/lib/module/components/DatePicker/DatePicker.js +0 -1
- package/lib/module/components/DatePicker/DatePickerComponent.js +9 -3
- package/lib/module/components/DatePicker/DatePickerComponent.web.js +1 -0
- package/lib/module/components/DeprecatedButton.js +4 -28
- package/lib/module/components/DeprecatedFAB.js +2 -3
- package/lib/module/components/Pressable.js +30 -0
- package/lib/module/components/Swiper/Swiper.js +2 -0
- package/lib/module/components/Touchable.js +8 -3
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/Button.js +40 -11
- package/lib/module/mappings/DatePicker.js +1 -1
- package/lib/module/mappings/FlashList.js +80 -3
- package/lib/module/mappings/FlatList.js +28 -1
- package/lib/module/mappings/ScrollView.js +7 -1
- package/lib/module/mappings/Swiper.js +3 -1
- package/lib/module/mappings/TextField.js +2 -2
- package/lib/module/mappings/Touchable.js +49 -9
- package/lib/typescript/src/components/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/src/components/Checkbox/CheckboxGroupRow.d.ts.map +1 -1
- package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts +0 -2
- package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedButton.d.ts +2 -2
- package/lib/typescript/src/components/DeprecatedButton.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
- package/lib/typescript/src/components/Pressable.d.ts +10 -0
- package/lib/typescript/src/components/Pressable.d.ts.map +1 -0
- package/lib/typescript/src/components/Swiper/Swiper.d.ts +2 -1
- package/lib/typescript/src/components/Swiper/Swiper.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.d.ts +5 -6
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Button.d.ts +113 -4
- package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
- package/lib/typescript/src/mappings/DatePicker.d.ts +1 -1
- package/lib/typescript/src/mappings/FlashList.d.ts +183 -2
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +73 -0
- package/lib/typescript/src/mappings/FlatList.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/Swiper.d.ts +11 -0
- package/lib/typescript/src/mappings/Swiper.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Touchable.d.ts +59 -5
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/Button.js +3 -3
- package/src/components/Button.tsx +14 -4
- package/src/components/Checkbox/Checkbox.js +2 -3
- package/src/components/Checkbox/Checkbox.tsx +5 -7
- package/src/components/Checkbox/CheckboxGroupRow.js +2 -3
- package/src/components/Checkbox/CheckboxGroupRow.tsx +3 -3
- package/src/components/Checkbox/CheckboxRow.js +2 -3
- package/src/components/Checkbox/CheckboxRow.tsx +3 -3
- package/src/components/DatePicker/DatePicker.js +1 -1
- package/src/components/DatePicker/DatePicker.tsx +0 -1
- package/src/components/DatePicker/DatePickerComponent.js +5 -3
- package/src/components/DatePicker/DatePickerComponent.tsx +11 -3
- package/src/components/DatePicker/DatePickerComponent.web.js +1 -1
- package/src/components/DatePicker/DatePickerComponent.web.tsx +1 -0
- package/src/components/DatePicker/DatePickerComponentType.ts +0 -9
- package/src/components/DeprecatedButton.js +4 -16
- package/src/components/DeprecatedButton.tsx +7 -31
- package/src/components/DeprecatedFAB.js +2 -3
- package/src/components/DeprecatedFAB.tsx +5 -5
- package/src/components/Pressable.js +12 -0
- package/src/components/Pressable.tsx +44 -0
- package/src/components/Swiper/Swiper.js +2 -2
- package/src/components/Swiper/Swiper.tsx +3 -0
- package/src/components/Touchable.js +3 -3
- package/src/components/Touchable.tsx +11 -7
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/Button.js +39 -10
- package/src/mappings/Button.ts +41 -10
- package/src/mappings/DatePicker.js +1 -1
- package/src/mappings/DatePicker.ts +1 -1
- package/src/mappings/FlashList.js +111 -31
- package/src/mappings/FlashList.ts +120 -30
- package/src/mappings/FlatList.js +28 -1
- package/src/mappings/FlatList.ts +34 -0
- package/src/mappings/ScrollView.js +7 -1
- package/src/mappings/ScrollView.ts +9 -0
- package/src/mappings/Swiper.js +3 -1
- package/src/mappings/Swiper.ts +4 -0
- package/src/mappings/TextField.js +2 -2
- package/src/mappings/TextField.ts +2 -2
- package/src/mappings/Touchable.js +50 -7
- package/src/mappings/Touchable.ts +53 -6
- package/lib/commonjs/components/DatePicker/DatePickerInput.js +0 -133
- package/lib/module/components/DatePicker/DatePickerInput.js +0 -123
- package/lib/typescript/src/components/DatePicker/DatePickerInput.d.ts +0 -18
- package/lib/typescript/src/components/DatePicker/DatePickerInput.d.ts.map +0 -1
- package/src/components/DatePicker/DatePickerInput.js +0 -97
- package/src/components/DatePicker/DatePickerInput.tsx +0 -195
package/src/mappings/Button.ts
CHANGED
|
@@ -7,11 +7,13 @@ import {
|
|
|
7
7
|
createActionProp,
|
|
8
8
|
Triggers,
|
|
9
9
|
StylesPanelSections,
|
|
10
|
+
createStaticNumberProp,
|
|
10
11
|
} from "@draftbit/types";
|
|
11
12
|
|
|
12
|
-
const SEED_DATA_TRIGGERS = [Triggers.OnPress];
|
|
13
|
+
const SEED_DATA_TRIGGERS = [Triggers.OnPress, Triggers.OnLongPress];
|
|
13
14
|
const SEED_DATA_PROPS = {
|
|
14
15
|
onPress: createActionProp(),
|
|
16
|
+
onLongPress: createActionProp(),
|
|
15
17
|
icon: createIconProp({
|
|
16
18
|
defaultValue: null,
|
|
17
19
|
required: false,
|
|
@@ -23,12 +25,38 @@ const SEED_DATA_PROPS = {
|
|
|
23
25
|
}),
|
|
24
26
|
disabled: createDisabledProp(),
|
|
25
27
|
loading: createLoadingProp(),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
activeOpacity: createStaticNumberProp({
|
|
29
|
+
label: "Active Opacity",
|
|
30
|
+
description: "Opacity of the button when active.",
|
|
31
|
+
defaultValue: 0.8,
|
|
32
|
+
min: 0,
|
|
33
|
+
max: 1,
|
|
34
|
+
step: 0.01,
|
|
35
|
+
precision: 2,
|
|
36
|
+
required: false,
|
|
37
|
+
}),
|
|
38
|
+
disabledOpacity: createStaticNumberProp({
|
|
39
|
+
label: "Disabled Opacity",
|
|
40
|
+
description: "Opacity of the button when disabled.",
|
|
41
|
+
defaultValue: 0.8,
|
|
42
|
+
min: 0,
|
|
43
|
+
max: 1,
|
|
44
|
+
step: 0.01,
|
|
45
|
+
precision: 2,
|
|
46
|
+
required: false,
|
|
47
|
+
}),
|
|
48
|
+
delayLongPress: createStaticNumberProp({
|
|
49
|
+
label: "Delay Long Press",
|
|
50
|
+
description:
|
|
51
|
+
"Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
52
|
+
required: false,
|
|
53
|
+
}),
|
|
54
|
+
hitSlop: createStaticNumberProp({
|
|
55
|
+
label: "Hit Slop",
|
|
56
|
+
description:
|
|
57
|
+
"Sets additional distance outside of element in which a press can be detected",
|
|
58
|
+
required: false,
|
|
59
|
+
}),
|
|
32
60
|
};
|
|
33
61
|
|
|
34
62
|
export const SEED_DATA = [
|
|
@@ -46,7 +74,8 @@ export const SEED_DATA = [
|
|
|
46
74
|
StylesPanelSections.Effects,
|
|
47
75
|
],
|
|
48
76
|
layout: {
|
|
49
|
-
|
|
77
|
+
borderRadius: 8,
|
|
78
|
+
fontFamily: "system-700",
|
|
50
79
|
backgroundColor: "transparent",
|
|
51
80
|
borderWidth: 1,
|
|
52
81
|
textAlign: "center",
|
|
@@ -68,7 +97,8 @@ export const SEED_DATA = [
|
|
|
68
97
|
StylesPanelSections.Effects,
|
|
69
98
|
],
|
|
70
99
|
layout: {
|
|
71
|
-
|
|
100
|
+
borderRadius: 8,
|
|
101
|
+
fontFamily: "system-700",
|
|
72
102
|
backgroundColor: "primary",
|
|
73
103
|
textAlign: "center",
|
|
74
104
|
},
|
|
@@ -89,7 +119,8 @@ export const SEED_DATA = [
|
|
|
89
119
|
StylesPanelSections.Effects,
|
|
90
120
|
],
|
|
91
121
|
layout: {
|
|
92
|
-
|
|
122
|
+
borderRadius: 8,
|
|
123
|
+
fontFamily: "system-700",
|
|
93
124
|
backgroundColor: "primary",
|
|
94
125
|
textAlign: "center",
|
|
95
126
|
},
|
|
@@ -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,33 +1,113 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, } from "@draftbit/types";
|
|
2
|
-
export const SEED_DATA =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, Triggers, createActionProp, createStaticNumberProp, createColorProp, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = [
|
|
3
|
+
{
|
|
4
|
+
name: "Masonry List",
|
|
5
|
+
tag: "MasonryFlashList",
|
|
6
|
+
description: "Masonry Flashlist by Shopify",
|
|
7
|
+
packageName: "@shopify/flash-list",
|
|
8
|
+
category: COMPONENT_TYPES.data,
|
|
9
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
10
|
+
layout: {
|
|
11
|
+
flex: 1,
|
|
12
|
+
},
|
|
13
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
14
|
+
props: {
|
|
15
|
+
onRefresh: createActionProp(),
|
|
16
|
+
onEndReached: createActionProp(),
|
|
17
|
+
numColumns: createNumColumnsType({
|
|
18
|
+
editable: true,
|
|
19
|
+
}),
|
|
20
|
+
estimatedItemSize: createNumberProp({
|
|
21
|
+
group: GROUPS.basic,
|
|
22
|
+
label: "Est. Item Size",
|
|
23
|
+
description: "Approximate size of the items before rendering.",
|
|
24
|
+
defaultValue: 50,
|
|
25
|
+
step: 1,
|
|
26
|
+
precision: 0,
|
|
27
|
+
}),
|
|
28
|
+
initialNumToRender: createStaticNumberProp({
|
|
29
|
+
label: "Initial Num To Render",
|
|
30
|
+
description: "How many items to render in the initial batch",
|
|
31
|
+
defaultValue: null,
|
|
32
|
+
}),
|
|
33
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
34
|
+
label: "End Reached Threshold",
|
|
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.",
|
|
36
|
+
defaultValue: 0.5,
|
|
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 false.",
|
|
45
|
+
defaultValue: false,
|
|
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
|
+
}),
|
|
52
|
+
},
|
|
11
53
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
54
|
+
{
|
|
55
|
+
name: "FlashList",
|
|
56
|
+
tag: "FlashList",
|
|
57
|
+
description: "Flashlist by Shopify",
|
|
58
|
+
packageName: "@shopify/flash-list",
|
|
59
|
+
category: COMPONENT_TYPES.data,
|
|
60
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
61
|
+
layout: {
|
|
62
|
+
flex: 1,
|
|
63
|
+
},
|
|
64
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
65
|
+
props: {
|
|
66
|
+
onRefresh: createActionProp(),
|
|
67
|
+
onEndReached: createActionProp(),
|
|
68
|
+
estimatedItemSize: createNumberProp({
|
|
69
|
+
group: GROUPS.basic,
|
|
70
|
+
label: "Est. Item Size",
|
|
71
|
+
description: "Approximate size of the items before rendering.",
|
|
72
|
+
defaultValue: 50,
|
|
73
|
+
step: 1,
|
|
74
|
+
precision: 0,
|
|
75
|
+
}),
|
|
76
|
+
horizontal: createStaticBoolProp({
|
|
77
|
+
label: "Horizontal",
|
|
78
|
+
description: "Render list horizontally",
|
|
79
|
+
}),
|
|
80
|
+
inverted: createStaticBoolProp({
|
|
81
|
+
label: "Inverted",
|
|
82
|
+
description: "If true, reverses the direction.",
|
|
83
|
+
}),
|
|
84
|
+
numColumns: createNumColumnsType({
|
|
85
|
+
editable: true,
|
|
86
|
+
}),
|
|
87
|
+
initialNumToRender: createStaticNumberProp({
|
|
88
|
+
label: "Initial Num To Render",
|
|
89
|
+
description: "How many items to render in the initial batch",
|
|
90
|
+
defaultValue: null,
|
|
91
|
+
}),
|
|
92
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
93
|
+
label: "End Reached Threshold",
|
|
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.",
|
|
95
|
+
defaultValue: 0.5,
|
|
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 false.",
|
|
104
|
+
defaultValue: false,
|
|
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
|
+
}),
|
|
111
|
+
},
|
|
32
112
|
},
|
|
33
|
-
|
|
113
|
+
];
|
|
@@ -5,37 +5,127 @@ import {
|
|
|
5
5
|
createNumberProp,
|
|
6
6
|
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
7
7
|
GROUPS,
|
|
8
|
+
Triggers,
|
|
9
|
+
createActionProp,
|
|
10
|
+
createStaticNumberProp,
|
|
11
|
+
createColorProp,
|
|
8
12
|
} from "@draftbit/types";
|
|
9
13
|
|
|
10
|
-
export const SEED_DATA =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
export const SEED_DATA = [
|
|
15
|
+
{
|
|
16
|
+
name: "Masonry List",
|
|
17
|
+
tag: "MasonryFlashList",
|
|
18
|
+
description: "Masonry Flashlist by Shopify",
|
|
19
|
+
packageName: "@shopify/flash-list",
|
|
20
|
+
category: COMPONENT_TYPES.data,
|
|
21
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
22
|
+
layout: {
|
|
23
|
+
flex: 1,
|
|
24
|
+
},
|
|
25
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
26
|
+
props: {
|
|
27
|
+
onRefresh: createActionProp(),
|
|
28
|
+
onEndReached: createActionProp(),
|
|
29
|
+
numColumns: createNumColumnsType({
|
|
30
|
+
editable: true,
|
|
31
|
+
}),
|
|
32
|
+
estimatedItemSize: createNumberProp({
|
|
33
|
+
group: GROUPS.basic,
|
|
34
|
+
label: "Est. Item Size",
|
|
35
|
+
description: "Approximate size of the items before rendering.",
|
|
36
|
+
defaultValue: 50,
|
|
37
|
+
step: 1,
|
|
38
|
+
precision: 0,
|
|
39
|
+
}),
|
|
40
|
+
initialNumToRender: createStaticNumberProp({
|
|
41
|
+
label: "Initial Num To Render",
|
|
42
|
+
description: "How many items to render in the initial batch",
|
|
43
|
+
defaultValue: null,
|
|
44
|
+
}),
|
|
45
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
46
|
+
label: "End Reached Threshold",
|
|
47
|
+
description:
|
|
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.",
|
|
49
|
+
defaultValue: 0.5,
|
|
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 false.",
|
|
59
|
+
defaultValue: false,
|
|
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
|
+
}),
|
|
67
|
+
},
|
|
19
68
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
69
|
+
{
|
|
70
|
+
name: "FlashList",
|
|
71
|
+
tag: "FlashList",
|
|
72
|
+
description: "Flashlist by Shopify",
|
|
73
|
+
packageName: "@shopify/flash-list",
|
|
74
|
+
category: COMPONENT_TYPES.data,
|
|
75
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
76
|
+
layout: {
|
|
77
|
+
flex: 1,
|
|
78
|
+
},
|
|
79
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
80
|
+
props: {
|
|
81
|
+
onRefresh: createActionProp(),
|
|
82
|
+
onEndReached: createActionProp(),
|
|
83
|
+
estimatedItemSize: createNumberProp({
|
|
84
|
+
group: GROUPS.basic,
|
|
85
|
+
label: "Est. Item Size",
|
|
86
|
+
description: "Approximate size of the items before rendering.",
|
|
87
|
+
defaultValue: 50,
|
|
88
|
+
step: 1,
|
|
89
|
+
precision: 0,
|
|
90
|
+
}),
|
|
91
|
+
horizontal: createStaticBoolProp({
|
|
92
|
+
label: "Horizontal",
|
|
93
|
+
description: "Render list horizontally",
|
|
94
|
+
}),
|
|
95
|
+
inverted: createStaticBoolProp({
|
|
96
|
+
label: "Inverted",
|
|
97
|
+
description: "If true, reverses the direction.",
|
|
98
|
+
}),
|
|
99
|
+
numColumns: createNumColumnsType({
|
|
100
|
+
editable: true,
|
|
101
|
+
}),
|
|
102
|
+
initialNumToRender: createStaticNumberProp({
|
|
103
|
+
label: "Initial Num To Render",
|
|
104
|
+
description: "How many items to render in the initial batch",
|
|
105
|
+
defaultValue: null,
|
|
106
|
+
}),
|
|
107
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
108
|
+
label: "End Reached Threshold",
|
|
109
|
+
description:
|
|
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.",
|
|
111
|
+
defaultValue: 0.5,
|
|
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 false.",
|
|
121
|
+
defaultValue: false,
|
|
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
|
+
}),
|
|
129
|
+
},
|
|
40
130
|
},
|
|
41
|
-
|
|
131
|
+
];
|
package/src/mappings/FlatList.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, } 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",
|
|
@@ -8,7 +8,10 @@ export const SEED_DATA = {
|
|
|
8
8
|
layout: {
|
|
9
9
|
flex: 1,
|
|
10
10
|
},
|
|
11
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
11
12
|
props: {
|
|
13
|
+
onRefresh: createActionProp(),
|
|
14
|
+
onEndReached: createActionProp(),
|
|
12
15
|
horizontal: createStaticBoolProp({
|
|
13
16
|
label: "Horizontal",
|
|
14
17
|
description: "Render list horizontally",
|
|
@@ -20,5 +23,29 @@ export const SEED_DATA = {
|
|
|
20
23
|
numColumns: createNumColumnsType({
|
|
21
24
|
editable: true,
|
|
22
25
|
}),
|
|
26
|
+
initialNumToRender: createStaticNumberProp({
|
|
27
|
+
label: "Initial Num To Render",
|
|
28
|
+
description: "How many items to render in the initial batch",
|
|
29
|
+
defaultValue: null,
|
|
30
|
+
}),
|
|
31
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
32
|
+
label: "End Reached Threshold",
|
|
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
|
+
defaultValue: 0.5,
|
|
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 false.",
|
|
43
|
+
defaultValue: false,
|
|
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
|
+
}),
|
|
23
50
|
},
|
|
24
51
|
};
|
package/src/mappings/FlatList.ts
CHANGED
|
@@ -3,6 +3,10 @@ import {
|
|
|
3
3
|
createNumColumnsType,
|
|
4
4
|
createStaticBoolProp,
|
|
5
5
|
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
6
|
+
Triggers,
|
|
7
|
+
createActionProp,
|
|
8
|
+
createStaticNumberProp,
|
|
9
|
+
createColorProp,
|
|
6
10
|
} from "@draftbit/types";
|
|
7
11
|
|
|
8
12
|
export const SEED_DATA = {
|
|
@@ -14,7 +18,10 @@ export const SEED_DATA = {
|
|
|
14
18
|
layout: {
|
|
15
19
|
flex: 1,
|
|
16
20
|
},
|
|
21
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
17
22
|
props: {
|
|
23
|
+
onRefresh: createActionProp(),
|
|
24
|
+
onEndReached: createActionProp(),
|
|
18
25
|
horizontal: createStaticBoolProp({
|
|
19
26
|
label: "Horizontal",
|
|
20
27
|
description: "Render list horizontally",
|
|
@@ -26,5 +33,32 @@ export const SEED_DATA = {
|
|
|
26
33
|
numColumns: createNumColumnsType({
|
|
27
34
|
editable: true,
|
|
28
35
|
}),
|
|
36
|
+
initialNumToRender: createStaticNumberProp({
|
|
37
|
+
label: "Initial Num To Render",
|
|
38
|
+
description: "How many items to render in the initial batch",
|
|
39
|
+
defaultValue: null,
|
|
40
|
+
}),
|
|
41
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
42
|
+
label: "End Reached Threshold",
|
|
43
|
+
description:
|
|
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.",
|
|
45
|
+
defaultValue: 0.5,
|
|
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 false.",
|
|
55
|
+
defaultValue: false,
|
|
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
|
+
}),
|
|
29
63
|
},
|
|
30
64
|
};
|
|
@@ -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",
|
|
@@ -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",
|
|
@@ -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
|
};
|
package/src/mappings/Swiper.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createBoolProp, createNumberProp, createTextProp, createColorProp, GROUPS, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createBoolProp, createNumberProp, createTextProp, createColorProp, GROUPS, Triggers, createActionProp, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Swiper",
|
|
4
4
|
tag: "Swiper",
|
|
@@ -8,7 +8,9 @@ export const SEED_DATA = {
|
|
|
8
8
|
height: 300,
|
|
9
9
|
width: "100%",
|
|
10
10
|
},
|
|
11
|
+
triggers: [Triggers.OnIndexChanged],
|
|
11
12
|
props: {
|
|
13
|
+
onIndexChanged: createActionProp(),
|
|
12
14
|
from: createNumberProp({
|
|
13
15
|
group: GROUPS.basic,
|
|
14
16
|
label: "Initial Slide",
|
package/src/mappings/Swiper.ts
CHANGED
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
createTextProp,
|
|
6
6
|
createColorProp,
|
|
7
7
|
GROUPS,
|
|
8
|
+
Triggers,
|
|
9
|
+
createActionProp,
|
|
8
10
|
} from "@draftbit/types";
|
|
9
11
|
|
|
10
12
|
export const SEED_DATA = {
|
|
@@ -16,7 +18,9 @@ export const SEED_DATA = {
|
|
|
16
18
|
height: 300,
|
|
17
19
|
width: "100%",
|
|
18
20
|
},
|
|
21
|
+
triggers: [Triggers.OnIndexChanged],
|
|
19
22
|
props: {
|
|
23
|
+
onIndexChanged: createActionProp(),
|
|
20
24
|
from: createNumberProp({
|
|
21
25
|
group: GROUPS.basic,
|
|
22
26
|
label: "Initial Slide",
|
|
@@ -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",
|