diff --git a/.gitignore b/.gitignore index 660b87b92..c9b146d5a 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,6 @@ example/android/app/src/main/gen # build react-native-fast-image-*.tgz -dist/ # coverage reports coverage diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 000000000..eecbd495e --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,100 @@ +import React from 'react'; +import { FlexStyle, LayoutChangeEvent, ShadowStyleIOS, StyleProp, TransformsStyle } from 'react-native'; +declare type ResizeMode = 'contain' | 'cover' | 'stretch' | 'center'; +declare const resizeMode: { + readonly contain: "contain"; + readonly cover: "cover"; + readonly stretch: "stretch"; + readonly center: "center"; +}; +declare type Priority = 'low' | 'normal' | 'high'; +declare const priority: { + readonly low: "low"; + readonly normal: "normal"; + readonly high: "high"; +}; +declare type Cache = 'low' | 'normal' | 'high'; +declare const cacheControl: { + readonly immutable: "immutable"; + readonly web: "web"; + readonly cacheOnly: "cacheOnly"; +}; +export declare type Source = { + uri?: string; + headers?: { + [key: string]: string; + }; + priority?: Priority; + cache?: Cache; +}; +export interface OnLoadEvent { + nativeEvent: { + width: number; + height: number; + }; +} +export interface OnProgressEvent { + nativeEvent: { + loaded: number; + total: number; + }; +} +export interface ImageStyle extends FlexStyle, TransformsStyle, ShadowStyleIOS { + backfaceVisibility?: 'visible' | 'hidden'; + borderBottomLeftRadius?: number; + borderBottomRightRadius?: number; + backgroundColor?: string; + borderColor?: string; + borderWidth?: number; + borderRadius?: number; + borderTopLeftRadius?: number; + borderTopRightRadius?: number; + overlayColor?: string; + tintColor?: string; + opacity?: number; +} +export interface FastImageProps { + source: Source | number; + resizeMode?: ResizeMode; + fallback?: boolean; + onLoadStart?(): void; + onProgress?(event: OnProgressEvent): void; + onLoad?(event: OnLoadEvent): void; + onError?(): void; + onLoadEnd?(): void; + /** + * onLayout function + * + * Invoked on mount and layout changes with + * + * {nativeEvent: { layout: {x, y, width, height}}}. + */ + onLayout?: (event: LayoutChangeEvent) => void; + /** + * + * Style + */ + style?: StyleProp; + /** + * TintColor + * + * If supplied, changes the color of all the non-transparent pixels to the given color. + */ + tintColor?: number | string; + /** + * A unique identifier for this element to be used in UI Automation testing scripts. + */ + testID?: string; + /** + * Render children within the image. + */ + children?: React.ReactNode; +} +interface FastImageStaticProperties { + resizeMode: typeof resizeMode; + priority: typeof priority; + cacheControl: typeof cacheControl; + preload: (sources: Source[]) => void; +} +declare const FastImage: React.ComponentType & FastImageStaticProperties; +export default FastImage; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 000000000..0127b1b20 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,8 @@ + +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./react-native-fast-image.cjs.production.min.js') +} else { + module.exports = require('./react-native-fast-image.cjs.development.js') +} diff --git a/dist/index.js.flow b/dist/index.js.flow new file mode 100644 index 000000000..71fac3a92 --- /dev/null +++ b/dist/index.js.flow @@ -0,0 +1,71 @@ +// @flow + +import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes' +import type { SyntheticEvent } from 'react-native/Libraries/Types/CoreEventTypes' + +export type OnLoadEvent = SyntheticEvent< + $ReadOnly<{ + width: number, + height: number, + }>, +> + +export type OnProgressEvent = SyntheticEvent< + $ReadOnly<{| + loaded: number, + total: number, + |}>, +> + +export type ResizeMode = $ReadOnly<{| + contain: 'contain', + cover: 'cover', + stretch: 'stretch', + center: 'center', +|}> + +export type Priority = $ReadOnly<{| + low: 'low', + normal: 'normal', + high: 'high', +|}> + +export type CacheControl = $ReadOnly<{| + immutable: 'immutable', + web: 'web', + cacheOnly: 'cacheOnly', +|}> + +export type ResizeModes = $Values +export type Priorities = $Values +export type CacheControls = $Values + +export type PreloadFn = (sources: Array) => void +export type FastImageSource = { + uri?: string, + headers?: Object, + priority?: Priorities, + cache?: CacheControls, +} + +export type FastImageProps = $ReadOnly<{| + ...ViewProps, + onError?: ?() => void, + onLoad?: ?(event: OnLoadEvent) => void, + onLoadEnd?: ?() => void, + onLoadStart?: ?() => void, + onProgress?: ?(event: OnProgressEvent) => void, + + source: FastImageSource | number, + + resizeMode?: ?ResizeModes, + fallback?: ?boolean, + testID?: ?string, +|}> + +declare export default class FastImage extends React$Component { + static resizeMode: ResizeMode; + static priority: Priority; + static cacheControl: CacheControl; + static preload: PreloadFn; +} diff --git a/dist/index.test.d.ts b/dist/index.test.d.ts new file mode 100644 index 000000000..509db1866 --- /dev/null +++ b/dist/index.test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/react-native-fast-image.cjs.development.js b/dist/react-native-fast-image.cjs.development.js new file mode 100644 index 000000000..6af09202c --- /dev/null +++ b/dist/react-native-fast-image.cjs.development.js @@ -0,0 +1,130 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var React = require('react'); +var React__default = _interopDefault(React); +var reactNative = require('react-native'); + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +var FastImageViewNativeModule = reactNative.NativeModules.FastImageView; +var resizeMode = { + contain: 'contain', + cover: 'cover', + stretch: 'stretch', + center: 'center' +}; +var priority = { + low: 'low', + normal: 'normal', + high: 'high' +}; +var cacheControl = { + // Ignore headers, use uri as cache key, fetch only if not in cache. + immutable: 'immutable', + // Respect http headers, no aggressive caching. + web: 'web', + // Only load from cache. + cacheOnly: 'cacheOnly' +}; + +function FastImageBase(_ref) { + var source = _ref.source, + tintColor = _ref.tintColor, + onLoadStart = _ref.onLoadStart, + onProgress = _ref.onProgress, + onLoad = _ref.onLoad, + onError = _ref.onError, + onLoadEnd = _ref.onLoadEnd, + style = _ref.style, + fallback = _ref.fallback, + children = _ref.children, + _ref$resizeMode = _ref.resizeMode, + resizeMode = _ref$resizeMode === void 0 ? 'cover' : _ref$resizeMode, + forwardedRef = _ref.forwardedRef, + props = _objectWithoutPropertiesLoose(_ref, ["source", "tintColor", "onLoadStart", "onProgress", "onLoad", "onError", "onLoadEnd", "style", "fallback", "children", "resizeMode", "forwardedRef"]); + + var resolvedSource = reactNative.Image.resolveAssetSource(source); + + if (fallback) { + return React__default.createElement(reactNative.View, { + style: [styles.imageContainer, style], + ref: forwardedRef + }, React__default.createElement(reactNative.Image, Object.assign({}, props, { + style: reactNative.StyleSheet.absoluteFill, + source: resolvedSource, + onLoadStart: onLoadStart, + onProgress: onProgress, + onLoad: onLoad, + onError: onError, + onLoadEnd: onLoadEnd, + resizeMode: resizeMode + })), children); + } + + return React__default.createElement(reactNative.View, { + style: [styles.imageContainer, style], + ref: forwardedRef + }, React__default.createElement(FastImageView, Object.assign({}, props, { + tintColor: tintColor, + style: reactNative.StyleSheet.absoluteFill, + source: resolvedSource, + onFastImageLoadStart: onLoadStart, + onFastImageProgress: onProgress, + onFastImageLoad: onLoad, + onFastImageError: onError, + onFastImageLoadEnd: onLoadEnd, + resizeMode: resizeMode + })), children); +} + +var FastImageMemo = /*#__PURE__*/React.memo(FastImageBase); +var FastImageComponent = /*#__PURE__*/React.forwardRef(function (props, ref) { + return React__default.createElement(FastImageMemo, Object.assign({ + forwardedRef: ref + }, props)); +}); +FastImageComponent.displayName = 'FastImage'; +var FastImage = FastImageComponent; +FastImage.resizeMode = resizeMode; +FastImage.cacheControl = cacheControl; +FastImage.priority = priority; + +FastImage.preload = function (sources) { + return FastImageViewNativeModule.preload(sources); +}; + +var styles = /*#__PURE__*/reactNative.StyleSheet.create({ + imageContainer: { + overflow: 'hidden' + } +}); // Types of requireNativeComponent are not correct. + +var FastImageView = /*#__PURE__*/reactNative.requireNativeComponent('FastImageView', FastImage, { + nativeOnly: { + onFastImageLoadStart: true, + onFastImageProgress: true, + onFastImageLoad: true, + onFastImageError: true, + onFastImageLoadEnd: true + } +}); + +exports.default = FastImage; +//# sourceMappingURL=react-native-fast-image.cjs.development.js.map diff --git a/dist/react-native-fast-image.cjs.development.js.map b/dist/react-native-fast-image.cjs.development.js.map new file mode 100644 index 000000000..7ad890028 --- /dev/null +++ b/dist/react-native-fast-image.cjs.development.js.map @@ -0,0 +1 @@ +{"version":3,"file":"react-native-fast-image.cjs.development.js","sources":["../src/index.tsx"],"sourcesContent":["import React, { forwardRef, memo } from 'react'\nimport {\n View,\n Image,\n NativeModules,\n requireNativeComponent,\n StyleSheet,\n FlexStyle,\n LayoutChangeEvent,\n ShadowStyleIOS,\n StyleProp,\n TransformsStyle,\n} from 'react-native'\n\nconst FastImageViewNativeModule = NativeModules.FastImageView\n\ntype ResizeMode = 'contain' | 'cover' | 'stretch' | 'center'\n\nconst resizeMode = {\n contain: 'contain',\n cover: 'cover',\n stretch: 'stretch',\n center: 'center',\n} as const\n\ntype Priority = 'low' | 'normal' | 'high'\n\nconst priority = {\n low: 'low',\n normal: 'normal',\n high: 'high',\n} as const\n\ntype Cache = 'low' | 'normal' | 'high'\n\nconst cacheControl = {\n // Ignore headers, use uri as cache key, fetch only if not in cache.\n immutable: 'immutable',\n // Respect http headers, no aggressive caching.\n web: 'web',\n // Only load from cache.\n cacheOnly: 'cacheOnly',\n} as const\n\nexport type Source = {\n uri?: string\n headers?: { [key: string]: string }\n priority?: Priority\n cache?: Cache\n}\n\nexport interface OnLoadEvent {\n nativeEvent: {\n width: number\n height: number\n }\n}\n\nexport interface OnProgressEvent {\n nativeEvent: {\n loaded: number\n total: number\n }\n}\n\nexport interface ImageStyle extends FlexStyle, TransformsStyle, ShadowStyleIOS {\n backfaceVisibility?: 'visible' | 'hidden'\n borderBottomLeftRadius?: number\n borderBottomRightRadius?: number\n backgroundColor?: string\n borderColor?: string\n borderWidth?: number\n borderRadius?: number\n borderTopLeftRadius?: number\n borderTopRightRadius?: number\n overlayColor?: string\n tintColor?: string\n opacity?: number\n}\n\nexport interface FastImageProps {\n source: Source | number\n resizeMode?: ResizeMode\n fallback?: boolean\n\n onLoadStart?(): void\n\n onProgress?(event: OnProgressEvent): void\n\n onLoad?(event: OnLoadEvent): void\n\n onError?(): void\n\n onLoadEnd?(): void\n\n /**\n * onLayout function\n *\n * Invoked on mount and layout changes with\n *\n * {nativeEvent: { layout: {x, y, width, height}}}.\n */\n onLayout?: (event: LayoutChangeEvent) => void\n\n /**\n *\n * Style\n */\n style?: StyleProp\n\n /**\n * TintColor\n *\n * If supplied, changes the color of all the non-transparent pixels to the given color.\n */\n\n tintColor?: number | string\n\n /**\n * A unique identifier for this element to be used in UI Automation testing scripts.\n */\n testID?: string\n\n /**\n * Render children within the image.\n */\n children?: React.ReactNode\n}\n\nfunction FastImageBase({\n source,\n tintColor,\n onLoadStart,\n onProgress,\n onLoad,\n onError,\n onLoadEnd,\n style,\n fallback,\n children,\n resizeMode = 'cover',\n forwardedRef,\n ...props\n}: FastImageProps & { forwardedRef: React.Ref }) {\n const resolvedSource = Image.resolveAssetSource(source as any)\n\n if (fallback) {\n return (\n \n \n {children}\n \n )\n }\n\n return (\n \n \n {children}\n \n )\n}\n\nconst FastImageMemo = memo(FastImageBase)\n\nconst FastImageComponent: React.ComponentType = forwardRef(\n (props: FastImageProps, ref: React.Ref) => (\n \n ),\n)\n\nFastImageComponent.displayName = 'FastImage'\n\ninterface FastImageStaticProperties {\n resizeMode: typeof resizeMode\n priority: typeof priority\n cacheControl: typeof cacheControl\n preload: (sources: Source[]) => void\n}\n\nconst FastImage: React.ComponentType &\n FastImageStaticProperties = FastImageComponent as any\n\nFastImage.resizeMode = resizeMode\n\nFastImage.cacheControl = cacheControl\n\nFastImage.priority = priority\n\nFastImage.preload = (sources: Source[]) =>\n FastImageViewNativeModule.preload(sources)\n\nconst styles = StyleSheet.create({\n imageContainer: {\n overflow: 'hidden',\n },\n})\n\n// Types of requireNativeComponent are not correct.\nconst FastImageView = (requireNativeComponent as any)(\n 'FastImageView',\n FastImage,\n {\n nativeOnly: {\n onFastImageLoadStart: true,\n onFastImageProgress: true,\n onFastImageLoad: true,\n onFastImageError: true,\n onFastImageLoadEnd: true,\n },\n },\n)\n\nexport default FastImage\n"],"names":["FastImageViewNativeModule","NativeModules","FastImageView","resizeMode","contain","cover","stretch","center","priority","low","normal","high","cacheControl","immutable","web","cacheOnly","FastImageBase","source","tintColor","onLoadStart","onProgress","onLoad","onError","onLoadEnd","style","fallback","children","forwardedRef","props","resolvedSource","Image","resolveAssetSource","React","View","styles","imageContainer","ref","StyleSheet","absoluteFill","onFastImageLoadStart","onFastImageProgress","onFastImageLoad","onFastImageError","onFastImageLoadEnd","FastImageMemo","memo","FastImageComponent","forwardRef","displayName","FastImage","preload","sources","create","overflow","requireNativeComponent","nativeOnly"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAcA,IAAMA,yBAAyB,GAAGC,yBAAa,CAACC,aAAhD;AAIA,IAAMC,UAAU,GAAG;AACfC,EAAAA,OAAO,EAAE,SADM;AAEfC,EAAAA,KAAK,EAAE,OAFQ;AAGfC,EAAAA,OAAO,EAAE,SAHM;AAIfC,EAAAA,MAAM,EAAE;AAJO,CAAnB;AASA,IAAMC,QAAQ,GAAG;AACbC,EAAAA,GAAG,EAAE,KADQ;AAEbC,EAAAA,MAAM,EAAE,QAFK;AAGbC,EAAAA,IAAI,EAAE;AAHO,CAAjB;AAQA,IAAMC,YAAY,GAAG;AACjB;AACAC,EAAAA,SAAS,EAAE,WAFM;AAGjB;AACAC,EAAAA,GAAG,EAAE,KAJY;AAKjB;AACAC,EAAAA,SAAS,EAAE;AANM,CAArB;;AA8FA,SAASC,aAAT;MACIC,cAAAA;MACAC,iBAAAA;MACAC,mBAAAA;MACAC,kBAAAA;MACAC,cAAAA;MACAC,eAAAA;MACAC,iBAAAA;MACAC,aAAAA;MACAC,gBAAAA;MACAC,gBAAAA;6BACAvB;MAAAA,0CAAa;MACbwB,oBAAAA;MACGC;;AAEH,MAAMC,cAAc,GAAGC,iBAAK,CAACC,kBAAN,CAA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AnB,GAAiC,WAAjC;AASA,IAAMC,SAAS,GACiBH,kBADhC;AAGAG,SAAS,CAAC9C,UAAV,GAAuBA,UAAvB;AAEA8C,SAAS,CAACrC,YAAV,GAAyBA,YAAzB;AAEAqC,SAAS,CAACzC,QAAV,GAAqBA,QAArB;;AAEAyC,SAAS,CAACC,OAAV,GAAoB,UAACC,OAAD;AAAA,SAChBnD,yBAAyB,CAACkD,OAA1B,CAAkCC,OAAlC,CADgB;AAAA,CAApB;;AAGA,IAAMjB,MAAM,gBAAGG,sBAAU,CAACe,MAAX,CAAkB;AAC7BjB,EAAAA,cAAc,EAAE;AACZkB,IAAAA,QAAQ,EAAE;AADE;AADa,CAAlB,CAAf;;AAOA,IAAMnD,aAAa,gBAAIoD,kCAA8B,CACjD,eADiD,EAEjDL,SAFiD,EAGjD;AACIM,EAAAA,UAAU,EAAE;AACRhB,IAAAA,oBAAoB,EAAE,IADd;AAERC,IAAAA,mBAAmB,EAAE,IAFb;AAGRC,IAAAA,eAAe,EAAE,IAHT;AAIRC,IAAAA,gBAAgB,EAAE,IAJV;AAKRC,IAAAA,kBAAkB,EAAE;AALZ;AADhB,CAHiD,CAArD;;;;"} \ No newline at end of file diff --git a/dist/react-native-fast-image.cjs.production.min.js b/dist/react-native-fast-image.cjs.production.min.js new file mode 100644 index 000000000..2c85f4e92 --- /dev/null +++ b/dist/react-native-fast-image.cjs.production.min.js @@ -0,0 +1,2 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,o=require("react"),r=(e=o)&&"object"==typeof e&&"default"in e?e.default:e,a=require("react-native"),t=a.NativeModules.FastImageView;function n(e){var o=e.source,t=e.tintColor,n=e.onLoadStart,s=e.onProgress,l=e.onLoad,i=e.onError,m=e.onLoadEnd,u=e.style,g=e.fallback,f=e.children,v=e.resizeMode,h=void 0===v?"cover":v,y=e.forwardedRef,F=function(e,o){if(null==e)return{};var r,a,t={},n=Object.keys(e);for(a=0;a=0||(t[r]=e[r]);return t}(e,["source","tintColor","onLoadStart","onProgress","onLoad","onError","onLoadEnd","style","fallback","children","resizeMode","forwardedRef"]),I=a.Image.resolveAssetSource(o);return r.createElement(a.View,{style:[d.imageContainer,u],ref:y},g?r.createElement(a.Image,Object.assign({},F,{style:a.StyleSheet.absoluteFill,source:I,onLoadStart:n,onProgress:s,onLoad:l,onError:i,onLoadEnd:m,resizeMode:h})):r.createElement(c,Object.assign({},F,{tintColor:t,style:a.StyleSheet.absoluteFill,source:I,onFastImageLoadStart:n,onFastImageProgress:s,onFastImageLoad:l,onFastImageError:i,onFastImageLoadEnd:m,resizeMode:h})),f)}var s=o.memo(n),l=o.forwardRef((function(e,o){return r.createElement(s,Object.assign({forwardedRef:o},e))}));l.displayName="FastImage";var i=l;i.resizeMode={contain:"contain",cover:"cover",stretch:"stretch",center:"center"},i.cacheControl={immutable:"immutable",web:"web",cacheOnly:"cacheOnly"},i.priority={low:"low",normal:"normal",high:"high"},i.preload=function(e){return t.preload(e)};var d=a.StyleSheet.create({imageContainer:{overflow:"hidden"}}),c=a.requireNativeComponent("FastImageView",i,{nativeOnly:{onFastImageLoadStart:!0,onFastImageProgress:!0,onFastImageLoad:!0,onFastImageError:!0,onFastImageLoadEnd:!0}});exports.default=i; +//# sourceMappingURL=react-native-fast-image.cjs.production.min.js.map diff --git a/dist/react-native-fast-image.cjs.production.min.js.map b/dist/react-native-fast-image.cjs.production.min.js.map new file mode 100644 index 000000000..0a38de585 --- /dev/null +++ b/dist/react-native-fast-image.cjs.production.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"react-native-fast-image.cjs.production.min.js","sources":["../src/index.tsx"],"sourcesContent":["import React, { forwardRef, memo } from 'react'\nimport {\n View,\n Image,\n NativeModules,\n requireNativeComponent,\n StyleSheet,\n FlexStyle,\n LayoutChangeEvent,\n ShadowStyleIOS,\n StyleProp,\n TransformsStyle,\n} from 'react-native'\n\nconst FastImageViewNativeModule = NativeModules.FastImageView\n\ntype ResizeMode = 'contain' | 'cover' | 'stretch' | 'center'\n\nconst resizeMode = {\n contain: 'contain',\n cover: 'cover',\n stretch: 'stretch',\n center: 'center',\n} as const\n\ntype Priority = 'low' | 'normal' | 'high'\n\nconst priority = {\n low: 'low',\n normal: 'normal',\n high: 'high',\n} as const\n\ntype Cache = 'low' | 'normal' | 'high'\n\nconst cacheControl = {\n // Ignore headers, use uri as cache key, fetch only if not in cache.\n immutable: 'immutable',\n // Respect http headers, no aggressive caching.\n web: 'web',\n // Only load from cache.\n cacheOnly: 'cacheOnly',\n} as const\n\nexport type Source = {\n uri?: string\n headers?: { [key: string]: string }\n priority?: Priority\n cache?: Cache\n}\n\nexport interface OnLoadEvent {\n nativeEvent: {\n width: number\n height: number\n }\n}\n\nexport interface OnProgressEvent {\n nativeEvent: {\n loaded: number\n total: number\n }\n}\n\nexport interface ImageStyle extends FlexStyle, TransformsStyle, ShadowStyleIOS {\n backfaceVisibility?: 'visible' | 'hidden'\n borderBottomLeftRadius?: number\n borderBottomRightRadius?: number\n backgroundColor?: string\n borderColor?: string\n borderWidth?: number\n borderRadius?: number\n borderTopLeftRadius?: number\n borderTopRightRadius?: number\n overlayColor?: string\n tintColor?: string\n opacity?: number\n}\n\nexport interface FastImageProps {\n source: Source | number\n resizeMode?: ResizeMode\n fallback?: boolean\n\n onLoadStart?(): void\n\n onProgress?(event: OnProgressEvent): void\n\n onLoad?(event: OnLoadEvent): void\n\n onError?(): void\n\n onLoadEnd?(): void\n\n /**\n * onLayout function\n *\n * Invoked on mount and layout changes with\n *\n * {nativeEvent: { layout: {x, y, width, height}}}.\n */\n onLayout?: (event: LayoutChangeEvent) => void\n\n /**\n *\n * Style\n */\n style?: StyleProp\n\n /**\n * TintColor\n *\n * If supplied, changes the color of all the non-transparent pixels to the given color.\n */\n\n tintColor?: number | string\n\n /**\n * A unique identifier for this element to be used in UI Automation testing scripts.\n */\n testID?: string\n\n /**\n * Render children within the image.\n */\n children?: React.ReactNode\n}\n\nfunction FastImageBase({\n source,\n tintColor,\n onLoadStart,\n onProgress,\n onLoad,\n onError,\n onLoadEnd,\n style,\n fallback,\n children,\n resizeMode = 'cover',\n forwardedRef,\n ...props\n}: FastImageProps & { forwardedRef: React.Ref }) {\n const resolvedSource = Image.resolveAssetSource(source as any)\n\n if (fallback) {\n return (\n \n \n {children}\n \n )\n }\n\n return (\n \n \n {children}\n \n )\n}\n\nconst FastImageMemo = memo(FastImageBase)\n\nconst FastImageComponent: React.ComponentType = forwardRef(\n (props: FastImageProps, ref: React.Ref) => (\n \n ),\n)\n\nFastImageComponent.displayName = 'FastImage'\n\ninterface FastImageStaticProperties {\n resizeMode: typeof resizeMode\n priority: typeof priority\n cacheControl: typeof cacheControl\n preload: (sources: Source[]) => void\n}\n\nconst FastImage: React.ComponentType &\n FastImageStaticProperties = FastImageComponent as any\n\nFastImage.resizeMode = resizeMode\n\nFastImage.cacheControl = cacheControl\n\nFastImage.priority = priority\n\nFastImage.preload = (sources: Source[]) =>\n FastImageViewNativeModule.preload(sources)\n\nconst styles = StyleSheet.create({\n imageContainer: {\n overflow: 'hidden',\n },\n})\n\n// Types of requireNativeComponent are not correct.\nconst FastImageView = (requireNativeComponent as any)(\n 'FastImageView',\n FastImage,\n {\n nativeOnly: {\n onFastImageLoadStart: true,\n onFastImageProgress: true,\n onFastImageLoad: true,\n onFastImageError: true,\n onFastImageLoadEnd: true,\n },\n },\n)\n\nexport default FastImage\n"],"names":["FastImageViewNativeModule","NativeModules","FastImageView","FastImageBase","source","tintColor","onLoadStart","onProgress","onLoad","onError","onLoadEnd","style","fallback","children","resizeMode","forwardedRef","props","resolvedSource","Image","resolveAssetSource","React","View","styles","imageContainer","ref","StyleSheet","absoluteFill","onFastImageLoadStart","onFastImageProgress","onFastImageLoad","onFastImageError","onFastImageLoadEnd","FastImageMemo","memo","FastImageComponent","forwardRef","displayName","FastImage","contain","cover","stretch","center","cacheControl","immutable","web","cacheOnly","priority","low","normal","high","preload","sources","create","overflow","requireNativeComponent","nativeOnly"],"mappings":"8KAcMA,EAA4BC,g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oB"} \ No newline at end of file diff --git a/dist/react-native-fast-image.esm.js b/dist/react-native-fast-image.esm.js new file mode 100644 index 000000000..77bd06e94 --- /dev/null +++ b/dist/react-native-fast-image.esm.js @@ -0,0 +1,123 @@ +import React, { forwardRef, memo } from 'react'; +import { NativeModules, Image, View, StyleSheet, requireNativeComponent } from 'react-native'; + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +var FastImageViewNativeModule = NativeModules.FastImageView; +var resizeMode = { + contain: 'contain', + cover: 'cover', + stretch: 'stretch', + center: 'center' +}; +var priority = { + low: 'low', + normal: 'normal', + high: 'high' +}; +var cacheControl = { + // Ignore headers, use uri as cache key, fetch only if not in cache. + immutable: 'immutable', + // Respect http headers, no aggressive caching. + web: 'web', + // Only load from cache. + cacheOnly: 'cacheOnly' +}; + +function FastImageBase(_ref) { + var source = _ref.source, + tintColor = _ref.tintColor, + onLoadStart = _ref.onLoadStart, + onProgress = _ref.onProgress, + onLoad = _ref.onLoad, + onError = _ref.onError, + onLoadEnd = _ref.onLoadEnd, + style = _ref.style, + fallback = _ref.fallback, + children = _ref.children, + _ref$resizeMode = _ref.resizeMode, + resizeMode = _ref$resizeMode === void 0 ? 'cover' : _ref$resizeMode, + forwardedRef = _ref.forwardedRef, + props = _objectWithoutPropertiesLoose(_ref, ["source", "tintColor", "onLoadStart", "onProgress", "onLoad", "onError", "onLoadEnd", "style", "fallback", "children", "resizeMode", "forwardedRef"]); + + var resolvedSource = Image.resolveAssetSource(source); + + if (fallback) { + return React.createElement(View, { + style: [styles.imageContainer, style], + ref: forwardedRef + }, React.createElement(Image, Object.assign({}, props, { + style: StyleSheet.absoluteFill, + source: resolvedSource, + onLoadStart: onLoadStart, + onProgress: onProgress, + onLoad: onLoad, + onError: onError, + onLoadEnd: onLoadEnd, + resizeMode: resizeMode + })), children); + } + + return React.createElement(View, { + style: [styles.imageContainer, style], + ref: forwardedRef + }, React.createElement(FastImageView, Object.assign({}, props, { + tintColor: tintColor, + style: StyleSheet.absoluteFill, + source: resolvedSource, + onFastImageLoadStart: onLoadStart, + onFastImageProgress: onProgress, + onFastImageLoad: onLoad, + onFastImageError: onError, + onFastImageLoadEnd: onLoadEnd, + resizeMode: resizeMode + })), children); +} + +var FastImageMemo = /*#__PURE__*/memo(FastImageBase); +var FastImageComponent = /*#__PURE__*/forwardRef(function (props, ref) { + return React.createElement(FastImageMemo, Object.assign({ + forwardedRef: ref + }, props)); +}); +FastImageComponent.displayName = 'FastImage'; +var FastImage = FastImageComponent; +FastImage.resizeMode = resizeMode; +FastImage.cacheControl = cacheControl; +FastImage.priority = priority; + +FastImage.preload = function (sources) { + return FastImageViewNativeModule.preload(sources); +}; + +var styles = /*#__PURE__*/StyleSheet.create({ + imageContainer: { + overflow: 'hidden' + } +}); // Types of requireNativeComponent are not correct. + +var FastImageView = /*#__PURE__*/requireNativeComponent('FastImageView', FastImage, { + nativeOnly: { + onFastImageLoadStart: true, + onFastImageProgress: true, + onFastImageLoad: true, + onFastImageError: true, + onFastImageLoadEnd: true + } +}); + +export default FastImage; +//# sourceMappingURL=react-native-fast-image.esm.js.map diff --git a/dist/react-native-fast-image.esm.js.map b/dist/react-native-fast-image.esm.js.map new file mode 100644 index 000000000..8d997c1e5 --- /dev/null +++ b/dist/react-native-fast-image.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"react-native-fast-image.esm.js","sources":["../src/index.tsx"],"sourcesContent":["import React, { forwardRef, memo } from 'react'\nimport {\n View,\n Image,\n NativeModules,\n requireNativeComponent,\n StyleSheet,\n FlexStyle,\n LayoutChangeEvent,\n ShadowStyleIOS,\n StyleProp,\n TransformsStyle,\n} from 'react-native'\n\nconst FastImageViewNativeModule = NativeModules.FastImageView\n\ntype ResizeMode = 'contain' | 'cover' | 'stretch' | 'center'\n\nconst resizeMode = {\n contain: 'contain',\n cover: 'cover',\n stretch: 'stretch',\n center: 'center',\n} as const\n\ntype Priority = 'low' | 'normal' | 'high'\n\nconst priority = {\n low: 'low',\n normal: 'normal',\n high: 'high',\n} as const\n\ntype Cache = 'low' | 'normal' | 'high'\n\nconst cacheControl = {\n // Ignore headers, use uri as cache key, fetch only if not in cache.\n immutable: 'immutable',\n // Respect http headers, no aggressive caching.\n web: 'web',\n // Only load from cache.\n cacheOnly: 'cacheOnly',\n} as const\n\nexport type Source = {\n uri?: string\n headers?: { [key: string]: string }\n priority?: Priority\n cache?: Cache\n}\n\nexport interface OnLoadEvent {\n nativeEvent: {\n width: number\n height: number\n }\n}\n\nexport interface OnProgressEvent {\n nativeEvent: {\n loaded: number\n total: number\n }\n}\n\nexport interface ImageStyle extends FlexStyle, TransformsStyle, ShadowStyleIOS {\n backfaceVisibility?: 'visible' | 'hidden'\n borderBottomLeftRadius?: number\n borderBottomRightRadius?: number\n backgroundColor?: string\n borderColor?: string\n borderWidth?: number\n borderRadius?: number\n borderTopLeftRadius?: number\n borderTopRightRadius?: number\n overlayColor?: string\n tintColor?: string\n opacity?: number\n}\n\nexport interface FastImageProps {\n source: Source | number\n resizeMode?: ResizeMode\n fallback?: boolean\n\n onLoadStart?(): void\n\n onProgress?(event: OnProgressEvent): void\n\n onLoad?(event: OnLoadEvent): void\n\n onError?(): void\n\n onLoadEnd?(): void\n\n /**\n * onLayout function\n *\n * Invoked on mount and layout changes with\n *\n * {nativeEvent: { layout: {x, y, width, height}}}.\n */\n onLayout?: (event: LayoutChangeEvent) => void\n\n /**\n *\n * Style\n */\n style?: StyleProp\n\n /**\n * TintColor\n *\n * If supplied, changes the color of all the non-transparent pixels to the given color.\n */\n\n tintColor?: number | string\n\n /**\n * A unique identifier for this element to be used in UI Automation testing scripts.\n */\n testID?: string\n\n /**\n * Render children within the image.\n */\n children?: React.ReactNode\n}\n\nfunction FastImageBase({\n source,\n tintColor,\n onLoadStart,\n onProgress,\n onLoad,\n onError,\n onLoadEnd,\n style,\n fallback,\n children,\n resizeMode = 'cover',\n forwardedRef,\n ...props\n}: FastImageProps & { forwardedRef: React.Ref }) {\n const resolvedSource = Image.resolveAssetSource(source as any)\n\n if (fallback) {\n return (\n \n \n {children}\n \n )\n }\n\n return (\n \n \n {children}\n \n )\n}\n\nconst FastImageMemo = memo(FastImageBase)\n\nconst FastImageComponent: React.ComponentType = forwardRef(\n (props: FastImageProps, ref: React.Ref) => (\n \n ),\n)\n\nFastImageComponent.displayName = 'FastImage'\n\ninterface FastImageStaticProperties {\n resizeMode: typeof resizeMode\n priority: typeof priority\n cacheControl: typeof cacheControl\n preload: (sources: Source[]) => void\n}\n\nconst FastImage: React.ComponentType &\n FastImageStaticProperties = FastImageComponent as any\n\nFastImage.resizeMode = resizeMode\n\nFastImage.cacheControl = cacheControl\n\nFastImage.priority = priority\n\nFastImage.preload = (sources: Source[]) =>\n FastImageViewNativeModule.preload(sources)\n\nconst styles = StyleSheet.create({\n imageContainer: {\n overflow: 'hidden',\n },\n})\n\n// Types of requireNativeComponent are not correct.\nconst FastImageView = (requireNativeComponent as any)(\n 'FastImageView',\n FastImage,\n {\n nativeOnly: {\n onFastImageLoadStart: true,\n onFastImageProgress: true,\n onFastImageLoad: true,\n onFastImageError: true,\n onFastImageLoadEnd: true,\n },\n },\n)\n\nexport default FastImage\n"],"names":["FastImageViewNativeModule","NativeModules","FastImageView","resizeMode","contain","cover","stretch","center","priority","low","normal","high","cacheControl","immutable","web","cacheOnly","FastImageBase","source","tintColor","onLoadStart","onProgress","onLoad","onError","onLoadEnd","style","fallback","children","forwardedRef","props","resolvedSource","Image","resolveAssetSource","React","View","styles","imageContainer","ref","StyleSheet","absoluteFill","onFastImageLoadStart","onFastImageProgress","onFastImageLoad","onFastImageError","onFastImageLoadEnd","FastImageMemo","memo","FastImageComponent","forwardRef","displayName","FastImage","preload","sources","create","overflow","requireNativeComponent","nativeOnly"],"mappings":";;;;;;;;;;;;;;;;;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EAGjD;AACIM,EAAAA,UAAU,EAAE;AACRhB,IAAAA,oBAAoB,EAAE,IADd;AAERC,IAAAA,mBAAmB,EAAE,IAFb;AAGRC,IAAAA,eAAe,EAAE,IAHT;AAIRC,IAAAA,gBAAgB,EAAE,IAJV;AAKRC,IAAAA,kBAAkB,EAAE;AALZ;AADhB,CAHiD,CAArD;;;;"} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 7c940dbe4..0dbe3b9ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3458,14 +3458,14 @@ debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: dependencies: ms "^2.1.1" -debug@^3.1.0, debug@^3.2.6: +debug@^3.1.0: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: ms "^2.1.1" -debuglog@*, debuglog@^1.0.1: +debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= @@ -3589,11 +3589,6 @@ detect-indent@~5.0.0: resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - detect-newline@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" @@ -5165,7 +5160,7 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -5240,7 +5235,7 @@ import-local@^2.0.0: pkg-dir "^3.0.0" resolve-cwd "^2.0.0" -imurmurhash@*, imurmurhash@^0.1.4: +imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= @@ -6619,11 +6614,6 @@ lockfile@^1.0.4: dependencies: signal-exit "^3.0.2" -lodash._baseindexof@*: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c" - integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw= - lodash._baseuniq@~4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" @@ -6632,33 +6622,11 @@ lodash._baseuniq@~4.6.0: lodash._createset "~4.0.0" lodash._root "~3.0.0" -lodash._bindcallback@*: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" - integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4= - -lodash._cacheindexof@*: - version "3.0.2" - resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92" - integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI= - -lodash._createcache@*: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093" - integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM= - dependencies: - lodash._getnative "^3.0.0" - lodash._createset@~4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY= -lodash._getnative@*, lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U= - lodash._root@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" @@ -6709,11 +6677,6 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.restparam@*: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU= - lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -7446,15 +7409,6 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -needle@^2.2.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.3.2.tgz#3342dea100b7160960a450dc8c22160ac712a528" - integrity sha512-DUzITvPVDUy6vczKKYTnWc/pBZ0EnjMJnQ3y+Jo5zfKFimJs7S3HFCxCRZYB9FUZcrzUQr3WsmvZgddMEIZv6w== - dependencies: - debug "^3.2.6" - iconv-lite "^0.4.4" - sax "^1.2.4" - negotiator@0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" @@ -7549,22 +7503,6 @@ node-notifier@^5.2.1, node-notifier@^5.4.2: shellwords "^0.1.1" which "^1.3.0" -node-pre-gyp@*: - version "0.14.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83" - integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4.4.2" - node-releases@^1.1.50: version "1.1.50" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.50.tgz#803c40d2c45db172d0410e4efec83aa8c6ad0592" @@ -7668,7 +7606,7 @@ npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1: semver "^5.6.0" validate-npm-package-name "^3.0.0" -npm-packlist@^1.1.12, npm-packlist@^1.1.6, npm-packlist@^1.4.8: +npm-packlist@^1.1.12, npm-packlist@^1.4.8: version "1.4.8" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.8.tgz#56ee6cc135b9f98ad3d51c1c95da22bbb9b2ef3e" integrity sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A== @@ -7848,7 +7786,7 @@ npm@^6.10.3: worker-farm "^1.7.0" write-file-atomic "^2.4.3" -npmlog@^4.0.2, npmlog@^4.1.2, npmlog@~4.1.2: +npmlog@^4.1.2, npmlog@~4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== @@ -8696,7 +8634,7 @@ range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -rc@^1.0.1, rc@^1.1.6, rc@^1.2.7, rc@^1.2.8: +rc@^1.0.1, rc@^1.1.6, rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -9250,7 +9188,7 @@ rimraf@2.6.3: dependencies: glob "^7.1.3" -rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: +rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -9490,7 +9428,7 @@ semver-regex@^2.0.0: resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338" integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw== -"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.1: +"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -10196,7 +10134,7 @@ table@^5.2.3: slice-ansi "^2.1.0" string-width "^3.0.0" -tar@^4.4.10, tar@^4.4.12, tar@^4.4.13, tar@^4.4.2: +tar@^4.4.10, tar@^4.4.12, tar@^4.4.13: version "4.4.13" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==