@draftbit/core 46.8.2-3b498d.2 → 46.8.2-57763.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.
Files changed (41) hide show
  1. package/lib/commonjs/components/Markdown.js +30 -0
  2. package/lib/commonjs/components/Picker/PickerComponent.android.js +20 -3
  3. package/lib/commonjs/components/TabView/TabView.js +14 -11
  4. package/lib/commonjs/constants.js +1 -1
  5. package/lib/commonjs/index.js +7 -0
  6. package/lib/commonjs/mappings/FlashList.js +2 -8
  7. package/lib/commonjs/mappings/Markdown.js +27 -0
  8. package/lib/commonjs/mappings/TabView.js +0 -3
  9. package/lib/module/components/Markdown.js +20 -0
  10. package/lib/module/components/TabView/TabView.js +14 -10
  11. package/lib/module/index.js +1 -0
  12. package/lib/module/mappings/FlashList.js +3 -9
  13. package/lib/module/mappings/Markdown.js +20 -0
  14. package/lib/module/mappings/TabView.js +0 -3
  15. package/lib/typescript/src/components/Markdown.d.ts +8 -0
  16. package/lib/typescript/src/components/Markdown.d.ts.map +1 -0
  17. package/lib/typescript/src/components/TabView/TabView.d.ts.map +1 -1
  18. package/lib/typescript/src/components/TabView/TabViewItem.d.ts +1 -1
  19. package/lib/typescript/src/components/TabView/TabViewItem.d.ts.map +1 -1
  20. package/lib/typescript/src/index.d.ts +1 -0
  21. package/lib/typescript/src/index.d.ts.map +1 -1
  22. package/lib/typescript/src/mappings/FlashList.d.ts +0 -6
  23. package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
  24. package/lib/typescript/src/mappings/Markdown.d.ts +20 -0
  25. package/lib/typescript/src/mappings/Markdown.d.ts.map +1 -0
  26. package/lib/typescript/src/mappings/TabView.d.ts +0 -3
  27. package/lib/typescript/src/mappings/TabView.d.ts.map +1 -1
  28. package/package.json +4 -3
  29. package/src/components/Markdown.js +10 -0
  30. package/src/components/Markdown.tsx +22 -0
  31. package/src/components/TabView/TabView.js +12 -8
  32. package/src/components/TabView/TabView.tsx +19 -9
  33. package/src/components/TabView/TabViewItem.tsx +1 -1
  34. package/src/index.js +1 -0
  35. package/src/index.tsx +1 -0
  36. package/src/mappings/FlashList.js +9 -9
  37. package/src/mappings/FlashList.ts +9 -9
  38. package/src/mappings/Markdown.js +25 -0
  39. package/src/mappings/Markdown.ts +32 -0
  40. package/src/mappings/TabView.js +0 -1
  41. package/src/mappings/TabView.ts +0 -1
@@ -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;
@@ -15,9 +15,7 @@ var _Touchable = _interopRequireDefault(require("../Touchable"));
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
16
  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); }
17
17
  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; }
18
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
18
  const Picker = _ref => {
20
- var _options$find$label, _options$find;
21
19
  let {
22
20
  style,
23
21
  options,
@@ -27,6 +25,7 @@ const Picker = _ref => {
27
25
  onValueChange: onValueChangeOverride = () => {},
28
26
  ...props
29
27
  } = _ref;
28
+ var _a, _b;
30
29
  const {
31
30
  viewStyles: {
32
31
  borderRadius,
@@ -71,7 +70,7 @@ const Picker = _ref => {
71
70
  };
72
71
 
73
72
  const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
74
- const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
73
+ const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
75
74
  return /*#__PURE__*/React.createElement(_Touchable.default, {
76
75
  disabled: disabled,
77
76
  onPress: toggleFocus,
@@ -95,6 +94,24 @@ const Picker = _ref => {
95
94
  key: o.value
96
95
  }))), /*#__PURE__*/React.createElement(_reactNative.View, {
97
96
  pointerEvents: "none"
97
+ }, /*#__PURE__*/React.createElement(_TextField.default, {
98
+ ...props,
99
+ value: selectedLabel,
100
+ placeholder: placeholder,
101
+ // @ts-ignore
102
+ ref: textField,
103
+ disabled: disabled,
104
+ // @ts-expect-error
105
+ style: stylesWithoutMargin
106
+ }))));
107
+ };
108
+ const styles = _reactNative.StyleSheet.create({
109
+ container: {
110
+ alignSelf: "stretch"
111
+ }
112
+ });
113
+ var _default = (0, _theming.withTheme)(Picker);
114
+ exports.default = _default;pointerEvents: "none"
98
115
  }, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
99
116
  value: selectedLabel,
100
117
  placeholder: placeholder
@@ -5,12 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
8
  var _reactNativeTabView = require("react-native-tab-view");
10
- var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
11
9
  var _theming = require("../../theming");
12
10
  var _utilities = require("../../utilities");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
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); }
15
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; }
16
13
  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); }
@@ -40,11 +37,17 @@ const TabViewComponent = _ref => {
40
37
  viewStyles
41
38
  } = (0, _utilities.extractStyles)(style);
42
39
 
40
+ //Check type of child using props
41
+ //Regular '.type' cannot work because Draftbit strips the type in Draft view
42
+ const instanceOfTabViewItemProps = object => {
43
+ return "title" in object;
44
+ };
45
+
43
46
  //Populate routes and scenes based on children
44
47
  React.useEffect(() => {
45
48
  const newRoutes = [];
46
49
  const scenes = {};
47
- React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && child.type === _TabViewItem.default).forEach((item, idx) => {
50
+ React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && instanceOfTabViewItemProps(child.props)).forEach((item, idx) => {
48
51
  const child = item;
49
52
  newRoutes.push({
50
53
  key: idx.toString(),
@@ -82,7 +85,7 @@ const TabViewComponent = _ref => {
82
85
  return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
83
86
  name: route.icon,
84
87
  color: color,
85
- size: 36
88
+ size: 16
86
89
  }) : null;
87
90
  },
88
91
  style: {
@@ -90,8 +93,13 @@ const TabViewComponent = _ref => {
90
93
  }
91
94
  }));
92
95
  };
96
+
97
+ //Cannot render TabView without at least one tab
98
+ if (!routes.length) {
99
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
100
+ }
93
101
  return /*#__PURE__*/React.createElement(_reactNativeTabView.TabView, {
94
- style: [styles.tabView, viewStyles],
102
+ style: [viewStyles],
95
103
  navigationState: {
96
104
  index,
97
105
  routes
@@ -104,10 +112,5 @@ const TabViewComponent = _ref => {
104
112
  swipeEnabled: swipeEnabled
105
113
  });
106
114
  };
107
- const styles = _reactNative.StyleSheet.create({
108
- tabView: {
109
- flex: 1
110
- }
111
- });
112
115
  var _default = (0, _theming.withTheme)(TabViewComponent);
113
116
  exports.default = _default;
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
12
12
  android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
13
13
  ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
14
14
  });
15
- exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
15
+ exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;AR_HEIGHT;
@@ -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 () {
@@ -427,6 +433,7 @@ var _Layout = require("./components/Layout");
427
433
  var _index = require("./components/RadioButton/index");
428
434
  var _DeckSwiper = require("./components/DeckSwiper");
429
435
  var _TabView = require("./components/TabView");
436
+ var _Markdown = _interopRequireDefault(require("./components/Markdown"));
430
437
  var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
431
438
  var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
432
439
  var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
@@ -11,10 +11,7 @@ const SEED_DATA = [{
11
11
  description: "Masonry Flashlist by Shopify",
12
12
  packageName: "@shopify/flash-list",
13
13
  category: _types.COMPONENT_TYPES.data,
14
- stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
15
- layout: {
16
- flex: 1
17
- },
14
+ stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.MarginsAndPaddings],
18
15
  triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
19
16
  props: {
20
17
  onRefresh: (0, _types.createActionProp)(),
@@ -61,10 +58,7 @@ const SEED_DATA = [{
61
58
  description: "Flashlist by Shopify",
62
59
  packageName: "@shopify/flash-list",
63
60
  category: _types.COMPONENT_TYPES.data,
64
- stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
65
- layout: {
66
- flex: 1
67
- },
61
+ stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.MarginsAndPaddings],
68
62
  triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
69
63
  props: {
70
64
  onRefresh: (0, _types.createActionProp)(),
@@ -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;
@@ -11,9 +11,6 @@ const SEED_DATA = {
11
11
  description: "Tab view container",
12
12
  category: _types.COMPONENT_TYPES.swiper,
13
13
  stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.Background, _types.StylesPanelSections.Typography],
14
- layout: {
15
- flex: 1
16
- },
17
14
  triggers: [_types.Triggers.OnIndexChanged, _types.Triggers.OnEndReached],
18
15
  props: {
19
16
  onIndexChanged: (0, _types.createActionProp)({
@@ -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;
@@ -1,8 +1,6 @@
1
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
2
  import * as React from "react";
3
- import { StyleSheet } from "react-native";
4
3
  import { TabView, TabBar, SceneMap } from "react-native-tab-view";
5
- import TabViewItem from "./TabViewItem";
6
4
  import { withTheme } from "../../theming";
7
5
  import { extractStyles } from "../../utilities";
8
6
  const TabViewComponent = _ref => {
@@ -31,11 +29,17 @@ const TabViewComponent = _ref => {
31
29
  viewStyles
32
30
  } = extractStyles(style);
33
31
 
32
+ //Check type of child using props
33
+ //Regular '.type' cannot work because Draftbit strips the type in Draft view
34
+ const instanceOfTabViewItemProps = object => {
35
+ return "title" in object;
36
+ };
37
+
34
38
  //Populate routes and scenes based on children
35
39
  React.useEffect(() => {
36
40
  const newRoutes = [];
37
41
  const scenes = {};
38
- React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && child.type === TabViewItem).forEach((item, idx) => {
42
+ React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && instanceOfTabViewItemProps(child.props)).forEach((item, idx) => {
39
43
  const child = item;
40
44
  newRoutes.push({
41
45
  key: idx.toString(),
@@ -73,7 +77,7 @@ const TabViewComponent = _ref => {
73
77
  return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
74
78
  name: route.icon,
75
79
  color: color,
76
- size: 36
80
+ size: 16
77
81
  }) : null;
78
82
  },
79
83
  style: {
@@ -81,8 +85,13 @@ const TabViewComponent = _ref => {
81
85
  }
82
86
  }));
83
87
  };
88
+
89
+ //Cannot render TabView without at least one tab
90
+ if (!routes.length) {
91
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
92
+ }
84
93
  return /*#__PURE__*/React.createElement(TabView, {
85
- style: [styles.tabView, viewStyles],
94
+ style: [viewStyles],
86
95
  navigationState: {
87
96
  index,
88
97
  routes
@@ -95,9 +104,4 @@ const TabViewComponent = _ref => {
95
104
  swipeEnabled: swipeEnabled
96
105
  });
97
106
  };
98
- const styles = StyleSheet.create({
99
- tabView: {
100
- flex: 1
101
- }
102
- });
103
107
  export default withTheme(TabViewComponent);
@@ -33,6 +33,7 @@ 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
35
  export { TabView, TabViewItem } from "./components/TabView";
36
+ export { default as Markdown } from "./components/Markdown";
36
37
 
37
38
  /* Deprecated: Fix or Delete! */
38
39
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
@@ -1,14 +1,11 @@
1
- import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, Triggers, createActionProp, createStaticNumberProp, createColorProp } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, GROUPS, Triggers, createActionProp, createStaticNumberProp, createColorProp, StylesPanelSections } from "@draftbit/types";
2
2
  export const SEED_DATA = [{
3
3
  name: "Masonry List",
4
4
  tag: "MasonryFlashList",
5
5
  description: "Masonry Flashlist by Shopify",
6
6
  packageName: "@shopify/flash-list",
7
7
  category: COMPONENT_TYPES.data,
8
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
9
- layout: {
10
- flex: 1
11
- },
8
+ stylesPanelSections: [StylesPanelSections.Background, StylesPanelSections.MarginsAndPaddings],
12
9
  triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
13
10
  props: {
14
11
  onRefresh: createActionProp(),
@@ -55,10 +52,7 @@ export const SEED_DATA = [{
55
52
  description: "Flashlist by Shopify",
56
53
  packageName: "@shopify/flash-list",
57
54
  category: COMPONENT_TYPES.data,
58
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
59
- layout: {
60
- flex: 1
61
- },
55
+ stylesPanelSections: [StylesPanelSections.Background, StylesPanelSections.MarginsAndPaddings],
62
56
  triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
63
57
  props: {
64
58
  onRefresh: createActionProp(),
@@ -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
+ };
@@ -5,9 +5,6 @@ export const SEED_DATA = {
5
5
  description: "Tab view container",
6
6
  category: COMPONENT_TYPES.swiper,
7
7
  stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Effects, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.Background, StylesPanelSections.Typography],
8
- layout: {
9
- flex: 1
10
- },
11
8
  triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
12
9
  props: {
13
10
  onIndexChanged: createActionProp({
@@ -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,EA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,KAAK,CAAC;CACd,GAAG,QAAQ,CAAC;;;;AAmGb,wBAA2C"}
1
+ {"version":3,"file":"TabView.d.ts","sourceRoot":"","sources":["../../../../../src/components/TabView/TabView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAWpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAMvD,aAAK,cAAc,GAAG,KAAK,GAAG,QAAQ,CAAC;AACvC,aAAK,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvD,aAAK,YAAY,GAAG;IAClB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,QAAQ,CAAC;;;;AA6Gb,wBAA2C"}
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { StyleProp, ViewStyle } from "react-native";
3
- interface TabViewItemProps {
3
+ export interface TabViewItemProps {
4
4
  title: string;
5
5
  icon?: string;
6
6
  accessibilityLabel?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"TabViewItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/TabView/TabViewItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAGtE,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAKpE,CAAC;AAQF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"TabViewItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/TabView/TabViewItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAGtE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAKpE,CAAC;AAQF,eAAe,WAAW,CAAC"}
@@ -33,6 +33,7 @@ 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
35
  export { TabView, TabViewItem } from "./components/TabView";
36
+ export { default as Markdown } from "./components/Markdown";
36
37
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
37
38
  export { default as Picker } from "./components/Picker/Picker";
38
39
  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,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iCA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,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
@@ -5,9 +5,6 @@ export declare const SEED_DATA: ({
5
5
  packageName: string;
6
6
  category: string;
7
7
  stylesPanelSections: string[];
8
- layout: {
9
- flex: number;
10
- };
11
8
  triggers: string[];
12
9
  props: {
13
10
  onRefresh: {
@@ -113,9 +110,6 @@ export declare const SEED_DATA: ({
113
110
  packageName: string;
114
111
  category: string;
115
112
  stylesPanelSections: string[];
116
- layout: {
117
- flex: number;
118
- };
119
113
  triggers: string[];
120
114
  props: {
121
115
  onRefresh: {
@@ -1 +1 @@
1
- {"version":3,"file":"FlashList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlashList.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqHrB,CAAC"}
1
+ {"version":3,"file":"FlashList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlashList.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqHrB,CAAC"}
@@ -0,0 +1,20 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ description: string;
5
+ category: string;
6
+ stylesPanelSections: string[];
7
+ props: {
8
+ children: {
9
+ group: string;
10
+ label: string;
11
+ description: string;
12
+ editable: boolean;
13
+ required: boolean;
14
+ formType: string;
15
+ propType: string;
16
+ defaultValue: string;
17
+ };
18
+ };
19
+ };
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"}
@@ -4,9 +4,6 @@ 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
  triggers: string[];
11
8
  props: {
12
9
  onIndexChanged: {
@@ -1 +1 @@
1
- {"version":3,"file":"TabView.d.ts","sourceRoot":"","sources":["../../../../src/mappings/TabView.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0ErB,CAAC"}
1
+ {"version":3,"file":"TabView.d.ts","sourceRoot":"","sources":["../../../../src/mappings/TabView.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyErB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.8.2-3b498d.2+3b498d6",
3
+ "version": "46.8.2-057763.2+0577637",
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-3b498d.2+3b498d6",
44
+ "@draftbit/types": "^46.8.2-057763.2+0577637",
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,6 +54,7 @@
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
59
  "react-native-pager-view": "5.4.24",
59
60
  "react-native-svg": "12.3.0",
@@ -94,5 +95,5 @@
94
95
  ]
95
96
  ]
96
97
  },
97
- "gitHead": "3b498d688155757b31754dc848a019892c1d55b8"
98
+ "gitHead": "05776378124b8cdb9a417de14e23e4c3e85cd9bc"
98
99
  }
@@ -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;
@@ -1,7 +1,5 @@
1
1
  import * as React from "react";
2
- import { StyleSheet } from "react-native";
3
2
  import { TabView, TabBar, SceneMap, } from "react-native-tab-view";
4
- import TabViewItem from "./TabViewItem";
5
3
  import { withTheme } from "../../theming";
6
4
  import { extractStyles } from "../../utilities";
7
5
  const TabViewComponent = ({ Icon, onIndexChanged, onEndReached, tabBarPosition, keyboardDismissMode, swipeEnabled, scrollEnabled, activeColor, inactiveColor, pressColor, indicatorColor, tabsBackgroundColor, style, theme, children, }) => {
@@ -9,12 +7,17 @@ const TabViewComponent = ({ Icon, onIndexChanged, onEndReached, tabBarPosition,
9
7
  const [routes, setRoutes] = React.useState([]);
10
8
  const [tabScenes, setTabScenes] = React.useState({});
11
9
  const { textStyles, viewStyles } = extractStyles(style);
10
+ //Check type of child using props
11
+ //Regular '.type' cannot work because Draftbit strips the type in Draft view
12
+ const instanceOfTabViewItemProps = (object) => {
13
+ return "title" in object;
14
+ };
12
15
  //Populate routes and scenes based on children
13
16
  React.useEffect(() => {
14
17
  const newRoutes = [];
15
18
  const scenes = {};
16
19
  React.Children.toArray(children)
17
- .filter((child) => React.isValidElement(child) && child.type === TabViewItem)
20
+ .filter((child) => React.isValidElement(child) && instanceOfTabViewItemProps(child.props))
18
21
  .forEach((item, idx) => {
19
22
  const child = item;
20
23
  newRoutes.push({
@@ -38,13 +41,14 @@ const TabViewComponent = ({ Icon, onIndexChanged, onEndReached, tabBarPosition,
38
41
  const renderTabBar = (props) => {
39
42
  return (React.createElement(TabBar, { ...props, activeColor: activeColor || theme.colors.primary, inactiveColor: inactiveColor || theme.colors.divider, pressColor: pressColor || theme.colors.primary, scrollEnabled: scrollEnabled, indicatorStyle: {
40
43
  backgroundColor: indicatorColor || theme.colors.primary,
41
- }, labelStyle: textStyles, renderIcon: ({ route, color }) => (route === null || route === void 0 ? void 0 : route.icon) ? (React.createElement(Icon, { name: route.icon, color: color, size: 36 })) : null, style: {
44
+ }, labelStyle: textStyles, renderIcon: ({ route, color }) => (route === null || route === void 0 ? void 0 : route.icon) ? (React.createElement(Icon, { name: route.icon, color: color, size: 16 })) : null, style: {
42
45
  backgroundColor: tabsBackgroundColor || theme.colors.background,
43
46
  } }));
44
47
  };
45
- return (React.createElement(TabView, { style: [styles.tabView, viewStyles], navigationState: { index, routes }, renderScene: SceneMap(tabScenes), renderTabBar: renderTabBar, onIndexChange: indexChangeHandler, tabBarPosition: tabBarPosition, keyboardDismissMode: keyboardDismissMode, swipeEnabled: swipeEnabled }));
48
+ //Cannot render TabView without at least one tab
49
+ if (!routes.length) {
50
+ return React.createElement(React.Fragment, null);
51
+ }
52
+ return (React.createElement(TabView, { style: [viewStyles], navigationState: { index, routes }, renderScene: SceneMap(tabScenes), renderTabBar: renderTabBar, onIndexChange: indexChangeHandler, tabBarPosition: tabBarPosition, keyboardDismissMode: keyboardDismissMode, swipeEnabled: swipeEnabled }));
46
53
  };
47
- const styles = StyleSheet.create({
48
- tabView: { flex: 1 },
49
- });
50
54
  export default withTheme(TabViewComponent);
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { StyleProp, ViewStyle, StyleSheet } from "react-native";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
3
  import {
4
4
  TabView,
5
5
  TabBar,
@@ -9,7 +9,7 @@ import {
9
9
  Route,
10
10
  } from "react-native-tab-view";
11
11
 
12
- import TabViewItem from "./TabViewItem";
12
+ import { TabViewItemProps } from "./TabViewItem";
13
13
  import type { IconSlot } from "../../interfaces/Icon";
14
14
  import { withTheme } from "../../theming";
15
15
  import type { Theme } from "../../styles/DefaultTheme";
@@ -60,6 +60,14 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
60
60
 
61
61
  const { textStyles, viewStyles } = extractStyles(style);
62
62
 
63
+ //Check type of child using props
64
+ //Regular '.type' cannot work because Draftbit strips the type in Draft view
65
+ const instanceOfTabViewItemProps = (
66
+ object: any
67
+ ): object is TabViewItemProps => {
68
+ return "title" in object;
69
+ };
70
+
63
71
  //Populate routes and scenes based on children
64
72
  React.useEffect(() => {
65
73
  const newRoutes: Route[] = [];
@@ -67,7 +75,8 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
67
75
 
68
76
  React.Children.toArray(children)
69
77
  .filter(
70
- (child) => React.isValidElement(child) && child.type === TabViewItem
78
+ (child) =>
79
+ React.isValidElement(child) && instanceOfTabViewItemProps(child.props)
71
80
  )
72
81
  .forEach((item: any, idx) => {
73
82
  const child = item as React.ReactElement;
@@ -106,7 +115,7 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
106
115
  labelStyle={textStyles}
107
116
  renderIcon={({ route, color }) =>
108
117
  route?.icon ? (
109
- <Icon name={route.icon} color={color} size={36} />
118
+ <Icon name={route.icon} color={color} size={16} />
110
119
  ) : null
111
120
  }
112
121
  style={{
@@ -116,9 +125,14 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
116
125
  );
117
126
  };
118
127
 
128
+ //Cannot render TabView without at least one tab
129
+ if (!routes.length) {
130
+ return <></>;
131
+ }
132
+
119
133
  return (
120
134
  <TabView
121
- style={[styles.tabView, viewStyles]}
135
+ style={[viewStyles]}
122
136
  navigationState={{ index, routes }}
123
137
  renderScene={SceneMap(tabScenes)}
124
138
  renderTabBar={renderTabBar}
@@ -130,8 +144,4 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
130
144
  );
131
145
  };
132
146
 
133
- const styles = StyleSheet.create({
134
- tabView: { flex: 1 },
135
- });
136
-
137
147
  export default withTheme(TabViewComponent);
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { StyleProp, ViewStyle, StyleSheet, View } from "react-native";
3
3
 
4
4
  //Props used by parent (TabView) to create tabs
5
- interface TabViewItemProps {
5
+ export interface TabViewItemProps {
6
6
  title: string;
7
7
  icon?: string;
8
8
  accessibilityLabel?: string;
package/src/index.js CHANGED
@@ -33,6 +33,7 @@ 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
35
  export { TabView, TabViewItem } from "./components/TabView";
36
+ export { default as Markdown } from "./components/Markdown";
36
37
  /* Deprecated: Fix or Delete! */
37
38
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
38
39
  export { default as Picker } from "./components/Picker/Picker";
package/src/index.tsx CHANGED
@@ -54,6 +54,7 @@ export {
54
54
  export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
55
55
 
56
56
  export { TabView, TabViewItem } from "./components/TabView";
57
+ export { default as Markdown } from "./components/Markdown";
57
58
 
58
59
  /* Deprecated: Fix or Delete! */
59
60
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, Triggers, createActionProp, createStaticNumberProp, createColorProp, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, GROUPS, Triggers, createActionProp, createStaticNumberProp, createColorProp, StylesPanelSections, } from "@draftbit/types";
2
2
  export const SEED_DATA = [
3
3
  {
4
4
  name: "Masonry List",
@@ -6,10 +6,10 @@ export const SEED_DATA = [
6
6
  description: "Masonry Flashlist by Shopify",
7
7
  packageName: "@shopify/flash-list",
8
8
  category: COMPONENT_TYPES.data,
9
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
10
- layout: {
11
- flex: 1,
12
- },
9
+ stylesPanelSections: [
10
+ StylesPanelSections.Background,
11
+ StylesPanelSections.MarginsAndPaddings,
12
+ ],
13
13
  triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
14
14
  props: {
15
15
  onRefresh: createActionProp(),
@@ -57,10 +57,10 @@ export const SEED_DATA = [
57
57
  description: "Flashlist by Shopify",
58
58
  packageName: "@shopify/flash-list",
59
59
  category: COMPONENT_TYPES.data,
60
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
61
- layout: {
62
- flex: 1,
63
- },
60
+ stylesPanelSections: [
61
+ StylesPanelSections.Background,
62
+ StylesPanelSections.MarginsAndPaddings,
63
+ ],
64
64
  triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
65
65
  props: {
66
66
  onRefresh: createActionProp(),
@@ -3,12 +3,12 @@ import {
3
3
  createNumColumnsType,
4
4
  createStaticBoolProp,
5
5
  createNumberProp,
6
- CONTAINER_COMPONENT_STYLES_SECTIONS,
7
6
  GROUPS,
8
7
  Triggers,
9
8
  createActionProp,
10
9
  createStaticNumberProp,
11
10
  createColorProp,
11
+ StylesPanelSections,
12
12
  } from "@draftbit/types";
13
13
 
14
14
  export const SEED_DATA = [
@@ -18,10 +18,10 @@ export const SEED_DATA = [
18
18
  description: "Masonry Flashlist by Shopify",
19
19
  packageName: "@shopify/flash-list",
20
20
  category: COMPONENT_TYPES.data,
21
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
22
- layout: {
23
- flex: 1,
24
- },
21
+ stylesPanelSections: [
22
+ StylesPanelSections.Background,
23
+ StylesPanelSections.MarginsAndPaddings,
24
+ ],
25
25
  triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
26
26
  props: {
27
27
  onRefresh: createActionProp(),
@@ -72,10 +72,10 @@ export const SEED_DATA = [
72
72
  description: "Flashlist by Shopify",
73
73
  packageName: "@shopify/flash-list",
74
74
  category: COMPONENT_TYPES.data,
75
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
76
- layout: {
77
- flex: 1,
78
- },
75
+ stylesPanelSections: [
76
+ StylesPanelSections.Background,
77
+ StylesPanelSections.MarginsAndPaddings,
78
+ ],
79
79
  triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
80
80
  props: {
81
81
  onRefresh: createActionProp(),
@@ -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
+ };
@@ -13,7 +13,6 @@ export const SEED_DATA = {
13
13
  StylesPanelSections.Background,
14
14
  StylesPanelSections.Typography,
15
15
  ],
16
- layout: { flex: 1 },
17
16
  triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
18
17
  props: {
19
18
  onIndexChanged: createActionProp({
@@ -23,7 +23,6 @@ export const SEED_DATA = {
23
23
  StylesPanelSections.Background,
24
24
  StylesPanelSections.Typography,
25
25
  ],
26
- layout: { flex: 1 },
27
26
  triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
28
27
  props: {
29
28
  onIndexChanged: createActionProp({