@draftbit/core 46.4.4-3bb5e5.2 → 46.4.4-64c11a.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 +32 -11
- package/lib/commonjs/components/Container.js +5 -17
- package/lib/commonjs/index.js +0 -38
- package/lib/commonjs/mappings/AudioPlayer.js +28 -2
- package/lib/commonjs/utilities.js +2 -2
- package/lib/module/index.js +0 -1
- package/lib/module/mappings/AudioPlayer.js +29 -3
- package/lib/module/utilities.js +3 -3
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/mappings/AudioPlayer.d.ts +52 -1
- package/lib/typescript/src/utilities.d.ts +3 -3
- package/package.json +3 -3
- package/src/index.js +0 -1
- package/src/index.tsx +0 -9
- package/src/mappings/AudioPlayer.js +35 -2
- package/src/mappings/AudioPlayer.ts +37 -1
- package/src/utilities.js +2 -5
- package/src/utilities.ts +2 -13
- package/lib/commonjs/components/Table/Table.js +0 -50
- package/lib/commonjs/components/Table/TableCell.js +0 -50
- package/lib/commonjs/components/Table/TableHeader.js +0 -41
- package/lib/commonjs/components/Table/TablePaginator.js +0 -17
- package/lib/commonjs/components/Table/TableRow.js +0 -47
- package/lib/commonjs/components/Table/TableTitle.js +0 -60
- package/lib/commonjs/components/Table/index.js +0 -55
- package/lib/commonjs/mappings/Table.js +0 -103
- package/lib/module/components/Table/Table.js +0 -23
- package/lib/module/components/Table/TableCell.js +0 -37
- package/lib/module/components/Table/TableHeader.js +0 -27
- package/lib/module/components/Table/TablePaginator.js +0 -6
- package/lib/module/components/Table/TableRow.js +0 -33
- package/lib/module/components/Table/TableTitle.js +0 -47
- package/lib/module/components/Table/index.js +0 -6
- package/lib/module/mappings/Table.js +0 -94
- package/lib/typescript/src/components/Table/Table.d.ts +0 -8
- package/lib/typescript/src/components/Table/TableCell.d.ts +0 -10
- package/lib/typescript/src/components/Table/TableHeader.d.ts +0 -12
- package/lib/typescript/src/components/Table/TablePaginator.d.ts +0 -3
- package/lib/typescript/src/components/Table/TableRow.d.ts +0 -12
- package/lib/typescript/src/components/Table/TableTitle.d.ts +0 -12
- package/lib/typescript/src/components/Table/index.d.ts +0 -6
- package/lib/typescript/src/mappings/Table.d.ts +0 -153
- package/src/components/Table/Table.js +0 -10
- package/src/components/Table/Table.tsx +0 -22
- package/src/components/Table/TableCell.js +0 -21
- package/src/components/Table/TableCell.tsx +0 -44
- package/src/components/Table/TableHeader.js +0 -11
- package/src/components/Table/TableHeader.tsx +0 -28
- package/src/components/Table/TablePaginator.js +0 -5
- package/src/components/Table/TablePaginator.tsx +0 -10
- package/src/components/Table/TableRow.js +0 -16
- package/src/components/Table/TableRow.tsx +0 -31
- package/src/components/Table/TableTitle.js +0 -28
- package/src/components/Table/TableTitle.tsx +0 -58
- package/src/components/Table/index.js +0 -6
- package/src/components/Table/index.tsx +0 -6
- package/src/mappings/Table.js +0 -137
- package/src/mappings/Table.ts +0 -145
|
@@ -15,8 +15,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
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; }
|
|
17
17
|
|
|
18
|
-
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); }
|
|
19
|
-
|
|
20
18
|
const CONSTANTS = {
|
|
21
19
|
baseHeight: 42,
|
|
22
20
|
borderRadius: 4,
|
|
@@ -73,7 +71,7 @@ function Base(_ref) {
|
|
|
73
71
|
buttonStyles.justifyContent = "flex-end";
|
|
74
72
|
}
|
|
75
73
|
|
|
76
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
74
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
77
75
|
onPress: onPress,
|
|
78
76
|
disabled: disabled || loading,
|
|
79
77
|
style: _ref2 => {
|
|
@@ -83,8 +81,9 @@ function Base(_ref) {
|
|
|
83
81
|
return [styles.base, {
|
|
84
82
|
opacity: pressed || disabled ? 0.75 : 1
|
|
85
83
|
}, buttonStyles];
|
|
86
|
-
}
|
|
87
|
-
|
|
84
|
+
},
|
|
85
|
+
...props
|
|
86
|
+
}, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
|
|
88
87
|
size: "small",
|
|
89
88
|
color: color,
|
|
90
89
|
style: styles.loading
|
|
@@ -104,13 +103,14 @@ const Solid = _ref3 => {
|
|
|
104
103
|
theme,
|
|
105
104
|
...props
|
|
106
105
|
} = _ref3;
|
|
107
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
106
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
108
107
|
style: [{
|
|
109
108
|
color: "#FFF",
|
|
110
109
|
borderRadius: theme.roundness,
|
|
111
110
|
backgroundColor: theme.colors.primary
|
|
112
|
-
}, style]
|
|
113
|
-
|
|
111
|
+
}, style],
|
|
112
|
+
...props
|
|
113
|
+
});
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
const ButtonSolid = (0, _theming.withTheme)(Solid);
|
|
@@ -124,13 +124,14 @@ const Outline = _ref4 => {
|
|
|
124
124
|
theme,
|
|
125
125
|
...props
|
|
126
126
|
} = _ref4;
|
|
127
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
127
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
128
128
|
style: [styles.outline, {
|
|
129
129
|
borderRadius: theme.roundness,
|
|
130
130
|
borderColor: theme.colors.primary,
|
|
131
131
|
color: theme.colors.primary
|
|
132
|
-
}, style]
|
|
133
|
-
|
|
132
|
+
}, style],
|
|
133
|
+
...props
|
|
134
|
+
});
|
|
134
135
|
};
|
|
135
136
|
|
|
136
137
|
const ButtonOutline = (0, _theming.withTheme)(Outline);
|
|
@@ -178,4 +179,24 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
178
179
|
}
|
|
179
180
|
})
|
|
180
181
|
}
|
|
182
|
+
});nsparent",
|
|
183
|
+
padding: 0,
|
|
184
|
+
minHeight: undefined
|
|
185
|
+
},
|
|
186
|
+
loading: {
|
|
187
|
+
marginRight: 6
|
|
188
|
+
},
|
|
189
|
+
icon: { ..._reactNative.Platform.select({
|
|
190
|
+
web: {
|
|
191
|
+
marginTop: 1,
|
|
192
|
+
marginRight: 4,
|
|
193
|
+
alignSelf: "center"
|
|
194
|
+
},
|
|
195
|
+
default: {
|
|
196
|
+
marginBottom: 2,
|
|
197
|
+
marginRight: 4,
|
|
198
|
+
alignSelf: "center"
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
}
|
|
181
202
|
});
|
|
@@ -19,6 +19,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
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; }
|
|
21
21
|
|
|
22
|
+
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); }
|
|
23
|
+
|
|
22
24
|
const Container = _ref => {
|
|
23
25
|
let {
|
|
24
26
|
useThemeGutterPadding,
|
|
@@ -80,10 +82,9 @@ const Container = _ref => {
|
|
|
80
82
|
};
|
|
81
83
|
const Wrap = elevation ? _Elevation.default : _reactNative.View;
|
|
82
84
|
if (elevation) containerStyle.elevation = elevation;
|
|
83
|
-
return /*#__PURE__*/React.createElement(Wrap, {
|
|
84
|
-
style: [containerStyle, style]
|
|
85
|
-
|
|
86
|
-
}, backgroundImage ? /*#__PURE__*/React.createElement(_reactNative.ImageBackground, {
|
|
85
|
+
return /*#__PURE__*/React.createElement(Wrap, _extends({
|
|
86
|
+
style: [containerStyle, style]
|
|
87
|
+
}, rest), backgroundImage ? /*#__PURE__*/React.createElement(_reactNative.ImageBackground, {
|
|
87
88
|
source: typeof backgroundImage === "string" ? {
|
|
88
89
|
uri: backgroundImage
|
|
89
90
|
} : backgroundImage,
|
|
@@ -100,17 +101,4 @@ const Container = _ref => {
|
|
|
100
101
|
|
|
101
102
|
var _default = (0, _theming.withTheme)(Container);
|
|
102
103
|
|
|
103
|
-
exports.default = _default;izeMode: backgroundImageResizeMode,
|
|
104
|
-
style: {
|
|
105
|
-
flex: 1
|
|
106
|
-
}
|
|
107
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
108
|
-
style: innerStyle
|
|
109
|
-
}, children)) : /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
110
|
-
style: innerStyle
|
|
111
|
-
}, children));
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
var _default = (0, _theming.withTheme)(Container);
|
|
115
|
-
|
|
116
104
|
exports.default = _default;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -369,42 +369,6 @@ Object.defineProperty(exports, "SwitchRow", {
|
|
|
369
369
|
return _Switch.SwitchRow;
|
|
370
370
|
}
|
|
371
371
|
});
|
|
372
|
-
Object.defineProperty(exports, "Table", {
|
|
373
|
-
enumerable: true,
|
|
374
|
-
get: function () {
|
|
375
|
-
return _Table.Table;
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
Object.defineProperty(exports, "TableCell", {
|
|
379
|
-
enumerable: true,
|
|
380
|
-
get: function () {
|
|
381
|
-
return _Table.TableCell;
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
Object.defineProperty(exports, "TableHeader", {
|
|
385
|
-
enumerable: true,
|
|
386
|
-
get: function () {
|
|
387
|
-
return _Table.TableHeader;
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
Object.defineProperty(exports, "TablePaginator", {
|
|
391
|
-
enumerable: true,
|
|
392
|
-
get: function () {
|
|
393
|
-
return _Table.TablePaginator;
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
Object.defineProperty(exports, "TableRow", {
|
|
397
|
-
enumerable: true,
|
|
398
|
-
get: function () {
|
|
399
|
-
return _Table.TableRow;
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
Object.defineProperty(exports, "TableTitle", {
|
|
403
|
-
enumerable: true,
|
|
404
|
-
get: function () {
|
|
405
|
-
return _Table.TableTitle;
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
372
|
Object.defineProperty(exports, "TextField", {
|
|
409
373
|
enumerable: true,
|
|
410
374
|
get: function () {
|
|
@@ -512,8 +476,6 @@ var _Layout = require("./components/Layout");
|
|
|
512
476
|
|
|
513
477
|
var _index = require("./components/RadioButton/index");
|
|
514
478
|
|
|
515
|
-
var _Table = require("./components/Table");
|
|
516
|
-
|
|
517
479
|
var _CardBlock = _interopRequireDefault(require("./components/CardBlock"));
|
|
518
480
|
|
|
519
481
|
var _CardContainer = _interopRequireDefault(require("./components/CardContainer"));
|
|
@@ -12,7 +12,17 @@ const SEED_DATA = {
|
|
|
12
12
|
tag: "AudioPlayer",
|
|
13
13
|
description: "Given a source URL, plays sounds & audio!",
|
|
14
14
|
category: _types.COMPONENT_TYPES.media,
|
|
15
|
-
|
|
15
|
+
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position],
|
|
16
|
+
layout: {
|
|
17
|
+
backgroundColor: "#eee",
|
|
18
|
+
paddingLeft: 16,
|
|
19
|
+
paddingRight: 16,
|
|
20
|
+
paddingTop: 8,
|
|
21
|
+
paddingBottom: 8,
|
|
22
|
+
borderRadius: 24,
|
|
23
|
+
flexDirection: "row",
|
|
24
|
+
alignItems: "center"
|
|
25
|
+
},
|
|
16
26
|
props: {
|
|
17
27
|
source: {
|
|
18
28
|
group: _types.GROUPS.data,
|
|
@@ -23,7 +33,23 @@ const SEED_DATA = {
|
|
|
23
33
|
defaultValue: "https://static.draftbit.com/audio/intro-to-draftbit-audio.mp3",
|
|
24
34
|
formType: _types.FORM_TYPES.sourceUrl,
|
|
25
35
|
propType: _types.PROP_TYPES.OBJECT
|
|
26
|
-
}
|
|
36
|
+
},
|
|
37
|
+
sliderColor: (0, _types.createColorProp)({
|
|
38
|
+
label: "Thumb Color",
|
|
39
|
+
defaultValue: "black"
|
|
40
|
+
}),
|
|
41
|
+
completedTrackColor: (0, _types.createColorProp)({
|
|
42
|
+
label: "Completed Track Color",
|
|
43
|
+
defaultValue: "white"
|
|
44
|
+
}),
|
|
45
|
+
remainingTrackColor: (0, _types.createColorProp)({
|
|
46
|
+
label: "Remaining Track Color",
|
|
47
|
+
defaultValue: "#333333"
|
|
48
|
+
}),
|
|
49
|
+
trackThumbSize: (0, _types.createNumberProp)({
|
|
50
|
+
label: "Thumb Size",
|
|
51
|
+
defaultValue: 24
|
|
52
|
+
})
|
|
27
53
|
}
|
|
28
54
|
};
|
|
29
55
|
exports.SEED_DATA = SEED_DATA;
|
package/lib/module/index.js
CHANGED
|
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/Ac
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
|
|
34
|
-
export { Table, TableRow, TablePaginator, TableHeader, TableCell, TableTitle } from "./components/Table";
|
|
35
34
|
/* Deprecated: Fix or Delete! */
|
|
36
35
|
|
|
37
36
|
export { default as CardBlock } from "./components/CardBlock";
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES } from "@draftbit/types";
|
|
1
|
+
import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, StylesPanelSections, createColorProp, createNumberProp } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Audio Player",
|
|
4
4
|
tag: "AudioPlayer",
|
|
5
5
|
description: "Given a source URL, plays sounds & audio!",
|
|
6
6
|
category: COMPONENT_TYPES.media,
|
|
7
|
-
|
|
7
|
+
stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position],
|
|
8
|
+
layout: {
|
|
9
|
+
backgroundColor: "#eee",
|
|
10
|
+
paddingLeft: 16,
|
|
11
|
+
paddingRight: 16,
|
|
12
|
+
paddingTop: 8,
|
|
13
|
+
paddingBottom: 8,
|
|
14
|
+
borderRadius: 24,
|
|
15
|
+
flexDirection: "row",
|
|
16
|
+
alignItems: "center"
|
|
17
|
+
},
|
|
8
18
|
props: {
|
|
9
19
|
source: {
|
|
10
20
|
group: GROUPS.data,
|
|
@@ -15,6 +25,22 @@ export const SEED_DATA = {
|
|
|
15
25
|
defaultValue: "https://static.draftbit.com/audio/intro-to-draftbit-audio.mp3",
|
|
16
26
|
formType: FORM_TYPES.sourceUrl,
|
|
17
27
|
propType: PROP_TYPES.OBJECT
|
|
18
|
-
}
|
|
28
|
+
},
|
|
29
|
+
sliderColor: createColorProp({
|
|
30
|
+
label: "Thumb Color",
|
|
31
|
+
defaultValue: "black"
|
|
32
|
+
}),
|
|
33
|
+
completedTrackColor: createColorProp({
|
|
34
|
+
label: "Completed Track Color",
|
|
35
|
+
defaultValue: "white"
|
|
36
|
+
}),
|
|
37
|
+
remainingTrackColor: createColorProp({
|
|
38
|
+
label: "Remaining Track Color",
|
|
39
|
+
defaultValue: "#333333"
|
|
40
|
+
}),
|
|
41
|
+
trackThumbSize: createNumberProp({
|
|
42
|
+
label: "Thumb Size",
|
|
43
|
+
defaultValue: 24
|
|
44
|
+
})
|
|
19
45
|
}
|
|
20
46
|
};
|
package/lib/module/utilities.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
|
-
import { isString, isNumber, pick, pickBy, identity
|
|
2
|
+
import { isString, isNumber, pick, pickBy, identity } from "lodash";
|
|
3
3
|
export function extractStyles(style) {
|
|
4
4
|
const {
|
|
5
5
|
color,
|
|
@@ -29,8 +29,8 @@ export function extractStyles(style) {
|
|
|
29
29
|
textDecorationStyle
|
|
30
30
|
};
|
|
31
31
|
return {
|
|
32
|
-
viewStyles
|
|
33
|
-
textStyles
|
|
32
|
+
viewStyles,
|
|
33
|
+
textStyles
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
export const borderStyleNames = ["borderRadius", "borderBottomColor", "borderBottomEndRadius", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomStartRadius", "borderBottomWidth", "borderColor", "borderEndColor", "borderLeftColor", "borderLeftWidth", "borderRadius", "borderRightColor", "borderRightWidth", "borderStartColor", "borderStyle", "borderTopColor", "borderTopEndRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderTopStartRadius", "borderTopWidth", "borderWidth"];
|
|
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
|
-
export { Table, TableRow, TablePaginator, TableHeader, TableCell, TableTitle, } from "./components/Table";
|
|
35
34
|
export { default as CardBlock } from "./components/CardBlock";
|
|
36
35
|
export { default as CardContainer } from "./components/CardContainer";
|
|
37
36
|
export { default as CardContainerRating } from "./components/CardContainerRating";
|
|
@@ -3,7 +3,17 @@ export declare const SEED_DATA: {
|
|
|
3
3
|
tag: string;
|
|
4
4
|
description: string;
|
|
5
5
|
category: string;
|
|
6
|
-
|
|
6
|
+
stylesPanelSections: string[];
|
|
7
|
+
layout: {
|
|
8
|
+
backgroundColor: string;
|
|
9
|
+
paddingLeft: number;
|
|
10
|
+
paddingRight: number;
|
|
11
|
+
paddingTop: number;
|
|
12
|
+
paddingBottom: number;
|
|
13
|
+
borderRadius: number;
|
|
14
|
+
flexDirection: string;
|
|
15
|
+
alignItems: string;
|
|
16
|
+
};
|
|
7
17
|
props: {
|
|
8
18
|
source: {
|
|
9
19
|
group: string;
|
|
@@ -15,5 +25,46 @@ export declare const SEED_DATA: {
|
|
|
15
25
|
formType: string;
|
|
16
26
|
propType: string;
|
|
17
27
|
};
|
|
28
|
+
sliderColor: {
|
|
29
|
+
group: string;
|
|
30
|
+
label: string;
|
|
31
|
+
description: string;
|
|
32
|
+
editable: boolean;
|
|
33
|
+
required: boolean;
|
|
34
|
+
defaultValue: null;
|
|
35
|
+
formType: string;
|
|
36
|
+
propType: string;
|
|
37
|
+
};
|
|
38
|
+
completedTrackColor: {
|
|
39
|
+
group: string;
|
|
40
|
+
label: string;
|
|
41
|
+
description: string;
|
|
42
|
+
editable: boolean;
|
|
43
|
+
required: boolean;
|
|
44
|
+
defaultValue: null;
|
|
45
|
+
formType: string;
|
|
46
|
+
propType: string;
|
|
47
|
+
};
|
|
48
|
+
remainingTrackColor: {
|
|
49
|
+
group: string;
|
|
50
|
+
label: string;
|
|
51
|
+
description: string;
|
|
52
|
+
editable: boolean;
|
|
53
|
+
required: boolean;
|
|
54
|
+
defaultValue: null;
|
|
55
|
+
formType: string;
|
|
56
|
+
propType: string;
|
|
57
|
+
};
|
|
58
|
+
trackThumbSize: {
|
|
59
|
+
label: string;
|
|
60
|
+
description: string;
|
|
61
|
+
formType: string;
|
|
62
|
+
propType: string;
|
|
63
|
+
group: string;
|
|
64
|
+
defaultValue: null;
|
|
65
|
+
editable: boolean;
|
|
66
|
+
required: boolean;
|
|
67
|
+
step: number;
|
|
68
|
+
};
|
|
18
69
|
};
|
|
19
70
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
|
-
import { StyleProp } from "react-native";
|
|
2
|
+
import { StyleProp, TextStyle } from "react-native";
|
|
3
3
|
export declare function extractStyles(style: StyleProp<any>): {
|
|
4
|
-
viewStyles:
|
|
5
|
-
textStyles:
|
|
4
|
+
viewStyles: any;
|
|
5
|
+
textStyles: TextStyle;
|
|
6
6
|
};
|
|
7
7
|
export declare const borderStyleNames: string[];
|
|
8
8
|
export declare const marginStyleNames: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.4.4-
|
|
3
|
+
"version": "46.4.4-64c11a.2+64c11a6",
|
|
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": "^46.4.4-
|
|
44
|
+
"@draftbit/types": "^46.4.4-64c11a.2+64c11a6",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
]
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "64c11a6d42bef20b500a03e6ca52f5ad693d569f"
|
|
85
85
|
}
|
package/src/index.js
CHANGED
|
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
|
-
export { Table, TableRow, TablePaginator, TableHeader, TableCell, TableTitle, } from "./components/Table";
|
|
35
34
|
/* Deprecated: Fix or Delete! */
|
|
36
35
|
export { default as CardBlock } from "./components/CardBlock";
|
|
37
36
|
export { default as CardContainer } from "./components/CardContainer";
|
package/src/index.tsx
CHANGED
|
@@ -51,15 +51,6 @@ export {
|
|
|
51
51
|
RadioButtonFieldGroup,
|
|
52
52
|
} from "./components/RadioButton/index";
|
|
53
53
|
|
|
54
|
-
export {
|
|
55
|
-
Table,
|
|
56
|
-
TableRow,
|
|
57
|
-
TablePaginator,
|
|
58
|
-
TableHeader,
|
|
59
|
-
TableCell,
|
|
60
|
-
TableTitle,
|
|
61
|
-
} from "./components/Table";
|
|
62
|
-
|
|
63
54
|
/* Deprecated: Fix or Delete! */
|
|
64
55
|
export { default as CardBlock } from "./components/CardBlock";
|
|
65
56
|
export { default as CardContainer } from "./components/CardContainer";
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
-
import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, } from "@draftbit/types";
|
|
1
|
+
import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, StylesPanelSections, createColorProp, createNumberProp, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Audio Player",
|
|
4
4
|
tag: "AudioPlayer",
|
|
5
5
|
description: "Given a source URL, plays sounds & audio!",
|
|
6
6
|
category: COMPONENT_TYPES.media,
|
|
7
|
-
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.Typography,
|
|
9
|
+
StylesPanelSections.Background,
|
|
10
|
+
StylesPanelSections.Borders,
|
|
11
|
+
StylesPanelSections.Size,
|
|
12
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
13
|
+
StylesPanelSections.Position,
|
|
14
|
+
],
|
|
15
|
+
layout: {
|
|
16
|
+
backgroundColor: "#eee",
|
|
17
|
+
paddingLeft: 16,
|
|
18
|
+
paddingRight: 16,
|
|
19
|
+
paddingTop: 8,
|
|
20
|
+
paddingBottom: 8,
|
|
21
|
+
borderRadius: 24,
|
|
22
|
+
flexDirection: "row",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
},
|
|
8
25
|
props: {
|
|
9
26
|
source: {
|
|
10
27
|
group: GROUPS.data,
|
|
@@ -16,5 +33,21 @@ export const SEED_DATA = {
|
|
|
16
33
|
formType: FORM_TYPES.sourceUrl,
|
|
17
34
|
propType: PROP_TYPES.OBJECT,
|
|
18
35
|
},
|
|
36
|
+
sliderColor: createColorProp({
|
|
37
|
+
label: "Thumb Color",
|
|
38
|
+
defaultValue: "black",
|
|
39
|
+
}),
|
|
40
|
+
completedTrackColor: createColorProp({
|
|
41
|
+
label: "Completed Track Color",
|
|
42
|
+
defaultValue: "white",
|
|
43
|
+
}),
|
|
44
|
+
remainingTrackColor: createColorProp({
|
|
45
|
+
label: "Remaining Track Color",
|
|
46
|
+
defaultValue: "#333333",
|
|
47
|
+
}),
|
|
48
|
+
trackThumbSize: createNumberProp({
|
|
49
|
+
label: "Thumb Size",
|
|
50
|
+
defaultValue: 24,
|
|
51
|
+
}),
|
|
19
52
|
},
|
|
20
53
|
};
|
|
@@ -3,6 +3,9 @@ import {
|
|
|
3
3
|
COMPONENT_TYPES,
|
|
4
4
|
FORM_TYPES,
|
|
5
5
|
PROP_TYPES,
|
|
6
|
+
StylesPanelSections,
|
|
7
|
+
createColorProp,
|
|
8
|
+
createNumberProp,
|
|
6
9
|
} from "@draftbit/types";
|
|
7
10
|
|
|
8
11
|
export const SEED_DATA = {
|
|
@@ -10,7 +13,24 @@ export const SEED_DATA = {
|
|
|
10
13
|
tag: "AudioPlayer",
|
|
11
14
|
description: "Given a source URL, plays sounds & audio!",
|
|
12
15
|
category: COMPONENT_TYPES.media,
|
|
13
|
-
|
|
16
|
+
stylesPanelSections: [
|
|
17
|
+
StylesPanelSections.Typography,
|
|
18
|
+
StylesPanelSections.Background,
|
|
19
|
+
StylesPanelSections.Borders,
|
|
20
|
+
StylesPanelSections.Size,
|
|
21
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
22
|
+
StylesPanelSections.Position,
|
|
23
|
+
],
|
|
24
|
+
layout: {
|
|
25
|
+
backgroundColor: "#eee",
|
|
26
|
+
paddingLeft: 16,
|
|
27
|
+
paddingRight: 16,
|
|
28
|
+
paddingTop: 8,
|
|
29
|
+
paddingBottom: 8,
|
|
30
|
+
borderRadius: 24,
|
|
31
|
+
flexDirection: "row",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
},
|
|
14
34
|
props: {
|
|
15
35
|
source: {
|
|
16
36
|
group: GROUPS.data,
|
|
@@ -23,5 +43,21 @@ export const SEED_DATA = {
|
|
|
23
43
|
formType: FORM_TYPES.sourceUrl,
|
|
24
44
|
propType: PROP_TYPES.OBJECT,
|
|
25
45
|
},
|
|
46
|
+
sliderColor: createColorProp({
|
|
47
|
+
label: "Thumb Color",
|
|
48
|
+
defaultValue: "black",
|
|
49
|
+
}),
|
|
50
|
+
completedTrackColor: createColorProp({
|
|
51
|
+
label: "Completed Track Color",
|
|
52
|
+
defaultValue: "white",
|
|
53
|
+
}),
|
|
54
|
+
remainingTrackColor: createColorProp({
|
|
55
|
+
label: "Remaining Track Color",
|
|
56
|
+
defaultValue: "#333333",
|
|
57
|
+
}),
|
|
58
|
+
trackThumbSize: createNumberProp({
|
|
59
|
+
label: "Thumb Size",
|
|
60
|
+
defaultValue: 24,
|
|
61
|
+
}),
|
|
26
62
|
},
|
|
27
63
|
};
|
package/src/utilities.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
|
-
import { isString, isNumber, pick, pickBy, identity
|
|
2
|
+
import { isString, isNumber, pick, pickBy, identity } from "lodash";
|
|
3
3
|
export function extractStyles(style) {
|
|
4
4
|
const { color, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...viewStyles } = StyleSheet.flatten(style || {});
|
|
5
5
|
const textStyles = {
|
|
@@ -15,10 +15,7 @@ export function extractStyles(style) {
|
|
|
15
15
|
textDecorationColor,
|
|
16
16
|
textDecorationStyle,
|
|
17
17
|
};
|
|
18
|
-
return {
|
|
19
|
-
viewStyles: omitBy(viewStyles, isNil),
|
|
20
|
-
textStyles: omitBy(textStyles, isNil),
|
|
21
|
-
};
|
|
18
|
+
return { viewStyles, textStyles };
|
|
22
19
|
}
|
|
23
20
|
export const borderStyleNames = [
|
|
24
21
|
"borderRadius",
|
package/src/utilities.ts
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { StyleSheet, StyleProp, TextStyle } from "react-native";
|
|
2
|
-
import {
|
|
3
|
-
isString,
|
|
4
|
-
isNumber,
|
|
5
|
-
pick,
|
|
6
|
-
pickBy,
|
|
7
|
-
identity,
|
|
8
|
-
omitBy,
|
|
9
|
-
isNil,
|
|
10
|
-
} from "lodash";
|
|
2
|
+
import { isString, isNumber, pick, pickBy, identity } from "lodash";
|
|
11
3
|
|
|
12
4
|
export function extractStyles(style: StyleProp<any>) {
|
|
13
5
|
const {
|
|
@@ -39,10 +31,7 @@ export function extractStyles(style: StyleProp<any>) {
|
|
|
39
31
|
textDecorationStyle,
|
|
40
32
|
};
|
|
41
33
|
|
|
42
|
-
return {
|
|
43
|
-
viewStyles: omitBy(viewStyles, isNil),
|
|
44
|
-
textStyles: omitBy(textStyles, isNil),
|
|
45
|
-
};
|
|
34
|
+
return { viewStyles, textStyles };
|
|
46
35
|
}
|
|
47
36
|
|
|
48
37
|
export const borderStyleNames = [
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
const Table = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
children,
|
|
17
|
-
style,
|
|
18
|
-
...rest
|
|
19
|
-
} = _ref;
|
|
20
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, { ...rest,
|
|
21
|
-
style: [styles.wrapper, style]
|
|
22
|
-
}, children);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const styles = _reactNative.StyleSheet.create({
|
|
26
|
-
wrapper: {
|
|
27
|
-
display: "flex",
|
|
28
|
-
flexDirection: "column"
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
var _default = Table;
|
|
33
|
-
exports.default = _default;,
|
|
34
|
-
style,
|
|
35
|
-
...rest
|
|
36
|
-
} = _ref;
|
|
37
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
38
|
-
style: [styles.wrapper, style]
|
|
39
|
-
}), children);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const styles = _reactNative.StyleSheet.create({
|
|
43
|
-
wrapper: {
|
|
44
|
-
display: "flex",
|
|
45
|
-
flexDirection: "column"
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
var _default = Table;
|
|
50
|
-
exports.default = _default;
|