@draftbit/core 46.2.4-1c9faf.10 → 46.2.4-1cc3fe.10

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 (35) hide show
  1. package/lib/commonjs/components/AspectRatio.js +2 -19
  2. package/lib/commonjs/components/Banner.js +4 -24
  3. package/lib/commonjs/components/CardContainerRating.js +5 -15
  4. package/lib/commonjs/components/Checkbox/Checkbox.js +4 -2
  5. package/lib/commonjs/components/Checkbox/context.js +1 -1
  6. package/lib/commonjs/components/DatePicker/DatePicker.js +8 -7
  7. package/lib/commonjs/components/IconButton.js +5 -22
  8. package/lib/commonjs/components/Markdown.js +33 -0
  9. package/lib/commonjs/components/Picker/PickerComponent.web.js +5 -24
  10. package/lib/commonjs/components/Portal/PortalManager.js +11 -19
  11. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +3 -16
  12. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +6 -24
  13. package/lib/commonjs/components/Slider.js +5 -24
  14. package/lib/commonjs/components/Switch.js +23 -10
  15. package/lib/commonjs/index.js +8 -0
  16. package/lib/commonjs/mappings/Markdown.js +23 -0
  17. package/lib/module/components/AnimatedCircularProgress.js +2 -14
  18. package/lib/module/components/Markdown.js +18 -0
  19. package/lib/module/index.js +2 -1
  20. package/lib/module/mappings/Markdown.js +14 -0
  21. package/lib/typescript/src/components/Markdown.d.ts +6 -0
  22. package/lib/typescript/src/index.d.ts +1 -0
  23. package/lib/typescript/src/mappings/Markdown.d.ts +9 -0
  24. package/package.json +4 -3
  25. package/src/components/Markdown.js +12 -0
  26. package/src/components/Markdown.tsx +25 -0
  27. package/src/index.js +1 -0
  28. package/src/index.tsx +1 -0
  29. package/src/mappings/Markdown.js +14 -0
  30. package/src/mappings/Markdown.ts +15 -0
  31. package/lib/commonjs/mappings/FlashList.js +0 -42
  32. package/lib/module/mappings/FlashList.js +0 -33
  33. package/lib/typescript/src/mappings/FlashList.d.ts +0 -54
  34. package/src/mappings/FlashList.js +0 -33
  35. package/src/mappings/FlashList.ts +0 -41
@@ -11,6 +11,8 @@ var _reactNative = require("react-native");
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
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
16
  const AspectRatio = props => {
15
17
  const [layout, setLayout] = _react.default.useState(null);
16
18
 
@@ -41,25 +43,6 @@ const AspectRatio = props => {
41
43
  }
42
44
  }
43
45
 
44
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, { ...props,
45
- style: style,
46
- onLayout: _ref => {
47
- let {
48
- nativeEvent: {
49
- layout: l
50
- }
51
- } = _ref;
52
- return setLayout(l);
53
- }
54
- }, props.children);
55
- };
56
-
57
- var _default = AspectRatio;
58
- exports.default = _default;
59
- });
60
- }
61
- }
62
-
63
46
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, props, {
64
47
  style: style,
65
48
  onLayout: _ref => {
@@ -21,6 +21,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
21
21
 
22
22
  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; }
23
23
 
24
+ 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); }
25
+
24
26
  const ELEVATION = 1;
25
27
  const DEFAULT_MAX_WIDTH = 960;
26
28
 
@@ -92,9 +94,9 @@ const Banner = _ref => {
92
94
 
93
95
  const translateY = _reactNative.Animated.multiply(_reactNative.Animated.add(position, -1), layout.height);
94
96
 
95
- return /*#__PURE__*/React.createElement(_Surface.default, { ...rest,
97
+ return /*#__PURE__*/React.createElement(_Surface.default, _extends({}, rest, {
96
98
  style: [styles.container, (0, _shadow.default)(ELEVATION), style]
97
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
99
+ }), /*#__PURE__*/React.createElement(_reactNative.View, {
98
100
  style: [styles.wrapper, contentStyle]
99
101
  }, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
100
102
  style: {
@@ -176,26 +178,4 @@ const styles = _reactNative.StyleSheet.create({
176
178
 
177
179
  var _default = (0, _theming.withTheme)(Banner);
178
180
 
179
- exports.default = _default;ow",
180
- justifyContent: "flex-start",
181
- marginHorizontal: 8,
182
- marginTop: 16,
183
- marginBottom: 0
184
- },
185
- icon: {
186
- margin: 8
187
- },
188
- message: {
189
- flex: 1,
190
- margin: 8
191
- },
192
- actions: {
193
- flexDirection: "row",
194
- justifyContent: "flex-end",
195
- margin: 8
196
- }
197
- });
198
-
199
- var _default = (0, _theming.withTheme)(Banner);
200
-
201
181
  exports.default = _default;
@@ -25,6 +25,8 @@ var _Config = _interopRequireDefault(require("./Config"));
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
28
+ 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); }
29
+
28
30
  const ICON_CONTAINER_SIZE = _Config.default.cardIconSize * 2;
29
31
  const ICON_CONTAINER_PADDING = _Config.default.cardIconSize / 2 - 1;
30
32
 
@@ -63,12 +65,11 @@ const CardContainerRating = _ref => {
63
65
  break;
64
66
  }
65
67
 
66
- return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, {
68
+ return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, _extends({
67
69
  style: style,
68
70
  onPress: onPress,
69
- numColumns: numColumns,
70
- ...rest
71
- }, /*#__PURE__*/_react.default.createElement(_Elevation.default, {
71
+ numColumns: numColumns
72
+ }, rest), /*#__PURE__*/_react.default.createElement(_Elevation.default, {
72
73
  style: {
73
74
  elevation,
74
75
  borderRadius: roundness
@@ -147,15 +148,4 @@ const CardContainerRating = _ref => {
147
148
 
148
149
  var _default = (0, _theming.withTheme)(CardContainerRating);
149
150
 
150
- exports.default = _default;or.default)(colors.strong).alpha(_Config.default.cardIconBackgroundOpacity).rgb().string()
151
- }
152
- }, /*#__PURE__*/_react.default.createElement(Icon, {
153
- name: icon,
154
- size: _Config.default.cardIconSize,
155
- color: colors.surface
156
- })) : null)));
157
- };
158
-
159
- var _default = (0, _theming.withTheme)(CardContainerRating);
160
-
161
151
  exports.default = _default;
@@ -21,6 +21,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
21
21
 
22
22
  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; }
23
23
 
24
+ 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); }
25
+
24
26
  const Checkbox = _ref => {
25
27
  let {
26
28
  Icon,
@@ -71,7 +73,7 @@ const Checkbox = _ref => {
71
73
  }
72
74
  };
73
75
 
74
- return /*#__PURE__*/React.createElement(_Touchable.default, { ...rest,
76
+ return /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
75
77
  onPress: handlePress,
76
78
  disabled: disabled,
77
79
  accessibilityState: {
@@ -83,7 +85,7 @@ const Checkbox = _ref => {
83
85
  width: size,
84
86
  height: size
85
87
  }]
86
- }, /*#__PURE__*/React.createElement(Icon, {
88
+ }), /*#__PURE__*/React.createElement(Icon, {
87
89
  style: styles.icon,
88
90
  name: internalValue ? checkedIcon : uncheckedIcon,
89
91
  size: size,
@@ -8,7 +8,7 @@ exports.useCheckboxGroupContext = useCheckboxGroupContext;
8
8
 
9
9
  var _react = require("react");
10
10
 
11
- var Direction;
11
+ let Direction;
12
12
  exports.Direction = Direction;
13
13
 
14
14
  (function (Direction) {
@@ -27,6 +27,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
27
27
 
28
28
  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; }
29
29
 
30
+ 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); }
31
+
30
32
  const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
31
33
 
32
34
  const FOCUS_ANIMATION_DURATION = 150;
@@ -282,9 +284,9 @@ const DatePicker = _ref => {
282
284
  pointerEvents: "none"
283
285
  }, /*#__PURE__*/React.createElement(_reactNative.View, {
284
286
  style: [styles.container, style]
285
- }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, { ...leftIconProps,
287
+ }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
286
288
  style: leftIconStyle
287
- }) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
289
+ })) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
288
290
  style: [containerStyle, style ? {
289
291
  height: style.height
290
292
  } : {}]
@@ -332,11 +334,11 @@ const DatePicker = _ref => {
332
334
  opacity: hasActiveOutline ? labeled : 1
333
335
  }],
334
336
  numberOfLines: 1
335
- }, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, { ...leftIconProps,
337
+ }, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
336
338
  style: { ...leftIconStyle,
337
339
  marginLeft: type === "solid" ? 16 : 0
338
340
  }
339
- }) : null, /*#__PURE__*/React.createElement(_reactNative.TextInput, {
341
+ })) : null, /*#__PURE__*/React.createElement(_reactNative.TextInput, _extends({
340
342
  value: formatDate(),
341
343
  placeholder: label ? placeholder1 : placeholder,
342
344
  editable: !disabled,
@@ -345,9 +347,8 @@ const DatePicker = _ref => {
345
347
  onFocus: _handleFocus,
346
348
  onBlur: _handleBlur,
347
349
  underlineColorAndroid: "transparent",
348
- style: inputStyles,
349
- ...props
350
- })), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
350
+ style: inputStyles
351
+ }, props))), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
351
352
  name: rightIconName,
352
353
  size: ICON_SIZE,
353
354
  color: colors.light,
@@ -15,6 +15,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
15
15
 
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
 
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
20
  const IconButton = _ref => {
19
21
  let {
20
22
  Icon,
@@ -29,7 +31,7 @@ const IconButton = _ref => {
29
31
  ...props
30
32
  } = _ref;
31
33
  const iconColor = customColor || theme.colors.primary;
32
- return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
34
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
33
35
  onPress: onPress,
34
36
  disabled: disabled || loading,
35
37
  style: _ref2 => {
@@ -43,9 +45,8 @@ const IconButton = _ref => {
43
45
  alignItems: "center",
44
46
  justifyContent: "center"
45
47
  }, style];
46
- },
47
- ...props
48
- }, /*#__PURE__*/React.createElement(_reactNative.View, null, icon && !loading ? /*#__PURE__*/React.createElement(Icon, {
48
+ }
49
+ }, props), /*#__PURE__*/React.createElement(_reactNative.View, null, icon && !loading ? /*#__PURE__*/React.createElement(Icon, {
49
50
  name: icon,
50
51
  size: size - 2,
51
52
  color: iconColor
@@ -70,22 +71,4 @@ const styles = _reactNative.StyleSheet.create({
70
71
 
71
72
  var _default = (0, _theming.withTheme)(IconButton);
72
73
 
73
- exports.default = _default;) : null));
74
- };
75
-
76
- const styles = _reactNative.StyleSheet.create({
77
- container: {
78
- alignItems: "center",
79
- justifyContent: "center",
80
- ..._reactNative.Platform.select({
81
- web: {
82
- cursor: "pointer",
83
- userSelect: "none"
84
- }
85
- })
86
- }
87
- });
88
-
89
- var _default = (0, _theming.withTheme)(IconButton);
90
-
91
74
  exports.default = _default;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var React = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNativeMarkdownPackage = _interopRequireDefault(require("react-native-markdown-package"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
+
18
+ // @ts-ignore
19
+ const MarkdownComponent = _ref => {
20
+ let {
21
+ content
22
+ } = _ref;
23
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_reactNativeMarkdownPackage.default, {
24
+ styles: markdownStyle
25
+ }, content));
26
+ };
27
+
28
+ const markdownStyle = {
29
+ singleLineMd: {},
30
+ collectiveMd: {}
31
+ };
32
+ var _default = MarkdownComponent;
33
+ exports.default = _default;
@@ -27,7 +27,11 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
27
27
 
28
28
  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; }
29
29
 
30
+ 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); }
31
+
30
32
  const Picker = _ref => {
33
+ var _options$find$label, _options$find;
34
+
31
35
  let {
32
36
  style,
33
37
  options,
@@ -37,9 +41,6 @@ const Picker = _ref => {
37
41
  onValueChange: onValueChangeOverride = () => {},
38
42
  ...props
39
43
  } = _ref;
40
-
41
- var _a, _b;
42
-
43
44
  const {
44
45
  viewStyles: {
45
46
  borderRadius,
@@ -86,7 +87,7 @@ const Picker = _ref => {
86
87
  };
87
88
 
88
89
  const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
89
- 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);
90
+ 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);
90
91
  return /*#__PURE__*/React.createElement(_Touchable.default, {
91
92
  disabled: disabled,
92
93
  onPress: toggleFocus,
@@ -111,26 +112,6 @@ const Picker = _ref => {
111
112
  key: o.value
112
113
  }))), /*#__PURE__*/React.createElement(_reactNative.View, {
113
114
  pointerEvents: "none"
114
- }, /*#__PURE__*/React.createElement(_TextField.default, { ...props,
115
- value: selectedLabel,
116
- placeholder: placeholder,
117
- // @ts-ignore
118
- ref: textField,
119
- disabled: disabled,
120
- // @ts-expect-error
121
- style: stylesWithoutMargin
122
- }))));
123
- };
124
-
125
- const styles = _reactNative.StyleSheet.create({
126
- container: {
127
- alignSelf: "stretch"
128
- }
129
- });
130
-
131
- var _default = (0, _theming.withTheme)(Picker);
132
-
133
- exports.default = _default; pointerEvents: "none"
134
115
  }, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
135
116
  value: selectedLabel,
136
117
  placeholder: placeholder // @ts-ignore
@@ -13,26 +13,29 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
13
13
 
14
14
  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; }
15
15
 
16
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+
16
18
  /**
17
19
  * Portal host is the component which actually renders all Portals.
18
20
  */
19
21
  class PortalManager extends React.PureComponent {
20
22
  constructor() {
21
23
  super(...arguments);
22
- this.state = {
24
+
25
+ _defineProperty(this, "state", {
23
26
  portals: []
24
- };
27
+ });
25
28
 
26
- this.mount = (key, children) => {
29
+ _defineProperty(this, "mount", (key, children) => {
27
30
  this.setState(state => ({
28
31
  portals: [...state.portals, {
29
32
  key,
30
33
  children
31
34
  }]
32
35
  }));
33
- };
36
+ });
34
37
 
35
- this.update = (key, children) => this.setState(state => ({
38
+ _defineProperty(this, "update", (key, children) => this.setState(state => ({
36
39
  portals: state.portals.map(item => {
37
40
  if (item.key === key) {
38
41
  return { ...item,
@@ -42,11 +45,11 @@ class PortalManager extends React.PureComponent {
42
45
 
43
46
  return item;
44
47
  })
45
- }));
48
+ })));
46
49
 
47
- this.unmount = key => this.setState(state => ({
50
+ _defineProperty(this, "unmount", key => this.setState(state => ({
48
51
  portals: state.portals.filter(item => item.key !== key)
49
- }));
52
+ })));
50
53
  }
51
54
 
52
55
  render() {
@@ -68,15 +71,4 @@ class PortalManager extends React.PureComponent {
68
71
 
69
72
  }
70
73
 
71
- exports.default = PortalManager;le: false
72
- /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */
73
- ,
74
- pointerEvents: "box-none",
75
- style: _reactNative.StyleSheet.absoluteFill
76
- }, children);
77
- });
78
- }
79
-
80
- }
81
-
82
74
  exports.default = PortalManager;
@@ -17,6 +17,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
17
17
 
18
18
  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; }
19
19
 
20
+ 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); }
21
+
20
22
  const {
21
23
  Provider
22
24
  } = _context.radioButtonGroupContext;
@@ -61,24 +63,9 @@ const RadioButtonGroup = _ref => {
61
63
  });
62
64
  }
63
65
 
64
- return /*#__PURE__*/React.createElement(_reactNative.View, {
66
+ return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
65
67
  style: [{
66
68
  minHeight: 40
67
- }, style],
68
- ...rest
69
- }, /*#__PURE__*/React.createElement(Provider, {
70
- value: {
71
- value: internalValue,
72
- onValueChange: handleValueChange,
73
- direction
74
- }
75
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
76
- style: _containerStyle
77
- }, children)));
78
- };
79
-
80
- var _default = RadioButtonGroup;
81
- exports.default = _default;0
82
69
  }, style]
83
70
  }, rest), /*#__PURE__*/React.createElement(Provider, {
84
71
  value: {
@@ -25,7 +25,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
25
 
26
26
  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; }
27
27
 
28
- var Direction;
28
+ 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); }
29
+
30
+ let Direction;
29
31
  exports.Direction = Direction;
30
32
 
31
33
  (function (Direction) {
@@ -88,14 +90,13 @@ const RadioButtonRow = _ref => {
88
90
  textStyles,
89
91
  viewStyles
90
92
  } = (0, _utilities.extractStyles)(style);
91
- return /*#__PURE__*/React.createElement(_Touchable.default, {
93
+ return /*#__PURE__*/React.createElement(_Touchable.default, _extends({
92
94
  onPress: handlePress,
93
95
  style: [styles.mainParent, {
94
96
  flexDirection: direction
95
97
  }, viewStyles],
96
- disabled: disabled,
97
- ...rest
98
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
98
+ disabled: disabled
99
+ }, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
99
100
  style: [styles.label, {
100
101
  alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
101
102
  }, labelContainerStyle]
@@ -134,24 +135,5 @@ const styles = _reactNative.StyleSheet.create({
134
135
  }
135
136
  });
136
137
 
137
- var _default = RadioButtonRow;
138
- exports.default = _default; "center",
139
- justifyContent: "space-around",
140
- paddingStart: 20,
141
- minHeight: 50,
142
- paddingEnd: 20,
143
- display: "flex",
144
- ..._reactNative.Platform.select({
145
- web: {
146
- cursor: "pointer",
147
- userSelect: "none"
148
- }
149
- })
150
- },
151
- label: {
152
- flex: 3
153
- }
154
- });
155
-
156
138
  var _default = RadioButtonRow;
157
139
  exports.default = _default;
@@ -23,6 +23,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
23
23
 
24
24
  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; }
25
25
 
26
+ 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); }
27
+
26
28
  function maybeParseValue(value) {
27
29
  if (value === undefined) {
28
30
  return undefined;
@@ -89,10 +91,9 @@ function Slider(_ref) {
89
91
  onValueChange(newValue);
90
92
  };
91
93
 
92
- return /*#__PURE__*/React.createElement(_reactNative.View, {
93
- style: [styles.container, style],
94
- ...rest
95
- }, leftIcon ? /*#__PURE__*/React.createElement(Icon, {
94
+ return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
95
+ style: [styles.container, style]
96
+ }, rest), leftIcon ? /*#__PURE__*/React.createElement(Icon, {
96
97
  color: leftIconThemeColor,
97
98
  name: leftIcon,
98
99
  size: 24
@@ -128,24 +129,4 @@ const styles = _reactNative.StyleSheet.create({
128
129
 
129
130
  var _default = (0, _theming.withTheme)(Slider);
130
131
 
131
- exports.default = _default;: rightIconThemeColor,
132
- name: rightIcon,
133
- size: 24
134
- }) : null);
135
- }
136
-
137
- const styles = _reactNative.StyleSheet.create({
138
- container: {
139
- height: 40,
140
- flexDirection: "row",
141
- alignItems: "center"
142
- },
143
- slider: {
144
- flex: 1,
145
- marginHorizontal: 12
146
- }
147
- });
148
-
149
- var _default = (0, _theming.withTheme)(Slider);
150
-
151
132
  exports.default = _default;
@@ -23,8 +23,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
23
23
 
24
24
  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; }
25
25
 
26
- 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); }
27
-
28
26
  function Switch(_ref) {
29
27
  let {
30
28
  value,
@@ -57,23 +55,24 @@ function Switch(_ref) {
57
55
  setChecked(Boolean(defaultValue));
58
56
  }
59
57
  }, [defaultValue, previousDefaultValue]);
60
- return /*#__PURE__*/React.createElement(_reactNative.Switch, _extends({
58
+ return /*#__PURE__*/React.createElement(_reactNative.Switch, {
61
59
  value: checked,
62
60
  disabled: disabled,
63
61
  trackColor: {
64
62
  false: inactiveTrackThemeColor,
65
63
  true: activeTrackThemeColor
66
64
  },
67
- thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor // @ts-ignore react-native-web only
68
- ,
65
+ thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor,
66
+ // @ts-ignore react-native-web only
69
67
  activeThumbColor: activeThumbThemeColor,
70
68
  ios_backgroundColor: inactiveTrackThemeColor,
71
69
  style: style,
72
70
  onValueChange: bool => {
73
71
  setChecked(bool);
74
72
  onValueChange && onValueChange(bool);
75
- }
76
- }, rest));
73
+ },
74
+ ...rest
75
+ });
77
76
  }
78
77
 
79
78
  function Row(_ref2) {
@@ -103,7 +102,7 @@ function Row(_ref2) {
103
102
  setChecked(defaultValue);
104
103
  }
105
104
  }, [defaultValue]);
106
- return /*#__PURE__*/React.createElement(_FormRow.default, _extends({
105
+ return /*#__PURE__*/React.createElement(_FormRow.default, {
107
106
  disabled: disabled,
108
107
  onPress: () => {
109
108
  setChecked(!checked);
@@ -111,8 +110,9 @@ function Row(_ref2) {
111
110
  },
112
111
  label: label,
113
112
  direction: direction,
114
- style: style
115
- }, rest), /*#__PURE__*/React.createElement(Switch, {
113
+ style: style,
114
+ ...rest
115
+ }, /*#__PURE__*/React.createElement(Switch, {
116
116
  theme: theme,
117
117
  value: checked,
118
118
  disabled: disabled,
@@ -129,4 +129,17 @@ exports.SwitchRow = SwitchRow;
129
129
 
130
130
  var _default = (0, _theming.withTheme)(Switch);
131
131
 
132
+ exports.default = _default;onValueChange,
133
+ activeTrackColor: activeTrackColor,
134
+ inactiveTrackColor: inactiveTrackColor,
135
+ activeThumbColor: activeThumbColor,
136
+ inactiveThumbColor: inactiveThumbColor
137
+ }));
138
+ }
139
+
140
+ const SwitchRow = (0, _theming.withTheme)(Row);
141
+ exports.SwitchRow = SwitchRow;
142
+
143
+ var _default = (0, _theming.withTheme)(Switch);
144
+
132
145
  exports.default = _default;
@@ -213,6 +213,12 @@ Object.defineProperty(exports, "Link", {
213
213
  return _Text.Link;
214
214
  }
215
215
  });
216
+ Object.defineProperty(exports, "Markdown", {
217
+ enumerable: true,
218
+ get: function () {
219
+ return _Markdown.default;
220
+ }
221
+ });
216
222
  Object.defineProperty(exports, "NumberInput", {
217
223
  enumerable: true,
218
224
  get: function () {
@@ -512,6 +518,8 @@ var _Stepper = _interopRequireDefault(require("./components/Stepper"));
512
518
 
513
519
  var _useAuthState = require("./components/useAuthState");
514
520
 
521
+ var _Markdown = _interopRequireDefault(require("./components/Markdown"));
522
+
515
523
  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); }
516
524
 
517
525
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SEED_DATA = void 0;
7
+
8
+ var _types = require("@draftbit/types");
9
+
10
+ const SEED_DATA = {
11
+ name: "Markdown",
12
+ tag: "MarkdownComponent",
13
+ description: "A markdown component",
14
+ category: _types.COMPONENT_TYPES.basic,
15
+ props: {
16
+ content: (0, _types.createTextProp)({
17
+ label: "Markdown Text",
18
+ description: "Markdown Text",
19
+ defaultValue: null
20
+ })
21
+ }
22
+ };
23
+ exports.SEED_DATA = SEED_DATA;
@@ -1,3 +1,5 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
1
3
  import * as React from "react";
2
4
  import { Animated, Easing } from "react-native";
3
5
  import CircularProgress from "./CircularProgress";
@@ -46,20 +48,6 @@ const AnimatedCircularProgress = _ref => {
46
48
  return tintAnimation;
47
49
  };
48
50
 
49
- React.useEffect(() => {
50
- animate();
51
- }, [fill, animate]);
52
- return /*#__PURE__*/React.createElement(AnimatedProgress, { ...other,
53
- style: other.style,
54
- childrenContainerStyle: other.childrenContainerStyle,
55
- fill: fillAnimation,
56
- tintColor: animateColor()
57
- });
58
- };
59
-
60
- export default AnimatedCircularProgress;tAnimation;
61
- };
62
-
63
51
  React.useEffect(() => {
64
52
  animate();
65
53
  }, [fill, animate]);
@@ -0,0 +1,18 @@
1
+ import * as React from "react"; // @ts-ignore
2
+
3
+ import Markdown from "react-native-markdown-package";
4
+
5
+ const MarkdownComponent = _ref => {
6
+ let {
7
+ content
8
+ } = _ref;
9
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Markdown, {
10
+ styles: markdownStyle
11
+ }, content));
12
+ };
13
+
14
+ const markdownStyle = {
15
+ singleLineMd: {},
16
+ collectiveMd: {}
17
+ };
18
+ export default MarkdownComponent;
@@ -50,4 +50,5 @@ export { default as RowHeadlineImageCaption } from "./components/RowHeadlineImag
50
50
  export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIcon";
51
51
  export { default as Slider } from "./components/Slider";
52
52
  export { default as Stepper } from "./components/Stepper";
53
- export { useAuthState } from "./components/useAuthState"; // a comment to fix sourcemap comment issue
53
+ export { useAuthState } from "./components/useAuthState";
54
+ export { default as Markdown } from "./components/Markdown"; // a comment to fix sourcemap comment issue
@@ -0,0 +1,14 @@
1
+ import { COMPONENT_TYPES, createTextProp } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Markdown",
4
+ tag: "MarkdownComponent",
5
+ description: "A markdown component",
6
+ category: COMPONENT_TYPES.basic,
7
+ props: {
8
+ content: createTextProp({
9
+ label: "Markdown Text",
10
+ description: "Markdown Text",
11
+ defaultValue: null
12
+ })
13
+ }
14
+ };
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ content?: string;
4
+ };
5
+ declare const MarkdownComponent: React.FC<Props>;
6
+ export default MarkdownComponent;
@@ -49,3 +49,4 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
49
49
  export { default as Slider } from "./components/Slider";
50
50
  export { default as Stepper } from "./components/Stepper";
51
51
  export { useAuthState } from "./components/useAuthState";
52
+ export { default as Markdown } from "./components/Markdown";
@@ -0,0 +1,9 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ description: string;
5
+ category: string;
6
+ props: {
7
+ content: any;
8
+ };
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-1c9faf.10+1c9faf7a",
3
+ "version": "46.2.4-1cc3fe.10+1cc3fe90",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -46,13 +46,14 @@
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.3",
48
48
  "@react-native-picker/picker": "2.4.2",
49
- "@shopify/flash-list": "1.2.0",
50
49
  "color": "^3.1.2",
51
50
  "date-fns": "^2.16.1",
52
51
  "dateformat": "^3.0.3",
53
52
  "lodash.isnumber": "^3.0.3",
54
53
  "lodash.omit": "^4.5.0",
55
54
  "lodash.tonumber": "^4.0.3",
55
+ "react-native-markdown-display": "^7.0.0-alpha.2",
56
+ "react-native-markdown-package": "^1.8.2",
56
57
  "react-native-modal-datetime-picker": "^13.0.0",
57
58
  "react-native-svg": "12.3.0",
58
59
  "react-native-typography": "^1.4.1",
@@ -81,5 +82,5 @@
81
82
  ]
82
83
  ]
83
84
  },
84
- "gitHead": "1c9faf7a80be4e19ec962f91ca3c4f1a8d992804"
85
+ "gitHead": "1cc3fe901a296f97d52f51d54c27f4f07fcf09e3"
85
86
  }
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ // @ts-ignore
3
+ import Markdown from "react-native-markdown-package";
4
+ const MarkdownComponent = ({ content }) => {
5
+ return (React.createElement(React.Fragment, null,
6
+ React.createElement(Markdown, { styles: markdownStyle }, content)));
7
+ };
8
+ const markdownStyle = {
9
+ singleLineMd: {},
10
+ collectiveMd: {},
11
+ };
12
+ export default MarkdownComponent;
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ // @ts-ignore
3
+ import Markdown from "react-native-markdown-package";
4
+
5
+ type Props = {
6
+ content?: string;
7
+ };
8
+
9
+ const MarkdownComponent: React.FC<Props> = ({ content }) => {
10
+ return (
11
+ <>
12
+ {
13
+ // @ts-ignore
14
+ }
15
+ <Markdown styles={markdownStyle}>{content}</Markdown>
16
+ </>
17
+ );
18
+ };
19
+
20
+ const markdownStyle = {
21
+ singleLineMd: {},
22
+ collectiveMd: {},
23
+ };
24
+
25
+ export default MarkdownComponent;
package/src/index.js CHANGED
@@ -50,4 +50,5 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
50
50
  export { default as Slider } from "./components/Slider";
51
51
  export { default as Stepper } from "./components/Stepper";
52
52
  export { useAuthState } from "./components/useAuthState";
53
+ export { default as Markdown } from "./components/Markdown";
53
54
  // a comment to fix sourcemap comment issue
package/src/index.tsx CHANGED
@@ -70,5 +70,6 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
70
70
  export { default as Slider } from "./components/Slider";
71
71
  export { default as Stepper } from "./components/Stepper";
72
72
  export { useAuthState } from "./components/useAuthState";
73
+ export { default as Markdown } from "./components/Markdown";
73
74
 
74
75
  // a comment to fix sourcemap comment issue
@@ -0,0 +1,14 @@
1
+ import { COMPONENT_TYPES, createTextProp } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Markdown",
4
+ tag: "MarkdownComponent",
5
+ description: "A markdown component",
6
+ category: COMPONENT_TYPES.basic,
7
+ props: {
8
+ content: createTextProp({
9
+ label: "Markdown Text",
10
+ description: "Markdown Text",
11
+ defaultValue: null,
12
+ }),
13
+ },
14
+ };
@@ -0,0 +1,15 @@
1
+ import { COMPONENT_TYPES, createTextProp } from "@draftbit/types";
2
+
3
+ export const SEED_DATA = {
4
+ name: "Markdown",
5
+ tag: "MarkdownComponent",
6
+ description: "A markdown component",
7
+ category: COMPONENT_TYPES.basic,
8
+ props: {
9
+ content: createTextProp({
10
+ label: "Markdown Text",
11
+ description: "Markdown Text",
12
+ defaultValue: null,
13
+ }),
14
+ },
15
+ };
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SEED_DATA = void 0;
7
-
8
- var _types = require("@draftbit/types");
9
-
10
- const SEED_DATA = {
11
- name: "FlashList",
12
- tag: "FlashList",
13
- description: "Flashlist by Shopify",
14
- packageName: "@shopify/flash-list",
15
- category: _types.COMPONENT_TYPES.data,
16
- stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
17
- layout: {
18
- flex: 1
19
- },
20
- props: {
21
- estimatedItemSize: (0, _types.createNumberProp)({
22
- group: _types.GROUPS.basic,
23
- label: "Est. Item Size",
24
- description: "Approximate size of the items before rendering.",
25
- defaultValue: 50,
26
- step: 1,
27
- precision: 0
28
- }),
29
- horizontal: (0, _types.createStaticBoolProp)({
30
- label: "Horizontal",
31
- description: "Render list horizontally"
32
- }),
33
- inverted: (0, _types.createStaticBoolProp)({
34
- label: "Inverted",
35
- description: "If true, reverses the direction."
36
- }),
37
- numColumns: (0, _types.createNumColumnsType)({
38
- editable: true
39
- })
40
- }
41
- };
42
- exports.SEED_DATA = SEED_DATA;
@@ -1,33 +0,0 @@
1
- import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "FlashList",
4
- tag: "FlashList",
5
- description: "Flashlist by Shopify",
6
- packageName: "@shopify/flash-list",
7
- category: COMPONENT_TYPES.data,
8
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
9
- layout: {
10
- flex: 1
11
- },
12
- props: {
13
- estimatedItemSize: createNumberProp({
14
- group: GROUPS.basic,
15
- label: "Est. Item Size",
16
- description: "Approximate size of the items before rendering.",
17
- defaultValue: 50,
18
- step: 1,
19
- precision: 0
20
- }),
21
- horizontal: createStaticBoolProp({
22
- label: "Horizontal",
23
- description: "Render list horizontally"
24
- }),
25
- inverted: createStaticBoolProp({
26
- label: "Inverted",
27
- description: "If true, reverses the direction."
28
- }),
29
- numColumns: createNumColumnsType({
30
- editable: true
31
- })
32
- }
33
- };
@@ -1,54 +0,0 @@
1
- export declare const SEED_DATA: {
2
- name: string;
3
- tag: string;
4
- description: string;
5
- packageName: string;
6
- category: string;
7
- stylesPanelSections: string[];
8
- layout: {
9
- flex: number;
10
- };
11
- props: {
12
- estimatedItemSize: {
13
- label: string;
14
- description: string;
15
- formType: string;
16
- propType: string;
17
- group: string;
18
- defaultValue: null;
19
- editable: boolean;
20
- required: boolean;
21
- step: number;
22
- };
23
- horizontal: {
24
- label: string;
25
- description: string;
26
- formType: string;
27
- propType: string;
28
- defaultValue: boolean;
29
- editable: boolean;
30
- required: boolean;
31
- group: string;
32
- };
33
- inverted: {
34
- label: string;
35
- description: string;
36
- formType: string;
37
- propType: string;
38
- defaultValue: boolean;
39
- editable: boolean;
40
- required: boolean;
41
- group: string;
42
- };
43
- numColumns: {
44
- label: string;
45
- description: string;
46
- group: string;
47
- formType: string;
48
- propType: string;
49
- defaultValue: number;
50
- editable: boolean;
51
- required: boolean;
52
- };
53
- };
54
- };
@@ -1,33 +0,0 @@
1
- import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "FlashList",
4
- tag: "FlashList",
5
- description: "Flashlist by Shopify",
6
- packageName: "@shopify/flash-list",
7
- category: COMPONENT_TYPES.data,
8
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
9
- layout: {
10
- flex: 1,
11
- },
12
- props: {
13
- estimatedItemSize: createNumberProp({
14
- group: GROUPS.basic,
15
- label: "Est. Item Size",
16
- description: "Approximate size of the items before rendering.",
17
- defaultValue: 50,
18
- step: 1,
19
- precision: 0,
20
- }),
21
- horizontal: createStaticBoolProp({
22
- label: "Horizontal",
23
- description: "Render list horizontally",
24
- }),
25
- inverted: createStaticBoolProp({
26
- label: "Inverted",
27
- description: "If true, reverses the direction.",
28
- }),
29
- numColumns: createNumColumnsType({
30
- editable: true,
31
- }),
32
- },
33
- };
@@ -1,41 +0,0 @@
1
- import {
2
- COMPONENT_TYPES,
3
- createNumColumnsType,
4
- createStaticBoolProp,
5
- createNumberProp,
6
- CONTAINER_COMPONENT_STYLES_SECTIONS,
7
- GROUPS,
8
- } from "@draftbit/types";
9
-
10
- export const SEED_DATA = {
11
- name: "FlashList",
12
- tag: "FlashList",
13
- description: "Flashlist by Shopify",
14
- packageName: "@shopify/flash-list",
15
- category: COMPONENT_TYPES.data,
16
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
17
- layout: {
18
- flex: 1,
19
- },
20
- props: {
21
- estimatedItemSize: createNumberProp({
22
- group: GROUPS.basic,
23
- label: "Est. Item Size",
24
- description: "Approximate size of the items before rendering.",
25
- defaultValue: 50,
26
- step: 1,
27
- precision: 0,
28
- }),
29
- horizontal: createStaticBoolProp({
30
- label: "Horizontal",
31
- description: "Render list horizontally",
32
- }),
33
- inverted: createStaticBoolProp({
34
- label: "Inverted",
35
- description: "If true, reverses the direction.",
36
- }),
37
- numColumns: createNumColumnsType({
38
- editable: true,
39
- }),
40
- },
41
- };