@draftbit/core 50.6.4-97b460.2 → 50.6.4-d8eff0.2
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/ExpoImage.js +1 -1
- package/lib/typescript/src/components/ExpoImage.d.ts +2 -5
- package/lib/typescript/src/components/ExpoImage.js +7 -4
- package/lib/typescript/src/components/ExpoImage.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/ExpoImage.js +7 -4
- package/src/components/ExpoImage.js.map +1 -1
- package/src/components/ExpoImage.tsx +12 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "50.6.4-
|
|
3
|
+
"version": "50.6.4-d8eff0.2+d8eff0f",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"types": "lib/typescript/src/index.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@dotlottie/react-player": "1.6.1",
|
|
44
44
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
45
|
-
"@draftbit/theme": "^50.6.4-
|
|
45
|
+
"@draftbit/theme": "^50.6.4-d8eff0.2+d8eff0f",
|
|
46
46
|
"@expo/vector-icons": "^14.0.0",
|
|
47
47
|
"@gorhom/bottom-sheet": "5.0.0-alpha.7",
|
|
48
48
|
"@lottiefiles/react-lottie-player": "3.5.3",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
],
|
|
124
124
|
"testEnvironment": "node"
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "d8eff0f36889ae8e9532c4017cd46ca5a2cec401"
|
|
127
127
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* README: Internal Image component used for stuff like Card. DO NOT EXPORT! */
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { StyleSheet } from "react-native";
|
|
4
3
|
import { Image, } from "expo-image";
|
|
@@ -38,7 +37,7 @@ const resizeModeToContentFit = (resizeMode) => {
|
|
|
38
37
|
};
|
|
39
38
|
return (_a = mapping[resizeMode]) !== null && _a !== void 0 ? _a : "cover";
|
|
40
39
|
};
|
|
41
|
-
const ExpoImage = ({ source, resizeMode = "cover", style,
|
|
40
|
+
const ExpoImage = ({ source, resizeMode = "cover", style, transition = 300, contentFit = "cover", contentPosition = "center", cachePolicy = "memory-disk", allowDownscaling = true, blurRadius, blurhash, ...props }) => {
|
|
42
41
|
let imageSource = source === null || source === undefined
|
|
43
42
|
? Config.placeholderImageURL
|
|
44
43
|
: source;
|
|
@@ -49,7 +48,9 @@ const ExpoImage = ({ source, resizeMode = "cover", style, placeholder, transitio
|
|
|
49
48
|
: contentFit;
|
|
50
49
|
if (aspectRatio) {
|
|
51
50
|
return (React.createElement(AspectRatio, { style: [style, { width, height, aspectRatio }] },
|
|
52
|
-
React.createElement(Image, { ...props, source: imageSource, contentFit: finalContentFit, placeholder:
|
|
51
|
+
React.createElement(Image, { ...props, source: imageSource, contentFit: finalContentFit, placeholder: {
|
|
52
|
+
blurhash,
|
|
53
|
+
}, transition: transition, contentPosition: contentPosition, cachePolicy: cachePolicy, allowDownscaling: allowDownscaling, blurRadius: blurRadius, style: [
|
|
53
54
|
style,
|
|
54
55
|
{
|
|
55
56
|
height: "100%",
|
|
@@ -57,7 +58,9 @@ const ExpoImage = ({ source, resizeMode = "cover", style, placeholder, transitio
|
|
|
57
58
|
},
|
|
58
59
|
] })));
|
|
59
60
|
}
|
|
60
|
-
return (React.createElement(Image, { ...props, source: source, contentFit: finalContentFit, placeholder:
|
|
61
|
+
return (React.createElement(Image, { ...props, source: source, contentFit: finalContentFit, placeholder: {
|
|
62
|
+
blurhash,
|
|
63
|
+
}, transition: transition, contentPosition: contentPosition, cachePolicy: cachePolicy, allowDownscaling: allowDownscaling, blurRadius: blurRadius, style: style }));
|
|
61
64
|
};
|
|
62
65
|
export default ExpoImage;
|
|
63
66
|
//# sourceMappingURL=ExpoImage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoImage.js","sourceRoot":"","sources":["ExpoImage.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ExpoImage.js","sourceRoot":"","sources":["ExpoImage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAuC,MAAM,cAAc,CAAC;AAC/E,OAAO,EACL,KAAK,GAIN,MAAM,YAAY,CAAC;AACpB,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,WAAW,MAAM,eAAe,CAAC;AA+BxC,MAAM,kBAAkB,GAAG,CAAC,EAC1B,WAAW,EACX,KAAK,EACL,MAAM,GACS,EAIf,EAAE;IACF,IAAI,WAAW,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE;QACpC,OAAO;YACL,WAAW;YACX,KAAK,EAAE,MAAM;SACd,CAAC;KACH;IAED,IAAI,WAAW,IAAI,MAAM,EAAE;QACzB,OAAO;YACL,WAAW;YACX,MAAM;YACN,KAAK,EAAE,WAAW,GAAG,MAAM;SAC5B,CAAC;KACH;IAED,IAAI,WAAW,IAAI,KAAK,EAAE;QACxB,OAAO;YACL,WAAW;YACX,KAAK;YACL,MAAM,EAAE,KAAK,GAAG,WAAW;SAC5B,CAAC;KACH;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,sBAAsB,GAAG,CAC7B,UAAiE,EAChD,EAAE;;IACnB,MAAM,OAAO,GAA+C;QAC1D,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,YAAY;KACZ,CAA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D,CACU,CACf,CAAC;KACH;IAED,OAAO,CACL,oBAAC,KAAK,OACA,KAAK,EACT,MAAM,EAAE,MAA6B,EACrC,UAAU,EAAE,eAAe,EAC3B,WAAW,EAAE;YACX,QAAQ;SACT,EACD,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* README: Internal Image component used for stuff like Card. DO NOT EXPORT! */
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { StyleSheet, ImageSourcePropType, DimensionValue } from "react-native";
|
|
4
3
|
import {
|
|
@@ -17,10 +16,6 @@ type ImageStyleProp = {
|
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
interface ExtendedImageProps extends ExpoImageProps {
|
|
20
|
-
placeholder?: {
|
|
21
|
-
blurhash?: string;
|
|
22
|
-
thumbhash?: string;
|
|
23
|
-
};
|
|
24
19
|
transition?:
|
|
25
20
|
| number
|
|
26
21
|
| {
|
|
@@ -39,7 +34,8 @@ interface ExtendedImageProps extends ExpoImageProps {
|
|
|
39
34
|
contentPosition?: ImageContentPosition;
|
|
40
35
|
cachePolicy?: "none" | "disk" | "memory" | "memory-disk";
|
|
41
36
|
allowDownscaling?: boolean;
|
|
42
|
-
|
|
37
|
+
blurRadius?: number;
|
|
38
|
+
blurhash?: string;
|
|
43
39
|
}
|
|
44
40
|
|
|
45
41
|
const generateDimensions = ({
|
|
@@ -94,13 +90,13 @@ const ExpoImage: React.FC<ExtendedImageProps> = ({
|
|
|
94
90
|
source,
|
|
95
91
|
resizeMode = "cover",
|
|
96
92
|
style,
|
|
97
|
-
placeholder,
|
|
98
93
|
transition = 300,
|
|
99
94
|
contentFit = "cover",
|
|
100
95
|
contentPosition = "center",
|
|
101
96
|
cachePolicy = "memory-disk",
|
|
102
97
|
allowDownscaling = true,
|
|
103
|
-
|
|
98
|
+
blurRadius,
|
|
99
|
+
blurhash,
|
|
104
100
|
...props
|
|
105
101
|
}) => {
|
|
106
102
|
let imageSource =
|
|
@@ -124,12 +120,14 @@ const ExpoImage: React.FC<ExtendedImageProps> = ({
|
|
|
124
120
|
{...props}
|
|
125
121
|
source={imageSource as ImageSourcePropType}
|
|
126
122
|
contentFit={finalContentFit}
|
|
127
|
-
placeholder={
|
|
123
|
+
placeholder={{
|
|
124
|
+
blurhash,
|
|
125
|
+
}}
|
|
128
126
|
transition={transition}
|
|
129
127
|
contentPosition={contentPosition}
|
|
130
128
|
cachePolicy={cachePolicy}
|
|
131
129
|
allowDownscaling={allowDownscaling}
|
|
132
|
-
|
|
130
|
+
blurRadius={blurRadius}
|
|
133
131
|
style={[
|
|
134
132
|
style,
|
|
135
133
|
{
|
|
@@ -147,12 +145,14 @@ const ExpoImage: React.FC<ExtendedImageProps> = ({
|
|
|
147
145
|
{...props}
|
|
148
146
|
source={source as ImageSourcePropType}
|
|
149
147
|
contentFit={finalContentFit}
|
|
150
|
-
placeholder={
|
|
148
|
+
placeholder={{
|
|
149
|
+
blurhash,
|
|
150
|
+
}}
|
|
151
151
|
transition={transition}
|
|
152
152
|
contentPosition={contentPosition}
|
|
153
153
|
cachePolicy={cachePolicy}
|
|
154
154
|
allowDownscaling={allowDownscaling}
|
|
155
|
-
|
|
155
|
+
blurRadius={blurRadius}
|
|
156
156
|
style={style}
|
|
157
157
|
/>
|
|
158
158
|
);
|