@draftbit/core 46.9.1-e3cd31.2 → 46.9.1-f483d0.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 (58) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +4 -23
  2. package/lib/commonjs/components/CircleImage.js +1 -15
  3. package/lib/commonjs/components/Picker/Picker.js +13 -3
  4. package/lib/commonjs/components/YotubePlayer.js +38 -0
  5. package/lib/commonjs/index.js +7 -0
  6. package/lib/commonjs/mappings/ActionSheet.js +1 -1
  7. package/lib/commonjs/mappings/ActionSheetCancel.js +1 -1
  8. package/lib/commonjs/mappings/ActionSheetItem.js +1 -1
  9. package/lib/commonjs/mappings/BottomSheet.js +1 -5
  10. package/lib/commonjs/mappings/MapCallout.js +1 -1
  11. package/lib/commonjs/mappings/MapMarker.js +1 -1
  12. package/lib/commonjs/mappings/YoutubePlayer.js +44 -0
  13. package/lib/module/components/FormRow.js +4 -4
  14. package/lib/module/components/Picker/Picker.js +13 -3
  15. package/lib/module/components/YotubePlayer.js +30 -0
  16. package/lib/module/index.js +1 -0
  17. package/lib/module/mappings/ActionSheet.js +1 -1
  18. package/lib/module/mappings/ActionSheetCancel.js +1 -1
  19. package/lib/module/mappings/ActionSheetItem.js +1 -1
  20. package/lib/module/mappings/BottomSheet.js +2 -6
  21. package/lib/module/mappings/MapCallout.js +2 -2
  22. package/lib/module/mappings/MapMarker.js +2 -2
  23. package/lib/module/mappings/YoutubePlayer.js +37 -0
  24. package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
  25. package/lib/typescript/src/components/YotubePlayer.d.ts +12 -0
  26. package/lib/typescript/src/components/YotubePlayer.d.ts.map +1 -0
  27. package/lib/typescript/src/index.d.ts +1 -0
  28. package/lib/typescript/src/index.d.ts.map +1 -1
  29. package/lib/typescript/src/mappings/ActionSheet.d.ts.map +1 -1
  30. package/lib/typescript/src/mappings/ActionSheetCancel.d.ts.map +1 -1
  31. package/lib/typescript/src/mappings/ActionSheetItem.d.ts.map +1 -1
  32. package/lib/typescript/src/mappings/BottomSheet.d.ts +0 -4
  33. package/lib/typescript/src/mappings/BottomSheet.d.ts.map +1 -1
  34. package/lib/typescript/src/mappings/MapCallout.d.ts.map +1 -1
  35. package/lib/typescript/src/mappings/MapMarker.d.ts.map +1 -1
  36. package/lib/typescript/src/mappings/YoutubePlayer.d.ts +37 -0
  37. package/lib/typescript/src/mappings/YoutubePlayer.d.ts.map +1 -0
  38. package/package.json +8 -6
  39. package/src/components/Picker/Picker.js +12 -3
  40. package/src/components/Picker/Picker.tsx +12 -3
  41. package/src/components/YotubePlayer.js +10 -0
  42. package/src/components/YotubePlayer.tsx +38 -0
  43. package/src/index.js +1 -0
  44. package/src/index.tsx +2 -0
  45. package/src/mappings/ActionSheet.js +4 -1
  46. package/src/mappings/ActionSheet.ts +4 -1
  47. package/src/mappings/ActionSheetCancel.js +4 -1
  48. package/src/mappings/ActionSheetCancel.ts +4 -1
  49. package/src/mappings/ActionSheetItem.js +4 -1
  50. package/src/mappings/ActionSheetItem.ts +4 -1
  51. package/src/mappings/BottomSheet.js +2 -3
  52. package/src/mappings/BottomSheet.ts +2 -3
  53. package/src/mappings/MapCallout.js +6 -2
  54. package/src/mappings/MapCallout.ts +6 -2
  55. package/src/mappings/MapMarker.js +6 -2
  56. package/src/mappings/MapMarker.ts +6 -2
  57. package/src/mappings/YoutubePlayer.js +37 -0
  58. package/src/mappings/YoutubePlayer.ts +43 -0
@@ -12,6 +12,7 @@ var _theming = require("../../theming");
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15
16
  const AccordionItem = _ref => {
16
17
  let {
17
18
  Icon,
@@ -26,10 +27,9 @@ const AccordionItem = _ref => {
26
27
  textStyles,
27
28
  viewStyles
28
29
  } = (0, _utilities.extractStyles)(style);
29
- return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
30
- style: [styles.container, viewStyles],
31
- ...rest
32
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
30
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
31
+ style: [styles.container, viewStyles]
32
+ }, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
33
33
  style: styles.row
34
34
  }, icon ? /*#__PURE__*/React.createElement(Icon, {
35
35
  name: icon,
@@ -61,23 +61,4 @@ const styles = _reactNative.StyleSheet.create({
61
61
  }
62
62
  });
63
63
  var _default = (0, _theming.withTheme)(AccordionItem);
64
- exports.default = _default;.StyleSheet.create({
65
- container: {
66
- padding: 8
67
- },
68
- row: {
69
- flexDirection: "row",
70
- alignItems: "center",
71
- paddingLeft: 8
72
- },
73
- item: {
74
- marginVertical: 6,
75
- paddingLeft: 8
76
- },
77
- content: {
78
- flex: 1,
79
- justifyContent: "center"
80
- }
81
- });
82
- var _default = (0, _theming.withTheme)(AccordionItem);
83
64
  exports.default = _default;
@@ -10,6 +10,7 @@ var _Config = _interopRequireDefault(require("./Config"));
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
  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); }
12
12
  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; }
13
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
14
  const CircleImage = _ref => {
14
15
  let {
15
16
  source = _Config.default.placeholderImageURL,
@@ -18,21 +19,6 @@ const CircleImage = _ref => {
18
19
  ...props
19
20
  } = _ref;
20
21
  const borderRadius = size / 2;
21
- return /*#__PURE__*/React.createElement(_reactNative.Image, {
22
- style: [{
23
- width: size,
24
- height: size,
25
- borderRadius
26
- }, style],
27
- source: typeof source === "string" ? {
28
- uri: source
29
- } : source,
30
- resizeMode: "cover",
31
- ...props
32
- });
33
- };
34
- var _default = CircleImage;
35
- exports.default = _default;size / 2;
36
22
  return /*#__PURE__*/React.createElement(_reactNative.Image, _extends({
37
23
  style: [{
38
24
  width: size,
@@ -58,7 +58,7 @@ const Picker = _ref => {
58
58
  defaultValue,
59
59
  Icon,
60
60
  style,
61
- placeholder,
61
+ placeholder = "Select an option",
62
62
  value,
63
63
  disabled = false,
64
64
  assistiveText,
@@ -99,7 +99,14 @@ const Picker = _ref => {
99
99
  _reactNative.Keyboard.dismiss();
100
100
  }
101
101
  }, [pickerVisible, autoDismissKeyboard]);
102
- const pickerOptions = normalizeOptions(options);
102
+ const normalizedOptions = normalizeOptions(options);
103
+
104
+ //Underlying Picker component defaults selection to first element when value is not provided (or undefined)
105
+ //Placholder must be the 1st option in order to allow selection of the 'actual' 1st option
106
+ const pickerOptions = placeholder ? [{
107
+ label: placeholder,
108
+ value: placeholder
109
+ }, ...normalizedOptions] : normalizedOptions;
103
110
  const {
104
111
  viewStyles,
105
112
  textStyles
@@ -199,9 +206,12 @@ const Picker = _ref => {
199
206
  } : {})
200
207
  };
201
208
  const handleValueChange = (newValue, itemIndex) => {
202
- if (newValue !== "") {
209
+ if (newValue !== "" && newValue !== placeholder) {
203
210
  onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(newValue, itemIndex);
204
211
  setInternalValue(newValue);
212
+ } else if (newValue === placeholder) {
213
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange("", 0);
214
+ setInternalValue(undefined);
205
215
  }
206
216
  };
207
217
  return (
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNativeYoutubeIframe = _interopRequireDefault(require("react-native-youtube-iframe"));
9
+ var _utilities = require("../utilities");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ const YoutubePlayer = _ref => {
12
+ let {
13
+ videoId,
14
+ playlist,
15
+ mute = false,
16
+ autoplay = false,
17
+ style
18
+ } = _ref;
19
+ const {
20
+ viewStyles
21
+ } = (0, _utilities.extractStyles)(style);
22
+ const {
23
+ height,
24
+ width
25
+ } = viewStyles;
26
+ const defaultVideoId = "nwMUpDESXrI";
27
+ return /*#__PURE__*/_react.default.createElement(_reactNativeYoutubeIframe.default, {
28
+ height: height,
29
+ width: width,
30
+ play: autoplay,
31
+ videoId: !videoId && !playlist ? defaultVideoId : videoId,
32
+ playList: playlist,
33
+ mute: mute,
34
+ webViewStyle: style
35
+ });
36
+ };
37
+ var _default = YoutubePlayer;
38
+ exports.default = _default;
@@ -393,6 +393,12 @@ Object.defineProperty(exports, "Touchable", {
393
393
  return _Touchable.default;
394
394
  }
395
395
  });
396
+ Object.defineProperty(exports, "YoutubePlayer", {
397
+ enumerable: true,
398
+ get: function () {
399
+ return _YotubePlayer.default;
400
+ }
401
+ });
396
402
  Object.defineProperty(exports, "injectIcon", {
397
403
  enumerable: true,
398
404
  get: function () {
@@ -448,6 +454,7 @@ var _DeckSwiper = require("./components/DeckSwiper");
448
454
  var _TabView = require("./components/TabView");
449
455
  var _Markdown = _interopRequireDefault(require("./components/Markdown"));
450
456
  var _BottomSheet = require("./components/BottomSheet");
457
+ var _YotubePlayer = _interopRequireDefault(require("./components/YotubePlayer"));
451
458
  var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
452
459
  var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
453
460
  var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
@@ -10,7 +10,7 @@ const SEED_DATA = {
10
10
  tag: "ActionSheet",
11
11
  description: "Action Sheet container",
12
12
  category: _types.COMPONENT_TYPES.actionsheet,
13
- stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins],
13
+ stylesPanelSections: [_types.StylesPanelSections.Margins, _types.StylesPanelSections.Effects],
14
14
  props: {
15
15
  visible: (0, _types.createStaticBoolProp)({
16
16
  group: _types.GROUPS.data,
@@ -9,7 +9,7 @@ const SEED_DATA = {
9
9
  name: "Action Sheet Cancel",
10
10
  tag: "ActionSheetCancel",
11
11
  description: "Action Sheet cancel",
12
- stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins],
12
+ stylesPanelSections: [_types.StylesPanelSections.Margins, _types.StylesPanelSections.Effects],
13
13
  category: _types.COMPONENT_TYPES.actionsheet,
14
14
  triggers: [_types.Triggers.OnPress],
15
15
  props: {
@@ -10,7 +10,7 @@ const SEED_DATA = {
10
10
  tag: "ActionSheetItem",
11
11
  description: "Action Sheet item",
12
12
  category: _types.COMPONENT_TYPES.actionsheet,
13
- stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins],
13
+ stylesPanelSections: [_types.StylesPanelSections.Margins, _types.StylesPanelSections.Effects],
14
14
  triggers: [_types.Triggers.OnPress],
15
15
  layout: {
16
16
  textAlign: "center"
@@ -11,17 +11,13 @@ const SEED_DATA = {
11
11
  description: "A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
12
12
  category: _types.COMPONENT_TYPES.bottomsheet,
13
13
  stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
14
- layout: {
15
- paddingHorizontal: 16,
16
- paddingVertical: 10
17
- },
18
14
  triggers: [_types.Triggers.OnSettle],
19
15
  props: {
20
16
  onSettle: (0, _types.createActionProp)({
21
17
  label: "On settle",
22
18
  description: "Action to execute when sheet settles on a snap point"
23
19
  }),
24
- snapPoints: (0, _types.createStaticArrayProp)({
20
+ snapPoints: (0, _types.createArrayProp)({
25
21
  label: "Snap points",
26
22
  description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
27
23
  defaultValue: ["10%", "50%", "80%"]
@@ -9,7 +9,7 @@ const SEED_DATA = {
9
9
  name: "Map Callout",
10
10
  tag: "MapCallout",
11
11
  packageName: "@draftbit/maps",
12
- stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
12
+ stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Effects],
13
13
  description: "An info window to display on top of a marker when it is clicked",
14
14
  category: _types.COMPONENT_TYPES.map,
15
15
  triggers: [_types.Triggers.OnPress],
@@ -11,7 +11,7 @@ const SEED_DATA = {
11
11
  packageName: "@draftbit/maps",
12
12
  description: "A marker to show inside map view",
13
13
  category: _types.COMPONENT_TYPES.map,
14
- stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
14
+ stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Effects],
15
15
  layout: {},
16
16
  props: {
17
17
  latitude: (0, _types.createNumberProp)({
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SEED_DATA = void 0;
7
+ var _types = require("@draftbit/types");
8
+ const SEED_DATA = {
9
+ name: "Youtube Player",
10
+ tag: "YoutubePlayer",
11
+ description: "Plays a youtube video form a Youtube video or playlist id",
12
+ doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
13
+ code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
14
+ category: _types.COMPONENT_TYPES.media,
15
+ stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
16
+ layout: {
17
+ height: 250
18
+ },
19
+ props: {
20
+ videoId: (0, _types.createTextProp)({
21
+ label: "Video ID",
22
+ description: "VideoId of the Youtube video.",
23
+ defaultValue: null
24
+ }),
25
+ playlist: (0, _types.createTextProp)({
26
+ label: "Playlist",
27
+ description: "Playlist of the Youtube videos.",
28
+ defaultValue: null
29
+ }),
30
+ mute: (0, _types.createStaticBoolProp)({
31
+ label: "Mute Audio",
32
+ description: "Mute the audio of the video.",
33
+ defaultValue: false,
34
+ required: false
35
+ }),
36
+ autoplay: (0, _types.createStaticBoolProp)({
37
+ label: "Auto Play",
38
+ description: "Autoplay the video on load.",
39
+ defaultValue: false,
40
+ required: false
41
+ })
42
+ }
43
+ };
44
+ exports.SEED_DATA = SEED_DATA;
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { Text, StyleSheet } from "react-native";
3
4
  import { extractStyles } from "../utilities";
@@ -16,14 +17,13 @@ export default function FormRow(_ref) {
16
17
  textStyles,
17
18
  viewStyles
18
19
  } = extractStyles(style);
19
- return /*#__PURE__*/React.createElement(Touchable, {
20
+ return /*#__PURE__*/React.createElement(Touchable, _extends({
20
21
  disabled: disabled,
21
22
  onPress: onPress,
22
23
  style: [styles.row, {
23
24
  flexDirection: direction
24
- }, viewStyles],
25
- ...rest
26
- }, /*#__PURE__*/React.createElement(Text, {
25
+ }, viewStyles]
26
+ }, rest), /*#__PURE__*/React.createElement(Text, {
27
27
  style: textStyles
28
28
  }, label), children);
29
29
  }
@@ -49,7 +49,7 @@ const Picker = _ref => {
49
49
  defaultValue,
50
50
  Icon,
51
51
  style,
52
- placeholder,
52
+ placeholder = "Select an option",
53
53
  value,
54
54
  disabled = false,
55
55
  assistiveText,
@@ -90,7 +90,14 @@ const Picker = _ref => {
90
90
  Keyboard.dismiss();
91
91
  }
92
92
  }, [pickerVisible, autoDismissKeyboard]);
93
- const pickerOptions = normalizeOptions(options);
93
+ const normalizedOptions = normalizeOptions(options);
94
+
95
+ //Underlying Picker component defaults selection to first element when value is not provided (or undefined)
96
+ //Placholder must be the 1st option in order to allow selection of the 'actual' 1st option
97
+ const pickerOptions = placeholder ? [{
98
+ label: placeholder,
99
+ value: placeholder
100
+ }, ...normalizedOptions] : normalizedOptions;
94
101
  const {
95
102
  viewStyles,
96
103
  textStyles
@@ -190,9 +197,12 @@ const Picker = _ref => {
190
197
  } : {})
191
198
  };
192
199
  const handleValueChange = (newValue, itemIndex) => {
193
- if (newValue !== "") {
200
+ if (newValue !== "" && newValue !== placeholder) {
194
201
  onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(newValue, itemIndex);
195
202
  setInternalValue(newValue);
203
+ } else if (newValue === placeholder) {
204
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange("", 0);
205
+ setInternalValue(undefined);
196
206
  }
197
207
  };
198
208
  return (
@@ -0,0 +1,30 @@
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;
@@ -36,6 +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
40
 
40
41
  /* Deprecated: Fix or Delete! */
41
42
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
@@ -4,7 +4,7 @@ export const SEED_DATA = {
4
4
  tag: "ActionSheet",
5
5
  description: "Action Sheet container",
6
6
  category: COMPONENT_TYPES.actionsheet,
7
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
7
+ stylesPanelSections: [StylesPanelSections.Margins, StylesPanelSections.Effects],
8
8
  props: {
9
9
  visible: createStaticBoolProp({
10
10
  group: GROUPS.data,
@@ -3,7 +3,7 @@ export const SEED_DATA = {
3
3
  name: "Action Sheet Cancel",
4
4
  tag: "ActionSheetCancel",
5
5
  description: "Action Sheet cancel",
6
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
6
+ stylesPanelSections: [StylesPanelSections.Margins, StylesPanelSections.Effects],
7
7
  category: COMPONENT_TYPES.actionsheet,
8
8
  triggers: [Triggers.OnPress],
9
9
  props: {
@@ -4,7 +4,7 @@ export const SEED_DATA = {
4
4
  tag: "ActionSheetItem",
5
5
  description: "Action Sheet item",
6
6
  category: COMPONENT_TYPES.actionsheet,
7
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
7
+ stylesPanelSections: [StylesPanelSections.Margins, StylesPanelSections.Effects],
8
8
  triggers: [Triggers.OnPress],
9
9
  layout: {
10
10
  textAlign: "center"
@@ -1,21 +1,17 @@
1
- import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticArrayProp, createStaticNumberProp } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Bottom Sheet",
4
4
  tag: "BottomSheet",
5
5
  description: "A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
6
6
  category: COMPONENT_TYPES.bottomsheet,
7
7
  stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
- layout: {
9
- paddingHorizontal: 16,
10
- paddingVertical: 10
11
- },
12
8
  triggers: [Triggers.OnSettle],
13
9
  props: {
14
10
  onSettle: createActionProp({
15
11
  label: "On settle",
16
12
  description: "Action to execute when sheet settles on a snap point"
17
13
  }),
18
- snapPoints: createStaticArrayProp({
14
+ snapPoints: createArrayProp({
19
15
  label: "Snap points",
20
16
  description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
21
17
  defaultValue: ["10%", "50%", "80%"]
@@ -1,9 +1,9 @@
1
- import { COMPONENT_TYPES, createActionProp, createBoolProp, GROUPS, Triggers, CONTAINER_COMPONENT_STYLES_SECTIONS } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createActionProp, createBoolProp, GROUPS, Triggers, StylesPanelSections } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Map Callout",
4
4
  tag: "MapCallout",
5
5
  packageName: "@draftbit/maps",
6
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
6
+ stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Effects],
7
7
  description: "An info window to display on top of a marker when it is clicked",
8
8
  category: COMPONENT_TYPES.map,
9
9
  triggers: [Triggers.OnPress],
@@ -1,11 +1,11 @@
1
- import { COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createTextProp, GROUPS, CONTAINER_COMPONENT_STYLES_SECTIONS } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createTextProp, GROUPS, StylesPanelSections } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Map Marker",
4
4
  tag: "MapMarker",
5
5
  packageName: "@draftbit/maps",
6
6
  description: "A marker to show inside map view",
7
7
  category: COMPONENT_TYPES.map,
8
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
+ stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Effects],
9
9
  layout: {},
10
10
  props: {
11
11
  latitude: createNumberProp({
@@ -0,0 +1,37 @@
1
+ import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, createStaticBoolProp, createTextProp } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Youtube Player",
4
+ tag: "YoutubePlayer",
5
+ description: "Plays a youtube video form a Youtube video or playlist id",
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: BLOCK_STYLES_SECTIONS,
10
+ layout: {
11
+ height: 250
12
+ },
13
+ props: {
14
+ videoId: createTextProp({
15
+ label: "Video ID",
16
+ description: "VideoId of the Youtube video.",
17
+ defaultValue: null
18
+ }),
19
+ playlist: createTextProp({
20
+ label: "Playlist",
21
+ description: "Playlist of the Youtube videos.",
22
+ defaultValue: null
23
+ }),
24
+ mute: createStaticBoolProp({
25
+ label: "Mute Audio",
26
+ description: "Mute the audio of the video.",
27
+ defaultValue: false,
28
+ required: false
29
+ }),
30
+ autoplay: createStaticBoolProp({
31
+ label: "Auto Play",
32
+ description: "Autoplay the video on load.",
33
+ defaultValue: false,
34
+ required: false
35
+ })
36
+ }
37
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,EAGV,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQtD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAA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W,GAAG;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAAC;IACnC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;;;;AAkbF,wBAAiC"}
@@ -0,0 +1,12 @@
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
@@ -0,0 +1 @@
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"}
@@ -36,6 +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
40
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
40
41
  export { default as Picker } from "./components/Picker/Picker";
41
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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{"version":3,"file":"ActionSheet.d.ts","sourceRoot":"","sources":["../../../../src/mappings/ActionSheet.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;CAerB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionSheetCancel.d.ts","sourceRoot":"","sources":["../../../../src/mappings/ActionSheetCancel.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBrB,CAAC"}
1
+ {"version":3,"file":"ActionSheetCancel.d.ts","sourceRoot":"","sources":["../../../../src/mappings/ActionSheetCancel.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionSheetItem.d.ts","sourceRoot":"","sources":["../../../../src/mappings/ActionSheetItem.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBrB,CAAC"}
1
+ {"version":3,"file":"ActionSheetItem.d.ts","sourceRoot":"","sources":["../../../../src/mappings/ActionSheetItem.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBrB,CAAC"}
@@ -4,10 +4,6 @@ export declare const SEED_DATA: {
4
4
  description: string;
5
5
  category: string;
6
6
  stylesPanelSections: string[];
7
- layout: {
8
- paddingHorizontal: number;
9
- paddingVertical: number;
10
- };
11
7
  triggers: string[];
12
8
  props: {
13
9
  onSettle: {
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../src/mappings/BottomSheet.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkErB,CAAC"}
1
+ {"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../src/mappings/BottomSheet.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiErB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MapCallout.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapCallout.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBrB,CAAC"}
1
+ {"version":3,"file":"MapCallout.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapCallout.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MapMarker.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapMarker.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CrB,CAAC"}
1
+ {"version":3,"file":"MapMarker.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapMarker.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDrB,CAAC"}
@@ -0,0 +1,37 @@
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
+ };
37
+ //# sourceMappingURL=YoutubePlayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YoutubePlayer.d.ts","sourceRoot":"","sources":["../../../../src/mappings/YoutubePlayer.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.9.1-e3cd31.2+e3cd310",
3
+ "version": "46.9.1-f483d0.2+f483d02",
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.9.1-e3cd31.2+e3cd310",
44
+ "@draftbit/types": "^46.9.1-f483d0.2+f483d02",
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",
@@ -54,16 +54,18 @@
54
54
  "lodash.omit": "^4.5.0",
55
55
  "lodash.tonumber": "^4.0.3",
56
56
  "react-native-deck-swiper": "^2.0.12",
57
- "react-native-gesture-handler": "^2.9.0",
57
+ "react-native-gesture-handler": "~2.5.0",
58
58
  "react-native-markdown-display": "^7.0.0-alpha.2",
59
59
  "react-native-modal-datetime-picker": "^13.0.0",
60
60
  "react-native-pager-view": "5.4.24",
61
- "react-native-reanimated": "^2.14.4",
61
+ "react-native-reanimated": "~2.9.1",
62
62
  "react-native-shadow-2": "^7.0.6",
63
63
  "react-native-svg": "12.3.0",
64
64
  "react-native-tab-view": "^3.4.0",
65
65
  "react-native-typography": "^1.4.1",
66
- "react-native-web-swiper": "^2.2.3"
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
69
  },
68
70
  "devDependencies": {
69
71
  "@types/color": "^3.0.1",
@@ -98,5 +100,5 @@
98
100
  ]
99
101
  ]
100
102
  },
101
- "gitHead": "e3cd310ffd90f62816ac3f88735a7db326625091"
103
+ "gitHead": "f483d0283115f2def1ea8188f144ad9d5fae9410"
102
104
  }
@@ -38,7 +38,7 @@ const disabledColor = "rgb(240, 240, 240)";
38
38
  const errorColor = "rgba(255, 69, 100, 1)";
39
39
  //Empty string for 'value' is treated as a non-value
40
40
  //reason: Draftbit uses empty string as initial value for string state*/
41
- const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style, placeholder, value, disabled = false, assistiveText, label, iconColor = unstyledColor, iconSize = 24, leftIconMode = "inset", leftIconName, placeholderTextColor = unstyledColor, rightIconName, type = "solid", autoDismissKeyboard = true, }) => {
41
+ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style, placeholder = "Select an option", value, disabled = false, assistiveText, label, iconColor = unstyledColor, iconSize = 24, leftIconMode = "inset", leftIconName, placeholderTextColor = unstyledColor, rightIconName, type = "solid", autoDismissKeyboard = true, }) => {
42
42
  var _a, _b;
43
43
  const androidPickerRef = React.useRef(undefined);
44
44
  const [internalValue, setInternalValue] = React.useState(value || defaultValue);
@@ -67,7 +67,12 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
67
67
  Keyboard.dismiss();
68
68
  }
69
69
  }, [pickerVisible, autoDismissKeyboard]);
70
- const pickerOptions = normalizeOptions(options);
70
+ const normalizedOptions = normalizeOptions(options);
71
+ //Underlying Picker component defaults selection to first element when value is not provided (or undefined)
72
+ //Placholder must be the 1st option in order to allow selection of the 'actual' 1st option
73
+ const pickerOptions = placeholder
74
+ ? [{ label: placeholder, value: placeholder }, ...normalizedOptions]
75
+ : normalizedOptions;
71
76
  const { viewStyles, textStyles } = extractStyles(style);
72
77
  const additionalBorderStyles = ["backgroundColor"];
73
78
  const additionalMarginStyles = [
@@ -162,10 +167,14 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
162
167
  ...(disabled ? { color: unstyledColor } : {}),
163
168
  };
164
169
  const handleValueChange = (newValue, itemIndex) => {
165
- if (newValue !== "") {
170
+ if (newValue !== "" && newValue !== placeholder) {
166
171
  onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(newValue, itemIndex);
167
172
  setInternalValue(newValue);
168
173
  }
174
+ else if (newValue === placeholder) {
175
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange("", 0);
176
+ setInternalValue(undefined);
177
+ }
169
178
  };
170
179
  return (
171
180
  /* marginsContainer */
@@ -101,7 +101,7 @@ const Picker: React.FC<PickerProps> = ({
101
101
  defaultValue,
102
102
  Icon,
103
103
  style,
104
- placeholder,
104
+ placeholder = "Select an option",
105
105
  value,
106
106
  disabled = false,
107
107
  assistiveText,
@@ -151,7 +151,13 @@ const Picker: React.FC<PickerProps> = ({
151
151
  }
152
152
  }, [pickerVisible, autoDismissKeyboard]);
153
153
 
154
- const pickerOptions = normalizeOptions(options);
154
+ const normalizedOptions = normalizeOptions(options);
155
+
156
+ //Underlying Picker component defaults selection to first element when value is not provided (or undefined)
157
+ //Placholder must be the 1st option in order to allow selection of the 'actual' 1st option
158
+ const pickerOptions = placeholder
159
+ ? [{ label: placeholder, value: placeholder }, ...normalizedOptions]
160
+ : normalizedOptions;
155
161
 
156
162
  const { viewStyles, textStyles } = extractStyles(style);
157
163
 
@@ -302,9 +308,12 @@ const Picker: React.FC<PickerProps> = ({
302
308
  };
303
309
 
304
310
  const handleValueChange = (newValue: string, itemIndex: number) => {
305
- if (newValue !== "") {
311
+ if (newValue !== "" && newValue !== placeholder) {
306
312
  onValueChange?.(newValue, itemIndex);
307
313
  setInternalValue(newValue);
314
+ } else if (newValue === placeholder) {
315
+ onValueChange?.("", 0);
316
+ setInternalValue(undefined);
308
317
  }
309
318
  };
310
319
 
@@ -0,0 +1,10 @@
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;
@@ -0,0 +1,38 @@
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;
package/src/index.js CHANGED
@@ -36,6 +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
40
  /* Deprecated: Fix or Delete! */
40
41
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
41
42
  export { default as Picker } from "./components/Picker/Picker";
package/src/index.tsx CHANGED
@@ -60,6 +60,8 @@ 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";
64
+
63
65
  /* Deprecated: Fix or Delete! */
64
66
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
65
67
  export { default as Picker } from "./components/Picker/Picker";
@@ -4,7 +4,10 @@ export const SEED_DATA = {
4
4
  tag: "ActionSheet",
5
5
  description: "Action Sheet container",
6
6
  category: COMPONENT_TYPES.actionsheet,
7
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
7
+ stylesPanelSections: [
8
+ StylesPanelSections.Margins,
9
+ StylesPanelSections.Effects,
10
+ ],
8
11
  props: {
9
12
  visible: createStaticBoolProp({
10
13
  group: GROUPS.data,
@@ -10,7 +10,10 @@ export const SEED_DATA = {
10
10
  tag: "ActionSheet",
11
11
  description: "Action Sheet container",
12
12
  category: COMPONENT_TYPES.actionsheet,
13
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
13
+ stylesPanelSections: [
14
+ StylesPanelSections.Margins,
15
+ StylesPanelSections.Effects,
16
+ ],
14
17
  props: {
15
18
  visible: createStaticBoolProp({
16
19
  group: GROUPS.data,
@@ -3,7 +3,10 @@ export const SEED_DATA = {
3
3
  name: "Action Sheet Cancel",
4
4
  tag: "ActionSheetCancel",
5
5
  description: "Action Sheet cancel",
6
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
6
+ stylesPanelSections: [
7
+ StylesPanelSections.Margins,
8
+ StylesPanelSections.Effects,
9
+ ],
7
10
  category: COMPONENT_TYPES.actionsheet,
8
11
  triggers: [Triggers.OnPress],
9
12
  props: {
@@ -12,7 +12,10 @@ export const SEED_DATA = {
12
12
  name: "Action Sheet Cancel",
13
13
  tag: "ActionSheetCancel",
14
14
  description: "Action Sheet cancel",
15
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
15
+ stylesPanelSections: [
16
+ StylesPanelSections.Margins,
17
+ StylesPanelSections.Effects,
18
+ ],
16
19
  category: COMPONENT_TYPES.actionsheet,
17
20
  triggers: [Triggers.OnPress],
18
21
  props: {
@@ -4,7 +4,10 @@ export const SEED_DATA = {
4
4
  tag: "ActionSheetItem",
5
5
  description: "Action Sheet item",
6
6
  category: COMPONENT_TYPES.actionsheet,
7
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
7
+ stylesPanelSections: [
8
+ StylesPanelSections.Margins,
9
+ StylesPanelSections.Effects,
10
+ ],
8
11
  triggers: [Triggers.OnPress],
9
12
  layout: {
10
13
  textAlign: "center",
@@ -13,7 +13,10 @@ export const SEED_DATA = {
13
13
  tag: "ActionSheetItem",
14
14
  description: "Action Sheet item",
15
15
  category: COMPONENT_TYPES.actionsheet,
16
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
16
+ stylesPanelSections: [
17
+ StylesPanelSections.Margins,
18
+ StylesPanelSections.Effects,
19
+ ],
17
20
  triggers: [Triggers.OnPress],
18
21
  layout: {
19
22
  textAlign: "center",
@@ -1,18 +1,17 @@
1
- import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticArrayProp, createStaticNumberProp, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp, } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Bottom Sheet",
4
4
  tag: "BottomSheet",
5
5
  description: "A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
6
6
  category: COMPONENT_TYPES.bottomsheet,
7
7
  stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
- layout: { paddingHorizontal: 16, paddingVertical: 10 },
9
8
  triggers: [Triggers.OnSettle],
10
9
  props: {
11
10
  onSettle: createActionProp({
12
11
  label: "On settle",
13
12
  description: "Action to execute when sheet settles on a snap point",
14
13
  }),
15
- snapPoints: createStaticArrayProp({
14
+ snapPoints: createArrayProp({
16
15
  label: "Snap points",
17
16
  description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
18
17
  defaultValue: ["10%", "50%", "80%"],
@@ -5,8 +5,8 @@ import {
5
5
  Triggers,
6
6
  createActionProp,
7
7
  createColorProp,
8
- createStaticArrayProp,
9
8
  createStaticNumberProp,
9
+ createArrayProp,
10
10
  } from "@draftbit/types";
11
11
 
12
12
  export const SEED_DATA = {
@@ -16,14 +16,13 @@ export const SEED_DATA = {
16
16
  "A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
17
17
  category: COMPONENT_TYPES.bottomsheet,
18
18
  stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
19
- layout: { paddingHorizontal: 16, paddingVertical: 10 },
20
19
  triggers: [Triggers.OnSettle],
21
20
  props: {
22
21
  onSettle: createActionProp({
23
22
  label: "On settle",
24
23
  description: "Action to execute when sheet settles on a snap point",
25
24
  }),
26
- snapPoints: createStaticArrayProp({
25
+ snapPoints: createArrayProp({
27
26
  label: "Snap points",
28
27
  description:
29
28
  "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
@@ -1,9 +1,13 @@
1
- import { COMPONENT_TYPES, createActionProp, createBoolProp, GROUPS, Triggers, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createActionProp, createBoolProp, GROUPS, Triggers, StylesPanelSections, } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Map Callout",
4
4
  tag: "MapCallout",
5
5
  packageName: "@draftbit/maps",
6
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
6
+ stylesPanelSections: [
7
+ StylesPanelSections.Size,
8
+ StylesPanelSections.Margins,
9
+ StylesPanelSections.Effects,
10
+ ],
7
11
  description: "An info window to display on top of a marker when it is clicked",
8
12
  category: COMPONENT_TYPES.map,
9
13
  triggers: [Triggers.OnPress],
@@ -4,14 +4,18 @@ import {
4
4
  createBoolProp,
5
5
  GROUPS,
6
6
  Triggers,
7
- CONTAINER_COMPONENT_STYLES_SECTIONS,
7
+ StylesPanelSections,
8
8
  } from "@draftbit/types";
9
9
 
10
10
  export const SEED_DATA = {
11
11
  name: "Map Callout",
12
12
  tag: "MapCallout",
13
13
  packageName: "@draftbit/maps",
14
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
14
+ stylesPanelSections: [
15
+ StylesPanelSections.Size,
16
+ StylesPanelSections.Margins,
17
+ StylesPanelSections.Effects,
18
+ ],
15
19
  description:
16
20
  "An info window to display on top of a marker when it is clicked",
17
21
  category: COMPONENT_TYPES.map,
@@ -1,11 +1,15 @@
1
- import { COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createTextProp, GROUPS, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createTextProp, GROUPS, StylesPanelSections, } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Map Marker",
4
4
  tag: "MapMarker",
5
5
  packageName: "@draftbit/maps",
6
6
  description: "A marker to show inside map view",
7
7
  category: COMPONENT_TYPES.map,
8
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
+ stylesPanelSections: [
9
+ StylesPanelSections.Size,
10
+ StylesPanelSections.Margins,
11
+ StylesPanelSections.Effects,
12
+ ],
9
13
  layout: {},
10
14
  props: {
11
15
  latitude: createNumberProp({
@@ -5,7 +5,7 @@ import {
5
5
  createNumberProp,
6
6
  createTextProp,
7
7
  GROUPS,
8
- CONTAINER_COMPONENT_STYLES_SECTIONS,
8
+ StylesPanelSections,
9
9
  } from "@draftbit/types";
10
10
 
11
11
  export const SEED_DATA = {
@@ -14,7 +14,11 @@ export const SEED_DATA = {
14
14
  packageName: "@draftbit/maps",
15
15
  description: "A marker to show inside map view",
16
16
  category: COMPONENT_TYPES.map,
17
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
17
+ stylesPanelSections: [
18
+ StylesPanelSections.Size,
19
+ StylesPanelSections.Margins,
20
+ StylesPanelSections.Effects,
21
+ ],
18
22
  layout: {},
19
23
  props: {
20
24
  latitude: createNumberProp({
@@ -0,0 +1,37 @@
1
+ import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, createStaticBoolProp, createTextProp, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Youtube Player",
4
+ tag: "YoutubePlayer",
5
+ description: "Plays a youtube video form a Youtube video or playlist id",
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: BLOCK_STYLES_SECTIONS,
10
+ layout: {
11
+ height: 250,
12
+ },
13
+ props: {
14
+ videoId: createTextProp({
15
+ label: "Video ID",
16
+ description: "VideoId of the Youtube video.",
17
+ defaultValue: null,
18
+ }),
19
+ playlist: createTextProp({
20
+ label: "Playlist",
21
+ description: "Playlist of the Youtube videos.",
22
+ defaultValue: null,
23
+ }),
24
+ mute: createStaticBoolProp({
25
+ label: "Mute Audio",
26
+ description: "Mute the audio of the video.",
27
+ defaultValue: false,
28
+ required: false,
29
+ }),
30
+ autoplay: createStaticBoolProp({
31
+ label: "Auto Play",
32
+ description: "Autoplay the video on load.",
33
+ defaultValue: false,
34
+ required: false,
35
+ }),
36
+ },
37
+ };
@@ -0,0 +1,43 @@
1
+ import {
2
+ BLOCK_STYLES_SECTIONS,
3
+ COMPONENT_TYPES,
4
+ createStaticBoolProp,
5
+ createTextProp,
6
+ } from "@draftbit/types";
7
+
8
+ export const SEED_DATA = {
9
+ name: "Youtube Player",
10
+ tag: "YoutubePlayer",
11
+ description: "Plays a youtube video form a Youtube video or playlist id",
12
+ doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
13
+ code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
14
+ category: COMPONENT_TYPES.media,
15
+ stylesPanelSections: BLOCK_STYLES_SECTIONS,
16
+ layout: {
17
+ height: 250,
18
+ },
19
+ props: {
20
+ videoId: createTextProp({
21
+ label: "Video ID",
22
+ description: "VideoId of the Youtube video.",
23
+ defaultValue: null,
24
+ }),
25
+ playlist: createTextProp({
26
+ label: "Playlist",
27
+ description: "Playlist of the Youtube videos.",
28
+ defaultValue: null,
29
+ }),
30
+ mute: createStaticBoolProp({
31
+ label: "Mute Audio",
32
+ description: "Mute the audio of the video.",
33
+ defaultValue: false,
34
+ required: false,
35
+ }),
36
+ autoplay: createStaticBoolProp({
37
+ label: "Auto Play",
38
+ description: "Autoplay the video on load.",
39
+ defaultValue: false,
40
+ required: false,
41
+ }),
42
+ },
43
+ };