@draftbit/core 46.2.4-a572b7.5 → 46.2.4-b5dfee.10

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.
Files changed (57) hide show
  1. package/lib/commonjs/components/AnimatedCircularProgress.js +2 -12
  2. package/lib/commonjs/components/Banner.js +4 -24
  3. package/lib/commonjs/components/CardBlock.js +5 -15
  4. package/lib/commonjs/components/CardContainer.js +5 -15
  5. package/lib/commonjs/components/CardContainerRating.js +5 -15
  6. package/lib/commonjs/components/CardContainerShortImage.js +5 -17
  7. package/lib/commonjs/components/Carousel.js +10 -34
  8. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +6 -24
  9. package/lib/commonjs/components/Checkbox/context.js +1 -1
  10. package/lib/commonjs/components/CircleImage.js +2 -16
  11. package/lib/commonjs/components/CircularProgress.js +7 -15
  12. package/lib/commonjs/components/Container.js +5 -17
  13. package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -17
  14. package/lib/commonjs/components/DeprecatedFAB.js +4 -22
  15. package/lib/commonjs/components/Elevation.js +3 -15
  16. package/lib/commonjs/components/FAB.js +5 -20
  17. package/lib/commonjs/components/FormRow.js +3 -17
  18. package/lib/commonjs/components/Image.js +3 -16
  19. package/lib/commonjs/components/NumberInput.js +2 -13
  20. package/lib/commonjs/components/Picker/PickerComponent.ios.js +13 -42
  21. package/lib/commonjs/components/Portal/PortalHost.js +15 -27
  22. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +3 -16
  23. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +6 -24
  24. package/lib/commonjs/components/ScreenContainer.js +5 -23
  25. package/lib/commonjs/components/Slider.js +5 -24
  26. package/lib/commonjs/components/StarRating.js +5 -25
  27. package/lib/commonjs/components/Surface.js +3 -14
  28. package/lib/commonjs/components/Text.js +11 -37
  29. package/lib/commonjs/components/TextField.js +30 -63
  30. package/lib/commonjs/components/Touchable.js +2 -16
  31. package/lib/commonjs/components/Youtube.js +73 -0
  32. package/lib/commonjs/index.js +8 -0
  33. package/lib/commonjs/mappings/SVG.js +1 -2
  34. package/lib/commonjs/mappings/Youtube.js +42 -0
  35. package/lib/module/components/Picker/PickerComponent.android.js +5 -23
  36. package/lib/module/components/ProgressBar.js +7 -23
  37. package/lib/module/components/Surface.js +2 -16
  38. package/lib/module/components/Youtube.js +59 -0
  39. package/lib/module/constants.js +1 -0
  40. package/lib/module/index.js +2 -1
  41. package/lib/module/mappings/SVG.js +2 -3
  42. package/lib/module/mappings/Youtube.js +33 -0
  43. package/lib/typescript/src/components/SVG.d.ts +2 -2
  44. package/lib/typescript/src/components/Youtube.d.ts +44 -0
  45. package/lib/typescript/src/index.d.ts +1 -0
  46. package/lib/typescript/src/mappings/SVG.d.ts +0 -1
  47. package/lib/typescript/src/mappings/Youtube.d.ts +36 -0
  48. package/package.json +7 -5
  49. package/src/components/SVG.tsx +2 -2
  50. package/src/components/Youtube.js +38 -0
  51. package/src/components/Youtube.tsx +66 -0
  52. package/src/index.js +1 -0
  53. package/src/index.tsx +1 -0
  54. package/src/mappings/SVG.js +2 -3
  55. package/src/mappings/SVG.ts +2 -3
  56. package/src/mappings/Youtube.js +33 -0
  57. package/src/mappings/Youtube.ts +39 -0
@@ -15,7 +15,17 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
15
15
 
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
17
 
18
+ 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); }
19
+
20
+ 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; }
21
+
18
22
  class Text extends React.Component {
23
+ constructor() {
24
+ super(...arguments);
25
+
26
+ _defineProperty(this, "_root", void 0);
27
+ }
28
+
19
29
  setNativeProps(args) {
20
30
  return this._root && this._root.setNativeProps(args);
21
31
  }
@@ -26,43 +36,7 @@ class Text extends React.Component {
26
36
  ...rest
27
37
  } = this.props;
28
38
  const writingDirection = _reactNative.I18nManager.isRTL ? "rtl" : "ltr";
29
- return /*#__PURE__*/React.createElement(_reactNative.Text, { ...rest,
30
- ref: c => {
31
- this._root = c;
32
- },
33
- style: [{
34
- textAlign: "left",
35
- writingDirection
36
- }, style]
37
- });
38
- }
39
-
40
- }
41
-
42
- const BaseLink = _ref => {
43
- let {
44
- style,
45
- theme,
46
- title,
47
- ...props
48
- } = _ref;
49
- return /*#__PURE__*/React.createElement(Text, {
50
- hitSlop: 8,
51
- style: [{
52
- color: theme.colors.primary
53
- }, style],
54
- theme: theme,
55
- ...props
56
- }, title);
57
- };
58
-
59
- exports.BaseLink = BaseLink;
60
- const Link = (0, _theming.withTheme)(BaseLink);
61
- exports.Link = Link;
62
-
63
- var _default = (0, _theming.withTheme)(Text);
64
-
65
- exports.default = _default;/React.createElement(_reactNative.Text, _extends({}, rest, {
39
+ return /*#__PURE__*/React.createElement(_reactNative.Text, _extends({}, rest, {
66
40
  ref: c => {
67
41
  this._root = c;
68
42
  },
@@ -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
- this.state = {
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
- this._timer = setTimeout(() => {}, 0);
42
+ });
43
+
44
+ _defineProperty(this, "_timer", setTimeout(() => {}, 0));
39
45
 
40
- this._showPlaceholder = () => {
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._hidePlaceholder = () => this.setState({
55
+ _defineProperty(this, "_hidePlaceholder", () => this.setState({
50
56
  placeholder: ""
51
- });
57
+ }));
52
58
 
53
- this._restoreLabel = () => _reactNative.Animated.timing(this.state.labeled, {
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._minmizeLabel = () => _reactNative.Animated.timing(this.state.labeled, {
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._handleFocus = () => {
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._handleBlur = () => {
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._handleChangeText = value => {
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._root = undefined;
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, { ...props
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, { ...leftIconProps,
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, { ...leftIconProps,
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"
@@ -11,6 +11,8 @@ var _reactNative = require("react-native");
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
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
16
  function Touchable(_ref) {
15
17
  let {
16
18
  children,
@@ -19,22 +21,6 @@ function Touchable(_ref) {
19
21
  style,
20
22
  ...props
21
23
  } = _ref;
22
- return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
23
- onPress: onPress,
24
- disabled: disabled,
25
- hitSlop: 8,
26
- style: _ref2 => {
27
- let {
28
- pressed
29
- } = _ref2;
30
- return [{
31
- opacity: pressed || disabled ? 0.75 : 1
32
- }, style];
33
- },
34
- ...props
35
- }, children);
36
- }rops
37
- } = _ref;
38
24
  return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
39
25
  onPress: onPress,
40
26
  disabled: disabled,
@@ -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;
@@ -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; }
@@ -11,7 +11,6 @@ const SEED_DATA = {
11
11
  name: "SVG",
12
12
  tag: "SVG",
13
13
  description: "An SVG component",
14
- packageName: "@draftbit/core",
15
14
  category: _types.COMPONENT_TYPES.media,
16
15
  layout: {
17
16
  width: 100,
@@ -19,7 +18,7 @@ const SEED_DATA = {
19
18
  },
20
19
  stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
21
20
  props: {
22
- source: (0, _types.createSvgProp)()
21
+ source: (0, _types.createSVGProp)()
23
22
  }
24
23
  };
25
24
  exports.SEED_DATA = SEED_DATA;
@@ -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],
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;
@@ -1,3 +1,5 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
1
3
  import * as React from "react";
2
4
  import { View, StyleSheet } from "react-native";
3
5
  import omit from "lodash.omit";
@@ -8,6 +10,8 @@ import TextField from "../TextField";
8
10
  import Touchable from "../Touchable";
9
11
 
10
12
  const Picker = _ref => {
13
+ var _options$find$label, _options$find;
14
+
11
15
  let {
12
16
  style,
13
17
  options,
@@ -17,9 +21,6 @@ const Picker = _ref => {
17
21
  onValueChange: onValueChangeOverride = () => {},
18
22
  ...props
19
23
  } = _ref;
20
-
21
- var _a, _b;
22
-
23
24
  const {
24
25
  viewStyles: {
25
26
  borderRadius,
@@ -66,7 +67,7 @@ const Picker = _ref => {
66
67
  };
67
68
 
68
69
  const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
69
- const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
70
+ const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
70
71
  return /*#__PURE__*/React.createElement(Touchable, {
71
72
  disabled: disabled,
72
73
  onPress: toggleFocus,
@@ -88,25 +89,6 @@ const Picker = _ref => {
88
89
  label: o.label,
89
90
  value: o.value,
90
91
  key: o.value
91
- }))), /*#__PURE__*/React.createElement(View, {
92
- pointerEvents: "none"
93
- }, /*#__PURE__*/React.createElement(TextField, { ...props,
94
- value: selectedLabel,
95
- placeholder: placeholder,
96
- // @ts-ignore
97
- ref: textField,
98
- disabled: disabled,
99
- // @ts-expect-error
100
- style: stylesWithoutMargin
101
- }))));
102
- };
103
-
104
- const styles = StyleSheet.create({
105
- container: {
106
- alignSelf: "stretch"
107
- }
108
- });
109
- export default withTheme(Picker); key: o.value
110
92
  }))), /*#__PURE__*/React.createElement(View, {
111
93
  pointerEvents: "none"
112
94
  }, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
@@ -1,3 +1,7 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ 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; }
4
+
1
5
  import React, { Component } from "react";
2
6
  import { Animated, Easing, View, I18nManager } from "react-native";
3
7
  const INDETERMINATE_WIDTH_FACTOR = 0.3;
@@ -6,7 +10,7 @@ export default class ProgressBar extends Component {
6
10
  constructor(props) {
7
11
  super(props);
8
12
 
9
- this.handleLayout = event => {
13
+ _defineProperty(this, "handleLayout", event => {
10
14
  const {
11
15
  width = 150,
12
16
  onLayout
@@ -21,7 +25,7 @@ export default class ProgressBar extends Component {
21
25
  if (onLayout) {
22
26
  onLayout(event);
23
27
  }
24
- };
28
+ });
25
29
 
26
30
  const {
27
31
  progress: progressP = 0,
@@ -75,6 +79,7 @@ export default class ProgressBar extends Component {
75
79
  Animated[animationType](this.state.progress, { ...animationConfig,
76
80
  toValue: progress,
77
81
  velocity: 0,
82
+ //adjust this value if animation fails - velocity is required
78
83
  useNativeDriver
79
84
  }).start();
80
85
  } else {
@@ -145,27 +150,6 @@ export default class ProgressBar extends Component {
145
150
  })
146
151
  }]
147
152
  };
148
- return /*#__PURE__*/React.createElement(View, {
149
- style: [containerStyle, style],
150
- onLayout: this.handleLayout,
151
- ...restProps
152
- }, /*#__PURE__*/React.createElement(Animated.View, {
153
- style: progressStyle
154
- }), children);
155
- }
156
-
157
- }te.progress.interpolate({
158
- inputRange: [0, 1],
159
- outputRange: [innerWidth / (I18nManager.isRTL ? 2 : -2), 0]
160
- })
161
- }, {
162
- // Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
163
- scaleX: this.state.progress.interpolate({
164
- inputRange: [0, 1],
165
- outputRange: [0.0001, 1]
166
- })
167
- }]
168
- };
169
153
  return /*#__PURE__*/React.createElement(View, _extends({
170
154
  style: [containerStyle, style],
171
155
  onLayout: this.handleLayout
@@ -1,3 +1,5 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
1
3
  /* Copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx */
2
4
  import * as React from "react";
3
5
  import { Animated, StyleSheet } from "react-native";
@@ -36,22 +38,6 @@ const Surface = _ref => {
36
38
  }
37
39
  };
38
40
 
39
- return /*#__PURE__*/React.createElement(Animated.View, { ...rest,
40
- style: [{
41
- backgroundColor: getBackgroundColor(),
42
- elevation,
43
- ...evalationStyles,
44
- ...restStyle
45
- }]
46
- }, children);
47
- };
48
-
49
- export default withTheme(Surface); overlay(elevation, colors.surface);
50
- } else {
51
- return colors.surface;
52
- }
53
- };
54
-
55
41
  return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
56
42
  style: [{
57
43
  backgroundColor: getBackgroundColor(),
@@ -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
+ };
@@ -5,4 +5,5 @@ const DEFAULT_STATUSBAR_HEIGHT_EXPO = expo !== null && expo !== void 0 && expo.C
5
5
  export const APPROX_STATUSBAR_HEIGHT = Platform.select({
6
6
  android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
7
7
  ios: Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
8
+ });PO : 0
8
9
  });
@@ -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"; // a comment to fix sourcemap comment issue
53
+ export { useAuthState } from "./components/useAuthState";
54
+ export { default as Youtube } from "./components/Youtube"; // a comment to fix sourcemap comment issue