@draftbit/core 46.2.4-d2065e.10 → 46.2.4-d5a19a.11
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/CardBlock.js +5 -15
- package/lib/commonjs/components/Carousel.js +10 -34
- package/lib/commonjs/components/CircularProgress.js +7 -15
- package/lib/commonjs/components/DeprecatedFAB.js +4 -22
- package/lib/commonjs/components/Portal/Portal.js +5 -3
- package/lib/commonjs/components/StepIndicator.js +16 -34
- package/lib/commonjs/components/TextField.js +30 -63
- package/lib/commonjs/components/Youtube.js +73 -0
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/mappings/Youtube.js +42 -0
- package/lib/module/components/Youtube.js +59 -0
- package/lib/module/index.js +2 -1
- package/lib/module/mappings/Youtube.js +33 -0
- package/lib/typescript/src/components/Youtube.d.ts +44 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/mappings/Youtube.d.ts +36 -0
- package/package.json +6 -4
- package/src/components/Youtube.js +38 -0
- package/src/components/Youtube.tsx +66 -0
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/Youtube.js +33 -0
- package/src/mappings/Youtube.ts +39 -0
|
@@ -21,6 +21,8 @@ var _Config = _interopRequireDefault(require("./Config"));
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
+
|
|
24
26
|
const CardBlock = _ref => {
|
|
25
27
|
let {
|
|
26
28
|
image = _Config.default.cardImageUrl,
|
|
@@ -60,12 +62,11 @@ const CardBlock = _ref => {
|
|
|
60
62
|
const rightDescriptionStyles = [typography.subtitle2, {
|
|
61
63
|
color: colors.light
|
|
62
64
|
}];
|
|
63
|
-
return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, {
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, _extends({
|
|
64
66
|
style: style,
|
|
65
67
|
onPress: onPress,
|
|
66
|
-
numColumns: numColumns
|
|
67
|
-
|
|
68
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
68
|
+
numColumns: numColumns
|
|
69
|
+
}, rest), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
69
70
|
style: {
|
|
70
71
|
backgroundColor: colors.background
|
|
71
72
|
}
|
|
@@ -117,15 +118,4 @@ const CardBlock = _ref => {
|
|
|
117
118
|
|
|
118
119
|
var _default = (0, _theming.withTheme)(CardBlock);
|
|
119
120
|
|
|
120
|
-
exports.default = _default;le: [typography.body2, {
|
|
121
|
-
color: colors.medium
|
|
122
|
-
}]
|
|
123
|
-
}, leftDescription), rightDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
124
|
-
numberOfLines: 1,
|
|
125
|
-
style: rightDescriptionStyles
|
|
126
|
-
}, rightDescription) : null) : null));
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
var _default = (0, _theming.withTheme)(CardBlock);
|
|
130
|
-
|
|
131
121
|
exports.default = _default;
|
|
@@ -19,6 +19,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
+
|
|
22
24
|
const screenWidth = _reactNative.Dimensions.get("window").width;
|
|
23
25
|
|
|
24
26
|
function Pager(_ref) {
|
|
@@ -48,6 +50,8 @@ function Pager(_ref) {
|
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
function Carousel(_ref2) {
|
|
53
|
+
var _data$length;
|
|
54
|
+
|
|
51
55
|
let {
|
|
52
56
|
data,
|
|
53
57
|
children,
|
|
@@ -55,12 +59,9 @@ function Carousel(_ref2) {
|
|
|
55
59
|
style,
|
|
56
60
|
...rest
|
|
57
61
|
} = _ref2;
|
|
58
|
-
|
|
59
|
-
var _a;
|
|
60
|
-
|
|
61
62
|
const [index, setIndex] = React.useState(0);
|
|
62
63
|
const length = React.Children.count(children);
|
|
63
|
-
const itemsLength = ((
|
|
64
|
+
const itemsLength = ((_data$length = data === null || data === void 0 ? void 0 : data.length) !== null && _data$length !== void 0 ? _data$length : 0) + length;
|
|
64
65
|
const slides = Array.isArray(data) ? data : [];
|
|
65
66
|
|
|
66
67
|
const {
|
|
@@ -70,10 +71,9 @@ function Carousel(_ref2) {
|
|
|
70
71
|
|
|
71
72
|
const slideWidth = width || screenWidth;
|
|
72
73
|
const slideHeight = height || 250;
|
|
73
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
74
|
-
style: [styles.container, style]
|
|
75
|
-
|
|
76
|
-
}, /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
|
|
74
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
75
|
+
style: [styles.container, style]
|
|
76
|
+
}, rest), /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
|
|
77
77
|
pagingEnabled: true,
|
|
78
78
|
horizontal: true,
|
|
79
79
|
decelerationRate: "fast",
|
|
@@ -101,9 +101,9 @@ function Carousel(_ref2) {
|
|
|
101
101
|
}]
|
|
102
102
|
});
|
|
103
103
|
}) : null, React.Children.map(children, child => {
|
|
104
|
-
var
|
|
104
|
+
var _child$props;
|
|
105
105
|
|
|
106
|
-
const s = (
|
|
106
|
+
const s = (child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.style) || {};
|
|
107
107
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
108
108
|
style: {
|
|
109
109
|
width: slideWidth
|
|
@@ -144,28 +144,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
144
144
|
|
|
145
145
|
var _default = (0, _theming.withTheme)(Carousel);
|
|
146
146
|
|
|
147
|
-
exports.default = _default;e({
|
|
148
|
-
container: {
|
|
149
|
-
backgroundColor: "#eee"
|
|
150
|
-
},
|
|
151
|
-
pager: {
|
|
152
|
-
position: "absolute",
|
|
153
|
-
bottom: 12,
|
|
154
|
-
left: 0,
|
|
155
|
-
right: 0,
|
|
156
|
-
flexDirection: "row",
|
|
157
|
-
justifyContent: "center",
|
|
158
|
-
alignItems: "center"
|
|
159
|
-
},
|
|
160
|
-
bullet: {
|
|
161
|
-
marginHorizontal: 2,
|
|
162
|
-
width: 10,
|
|
163
|
-
height: 10,
|
|
164
|
-
borderRadius: 20,
|
|
165
|
-
backgroundColor: "#000"
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
var _default = (0, _theming.withTheme)(Carousel);
|
|
170
|
-
|
|
171
147
|
exports.default = _default;
|
|
@@ -13,27 +13,29 @@ var _reactNativeSvg = require("react-native-svg");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
+
|
|
16
18
|
class CircularProgress extends _react.default.Component {
|
|
17
19
|
constructor() {
|
|
18
20
|
super(...arguments);
|
|
19
21
|
|
|
20
|
-
this
|
|
22
|
+
_defineProperty(this, "polarToCartesian", (centerX, centerY, radius, angleInDegrees) => {
|
|
21
23
|
var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
|
|
22
24
|
return {
|
|
23
25
|
x: centerX + radius * Math.cos(angleInRadians),
|
|
24
26
|
y: centerY + radius * Math.sin(angleInRadians)
|
|
25
27
|
};
|
|
26
|
-
};
|
|
28
|
+
});
|
|
27
29
|
|
|
28
|
-
this
|
|
30
|
+
_defineProperty(this, "circlePath", (x, y, radius, startAngle, endAngle) => {
|
|
29
31
|
var start = this.polarToCartesian(x, y, radius, endAngle * 0.9999);
|
|
30
32
|
var end = this.polarToCartesian(x, y, radius, startAngle);
|
|
31
33
|
var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
|
|
32
34
|
var d = ["M", start.x, start.y, "A", radius, radius, 0, largeArcFlag, 0, end.x, end.y];
|
|
33
35
|
return d.join(" ");
|
|
34
|
-
};
|
|
36
|
+
});
|
|
35
37
|
|
|
36
|
-
this
|
|
38
|
+
_defineProperty(this, "clampFill", fill => Math.min(100, Math.max(0, fill)));
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
render() {
|
|
@@ -116,15 +118,5 @@ class CircularProgress extends _react.default.Component {
|
|
|
116
118
|
|
|
117
119
|
}
|
|
118
120
|
|
|
119
|
-
var _default = CircularProgress;
|
|
120
|
-
exports.default = _default;okeDasharrayTint,
|
|
121
|
-
fill: "transparent"
|
|
122
|
-
}), cap)), children && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
123
|
-
style: localChildrenContainerStyle
|
|
124
|
-
}, children(fill)));
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
121
|
var _default = CircularProgress;
|
|
130
122
|
exports.default = _default;
|
|
@@ -27,6 +27,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
27
|
|
|
28
28
|
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; }
|
|
29
29
|
|
|
30
|
+
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); }
|
|
31
|
+
|
|
30
32
|
const FAB = _ref => {
|
|
31
33
|
let {
|
|
32
34
|
Icon,
|
|
@@ -128,7 +130,7 @@ const FAB = _ref => {
|
|
|
128
130
|
style: [{
|
|
129
131
|
elevation
|
|
130
132
|
}, style]
|
|
131
|
-
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
133
|
+
}, /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
|
|
132
134
|
onPress: onPress,
|
|
133
135
|
accessibilityState: {
|
|
134
136
|
disabled
|
|
@@ -136,7 +138,7 @@ const FAB = _ref => {
|
|
|
136
138
|
accessibilityRole: "button",
|
|
137
139
|
disabled: disabled || loading,
|
|
138
140
|
style: buttonStyles
|
|
139
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
141
|
+
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
140
142
|
style: styles.content
|
|
141
143
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
142
144
|
style: iconStyle
|
|
@@ -179,24 +181,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
179
181
|
|
|
180
182
|
var _default = (0, _theming.withTheme)(FAB);
|
|
181
183
|
|
|
182
|
-
exports.default = _default; "row",
|
|
183
|
-
alignItems: "center",
|
|
184
|
-
justifyContent: "center"
|
|
185
|
-
},
|
|
186
|
-
icon: {
|
|
187
|
-
alignItems: "center",
|
|
188
|
-
justifyContent: "center",
|
|
189
|
-
width: _Config.default.buttonIconSize
|
|
190
|
-
},
|
|
191
|
-
fixed: {
|
|
192
|
-
left: 0,
|
|
193
|
-
right: 0,
|
|
194
|
-
bottom: 0,
|
|
195
|
-
height: 64,
|
|
196
|
-
borderRadius: 0
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
var _default = (0, _theming.withTheme)(FAB);
|
|
201
|
-
|
|
202
184
|
exports.default = _default;
|
|
@@ -19,6 +19,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
|
|
22
24
|
/**
|
|
23
25
|
* Portal allows to render a component at a different place in the parent tree.
|
|
24
26
|
* You can use it to render content which should appear above other elements, similar to `Modal`.
|
|
@@ -41,6 +43,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
41
43
|
* ```
|
|
42
44
|
*/
|
|
43
45
|
class Portal extends React.Component {
|
|
46
|
+
// @component ./PortalHost.tsx
|
|
44
47
|
render() {
|
|
45
48
|
const {
|
|
46
49
|
children,
|
|
@@ -53,10 +56,9 @@ class Portal extends React.Component {
|
|
|
53
56
|
}, children)));
|
|
54
57
|
}
|
|
55
58
|
|
|
56
|
-
}
|
|
57
|
-
|
|
59
|
+
}
|
|
58
60
|
|
|
59
|
-
Portal
|
|
61
|
+
_defineProperty(Portal, "Host", _PortalHost.default);
|
|
60
62
|
|
|
61
63
|
var _default = (0, _theming.withTheme)(Portal);
|
|
62
64
|
|
|
@@ -13,7 +13,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
13
13
|
|
|
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
15
|
|
|
16
|
-
|
|
16
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
+
|
|
17
18
|
const STEP_STATUS = {
|
|
18
19
|
CURRENT: "current",
|
|
19
20
|
FINISHED: "finished",
|
|
@@ -24,7 +25,7 @@ class StepIndicator extends _react.Component {
|
|
|
24
25
|
constructor(props) {
|
|
25
26
|
super(props);
|
|
26
27
|
|
|
27
|
-
this
|
|
28
|
+
_defineProperty(this, "renderProgressBarBackground", () => {
|
|
28
29
|
const {
|
|
29
30
|
stepCount,
|
|
30
31
|
direction
|
|
@@ -69,9 +70,9 @@ class StepIndicator extends _react.Component {
|
|
|
69
70
|
},
|
|
70
71
|
style: progressBarBackgroundStyle
|
|
71
72
|
});
|
|
72
|
-
};
|
|
73
|
+
});
|
|
73
74
|
|
|
74
|
-
this
|
|
75
|
+
_defineProperty(this, "renderProgressBar", () => {
|
|
75
76
|
const {
|
|
76
77
|
stepCount,
|
|
77
78
|
direction
|
|
@@ -103,9 +104,9 @@ class StepIndicator extends _react.Component {
|
|
|
103
104
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
104
105
|
style: progressBarStyle
|
|
105
106
|
});
|
|
106
|
-
};
|
|
107
|
+
});
|
|
107
108
|
|
|
108
|
-
this
|
|
109
|
+
_defineProperty(this, "renderStepIndicator", () => {
|
|
109
110
|
let steps = [];
|
|
110
111
|
const {
|
|
111
112
|
stepCount,
|
|
@@ -138,9 +139,9 @@ class StepIndicator extends _react.Component {
|
|
|
138
139
|
height: this.state.customStyles.currentStepIndicatorSize
|
|
139
140
|
}]
|
|
140
141
|
}, steps);
|
|
141
|
-
};
|
|
142
|
+
});
|
|
142
143
|
|
|
143
|
-
this
|
|
144
|
+
_defineProperty(this, "renderStepLabels", () => {
|
|
144
145
|
const {
|
|
145
146
|
labels,
|
|
146
147
|
direction,
|
|
@@ -182,9 +183,9 @@ class StepIndicator extends _react.Component {
|
|
|
182
183
|
alignItems: this.state.customStyles.labelAlign
|
|
183
184
|
}]
|
|
184
185
|
}, labelViews);
|
|
185
|
-
};
|
|
186
|
+
});
|
|
186
187
|
|
|
187
|
-
this
|
|
188
|
+
_defineProperty(this, "renderStep", position => {
|
|
188
189
|
const {
|
|
189
190
|
renderStepIndicator
|
|
190
191
|
} = this.props;
|
|
@@ -256,9 +257,9 @@ class StepIndicator extends _react.Component {
|
|
|
256
257
|
}) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
257
258
|
style: indicatorLabelStyle
|
|
258
259
|
}, "".concat(position + 1)));
|
|
259
|
-
};
|
|
260
|
+
});
|
|
260
261
|
|
|
261
|
-
this
|
|
262
|
+
_defineProperty(this, "getStepStatus", stepPosition => {
|
|
262
263
|
const {
|
|
263
264
|
currentPosition
|
|
264
265
|
} = this.props;
|
|
@@ -270,9 +271,9 @@ class StepIndicator extends _react.Component {
|
|
|
270
271
|
} else {
|
|
271
272
|
return STEP_STATUS.UNFINISHED;
|
|
272
273
|
}
|
|
273
|
-
};
|
|
274
|
+
});
|
|
274
275
|
|
|
275
|
-
this
|
|
276
|
+
_defineProperty(this, "onCurrentPositionChanged", position => {
|
|
276
277
|
let {
|
|
277
278
|
stepCount
|
|
278
279
|
} = this.props;
|
|
@@ -295,7 +296,7 @@ class StepIndicator extends _react.Component {
|
|
|
295
296
|
toValue: this.state.customStyles.currentStepIndicatorSize / 2,
|
|
296
297
|
duration: 100
|
|
297
298
|
})])]).start();
|
|
298
|
-
};
|
|
299
|
+
});
|
|
299
300
|
|
|
300
301
|
const defaultStyles = {
|
|
301
302
|
stepIndicatorSize: 30,
|
|
@@ -410,25 +411,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
410
411
|
}
|
|
411
412
|
});
|
|
412
413
|
|
|
413
|
-
StepIndicator.defaultProps = {
|
|
414
|
-
currentPosition: 0,
|
|
415
|
-
stepCount: 5,
|
|
416
|
-
customStyles: {},
|
|
417
|
-
direction: "horizontal"
|
|
418
|
-
}; justifyContent: "center"
|
|
419
|
-
},
|
|
420
|
-
stepLabel: {
|
|
421
|
-
fontSize: 12,
|
|
422
|
-
textAlign: "center",
|
|
423
|
-
fontWeight: "500"
|
|
424
|
-
},
|
|
425
|
-
stepLabelItem: {
|
|
426
|
-
flex: 1,
|
|
427
|
-
alignItems: "center",
|
|
428
|
-
justifyContent: "center"
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
|
|
432
414
|
StepIndicator.defaultProps = {
|
|
433
415
|
currentPosition: 0,
|
|
434
416
|
stepCount: 5,
|
|
@@ -17,6 +17,10 @@ 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
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
|
|
20
24
|
const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
|
|
21
25
|
|
|
22
26
|
const FOCUS_ANIMATION_DURATION = 150;
|
|
@@ -26,7 +30,8 @@ const ICON_SIZE = 24;
|
|
|
26
30
|
class TextField extends React.Component {
|
|
27
31
|
constructor() {
|
|
28
32
|
super(...arguments);
|
|
29
|
-
|
|
33
|
+
|
|
34
|
+
_defineProperty(this, "state", {
|
|
30
35
|
labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
|
|
31
36
|
focused: false,
|
|
32
37
|
placeholder: this.props.error ? this.props.placeholder : "",
|
|
@@ -34,35 +39,36 @@ class TextField extends React.Component {
|
|
|
34
39
|
measured: false,
|
|
35
40
|
width: 0
|
|
36
41
|
}
|
|
37
|
-
};
|
|
38
|
-
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
_defineProperty(this, "_timer", setTimeout(() => {}, 0));
|
|
39
45
|
|
|
40
|
-
this
|
|
46
|
+
_defineProperty(this, "_showPlaceholder", () => {
|
|
41
47
|
clearTimeout(this._timer); // Set the placeholder in a delay to offset the label animation
|
|
42
48
|
// If we show it immediately, they'll overlap and look ugly
|
|
43
49
|
|
|
44
50
|
this._timer = setTimeout(() => this.setState({
|
|
45
51
|
placeholder: this.props.placeholder
|
|
46
52
|
}), 50);
|
|
47
|
-
};
|
|
53
|
+
});
|
|
48
54
|
|
|
49
|
-
this
|
|
55
|
+
_defineProperty(this, "_hidePlaceholder", () => this.setState({
|
|
50
56
|
placeholder: ""
|
|
51
|
-
});
|
|
57
|
+
}));
|
|
52
58
|
|
|
53
|
-
this
|
|
59
|
+
_defineProperty(this, "_restoreLabel", () => _reactNative.Animated.timing(this.state.labeled, {
|
|
54
60
|
toValue: 1,
|
|
55
61
|
duration: FOCUS_ANIMATION_DURATION,
|
|
56
62
|
useNativeDriver: true
|
|
57
|
-
}).start();
|
|
63
|
+
}).start());
|
|
58
64
|
|
|
59
|
-
this
|
|
65
|
+
_defineProperty(this, "_minmizeLabel", () => _reactNative.Animated.timing(this.state.labeled, {
|
|
60
66
|
toValue: 0,
|
|
61
67
|
duration: BLUR_ANIMATION_DURATION,
|
|
62
68
|
useNativeDriver: true
|
|
63
|
-
}).start();
|
|
69
|
+
}).start());
|
|
64
70
|
|
|
65
|
-
this
|
|
71
|
+
_defineProperty(this, "_handleFocus", () => {
|
|
66
72
|
if (this.props.disabled) {
|
|
67
73
|
return;
|
|
68
74
|
}
|
|
@@ -70,9 +76,9 @@ class TextField extends React.Component {
|
|
|
70
76
|
this.setState({
|
|
71
77
|
focused: true
|
|
72
78
|
});
|
|
73
|
-
};
|
|
79
|
+
});
|
|
74
80
|
|
|
75
|
-
this
|
|
81
|
+
_defineProperty(this, "_handleBlur", () => {
|
|
76
82
|
if (this.props.disabled) {
|
|
77
83
|
return;
|
|
78
84
|
}
|
|
@@ -80,9 +86,9 @@ class TextField extends React.Component {
|
|
|
80
86
|
this.setState({
|
|
81
87
|
focused: false
|
|
82
88
|
});
|
|
83
|
-
};
|
|
89
|
+
});
|
|
84
90
|
|
|
85
|
-
this
|
|
91
|
+
_defineProperty(this, "_handleChangeText", value => {
|
|
86
92
|
if (this.props.disabled) {
|
|
87
93
|
return;
|
|
88
94
|
}
|
|
@@ -98,9 +104,9 @@ class TextField extends React.Component {
|
|
|
98
104
|
});
|
|
99
105
|
this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
|
|
100
106
|
}
|
|
101
|
-
};
|
|
107
|
+
});
|
|
102
108
|
|
|
103
|
-
this
|
|
109
|
+
_defineProperty(this, "_root", undefined);
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
@@ -151,11 +157,10 @@ class TextField extends React.Component {
|
|
|
151
157
|
focused: !prevState.focused
|
|
152
158
|
}));
|
|
153
159
|
}
|
|
160
|
+
|
|
154
161
|
/**
|
|
155
162
|
* @internal
|
|
156
163
|
*/
|
|
157
|
-
|
|
158
|
-
|
|
159
164
|
setNativeProps(args) {
|
|
160
165
|
return this._root && this._root.setNativeProps(args);
|
|
161
166
|
}
|
|
@@ -198,8 +203,7 @@ class TextField extends React.Component {
|
|
|
198
203
|
roundness,
|
|
199
204
|
disabledOpacity
|
|
200
205
|
},
|
|
201
|
-
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput,
|
|
202
|
-
}),
|
|
206
|
+
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, props),
|
|
203
207
|
...rest
|
|
204
208
|
} = this.props;
|
|
205
209
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
@@ -353,9 +357,9 @@ class TextField extends React.Component {
|
|
|
353
357
|
|
|
354
358
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
355
359
|
style: [styles.container, styleProp]
|
|
356
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
360
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
357
361
|
style: leftIconStyle
|
|
358
|
-
}) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
362
|
+
})) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
359
363
|
style: (0, _utilities.applyStyles)([containerStyle], {
|
|
360
364
|
height: style === null || style === void 0 ? void 0 : style.height,
|
|
361
365
|
backgroundColor: bgColor,
|
|
@@ -422,9 +426,9 @@ class TextField extends React.Component {
|
|
|
422
426
|
style: {
|
|
423
427
|
justifyContent: type === "solid" ? "center" : undefined
|
|
424
428
|
}
|
|
425
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
429
|
+
}, /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
426
430
|
style: leftIconStyle
|
|
427
|
-
})) : null, render({
|
|
431
|
+
}))) : null, render({
|
|
428
432
|
ref: c => {
|
|
429
433
|
this._root = c;
|
|
430
434
|
},
|
|
@@ -465,43 +469,6 @@ var _default = (0, _theming.withTheme)(TextField);
|
|
|
465
469
|
|
|
466
470
|
exports.default = _default;
|
|
467
471
|
|
|
468
|
-
const styles = _reactNative.StyleSheet.create({
|
|
469
|
-
container: {
|
|
470
|
-
alignSelf: "stretch"
|
|
471
|
-
},
|
|
472
|
-
placeholder: {
|
|
473
|
-
position: "absolute",
|
|
474
|
-
left: 0
|
|
475
|
-
},
|
|
476
|
-
underline: {
|
|
477
|
-
position: "absolute",
|
|
478
|
-
left: 0,
|
|
479
|
-
right: 0,
|
|
480
|
-
bottom: 0,
|
|
481
|
-
height: 2
|
|
482
|
-
},
|
|
483
|
-
input: {
|
|
484
|
-
flexGrow: 1,
|
|
485
|
-
justifyContent: "center",
|
|
486
|
-
textAlignVertical: "center",
|
|
487
|
-
margin: 0,
|
|
488
|
-
textAlign: _reactNative.I18nManager.isRTL ? "right" : "left"
|
|
489
|
-
}
|
|
490
|
-
});? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
491
|
-
style: [{
|
|
492
|
-
color: error ? colors.error : colors.light,
|
|
493
|
-
marginTop: 8,
|
|
494
|
-
marginLeft: assistiveTextLeftMargin
|
|
495
|
-
}]
|
|
496
|
-
}, assistiveText) : null);
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
var _default = (0, _theming.withTheme)(TextField);
|
|
502
|
-
|
|
503
|
-
exports.default = _default;
|
|
504
|
-
|
|
505
472
|
const styles = _reactNative.StyleSheet.create({
|
|
506
473
|
container: {
|
|
507
474
|
alignSelf: "stretch"
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.SEED_DATA = void 0;
|
|
7
|
+
|
|
8
|
+
var _types = require("@draftbit/types");
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _reactNativeYoutubeIframe = _interopRequireDefault(require("react-native-youtube-iframe"));
|
|
13
|
+
|
|
14
|
+
var _utilities = require("../utilities");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
const Youtube = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
videoId,
|
|
21
|
+
playlist,
|
|
22
|
+
style,
|
|
23
|
+
mute,
|
|
24
|
+
autoplay
|
|
25
|
+
} = _ref;
|
|
26
|
+
const {
|
|
27
|
+
viewStyles: {
|
|
28
|
+
height,
|
|
29
|
+
width
|
|
30
|
+
}
|
|
31
|
+
} = (0, _utilities.extractStyles)(style);
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativeYoutubeIframe.default, {
|
|
33
|
+
height: height,
|
|
34
|
+
width: width,
|
|
35
|
+
play: autoplay,
|
|
36
|
+
videoId: videoId,
|
|
37
|
+
playList: playlist,
|
|
38
|
+
mute: mute
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var _default = Youtube;
|
|
43
|
+
exports.default = _default;
|
|
44
|
+
const SEED_DATA = {
|
|
45
|
+
name: "Youtube",
|
|
46
|
+
tag: "Youtube",
|
|
47
|
+
description: "Youtube Component",
|
|
48
|
+
category: _types.COMPONENT_TYPES.media,
|
|
49
|
+
layout: {
|
|
50
|
+
width: "100%"
|
|
51
|
+
},
|
|
52
|
+
props: {
|
|
53
|
+
videoId: (0, _types.createTextProp)({
|
|
54
|
+
label: "VideoId",
|
|
55
|
+
description: "Youtube Video ID"
|
|
56
|
+
}),
|
|
57
|
+
playlist: (0, _types.createTextProp)({
|
|
58
|
+
label: "PlayList",
|
|
59
|
+
description: "Playlist ID"
|
|
60
|
+
}),
|
|
61
|
+
mute: (0, _types.createBoolProp)({
|
|
62
|
+
label: "Mute",
|
|
63
|
+
description: "Whether to mute video",
|
|
64
|
+
defaultValue: false
|
|
65
|
+
}),
|
|
66
|
+
autoplay: (0, _types.createBoolProp)({
|
|
67
|
+
label: "Autoplay",
|
|
68
|
+
description: "Whether to Autoplay video",
|
|
69
|
+
defaultValue: false
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
exports.SEED_DATA = SEED_DATA;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -393,6 +393,12 @@ Object.defineProperty(exports, "Touchable", {
|
|
|
393
393
|
return _Touchable.default;
|
|
394
394
|
}
|
|
395
395
|
});
|
|
396
|
+
Object.defineProperty(exports, "Youtube", {
|
|
397
|
+
enumerable: true,
|
|
398
|
+
get: function () {
|
|
399
|
+
return _Youtube.default;
|
|
400
|
+
}
|
|
401
|
+
});
|
|
396
402
|
Object.defineProperty(exports, "injectIcon", {
|
|
397
403
|
enumerable: true,
|
|
398
404
|
get: function () {
|
|
@@ -512,6 +518,8 @@ var _Stepper = _interopRequireDefault(require("./components/Stepper"));
|
|
|
512
518
|
|
|
513
519
|
var _useAuthState = require("./components/useAuthState");
|
|
514
520
|
|
|
521
|
+
var _Youtube = _interopRequireDefault(require("./components/Youtube"));
|
|
522
|
+
|
|
515
523
|
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); }
|
|
516
524
|
|
|
517
525
|
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; }
|
|
@@ -0,0 +1,42 @@
|
|
|
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 = {
|
|
11
|
+
name: "Youtube",
|
|
12
|
+
tag: "Youtube",
|
|
13
|
+
description: "Given a VideoId orPlaylist and play Youtube video",
|
|
14
|
+
doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
|
|
15
|
+
code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
|
|
16
|
+
category: _types.COMPONENT_TYPES.media,
|
|
17
|
+
stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Position],
|
|
18
|
+
layout: {
|
|
19
|
+
height: 250
|
|
20
|
+
},
|
|
21
|
+
props: {
|
|
22
|
+
videoId: (0, _types.createTextProp)({
|
|
23
|
+
label: "Video ID",
|
|
24
|
+
description: "VideoId of the Youtube video.",
|
|
25
|
+
defaultValue: "nwMUpDESXrI"
|
|
26
|
+
}),
|
|
27
|
+
playlist: (0, _types.createTextProp)({
|
|
28
|
+
label: "Playlist",
|
|
29
|
+
description: "Playlist of the Youtube videos.",
|
|
30
|
+
defaultValue: "PLUa6TiXzjIrwowt6P-uGCJm8ovm-9S1Ks"
|
|
31
|
+
}),
|
|
32
|
+
mute: (0, _types.createStaticBoolProp)({
|
|
33
|
+
label: "Mute Audio",
|
|
34
|
+
description: "Mute the audio of the video."
|
|
35
|
+
}),
|
|
36
|
+
autoplay: (0, _types.createStaticBoolProp)({
|
|
37
|
+
label: "Auto Play",
|
|
38
|
+
description: "Autoplay the video on load."
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createBoolProp, createTextProp } from "@draftbit/types";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import YoutubePlayer from "react-native-youtube-iframe";
|
|
4
|
+
import { extractStyles } from "../utilities";
|
|
5
|
+
|
|
6
|
+
const Youtube = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
videoId,
|
|
9
|
+
playlist,
|
|
10
|
+
style,
|
|
11
|
+
mute,
|
|
12
|
+
autoplay
|
|
13
|
+
} = _ref;
|
|
14
|
+
const {
|
|
15
|
+
viewStyles: {
|
|
16
|
+
height,
|
|
17
|
+
width
|
|
18
|
+
}
|
|
19
|
+
} = extractStyles(style);
|
|
20
|
+
return /*#__PURE__*/React.createElement(YoutubePlayer, {
|
|
21
|
+
height: height,
|
|
22
|
+
width: width,
|
|
23
|
+
play: autoplay,
|
|
24
|
+
videoId: videoId,
|
|
25
|
+
playList: playlist,
|
|
26
|
+
mute: mute
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default Youtube;
|
|
31
|
+
export const SEED_DATA = {
|
|
32
|
+
name: "Youtube",
|
|
33
|
+
tag: "Youtube",
|
|
34
|
+
description: "Youtube Component",
|
|
35
|
+
category: COMPONENT_TYPES.media,
|
|
36
|
+
layout: {
|
|
37
|
+
width: "100%"
|
|
38
|
+
},
|
|
39
|
+
props: {
|
|
40
|
+
videoId: createTextProp({
|
|
41
|
+
label: "VideoId",
|
|
42
|
+
description: "Youtube Video ID"
|
|
43
|
+
}),
|
|
44
|
+
playlist: createTextProp({
|
|
45
|
+
label: "PlayList",
|
|
46
|
+
description: "Playlist ID"
|
|
47
|
+
}),
|
|
48
|
+
mute: createBoolProp({
|
|
49
|
+
label: "Mute",
|
|
50
|
+
description: "Whether to mute video",
|
|
51
|
+
defaultValue: false
|
|
52
|
+
}),
|
|
53
|
+
autoplay: createBoolProp({
|
|
54
|
+
label: "Autoplay",
|
|
55
|
+
description: "Whether to Autoplay video",
|
|
56
|
+
defaultValue: false
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
};
|
package/lib/module/index.js
CHANGED
|
@@ -50,4 +50,5 @@ export { default as RowHeadlineImageCaption } from "./components/RowHeadlineImag
|
|
|
50
50
|
export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIcon";
|
|
51
51
|
export { default as Slider } from "./components/Slider";
|
|
52
52
|
export { default as Stepper } from "./components/Stepper";
|
|
53
|
-
export { useAuthState } from "./components/useAuthState";
|
|
53
|
+
export { useAuthState } from "./components/useAuthState";
|
|
54
|
+
export { default as Youtube } from "./components/Youtube"; // a comment to fix sourcemap comment issue
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, createTextProp, StylesPanelSections } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Youtube",
|
|
4
|
+
tag: "Youtube",
|
|
5
|
+
description: "Given a VideoId orPlaylist and play Youtube video",
|
|
6
|
+
doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
|
|
7
|
+
code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
|
|
8
|
+
category: COMPONENT_TYPES.media,
|
|
9
|
+
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Position],
|
|
10
|
+
layout: {
|
|
11
|
+
height: 250
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
videoId: createTextProp({
|
|
15
|
+
label: "Video ID",
|
|
16
|
+
description: "VideoId of the Youtube video.",
|
|
17
|
+
defaultValue: "nwMUpDESXrI"
|
|
18
|
+
}),
|
|
19
|
+
playlist: createTextProp({
|
|
20
|
+
label: "Playlist",
|
|
21
|
+
description: "Playlist of the Youtube videos.",
|
|
22
|
+
defaultValue: "PLUa6TiXzjIrwowt6P-uGCJm8ovm-9S1Ks"
|
|
23
|
+
}),
|
|
24
|
+
mute: createStaticBoolProp({
|
|
25
|
+
label: "Mute Audio",
|
|
26
|
+
description: "Mute the audio of the video."
|
|
27
|
+
}),
|
|
28
|
+
autoplay: createStaticBoolProp({
|
|
29
|
+
label: "Auto Play",
|
|
30
|
+
description: "Autoplay the video on load."
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
videoId: string;
|
|
5
|
+
playlist: string;
|
|
6
|
+
style: StyleProp<ViewStyle>;
|
|
7
|
+
mute: boolean;
|
|
8
|
+
autoplay: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const Youtube: ({ videoId, playlist, style, mute, autoplay }: Props) => JSX.Element;
|
|
11
|
+
export default Youtube;
|
|
12
|
+
export declare const SEED_DATA: {
|
|
13
|
+
name: string;
|
|
14
|
+
tag: string;
|
|
15
|
+
description: string;
|
|
16
|
+
category: string;
|
|
17
|
+
layout: {
|
|
18
|
+
width: string;
|
|
19
|
+
};
|
|
20
|
+
props: {
|
|
21
|
+
videoId: any;
|
|
22
|
+
playlist: any;
|
|
23
|
+
mute: {
|
|
24
|
+
label: string;
|
|
25
|
+
description: string;
|
|
26
|
+
formType: string;
|
|
27
|
+
propType: string;
|
|
28
|
+
defaultValue: boolean;
|
|
29
|
+
editable: boolean;
|
|
30
|
+
required: boolean;
|
|
31
|
+
group: string;
|
|
32
|
+
};
|
|
33
|
+
autoplay: {
|
|
34
|
+
label: string;
|
|
35
|
+
description: string;
|
|
36
|
+
formType: string;
|
|
37
|
+
propType: string;
|
|
38
|
+
defaultValue: boolean;
|
|
39
|
+
editable: boolean;
|
|
40
|
+
required: boolean;
|
|
41
|
+
group: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -49,3 +49,4 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
|
|
|
49
49
|
export { default as Slider } from "./components/Slider";
|
|
50
50
|
export { default as Stepper } from "./components/Stepper";
|
|
51
51
|
export { useAuthState } from "./components/useAuthState";
|
|
52
|
+
export { default as Youtube } from "./components/Youtube";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const SEED_DATA: {
|
|
2
|
+
name: string;
|
|
3
|
+
tag: string;
|
|
4
|
+
description: string;
|
|
5
|
+
doc_link: string;
|
|
6
|
+
code_link: string;
|
|
7
|
+
category: string;
|
|
8
|
+
stylesPanelSections: string[];
|
|
9
|
+
layout: {
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
props: {
|
|
13
|
+
videoId: any;
|
|
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
|
+
autoplay: {
|
|
26
|
+
label: string;
|
|
27
|
+
description: string;
|
|
28
|
+
formType: string;
|
|
29
|
+
propType: string;
|
|
30
|
+
defaultValue: boolean;
|
|
31
|
+
editable: boolean;
|
|
32
|
+
required: boolean;
|
|
33
|
+
group: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.2.4-
|
|
3
|
+
"version": "46.2.4-d5a19a.11+d5a19a35",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
48
48
|
"@react-native-picker/picker": "2.4.2",
|
|
49
|
-
"@shopify/flash-list": "
|
|
49
|
+
"@shopify/flash-list": "1.2.0",
|
|
50
50
|
"color": "^3.1.2",
|
|
51
51
|
"date-fns": "^2.16.1",
|
|
52
52
|
"dateformat": "^3.0.3",
|
|
@@ -56,7 +56,9 @@
|
|
|
56
56
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
57
57
|
"react-native-svg": "12.3.0",
|
|
58
58
|
"react-native-typography": "^1.4.1",
|
|
59
|
-
"react-native-web-swiper": "^2.2.3"
|
|
59
|
+
"react-native-web-swiper": "^2.2.3",
|
|
60
|
+
"react-native-web-webview": "^1.0.2",
|
|
61
|
+
"react-native-youtube-iframe": "^2.2.2"
|
|
60
62
|
},
|
|
61
63
|
"devDependencies": {
|
|
62
64
|
"@types/color": "^3.0.1",
|
|
@@ -81,5 +83,5 @@
|
|
|
81
83
|
]
|
|
82
84
|
]
|
|
83
85
|
},
|
|
84
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "d5a19a35c61087cef1266640e6803fed1df84272"
|
|
85
87
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createBoolProp, createTextProp, } from "@draftbit/types";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import YoutubePlayer from "react-native-youtube-iframe";
|
|
4
|
+
import { extractStyles } from "../utilities";
|
|
5
|
+
const Youtube = ({ videoId, playlist, style, mute, autoplay }) => {
|
|
6
|
+
const { viewStyles: { height, width }, } = extractStyles(style);
|
|
7
|
+
return (React.createElement(YoutubePlayer, { height: height, width: width, play: autoplay, videoId: videoId, playList: playlist, mute: mute }));
|
|
8
|
+
};
|
|
9
|
+
export default Youtube;
|
|
10
|
+
export const SEED_DATA = {
|
|
11
|
+
name: "Youtube",
|
|
12
|
+
tag: "Youtube",
|
|
13
|
+
description: "Youtube Component",
|
|
14
|
+
category: COMPONENT_TYPES.media,
|
|
15
|
+
layout: {
|
|
16
|
+
width: "100%",
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
videoId: createTextProp({
|
|
20
|
+
label: "VideoId",
|
|
21
|
+
description: "Youtube Video ID",
|
|
22
|
+
}),
|
|
23
|
+
playlist: createTextProp({
|
|
24
|
+
label: "PlayList",
|
|
25
|
+
description: "Playlist ID",
|
|
26
|
+
}),
|
|
27
|
+
mute: createBoolProp({
|
|
28
|
+
label: "Mute",
|
|
29
|
+
description: "Whether to mute video",
|
|
30
|
+
defaultValue: false,
|
|
31
|
+
}),
|
|
32
|
+
autoplay: createBoolProp({
|
|
33
|
+
label: "Autoplay",
|
|
34
|
+
description: "Whether to Autoplay video",
|
|
35
|
+
defaultValue: false,
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createBoolProp,
|
|
4
|
+
createTextProp,
|
|
5
|
+
} from "@draftbit/types";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
8
|
+
import YoutubePlayer from "react-native-youtube-iframe";
|
|
9
|
+
import { extractStyles } from "../utilities";
|
|
10
|
+
|
|
11
|
+
type Props = {
|
|
12
|
+
videoId: string;
|
|
13
|
+
playlist: string;
|
|
14
|
+
style: StyleProp<ViewStyle>;
|
|
15
|
+
mute: boolean;
|
|
16
|
+
autoplay: boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const Youtube = ({ videoId, playlist, style, mute, autoplay }: Props) => {
|
|
20
|
+
const {
|
|
21
|
+
viewStyles: { height, width },
|
|
22
|
+
} = extractStyles(style);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<YoutubePlayer
|
|
26
|
+
height={height}
|
|
27
|
+
width={width}
|
|
28
|
+
play={autoplay}
|
|
29
|
+
videoId={videoId}
|
|
30
|
+
playList={playlist}
|
|
31
|
+
mute={mute}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default Youtube;
|
|
37
|
+
|
|
38
|
+
export const SEED_DATA = {
|
|
39
|
+
name: "Youtube",
|
|
40
|
+
tag: "Youtube",
|
|
41
|
+
description: "Youtube Component",
|
|
42
|
+
category: COMPONENT_TYPES.media,
|
|
43
|
+
layout: {
|
|
44
|
+
width: "100%",
|
|
45
|
+
},
|
|
46
|
+
props: {
|
|
47
|
+
videoId: createTextProp({
|
|
48
|
+
label: "VideoId",
|
|
49
|
+
description: "Youtube Video ID",
|
|
50
|
+
}),
|
|
51
|
+
playlist: createTextProp({
|
|
52
|
+
label: "PlayList",
|
|
53
|
+
description: "Playlist ID",
|
|
54
|
+
}),
|
|
55
|
+
mute: createBoolProp({
|
|
56
|
+
label: "Mute",
|
|
57
|
+
description: "Whether to mute video",
|
|
58
|
+
defaultValue: false,
|
|
59
|
+
}),
|
|
60
|
+
autoplay: createBoolProp({
|
|
61
|
+
label: "Autoplay",
|
|
62
|
+
description: "Whether to Autoplay video",
|
|
63
|
+
defaultValue: false,
|
|
64
|
+
}),
|
|
65
|
+
},
|
|
66
|
+
};
|
package/src/index.js
CHANGED
|
@@ -50,4 +50,5 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
|
|
|
50
50
|
export { default as Slider } from "./components/Slider";
|
|
51
51
|
export { default as Stepper } from "./components/Stepper";
|
|
52
52
|
export { useAuthState } from "./components/useAuthState";
|
|
53
|
+
export { default as Youtube } from "./components/Youtube";
|
|
53
54
|
// a comment to fix sourcemap comment issue
|
package/src/index.tsx
CHANGED
|
@@ -70,5 +70,6 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
|
|
|
70
70
|
export { default as Slider } from "./components/Slider";
|
|
71
71
|
export { default as Stepper } from "./components/Stepper";
|
|
72
72
|
export { useAuthState } from "./components/useAuthState";
|
|
73
|
+
export { default as Youtube } from "./components/Youtube";
|
|
73
74
|
|
|
74
75
|
// a comment to fix sourcemap comment issue
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, createTextProp, StylesPanelSections, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Youtube",
|
|
4
|
+
tag: "Youtube",
|
|
5
|
+
description: "Given a VideoId orPlaylist and play Youtube video",
|
|
6
|
+
doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
|
|
7
|
+
code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
|
|
8
|
+
category: COMPONENT_TYPES.media,
|
|
9
|
+
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Position],
|
|
10
|
+
layout: {
|
|
11
|
+
height: 250,
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
videoId: createTextProp({
|
|
15
|
+
label: "Video ID",
|
|
16
|
+
description: "VideoId of the Youtube video.",
|
|
17
|
+
defaultValue: "nwMUpDESXrI",
|
|
18
|
+
}),
|
|
19
|
+
playlist: createTextProp({
|
|
20
|
+
label: "Playlist",
|
|
21
|
+
description: "Playlist of the Youtube videos.",
|
|
22
|
+
defaultValue: "PLUa6TiXzjIrwowt6P-uGCJm8ovm-9S1Ks",
|
|
23
|
+
}),
|
|
24
|
+
mute: createStaticBoolProp({
|
|
25
|
+
label: "Mute Audio",
|
|
26
|
+
description: "Mute the audio of the video.",
|
|
27
|
+
}),
|
|
28
|
+
autoplay: createStaticBoolProp({
|
|
29
|
+
label: "Auto Play",
|
|
30
|
+
description: "Autoplay the video on load.",
|
|
31
|
+
}),
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createStaticBoolProp,
|
|
4
|
+
createTextProp,
|
|
5
|
+
StylesPanelSections,
|
|
6
|
+
} from "@draftbit/types";
|
|
7
|
+
|
|
8
|
+
export const SEED_DATA = {
|
|
9
|
+
name: "Youtube",
|
|
10
|
+
tag: "Youtube",
|
|
11
|
+
description: "Given a VideoId orPlaylist and play Youtube video",
|
|
12
|
+
doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
|
|
13
|
+
code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
|
|
14
|
+
category: COMPONENT_TYPES.media,
|
|
15
|
+
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Position],
|
|
16
|
+
layout: {
|
|
17
|
+
height: 250,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
videoId: createTextProp({
|
|
21
|
+
label: "Video ID",
|
|
22
|
+
description: "VideoId of the Youtube video.",
|
|
23
|
+
defaultValue: "nwMUpDESXrI",
|
|
24
|
+
}),
|
|
25
|
+
playlist: createTextProp({
|
|
26
|
+
label: "Playlist",
|
|
27
|
+
description: "Playlist of the Youtube videos.",
|
|
28
|
+
defaultValue: "PLUa6TiXzjIrwowt6P-uGCJm8ovm-9S1Ks",
|
|
29
|
+
}),
|
|
30
|
+
mute: createStaticBoolProp({
|
|
31
|
+
label: "Mute Audio",
|
|
32
|
+
description: "Mute the audio of the video.",
|
|
33
|
+
}),
|
|
34
|
+
autoplay: createStaticBoolProp({
|
|
35
|
+
label: "Auto Play",
|
|
36
|
+
description: "Autoplay the video on load.",
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
};
|