@draftbit/core 46.2.4-7028ac.5 → 46.2.4-70e86e.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.
- package/lib/commonjs/components/CardContainer.js +5 -15
- package/lib/commonjs/components/CircleImage.js +2 -16
- package/lib/commonjs/components/DeprecatedButton.js +4 -22
- package/lib/commonjs/components/IconButton.js +5 -22
- package/lib/commonjs/components/Image.js +3 -16
- package/lib/commonjs/components/Markdown.js +78 -0
- package/lib/commonjs/components/Portal/Portal.js +3 -12
- package/lib/commonjs/components/Portal/PortalConsumer.js +8 -10
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +6 -24
- package/lib/commonjs/components/RadioButton/context.js +1 -1
- package/lib/commonjs/components/StarRating.js +0 -1
- package/lib/commonjs/components/Switch.js +10 -23
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/mappings/Markdown.js +23 -0
- package/lib/commonjs/mappings/SVG.js +0 -1
- package/lib/module/components/Banner.js +4 -24
- package/lib/module/components/CardBlock.js +5 -15
- package/lib/module/components/Checkbox/CheckboxGroup.js +3 -17
- package/lib/module/components/DeprecatedCardWrapper.js +2 -19
- package/lib/module/components/IconButton.js +5 -22
- package/lib/module/components/Markdown.js +63 -0
- package/lib/module/components/Picker/PickerComponent.android.js +5 -23
- package/lib/module/components/Picker/PickerComponent.web.js +5 -23
- package/lib/module/components/ProgressBar.js +7 -23
- package/lib/module/components/StarRating.js +5 -25
- package/lib/module/components/Surface.js +2 -16
- package/lib/module/components/Text.js +10 -33
- package/lib/module/components/TextField.js +30 -62
- package/lib/module/components/Touchable.js +2 -18
- package/lib/module/constants.js +0 -1
- package/lib/module/index.js +2 -1
- package/lib/module/mappings/Markdown.js +14 -0
- package/lib/module/mappings/SVG.js +0 -1
- package/lib/typescript/src/components/Markdown.d.ts +6 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/mappings/Markdown.d.ts +9 -0
- package/lib/typescript/src/mappings/SVG.d.ts +0 -1
- package/package.json +6 -4
- package/src/components/Markdown.js +57 -0
- package/src/components/Markdown.tsx +70 -0
- package/src/components/StarRating.js +0 -1
- package/src/components/StarRating.tsx +0 -1
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/Markdown.js +14 -0
- package/src/mappings/Markdown.ts +15 -0
- package/src/mappings/SVG.js +0 -1
- package/src/mappings/SVG.ts +0 -1
|
@@ -23,6 +23,8 @@ var _Config = _interopRequireDefault(require("./Config"));
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
const ICON_CONTAINER_SIZE = _Config.default.cardIconSize * 2;
|
|
27
29
|
const ICON_CONTAINER_PADDING = _Config.default.cardIconSize / 2 - 1;
|
|
28
30
|
|
|
@@ -66,12 +68,11 @@ const CardContainer = _ref => {
|
|
|
66
68
|
break;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, {
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, _extends({
|
|
70
72
|
style: style,
|
|
71
73
|
onPress: onPress,
|
|
72
|
-
numColumns: numColumns
|
|
73
|
-
|
|
74
|
-
}, /*#__PURE__*/_react.default.createElement(_Elevation.default, {
|
|
74
|
+
numColumns: numColumns
|
|
75
|
+
}, rest), /*#__PURE__*/_react.default.createElement(_Elevation.default, {
|
|
75
76
|
style: {
|
|
76
77
|
elevation,
|
|
77
78
|
borderRadius: roundness
|
|
@@ -143,15 +144,4 @@ const CardContainer = _ref => {
|
|
|
143
144
|
|
|
144
145
|
var _default = (0, _theming.withTheme)(CardContainer);
|
|
145
146
|
|
|
146
|
-
exports.default = _default;, _color.default)(colors.strong).alpha(_Config.default.cardIconBackgroundOpacity).rgb().string()
|
|
147
|
-
}
|
|
148
|
-
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
149
|
-
name: icon,
|
|
150
|
-
size: _Config.default.cardIconSize,
|
|
151
|
-
color: colors.surface
|
|
152
|
-
})) : null)));
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
var _default = (0, _theming.withTheme)(CardContainer);
|
|
156
|
-
|
|
157
147
|
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 _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,
|
|
@@ -25,6 +25,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
25
|
|
|
26
26
|
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; }
|
|
27
27
|
|
|
28
|
+
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); }
|
|
29
|
+
|
|
28
30
|
const Button = _ref => {
|
|
29
31
|
let {
|
|
30
32
|
Icon,
|
|
@@ -126,7 +128,7 @@ const Button = _ref => {
|
|
|
126
128
|
alignSelf: "stretch",
|
|
127
129
|
...margins
|
|
128
130
|
}
|
|
129
|
-
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
131
|
+
}, /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
|
|
130
132
|
onPress: onPress,
|
|
131
133
|
accessibilityState: {
|
|
132
134
|
disabled
|
|
@@ -134,7 +136,7 @@ const Button = _ref => {
|
|
|
134
136
|
accessibilityRole: "button",
|
|
135
137
|
disabled: disabled || loading,
|
|
136
138
|
style: [styles.button, buttonStyle, innerStyles]
|
|
137
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
139
|
+
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
138
140
|
style: styles.content
|
|
139
141
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
140
142
|
style: iconStyle
|
|
@@ -169,24 +171,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
169
171
|
|
|
170
172
|
var _default = (0, _theming.withTheme)(Button);
|
|
171
173
|
|
|
172
|
-
exports.default = _default;));
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
const styles = _reactNative.StyleSheet.create({
|
|
176
|
-
button: {
|
|
177
|
-
minWidth: 64,
|
|
178
|
-
borderStyle: "solid"
|
|
179
|
-
},
|
|
180
|
-
content: {
|
|
181
|
-
flexDirection: "row",
|
|
182
|
-
alignItems: "center",
|
|
183
|
-
justifyContent: "center"
|
|
184
|
-
},
|
|
185
|
-
icon: {
|
|
186
|
-
width: _Config.default.buttonIconSize
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
var _default = (0, _theming.withTheme)(Button);
|
|
191
|
-
|
|
192
174
|
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 IconButton = _ref => {
|
|
19
21
|
let {
|
|
20
22
|
Icon,
|
|
@@ -29,7 +31,7 @@ const IconButton = _ref => {
|
|
|
29
31
|
...props
|
|
30
32
|
} = _ref;
|
|
31
33
|
const iconColor = customColor || theme.colors.primary;
|
|
32
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
34
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
|
|
33
35
|
onPress: onPress,
|
|
34
36
|
disabled: disabled || loading,
|
|
35
37
|
style: _ref2 => {
|
|
@@ -43,9 +45,8 @@ const IconButton = _ref => {
|
|
|
43
45
|
alignItems: "center",
|
|
44
46
|
justifyContent: "center"
|
|
45
47
|
}, style];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, null, icon && !loading ? /*#__PURE__*/React.createElement(Icon, {
|
|
48
|
+
}
|
|
49
|
+
}, props), /*#__PURE__*/React.createElement(_reactNative.View, null, icon && !loading ? /*#__PURE__*/React.createElement(Icon, {
|
|
49
50
|
name: icon,
|
|
50
51
|
size: size - 2,
|
|
51
52
|
color: iconColor
|
|
@@ -70,22 +71,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
70
71
|
|
|
71
72
|
var _default = (0, _theming.withTheme)(IconButton);
|
|
72
73
|
|
|
73
|
-
exports.default = _default;) : null));
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const styles = _reactNative.StyleSheet.create({
|
|
77
|
-
container: {
|
|
78
|
-
alignItems: "center",
|
|
79
|
-
justifyContent: "center",
|
|
80
|
-
..._reactNative.Platform.select({
|
|
81
|
-
web: {
|
|
82
|
-
cursor: "pointer",
|
|
83
|
-
userSelect: "none"
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
var _default = (0, _theming.withTheme)(IconButton);
|
|
90
|
-
|
|
91
74
|
exports.default = _default;
|
|
@@ -15,7 +15,8 @@ var _AspectRatio = _interopRequireDefault(require("./AspectRatio"));
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
|
|
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
|
+
|
|
19
20
|
const generateDimensions = _ref => {
|
|
20
21
|
let {
|
|
21
22
|
aspectRatio,
|
|
@@ -76,27 +77,13 @@ const Image = _ref2 => {
|
|
|
76
77
|
height,
|
|
77
78
|
aspectRatio
|
|
78
79
|
}]
|
|
79
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, _extends({}, props, {
|
|
80
81
|
source: imageSource,
|
|
81
82
|
resizeMode: resizeMode,
|
|
82
83
|
style: [style, {
|
|
83
84
|
height: "100%",
|
|
84
85
|
width: "100%"
|
|
85
86
|
}]
|
|
86
|
-
}));
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Image, { ...props,
|
|
90
|
-
source: source,
|
|
91
|
-
resizeMode: resizeMode,
|
|
92
|
-
style: style
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
var _default = Image;
|
|
97
|
-
exports.default = _default; height: "100%",
|
|
98
|
-
width: "100%"
|
|
99
|
-
}]
|
|
100
87
|
})));
|
|
101
88
|
}
|
|
102
89
|
|
|
@@ -0,0 +1,78 @@
|
|
|
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.collectiveMd
|
|
25
|
+
}, content));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const markdownStyle = {
|
|
29
|
+
singleLineMd: {
|
|
30
|
+
text: {
|
|
31
|
+
color: "blue",
|
|
32
|
+
textAlign: "right"
|
|
33
|
+
},
|
|
34
|
+
view: {
|
|
35
|
+
alignSelf: "stretch"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
collectiveMd: {
|
|
39
|
+
heading1: {
|
|
40
|
+
color: "red"
|
|
41
|
+
},
|
|
42
|
+
heading2: {
|
|
43
|
+
color: "green",
|
|
44
|
+
textAlign: "right"
|
|
45
|
+
},
|
|
46
|
+
strong: {
|
|
47
|
+
color: "blue"
|
|
48
|
+
},
|
|
49
|
+
em: {
|
|
50
|
+
color: "cyan"
|
|
51
|
+
},
|
|
52
|
+
text: {
|
|
53
|
+
color: "black"
|
|
54
|
+
},
|
|
55
|
+
blockQuoteText: {
|
|
56
|
+
color: "grey"
|
|
57
|
+
},
|
|
58
|
+
blockQuoteSection: {
|
|
59
|
+
flexDirection: "row"
|
|
60
|
+
},
|
|
61
|
+
blockQuoteSectionBar: {
|
|
62
|
+
width: 3,
|
|
63
|
+
height: null,
|
|
64
|
+
backgroundColor: "#DDDDDD",
|
|
65
|
+
marginRight: 15
|
|
66
|
+
},
|
|
67
|
+
codeBlock: {
|
|
68
|
+
fontFamily: "Courier",
|
|
69
|
+
fontWeight: "500",
|
|
70
|
+
backgroundColor: "#DDDDDD"
|
|
71
|
+
},
|
|
72
|
+
tableHeader: {
|
|
73
|
+
backgroundColor: "grey"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var _default = MarkdownComponent;
|
|
78
|
+
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 _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
|
+
|
|
22
24
|
/**
|
|
23
25
|
* Portal allows to render a component at a different place in the parent tree.
|
|
24
26
|
* You can use it to render content which should appear above other elements, similar to `Modal`.
|
|
@@ -41,6 +43,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
41
43
|
* ```
|
|
42
44
|
*/
|
|
43
45
|
class Portal extends React.Component {
|
|
46
|
+
// @component ./PortalHost.tsx
|
|
44
47
|
render() {
|
|
45
48
|
const {
|
|
46
49
|
children,
|
|
@@ -53,18 +56,6 @@ class Portal extends React.Component {
|
|
|
53
56
|
}, children)));
|
|
54
57
|
}
|
|
55
58
|
|
|
56
|
-
} // @component ./PortalHost.tsx
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Portal.Host = _PortalHost.default;
|
|
60
|
-
|
|
61
|
-
var _default = (0, _theming.withTheme)(Portal);
|
|
62
|
-
|
|
63
|
-
exports.default = _default;URE__*/React.createElement(_theming.ThemeProvider, {
|
|
64
|
-
theme: theme
|
|
65
|
-
}, children)));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
59
|
}
|
|
69
60
|
|
|
70
61
|
_defineProperty(Portal, "Host", _PortalHost.default);
|
|
@@ -11,7 +11,15 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
11
11
|
|
|
12
12
|
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; }
|
|
13
13
|
|
|
14
|
+
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; }
|
|
15
|
+
|
|
14
16
|
class PortalConsumer extends React.Component {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
|
|
20
|
+
_defineProperty(this, "key", void 0);
|
|
21
|
+
}
|
|
22
|
+
|
|
15
23
|
async componentDidMount() {
|
|
16
24
|
this.checkManager(); // Delay updating to prevent React from going to infinite loop
|
|
17
25
|
|
|
@@ -41,14 +49,4 @@ class PortalConsumer extends React.Component {
|
|
|
41
49
|
|
|
42
50
|
}
|
|
43
51
|
|
|
44
|
-
exports.default = PortalConsumer;er` component from `react-native-paper`.\n\n" + "Please read our getting-started guide and make sure you've followed all the required steps.\n\n" + "https://callstack.github.io/react-native-paper/getting-started.html");
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
render() {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
52
|
exports.default = PortalConsumer;
|
|
@@ -25,7 +25,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
25
|
|
|
26
26
|
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; }
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
let Direction;
|
|
29
31
|
exports.Direction = Direction;
|
|
30
32
|
|
|
31
33
|
(function (Direction) {
|
|
@@ -88,14 +90,13 @@ const RadioButtonRow = _ref => {
|
|
|
88
90
|
textStyles,
|
|
89
91
|
viewStyles
|
|
90
92
|
} = (0, _utilities.extractStyles)(style);
|
|
91
|
-
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
93
|
+
return /*#__PURE__*/React.createElement(_Touchable.default, _extends({
|
|
92
94
|
onPress: handlePress,
|
|
93
95
|
style: [styles.mainParent, {
|
|
94
96
|
flexDirection: direction
|
|
95
97
|
}, viewStyles],
|
|
96
|
-
disabled: disabled
|
|
97
|
-
|
|
98
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
98
|
+
disabled: disabled
|
|
99
|
+
}, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
99
100
|
style: [styles.label, {
|
|
100
101
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
101
102
|
}, labelContainerStyle]
|
|
@@ -134,24 +135,5 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
134
135
|
}
|
|
135
136
|
});
|
|
136
137
|
|
|
137
|
-
var _default = RadioButtonRow;
|
|
138
|
-
exports.default = _default; "center",
|
|
139
|
-
justifyContent: "space-around",
|
|
140
|
-
paddingStart: 20,
|
|
141
|
-
minHeight: 50,
|
|
142
|
-
paddingEnd: 20,
|
|
143
|
-
display: "flex",
|
|
144
|
-
..._reactNative.Platform.select({
|
|
145
|
-
web: {
|
|
146
|
-
cursor: "pointer",
|
|
147
|
-
userSelect: "none"
|
|
148
|
-
}
|
|
149
|
-
})
|
|
150
|
-
},
|
|
151
|
-
label: {
|
|
152
|
-
flex: 3
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
|
|
156
138
|
var _default = RadioButtonRow;
|
|
157
139
|
exports.default = _default;
|
|
@@ -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 Switch(_ref) {
|
|
27
29
|
let {
|
|
28
30
|
value,
|
|
@@ -55,24 +57,23 @@ function Switch(_ref) {
|
|
|
55
57
|
setChecked(Boolean(defaultValue));
|
|
56
58
|
}
|
|
57
59
|
}, [defaultValue, previousDefaultValue]);
|
|
58
|
-
return /*#__PURE__*/React.createElement(_reactNative.Switch, {
|
|
60
|
+
return /*#__PURE__*/React.createElement(_reactNative.Switch, _extends({
|
|
59
61
|
value: checked,
|
|
60
62
|
disabled: disabled,
|
|
61
63
|
trackColor: {
|
|
62
64
|
false: inactiveTrackThemeColor,
|
|
63
65
|
true: activeTrackThemeColor
|
|
64
66
|
},
|
|
65
|
-
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor
|
|
66
|
-
|
|
67
|
+
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor // @ts-ignore react-native-web only
|
|
68
|
+
,
|
|
67
69
|
activeThumbColor: activeThumbThemeColor,
|
|
68
70
|
ios_backgroundColor: inactiveTrackThemeColor,
|
|
69
71
|
style: style,
|
|
70
72
|
onValueChange: bool => {
|
|
71
73
|
setChecked(bool);
|
|
72
74
|
onValueChange && onValueChange(bool);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
});
|
|
75
|
+
}
|
|
76
|
+
}, rest));
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
function Row(_ref2) {
|
|
@@ -102,7 +103,7 @@ function Row(_ref2) {
|
|
|
102
103
|
setChecked(defaultValue);
|
|
103
104
|
}
|
|
104
105
|
}, [defaultValue]);
|
|
105
|
-
return /*#__PURE__*/React.createElement(_FormRow.default, {
|
|
106
|
+
return /*#__PURE__*/React.createElement(_FormRow.default, _extends({
|
|
106
107
|
disabled: disabled,
|
|
107
108
|
onPress: () => {
|
|
108
109
|
setChecked(!checked);
|
|
@@ -110,9 +111,8 @@ function Row(_ref2) {
|
|
|
110
111
|
},
|
|
111
112
|
label: label,
|
|
112
113
|
direction: direction,
|
|
113
|
-
style: style
|
|
114
|
-
|
|
115
|
-
}, /*#__PURE__*/React.createElement(Switch, {
|
|
114
|
+
style: style
|
|
115
|
+
}, rest), /*#__PURE__*/React.createElement(Switch, {
|
|
116
116
|
theme: theme,
|
|
117
117
|
value: checked,
|
|
118
118
|
disabled: disabled,
|
|
@@ -129,17 +129,4 @@ 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
|
-
|
|
145
132
|
exports.default = _default;
|
|
@@ -9,7 +9,7 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
|
|
10
10
|
// @ts-ignore
|
|
11
11
|
const expo = global.__expo;
|
|
12
|
-
const DEFAULT_STATUSBAR_HEIGHT_EXPO =
|
|
12
|
+
const DEFAULT_STATUSBAR_HEIGHT_EXPO = expo !== null && expo !== void 0 && expo.Constants ? expo.Constants.statusBarHeight : 0;
|
|
13
13
|
|
|
14
14
|
const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
15
15
|
android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
|
package/lib/commonjs/index.js
CHANGED
|
@@ -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;
|
|
@@ -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 { Button, Text, View, StyleSheet, Animated } from "react-native";
|
|
3
5
|
import Surface from "./Surface";
|
|
@@ -72,9 +74,9 @@ const Banner = _ref => {
|
|
|
72
74
|
|
|
73
75
|
const height = Animated.multiply(position, layout.height);
|
|
74
76
|
const translateY = Animated.multiply(Animated.add(position, -1), layout.height);
|
|
75
|
-
return /*#__PURE__*/React.createElement(Surface, {
|
|
77
|
+
return /*#__PURE__*/React.createElement(Surface, _extends({}, rest, {
|
|
76
78
|
style: [styles.container, shadow(ELEVATION), style]
|
|
77
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
79
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
78
80
|
style: [styles.wrapper, contentStyle]
|
|
79
81
|
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
80
82
|
style: {
|
|
@@ -153,26 +155,4 @@ const styles = StyleSheet.create({
|
|
|
153
155
|
margin: 8
|
|
154
156
|
}
|
|
155
157
|
});
|
|
156
|
-
export default withTheme(Banner);00%"
|
|
157
|
-
},
|
|
158
|
-
content: {
|
|
159
|
-
flexDirection: "row",
|
|
160
|
-
justifyContent: "flex-start",
|
|
161
|
-
marginHorizontal: 8,
|
|
162
|
-
marginTop: 16,
|
|
163
|
-
marginBottom: 0
|
|
164
|
-
},
|
|
165
|
-
icon: {
|
|
166
|
-
margin: 8
|
|
167
|
-
},
|
|
168
|
-
message: {
|
|
169
|
-
flex: 1,
|
|
170
|
-
margin: 8
|
|
171
|
-
},
|
|
172
|
-
actions: {
|
|
173
|
-
flexDirection: "row",
|
|
174
|
-
justifyContent: "flex-end",
|
|
175
|
-
margin: 8
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
158
|
export default withTheme(Banner);
|
|
@@ -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 React from "react";
|
|
2
4
|
import { View, Text } from "react-native";
|
|
3
5
|
import Image from "./Image";
|
|
@@ -45,12 +47,11 @@ const CardBlock = _ref => {
|
|
|
45
47
|
const rightDescriptionStyles = [typography.subtitle2, {
|
|
46
48
|
color: colors.light
|
|
47
49
|
}];
|
|
48
|
-
return /*#__PURE__*/React.createElement(Card, {
|
|
50
|
+
return /*#__PURE__*/React.createElement(Card, _extends({
|
|
49
51
|
style: style,
|
|
50
52
|
onPress: onPress,
|
|
51
|
-
numColumns: numColumns
|
|
52
|
-
|
|
53
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
53
|
+
numColumns: numColumns
|
|
54
|
+
}, rest), /*#__PURE__*/React.createElement(View, {
|
|
54
55
|
style: {
|
|
55
56
|
backgroundColor: colors.background
|
|
56
57
|
}
|
|
@@ -100,15 +101,4 @@ const CardBlock = _ref => {
|
|
|
100
101
|
}, rightDescription) : null) : null));
|
|
101
102
|
};
|
|
102
103
|
|
|
103
|
-
export default withTheme(CardBlock);PURE__*/React.createElement(Text, {
|
|
104
|
-
numberOfLines: 1,
|
|
105
|
-
style: [typography.body2, {
|
|
106
|
-
color: colors.medium
|
|
107
|
-
}]
|
|
108
|
-
}, leftDescription), rightDescription ? /*#__PURE__*/React.createElement(Text, {
|
|
109
|
-
numberOfLines: 1,
|
|
110
|
-
style: rightDescriptionStyles
|
|
111
|
-
}, rightDescription) : null) : null));
|
|
112
|
-
};
|
|
113
|
-
|
|
114
104
|
export default withTheme(CardBlock);
|