@draftbit/core 46.4.4-62cd12.2 → 46.4.4-65cd42.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/Carousel.js +7 -25
- package/lib/commonjs/components/Image.js +2 -17
- package/lib/commonjs/components/Markdown.js +27 -0
- package/lib/commonjs/components/Portal/PortalConsumer.js +7 -22
- package/lib/commonjs/components/Stepper.js +2 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/mappings/Markdown.js +21 -0
- package/lib/module/components/Markdown.js +16 -0
- package/lib/module/index.js +1 -0
- 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
|
@@ -11,6 +11,7 @@ var _Image = _interopRequireDefault(require("./Image"));
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
|
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); }
|
|
14
15
|
const screenWidth = _reactNative.Dimensions.get("window").width;
|
|
15
16
|
function Pager(_ref) {
|
|
16
17
|
let {
|
|
@@ -45,10 +46,9 @@ function Carousel(_ref2) {
|
|
|
45
46
|
style,
|
|
46
47
|
...rest
|
|
47
48
|
} = _ref2;
|
|
48
|
-
var _a;
|
|
49
49
|
const [index, setIndex] = React.useState(0);
|
|
50
50
|
const length = React.Children.count(children);
|
|
51
|
-
const itemsLength = ((
|
|
51
|
+
const itemsLength = ((data === null || data === void 0 ? void 0 : data.length) ?? 0) + length;
|
|
52
52
|
const slides = Array.isArray(data) ? data : [];
|
|
53
53
|
const {
|
|
54
54
|
width,
|
|
@@ -56,10 +56,9 @@ function Carousel(_ref2) {
|
|
|
56
56
|
} = _reactNative.StyleSheet.flatten(style || {});
|
|
57
57
|
const slideWidth = width || screenWidth;
|
|
58
58
|
const slideHeight = height || 250;
|
|
59
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
60
|
-
style: [styles.container, style]
|
|
61
|
-
|
|
62
|
-
}, /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
|
|
59
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
60
|
+
style: [styles.container, style]
|
|
61
|
+
}, rest), /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
|
|
63
62
|
pagingEnabled: true,
|
|
64
63
|
horizontal: true,
|
|
65
64
|
decelerationRate: "fast",
|
|
@@ -87,8 +86,8 @@ function Carousel(_ref2) {
|
|
|
87
86
|
}]
|
|
88
87
|
});
|
|
89
88
|
}) : null, React.Children.map(children, child => {
|
|
90
|
-
var
|
|
91
|
-
const s = (
|
|
89
|
+
var _child$props;
|
|
90
|
+
const s = (child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.style) || {};
|
|
92
91
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
93
92
|
style: {
|
|
94
93
|
width: slideWidth
|
|
@@ -127,21 +126,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
127
126
|
}
|
|
128
127
|
});
|
|
129
128
|
var _default = (0, _theming.withTheme)(Carousel);
|
|
130
|
-
exports.default = _default;ute",
|
|
131
|
-
bottom: 12,
|
|
132
|
-
left: 0,
|
|
133
|
-
right: 0,
|
|
134
|
-
flexDirection: "row",
|
|
135
|
-
justifyContent: "center",
|
|
136
|
-
alignItems: "center"
|
|
137
|
-
},
|
|
138
|
-
bullet: {
|
|
139
|
-
marginHorizontal: 2,
|
|
140
|
-
width: 10,
|
|
141
|
-
height: 10,
|
|
142
|
-
borderRadius: 20,
|
|
143
|
-
backgroundColor: "#000"
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
var _default = (0, _theming.withTheme)(Carousel);
|
|
147
129
|
exports.default = _default;
|
|
@@ -9,8 +9,7 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _Config = _interopRequireDefault(require("./Config"));
|
|
10
10
|
var _AspectRatio = _interopRequireDefault(require("./AspectRatio"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
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); }
|
|
14
13
|
const generateDimensions = _ref => {
|
|
15
14
|
let {
|
|
16
15
|
aspectRatio,
|
|
@@ -63,27 +62,13 @@ const Image = _ref2 => {
|
|
|
63
62
|
height,
|
|
64
63
|
aspectRatio
|
|
65
64
|
}]
|
|
66
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
67
|
-
...props,
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, _extends({}, props, {
|
|
68
66
|
source: imageSource,
|
|
69
67
|
resizeMode: resizeMode,
|
|
70
68
|
style: [style, {
|
|
71
69
|
height: "100%",
|
|
72
70
|
width: "100%"
|
|
73
71
|
}]
|
|
74
|
-
}));
|
|
75
|
-
}
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
77
|
-
...props,
|
|
78
|
-
source: source,
|
|
79
|
-
resizeMode: resizeMode,
|
|
80
|
-
style: style
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
var _default = Image;
|
|
84
|
-
exports.default = _default; "100%",
|
|
85
|
-
width: "100%"
|
|
86
|
-
}]
|
|
87
72
|
})));
|
|
88
73
|
}
|
|
89
74
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Image, _extends({}, props, {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNativeMarkdownPackage = _interopRequireDefault(require("react-native-markdown-package"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
|
|
14
|
+
const MarkdownComponent = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
content
|
|
17
|
+
} = _ref;
|
|
18
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_reactNativeMarkdownPackage.default, {
|
|
19
|
+
styles: markdownStyle
|
|
20
|
+
}, content));
|
|
21
|
+
};
|
|
22
|
+
const markdownStyle = {
|
|
23
|
+
singleLineMd: {},
|
|
24
|
+
collectiveMd: {}
|
|
25
|
+
};
|
|
26
|
+
var _default = MarkdownComponent;
|
|
27
|
+
exports.default = _default;
|
|
@@ -7,31 +7,16 @@ exports.default = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
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); }
|
|
9
9
|
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; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
13
|
class PortalConsumer extends React.Component {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
await Promise.resolve();
|
|
15
|
-
this.key = this.props.manager.mount(this.props.children);
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
_defineProperty(this, "key", void 0);
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
this.checkManager();
|
|
19
|
-
this.props.manager.update(this.key, this.props.children);
|
|
20
|
-
}
|
|
21
|
-
componentWillUnmount() {
|
|
18
|
+
async componentDidMount() {
|
|
22
19
|
this.checkManager();
|
|
23
|
-
this.props.manager.unmount(this.key);
|
|
24
|
-
}
|
|
25
|
-
checkManager() {
|
|
26
|
-
if (!this.props.manager) {
|
|
27
|
-
throw new Error("Looks like you forgot to wrap your root component with `Provider` 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");
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
render() {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.default = PortalConsumer;s.checkManager();
|
|
35
20
|
|
|
36
21
|
// Delay updating to prevent React from going to infinite loop
|
|
37
22
|
await Promise.resolve();
|
|
@@ -29,7 +29,7 @@ const Stepper = _ref => {
|
|
|
29
29
|
},
|
|
30
30
|
Icon
|
|
31
31
|
} = _ref;
|
|
32
|
-
const [value, setValue] = (0, _react.useState)(defaultValue
|
|
32
|
+
const [value, setValue] = (0, _react.useState)(defaultValue ?? 0);
|
|
33
33
|
const isValidValue = valueArg => valueArg >= min && valueArg <= max;
|
|
34
34
|
const handlePlusOrMinus = type => {
|
|
35
35
|
const newValue = type === "plus" ? value + 1 : value - 1;
|
|
@@ -78,4 +78,5 @@ const Stepper = _ref => {
|
|
|
78
78
|
}));
|
|
79
79
|
};
|
|
80
80
|
var _default = (0, _theming.withTheme)(Stepper);
|
|
81
|
+
exports.default = _default;g.withTheme)(Stepper);
|
|
81
82
|
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 () {
|
|
@@ -460,6 +466,7 @@ var _RowHeadlineImageIcon = _interopRequireDefault(require("./components/RowHead
|
|
|
460
466
|
var _Slider = _interopRequireDefault(require("./components/Slider"));
|
|
461
467
|
var _Stepper = _interopRequireDefault(require("./components/Stepper"));
|
|
462
468
|
var _useAuthState = require("./components/useAuthState");
|
|
469
|
+
var _Markdown = _interopRequireDefault(require("./components/Markdown"));
|
|
463
470
|
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); }
|
|
464
471
|
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; }
|
|
465
472
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SEED_DATA = void 0;
|
|
7
|
+
var _types = require("@draftbit/types");
|
|
8
|
+
const SEED_DATA = {
|
|
9
|
+
name: "Markdown",
|
|
10
|
+
tag: "MarkdownComponent",
|
|
11
|
+
description: "A markdown component",
|
|
12
|
+
category: _types.COMPONENT_TYPES.basic,
|
|
13
|
+
props: {
|
|
14
|
+
content: (0, _types.createTextProp)({
|
|
15
|
+
label: "Markdown Text",
|
|
16
|
+
description: "Markdown Text",
|
|
17
|
+
defaultValue: null
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import Markdown from "react-native-markdown-package";
|
|
4
|
+
const MarkdownComponent = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
content
|
|
7
|
+
} = _ref;
|
|
8
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Markdown, {
|
|
9
|
+
styles: markdownStyle
|
|
10
|
+
}, content));
|
|
11
|
+
};
|
|
12
|
+
const markdownStyle = {
|
|
13
|
+
singleLineMd: {},
|
|
14
|
+
collectiveMd: {}
|
|
15
|
+
};
|
|
16
|
+
export default MarkdownComponent;
|
package/lib/module/index.js
CHANGED
|
@@ -50,5 +50,6 @@ 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
|
|
|
54
55
|
// 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-65cd42.2+65cd428",
|
|
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-65cd42.2+65cd428",
|
|
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": "65cd428a38e995b2900296570798fcad70ab711f"
|
|
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
|
+
};
|