@draftbit/core 47.0.1-9fd6f2.2 → 47.0.1-b3708e.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/AvatarEdit.js +15 -4
- package/lib/commonjs/components/Swiper/Swiper.js +2 -0
- package/lib/commonjs/mappings/FlashList.js +45 -2
- package/lib/commonjs/mappings/FlatList.js +12 -0
- package/lib/commonjs/mappings/Swiper.js +2 -0
- package/lib/module/components/AnimatedCircularProgress.js +13 -1
- package/lib/module/components/Picker/PickerComponent.web.js +21 -3
- package/lib/module/components/Portal/PortalManager.js +33 -7
- package/lib/module/components/Swiper/Swiper.js +2 -0
- package/lib/module/mappings/FlashList.js +46 -3
- package/lib/module/mappings/FlatList.js +13 -1
- package/lib/module/mappings/Swiper.js +3 -1
- 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/mappings/FlashList.d.ts +112 -2
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +42 -0
- package/lib/typescript/src/mappings/FlatList.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/package.json +3 -3
- package/src/components/Swiper/Swiper.js +2 -2
- package/src/components/Swiper/Swiper.tsx +3 -0
- package/src/mappings/FlashList.js +77 -31
- package/src/mappings/FlashList.ts +82 -30
- package/src/mappings/FlatList.js +13 -1
- package/src/mappings/FlatList.ts +16 -0
- package/src/mappings/Swiper.js +3 -1
- package/src/mappings/Swiper.ts +4 -0
|
@@ -12,7 +12,6 @@ var _theming = require("../theming");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
15
|
const AvatarEdit = _ref => {
|
|
17
16
|
let {
|
|
18
17
|
Icon,
|
|
@@ -32,9 +31,10 @@ const AvatarEdit = _ref => {
|
|
|
32
31
|
width: size,
|
|
33
32
|
height: size
|
|
34
33
|
};
|
|
35
|
-
return /*#__PURE__*/React.createElement(_reactNative.View,
|
|
36
|
-
style: [style, dimensions]
|
|
37
|
-
|
|
34
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
35
|
+
style: [style, dimensions],
|
|
36
|
+
...rest
|
|
37
|
+
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
38
38
|
onPress: onPress
|
|
39
39
|
}, /*#__PURE__*/React.createElement(_CircleImage.default, {
|
|
40
40
|
source: image,
|
|
@@ -56,4 +56,15 @@ const AvatarEdit = _ref => {
|
|
|
56
56
|
}))));
|
|
57
57
|
};
|
|
58
58
|
var _default = (0, _theming.withTheme)(AvatarEdit);
|
|
59
|
+
exports.default = _default;r: colorStyles.editBackgroundColor,
|
|
60
|
+
borderRadius: size * (3 / 16),
|
|
61
|
+
padding: size * (3 / 32)
|
|
62
|
+
}
|
|
63
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
64
|
+
name: "MaterialIcons/edit",
|
|
65
|
+
color: colorStyles.editIconColor,
|
|
66
|
+
size: size * (3 / 16)
|
|
67
|
+
}))));
|
|
68
|
+
};
|
|
69
|
+
var _default = (0, _theming.withTheme)(AvatarEdit);
|
|
59
70
|
exports.default = _default;
|
|
@@ -25,6 +25,7 @@ const Swiper = _ref => {
|
|
|
25
25
|
keyExtractor,
|
|
26
26
|
renderItem,
|
|
27
27
|
children,
|
|
28
|
+
onIndexChanged,
|
|
28
29
|
style
|
|
29
30
|
} = _ref;
|
|
30
31
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
@@ -34,6 +35,7 @@ const Swiper = _ref => {
|
|
|
34
35
|
loop: loop,
|
|
35
36
|
timeout: timeout,
|
|
36
37
|
vertical: vertical,
|
|
38
|
+
onIndexChanged: onIndexChanged,
|
|
37
39
|
controlsProps: {
|
|
38
40
|
prevTitle,
|
|
39
41
|
nextTitle,
|
|
@@ -5,7 +5,42 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SEED_DATA = void 0;
|
|
7
7
|
var _types = require("@draftbit/types");
|
|
8
|
-
const SEED_DATA = {
|
|
8
|
+
const SEED_DATA = [{
|
|
9
|
+
name: "Masonry List",
|
|
10
|
+
tag: "MasonryFlashList",
|
|
11
|
+
description: "Masonry Flashlist by Shopify",
|
|
12
|
+
packageName: "@shopify/flash-list",
|
|
13
|
+
category: _types.COMPONENT_TYPES.data,
|
|
14
|
+
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
15
|
+
layout: {
|
|
16
|
+
flex: 1
|
|
17
|
+
},
|
|
18
|
+
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
19
|
+
props: {
|
|
20
|
+
onRefresh: (0, _types.createActionProp)(),
|
|
21
|
+
onEndReached: (0, _types.createActionProp)(),
|
|
22
|
+
numColumns: (0, _types.createNumColumnsType)({
|
|
23
|
+
editable: true
|
|
24
|
+
}),
|
|
25
|
+
estimatedItemSize: (0, _types.createNumberProp)({
|
|
26
|
+
group: _types.GROUPS.basic,
|
|
27
|
+
label: "Est. Item Size",
|
|
28
|
+
description: "Approximate size of the items before rendering.",
|
|
29
|
+
defaultValue: 50,
|
|
30
|
+
step: 1,
|
|
31
|
+
precision: 0
|
|
32
|
+
}),
|
|
33
|
+
optimizeItemArrangement: (0, _types.createStaticBoolProp)({
|
|
34
|
+
label: "Optimize Item Arrangement",
|
|
35
|
+
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."
|
|
36
|
+
}),
|
|
37
|
+
onEndReachedThreshold: (0, _types.createStaticNumberProp)({
|
|
38
|
+
label: "End Reached Threshold",
|
|
39
|
+
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
|
+
defaultValue: 0.5
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
9
44
|
name: "FlashList",
|
|
10
45
|
tag: "FlashList",
|
|
11
46
|
description: "Flashlist by Shopify",
|
|
@@ -15,7 +50,10 @@ const SEED_DATA = {
|
|
|
15
50
|
layout: {
|
|
16
51
|
flex: 1
|
|
17
52
|
},
|
|
53
|
+
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
18
54
|
props: {
|
|
55
|
+
onRefresh: (0, _types.createActionProp)(),
|
|
56
|
+
onEndReached: (0, _types.createActionProp)(),
|
|
19
57
|
estimatedItemSize: (0, _types.createNumberProp)({
|
|
20
58
|
group: _types.GROUPS.basic,
|
|
21
59
|
label: "Est. Item Size",
|
|
@@ -34,7 +72,12 @@ const SEED_DATA = {
|
|
|
34
72
|
}),
|
|
35
73
|
numColumns: (0, _types.createNumColumnsType)({
|
|
36
74
|
editable: true
|
|
75
|
+
}),
|
|
76
|
+
onEndReachedThreshold: (0, _types.createStaticNumberProp)({
|
|
77
|
+
label: "End Reached Threshold",
|
|
78
|
+
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.",
|
|
79
|
+
defaultValue: 0.5
|
|
37
80
|
})
|
|
38
81
|
}
|
|
39
|
-
};
|
|
82
|
+
}];
|
|
40
83
|
exports.SEED_DATA = SEED_DATA;
|
|
@@ -14,7 +14,10 @@ const SEED_DATA = {
|
|
|
14
14
|
layout: {
|
|
15
15
|
flex: 1
|
|
16
16
|
},
|
|
17
|
+
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
17
18
|
props: {
|
|
19
|
+
onRefresh: (0, _types.createActionProp)(),
|
|
20
|
+
onEndReached: (0, _types.createActionProp)(),
|
|
18
21
|
horizontal: (0, _types.createStaticBoolProp)({
|
|
19
22
|
label: "Horizontal",
|
|
20
23
|
description: "Render list horizontally"
|
|
@@ -25,6 +28,15 @@ const SEED_DATA = {
|
|
|
25
28
|
}),
|
|
26
29
|
numColumns: (0, _types.createNumColumnsType)({
|
|
27
30
|
editable: true
|
|
31
|
+
}),
|
|
32
|
+
initialNumToRender: (0, _types.createStaticBoolProp)({
|
|
33
|
+
label: "Initial Num To Render",
|
|
34
|
+
descriprion: "How many items to render in the initial batch"
|
|
35
|
+
}),
|
|
36
|
+
onEndReachedThreshold: (0, _types.createStaticNumberProp)({
|
|
37
|
+
label: "End Reached Threshold",
|
|
38
|
+
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.",
|
|
39
|
+
defaultValue: 0.5
|
|
28
40
|
})
|
|
29
41
|
}
|
|
30
42
|
};
|
|
@@ -14,7 +14,9 @@ const SEED_DATA = {
|
|
|
14
14
|
height: 300,
|
|
15
15
|
width: "100%"
|
|
16
16
|
},
|
|
17
|
+
triggers: [_types.Triggers.OnIndexChanged],
|
|
17
18
|
props: {
|
|
19
|
+
onIndexChanged: (0, _types.createActionProp)(),
|
|
18
20
|
from: (0, _types.createNumberProp)({
|
|
19
21
|
group: _types.GROUPS.basic,
|
|
20
22
|
label: "Initial Slide"
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { Animated, Easing } from "react-native";
|
|
4
3
|
import CircularProgress from "./CircularProgress";
|
|
@@ -46,6 +45,19 @@ const AnimatedCircularProgress = _ref => {
|
|
|
46
45
|
React.useEffect(() => {
|
|
47
46
|
animate();
|
|
48
47
|
}, [fill, animate]);
|
|
48
|
+
return /*#__PURE__*/React.createElement(AnimatedProgress, {
|
|
49
|
+
...other,
|
|
50
|
+
style: other.style,
|
|
51
|
+
childrenContainerStyle: other.childrenContainerStyle,
|
|
52
|
+
fill: fillAnimation,
|
|
53
|
+
tintColor: animateColor()
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
export default AnimatedCircularProgress;imation;
|
|
57
|
+
};
|
|
58
|
+
React.useEffect(() => {
|
|
59
|
+
animate();
|
|
60
|
+
}, [fill, animate]);
|
|
49
61
|
return /*#__PURE__*/React.createElement(AnimatedProgress, _extends({}, other, {
|
|
50
62
|
style: other.style,
|
|
51
63
|
childrenContainerStyle: other.childrenContainerStyle,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { View, StyleSheet } from "react-native";
|
|
4
3
|
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
@@ -8,7 +7,6 @@ import { extractStyles } from "../../utilities";
|
|
|
8
7
|
import TextField from "../TextField";
|
|
9
8
|
import Touchable from "../Touchable";
|
|
10
9
|
const Picker = _ref => {
|
|
11
|
-
var _options$find$label, _options$find;
|
|
12
10
|
let {
|
|
13
11
|
style,
|
|
14
12
|
options,
|
|
@@ -18,6 +16,7 @@ const Picker = _ref => {
|
|
|
18
16
|
onValueChange: onValueChangeOverride = () => {},
|
|
19
17
|
...props
|
|
20
18
|
} = _ref;
|
|
19
|
+
var _a, _b;
|
|
21
20
|
const {
|
|
22
21
|
viewStyles: {
|
|
23
22
|
borderRadius,
|
|
@@ -62,7 +61,7 @@ const Picker = _ref => {
|
|
|
62
61
|
};
|
|
63
62
|
|
|
64
63
|
const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
65
|
-
const selectedLabel = selectedValue && ((
|
|
64
|
+
const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
|
|
66
65
|
return /*#__PURE__*/React.createElement(Touchable, {
|
|
67
66
|
disabled: disabled,
|
|
68
67
|
onPress: toggleFocus,
|
|
@@ -85,6 +84,25 @@ const Picker = _ref => {
|
|
|
85
84
|
label: o.label,
|
|
86
85
|
value: o.value,
|
|
87
86
|
key: o.value
|
|
87
|
+
}))), /*#__PURE__*/React.createElement(View, {
|
|
88
|
+
pointerEvents: "none"
|
|
89
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
90
|
+
...props,
|
|
91
|
+
value: selectedLabel,
|
|
92
|
+
placeholder: placeholder,
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
ref: textField,
|
|
95
|
+
disabled: disabled,
|
|
96
|
+
// @ts-expect-error
|
|
97
|
+
style: stylesWithoutMargin
|
|
98
|
+
}))));
|
|
99
|
+
};
|
|
100
|
+
const styles = StyleSheet.create({
|
|
101
|
+
container: {
|
|
102
|
+
alignSelf: "stretch"
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
export default withTheme(Picker);y: o.value
|
|
88
106
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
89
107
|
pointerEvents: "none"
|
|
90
108
|
}, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
1
|
import * as React from "react";
|
|
5
2
|
import { View, StyleSheet } from "react-native";
|
|
6
3
|
/**
|
|
@@ -9,18 +6,47 @@ import { View, StyleSheet } from "react-native";
|
|
|
9
6
|
export default class PortalManager extends React.PureComponent {
|
|
10
7
|
constructor() {
|
|
11
8
|
super(...arguments);
|
|
12
|
-
|
|
9
|
+
this.state = {
|
|
13
10
|
portals: []
|
|
14
|
-
}
|
|
15
|
-
|
|
11
|
+
};
|
|
12
|
+
this.mount = (key, children) => {
|
|
16
13
|
this.setState(state => ({
|
|
17
14
|
portals: [...state.portals, {
|
|
18
15
|
key,
|
|
19
16
|
children
|
|
20
17
|
}]
|
|
21
18
|
}));
|
|
19
|
+
};
|
|
20
|
+
this.update = (key, children) => this.setState(state => ({
|
|
21
|
+
portals: state.portals.map(item => {
|
|
22
|
+
if (item.key === key) {
|
|
23
|
+
return {
|
|
24
|
+
...item,
|
|
25
|
+
children
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return item;
|
|
29
|
+
})
|
|
30
|
+
}));
|
|
31
|
+
this.unmount = key => this.setState(state => ({
|
|
32
|
+
portals: state.portals.filter(item => item.key !== key)
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return this.state.portals.map(_ref => {
|
|
37
|
+
let {
|
|
38
|
+
key,
|
|
39
|
+
children
|
|
40
|
+
} = _ref;
|
|
41
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
42
|
+
key: key,
|
|
43
|
+
collapsable: false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */,
|
|
44
|
+
pointerEvents: "box-none",
|
|
45
|
+
style: StyleSheet.absoluteFill
|
|
46
|
+
}, children);
|
|
22
47
|
});
|
|
23
|
-
|
|
48
|
+
}
|
|
49
|
+
}ey, children) => this.setState(state => ({
|
|
24
50
|
portals: state.portals.map(item => {
|
|
25
51
|
if (item.key === key) {
|
|
26
52
|
return {
|
|
@@ -18,6 +18,7 @@ const Swiper = _ref => {
|
|
|
18
18
|
keyExtractor,
|
|
19
19
|
renderItem,
|
|
20
20
|
children,
|
|
21
|
+
onIndexChanged,
|
|
21
22
|
style
|
|
22
23
|
} = _ref;
|
|
23
24
|
return /*#__PURE__*/React.createElement(View, {
|
|
@@ -27,6 +28,7 @@ const Swiper = _ref => {
|
|
|
27
28
|
loop: loop,
|
|
28
29
|
timeout: timeout,
|
|
29
30
|
vertical: vertical,
|
|
31
|
+
onIndexChanged: onIndexChanged,
|
|
30
32
|
controlsProps: {
|
|
31
33
|
prevTitle,
|
|
32
34
|
nextTitle,
|
|
@@ -1,5 +1,40 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS } from "@draftbit/types";
|
|
2
|
-
export const SEED_DATA = {
|
|
1
|
+
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, Triggers, createActionProp, createStaticNumberProp } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = [{
|
|
3
|
+
name: "Masonry List",
|
|
4
|
+
tag: "MasonryFlashList",
|
|
5
|
+
description: "Masonry Flashlist by Shopify",
|
|
6
|
+
packageName: "@shopify/flash-list",
|
|
7
|
+
category: COMPONENT_TYPES.data,
|
|
8
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
9
|
+
layout: {
|
|
10
|
+
flex: 1
|
|
11
|
+
},
|
|
12
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
13
|
+
props: {
|
|
14
|
+
onRefresh: createActionProp(),
|
|
15
|
+
onEndReached: createActionProp(),
|
|
16
|
+
numColumns: createNumColumnsType({
|
|
17
|
+
editable: true
|
|
18
|
+
}),
|
|
19
|
+
estimatedItemSize: createNumberProp({
|
|
20
|
+
group: GROUPS.basic,
|
|
21
|
+
label: "Est. Item Size",
|
|
22
|
+
description: "Approximate size of the items before rendering.",
|
|
23
|
+
defaultValue: 50,
|
|
24
|
+
step: 1,
|
|
25
|
+
precision: 0
|
|
26
|
+
}),
|
|
27
|
+
optimizeItemArrangement: createStaticBoolProp({
|
|
28
|
+
label: "Optimize Item Arrangement",
|
|
29
|
+
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."
|
|
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
|
+
}
|
|
37
|
+
}, {
|
|
3
38
|
name: "FlashList",
|
|
4
39
|
tag: "FlashList",
|
|
5
40
|
description: "Flashlist by Shopify",
|
|
@@ -9,7 +44,10 @@ export const SEED_DATA = {
|
|
|
9
44
|
layout: {
|
|
10
45
|
flex: 1
|
|
11
46
|
},
|
|
47
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
12
48
|
props: {
|
|
49
|
+
onRefresh: createActionProp(),
|
|
50
|
+
onEndReached: createActionProp(),
|
|
13
51
|
estimatedItemSize: createNumberProp({
|
|
14
52
|
group: GROUPS.basic,
|
|
15
53
|
label: "Est. Item Size",
|
|
@@ -28,6 +66,11 @@ export const SEED_DATA = {
|
|
|
28
66
|
}),
|
|
29
67
|
numColumns: createNumColumnsType({
|
|
30
68
|
editable: true
|
|
69
|
+
}),
|
|
70
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
71
|
+
label: "End Reached Threshold",
|
|
72
|
+
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.",
|
|
73
|
+
defaultValue: 0.5
|
|
31
74
|
})
|
|
32
75
|
}
|
|
33
|
-
};
|
|
76
|
+
}];
|
|
@@ -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 } 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"
|
|
@@ -19,6 +22,15 @@ export const SEED_DATA = {
|
|
|
19
22
|
}),
|
|
20
23
|
numColumns: createNumColumnsType({
|
|
21
24
|
editable: true
|
|
25
|
+
}),
|
|
26
|
+
initialNumToRender: createStaticBoolProp({
|
|
27
|
+
label: "Initial Num To Render",
|
|
28
|
+
descriprion: "How many items to render in the initial batch"
|
|
29
|
+
}),
|
|
30
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
31
|
+
label: "End Reached Threshold",
|
|
32
|
+
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.",
|
|
33
|
+
defaultValue: 0.5
|
|
22
34
|
})
|
|
23
35
|
}
|
|
24
36
|
};
|
|
@@ -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"
|
|
@@ -20,7 +20,8 @@ export interface SwiperProps<T> {
|
|
|
20
20
|
index: number;
|
|
21
21
|
}) => JSX.Element;
|
|
22
22
|
style?: StyleProp<ViewStyle>;
|
|
23
|
+
onIndexChanged?: (index: number) => void;
|
|
23
24
|
}
|
|
24
|
-
declare const Swiper: ({ vertical, loop, timeout, from, prevTitle, nextTitle, prevTitleColor, nextTitleColor, dotsTouchable, dotColor, dotActiveColor, data, keyExtractor, renderItem, children, style, }: SwiperProps<any>) => JSX.Element;
|
|
25
|
+
declare const Swiper: ({ vertical, loop, timeout, from, prevTitle, nextTitle, prevTitleColor, nextTitleColor, dotsTouchable, dotColor, dotActiveColor, data, keyExtractor, renderItem, children, onIndexChanged, style, }: SwiperProps<any>) => JSX.Element;
|
|
25
26
|
export default Swiper;
|
|
26
27
|
//# sourceMappingURL=Swiper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Swiper.d.ts","sourceRoot":"","sources":["../../../../../src/components/Swiper/Swiper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG1D,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChB,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,UAAU,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,GAAG,CAAC,OAAO,CAAC;IAC1E,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Swiper.d.ts","sourceRoot":"","sources":["../../../../../src/components/Swiper/Swiper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG1D,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChB,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,UAAU,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,GAAG,CAAC,OAAO,CAAC;IAC1E,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED,QAAA,MAAM,MAAM,uMAkBT,YAAY,GAAG,CAAC,gBAuClB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SEED_DATA: {
|
|
1
|
+
export declare const SEED_DATA: ({
|
|
2
2
|
name: string;
|
|
3
3
|
tag: string;
|
|
4
4
|
description: string;
|
|
@@ -8,7 +8,105 @@ export declare const SEED_DATA: {
|
|
|
8
8
|
layout: {
|
|
9
9
|
flex: number;
|
|
10
10
|
};
|
|
11
|
+
triggers: string[];
|
|
11
12
|
props: {
|
|
13
|
+
onRefresh: {
|
|
14
|
+
label: string;
|
|
15
|
+
description: string;
|
|
16
|
+
editable: boolean;
|
|
17
|
+
required: boolean;
|
|
18
|
+
formType: string;
|
|
19
|
+
propType: string;
|
|
20
|
+
defaultValue: null;
|
|
21
|
+
group: string;
|
|
22
|
+
};
|
|
23
|
+
onEndReached: {
|
|
24
|
+
label: string;
|
|
25
|
+
description: string;
|
|
26
|
+
editable: boolean;
|
|
27
|
+
required: boolean;
|
|
28
|
+
formType: string;
|
|
29
|
+
propType: string;
|
|
30
|
+
defaultValue: null;
|
|
31
|
+
group: string;
|
|
32
|
+
};
|
|
33
|
+
numColumns: {
|
|
34
|
+
label: string;
|
|
35
|
+
description: string;
|
|
36
|
+
group: string;
|
|
37
|
+
formType: string;
|
|
38
|
+
propType: string;
|
|
39
|
+
defaultValue: number;
|
|
40
|
+
editable: boolean;
|
|
41
|
+
required: boolean;
|
|
42
|
+
};
|
|
43
|
+
estimatedItemSize: {
|
|
44
|
+
label: string;
|
|
45
|
+
description: string;
|
|
46
|
+
formType: string;
|
|
47
|
+
propType: string;
|
|
48
|
+
group: string;
|
|
49
|
+
defaultValue: null;
|
|
50
|
+
editable: boolean;
|
|
51
|
+
required: boolean;
|
|
52
|
+
step: number;
|
|
53
|
+
};
|
|
54
|
+
optimizeItemArrangement: {
|
|
55
|
+
label: string;
|
|
56
|
+
description: string;
|
|
57
|
+
formType: string;
|
|
58
|
+
propType: string;
|
|
59
|
+
defaultValue: boolean;
|
|
60
|
+
editable: boolean;
|
|
61
|
+
required: boolean;
|
|
62
|
+
group: string;
|
|
63
|
+
};
|
|
64
|
+
onEndReachedThreshold: {
|
|
65
|
+
label: string;
|
|
66
|
+
description: string;
|
|
67
|
+
formType: string;
|
|
68
|
+
propType: string;
|
|
69
|
+
group: string;
|
|
70
|
+
defaultValue: null;
|
|
71
|
+
editable: boolean;
|
|
72
|
+
required: boolean;
|
|
73
|
+
step: number;
|
|
74
|
+
};
|
|
75
|
+
horizontal?: undefined;
|
|
76
|
+
inverted?: undefined;
|
|
77
|
+
};
|
|
78
|
+
} | {
|
|
79
|
+
name: string;
|
|
80
|
+
tag: string;
|
|
81
|
+
description: string;
|
|
82
|
+
packageName: string;
|
|
83
|
+
category: string;
|
|
84
|
+
stylesPanelSections: string[];
|
|
85
|
+
layout: {
|
|
86
|
+
flex: number;
|
|
87
|
+
};
|
|
88
|
+
triggers: string[];
|
|
89
|
+
props: {
|
|
90
|
+
onRefresh: {
|
|
91
|
+
label: string;
|
|
92
|
+
description: string;
|
|
93
|
+
editable: boolean;
|
|
94
|
+
required: boolean;
|
|
95
|
+
formType: string;
|
|
96
|
+
propType: string;
|
|
97
|
+
defaultValue: null;
|
|
98
|
+
group: string;
|
|
99
|
+
};
|
|
100
|
+
onEndReached: {
|
|
101
|
+
label: string;
|
|
102
|
+
description: string;
|
|
103
|
+
editable: boolean;
|
|
104
|
+
required: boolean;
|
|
105
|
+
formType: string;
|
|
106
|
+
propType: string;
|
|
107
|
+
defaultValue: null;
|
|
108
|
+
group: string;
|
|
109
|
+
};
|
|
12
110
|
estimatedItemSize: {
|
|
13
111
|
label: string;
|
|
14
112
|
description: string;
|
|
@@ -50,6 +148,18 @@ export declare const SEED_DATA: {
|
|
|
50
148
|
editable: boolean;
|
|
51
149
|
required: boolean;
|
|
52
150
|
};
|
|
151
|
+
onEndReachedThreshold: {
|
|
152
|
+
label: string;
|
|
153
|
+
description: string;
|
|
154
|
+
formType: string;
|
|
155
|
+
propType: string;
|
|
156
|
+
group: string;
|
|
157
|
+
defaultValue: null;
|
|
158
|
+
editable: boolean;
|
|
159
|
+
required: boolean;
|
|
160
|
+
step: number;
|
|
161
|
+
};
|
|
162
|
+
optimizeItemArrangement?: undefined;
|
|
53
163
|
};
|
|
54
|
-
};
|
|
164
|
+
})[];
|
|
55
165
|
//# sourceMappingURL=FlashList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlashList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlashList.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlashList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlashList.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgFrB,CAAC"}
|
|
@@ -7,7 +7,28 @@ export declare const SEED_DATA: {
|
|
|
7
7
|
layout: {
|
|
8
8
|
flex: number;
|
|
9
9
|
};
|
|
10
|
+
triggers: string[];
|
|
10
11
|
props: {
|
|
12
|
+
onRefresh: {
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
editable: boolean;
|
|
16
|
+
required: boolean;
|
|
17
|
+
formType: string;
|
|
18
|
+
propType: string;
|
|
19
|
+
defaultValue: null;
|
|
20
|
+
group: string;
|
|
21
|
+
};
|
|
22
|
+
onEndReached: {
|
|
23
|
+
label: string;
|
|
24
|
+
description: string;
|
|
25
|
+
editable: boolean;
|
|
26
|
+
required: boolean;
|
|
27
|
+
formType: string;
|
|
28
|
+
propType: string;
|
|
29
|
+
defaultValue: null;
|
|
30
|
+
group: string;
|
|
31
|
+
};
|
|
11
32
|
horizontal: {
|
|
12
33
|
label: string;
|
|
13
34
|
description: string;
|
|
@@ -38,6 +59,27 @@ export declare const SEED_DATA: {
|
|
|
38
59
|
editable: boolean;
|
|
39
60
|
required: boolean;
|
|
40
61
|
};
|
|
62
|
+
initialNumToRender: {
|
|
63
|
+
label: string;
|
|
64
|
+
description: string;
|
|
65
|
+
formType: string;
|
|
66
|
+
propType: string;
|
|
67
|
+
defaultValue: boolean;
|
|
68
|
+
editable: boolean;
|
|
69
|
+
required: boolean;
|
|
70
|
+
group: string;
|
|
71
|
+
};
|
|
72
|
+
onEndReachedThreshold: {
|
|
73
|
+
label: string;
|
|
74
|
+
description: string;
|
|
75
|
+
formType: string;
|
|
76
|
+
propType: string;
|
|
77
|
+
group: string;
|
|
78
|
+
defaultValue: null;
|
|
79
|
+
editable: boolean;
|
|
80
|
+
required: boolean;
|
|
81
|
+
step: number;
|
|
82
|
+
};
|
|
41
83
|
};
|
|
42
84
|
};
|
|
43
85
|
//# sourceMappingURL=FlatList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlatList.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlatList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlatList.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCrB,CAAC"}
|
|
@@ -7,7 +7,18 @@ export declare const SEED_DATA: {
|
|
|
7
7
|
height: number;
|
|
8
8
|
width: string;
|
|
9
9
|
};
|
|
10
|
+
triggers: string[];
|
|
10
11
|
props: {
|
|
12
|
+
onIndexChanged: {
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
editable: boolean;
|
|
16
|
+
required: boolean;
|
|
17
|
+
formType: string;
|
|
18
|
+
propType: string;
|
|
19
|
+
defaultValue: null;
|
|
20
|
+
group: string;
|
|
21
|
+
};
|
|
11
22
|
from: {
|
|
12
23
|
label: string;
|
|
13
24
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Swiper.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Swiper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Swiper.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Swiper.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "47.0.1-
|
|
3
|
+
"version": "47.0.1-b3708e.2+b3708e6",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^47.0.1-
|
|
44
|
+
"@draftbit/types": "^47.0.1-b3708e.2+b3708e6",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.4",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
]
|
|
92
92
|
]
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "b3708e6d174a2b710a950f327f8703bf485b90c6"
|
|
95
95
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import SwiperComponent from "react-native-web-swiper";
|
|
4
|
-
const Swiper = ({ vertical = false, loop = false, timeout = 0, from = 0, prevTitle = "", nextTitle = "", prevTitleColor, nextTitleColor, dotsTouchable = true, dotColor, dotActiveColor, data, keyExtractor, renderItem, children, style, }) => (React.createElement(View, { style: style },
|
|
5
|
-
React.createElement(SwiperComponent, { from: from, loop: loop, timeout: timeout, vertical: vertical, controlsProps: {
|
|
4
|
+
const Swiper = ({ vertical = false, loop = false, timeout = 0, from = 0, prevTitle = "", nextTitle = "", prevTitleColor, nextTitleColor, dotsTouchable = true, dotColor, dotActiveColor, data, keyExtractor, renderItem, children, onIndexChanged, style, }) => (React.createElement(View, { style: style },
|
|
5
|
+
React.createElement(SwiperComponent, { from: from, loop: loop, timeout: timeout, vertical: vertical, onIndexChanged: onIndexChanged, controlsProps: {
|
|
6
6
|
prevTitle,
|
|
7
7
|
nextTitle,
|
|
8
8
|
prevTitleStyle: { color: prevTitleColor },
|
|
@@ -19,6 +19,7 @@ export interface SwiperProps<T> {
|
|
|
19
19
|
keyExtractor: (item: T, index: number) => string;
|
|
20
20
|
renderItem?: ({ item, index }: { item: T; index: number }) => JSX.Element;
|
|
21
21
|
style?: StyleProp<ViewStyle>;
|
|
22
|
+
onIndexChanged?: (index: number) => void;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
const Swiper = ({
|
|
@@ -37,6 +38,7 @@ const Swiper = ({
|
|
|
37
38
|
keyExtractor,
|
|
38
39
|
renderItem,
|
|
39
40
|
children,
|
|
41
|
+
onIndexChanged,
|
|
40
42
|
style,
|
|
41
43
|
}: SwiperProps<any>) => (
|
|
42
44
|
<View style={style}>
|
|
@@ -46,6 +48,7 @@ const Swiper = ({
|
|
|
46
48
|
loop={loop}
|
|
47
49
|
timeout={timeout}
|
|
48
50
|
vertical={vertical}
|
|
51
|
+
onIndexChanged={onIndexChanged}
|
|
49
52
|
controlsProps={{
|
|
50
53
|
prevTitle,
|
|
51
54
|
nextTitle,
|
|
@@ -1,33 +1,79 @@
|
|
|
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, } 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
|
+
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
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
33
|
+
label: "End Reached Threshold",
|
|
34
|
+
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.",
|
|
35
|
+
defaultValue: 0.5,
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
11
38
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
{
|
|
40
|
+
name: "FlashList",
|
|
41
|
+
tag: "FlashList",
|
|
42
|
+
description: "Flashlist by Shopify",
|
|
43
|
+
packageName: "@shopify/flash-list",
|
|
44
|
+
category: COMPONENT_TYPES.data,
|
|
45
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
46
|
+
layout: {
|
|
47
|
+
flex: 1,
|
|
48
|
+
},
|
|
49
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
50
|
+
props: {
|
|
51
|
+
onRefresh: createActionProp(),
|
|
52
|
+
onEndReached: createActionProp(),
|
|
53
|
+
estimatedItemSize: createNumberProp({
|
|
54
|
+
group: GROUPS.basic,
|
|
55
|
+
label: "Est. Item Size",
|
|
56
|
+
description: "Approximate size of the items before rendering.",
|
|
57
|
+
defaultValue: 50,
|
|
58
|
+
step: 1,
|
|
59
|
+
precision: 0,
|
|
60
|
+
}),
|
|
61
|
+
horizontal: createStaticBoolProp({
|
|
62
|
+
label: "Horizontal",
|
|
63
|
+
description: "Render list horizontally",
|
|
64
|
+
}),
|
|
65
|
+
inverted: createStaticBoolProp({
|
|
66
|
+
label: "Inverted",
|
|
67
|
+
description: "If true, reverses the direction.",
|
|
68
|
+
}),
|
|
69
|
+
numColumns: createNumColumnsType({
|
|
70
|
+
editable: true,
|
|
71
|
+
}),
|
|
72
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
73
|
+
label: "End Reached Threshold",
|
|
74
|
+
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.",
|
|
75
|
+
defaultValue: 0.5,
|
|
76
|
+
}),
|
|
77
|
+
},
|
|
32
78
|
},
|
|
33
|
-
|
|
79
|
+
];
|
|
@@ -5,37 +5,89 @@ import {
|
|
|
5
5
|
createNumberProp,
|
|
6
6
|
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
7
7
|
GROUPS,
|
|
8
|
+
Triggers,
|
|
9
|
+
createActionProp,
|
|
10
|
+
createStaticNumberProp,
|
|
8
11
|
} from "@draftbit/types";
|
|
9
12
|
|
|
10
|
-
export const SEED_DATA =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
export const SEED_DATA = [
|
|
14
|
+
{
|
|
15
|
+
name: "Masonry List",
|
|
16
|
+
tag: "MasonryFlashList",
|
|
17
|
+
description: "Masonry Flashlist by Shopify",
|
|
18
|
+
packageName: "@shopify/flash-list",
|
|
19
|
+
category: COMPONENT_TYPES.data,
|
|
20
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
21
|
+
layout: {
|
|
22
|
+
flex: 1,
|
|
23
|
+
},
|
|
24
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
25
|
+
props: {
|
|
26
|
+
onRefresh: createActionProp(),
|
|
27
|
+
onEndReached: createActionProp(),
|
|
28
|
+
numColumns: createNumColumnsType({
|
|
29
|
+
editable: true,
|
|
30
|
+
}),
|
|
31
|
+
estimatedItemSize: createNumberProp({
|
|
32
|
+
group: GROUPS.basic,
|
|
33
|
+
label: "Est. Item Size",
|
|
34
|
+
description: "Approximate size of the items before rendering.",
|
|
35
|
+
defaultValue: 50,
|
|
36
|
+
step: 1,
|
|
37
|
+
precision: 0,
|
|
38
|
+
}),
|
|
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
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
45
|
+
label: "End Reached Threshold",
|
|
46
|
+
description:
|
|
47
|
+
"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.",
|
|
48
|
+
defaultValue: 0.5,
|
|
49
|
+
}),
|
|
50
|
+
},
|
|
19
51
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
52
|
+
{
|
|
53
|
+
name: "FlashList",
|
|
54
|
+
tag: "FlashList",
|
|
55
|
+
description: "Flashlist by Shopify",
|
|
56
|
+
packageName: "@shopify/flash-list",
|
|
57
|
+
category: COMPONENT_TYPES.data,
|
|
58
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
59
|
+
layout: {
|
|
60
|
+
flex: 1,
|
|
61
|
+
},
|
|
62
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
63
|
+
props: {
|
|
64
|
+
onRefresh: createActionProp(),
|
|
65
|
+
onEndReached: createActionProp(),
|
|
66
|
+
estimatedItemSize: createNumberProp({
|
|
67
|
+
group: GROUPS.basic,
|
|
68
|
+
label: "Est. Item Size",
|
|
69
|
+
description: "Approximate size of the items before rendering.",
|
|
70
|
+
defaultValue: 50,
|
|
71
|
+
step: 1,
|
|
72
|
+
precision: 0,
|
|
73
|
+
}),
|
|
74
|
+
horizontal: createStaticBoolProp({
|
|
75
|
+
label: "Horizontal",
|
|
76
|
+
description: "Render list horizontally",
|
|
77
|
+
}),
|
|
78
|
+
inverted: createStaticBoolProp({
|
|
79
|
+
label: "Inverted",
|
|
80
|
+
description: "If true, reverses the direction.",
|
|
81
|
+
}),
|
|
82
|
+
numColumns: createNumColumnsType({
|
|
83
|
+
editable: true,
|
|
84
|
+
}),
|
|
85
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
86
|
+
label: "End Reached Threshold",
|
|
87
|
+
description:
|
|
88
|
+
"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.",
|
|
89
|
+
defaultValue: 0.5,
|
|
90
|
+
}),
|
|
91
|
+
},
|
|
40
92
|
},
|
|
41
|
-
|
|
93
|
+
];
|
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, } 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,14 @@ export const SEED_DATA = {
|
|
|
20
23
|
numColumns: createNumColumnsType({
|
|
21
24
|
editable: true,
|
|
22
25
|
}),
|
|
26
|
+
initialNumToRender: createStaticBoolProp({
|
|
27
|
+
label: "Initial Num To Render",
|
|
28
|
+
descriprion: "How many items to render in the initial batch",
|
|
29
|
+
}),
|
|
30
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
31
|
+
label: "End Reached Threshold",
|
|
32
|
+
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.",
|
|
33
|
+
defaultValue: 0.5,
|
|
34
|
+
}),
|
|
23
35
|
},
|
|
24
36
|
};
|
package/src/mappings/FlatList.ts
CHANGED
|
@@ -3,6 +3,9 @@ import {
|
|
|
3
3
|
createNumColumnsType,
|
|
4
4
|
createStaticBoolProp,
|
|
5
5
|
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
6
|
+
Triggers,
|
|
7
|
+
createActionProp,
|
|
8
|
+
createStaticNumberProp,
|
|
6
9
|
} from "@draftbit/types";
|
|
7
10
|
|
|
8
11
|
export const SEED_DATA = {
|
|
@@ -14,7 +17,10 @@ export const SEED_DATA = {
|
|
|
14
17
|
layout: {
|
|
15
18
|
flex: 1,
|
|
16
19
|
},
|
|
20
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
17
21
|
props: {
|
|
22
|
+
onRefresh: createActionProp(),
|
|
23
|
+
onEndReached: createActionProp(),
|
|
18
24
|
horizontal: createStaticBoolProp({
|
|
19
25
|
label: "Horizontal",
|
|
20
26
|
description: "Render list horizontally",
|
|
@@ -26,5 +32,15 @@ export const SEED_DATA = {
|
|
|
26
32
|
numColumns: createNumColumnsType({
|
|
27
33
|
editable: true,
|
|
28
34
|
}),
|
|
35
|
+
initialNumToRender: createStaticBoolProp({
|
|
36
|
+
label: "Initial Num To Render",
|
|
37
|
+
descriprion: "How many items to render in the initial batch",
|
|
38
|
+
}),
|
|
39
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
40
|
+
label: "End Reached Threshold",
|
|
41
|
+
description:
|
|
42
|
+
"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.",
|
|
43
|
+
defaultValue: 0.5,
|
|
44
|
+
}),
|
|
29
45
|
},
|
|
30
46
|
};
|
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",
|