@sendbird/uikit-react-native-foundation 3.0.0-rc.0 → 3.0.0-rc.1
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/Image/FastImageInternal.js +13 -0
- package/lib/commonjs/components/Image/FastImageInternal.js.map +1 -0
- package/lib/commonjs/components/Image/Image.fastimage.js +2 -5
- package/lib/commonjs/components/Image/Image.fastimage.js.map +1 -1
- package/lib/module/components/Image/FastImageInternal.js +6 -0
- package/lib/module/components/Image/FastImageInternal.js.map +1 -0
- package/lib/module/components/Image/Image.fastimage.js +2 -5
- package/lib/module/components/Image/Image.fastimage.js.map +1 -1
- package/lib/typescript/src/components/Image/FastImageInternal.d.ts +3 -0
- package/package.json +3 -2
- package/src/components/Image/FastImageInternal.tsx +9 -0
- package/src/components/Image/Image.fastimage.tsx +2 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
let FastImageInternal = () => null;
|
|
8
|
+
try {
|
|
9
|
+
FastImageInternal = require('react-native-fast-image');
|
|
10
|
+
} catch {}
|
|
11
|
+
var _default = FastImageInternal;
|
|
12
|
+
exports.default = _default;
|
|
13
|
+
//# sourceMappingURL=FastImageInternal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FastImageInternal","require","_default","exports","default"],"sources":["FastImageInternal.tsx"],"sourcesContent":["import type { FastImageProps } from 'react-native-fast-image';\n\nlet FastImageInternal: (props: FastImageProps) => JSX.Element | null = () => null;\n\ntry {\n FastImageInternal = require('react-native-fast-image') as (props: FastImageProps) => JSX.Element;\n} catch {}\n\nexport default FastImageInternal;\n"],"mappings":";;;;;;AAEA,IAAIA,iBAAgE,GAAGA,CAAA,KAAM,IAAI;AAEjF,IAAI;EACFA,iBAAiB,GAAGC,OAAO,CAAC,yBAAyB,CAA2C;AAClG,CAAC,CAAC,MAAM,CAAC;AAAC,IAAAC,QAAA,GAEKF,iBAAiB;AAAAG,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _FastImageInternal = _interopRequireDefault(require("./FastImageInternal"));
|
|
8
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
10
|
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); }
|
|
10
11
|
function convertCache(cache) {
|
|
@@ -50,10 +51,6 @@ function convertResizeMode(mode) {
|
|
|
50
51
|
return undefined;
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
let FastImage = () => null;
|
|
54
|
-
try {
|
|
55
|
-
FastImage = require('react-native-fast-image');
|
|
56
|
-
} catch {}
|
|
57
54
|
const Image_FastImage = _ref => {
|
|
58
55
|
let {
|
|
59
56
|
source,
|
|
@@ -64,7 +61,7 @@ const Image_FastImage = _ref => {
|
|
|
64
61
|
style,
|
|
65
62
|
...props
|
|
66
63
|
} = _ref;
|
|
67
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement(_FastImageInternal.default, _extends({}, props, {
|
|
68
65
|
onLoad: onLoad && (e => onLoad(e.nativeEvent)),
|
|
69
66
|
onError: onError && (() => onError({})),
|
|
70
67
|
style: style,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","convertCache","cache","convertSource","Array","isArray","uri","headers","convertDefaultSource","undefined","convertResizeMode","mode","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_FastImageInternal","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","convertCache","cache","convertSource","Array","isArray","uri","headers","convertDefaultSource","undefined","convertResizeMode","mode","Image_FastImage","_ref","defaultSource","resizeMode","onLoad","onError","style","props","createElement","e","nativeEvent","_default","exports"],"sources":["Image.fastimage.tsx"],"sourcesContent":["import React from 'react';\nimport type { FastImageProps, ResizeMode, Source } from 'react-native-fast-image';\n\nimport FastImageInternal from './FastImageInternal';\nimport type { SendbirdImageComponent, SendbirdImageProps } from './index';\n\nfunction convertCache(\n cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached' | undefined,\n): 'immutable' | 'web' | 'cacheOnly' {\n switch (cache) {\n case 'force-cache':\n case 'only-if-cached':\n return 'cacheOnly';\n default:\n return 'immutable';\n }\n}\n\nfunction convertSource(source: SendbirdImageProps['source']): Source | number {\n if (Array.isArray(source)) {\n return convertSource(source[0]);\n }\n\n if (typeof source === 'number') {\n return source;\n }\n\n return {\n uri: source.uri,\n headers: source.headers,\n cache: convertCache(source.cache), //'immutable' | 'web' | 'cacheOnly'\n };\n}\nfunction convertDefaultSource(source?: SendbirdImageProps['defaultSource']): number | undefined {\n if (typeof source === 'number') {\n return source;\n }\n\n return undefined;\n}\n\nfunction convertResizeMode(mode?: SendbirdImageProps['resizeMode']): ResizeMode | undefined {\n switch (mode) {\n case 'center':\n return 'center';\n case 'contain':\n return 'contain';\n case 'cover':\n return 'cover';\n case 'stretch':\n return 'stretch';\n default:\n return undefined;\n }\n}\n\nconst Image_FastImage: SendbirdImageComponent = ({\n source,\n defaultSource,\n resizeMode,\n onLoad,\n onError,\n style,\n ...props\n}) => {\n return (\n <FastImageInternal\n {...props}\n onLoad={onLoad && ((e) => onLoad(e.nativeEvent))}\n onError={onError && (() => onError({}))}\n style={style as FastImageProps['style']}\n source={convertSource(source)}\n defaultSource={convertDefaultSource(defaultSource)}\n resizeMode={convertResizeMode(resizeMode)}\n />\n );\n};\n\nexport default Image_FastImage;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,kBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAoD,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAGpD,SAASQ,YAAYA,CACnBC,KAA2E,EACxC;EACnC,QAAQA,KAAK;IACX,KAAK,aAAa;IAClB,KAAK,gBAAgB;MACnB,OAAO,WAAW;IACpB;MACE,OAAO,WAAW;EAAC;AAEzB;AAEA,SAASC,aAAaA,CAACR,MAAoC,EAAmB;EAC5E,IAAIS,KAAK,CAACC,OAAO,CAACV,MAAM,CAAC,EAAE;IACzB,OAAOQ,aAAa,CAACR,MAAM,CAAC,CAAC,CAAC,CAAC;EACjC;EAEA,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOA,MAAM;EACf;EAEA,OAAO;IACLW,GAAG,EAAEX,MAAM,CAACW,GAAG;IACfC,OAAO,EA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":["FastImageInternal","require"],"sources":["FastImageInternal.tsx"],"sourcesContent":["import type { FastImageProps } from 'react-native-fast-image';\n\nlet FastImageInternal: (props: FastImageProps) => JSX.Element | null = () => null;\n\ntry {\n FastImageInternal = require('react-native-fast-image') as (props: FastImageProps) => JSX.Element;\n} catch {}\n\nexport default FastImageInternal;\n"],"mappings":"AAEA,IAAIA,iBAAgE,GAAGA,CAAA,KAAM,IAAI;AAEjF,IAAI;EACFA,iBAAiB,GAAGC,OAAO,CAAC,yBAAyB,CAA2C;AAClG,CAAC,CAAC,MAAM,CAAC;AAET,eAAeD,iBAAiB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
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
2
|
import React from 'react';
|
|
3
|
+
import FastImageInternal from './FastImageInternal';
|
|
3
4
|
function convertCache(cache) {
|
|
4
5
|
switch (cache) {
|
|
5
6
|
case 'force-cache':
|
|
@@ -43,10 +44,6 @@ function convertResizeMode(mode) {
|
|
|
43
44
|
return undefined;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
|
-
let FastImage = () => null;
|
|
47
|
-
try {
|
|
48
|
-
FastImage = require('react-native-fast-image');
|
|
49
|
-
} catch {}
|
|
50
47
|
const Image_FastImage = _ref => {
|
|
51
48
|
let {
|
|
52
49
|
source,
|
|
@@ -57,7 +54,7 @@ const Image_FastImage = _ref => {
|
|
|
57
54
|
style,
|
|
58
55
|
...props
|
|
59
56
|
} = _ref;
|
|
60
|
-
return /*#__PURE__*/React.createElement(
|
|
57
|
+
return /*#__PURE__*/React.createElement(FastImageInternal, _extends({}, props, {
|
|
61
58
|
onLoad: onLoad && (e => onLoad(e.nativeEvent)),
|
|
62
59
|
onError: onError && (() => onError({})),
|
|
63
60
|
style: style,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","convertCache","cache","convertSource","source","Array","isArray","uri","headers","convertDefaultSource","undefined","convertResizeMode","mode","
|
|
1
|
+
{"version":3,"names":["React","FastImageInternal","convertCache","cache","convertSource","source","Array","isArray","uri","headers","convertDefaultSource","undefined","convertResizeMode","mode","Image_FastImage","_ref","defaultSource","resizeMode","onLoad","onError","style","props","createElement","_extends","e","nativeEvent"],"sources":["Image.fastimage.tsx"],"sourcesContent":["import React from 'react';\nimport type { FastImageProps, ResizeMode, Source } from 'react-native-fast-image';\n\nimport FastImageInternal from './FastImageInternal';\nimport type { SendbirdImageComponent, SendbirdImageProps } from './index';\n\nfunction convertCache(\n cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached' | undefined,\n): 'immutable' | 'web' | 'cacheOnly' {\n switch (cache) {\n case 'force-cache':\n case 'only-if-cached':\n return 'cacheOnly';\n default:\n return 'immutable';\n }\n}\n\nfunction convertSource(source: SendbirdImageProps['source']): Source | number {\n if (Array.isArray(source)) {\n return convertSource(source[0]);\n }\n\n if (typeof source === 'number') {\n return source;\n }\n\n return {\n uri: source.uri,\n headers: source.headers,\n cache: convertCache(source.cache), //'immutable' | 'web' | 'cacheOnly'\n };\n}\nfunction convertDefaultSource(source?: SendbirdImageProps['defaultSource']): number | undefined {\n if (typeof source === 'number') {\n return source;\n }\n\n return undefined;\n}\n\nfunction convertResizeMode(mode?: SendbirdImageProps['resizeMode']): ResizeMode | undefined {\n switch (mode) {\n case 'center':\n return 'center';\n case 'contain':\n return 'contain';\n case 'cover':\n return 'cover';\n case 'stretch':\n return 'stretch';\n default:\n return undefined;\n }\n}\n\nconst Image_FastImage: SendbirdImageComponent = ({\n source,\n defaultSource,\n resizeMode,\n onLoad,\n onError,\n style,\n ...props\n}) => {\n return (\n <FastImageInternal\n {...props}\n onLoad={onLoad && ((e) => onLoad(e.nativeEvent))}\n onError={onError && (() => onError({}))}\n style={style as FastImageProps['style']}\n source={convertSource(source)}\n defaultSource={convertDefaultSource(defaultSource)}\n resizeMode={convertResizeMode(resizeMode)}\n />\n );\n};\n\nexport default Image_FastImage;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,OAAOC,iBAAiB,MAAM,qBAAqB;AAGnD,SAASC,YAAYA,CACnBC,KAA2E,EACxC;EACnC,QAAQA,KAAK;IACX,KAAK,aAAa;IAClB,KAAK,gBAAgB;MACnB,OAAO,WAAW;IACpB;MACE,OAAO,WAAW;EAAC;AAEzB;AAEA,SAASC,aAAaA,CAACC,MAAoC,EAAmB;EAC5E,IAAIC,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,EAAE;IACzB,OAAOD,aAAa,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC;EACjC;EAEA,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOA,MAAM;EACf;EAEA,OAAO;IACLG,GAAG,EAAEH,MAAM,CAACG,GAAG;IACfC,OAAO,EAAEJ,MAAM,CAACI,OAAO;IACvBN,KAAK,EAAED,YAAY,CAACG,MAAM,CAACF,KAAK,CAAC,CAAE;EACrC,CAAC;AACH;;AACA,SAASO,oBAAoBA,CAACL,MAA4C,EAAsB;EAC9F,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOA,MAAM;EACf;EAEA,OAAOM,SAAS;AAClB;AAEA,SAASC,iBAAiBA,CAACC,IAAuC,EAA0B;EAC1F,QAAQA,IAAI;IACV,KAAK,QAAQ;MACX,OAAO,QAAQ;IACjB,KAAK,SAAS;MACZ,OAAO,SAAS;IAClB,KAAK,OAAO;MACV,OAAO,OAAO;IAChB,KAAK,SAAS;MACZ,OAAO,SAAS;IAClB;MACE,OAAOF,SAAS;EAAC;AAEvB;AAEA,MAAMG,eAAuC,GAAGC,IAAA,IAQ1C;EAAA,IAR2C;IAC/CV,MAAM;IACNW,aAAa;IACbC,UAAU;IACVC,MAAM;IACNC,OAAO;IACPC,KAAK;IACL,GAAGC;EACL,CAAC,GAAAN,IAAA;EACC,oBACEf,KAAA,CAAAsB,aAAA,CAACrB,iBAAiB,EAAAsB,QAAA,KACZF,KAAK;IACTH,MAAM,EAAEA,MAAM,KAAMM,CAAC,IAAKN,MAAM,CAACM,CAAC,CAACC,WAAW,CAAC,CAAE;IACjDN,OAAO,EAAEA,OAAO,KAAK,MAAMA,OAAO,CAAC,CAAC,CAAC,CAAC,CAAE;IACxCC,KAAK,EAAEA,KAAiC;IACxCf,MAAM,EAAED,aAAa,CAACC,MAAM,CAAE;IAC9BW,aAAa,EAAEN,oBAAoB,CAACM,aAAa,CAAE;IACnDC,UAAU,EAAEL,iBAAiB,CAACK,UAAU;EAAE,GAC1C;AAEN,CAAC;AAED,eAAeH,eAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendbird/uikit-react-native-foundation",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.1",
|
|
4
4
|
"description": "A foundational UI kit for building chat-enabled React Native apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sendbird",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"test": "jest",
|
|
29
29
|
"build": "bob build",
|
|
30
30
|
"clean": "del lib",
|
|
31
|
+
"publish:next": "npm publish --tag next",
|
|
31
32
|
"generate-icons": "node src/assets/bundle-icons.js"
|
|
32
33
|
},
|
|
33
34
|
"repository": {
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"access": "public"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
|
-
"@sendbird/uikit-utils": "3.0.0-rc.
|
|
50
|
+
"@sendbird/uikit-utils": "3.0.0-rc.1"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@types/react": "*",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FastImageProps } from 'react-native-fast-image';
|
|
2
|
+
|
|
3
|
+
let FastImageInternal: (props: FastImageProps) => JSX.Element | null = () => null;
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
FastImageInternal = require('react-native-fast-image') as (props: FastImageProps) => JSX.Element;
|
|
7
|
+
} catch {}
|
|
8
|
+
|
|
9
|
+
export default FastImageInternal;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FastImageProps, ResizeMode, Source } from 'react-native-fast-image';
|
|
3
3
|
|
|
4
|
+
import FastImageInternal from './FastImageInternal';
|
|
4
5
|
import type { SendbirdImageComponent, SendbirdImageProps } from './index';
|
|
5
6
|
|
|
6
7
|
function convertCache(
|
|
@@ -53,12 +54,6 @@ function convertResizeMode(mode?: SendbirdImageProps['resizeMode']): ResizeMode
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
let FastImage: (props: FastImageProps) => JSX.Element | null = () => null;
|
|
57
|
-
|
|
58
|
-
try {
|
|
59
|
-
FastImage = require('react-native-fast-image') as (props: FastImageProps) => JSX.Element;
|
|
60
|
-
} catch {}
|
|
61
|
-
|
|
62
57
|
const Image_FastImage: SendbirdImageComponent = ({
|
|
63
58
|
source,
|
|
64
59
|
defaultSource,
|
|
@@ -69,7 +64,7 @@ const Image_FastImage: SendbirdImageComponent = ({
|
|
|
69
64
|
...props
|
|
70
65
|
}) => {
|
|
71
66
|
return (
|
|
72
|
-
<
|
|
67
|
+
<FastImageInternal
|
|
73
68
|
{...props}
|
|
74
69
|
onLoad={onLoad && ((e) => onLoad(e.nativeEvent))}
|
|
75
70
|
onError={onError && (() => onError({}))}
|