@sendbird/uikit-react-native-foundation 3.5.2 → 3.5.4
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/Image.fastimage.js +1 -1
- package/lib/commonjs/components/Image/Image.fastimage.js.map +1 -1
- package/lib/commonjs/components/Image/index.js +0 -3
- package/lib/commonjs/components/Image/index.js.map +1 -1
- package/lib/module/components/Image/Image.fastimage.js +1 -1
- package/lib/module/components/Image/Image.fastimage.js.map +1 -1
- package/lib/module/components/Image/index.js +0 -3
- package/lib/module/components/Image/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Image/Image.fastimage.tsx +1 -1
- package/src/components/Image/index.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_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","tintColor","disableFastImage","props","createElement","Image","e","nativeEvent","_default","exports"],"sources":["Image.fastimage.tsx"],"sourcesContent":["import React from 'react';\nimport { Image } from 'react-native';\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 tintColor,\n disableFastImage,\n ...props\n}) => {\n if (disableFastImage) {\n return (\n <Image\n {...props}\n source={source}\n style={[style, { tintColor }]}\n onError={onError && ((e) => onError(e.nativeEvent))}\n onLoad={onLoad && ((e) => onLoad(e.nativeEvent.source))}\n />\n );\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;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAoD,SAAAD,uBAAAI,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,M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NC,OAAO;IACPC,KAAK;IACLC,SAAS;IACTC,gBAAgB;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_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","tintColor","disableFastImage","props","createElement","Image","e","nativeEvent","_default","exports"],"sources":["Image.fastimage.tsx"],"sourcesContent":["import React from 'react';\nimport { Image } from 'react-native';\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 tintColor,\n disableFastImage = false,\n ...props\n}) => {\n if (disableFastImage) {\n return (\n <Image\n {...props}\n source={source}\n style={[style, { tintColor }]}\n onError={onError && ((e) => onError(e.nativeEvent))}\n onLoad={onLoad && ((e) => onLoad(e.nativeEvent.source))}\n />\n );\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;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAoD,SAAAD,uBAAAI,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,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,MAAM,KAAMQ,CAAC,IAAKR,MAAM,CAACQ,CAAC,CAACC,WAAW,CAAC9B,MAAM,CAAC;IAAE,GACxD;EAEN;EACA,oBACEhB,MAAA,CAAAO,OAAA,CAAAoC,aAAA,CAACvC,kBAAA,CAAAG,OAAiB,EAAAC,QAAA,KACZkC,KAAK;IACTL,MAAM,EAAEA,MAAM,KAAMQ,CAAC,IAAKR,MAAM,CAACQ,CAAC,CAACC,WAAW,CAAC,CAAE;IACjDR,OAAO,EAAEA,OAAO,KAAK,MAAMA,OAAO,CAAC,CAAC,CAAC,CAAC,CAAE;IACxCC,KAAK,EAAEA,KAAiC;IACxCvB,MAAM,EAAEQ,aAAa,CAACR,MAAM,CAAE;IAC9BmB,aAAa,EAAEN,oBAAoB,CAACM,aAAa,CAAE;IACnDC,UAAU,EAAEL,iBAAiB,CAACK,UAAU;EAAE,GAC1C;AAEN,CAAC;AAAC,IAAAW,QAAA,GAEad,eAAe;AAAAe,OAAA,CAAAzC,OAAA,GAAAwC,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","getImageModule","hasFastImage","Boolean","NativeModules","FastImageView","default","e","Image","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","getImageModule","hasFastImage","Boolean","NativeModules","FastImageView","default","e","Image","_default","exports"],"sources":["index.ts"],"sourcesContent":["import { ComponentType } from 'react';\nimport type { ImageProps as NativeImageProps } from 'react-native';\nimport { NativeModules } from 'react-native';\n\nexport interface SendbirdImageProps extends Omit<NativeImageProps, 'onLoad' | 'onError'> {\n disableFastImage?: boolean;\n onLoad?: (event: { width: number; height: number }) => void;\n onError?: (event: { error?: unknown }) => void;\n tintColor?: string;\n}\n\nexport type SendbirdImageComponent = ComponentType<SendbirdImageProps>;\nfunction getImageModule(): SendbirdImageComponent {\n const hasFastImage = Boolean(NativeModules.FastImageView);\n if (hasFastImage) {\n try {\n return require('./Image.fastimage').default;\n } catch (e) {\n return require('./Image.reactnative').default;\n }\n } else {\n return require('./Image.reactnative').default;\n }\n}\n\nconst Image = getImageModule();\n\nexport default Image;\n"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AAUA,SAASC,cAAcA,CAAA,EAA2B;EAChD,MAAMC,YAAY,GAAGC,OAAO,CAACC,0BAAa,CAACC,aAAa,CAAC;EACzD,IAAIH,YAAY,EAAE;IAChB,IAAI;MACF,OAAOF,OAAO,CAAC,mBAAmB,CAAC,CAACM,OAAO;IAC7C,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,OAAOP,OAAO,CAAC,qBAAqB,CAAC,CAACM,OAAO;IAC/C;EACF,CAAC,MAAM;IACL,OAAON,OAAO,CAAC,qBAAqB,CAAC,CAACM,OAAO;EAC/C;AACF;AAEA,MAAME,KAAK,GAAGP,cAAc,EAAE;AAAC,IAAAQ,QAAA,GAEhBD,KAAK;AAAAE,OAAA,CAAAJ,OAAA,GAAAG,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Image","FastImageInternal","convertCache","cache","convertSource","source","Array","isArray","uri","headers","convertDefaultSource","undefined","convertResizeMode","mode","Image_FastImage","_ref","defaultSource","resizeMode","onLoad","onError","style","tintColor","disableFastImage","props","createElement","_extends","e","nativeEvent"],"sources":["Image.fastimage.tsx"],"sourcesContent":["import React from 'react';\nimport { Image } from 'react-native';\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 tintColor,\n disableFastImage,\n ...props\n}) => {\n if (disableFastImage) {\n return (\n <Image\n {...props}\n source={source}\n style={[style, { tintColor }]}\n onError={onError && ((e) => onError(e.nativeEvent))}\n onLoad={onLoad && ((e) => onLoad(e.nativeEvent.source))}\n />\n );\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;AACzB,SAASC,KAAK,QAAQ,cAAc;AAGpC,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,IAU1C;EAAA,IAV2C;IAC/CV,MAAM;IACNW,aAAa;IACbC,UAAU;IACVC,MAAM;IACNC,OAAO;IACPC,KAAK;IACLC,SAAS;IACTC,gBAAgB;
|
|
1
|
+
{"version":3,"names":["React","Image","FastImageInternal","convertCache","cache","convertSource","source","Array","isArray","uri","headers","convertDefaultSource","undefined","convertResizeMode","mode","Image_FastImage","_ref","defaultSource","resizeMode","onLoad","onError","style","tintColor","disableFastImage","props","createElement","_extends","e","nativeEvent"],"sources":["Image.fastimage.tsx"],"sourcesContent":["import React from 'react';\nimport { Image } from 'react-native';\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 tintColor,\n disableFastImage = false,\n ...props\n}) => {\n if (disableFastImage) {\n return (\n <Image\n {...props}\n source={source}\n style={[style, { tintColor }]}\n onError={onError && ((e) => onError(e.nativeEvent))}\n onLoad={onLoad && ((e) => onLoad(e.nativeEvent.source))}\n />\n );\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;AACzB,SAASC,KAAK,QAAQ,cAAc;AAGpC,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,IA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AM,KAAMQ,CAAC,IAAKR,MAAM,CAACQ,CAAC,CAACC,WAAW,CAACtB,MAAM,CAAC;IAAE,GACxD;EAEN;EACA,oBACEN,KAAA,CAAAyB,aAAA,CAACvB,iBAAiB,EAAAwB,QAAA,KACZF,KAAK;IACTL,MAAM,EAAEA,MAAM,KAAMQ,CAAC,IAAKR,MAAM,CAACQ,CAAC,CAACC,WAAW,CAAC,CAAE;IACjDR,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","getImageModule","hasFastImage","Boolean","FastImageView","require","default","e","Image"
|
|
1
|
+
{"version":3,"names":["NativeModules","getImageModule","hasFastImage","Boolean","FastImageView","require","default","e","Image"],"sources":["index.ts"],"sourcesContent":["import { ComponentType } from 'react';\nimport type { ImageProps as NativeImageProps } from 'react-native';\nimport { NativeModules } from 'react-native';\n\nexport interface SendbirdImageProps extends Omit<NativeImageProps, 'onLoad' | 'onError'> {\n disableFastImage?: boolean;\n onLoad?: (event: { width: number; height: number }) => void;\n onError?: (event: { error?: unknown }) => void;\n tintColor?: string;\n}\n\nexport type SendbirdImageComponent = ComponentType<SendbirdImageProps>;\nfunction getImageModule(): SendbirdImageComponent {\n const hasFastImage = Boolean(NativeModules.FastImageView);\n if (hasFastImage) {\n try {\n return require('./Image.fastimage').default;\n } catch (e) {\n return require('./Image.reactnative').default;\n }\n } else {\n return require('./Image.reactnative').default;\n }\n}\n\nconst Image = getImageModule();\n\nexport default Image;\n"],"mappings":"AAEA,SAASA,aAAa,QAAQ,cAAc;AAU5C,SAASC,cAAcA,CAAA,EAA2B;EAChD,MAAMC,YAAY,GAAGC,OAAO,CAACH,aAAa,CAACI,aAAa,CAAC;EACzD,IAAIF,YAAY,EAAE;IAChB,IAAI;MACF,OAAOG,OAAO,CAAC,mBAAmB,CAAC,CAACC,OAAO;IAC7C,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,OAAOF,OAAO,CAAC,qBAAqB,CAAC,CAACC,OAAO;IAC/C;EACF,CAAC,MAAM;IACL,OAAOD,OAAO,CAAC,qBAAqB,CAAC,CAACC,OAAO;EAC/C;AACF;AAEA,MAAME,KAAK,GAAGP,cAAc,EAAE;AAE9B,eAAeO,KAAK"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendbird/uikit-react-native-foundation",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.4",
|
|
4
4
|
"description": "A foundational UI kit for building chat-enabled React Native apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sendbird",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@sendbird/uikit-utils": "3.5.
|
|
51
|
+
"@sendbird/uikit-utils": "3.5.4"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/react": "*",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
]
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "98ab944367959657368a0f2f2abb3782b2fb88f2"
|
|
89
89
|
}
|