@draftbit/core 46.9.1-db63a0.2 → 46.9.1-deddd4.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/BottomSheet/BottomSheet.js +88 -0
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +464 -0
- package/lib/commonjs/components/BottomSheet/index.js +13 -0
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +23 -6
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/Container.js +4 -15
- package/lib/commonjs/components/Table/Table.js +36 -4
- package/lib/commonjs/components/YotubePlayer.js +38 -0
- package/lib/commonjs/hooks.js +1 -2
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/mappings/BottomSheet.js +70 -0
- package/lib/commonjs/mappings/Table.js +16 -3
- package/lib/commonjs/mappings/YoutubePlayer.js +44 -0
- package/lib/module/components/BottomSheet/BottomSheet.js +80 -0
- package/lib/module/components/BottomSheet/BottomSheetComponent.js +470 -0
- package/lib/module/components/BottomSheet/index.js +1 -0
- package/lib/module/components/Table/Table.js +36 -5
- package/lib/module/components/YotubePlayer.js +30 -0
- package/lib/module/index.js +2 -0
- package/lib/module/mappings/BottomSheet.js +63 -0
- package/lib/module/mappings/Table.js +16 -3
- package/lib/module/mappings/YoutubePlayer.js +37 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +20 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts +170 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet/index.d.ts +2 -0
- package/lib/typescript/src/components/BottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/Table.d.ts +3 -3
- package/lib/typescript/src/components/Table/Table.d.ts.map +1 -1
- package/lib/typescript/src/components/YotubePlayer.d.ts +12 -0
- package/lib/typescript/src/components/YotubePlayer.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/BottomSheet.d.ts +115 -0
- package/lib/typescript/src/mappings/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/mappings/Table.d.ts +22 -12
- package/lib/typescript/src/mappings/Table.d.ts.map +1 -1
- package/lib/typescript/src/mappings/YoutubePlayer.d.ts +37 -0
- package/lib/typescript/src/mappings/YoutubePlayer.d.ts.map +1 -0
- package/package.json +8 -4
- package/src/components/BottomSheet/BottomSheet.js +56 -0
- package/src/components/BottomSheet/BottomSheet.tsx +120 -0
- package/src/components/BottomSheet/BottomSheetComponent.js +437 -0
- package/src/components/BottomSheet/BottomSheetComponent.tsx +895 -0
- package/src/components/BottomSheet/index.js +1 -0
- package/src/components/BottomSheet/index.ts +1 -0
- package/src/components/Table/Table.js +34 -5
- package/src/components/Table/Table.tsx +51 -11
- package/src/components/YotubePlayer.js +10 -0
- package/src/components/YotubePlayer.tsx +38 -0
- package/src/index.js +2 -0
- package/src/index.tsx +4 -0
- package/src/mappings/BottomSheet.js +63 -0
- package/src/mappings/BottomSheet.ts +77 -0
- package/src/mappings/Table.js +15 -2
- package/src/mappings/Table.ts +16 -2
- package/src/mappings/YoutubePlayer.js +37 -0
- package/src/mappings/YoutubePlayer.ts +43 -0
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.checkboxGroupContext = exports.Direction = void 0;
|
|
7
7
|
exports.useCheckboxGroupContext = useCheckboxGroupContext;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
|
|
9
|
+
var Direction;
|
|
10
10
|
exports.Direction = Direction;
|
|
11
11
|
(function (Direction) {
|
|
12
12
|
Direction["Horizontal"] = "horizontal";
|
|
@@ -11,6 +11,7 @@ var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
|
14
|
+
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); }
|
|
14
15
|
const Container = _ref => {
|
|
15
16
|
let {
|
|
16
17
|
useThemeGutterPadding,
|
|
@@ -72,10 +73,9 @@ const Container = _ref => {
|
|
|
72
73
|
};
|
|
73
74
|
const Wrap = elevation ? _Elevation.default : _reactNative.View;
|
|
74
75
|
if (elevation) containerStyle.elevation = elevation;
|
|
75
|
-
return /*#__PURE__*/React.createElement(Wrap, {
|
|
76
|
-
style: [containerStyle, style]
|
|
77
|
-
|
|
78
|
-
}, backgroundImage ? /*#__PURE__*/React.createElement(_reactNative.ImageBackground, {
|
|
76
|
+
return /*#__PURE__*/React.createElement(Wrap, _extends({
|
|
77
|
+
style: [containerStyle, style]
|
|
78
|
+
}, rest), backgroundImage ? /*#__PURE__*/React.createElement(_reactNative.ImageBackground, {
|
|
79
79
|
source: typeof backgroundImage === "string" ? {
|
|
80
80
|
uri: backgroundImage
|
|
81
81
|
} : backgroundImage,
|
|
@@ -90,15 +90,4 @@ const Container = _ref => {
|
|
|
90
90
|
}, children));
|
|
91
91
|
};
|
|
92
92
|
var _default = (0, _theming.withTheme)(Container);
|
|
93
|
-
exports.default = _default;sizeMode: backgroundImageResizeMode,
|
|
94
|
-
style: {
|
|
95
|
-
flex: 1
|
|
96
|
-
}
|
|
97
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
98
|
-
style: innerStyle
|
|
99
|
-
}, children)) : /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
100
|
-
style: innerStyle
|
|
101
|
-
}, children));
|
|
102
|
-
};
|
|
103
|
-
var _default = (0, _theming.withTheme)(Container);
|
|
104
93
|
exports.default = _default;
|
|
@@ -25,7 +25,8 @@ const Table = _ref => {
|
|
|
25
25
|
keyExtractor,
|
|
26
26
|
renderItem,
|
|
27
27
|
children: childrenProp,
|
|
28
|
-
style
|
|
28
|
+
style,
|
|
29
|
+
...rest
|
|
29
30
|
} = _ref;
|
|
30
31
|
//Both 'renderItem' and 'data' are optional to allow direct children. But if one is included, both need to be included
|
|
31
32
|
if (data && !renderItem || renderItem && !data) {
|
|
@@ -58,8 +59,38 @@ const Table = _ref => {
|
|
|
58
59
|
}, [data, renderItem, keyExtractor, isRenderItem]);
|
|
59
60
|
const children = isRenderItem ? dataAsChildren : _react.default.Children.toArray(childrenProp);
|
|
60
61
|
const validChildren = _react.default.useMemo(() => children.filter(item => /*#__PURE__*/_react.default.isValidElement(item)), [children]);
|
|
61
|
-
const childrenWithoutHeader = _react.default.useMemo(() =>
|
|
62
|
-
|
|
62
|
+
const childrenWithoutHeader = _react.default.useMemo(() => {
|
|
63
|
+
const flattenedWithoutNestedHeaders = validChildren.map(item => {
|
|
64
|
+
const nestedChildren = _react.default.Children.toArray(item.props.children);
|
|
65
|
+
//Header can be nested in React.Fragment when in renderItem
|
|
66
|
+
const nestedHeaders = nestedChildren.filter(child => isTableHeader(child.props));
|
|
67
|
+
if (nestedHeaders !== null && nestedHeaders !== void 0 && nestedHeaders.length) {
|
|
68
|
+
//New element excluding header children
|
|
69
|
+
return /*#__PURE__*/_react.default.cloneElement(item, {
|
|
70
|
+
children: nestedChildren.filter(child => !isTableHeader(child.props))
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return item;
|
|
74
|
+
});
|
|
75
|
+
return flattenedWithoutNestedHeaders.filter(item => !isTableHeader(item.props));
|
|
76
|
+
}, [validChildren, isTableHeader]);
|
|
77
|
+
const header = _react.default.useMemo(() => {
|
|
78
|
+
const flattenedPossibleHeaders = validChildren.map(item => {
|
|
79
|
+
const nestedChildren = _react.default.Children.toArray(item.props.children);
|
|
80
|
+
//Header can be nested in React.Fragment when in renderItem
|
|
81
|
+
const nestedHeaders = nestedChildren.filter(child => isTableHeader(child.props));
|
|
82
|
+
if (nestedHeaders !== null && nestedHeaders !== void 0 && nestedHeaders.length) {
|
|
83
|
+
return nestedHeaders[0];
|
|
84
|
+
}
|
|
85
|
+
return item;
|
|
86
|
+
});
|
|
87
|
+
const allHeaders = flattenedPossibleHeaders.filter(item => isTableHeader(item.props));
|
|
88
|
+
if (allHeaders.length) {
|
|
89
|
+
return allHeaders[0]; //Only 1 header taken
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return null;
|
|
93
|
+
}, [validChildren, isTableHeader]);
|
|
63
94
|
const contextValue = {
|
|
64
95
|
borderColor,
|
|
65
96
|
borderStyle,
|
|
@@ -80,7 +111,7 @@ const Table = _ref => {
|
|
|
80
111
|
value: contextValue
|
|
81
112
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
82
113
|
style: [styles.container, borderViewStyle, style]
|
|
83
|
-
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
114
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, header), /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, rest, childrenWithoutHeader)));
|
|
84
115
|
};
|
|
85
116
|
const styles = _reactNative.StyleSheet.create({
|
|
86
117
|
container: {
|
|
@@ -88,4 +119,5 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
88
119
|
}
|
|
89
120
|
});
|
|
90
121
|
var _default = (0, _theming.withTheme)(Table);
|
|
122
|
+
exports.default = _default;
|
|
91
123
|
exports.default = _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNativeYoutubeIframe = _interopRequireDefault(require("react-native-youtube-iframe"));
|
|
9
|
+
var _utilities = require("../utilities");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const YoutubePlayer = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
videoId,
|
|
14
|
+
playlist,
|
|
15
|
+
mute = false,
|
|
16
|
+
autoplay = false,
|
|
17
|
+
style
|
|
18
|
+
} = _ref;
|
|
19
|
+
const {
|
|
20
|
+
viewStyles
|
|
21
|
+
} = (0, _utilities.extractStyles)(style);
|
|
22
|
+
const {
|
|
23
|
+
height,
|
|
24
|
+
width
|
|
25
|
+
} = viewStyles;
|
|
26
|
+
const defaultVideoId = "nwMUpDESXrI";
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativeYoutubeIframe.default, {
|
|
28
|
+
height: height,
|
|
29
|
+
width: width,
|
|
30
|
+
play: autoplay,
|
|
31
|
+
videoId: !videoId && !playlist ? defaultVideoId : videoId,
|
|
32
|
+
playList: playlist,
|
|
33
|
+
mute: mute,
|
|
34
|
+
webViewStyle: style
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var _default = YoutubePlayer;
|
|
38
|
+
exports.default = _default;
|
package/lib/commonjs/hooks.js
CHANGED
|
@@ -10,12 +10,11 @@ function usePrevious(value) {
|
|
|
10
10
|
// The ref object is a generic container whose current property is mutable
|
|
11
11
|
// and can hold any value, similar to an instance property on a class
|
|
12
12
|
const ref = _react.default.useRef();
|
|
13
|
-
|
|
14
13
|
// Store current value in ref
|
|
15
14
|
_react.default.useEffect(() => {
|
|
16
15
|
ref.current = value;
|
|
17
16
|
}, [value]);
|
|
18
|
-
|
|
19
17
|
// Return previous value (happens before update in useEffect above)
|
|
20
18
|
return ref.current;
|
|
19
|
+
}
|
|
21
20
|
}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -51,6 +51,12 @@ Object.defineProperty(exports, "Banner", {
|
|
|
51
51
|
return _Banner.default;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
+
Object.defineProperty(exports, "BottomSheet", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _BottomSheet.BottomSheet;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
54
60
|
Object.defineProperty(exports, "Button", {
|
|
55
61
|
enumerable: true,
|
|
56
62
|
get: function () {
|
|
@@ -405,6 +411,12 @@ Object.defineProperty(exports, "Touchable", {
|
|
|
405
411
|
return _Touchable.default;
|
|
406
412
|
}
|
|
407
413
|
});
|
|
414
|
+
Object.defineProperty(exports, "YoutubePlayer", {
|
|
415
|
+
enumerable: true,
|
|
416
|
+
get: function () {
|
|
417
|
+
return _YotubePlayer.default;
|
|
418
|
+
}
|
|
419
|
+
});
|
|
408
420
|
Object.defineProperty(exports, "injectIcon", {
|
|
409
421
|
enumerable: true,
|
|
410
422
|
get: function () {
|
|
@@ -459,6 +471,8 @@ var _Shadow = _interopRequireDefault(require("./components/Shadow"));
|
|
|
459
471
|
var _DeckSwiper = require("./components/DeckSwiper");
|
|
460
472
|
var _TabView = require("./components/TabView");
|
|
461
473
|
var _Markdown = _interopRequireDefault(require("./components/Markdown"));
|
|
474
|
+
var _BottomSheet = require("./components/BottomSheet");
|
|
475
|
+
var _YotubePlayer = _interopRequireDefault(require("./components/YotubePlayer"));
|
|
462
476
|
var _Table = require("./components/Table");
|
|
463
477
|
var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
|
|
464
478
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SEED_DATA = void 0;
|
|
7
|
+
var _types = require("@draftbit/types");
|
|
8
|
+
const SEED_DATA = {
|
|
9
|
+
name: "Bottom Sheet",
|
|
10
|
+
tag: "BottomSheet",
|
|
11
|
+
description: "A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
|
|
12
|
+
category: _types.COMPONENT_TYPES.bottomsheet,
|
|
13
|
+
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
14
|
+
triggers: [_types.Triggers.OnSettle],
|
|
15
|
+
props: {
|
|
16
|
+
onSettle: (0, _types.createActionProp)({
|
|
17
|
+
label: "On settle",
|
|
18
|
+
description: "Action to execute when sheet settles on a snap point"
|
|
19
|
+
}),
|
|
20
|
+
snapPoints: (0, _types.createArrayProp)({
|
|
21
|
+
label: "Snap points",
|
|
22
|
+
description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
|
|
23
|
+
defaultValue: ["10%", "50%", "80%"]
|
|
24
|
+
}),
|
|
25
|
+
initialSnapIndex: (0, _types.createStaticNumberProp)({
|
|
26
|
+
label: "Initial snap index",
|
|
27
|
+
description: "Index of the snap point to be used as the initial point",
|
|
28
|
+
defaultValue: 0,
|
|
29
|
+
required: false
|
|
30
|
+
}),
|
|
31
|
+
showHandle: (0, _types.createStaticBoolProp)({
|
|
32
|
+
label: "Show handle",
|
|
33
|
+
description: "Whether to show the top sheet handle or not",
|
|
34
|
+
defaultValue: true
|
|
35
|
+
}),
|
|
36
|
+
handleColor: (0, _types.createColorProp)({
|
|
37
|
+
label: "Handle color",
|
|
38
|
+
description: "Color of the top handle",
|
|
39
|
+
defaultValue: "divider"
|
|
40
|
+
}),
|
|
41
|
+
topBorderRadius: (0, _types.createStaticNumberProp)({
|
|
42
|
+
label: "Top border radius",
|
|
43
|
+
description: "Border radius of top corners",
|
|
44
|
+
defaultValue: 20,
|
|
45
|
+
required: false
|
|
46
|
+
}),
|
|
47
|
+
borderWidth: (0, _types.createStaticNumberProp)({
|
|
48
|
+
label: "Border width",
|
|
49
|
+
description: "Width of bottom sheet borders",
|
|
50
|
+
defaultValue: 1,
|
|
51
|
+
required: false
|
|
52
|
+
}),
|
|
53
|
+
borderColor: (0, _types.createColorProp)({
|
|
54
|
+
label: "Border color",
|
|
55
|
+
description: "Color of bottom sheet borders",
|
|
56
|
+
defaultValue: "divider"
|
|
57
|
+
}),
|
|
58
|
+
showsVerticalScrollIndicator: (0, _types.createStaticBoolProp)({
|
|
59
|
+
label: "Show Vertical Scroll Indicator",
|
|
60
|
+
description: "When true, shows a vertical scroll indicator. The default value is true.",
|
|
61
|
+
defaultValue: true
|
|
62
|
+
}),
|
|
63
|
+
bounces: (0, _types.createStaticBoolProp)({
|
|
64
|
+
label: "Bounce",
|
|
65
|
+
description: "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
|
|
66
|
+
defaultValue: true
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -47,13 +47,13 @@ const SHARED_SEED_DATA_PROPS = {
|
|
|
47
47
|
label: "Cell Vertical Padding",
|
|
48
48
|
description: "Specifies the vertical padding of the cell. Passed down to TableCell components unless overridden",
|
|
49
49
|
required: false,
|
|
50
|
-
defaultValue:
|
|
50
|
+
defaultValue: null
|
|
51
51
|
}),
|
|
52
52
|
cellHorizontalPadding: (0, _types.createStaticNumberProp)({
|
|
53
53
|
label: "Cell Horizontal Padding",
|
|
54
54
|
description: "Specifies the horizontal padding of the cell. Passed down to TableCell components unless overridden",
|
|
55
55
|
required: false,
|
|
56
|
-
defaultValue:
|
|
56
|
+
defaultValue: null
|
|
57
57
|
})
|
|
58
58
|
};
|
|
59
59
|
const SEED_DATA = [{
|
|
@@ -82,7 +82,20 @@ const SEED_DATA = [{
|
|
|
82
82
|
drawTopBorder: {
|
|
83
83
|
...SHARED_SEED_DATA_PROPS.drawTopBorder,
|
|
84
84
|
defaultValue: true
|
|
85
|
-
}
|
|
85
|
+
},
|
|
86
|
+
cellVerticalPadding: {
|
|
87
|
+
...SHARED_SEED_DATA_PROPS.cellVerticalPadding,
|
|
88
|
+
defaultValue: 10
|
|
89
|
+
},
|
|
90
|
+
cellHorizontalPadding: {
|
|
91
|
+
...SHARED_SEED_DATA_PROPS.cellHorizontalPadding,
|
|
92
|
+
defaultValue: 10
|
|
93
|
+
},
|
|
94
|
+
showsVerticalScrollIndicator: (0, _types.createStaticBoolProp)({
|
|
95
|
+
label: "Show Vertical Scroll Indicator",
|
|
96
|
+
description: "When true, shows a vertical scroll indicator. The default value is true.",
|
|
97
|
+
defaultValue: true
|
|
98
|
+
})
|
|
86
99
|
}
|
|
87
100
|
}, {
|
|
88
101
|
name: "Table Row",
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SEED_DATA = void 0;
|
|
7
|
+
var _types = require("@draftbit/types");
|
|
8
|
+
const SEED_DATA = {
|
|
9
|
+
name: "Youtube Player",
|
|
10
|
+
tag: "YoutubePlayer",
|
|
11
|
+
description: "Plays a youtube video form a Youtube video or playlist id",
|
|
12
|
+
doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
|
|
13
|
+
code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
|
|
14
|
+
category: _types.COMPONENT_TYPES.media,
|
|
15
|
+
stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
|
|
16
|
+
layout: {
|
|
17
|
+
height: 250
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
videoId: (0, _types.createTextProp)({
|
|
21
|
+
label: "Video ID",
|
|
22
|
+
description: "VideoId of the Youtube video.",
|
|
23
|
+
defaultValue: null
|
|
24
|
+
}),
|
|
25
|
+
playlist: (0, _types.createTextProp)({
|
|
26
|
+
label: "Playlist",
|
|
27
|
+
description: "Playlist of the Youtube videos.",
|
|
28
|
+
defaultValue: null
|
|
29
|
+
}),
|
|
30
|
+
mute: (0, _types.createStaticBoolProp)({
|
|
31
|
+
label: "Mute Audio",
|
|
32
|
+
description: "Mute the audio of the video.",
|
|
33
|
+
defaultValue: false,
|
|
34
|
+
required: false
|
|
35
|
+
}),
|
|
36
|
+
autoplay: (0, _types.createStaticBoolProp)({
|
|
37
|
+
label: "Auto Play",
|
|
38
|
+
description: "Autoplay the video on load.",
|
|
39
|
+
defaultValue: false,
|
|
40
|
+
required: false
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
import React from "react";
|
|
3
|
+
import { StyleSheet, View } from "react-native";
|
|
4
|
+
import BottomSheetComponent from "./BottomSheetComponent";
|
|
5
|
+
import { withTheme } from "../../theming";
|
|
6
|
+
const BottomSheet = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
theme,
|
|
9
|
+
snapPoints = ["10%", "50%", "80%"],
|
|
10
|
+
initialSnapIndex = 0,
|
|
11
|
+
showHandle = true,
|
|
12
|
+
handleColor = theme.colors.divider,
|
|
13
|
+
topBorderRadius = 20,
|
|
14
|
+
borderWidth = 1,
|
|
15
|
+
borderColor = theme.colors.divider,
|
|
16
|
+
onSettle,
|
|
17
|
+
style,
|
|
18
|
+
children,
|
|
19
|
+
...rest
|
|
20
|
+
} = _ref;
|
|
21
|
+
const backgroundColor = (style === null || style === void 0 ? void 0 : style.backgroundColor) || theme.colors.background;
|
|
22
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
23
|
+
style: styles.parentContainer,
|
|
24
|
+
pointerEvents: "box-none"
|
|
25
|
+
}, /*#__PURE__*/React.createElement(BottomSheetComponent, _extends({
|
|
26
|
+
componentType: "ScrollView",
|
|
27
|
+
snapPoints: snapPoints,
|
|
28
|
+
initialSnapIndex: initialSnapIndex,
|
|
29
|
+
renderHandle: () => /*#__PURE__*/React.createElement(React.Fragment, null, showHandle && /*#__PURE__*/React.createElement(View, {
|
|
30
|
+
style: [styles.handleContainer, {
|
|
31
|
+
backgroundColor,
|
|
32
|
+
borderTopLeftRadius: topBorderRadius,
|
|
33
|
+
borderTopRightRadius: topBorderRadius
|
|
34
|
+
}]
|
|
35
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
36
|
+
style: [styles.handle, {
|
|
37
|
+
backgroundColor: handleColor
|
|
38
|
+
}]
|
|
39
|
+
}))),
|
|
40
|
+
contentContainerStyle: [styles.contentContainerStyle, style],
|
|
41
|
+
containerStyle: StyleSheet.flatten([styles.containerStyle, {
|
|
42
|
+
backgroundColor,
|
|
43
|
+
borderTopLeftRadius: topBorderRadius,
|
|
44
|
+
borderTopRightRadius: topBorderRadius,
|
|
45
|
+
borderWidth,
|
|
46
|
+
borderColor
|
|
47
|
+
}]),
|
|
48
|
+
onSettle: onSettle
|
|
49
|
+
}, rest), children));
|
|
50
|
+
};
|
|
51
|
+
const styles = StyleSheet.create({
|
|
52
|
+
//Render on top of everything
|
|
53
|
+
parentContainer: {
|
|
54
|
+
position: "absolute",
|
|
55
|
+
left: 0,
|
|
56
|
+
right: 0,
|
|
57
|
+
top: 0,
|
|
58
|
+
bottom: 0,
|
|
59
|
+
zIndex: 10,
|
|
60
|
+
overflow: "hidden"
|
|
61
|
+
},
|
|
62
|
+
contentContainerStyle: {
|
|
63
|
+
paddingHorizontal: 16,
|
|
64
|
+
paddingVertical: 10
|
|
65
|
+
},
|
|
66
|
+
containerStyle: {
|
|
67
|
+
flex: 1,
|
|
68
|
+
overflow: "hidden"
|
|
69
|
+
},
|
|
70
|
+
handleContainer: {
|
|
71
|
+
alignItems: "center",
|
|
72
|
+
paddingVertical: 20
|
|
73
|
+
},
|
|
74
|
+
handle: {
|
|
75
|
+
width: 40,
|
|
76
|
+
height: 2,
|
|
77
|
+
borderRadius: 4
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
export default withTheme(BottomSheet);
|