@draftbit/core 46.2.4-99ac4e.1 → 46.2.4-a572b7.5
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.
- package/lib/commonjs/components/AnimatedCircularProgress.js +12 -2
- package/lib/commonjs/components/Banner.js +24 -4
- package/lib/commonjs/components/CardBlock.js +15 -5
- package/lib/commonjs/components/CardContainer.js +15 -5
- package/lib/commonjs/components/CardContainerRating.js +15 -5
- package/lib/commonjs/components/CardContainerShortImage.js +17 -5
- package/lib/commonjs/components/Carousel.js +34 -10
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +24 -6
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/CircleImage.js +16 -2
- package/lib/commonjs/components/CircularProgress.js +15 -7
- package/lib/commonjs/components/Config.js +1 -0
- package/lib/commonjs/components/Container.js +17 -5
- package/lib/commonjs/components/DeprecatedButton.js +4 -22
- package/lib/commonjs/components/DeprecatedCardWrapper.js +17 -2
- package/lib/commonjs/components/DeprecatedFAB.js +22 -4
- package/lib/commonjs/components/Elevation.js +15 -3
- package/lib/commonjs/components/FAB.js +20 -5
- package/lib/commonjs/components/FormRow.js +17 -3
- package/lib/commonjs/components/Image.js +16 -3
- package/lib/commonjs/components/NumberInput.js +13 -2
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +42 -13
- package/lib/commonjs/components/Portal/PortalHost.js +27 -15
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +16 -3
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +24 -6
- package/lib/commonjs/components/SVG.js +48 -0
- package/lib/commonjs/components/ScreenContainer.js +23 -5
- package/lib/commonjs/components/Slider.js +24 -5
- package/lib/commonjs/components/StarRating.js +25 -5
- package/lib/commonjs/components/Surface.js +14 -3
- package/lib/commonjs/components/Text.js +37 -11
- package/lib/commonjs/components/TextField.js +63 -30
- package/lib/commonjs/components/Touchable.js +16 -2
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/mappings/Image.js +2 -2
- package/lib/commonjs/mappings/MapView.js +1 -0
- package/lib/commonjs/mappings/SVG.js +25 -0
- package/lib/module/components/Config.js +1 -0
- package/lib/module/components/Picker/PickerComponent.android.js +23 -5
- package/lib/module/components/ProgressBar.js +23 -7
- package/lib/module/components/SVG.js +31 -0
- package/lib/module/components/Surface.js +16 -2
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/Image.js +2 -2
- package/lib/module/mappings/MapView.js +1 -0
- package/lib/module/mappings/SVG.js +16 -0
- package/lib/typescript/src/components/Config.d.ts +1 -0
- package/lib/typescript/src/components/SVG.d.ts +8 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/mappings/MapView.d.ts +1 -0
- package/lib/typescript/src/mappings/SVG.d.ts +24 -0
- package/package.json +4 -3
- package/src/components/Config.js +1 -0
- package/src/components/Config.ts +1 -0
- package/src/components/SVG.js +13 -0
- package/src/components/SVG.tsx +35 -0
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/Image.js +2 -2
- package/src/mappings/Image.ts +2 -2
- package/src/mappings/MapView.js +1 -0
- package/src/mappings/MapView.ts +1 -0
- package/src/mappings/SVG.js +21 -0
- package/src/mappings/SVG.ts +26 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const SEED_DATA: {
|
|
2
|
+
name: string;
|
|
3
|
+
tag: string;
|
|
4
|
+
description: string;
|
|
5
|
+
packageName: string;
|
|
6
|
+
category: string;
|
|
7
|
+
layout: {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
stylesPanelSections: string[];
|
|
12
|
+
props: {
|
|
13
|
+
source: {
|
|
14
|
+
label: string;
|
|
15
|
+
description: string;
|
|
16
|
+
group: string;
|
|
17
|
+
formType: string;
|
|
18
|
+
propType: string;
|
|
19
|
+
defaultValue: string;
|
|
20
|
+
editable: boolean;
|
|
21
|
+
required: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.2.4-
|
|
3
|
+
"version": "46.2.4-a572b7.5+a572b72e",
|
|
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.
|
|
44
|
+
"@draftbit/types": "^46.2.4-a572b7.5+a572b72e",
|
|
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",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"lodash.omit": "^4.5.0",
|
|
54
54
|
"lodash.tonumber": "^4.0.3",
|
|
55
55
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
56
|
+
"react-native-svg": "^12.3.0",
|
|
56
57
|
"react-native-typography": "^1.4.1",
|
|
57
58
|
"react-native-web-swiper": "^2.2.3"
|
|
58
59
|
},
|
|
@@ -79,5 +80,5 @@
|
|
|
79
80
|
]
|
|
80
81
|
]
|
|
81
82
|
},
|
|
82
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "a572b72e7ba52c06964c007725111547e499a50f"
|
|
83
84
|
}
|
package/src/components/Config.js
CHANGED
|
@@ -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,
|
package/src/components/Config.ts
CHANGED
|
@@ -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,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";
|
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";
|
package/src/mappings/Image.js
CHANGED
package/src/mappings/Image.ts
CHANGED
package/src/mappings/MapView.js
CHANGED
package/src/mappings/MapView.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
packageName: "@draftbit/core",
|
|
7
|
+
category: COMPONENT_TYPES.media,
|
|
8
|
+
layout: {
|
|
9
|
+
width: 100,
|
|
10
|
+
height: 100,
|
|
11
|
+
},
|
|
12
|
+
stylesPanelSections: [
|
|
13
|
+
StylesPanelSections.Size,
|
|
14
|
+
StylesPanelSections.Margins,
|
|
15
|
+
StylesPanelSections.Position,
|
|
16
|
+
StylesPanelSections.Effects,
|
|
17
|
+
],
|
|
18
|
+
props: {
|
|
19
|
+
source: createSvgProp(),
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
packageName: "@draftbit/core",
|
|
12
|
+
category: COMPONENT_TYPES.media,
|
|
13
|
+
layout: {
|
|
14
|
+
width: 100,
|
|
15
|
+
height: 100,
|
|
16
|
+
},
|
|
17
|
+
stylesPanelSections: [
|
|
18
|
+
StylesPanelSections.Size,
|
|
19
|
+
StylesPanelSections.Margins,
|
|
20
|
+
StylesPanelSections.Position,
|
|
21
|
+
StylesPanelSections.Effects,
|
|
22
|
+
],
|
|
23
|
+
props: {
|
|
24
|
+
source: createSvgProp(),
|
|
25
|
+
},
|
|
26
|
+
};
|