@draftbit/core 46.2.4-5875f8.8 → 46.2.4-5b5cc7.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/Markdown.js +33 -0
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/mappings/Markdown.js +23 -0
- package/lib/module/components/Button.js +32 -11
- package/lib/module/components/DeprecatedButton.js +21 -4
- package/lib/module/components/Divider.js +20 -2
- package/lib/module/components/Layout.js +43 -21
- package/lib/module/components/Markdown.js +18 -0
- package/lib/module/components/Portal/PortalHost.js +26 -15
- package/lib/module/components/ToggleButton.js +17 -3
- package/lib/module/index.js +2 -1
- package/lib/module/mappings/Markdown.js +14 -0
- 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/package.json +5 -3
- package/src/components/Markdown.js +12 -0
- package/src/components/Markdown.tsx +25 -0
- 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
|
@@ -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;
|
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,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
2
|
import { Text, Pressable, Platform, StyleSheet, ActivityIndicator } from "react-native";
|
|
5
3
|
import { withTheme } from "../theming";
|
|
@@ -57,7 +55,7 @@ function Base(_ref) {
|
|
|
57
55
|
buttonStyles.justifyContent = "flex-end";
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
return /*#__PURE__*/React.createElement(Pressable,
|
|
58
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
61
59
|
onPress: onPress,
|
|
62
60
|
disabled: disabled || loading,
|
|
63
61
|
style: _ref2 => {
|
|
@@ -67,8 +65,9 @@ function Base(_ref) {
|
|
|
67
65
|
return [styles.base, {
|
|
68
66
|
opacity: pressed || disabled ? 0.75 : 1
|
|
69
67
|
}, buttonStyles];
|
|
70
|
-
}
|
|
71
|
-
|
|
68
|
+
},
|
|
69
|
+
...props
|
|
70
|
+
}, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
72
71
|
size: "small",
|
|
73
72
|
color: color,
|
|
74
73
|
style: styles.loading
|
|
@@ -88,13 +87,14 @@ const Solid = _ref3 => {
|
|
|
88
87
|
theme,
|
|
89
88
|
...props
|
|
90
89
|
} = _ref3;
|
|
91
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
90
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
92
91
|
style: [{
|
|
93
92
|
color: "#FFF",
|
|
94
93
|
borderRadius: theme.roundness,
|
|
95
94
|
backgroundColor: theme.colors.primary
|
|
96
|
-
}, style]
|
|
97
|
-
|
|
95
|
+
}, style],
|
|
96
|
+
...props
|
|
97
|
+
});
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
const ButtonSolid = withTheme(Solid);
|
|
@@ -106,13 +106,14 @@ const Outline = _ref4 => {
|
|
|
106
106
|
theme,
|
|
107
107
|
...props
|
|
108
108
|
} = _ref4;
|
|
109
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
109
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
110
110
|
style: [styles.outline, {
|
|
111
111
|
borderRadius: theme.roundness,
|
|
112
112
|
borderColor: theme.colors.primary,
|
|
113
113
|
color: theme.colors.primary
|
|
114
|
-
}, style]
|
|
115
|
-
|
|
114
|
+
}, style],
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
116
117
|
};
|
|
117
118
|
|
|
118
119
|
const ButtonOutline = withTheme(Outline);
|
|
@@ -159,4 +160,24 @@ const styles = StyleSheet.create({
|
|
|
159
160
|
}
|
|
160
161
|
})
|
|
161
162
|
}
|
|
163
|
+
});ndColor: "transparent",
|
|
164
|
+
padding: 0,
|
|
165
|
+
minHeight: undefined
|
|
166
|
+
},
|
|
167
|
+
loading: {
|
|
168
|
+
marginRight: 6
|
|
169
|
+
},
|
|
170
|
+
icon: { ...Platform.select({
|
|
171
|
+
web: {
|
|
172
|
+
marginTop: 1,
|
|
173
|
+
marginRight: 4,
|
|
174
|
+
alignSelf: "center"
|
|
175
|
+
},
|
|
176
|
+
default: {
|
|
177
|
+
marginBottom: 2,
|
|
178
|
+
marginRight: 4,
|
|
179
|
+
alignSelf: "center"
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
}
|
|
162
183
|
});
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
2
|
import { ActivityIndicator, View, Text, StyleSheet } from "react-native";
|
|
5
3
|
import color from "color";
|
|
@@ -107,7 +105,7 @@ const Button = _ref => {
|
|
|
107
105
|
alignSelf: "stretch",
|
|
108
106
|
...margins
|
|
109
107
|
}
|
|
110
|
-
}, /*#__PURE__*/React.createElement(Touchable,
|
|
108
|
+
}, /*#__PURE__*/React.createElement(Touchable, { ...rest,
|
|
111
109
|
onPress: onPress,
|
|
112
110
|
accessibilityState: {
|
|
113
111
|
disabled
|
|
@@ -115,7 +113,7 @@ const Button = _ref => {
|
|
|
115
113
|
accessibilityRole: "button",
|
|
116
114
|
disabled: disabled || loading,
|
|
117
115
|
style: [styles.button, buttonStyle, innerStyles]
|
|
118
|
-
}
|
|
116
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
119
117
|
style: styles.content
|
|
120
118
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
121
119
|
style: iconStyle
|
|
@@ -133,6 +131,25 @@ const Button = _ref => {
|
|
|
133
131
|
}, children))));
|
|
134
132
|
};
|
|
135
133
|
|
|
134
|
+
const styles = StyleSheet.create({
|
|
135
|
+
button: {
|
|
136
|
+
minWidth: 64,
|
|
137
|
+
borderStyle: "solid"
|
|
138
|
+
},
|
|
139
|
+
content: {
|
|
140
|
+
flexDirection: "row",
|
|
141
|
+
alignItems: "center",
|
|
142
|
+
justifyContent: "center"
|
|
143
|
+
},
|
|
144
|
+
icon: {
|
|
145
|
+
width: Config.buttonIconSize
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
export default withTheme(Button);ines: 1,
|
|
149
|
+
style: [textStyle, typography.button]
|
|
150
|
+
}, children))));
|
|
151
|
+
};
|
|
152
|
+
|
|
136
153
|
const styles = StyleSheet.create({
|
|
137
154
|
button: {
|
|
138
155
|
minWidth: 64,
|
|
@@ -1,9 +1,27 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
2
|
import { StyleSheet, View } from "react-native";
|
|
5
3
|
import { withTheme } from "../theming";
|
|
6
4
|
|
|
5
|
+
const Divider = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
style,
|
|
8
|
+
color,
|
|
9
|
+
theme: {
|
|
10
|
+
colors
|
|
11
|
+
},
|
|
12
|
+
...rest
|
|
13
|
+
} = _ref;
|
|
14
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
15
|
+
style: [{
|
|
16
|
+
backgroundColor: color || colors.divider,
|
|
17
|
+
height: StyleSheet.hairlineWidth
|
|
18
|
+
}, style],
|
|
19
|
+
...rest
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default withTheme(Divider);ng";
|
|
24
|
+
|
|
7
25
|
const Divider = _ref => {
|
|
8
26
|
let {
|
|
9
27
|
style,
|
|
@@ -1,8 +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
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
|
-
import { View } from "react-native";
|
|
5
|
-
|
|
2
|
+
import { View } from "react-native";
|
|
6
3
|
export function Center(_ref) {
|
|
7
4
|
let {
|
|
8
5
|
width = 240,
|
|
@@ -12,15 +9,16 @@ export function Center(_ref) {
|
|
|
12
9
|
style,
|
|
13
10
|
...rest
|
|
14
11
|
} = _ref;
|
|
15
|
-
return /*#__PURE__*/React.createElement(View,
|
|
12
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
16
13
|
style: [{
|
|
17
14
|
justifyContent: "center",
|
|
18
15
|
alignItems: "center",
|
|
19
16
|
width,
|
|
20
17
|
height,
|
|
21
18
|
backgroundColor: bgColor
|
|
22
|
-
}, style]
|
|
23
|
-
|
|
19
|
+
}, style],
|
|
20
|
+
...rest
|
|
21
|
+
}, children);
|
|
24
22
|
}
|
|
25
23
|
export function Circle(_ref2) {
|
|
26
24
|
let {
|
|
@@ -31,7 +29,7 @@ export function Circle(_ref2) {
|
|
|
31
29
|
...rest
|
|
32
30
|
} = _ref2;
|
|
33
31
|
const borderRadius = 1000;
|
|
34
|
-
return /*#__PURE__*/React.createElement(Center,
|
|
32
|
+
return /*#__PURE__*/React.createElement(Center, {
|
|
35
33
|
width: size,
|
|
36
34
|
height: size,
|
|
37
35
|
bgColor: bgColor,
|
|
@@ -39,8 +37,9 @@ export function Circle(_ref2) {
|
|
|
39
37
|
backgroundColor: bgColor,
|
|
40
38
|
borderRadius,
|
|
41
39
|
overflow: "hidden"
|
|
42
|
-
}]
|
|
43
|
-
|
|
40
|
+
}],
|
|
41
|
+
...rest
|
|
42
|
+
}, children);
|
|
44
43
|
}
|
|
45
44
|
export function Square(_ref3) {
|
|
46
45
|
let {
|
|
@@ -50,12 +49,13 @@ export function Square(_ref3) {
|
|
|
50
49
|
style,
|
|
51
50
|
...rest
|
|
52
51
|
} = _ref3;
|
|
53
|
-
return /*#__PURE__*/React.createElement(Center,
|
|
52
|
+
return /*#__PURE__*/React.createElement(Center, {
|
|
54
53
|
style: style,
|
|
55
54
|
width: size,
|
|
56
55
|
height: size,
|
|
57
|
-
bgColor: bgColor
|
|
58
|
-
|
|
56
|
+
bgColor: bgColor,
|
|
57
|
+
...rest
|
|
58
|
+
}, children);
|
|
59
59
|
}
|
|
60
60
|
export function Row(_ref4) {
|
|
61
61
|
let {
|
|
@@ -65,14 +65,14 @@ export function Row(_ref4) {
|
|
|
65
65
|
style,
|
|
66
66
|
...rest
|
|
67
67
|
} = _ref4;
|
|
68
|
-
return /*#__PURE__*/React.createElement(View,
|
|
69
|
-
style: [style,
|
|
70
|
-
{
|
|
68
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
69
|
+
style: [style, {
|
|
71
70
|
alignItems,
|
|
72
71
|
flexDirection: "row",
|
|
73
72
|
justifyContent: justifyContent
|
|
74
|
-
}]
|
|
75
|
-
|
|
73
|
+
}],
|
|
74
|
+
...rest
|
|
75
|
+
}, children);
|
|
76
76
|
}
|
|
77
77
|
export function Spacer(_ref5) {
|
|
78
78
|
let {
|
|
@@ -84,14 +84,36 @@ export function Spacer(_ref5) {
|
|
|
84
84
|
style,
|
|
85
85
|
...rest
|
|
86
86
|
} = _ref5;
|
|
87
|
-
return /*#__PURE__*/React.createElement(View,
|
|
87
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
88
88
|
style: [style, {
|
|
89
89
|
paddingRight: right,
|
|
90
90
|
paddingTop: top,
|
|
91
91
|
paddingLeft: left,
|
|
92
92
|
paddingBottom: bottom
|
|
93
|
-
}]
|
|
94
|
-
|
|
93
|
+
}],
|
|
94
|
+
...rest
|
|
95
|
+
}, children);
|
|
96
|
+
}
|
|
97
|
+
export function Stack(_ref6) {
|
|
98
|
+
let {
|
|
99
|
+
children,
|
|
100
|
+
justifyContent = "flex-start",
|
|
101
|
+
alignItems = "flex-start",
|
|
102
|
+
style,
|
|
103
|
+
...rest
|
|
104
|
+
} = _ref6;
|
|
105
|
+
return (
|
|
106
|
+
/*#__PURE__*/
|
|
107
|
+
// style must go first since we don't want justifyContent, alignItems overridden
|
|
108
|
+
React.createElement(View, {
|
|
109
|
+
style: [style, {
|
|
110
|
+
justifyContent,
|
|
111
|
+
alignItems
|
|
112
|
+
}],
|
|
113
|
+
...rest
|
|
114
|
+
}, children)
|
|
115
|
+
);
|
|
116
|
+
}dren);
|
|
95
117
|
}
|
|
96
118
|
export function Stack(_ref6) {
|
|
97
119
|
let {
|
|
@@ -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;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
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; }
|
|
2
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
2
|
import { View, StyleSheet } from "react-native";
|
|
5
3
|
import PortalManager from "./PortalManager";
|
|
@@ -33,11 +31,11 @@ export default class PortalHost extends React.Component {
|
|
|
33
31
|
constructor() {
|
|
34
32
|
super(...arguments);
|
|
35
33
|
|
|
36
|
-
|
|
34
|
+
this.setManager = manager => {
|
|
37
35
|
this.manager = manager;
|
|
38
|
-
}
|
|
36
|
+
};
|
|
39
37
|
|
|
40
|
-
|
|
38
|
+
this.mount = children => {
|
|
41
39
|
const key = this.nextKey++;
|
|
42
40
|
|
|
43
41
|
if (this.manager) {
|
|
@@ -51,9 +49,9 @@ export default class PortalHost extends React.Component {
|
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
return key;
|
|
54
|
-
}
|
|
52
|
+
};
|
|
55
53
|
|
|
56
|
-
|
|
54
|
+
this.update = (key, children) => {
|
|
57
55
|
if (this.manager) {
|
|
58
56
|
this.manager.update(key, children);
|
|
59
57
|
} else {
|
|
@@ -71,9 +69,9 @@ export default class PortalHost extends React.Component {
|
|
|
71
69
|
this.queue.push(op);
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
|
-
}
|
|
72
|
+
};
|
|
75
73
|
|
|
76
|
-
|
|
74
|
+
this.unmount = key => {
|
|
77
75
|
if (this.manager) {
|
|
78
76
|
this.manager.unmount(key);
|
|
79
77
|
} else {
|
|
@@ -82,13 +80,10 @@ export default class PortalHost extends React.Component {
|
|
|
82
80
|
key
|
|
83
81
|
});
|
|
84
82
|
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
_defineProperty(this, "nextKey", 0);
|
|
88
|
-
|
|
89
|
-
_defineProperty(this, "queue", []);
|
|
83
|
+
};
|
|
90
84
|
|
|
91
|
-
|
|
85
|
+
this.nextKey = 0;
|
|
86
|
+
this.queue = [];
|
|
92
87
|
}
|
|
93
88
|
|
|
94
89
|
componentDidMount() {
|
|
@@ -132,6 +127,22 @@ export default class PortalHost extends React.Component {
|
|
|
132
127
|
}));
|
|
133
128
|
}
|
|
134
129
|
|
|
130
|
+
}
|
|
131
|
+
PortalHost.displayName = "Portal.Host";
|
|
132
|
+
const styles = StyleSheet.create({
|
|
133
|
+
container: {
|
|
134
|
+
flex: 1
|
|
135
|
+
}
|
|
136
|
+
}); }
|
|
137
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
138
|
+
style: styles.container,
|
|
139
|
+
collapsable: false,
|
|
140
|
+
pointerEvents: "box-none"
|
|
141
|
+
}, this.props.children), /*#__PURE__*/React.createElement(PortalManager, {
|
|
142
|
+
ref: this.setManager
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
|
|
135
146
|
}
|
|
136
147
|
|
|
137
148
|
_defineProperty(PortalHost, "displayName", "Portal.Host");
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
2
|
import { withTheme } from "../theming";
|
|
5
3
|
import { StyleSheet } from "react-native";
|
|
@@ -42,13 +40,29 @@ const ToggleButton = _ref => {
|
|
|
42
40
|
onPress(!internalValue);
|
|
43
41
|
};
|
|
44
42
|
|
|
45
|
-
return /*#__PURE__*/React.createElement(IconButton,
|
|
43
|
+
return /*#__PURE__*/React.createElement(IconButton, {
|
|
46
44
|
Icon: Icon,
|
|
47
45
|
icon: icon,
|
|
48
46
|
size: iconSize,
|
|
49
47
|
color: internalValue ? colors[color] : colors[colorSecondary],
|
|
50
48
|
onPress: handlePress,
|
|
51
49
|
disabled: disabled,
|
|
50
|
+
style: [styles.mainContainer, {
|
|
51
|
+
width,
|
|
52
|
+
height,
|
|
53
|
+
backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
|
|
54
|
+
borderColor: colors[borderColor]
|
|
55
|
+
}, style],
|
|
56
|
+
...rest
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const styles = StyleSheet.create({
|
|
61
|
+
mainContainer: {
|
|
62
|
+
borderWidth: 1
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export default withTheme(ToggleButton);: disabled,
|
|
52
66
|
style: [styles.mainContainer, {
|
|
53
67
|
width,
|
|
54
68
|
height,
|
package/lib/module/index.js
CHANGED
|
@@ -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";
|
|
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
|
+
};
|
|
@@ -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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.2.4-
|
|
3
|
+
"version": "46.2.4-5b5cc7.10+5b5cc749",
|
|
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.
|
|
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": "
|
|
85
|
+
"gitHead": "5b5cc749b746b63ee6932c63dd6f529414ad5531"
|
|
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
|
+
};
|