@draftbit/core 46.8.1-c1d8e9.2 → 46.8.1-d2585a.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.
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
9
9
  var _lodash = require("lodash");
10
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
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
- 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); }
13
12
  const NumberInput = _ref => {
14
13
  let {
15
14
  onChangeText,
@@ -40,7 +39,6 @@ const NumberInput = _ref => {
40
39
  setCurrentStringNumberValue(newStringNumberValue);
41
40
  onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(number);
42
41
  };
43
-
44
42
  // run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)
45
43
  (0, _react.useEffect)(() => {
46
44
  const nextStringNumberValue = formatValueToStringNumber(value);
@@ -49,7 +47,6 @@ const NumberInput = _ref => {
49
47
  }
50
48
  // eslint-disable-next-line react-hooks/exhaustive-deps
51
49
  }, [value]);
52
-
53
50
  // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
54
51
  (0, _react.useEffect)(() => {
55
52
  const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
@@ -58,6 +55,18 @@ const NumberInput = _ref => {
58
55
  }
59
56
  // eslint-disable-next-line react-hooks/exhaustive-deps
60
57
  }, []);
58
+ return /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, {
59
+ keyboardType: "numeric",
60
+ value: currentStringNumberValue,
61
+ onChangeText: handleChangeText,
62
+ ...props
63
+ });
64
+ };
65
+ var _default = NumberInput;
66
+ exports.default = _default;erValue);
67
+ }
68
+ // eslint-disable-next-line react-hooks/exhaustive-deps
69
+ }, []);
61
70
  return /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, _extends({
62
71
  keyboardType: "numeric",
63
72
  value: currentStringNumberValue,
@@ -11,7 +11,6 @@ var _IconButton = _interopRequireDefault(require("./IconButton"));
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); }
15
14
  const ToggleButton = _ref => {
16
15
  let {
17
16
  Icon,
@@ -47,7 +46,7 @@ const ToggleButton = _ref => {
47
46
  setInternalValue(!internalValue);
48
47
  onPress(!internalValue);
49
48
  };
50
- return /*#__PURE__*/React.createElement(_IconButton.default, _extends({
49
+ return /*#__PURE__*/React.createElement(_IconButton.default, {
51
50
  Icon: Icon,
52
51
  icon: icon,
53
52
  size: iconSize,
@@ -59,6 +58,20 @@ const ToggleButton = _ref => {
59
58
  height,
60
59
  backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
61
60
  borderColor: colors[borderColor]
61
+ }, style],
62
+ ...rest
63
+ });
64
+ };
65
+ const styles = _reactNative.StyleSheet.create({
66
+ mainContainer: {
67
+ borderWidth: 1
68
+ }
69
+ });
70
+ var _default = (0, _theming.withTheme)(ToggleButton);
71
+ exports.default = _default;idth,
72
+ height,
73
+ backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
74
+ borderColor: colors[borderColor]
62
75
  }, style]
63
76
  }, rest));
64
77
  };
@@ -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,12 +177,6 @@ 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
- });
186
180
  Object.defineProperty(exports, "NumberInput", {
187
181
  enumerable: true,
188
182
  get: function () {
@@ -420,7 +414,6 @@ var _Swiper = require("./components/Swiper");
420
414
  var _Layout = require("./components/Layout");
421
415
  var _index = require("./components/RadioButton/index");
422
416
  var _DeckSwiper = require("./components/DeckSwiper");
423
- var _Markdown = _interopRequireDefault(require("./components/Markdown"));
424
417
  var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
425
418
  var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
426
419
  var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
@@ -0,0 +1,177 @@
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_TRIGGERS = [_types.Triggers.OnValueChange];
9
+ const ELEMENT_SEED_DATA = {
10
+ doc_link: "https://www.npmjs.com/package/@expo/html-elements",
11
+ code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
12
+ packageName: "@expo/html-elements",
13
+ stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Effects],
14
+ layout: {
15
+ margin: 0
16
+ },
17
+ triggers: SEED_DATA_TRIGGERS,
18
+ category: _types.COMPONENT_TYPES.webelement
19
+ };
20
+ const HEADING_SEED_DATA = {
21
+ ...ELEMENT_SEED_DATA,
22
+ category: _types.COMPONENT_TYPES.text,
23
+ props: {
24
+ accessibilityLabel: {
25
+ group: _types.GROUPS.accessibility,
26
+ name: "accessibilityLabel",
27
+ label: "accessibilityLabel",
28
+ description: "Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space.",
29
+ editable: true,
30
+ required: false,
31
+ formType: _types.FORM_TYPES.string,
32
+ propType: _types.PROP_TYPES.STRING,
33
+ defaultValue: null
34
+ },
35
+ selectable: {
36
+ group: _types.GROUPS.advanced,
37
+ name: "selectable",
38
+ label: "selectable",
39
+ description: "Lets the user select text, to use the native copy and paste functionality.",
40
+ editable: true,
41
+ required: false,
42
+ formType: _types.FORM_TYPES.boolean,
43
+ propType: _types.PROP_TYPES.BOOLEAN,
44
+ defaultValue: null
45
+ },
46
+ children: {
47
+ group: _types.GROUPS.data,
48
+ label: "Text",
49
+ description: "Text",
50
+ editable: true,
51
+ required: true,
52
+ formType: _types.FORM_TYPES.string,
53
+ propType: _types.PROP_TYPES.STRING,
54
+ defaultValue: "Your Headline Here"
55
+ }
56
+ }
57
+ };
58
+ const TEXT_SEED_DATA = {
59
+ ...ELEMENT_SEED_DATA,
60
+ category: _types.COMPONENT_TYPES.text,
61
+ props: {
62
+ children: {
63
+ group: _types.GROUPS.data,
64
+ label: "Text",
65
+ description: "Text",
66
+ defaultValue: "Your Text Here",
67
+ editable: true,
68
+ required: true,
69
+ formType: _types.FORM_TYPES.string,
70
+ propType: _types.PROP_TYPES.STRING
71
+ }
72
+ }
73
+ };
74
+ const SEED_DATA = [{
75
+ name: "H1",
76
+ tag: "H1",
77
+ ...HEADING_SEED_DATA
78
+ }, {
79
+ name: "H2",
80
+ tag: "H2",
81
+ ...HEADING_SEED_DATA
82
+ }, {
83
+ name: "H3",
84
+ tag: "H3",
85
+ ...HEADING_SEED_DATA
86
+ }, {
87
+ name: "H4",
88
+ tag: "H4",
89
+ ...HEADING_SEED_DATA
90
+ }, {
91
+ name: "H5",
92
+ tag: "H5",
93
+ ...HEADING_SEED_DATA
94
+ }, {
95
+ name: "H6",
96
+ tag: "H6",
97
+ ...HEADING_SEED_DATA
98
+ }, {
99
+ name: "Anchor",
100
+ tag: "A",
101
+ ...TEXT_SEED_DATA,
102
+ props: {
103
+ href: (0, _types.createTextProp)({
104
+ label: "href",
105
+ description: "Specify the URL",
106
+ defaultValue: ""
107
+ }),
108
+ target: {
109
+ group: _types.GROUPS.basic,
110
+ label: "target",
111
+ description: "decide where link should open",
112
+ formType: _types.FORM_TYPES.flatArray,
113
+ defaultValue: "_blank",
114
+ options: ["_blank", "_self", "_parent", "_top"]
115
+ }
116
+ }
117
+ }, {
118
+ name: "Paragraph",
119
+ tag: "P",
120
+ ...TEXT_SEED_DATA,
121
+ props: {
122
+ // NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
123
+ // strong: createBoolProp({
124
+ // label: "Strong",
125
+ // description: "Strong",
126
+ // }),
127
+ // strike: createBoolProp({
128
+ // label: "Strike",
129
+ // description: "Strike through",
130
+ // }),
131
+ // italic: createBoolProp({
132
+ // label: "Italic",
133
+ // description: "Italic Fonts",
134
+ // }),
135
+ // bold: createBoolProp({
136
+ // label: "Bold",
137
+ // description: "Bold",
138
+ // }),
139
+ }
140
+ }, {
141
+ name: "Code",
142
+ tag: "Code",
143
+ ...TEXT_SEED_DATA
144
+ }, {
145
+ name: "Pre",
146
+ tag: "Pre",
147
+ ...TEXT_SEED_DATA
148
+ }, {
149
+ name: "Mark",
150
+ tag: "Mark",
151
+ ...TEXT_SEED_DATA
152
+ }, {
153
+ name: "BR",
154
+ tag: "BR",
155
+ ...TEXT_SEED_DATA
156
+ }, {
157
+ name: "BlockQuote",
158
+ tag: "BlockQuote",
159
+ ...TEXT_SEED_DATA
160
+ }, {
161
+ name: "HR",
162
+ tag: "HR",
163
+ ...TEXT_SEED_DATA
164
+ }, {
165
+ name: "Time",
166
+ tag: "Time",
167
+ ...ELEMENT_SEED_DATA
168
+ }, {
169
+ name: "UL",
170
+ tag: "UL",
171
+ ...ELEMENT_SEED_DATA
172
+ }, {
173
+ name: "LI",
174
+ tag: "LI",
175
+ ...ELEMENT_SEED_DATA
176
+ }];
177
+ exports.SEED_DATA = SEED_DATA;
@@ -1,3 +1,4 @@
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); }
1
2
  import * as React from "react";
2
3
  import { ActivityIndicator, View, Text, StyleSheet, Pressable } from "react-native";
3
4
  import color from "color";
@@ -74,8 +75,7 @@ const Button = _ref => {
74
75
  elevation,
75
76
  alignSelf: "stretch"
76
77
  }
77
- }, /*#__PURE__*/React.createElement(Pressable, {
78
- ...rest,
78
+ }, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
79
79
  onPress: onPress,
80
80
  accessibilityState: {
81
81
  disabled
@@ -83,7 +83,7 @@ const Button = _ref => {
83
83
  accessibilityRole: "button",
84
84
  disabled: disabled || loading,
85
85
  style: [styles.button, buttonStyle]
86
- }, /*#__PURE__*/React.createElement(View, {
86
+ }), /*#__PURE__*/React.createElement(View, {
87
87
  style: styles.content
88
88
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
89
89
  style: iconStyle
@@ -114,22 +114,4 @@ const styles = StyleSheet.create({
114
114
  width: Config.buttonIconSize
115
115
  }
116
116
  });
117
- export default withTheme(Button);: 1,
118
- style: [textStyle, typography.button]
119
- }, children))));
120
- };
121
- const styles = StyleSheet.create({
122
- button: {
123
- minWidth: 64,
124
- borderStyle: "solid"
125
- },
126
- content: {
127
- flexDirection: "row",
128
- alignItems: "center",
129
- justifyContent: "center"
130
- },
131
- icon: {
132
- width: Config.buttonIconSize
133
- }
134
- });
135
117
  export default withTheme(Button);
@@ -32,7 +32,6 @@ 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 { default as Markdown } from "./components/Markdown";
36
35
 
37
36
  /* Deprecated: Fix or Delete! */
38
37
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
@@ -0,0 +1,170 @@
1
+ import { COMPONENT_TYPES, createTextProp, FORM_TYPES, PROP_TYPES, GROUPS, StylesPanelSections, Triggers } from "@draftbit/types";
2
+ const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
3
+ const ELEMENT_SEED_DATA = {
4
+ doc_link: "https://www.npmjs.com/package/@expo/html-elements",
5
+ code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
6
+ packageName: "@expo/html-elements",
7
+ stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Effects],
8
+ layout: {
9
+ margin: 0
10
+ },
11
+ triggers: SEED_DATA_TRIGGERS,
12
+ category: COMPONENT_TYPES.webelement
13
+ };
14
+ const HEADING_SEED_DATA = {
15
+ ...ELEMENT_SEED_DATA,
16
+ category: COMPONENT_TYPES.text,
17
+ props: {
18
+ accessibilityLabel: {
19
+ group: GROUPS.accessibility,
20
+ name: "accessibilityLabel",
21
+ label: "accessibilityLabel",
22
+ description: "Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space.",
23
+ editable: true,
24
+ required: false,
25
+ formType: FORM_TYPES.string,
26
+ propType: PROP_TYPES.STRING,
27
+ defaultValue: null
28
+ },
29
+ selectable: {
30
+ group: GROUPS.advanced,
31
+ name: "selectable",
32
+ label: "selectable",
33
+ description: "Lets the user select text, to use the native copy and paste functionality.",
34
+ editable: true,
35
+ required: false,
36
+ formType: FORM_TYPES.boolean,
37
+ propType: PROP_TYPES.BOOLEAN,
38
+ defaultValue: null
39
+ },
40
+ children: {
41
+ group: GROUPS.data,
42
+ label: "Text",
43
+ description: "Text",
44
+ editable: true,
45
+ required: true,
46
+ formType: FORM_TYPES.string,
47
+ propType: PROP_TYPES.STRING,
48
+ defaultValue: "Your Headline Here"
49
+ }
50
+ }
51
+ };
52
+ const TEXT_SEED_DATA = {
53
+ ...ELEMENT_SEED_DATA,
54
+ category: COMPONENT_TYPES.text,
55
+ props: {
56
+ children: {
57
+ group: GROUPS.data,
58
+ label: "Text",
59
+ description: "Text",
60
+ defaultValue: "Your Text Here",
61
+ editable: true,
62
+ required: true,
63
+ formType: FORM_TYPES.string,
64
+ propType: PROP_TYPES.STRING
65
+ }
66
+ }
67
+ };
68
+ export const SEED_DATA = [{
69
+ name: "H1",
70
+ tag: "H1",
71
+ ...HEADING_SEED_DATA
72
+ }, {
73
+ name: "H2",
74
+ tag: "H2",
75
+ ...HEADING_SEED_DATA
76
+ }, {
77
+ name: "H3",
78
+ tag: "H3",
79
+ ...HEADING_SEED_DATA
80
+ }, {
81
+ name: "H4",
82
+ tag: "H4",
83
+ ...HEADING_SEED_DATA
84
+ }, {
85
+ name: "H5",
86
+ tag: "H5",
87
+ ...HEADING_SEED_DATA
88
+ }, {
89
+ name: "H6",
90
+ tag: "H6",
91
+ ...HEADING_SEED_DATA
92
+ }, {
93
+ name: "Anchor",
94
+ tag: "A",
95
+ ...TEXT_SEED_DATA,
96
+ props: {
97
+ href: createTextProp({
98
+ label: "href",
99
+ description: "Specify the URL",
100
+ defaultValue: ""
101
+ }),
102
+ target: {
103
+ group: GROUPS.basic,
104
+ label: "target",
105
+ description: "decide where link should open",
106
+ formType: FORM_TYPES.flatArray,
107
+ defaultValue: "_blank",
108
+ options: ["_blank", "_self", "_parent", "_top"]
109
+ }
110
+ }
111
+ }, {
112
+ name: "Paragraph",
113
+ tag: "P",
114
+ ...TEXT_SEED_DATA,
115
+ props: {
116
+ // NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
117
+ // strong: createBoolProp({
118
+ // label: "Strong",
119
+ // description: "Strong",
120
+ // }),
121
+ // strike: createBoolProp({
122
+ // label: "Strike",
123
+ // description: "Strike through",
124
+ // }),
125
+ // italic: createBoolProp({
126
+ // label: "Italic",
127
+ // description: "Italic Fonts",
128
+ // }),
129
+ // bold: createBoolProp({
130
+ // label: "Bold",
131
+ // description: "Bold",
132
+ // }),
133
+ }
134
+ }, {
135
+ name: "Code",
136
+ tag: "Code",
137
+ ...TEXT_SEED_DATA
138
+ }, {
139
+ name: "Pre",
140
+ tag: "Pre",
141
+ ...TEXT_SEED_DATA
142
+ }, {
143
+ name: "Mark",
144
+ tag: "Mark",
145
+ ...TEXT_SEED_DATA
146
+ }, {
147
+ name: "BR",
148
+ tag: "BR",
149
+ ...TEXT_SEED_DATA
150
+ }, {
151
+ name: "BlockQuote",
152
+ tag: "BlockQuote",
153
+ ...TEXT_SEED_DATA
154
+ }, {
155
+ name: "HR",
156
+ tag: "HR",
157
+ ...TEXT_SEED_DATA
158
+ }, {
159
+ name: "Time",
160
+ tag: "Time",
161
+ ...ELEMENT_SEED_DATA
162
+ }, {
163
+ name: "UL",
164
+ tag: "UL",
165
+ ...ELEMENT_SEED_DATA
166
+ }, {
167
+ name: "LI",
168
+ tag: "LI",
169
+ ...ELEMENT_SEED_DATA
170
+ }];
@@ -32,7 +32,6 @@ 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 { default as Markdown } from "./components/Markdown";
36
35
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
37
36
  export { default as Picker } from "./components/Picker/Picker";
38
37
  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,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AqB,CAAC;AAE7B,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,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"}
@@ -0,0 +1,77 @@
1
+ export declare const SEED_DATA: ({
2
+ props: {
3
+ href: any;
4
+ target: {
5
+ group: string;
6
+ label: string;
7
+ description: string;
8
+ formType: string;
9
+ defaultValue: string;
10
+ options: string[];
11
+ };
12
+ };
13
+ category: string;
14
+ doc_link: string;
15
+ code_link: string;
16
+ packageName: string;
17
+ stylesPanelSections: string[];
18
+ layout: {
19
+ margin: number;
20
+ };
21
+ triggers: string[];
22
+ name: string;
23
+ tag: string;
24
+ } | {
25
+ props: {
26
+ href?: undefined;
27
+ target?: undefined;
28
+ };
29
+ category: string;
30
+ doc_link: string;
31
+ code_link: string;
32
+ packageName: string;
33
+ stylesPanelSections: string[];
34
+ layout: {
35
+ margin: number;
36
+ };
37
+ triggers: string[];
38
+ name: string;
39
+ tag: string;
40
+ } | {
41
+ category: string;
42
+ props: {
43
+ children: {
44
+ group: string;
45
+ label: string;
46
+ description: string;
47
+ defaultValue: string;
48
+ editable: boolean;
49
+ required: boolean;
50
+ formType: string;
51
+ propType: string;
52
+ };
53
+ };
54
+ doc_link: string;
55
+ code_link: string;
56
+ packageName: string;
57
+ stylesPanelSections: string[];
58
+ layout: {
59
+ margin: number;
60
+ };
61
+ triggers: string[];
62
+ name: string;
63
+ tag: string;
64
+ } | {
65
+ doc_link: string;
66
+ code_link: string;
67
+ packageName: string;
68
+ stylesPanelSections: string[];
69
+ layout: {
70
+ margin: number;
71
+ };
72
+ triggers: string[];
73
+ category: string;
74
+ name: string;
75
+ tag: string;
76
+ })[];
77
+ //# sourceMappingURL=HtmlElements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HtmlElements.d.ts","sourceRoot":"","sources":["../../../../src/mappings/HtmlElements.ts"],"names":[],"mappings":"AAsFA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwHrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.8.1-c1d8e9.2+c1d8e9f",
3
+ "version": "46.8.1-d2585a.2+d2585a8",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,8 @@
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.1-c1d8e9.2+c1d8e9f",
44
+ "@draftbit/types": "^46.8.1-d2585a.2+d2585a8",
45
+ "@expo/html-elements": "^0.3.1",
45
46
  "@material-ui/core": "^4.11.0",
46
47
  "@material-ui/pickers": "^3.2.10",
47
48
  "@react-native-community/slider": "4.2.3",
@@ -54,7 +55,6 @@
54
55
  "lodash.omit": "^4.5.0",
55
56
  "lodash.tonumber": "^4.0.3",
56
57
  "react-native-deck-swiper": "^2.0.12",
57
- "react-native-markdown-display": "^7.0.0-alpha.2",
58
58
  "react-native-modal-datetime-picker": "^13.0.0",
59
59
  "react-native-svg": "12.3.0",
60
60
  "react-native-typography": "^1.4.1",
@@ -93,5 +93,5 @@
93
93
  ]
94
94
  ]
95
95
  },
96
- "gitHead": "c1d8e9fc142bf557fb1ae20dff52b8de218703db"
96
+ "gitHead": "d2585a89f100db8b2652d8251caaa71734e3038b"
97
97
  }
package/src/index.js CHANGED
@@ -32,7 +32,6 @@ 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 { default as Markdown } from "./components/Markdown";
36
35
  /* Deprecated: Fix or Delete! */
37
36
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
38
37
  export { default as Picker } from "./components/Picker/Picker";
package/src/index.tsx CHANGED
@@ -53,8 +53,6 @@ export {
53
53
 
54
54
  export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
55
55
 
56
- export { default as Markdown } from "./components/Markdown";
57
-
58
56
  /* Deprecated: Fix or Delete! */
59
57
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
60
58
  export { default as Picker } from "./components/Picker/Picker";
@@ -0,0 +1,193 @@
1
+ import { COMPONENT_TYPES, createTextProp, FORM_TYPES, PROP_TYPES, GROUPS, StylesPanelSections, Triggers, } from "@draftbit/types";
2
+ const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
3
+ const ELEMENT_SEED_DATA = {
4
+ doc_link: "https://www.npmjs.com/package/@expo/html-elements",
5
+ code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
6
+ packageName: "@expo/html-elements",
7
+ stylesPanelSections: [
8
+ StylesPanelSections.Typography,
9
+ StylesPanelSections.LayoutSelectedItem,
10
+ StylesPanelSections.MarginsAndPaddings,
11
+ StylesPanelSections.Effects,
12
+ ],
13
+ layout: {
14
+ margin: 0,
15
+ },
16
+ triggers: SEED_DATA_TRIGGERS,
17
+ category: COMPONENT_TYPES.webelement,
18
+ };
19
+ const HEADING_SEED_DATA = {
20
+ ...ELEMENT_SEED_DATA,
21
+ category: COMPONENT_TYPES.text,
22
+ props: {
23
+ accessibilityLabel: {
24
+ group: GROUPS.accessibility,
25
+ name: "accessibilityLabel",
26
+ label: "accessibilityLabel",
27
+ description: "Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space.",
28
+ editable: true,
29
+ required: false,
30
+ formType: FORM_TYPES.string,
31
+ propType: PROP_TYPES.STRING,
32
+ defaultValue: null,
33
+ },
34
+ selectable: {
35
+ group: GROUPS.advanced,
36
+ name: "selectable",
37
+ label: "selectable",
38
+ description: "Lets the user select text, to use the native copy and paste functionality.",
39
+ editable: true,
40
+ required: false,
41
+ formType: FORM_TYPES.boolean,
42
+ propType: PROP_TYPES.BOOLEAN,
43
+ defaultValue: null,
44
+ },
45
+ children: {
46
+ group: GROUPS.data,
47
+ label: "Text",
48
+ description: "Text",
49
+ editable: true,
50
+ required: true,
51
+ formType: FORM_TYPES.string,
52
+ propType: PROP_TYPES.STRING,
53
+ defaultValue: "Your Headline Here",
54
+ },
55
+ },
56
+ };
57
+ const TEXT_SEED_DATA = {
58
+ ...ELEMENT_SEED_DATA,
59
+ category: COMPONENT_TYPES.text,
60
+ props: {
61
+ children: {
62
+ group: GROUPS.data,
63
+ label: "Text",
64
+ description: "Text",
65
+ defaultValue: "Your Text Here",
66
+ editable: true,
67
+ required: true,
68
+ formType: FORM_TYPES.string,
69
+ propType: PROP_TYPES.STRING,
70
+ },
71
+ },
72
+ };
73
+ export const SEED_DATA = [
74
+ {
75
+ name: "H1",
76
+ tag: "H1",
77
+ ...HEADING_SEED_DATA,
78
+ },
79
+ {
80
+ name: "H2",
81
+ tag: "H2",
82
+ ...HEADING_SEED_DATA,
83
+ },
84
+ {
85
+ name: "H3",
86
+ tag: "H3",
87
+ ...HEADING_SEED_DATA,
88
+ },
89
+ {
90
+ name: "H4",
91
+ tag: "H4",
92
+ ...HEADING_SEED_DATA,
93
+ },
94
+ {
95
+ name: "H5",
96
+ tag: "H5",
97
+ ...HEADING_SEED_DATA,
98
+ },
99
+ {
100
+ name: "H6",
101
+ tag: "H6",
102
+ ...HEADING_SEED_DATA,
103
+ },
104
+ {
105
+ name: "Anchor",
106
+ tag: "A",
107
+ ...TEXT_SEED_DATA,
108
+ props: {
109
+ href: createTextProp({
110
+ label: "href",
111
+ description: "Specify the URL",
112
+ defaultValue: "",
113
+ }),
114
+ target: {
115
+ group: GROUPS.basic,
116
+ label: "target",
117
+ description: "decide where link should open",
118
+ formType: FORM_TYPES.flatArray,
119
+ defaultValue: "_blank",
120
+ options: ["_blank", "_self", "_parent", "_top"],
121
+ },
122
+ },
123
+ },
124
+ {
125
+ name: "Paragraph",
126
+ tag: "P",
127
+ ...TEXT_SEED_DATA,
128
+ props: {
129
+ // NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
130
+ // strong: createBoolProp({
131
+ // label: "Strong",
132
+ // description: "Strong",
133
+ // }),
134
+ // strike: createBoolProp({
135
+ // label: "Strike",
136
+ // description: "Strike through",
137
+ // }),
138
+ // italic: createBoolProp({
139
+ // label: "Italic",
140
+ // description: "Italic Fonts",
141
+ // }),
142
+ // bold: createBoolProp({
143
+ // label: "Bold",
144
+ // description: "Bold",
145
+ // }),
146
+ },
147
+ },
148
+ {
149
+ name: "Code",
150
+ tag: "Code",
151
+ ...TEXT_SEED_DATA,
152
+ },
153
+ {
154
+ name: "Pre",
155
+ tag: "Pre",
156
+ ...TEXT_SEED_DATA,
157
+ },
158
+ {
159
+ name: "Mark",
160
+ tag: "Mark",
161
+ ...TEXT_SEED_DATA,
162
+ },
163
+ {
164
+ name: "BR",
165
+ tag: "BR",
166
+ ...TEXT_SEED_DATA,
167
+ },
168
+ {
169
+ name: "BlockQuote",
170
+ tag: "BlockQuote",
171
+ ...TEXT_SEED_DATA,
172
+ },
173
+ {
174
+ name: "HR",
175
+ tag: "HR",
176
+ ...TEXT_SEED_DATA,
177
+ },
178
+ {
179
+ name: "Time",
180
+ tag: "Time",
181
+ ...ELEMENT_SEED_DATA,
182
+ },
183
+ {
184
+ name: "UL",
185
+ tag: "UL",
186
+ ...ELEMENT_SEED_DATA,
187
+ },
188
+ {
189
+ name: "LI",
190
+ tag: "LI",
191
+ ...ELEMENT_SEED_DATA,
192
+ },
193
+ ];
@@ -0,0 +1,207 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createTextProp,
4
+ FORM_TYPES,
5
+ PROP_TYPES,
6
+ GROUPS,
7
+ StylesPanelSections,
8
+ Triggers,
9
+ } from "@draftbit/types";
10
+ const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
11
+
12
+ const ELEMENT_SEED_DATA = {
13
+ doc_link: "https://www.npmjs.com/package/@expo/html-elements",
14
+ code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
15
+ packageName: "@expo/html-elements",
16
+ stylesPanelSections: [
17
+ StylesPanelSections.Typography,
18
+ StylesPanelSections.LayoutSelectedItem,
19
+ StylesPanelSections.MarginsAndPaddings,
20
+ StylesPanelSections.Effects,
21
+ ],
22
+ layout: {
23
+ margin: 0,
24
+ },
25
+ triggers: SEED_DATA_TRIGGERS,
26
+ category: COMPONENT_TYPES.webelement,
27
+ };
28
+
29
+ const HEADING_SEED_DATA = {
30
+ ...ELEMENT_SEED_DATA,
31
+ category: COMPONENT_TYPES.text,
32
+ props: {
33
+ accessibilityLabel: {
34
+ group: GROUPS.accessibility,
35
+ name: "accessibilityLabel",
36
+ label: "accessibilityLabel",
37
+ description:
38
+ "Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space.",
39
+ editable: true,
40
+ required: false,
41
+ formType: FORM_TYPES.string,
42
+ propType: PROP_TYPES.STRING,
43
+ defaultValue: null,
44
+ },
45
+ selectable: {
46
+ group: GROUPS.advanced,
47
+ name: "selectable",
48
+ label: "selectable",
49
+ description:
50
+ "Lets the user select text, to use the native copy and paste functionality.",
51
+ editable: true,
52
+ required: false,
53
+ formType: FORM_TYPES.boolean,
54
+ propType: PROP_TYPES.BOOLEAN,
55
+ defaultValue: null,
56
+ },
57
+ children: {
58
+ group: GROUPS.data,
59
+ label: "Text",
60
+ description: "Text",
61
+ editable: true,
62
+ required: true,
63
+ formType: FORM_TYPES.string,
64
+ propType: PROP_TYPES.STRING,
65
+ defaultValue: "Your Headline Here",
66
+ },
67
+ },
68
+ };
69
+
70
+ const TEXT_SEED_DATA = {
71
+ ...ELEMENT_SEED_DATA,
72
+ category: COMPONENT_TYPES.text,
73
+ props: {
74
+ children: {
75
+ group: GROUPS.data,
76
+ label: "Text",
77
+ description: "Text",
78
+ defaultValue: "Your Text Here",
79
+ editable: true,
80
+ required: true,
81
+ formType: FORM_TYPES.string,
82
+ propType: PROP_TYPES.STRING,
83
+ },
84
+ },
85
+ };
86
+
87
+ export const SEED_DATA = [
88
+ {
89
+ name: "H1",
90
+ tag: "H1",
91
+ ...HEADING_SEED_DATA,
92
+ },
93
+ {
94
+ name: "H2",
95
+ tag: "H2",
96
+ ...HEADING_SEED_DATA,
97
+ },
98
+ {
99
+ name: "H3",
100
+ tag: "H3",
101
+ ...HEADING_SEED_DATA,
102
+ },
103
+ {
104
+ name: "H4",
105
+ tag: "H4",
106
+ ...HEADING_SEED_DATA,
107
+ },
108
+ {
109
+ name: "H5",
110
+ tag: "H5",
111
+ ...HEADING_SEED_DATA,
112
+ },
113
+ {
114
+ name: "H6",
115
+ tag: "H6",
116
+ ...HEADING_SEED_DATA,
117
+ },
118
+ {
119
+ name: "Anchor",
120
+ tag: "A",
121
+ ...TEXT_SEED_DATA,
122
+ props: {
123
+ href: createTextProp({
124
+ label: "href",
125
+ description: "Specify the URL",
126
+ defaultValue: "",
127
+ }),
128
+ target: {
129
+ group: GROUPS.basic,
130
+ label: "target",
131
+ description: "decide where link should open",
132
+ formType: FORM_TYPES.flatArray,
133
+ defaultValue: "_blank",
134
+ options: ["_blank", "_self", "_parent", "_top"],
135
+ },
136
+ },
137
+ },
138
+ {
139
+ name: "Paragraph",
140
+ tag: "P",
141
+ ...TEXT_SEED_DATA,
142
+ props: {
143
+ // NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
144
+ // strong: createBoolProp({
145
+ // label: "Strong",
146
+ // description: "Strong",
147
+ // }),
148
+ // strike: createBoolProp({
149
+ // label: "Strike",
150
+ // description: "Strike through",
151
+ // }),
152
+ // italic: createBoolProp({
153
+ // label: "Italic",
154
+ // description: "Italic Fonts",
155
+ // }),
156
+ // bold: createBoolProp({
157
+ // label: "Bold",
158
+ // description: "Bold",
159
+ // }),
160
+ },
161
+ },
162
+ {
163
+ name: "Code",
164
+ tag: "Code",
165
+ ...TEXT_SEED_DATA,
166
+ },
167
+ {
168
+ name: "Pre",
169
+ tag: "Pre",
170
+ ...TEXT_SEED_DATA,
171
+ },
172
+ {
173
+ name: "Mark",
174
+ tag: "Mark",
175
+ ...TEXT_SEED_DATA,
176
+ },
177
+ {
178
+ name: "BR",
179
+ tag: "BR",
180
+ ...TEXT_SEED_DATA,
181
+ },
182
+ {
183
+ name: "BlockQuote",
184
+ tag: "BlockQuote",
185
+ ...TEXT_SEED_DATA,
186
+ },
187
+ {
188
+ name: "HR",
189
+ tag: "HR",
190
+ ...TEXT_SEED_DATA,
191
+ },
192
+ {
193
+ name: "Time",
194
+ tag: "Time",
195
+ ...ELEMENT_SEED_DATA,
196
+ },
197
+ {
198
+ name: "UL",
199
+ tag: "UL",
200
+ ...ELEMENT_SEED_DATA,
201
+ },
202
+ {
203
+ name: "LI",
204
+ tag: "LI",
205
+ ...ELEMENT_SEED_DATA,
206
+ },
207
+ ];
@@ -1,30 +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 _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 used for main parent container
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;
@@ -1,27 +0,0 @@
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.basic,
13
- stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
14
- props: {
15
- children: {
16
- group: _types.GROUPS.data,
17
- label: "Markdown Text",
18
- description: "Markdownt text to be rendered ",
19
- editable: true,
20
- required: true,
21
- formType: _types.FORM_TYPES.string,
22
- propType: _types.PROP_TYPES.STRING,
23
- defaultValue: "## Double click me to edit 👀"
24
- }
25
- }
26
- };
27
- exports.SEED_DATA = SEED_DATA;
@@ -1,20 +0,0 @@
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 used for main parent container
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,20 +0,0 @@
1
- import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, FORM_TYPES, GROUPS, PROP_TYPES } 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.basic,
7
- stylesPanelSections: BLOCK_STYLES_SECTIONS,
8
- props: {
9
- children: {
10
- group: GROUPS.data,
11
- label: "Markdown Text",
12
- description: "Markdownt text to be rendered ",
13
- editable: true,
14
- required: true,
15
- formType: FORM_TYPES.string,
16
- propType: PROP_TYPES.STRING,
17
- defaultValue: "## Double click me to edit 👀"
18
- }
19
- }
20
- };
@@ -1,8 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,20 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Markdown.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;CAkBrB,CAAC"}
@@ -1,10 +0,0 @@
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 used for main parent container
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;
@@ -1,22 +0,0 @@
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 used for main parent container
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,20 +0,0 @@
1
- import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, FORM_TYPES, GROUPS, PROP_TYPES, } 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.basic,
7
- stylesPanelSections: BLOCK_STYLES_SECTIONS,
8
- props: {
9
- children: {
10
- group: GROUPS.data,
11
- label: "Markdown Text",
12
- description: "Markdownt text to be rendered ",
13
- editable: true,
14
- required: true,
15
- formType: FORM_TYPES.string,
16
- propType: PROP_TYPES.STRING,
17
- defaultValue: "## Double click me to edit 👀",
18
- },
19
- },
20
- };
@@ -1,27 +0,0 @@
1
- import {
2
- BLOCK_STYLES_SECTIONS,
3
- COMPONENT_TYPES,
4
- FORM_TYPES,
5
- GROUPS,
6
- PROP_TYPES,
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.basic,
14
- stylesPanelSections: BLOCK_STYLES_SECTIONS,
15
- props: {
16
- children: {
17
- group: GROUPS.data,
18
- label: "Markdown Text",
19
- description: "Markdownt text to be rendered ",
20
- editable: true,
21
- required: true,
22
- formType: FORM_TYPES.string,
23
- propType: PROP_TYPES.STRING,
24
- defaultValue: "## Double click me to edit 👀",
25
- },
26
- },
27
- };