@draftbit/core 46.8.2-81337b.2 → 46.8.2-9431ce.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/DeprecatedCardWrapper.js +1 -15
- package/lib/commonjs/components/Markdown.js +30 -0
- package/lib/commonjs/index.js +7 -13
- package/lib/commonjs/mappings/Markdown.js +27 -0
- package/lib/commonjs/styles/overlay.js +3 -1
- package/lib/commonjs/utilities.js +2 -1
- package/lib/module/components/Markdown.js +20 -0
- package/lib/module/index.js +1 -1
- package/lib/module/mappings/Markdown.js +20 -0
- package/lib/typescript/src/components/Markdown.d.ts +8 -0
- package/lib/typescript/src/components/Markdown.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/{TabViewItem.d.ts → Markdown.d.ts} +5 -10
- package/lib/typescript/src/mappings/Markdown.d.ts.map +1 -0
- package/package.json +4 -5
- package/src/components/Markdown.js +10 -0
- package/src/components/Markdown.tsx +22 -0
- package/src/index.js +1 -1
- package/src/index.tsx +1 -1
- package/src/mappings/Markdown.js +25 -0
- package/src/mappings/Markdown.ts +32 -0
- package/lib/commonjs/components/TabView/TabView.js +0 -100
- package/lib/commonjs/components/TabView/TabViewItem.js +0 -25
- package/lib/commonjs/components/TabView/index.js +0 -20
- package/lib/commonjs/mappings/TabView.js +0 -74
- package/lib/commonjs/mappings/TabViewItem.js +0 -37
- package/lib/module/components/TabView/TabView.js +0 -90
- package/lib/module/components/TabView/TabViewItem.js +0 -20
- package/lib/module/components/TabView/index.js +0 -2
- package/lib/module/mappings/TabView.js +0 -67
- package/lib/module/mappings/TabViewItem.js +0 -30
- package/lib/typescript/src/components/TabView/TabView.d.ts +0 -26
- package/lib/typescript/src/components/TabView/TabView.d.ts.map +0 -1
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +0 -11
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts.map +0 -1
- package/lib/typescript/src/components/TabView/index.d.ts +0 -3
- package/lib/typescript/src/components/TabView/index.d.ts.map +0 -1
- package/lib/typescript/src/mappings/TabView.d.ts +0 -123
- package/lib/typescript/src/mappings/TabView.d.ts.map +0 -1
- package/lib/typescript/src/mappings/TabViewItem.d.ts.map +0 -1
- package/src/components/TabView/TabView.js +0 -45
- package/src/components/TabView/TabView.tsx +0 -129
- package/src/components/TabView/TabViewItem.js +0 -11
- package/src/components/TabView/TabViewItem.tsx +0 -25
- package/src/components/TabView/index.js +0 -2
- package/src/components/TabView/index.tsx +0 -2
- package/src/mappings/TabView.js +0 -70
- package/src/mappings/TabView.ts +0 -81
- package/src/mappings/TabViewItem.js +0 -30
- package/src/mappings/TabViewItem.ts +0 -38
|
@@ -8,6 +8,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _theming = require("../theming");
|
|
9
9
|
var _Touchable = _interopRequireDefault(require("./Touchable"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
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); }
|
|
11
12
|
const getWidth = numColumns => {
|
|
12
13
|
switch (numColumns) {
|
|
13
14
|
case 1:
|
|
@@ -27,21 +28,6 @@ const Card = _ref => {
|
|
|
27
28
|
...rest
|
|
28
29
|
} = _ref;
|
|
29
30
|
const width = getWidth(numColumns);
|
|
30
|
-
return /*#__PURE__*/_react.default.createElement(_Touchable.default, {
|
|
31
|
-
disabled: !onPress,
|
|
32
|
-
onPress: onPress,
|
|
33
|
-
style: [style, {
|
|
34
|
-
width
|
|
35
|
-
}],
|
|
36
|
-
...rest
|
|
37
|
-
}, children);
|
|
38
|
-
};
|
|
39
|
-
var _default = (0, _theming.withTheme)(Card);
|
|
40
|
-
exports.default = _default;s,
|
|
41
|
-
style,
|
|
42
|
-
...rest
|
|
43
|
-
} = _ref;
|
|
44
|
-
const width = getWidth(numColumns);
|
|
45
31
|
return /*#__PURE__*/_react.default.createElement(_Touchable.default, _extends({
|
|
46
32
|
disabled: !onPress,
|
|
47
33
|
onPress: onPress,
|
|
@@ -0,0 +1,30 @@
|
|
|
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 _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeMarkdownDisplay = _interopRequireDefault(require("react-native-markdown-display"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
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); }
|
|
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
|
+
const Markdown = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
children,
|
|
16
|
+
style
|
|
17
|
+
} = _ref;
|
|
18
|
+
return (
|
|
19
|
+
/*#__PURE__*/
|
|
20
|
+
//'body' style applies to all markdown components
|
|
21
|
+
//@ts-ignore TS does not like the type of this named style for some reason
|
|
22
|
+
React.createElement(_reactNativeMarkdownDisplay.default, {
|
|
23
|
+
style: {
|
|
24
|
+
body: _reactNative.StyleSheet.flatten(style)
|
|
25
|
+
}
|
|
26
|
+
}, children)
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
var _default = Markdown;
|
|
30
|
+
exports.default = _default;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -177,6 +177,12 @@ Object.defineProperty(exports, "Link", {
|
|
|
177
177
|
return _Text.Link;
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
|
+
Object.defineProperty(exports, "Markdown", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return _Markdown.default;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
180
186
|
Object.defineProperty(exports, "NumberInput", {
|
|
181
187
|
enumerable: true,
|
|
182
188
|
get: function () {
|
|
@@ -339,18 +345,6 @@ Object.defineProperty(exports, "SwitchRow", {
|
|
|
339
345
|
return _Switch.SwitchRow;
|
|
340
346
|
}
|
|
341
347
|
});
|
|
342
|
-
Object.defineProperty(exports, "TabView", {
|
|
343
|
-
enumerable: true,
|
|
344
|
-
get: function () {
|
|
345
|
-
return _TabView.TabView;
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
Object.defineProperty(exports, "TabViewItem", {
|
|
349
|
-
enumerable: true,
|
|
350
|
-
get: function () {
|
|
351
|
-
return _TabView.TabViewItem;
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
348
|
Object.defineProperty(exports, "TextField", {
|
|
355
349
|
enumerable: true,
|
|
356
350
|
get: function () {
|
|
@@ -426,7 +420,7 @@ var _Swiper = require("./components/Swiper");
|
|
|
426
420
|
var _Layout = require("./components/Layout");
|
|
427
421
|
var _index = require("./components/RadioButton/index");
|
|
428
422
|
var _DeckSwiper = require("./components/DeckSwiper");
|
|
429
|
-
var
|
|
423
|
+
var _Markdown = _interopRequireDefault(require("./components/Markdown"));
|
|
430
424
|
var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
|
|
431
425
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
432
426
|
var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
|
|
@@ -0,0 +1,27 @@
|
|
|
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: "Markdown",
|
|
11
|
+
description: "A component that renders markdown",
|
|
12
|
+
category: _types.COMPONENT_TYPES.text,
|
|
13
|
+
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Effects],
|
|
14
|
+
props: {
|
|
15
|
+
children: {
|
|
16
|
+
group: _types.GROUPS.data,
|
|
17
|
+
label: "Markdown Text",
|
|
18
|
+
description: "Markdown text to be rendered ",
|
|
19
|
+
editable: true,
|
|
20
|
+
required: true,
|
|
21
|
+
formType: _types.FORM_TYPES.string,
|
|
22
|
+
propType: _types.PROP_TYPES.STRING,
|
|
23
|
+
defaultValue: "### Markdown"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -15,6 +15,7 @@ function overlay(elevation) {
|
|
|
15
15
|
let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _DarkTheme.default.colors.surface;
|
|
16
16
|
if (isAnimatedValue(elevation)) {
|
|
17
17
|
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
18
|
+
|
|
18
19
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
19
20
|
return elevation.interpolate({
|
|
20
21
|
inputRange,
|
|
@@ -23,6 +24,7 @@ function overlay(elevation) {
|
|
|
23
24
|
})
|
|
24
25
|
});
|
|
25
26
|
}
|
|
27
|
+
|
|
26
28
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
27
29
|
return calculateColor(surfaceColor, elevation);
|
|
28
30
|
}
|
|
@@ -63,4 +65,4 @@ const elevationOverlayTransparency = {
|
|
|
63
65
|
22: 15.72,
|
|
64
66
|
23: 15.84,
|
|
65
67
|
24: 16
|
|
66
|
-
};
|
|
68
|
+
};
|
|
@@ -57,6 +57,7 @@ function extractBorderAndMarginStyles(style, additionalBorderStyles, additionalM
|
|
|
57
57
|
marginStyles
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
+
|
|
60
61
|
/**
|
|
61
62
|
* Merges a style object on top of another style object. In React Native,
|
|
62
63
|
* keys with undefined values in a style object will still override styles
|
|
@@ -89,4 +90,4 @@ function getValueForRadioButton(value) {
|
|
|
89
90
|
} else {
|
|
90
91
|
throw new Error("Invalid value: ".concat(value));
|
|
91
92
|
}
|
|
92
|
-
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
import MarkdownComponent from "react-native-markdown-display";
|
|
4
|
+
const Markdown = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
children,
|
|
7
|
+
style
|
|
8
|
+
} = _ref;
|
|
9
|
+
return (
|
|
10
|
+
/*#__PURE__*/
|
|
11
|
+
//'body' style applies to all markdown components
|
|
12
|
+
//@ts-ignore TS does not like the type of this named style for some reason
|
|
13
|
+
React.createElement(MarkdownComponent, {
|
|
14
|
+
style: {
|
|
15
|
+
body: StyleSheet.flatten(style)
|
|
16
|
+
}
|
|
17
|
+
}, children)
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
export default Markdown;
|
package/lib/module/index.js
CHANGED
|
@@ -32,7 +32,7 @@ export { Swiper, SwiperItem } from "./components/Swiper";
|
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
|
|
34
34
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
|
-
export {
|
|
35
|
+
export { default as Markdown } from "./components/Markdown";
|
|
36
36
|
|
|
37
37
|
/* Deprecated: Fix or Delete! */
|
|
38
38
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, FORM_TYPES, GROUPS, PROP_TYPES, StylesPanelSections } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Markdown",
|
|
4
|
+
tag: "Markdown",
|
|
5
|
+
description: "A component that renders markdown",
|
|
6
|
+
category: COMPONENT_TYPES.text,
|
|
7
|
+
stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Effects],
|
|
8
|
+
props: {
|
|
9
|
+
children: {
|
|
10
|
+
group: GROUPS.data,
|
|
11
|
+
label: "Markdown Text",
|
|
12
|
+
description: "Markdown text to be rendered ",
|
|
13
|
+
editable: true,
|
|
14
|
+
required: true,
|
|
15
|
+
formType: FORM_TYPES.string,
|
|
16
|
+
propType: PROP_TYPES.STRING,
|
|
17
|
+
defaultValue: "### Markdown"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
declare type MarkdownProps = {
|
|
4
|
+
style?: StyleProp<ViewStyle>;
|
|
5
|
+
};
|
|
6
|
+
declare const Markdown: React.FC<React.PropsWithChildren<MarkdownProps>>;
|
|
7
|
+
export default Markdown;
|
|
8
|
+
//# sourceMappingURL=Markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAGhE,aAAK,aAAa,GAAG;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAW9D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -32,7 +32,7 @@ export { Swiper, SwiperItem } from "./components/Swiper";
|
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
34
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
|
-
export {
|
|
35
|
+
export { default as Markdown } from "./components/Markdown";
|
|
36
36
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
37
37
|
export { default as Picker } from "./components/Picker/Picker";
|
|
38
38
|
export { default as ProgressBar } from "./components/ProgressBar";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,E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,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -4,22 +4,17 @@ export declare const SEED_DATA: {
|
|
|
4
4
|
description: string;
|
|
5
5
|
category: string;
|
|
6
6
|
stylesPanelSections: string[];
|
|
7
|
-
layout: {
|
|
8
|
-
flex: number;
|
|
9
|
-
};
|
|
10
7
|
props: {
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
children: {
|
|
9
|
+
group: string;
|
|
13
10
|
label: string;
|
|
14
11
|
description: string;
|
|
12
|
+
editable: boolean;
|
|
13
|
+
required: boolean;
|
|
15
14
|
formType: string;
|
|
16
15
|
propType: string;
|
|
17
16
|
defaultValue: string;
|
|
18
|
-
required: boolean;
|
|
19
|
-
editable: boolean;
|
|
20
|
-
group: string;
|
|
21
17
|
};
|
|
22
|
-
accessibilityLabel: any;
|
|
23
18
|
};
|
|
24
19
|
};
|
|
25
|
-
//# sourceMappingURL=
|
|
20
|
+
//# sourceMappingURL=Markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Markdown.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;CAuBrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.8.2-
|
|
3
|
+
"version": "46.8.2-9431ce.2+9431cec",
|
|
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.8.2-
|
|
44
|
+
"@draftbit/types": "^46.8.2-9431ce.2+9431cec",
|
|
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",
|
|
@@ -54,10 +54,9 @@
|
|
|
54
54
|
"lodash.omit": "^4.5.0",
|
|
55
55
|
"lodash.tonumber": "^4.0.3",
|
|
56
56
|
"react-native-deck-swiper": "^2.0.12",
|
|
57
|
+
"react-native-markdown-display": "^7.0.0-alpha.2",
|
|
57
58
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
58
|
-
"react-native-pager-view": "5.4.24",
|
|
59
59
|
"react-native-svg": "12.3.0",
|
|
60
|
-
"react-native-tab-view": "^3.4.0",
|
|
61
60
|
"react-native-typography": "^1.4.1",
|
|
62
61
|
"react-native-web-swiper": "^2.2.3"
|
|
63
62
|
},
|
|
@@ -94,5 +93,5 @@
|
|
|
94
93
|
]
|
|
95
94
|
]
|
|
96
95
|
},
|
|
97
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "9431cec6f917305ad98e74b99db8e36ba5f76a62"
|
|
98
97
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
import MarkdownComponent from "react-native-markdown-display";
|
|
4
|
+
const Markdown = ({ children, style, }) => {
|
|
5
|
+
return (
|
|
6
|
+
//'body' style applies to all markdown components
|
|
7
|
+
//@ts-ignore TS does not like the type of this named style for some reason
|
|
8
|
+
React.createElement(MarkdownComponent, { style: { body: StyleSheet.flatten(style) } }, children));
|
|
9
|
+
};
|
|
10
|
+
export default Markdown;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleProp, ViewStyle, StyleSheet } from "react-native";
|
|
3
|
+
import MarkdownComponent from "react-native-markdown-display";
|
|
4
|
+
|
|
5
|
+
type MarkdownProps = {
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const Markdown: React.FC<React.PropsWithChildren<MarkdownProps>> = ({
|
|
10
|
+
children,
|
|
11
|
+
style,
|
|
12
|
+
}) => {
|
|
13
|
+
return (
|
|
14
|
+
//'body' style applies to all markdown components
|
|
15
|
+
//@ts-ignore TS does not like the type of this named style for some reason
|
|
16
|
+
<MarkdownComponent style={{ body: StyleSheet.flatten(style) }}>
|
|
17
|
+
{children}
|
|
18
|
+
</MarkdownComponent>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default Markdown;
|
package/src/index.js
CHANGED
|
@@ -32,7 +32,7 @@ export { Swiper, SwiperItem } from "./components/Swiper";
|
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
34
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
|
-
export {
|
|
35
|
+
export { default as Markdown } from "./components/Markdown";
|
|
36
36
|
/* Deprecated: Fix or Delete! */
|
|
37
37
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
38
38
|
export { default as Picker } from "./components/Picker/Picker";
|
package/src/index.tsx
CHANGED
|
@@ -53,7 +53,7 @@ export {
|
|
|
53
53
|
|
|
54
54
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
55
55
|
|
|
56
|
-
export {
|
|
56
|
+
export { default as Markdown } from "./components/Markdown";
|
|
57
57
|
|
|
58
58
|
/* Deprecated: Fix or Delete! */
|
|
59
59
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, FORM_TYPES, GROUPS, PROP_TYPES, StylesPanelSections, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Markdown",
|
|
4
|
+
tag: "Markdown",
|
|
5
|
+
description: "A component that renders markdown",
|
|
6
|
+
category: COMPONENT_TYPES.text,
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.Typography,
|
|
9
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
10
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
11
|
+
StylesPanelSections.Effects,
|
|
12
|
+
],
|
|
13
|
+
props: {
|
|
14
|
+
children: {
|
|
15
|
+
group: GROUPS.data,
|
|
16
|
+
label: "Markdown Text",
|
|
17
|
+
description: "Markdown text to be rendered ",
|
|
18
|
+
editable: true,
|
|
19
|
+
required: true,
|
|
20
|
+
formType: FORM_TYPES.string,
|
|
21
|
+
propType: PROP_TYPES.STRING,
|
|
22
|
+
defaultValue: "### Markdown",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
FORM_TYPES,
|
|
4
|
+
GROUPS,
|
|
5
|
+
PROP_TYPES,
|
|
6
|
+
StylesPanelSections,
|
|
7
|
+
} from "@draftbit/types";
|
|
8
|
+
|
|
9
|
+
export const SEED_DATA = {
|
|
10
|
+
name: "Markdown",
|
|
11
|
+
tag: "Markdown",
|
|
12
|
+
description: "A component that renders markdown",
|
|
13
|
+
category: COMPONENT_TYPES.text,
|
|
14
|
+
stylesPanelSections: [
|
|
15
|
+
StylesPanelSections.Typography,
|
|
16
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
17
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
18
|
+
StylesPanelSections.Effects,
|
|
19
|
+
],
|
|
20
|
+
props: {
|
|
21
|
+
children: {
|
|
22
|
+
group: GROUPS.data,
|
|
23
|
+
label: "Markdown Text",
|
|
24
|
+
description: "Markdown text to be rendered ",
|
|
25
|
+
editable: true,
|
|
26
|
+
required: true,
|
|
27
|
+
formType: FORM_TYPES.string,
|
|
28
|
+
propType: PROP_TYPES.STRING,
|
|
29
|
+
defaultValue: "### Markdown",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -1,100 +0,0 @@
|
|
|
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 _reactNativeTabView = require("react-native-tab-view");
|
|
9
|
-
var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
|
|
10
|
-
var _theming = require("../../theming");
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
-
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); }
|
|
15
|
-
const TabViewComponent = _ref => {
|
|
16
|
-
let {
|
|
17
|
-
Icon,
|
|
18
|
-
onIndexChanged,
|
|
19
|
-
onEndReached,
|
|
20
|
-
tabBarPosition,
|
|
21
|
-
keyboardDismissMode,
|
|
22
|
-
swipeEnabled,
|
|
23
|
-
scrollEnabled,
|
|
24
|
-
activeColor,
|
|
25
|
-
inactiveColor,
|
|
26
|
-
pressColor,
|
|
27
|
-
indicatorColor,
|
|
28
|
-
tabsBackgroundColor,
|
|
29
|
-
style,
|
|
30
|
-
theme,
|
|
31
|
-
children
|
|
32
|
-
} = _ref;
|
|
33
|
-
const [index, setIndex] = React.useState(0);
|
|
34
|
-
const [routes, setRoutes] = React.useState([]);
|
|
35
|
-
const [tabScenes, setTabScenes] = React.useState({});
|
|
36
|
-
|
|
37
|
-
//Populate routes and scenes based on children
|
|
38
|
-
React.useEffect(() => {
|
|
39
|
-
const newRoutes = [];
|
|
40
|
-
const scenes = {};
|
|
41
|
-
React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && child.type === _TabViewItem.default).forEach((item, idx) => {
|
|
42
|
-
const child = item;
|
|
43
|
-
newRoutes.push({
|
|
44
|
-
key: idx.toString(),
|
|
45
|
-
title: child.props.title,
|
|
46
|
-
icon: child.props.icon,
|
|
47
|
-
accessibilityLabel: child.props.accessibilityLabel
|
|
48
|
-
});
|
|
49
|
-
scenes[idx] = () => child;
|
|
50
|
-
});
|
|
51
|
-
setRoutes(newRoutes);
|
|
52
|
-
setTabScenes(scenes);
|
|
53
|
-
}, [children]);
|
|
54
|
-
const indexChangeHandler = i => {
|
|
55
|
-
setIndex(i);
|
|
56
|
-
onIndexChanged === null || onIndexChanged === void 0 ? void 0 : onIndexChanged(i);
|
|
57
|
-
if (i === routes.length) {
|
|
58
|
-
onEndReached === null || onEndReached === void 0 ? void 0 : onEndReached();
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
const renderTabBar = props => {
|
|
62
|
-
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar, _extends({}, props, {
|
|
63
|
-
activeColor: activeColor || theme.colors.primary,
|
|
64
|
-
inactiveColor: inactiveColor || theme.colors.divider,
|
|
65
|
-
pressColor: pressColor || theme.colors.primary,
|
|
66
|
-
scrollEnabled: scrollEnabled,
|
|
67
|
-
indicatorStyle: {
|
|
68
|
-
backgroundColor: indicatorColor || theme.colors.primary
|
|
69
|
-
},
|
|
70
|
-
renderIcon: _ref2 => {
|
|
71
|
-
let {
|
|
72
|
-
route,
|
|
73
|
-
color
|
|
74
|
-
} = _ref2;
|
|
75
|
-
return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
76
|
-
name: route.icon,
|
|
77
|
-
color: color,
|
|
78
|
-
size: 36
|
|
79
|
-
}) : null;
|
|
80
|
-
},
|
|
81
|
-
style: [{
|
|
82
|
-
backgroundColor: tabsBackgroundColor || theme.colors.background
|
|
83
|
-
}, style]
|
|
84
|
-
}));
|
|
85
|
-
};
|
|
86
|
-
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabView, {
|
|
87
|
-
navigationState: {
|
|
88
|
-
index,
|
|
89
|
-
routes
|
|
90
|
-
},
|
|
91
|
-
renderScene: (0, _reactNativeTabView.SceneMap)(tabScenes),
|
|
92
|
-
renderTabBar: renderTabBar,
|
|
93
|
-
onIndexChange: indexChangeHandler,
|
|
94
|
-
tabBarPosition: tabBarPosition,
|
|
95
|
-
keyboardDismissMode: keyboardDismissMode,
|
|
96
|
-
swipeEnabled: swipeEnabled
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
var _default = (0, _theming.withTheme)(TabViewComponent);
|
|
100
|
-
exports.default = _default;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
const TabViewItem = _ref => {
|
|
11
|
-
let {
|
|
12
|
-
style,
|
|
13
|
-
children
|
|
14
|
-
} = _ref;
|
|
15
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
16
|
-
style: [styles.parentContainer, style]
|
|
17
|
-
}, children);
|
|
18
|
-
};
|
|
19
|
-
const styles = _reactNative.StyleSheet.create({
|
|
20
|
-
parentContainer: {
|
|
21
|
-
flex: 1
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
var _default = TabViewItem;
|
|
25
|
-
exports.default = _default;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "TabView", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _TabView.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "TabViewItem", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _TabViewItem.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _TabView = _interopRequireDefault(require("./TabView"));
|
|
19
|
-
var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|