@draftbit/core 46.2.4-99ac4e.1 → 46.2.4-a3e5f4.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 (56) hide show
  1. package/lib/commonjs/components/Config.js +1 -0
  2. package/lib/commonjs/components/DeprecatedButton.js +4 -22
  3. package/lib/commonjs/components/Markdown.js +33 -0
  4. package/lib/commonjs/components/Picker/PickerComponent.android.js +24 -5
  5. package/lib/commonjs/components/SVG.js +48 -0
  6. package/lib/commonjs/components/ScreenContainer.js +23 -5
  7. package/lib/commonjs/components/Slider.js +24 -5
  8. package/lib/commonjs/components/StepIndicator.js +34 -16
  9. package/lib/commonjs/components/Surface.js +14 -3
  10. package/lib/commonjs/components/Switch.js +23 -10
  11. package/lib/commonjs/components/Text.js +37 -11
  12. package/lib/commonjs/components/ToggleButton.js +18 -3
  13. package/lib/commonjs/components/Touchable.js +16 -2
  14. package/lib/commonjs/index.js +16 -0
  15. package/lib/commonjs/mappings/Image.js +2 -2
  16. package/lib/commonjs/mappings/MapView.js +1 -0
  17. package/lib/commonjs/mappings/Markdown.js +23 -0
  18. package/lib/commonjs/mappings/SVG.js +24 -0
  19. package/lib/module/components/CircularProgress.js +15 -7
  20. package/lib/module/components/Config.js +1 -0
  21. package/lib/module/components/FormRow.js +17 -3
  22. package/lib/module/components/Markdown.js +18 -0
  23. package/lib/module/components/Picker/PickerComponent.android.js +23 -5
  24. package/lib/module/components/ProgressBar.js +23 -7
  25. package/lib/module/components/SVG.js +31 -0
  26. package/lib/module/components/StepIndicator.js +33 -16
  27. package/lib/module/constants.js +1 -0
  28. package/lib/module/index.js +3 -1
  29. package/lib/module/mappings/Image.js +2 -2
  30. package/lib/module/mappings/MapView.js +1 -0
  31. package/lib/module/mappings/Markdown.js +14 -0
  32. package/lib/module/mappings/SVG.js +15 -0
  33. package/lib/typescript/src/components/Config.d.ts +1 -0
  34. package/lib/typescript/src/components/Markdown.d.ts +6 -0
  35. package/lib/typescript/src/components/SVG.d.ts +8 -0
  36. package/lib/typescript/src/index.d.ts +2 -0
  37. package/lib/typescript/src/mappings/MapView.d.ts +1 -0
  38. package/lib/typescript/src/mappings/Markdown.d.ts +9 -0
  39. package/lib/typescript/src/mappings/SVG.d.ts +23 -0
  40. package/package.json +6 -3
  41. package/src/components/Config.js +1 -0
  42. package/src/components/Config.ts +1 -0
  43. package/src/components/Markdown.js +12 -0
  44. package/src/components/Markdown.tsx +25 -0
  45. package/src/components/SVG.js +13 -0
  46. package/src/components/SVG.tsx +35 -0
  47. package/src/index.js +2 -0
  48. package/src/index.tsx +2 -0
  49. package/src/mappings/Image.js +2 -2
  50. package/src/mappings/Image.ts +2 -2
  51. package/src/mappings/MapView.js +1 -0
  52. package/src/mappings/MapView.ts +1 -0
  53. package/src/mappings/Markdown.js +14 -0
  54. package/src/mappings/Markdown.ts +15 -0
  55. package/src/mappings/SVG.js +20 -0
  56. package/src/mappings/SVG.ts +25 -0
@@ -0,0 +1,23 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ description: string;
5
+ category: string;
6
+ layout: {
7
+ width: number;
8
+ height: number;
9
+ };
10
+ stylesPanelSections: string[];
11
+ props: {
12
+ source: {
13
+ label: string;
14
+ description: string;
15
+ group: string;
16
+ formType: string;
17
+ propType: string;
18
+ defaultValue: string;
19
+ editable: boolean;
20
+ required: boolean;
21
+ };
22
+ };
23
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-99ac4e.1+99ac4ee6",
3
+ "version": "46.2.4-a3e5f4.10+a3e5f44e",
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.3",
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,7 +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",
58
+ "react-native-svg": "12.3.0",
56
59
  "react-native-typography": "^1.4.1",
57
60
  "react-native-web-swiper": "^2.2.3"
58
61
  },
@@ -79,5 +82,5 @@
79
82
  ]
80
83
  ]
81
84
  },
82
- "gitHead": "99ac4ee67b881abfe6746d634237cb9cf26051ac"
85
+ "gitHead": "a3e5f44e96bfbb9f31fe7d8e5ba06a2d8cc19238"
83
86
  }
@@ -42,6 +42,7 @@ export default {
42
42
  cardIconElevation: 1,
43
43
  placeholderImageURL: "https://static.draftbit.com/images/placeholder-image" + getExtension(),
44
44
  getPlaceholderImageUrl: (size) => buildImageUrl({ width: size.width, height: size.height }, "image-placeholder_1"),
45
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
45
46
  squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
46
47
  FABSize: 40,
47
48
  FABBorderRadius: 20,
@@ -60,6 +60,7 @@ export default {
60
60
  { width: size.width, height: size.height },
61
61
  "image-placeholder_1"
62
62
  ),
63
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
63
64
  squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
64
65
  FABSize: 40,
65
66
  FABBorderRadius: 20,
@@ -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;
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import { View, Platform, Image } from "react-native";
3
+ import { SvgUri } from "react-native-svg";
4
+ import Config from "./Config";
5
+ const SVG = ({ source = Config.placeholderSvgURL, style, }) => {
6
+ return (React.createElement(React.Fragment, null,
7
+ Platform.OS === "ios" && (React.createElement(View, { style: style },
8
+ React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
9
+ Platform.OS === "android" && (React.createElement(View, { style: style },
10
+ React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
11
+ Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: source } }))));
12
+ };
13
+ export default SVG;
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ import { View, Platform, Image, StyleProp, ImageStyle } from "react-native";
3
+ import { SvgUri } from "react-native-svg";
4
+
5
+ import Config from "./Config";
6
+
7
+ type SVGComponentProps = {
8
+ source: string;
9
+ style?: StyleProp<ImageStyle>;
10
+ };
11
+
12
+ const SVG: React.FC<React.PropsWithChildren<SVGComponentProps>> = ({
13
+ source = Config.placeholderSvgURL,
14
+ style,
15
+ }) => {
16
+ return (
17
+ <>
18
+ {Platform.OS === "ios" && (
19
+ <View style={style}>
20
+ <SvgUri width="100%" height="100%" uri={source} />
21
+ </View>
22
+ )}
23
+ {Platform.OS === "android" && (
24
+ <View style={style}>
25
+ <SvgUri width="100%" height="100%" uri={source} />
26
+ </View>
27
+ )}
28
+ {Platform.OS === "web" && (
29
+ <Image style={style} source={{ uri: source }} />
30
+ )}
31
+ </>
32
+ );
33
+ };
34
+
35
+ export default SVG;
package/src/index.js CHANGED
@@ -17,6 +17,7 @@ export { default as FAB } from "./components/FAB";
17
17
  export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
18
18
  export { default as IconButton } from "./components/IconButton";
19
19
  export { default as Image } from "./components/Image";
20
+ export { default as SVG } from "./components/SVG";
20
21
  export { default as NumberInput } from "./components/NumberInput";
21
22
  export { default as ScreenContainer } from "./components/ScreenContainer";
22
23
  export { default as StarRating } from "./components/StarRating";
@@ -49,4 +50,5 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
49
50
  export { default as Slider } from "./components/Slider";
50
51
  export { default as Stepper } from "./components/Stepper";
51
52
  export { useAuthState } from "./components/useAuthState";
53
+ export { default as Markdown } from "./components/Markdown";
52
54
  // a comment to fix sourcemap comment issue
package/src/index.tsx CHANGED
@@ -18,6 +18,7 @@ export { default as FAB } from "./components/FAB";
18
18
  export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
19
19
  export { default as IconButton } from "./components/IconButton";
20
20
  export { default as Image } from "./components/Image";
21
+ export { default as SVG } from "./components/SVG";
21
22
  export { default as NumberInput } from "./components/NumberInput";
22
23
  export { default as ScreenContainer } from "./components/ScreenContainer";
23
24
  export { default as StarRating } from "./components/StarRating";
@@ -69,5 +70,6 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
69
70
  export { default as Slider } from "./components/Slider";
70
71
  export { default as Stepper } from "./components/Stepper";
71
72
  export { useAuthState } from "./components/useAuthState";
73
+ export { default as Markdown } from "./components/Markdown";
72
74
 
73
75
  // a comment to fix sourcemap comment issue
@@ -11,8 +11,8 @@ export const SEED_DATA = {
11
11
  StylesPanelSections.Effects,
12
12
  ],
13
13
  layout: {
14
- width: 250,
15
- height: 250,
14
+ width: 100,
15
+ height: 100,
16
16
  },
17
17
  props: {
18
18
  source: createImageProp(),
@@ -17,8 +17,8 @@ export const SEED_DATA = {
17
17
  StylesPanelSections.Effects,
18
18
  ],
19
19
  layout: {
20
- width: 250,
21
- height: 250,
20
+ width: 100,
21
+ height: 100,
22
22
  },
23
23
  props: {
24
24
  source: createImageProp(),
@@ -53,6 +53,7 @@ export const SEED_DATA = {
53
53
  label: "Map Type",
54
54
  description: "The type of map to show",
55
55
  group: GROUPS.basic,
56
+ editable: true,
56
57
  formType: FORM_TYPES.flatArray,
57
58
  propType: PROP_TYPES.STRING,
58
59
  required: false,
@@ -63,6 +63,7 @@ export const SEED_DATA = {
63
63
  label: "Map Type",
64
64
  description: "The type of map to show",
65
65
  group: GROUPS.basic,
66
+ editable: true,
66
67
  formType: FORM_TYPES.flatArray,
67
68
  propType: PROP_TYPES.STRING,
68
69
  required: false,
@@ -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
+ };
@@ -0,0 +1,20 @@
1
+ import { COMPONENT_TYPES, createSVGProp, StylesPanelSections, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "SVG",
4
+ tag: "SVG",
5
+ description: "An SVG component",
6
+ category: COMPONENT_TYPES.media,
7
+ layout: {
8
+ width: 100,
9
+ height: 100,
10
+ },
11
+ stylesPanelSections: [
12
+ StylesPanelSections.Size,
13
+ StylesPanelSections.Margins,
14
+ StylesPanelSections.Position,
15
+ StylesPanelSections.Effects,
16
+ ],
17
+ props: {
18
+ source: createSVGProp(),
19
+ },
20
+ };
@@ -0,0 +1,25 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createSVGProp,
4
+ StylesPanelSections,
5
+ } from "@draftbit/types";
6
+
7
+ export const SEED_DATA = {
8
+ name: "SVG",
9
+ tag: "SVG",
10
+ description: "An SVG component",
11
+ category: COMPONENT_TYPES.media,
12
+ layout: {
13
+ width: 100,
14
+ height: 100,
15
+ },
16
+ stylesPanelSections: [
17
+ StylesPanelSections.Size,
18
+ StylesPanelSections.Margins,
19
+ StylesPanelSections.Position,
20
+ StylesPanelSections.Effects,
21
+ ],
22
+ props: {
23
+ source: createSVGProp(),
24
+ },
25
+ };