@draftbit/core 46.10.2-30afd1.2 → 46.10.2-9ed879.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 +23 -4
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +23 -6
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/Container.js +15 -4
- package/lib/commonjs/components/DeprecatedFAB.js +21 -3
- package/lib/commonjs/components/FAB.js +18 -4
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +23 -5
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.js +40 -0
- package/lib/commonjs/components/{YotubePlayer.js → YoutubePlayer/YoutubePlayer.native.js} +4 -10
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayerProps.js +5 -0
- package/lib/commonjs/components/YoutubePlayer/index.js +13 -0
- package/lib/commonjs/hooks.js +1 -2
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/mappings/YoutubePlayer.js +0 -6
- package/lib/module/components/Accordion/AccordionItem.js +4 -25
- package/lib/module/components/YoutubePlayer/YoutubePlayer.js +32 -0
- package/lib/module/components/YoutubePlayer/YoutubePlayer.native.js +24 -0
- package/lib/module/components/YoutubePlayer/YoutubePlayerProps.js +1 -0
- package/lib/module/components/YoutubePlayer/index.js +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/mappings/YoutubePlayer.js +0 -6
- package/lib/typescript/src/components/YoutubePlayer/YoutubePlayer.d.ts +5 -0
- package/lib/typescript/src/components/YoutubePlayer/YoutubePlayer.d.ts.map +1 -0
- package/lib/typescript/src/components/YoutubePlayer/YoutubePlayer.native.d.ts +5 -0
- package/lib/typescript/src/components/YoutubePlayer/YoutubePlayer.native.d.ts.map +1 -0
- package/lib/typescript/src/components/YoutubePlayer/YoutubePlayerProps.d.ts +8 -0
- package/lib/typescript/src/components/YoutubePlayer/YoutubePlayerProps.d.ts.map +1 -0
- package/lib/typescript/src/components/YoutubePlayer/index.d.ts +2 -0
- package/lib/typescript/src/components/YoutubePlayer/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/YoutubePlayer.d.ts +0 -10
- package/lib/typescript/src/mappings/YoutubePlayer.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/YoutubePlayer/YoutubePlayer.js +20 -0
- package/src/components/YoutubePlayer/YoutubePlayer.native.js +9 -0
- package/src/components/YoutubePlayer/YoutubePlayer.native.tsx +27 -0
- package/src/components/YoutubePlayer/YoutubePlayer.tsx +36 -0
- package/src/components/YoutubePlayer/YoutubePlayerProps.js +1 -0
- package/src/components/YoutubePlayer/YoutubePlayerProps.ts +8 -0
- package/src/components/YoutubePlayer/index.js +1 -0
- package/src/components/YoutubePlayer/index.ts +1 -0
- package/src/index.js +1 -1
- package/src/index.tsx +1 -1
- package/src/mappings/YoutubePlayer.js +0 -6
- package/src/mappings/YoutubePlayer.ts +0 -6
- package/lib/module/components/YotubePlayer.js +0 -30
- package/lib/typescript/src/components/YotubePlayer.d.ts +0 -12
- package/lib/typescript/src/components/YotubePlayer.d.ts.map +0 -1
- package/src/components/YotubePlayer.js +0 -10
- package/src/components/YotubePlayer.tsx +0 -38
|
@@ -12,7 +12,6 @@ var _theming = require("../../theming");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
15
|
const AccordionItem = _ref => {
|
|
17
16
|
let {
|
|
18
17
|
Icon,
|
|
@@ -27,9 +26,10 @@ const AccordionItem = _ref => {
|
|
|
27
26
|
textStyles,
|
|
28
27
|
viewStyles
|
|
29
28
|
} = (0, _utilities.extractStyles)(style);
|
|
30
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
31
|
-
style: [styles.container, viewStyles]
|
|
32
|
-
|
|
29
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
30
|
+
style: [styles.container, viewStyles],
|
|
31
|
+
...rest
|
|
32
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
33
33
|
style: styles.row
|
|
34
34
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
35
35
|
name: icon,
|
|
@@ -61,4 +61,23 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
64
|
+
exports.default = _default;.StyleSheet.create({
|
|
65
|
+
container: {
|
|
66
|
+
padding: 8
|
|
67
|
+
},
|
|
68
|
+
row: {
|
|
69
|
+
flexDirection: "row",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
paddingLeft: 8
|
|
72
|
+
},
|
|
73
|
+
item: {
|
|
74
|
+
marginVertical: 6,
|
|
75
|
+
paddingLeft: 8
|
|
76
|
+
},
|
|
77
|
+
content: {
|
|
78
|
+
flex: 1,
|
|
79
|
+
justifyContent: "center"
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
64
83
|
exports.default = _default;
|
|
@@ -14,8 +14,7 @@ var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
|
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
|
-
|
|
18
|
-
let Direction;
|
|
17
|
+
var Direction;
|
|
19
18
|
exports.Direction = Direction;
|
|
20
19
|
(function (Direction) {
|
|
21
20
|
Direction["Row"] = "row";
|
|
@@ -58,7 +57,6 @@ const CheckboxRow = _ref => {
|
|
|
58
57
|
setInternalValue(status);
|
|
59
58
|
}
|
|
60
59
|
}, [status]);
|
|
61
|
-
|
|
62
60
|
// This special logic is to handle weird APIs like Airtable that return
|
|
63
61
|
// true or undefined for a boolean
|
|
64
62
|
const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
|
|
@@ -82,13 +80,14 @@ const CheckboxRow = _ref => {
|
|
|
82
80
|
textStyles,
|
|
83
81
|
viewStyles
|
|
84
82
|
} = (0, _utilities.extractStyles)(style);
|
|
85
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
83
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
86
84
|
onPress: handlePress,
|
|
87
85
|
style: [viewStyles, styles.mainParent, {
|
|
88
86
|
flexDirection: direction
|
|
89
87
|
}],
|
|
90
|
-
disabled: disabled
|
|
91
|
-
|
|
88
|
+
disabled: disabled,
|
|
89
|
+
...rest
|
|
90
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
92
91
|
style: [styles.label, {
|
|
93
92
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
94
93
|
}, labelContainerStyle]
|
|
@@ -125,4 +124,22 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
125
124
|
}
|
|
126
125
|
});
|
|
127
126
|
var _default = CheckboxRow;
|
|
127
|
+
exports.default = _default;ems: "center",
|
|
128
|
+
justifyContent: "space-around",
|
|
129
|
+
paddingStart: 20,
|
|
130
|
+
minHeight: 50,
|
|
131
|
+
paddingEnd: 20,
|
|
132
|
+
display: "flex",
|
|
133
|
+
..._reactNative.Platform.select({
|
|
134
|
+
web: {
|
|
135
|
+
cursor: "pointer",
|
|
136
|
+
userSelect: "none"
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
},
|
|
140
|
+
label: {
|
|
141
|
+
flex: 3
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
var _default = CheckboxRow;
|
|
128
145
|
exports.default = _default;
|
|
@@ -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,7 +11,6 @@ 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); }
|
|
15
14
|
const Container = _ref => {
|
|
16
15
|
let {
|
|
17
16
|
useThemeGutterPadding,
|
|
@@ -73,9 +72,10 @@ const Container = _ref => {
|
|
|
73
72
|
};
|
|
74
73
|
const Wrap = elevation ? _Elevation.default : _reactNative.View;
|
|
75
74
|
if (elevation) containerStyle.elevation = elevation;
|
|
76
|
-
return /*#__PURE__*/React.createElement(Wrap,
|
|
77
|
-
style: [containerStyle, style]
|
|
78
|
-
|
|
75
|
+
return /*#__PURE__*/React.createElement(Wrap, {
|
|
76
|
+
style: [containerStyle, style],
|
|
77
|
+
...rest
|
|
78
|
+
}, backgroundImage ? /*#__PURE__*/React.createElement(_reactNative.ImageBackground, {
|
|
79
79
|
source: typeof backgroundImage === "string" ? {
|
|
80
80
|
uri: backgroundImage
|
|
81
81
|
} : backgroundImage,
|
|
@@ -90,4 +90,15 @@ 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);
|
|
93
104
|
exports.default = _default;
|
|
@@ -14,7 +14,6 @@ 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); }
|
|
18
17
|
const FAB = _ref => {
|
|
19
18
|
let {
|
|
20
19
|
Icon,
|
|
@@ -106,7 +105,8 @@ const FAB = _ref => {
|
|
|
106
105
|
style: [{
|
|
107
106
|
elevation
|
|
108
107
|
}, style]
|
|
109
|
-
}, /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
108
|
+
}, /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
109
|
+
...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
|
-
}
|
|
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,4 +154,22 @@ 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);
|
|
157
175
|
exports.default = _default;
|
|
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _theming = require("../theming");
|
|
10
10
|
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); }
|
|
11
11
|
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; }
|
|
12
|
-
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); }
|
|
13
12
|
const FAB = _ref => {
|
|
14
13
|
let {
|
|
15
14
|
onPress,
|
|
@@ -33,7 +32,7 @@ const FAB = _ref => {
|
|
|
33
32
|
borderRadius: size / 2,
|
|
34
33
|
overflow: "hidden"
|
|
35
34
|
}, style]
|
|
36
|
-
}, /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
35
|
+
}, /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
37
36
|
onPress: onPress,
|
|
38
37
|
disabled: loading || disabled,
|
|
39
38
|
android_ripple: {
|
|
@@ -51,8 +50,9 @@ const FAB = _ref => {
|
|
|
51
50
|
borderRadius: size / 2,
|
|
52
51
|
backgroundColor
|
|
53
52
|
}];
|
|
54
|
-
}
|
|
55
|
-
|
|
53
|
+
},
|
|
54
|
+
...props
|
|
55
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, null, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
|
|
56
56
|
style: size > 50 ? {
|
|
57
57
|
marginTop: 2,
|
|
58
58
|
marginLeft: 2
|
|
@@ -79,4 +79,18 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
var _default = (0, _theming.withTheme)(FAB);
|
|
82
|
+
exports.default = _default; styles = _reactNative.StyleSheet.create({
|
|
83
|
+
button: {
|
|
84
|
+
backgroundColor: "#5a45ff",
|
|
85
|
+
justifyContent: "center",
|
|
86
|
+
alignItems: "center",
|
|
87
|
+
..._reactNative.Platform.select({
|
|
88
|
+
web: {
|
|
89
|
+
cursor: "pointer",
|
|
90
|
+
userSelect: "none"
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
var _default = (0, _theming.withTheme)(FAB);
|
|
82
96
|
exports.default = _default;
|
|
@@ -14,8 +14,7 @@ var _utilities = require("../../utilities");
|
|
|
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
|
-
|
|
18
|
-
let Direction;
|
|
17
|
+
var Direction;
|
|
19
18
|
exports.Direction = Direction;
|
|
20
19
|
(function (Direction) {
|
|
21
20
|
Direction["Row"] = "row";
|
|
@@ -72,13 +71,14 @@ const RadioButtonRow = _ref => {
|
|
|
72
71
|
textStyles,
|
|
73
72
|
viewStyles
|
|
74
73
|
} = (0, _utilities.extractStyles)(style);
|
|
75
|
-
return /*#__PURE__*/React.createElement(_Touchable.default,
|
|
74
|
+
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
76
75
|
onPress: handlePress,
|
|
77
76
|
style: [styles.mainParent, {
|
|
78
77
|
flexDirection: direction
|
|
79
78
|
}, viewStyles],
|
|
80
|
-
disabled: disabled
|
|
81
|
-
|
|
79
|
+
disabled: disabled,
|
|
80
|
+
...rest
|
|
81
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
82
82
|
style: [styles.label, {
|
|
83
83
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
84
84
|
}, labelContainerStyle]
|
|
@@ -116,4 +116,22 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
var _default = RadioButtonRow;
|
|
119
|
+
exports.default = _default; "center",
|
|
120
|
+
justifyContent: "space-around",
|
|
121
|
+
paddingStart: 20,
|
|
122
|
+
minHeight: 50,
|
|
123
|
+
paddingEnd: 20,
|
|
124
|
+
display: "flex",
|
|
125
|
+
..._reactNative.Platform.select({
|
|
126
|
+
web: {
|
|
127
|
+
cursor: "pointer",
|
|
128
|
+
userSelect: "none"
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
},
|
|
132
|
+
label: {
|
|
133
|
+
flex: 3
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
var _default = RadioButtonRow;
|
|
119
137
|
exports.default = _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
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 _reactNative = require("react-native");
|
|
9
|
+
var _utilities = require("../../utilities");
|
|
10
|
+
var _reactYoutube = _interopRequireDefault(require("react-youtube"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
const YoutubePlayer = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
videoId,
|
|
15
|
+
playlist,
|
|
16
|
+
autoplay = false,
|
|
17
|
+
style
|
|
18
|
+
} = _ref;
|
|
19
|
+
const {
|
|
20
|
+
viewStyles
|
|
21
|
+
} = (0, _utilities.extractStyles)(style);
|
|
22
|
+
const defaultVideoId = "nwMUpDESXrI";
|
|
23
|
+
const options = {
|
|
24
|
+
width: viewStyles.width,
|
|
25
|
+
height: viewStyles.height,
|
|
26
|
+
playerVars: {
|
|
27
|
+
autoplay: autoplay ? 1 : 0,
|
|
28
|
+
list: playlist,
|
|
29
|
+
listType: "playlist"
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
33
|
+
style: viewStyles
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_reactYoutube.default, {
|
|
35
|
+
videoId: !videoId && !playlist ? defaultVideoId : videoId,
|
|
36
|
+
opts: options
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
var _default = YoutubePlayer;
|
|
40
|
+
exports.default = _default;
|
|
@@ -6,32 +6,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNativeYoutubeIframe = _interopRequireDefault(require("react-native-youtube-iframe"));
|
|
9
|
-
var _utilities = require("
|
|
9
|
+
var _utilities = require("../../utilities");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
const YoutubePlayer = _ref => {
|
|
12
12
|
let {
|
|
13
13
|
videoId,
|
|
14
14
|
playlist,
|
|
15
|
-
mute = false,
|
|
16
15
|
autoplay = false,
|
|
17
16
|
style
|
|
18
17
|
} = _ref;
|
|
19
18
|
const {
|
|
20
19
|
viewStyles
|
|
21
20
|
} = (0, _utilities.extractStyles)(style);
|
|
22
|
-
const {
|
|
23
|
-
height,
|
|
24
|
-
width
|
|
25
|
-
} = viewStyles;
|
|
26
21
|
const defaultVideoId = "nwMUpDESXrI";
|
|
27
22
|
return /*#__PURE__*/_react.default.createElement(_reactNativeYoutubeIframe.default, {
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
width: viewStyles.width,
|
|
24
|
+
height: viewStyles.height,
|
|
30
25
|
play: autoplay,
|
|
31
26
|
videoId: !videoId && !playlist ? defaultVideoId : videoId,
|
|
32
27
|
playList: playlist,
|
|
33
|
-
|
|
34
|
-
webViewStyle: style
|
|
28
|
+
webViewStyle: viewStyles
|
|
35
29
|
});
|
|
36
30
|
};
|
|
37
31
|
var _default = YoutubePlayer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "YoutubePlayer", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _YoutubePlayer.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _YoutubePlayer = _interopRequireDefault(require("./YoutubePlayer"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
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
|
@@ -396,7 +396,7 @@ Object.defineProperty(exports, "Touchable", {
|
|
|
396
396
|
Object.defineProperty(exports, "YoutubePlayer", {
|
|
397
397
|
enumerable: true,
|
|
398
398
|
get: function () {
|
|
399
|
-
return
|
|
399
|
+
return _YoutubePlayer.YoutubePlayer;
|
|
400
400
|
}
|
|
401
401
|
});
|
|
402
402
|
Object.defineProperty(exports, "injectIcon", {
|
|
@@ -454,7 +454,7 @@ var _DeckSwiper = require("./components/DeckSwiper");
|
|
|
454
454
|
var _TabView = require("./components/TabView");
|
|
455
455
|
var _Markdown = _interopRequireDefault(require("./components/Markdown"));
|
|
456
456
|
var _BottomSheet = require("./components/BottomSheet");
|
|
457
|
-
var
|
|
457
|
+
var _YoutubePlayer = require("./components/YoutubePlayer");
|
|
458
458
|
var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
|
|
459
459
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
460
460
|
var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
|
|
@@ -27,12 +27,6 @@ const SEED_DATA = {
|
|
|
27
27
|
description: "Playlist of the Youtube videos.",
|
|
28
28
|
defaultValue: null
|
|
29
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
30
|
autoplay: (0, _types.createStaticBoolProp)({
|
|
37
31
|
label: "Auto Play",
|
|
38
32
|
description: "Autoplay the video on load.",
|
|
@@ -1,3 +1,4 @@
|
|
|
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { Pressable, StyleSheet, View } from "react-native";
|
|
3
4
|
import Text from "../Text";
|
|
@@ -17,10 +18,9 @@ const AccordionItem = _ref => {
|
|
|
17
18
|
textStyles,
|
|
18
19
|
viewStyles
|
|
19
20
|
} = extractStyles(style);
|
|
20
|
-
return /*#__PURE__*/React.createElement(Pressable, {
|
|
21
|
-
style: [styles.container, viewStyles]
|
|
22
|
-
|
|
23
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
21
|
+
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
22
|
+
style: [styles.container, viewStyles]
|
|
23
|
+
}, rest), /*#__PURE__*/React.createElement(View, {
|
|
24
24
|
style: styles.row
|
|
25
25
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
26
26
|
name: icon,
|
|
@@ -51,25 +51,4 @@ const styles = StyleSheet.create({
|
|
|
51
51
|
justifyContent: "center"
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
export default withTheme(AccordionItem);xtStyles
|
|
55
|
-
}, label))));
|
|
56
|
-
};
|
|
57
|
-
const styles = StyleSheet.create({
|
|
58
|
-
container: {
|
|
59
|
-
padding: 8
|
|
60
|
-
},
|
|
61
|
-
row: {
|
|
62
|
-
flexDirection: "row",
|
|
63
|
-
alignItems: "center",
|
|
64
|
-
paddingLeft: 8
|
|
65
|
-
},
|
|
66
|
-
item: {
|
|
67
|
-
marginVertical: 6,
|
|
68
|
-
paddingLeft: 8
|
|
69
|
-
},
|
|
70
|
-
content: {
|
|
71
|
-
flex: 1,
|
|
72
|
-
justifyContent: "center"
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
54
|
export default withTheme(AccordionItem);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { extractStyles } from "../../utilities";
|
|
4
|
+
import YouTube from "react-youtube";
|
|
5
|
+
const YoutubePlayer = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
videoId,
|
|
8
|
+
playlist,
|
|
9
|
+
autoplay = false,
|
|
10
|
+
style
|
|
11
|
+
} = _ref;
|
|
12
|
+
const {
|
|
13
|
+
viewStyles
|
|
14
|
+
} = extractStyles(style);
|
|
15
|
+
const defaultVideoId = "nwMUpDESXrI";
|
|
16
|
+
const options = {
|
|
17
|
+
width: viewStyles.width,
|
|
18
|
+
height: viewStyles.height,
|
|
19
|
+
playerVars: {
|
|
20
|
+
autoplay: autoplay ? 1 : 0,
|
|
21
|
+
list: playlist,
|
|
22
|
+
listType: "playlist"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
style: viewStyles
|
|
27
|
+
}, /*#__PURE__*/React.createElement(YouTube, {
|
|
28
|
+
videoId: !videoId && !playlist ? defaultVideoId : videoId,
|
|
29
|
+
opts: options
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
export default YoutubePlayer;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import YoutubePlayerIFrame from "react-native-youtube-iframe";
|
|
3
|
+
import { extractStyles } from "../../utilities";
|
|
4
|
+
const YoutubePlayer = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
videoId,
|
|
7
|
+
playlist,
|
|
8
|
+
autoplay = false,
|
|
9
|
+
style
|
|
10
|
+
} = _ref;
|
|
11
|
+
const {
|
|
12
|
+
viewStyles
|
|
13
|
+
} = extractStyles(style);
|
|
14
|
+
const defaultVideoId = "nwMUpDESXrI";
|
|
15
|
+
return /*#__PURE__*/React.createElement(YoutubePlayerIFrame, {
|
|
16
|
+
width: viewStyles.width,
|
|
17
|
+
height: viewStyles.height,
|
|
18
|
+
play: autoplay,
|
|
19
|
+
videoId: !videoId && !playlist ? defaultVideoId : videoId,
|
|
20
|
+
playList: playlist,
|
|
21
|
+
webViewStyle: viewStyles
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
export default YoutubePlayer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as YoutubePlayer } from "./YoutubePlayer";
|
package/lib/module/index.js
CHANGED
|
@@ -36,7 +36,7 @@ export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
|
36
36
|
export { TabView, TabViewItem } from "./components/TabView";
|
|
37
37
|
export { default as Markdown } from "./components/Markdown";
|
|
38
38
|
export { BottomSheet } from "./components/BottomSheet";
|
|
39
|
-
export {
|
|
39
|
+
export { YoutubePlayer } from "./components/YoutubePlayer";
|
|
40
40
|
|
|
41
41
|
/* Deprecated: Fix or Delete! */
|
|
42
42
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
@@ -21,12 +21,6 @@ export const SEED_DATA = {
|
|
|
21
21
|
description: "Playlist of the Youtube videos.",
|
|
22
22
|
defaultValue: null
|
|
23
23
|
}),
|
|
24
|
-
mute: createStaticBoolProp({
|
|
25
|
-
label: "Mute Audio",
|
|
26
|
-
description: "Mute the audio of the video.",
|
|
27
|
-
defaultValue: false,
|
|
28
|
-
required: false
|
|
29
|
-
}),
|
|
30
24
|
autoplay: createStaticBoolProp({
|
|
31
25
|
label: "Auto Play",
|
|
32
26
|
description: "Autoplay the video on load.",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YoutubePlayer.d.ts","sourceRoot":"","sources":["../../../../../src/components/YoutubePlayer/YoutubePlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2B/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YoutubePlayer.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/YoutubePlayer/YoutubePlayer.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmB/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YoutubePlayerProps.d.ts","sourceRoot":"","sources":["../../../../../src/components/YoutubePlayer/YoutubePlayerProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/YoutubePlayer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -36,7 +36,7 @@ export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
|
36
36
|
export { TabView, TabViewItem } from "./components/TabView";
|
|
37
37
|
export { default as Markdown } from "./components/Markdown";
|
|
38
38
|
export { BottomSheet } from "./components/BottomSheet";
|
|
39
|
-
export {
|
|
39
|
+
export { YoutubePlayer } from "./components/YoutubePlayer";
|
|
40
40
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
41
41
|
export { default as Picker } from "./components/Picker/Picker";
|
|
42
42
|
export { default as ProgressBar } from "./components/ProgressBar";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAm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BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -12,16 +12,6 @@ export declare const SEED_DATA: {
|
|
|
12
12
|
props: {
|
|
13
13
|
videoId: any;
|
|
14
14
|
playlist: any;
|
|
15
|
-
mute: {
|
|
16
|
-
label: string;
|
|
17
|
-
description: string;
|
|
18
|
-
formType: string;
|
|
19
|
-
propType: string;
|
|
20
|
-
defaultValue: boolean;
|
|
21
|
-
editable: boolean;
|
|
22
|
-
required: boolean;
|
|
23
|
-
group: string;
|
|
24
|
-
};
|
|
25
15
|
autoplay: {
|
|
26
16
|
label: string;
|
|
27
17
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YoutubePlayer.d.ts","sourceRoot":"","sources":["../../../../src/mappings/YoutubePlayer.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"YoutubePlayer.d.ts","sourceRoot":"","sources":["../../../../src/mappings/YoutubePlayer.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;CA6BrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.10.2-
|
|
3
|
+
"version": "46.10.2-9ed879.2+9ed8799",
|
|
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.10.2-
|
|
44
|
+
"@draftbit/types": "^46.10.2-9ed879.2+9ed8799",
|
|
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",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"react-native-tab-view": "^3.4.0",
|
|
65
65
|
"react-native-typography": "^1.4.1",
|
|
66
66
|
"react-native-web-swiper": "^2.2.3",
|
|
67
|
-
"react-native-
|
|
68
|
-
"react-
|
|
67
|
+
"react-native-youtube-iframe": "^2.2.2",
|
|
68
|
+
"react-youtube": "^10.1.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/color": "^3.0.1",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
]
|
|
101
101
|
]
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "9ed8799bea901e8e725df98192d9863e543b376a"
|
|
104
104
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { extractStyles } from "../../utilities";
|
|
4
|
+
import YouTube from "react-youtube";
|
|
5
|
+
const YoutubePlayer = ({ videoId, playlist, autoplay = false, style, }) => {
|
|
6
|
+
const { viewStyles } = extractStyles(style);
|
|
7
|
+
const defaultVideoId = "nwMUpDESXrI";
|
|
8
|
+
const options = {
|
|
9
|
+
width: viewStyles.width,
|
|
10
|
+
height: viewStyles.height,
|
|
11
|
+
playerVars: {
|
|
12
|
+
autoplay: autoplay ? 1 : 0,
|
|
13
|
+
list: playlist,
|
|
14
|
+
listType: "playlist",
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
return (React.createElement(View, { style: viewStyles },
|
|
18
|
+
React.createElement(YouTube, { videoId: !videoId && !playlist ? defaultVideoId : videoId, opts: options })));
|
|
19
|
+
};
|
|
20
|
+
export default YoutubePlayer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import YoutubePlayerIFrame from "react-native-youtube-iframe";
|
|
3
|
+
import { extractStyles } from "../../utilities";
|
|
4
|
+
const YoutubePlayer = ({ videoId, playlist, autoplay = false, style, }) => {
|
|
5
|
+
const { viewStyles } = extractStyles(style);
|
|
6
|
+
const defaultVideoId = "nwMUpDESXrI";
|
|
7
|
+
return (React.createElement(YoutubePlayerIFrame, { width: viewStyles.width, height: viewStyles.height, play: autoplay, videoId: !videoId && !playlist ? defaultVideoId : videoId, playList: playlist, webViewStyle: viewStyles }));
|
|
8
|
+
};
|
|
9
|
+
export default YoutubePlayer;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import YoutubePlayerIFrame from "react-native-youtube-iframe";
|
|
3
|
+
import { extractStyles } from "../../utilities";
|
|
4
|
+
import { YoutubePlayerProps } from "./YoutubePlayerProps";
|
|
5
|
+
|
|
6
|
+
const YoutubePlayer: React.FC<YoutubePlayerProps> = ({
|
|
7
|
+
videoId,
|
|
8
|
+
playlist,
|
|
9
|
+
autoplay = false,
|
|
10
|
+
style,
|
|
11
|
+
}) => {
|
|
12
|
+
const { viewStyles } = extractStyles(style);
|
|
13
|
+
const defaultVideoId = "nwMUpDESXrI";
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<YoutubePlayerIFrame
|
|
17
|
+
width={viewStyles.width}
|
|
18
|
+
height={viewStyles.height}
|
|
19
|
+
play={autoplay}
|
|
20
|
+
videoId={!videoId && !playlist ? defaultVideoId : videoId}
|
|
21
|
+
playList={playlist}
|
|
22
|
+
webViewStyle={viewStyles}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default YoutubePlayer;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { extractStyles } from "../../utilities";
|
|
4
|
+
import { YoutubePlayerProps } from "./YoutubePlayerProps";
|
|
5
|
+
import YouTube, { YouTubeProps } from "react-youtube";
|
|
6
|
+
|
|
7
|
+
const YoutubePlayer: React.FC<YoutubePlayerProps> = ({
|
|
8
|
+
videoId,
|
|
9
|
+
playlist,
|
|
10
|
+
autoplay = false,
|
|
11
|
+
style,
|
|
12
|
+
}) => {
|
|
13
|
+
const { viewStyles } = extractStyles(style);
|
|
14
|
+
const defaultVideoId = "nwMUpDESXrI";
|
|
15
|
+
|
|
16
|
+
const options: YouTubeProps["opts"] = {
|
|
17
|
+
width: viewStyles.width,
|
|
18
|
+
height: viewStyles.height,
|
|
19
|
+
playerVars: {
|
|
20
|
+
autoplay: autoplay ? 1 : 0,
|
|
21
|
+
list: playlist,
|
|
22
|
+
listType: "playlist",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<View style={viewStyles}>
|
|
28
|
+
<YouTube
|
|
29
|
+
videoId={!videoId && !playlist ? defaultVideoId : videoId}
|
|
30
|
+
opts={options}
|
|
31
|
+
/>
|
|
32
|
+
</View>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default YoutubePlayer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as YoutubePlayer } from "./YoutubePlayer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as YoutubePlayer } from "./YoutubePlayer";
|
package/src/index.js
CHANGED
|
@@ -36,7 +36,7 @@ export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
|
36
36
|
export { TabView, TabViewItem } from "./components/TabView";
|
|
37
37
|
export { default as Markdown } from "./components/Markdown";
|
|
38
38
|
export { BottomSheet } from "./components/BottomSheet";
|
|
39
|
-
export {
|
|
39
|
+
export { YoutubePlayer } from "./components/YoutubePlayer";
|
|
40
40
|
/* Deprecated: Fix or Delete! */
|
|
41
41
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
42
42
|
export { default as Picker } from "./components/Picker/Picker";
|
package/src/index.tsx
CHANGED
|
@@ -60,7 +60,7 @@ export { default as Markdown } from "./components/Markdown";
|
|
|
60
60
|
|
|
61
61
|
export { BottomSheet } from "./components/BottomSheet";
|
|
62
62
|
|
|
63
|
-
export {
|
|
63
|
+
export { YoutubePlayer } from "./components/YoutubePlayer";
|
|
64
64
|
|
|
65
65
|
/* Deprecated: Fix or Delete! */
|
|
66
66
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
@@ -21,12 +21,6 @@ export const SEED_DATA = {
|
|
|
21
21
|
description: "Playlist of the Youtube videos.",
|
|
22
22
|
defaultValue: null,
|
|
23
23
|
}),
|
|
24
|
-
mute: createStaticBoolProp({
|
|
25
|
-
label: "Mute Audio",
|
|
26
|
-
description: "Mute the audio of the video.",
|
|
27
|
-
defaultValue: false,
|
|
28
|
-
required: false,
|
|
29
|
-
}),
|
|
30
24
|
autoplay: createStaticBoolProp({
|
|
31
25
|
label: "Auto Play",
|
|
32
26
|
description: "Autoplay the video on load.",
|
|
@@ -27,12 +27,6 @@ export const SEED_DATA = {
|
|
|
27
27
|
description: "Playlist of the Youtube videos.",
|
|
28
28
|
defaultValue: null,
|
|
29
29
|
}),
|
|
30
|
-
mute: createStaticBoolProp({
|
|
31
|
-
label: "Mute Audio",
|
|
32
|
-
description: "Mute the audio of the video.",
|
|
33
|
-
defaultValue: false,
|
|
34
|
-
required: false,
|
|
35
|
-
}),
|
|
36
30
|
autoplay: createStaticBoolProp({
|
|
37
31
|
label: "Auto Play",
|
|
38
32
|
description: "Autoplay the video on load.",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import YoutubePlayerComponent from "react-native-youtube-iframe";
|
|
3
|
-
import { extractStyles } from "../utilities";
|
|
4
|
-
const YoutubePlayer = _ref => {
|
|
5
|
-
let {
|
|
6
|
-
videoId,
|
|
7
|
-
playlist,
|
|
8
|
-
mute = false,
|
|
9
|
-
autoplay = false,
|
|
10
|
-
style
|
|
11
|
-
} = _ref;
|
|
12
|
-
const {
|
|
13
|
-
viewStyles
|
|
14
|
-
} = extractStyles(style);
|
|
15
|
-
const {
|
|
16
|
-
height,
|
|
17
|
-
width
|
|
18
|
-
} = viewStyles;
|
|
19
|
-
const defaultVideoId = "nwMUpDESXrI";
|
|
20
|
-
return /*#__PURE__*/React.createElement(YoutubePlayerComponent, {
|
|
21
|
-
height: height,
|
|
22
|
-
width: width,
|
|
23
|
-
play: autoplay,
|
|
24
|
-
videoId: !videoId && !playlist ? defaultVideoId : videoId,
|
|
25
|
-
playList: playlist,
|
|
26
|
-
mute: mute,
|
|
27
|
-
webViewStyle: style
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
export default YoutubePlayer;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
interface YoutubePlayerProps {
|
|
4
|
-
videoId?: string;
|
|
5
|
-
playlist?: string;
|
|
6
|
-
mute?: boolean;
|
|
7
|
-
autoplay?: boolean;
|
|
8
|
-
style?: StyleProp<ViewStyle>;
|
|
9
|
-
}
|
|
10
|
-
declare const YoutubePlayer: React.FC<YoutubePlayerProps>;
|
|
11
|
-
export default YoutubePlayer;
|
|
12
|
-
//# sourceMappingURL=YotubePlayer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"YotubePlayer.d.ts","sourceRoot":"","sources":["../../../../src/components/YotubePlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAsB/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import YoutubePlayerComponent from "react-native-youtube-iframe";
|
|
3
|
-
import { extractStyles } from "../utilities";
|
|
4
|
-
const YoutubePlayer = ({ videoId, playlist, mute = false, autoplay = false, style, }) => {
|
|
5
|
-
const { viewStyles } = extractStyles(style);
|
|
6
|
-
const { height, width } = viewStyles;
|
|
7
|
-
const defaultVideoId = "nwMUpDESXrI";
|
|
8
|
-
return (React.createElement(YoutubePlayerComponent, { height: height, width: width, play: autoplay, videoId: !videoId && !playlist ? defaultVideoId : videoId, playList: playlist, mute: mute, webViewStyle: style }));
|
|
9
|
-
};
|
|
10
|
-
export default YoutubePlayer;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import YoutubePlayerComponent from "react-native-youtube-iframe";
|
|
4
|
-
import { extractStyles } from "../utilities";
|
|
5
|
-
|
|
6
|
-
interface YoutubePlayerProps {
|
|
7
|
-
videoId?: string;
|
|
8
|
-
playlist?: string;
|
|
9
|
-
mute?: boolean;
|
|
10
|
-
autoplay?: boolean;
|
|
11
|
-
style?: StyleProp<ViewStyle>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const YoutubePlayer: React.FC<YoutubePlayerProps> = ({
|
|
15
|
-
videoId,
|
|
16
|
-
playlist,
|
|
17
|
-
mute = false,
|
|
18
|
-
autoplay = false,
|
|
19
|
-
style,
|
|
20
|
-
}) => {
|
|
21
|
-
const { viewStyles } = extractStyles(style);
|
|
22
|
-
const { height, width } = viewStyles;
|
|
23
|
-
const defaultVideoId = "nwMUpDESXrI";
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<YoutubePlayerComponent
|
|
27
|
-
height={height}
|
|
28
|
-
width={width}
|
|
29
|
-
play={autoplay}
|
|
30
|
-
videoId={!videoId && !playlist ? defaultVideoId : videoId}
|
|
31
|
-
playList={playlist}
|
|
32
|
-
mute={mute}
|
|
33
|
-
webViewStyle={style}
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default YoutubePlayer;
|