diff --git a/lib/Placeholder.d.ts b/lib/Placeholder.d.ts index fd850dc..f6f83a9 100644 --- a/lib/Placeholder.d.ts +++ b/lib/Placeholder.d.ts @@ -1,8 +1,8 @@ import React from "react"; import { ViewProps } from "react-native"; -export interface IPlaceholder extends ViewProps { +export interface PlaceholderProps extends ViewProps { Animation?: React.ComponentType; Left?: React.ComponentType; Right?: React.ComponentType; } -export declare const Placeholder: React.FC; +export declare const Placeholder: React.FC; diff --git a/lib/Placeholder.js b/lib/Placeholder.js index 0b98c8c..0cbdf5f 100644 --- a/lib/Placeholder.js +++ b/lib/Placeholder.js @@ -25,6 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; exports.__esModule = true; +exports.Placeholder = void 0; var react_1 = __importDefault(require("react")); var react_native_1 = require("react-native"); var Raw_1 = require("./animations/Raw"); @@ -33,7 +34,7 @@ exports.Placeholder = function (_a) { var children = _a.children, style = _a.style, Left = _a.Left, Right = _a.Right, Animation = _a.Animation, props = __rest(_a, ["children", "style", "Left", "Right", "Animation"]); var AnimationProvider = Animation || Raw_1.Raw; return (react_1["default"].createElement(AnimationProvider, null, - react_1["default"].createElement(react_native_1.View, __assign({ style: [style, styles.row] }, props), + react_1["default"].createElement(react_native_1.View, __assign({ style: [styles.row, style] }, props), Left && react_1["default"].createElement(Left, { style: styles.left }), react_1["default"].createElement(react_native_1.View, { style: styles.full }, children), Right && react_1["default"].createElement(Right, { style: styles.right })))); diff --git a/lib/Placeholder.js.map b/lib/Placeholder.js.map index 016121f..46845de 100644 --- a/lib/Placeholder.js.map +++ b/lib/Placeholder.js.map @@ -1 +1 @@ -{"version":3,"file":"Placeholder.js","sourceRoot":"","sources":["../src/Placeholder.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,6CAA2D;AAC3D,wCAAuC;AACvC,mCAAiC;AAWpB,QAAA,WAAW,GAA2B,UAAC,EAOnD;I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CAAC,iBAAiB;QAChB,iCAAC,mBAAI,aAAC,KAAK,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAM,KAAK;YACxC,IAAI,IAAI,iCAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,GAAI;YACrC,iCAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,IAAG,QAAQ,CAAQ;YAC1C,KAAK,IAAI,iCAAC,KAAK,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAI,CACnC,CACW,CACrB,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,IAAI,EAAE,CAAC;KACR;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,cAAK,CAAC,MAAM;KAC1B;IACD,KAAK,EAAE;QACL,UAAU,EAAE,cAAK,CAAC,MAAM;KACzB;IACD,GAAG,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE;CAC7C,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/PlaceholderLine.d.ts b/lib/PlaceholderLine.d.ts index 32d35b2..5c9192a 100644 --- a/lib/PlaceholderLine.d.ts +++ b/lib/PlaceholderLine.d.ts @@ -1,10 +1,10 @@ import React from "react"; import { ViewProps } from "react-native"; -export interface ILine extends ViewProps { +export interface PlaceholderLineProps extends ViewProps { height?: number; color?: string; width?: number; noMargin?: boolean; style?: ViewProps["style"]; } -export declare const PlaceholderLine: React.FC; +export declare const PlaceholderLine: React.FC; diff --git a/lib/PlaceholderLine.js b/lib/PlaceholderLine.js index 48ad713..e7d77fa 100644 --- a/lib/PlaceholderLine.js +++ b/lib/PlaceholderLine.js @@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; exports.__esModule = true; +exports.PlaceholderLine = void 0; var react_1 = __importDefault(require("react")); var react_native_1 = require("react-native"); -var AnimationConsumer_1 = require("./animations/AnimationConsumer"); +var context_1 = require("./animations/context"); var tokens_1 = require("./tokens"); exports.PlaceholderLine = function (_a) { var _b = _a.height, height = _b === void 0 ? tokens_1.SIZES.normal : _b, _c = _a.color, color = _c === void 0 ? tokens_1.COLORS.primary : _c, _d = _a.width, width = _d === void 0 ? 100 : _d, _e = _a.noMargin, noMargin = _e === void 0 ? false : _e, style = _a.style; @@ -19,8 +20,9 @@ exports.PlaceholderLine = function (_a) { marginBottom: marginBottom, width: width + "%" }; + var animationStyle = context_1.useAnimation(); return (react_1["default"].createElement(react_native_1.View, { style: [computedStyle, style, styles.line] }, - react_1["default"].createElement(AnimationConsumer_1.AnimationConsumer, null))); + react_1["default"].createElement(react_native_1.Animated.View, { style: animationStyle }))); }; var styles = react_native_1.StyleSheet.create({ line: { diff --git a/lib/PlaceholderLine.js.map b/lib/PlaceholderLine.js.map index 7ee4e24..cfacc33 100644 --- a/lib/PlaceholderLine.js.map +++ b/lib/PlaceholderLine.js.map @@ -1 +1 @@ -{"version":3,"file":"PlaceholderLine.js","sourceRoot":"","sources":["../src/PlaceholderLine.tsx"],"names":[],"mappings":";;;;;AAAA,gDAA0B;AAC1B,6CAA2D;AAC3D,oEAAmE;AACnE,mCAAyC;AAe5B,QAAA,eAAe,GAAoB,UAAC,EAMhD;QALC,cAAqB,EAArB,mDAAqB,EACrB,aAAsB,EAAtB,oDAAsB,EACtB,aAAW,EAAX,gCAAW,EACX,gBAAgB,EAAhB,qCAAgB,EAChB,gBAAK;IAEL,IAAM,eAAe,GAAG,KAAK,CAAC;IAC9B,IAAM,YAAY,GAAG,MAAM,GAAG,CAAC,CAAC;IAChC,IAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAE3C,IAAM,aAAa,GAAG;QACpB,eAAe,iBAAA;QACf,YAAY,cAAA;QACZ,MAAM,QAAA;QACN,YAAY,cAAA;QACZ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C,KAAK,EAAE,cAAc,GAAI,CACnC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/PlaceholderMedia.d.ts b/lib/PlaceholderMedia.d.ts index 318f6e7..ded3fc9 100644 --- a/lib/PlaceholderMedia.d.ts +++ b/lib/PlaceholderMedia.d.ts @@ -1,9 +1,9 @@ import React from "react"; import { ViewProps } from "react-native"; -export interface IMedia extends ViewProps { +export interface PlaceholderMediaProps extends ViewProps { size?: number; isRound?: boolean; color?: string; style?: ViewProps["style"]; } -export declare const PlaceholderMedia: React.FC; +export declare const PlaceholderMedia: React.FC; diff --git a/lib/PlaceholderMedia.js b/lib/PlaceholderMedia.js index ced6217..d2db865 100644 --- a/lib/PlaceholderMedia.js +++ b/lib/PlaceholderMedia.js @@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; exports.__esModule = true; +exports.PlaceholderMedia = void 0; var react_1 = __importDefault(require("react")); var react_native_1 = require("react-native"); -var AnimationConsumer_1 = require("./animations/AnimationConsumer"); +var context_1 = require("./animations/context"); var tokens_1 = require("./tokens"); exports.PlaceholderMedia = function (_a) { var _b = _a.size, size = _b === void 0 ? tokens_1.SIZES.xxl : _b, _c = _a.isRound, isRound = _c === void 0 ? false : _c, _d = _a.color, color = _d === void 0 ? tokens_1.COLORS.primary : _d, style = _a.style; @@ -15,8 +16,9 @@ exports.PlaceholderMedia = function (_a) { height: size, width: size }; + var animationStyle = context_1.useAnimation(); return (react_1["default"].createElement(react_native_1.View, { style: [computedStyles, style, styles.media] }, - react_1["default"].createElement(AnimationConsumer_1.AnimationConsumer, null))); + react_1["default"].createElement(react_native_1.Animated.View, { style: animationStyle }))); }; var styles = react_native_1.StyleSheet.create({ media: { diff --git a/lib/PlaceholderMedia.js.map b/lib/PlaceholderMedia.js.map index d345689..34f877f 100644 --- a/lib/PlaceholderMedia.js.map +++ b/lib/PlaceholderMedia.js.map @@ -1 +1 @@ -{"version":3,"file":"PlaceholderMedia.js","sourceRoot":"","sources":["../src/PlaceholderMedia.tsx"],"names":[],"mappings":";;;;;AAAA,gDAA0B;AAC1B,6CAA2D;AAC3D,oEAAmE;AACnE,mCAAyC;AAa5B,QAAA,gBAAgB,GAAqB,UAAC,EAKlD;QAJC,YAAgB,EAAhB,8CAAgB,EAChB,eAAe,EAAf,oCAAe,EACf,aAAsB,EAAtB,oDAAsB,EACtB,gBAAK;IAEL,IAAM,cAAc,GAAG;QACrB,eAAe,EAAE,KAAK;QACtB,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;KACZ,CAAC;IAEF,OAAO,CACL,iCAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;QAChD,iCAAC,qCAAiB,OAAG,CAChB,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE;QACL,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"PlaceholderMedia.js","sourceRoot":"","sources":["../src/PlaceholderMedia.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAC1B,6CAAqE;AACrE,gDAAoD;AACpD,mCAAyC;AAa5B,QAAA,gBAAgB,GAAoC,UAAC,EAKjE;QAJC,YAAgB,EAAhB,IAAI,mBAAG,cAAK,CAAC,GAAG,KAAA,EAChB,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA,EACf,aAAsB,EAAtB,KAAK,mBAAG,eAAM,CAAC,OAAO,KAAA,EACtB,KAAK,WAAA;IAEL,IAAM,cAAc,GAAG;QACrB,eAAe,EAAE,KAAK;QACtB,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;KACZ,CAAC;IAEF,IAAM,cAAc,GAAG,sBAAY,EAAE,CAAC;IAEtC,OAAO,CACL,iCAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;QAChD,iCAAC,uBAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,cAAc,GAAI,CACnC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE;QACL,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/animations/Fade.d.ts b/lib/animations/Fade.d.ts index 3434369..c368397 100644 --- a/lib/animations/Fade.d.ts +++ b/lib/animations/Fade.d.ts @@ -1,15 +1,6 @@ import React from "react"; import { ViewProps } from "react-native"; -export interface IFade extends ViewProps { +export interface FadeProps extends ViewProps { duration?: number; } -export declare class Fade extends React.Component { - static defaultProps: { - duration: number; - }; - private animation; - constructor(props: IFade); - componentDidMount(): void; - render(): JSX.Element; - private start; -} +export declare const Fade: React.FC; diff --git a/lib/animations/Fade.js b/lib/animations/Fade.js index 8c80ca1..7766795 100644 --- a/lib/animations/Fade.js +++ b/lib/animations/Fade.js @@ -1,73 +1,63 @@ "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; exports.__esModule = true; -var react_1 = __importDefault(require("react")); +exports.Fade = void 0; +var react_1 = __importStar(require("react")); var react_native_1 = require("react-native"); var context_1 = require("./context"); var START_VALUE = 0.5; var END_VALUE = 1; var useNativeDriver = true; var isInteraction = false; -var Fade = /** @class */ (function (_super) { - __extends(Fade, _super); - function Fade(props) { - var _this = _super.call(this, props) || this; - _this.animation = new react_native_1.Animated.Value(START_VALUE); - return _this; - } - Fade.prototype.componentDidMount = function () { - this.start(); - }; - Fade.prototype.render = function () { - var _a = this.props, children = _a.children, style = _a.style; - var animationStyle = { - backgroundColor: "#dfdfdf", - height: "100%", - opacity: this.animation - }; - return react_1["default"].createElement(context_1.Provider, { value: [animationStyle, style] }, children); - }; - Fade.prototype.start = function () { - var _this = this; - var duration = this.props.duration; +exports.Fade = function (_a) { + var _b = _a.duration, duration = _b === void 0 ? 500 : _b, children = _a.children, style = _a.style; + var animation = react_1.useRef(new react_native_1.Animated.Value(START_VALUE)); + var start = function () { react_native_1.Animated.sequence([ - react_native_1.Animated.timing(this.animation, { + react_native_1.Animated.timing(animation.current, { duration: duration, isInteraction: isInteraction, toValue: END_VALUE, useNativeDriver: useNativeDriver }), - react_native_1.Animated.timing(this.animation, { + react_native_1.Animated.timing(animation.current, { duration: duration, isInteraction: isInteraction, toValue: START_VALUE, useNativeDriver: useNativeDriver - }) + }), ]).start(function (e) { if (e.finished) { - _this.start(); + start(); } }); }; - Fade.defaultProps = { - duration: 500 + react_1["default"].useEffect(function () { + start(); + }, []); + var animationStyle = { + backgroundColor: "#dfdfdf", + height: "100%", + opacity: animation.current }; - return Fade; -}(react_1["default"].Component)); -exports.Fade = Fade; + return (react_1["default"].createElement(context_1.AnimationContext.Provider, { value: [animationStyle, style] }, children)); +}; //# sourceMappingURL=Fade.js.map \ No newline at end of file diff --git a/lib/animations/Fade.js.map b/lib/animations/Fade.js.map index 91395db..942e49b 100644 --- a/lib/animations/Fade.js.map +++ b/lib/animations/Fade.js.map @@ -1 +1 @@ -{"version":3,"file":"Fade.js","sourceRoot":"","sources":["../../src/animations/Fade.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,6CAAmD;AACnD,qCAAqC;AAErC,IAAM,WAAW,GAAG,GAAG,CAAC;AACxB,IAAM,SAAS,GAAG,CAAC,CAAC;AACpB,IAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,IAAM,aAAa,GAAG,KAAK,CAAC;AAO5B;IAA0B,wBAAsB;IAO9C,cAAY,KAAY;QAAxB,YACE,kBAAM,KAAK,CAAC,SAGb;QADC,KAAI,CAAC,SAAS,GAAG,IAAI,uBAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;;IACnD,CAAC;IAEM,gCAAiB,GAAxB;QACE,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAEM,qBAAM,GAAb;QACQ,IAAA,eAAgC,EAA9B,sBAAQ,EAAE,gBAAoB,CAAC;QACvC,IAAM,cAAc,GAAG;YACrB,eAAe,EAAE,SAAS;YAC1B,MAAM,EAAE,MAAM;YACd,OAAO,EAAE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ACR,KAAK,WAAA;IAEL,IAAM,SAAS,GAAG,cAAM,CAAC,IAAI,uBAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAE1D,IAAM,KAAK,GAAG;QACZ,uBAAQ,CAAC,QAAQ,CAAC;YAChB,uBAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE;gBACjC,QAAQ,UAAA;gBACR,aAAa,eAAA;gBACb,OAAO,EAAE,SAAS;gBAClB,eAAe,iBAAA;aAChB,CAAC;YACF,uBAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE;gBACjC,QAAQ,UAAA;gBACR,aAAa,eAAA;gBACb,OAAO,EAAE,WAAW;gBACpB,eAAe,iBAAA;aAChB,CAAC;SACH,CAAC,CAAC,KAAK,CAAC,UAAC,CAAC;YACT,IAAI,CAAC,CAAC,QAAQ,EAAE;gBACd,KAAK,EAAE,CAAC;aACT;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,kBAAK,CAAC,SAAS,CAAC;QACd,KAAK,EAAE,CAAC;IACV,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAM,cAAc,GAAG;QACrB,eAAe,EAAE,SAAS;QAC1B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,SAAS,CAAC,OAAO;KAC3B,CAAC;IAEF,OAAO,CACL,iCAAC,0BAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,CAAC,cAAc,EAAE,KAAK,CAAC,IACtD,QAAQ,CACiB,CAC7B,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/animations/Loader.js b/lib/animations/Loader.js index d61f051..16503b3 100644 --- a/lib/animations/Loader.js +++ b/lib/animations/Loader.js @@ -25,15 +25,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; exports.__esModule = true; +exports.Loader = void 0; var react_1 = __importDefault(require("react")); var react_native_1 = require("react-native"); -var context_1 = require("./context"); exports.Loader = function (_a) { var children = _a.children, props = __rest(_a, ["children"]); - return (react_1["default"].createElement(context_1.Provider, { value: null }, - react_1["default"].createElement(react_native_1.View, { style: styles.loader }, - children, - react_1["default"].createElement(react_native_1.ActivityIndicator, __assign({}, props, { style: [styles.indicator, props.style] }))))); + return (react_1["default"].createElement(react_native_1.View, { style: styles.loader }, + children, + react_1["default"].createElement(react_native_1.ActivityIndicator, __assign({}, props, { style: [styles.indicator, props.style] })))); }; var styles = react_native_1.StyleSheet.create({ indicator: { position: "absolute", height: "100%" }, diff --git a/lib/animations/Loader.js.map b/lib/animations/Loader.js.map index e38d46d..2e0e9f1 100644 --- a/lib/animations/Loader.js.map +++ b/lib/animations/Loader.js.map @@ -1 +1 @@ -{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../src/animations/Loader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,6CAKsB;AACtB,qCAAqC;AAExB,QAAA,MAAM,GAAqC,UAAC,EAGxD;IAFC,IAAA,sBAAQ,EACR,gCAAQ;IACJ,OAAA,CACJ,iCAAC,kBAAQ,IAAC,KAAK,EAAE,IAAI;QACnB,iCAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM;YACvB,QAAQ;YACT,iCAAC,gCAAiB,eAAK,KAAK,IAAE,KAAK,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CACnE,CACE,CACZ,CAAA;CAAA,CAAC;AAEF,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE;IACnD,MAAM,EAAE;QACN,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../src/animations/Loader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,6CAKsB;AAET,QAAA,MAAM,GAAqC,UAAC,EAGxD;IAFC,IAAA,QAAQ,cAAA,EACL,KAAK,cAF+C,YAGxD,CADS;IACJ,OAAA,CACF,iCAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM;QACvB,QAAQ;QACT,iCAAC,gCAAiB,eAAK,KAAK,IAAE,KAAK,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CACnE,CACV,CAAA;CAAA,CAAC;AAEF,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE;IACnD,MAAM,EAAE;QACN,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/animations/Progressive.d.ts b/lib/animations/Progressive.d.ts index 772c518..bd6704d 100644 --- a/lib/animations/Progressive.d.ts +++ b/lib/animations/Progressive.d.ts @@ -1,12 +1,6 @@ import React from "react"; import { ViewProps } from "react-native"; -export interface IProgressive extends ViewProps { +export interface ProgressiveProps extends ViewProps { color?: string; } -export declare class Progressive extends React.Component { - private animation; - constructor(props: IProgressive); - componentDidMount(): void; - render(): JSX.Element; - private start; -} +export declare const Progressive: React.FC; diff --git a/lib/animations/Progressive.js b/lib/animations/Progressive.js index 8f2927f..67c7be5 100644 --- a/lib/animations/Progressive.js +++ b/lib/animations/Progressive.js @@ -1,60 +1,44 @@ "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; exports.__esModule = true; -var react_1 = __importDefault(require("react")); +exports.Progressive = void 0; +var react_1 = __importStar(require("react")); var react_native_1 = require("react-native"); var context_1 = require("./context"); var START_VALUE = 0; var END_VALUE = 100; var DURATION = 750; var isInteraction = false; -var Progressive = /** @class */ (function (_super) { - __extends(Progressive, _super); - function Progressive(props) { - var _this = _super.call(this, props) || this; - _this.animation = new react_native_1.Animated.Value(START_VALUE); - return _this; - } - Progressive.prototype.componentDidMount = function () { - this.start(); - }; - Progressive.prototype.render = function () { - var _a = this.props, children = _a.children, style = _a.style, _b = _a.color, color = _b === void 0 ? "rgba(0,0,0,0.1)" : _b; - var right = this.animation.interpolate({ - inputRange: [START_VALUE, END_VALUE], - outputRange: ["0%", "100%"] - }); - return (react_1["default"].createElement(context_1.Provider, { value: [ - styles.animationStyle, - style, - { right: right, backgroundColor: color }, - ] }, children)); - }; - Progressive.prototype.start = function () { - var _this = this; +exports.Progressive = function (_a) { + var style = _a.style, _b = _a.color, color = _b === void 0 ? "rgba(0,0,0,0.1)" : _b, children = _a.children; + var animation = react_1.useRef(new react_native_1.Animated.Value(START_VALUE)); + var start = function () { react_native_1.Animated.sequence([ - react_native_1.Animated.timing(this.animation, { + react_native_1.Animated.timing(animation.current, { duration: DURATION, isInteraction: isInteraction, toValue: END_VALUE, useNativeDriver: false }), - react_native_1.Animated.timing(this.animation, { + react_native_1.Animated.timing(animation.current, { duration: DURATION, isInteraction: isInteraction, toValue: START_VALUE, @@ -62,13 +46,19 @@ var Progressive = /** @class */ (function (_super) { }), ]).start(function (e) { if (e.finished) { - _this.start(); + start(); } }); }; - return Progressive; -}(react_1["default"].Component)); -exports.Progressive = Progressive; + react_1["default"].useEffect(function () { + start(); + }, []); + var right = animation.current.interpolate({ + inputRange: [START_VALUE, END_VALUE], + outputRange: ["0%", "100%"] + }); + return (react_1["default"].createElement(context_1.AnimationContext.Provider, { value: [styles.animationStyle, style, { right: right, backgroundColor: color }] }, children)); +}; var styles = react_native_1.StyleSheet.create({ animationStyle: { height: "100%", diff --git a/lib/animations/Progressive.js.map b/lib/animations/Progressive.js.map index 85e961b..206a024 100644 --- a/lib/animations/Progressive.js.map +++ b/lib/animations/Progressive.js.map @@ -1 +1 @@ -{"version":3,"file":"Progressive.js","sourceRoot":"","sources":["../../src/animations/Progressive.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,6CAA+D;AAC/D,qCAAqC;AAErC,IAAM,WAAW,GAAG,CAAC,CAAC;AACtB,IAAM,SAAS,GAAG,GAAG,CAAC;AACtB,IAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,IAAM,aAAa,GAAG,KAAK,CAAC;AAM5B;IAAiC,+BAA6B;IAG5D,qBAAY,KAAmB;QAA/B,YACE,kBAAM,KAAK,CAAC,SAGb;QADC,KAAI,CAAC,SAAS,GAAG,IAAI,uBAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;;IACnD,CAAC;IAEM,uCAAiB,GAAxB;QACE,IAAI,CAAC,KAAK,EAAE,C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QACpB,KAAK,EAAE,MAAM;KACd;CACF,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"Progressive.js","sourceRoot":"","sources":["../../src/animations/Progressive.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAsC;AACtC,6CAA+D;AAC/D,qCAA6C;AAE7C,IAAM,WAAW,GAAG,CAAC,CAAC;AACtB,IAAM,SAAS,GAAG,GAAG,CAAC;AACtB,IAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,IAAM,aAAa,GAAG,KAAK,CAAC;AAMf,QAAA,WAAW,GAA+B,UAAC,EAIvD;QAHC,KAAK,WAAA,EACL,aAAyB,EAAzB,KAAK,mBAAG,iBAAiB,KAAA,EACzB,QAAQ,cAAA;IAER,IAAM,SAAS,GAAG,cAAM,CAAC,IAAI,uBAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAE1D,IAAM,KAAK,GAAG;QACZ,uBAAQ,CAAC,QAAQ,CAAC;YAChB,uBAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE;gBACjC,QAAQ,EAAE,QAAQ;gBAClB,aAAa,eAAA;gBACb,OAAO,EAAE,SAAS;gBAClB,eAAe,EAAE,KAAK;aACvB,CAAC;YACF,uBAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE;gBACjC,QAAQ,EAAE,QAAQ;gBAClB,aAAa,eAAA;gBACb,OAAO,EAAE,WAAW;gBACpB,eAAe,EAAE,KAAK;aACvB,CAAC;SACH,CAAC,CAAC,KAAK,CAAC,UAAC,CAAC;YACT,IAAI,CAAC,CAAC,QAAQ,EAAE;gBACd,KAAK,EAAE,CAAC;aACT;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,kBAAK,CAAC,SAAS,CAAC;QACd,KAAK,EAAE,CAAC;IACV,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;QAC1C,UAAU,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;QACpC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;KAC5B,CAAC,CAAC;IAEH,OAAO,CACL,iCAAC,0BAAgB,CAAC,QAAQ,IACxB,KAAK,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,EAAE,EAAE,KAAK,OAAA,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,IAEvE,QAAQ,CACiB,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,cAAc,EAAE;QACd,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,MAAM;KACd;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/animations/Raw.js b/lib/animations/Raw.js index ffe2c92..0614c85 100644 --- a/lib/animations/Raw.js +++ b/lib/animations/Raw.js @@ -1,23 +1,12 @@ "use strict"; -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; exports.__esModule = true; +exports.Raw = void 0; var react_1 = __importDefault(require("react")); -var context_1 = require("./context"); exports.Raw = function (_a) { - var children = _a.children, props = __rest(_a, ["children"]); - return (react_1["default"].createElement(context_1.Provider, { value: null }, children)); + var children = _a.children; + return react_1["default"].createElement(react_1["default"].Fragment, null, children); }; //# sourceMappingURL=Raw.js.map \ No newline at end of file diff --git a/lib/animations/Raw.js.map b/lib/animations/Raw.js.map index 69afce6..faf9a9e 100644 --- a/lib/animations/Raw.js.map +++ b/lib/animations/Raw.js.map @@ -1 +1 @@ -{"version":3,"file":"Raw.js","sourceRoot":"","sources":["../../src/animations/Raw.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAE1B,qCAAqC;AAExB,QAAA,GAAG,GAAwB,UAAC,EAAsB;IAApB,IAAA,sBAAQ,EAAE,gCAAQ;IAAO,OAAA,CAClE,iCAAC,kBAAQ,IAAC,KAAK,EAAE,IAAI,IAAG,QAAQ,CAAY,CAC7C,CAAA;CAAA,CAAC"} \ No newline at end of file +{"version":3,"file":"Raw.js","sourceRoot":"","sources":["../../src/animations/Raw.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAGb,QAAA,GAAG,GAAwB,UAAC,EAAY;QAAV,QAAQ,cAAA;IAAO,OAAA,oEAAG,QAAQ,CAAI;AAAf,CAAe,CAAC"} \ No newline at end of file diff --git a/lib/animations/Shine.d.ts b/lib/animations/Shine.d.ts index a68d507..ee66eda 100644 --- a/lib/animations/Shine.d.ts +++ b/lib/animations/Shine.d.ts @@ -1,12 +1,6 @@ import React from "react"; import { ViewProps } from "react-native"; -export interface IShine extends ViewProps { +export interface ShineProps extends ViewProps { duration?: number; } -export declare class Shine extends React.Component { - private animation; - constructor(props: IShine); - componentDidMount(): void; - render(): JSX.Element; - private start; -} +export declare const Shine: React.FC; diff --git a/lib/animations/Shine.js b/lib/animations/Shine.js index adc795e..27feb81 100644 --- a/lib/animations/Shine.js +++ b/lib/animations/Shine.js @@ -1,62 +1,56 @@ "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; exports.__esModule = true; -var react_1 = __importDefault(require("react")); +exports.Shine = void 0; +var react_1 = __importStar(require("react")); var react_native_1 = require("react-native"); var context_1 = require("./context"); var START_VALUE = 0; var END_VALUE = 100; var isInteraction = false; -var Shine = /** @class */ (function (_super) { - __extends(Shine, _super); - function Shine(props) { - var _this = _super.call(this, props) || this; - _this.animation = new react_native_1.Animated.Value(0); - return _this; - } - Shine.prototype.componentDidMount = function () { - this.start(); - }; - Shine.prototype.render = function () { - var _a = this.props, children = _a.children, style = _a.style; - var left = this.animation.interpolate({ - inputRange: [START_VALUE, END_VALUE], - outputRange: ["0%", "100%"] - }); - return (react_1["default"].createElement(context_1.Provider, { value: [styles.shine, { left: left }, style] }, children)); - }; - Shine.prototype.start = function () { - var _this = this; - this.animation.setValue(START_VALUE); - react_native_1.Animated.timing(this.animation, { - duration: this.props.duration || 750, +exports.Shine = function (_a) { + var duration = _a.duration, children = _a.children, style = _a.style; + var animation = react_1.useRef(new react_native_1.Animated.Value(START_VALUE)); + var start = function () { + animation.current.setValue(START_VALUE); + react_native_1.Animated.timing(animation.current, { + duration: duration || 750, isInteraction: isInteraction, toValue: END_VALUE, useNativeDriver: false }).start(function (e) { if (e.finished) { - _this.start(); + start(); } }); }; - return Shine; -}(react_1["default"].Component)); -exports.Shine = Shine; + react_1.useEffect(function () { + start(); + }, []); + var left = animation.current.interpolate({ + inputRange: [START_VALUE, END_VALUE], + outputRange: ["0%", "100%"] + }); + return (react_1["default"].createElement(context_1.AnimationContext.Provider, { value: [styles.shine, { left: left }, style] }, children)); +}; var styles = react_native_1.StyleSheet.create({ shine: { backgroundColor: "white", diff --git a/lib/animations/Shine.js.map b/lib/animations/Shine.js.map index 8af1fa8..6c49678 100644 --- a/lib/animations/Shine.js.map +++ b/lib/animations/Shine.js.map @@ -1 +1 @@ -{"version":3,"file":"Shine.js","sourceRoot":"","sources":["../../src/animations/Shine.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,6CAA+D;AAC/D,qCAAqC;AAErC,IAAM,WAAW,GAAG,CAAC,CAAC;AACtB,IAAM,SAAS,GAAG,GAAG,CAAC;AACtB,IAAM,aAAa,GAAG,KAAK,CAAC;AAO5B;IAA2B,yBAAuB;IAEhD,eAAY,KAAa;QAAzB,YACE,kBAAM,KAAK,CAAC,SAGb;QADC,KAAI,CAAC,SAAS,GAAG,IAAI,uBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;;IACzC,CAAC;IAEM,iCAAiB,GAAxB;QACE,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAEM,sBAAM,GAAb;QACQ,IAAA,eAAgC,EAA9B,sBAAQ,EAAE,gBAAoB,CAAC;QAEvC,IAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YACtC,UAAU,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;YACpC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;SAC5B,CAAC,CAAC;QAEH,OAAO,CACL,iCAAC,kBAAQ,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,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AAC,CAAC;IAE1D,IAAM,KAAK,GAAG;QACZ,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAExC,uBAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE;YACjC,QAAQ,EAAE,QAAQ,IAAI,GAAG;YACzB,aAAa,eAAA;YACb,OAAO,EAAE,SAAS;YAClB,eAAe,EAAE,KAAK;SACvB,CAAC,CAAC,KAAK,CAAC,UAAC,CAAC;YACT,IAAI,CAAC,CAAC,QAAQ,EAAE;gBACd,KAAK,EAAE,CAAC;aACT;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,iBAAS,CAAC;QACR,KAAK,EAAE,CAAC;IACV,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;QACzC,UAAU,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;QACpC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;KAC5B,CAAC,CAAC;IAEH,OAAO,CACL,iCAAC,0BAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,MAAA,EAAE,EAAE,KAAK,CAAC,IAC9D,QAAQ,CACiB,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE;QACL,eAAe,EAAE,OAAO;QACxB,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,GAAG;QACZ,KAAK,EAAE,KAAK;KACb;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/animations/ShineOverlay.d.ts b/lib/animations/ShineOverlay.d.ts index 43f7f77..16ba7b6 100644 --- a/lib/animations/ShineOverlay.d.ts +++ b/lib/animations/ShineOverlay.d.ts @@ -1,11 +1,5 @@ import React from "react"; -export interface IShine { +export interface ShineOverlayProps { duration?: number; } -export declare class ShineOverlay extends React.Component { - private animation; - constructor(props: IShine); - componentDidMount(): void; - render(): JSX.Element; - private start; -} +export declare const ShineOverlay: React.FC; diff --git a/lib/animations/ShineOverlay.js b/lib/animations/ShineOverlay.js index 61e8f2a..f167cbf 100644 --- a/lib/animations/ShineOverlay.js +++ b/lib/animations/ShineOverlay.js @@ -1,63 +1,57 @@ "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; exports.__esModule = true; -var react_1 = __importDefault(require("react")); +exports.ShineOverlay = void 0; +var react_1 = __importStar(require("react")); var react_native_1 = require("react-native"); var START_VALUE = 0; var END_VALUE = 100; var isInteraction = false; -var ShineOverlay = /** @class */ (function (_super) { - __extends(ShineOverlay, _super); - function ShineOverlay(props) { - var _this = _super.call(this, props) || this; - _this.animation = new react_native_1.Animated.Value(0); - return _this; - } - ShineOverlay.prototype.componentDidMount = function () { - this.start(); - }; - ShineOverlay.prototype.render = function () { - var children = this.props.children; - var left = this.animation.interpolate({ - inputRange: [START_VALUE, END_VALUE], - outputRange: ["0%", "100%"] - }); - return (react_1["default"].createElement(react_native_1.View, null, - children, - react_1["default"].createElement(react_native_1.Animated.View, { style: [styles.shine, { left: left }] }))); - }; - ShineOverlay.prototype.start = function () { - var _this = this; - this.animation.setValue(START_VALUE); - react_native_1.Animated.timing(this.animation, { - duration: this.props.duration || 750, +exports.ShineOverlay = function (_a) { + var duration = _a.duration, children = _a.children; + var animation = react_1.useRef(new react_native_1.Animated.Value(START_VALUE)); + var start = function () { + animation.current.setValue(START_VALUE); + react_native_1.Animated.timing(animation.current, { + duration: duration || 750, isInteraction: isInteraction, toValue: END_VALUE, useNativeDriver: false }).start(function (e) { if (e.finished) { - _this.start(); + start(); } }); }; - return ShineOverlay; -}(react_1["default"].Component)); -exports.ShineOverlay = ShineOverlay; + react_1.useEffect(function () { + start(); + }, []); + var left = animation.current.interpolate({ + inputRange: [START_VALUE, END_VALUE], + outputRange: ["0%", "100%"] + }); + return (react_1["default"].createElement(react_native_1.View, null, + children, + react_1["default"].createElement(react_native_1.Animated.View, { style: [styles.shine, { left: left }] }))); +}; var styles = react_native_1.StyleSheet.create({ shine: { backgroundColor: "#ffffff", diff --git a/lib/animations/ShineOverlay.js.map b/lib/animations/ShineOverlay.js.map index 35034e4..1f28607 100644 --- a/lib/animations/ShineOverlay.js.map +++ b/lib/animations/ShineOverlay.js.map @@ -1 +1 @@ -{"version":3,"file":"ShineOverlay.js","sourceRoot":"","sources":["../../src/animations/ShineOverlay.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,6CAA0D;AAE1D,IAAM,WAAW,GAAG,CAAC,CAAC;AACtB,IAAM,SAAS,GAAG,GAAG,CAAC;AACtB,IAAM,aAAa,GAAG,KAAK,CAAC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EAAE;QACL,eAAe,EAAE,SAAS;QAC1B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,GAAG;QACZ,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,EAAE;KACV;CACF,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"ShineOverlay.js","sourceRoot":"","sources":["../../src/animations/ShineOverlay.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAiD;AACjD,6CAA0D;AAE1D,IAAM,WAAW,GAAG,CAAC,CAAC;AACtB,IAAM,SAAS,GAAG,GAAG,CAAC;AACtB,IAAM,aAAa,GAAG,KAAK,CAAC;AAOf,QAAA,YAAY,GAAgC,UAAC,EAGzD;QAFC,QAAQ,cAAA,EACR,QAAQ,cAAA;IAER,IAAM,SAAS,GAAG,cAAM,CAAC,IAAI,uBAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAE1D,IAAM,KAAK,GAAG;QACZ,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAExC,uBAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE;YACjC,QAAQ,EAAE,QAAQ,IAAI,GAAG;YACzB,aAAa,eAAA;YACb,OAAO,EAAE,SAAS;YAClB,eAAe,EAAE,KAAK;SACvB,CAAC,CAAC,KAAK,CAAC,UAAC,CAAC;YACT,IAAI,CAAC,CAAC,QAAQ,EAAE;gBACd,KAAK,EAAE,CAAC;aACT;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,iBAAS,CAAC;QACR,KAAK,EAAE,CAAC;IACV,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;QACzC,UAAU,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;QACpC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;KAC5B,CAAC,CAAC;IAEH,OAAO,CACL,iCAAC,mBAAI;QACF,QAAQ;QACT,iCAAC,uBAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,MAAA,EAAE,CAAC,GAAI,CAC7C,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE;QACL,eAAe,EAAE,SAAS;QAC1B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,GAAG;QACZ,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,EAAE;KACV;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/animations/context.d.ts b/lib/animations/context.d.ts index 2c478cc..713bcbd 100644 --- a/lib/animations/context.d.ts +++ b/lib/animations/context.d.ts @@ -1,2 +1,3 @@ import React from "react"; -export declare const Consumer: React.ExoticComponent>, Provider: React.ProviderExoticComponent>; +export declare const AnimationContext: React.Context<{}>; +export declare const useAnimation: () => {}; diff --git a/lib/animations/context.js b/lib/animations/context.js index 4ca24bf..a9b118d 100644 --- a/lib/animations/context.js +++ b/lib/animations/context.js @@ -1,9 +1,26 @@ "use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; -var _a; exports.__esModule = true; -var react_1 = __importDefault(require("react")); -exports.Consumer = (_a = react_1["default"].createContext({}), _a.Consumer), exports.Provider = _a.Provider; +exports.useAnimation = exports.AnimationContext = void 0; +var react_1 = __importStar(require("react")); +exports.AnimationContext = react_1["default"].createContext({}); +exports.useAnimation = function () { return react_1.useContext(exports.AnimationContext); }; //# sourceMappingURL=context.js.map \ No newline at end of file diff --git a/lib/animations/context.js.map b/lib/animations/context.js.map index 69e24a9..430979a 100644 --- a/lib/animations/context.js.map +++ b/lib/animations/context.js.map @@ -1 +1 @@ -{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/animations/context.ts"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAEX,QAAA,QAAQ,IAAV,KAAyB,kBAAK,CAAC,aAAa,CAAC,EAAE,CAAC,gBAApC,QAAA,QAAQ,eAA6B"} \ No newline at end of file +{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/animations/context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA0C;AAC7B,QAAA,gBAAgB,GAAG,kBAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;AAE3C,QAAA,YAAY,GAAG,cAAM,OAAA,kBAAU,CAAC,wBAAgB,CAAC,EAA5B,CAA4B,CAAC"} \ No newline at end of file diff --git a/lib/index.d.ts b/lib/index.d.ts index 73ba40f..b2bc324 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -1,4 +1,3 @@ -export { AnimationConsumer } from "./animations/AnimationConsumer"; export { Placeholder } from "./Placeholder"; export { PlaceholderLine } from "./PlaceholderLine"; export { PlaceholderMedia } from "./PlaceholderMedia"; diff --git a/lib/index.js b/lib/index.js index fd08083..7ed36e6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,25 +1,31 @@ "use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; exports.__esModule = true; -var AnimationConsumer_1 = require("./animations/AnimationConsumer"); -exports.AnimationConsumer = AnimationConsumer_1.AnimationConsumer; +exports.Progressive = exports.Loader = exports.ShineOverlay = exports.Shine = exports.Fade = exports.PlaceholderMedia = exports.PlaceholderLine = exports.Placeholder = void 0; var Placeholder_1 = require("./Placeholder"); -exports.Placeholder = Placeholder_1.Placeholder; +__createBinding(exports, Placeholder_1, "Placeholder"); var PlaceholderLine_1 = require("./PlaceholderLine"); -exports.PlaceholderLine = PlaceholderLine_1.PlaceholderLine; +__createBinding(exports, PlaceholderLine_1, "PlaceholderLine"); var PlaceholderMedia_1 = require("./PlaceholderMedia"); -exports.PlaceholderMedia = PlaceholderMedia_1.PlaceholderMedia; +__createBinding(exports, PlaceholderMedia_1, "PlaceholderMedia"); var Fade_1 = require("./animations/Fade"); -exports.Fade = Fade_1.Fade; +__createBinding(exports, Fade_1, "Fade"); var Shine_1 = require("./animations/Shine"); -exports.Shine = Shine_1.Shine; +__createBinding(exports, Shine_1, "Shine"); var ShineOverlay_1 = require("./animations/ShineOverlay"); -exports.ShineOverlay = ShineOverlay_1.ShineOverlay; +__createBinding(exports, ShineOverlay_1, "ShineOverlay"); var Loader_1 = require("./animations/Loader"); -exports.Loader = Loader_1.Loader; +__createBinding(exports, Loader_1, "Loader"); var Progressive_1 = require("./animations/Progressive"); -exports.Progressive = Progressive_1.Progressive; -__export(require("./animations/context")); +__createBinding(exports, Progressive_1, "Progressive"); +__exportStar(require("./animations/context"), exports); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/index.js.map b/lib/index.js.map index e991a43..62ed674 100644 --- a/lib/index.js.map +++ b/lib/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;;;AAAA,oEAAmE;AAA1D,gDAAA,iBAAiB,CAAA;AAC1B,6CAA4C;AAAnC,oCAAA,WAAW,CAAA;AACpB,qDAAoD;AAA3C,4CAAA,eAAe,CAAA;AACxB,uDAAsD;AAA7C,8CAAA,gBAAgB,CAAA;AACzB,0CAAyC;AAAhC,sBAAA,IAAI,CAAA;AACb,4CAA2C;AAAlC,wBAAA,KAAK,CAAA;AACd,0DAAyD;AAAhD,sCAAA,YAAY,CAAA;AACrB,8CAA6C;AAApC,0BAAA,MAAM,CAAA;AACf,wDAAuD;AAA9C,oCAAA,WAAW,CAAA;AACpB,0CAAqC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AACA,6CAA4C;AAAnC,uDAAW;AACpB,qDAAoD;AAA3C,+DAAe;AACxB,uDAAsD;AAA7C,iEAAgB;AACzB,0CAAyC;AAAhC,yCAAI;AACb,4CAA2C;AAAlC,2CAAK;AACd,0DAAyD;AAAhD,yDAAY;AACrB,8CAA6C;AAApC,6CAAM;AACf,wDAAuD;AAA9C,uDAAW;AACpB,uDAAqC"} \ No newline at end of file diff --git a/lib/tokens.js b/lib/tokens.js index c4ac95f..71ff524 100644 --- a/lib/tokens.js +++ b/lib/tokens.js @@ -1,5 +1,6 @@ "use strict"; exports.__esModule = true; +exports.SIZES = exports.COLORS = void 0; exports.COLORS = { primary: "#efefef" }; diff --git a/lib/tokens.js.map b/lib/tokens.js.map index de83c87..6a6131f 100644 --- a/lib/tokens.js.map +++ b/lib/tokens.js.map @@ -1 +1 @@ -{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.tsx"],"names":[],"mappings":";;AASa,QAAA,MAAM,GAAY;IAC7B,OAAO,EAAE,SAAS;CACnB,CAAC;AAEW,QAAA,KAAK,GAAW;IAC3B,MAAM,EAAE,EAAE;IACV,GAAG,EAAE,EAAE;CACR,CAAC"} \ No newline at end of file +{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.tsx"],"names":[],"mappings":";;;AASa,QAAA,MAAM,GAAY;IAC7B,OAAO,EAAE,SAAS;CACnB,CAAC;AAEW,QAAA,KAAK,GAAW;IAC3B,MAAM,EAAE,EAAE;IACV,GAAG,EAAE,EAAE;CACR,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 062f578..73e54ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rn-placeholder", - "version": "3.0.1", + "version": "3.0.2", "main": "lib/index.js", "types": "lib/index.d.ts", "homepage": "https://github.com/mfrachet/rn-placeholder", @@ -19,7 +19,7 @@ "license": "MIT", "scripts": { "test": "tsc --outDir example/placeholder && yarn --cwd ./example test", - "build": "yarn lint && yarn test && tsc --outDir lib && yarn generate:docs", + "build": "yarn lint && yarn test && tsc --outDir lib", "format": "prettier --write './src/**/*.tsx'", "lint": "tslint -c tslint.json 'src/**/**'", "start": "concurrently \"tsc -w --outDir example/placeholder\" \"yarn --cwd ./example start\"",