@draftbit/core 46.4.4-ae1fa9.2 → 46.4.4-b53636.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/Accordion/AccordionItem.js +25 -5
- package/lib/commonjs/components/AnimatedCircularProgress.js +12 -2
- package/lib/commonjs/components/CircleImage.js +16 -2
- package/lib/commonjs/mappings/AudioPlayer.js +32 -2
- package/lib/module/components/Accordion/AccordionItem.js +26 -5
- package/lib/module/components/AspectRatio.js +2 -19
- package/lib/module/components/Divider.js +2 -20
- package/lib/module/mappings/AudioPlayer.js +33 -3
- package/lib/typescript/src/mappings/AudioPlayer.d.ts +62 -1
- package/package.json +3 -4
- package/src/mappings/AudioPlayer.js +39 -2
- package/src/mappings/AudioPlayer.ts +41 -1
- package/lib/commonjs/mappings/Elements.js +0 -127
- package/lib/module/mappings/Elements.js +0 -119
- package/lib/typescript/src/mappings/Elements.d.ts +0 -43
- package/src/mappings/Elements.js +0 -141
- package/src/mappings/Elements.ts +0 -150
|
@@ -21,8 +21,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
|
-
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); }
|
|
25
|
-
|
|
26
24
|
const AccordionItem = _ref => {
|
|
27
25
|
let {
|
|
28
26
|
Icon,
|
|
@@ -37,9 +35,10 @@ const AccordionItem = _ref => {
|
|
|
37
35
|
textStyles,
|
|
38
36
|
viewStyles
|
|
39
37
|
} = (0, _utilities.extractStyles)(style);
|
|
40
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
41
|
-
style: [styles.container, viewStyles]
|
|
42
|
-
|
|
38
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
39
|
+
style: [styles.container, viewStyles],
|
|
40
|
+
...rest
|
|
41
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
43
42
|
style: styles.row
|
|
44
43
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
45
44
|
name: icon,
|
|
@@ -74,4 +73,25 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
74
73
|
|
|
75
74
|
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
76
75
|
|
|
76
|
+
exports.default = _default;StyleSheet.create({
|
|
77
|
+
container: {
|
|
78
|
+
padding: 8
|
|
79
|
+
},
|
|
80
|
+
row: {
|
|
81
|
+
flexDirection: "row",
|
|
82
|
+
alignItems: "center",
|
|
83
|
+
paddingLeft: 8
|
|
84
|
+
},
|
|
85
|
+
item: {
|
|
86
|
+
marginVertical: 6,
|
|
87
|
+
paddingLeft: 8
|
|
88
|
+
},
|
|
89
|
+
content: {
|
|
90
|
+
flex: 1,
|
|
91
|
+
justifyContent: "center"
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
96
|
+
|
|
77
97
|
exports.default = _default;
|
|
@@ -17,8 +17,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
17
|
|
|
18
18
|
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; }
|
|
19
19
|
|
|
20
|
-
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); }
|
|
21
|
-
|
|
22
20
|
const AnimatedProgress = _reactNative.Animated.createAnimatedComponent(_CircularProgress.default);
|
|
23
21
|
|
|
24
22
|
const AnimatedCircularProgress = _ref => {
|
|
@@ -69,6 +67,18 @@ const AnimatedCircularProgress = _ref => {
|
|
|
69
67
|
React.useEffect(() => {
|
|
70
68
|
animate();
|
|
71
69
|
}, [fill, animate]);
|
|
70
|
+
return /*#__PURE__*/React.createElement(AnimatedProgress, { ...other,
|
|
71
|
+
style: other.style,
|
|
72
|
+
childrenContainerStyle: other.childrenContainerStyle,
|
|
73
|
+
fill: fillAnimation,
|
|
74
|
+
tintColor: animateColor()
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
var _default = AnimatedCircularProgress;
|
|
79
|
+
exports.default = _default;eEffect(() => {
|
|
80
|
+
animate();
|
|
81
|
+
}, [fill, animate]);
|
|
72
82
|
return /*#__PURE__*/React.createElement(AnimatedProgress, _extends({}, other, {
|
|
73
83
|
style: other.style,
|
|
74
84
|
childrenContainerStyle: other.childrenContainerStyle,
|
|
@@ -17,8 +17,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
17
|
|
|
18
18
|
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; }
|
|
19
19
|
|
|
20
|
-
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); }
|
|
21
|
-
|
|
22
20
|
const CircleImage = _ref => {
|
|
23
21
|
let {
|
|
24
22
|
source = _Config.default.placeholderImageURL,
|
|
@@ -27,6 +25,22 @@ const CircleImage = _ref => {
|
|
|
27
25
|
...props
|
|
28
26
|
} = _ref;
|
|
29
27
|
const borderRadius = size / 2;
|
|
28
|
+
return /*#__PURE__*/React.createElement(_reactNative.Image, {
|
|
29
|
+
style: [{
|
|
30
|
+
width: size,
|
|
31
|
+
height: size,
|
|
32
|
+
borderRadius
|
|
33
|
+
}, style],
|
|
34
|
+
source: typeof source === "string" ? {
|
|
35
|
+
uri: source
|
|
36
|
+
} : source,
|
|
37
|
+
resizeMode: "cover",
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var _default = CircleImage;
|
|
43
|
+
exports.default = _default;size / 2;
|
|
30
44
|
return /*#__PURE__*/React.createElement(_reactNative.Image, _extends({
|
|
31
45
|
style: [{
|
|
32
46
|
width: size,
|
|
@@ -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,27 @@ 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
|
+
}),
|
|
53
|
+
playIconColor: (0, _types.createColorProp)({
|
|
54
|
+
label: "Play Icon Color",
|
|
55
|
+
defaultValue: "black"
|
|
56
|
+
})
|
|
27
57
|
}
|
|
28
58
|
};
|
|
29
59
|
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,5 +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
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
2
|
import { Pressable, StyleSheet, View } from "react-native";
|
|
5
3
|
import Text from "../Text";
|
|
@@ -20,9 +18,10 @@ const AccordionItem = _ref => {
|
|
|
20
18
|
textStyles,
|
|
21
19
|
viewStyles
|
|
22
20
|
} = extractStyles(style);
|
|
23
|
-
return /*#__PURE__*/React.createElement(Pressable,
|
|
24
|
-
style: [styles.container, viewStyles]
|
|
25
|
-
|
|
21
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
22
|
+
style: [styles.container, viewStyles],
|
|
23
|
+
...rest
|
|
24
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
26
25
|
style: styles.row
|
|
27
26
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
28
27
|
name: icon,
|
|
@@ -36,6 +35,28 @@ const AccordionItem = _ref => {
|
|
|
36
35
|
}, label))));
|
|
37
36
|
};
|
|
38
37
|
|
|
38
|
+
const styles = StyleSheet.create({
|
|
39
|
+
container: {
|
|
40
|
+
padding: 8
|
|
41
|
+
},
|
|
42
|
+
row: {
|
|
43
|
+
flexDirection: "row",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
paddingLeft: 8
|
|
46
|
+
},
|
|
47
|
+
item: {
|
|
48
|
+
marginVertical: 6,
|
|
49
|
+
paddingLeft: 8
|
|
50
|
+
},
|
|
51
|
+
content: {
|
|
52
|
+
flex: 1,
|
|
53
|
+
justifyContent: "center"
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export default withTheme(AccordionItem);xtStyles
|
|
57
|
+
}, label))));
|
|
58
|
+
};
|
|
59
|
+
|
|
39
60
|
const styles = StyleSheet.create({
|
|
40
61
|
container: {
|
|
41
62
|
padding: 8
|
|
@@ -1,3 +1,5 @@
|
|
|
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
3
|
import React from "react";
|
|
2
4
|
import { View, StyleSheet } from "react-native";
|
|
3
5
|
|
|
@@ -30,25 +32,6 @@ const AspectRatio = props => {
|
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
return /*#__PURE__*/React.createElement(View, { ...props,
|
|
34
|
-
style: style,
|
|
35
|
-
onLayout: _ref => {
|
|
36
|
-
let {
|
|
37
|
-
nativeEvent: {
|
|
38
|
-
layout: l
|
|
39
|
-
}
|
|
40
|
-
} = _ref;
|
|
41
|
-
return setLayout(l);
|
|
42
|
-
}
|
|
43
|
-
}, props.children);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export default AspectRatio; width,
|
|
47
|
-
height: width * (1 / aspectRatio)
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
35
|
return /*#__PURE__*/React.createElement(View, _extends({}, props, {
|
|
53
36
|
style: style,
|
|
54
37
|
onLayout: _ref => {
|
|
@@ -1,27 +1,9 @@
|
|
|
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
3
|
import * as React from "react";
|
|
2
4
|
import { StyleSheet, View } from "react-native";
|
|
3
5
|
import { withTheme } from "../theming";
|
|
4
6
|
|
|
5
|
-
const Divider = _ref => {
|
|
6
|
-
let {
|
|
7
|
-
style,
|
|
8
|
-
color,
|
|
9
|
-
theme: {
|
|
10
|
-
colors
|
|
11
|
-
},
|
|
12
|
-
...rest
|
|
13
|
-
} = _ref;
|
|
14
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
15
|
-
style: [{
|
|
16
|
-
backgroundColor: color || colors.divider,
|
|
17
|
-
height: StyleSheet.hairlineWidth
|
|
18
|
-
}, style],
|
|
19
|
-
...rest
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default withTheme(Divider);ng";
|
|
24
|
-
|
|
25
7
|
const Divider = _ref => {
|
|
26
8
|
let {
|
|
27
9
|
style,
|
|
@@ -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,26 @@ 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
|
+
}),
|
|
45
|
+
playIconColor: createColorProp({
|
|
46
|
+
label: "Play Icon Color",
|
|
47
|
+
defaultValue: "black"
|
|
48
|
+
})
|
|
19
49
|
}
|
|
20
50
|
};
|
|
@@ -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,56 @@ 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
|
+
};
|
|
69
|
+
playIconColor: {
|
|
70
|
+
group: string;
|
|
71
|
+
label: string;
|
|
72
|
+
description: string;
|
|
73
|
+
editable: boolean;
|
|
74
|
+
required: boolean;
|
|
75
|
+
defaultValue: null;
|
|
76
|
+
formType: string;
|
|
77
|
+
propType: string;
|
|
78
|
+
};
|
|
18
79
|
};
|
|
19
80
|
};
|
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-b53636.2+b536363",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,8 +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-
|
|
45
|
-
"@expo/html-elements": "^0.2.0",
|
|
44
|
+
"@draftbit/types": "^46.4.4-b53636.2+b536363",
|
|
46
45
|
"@material-ui/core": "^4.11.0",
|
|
47
46
|
"@material-ui/pickers": "^3.2.10",
|
|
48
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -82,5 +81,5 @@
|
|
|
82
81
|
]
|
|
83
82
|
]
|
|
84
83
|
},
|
|
85
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "b536363885da285bd8327c5c4cb51fd9e03bdf78"
|
|
86
85
|
}
|
|
@@ -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,25 @@ 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
|
+
}),
|
|
52
|
+
playIconColor: createColorProp({
|
|
53
|
+
label: "Play Icon Color",
|
|
54
|
+
defaultValue: "black",
|
|
55
|
+
}),
|
|
19
56
|
},
|
|
20
57
|
};
|
|
@@ -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,25 @@ 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
|
+
}),
|
|
62
|
+
playIconColor: createColorProp({
|
|
63
|
+
label: "Play Icon Color",
|
|
64
|
+
defaultValue: "black",
|
|
65
|
+
}),
|
|
26
66
|
},
|
|
27
67
|
};
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SEED_DATA = void 0;
|
|
7
|
-
|
|
8
|
-
var _types = require("@draftbit/types");
|
|
9
|
-
|
|
10
|
-
const SEED_DATA_TRIGGERS = [_types.Triggers.OnValueChange];
|
|
11
|
-
const ELEMENT_PROPS = {
|
|
12
|
-
category: _types.COMPONENT_TYPES.element,
|
|
13
|
-
stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
|
|
14
|
-
layout: {
|
|
15
|
-
margin: 0
|
|
16
|
-
},
|
|
17
|
-
triggers: SEED_DATA_TRIGGERS
|
|
18
|
-
};
|
|
19
|
-
const HEADING_PROPS = { ...ELEMENT_PROPS
|
|
20
|
-
};
|
|
21
|
-
const SEED_DATA = [{
|
|
22
|
-
name: "H1",
|
|
23
|
-
tag: "H1",
|
|
24
|
-
...HEADING_PROPS
|
|
25
|
-
}, {
|
|
26
|
-
name: "H2",
|
|
27
|
-
tag: "H2",
|
|
28
|
-
...HEADING_PROPS
|
|
29
|
-
}, {
|
|
30
|
-
name: "H3",
|
|
31
|
-
tag: "H3",
|
|
32
|
-
...HEADING_PROPS
|
|
33
|
-
}, {
|
|
34
|
-
name: "H4",
|
|
35
|
-
tag: "H4",
|
|
36
|
-
...HEADING_PROPS
|
|
37
|
-
}, {
|
|
38
|
-
name: "H5",
|
|
39
|
-
tag: "H5",
|
|
40
|
-
...HEADING_PROPS
|
|
41
|
-
}, {
|
|
42
|
-
name: "H6",
|
|
43
|
-
tag: "H6",
|
|
44
|
-
...HEADING_PROPS
|
|
45
|
-
}, {
|
|
46
|
-
name: "Anchor",
|
|
47
|
-
tag: "A",
|
|
48
|
-
...ELEMENT_PROPS,
|
|
49
|
-
props: {
|
|
50
|
-
href: (0, _types.createTextProp)({
|
|
51
|
-
label: "href",
|
|
52
|
-
description: "Specify the URL",
|
|
53
|
-
defaultValue: ""
|
|
54
|
-
}),
|
|
55
|
-
target: {
|
|
56
|
-
group: _types.GROUPS.basic,
|
|
57
|
-
label: "target",
|
|
58
|
-
description: "decide where link should open",
|
|
59
|
-
formType: _types.FORM_TYPES.flatArray,
|
|
60
|
-
defaultValue: "_blank",
|
|
61
|
-
options: ["_blank", "_self", "_parent", "_top"]
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}, {
|
|
65
|
-
name: "Paragraph",
|
|
66
|
-
tag: "P",
|
|
67
|
-
...ELEMENT_PROPS,
|
|
68
|
-
props: {// NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
|
|
69
|
-
// strong: createBoolProp({
|
|
70
|
-
// label: "Strong",
|
|
71
|
-
// description: "Strong",
|
|
72
|
-
// }),
|
|
73
|
-
// strike: createBoolProp({
|
|
74
|
-
// label: "Strike",
|
|
75
|
-
// description: "Strike through",
|
|
76
|
-
// }),
|
|
77
|
-
// italic: createBoolProp({
|
|
78
|
-
// label: "Italic",
|
|
79
|
-
// description: "Italic Fonts",
|
|
80
|
-
// }),
|
|
81
|
-
// bold: createBoolProp({
|
|
82
|
-
// label: "Bold",
|
|
83
|
-
// description: "Bold",
|
|
84
|
-
// }),
|
|
85
|
-
}
|
|
86
|
-
}, {
|
|
87
|
-
name: "Code",
|
|
88
|
-
tag: "Code",
|
|
89
|
-
...ELEMENT_PROPS
|
|
90
|
-
}, {
|
|
91
|
-
name: "Pre",
|
|
92
|
-
tag: "Pre",
|
|
93
|
-
...ELEMENT_PROPS
|
|
94
|
-
}, {
|
|
95
|
-
name: "Mark",
|
|
96
|
-
tag: "Mark",
|
|
97
|
-
...ELEMENT_PROPS
|
|
98
|
-
}, {
|
|
99
|
-
name: "BR",
|
|
100
|
-
tag: "BR",
|
|
101
|
-
...ELEMENT_PROPS
|
|
102
|
-
}, {
|
|
103
|
-
name: "Quote",
|
|
104
|
-
tag: "Q",
|
|
105
|
-
...ELEMENT_PROPS
|
|
106
|
-
}, {
|
|
107
|
-
name: "BlockQuote",
|
|
108
|
-
tag: "BlockQuote",
|
|
109
|
-
...ELEMENT_PROPS
|
|
110
|
-
}, {
|
|
111
|
-
name: "Time",
|
|
112
|
-
tag: "Time",
|
|
113
|
-
...ELEMENT_PROPS
|
|
114
|
-
}, {
|
|
115
|
-
name: "UL",
|
|
116
|
-
tag: "UL",
|
|
117
|
-
...ELEMENT_PROPS
|
|
118
|
-
}, {
|
|
119
|
-
name: "LI",
|
|
120
|
-
tag: "LI",
|
|
121
|
-
...ELEMENT_PROPS
|
|
122
|
-
}, {
|
|
123
|
-
name: "HR",
|
|
124
|
-
tag: "HR",
|
|
125
|
-
...ELEMENT_PROPS
|
|
126
|
-
}];
|
|
127
|
-
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, // createBoolProp,
|
|
2
|
-
createTextProp, FORM_TYPES, GROUPS, Triggers } from "@draftbit/types";
|
|
3
|
-
const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
|
|
4
|
-
const ELEMENT_PROPS = {
|
|
5
|
-
category: COMPONENT_TYPES.element,
|
|
6
|
-
stylesPanelSections: BLOCK_STYLES_SECTIONS,
|
|
7
|
-
layout: {
|
|
8
|
-
margin: 0
|
|
9
|
-
},
|
|
10
|
-
triggers: SEED_DATA_TRIGGERS
|
|
11
|
-
};
|
|
12
|
-
const HEADING_PROPS = { ...ELEMENT_PROPS
|
|
13
|
-
};
|
|
14
|
-
export const SEED_DATA = [{
|
|
15
|
-
name: "H1",
|
|
16
|
-
tag: "H1",
|
|
17
|
-
...HEADING_PROPS
|
|
18
|
-
}, {
|
|
19
|
-
name: "H2",
|
|
20
|
-
tag: "H2",
|
|
21
|
-
...HEADING_PROPS
|
|
22
|
-
}, {
|
|
23
|
-
name: "H3",
|
|
24
|
-
tag: "H3",
|
|
25
|
-
...HEADING_PROPS
|
|
26
|
-
}, {
|
|
27
|
-
name: "H4",
|
|
28
|
-
tag: "H4",
|
|
29
|
-
...HEADING_PROPS
|
|
30
|
-
}, {
|
|
31
|
-
name: "H5",
|
|
32
|
-
tag: "H5",
|
|
33
|
-
...HEADING_PROPS
|
|
34
|
-
}, {
|
|
35
|
-
name: "H6",
|
|
36
|
-
tag: "H6",
|
|
37
|
-
...HEADING_PROPS
|
|
38
|
-
}, {
|
|
39
|
-
name: "Anchor",
|
|
40
|
-
tag: "A",
|
|
41
|
-
...ELEMENT_PROPS,
|
|
42
|
-
props: {
|
|
43
|
-
href: createTextProp({
|
|
44
|
-
label: "href",
|
|
45
|
-
description: "Specify the URL",
|
|
46
|
-
defaultValue: ""
|
|
47
|
-
}),
|
|
48
|
-
target: {
|
|
49
|
-
group: GROUPS.basic,
|
|
50
|
-
label: "target",
|
|
51
|
-
description: "decide where link should open",
|
|
52
|
-
formType: FORM_TYPES.flatArray,
|
|
53
|
-
defaultValue: "_blank",
|
|
54
|
-
options: ["_blank", "_self", "_parent", "_top"]
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}, {
|
|
58
|
-
name: "Paragraph",
|
|
59
|
-
tag: "P",
|
|
60
|
-
...ELEMENT_PROPS,
|
|
61
|
-
props: {// NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
|
|
62
|
-
// strong: createBoolProp({
|
|
63
|
-
// label: "Strong",
|
|
64
|
-
// description: "Strong",
|
|
65
|
-
// }),
|
|
66
|
-
// strike: createBoolProp({
|
|
67
|
-
// label: "Strike",
|
|
68
|
-
// description: "Strike through",
|
|
69
|
-
// }),
|
|
70
|
-
// italic: createBoolProp({
|
|
71
|
-
// label: "Italic",
|
|
72
|
-
// description: "Italic Fonts",
|
|
73
|
-
// }),
|
|
74
|
-
// bold: createBoolProp({
|
|
75
|
-
// label: "Bold",
|
|
76
|
-
// description: "Bold",
|
|
77
|
-
// }),
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
name: "Code",
|
|
81
|
-
tag: "Code",
|
|
82
|
-
...ELEMENT_PROPS
|
|
83
|
-
}, {
|
|
84
|
-
name: "Pre",
|
|
85
|
-
tag: "Pre",
|
|
86
|
-
...ELEMENT_PROPS
|
|
87
|
-
}, {
|
|
88
|
-
name: "Mark",
|
|
89
|
-
tag: "Mark",
|
|
90
|
-
...ELEMENT_PROPS
|
|
91
|
-
}, {
|
|
92
|
-
name: "BR",
|
|
93
|
-
tag: "BR",
|
|
94
|
-
...ELEMENT_PROPS
|
|
95
|
-
}, {
|
|
96
|
-
name: "Quote",
|
|
97
|
-
tag: "Q",
|
|
98
|
-
...ELEMENT_PROPS
|
|
99
|
-
}, {
|
|
100
|
-
name: "BlockQuote",
|
|
101
|
-
tag: "BlockQuote",
|
|
102
|
-
...ELEMENT_PROPS
|
|
103
|
-
}, {
|
|
104
|
-
name: "Time",
|
|
105
|
-
tag: "Time",
|
|
106
|
-
...ELEMENT_PROPS
|
|
107
|
-
}, {
|
|
108
|
-
name: "UL",
|
|
109
|
-
tag: "UL",
|
|
110
|
-
...ELEMENT_PROPS
|
|
111
|
-
}, {
|
|
112
|
-
name: "LI",
|
|
113
|
-
tag: "LI",
|
|
114
|
-
...ELEMENT_PROPS
|
|
115
|
-
}, {
|
|
116
|
-
name: "HR",
|
|
117
|
-
tag: "HR",
|
|
118
|
-
...ELEMENT_PROPS
|
|
119
|
-
}];
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export declare const SEED_DATA: ({
|
|
2
|
-
category: string;
|
|
3
|
-
stylesPanelSections: string[];
|
|
4
|
-
layout: {
|
|
5
|
-
margin: number;
|
|
6
|
-
};
|
|
7
|
-
triggers: string[];
|
|
8
|
-
name: string;
|
|
9
|
-
tag: string;
|
|
10
|
-
} | {
|
|
11
|
-
props: {
|
|
12
|
-
href: any;
|
|
13
|
-
target: {
|
|
14
|
-
group: string;
|
|
15
|
-
label: string;
|
|
16
|
-
description: string;
|
|
17
|
-
formType: string;
|
|
18
|
-
defaultValue: string;
|
|
19
|
-
options: string[];
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
category: string;
|
|
23
|
-
stylesPanelSections: string[];
|
|
24
|
-
layout: {
|
|
25
|
-
margin: number;
|
|
26
|
-
};
|
|
27
|
-
triggers: string[];
|
|
28
|
-
name: string;
|
|
29
|
-
tag: string;
|
|
30
|
-
} | {
|
|
31
|
-
props: {
|
|
32
|
-
href?: undefined;
|
|
33
|
-
target?: undefined;
|
|
34
|
-
};
|
|
35
|
-
category: string;
|
|
36
|
-
stylesPanelSections: string[];
|
|
37
|
-
layout: {
|
|
38
|
-
margin: number;
|
|
39
|
-
};
|
|
40
|
-
triggers: string[];
|
|
41
|
-
name: string;
|
|
42
|
-
tag: string;
|
|
43
|
-
})[];
|
package/src/mappings/Elements.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES,
|
|
2
|
-
// createBoolProp,
|
|
3
|
-
createTextProp, FORM_TYPES, GROUPS, Triggers, } from "@draftbit/types";
|
|
4
|
-
const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
|
|
5
|
-
const ELEMENT_PROPS = {
|
|
6
|
-
category: COMPONENT_TYPES.element,
|
|
7
|
-
stylesPanelSections: BLOCK_STYLES_SECTIONS,
|
|
8
|
-
layout: {
|
|
9
|
-
margin: 0,
|
|
10
|
-
},
|
|
11
|
-
triggers: SEED_DATA_TRIGGERS,
|
|
12
|
-
};
|
|
13
|
-
const HEADING_PROPS = {
|
|
14
|
-
...ELEMENT_PROPS,
|
|
15
|
-
};
|
|
16
|
-
export const SEED_DATA = [
|
|
17
|
-
{
|
|
18
|
-
name: "H1",
|
|
19
|
-
tag: "H1",
|
|
20
|
-
...HEADING_PROPS,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: "H2",
|
|
24
|
-
tag: "H2",
|
|
25
|
-
...HEADING_PROPS,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: "H3",
|
|
29
|
-
tag: "H3",
|
|
30
|
-
...HEADING_PROPS,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "H4",
|
|
34
|
-
tag: "H4",
|
|
35
|
-
...HEADING_PROPS,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: "H5",
|
|
39
|
-
tag: "H5",
|
|
40
|
-
...HEADING_PROPS,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: "H6",
|
|
44
|
-
tag: "H6",
|
|
45
|
-
...HEADING_PROPS,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: "Anchor",
|
|
49
|
-
tag: "A",
|
|
50
|
-
...ELEMENT_PROPS,
|
|
51
|
-
props: {
|
|
52
|
-
href: createTextProp({
|
|
53
|
-
label: "href",
|
|
54
|
-
description: "Specify the URL",
|
|
55
|
-
defaultValue: "",
|
|
56
|
-
}),
|
|
57
|
-
target: {
|
|
58
|
-
group: GROUPS.basic,
|
|
59
|
-
label: "target",
|
|
60
|
-
description: "decide where link should open",
|
|
61
|
-
formType: FORM_TYPES.flatArray,
|
|
62
|
-
defaultValue: "_blank",
|
|
63
|
-
options: ["_blank", "_self", "_parent", "_top"],
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: "Paragraph",
|
|
69
|
-
tag: "P",
|
|
70
|
-
...ELEMENT_PROPS,
|
|
71
|
-
props: {
|
|
72
|
-
// NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
|
|
73
|
-
// strong: createBoolProp({
|
|
74
|
-
// label: "Strong",
|
|
75
|
-
// description: "Strong",
|
|
76
|
-
// }),
|
|
77
|
-
// strike: createBoolProp({
|
|
78
|
-
// label: "Strike",
|
|
79
|
-
// description: "Strike through",
|
|
80
|
-
// }),
|
|
81
|
-
// italic: createBoolProp({
|
|
82
|
-
// label: "Italic",
|
|
83
|
-
// description: "Italic Fonts",
|
|
84
|
-
// }),
|
|
85
|
-
// bold: createBoolProp({
|
|
86
|
-
// label: "Bold",
|
|
87
|
-
// description: "Bold",
|
|
88
|
-
// }),
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: "Code",
|
|
93
|
-
tag: "Code",
|
|
94
|
-
...ELEMENT_PROPS,
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: "Pre",
|
|
98
|
-
tag: "Pre",
|
|
99
|
-
...ELEMENT_PROPS,
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: "Mark",
|
|
103
|
-
tag: "Mark",
|
|
104
|
-
...ELEMENT_PROPS,
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: "BR",
|
|
108
|
-
tag: "BR",
|
|
109
|
-
...ELEMENT_PROPS,
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: "Quote",
|
|
113
|
-
tag: "Q",
|
|
114
|
-
...ELEMENT_PROPS,
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: "BlockQuote",
|
|
118
|
-
tag: "BlockQuote",
|
|
119
|
-
...ELEMENT_PROPS,
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: "Time",
|
|
123
|
-
tag: "Time",
|
|
124
|
-
...ELEMENT_PROPS,
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
name: "UL",
|
|
128
|
-
tag: "UL",
|
|
129
|
-
...ELEMENT_PROPS,
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
name: "LI",
|
|
133
|
-
tag: "LI",
|
|
134
|
-
...ELEMENT_PROPS,
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
name: "HR",
|
|
138
|
-
tag: "HR",
|
|
139
|
-
...ELEMENT_PROPS,
|
|
140
|
-
},
|
|
141
|
-
];
|
package/src/mappings/Elements.ts
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BLOCK_STYLES_SECTIONS,
|
|
3
|
-
COMPONENT_TYPES,
|
|
4
|
-
// createBoolProp,
|
|
5
|
-
createTextProp,
|
|
6
|
-
FORM_TYPES,
|
|
7
|
-
GROUPS,
|
|
8
|
-
Triggers,
|
|
9
|
-
} from "@draftbit/types";
|
|
10
|
-
const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
|
|
11
|
-
|
|
12
|
-
const ELEMENT_PROPS = {
|
|
13
|
-
category: COMPONENT_TYPES.element,
|
|
14
|
-
stylesPanelSections: BLOCK_STYLES_SECTIONS,
|
|
15
|
-
layout: {
|
|
16
|
-
margin: 0,
|
|
17
|
-
},
|
|
18
|
-
triggers: SEED_DATA_TRIGGERS,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const HEADING_PROPS = {
|
|
22
|
-
...ELEMENT_PROPS,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const SEED_DATA = [
|
|
26
|
-
{
|
|
27
|
-
name: "H1",
|
|
28
|
-
tag: "H1",
|
|
29
|
-
...HEADING_PROPS,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: "H2",
|
|
33
|
-
tag: "H2",
|
|
34
|
-
...HEADING_PROPS,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: "H3",
|
|
38
|
-
tag: "H3",
|
|
39
|
-
...HEADING_PROPS,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: "H4",
|
|
43
|
-
tag: "H4",
|
|
44
|
-
...HEADING_PROPS,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: "H5",
|
|
48
|
-
tag: "H5",
|
|
49
|
-
...HEADING_PROPS,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: "H6",
|
|
53
|
-
tag: "H6",
|
|
54
|
-
...HEADING_PROPS,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "Anchor",
|
|
58
|
-
tag: "A",
|
|
59
|
-
...ELEMENT_PROPS,
|
|
60
|
-
props: {
|
|
61
|
-
href: createTextProp({
|
|
62
|
-
label: "href",
|
|
63
|
-
description: "Specify the URL",
|
|
64
|
-
defaultValue: "",
|
|
65
|
-
}),
|
|
66
|
-
target: {
|
|
67
|
-
group: GROUPS.basic,
|
|
68
|
-
label: "target",
|
|
69
|
-
description: "decide where link should open",
|
|
70
|
-
formType: FORM_TYPES.flatArray,
|
|
71
|
-
defaultValue: "_blank",
|
|
72
|
-
options: ["_blank", "_self", "_parent", "_top"],
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: "Paragraph",
|
|
78
|
-
tag: "P",
|
|
79
|
-
...ELEMENT_PROPS,
|
|
80
|
-
props: {
|
|
81
|
-
// NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
|
|
82
|
-
// strong: createBoolProp({
|
|
83
|
-
// label: "Strong",
|
|
84
|
-
// description: "Strong",
|
|
85
|
-
// }),
|
|
86
|
-
// strike: createBoolProp({
|
|
87
|
-
// label: "Strike",
|
|
88
|
-
// description: "Strike through",
|
|
89
|
-
// }),
|
|
90
|
-
// italic: createBoolProp({
|
|
91
|
-
// label: "Italic",
|
|
92
|
-
// description: "Italic Fonts",
|
|
93
|
-
// }),
|
|
94
|
-
// bold: createBoolProp({
|
|
95
|
-
// label: "Bold",
|
|
96
|
-
// description: "Bold",
|
|
97
|
-
// }),
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: "Code",
|
|
102
|
-
tag: "Code",
|
|
103
|
-
...ELEMENT_PROPS,
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
name: "Pre",
|
|
107
|
-
tag: "Pre",
|
|
108
|
-
...ELEMENT_PROPS,
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
name: "Mark",
|
|
112
|
-
tag: "Mark",
|
|
113
|
-
...ELEMENT_PROPS,
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
name: "BR",
|
|
117
|
-
tag: "BR",
|
|
118
|
-
...ELEMENT_PROPS,
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
name: "Quote",
|
|
122
|
-
tag: "Q",
|
|
123
|
-
...ELEMENT_PROPS,
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
name: "BlockQuote",
|
|
127
|
-
tag: "BlockQuote",
|
|
128
|
-
...ELEMENT_PROPS,
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
name: "Time",
|
|
132
|
-
tag: "Time",
|
|
133
|
-
...ELEMENT_PROPS,
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
name: "UL",
|
|
137
|
-
tag: "UL",
|
|
138
|
-
...ELEMENT_PROPS,
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: "LI",
|
|
142
|
-
tag: "LI",
|
|
143
|
-
...ELEMENT_PROPS,
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: "HR",
|
|
147
|
-
tag: "HR",
|
|
148
|
-
...ELEMENT_PROPS,
|
|
149
|
-
},
|
|
150
|
-
];
|