@draftbit/core 42.4.1-3e3daf.0 → 42.4.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 (61) hide show
  1. package/lib/commonjs/components/Accordion/index.js.map +1 -1
  2. package/lib/commonjs/components/Checkbox/Checkbox.js +6 -4
  3. package/lib/commonjs/components/Checkbox/Checkbox.js.map +1 -1
  4. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +3 -1
  5. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
  6. package/lib/commonjs/components/Slider.js +3 -1
  7. package/lib/commonjs/components/Slider.js.map +1 -1
  8. package/lib/commonjs/components/StarRating.js +3 -1
  9. package/lib/commonjs/components/StarRating.js.map +1 -1
  10. package/lib/commonjs/components/Stepper.js +4 -2
  11. package/lib/commonjs/components/Stepper.js.map +1 -1
  12. package/lib/commonjs/components/Switch.js +1 -4
  13. package/lib/commonjs/components/Switch.js.map +1 -1
  14. package/lib/commonjs/components/ToggleButton.js +3 -1
  15. package/lib/commonjs/components/ToggleButton.js.map +1 -1
  16. package/lib/commonjs/index.js +0 -8
  17. package/lib/commonjs/index.js.map +1 -1
  18. package/lib/module/components/ActionSheet/ActionSheetCancel.js.map +1 -1
  19. package/lib/module/components/Carousel.js +5 -4
  20. package/lib/module/components/Carousel.js.map +1 -1
  21. package/lib/module/components/Checkbox/Checkbox.js +6 -4
  22. package/lib/module/components/Checkbox/Checkbox.js.map +1 -1
  23. package/lib/module/components/RadioButton/RadioButtonGroup.js +3 -1
  24. package/lib/module/components/RadioButton/RadioButtonGroup.js.map +1 -1
  25. package/lib/module/components/Slider.js +3 -1
  26. package/lib/module/components/Slider.js.map +1 -1
  27. package/lib/module/components/StarRating.js +3 -1
  28. package/lib/module/components/StarRating.js.map +1 -1
  29. package/lib/module/components/Stepper.js +4 -2
  30. package/lib/module/components/Stepper.js.map +1 -1
  31. package/lib/module/components/Switch.js +1 -4
  32. package/lib/module/components/Switch.js.map +1 -1
  33. package/lib/module/components/ToggleButton.js +3 -1
  34. package/lib/module/components/ToggleButton.js.map +1 -1
  35. package/lib/module/index.js +0 -1
  36. package/lib/module/index.js.map +1 -1
  37. package/lib/typescript/src/index.d.ts +0 -1
  38. package/package.json +3 -5
  39. package/src/components/Checkbox/Checkbox.js +6 -4
  40. package/src/components/Checkbox/Checkbox.tsx +6 -4
  41. package/src/components/RadioButton/RadioButtonGroup.js +3 -1
  42. package/src/components/RadioButton/RadioButtonGroup.tsx +3 -1
  43. package/src/components/Slider.js +3 -1
  44. package/src/components/Slider.tsx +3 -1
  45. package/src/components/StarRating.js +3 -1
  46. package/src/components/StarRating.tsx +3 -1
  47. package/src/components/Stepper.js +4 -2
  48. package/src/components/Stepper.tsx +4 -2
  49. package/src/components/Switch.js +1 -4
  50. package/src/components/Switch.tsx +1 -5
  51. package/src/components/ToggleButton.js +3 -1
  52. package/src/components/ToggleButton.tsx +3 -1
  53. package/src/index.js +0 -1
  54. package/src/index.tsx +0 -1
  55. package/lib/commonjs/components/Youtube.js +0 -73
  56. package/lib/commonjs/components/Youtube.js.map +0 -1
  57. package/lib/module/components/Youtube.js +0 -59
  58. package/lib/module/components/Youtube.js.map +0 -1
  59. package/lib/typescript/src/components/Youtube.d.ts +0 -43
  60. package/src/components/Youtube.js +0 -38
  61. package/src/components/Youtube.tsx +0 -66
@@ -10,10 +10,12 @@ export var CheckboxStatus;
10
10
  CheckboxStatus["Unchecked"] = "unchecked";
11
11
  CheckboxStatus["Indeterminate"] = "indeterminate";
12
12
  })(CheckboxStatus || (CheckboxStatus = {}));
13
- const Checkbox = ({ Icon, status = CheckboxStatus.Unchecked, disabled = false, onPress = () => { }, color, uncheckedColor, indeterminateColor, initialValue, defaultValue, checkedIcon = "MaterialCommunityIcons/checkbox-marked", uncheckedIcon = "MaterialCommunityIcons/checkbox-blank-outline", indeterminateIcon = "AntDesign/minussquareo", size = 24, style, ...rest }) => {
14
- const [internalValue, setInternalValue] = React.useState(status || defaultValue);
13
+ const Checkbox = ({ Icon, status, disabled = false, onPress = () => { }, color, uncheckedColor, indeterminateColor, initialValue, defaultValue, checkedIcon = "MaterialCommunityIcons/checkbox-marked", uncheckedIcon = "MaterialCommunityIcons/checkbox-blank-outline", indeterminateIcon = "AntDesign/minussquareo", size = 24, style, ...rest }) => {
14
+ const [internalValue, setInternalValue] = React.useState(status || defaultValue || CheckboxStatus.Unchecked);
15
15
  React.useEffect(() => {
16
- setInternalValue(status);
16
+ if (status != null) {
17
+ setInternalValue(status);
18
+ }
17
19
  }, [status]);
18
20
  const previousInitialValue = usePrevious(initialValue);
19
21
  React.useEffect(() => {
@@ -32,7 +34,7 @@ const Checkbox = ({ Icon, status = CheckboxStatus.Unchecked, disabled = false, o
32
34
  [CheckboxStatus.Unchecked]: uncheckedIcon,
33
35
  [CheckboxStatus.Indeterminate]: indeterminateIcon,
34
36
  };
35
- const checkboxColor = colorsMap[status];
37
+ const checkboxColor = colorsMap[internalValue];
36
38
  const handlePress = () => {
37
39
  setInternalValue(internalValue === CheckboxStatus.Unchecked
38
40
  ? CheckboxStatus.Checked
@@ -47,7 +47,7 @@ export interface CheckboxProps {
47
47
  const Checkbox: React.FC<CheckboxProps & TouchableHighlightProps & IconSlot> =
48
48
  ({
49
49
  Icon,
50
- status = CheckboxStatus.Unchecked,
50
+ status,
51
51
  disabled = false,
52
52
  onPress = () => {},
53
53
  color,
@@ -63,11 +63,13 @@ const Checkbox: React.FC<CheckboxProps & TouchableHighlightProps & IconSlot> =
63
63
  ...rest
64
64
  }) => {
65
65
  const [internalValue, setInternalValue] = React.useState<CheckboxStatus>(
66
- status || defaultValue
66
+ status || defaultValue || CheckboxStatus.Unchecked
67
67
  );
68
68
 
69
69
  React.useEffect(() => {
70
- setInternalValue(status);
70
+ if (status != null) {
71
+ setInternalValue(status);
72
+ }
71
73
  }, [status]);
72
74
 
73
75
  const previousInitialValue = usePrevious(initialValue);
@@ -90,7 +92,7 @@ const Checkbox: React.FC<CheckboxProps & TouchableHighlightProps & IconSlot> =
90
92
  [CheckboxStatus.Indeterminate]: indeterminateIcon,
91
93
  };
92
94
 
93
- const checkboxColor = colorsMap[status];
95
+ const checkboxColor = colorsMap[internalValue];
94
96
 
95
97
  const handlePress = () => {
96
98
  setInternalValue(
@@ -7,7 +7,9 @@ const { Provider } = radioButtonGroupContext;
7
7
  const RadioButtonGroup = ({ direction = Direction.Vertical, value, onValueChange = () => { }, initialValue, defaultValue, style, children, ...rest }) => {
8
8
  const [internalValue, setIntervalValue] = React.useState(value || defaultValue);
9
9
  React.useEffect(() => {
10
- setIntervalValue(value);
10
+ if (value != null) {
11
+ setIntervalValue(value);
12
+ }
11
13
  }, [value]);
12
14
  const previousInitialValue = usePrevious(initialValue);
13
15
  React.useEffect(() => {
@@ -37,7 +37,9 @@ const RadioButtonGroup: React.FC<RadioButtonGroupProps> = ({
37
37
  );
38
38
 
39
39
  React.useEffect(() => {
40
- setIntervalValue(value);
40
+ if (value != null) {
41
+ setIntervalValue(value);
42
+ }
41
43
  }, [value]);
42
44
 
43
45
  const previousInitialValue = usePrevious(initialValue);
@@ -33,7 +33,9 @@ function Slider({ Icon, leftIcon, rightIcon, leftIconColor, rightIconColor, valu
33
33
  }, [initialValue, previousInitialValue, onValueChange]);
34
34
  const [internalValue, setIntervalValue] = React.useState(value || defaultValue);
35
35
  React.useEffect(() => {
36
- setIntervalValue(value);
36
+ if (value != null) {
37
+ setIntervalValue(value);
38
+ }
37
39
  }, [value]);
38
40
  const minTrackColor = minimumTrackTintColor || theme.colors.primary;
39
41
  const maxTrackColor = maximumTrackTintColor || theme.colors.light;
@@ -92,7 +92,9 @@ function Slider({
92
92
  );
93
93
 
94
94
  React.useEffect(() => {
95
- setIntervalValue(value);
95
+ if (value != null) {
96
+ setIntervalValue(value);
97
+ }
96
98
  }, [value]);
97
99
 
98
100
  const minTrackColor = minimumTrackTintColor || theme.colors.primary;
@@ -5,7 +5,9 @@ import { COMPONENT_TYPES, createStaticNumberProp, createFieldNameProp, createSta
5
5
  const StarRating = ({ Icon, starSize = 16, maxStars = 5, rating = 0, defaultValue, isEditable = false, activeColor, inactiveColor, style, onPress, ...rest }) => {
6
6
  const [localRating, setLocalRating] = React.useState(rating || defaultValue || 0);
7
7
  React.useEffect(() => {
8
- setLocalRating(rating);
8
+ if (rating != null) {
9
+ setLocalRating(rating);
10
+ }
9
11
  }, [rating]);
10
12
  const ratingHandler = React.useCallback((r) => {
11
13
  setLocalRating(r);
@@ -51,7 +51,9 @@ const StarRating: React.FC<Props> = ({
51
51
  );
52
52
 
53
53
  React.useEffect(() => {
54
- setLocalRating(rating);
54
+ if (rating != null) {
55
+ setLocalRating(rating);
56
+ }
55
57
  }, [rating]);
56
58
 
57
59
  const ratingHandler = React.useCallback(
@@ -4,10 +4,12 @@ import { withTheme } from "../theming";
4
4
  import { COMPONENT_TYPES, createIconSizeProp, createColorProp, createFieldNameProp, Triggers, } from "@draftbit/types";
5
5
  import IconButton from "./IconButton";
6
6
  import { usePrevious } from "../hooks";
7
- const Stepper = ({ Icon, value = 0, style, onChange, initialValue, defaultValue, theme: { colors, typography, roundness }, iconSize = 24, iconColor = colors.strong, borderRadius = roundness, typeStyle, }) => {
7
+ const Stepper = ({ Icon, value, style, onChange, initialValue, defaultValue, theme: { colors, typography, roundness }, iconSize = 24, iconColor = colors.strong, borderRadius = roundness, typeStyle, }) => {
8
8
  const [stateValue, setStateValue] = React.useState(value || defaultValue || 0);
9
9
  React.useEffect(() => {
10
- setStateValue(value);
10
+ if (value != null) {
11
+ setStateValue(value);
12
+ }
11
13
  }, [value]);
12
14
  const previousInitialValue = usePrevious(initialValue);
13
15
  React.useEffect(() => {
@@ -29,7 +29,7 @@ type Props = {
29
29
 
30
30
  const Stepper: React.FC<Props> = ({
31
31
  Icon,
32
- value = 0,
32
+ value,
33
33
  style,
34
34
  onChange,
35
35
  initialValue,
@@ -45,7 +45,9 @@ const Stepper: React.FC<Props> = ({
45
45
  );
46
46
 
47
47
  React.useEffect(() => {
48
- setStateValue(value);
48
+ if (value != null) {
49
+ setStateValue(value);
50
+ }
49
51
  }, [value]);
50
52
 
51
53
  const previousInitialValue = usePrevious(initialValue);
@@ -10,9 +10,6 @@ function Switch({ value, initialValue, defaultValue, disabled, onValueChange, ac
10
10
  const activeThumbThemeColor = activeThumbColor || "#FFF";
11
11
  const inactiveThumbThemeColor = inactiveThumbColor || "#FFF";
12
12
  const [checked, setChecked] = React.useState(value || defaultValue);
13
- React.useEffect(() => {
14
- setChecked(value);
15
- }, [value]);
16
13
  React.useEffect(() => {
17
14
  if (value != null && value !== checked) {
18
15
  setChecked(value);
@@ -42,7 +39,7 @@ function Switch({ value, initialValue, defaultValue, disabled, onValueChange, ac
42
39
  onValueChange && onValueChange(bool);
43
40
  }, ...rest }));
44
41
  }
45
- function Row({ label = "Label", direction = RowDirection.Row, style, value = false, disabled, onValueChange, activeTrackColor, inactiveTrackColor, activeThumbColor, inactiveThumbColor, theme, ...rest }) {
42
+ function Row({ label = "Label", direction = RowDirection.Row, style, value, disabled, onValueChange, activeTrackColor, inactiveTrackColor, activeThumbColor, inactiveThumbColor, theme, ...rest }) {
46
43
  const [checked, setChecked] = React.useState(value);
47
44
  React.useEffect(() => {
48
45
  if (value !== checked) {
@@ -46,10 +46,6 @@ function Switch({
46
46
 
47
47
  const [checked, setChecked] = React.useState(value || defaultValue);
48
48
 
49
- React.useEffect(() => {
50
- setChecked(value);
51
- }, [value]);
52
-
53
49
  React.useEffect(() => {
54
50
  if (value != null && value !== checked) {
55
51
  setChecked(value);
@@ -104,7 +100,7 @@ function Row({
104
100
  label = "Label",
105
101
  direction = RowDirection.Row,
106
102
  style,
107
- value = false,
103
+ value,
108
104
  disabled,
109
105
  onValueChange,
110
106
  activeTrackColor,
@@ -8,7 +8,9 @@ import { usePrevious } from "../hooks";
8
8
  const ToggleButton = ({ Icon, icon, toggled = false, onPress = () => { }, initialValue, defaultValue, disabled = false, color = "primary", colorSecondary = "surface", borderColor = "divider", iconSize = 25, width = 50, height = 50, theme: { colors }, style, ...rest }) => {
9
9
  const [internalValue, setIntervalValue] = React.useState(toggled || defaultValue || false);
10
10
  React.useEffect(() => {
11
- setIntervalValue(toggled);
11
+ if (toggled != null) {
12
+ setIntervalValue(toggled);
13
+ }
12
14
  }, [toggled]);
13
15
  const previousInitialValue = usePrevious(initialValue);
14
16
  React.useEffect(() => {
@@ -58,7 +58,9 @@ const ToggleButton: React.FC<Props> = ({
58
58
  );
59
59
 
60
60
  React.useEffect(() => {
61
- setIntervalValue(toggled);
61
+ if (toggled != null) {
62
+ setIntervalValue(toggled);
63
+ }
62
64
  }, [toggled]);
63
65
 
64
66
  const previousInitialValue = usePrevious(initialValue);
package/src/index.js CHANGED
@@ -49,4 +49,3 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
49
49
  export { default as Slider } from "./components/Slider";
50
50
  export { default as Stepper } from "./components/Stepper";
51
51
  export { useAuthState } from "./components/useAuthState";
52
- export { default as Youtube } from "./components/Youtube";
package/src/index.tsx CHANGED
@@ -69,4 +69,3 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
69
69
  export { default as Slider } from "./components/Slider";
70
70
  export { default as Stepper } from "./components/Stepper";
71
71
  export { useAuthState } from "./components/useAuthState";
72
- export { default as Youtube } from "./components/Youtube";
@@ -1,73 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SEED_DATA = exports.default = 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 = ({
19
- videoId,
20
- playlist,
21
- style,
22
- mute,
23
- autoplay
24
- }) => {
25
- const {
26
- viewStyles: {
27
- height,
28
- width
29
- }
30
- } = (0, _utilities.extractStyles)(style);
31
- return /*#__PURE__*/_react.default.createElement(_reactNativeYoutubeIframe.default, {
32
- height: height,
33
- width: width,
34
- play: autoplay,
35
- videoId: videoId,
36
- playList: playlist,
37
- mute: mute
38
- });
39
- };
40
-
41
- var _default = Youtube;
42
- exports.default = _default;
43
- const SEED_DATA = {
44
- name: "Youtube",
45
- tag: "Youtube",
46
- description: "Youtube Component",
47
- category: _types.COMPONENT_TYPES.media,
48
- layout: {
49
- width: "100%"
50
- },
51
- props: {
52
- videoId: (0, _types.createTextProp)({
53
- label: "VideoId",
54
- description: "Youtube Video ID"
55
- }),
56
- playlist: (0, _types.createTextProp)({
57
- label: "PlayList",
58
- description: "Playlist ID"
59
- }),
60
- mute: (0, _types.createBoolProp)({
61
- label: "Mute",
62
- description: "Whether to mute video",
63
- defaultValue: false
64
- }),
65
- autoplay: (0, _types.createBoolProp)({
66
- label: "Autoplay",
67
- description: "Whether to Autoplay video",
68
- defaultValue: false
69
- })
70
- }
71
- };
72
- exports.SEED_DATA = SEED_DATA;
73
- //# sourceMappingURL=Youtube.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Youtube.tsx"],"names":["Youtube","videoId","playlist","style","mute","autoplay","viewStyles","height","width","SEED_DATA","name","tag","description","category","COMPONENT_TYPES","media","layout","props","label","defaultValue"],"mappings":";;;;;;;AAAA;;AAKA;;AAEA;;AACA;;;;AAUA,MAAMA,OAAO,GAAG,CAAC;AAAEC,EAAAA,OAAF;AAAWC,EAAAA,QAAX;AAAqBC,EAAAA,KAArB;AAA4BC,EAAAA,IAA5B;AAAkCC,EAAAA;AAAlC,CAAD,KAAyD;AACvE,QAAM;AACJC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV;AADR,MAEF,8BAAcL,KAAd,CAFJ;AAIA,sBACE,6BAAC,iCAAD;AACE,IAAA,MAAM,EAAEI,MADV;AAEE,IAAA,KAAK,EAAEC,KAFT;AAGE,IAAA,IAAI,EAAEH,QAHR;AAIE,IAAA,OAAO,EAAEJ,OAJX;AAKE,IAAA,QAAQ,EAAEC,QALZ;AAME,IAAA,IAAI,EAAEE;AANR,IADF;AAUD,CAfD;;eAiBeJ,O;;AAER,MAAMS,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,SADiB;AAEvBC,EAAAA,GAAG,EAAE,SAFkB;AAGvBC,EAAAA,WAAW,EAAE,mBAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAJH;AAKvBC,EAAAA,MAAM,EAAE;AACNR,IAAAA,KAAK,EAAE;AADD,GALe;AAQvBS,EAAAA,KAAK,EAAE;AACLhB,IAAAA,OAAO,EAAE,2BAAe;AACtBiB,MAAAA,KAAK,EAAE,SADe;AAEtBN,MAAAA,WAAW,EAAE;AAFS,KAAf,CADJ;AAKLV,IAAAA,QAAQ,EAAE,2BAAe;AACvBgB,MAAAA,KAAK,EAAE,UADgB;AAEvBN,MAAAA,WAAW,EAAE;AAFU,KAAf,CALL;AASLR,IAAAA,IAAI,EAAE,2BAAe;AACnBc,MAAAA,KAAK,EAAE,MADY;AAEnBN,MAAAA,WAAW,EAAE,uBAFM;AAGnBO,MAAAA,YAAY,EAAE;AAHK,KAAf,CATD;AAcLd,IAAAA,QAAQ,EAAE,2BAAe;AACvBa,MAAAA,KAAK,EAAE,UADgB;AAEvBN,MAAAA,WAAW,EAAE,2BAFU;AAGvBO,MAAAA,YAAY,EAAE;AAHS,KAAf;AAdL;AARgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createBoolProp,\n createTextProp,\n} from \"@draftbit/types\";\nimport React from \"react\";\nimport { StyleProp, ViewStyle } from \"react-native\";\nimport YoutubePlayer from \"react-native-youtube-iframe\";\nimport { extractStyles } from \"../utilities\";\n\ntype Props = {\n videoId: string;\n playlist: string;\n style: StyleProp<ViewStyle>;\n mute: boolean;\n autoplay: boolean;\n};\n\nconst Youtube = ({ videoId, playlist, style, mute, autoplay }: Props) => {\n const {\n viewStyles: { height, width },\n } = extractStyles(style);\n\n return (\n <YoutubePlayer\n height={height}\n width={width}\n play={autoplay}\n videoId={videoId}\n playList={playlist}\n mute={mute}\n />\n );\n};\n\nexport default Youtube;\n\nexport const SEED_DATA = {\n name: \"Youtube\",\n tag: \"Youtube\",\n description: \"Youtube Component\",\n category: COMPONENT_TYPES.media,\n layout: {\n width: \"100%\",\n },\n props: {\n videoId: createTextProp({\n label: \"VideoId\",\n description: \"Youtube Video ID\",\n }),\n playlist: createTextProp({\n label: \"PlayList\",\n description: \"Playlist ID\",\n }),\n mute: createBoolProp({\n label: \"Mute\",\n description: \"Whether to mute video\",\n defaultValue: false,\n }),\n autoplay: createBoolProp({\n label: \"Autoplay\",\n description: \"Whether to Autoplay video\",\n defaultValue: false,\n }),\n },\n};\n"]}
@@ -1,59 +0,0 @@
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 = ({
7
- videoId,
8
- playlist,
9
- style,
10
- mute,
11
- autoplay
12
- }) => {
13
- const {
14
- viewStyles: {
15
- height,
16
- width
17
- }
18
- } = extractStyles(style);
19
- return /*#__PURE__*/React.createElement(YoutubePlayer, {
20
- height: height,
21
- width: width,
22
- play: autoplay,
23
- videoId: videoId,
24
- playList: playlist,
25
- mute: mute
26
- });
27
- };
28
-
29
- export default Youtube;
30
- export const SEED_DATA = {
31
- name: "Youtube",
32
- tag: "Youtube",
33
- description: "Youtube Component",
34
- category: COMPONENT_TYPES.media,
35
- layout: {
36
- width: "100%"
37
- },
38
- props: {
39
- videoId: createTextProp({
40
- label: "VideoId",
41
- description: "Youtube Video ID"
42
- }),
43
- playlist: createTextProp({
44
- label: "PlayList",
45
- description: "Playlist ID"
46
- }),
47
- mute: createBoolProp({
48
- label: "Mute",
49
- description: "Whether to mute video",
50
- defaultValue: false
51
- }),
52
- autoplay: createBoolProp({
53
- label: "Autoplay",
54
- description: "Whether to Autoplay video",
55
- defaultValue: false
56
- })
57
- }
58
- };
59
- //# sourceMappingURL=Youtube.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Youtube.tsx"],"names":["COMPONENT_TYPES","createBoolProp","createTextProp","React","YoutubePlayer","extractStyles","Youtube","videoId","playlist","style","mute","autoplay","viewStyles","height","width","SEED_DATA","name","tag","description","category","media","layout","props","label","defaultValue"],"mappings":"AAAA,SACEA,eADF,EAEEC,cAFF,EAGEC,cAHF,QAIO,iBAJP;AAKA,OAAOC,KAAP,MAAkB,OAAlB;AAEA,OAAOC,aAAP,MAA0B,6BAA1B;AACA,SAASC,aAAT,QAA8B,cAA9B;;AAUA,MAAMC,OAAO,GAAG,CAAC;AAAEC,EAAAA,OAAF;AAAWC,EAAAA,QAAX;AAAqBC,EAAAA,KAArB;AAA4BC,EAAAA,IAA5B;AAAkCC,EAAAA;AAAlC,CAAD,KAAyD;AACvE,QAAM;AACJC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV;AADR,MAEFT,aAAa,CAACI,KAAD,CAFjB;AAIA,sBACE,oBAAC,aAAD;AACE,IAAA,MAAM,EAAEI,MADV;AAEE,IAAA,KAAK,EAAEC,KAFT;AAGE,IAAA,IAAI,EAAEH,QAHR;AAIE,IAAA,OAAO,EAAEJ,OAJX;AAKE,IAAA,QAAQ,EAAEC,QALZ;AAME,IAAA,IAAI,EAAEE;AANR,IADF;AAUD,CAfD;;AAiBA,eAAeJ,OAAf;AAEA,OAAO,MAAMS,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,SADiB;AAEvBC,EAAAA,GAAG,EAAE,SAFkB;AAGvBC,EAAAA,WAAW,EAAE,mBAHU;AAIvBC,EAAAA,QAAQ,EAAEnB,eAAe,CAACoB,KAJH;AAKvBC,EAAAA,MAAM,EAAE;AACNP,IAAAA,KAAK,EAAE;AADD,GALe;AAQvBQ,EAAAA,KAAK,EAAE;AACLf,IAAAA,OAAO,EAAEL,cAAc,CAAC;AACtBqB,MAAAA,KAAK,EAAE,SADe;AAEtBL,MAAAA,WAAW,EAAE;AAFS,KAAD,CADlB;AAKLV,IAAAA,QAAQ,EAAEN,cAAc,CAAC;AACvBqB,MAAAA,KAAK,EAAE,UADgB;AAEvBL,MAAAA,WAAW,EAAE;AAFU,KAAD,CALnB;AASLR,IAAAA,IAAI,EAAET,cAAc,CAAC;AACnBsB,MAAAA,KAAK,EAAE,MADY;AAEnBL,MAAAA,WAAW,EAAE,uBAFM;AAGnBM,MAAAA,YAAY,EAAE;AAHK,KAAD,CATf;AAcLb,IAAAA,QAAQ,EAAEV,cAAc,CAAC;AACvBsB,MAAAA,KAAK,EAAE,UADgB;AAEvBL,MAAAA,WAAW,EAAE,2BAFU;AAGvBM,MAAAA,YAAY,EAAE;AAHS,KAAD;AAdnB;AARgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createBoolProp,\n createTextProp,\n} from \"@draftbit/types\";\nimport React from \"react\";\nimport { StyleProp, ViewStyle } from \"react-native\";\nimport YoutubePlayer from \"react-native-youtube-iframe\";\nimport { extractStyles } from \"../utilities\";\n\ntype Props = {\n videoId: string;\n playlist: string;\n style: StyleProp<ViewStyle>;\n mute: boolean;\n autoplay: boolean;\n};\n\nconst Youtube = ({ videoId, playlist, style, mute, autoplay }: Props) => {\n const {\n viewStyles: { height, width },\n } = extractStyles(style);\n\n return (\n <YoutubePlayer\n height={height}\n width={width}\n play={autoplay}\n videoId={videoId}\n playList={playlist}\n mute={mute}\n />\n );\n};\n\nexport default Youtube;\n\nexport const SEED_DATA = {\n name: \"Youtube\",\n tag: \"Youtube\",\n description: \"Youtube Component\",\n category: COMPONENT_TYPES.media,\n layout: {\n width: \"100%\",\n },\n props: {\n videoId: createTextProp({\n label: \"VideoId\",\n description: \"Youtube Video ID\",\n }),\n playlist: createTextProp({\n label: \"PlayList\",\n description: \"Playlist ID\",\n }),\n mute: createBoolProp({\n label: \"Mute\",\n description: \"Whether to mute video\",\n defaultValue: false,\n }),\n autoplay: createBoolProp({\n label: \"Autoplay\",\n description: \"Whether to Autoplay video\",\n defaultValue: false,\n }),\n },\n};\n"]}
@@ -1,43 +0,0 @@
1
- import { StyleProp, ViewStyle } from "react-native";
2
- declare type Props = {
3
- videoId: string;
4
- playlist: string;
5
- style: StyleProp<ViewStyle>;
6
- mute: boolean;
7
- autoplay: boolean;
8
- };
9
- declare const Youtube: ({ videoId, playlist, style, mute, autoplay }: Props) => JSX.Element;
10
- export default Youtube;
11
- export declare const SEED_DATA: {
12
- name: string;
13
- tag: string;
14
- description: string;
15
- category: string;
16
- layout: {
17
- width: string;
18
- };
19
- props: {
20
- videoId: any;
21
- playlist: any;
22
- mute: {
23
- label: string;
24
- description: string;
25
- formType: string;
26
- propType: string;
27
- defaultValue: boolean;
28
- editable: boolean;
29
- required: boolean;
30
- group: string;
31
- };
32
- autoplay: {
33
- label: string;
34
- description: string;
35
- formType: string;
36
- propType: string;
37
- defaultValue: boolean;
38
- editable: boolean;
39
- required: boolean;
40
- group: string;
41
- };
42
- };
43
- };
@@ -1,38 +0,0 @@
1
- import { COMPONENT_TYPES, createBoolProp, createTextProp, } from "@draftbit/types";
2
- import React from "react";
3
- import YoutubePlayer from "react-native-youtube-iframe";
4
- import { extractStyles } from "../utilities";
5
- const Youtube = ({ videoId, playlist, style, mute, autoplay }) => {
6
- const { viewStyles: { height, width }, } = extractStyles(style);
7
- return (React.createElement(YoutubePlayer, { height: height, width: width, play: autoplay, videoId: videoId, playList: playlist, mute: mute }));
8
- };
9
- export default Youtube;
10
- export const SEED_DATA = {
11
- name: "Youtube",
12
- tag: "Youtube",
13
- description: "Youtube Component",
14
- category: COMPONENT_TYPES.media,
15
- layout: {
16
- width: "100%",
17
- },
18
- props: {
19
- videoId: createTextProp({
20
- label: "VideoId",
21
- description: "Youtube Video ID",
22
- }),
23
- playlist: createTextProp({
24
- label: "PlayList",
25
- description: "Playlist ID",
26
- }),
27
- mute: createBoolProp({
28
- label: "Mute",
29
- description: "Whether to mute video",
30
- defaultValue: false,
31
- }),
32
- autoplay: createBoolProp({
33
- label: "Autoplay",
34
- description: "Whether to Autoplay video",
35
- defaultValue: false,
36
- }),
37
- },
38
- };
@@ -1,66 +0,0 @@
1
- import {
2
- COMPONENT_TYPES,
3
- createBoolProp,
4
- createTextProp,
5
- } from "@draftbit/types";
6
- import React from "react";
7
- import { StyleProp, ViewStyle } from "react-native";
8
- import YoutubePlayer from "react-native-youtube-iframe";
9
- import { extractStyles } from "../utilities";
10
-
11
- type Props = {
12
- videoId: string;
13
- playlist: string;
14
- style: StyleProp<ViewStyle>;
15
- mute: boolean;
16
- autoplay: boolean;
17
- };
18
-
19
- const Youtube = ({ videoId, playlist, style, mute, autoplay }: Props) => {
20
- const {
21
- viewStyles: { height, width },
22
- } = extractStyles(style);
23
-
24
- return (
25
- <YoutubePlayer
26
- height={height}
27
- width={width}
28
- play={autoplay}
29
- videoId={videoId}
30
- playList={playlist}
31
- mute={mute}
32
- />
33
- );
34
- };
35
-
36
- export default Youtube;
37
-
38
- export const SEED_DATA = {
39
- name: "Youtube",
40
- tag: "Youtube",
41
- description: "Youtube Component",
42
- category: COMPONENT_TYPES.media,
43
- layout: {
44
- width: "100%",
45
- },
46
- props: {
47
- videoId: createTextProp({
48
- label: "VideoId",
49
- description: "Youtube Video ID",
50
- }),
51
- playlist: createTextProp({
52
- label: "PlayList",
53
- description: "Playlist ID",
54
- }),
55
- mute: createBoolProp({
56
- label: "Mute",
57
- description: "Whether to mute video",
58
- defaultValue: false,
59
- }),
60
- autoplay: createBoolProp({
61
- label: "Autoplay",
62
- description: "Whether to Autoplay video",
63
- defaultValue: false,
64
- }),
65
- },
66
- };