@draftbit/core 46.2.4-cb2c54.5 → 46.2.4-d2065e.10

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.
@@ -21,8 +21,6 @@ var _Config = _interopRequireDefault(require("./Config"));
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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
-
26
24
  const CardBlock = _ref => {
27
25
  let {
28
26
  image = _Config.default.cardImageUrl,
@@ -62,11 +60,12 @@ const CardBlock = _ref => {
62
60
  const rightDescriptionStyles = [typography.subtitle2, {
63
61
  color: colors.light
64
62
  }];
65
- return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, _extends({
63
+ return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, {
66
64
  style: style,
67
65
  onPress: onPress,
68
- numColumns: numColumns
69
- }, rest), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
66
+ numColumns: numColumns,
67
+ ...rest
68
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
70
69
  style: {
71
70
  backgroundColor: colors.background
72
71
  }
@@ -118,4 +117,15 @@ const CardBlock = _ref => {
118
117
 
119
118
  var _default = (0, _theming.withTheme)(CardBlock);
120
119
 
120
+ exports.default = _default;le: [typography.body2, {
121
+ color: colors.medium
122
+ }]
123
+ }, leftDescription), rightDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
124
+ numberOfLines: 1,
125
+ style: rightDescriptionStyles
126
+ }, rightDescription) : null) : null));
127
+ };
128
+
129
+ var _default = (0, _theming.withTheme)(CardBlock);
130
+
121
131
  exports.default = _default;
@@ -19,8 +19,6 @@ 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
-
24
22
  const screenWidth = _reactNative.Dimensions.get("window").width;
25
23
 
26
24
  function Pager(_ref) {
@@ -50,8 +48,6 @@ function Pager(_ref) {
50
48
  }
51
49
 
52
50
  function Carousel(_ref2) {
53
- var _data$length;
54
-
55
51
  let {
56
52
  data,
57
53
  children,
@@ -59,9 +55,12 @@ function Carousel(_ref2) {
59
55
  style,
60
56
  ...rest
61
57
  } = _ref2;
58
+
59
+ var _a;
60
+
62
61
  const [index, setIndex] = React.useState(0);
63
62
  const length = React.Children.count(children);
64
- const itemsLength = ((_data$length = data === null || data === void 0 ? void 0 : data.length) !== null && _data$length !== void 0 ? _data$length : 0) + length;
63
+ const itemsLength = ((_a = data === null || data === void 0 ? void 0 : data.length) !== null && _a !== void 0 ? _a : 0) + length;
65
64
  const slides = Array.isArray(data) ? data : [];
66
65
 
67
66
  const {
@@ -71,9 +70,10 @@ function Carousel(_ref2) {
71
70
 
72
71
  const slideWidth = width || screenWidth;
73
72
  const slideHeight = height || 250;
74
- return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
75
- style: [styles.container, style]
76
- }, rest), /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
73
+ return /*#__PURE__*/React.createElement(_reactNative.View, {
74
+ style: [styles.container, style],
75
+ ...rest
76
+ }, /*#__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 _child$props;
104
+ var _a;
105
105
 
106
- const s = (child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.style) || {};
106
+ const s = ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.style) || {};
107
107
  return /*#__PURE__*/React.createElement(_reactNative.View, {
108
108
  style: {
109
109
  width: slideWidth
@@ -144,4 +144,28 @@ 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
+
147
171
  exports.default = _default;
@@ -13,29 +13,27 @@ var _reactNativeSvg = require("react-native-svg");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
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
-
18
16
  class CircularProgress extends _react.default.Component {
19
17
  constructor() {
20
18
  super(...arguments);
21
19
 
22
- _defineProperty(this, "polarToCartesian", (centerX, centerY, radius, angleInDegrees) => {
20
+ this.polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
23
21
  var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
24
22
  return {
25
23
  x: centerX + radius * Math.cos(angleInRadians),
26
24
  y: centerY + radius * Math.sin(angleInRadians)
27
25
  };
28
- });
26
+ };
29
27
 
30
- _defineProperty(this, "circlePath", (x, y, radius, startAngle, endAngle) => {
28
+ this.circlePath = (x, y, radius, startAngle, endAngle) => {
31
29
  var start = this.polarToCartesian(x, y, radius, endAngle * 0.9999);
32
30
  var end = this.polarToCartesian(x, y, radius, startAngle);
33
31
  var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
34
32
  var d = ["M", start.x, start.y, "A", radius, radius, 0, largeArcFlag, 0, end.x, end.y];
35
33
  return d.join(" ");
36
- });
34
+ };
37
35
 
38
- _defineProperty(this, "clampFill", fill => Math.min(100, Math.max(0, fill)));
36
+ this.clampFill = fill => Math.min(100, Math.max(0, fill));
39
37
  }
40
38
 
41
39
  render() {
@@ -118,5 +116,15 @@ class CircularProgress extends _react.default.Component {
118
116
 
119
117
  }
120
118
 
119
+ var _default = CircularProgress;
120
+ exports.default = _default;okeDasharrayTint,
121
+ fill: "transparent"
122
+ }), cap)), children && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
123
+ style: localChildrenContainerStyle
124
+ }, children(fill)));
125
+ }
126
+
127
+ }
128
+
121
129
  var _default = CircularProgress;
122
130
  exports.default = _default;
@@ -27,8 +27,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
27
27
 
28
28
  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; }
29
29
 
30
- 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); }
31
-
32
30
  const FAB = _ref => {
33
31
  let {
34
32
  Icon,
@@ -130,7 +128,7 @@ const FAB = _ref => {
130
128
  style: [{
131
129
  elevation
132
130
  }, style]
133
- }, /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
131
+ }, /*#__PURE__*/React.createElement(_Touchable.default, { ...rest,
134
132
  onPress: onPress,
135
133
  accessibilityState: {
136
134
  disabled
@@ -138,7 +136,7 @@ const FAB = _ref => {
138
136
  accessibilityRole: "button",
139
137
  disabled: disabled || loading,
140
138
  style: buttonStyles
141
- }), /*#__PURE__*/React.createElement(_reactNative.View, {
139
+ }, /*#__PURE__*/React.createElement(_reactNative.View, {
142
140
  style: styles.content
143
141
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
144
142
  style: iconStyle
@@ -181,4 +179,24 @@ const styles = _reactNative.StyleSheet.create({
181
179
 
182
180
  var _default = (0, _theming.withTheme)(FAB);
183
181
 
182
+ exports.default = _default; "row",
183
+ alignItems: "center",
184
+ justifyContent: "center"
185
+ },
186
+ icon: {
187
+ alignItems: "center",
188
+ justifyContent: "center",
189
+ width: _Config.default.buttonIconSize
190
+ },
191
+ fixed: {
192
+ left: 0,
193
+ right: 0,
194
+ bottom: 0,
195
+ height: 64,
196
+ borderRadius: 0
197
+ }
198
+ });
199
+
200
+ var _default = (0, _theming.withTheme)(FAB);
201
+
184
202
  exports.default = _default;
@@ -19,8 +19,6 @@ 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 _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
22
  /**
25
23
  * Portal allows to render a component at a different place in the parent tree.
26
24
  * You can use it to render content which should appear above other elements, similar to `Modal`.
@@ -43,7 +41,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
43
41
  * ```
44
42
  */
45
43
  class Portal extends React.Component {
46
- // @component ./PortalHost.tsx
47
44
  render() {
48
45
  const {
49
46
  children,
@@ -56,9 +53,10 @@ class Portal extends React.Component {
56
53
  }, children)));
57
54
  }
58
55
 
59
- }
56
+ } // @component ./PortalHost.tsx
57
+
60
58
 
61
- _defineProperty(Portal, "Host", _PortalHost.default);
59
+ Portal.Host = _PortalHost.default;
62
60
 
63
61
  var _default = (0, _theming.withTheme)(Portal);
64
62
 
@@ -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 _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
+
20
22
  const PortalContext = /*#__PURE__*/React.createContext(null);
21
23
  /**
22
24
  * Portal host renders all of its children `Portal` elements.
@@ -49,11 +51,11 @@ class PortalHost extends React.Component {
49
51
  constructor() {
50
52
  super(...arguments);
51
53
 
52
- this.setManager = manager => {
54
+ _defineProperty(this, "setManager", manager => {
53
55
  this.manager = manager;
54
- };
56
+ });
55
57
 
56
- this.mount = children => {
58
+ _defineProperty(this, "mount", children => {
57
59
  const key = this.nextKey++;
58
60
 
59
61
  if (this.manager) {
@@ -67,9 +69,9 @@ class PortalHost extends React.Component {
67
69
  }
68
70
 
69
71
  return key;
70
- };
72
+ });
71
73
 
72
- this.update = (key, children) => {
74
+ _defineProperty(this, "update", (key, children) => {
73
75
  if (this.manager) {
74
76
  this.manager.update(key, children);
75
77
  } else {
@@ -87,9 +89,9 @@ class PortalHost extends React.Component {
87
89
  this.queue.push(op);
88
90
  }
89
91
  }
90
- };
92
+ });
91
93
 
92
- this.unmount = key => {
94
+ _defineProperty(this, "unmount", key => {
93
95
  if (this.manager) {
94
96
  this.manager.unmount(key);
95
97
  } else {
@@ -98,10 +100,13 @@ class PortalHost extends React.Component {
98
100
  key
99
101
  });
100
102
  }
101
- };
103
+ });
104
+
105
+ _defineProperty(this, "nextKey", 0);
106
+
107
+ _defineProperty(this, "queue", []);
102
108
 
103
- this.nextKey = 0;
104
- this.queue = [];
109
+ _defineProperty(this, "manager", void 0);
105
110
  }
106
111
 
107
112
  componentDidMount() {
@@ -147,23 +152,6 @@ class PortalHost extends React.Component {
147
152
 
148
153
  }
149
154
 
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
-
167
155
  exports.default = PortalHost;
168
156
 
169
157
  _defineProperty(PortalHost, "displayName", "Portal.Host");
@@ -13,8 +13,7 @@ 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
- 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
-
16
+ // @ts-nocheck
18
17
  const STEP_STATUS = {
19
18
  CURRENT: "current",
20
19
  FINISHED: "finished",
@@ -25,7 +24,7 @@ class StepIndicator extends _react.Component {
25
24
  constructor(props) {
26
25
  super(props);
27
26
 
28
- _defineProperty(this, "renderProgressBarBackground", () => {
27
+ this.renderProgressBarBackground = () => {
29
28
  const {
30
29
  stepCount,
31
30
  direction
@@ -70,9 +69,9 @@ class StepIndicator extends _react.Component {
70
69
  },
71
70
  style: progressBarBackgroundStyle
72
71
  });
73
- });
72
+ };
74
73
 
75
- _defineProperty(this, "renderProgressBar", () => {
74
+ this.renderProgressBar = () => {
76
75
  const {
77
76
  stepCount,
78
77
  direction
@@ -104,9 +103,9 @@ class StepIndicator extends _react.Component {
104
103
  return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
105
104
  style: progressBarStyle
106
105
  });
107
- });
106
+ };
108
107
 
109
- _defineProperty(this, "renderStepIndicator", () => {
108
+ this.renderStepIndicator = () => {
110
109
  let steps = [];
111
110
  const {
112
111
  stepCount,
@@ -139,9 +138,9 @@ class StepIndicator extends _react.Component {
139
138
  height: this.state.customStyles.currentStepIndicatorSize
140
139
  }]
141
140
  }, steps);
142
- });
141
+ };
143
142
 
144
- _defineProperty(this, "renderStepLabels", () => {
143
+ this.renderStepLabels = () => {
145
144
  const {
146
145
  labels,
147
146
  direction,
@@ -183,9 +182,9 @@ class StepIndicator extends _react.Component {
183
182
  alignItems: this.state.customStyles.labelAlign
184
183
  }]
185
184
  }, labelViews);
186
- });
185
+ };
187
186
 
188
- _defineProperty(this, "renderStep", position => {
187
+ this.renderStep = position => {
189
188
  const {
190
189
  renderStepIndicator
191
190
  } = this.props;
@@ -257,9 +256,9 @@ class StepIndicator extends _react.Component {
257
256
  }) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
258
257
  style: indicatorLabelStyle
259
258
  }, "".concat(position + 1)));
260
- });
259
+ };
261
260
 
262
- _defineProperty(this, "getStepStatus", stepPosition => {
261
+ this.getStepStatus = stepPosition => {
263
262
  const {
264
263
  currentPosition
265
264
  } = this.props;
@@ -271,9 +270,9 @@ class StepIndicator extends _react.Component {
271
270
  } else {
272
271
  return STEP_STATUS.UNFINISHED;
273
272
  }
274
- });
273
+ };
275
274
 
276
- _defineProperty(this, "onCurrentPositionChanged", position => {
275
+ this.onCurrentPositionChanged = position => {
277
276
  let {
278
277
  stepCount
279
278
  } = this.props;
@@ -296,7 +295,7 @@ class StepIndicator extends _react.Component {
296
295
  toValue: this.state.customStyles.currentStepIndicatorSize / 2,
297
296
  duration: 100
298
297
  })])]).start();
299
- });
298
+ };
300
299
 
301
300
  const defaultStyles = {
302
301
  stepIndicatorSize: 30,
@@ -411,6 +410,25 @@ const styles = _reactNative.StyleSheet.create({
411
410
  }
412
411
  });
413
412
 
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
+
414
432
  StepIndicator.defaultProps = {
415
433
  currentPosition: 0,
416
434
  stepCount: 5,
@@ -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"
@@ -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;AR_HEIGHT;
19
+ exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
@@ -0,0 +1,42 @@
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: "FlashList",
12
+ tag: "FlashList",
13
+ description: "Flashlist by Shopify",
14
+ packageName: "@shopify/flash-list",
15
+ category: _types.COMPONENT_TYPES.data,
16
+ stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
17
+ layout: {
18
+ flex: 1
19
+ },
20
+ props: {
21
+ estimatedItemSize: (0, _types.createNumberProp)({
22
+ group: _types.GROUPS.basic,
23
+ label: "Est. Item Size",
24
+ description: "Approximate size of the items before rendering.",
25
+ defaultValue: 50,
26
+ step: 1,
27
+ precision: 0
28
+ }),
29
+ horizontal: (0, _types.createStaticBoolProp)({
30
+ label: "Horizontal",
31
+ description: "Render list horizontally"
32
+ }),
33
+ inverted: (0, _types.createStaticBoolProp)({
34
+ label: "Inverted",
35
+ description: "If true, reverses the direction."
36
+ }),
37
+ numColumns: (0, _types.createNumColumnsType)({
38
+ editable: true
39
+ })
40
+ }
41
+ };
42
+ exports.SEED_DATA = SEED_DATA;
@@ -11,7 +11,6 @@ const SEED_DATA = {
11
11
  name: "SVG",
12
12
  tag: "SVG",
13
13
  description: "An SVG component",
14
- packageName: "@draftbit/core",
15
14
  category: _types.COMPONENT_TYPES.media,
16
15
  layout: {
17
16
  width: 100,
@@ -1,3 +1,5 @@
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
+
1
3
  import * as React from "react";
2
4
  import { View, StyleSheet, Pressable } from "react-native";
3
5
  import { withTheme } from "../theming";
@@ -32,10 +34,9 @@ const StarRating = _ref => {
32
34
  !!onPress && onPress(r);
33
35
  }, [onPress]);
34
36
  const ratingRounded = Math.round(localRating * 2) / 2;
35
- return /*#__PURE__*/React.createElement(View, {
36
- style: [styles.container, style],
37
- ...rest
38
- }, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
37
+ return /*#__PURE__*/React.createElement(View, _extends({
38
+ style: [styles.container, style]
39
+ }, rest), [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
39
40
  key: i,
40
41
  style: {
41
42
  display: "flex"
@@ -76,24 +77,4 @@ const styles = StyleSheet.create({
76
77
  width: "50%"
77
78
  }
78
79
  });
79
- export default withTheme(StarRating);ontainer: {
80
- flexDirection: "row",
81
- alignItems: "center"
82
- },
83
- touchContainer: {
84
- display: "flex",
85
- flexDirection: "row",
86
- position: "absolute",
87
- top: 0,
88
- right: 0,
89
- left: 0,
90
- bottom: 0,
91
- zIndex: 1
92
- },
93
- pressable: {
94
- flex: 1,
95
- height: "100%",
96
- width: "50%"
97
- }
98
- });
99
80
  export default withTheme(StarRating);
@@ -5,5 +5,4 @@ const DEFAULT_STATUSBAR_HEIGHT_EXPO = expo !== null && expo !== void 0 && expo.C
5
5
  export const APPROX_STATUSBAR_HEIGHT = Platform.select({
6
6
  android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
7
7
  ios: Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
8
- });PO : 0
9
8
  });
@@ -0,0 +1,33 @@
1
+ import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "FlashList",
4
+ tag: "FlashList",
5
+ description: "Flashlist by Shopify",
6
+ packageName: "@shopify/flash-list",
7
+ category: COMPONENT_TYPES.data,
8
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
9
+ layout: {
10
+ flex: 1
11
+ },
12
+ props: {
13
+ estimatedItemSize: createNumberProp({
14
+ group: GROUPS.basic,
15
+ label: "Est. Item Size",
16
+ description: "Approximate size of the items before rendering.",
17
+ defaultValue: 50,
18
+ step: 1,
19
+ precision: 0
20
+ }),
21
+ horizontal: createStaticBoolProp({
22
+ label: "Horizontal",
23
+ description: "Render list horizontally"
24
+ }),
25
+ inverted: createStaticBoolProp({
26
+ label: "Inverted",
27
+ description: "If true, reverses the direction."
28
+ }),
29
+ numColumns: createNumColumnsType({
30
+ editable: true
31
+ })
32
+ }
33
+ };
@@ -3,7 +3,6 @@ export const SEED_DATA = {
3
3
  name: "SVG",
4
4
  tag: "SVG",
5
5
  description: "An SVG component",
6
- packageName: "@draftbit/core",
7
6
  category: COMPONENT_TYPES.media,
8
7
  layout: {
9
8
  width: 100,
@@ -0,0 +1,54 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ description: string;
5
+ packageName: string;
6
+ category: string;
7
+ stylesPanelSections: string[];
8
+ layout: {
9
+ flex: number;
10
+ };
11
+ props: {
12
+ estimatedItemSize: {
13
+ label: string;
14
+ description: string;
15
+ formType: string;
16
+ propType: string;
17
+ group: string;
18
+ defaultValue: null;
19
+ editable: boolean;
20
+ required: boolean;
21
+ step: number;
22
+ };
23
+ horizontal: {
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
+ inverted: {
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
+ numColumns: {
44
+ label: string;
45
+ description: string;
46
+ group: string;
47
+ formType: string;
48
+ propType: string;
49
+ defaultValue: number;
50
+ editable: boolean;
51
+ required: boolean;
52
+ };
53
+ };
54
+ };
@@ -2,7 +2,6 @@ export declare const SEED_DATA: {
2
2
  name: string;
3
3
  tag: string;
4
4
  description: string;
5
- packageName: string;
6
5
  category: string;
7
6
  layout: {
8
7
  width: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-cb2c54.5+cb2c5435",
3
+ "version": "46.2.4-d2065e.10+d2065e18",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,11 +41,12 @@
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-cb2c54.5+cb2c5435",
44
+ "@draftbit/types": "^46.3.0",
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",
48
48
  "@react-native-picker/picker": "2.4.2",
49
+ "@shopify/flash-list": "^1.3.0",
49
50
  "color": "^3.1.2",
50
51
  "date-fns": "^2.16.1",
51
52
  "dateformat": "^3.0.3",
@@ -53,7 +54,7 @@
53
54
  "lodash.omit": "^4.5.0",
54
55
  "lodash.tonumber": "^4.0.3",
55
56
  "react-native-modal-datetime-picker": "^13.0.0",
56
- "react-native-svg": "^12.3.0",
57
+ "react-native-svg": "12.3.0",
57
58
  "react-native-typography": "^1.4.1",
58
59
  "react-native-web-swiper": "^2.2.3"
59
60
  },
@@ -80,5 +81,5 @@
80
81
  ]
81
82
  ]
82
83
  },
83
- "gitHead": "cb2c543552734b1e7d7056d04da2430dd5a6e4b5"
84
+ "gitHead": "d2065e1882c71953f45e9470332b9d04aabaada5"
84
85
  }
@@ -0,0 +1,33 @@
1
+ import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "FlashList",
4
+ tag: "FlashList",
5
+ description: "Flashlist by Shopify",
6
+ packageName: "@shopify/flash-list",
7
+ category: COMPONENT_TYPES.data,
8
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
9
+ layout: {
10
+ flex: 1,
11
+ },
12
+ props: {
13
+ estimatedItemSize: createNumberProp({
14
+ group: GROUPS.basic,
15
+ label: "Est. Item Size",
16
+ description: "Approximate size of the items before rendering.",
17
+ defaultValue: 50,
18
+ step: 1,
19
+ precision: 0,
20
+ }),
21
+ horizontal: createStaticBoolProp({
22
+ label: "Horizontal",
23
+ description: "Render list horizontally",
24
+ }),
25
+ inverted: createStaticBoolProp({
26
+ label: "Inverted",
27
+ description: "If true, reverses the direction.",
28
+ }),
29
+ numColumns: createNumColumnsType({
30
+ editable: true,
31
+ }),
32
+ },
33
+ };
@@ -0,0 +1,41 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createNumColumnsType,
4
+ createStaticBoolProp,
5
+ createNumberProp,
6
+ CONTAINER_COMPONENT_STYLES_SECTIONS,
7
+ GROUPS,
8
+ } from "@draftbit/types";
9
+
10
+ export const SEED_DATA = {
11
+ name: "FlashList",
12
+ tag: "FlashList",
13
+ description: "Flashlist by Shopify",
14
+ packageName: "@shopify/flash-list",
15
+ category: COMPONENT_TYPES.data,
16
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
17
+ layout: {
18
+ flex: 1,
19
+ },
20
+ props: {
21
+ estimatedItemSize: createNumberProp({
22
+ group: GROUPS.basic,
23
+ label: "Est. Item Size",
24
+ description: "Approximate size of the items before rendering.",
25
+ defaultValue: 50,
26
+ step: 1,
27
+ precision: 0,
28
+ }),
29
+ horizontal: createStaticBoolProp({
30
+ label: "Horizontal",
31
+ description: "Render list horizontally",
32
+ }),
33
+ inverted: createStaticBoolProp({
34
+ label: "Inverted",
35
+ description: "If true, reverses the direction.",
36
+ }),
37
+ numColumns: createNumColumnsType({
38
+ editable: true,
39
+ }),
40
+ },
41
+ };
@@ -3,7 +3,6 @@ export const SEED_DATA = {
3
3
  name: "SVG",
4
4
  tag: "SVG",
5
5
  description: "An SVG component",
6
- packageName: "@draftbit/core",
7
6
  category: COMPONENT_TYPES.media,
8
7
  layout: {
9
8
  width: 100,
@@ -8,7 +8,6 @@ export const SEED_DATA = {
8
8
  name: "SVG",
9
9
  tag: "SVG",
10
10
  description: "An SVG component",
11
- packageName: "@draftbit/core",
12
11
  category: COMPONENT_TYPES.media,
13
12
  layout: {
14
13
  width: 100,