@draftbit/core 46.2.4-a3d00e.4 → 46.2.4-a572b7.5

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 (78) hide show
  1. package/lib/commonjs/components/AnimatedCircularProgress.js +12 -2
  2. package/lib/commonjs/components/Banner.js +24 -4
  3. package/lib/commonjs/components/CardBlock.js +15 -5
  4. package/lib/commonjs/components/CardContainer.js +15 -5
  5. package/lib/commonjs/components/CardContainerRating.js +15 -5
  6. package/lib/commonjs/components/CardContainerShortImage.js +17 -5
  7. package/lib/commonjs/components/Carousel.js +34 -10
  8. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +24 -6
  9. package/lib/commonjs/components/Checkbox/context.js +1 -1
  10. package/lib/commonjs/components/CircleImage.js +16 -2
  11. package/lib/commonjs/components/CircularProgress.js +15 -7
  12. package/lib/commonjs/components/Config.js +1 -1
  13. package/lib/commonjs/components/Container.js +17 -5
  14. package/lib/commonjs/components/DeprecatedCardWrapper.js +17 -2
  15. package/lib/commonjs/components/DeprecatedFAB.js +22 -4
  16. package/lib/commonjs/components/Elevation.js +15 -3
  17. package/lib/commonjs/components/FAB.js +20 -5
  18. package/lib/commonjs/components/FormRow.js +17 -3
  19. package/lib/commonjs/components/Image.js +16 -3
  20. package/lib/commonjs/components/NumberInput.js +13 -2
  21. package/lib/commonjs/components/Picker/PickerComponent.ios.js +42 -13
  22. package/lib/commonjs/components/Portal/PortalHost.js +27 -15
  23. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +16 -3
  24. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +24 -6
  25. package/lib/commonjs/components/SVG.js +4 -5
  26. package/lib/commonjs/components/ScreenContainer.js +23 -5
  27. package/lib/commonjs/components/Slider.js +24 -5
  28. package/lib/commonjs/components/StarRating.js +25 -5
  29. package/lib/commonjs/components/Surface.js +14 -3
  30. package/lib/commonjs/components/Text.js +37 -11
  31. package/lib/commonjs/components/TextField.js +63 -30
  32. package/lib/commonjs/components/Touchable.js +16 -2
  33. package/lib/commonjs/index.js +0 -14
  34. package/lib/commonjs/mappings/MapView.js +1 -0
  35. package/lib/commonjs/mappings/SVG.js +2 -0
  36. package/lib/module/components/Config.js +1 -1
  37. package/lib/module/components/Picker/PickerComponent.android.js +23 -5
  38. package/lib/module/components/ProgressBar.js +23 -7
  39. package/lib/module/components/SVG.js +4 -5
  40. package/lib/module/components/Surface.js +16 -2
  41. package/lib/module/index.js +0 -1
  42. package/lib/module/mappings/MapView.js +1 -0
  43. package/lib/module/mappings/SVG.js +3 -1
  44. package/lib/typescript/src/components/SVG.d.ts +3 -3
  45. package/lib/typescript/src/index.d.ts +0 -1
  46. package/lib/typescript/src/mappings/MapView.d.ts +1 -0
  47. package/lib/typescript/src/mappings/SVG.d.ts +2 -0
  48. package/package.json +3 -5
  49. package/src/components/Config.js +1 -1
  50. package/src/components/Config.ts +1 -1
  51. package/src/components/SVG.js +4 -5
  52. package/src/components/SVG.tsx +8 -8
  53. package/src/index.js +0 -1
  54. package/src/index.tsx +0 -1
  55. package/src/mappings/MapView.js +1 -0
  56. package/src/mappings/MapView.ts +1 -0
  57. package/src/mappings/SVG.js +8 -1
  58. package/src/mappings/SVG.ts +12 -1
  59. package/lib/commonjs/components/TabView/TabView.js +0 -102
  60. package/lib/commonjs/components/TabView/TabViewItem.js +0 -26
  61. package/lib/commonjs/components/TabView/index.js +0 -23
  62. package/lib/commonjs/mappings/TabView.js +0 -79
  63. package/lib/module/components/TabView/TabView.js +0 -87
  64. package/lib/module/components/TabView/TabViewItem.js +0 -18
  65. package/lib/module/components/TabView/index.js +0 -2
  66. package/lib/module/mappings/TabView.js +0 -70
  67. package/lib/typescript/src/components/TabView/TabView.d.ts +0 -19
  68. package/lib/typescript/src/components/TabView/TabViewItem.d.ts +0 -10
  69. package/lib/typescript/src/components/TabView/index.d.ts +0 -2
  70. package/lib/typescript/src/mappings/TabView.d.ts +0 -111
  71. package/src/components/TabView/TabView.js +0 -34
  72. package/src/components/TabView/TabView.tsx +0 -97
  73. package/src/components/TabView/TabViewItem.js +0 -5
  74. package/src/components/TabView/TabViewItem.tsx +0 -21
  75. package/src/components/TabView/index.js +0 -2
  76. package/src/components/TabView/index.ts +0 -2
  77. package/src/mappings/TabView.js +0 -73
  78. package/src/mappings/TabView.ts +0 -80
@@ -15,17 +15,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
15
15
 
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
 
18
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
-
20
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
-
22
18
  class Text extends React.Component {
23
- constructor() {
24
- super(...arguments);
25
-
26
- _defineProperty(this, "_root", void 0);
27
- }
28
-
29
19
  setNativeProps(args) {
30
20
  return this._root && this._root.setNativeProps(args);
31
21
  }
@@ -36,7 +26,43 @@ class Text extends React.Component {
36
26
  ...rest
37
27
  } = this.props;
38
28
  const writingDirection = _reactNative.I18nManager.isRTL ? "rtl" : "ltr";
39
- return /*#__PURE__*/React.createElement(_reactNative.Text, _extends({}, rest, {
29
+ return /*#__PURE__*/React.createElement(_reactNative.Text, { ...rest,
30
+ ref: c => {
31
+ this._root = c;
32
+ },
33
+ style: [{
34
+ textAlign: "left",
35
+ writingDirection
36
+ }, style]
37
+ });
38
+ }
39
+
40
+ }
41
+
42
+ const BaseLink = _ref => {
43
+ let {
44
+ style,
45
+ theme,
46
+ title,
47
+ ...props
48
+ } = _ref;
49
+ return /*#__PURE__*/React.createElement(Text, {
50
+ hitSlop: 8,
51
+ style: [{
52
+ color: theme.colors.primary
53
+ }, style],
54
+ theme: theme,
55
+ ...props
56
+ }, title);
57
+ };
58
+
59
+ exports.BaseLink = BaseLink;
60
+ const Link = (0, _theming.withTheme)(BaseLink);
61
+ exports.Link = Link;
62
+
63
+ var _default = (0, _theming.withTheme)(Text);
64
+
65
+ exports.default = _default;/React.createElement(_reactNative.Text, _extends({}, rest, {
40
66
  ref: c => {
41
67
  this._root = c;
42
68
  },
@@ -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,
@@ -369,18 +369,6 @@ Object.defineProperty(exports, "SwitchRow", {
369
369
  return _Switch.SwitchRow;
370
370
  }
371
371
  });
372
- Object.defineProperty(exports, "TabView", {
373
- enumerable: true,
374
- get: function () {
375
- return _TabView.TabView;
376
- }
377
- });
378
- Object.defineProperty(exports, "TabViewItem", {
379
- enumerable: true,
380
- get: function () {
381
- return _TabView.TabViewItem;
382
- }
383
- });
384
372
  Object.defineProperty(exports, "TextField", {
385
373
  enumerable: true,
386
374
  get: function () {
@@ -484,8 +472,6 @@ var _ActionSheet = require("./components/ActionSheet");
484
472
 
485
473
  var _Swiper = require("./components/Swiper");
486
474
 
487
- var _TabView = require("./components/TabView");
488
-
489
475
  var _Layout = require("./components/Layout");
490
476
 
491
477
  var _index = require("./components/RadioButton/index");
@@ -61,6 +61,7 @@ const SEED_DATA = {
61
61
  label: "Map Type",
62
62
  description: "The type of map to show",
63
63
  group: _types.GROUPS.basic,
64
+ editable: true,
64
65
  formType: _types.FORM_TYPES.flatArray,
65
66
  propType: _types.PROP_TYPES.STRING,
66
67
  required: false,
@@ -11,11 +11,13 @@ const SEED_DATA = {
11
11
  name: "SVG",
12
12
  tag: "SVG",
13
13
  description: "An SVG component",
14
+ packageName: "@draftbit/core",
14
15
  category: _types.COMPONENT_TYPES.media,
15
16
  layout: {
16
17
  width: 100,
17
18
  height: 100
18
19
  },
20
+ stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
19
21
  props: {
20
22
  source: (0, _types.createSvgProp)()
21
23
  }
@@ -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
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import * as React from "react";
4
2
  import { View, StyleSheet } from "react-native";
5
3
  import omit from "lodash.omit";
@@ -10,8 +8,6 @@ import TextField from "../TextField";
10
8
  import Touchable from "../Touchable";
11
9
 
12
10
  const Picker = _ref => {
13
- var _options$find$label, _options$find;
14
-
15
11
  let {
16
12
  style,
17
13
  options,
@@ -21,6 +17,9 @@ const Picker = _ref => {
21
17
  onValueChange: onValueChangeOverride = () => {},
22
18
  ...props
23
19
  } = _ref;
20
+
21
+ var _a, _b;
22
+
24
23
  const {
25
24
  viewStyles: {
26
25
  borderRadius,
@@ -67,7 +66,7 @@ const Picker = _ref => {
67
66
  };
68
67
 
69
68
  const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
70
- const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
69
+ const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
71
70
  return /*#__PURE__*/React.createElement(Touchable, {
72
71
  disabled: disabled,
73
72
  onPress: toggleFocus,
@@ -89,6 +88,25 @@ const Picker = _ref => {
89
88
  label: o.label,
90
89
  value: o.value,
91
90
  key: o.value
91
+ }))), /*#__PURE__*/React.createElement(View, {
92
+ pointerEvents: "none"
93
+ }, /*#__PURE__*/React.createElement(TextField, { ...props,
94
+ value: selectedLabel,
95
+ placeholder: placeholder,
96
+ // @ts-ignore
97
+ ref: textField,
98
+ disabled: disabled,
99
+ // @ts-expect-error
100
+ style: stylesWithoutMargin
101
+ }))));
102
+ };
103
+
104
+ const styles = StyleSheet.create({
105
+ container: {
106
+ alignSelf: "stretch"
107
+ }
108
+ });
109
+ export default withTheme(Picker); key: o.value
92
110
  }))), /*#__PURE__*/React.createElement(View, {
93
111
  pointerEvents: "none"
94
112
  }, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
@@ -1,7 +1,3 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
-
5
1
  import React, { Component } from "react";
6
2
  import { Animated, Easing, View, I18nManager } from "react-native";
7
3
  const INDETERMINATE_WIDTH_FACTOR = 0.3;
@@ -10,7 +6,7 @@ export default class ProgressBar extends Component {
10
6
  constructor(props) {
11
7
  super(props);
12
8
 
13
- _defineProperty(this, "handleLayout", event => {
9
+ this.handleLayout = event => {
14
10
  const {
15
11
  width = 150,
16
12
  onLayout
@@ -25,7 +21,7 @@ export default class ProgressBar extends Component {
25
21
  if (onLayout) {
26
22
  onLayout(event);
27
23
  }
28
- });
24
+ };
29
25
 
30
26
  const {
31
27
  progress: progressP = 0,
@@ -79,7 +75,6 @@ export default class ProgressBar extends Component {
79
75
  Animated[animationType](this.state.progress, { ...animationConfig,
80
76
  toValue: progress,
81
77
  velocity: 0,
82
- //adjust this value if animation fails - velocity is required
83
78
  useNativeDriver
84
79
  }).start();
85
80
  } else {
@@ -150,6 +145,27 @@ export default class ProgressBar extends Component {
150
145
  })
151
146
  }]
152
147
  };
148
+ return /*#__PURE__*/React.createElement(View, {
149
+ style: [containerStyle, style],
150
+ onLayout: this.handleLayout,
151
+ ...restProps
152
+ }, /*#__PURE__*/React.createElement(Animated.View, {
153
+ style: progressStyle
154
+ }), children);
155
+ }
156
+
157
+ }te.progress.interpolate({
158
+ inputRange: [0, 1],
159
+ outputRange: [innerWidth / (I18nManager.isRTL ? 2 : -2), 0]
160
+ })
161
+ }, {
162
+ // Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
163
+ scaleX: this.state.progress.interpolate({
164
+ inputRange: [0, 1],
165
+ outputRange: [0.0001, 1]
166
+ })
167
+ }]
168
+ };
153
169
  return /*#__PURE__*/React.createElement(View, _extends({
154
170
  style: [containerStyle, style],
155
171
  onLayout: this.handleLayout
@@ -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
  };
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /* Copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx */
4
2
  import * as React from "react";
5
3
  import { Animated, StyleSheet } from "react-native";
@@ -38,6 +36,22 @@ const Surface = _ref => {
38
36
  }
39
37
  };
40
38
 
39
+ return /*#__PURE__*/React.createElement(Animated.View, { ...rest,
40
+ style: [{
41
+ backgroundColor: getBackgroundColor(),
42
+ elevation,
43
+ ...evalationStyles,
44
+ ...restStyle
45
+ }]
46
+ }, children);
47
+ };
48
+
49
+ export default withTheme(Surface); overlay(elevation, colors.surface);
50
+ } else {
51
+ return colors.surface;
52
+ }
53
+ };
54
+
41
55
  return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
42
56
  style: [{
43
57
  backgroundColor: getBackgroundColor(),
@@ -29,7 +29,6 @@ export { default as Touchable } from "./components/Touchable";
29
29
  export { AccordionGroup, AccordionItem } from "./components/Accordion";
30
30
  export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/ActionSheet";
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
- export { TabView, TabViewItem } from "./components/TabView";
33
32
  export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
34
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
35
34
  /* Deprecated: Fix or Delete! */
@@ -53,6 +53,7 @@ export const SEED_DATA = {
53
53
  label: "Map Type",
54
54
  description: "The type of map to show",
55
55
  group: GROUPS.basic,
56
+ editable: true,
56
57
  formType: FORM_TYPES.flatArray,
57
58
  propType: PROP_TYPES.STRING,
58
59
  required: false,
@@ -1,13 +1,15 @@
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",
5
5
  description: "An SVG component",
6
+ packageName: "@draftbit/core",
6
7
  category: COMPONENT_TYPES.media,
7
8
  layout: {
8
9
  width: 100,
9
10
  height: 100
10
11
  },
12
+ stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Effects],
11
13
  props: {
12
14
  source: createSvgProp()
13
15
  }
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import { StyleProp, ImageStyle } from "react-native";
3
- declare type SVGComponentProps = {
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;
@@ -29,7 +29,6 @@ export { default as Touchable } from "./components/Touchable";
29
29
  export { AccordionGroup, AccordionItem } from "./components/Accordion";
30
30
  export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
- export { TabView, TabViewItem } from "./components/TabView";
33
32
  export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
34
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
35
34
  export { default as Button } from "./components/DeprecatedButton";
@@ -56,6 +56,7 @@ export declare const SEED_DATA: {
56
56
  label: string;
57
57
  description: string;
58
58
  group: string;
59
+ editable: boolean;
59
60
  formType: string;
60
61
  propType: string;
61
62
  required: boolean;
@@ -2,11 +2,13 @@ export declare const SEED_DATA: {
2
2
  name: string;
3
3
  tag: string;
4
4
  description: string;
5
+ packageName: string;
5
6
  category: string;
6
7
  layout: {
7
8
  width: number;
8
9
  height: number;
9
10
  };
11
+ stylesPanelSections: string[];
10
12
  props: {
11
13
  source: {
12
14
  label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-a3d00e.4+a3d00ec7",
3
+ "version": "46.2.4-a572b7.5+a572b72e",
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.2.4",
44
+ "@draftbit/types": "^46.2.4-a572b7.5+a572b72e",
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",
@@ -53,9 +53,7 @@
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-pager-view": "5.4.24",
57
56
  "react-native-svg": "^12.3.0",
58
- "react-native-tab-view": "^3.0.0",
59
57
  "react-native-typography": "^1.4.1",
60
58
  "react-native-web-swiper": "^2.2.3"
61
59
  },
@@ -82,5 +80,5 @@
82
80
  ]
83
81
  ]
84
82
  },
85
- "gitHead": "a3d00ec7cecffe5e152283bd403477beb2df06c5"
83
+ "gitHead": "a572b72e7ba52c06964c007725111547e499a50f"
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,