@draftbit/core 46.2.4-17908.5 → 46.2.4-1a04f8.6

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 (37) hide show
  1. package/lib/commonjs/components/Button.js +32 -11
  2. package/lib/commonjs/components/CircleImage.js +16 -2
  3. package/lib/commonjs/components/Config.js +1 -1
  4. package/lib/commonjs/components/DeprecatedCardWrapper.js +17 -2
  5. package/lib/commonjs/components/Portal/PortalHost.js +27 -15
  6. package/lib/commonjs/components/SVG.js +4 -5
  7. package/lib/commonjs/components/TextField.js +63 -30
  8. package/lib/commonjs/components/Touchable.js +16 -2
  9. package/lib/commonjs/constants.js +1 -1
  10. package/lib/commonjs/index.js +0 -8
  11. package/lib/commonjs/mappings/SVG.js +2 -1
  12. package/lib/module/components/Config.js +1 -1
  13. package/lib/module/components/SVG.js +4 -5
  14. package/lib/module/index.js +1 -2
  15. package/lib/module/mappings/SVG.js +3 -2
  16. package/lib/typescript/src/components/SVG.d.ts +2 -2
  17. package/lib/typescript/src/index.d.ts +0 -1
  18. package/lib/typescript/src/mappings/SVG.d.ts +1 -0
  19. package/package.json +4 -6
  20. package/src/components/Config.js +1 -1
  21. package/src/components/Config.ts +1 -1
  22. package/src/components/SVG.js +4 -5
  23. package/src/components/SVG.tsx +7 -7
  24. package/src/index.js +0 -1
  25. package/src/index.tsx +0 -1
  26. package/src/mappings/SVG.js +8 -2
  27. package/src/mappings/SVG.ts +12 -2
  28. package/lib/commonjs/components/Youtube.js +0 -73
  29. package/lib/commonjs/mappings/Youtube.js +0 -42
  30. package/lib/module/components/Youtube.js +0 -59
  31. package/lib/module/mappings/Youtube.js +0 -33
  32. package/lib/typescript/src/components/Youtube.d.ts +0 -44
  33. package/lib/typescript/src/mappings/Youtube.d.ts +0 -36
  34. package/src/components/Youtube.js +0 -38
  35. package/src/components/Youtube.tsx +0 -66
  36. package/src/mappings/Youtube.js +0 -33
  37. package/src/mappings/Youtube.ts +0 -39
@@ -15,8 +15,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
15
15
 
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
 
18
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
-
20
18
  const CONSTANTS = {
21
19
  baseHeight: 42,
22
20
  borderRadius: 4,
@@ -73,7 +71,7 @@ function Base(_ref) {
73
71
  buttonStyles.justifyContent = "flex-end";
74
72
  }
75
73
 
76
- return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
74
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
77
75
  onPress: onPress,
78
76
  disabled: disabled || loading,
79
77
  style: _ref2 => {
@@ -83,8 +81,9 @@ function Base(_ref) {
83
81
  return [styles.base, {
84
82
  opacity: pressed || disabled ? 0.75 : 1
85
83
  }, buttonStyles];
86
- }
87
- }, props), loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
84
+ },
85
+ ...props
86
+ }, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
88
87
  size: "small",
89
88
  color: color,
90
89
  style: styles.loading
@@ -104,13 +103,14 @@ const Solid = _ref3 => {
104
103
  theme,
105
104
  ...props
106
105
  } = _ref3;
107
- return /*#__PURE__*/React.createElement(Base, _extends({
106
+ return /*#__PURE__*/React.createElement(Base, {
108
107
  style: [{
109
108
  color: "#FFF",
110
109
  borderRadius: theme.roundness,
111
110
  backgroundColor: theme.colors.primary
112
- }, style]
113
- }, props));
111
+ }, style],
112
+ ...props
113
+ });
114
114
  };
115
115
 
116
116
  const ButtonSolid = (0, _theming.withTheme)(Solid);
@@ -122,13 +122,14 @@ const Outline = _ref4 => {
122
122
  theme,
123
123
  ...props
124
124
  } = _ref4;
125
- return /*#__PURE__*/React.createElement(Base, _extends({
125
+ return /*#__PURE__*/React.createElement(Base, {
126
126
  style: [styles.outline, {
127
127
  borderRadius: theme.roundness,
128
128
  borderColor: theme.colors.primary,
129
129
  color: theme.colors.primary
130
- }, style]
131
- }, props));
130
+ }, style],
131
+ ...props
132
+ });
132
133
  };
133
134
 
134
135
  const ButtonOutline = (0, _theming.withTheme)(Outline);
@@ -176,4 +177,24 @@ const styles = _reactNative.StyleSheet.create({
176
177
  }
177
178
  })
178
179
  }
180
+ });nsparent",
181
+ padding: 0,
182
+ minHeight: undefined
183
+ },
184
+ loading: {
185
+ marginRight: 6
186
+ },
187
+ icon: { ..._reactNative.Platform.select({
188
+ web: {
189
+ marginTop: 1,
190
+ marginRight: 4,
191
+ alignSelf: "center"
192
+ },
193
+ default: {
194
+ marginBottom: 2,
195
+ marginRight: 4,
196
+ alignSelf: "center"
197
+ }
198
+ })
199
+ }
179
200
  });
@@ -17,8 +17,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
17
17
 
18
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
19
 
20
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
-
22
20
  const CircleImage = _ref => {
23
21
  let {
24
22
  source = _Config.default.placeholderImageURL,
@@ -27,6 +25,22 @@ const CircleImage = _ref => {
27
25
  ...props
28
26
  } = _ref;
29
27
  const borderRadius = size / 2;
28
+ return /*#__PURE__*/React.createElement(_reactNative.Image, {
29
+ style: [{
30
+ width: size,
31
+ height: size,
32
+ borderRadius
33
+ }, style],
34
+ source: typeof source === "string" ? {
35
+ uri: source
36
+ } : source,
37
+ resizeMode: "cover",
38
+ ...props
39
+ });
40
+ };
41
+
42
+ var _default = CircleImage;
43
+ exports.default = _default;size / 2;
30
44
  return /*#__PURE__*/React.createElement(_reactNative.Image, _extends({
31
45
  style: [{
32
46
  width: size,
@@ -62,7 +62,7 @@ var _default = {
62
62
  width: size.width,
63
63
  height: size.height
64
64
  }, "image-placeholder_1"),
65
- placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
65
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
66
66
  squareImageUrl: buildImageUrl({
67
67
  width: 100,
68
68
  height: 100
@@ -13,8 +13,6 @@ var _Touchable = _interopRequireDefault(require("./Touchable"));
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- 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); }
17
-
18
16
  const getWidth = numColumns => {
19
17
  switch (numColumns) {
20
18
  case 1:
@@ -37,6 +35,23 @@ const Card = _ref => {
37
35
  ...rest
38
36
  } = _ref;
39
37
  const width = getWidth(numColumns);
38
+ return /*#__PURE__*/_react.default.createElement(_Touchable.default, {
39
+ disabled: !onPress,
40
+ onPress: onPress,
41
+ style: [style, {
42
+ width
43
+ }],
44
+ ...rest
45
+ }, children);
46
+ };
47
+
48
+ var _default = (0, _theming.withTheme)(Card);
49
+
50
+ exports.default = _default;,
51
+ style,
52
+ ...rest
53
+ } = _ref;
54
+ const width = getWidth(numColumns);
40
55
  return /*#__PURE__*/_react.default.createElement(_Touchable.default, _extends({
41
56
  disabled: !onPress,
42
57
  onPress: onPress,
@@ -17,8 +17,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
17
17
 
18
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
19
 
20
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
-
22
20
  const PortalContext = /*#__PURE__*/React.createContext(null);
23
21
  /**
24
22
  * Portal host renders all of its children `Portal` elements.
@@ -51,11 +49,11 @@ class PortalHost extends React.Component {
51
49
  constructor() {
52
50
  super(...arguments);
53
51
 
54
- _defineProperty(this, "setManager", manager => {
52
+ this.setManager = manager => {
55
53
  this.manager = manager;
56
- });
54
+ };
57
55
 
58
- _defineProperty(this, "mount", children => {
56
+ this.mount = children => {
59
57
  const key = this.nextKey++;
60
58
 
61
59
  if (this.manager) {
@@ -69,9 +67,9 @@ class PortalHost extends React.Component {
69
67
  }
70
68
 
71
69
  return key;
72
- });
70
+ };
73
71
 
74
- _defineProperty(this, "update", (key, children) => {
72
+ this.update = (key, children) => {
75
73
  if (this.manager) {
76
74
  this.manager.update(key, children);
77
75
  } else {
@@ -89,9 +87,9 @@ class PortalHost extends React.Component {
89
87
  this.queue.push(op);
90
88
  }
91
89
  }
92
- });
90
+ };
93
91
 
94
- _defineProperty(this, "unmount", key => {
92
+ this.unmount = key => {
95
93
  if (this.manager) {
96
94
  this.manager.unmount(key);
97
95
  } else {
@@ -100,13 +98,10 @@ class PortalHost extends React.Component {
100
98
  key
101
99
  });
102
100
  }
103
- });
104
-
105
- _defineProperty(this, "nextKey", 0);
106
-
107
- _defineProperty(this, "queue", []);
101
+ };
108
102
 
109
- _defineProperty(this, "manager", void 0);
103
+ this.nextKey = 0;
104
+ this.queue = [];
110
105
  }
111
106
 
112
107
  componentDidMount() {
@@ -152,6 +147,23 @@ class PortalHost extends React.Component {
152
147
 
153
148
  }
154
149
 
150
+ exports.default = PortalHost;
151
+ PortalHost.displayName = "Portal.Host";
152
+
153
+ const styles = _reactNative.StyleSheet.create({
154
+ container: {
155
+ flex: 1
156
+ }
157
+ }); style: styles.container,
158
+ collapsable: false,
159
+ pointerEvents: "box-none"
160
+ }, this.props.children), /*#__PURE__*/React.createElement(_PortalManager.default, {
161
+ ref: this.setManager
162
+ }));
163
+ }
164
+
165
+ }
166
+
155
167
  exports.default = PortalHost;
156
168
 
157
169
  _defineProperty(PortalHost, "displayName", "Portal.Host");
@@ -21,26 +21,25 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
21
21
 
22
22
  const SVG = _ref => {
23
23
  let {
24
- source,
24
+ source = _Config.default.placeholderSvgURL,
25
25
  style
26
26
  } = _ref;
27
- let svgSource = source === null || source === undefined ? _Config.default.placeholderSvgURL : source;
28
27
  return /*#__PURE__*/React.createElement(React.Fragment, null, _reactNative.Platform.OS === "ios" && /*#__PURE__*/React.createElement(_reactNative.View, {
29
28
  style: style
30
29
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgUri, {
31
30
  width: "100%",
32
31
  height: "100%",
33
- uri: svgSource
32
+ uri: source
34
33
  })), _reactNative.Platform.OS === "android" && /*#__PURE__*/React.createElement(_reactNative.View, {
35
34
  style: style
36
35
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgUri, {
37
36
  width: "100%",
38
37
  height: "100%",
39
- uri: svgSource
38
+ uri: source
40
39
  })), _reactNative.Platform.OS === "web" && /*#__PURE__*/React.createElement(_reactNative.Image, {
41
40
  style: style,
42
41
  source: {
43
- uri: svgSource
42
+ uri: source
44
43
  }
45
44
  }));
46
45
  };
@@ -17,10 +17,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
17
17
 
18
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
19
 
20
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
-
22
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
-
24
20
  const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
25
21
 
26
22
  const FOCUS_ANIMATION_DURATION = 150;
@@ -30,8 +26,7 @@ const ICON_SIZE = 24;
30
26
  class TextField extends React.Component {
31
27
  constructor() {
32
28
  super(...arguments);
33
-
34
- _defineProperty(this, "state", {
29
+ this.state = {
35
30
  labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
36
31
  focused: false,
37
32
  placeholder: this.props.error ? this.props.placeholder : "",
@@ -39,36 +34,35 @@ class TextField extends React.Component {
39
34
  measured: false,
40
35
  width: 0
41
36
  }
42
- });
43
-
44
- _defineProperty(this, "_timer", setTimeout(() => {}, 0));
37
+ };
38
+ this._timer = setTimeout(() => {}, 0);
45
39
 
46
- _defineProperty(this, "_showPlaceholder", () => {
40
+ this._showPlaceholder = () => {
47
41
  clearTimeout(this._timer); // Set the placeholder in a delay to offset the label animation
48
42
  // If we show it immediately, they'll overlap and look ugly
49
43
 
50
44
  this._timer = setTimeout(() => this.setState({
51
45
  placeholder: this.props.placeholder
52
46
  }), 50);
53
- });
47
+ };
54
48
 
55
- _defineProperty(this, "_hidePlaceholder", () => this.setState({
49
+ this._hidePlaceholder = () => this.setState({
56
50
  placeholder: ""
57
- }));
51
+ });
58
52
 
59
- _defineProperty(this, "_restoreLabel", () => _reactNative.Animated.timing(this.state.labeled, {
53
+ this._restoreLabel = () => _reactNative.Animated.timing(this.state.labeled, {
60
54
  toValue: 1,
61
55
  duration: FOCUS_ANIMATION_DURATION,
62
56
  useNativeDriver: true
63
- }).start());
57
+ }).start();
64
58
 
65
- _defineProperty(this, "_minmizeLabel", () => _reactNative.Animated.timing(this.state.labeled, {
59
+ this._minmizeLabel = () => _reactNative.Animated.timing(this.state.labeled, {
66
60
  toValue: 0,
67
61
  duration: BLUR_ANIMATION_DURATION,
68
62
  useNativeDriver: true
69
- }).start());
63
+ }).start();
70
64
 
71
- _defineProperty(this, "_handleFocus", () => {
65
+ this._handleFocus = () => {
72
66
  if (this.props.disabled) {
73
67
  return;
74
68
  }
@@ -76,9 +70,9 @@ class TextField extends React.Component {
76
70
  this.setState({
77
71
  focused: true
78
72
  });
79
- });
73
+ };
80
74
 
81
- _defineProperty(this, "_handleBlur", () => {
75
+ this._handleBlur = () => {
82
76
  if (this.props.disabled) {
83
77
  return;
84
78
  }
@@ -86,9 +80,9 @@ class TextField extends React.Component {
86
80
  this.setState({
87
81
  focused: false
88
82
  });
89
- });
83
+ };
90
84
 
91
- _defineProperty(this, "_handleChangeText", value => {
85
+ this._handleChangeText = value => {
92
86
  if (this.props.disabled) {
93
87
  return;
94
88
  }
@@ -104,9 +98,9 @@ class TextField extends React.Component {
104
98
  });
105
99
  this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
106
100
  }
107
- });
101
+ };
108
102
 
109
- _defineProperty(this, "_root", undefined);
103
+ this._root = undefined;
110
104
  }
111
105
 
112
106
  static getDerivedStateFromProps(nextProps, prevState) {
@@ -157,10 +151,11 @@ class TextField extends React.Component {
157
151
  focused: !prevState.focused
158
152
  }));
159
153
  }
160
-
161
154
  /**
162
155
  * @internal
163
156
  */
157
+
158
+
164
159
  setNativeProps(args) {
165
160
  return this._root && this._root.setNativeProps(args);
166
161
  }
@@ -203,7 +198,8 @@ class TextField extends React.Component {
203
198
  roundness,
204
199
  disabledOpacity
205
200
  },
206
- render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, props),
201
+ render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, { ...props
202
+ }),
207
203
  ...rest
208
204
  } = this.props;
209
205
  const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
@@ -357,9 +353,9 @@ class TextField extends React.Component {
357
353
 
358
354
  return /*#__PURE__*/React.createElement(_reactNative.View, {
359
355
  style: [styles.container, styleProp]
360
- }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
356
+ }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, { ...leftIconProps,
361
357
  style: leftIconStyle
362
- })) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
358
+ }) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
363
359
  style: (0, _utilities.applyStyles)([containerStyle], {
364
360
  height: style === null || style === void 0 ? void 0 : style.height,
365
361
  backgroundColor: bgColor,
@@ -426,9 +422,9 @@ class TextField extends React.Component {
426
422
  style: {
427
423
  justifyContent: type === "solid" ? "center" : undefined
428
424
  }
429
- }, /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
425
+ }, /*#__PURE__*/React.createElement(Icon, { ...leftIconProps,
430
426
  style: leftIconStyle
431
- }))) : null, render({
427
+ })) : null, render({
432
428
  ref: c => {
433
429
  this._root = c;
434
430
  },
@@ -469,6 +465,43 @@ var _default = (0, _theming.withTheme)(TextField);
469
465
 
470
466
  exports.default = _default;
471
467
 
468
+ const styles = _reactNative.StyleSheet.create({
469
+ container: {
470
+ alignSelf: "stretch"
471
+ },
472
+ placeholder: {
473
+ position: "absolute",
474
+ left: 0
475
+ },
476
+ underline: {
477
+ position: "absolute",
478
+ left: 0,
479
+ right: 0,
480
+ bottom: 0,
481
+ height: 2
482
+ },
483
+ input: {
484
+ flexGrow: 1,
485
+ justifyContent: "center",
486
+ textAlignVertical: "center",
487
+ margin: 0,
488
+ textAlign: _reactNative.I18nManager.isRTL ? "right" : "left"
489
+ }
490
+ });? /*#__PURE__*/React.createElement(_reactNative.Text, {
491
+ style: [{
492
+ color: error ? colors.error : colors.light,
493
+ marginTop: 8,
494
+ marginLeft: assistiveTextLeftMargin
495
+ }]
496
+ }, assistiveText) : null);
497
+ }
498
+
499
+ }
500
+
501
+ var _default = (0, _theming.withTheme)(TextField);
502
+
503
+ exports.default = _default;
504
+
472
505
  const styles = _reactNative.StyleSheet.create({
473
506
  container: {
474
507
  alignSelf: "stretch"
@@ -11,8 +11,6 @@ var _reactNative = require("react-native");
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15
-
16
14
  function Touchable(_ref) {
17
15
  let {
18
16
  children,
@@ -21,6 +19,22 @@ function Touchable(_ref) {
21
19
  style,
22
20
  ...props
23
21
  } = _ref;
22
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
23
+ onPress: onPress,
24
+ disabled: disabled,
25
+ hitSlop: 8,
26
+ style: _ref2 => {
27
+ let {
28
+ pressed
29
+ } = _ref2;
30
+ return [{
31
+ opacity: pressed || disabled ? 0.75 : 1
32
+ }, style];
33
+ },
34
+ ...props
35
+ }, children);
36
+ }rops
37
+ } = _ref;
24
38
  return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
25
39
  onPress: onPress,
26
40
  disabled: disabled,
@@ -16,4 +16,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
16
16
  ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
17
17
  });
18
18
 
19
- exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
19
+ exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;AR_HEIGHT;
@@ -393,12 +393,6 @@ Object.defineProperty(exports, "Touchable", {
393
393
  return _Touchable.default;
394
394
  }
395
395
  });
396
- Object.defineProperty(exports, "Youtube", {
397
- enumerable: true,
398
- get: function () {
399
- return _Youtube.default;
400
- }
401
- });
402
396
  Object.defineProperty(exports, "injectIcon", {
403
397
  enumerable: true,
404
398
  get: function () {
@@ -518,8 +512,6 @@ var _Stepper = _interopRequireDefault(require("./components/Stepper"));
518
512
 
519
513
  var _useAuthState = require("./components/useAuthState");
520
514
 
521
- var _Youtube = _interopRequireDefault(require("./components/Youtube"));
522
-
523
515
  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); }
524
516
 
525
517
  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; }
@@ -16,8 +16,9 @@ const SEED_DATA = {
16
16
  width: 100,
17
17
  height: 100
18
18
  },
19
+ stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
19
20
  props: {
20
- source: (0, _types.createSvgProp)()
21
+ source: (0, _types.createSVGProp)()
21
22
  }
22
23
  };
23
24
  exports.SEED_DATA = SEED_DATA;
@@ -54,7 +54,7 @@ export default {
54
54
  width: size.width,
55
55
  height: size.height
56
56
  }, "image-placeholder_1"),
57
- placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
57
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
58
58
  squareImageUrl: buildImageUrl({
59
59
  width: 100,
60
60
  height: 100
@@ -5,26 +5,25 @@ import Config from "./Config";
5
5
 
6
6
  const SVG = _ref => {
7
7
  let {
8
- source,
8
+ source = Config.placeholderSvgURL,
9
9
  style
10
10
  } = _ref;
11
- let svgSource = source === null || source === undefined ? Config.placeholderSvgURL : source;
12
11
  return /*#__PURE__*/React.createElement(React.Fragment, null, Platform.OS === "ios" && /*#__PURE__*/React.createElement(View, {
13
12
  style: style
14
13
  }, /*#__PURE__*/React.createElement(SvgUri, {
15
14
  width: "100%",
16
15
  height: "100%",
17
- uri: svgSource
16
+ uri: source
18
17
  })), Platform.OS === "android" && /*#__PURE__*/React.createElement(View, {
19
18
  style: style
20
19
  }, /*#__PURE__*/React.createElement(SvgUri, {
21
20
  width: "100%",
22
21
  height: "100%",
23
- uri: svgSource
22
+ uri: source
24
23
  })), Platform.OS === "web" && /*#__PURE__*/React.createElement(Image, {
25
24
  style: style,
26
25
  source: {
27
- uri: svgSource
26
+ uri: source
28
27
  }
29
28
  }));
30
29
  };
@@ -50,5 +50,4 @@ export { default as RowHeadlineImageCaption } from "./components/RowHeadlineImag
50
50
  export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIcon";
51
51
  export { default as Slider } from "./components/Slider";
52
52
  export { default as Stepper } from "./components/Stepper";
53
- export { useAuthState } from "./components/useAuthState";
54
- export { default as Youtube } from "./components/Youtube"; // a comment to fix sourcemap comment issue
53
+ export { useAuthState } from "./components/useAuthState"; // a comment to fix sourcemap comment issue
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createSvgProp } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createSVGProp, StylesPanelSections } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "SVG",
4
4
  tag: "SVG",
@@ -8,7 +8,8 @@ export const SEED_DATA = {
8
8
  width: 100,
9
9
  height: 100
10
10
  },
11
+ stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Effects],
11
12
  props: {
12
- source: createSvgProp()
13
+ source: createSVGProp()
13
14
  }
14
15
  };
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import { StyleProp, ImageStyle } from "react-native";
3
3
  declare type SVGComponentProps = {
4
4
  source: string;
5
5
  style?: StyleProp<ImageStyle>;
6
6
  };
7
- declare const SVG: ({ source, style }: SVGComponentProps) => JSX.Element;
7
+ declare const SVG: React.FC<React.PropsWithChildren<SVGComponentProps>>;
8
8
  export default SVG;
@@ -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";
@@ -7,6 +7,7 @@ export declare const SEED_DATA: {
7
7
  width: number;
8
8
  height: number;
9
9
  };
10
+ stylesPanelSections: string[];
10
11
  props: {
11
12
  source: {
12
13
  label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-017908.5+017908e8",
3
+ "version": "46.2.4-1a04f8.6+1a04f8a2",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -53,11 +53,9 @@
53
53
  "lodash.omit": "^4.5.0",
54
54
  "lodash.tonumber": "^4.0.3",
55
55
  "react-native-modal-datetime-picker": "^13.0.0",
56
- "react-native-svg": "^12.3.0",
56
+ "react-native-svg": "12.3.0",
57
57
  "react-native-typography": "^1.4.1",
58
- "react-native-web-swiper": "^2.2.3",
59
- "react-native-web-webview": "^1.0.2",
60
- "react-native-youtube-iframe": "^2.2.2"
58
+ "react-native-web-swiper": "^2.2.3"
61
59
  },
62
60
  "devDependencies": {
63
61
  "@types/color": "^3.0.1",
@@ -82,5 +80,5 @@
82
80
  ]
83
81
  ]
84
82
  },
85
- "gitHead": "017908e83d703431ff70ab9fe9a241a7e86d5ee1"
83
+ "gitHead": "1a04f8a2303a4a172ea71e68277fa5a38d8dd7f1"
86
84
  }
@@ -42,7 +42,7 @@ export default {
42
42
  cardIconElevation: 1,
43
43
  placeholderImageURL: "https://static.draftbit.com/images/placeholder-image" + getExtension(),
44
44
  getPlaceholderImageUrl: (size) => buildImageUrl({ width: size.width, height: size.height }, "image-placeholder_1"),
45
- placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
45
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
46
46
  squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
47
47
  FABSize: 40,
48
48
  FABBorderRadius: 20,
@@ -60,7 +60,7 @@ export default {
60
60
  { width: size.width, height: size.height },
61
61
  "image-placeholder_1"
62
62
  ),
63
- placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
63
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
64
64
  squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
65
65
  FABSize: 40,
66
66
  FABBorderRadius: 20,
@@ -2,13 +2,12 @@ import * as React from "react";
2
2
  import { View, Platform, Image } from "react-native";
3
3
  import { SvgUri } from "react-native-svg";
4
4
  import Config from "./Config";
5
- const SVG = ({ source, style }) => {
6
- let svgSource = source === null || source === undefined ? Config.placeholderSvgURL : source;
5
+ const SVG = ({ source = Config.placeholderSvgURL, style, }) => {
7
6
  return (React.createElement(React.Fragment, null,
8
7
  Platform.OS === "ios" && (React.createElement(View, { style: style },
9
- React.createElement(SvgUri, { width: "100%", height: "100%", uri: svgSource }))),
8
+ React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
10
9
  Platform.OS === "android" && (React.createElement(View, { style: style },
11
- React.createElement(SvgUri, { width: "100%", height: "100%", uri: svgSource }))),
12
- Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: svgSource } }))));
10
+ React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
11
+ Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: source } }))));
13
12
  };
14
13
  export default SVG;
@@ -9,24 +9,24 @@ type SVGComponentProps = {
9
9
  style?: StyleProp<ImageStyle>;
10
10
  };
11
11
 
12
- const SVG = ({ source, style }: SVGComponentProps) => {
13
- let svgSource =
14
- source === null || source === undefined ? Config.placeholderSvgURL : source;
15
-
12
+ const SVG: React.FC<React.PropsWithChildren<SVGComponentProps>> = ({
13
+ source = Config.placeholderSvgURL,
14
+ style,
15
+ }) => {
16
16
  return (
17
17
  <>
18
18
  {Platform.OS === "ios" && (
19
19
  <View style={style}>
20
- <SvgUri width="100%" height="100%" uri={svgSource} />
20
+ <SvgUri width="100%" height="100%" uri={source} />
21
21
  </View>
22
22
  )}
23
23
  {Platform.OS === "android" && (
24
24
  <View style={style}>
25
- <SvgUri width="100%" height="100%" uri={svgSource} />
25
+ <SvgUri width="100%" height="100%" uri={source} />
26
26
  </View>
27
27
  )}
28
28
  {Platform.OS === "web" && (
29
- <Image style={style} source={{ uri: svgSource }} />
29
+ <Image style={style} source={{ uri: source }} />
30
30
  )}
31
31
  </>
32
32
  );
package/src/index.js CHANGED
@@ -50,5 +50,4 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
50
50
  export { default as Slider } from "./components/Slider";
51
51
  export { default as Stepper } from "./components/Stepper";
52
52
  export { useAuthState } from "./components/useAuthState";
53
- export { default as Youtube } from "./components/Youtube";
54
53
  // a comment to fix sourcemap comment issue
package/src/index.tsx CHANGED
@@ -70,6 +70,5 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
70
70
  export { default as Slider } from "./components/Slider";
71
71
  export { default as Stepper } from "./components/Stepper";
72
72
  export { useAuthState } from "./components/useAuthState";
73
- export { default as Youtube } from "./components/Youtube";
74
73
 
75
74
  // a comment to fix sourcemap comment issue
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createSvgProp } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createSVGProp, StylesPanelSections, } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "SVG",
4
4
  tag: "SVG",
@@ -8,7 +8,13 @@ export const SEED_DATA = {
8
8
  width: 100,
9
9
  height: 100,
10
10
  },
11
+ stylesPanelSections: [
12
+ StylesPanelSections.Size,
13
+ StylesPanelSections.Margins,
14
+ StylesPanelSections.Position,
15
+ StylesPanelSections.Effects,
16
+ ],
11
17
  props: {
12
- source: createSvgProp(),
18
+ source: createSVGProp(),
13
19
  },
14
20
  };
@@ -1,4 +1,8 @@
1
- import { COMPONENT_TYPES, createSvgProp } from "@draftbit/types";
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createSVGProp,
4
+ StylesPanelSections,
5
+ } from "@draftbit/types";
2
6
 
3
7
  export const SEED_DATA = {
4
8
  name: "SVG",
@@ -9,7 +13,13 @@ export const SEED_DATA = {
9
13
  width: 100,
10
14
  height: 100,
11
15
  },
16
+ stylesPanelSections: [
17
+ StylesPanelSections.Size,
18
+ StylesPanelSections.Margins,
19
+ StylesPanelSections.Position,
20
+ StylesPanelSections.Effects,
21
+ ],
12
22
  props: {
13
- source: createSvgProp(),
23
+ source: createSVGProp(),
14
24
  },
15
25
  };
@@ -1,73 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.SEED_DATA = void 0;
7
-
8
- var _types = require("@draftbit/types");
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _reactNativeYoutubeIframe = _interopRequireDefault(require("react-native-youtube-iframe"));
13
-
14
- var _utilities = require("../utilities");
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- const Youtube = _ref => {
19
- let {
20
- videoId,
21
- playlist,
22
- style,
23
- mute,
24
- autoplay
25
- } = _ref;
26
- const {
27
- viewStyles: {
28
- height,
29
- width
30
- }
31
- } = (0, _utilities.extractStyles)(style);
32
- return /*#__PURE__*/_react.default.createElement(_reactNativeYoutubeIframe.default, {
33
- height: height,
34
- width: width,
35
- play: autoplay,
36
- videoId: videoId,
37
- playList: playlist,
38
- mute: mute
39
- });
40
- };
41
-
42
- var _default = Youtube;
43
- exports.default = _default;
44
- const SEED_DATA = {
45
- name: "Youtube",
46
- tag: "Youtube",
47
- description: "Youtube Component",
48
- category: _types.COMPONENT_TYPES.media,
49
- layout: {
50
- width: "100%"
51
- },
52
- props: {
53
- videoId: (0, _types.createTextProp)({
54
- label: "VideoId",
55
- description: "Youtube Video ID"
56
- }),
57
- playlist: (0, _types.createTextProp)({
58
- label: "PlayList",
59
- description: "Playlist ID"
60
- }),
61
- mute: (0, _types.createBoolProp)({
62
- label: "Mute",
63
- description: "Whether to mute video",
64
- defaultValue: false
65
- }),
66
- autoplay: (0, _types.createBoolProp)({
67
- label: "Autoplay",
68
- description: "Whether to Autoplay video",
69
- defaultValue: false
70
- })
71
- }
72
- };
73
- exports.SEED_DATA = SEED_DATA;
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SEED_DATA = void 0;
7
-
8
- var _types = require("@draftbit/types");
9
-
10
- const SEED_DATA = {
11
- name: "Youtube",
12
- tag: "Youtube",
13
- description: "Given a VideoId orPlaylist and play Youtube video",
14
- doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
15
- code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
16
- category: _types.COMPONENT_TYPES.media,
17
- stylesPanelSections: [_types.StylesPanelSections.Size],
18
- layout: {
19
- height: 250
20
- },
21
- props: {
22
- videoId: (0, _types.createTextProp)({
23
- label: "Video ID",
24
- description: "VideoId of the Youtube video.",
25
- defaultValue: "nwMUpDESXrI"
26
- }),
27
- playlist: (0, _types.createTextProp)({
28
- label: "Playlist",
29
- description: "Playlist of the Youtube videos.",
30
- defaultValue: "PLUa6TiXzjIrwowt6P-uGCJm8ovm-9S1Ks"
31
- }),
32
- mute: (0, _types.createStaticBoolProp)({
33
- label: "Mute Audio",
34
- description: "Mute the audio of the video."
35
- }),
36
- autoplay: (0, _types.createStaticBoolProp)({
37
- label: "Auto Play",
38
- description: "Autoplay the video on load."
39
- })
40
- }
41
- };
42
- exports.SEED_DATA = SEED_DATA;
@@ -1,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 = _ref => {
7
- let {
8
- videoId,
9
- playlist,
10
- style,
11
- mute,
12
- autoplay
13
- } = _ref;
14
- const {
15
- viewStyles: {
16
- height,
17
- width
18
- }
19
- } = extractStyles(style);
20
- return /*#__PURE__*/React.createElement(YoutubePlayer, {
21
- height: height,
22
- width: width,
23
- play: autoplay,
24
- videoId: videoId,
25
- playList: playlist,
26
- mute: mute
27
- });
28
- };
29
-
30
- export default Youtube;
31
- export const SEED_DATA = {
32
- name: "Youtube",
33
- tag: "Youtube",
34
- description: "Youtube Component",
35
- category: COMPONENT_TYPES.media,
36
- layout: {
37
- width: "100%"
38
- },
39
- props: {
40
- videoId: createTextProp({
41
- label: "VideoId",
42
- description: "Youtube Video ID"
43
- }),
44
- playlist: createTextProp({
45
- label: "PlayList",
46
- description: "Playlist ID"
47
- }),
48
- mute: createBoolProp({
49
- label: "Mute",
50
- description: "Whether to mute video",
51
- defaultValue: false
52
- }),
53
- autoplay: createBoolProp({
54
- label: "Autoplay",
55
- description: "Whether to Autoplay video",
56
- defaultValue: false
57
- })
58
- }
59
- };
@@ -1,33 +0,0 @@
1
- import { COMPONENT_TYPES, createStaticBoolProp, createTextProp, StylesPanelSections } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Youtube",
4
- tag: "Youtube",
5
- description: "Given a VideoId orPlaylist and play Youtube video",
6
- doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
7
- code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
8
- category: COMPONENT_TYPES.media,
9
- stylesPanelSections: [StylesPanelSections.Size],
10
- layout: {
11
- height: 250
12
- },
13
- props: {
14
- videoId: createTextProp({
15
- label: "Video ID",
16
- description: "VideoId of the Youtube video.",
17
- defaultValue: "nwMUpDESXrI"
18
- }),
19
- playlist: createTextProp({
20
- label: "Playlist",
21
- description: "Playlist of the Youtube videos.",
22
- defaultValue: "PLUa6TiXzjIrwowt6P-uGCJm8ovm-9S1Ks"
23
- }),
24
- mute: createStaticBoolProp({
25
- label: "Mute Audio",
26
- description: "Mute the audio of the video."
27
- }),
28
- autoplay: createStaticBoolProp({
29
- label: "Auto Play",
30
- description: "Autoplay the video on load."
31
- })
32
- }
33
- };
@@ -1,44 +0,0 @@
1
- /// <reference types="react" />
2
- import { StyleProp, ViewStyle } from "react-native";
3
- declare type Props = {
4
- videoId: string;
5
- playlist: string;
6
- style: StyleProp<ViewStyle>;
7
- mute: boolean;
8
- autoplay: boolean;
9
- };
10
- declare const Youtube: ({ videoId, playlist, style, mute, autoplay }: Props) => JSX.Element;
11
- export default Youtube;
12
- export declare const SEED_DATA: {
13
- name: string;
14
- tag: string;
15
- description: string;
16
- category: string;
17
- layout: {
18
- width: string;
19
- };
20
- props: {
21
- videoId: any;
22
- playlist: any;
23
- mute: {
24
- label: string;
25
- description: string;
26
- formType: string;
27
- propType: string;
28
- defaultValue: boolean;
29
- editable: boolean;
30
- required: boolean;
31
- group: string;
32
- };
33
- autoplay: {
34
- label: string;
35
- description: string;
36
- formType: string;
37
- propType: string;
38
- defaultValue: boolean;
39
- editable: boolean;
40
- required: boolean;
41
- group: string;
42
- };
43
- };
44
- };
@@ -1,36 +0,0 @@
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
- };
@@ -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
- };
@@ -1,33 +0,0 @@
1
- import { COMPONENT_TYPES, createStaticBoolProp, createTextProp, StylesPanelSections, } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Youtube",
4
- tag: "Youtube",
5
- description: "Given a VideoId orPlaylist and play Youtube video",
6
- doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
7
- code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
8
- category: COMPONENT_TYPES.media,
9
- stylesPanelSections: [StylesPanelSections.Size],
10
- layout: {
11
- height: 250,
12
- },
13
- props: {
14
- videoId: createTextProp({
15
- label: "Video ID",
16
- description: "VideoId of the Youtube video.",
17
- defaultValue: "nwMUpDESXrI",
18
- }),
19
- playlist: createTextProp({
20
- label: "Playlist",
21
- description: "Playlist of the Youtube videos.",
22
- defaultValue: "PLUa6TiXzjIrwowt6P-uGCJm8ovm-9S1Ks",
23
- }),
24
- mute: createStaticBoolProp({
25
- label: "Mute Audio",
26
- description: "Mute the audio of the video.",
27
- }),
28
- autoplay: createStaticBoolProp({
29
- label: "Auto Play",
30
- description: "Autoplay the video on load.",
31
- }),
32
- },
33
- };
@@ -1,39 +0,0 @@
1
- import {
2
- COMPONENT_TYPES,
3
- createStaticBoolProp,
4
- createTextProp,
5
- StylesPanelSections,
6
- } from "@draftbit/types";
7
-
8
- export const SEED_DATA = {
9
- name: "Youtube",
10
- tag: "Youtube",
11
- description: "Given a VideoId orPlaylist and play Youtube video",
12
- doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
13
- code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
14
- category: COMPONENT_TYPES.media,
15
- stylesPanelSections: [StylesPanelSections.Size],
16
- layout: {
17
- height: 250,
18
- },
19
- props: {
20
- videoId: createTextProp({
21
- label: "Video ID",
22
- description: "VideoId of the Youtube video.",
23
- defaultValue: "nwMUpDESXrI",
24
- }),
25
- playlist: createTextProp({
26
- label: "Playlist",
27
- description: "Playlist of the Youtube videos.",
28
- defaultValue: "PLUa6TiXzjIrwowt6P-uGCJm8ovm-9S1Ks",
29
- }),
30
- mute: createStaticBoolProp({
31
- label: "Mute Audio",
32
- description: "Mute the audio of the video.",
33
- }),
34
- autoplay: createStaticBoolProp({
35
- label: "Auto Play",
36
- description: "Autoplay the video on load.",
37
- }),
38
- },
39
- };