@draftbit/core 46.2.4-0b78ac.5 → 46.2.4-0e692a.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 (34) hide show
  1. package/lib/commonjs/components/AnimatedCircularProgress.js +2 -12
  2. package/lib/commonjs/components/Carousel.js +10 -34
  3. package/lib/commonjs/components/Checkbox/context.js +1 -1
  4. package/lib/commonjs/components/Config.js +1 -1
  5. package/lib/commonjs/components/Container.js +5 -17
  6. package/lib/commonjs/components/FormRow.js +3 -17
  7. package/lib/commonjs/components/Picker/Picker.js +6 -7
  8. package/lib/commonjs/components/RadioButton/RadioButton.js +3 -14
  9. package/lib/commonjs/components/RadioButton/context.js +1 -1
  10. package/lib/commonjs/components/Slider.js +5 -24
  11. package/lib/commonjs/components/StarRating.js +5 -25
  12. package/lib/commonjs/components/StepIndicator.js +16 -34
  13. package/lib/commonjs/components/{SVG.js → Svg.js} +6 -7
  14. package/lib/commonjs/components/Touchable.js +2 -16
  15. package/lib/commonjs/index.js +7 -7
  16. package/lib/commonjs/mappings/{SVG.js → Svg.js} +0 -0
  17. package/lib/module/components/Config.js +1 -1
  18. package/lib/module/components/{SVG.js → Svg.js} +6 -7
  19. package/lib/module/index.js +1 -1
  20. package/lib/module/mappings/{SVG.js → Svg.js} +0 -0
  21. package/lib/typescript/src/components/Svg.d.ts +7 -0
  22. package/lib/typescript/src/index.d.ts +1 -1
  23. package/lib/typescript/src/mappings/{SVG.d.ts → Svg.d.ts} +0 -0
  24. package/package.json +4 -4
  25. package/src/components/Config.js +1 -1
  26. package/src/components/Config.ts +1 -1
  27. package/src/components/{SVG.js → Svg.js} +5 -6
  28. package/src/components/Svg.tsx +35 -0
  29. package/src/index.js +1 -1
  30. package/src/index.tsx +1 -1
  31. package/src/mappings/{SVG.js → Svg.js} +0 -0
  32. package/src/mappings/{SVG.ts → Svg.ts} +0 -0
  33. package/lib/typescript/src/components/SVG.d.ts +0 -8
  34. package/src/components/SVG.tsx +0 -35
@@ -17,6 +17,8 @@ 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
+
20
22
  const AnimatedProgress = _reactNative.Animated.createAnimatedComponent(_CircularProgress.default);
21
23
 
22
24
  const AnimatedCircularProgress = _ref => {
@@ -67,18 +69,6 @@ const AnimatedCircularProgress = _ref => {
67
69
  React.useEffect(() => {
68
70
  animate();
69
71
  }, [fill, animate]);
70
- return /*#__PURE__*/React.createElement(AnimatedProgress, { ...other,
71
- style: other.style,
72
- childrenContainerStyle: other.childrenContainerStyle,
73
- fill: fillAnimation,
74
- tintColor: animateColor()
75
- });
76
- };
77
-
78
- var _default = AnimatedCircularProgress;
79
- exports.default = _default;eEffect(() => {
80
- animate();
81
- }, [fill, animate]);
82
72
  return /*#__PURE__*/React.createElement(AnimatedProgress, _extends({}, other, {
83
73
  style: other.style,
84
74
  childrenContainerStyle: other.childrenContainerStyle,
@@ -19,6 +19,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
 
20
20
  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; }
21
21
 
22
+ 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); }
23
+
22
24
  const screenWidth = _reactNative.Dimensions.get("window").width;
23
25
 
24
26
  function Pager(_ref) {
@@ -48,6 +50,8 @@ function Pager(_ref) {
48
50
  }
49
51
 
50
52
  function Carousel(_ref2) {
53
+ var _data$length;
54
+
51
55
  let {
52
56
  data,
53
57
  children,
@@ -55,12 +59,9 @@ function Carousel(_ref2) {
55
59
  style,
56
60
  ...rest
57
61
  } = _ref2;
58
-
59
- var _a;
60
-
61
62
  const [index, setIndex] = React.useState(0);
62
63
  const length = React.Children.count(children);
63
- const itemsLength = ((_a = data === null || data === void 0 ? void 0 : data.length) !== null && _a !== void 0 ? _a : 0) + length;
64
+ const itemsLength = ((_data$length = data === null || data === void 0 ? void 0 : data.length) !== null && _data$length !== void 0 ? _data$length : 0) + length;
64
65
  const slides = Array.isArray(data) ? data : [];
65
66
 
66
67
  const {
@@ -70,10 +71,9 @@ function Carousel(_ref2) {
70
71
 
71
72
  const slideWidth = width || screenWidth;
72
73
  const slideHeight = height || 250;
73
- return /*#__PURE__*/React.createElement(_reactNative.View, {
74
- style: [styles.container, style],
75
- ...rest
76
- }, /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
74
+ return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
75
+ style: [styles.container, style]
76
+ }, rest), /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
77
77
  pagingEnabled: true,
78
78
  horizontal: true,
79
79
  decelerationRate: "fast",
@@ -101,9 +101,9 @@ function Carousel(_ref2) {
101
101
  }]
102
102
  });
103
103
  }) : null, React.Children.map(children, child => {
104
- var _a;
104
+ var _child$props;
105
105
 
106
- const s = ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.style) || {};
106
+ const s = (child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.style) || {};
107
107
  return /*#__PURE__*/React.createElement(_reactNative.View, {
108
108
  style: {
109
109
  width: slideWidth
@@ -144,28 +144,4 @@ const styles = _reactNative.StyleSheet.create({
144
144
 
145
145
  var _default = (0, _theming.withTheme)(Carousel);
146
146
 
147
- exports.default = _default;e({
148
- container: {
149
- backgroundColor: "#eee"
150
- },
151
- pager: {
152
- position: "absolute",
153
- bottom: 12,
154
- left: 0,
155
- right: 0,
156
- flexDirection: "row",
157
- justifyContent: "center",
158
- alignItems: "center"
159
- },
160
- bullet: {
161
- marginHorizontal: 2,
162
- width: 10,
163
- height: 10,
164
- borderRadius: 20,
165
- backgroundColor: "#000"
166
- }
167
- });
168
-
169
- var _default = (0, _theming.withTheme)(Carousel);
170
-
171
147
  exports.default = _default;
@@ -8,7 +8,7 @@ exports.useCheckboxGroupContext = useCheckboxGroupContext;
8
8
 
9
9
  var _react = require("react");
10
10
 
11
- var Direction;
11
+ let Direction;
12
12
  exports.Direction = Direction;
13
13
 
14
14
  (function (Direction) {
@@ -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
@@ -19,6 +19,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
 
20
20
  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; }
21
21
 
22
+ 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); }
23
+
22
24
  const Container = _ref => {
23
25
  let {
24
26
  useThemeGutterPadding,
@@ -80,10 +82,9 @@ const Container = _ref => {
80
82
  };
81
83
  const Wrap = elevation ? _Elevation.default : _reactNative.View;
82
84
  if (elevation) containerStyle.elevation = elevation;
83
- return /*#__PURE__*/React.createElement(Wrap, {
84
- style: [containerStyle, style],
85
- ...rest
86
- }, backgroundImage ? /*#__PURE__*/React.createElement(_reactNative.ImageBackground, {
85
+ return /*#__PURE__*/React.createElement(Wrap, _extends({
86
+ style: [containerStyle, style]
87
+ }, rest), backgroundImage ? /*#__PURE__*/React.createElement(_reactNative.ImageBackground, {
87
88
  source: typeof backgroundImage === "string" ? {
88
89
  uri: backgroundImage
89
90
  } : backgroundImage,
@@ -100,17 +101,4 @@ const Container = _ref => {
100
101
 
101
102
  var _default = (0, _theming.withTheme)(Container);
102
103
 
103
- exports.default = _default;izeMode: backgroundImageResizeMode,
104
- style: {
105
- flex: 1
106
- }
107
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
108
- style: innerStyle
109
- }, children)) : /*#__PURE__*/React.createElement(_reactNative.View, {
110
- style: innerStyle
111
- }, children));
112
- };
113
-
114
- var _default = (0, _theming.withTheme)(Container);
115
-
116
104
  exports.default = _default;
@@ -19,6 +19,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
 
20
20
  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; }
21
21
 
22
+ 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); }
23
+
22
24
  function FormRow(_ref) {
23
25
  let {
24
26
  disabled,
@@ -33,27 +35,11 @@ function FormRow(_ref) {
33
35
  textStyles,
34
36
  viewStyles
35
37
  } = (0, _utilities.extractStyles)(style);
36
- return /*#__PURE__*/React.createElement(_Touchable.default, {
38
+ return /*#__PURE__*/React.createElement(_Touchable.default, _extends({
37
39
  disabled: disabled,
38
40
  onPress: onPress,
39
41
  style: [styles.row, {
40
42
  flexDirection: direction
41
- }, viewStyles],
42
- ...rest
43
- }, /*#__PURE__*/React.createElement(_reactNative.Text, {
44
- style: textStyles
45
- }, label), children);
46
- }
47
-
48
- const styles = _reactNative.StyleSheet.create({
49
- row: {
50
- marginLeft: 8,
51
- marginRight: 8,
52
- flexDirection: "row",
53
- justifyContent: "space-between",
54
- alignItems: "center"
55
- }
56
- });rection: direction
57
43
  }, viewStyles]
58
44
  }, rest), /*#__PURE__*/React.createElement(_reactNative.Text, {
59
45
  style: textStyles
@@ -66,6 +66,8 @@ const disabledColor = "rgb(240, 240, 240)";
66
66
  const errorColor = "rgba(255, 69, 100, 1)";
67
67
 
68
68
  const Picker = _ref => {
69
+ var _find$label, _find;
70
+
69
71
  let {
70
72
  error,
71
73
  options = [],
@@ -87,9 +89,6 @@ const Picker = _ref => {
87
89
  rightIconName,
88
90
  type = "solid"
89
91
  } = _ref;
90
-
91
- var _a, _b;
92
-
93
92
  const androidPickerRef = React.useRef(undefined);
94
93
  const [internalValue, setInternalValue] = React.useState(value || defaultValue);
95
94
  const [pickerVisible, setPickerVisible] = React.useState(false);
@@ -109,10 +108,10 @@ const Picker = _ref => {
109
108
  }
110
109
  }, [defaultValue]);
111
110
  React.useEffect(() => {
112
- var _a;
113
-
114
111
  if (pickerVisible && androidPickerRef.current) {
115
- (_a = androidPickerRef === null || androidPickerRef === void 0 ? void 0 : androidPickerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
112
+ var _androidPickerRef$cur;
113
+
114
+ androidPickerRef === null || androidPickerRef === void 0 ? void 0 : (_androidPickerRef$cur = androidPickerRef.current) === null || _androidPickerRef$cur === void 0 ? void 0 : _androidPickerRef$cur.focus();
116
115
  }
117
116
  }, [pickerVisible, androidPickerRef]);
118
117
  const normalizedOptions = normalizeOptions(options);
@@ -160,7 +159,7 @@ const Picker = _ref => {
160
159
  ...extractedMarginStyles
161
160
  };
162
161
  const stylesWithoutBordersAndMargins = (0, _lodash.omit)(viewStyles, [..._utilities.borderStyleNames, ..._utilities.marginStyleNames, ...additionalBorderStyles, ...additionalMarginStyles]);
163
- const selectedLabel = internalValue && ((_b = (_a = pickerOptions.find(option => option.value === internalValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : internalValue);
162
+ const selectedLabel = internalValue && ((_find$label = (_find = pickerOptions.find(option => option.value === internalValue)) === null || _find === void 0 ? void 0 : _find.label) !== null && _find$label !== void 0 ? _find$label : internalValue);
164
163
  const labelText = label ? /*#__PURE__*/React.createElement(_reactNative.Text, {
165
164
  style: {
166
165
  textAlign: textStyles.textAlign,
@@ -21,6 +21,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
21
21
 
22
22
  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; }
23
23
 
24
+ 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); }
25
+
24
26
  const RadioButton = _ref => {
25
27
  let {
26
28
  Icon,
@@ -49,20 +51,7 @@ const RadioButton = _ref => {
49
51
  onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
50
52
  };
51
53
 
52
- return /*#__PURE__*/React.createElement(_IconButton.default, {
53
- Icon: Icon,
54
- icon: isSelected ? selectedIcon : unselectedIcon,
55
- color: isSelected ? color : unselectedColor,
56
- disabled: disabled,
57
- onPress: handlePress,
58
- size: size,
59
- style: style,
60
- ...rest
61
- });
62
- };
63
-
64
- var _default = RadioButton;
65
- exports.default = _default;turn /*#__PURE__*/React.createElement(_IconButton.default, _extends({
54
+ return /*#__PURE__*/React.createElement(_IconButton.default, _extends({
66
55
  Icon: Icon,
67
56
  icon: isSelected ? selectedIcon : unselectedIcon,
68
57
  color: isSelected ? color : unselectedColor,
@@ -8,7 +8,7 @@ exports.useRadioButtonGroupContext = useRadioButtonGroupContext;
8
8
 
9
9
  var _react = require("react");
10
10
 
11
- var Direction;
11
+ let Direction;
12
12
  exports.Direction = Direction;
13
13
 
14
14
  (function (Direction) {
@@ -23,6 +23,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
23
23
 
24
24
  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; }
25
25
 
26
+ 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); }
27
+
26
28
  function maybeParseValue(value) {
27
29
  if (value === undefined) {
28
30
  return undefined;
@@ -89,10 +91,9 @@ function Slider(_ref) {
89
91
  onValueChange(newValue);
90
92
  };
91
93
 
92
- return /*#__PURE__*/React.createElement(_reactNative.View, {
93
- style: [styles.container, style],
94
- ...rest
95
- }, leftIcon ? /*#__PURE__*/React.createElement(Icon, {
94
+ return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
95
+ style: [styles.container, style]
96
+ }, rest), leftIcon ? /*#__PURE__*/React.createElement(Icon, {
96
97
  color: leftIconThemeColor,
97
98
  name: leftIcon,
98
99
  size: 24
@@ -128,24 +129,4 @@ const styles = _reactNative.StyleSheet.create({
128
129
 
129
130
  var _default = (0, _theming.withTheme)(Slider);
130
131
 
131
- exports.default = _default;: rightIconThemeColor,
132
- name: rightIcon,
133
- size: 24
134
- }) : null);
135
- }
136
-
137
- const styles = _reactNative.StyleSheet.create({
138
- container: {
139
- height: 40,
140
- flexDirection: "row",
141
- alignItems: "center"
142
- },
143
- slider: {
144
- flex: 1,
145
- marginHorizontal: 12
146
- }
147
- });
148
-
149
- var _default = (0, _theming.withTheme)(Slider);
150
-
151
132
  exports.default = _default;
@@ -15,6 +15,8 @@ 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
+
18
20
  const StarRating = _ref => {
19
21
  let {
20
22
  Icon,
@@ -45,10 +47,9 @@ const StarRating = _ref => {
45
47
  !!onPress && onPress(r);
46
48
  }, [onPress]);
47
49
  const ratingRounded = Math.round(localRating * 2) / 2;
48
- return /*#__PURE__*/React.createElement(_reactNative.View, {
49
- style: [styles.container, style],
50
- ...rest
51
- }, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(_reactNative.View, {
50
+ return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
51
+ style: [styles.container, style]
52
+ }, rest), [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(_reactNative.View, {
52
53
  key: i,
53
54
  style: {
54
55
  display: "flex"
@@ -92,25 +93,4 @@ const styles = _reactNative.StyleSheet.create({
92
93
 
93
94
  var _default = (0, _theming.withTheme)(StarRating);
94
95
 
95
- exports.default = _default;ignItems: "center"
96
- },
97
- touchContainer: {
98
- display: "flex",
99
- flexDirection: "row",
100
- position: "absolute",
101
- top: 0,
102
- right: 0,
103
- left: 0,
104
- bottom: 0,
105
- zIndex: 1
106
- },
107
- pressable: {
108
- flex: 1,
109
- height: "100%",
110
- width: "50%"
111
- }
112
- });
113
-
114
- var _default = (0, _theming.withTheme)(StarRating);
115
-
116
96
  exports.default = _default;
@@ -13,7 +13,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
13
13
 
14
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
15
 
16
- // @ts-nocheck
16
+ 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; }
17
+
17
18
  const STEP_STATUS = {
18
19
  CURRENT: "current",
19
20
  FINISHED: "finished",
@@ -24,7 +25,7 @@ class StepIndicator extends _react.Component {
24
25
  constructor(props) {
25
26
  super(props);
26
27
 
27
- this.renderProgressBarBackground = () => {
28
+ _defineProperty(this, "renderProgressBarBackground", () => {
28
29
  const {
29
30
  stepCount,
30
31
  direction
@@ -69,9 +70,9 @@ class StepIndicator extends _react.Component {
69
70
  },
70
71
  style: progressBarBackgroundStyle
71
72
  });
72
- };
73
+ });
73
74
 
74
- this.renderProgressBar = () => {
75
+ _defineProperty(this, "renderProgressBar", () => {
75
76
  const {
76
77
  stepCount,
77
78
  direction
@@ -103,9 +104,9 @@ class StepIndicator extends _react.Component {
103
104
  return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
104
105
  style: progressBarStyle
105
106
  });
106
- };
107
+ });
107
108
 
108
- this.renderStepIndicator = () => {
109
+ _defineProperty(this, "renderStepIndicator", () => {
109
110
  let steps = [];
110
111
  const {
111
112
  stepCount,
@@ -138,9 +139,9 @@ class StepIndicator extends _react.Component {
138
139
  height: this.state.customStyles.currentStepIndicatorSize
139
140
  }]
140
141
  }, steps);
141
- };
142
+ });
142
143
 
143
- this.renderStepLabels = () => {
144
+ _defineProperty(this, "renderStepLabels", () => {
144
145
  const {
145
146
  labels,
146
147
  direction,
@@ -182,9 +183,9 @@ class StepIndicator extends _react.Component {
182
183
  alignItems: this.state.customStyles.labelAlign
183
184
  }]
184
185
  }, labelViews);
185
- };
186
+ });
186
187
 
187
- this.renderStep = position => {
188
+ _defineProperty(this, "renderStep", position => {
188
189
  const {
189
190
  renderStepIndicator
190
191
  } = this.props;
@@ -256,9 +257,9 @@ class StepIndicator extends _react.Component {
256
257
  }) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
257
258
  style: indicatorLabelStyle
258
259
  }, "".concat(position + 1)));
259
- };
260
+ });
260
261
 
261
- this.getStepStatus = stepPosition => {
262
+ _defineProperty(this, "getStepStatus", stepPosition => {
262
263
  const {
263
264
  currentPosition
264
265
  } = this.props;
@@ -270,9 +271,9 @@ class StepIndicator extends _react.Component {
270
271
  } else {
271
272
  return STEP_STATUS.UNFINISHED;
272
273
  }
273
- };
274
+ });
274
275
 
275
- this.onCurrentPositionChanged = position => {
276
+ _defineProperty(this, "onCurrentPositionChanged", position => {
276
277
  let {
277
278
  stepCount
278
279
  } = this.props;
@@ -295,7 +296,7 @@ class StepIndicator extends _react.Component {
295
296
  toValue: this.state.customStyles.currentStepIndicatorSize / 2,
296
297
  duration: 100
297
298
  })])]).start();
298
- };
299
+ });
299
300
 
300
301
  const defaultStyles = {
301
302
  stepIndicatorSize: 30,
@@ -410,25 +411,6 @@ const styles = _reactNative.StyleSheet.create({
410
411
  }
411
412
  });
412
413
 
413
- StepIndicator.defaultProps = {
414
- currentPosition: 0,
415
- stepCount: 5,
416
- customStyles: {},
417
- direction: "horizontal"
418
- }; justifyContent: "center"
419
- },
420
- stepLabel: {
421
- fontSize: 12,
422
- textAlign: "center",
423
- fontWeight: "500"
424
- },
425
- stepLabelItem: {
426
- flex: 1,
427
- alignItems: "center",
428
- justifyContent: "center"
429
- }
430
- });
431
-
432
414
  StepIndicator.defaultProps = {
433
415
  currentPosition: 0,
434
416
  stepCount: 5,
@@ -19,31 +19,30 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
 
20
20
  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; }
21
21
 
22
- const SVG = _ref => {
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
  };
47
46
 
48
- var _default = SVG;
47
+ var _default = Svg;
49
48
  exports.default = _default;
@@ -11,6 +11,8 @@ 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
+
14
16
  function Touchable(_ref) {
15
17
  let {
16
18
  children,
@@ -19,22 +21,6 @@ function Touchable(_ref) {
19
21
  style,
20
22
  ...props
21
23
  } = _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;
38
24
  return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
39
25
  onPress: onPress,
40
26
  disabled: disabled,
@@ -291,12 +291,6 @@ Object.defineProperty(exports, "RowHeadlineImageIcon", {
291
291
  return _RowHeadlineImageIcon.default;
292
292
  }
293
293
  });
294
- Object.defineProperty(exports, "SVG", {
295
- enumerable: true,
296
- get: function () {
297
- return _SVG.default;
298
- }
299
- });
300
294
  Object.defineProperty(exports, "ScreenContainer", {
301
295
  enumerable: true,
302
296
  get: function () {
@@ -345,6 +339,12 @@ Object.defineProperty(exports, "Surface", {
345
339
  return _Surface.default;
346
340
  }
347
341
  });
342
+ Object.defineProperty(exports, "Svg", {
343
+ enumerable: true,
344
+ get: function () {
345
+ return _Svg.default;
346
+ }
347
+ });
348
348
  Object.defineProperty(exports, "Swiper", {
349
349
  enumerable: true,
350
350
  get: function () {
@@ -448,7 +448,7 @@ var _IconButton = _interopRequireDefault(require("./components/IconButton"));
448
448
 
449
449
  var _Image = _interopRequireDefault(require("./components/Image"));
450
450
 
451
- var _SVG = _interopRequireDefault(require("./components/SVG"));
451
+ var _Svg = _interopRequireDefault(require("./components/Svg"));
452
452
 
453
453
  var _NumberInput = _interopRequireDefault(require("./components/NumberInput"));
454
454
 
File without changes
@@ -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
@@ -3,30 +3,29 @@ import { View, Platform, Image } from "react-native";
3
3
  import { SvgUri } from "react-native-svg";
4
4
  import Config from "./Config";
5
5
 
6
- const SVG = _ref => {
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
  };
31
30
 
32
- export default SVG;
31
+ export default Svg;
@@ -17,7 +17,7 @@ export { default as FAB } from "./components/FAB";
17
17
  export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
18
18
  export { default as IconButton } from "./components/IconButton";
19
19
  export { default as Image } from "./components/Image";
20
- export { default as SVG } from "./components/SVG";
20
+ export { default as Svg } from "./components/Svg";
21
21
  export { default as NumberInput } from "./components/NumberInput";
22
22
  export { default as ScreenContainer } from "./components/ScreenContainer";
23
23
  export { default as StarRating } from "./components/StarRating";
File without changes
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ declare type SvgComponentProps = {
3
+ source: string;
4
+ style?: any;
5
+ };
6
+ declare const Svg: React.FC<React.PropsWithChildren<SvgComponentProps>>;
7
+ export default Svg;
@@ -17,7 +17,7 @@ export { default as FAB } from "./components/FAB";
17
17
  export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
18
18
  export { default as IconButton } from "./components/IconButton";
19
19
  export { default as Image } from "./components/Image";
20
- export { default as SVG } from "./components/SVG";
20
+ export { default as Svg } from "./components/Svg";
21
21
  export { default as NumberInput } from "./components/NumberInput";
22
22
  export { default as ScreenContainer } from "./components/ScreenContainer";
23
23
  export { default as StarRating } from "./components/StarRating";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-0b78ac.5+0b78accb",
3
+ "version": "46.2.4-0e692a.5+0e692adc",
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-0e692a.5+0e692adc",
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,7 +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-svg": "^12.3.0",
56
+ "react-native-svg": "^13.2.0",
57
57
  "react-native-typography": "^1.4.1",
58
58
  "react-native-web-swiper": "^2.2.3"
59
59
  },
@@ -80,5 +80,5 @@
80
80
  ]
81
81
  ]
82
82
  },
83
- "gitHead": "0b78accbd6bab9f7f970582fec5cc22b4a53904a"
83
+ "gitHead": "0e692adc6f7d632b5a1e30eedeba4d9b5f810afa"
84
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
- export default SVG;
13
+ export default Svg;
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ import { View, Platform, Image } from "react-native";
3
+ import { SvgUri } from "react-native-svg";
4
+
5
+ import Config from "./Config";
6
+
7
+ type SvgComponentProps = {
8
+ source: string;
9
+ style?: any;
10
+ };
11
+
12
+ const Svg: React.FC<React.PropsWithChildren<SvgComponentProps>> = ({
13
+ source = Config.placeholderSvgURL,
14
+ style,
15
+ }) => {
16
+ return (
17
+ <>
18
+ {Platform.OS === "ios" && (
19
+ <View style={style}>
20
+ <SvgUri width="100%" height="100%" uri={source} />
21
+ </View>
22
+ )}
23
+ {Platform.OS === "android" && (
24
+ <View style={style}>
25
+ <SvgUri width="100%" height="100%" uri={source} />
26
+ </View>
27
+ )}
28
+ {Platform.OS === "web" && (
29
+ <Image style={style} source={{ uri: source }} />
30
+ )}
31
+ </>
32
+ );
33
+ };
34
+
35
+ export default Svg;
package/src/index.js CHANGED
@@ -17,7 +17,7 @@ export { default as FAB } from "./components/FAB";
17
17
  export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
18
18
  export { default as IconButton } from "./components/IconButton";
19
19
  export { default as Image } from "./components/Image";
20
- export { default as SVG } from "./components/SVG";
20
+ export { default as Svg } from "./components/Svg";
21
21
  export { default as NumberInput } from "./components/NumberInput";
22
22
  export { default as ScreenContainer } from "./components/ScreenContainer";
23
23
  export { default as StarRating } from "./components/StarRating";
package/src/index.tsx CHANGED
@@ -18,7 +18,7 @@ export { default as FAB } from "./components/FAB";
18
18
  export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
19
19
  export { default as IconButton } from "./components/IconButton";
20
20
  export { default as Image } from "./components/Image";
21
- export { default as SVG } from "./components/SVG";
21
+ export { default as Svg } from "./components/Svg";
22
22
  export { default as NumberInput } from "./components/NumberInput";
23
23
  export { default as ScreenContainer } from "./components/ScreenContainer";
24
24
  export { default as StarRating } from "./components/StarRating";
File without changes
File without changes
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { StyleProp, ImageStyle } from "react-native";
3
- declare type SVGComponentProps = {
4
- source: string;
5
- style?: StyleProp<ImageStyle>;
6
- };
7
- declare const SVG: ({ source, style }: SVGComponentProps) => JSX.Element;
8
- export default SVG;
@@ -1,35 +0,0 @@
1
- import * as React from "react";
2
- import { View, Platform, Image, StyleProp, ImageStyle } from "react-native";
3
- import { SvgUri } from "react-native-svg";
4
-
5
- import Config from "./Config";
6
-
7
- type SVGComponentProps = {
8
- source: string;
9
- style?: StyleProp<ImageStyle>;
10
- };
11
-
12
- const SVG = ({ source, style }: SVGComponentProps) => {
13
- let svgSource =
14
- source === null || source === undefined ? Config.placeholderSvgURL : source;
15
-
16
- return (
17
- <>
18
- {Platform.OS === "ios" && (
19
- <View style={style}>
20
- <SvgUri width="100%" height="100%" uri={svgSource} />
21
- </View>
22
- )}
23
- {Platform.OS === "android" && (
24
- <View style={style}>
25
- <SvgUri width="100%" height="100%" uri={svgSource} />
26
- </View>
27
- )}
28
- {Platform.OS === "web" && (
29
- <Image style={style} source={{ uri: svgSource }} />
30
- )}
31
- </>
32
- );
33
- };
34
-
35
- export default SVG;