@draftbit/core 46.10.2-078a87.2 → 46.10.2-14170b.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.
Files changed (50) hide show
  1. package/lib/commonjs/components/Checkbox/context.js +1 -1
  2. package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.js +40 -0
  3. package/lib/commonjs/components/{YotubePlayer.js → YoutubePlayer/YoutubePlayer.native.js} +4 -10
  4. package/lib/commonjs/components/YoutubePlayer/YoutubePlayerProps.js +5 -0
  5. package/lib/commonjs/components/YoutubePlayer/index.js +13 -0
  6. package/lib/commonjs/index.js +2 -2
  7. package/lib/commonjs/mappings/NativeBase/Layout.js +4 -5
  8. package/lib/commonjs/mappings/YoutubePlayer.js +0 -6
  9. package/lib/module/components/YoutubePlayer/YoutubePlayer.js +32 -0
  10. package/lib/module/components/YoutubePlayer/YoutubePlayer.native.js +24 -0
  11. package/lib/module/components/YoutubePlayer/YoutubePlayerProps.js +1 -0
  12. package/lib/module/components/YoutubePlayer/index.js +1 -0
  13. package/lib/module/hooks.js +1 -2
  14. package/lib/module/index.js +1 -1
  15. package/lib/module/mappings/NativeBase/Layout.js +5 -6
  16. package/lib/module/mappings/YoutubePlayer.js +0 -6
  17. package/lib/typescript/src/components/YoutubePlayer/YoutubePlayer.d.ts +5 -0
  18. package/lib/typescript/src/components/YoutubePlayer/YoutubePlayer.d.ts.map +1 -0
  19. package/lib/typescript/src/components/YoutubePlayer/YoutubePlayer.native.d.ts +5 -0
  20. package/lib/typescript/src/components/YoutubePlayer/YoutubePlayer.native.d.ts.map +1 -0
  21. package/lib/typescript/src/components/YoutubePlayer/YoutubePlayerProps.d.ts +8 -0
  22. package/lib/typescript/src/components/YoutubePlayer/YoutubePlayerProps.d.ts.map +1 -0
  23. package/lib/typescript/src/components/YoutubePlayer/index.d.ts +2 -0
  24. package/lib/typescript/src/components/YoutubePlayer/index.d.ts.map +1 -0
  25. package/lib/typescript/src/index.d.ts +1 -1
  26. package/lib/typescript/src/index.d.ts.map +1 -1
  27. package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +11 -1
  28. package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -1
  29. package/lib/typescript/src/mappings/YoutubePlayer.d.ts +0 -10
  30. package/lib/typescript/src/mappings/YoutubePlayer.d.ts.map +1 -1
  31. package/package.json +5 -5
  32. package/src/components/YoutubePlayer/YoutubePlayer.js +20 -0
  33. package/src/components/YoutubePlayer/YoutubePlayer.native.js +9 -0
  34. package/src/components/YoutubePlayer/YoutubePlayer.native.tsx +27 -0
  35. package/src/components/YoutubePlayer/YoutubePlayer.tsx +36 -0
  36. package/src/components/YoutubePlayer/YoutubePlayerProps.js +1 -0
  37. package/src/components/YoutubePlayer/YoutubePlayerProps.ts +8 -0
  38. package/src/components/YoutubePlayer/index.js +1 -0
  39. package/src/components/YoutubePlayer/index.ts +1 -0
  40. package/src/index.js +1 -1
  41. package/src/index.tsx +1 -1
  42. package/src/mappings/NativeBase/Layout.js +5 -6
  43. package/src/mappings/NativeBase/Layout.ts +6 -7
  44. package/src/mappings/YoutubePlayer.js +0 -6
  45. package/src/mappings/YoutubePlayer.ts +0 -6
  46. package/lib/module/components/YotubePlayer.js +0 -30
  47. package/lib/typescript/src/components/YotubePlayer.d.ts +0 -12
  48. package/lib/typescript/src/components/YotubePlayer.d.ts.map +0 -1
  49. package/src/components/YotubePlayer.js +0 -10
  50. package/src/components/YotubePlayer.tsx +0 -38
@@ -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
- var Direction;
9
+ let Direction;
10
10
  exports.Direction = Direction;
11
11
  (function (Direction) {
12
12
  Direction["Horizontal"] = "horizontal";
@@ -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("../utilities");
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
- height: height,
29
- width: width,
23
+ width: viewStyles.width,
24
+ height: viewStyles.height,
30
25
  play: autoplay,
31
26
  videoId: !videoId && !playlist ? defaultVideoId : videoId,
32
27
  playList: playlist,
33
- mute: mute,
34
- webViewStyle: style
28
+ webViewStyle: viewStyles
35
29
  });
36
30
  };
37
31
  var _default = YoutubePlayer;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -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 }; }
@@ -378,7 +378,7 @@ Object.defineProperty(exports, "Touchable", {
378
378
  Object.defineProperty(exports, "YoutubePlayer", {
379
379
  enumerable: true,
380
380
  get: function () {
381
- return _YotubePlayer.default;
381
+ return _YoutubePlayer.YoutubePlayer;
382
382
  }
383
383
  });
384
384
  Object.defineProperty(exports, "injectIcon", {
@@ -436,7 +436,7 @@ var _DeckSwiper = require("./components/DeckSwiper");
436
436
  var _TabView = require("./components/TabView");
437
437
  var _Markdown = _interopRequireDefault(require("./components/Markdown"));
438
438
  var _BottomSheet = require("./components/BottomSheet");
439
- var _YotubePlayer = _interopRequireDefault(require("./components/YotubePlayer"));
439
+ var _YoutubePlayer = require("./components/YoutubePlayer");
440
440
  var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
441
441
  var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
442
442
  var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
@@ -13,14 +13,13 @@ const SHARED_SEED_DATA = {
13
13
  const SEED_DATA = [{
14
14
  name: "Aspect Ratio",
15
15
  tag: "AspectRatio",
16
- description: "Controls the size of the undefined dimension of a node or child component using an aspect ration",
16
+ description: "Controls the size of the undefined dimension of a node or child component using an aspect ratio",
17
17
  ...SHARED_SEED_DATA,
18
18
  props: {
19
- ratio: (0, _types.createTextProp)({
19
+ ratio: (0, _types.createStaticNumberProp)({
20
20
  label: "Ratio",
21
- description: "The aspect ratio of the container",
22
- defaultValue: "4/3",
23
- group: _types.GROUPS.basic
21
+ description: "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
22
+ defaultValue: 1.33
24
23
  })
25
24
  }
26
25
  }, {
@@ -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.",
@@ -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 { default as YoutubePlayer } from "./YoutubePlayer";
@@ -3,12 +3,11 @@ export function usePrevious(value) {
3
3
  // The ref object is a generic container whose current property is mutable
4
4
  // and can hold any value, similar to an instance property on a class
5
5
  const ref = React.useRef();
6
-
7
6
  // Store current value in ref
8
7
  React.useEffect(() => {
9
8
  ref.current = value;
10
9
  }, [value]);
11
-
12
10
  // Return previous value (happens before update in useEffect above)
13
11
  return ref.current;
12
+ }
14
13
  }
@@ -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 { default as YoutubePlayer } from "./components/YotubePlayer";
39
+ export { YoutubePlayer } from "./components/YoutubePlayer";
40
40
 
41
41
  /* Deprecated: Fix or Delete! */
42
42
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createTextEnumProp, createBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, createTextProp, GROUPS } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createTextEnumProp, createBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, createStaticNumberProp } from "@draftbit/types";
2
2
  const SHARED_SEED_DATA = {
3
3
  category: COMPONENT_TYPES.layout,
4
4
  packageName: "native-base",
@@ -7,14 +7,13 @@ const SHARED_SEED_DATA = {
7
7
  export const SEED_DATA = [{
8
8
  name: "Aspect Ratio",
9
9
  tag: "AspectRatio",
10
- description: "Controls the size of the undefined dimension of a node or child component using an aspect ration",
10
+ description: "Controls the size of the undefined dimension of a node or child component using an aspect ratio",
11
11
  ...SHARED_SEED_DATA,
12
12
  props: {
13
- ratio: createTextProp({
13
+ ratio: createStaticNumberProp({
14
14
  label: "Ratio",
15
- description: "The aspect ratio of the container",
16
- defaultValue: "4/3",
17
- group: GROUPS.basic
15
+ description: "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
16
+ defaultValue: 1.33
18
17
  })
19
18
  }
20
19
  }, {
@@ -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,5 @@
1
+ import React from "react";
2
+ import { YoutubePlayerProps } from "./YoutubePlayerProps";
3
+ declare const YoutubePlayer: React.FC<YoutubePlayerProps>;
4
+ export default YoutubePlayer;
5
+ //# sourceMappingURL=YoutubePlayer.d.ts.map
@@ -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,5 @@
1
+ import React from "react";
2
+ import { YoutubePlayerProps } from "./YoutubePlayerProps";
3
+ declare const YoutubePlayer: React.FC<YoutubePlayerProps>;
4
+ export default YoutubePlayer;
5
+ //# sourceMappingURL=YoutubePlayer.native.d.ts.map
@@ -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,8 @@
1
+ import { StyleProp, ViewStyle } from "react-native";
2
+ export interface YoutubePlayerProps {
3
+ videoId?: string;
4
+ playlist?: string;
5
+ autoplay?: boolean;
6
+ style?: StyleProp<ViewStyle>;
7
+ }
8
+ //# sourceMappingURL=YoutubePlayerProps.d.ts.map
@@ -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,2 @@
1
+ export { default as YoutubePlayer } from "./YoutubePlayer";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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 { default as YoutubePlayer } from "./components/YotubePlayer";
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,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI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AAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,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"}
@@ -1,6 +1,16 @@
1
1
  export declare const SEED_DATA: ({
2
2
  props: {
3
- ratio: any;
3
+ ratio: {
4
+ label: string;
5
+ description: string;
6
+ formType: string;
7
+ propType: string;
8
+ group: string;
9
+ defaultValue: null;
10
+ editable: boolean;
11
+ required: boolean;
12
+ step: number;
13
+ };
4
14
  direction?: undefined;
5
15
  reversed?: undefined;
6
16
  isDisabled?: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../../src/mappings/NativeBase/Layout.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqGrB,CAAC"}
1
+ {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../../src/mappings/NativeBase/Layout.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqGrB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCrB,CAAC"}
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-078a87.2+078a874",
3
+ "version": "46.10.2-14170b.2+14170b2",
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-078a87.2+078a874",
44
+ "@draftbit/types": "^46.10.2-14170b.2+14170b2",
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-web-webview": "^1.0.2",
68
- "react-native-youtube-iframe": "^2.2.2"
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": "078a874dab9ed643b296fad0dde629918e0cb8be"
103
+ "gitHead": "14170b2dfbfa58ed0f17e7307b0eb8d8f97a5f59"
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,8 @@
1
+ import { StyleProp, ViewStyle } from "react-native";
2
+
3
+ export interface YoutubePlayerProps {
4
+ videoId?: string;
5
+ playlist?: string;
6
+ autoplay?: boolean;
7
+ style?: StyleProp<ViewStyle>;
8
+ }
@@ -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 { default as YoutubePlayer } from "./components/YotubePlayer";
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 { default as YoutubePlayer } from "./components/YotubePlayer";
63
+ export { YoutubePlayer } from "./components/YoutubePlayer";
64
64
 
65
65
  /* Deprecated: Fix or Delete! */
66
66
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createTextEnumProp, createBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, createTextProp, GROUPS, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createTextEnumProp, createBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, createStaticNumberProp, } from "@draftbit/types";
2
2
  const SHARED_SEED_DATA = {
3
3
  category: COMPONENT_TYPES.layout,
4
4
  packageName: "native-base",
@@ -8,14 +8,13 @@ export const SEED_DATA = [
8
8
  {
9
9
  name: "Aspect Ratio",
10
10
  tag: "AspectRatio",
11
- description: "Controls the size of the undefined dimension of a node or child component using an aspect ration",
11
+ description: "Controls the size of the undefined dimension of a node or child component using an aspect ratio",
12
12
  ...SHARED_SEED_DATA,
13
13
  props: {
14
- ratio: createTextProp({
14
+ ratio: createStaticNumberProp({
15
15
  label: "Ratio",
16
- description: "The aspect ratio of the container",
17
- defaultValue: "4/3",
18
- group: GROUPS.basic,
16
+ description: "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
17
+ defaultValue: 1.33,
19
18
  }),
20
19
  },
21
20
  },
@@ -3,8 +3,7 @@ import {
3
3
  createTextEnumProp,
4
4
  createBoolProp,
5
5
  CONTAINER_COMPONENT_STYLES_SECTIONS,
6
- createTextProp,
7
- GROUPS,
6
+ createStaticNumberProp,
8
7
  } from "@draftbit/types";
9
8
 
10
9
  const SHARED_SEED_DATA = {
@@ -18,14 +17,14 @@ export const SEED_DATA = [
18
17
  name: "Aspect Ratio",
19
18
  tag: "AspectRatio",
20
19
  description:
21
- "Controls the size of the undefined dimension of a node or child component using an aspect ration",
20
+ "Controls the size of the undefined dimension of a node or child component using an aspect ratio",
22
21
  ...SHARED_SEED_DATA,
23
22
  props: {
24
- ratio: createTextProp({
23
+ ratio: createStaticNumberProp({
25
24
  label: "Ratio",
26
- description: "The aspect ratio of the container",
27
- defaultValue: "4/3",
28
- group: GROUPS.basic,
25
+ description:
26
+ "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
27
+ defaultValue: 1.33,
29
28
  }),
30
29
  },
31
30
  },
@@ -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;