@draftbit/core 46.9.1-fe76aa.2 → 46.10.0
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 +4 -23
- 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/DeprecatedFAB.js +3 -21
- package/lib/commonjs/components/YotubePlayer.js +38 -0
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/mappings/BottomSheet.js +70 -0
- 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/YotubePlayer.js +30 -0
- package/lib/module/index.js +2 -0
- package/lib/module/mappings/BottomSheet.js +63 -0
- 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/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/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/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/YoutubePlayer.js +37 -0
- package/src/mappings/YoutubePlayer.ts +43 -0
|
@@ -14,6 +14,7 @@ var _theming = require("../theming");
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
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); }
|
|
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
|
+
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); }
|
|
17
18
|
const FAB = _ref => {
|
|
18
19
|
let {
|
|
19
20
|
Icon,
|
|
@@ -105,8 +106,7 @@ const FAB = _ref => {
|
|
|
105
106
|
style: [{
|
|
106
107
|
elevation
|
|
107
108
|
}, style]
|
|
108
|
-
}, /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
109
|
-
...rest,
|
|
109
|
+
}, /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({}, rest, {
|
|
110
110
|
onPress: onPress,
|
|
111
111
|
accessibilityState: {
|
|
112
112
|
disabled
|
|
@@ -114,7 +114,7 @@ const FAB = _ref => {
|
|
|
114
114
|
accessibilityRole: "button",
|
|
115
115
|
disabled: disabled || loading,
|
|
116
116
|
style: buttonStyles
|
|
117
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
117
|
+
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
118
118
|
style: styles.content
|
|
119
119
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
120
120
|
style: iconStyle
|
|
@@ -154,22 +154,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
var _default = (0, _theming.withTheme)(FAB);
|
|
157
|
-
exports.default = _default;ow",
|
|
158
|
-
alignItems: "center",
|
|
159
|
-
justifyContent: "center"
|
|
160
|
-
},
|
|
161
|
-
icon: {
|
|
162
|
-
alignItems: "center",
|
|
163
|
-
justifyContent: "center",
|
|
164
|
-
width: _Config.default.buttonIconSize
|
|
165
|
-
},
|
|
166
|
-
fixed: {
|
|
167
|
-
left: 0,
|
|
168
|
-
right: 0,
|
|
169
|
-
bottom: 0,
|
|
170
|
-
height: 64,
|
|
171
|
-
borderRadius: 0
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
var _default = (0, _theming.withTheme)(FAB);
|
|
175
157
|
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/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 () {
|
|
@@ -387,6 +393,12 @@ Object.defineProperty(exports, "Touchable", {
|
|
|
387
393
|
return _Touchable.default;
|
|
388
394
|
}
|
|
389
395
|
});
|
|
396
|
+
Object.defineProperty(exports, "YoutubePlayer", {
|
|
397
|
+
enumerable: true,
|
|
398
|
+
get: function () {
|
|
399
|
+
return _YotubePlayer.default;
|
|
400
|
+
}
|
|
401
|
+
});
|
|
390
402
|
Object.defineProperty(exports, "injectIcon", {
|
|
391
403
|
enumerable: true,
|
|
392
404
|
get: function () {
|
|
@@ -441,6 +453,8 @@ var _Shadow = _interopRequireDefault(require("./components/Shadow"));
|
|
|
441
453
|
var _DeckSwiper = require("./components/DeckSwiper");
|
|
442
454
|
var _TabView = require("./components/TabView");
|
|
443
455
|
var _Markdown = _interopRequireDefault(require("./components/Markdown"));
|
|
456
|
+
var _BottomSheet = require("./components/BottomSheet");
|
|
457
|
+
var _YotubePlayer = _interopRequireDefault(require("./components/YotubePlayer"));
|
|
444
458
|
var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
|
|
445
459
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
446
460
|
var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
|
|
@@ -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;
|
|
@@ -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);
|