@draftbit/core 46.2.4-1a04f8.6 → 46.2.4-1cc3fe.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.
@@ -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 CONSTANTS = {
19
21
  baseHeight: 42,
20
22
  borderRadius: 4,
@@ -71,7 +73,7 @@ function Base(_ref) {
71
73
  buttonStyles.justifyContent = "flex-end";
72
74
  }
73
75
 
74
- return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
76
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
75
77
  onPress: onPress,
76
78
  disabled: disabled || loading,
77
79
  style: _ref2 => {
@@ -81,9 +83,8 @@ function Base(_ref) {
81
83
  return [styles.base, {
82
84
  opacity: pressed || disabled ? 0.75 : 1
83
85
  }, buttonStyles];
84
- },
85
- ...props
86
- }, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
86
+ }
87
+ }, props), loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
87
88
  size: "small",
88
89
  color: color,
89
90
  style: styles.loading
@@ -103,14 +104,13 @@ const Solid = _ref3 => {
103
104
  theme,
104
105
  ...props
105
106
  } = _ref3;
106
- return /*#__PURE__*/React.createElement(Base, {
107
+ return /*#__PURE__*/React.createElement(Base, _extends({
107
108
  style: [{
108
109
  color: "#FFF",
109
110
  borderRadius: theme.roundness,
110
111
  backgroundColor: theme.colors.primary
111
- }, style],
112
- ...props
113
- });
112
+ }, style]
113
+ }, props));
114
114
  };
115
115
 
116
116
  const ButtonSolid = (0, _theming.withTheme)(Solid);
@@ -122,14 +122,13 @@ const Outline = _ref4 => {
122
122
  theme,
123
123
  ...props
124
124
  } = _ref4;
125
- return /*#__PURE__*/React.createElement(Base, {
125
+ return /*#__PURE__*/React.createElement(Base, _extends({
126
126
  style: [styles.outline, {
127
127
  borderRadius: theme.roundness,
128
128
  borderColor: theme.colors.primary,
129
129
  color: theme.colors.primary
130
- }, style],
131
- ...props
132
- });
130
+ }, style]
131
+ }, props));
133
132
  };
134
133
 
135
134
  const ButtonOutline = (0, _theming.withTheme)(Outline);
@@ -177,24 +176,4 @@ const styles = _reactNative.StyleSheet.create({
177
176
  }
178
177
  })
179
178
  }
180
- });nsparent",
181
- padding: 0,
182
- minHeight: undefined
183
- },
184
- loading: {
185
- marginRight: 6
186
- },
187
- icon: { ..._reactNative.Platform.select({
188
- web: {
189
- marginTop: 1,
190
- marginRight: 4,
191
- alignSelf: "center"
192
- },
193
- default: {
194
- marginBottom: 2,
195
- marginRight: 4,
196
- alignSelf: "center"
197
- }
198
- })
199
- }
200
179
  });
@@ -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 CircleImage = _ref => {
21
23
  let {
22
24
  source = _Config.default.placeholderImageURL,
@@ -25,22 +27,6 @@ const CircleImage = _ref => {
25
27
  ...props
26
28
  } = _ref;
27
29
  const borderRadius = size / 2;
28
- return /*#__PURE__*/React.createElement(_reactNative.Image, {
29
- style: [{
30
- width: size,
31
- height: size,
32
- borderRadius
33
- }, style],
34
- source: typeof source === "string" ? {
35
- uri: source
36
- } : source,
37
- resizeMode: "cover",
38
- ...props
39
- });
40
- };
41
-
42
- var _default = CircleImage;
43
- exports.default = _default;size / 2;
44
30
  return /*#__PURE__*/React.createElement(_reactNative.Image, _extends({
45
31
  style: [{
46
32
  width: size,
@@ -13,6 +13,8 @@ var _Touchable = _interopRequireDefault(require("./Touchable"));
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+
16
18
  const getWidth = numColumns => {
17
19
  switch (numColumns) {
18
20
  case 1:
@@ -35,23 +37,6 @@ const Card = _ref => {
35
37
  ...rest
36
38
  } = _ref;
37
39
  const width = getWidth(numColumns);
38
- return /*#__PURE__*/_react.default.createElement(_Touchable.default, {
39
- disabled: !onPress,
40
- onPress: onPress,
41
- style: [style, {
42
- width
43
- }],
44
- ...rest
45
- }, children);
46
- };
47
-
48
- var _default = (0, _theming.withTheme)(Card);
49
-
50
- exports.default = _default;,
51
- style,
52
- ...rest
53
- } = _ref;
54
- const width = getWidth(numColumns);
55
40
  return /*#__PURE__*/_react.default.createElement(_Touchable.default, _extends({
56
41
  disabled: !onPress,
57
42
  onPress: onPress,
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var React = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNativeMarkdownPackage = _interopRequireDefault(require("react-native-markdown-package"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+
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
+
18
+ // @ts-ignore
19
+ const MarkdownComponent = _ref => {
20
+ let {
21
+ content
22
+ } = _ref;
23
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_reactNativeMarkdownPackage.default, {
24
+ styles: markdownStyle
25
+ }, content));
26
+ };
27
+
28
+ const markdownStyle = {
29
+ singleLineMd: {},
30
+ collectiveMd: {}
31
+ };
32
+ var _default = MarkdownComponent;
33
+ exports.default = _default;
@@ -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");
@@ -23,8 +23,6 @@ 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
-
28
26
  function Switch(_ref) {
29
27
  let {
30
28
  value,
@@ -57,23 +55,24 @@ function Switch(_ref) {
57
55
  setChecked(Boolean(defaultValue));
58
56
  }
59
57
  }, [defaultValue, previousDefaultValue]);
60
- return /*#__PURE__*/React.createElement(_reactNative.Switch, _extends({
58
+ return /*#__PURE__*/React.createElement(_reactNative.Switch, {
61
59
  value: checked,
62
60
  disabled: disabled,
63
61
  trackColor: {
64
62
  false: inactiveTrackThemeColor,
65
63
  true: activeTrackThemeColor
66
64
  },
67
- thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor // @ts-ignore react-native-web only
68
- ,
65
+ thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor,
66
+ // @ts-ignore react-native-web only
69
67
  activeThumbColor: activeThumbThemeColor,
70
68
  ios_backgroundColor: inactiveTrackThemeColor,
71
69
  style: style,
72
70
  onValueChange: bool => {
73
71
  setChecked(bool);
74
72
  onValueChange && onValueChange(bool);
75
- }
76
- }, rest));
73
+ },
74
+ ...rest
75
+ });
77
76
  }
78
77
 
79
78
  function Row(_ref2) {
@@ -103,7 +102,7 @@ function Row(_ref2) {
103
102
  setChecked(defaultValue);
104
103
  }
105
104
  }, [defaultValue]);
106
- return /*#__PURE__*/React.createElement(_FormRow.default, _extends({
105
+ return /*#__PURE__*/React.createElement(_FormRow.default, {
107
106
  disabled: disabled,
108
107
  onPress: () => {
109
108
  setChecked(!checked);
@@ -111,8 +110,9 @@ function Row(_ref2) {
111
110
  },
112
111
  label: label,
113
112
  direction: direction,
114
- style: style
115
- }, rest), /*#__PURE__*/React.createElement(Switch, {
113
+ style: style,
114
+ ...rest
115
+ }, /*#__PURE__*/React.createElement(Switch, {
116
116
  theme: theme,
117
117
  value: checked,
118
118
  disabled: disabled,
@@ -129,4 +129,17 @@ exports.SwitchRow = SwitchRow;
129
129
 
130
130
  var _default = (0, _theming.withTheme)(Switch);
131
131
 
132
+ exports.default = _default;onValueChange,
133
+ activeTrackColor: activeTrackColor,
134
+ inactiveTrackColor: inactiveTrackColor,
135
+ activeThumbColor: activeThumbColor,
136
+ inactiveThumbColor: inactiveThumbColor
137
+ }));
138
+ }
139
+
140
+ const SwitchRow = (0, _theming.withTheme)(Row);
141
+ exports.SwitchRow = SwitchRow;
142
+
143
+ var _default = (0, _theming.withTheme)(Switch);
144
+
132
145
  exports.default = _default;
@@ -17,6 +17,10 @@ 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
+
20
24
  const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
21
25
 
22
26
  const FOCUS_ANIMATION_DURATION = 150;
@@ -26,7 +30,8 @@ const ICON_SIZE = 24;
26
30
  class TextField extends React.Component {
27
31
  constructor() {
28
32
  super(...arguments);
29
- this.state = {
33
+
34
+ _defineProperty(this, "state", {
30
35
  labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
31
36
  focused: false,
32
37
  placeholder: this.props.error ? this.props.placeholder : "",
@@ -34,35 +39,36 @@ class TextField extends React.Component {
34
39
  measured: false,
35
40
  width: 0
36
41
  }
37
- };
38
- this._timer = setTimeout(() => {}, 0);
42
+ });
43
+
44
+ _defineProperty(this, "_timer", setTimeout(() => {}, 0));
39
45
 
40
- this._showPlaceholder = () => {
46
+ _defineProperty(this, "_showPlaceholder", () => {
41
47
  clearTimeout(this._timer); // Set the placeholder in a delay to offset the label animation
42
48
  // If we show it immediately, they'll overlap and look ugly
43
49
 
44
50
  this._timer = setTimeout(() => this.setState({
45
51
  placeholder: this.props.placeholder
46
52
  }), 50);
47
- };
53
+ });
48
54
 
49
- this._hidePlaceholder = () => this.setState({
55
+ _defineProperty(this, "_hidePlaceholder", () => this.setState({
50
56
  placeholder: ""
51
- });
57
+ }));
52
58
 
53
- this._restoreLabel = () => _reactNative.Animated.timing(this.state.labeled, {
59
+ _defineProperty(this, "_restoreLabel", () => _reactNative.Animated.timing(this.state.labeled, {
54
60
  toValue: 1,
55
61
  duration: FOCUS_ANIMATION_DURATION,
56
62
  useNativeDriver: true
57
- }).start();
63
+ }).start());
58
64
 
59
- this._minmizeLabel = () => _reactNative.Animated.timing(this.state.labeled, {
65
+ _defineProperty(this, "_minmizeLabel", () => _reactNative.Animated.timing(this.state.labeled, {
60
66
  toValue: 0,
61
67
  duration: BLUR_ANIMATION_DURATION,
62
68
  useNativeDriver: true
63
- }).start();
69
+ }).start());
64
70
 
65
- this._handleFocus = () => {
71
+ _defineProperty(this, "_handleFocus", () => {
66
72
  if (this.props.disabled) {
67
73
  return;
68
74
  }
@@ -70,9 +76,9 @@ class TextField extends React.Component {
70
76
  this.setState({
71
77
  focused: true
72
78
  });
73
- };
79
+ });
74
80
 
75
- this._handleBlur = () => {
81
+ _defineProperty(this, "_handleBlur", () => {
76
82
  if (this.props.disabled) {
77
83
  return;
78
84
  }
@@ -80,9 +86,9 @@ class TextField extends React.Component {
80
86
  this.setState({
81
87
  focused: false
82
88
  });
83
- };
89
+ });
84
90
 
85
- this._handleChangeText = value => {
91
+ _defineProperty(this, "_handleChangeText", value => {
86
92
  if (this.props.disabled) {
87
93
  return;
88
94
  }
@@ -98,9 +104,9 @@ class TextField extends React.Component {
98
104
  });
99
105
  this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
100
106
  }
101
- };
107
+ });
102
108
 
103
- this._root = undefined;
109
+ _defineProperty(this, "_root", undefined);
104
110
  }
105
111
 
106
112
  static getDerivedStateFromProps(nextProps, prevState) {
@@ -151,11 +157,10 @@ class TextField extends React.Component {
151
157
  focused: !prevState.focused
152
158
  }));
153
159
  }
160
+
154
161
  /**
155
162
  * @internal
156
163
  */
157
-
158
-
159
164
  setNativeProps(args) {
160
165
  return this._root && this._root.setNativeProps(args);
161
166
  }
@@ -198,8 +203,7 @@ class TextField extends React.Component {
198
203
  roundness,
199
204
  disabledOpacity
200
205
  },
201
- render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, { ...props
202
- }),
206
+ render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, props),
203
207
  ...rest
204
208
  } = this.props;
205
209
  const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
@@ -353,9 +357,9 @@ class TextField extends React.Component {
353
357
 
354
358
  return /*#__PURE__*/React.createElement(_reactNative.View, {
355
359
  style: [styles.container, styleProp]
356
- }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, { ...leftIconProps,
360
+ }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
357
361
  style: leftIconStyle
358
- }) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
362
+ })) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
359
363
  style: (0, _utilities.applyStyles)([containerStyle], {
360
364
  height: style === null || style === void 0 ? void 0 : style.height,
361
365
  backgroundColor: bgColor,
@@ -422,9 +426,9 @@ class TextField extends React.Component {
422
426
  style: {
423
427
  justifyContent: type === "solid" ? "center" : undefined
424
428
  }
425
- }, /*#__PURE__*/React.createElement(Icon, { ...leftIconProps,
429
+ }, /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
426
430
  style: leftIconStyle
427
- })) : null, render({
431
+ }))) : null, render({
428
432
  ref: c => {
429
433
  this._root = c;
430
434
  },
@@ -465,43 +469,6 @@ var _default = (0, _theming.withTheme)(TextField);
465
469
 
466
470
  exports.default = _default;
467
471
 
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
-
505
472
  const styles = _reactNative.StyleSheet.create({
506
473
  container: {
507
474
  alignSelf: "stretch"
@@ -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,
@@ -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;
@@ -213,6 +213,12 @@ Object.defineProperty(exports, "Link", {
213
213
  return _Text.Link;
214
214
  }
215
215
  });
216
+ Object.defineProperty(exports, "Markdown", {
217
+ enumerable: true,
218
+ get: function () {
219
+ return _Markdown.default;
220
+ }
221
+ });
216
222
  Object.defineProperty(exports, "NumberInput", {
217
223
  enumerable: true,
218
224
  get: function () {
@@ -512,6 +518,8 @@ var _Stepper = _interopRequireDefault(require("./components/Stepper"));
512
518
 
513
519
  var _useAuthState = require("./components/useAuthState");
514
520
 
521
+ var _Markdown = _interopRequireDefault(require("./components/Markdown"));
522
+
515
523
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
516
524
 
517
525
  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; }
@@ -0,0 +1,23 @@
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: "Markdown",
12
+ tag: "MarkdownComponent",
13
+ description: "A markdown component",
14
+ category: _types.COMPONENT_TYPES.basic,
15
+ props: {
16
+ content: (0, _types.createTextProp)({
17
+ label: "Markdown Text",
18
+ description: "Markdown Text",
19
+ defaultValue: null
20
+ })
21
+ }
22
+ };
23
+ exports.SEED_DATA = SEED_DATA;
@@ -0,0 +1,18 @@
1
+ import * as React from "react"; // @ts-ignore
2
+
3
+ import Markdown from "react-native-markdown-package";
4
+
5
+ const MarkdownComponent = _ref => {
6
+ let {
7
+ content
8
+ } = _ref;
9
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Markdown, {
10
+ styles: markdownStyle
11
+ }, content));
12
+ };
13
+
14
+ const markdownStyle = {
15
+ singleLineMd: {},
16
+ collectiveMd: {}
17
+ };
18
+ export default MarkdownComponent;
@@ -50,4 +50,5 @@ export { default as RowHeadlineImageCaption } from "./components/RowHeadlineImag
50
50
  export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIcon";
51
51
  export { default as Slider } from "./components/Slider";
52
52
  export { default as Stepper } from "./components/Stepper";
53
- export { useAuthState } from "./components/useAuthState"; // a comment to fix sourcemap comment issue
53
+ export { useAuthState } from "./components/useAuthState";
54
+ export { default as Markdown } from "./components/Markdown"; // a comment to fix sourcemap comment issue
@@ -0,0 +1,14 @@
1
+ import { COMPONENT_TYPES, createTextProp } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Markdown",
4
+ tag: "MarkdownComponent",
5
+ description: "A markdown component",
6
+ category: COMPONENT_TYPES.basic,
7
+ props: {
8
+ content: createTextProp({
9
+ label: "Markdown Text",
10
+ description: "Markdown Text",
11
+ defaultValue: null
12
+ })
13
+ }
14
+ };
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ content?: string;
4
+ };
5
+ declare const MarkdownComponent: React.FC<Props>;
6
+ export default MarkdownComponent;
@@ -49,3 +49,4 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
49
49
  export { default as Slider } from "./components/Slider";
50
50
  export { default as Stepper } from "./components/Stepper";
51
51
  export { useAuthState } from "./components/useAuthState";
52
+ export { default as Markdown } from "./components/Markdown";
@@ -0,0 +1,9 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ description: string;
5
+ category: string;
6
+ props: {
7
+ content: any;
8
+ };
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-1a04f8.6+1a04f8a2",
3
+ "version": "46.2.4-1cc3fe.10+1cc3fe90",
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.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",
@@ -52,6 +52,8 @@
52
52
  "lodash.isnumber": "^3.0.3",
53
53
  "lodash.omit": "^4.5.0",
54
54
  "lodash.tonumber": "^4.0.3",
55
+ "react-native-markdown-display": "^7.0.0-alpha.2",
56
+ "react-native-markdown-package": "^1.8.2",
55
57
  "react-native-modal-datetime-picker": "^13.0.0",
56
58
  "react-native-svg": "12.3.0",
57
59
  "react-native-typography": "^1.4.1",
@@ -80,5 +82,5 @@
80
82
  ]
81
83
  ]
82
84
  },
83
- "gitHead": "1a04f8a2303a4a172ea71e68277fa5a38d8dd7f1"
85
+ "gitHead": "1cc3fe901a296f97d52f51d54c27f4f07fcf09e3"
84
86
  }
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ // @ts-ignore
3
+ import Markdown from "react-native-markdown-package";
4
+ const MarkdownComponent = ({ content }) => {
5
+ return (React.createElement(React.Fragment, null,
6
+ React.createElement(Markdown, { styles: markdownStyle }, content)));
7
+ };
8
+ const markdownStyle = {
9
+ singleLineMd: {},
10
+ collectiveMd: {},
11
+ };
12
+ export default MarkdownComponent;
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ // @ts-ignore
3
+ import Markdown from "react-native-markdown-package";
4
+
5
+ type Props = {
6
+ content?: string;
7
+ };
8
+
9
+ const MarkdownComponent: React.FC<Props> = ({ content }) => {
10
+ return (
11
+ <>
12
+ {
13
+ // @ts-ignore
14
+ }
15
+ <Markdown styles={markdownStyle}>{content}</Markdown>
16
+ </>
17
+ );
18
+ };
19
+
20
+ const markdownStyle = {
21
+ singleLineMd: {},
22
+ collectiveMd: {},
23
+ };
24
+
25
+ export default MarkdownComponent;
package/src/index.js CHANGED
@@ -50,4 +50,5 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
50
50
  export { default as Slider } from "./components/Slider";
51
51
  export { default as Stepper } from "./components/Stepper";
52
52
  export { useAuthState } from "./components/useAuthState";
53
+ export { default as Markdown } from "./components/Markdown";
53
54
  // a comment to fix sourcemap comment issue
package/src/index.tsx CHANGED
@@ -70,5 +70,6 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
70
70
  export { default as Slider } from "./components/Slider";
71
71
  export { default as Stepper } from "./components/Stepper";
72
72
  export { useAuthState } from "./components/useAuthState";
73
+ export { default as Markdown } from "./components/Markdown";
73
74
 
74
75
  // a comment to fix sourcemap comment issue
@@ -0,0 +1,14 @@
1
+ import { COMPONENT_TYPES, createTextProp } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Markdown",
4
+ tag: "MarkdownComponent",
5
+ description: "A markdown component",
6
+ category: COMPONENT_TYPES.basic,
7
+ props: {
8
+ content: createTextProp({
9
+ label: "Markdown Text",
10
+ description: "Markdown Text",
11
+ defaultValue: null,
12
+ }),
13
+ },
14
+ };
@@ -0,0 +1,15 @@
1
+ import { COMPONENT_TYPES, createTextProp } from "@draftbit/types";
2
+
3
+ export const SEED_DATA = {
4
+ name: "Markdown",
5
+ tag: "MarkdownComponent",
6
+ description: "A markdown component",
7
+ category: COMPONENT_TYPES.basic,
8
+ props: {
9
+ content: createTextProp({
10
+ label: "Markdown Text",
11
+ description: "Markdown Text",
12
+ defaultValue: null,
13
+ }),
14
+ },
15
+ };