@draftbit/core 46.2.4-6d236f.2 → 46.2.4-7028ac.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/CardContainer.js +15 -5
- package/lib/commonjs/components/CircleImage.js +16 -2
- package/lib/commonjs/components/Config.js +1 -1
- package/lib/commonjs/components/DeprecatedButton.js +22 -4
- package/lib/commonjs/components/IconButton.js +22 -5
- package/lib/commonjs/components/Image.js +16 -3
- package/lib/commonjs/components/Portal/Portal.js +12 -3
- package/lib/commonjs/components/Portal/PortalConsumer.js +10 -8
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +24 -6
- package/lib/commonjs/components/RadioButton/context.js +1 -1
- package/lib/commonjs/components/SVG.js +4 -5
- package/lib/commonjs/components/StarRating.js +1 -0
- package/lib/commonjs/components/Switch.js +23 -10
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/mappings/MapView.js +1 -0
- package/lib/commonjs/mappings/SVG.js +3 -1
- package/lib/module/components/Banner.js +24 -4
- package/lib/module/components/CardBlock.js +15 -5
- package/lib/module/components/Checkbox/CheckboxGroup.js +17 -3
- package/lib/module/components/Config.js +1 -1
- package/lib/module/components/DeprecatedCardWrapper.js +19 -2
- package/lib/module/components/IconButton.js +22 -5
- package/lib/module/components/Picker/PickerComponent.android.js +23 -5
- package/lib/module/components/Picker/PickerComponent.web.js +23 -5
- package/lib/module/components/ProgressBar.js +23 -7
- package/lib/module/components/SVG.js +4 -5
- package/lib/module/components/StarRating.js +25 -5
- package/lib/module/components/Surface.js +16 -2
- package/lib/module/components/Text.js +33 -10
- package/lib/module/components/TextField.js +62 -30
- package/lib/module/components/Touchable.js +18 -2
- package/lib/module/constants.js +1 -0
- package/lib/module/mappings/MapView.js +1 -0
- package/lib/module/mappings/SVG.js +4 -2
- package/lib/typescript/src/components/SVG.d.ts +2 -2
- package/lib/typescript/src/mappings/MapView.d.ts +1 -0
- package/lib/typescript/src/mappings/SVG.d.ts +2 -0
- package/package.json +3 -3
- package/src/components/Config.js +1 -1
- package/src/components/Config.ts +1 -1
- package/src/components/SVG.js +4 -5
- package/src/components/SVG.tsx +7 -7
- package/src/components/StarRating.js +1 -0
- package/src/components/StarRating.tsx +1 -0
- package/src/mappings/MapView.js +1 -0
- package/src/mappings/MapView.ts +1 -0
- package/src/mappings/SVG.js +9 -2
- package/src/mappings/SVG.ts +13 -2
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { COMPONENT_TYPES,
|
|
1
|
+
import { COMPONENT_TYPES, createSVGProp, StylesPanelSections } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "SVG",
|
|
4
4
|
tag: "SVG",
|
|
5
5
|
description: "An SVG component",
|
|
6
|
+
packageName: "@draftbit/core",
|
|
6
7
|
category: COMPONENT_TYPES.media,
|
|
7
8
|
layout: {
|
|
8
9
|
width: 100,
|
|
9
10
|
height: 100
|
|
10
11
|
},
|
|
12
|
+
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
11
13
|
props: {
|
|
12
|
-
source:
|
|
14
|
+
source: createSVGProp()
|
|
13
15
|
}
|
|
14
16
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { StyleProp, ImageStyle } from "react-native";
|
|
3
3
|
declare type SVGComponentProps = {
|
|
4
4
|
source: string;
|
|
5
5
|
style?: StyleProp<ImageStyle>;
|
|
6
6
|
};
|
|
7
|
-
declare const SVG:
|
|
7
|
+
declare const SVG: React.FC<React.PropsWithChildren<SVGComponentProps>>;
|
|
8
8
|
export default SVG;
|
|
@@ -2,11 +2,13 @@ export declare const SEED_DATA: {
|
|
|
2
2
|
name: string;
|
|
3
3
|
tag: string;
|
|
4
4
|
description: string;
|
|
5
|
+
packageName: string;
|
|
5
6
|
category: string;
|
|
6
7
|
layout: {
|
|
7
8
|
width: number;
|
|
8
9
|
height: number;
|
|
9
10
|
};
|
|
11
|
+
stylesPanelSections: string[];
|
|
10
12
|
props: {
|
|
11
13
|
source: {
|
|
12
14
|
label: string;
|
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-7028ac.5+7028ac76",
|
|
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-
|
|
44
|
+
"@draftbit/types": "^46.2.4-7028ac.5+7028ac76",
|
|
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",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
]
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "7028ac766b962df851f034e308568aee4df4376a"
|
|
84
84
|
}
|
package/src/components/Config.js
CHANGED
|
@@ -42,7 +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-
|
|
45
|
+
placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
|
|
46
46
|
squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
|
|
47
47
|
FABSize: 40,
|
|
48
48
|
FABBorderRadius: 20,
|
package/src/components/Config.ts
CHANGED
|
@@ -60,7 +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-
|
|
63
|
+
placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
|
|
64
64
|
squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
|
|
65
65
|
FABSize: 40,
|
|
66
66
|
FABBorderRadius: 20,
|
package/src/components/SVG.js
CHANGED
|
@@ -2,13 +2,12 @@ import * as React from "react";
|
|
|
2
2
|
import { View, Platform, Image } from "react-native";
|
|
3
3
|
import { SvgUri } from "react-native-svg";
|
|
4
4
|
import Config from "./Config";
|
|
5
|
-
const SVG = ({ source, style }) => {
|
|
6
|
-
let svgSource = source === null || source === undefined ? Config.placeholderSvgURL : source;
|
|
5
|
+
const SVG = ({ source = Config.placeholderSvgURL, style, }) => {
|
|
7
6
|
return (React.createElement(React.Fragment, null,
|
|
8
7
|
Platform.OS === "ios" && (React.createElement(View, { style: style },
|
|
9
|
-
React.createElement(SvgUri, { width: "100%", height: "100%", uri:
|
|
8
|
+
React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
|
|
10
9
|
Platform.OS === "android" && (React.createElement(View, { style: style },
|
|
11
|
-
React.createElement(SvgUri, { width: "100%", height: "100%", uri:
|
|
12
|
-
Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri:
|
|
10
|
+
React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
|
|
11
|
+
Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: source } }))));
|
|
13
12
|
};
|
|
14
13
|
export default SVG;
|
package/src/components/SVG.tsx
CHANGED
|
@@ -9,24 +9,24 @@ type SVGComponentProps = {
|
|
|
9
9
|
style?: StyleProp<ImageStyle>;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const SVG
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const SVG: React.FC<React.PropsWithChildren<SVGComponentProps>> = ({
|
|
13
|
+
source = Config.placeholderSvgURL,
|
|
14
|
+
style,
|
|
15
|
+
}) => {
|
|
16
16
|
return (
|
|
17
17
|
<>
|
|
18
18
|
{Platform.OS === "ios" && (
|
|
19
19
|
<View style={style}>
|
|
20
|
-
<SvgUri width="100%" height="100%" uri={
|
|
20
|
+
<SvgUri width="100%" height="100%" uri={source} />
|
|
21
21
|
</View>
|
|
22
22
|
)}
|
|
23
23
|
{Platform.OS === "android" && (
|
|
24
24
|
<View style={style}>
|
|
25
|
-
<SvgUri width="100%" height="100%" uri={
|
|
25
|
+
<SvgUri width="100%" height="100%" uri={source} />
|
|
26
26
|
</View>
|
|
27
27
|
)}
|
|
28
28
|
{Platform.OS === "web" && (
|
|
29
|
-
<Image style={style} source={{ uri:
|
|
29
|
+
<Image style={style} source={{ uri: source }} />
|
|
30
30
|
)}
|
|
31
31
|
</>
|
|
32
32
|
);
|
|
@@ -27,6 +27,7 @@ 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!
|
|
30
31
|
container: {
|
|
31
32
|
flexDirection: "row",
|
|
32
33
|
alignItems: "center",
|
package/src/mappings/MapView.js
CHANGED
package/src/mappings/MapView.ts
CHANGED
package/src/mappings/SVG.js
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import { COMPONENT_TYPES,
|
|
1
|
+
import { COMPONENT_TYPES, createSVGProp, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "SVG",
|
|
4
4
|
tag: "SVG",
|
|
5
5
|
description: "An SVG component",
|
|
6
|
+
packageName: "@draftbit/core",
|
|
6
7
|
category: COMPONENT_TYPES.media,
|
|
7
8
|
layout: {
|
|
8
9
|
width: 100,
|
|
9
10
|
height: 100,
|
|
10
11
|
},
|
|
12
|
+
stylesPanelSections: [
|
|
13
|
+
StylesPanelSections.Size,
|
|
14
|
+
StylesPanelSections.Margins,
|
|
15
|
+
StylesPanelSections.Position,
|
|
16
|
+
StylesPanelSections.Effects,
|
|
17
|
+
],
|
|
11
18
|
props: {
|
|
12
|
-
source:
|
|
19
|
+
source: createSVGProp(),
|
|
13
20
|
},
|
|
14
21
|
};
|
package/src/mappings/SVG.ts
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createSVGProp,
|
|
4
|
+
StylesPanelSections,
|
|
5
|
+
} from "@draftbit/types";
|
|
2
6
|
|
|
3
7
|
export const SEED_DATA = {
|
|
4
8
|
name: "SVG",
|
|
5
9
|
tag: "SVG",
|
|
6
10
|
description: "An SVG component",
|
|
11
|
+
packageName: "@draftbit/core",
|
|
7
12
|
category: COMPONENT_TYPES.media,
|
|
8
13
|
layout: {
|
|
9
14
|
width: 100,
|
|
10
15
|
height: 100,
|
|
11
16
|
},
|
|
17
|
+
stylesPanelSections: [
|
|
18
|
+
StylesPanelSections.Size,
|
|
19
|
+
StylesPanelSections.Margins,
|
|
20
|
+
StylesPanelSections.Position,
|
|
21
|
+
StylesPanelSections.Effects,
|
|
22
|
+
],
|
|
12
23
|
props: {
|
|
13
|
-
source:
|
|
24
|
+
source: createSVGProp(),
|
|
14
25
|
},
|
|
15
26
|
};
|