@draftbit/core 46.4.4-d73221.2 → 46.4.4-f73e6b.2
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/Banner.js +4 -24
- package/lib/module/components/DatePicker/DatePicker.js +8 -7
- package/lib/module/components/Elevation.js +4 -15
- package/lib/module/components/Image.js +3 -18
- package/lib/module/components/Markdown.js +18 -0
- package/lib/module/components/StepIndicator.js +16 -33
- 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 () {
|
|
@@ -510,6 +516,8 @@ var _Stepper = _interopRequireDefault(require("./components/Stepper"));
|
|
|
510
516
|
|
|
511
517
|
var _useAuthState = require("./components/useAuthState");
|
|
512
518
|
|
|
519
|
+
var _Markdown = _interopRequireDefault(require("./components/Markdown"));
|
|
520
|
+
|
|
513
521
|
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); }
|
|
514
522
|
|
|
515
523
|
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 * as React from "react";
|
|
2
4
|
import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput } from "react-native";
|
|
3
5
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
@@ -260,9 +262,9 @@ const DatePicker = _ref => {
|
|
|
260
262
|
pointerEvents: "none"
|
|
261
263
|
}, /*#__PURE__*/React.createElement(View, {
|
|
262
264
|
style: [styles.container, style]
|
|
263
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
265
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
264
266
|
style: leftIconStyle
|
|
265
|
-
}) : null, /*#__PURE__*/React.createElement(View, {
|
|
267
|
+
})) : null, /*#__PURE__*/React.createElement(View, {
|
|
266
268
|
style: [containerStyle, style ? {
|
|
267
269
|
height: style.height
|
|
268
270
|
} : {}]
|
|
@@ -310,11 +312,11 @@ const DatePicker = _ref => {
|
|
|
310
312
|
opacity: hasActiveOutline ? labeled : 1
|
|
311
313
|
}],
|
|
312
314
|
numberOfLines: 1
|
|
313
|
-
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
315
|
+
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
314
316
|
style: { ...leftIconStyle,
|
|
315
317
|
marginLeft: type === "solid" ? 16 : 0
|
|
316
318
|
}
|
|
317
|
-
}) : null, /*#__PURE__*/React.createElement(NativeTextInput, {
|
|
319
|
+
})) : null, /*#__PURE__*/React.createElement(NativeTextInput, _extends({
|
|
318
320
|
value: formatDate(),
|
|
319
321
|
placeholder: label ? placeholder1 : placeholder,
|
|
320
322
|
editable: !disabled,
|
|
@@ -323,9 +325,8 @@ const DatePicker = _ref => {
|
|
|
323
325
|
onFocus: _handleFocus,
|
|
324
326
|
onBlur: _handleBlur,
|
|
325
327
|
underlineColorAndroid: "transparent",
|
|
326
|
-
style: inputStyles
|
|
327
|
-
|
|
328
|
-
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
328
|
+
style: inputStyles
|
|
329
|
+
}, props))), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
329
330
|
name: rightIconName,
|
|
330
331
|
size: ICON_SIZE,
|
|
331
332
|
color: colors.light,
|
|
@@ -1,9 +1,11 @@
|
|
|
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 { Animated, StyleSheet, View } from "react-native";
|
|
3
5
|
import shadow from "../styles/shadow";
|
|
4
6
|
import { withTheme } from "../theming";
|
|
5
|
-
/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
|
|
6
7
|
|
|
8
|
+
/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
|
|
7
9
|
const Elevation = _ref => {
|
|
8
10
|
let {
|
|
9
11
|
style,
|
|
@@ -19,20 +21,7 @@ const Elevation = _ref => {
|
|
|
19
21
|
colors
|
|
20
22
|
} = theme;
|
|
21
23
|
const borderRadius = radius;
|
|
22
|
-
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
23
|
-
style: [{
|
|
24
|
-
borderRadius,
|
|
25
|
-
backgroundColor: colors.surface
|
|
26
|
-
}, elevation ? shadow(elevation) : null, style]
|
|
27
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
28
|
-
style: {
|
|
29
|
-
overflow: "hidden",
|
|
30
|
-
borderRadius
|
|
31
|
-
}
|
|
32
|
-
}, children));
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default withTheme(Elevation);__*/React.createElement(Animated.View, _extends({}, rest, {
|
|
24
|
+
return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
|
|
36
25
|
style: [{
|
|
37
26
|
borderRadius,
|
|
38
27
|
backgroundColor: colors.surface
|
|
@@ -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
|
/* README: Internal Image component used for stuff like Card. DO NOT EXPORT! */
|
|
2
4
|
import React from "react";
|
|
3
5
|
import { Image as NativeImage, StyleSheet } from "react-native";
|
|
@@ -62,24 +64,7 @@ const Image = _ref2 => {
|
|
|
62
64
|
height,
|
|
63
65
|
aspectRatio
|
|
64
66
|
}]
|
|
65
|
-
}, /*#__PURE__*/React.createElement(NativeImage, {
|
|
66
|
-
source: imageSource,
|
|
67
|
-
resizeMode: resizeMode,
|
|
68
|
-
style: [style, {
|
|
69
|
-
height: "100%",
|
|
70
|
-
width: "100%"
|
|
71
|
-
}]
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return /*#__PURE__*/React.createElement(NativeImage, { ...props,
|
|
76
|
-
source: source,
|
|
77
|
-
resizeMode: resizeMode,
|
|
78
|
-
style: style
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export default Image;ent(NativeImage, _extends({}, props, {
|
|
67
|
+
}, /*#__PURE__*/React.createElement(NativeImage, _extends({}, props, {
|
|
83
68
|
source: imageSource,
|
|
84
69
|
resizeMode: resizeMode,
|
|
85
70
|
style: [style, {
|
|
@@ -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,3 +1,5 @@
|
|
|
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
|
+
|
|
1
3
|
// @ts-nocheck
|
|
2
4
|
import React, { Component } from "react";
|
|
3
5
|
import { View, Text, StyleSheet, Animated, TouchableWithoutFeedback } from "react-native";
|
|
@@ -10,7 +12,7 @@ export default class StepIndicator extends Component {
|
|
|
10
12
|
constructor(props) {
|
|
11
13
|
super(props);
|
|
12
14
|
|
|
13
|
-
this
|
|
15
|
+
_defineProperty(this, "renderProgressBarBackground", () => {
|
|
14
16
|
const {
|
|
15
17
|
stepCount,
|
|
16
18
|
direction
|
|
@@ -55,9 +57,9 @@ export default class StepIndicator extends Component {
|
|
|
55
57
|
},
|
|
56
58
|
style: progressBarBackgroundStyle
|
|
57
59
|
});
|
|
58
|
-
};
|
|
60
|
+
});
|
|
59
61
|
|
|
60
|
-
this
|
|
62
|
+
_defineProperty(this, "renderProgressBar", () => {
|
|
61
63
|
const {
|
|
62
64
|
stepCount,
|
|
63
65
|
direction
|
|
@@ -89,9 +91,9 @@ export default class StepIndicator extends Component {
|
|
|
89
91
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
90
92
|
style: progressBarStyle
|
|
91
93
|
});
|
|
92
|
-
};
|
|
94
|
+
});
|
|
93
95
|
|
|
94
|
-
this
|
|
96
|
+
_defineProperty(this, "renderStepIndicator", () => {
|
|
95
97
|
let steps = [];
|
|
96
98
|
const {
|
|
97
99
|
stepCount,
|
|
@@ -124,9 +126,9 @@ export default class StepIndicator extends Component {
|
|
|
124
126
|
height: this.state.customStyles.currentStepIndicatorSize
|
|
125
127
|
}]
|
|
126
128
|
}, steps);
|
|
127
|
-
};
|
|
129
|
+
});
|
|
128
130
|
|
|
129
|
-
this
|
|
131
|
+
_defineProperty(this, "renderStepLabels", () => {
|
|
130
132
|
const {
|
|
131
133
|
labels,
|
|
132
134
|
direction,
|
|
@@ -168,9 +170,9 @@ export default class StepIndicator extends Component {
|
|
|
168
170
|
alignItems: this.state.customStyles.labelAlign
|
|
169
171
|
}]
|
|
170
172
|
}, labelViews);
|
|
171
|
-
};
|
|
173
|
+
});
|
|
172
174
|
|
|
173
|
-
this
|
|
175
|
+
_defineProperty(this, "renderStep", position => {
|
|
174
176
|
const {
|
|
175
177
|
renderStepIndicator
|
|
176
178
|
} = this.props;
|
|
@@ -242,9 +244,9 @@ export default class StepIndicator extends Component {
|
|
|
242
244
|
}) : /*#__PURE__*/React.createElement(Text, {
|
|
243
245
|
style: indicatorLabelStyle
|
|
244
246
|
}, "".concat(position + 1)));
|
|
245
|
-
};
|
|
247
|
+
});
|
|
246
248
|
|
|
247
|
-
this
|
|
249
|
+
_defineProperty(this, "getStepStatus", stepPosition => {
|
|
248
250
|
const {
|
|
249
251
|
currentPosition
|
|
250
252
|
} = this.props;
|
|
@@ -256,9 +258,9 @@ export default class StepIndicator extends Component {
|
|
|
256
258
|
} else {
|
|
257
259
|
return STEP_STATUS.UNFINISHED;
|
|
258
260
|
}
|
|
259
|
-
};
|
|
261
|
+
});
|
|
260
262
|
|
|
261
|
-
this
|
|
263
|
+
_defineProperty(this, "onCurrentPositionChanged", position => {
|
|
262
264
|
let {
|
|
263
265
|
stepCount
|
|
264
266
|
} = this.props;
|
|
@@ -280,7 +282,7 @@ export default class StepIndicator extends Component {
|
|
|
280
282
|
toValue: this.state.customStyles.currentStepIndicatorSize / 2,
|
|
281
283
|
duration: 100
|
|
282
284
|
})])]).start();
|
|
283
|
-
};
|
|
285
|
+
});
|
|
284
286
|
|
|
285
287
|
const defaultStyles = {
|
|
286
288
|
stepIndicatorSize: 30,
|
|
@@ -391,25 +393,6 @@ const styles = StyleSheet.create({
|
|
|
391
393
|
justifyContent: "center"
|
|
392
394
|
}
|
|
393
395
|
});
|
|
394
|
-
StepIndicator.defaultProps = {
|
|
395
|
-
currentPosition: 0,
|
|
396
|
-
stepCount: 5,
|
|
397
|
-
customStyles: {},
|
|
398
|
-
direction: "horizontal"
|
|
399
|
-
};s: "center",
|
|
400
|
-
justifyContent: "center"
|
|
401
|
-
},
|
|
402
|
-
stepLabel: {
|
|
403
|
-
fontSize: 12,
|
|
404
|
-
textAlign: "center",
|
|
405
|
-
fontWeight: "500"
|
|
406
|
-
},
|
|
407
|
-
stepLabelItem: {
|
|
408
|
-
flex: 1,
|
|
409
|
-
alignItems: "center",
|
|
410
|
-
justifyContent: "center"
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
396
|
StepIndicator.defaultProps = {
|
|
414
397
|
currentPosition: 0,
|
|
415
398
|
stepCount: 5,
|
package/lib/module/index.js
CHANGED
|
@@ -49,4 +49,5 @@ export { default as RowHeadlineImageCaption } from "./components/RowHeadlineImag
|
|
|
49
49
|
export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIcon";
|
|
50
50
|
export { default as Slider } from "./components/Slider";
|
|
51
51
|
export { default as Stepper } from "./components/Stepper";
|
|
52
|
-
export { useAuthState } from "./components/useAuthState";
|
|
52
|
+
export { useAuthState } from "./components/useAuthState";
|
|
53
|
+
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
|
+
};
|
|
@@ -48,3 +48,4 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
|
|
|
48
48
|
export { default as Slider } from "./components/Slider";
|
|
49
49
|
export { default as Stepper } from "./components/Stepper";
|
|
50
50
|
export { useAuthState } from "./components/useAuthState";
|
|
51
|
+
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.4.4-
|
|
3
|
+
"version": "46.4.4-f73e6b.2+f73e6be",
|
|
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.4.4-
|
|
44
|
+
"@draftbit/types": "^46.4.4-f73e6b.2+f73e6be",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -53,6 +53,8 @@
|
|
|
53
53
|
"lodash.isnumber": "^3.0.3",
|
|
54
54
|
"lodash.omit": "^4.5.0",
|
|
55
55
|
"lodash.tonumber": "^4.0.3",
|
|
56
|
+
"react-native-markdown-display": "^7.0.0-alpha.2",
|
|
57
|
+
"react-native-markdown-package": "^1.8.2",
|
|
56
58
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
57
59
|
"react-native-svg": "12.3.0",
|
|
58
60
|
"react-native-typography": "^1.4.1",
|
|
@@ -81,5 +83,5 @@
|
|
|
81
83
|
]
|
|
82
84
|
]
|
|
83
85
|
},
|
|
84
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "f73e6be8016038736f72484115d20a170acb5250"
|
|
85
87
|
}
|
|
@@ -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
|
@@ -49,4 +49,5 @@ 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";
|
|
52
53
|
// a comment to fix sourcemap comment issue
|
package/src/index.tsx
CHANGED
|
@@ -69,5 +69,6 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
|
|
|
69
69
|
export { default as Slider } from "./components/Slider";
|
|
70
70
|
export { default as Stepper } from "./components/Stepper";
|
|
71
71
|
export { useAuthState } from "./components/useAuthState";
|
|
72
|
+
export { default as Markdown } from "./components/Markdown";
|
|
72
73
|
|
|
73
74
|
// 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
|
+
};
|