@draftbit/core 46.2.4-7028ac.5 → 46.2.4-70e86e.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 (49) hide show
  1. package/lib/commonjs/components/CardContainer.js +5 -15
  2. package/lib/commonjs/components/CircleImage.js +2 -16
  3. package/lib/commonjs/components/DeprecatedButton.js +4 -22
  4. package/lib/commonjs/components/IconButton.js +5 -22
  5. package/lib/commonjs/components/Image.js +3 -16
  6. package/lib/commonjs/components/Markdown.js +78 -0
  7. package/lib/commonjs/components/Portal/Portal.js +3 -12
  8. package/lib/commonjs/components/Portal/PortalConsumer.js +8 -10
  9. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +6 -24
  10. package/lib/commonjs/components/RadioButton/context.js +1 -1
  11. package/lib/commonjs/components/StarRating.js +0 -1
  12. package/lib/commonjs/components/Switch.js +10 -23
  13. package/lib/commonjs/constants.js +1 -1
  14. package/lib/commonjs/index.js +8 -0
  15. package/lib/commonjs/mappings/Markdown.js +23 -0
  16. package/lib/commonjs/mappings/SVG.js +0 -1
  17. package/lib/module/components/Banner.js +4 -24
  18. package/lib/module/components/CardBlock.js +5 -15
  19. package/lib/module/components/Checkbox/CheckboxGroup.js +3 -17
  20. package/lib/module/components/DeprecatedCardWrapper.js +2 -19
  21. package/lib/module/components/IconButton.js +5 -22
  22. package/lib/module/components/Markdown.js +63 -0
  23. package/lib/module/components/Picker/PickerComponent.android.js +5 -23
  24. package/lib/module/components/Picker/PickerComponent.web.js +5 -23
  25. package/lib/module/components/ProgressBar.js +7 -23
  26. package/lib/module/components/StarRating.js +5 -25
  27. package/lib/module/components/Surface.js +2 -16
  28. package/lib/module/components/Text.js +10 -33
  29. package/lib/module/components/TextField.js +30 -62
  30. package/lib/module/components/Touchable.js +2 -18
  31. package/lib/module/constants.js +0 -1
  32. package/lib/module/index.js +2 -1
  33. package/lib/module/mappings/Markdown.js +14 -0
  34. package/lib/module/mappings/SVG.js +0 -1
  35. package/lib/typescript/src/components/Markdown.d.ts +6 -0
  36. package/lib/typescript/src/index.d.ts +1 -0
  37. package/lib/typescript/src/mappings/Markdown.d.ts +9 -0
  38. package/lib/typescript/src/mappings/SVG.d.ts +0 -1
  39. package/package.json +6 -4
  40. package/src/components/Markdown.js +57 -0
  41. package/src/components/Markdown.tsx +70 -0
  42. package/src/components/StarRating.js +0 -1
  43. package/src/components/StarRating.tsx +0 -1
  44. package/src/index.js +1 -0
  45. package/src/index.tsx +1 -0
  46. package/src/mappings/Markdown.js +14 -0
  47. package/src/mappings/Markdown.ts +15 -0
  48. package/src/mappings/SVG.js +0 -1
  49. package/src/mappings/SVG.ts +0 -1
@@ -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 React from "react";
2
4
  import { Pressable } from "react-native";
3
5
  export default function Touchable(_ref) {
@@ -8,24 +10,6 @@ export default function Touchable(_ref) {
8
10
  style,
9
11
  ...props
10
12
  } = _ref;
11
- return /*#__PURE__*/React.createElement(Pressable, {
12
- onPress: onPress,
13
- disabled: disabled,
14
- hitSlop: 8,
15
- style: _ref2 => {
16
- let {
17
- pressed
18
- } = _ref2;
19
- return [{
20
- opacity: pressed || disabled ? 0.75 : 1
21
- }, style];
22
- },
23
- ...props
24
- }, children);
25
- }s,
26
- style,
27
- ...props
28
- } = _ref;
29
13
  return /*#__PURE__*/React.createElement(Pressable, _extends({
30
14
  onPress: onPress,
31
15
  disabled: disabled,
@@ -5,5 +5,4 @@ const DEFAULT_STATUSBAR_HEIGHT_EXPO = expo !== null && expo !== void 0 && expo.C
5
5
  export const APPROX_STATUSBAR_HEIGHT = Platform.select({
6
6
  android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
7
7
  ios: Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
8
- });PO : 0
9
8
  });
@@ -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
+ };
@@ -3,7 +3,6 @@ export const SEED_DATA = {
3
3
  name: "SVG",
4
4
  tag: "SVG",
5
5
  description: "An SVG component",
6
- packageName: "@draftbit/core",
7
6
  category: COMPONENT_TYPES.media,
8
7
  layout: {
9
8
  width: 100,
@@ -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
+ };
@@ -2,7 +2,6 @@ export declare const SEED_DATA: {
2
2
  name: string;
3
3
  tag: string;
4
4
  description: string;
5
- packageName: string;
6
5
  category: string;
7
6
  layout: {
8
7
  width: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-7028ac.5+7028ac76",
3
+ "version": "46.2.4-70e86e.10+70e86e38",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^46.2.4-7028ac.5+7028ac76",
44
+ "@draftbit/types": "^46.3.0",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.3",
@@ -52,8 +52,10 @@
52
52
  "lodash.isnumber": "^3.0.3",
53
53
  "lodash.omit": "^4.5.0",
54
54
  "lodash.tonumber": "^4.0.3",
55
+ "react-native-markdown-display": "^7.0.0-alpha.2",
56
+ "react-native-markdown-package": "^1.8.2",
55
57
  "react-native-modal-datetime-picker": "^13.0.0",
56
- "react-native-svg": "^12.3.0",
58
+ "react-native-svg": "12.3.0",
57
59
  "react-native-typography": "^1.4.1",
58
60
  "react-native-web-swiper": "^2.2.3"
59
61
  },
@@ -80,5 +82,5 @@
80
82
  ]
81
83
  ]
82
84
  },
83
- "gitHead": "7028ac766b962df851f034e308568aee4df4376a"
85
+ "gitHead": "70e86e38470d1aa32cd3a90888166a0c61db9b1a"
84
86
  }
@@ -0,0 +1,57 @@
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.collectiveMd }, content)));
7
+ };
8
+ const markdownStyle = {
9
+ singleLineMd: {
10
+ text: {
11
+ color: "blue",
12
+ textAlign: "right",
13
+ },
14
+ view: {
15
+ alignSelf: "stretch",
16
+ },
17
+ },
18
+ collectiveMd: {
19
+ heading1: {
20
+ color: "red",
21
+ },
22
+ heading2: {
23
+ color: "green",
24
+ textAlign: "right",
25
+ },
26
+ strong: {
27
+ color: "blue",
28
+ },
29
+ em: {
30
+ color: "cyan",
31
+ },
32
+ text: {
33
+ color: "black",
34
+ },
35
+ blockQuoteText: {
36
+ color: "grey",
37
+ },
38
+ blockQuoteSection: {
39
+ flexDirection: "row",
40
+ },
41
+ blockQuoteSectionBar: {
42
+ width: 3,
43
+ height: null,
44
+ backgroundColor: "#DDDDDD",
45
+ marginRight: 15,
46
+ },
47
+ codeBlock: {
48
+ fontFamily: "Courier",
49
+ fontWeight: "500",
50
+ backgroundColor: "#DDDDDD",
51
+ },
52
+ tableHeader: {
53
+ backgroundColor: "grey",
54
+ },
55
+ },
56
+ };
57
+ export default MarkdownComponent;
@@ -0,0 +1,70 @@
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.collectiveMd}>{content}</Markdown>
16
+ </>
17
+ );
18
+ };
19
+
20
+ const markdownStyle = {
21
+ singleLineMd: {
22
+ text: {
23
+ color: "blue",
24
+ textAlign: "right",
25
+ },
26
+ view: {
27
+ alignSelf: "stretch",
28
+ },
29
+ },
30
+ collectiveMd: {
31
+ heading1: {
32
+ color: "red",
33
+ },
34
+ heading2: {
35
+ color: "green",
36
+ textAlign: "right",
37
+ },
38
+ strong: {
39
+ color: "blue",
40
+ },
41
+ em: {
42
+ color: "cyan",
43
+ },
44
+ text: {
45
+ color: "black",
46
+ },
47
+ blockQuoteText: {
48
+ color: "grey",
49
+ },
50
+ blockQuoteSection: {
51
+ flexDirection: "row",
52
+ },
53
+ blockQuoteSectionBar: {
54
+ width: 3,
55
+ height: null,
56
+ backgroundColor: "#DDDDDD",
57
+ marginRight: 15,
58
+ },
59
+ codeBlock: {
60
+ fontFamily: "Courier",
61
+ fontWeight: "500",
62
+ backgroundColor: "#DDDDDD",
63
+ },
64
+ tableHeader: {
65
+ backgroundColor: "grey",
66
+ },
67
+ },
68
+ };
69
+
70
+ export default MarkdownComponent;
@@ -27,7 +27,6 @@ const StarRating = ({ Icon, starSize = 16, maxStars = 5, rating = 0, defaultValu
27
27
  React.createElement(Pressable, { style: styles.pressable, onPress: () => ratingHandler(i + 1) }))))))));
28
28
  };
29
29
  const styles = StyleSheet.create({
30
- //comment!
31
30
  container: {
32
31
  flexDirection: "row",
33
32
  alignItems: "center",
@@ -94,7 +94,6 @@ const StarRating: React.FC<React.PropsWithChildren<Props>> = ({
94
94
  };
95
95
 
96
96
  const styles = StyleSheet.create({
97
- //comment!
98
97
  container: {
99
98
  flexDirection: "row",
100
99
  alignItems: "center",
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
+ };
@@ -3,7 +3,6 @@ export const SEED_DATA = {
3
3
  name: "SVG",
4
4
  tag: "SVG",
5
5
  description: "An SVG component",
6
- packageName: "@draftbit/core",
7
6
  category: COMPONENT_TYPES.media,
8
7
  layout: {
9
8
  width: 100,
@@ -8,7 +8,6 @@ export const SEED_DATA = {
8
8
  name: "SVG",
9
9
  tag: "SVG",
10
10
  description: "An SVG component",
11
- packageName: "@draftbit/core",
12
11
  category: COMPONENT_TYPES.media,
13
12
  layout: {
14
13
  width: 100,