Skip to content

Commit

Permalink
Upgrade npm packges to fix dependency vulnerabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronCCWong committed Jul 18, 2020
1 parent 664d311 commit 60622d4
Show file tree
Hide file tree
Showing 6 changed files with 9,824 additions and 3,369 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Aaron Wong
Copyright (c) 2020 Aaron Wong

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';
import ReactDOM from 'react-dom';

import Example from './Example';
import SlowerExample from './SlowerExample';
import FasterExample from './FasterExample';
import RevolvingExample from './RevolvingExample';
import SlowerExample from './SlowerExample';
import VerticalExample from './VerticalExample';

const App = () => {
Expand Down
27 changes: 14 additions & 13 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,39 @@ module.exports = {
devtool: 'eval-source-map',
output: {
filename: '[name].js',
path: path.resolve(__dirname, './build')
path: path.resolve(__dirname, './build'),
},
module: {
rules: [
{
test: /(\.jsx|\.js|\.tsx|\.ts)$/,
loader: 'babel-loader',
exclude: /(node_modules|bower_components)/
exclude: /(node_modules|bower_components)/,
},
{
test: /\.(png|jpg|gif)$/,
use: [
{
loader: 'file-loader'
}
]
}
]
loader: 'file-loader',
},
],
},
],
},
devServer: {
contentBase: path.join(__dirname, './example')
contentBase: path.resolve(__dirname, '.'),
open: true,
},
resolve: {
alias: {
'react-card-flip': path.resolve(__dirname, '../src/ReactCardFlip')
'react-card-flip': path.resolve(__dirname, '../src/ReactCardFlip'),
},
extensions: ['.js', '.jsx', '.tsx', '.ts']
extensions: ['.js', '.jsx', '.tsx', '.ts'],
},
optimization: {
splitChunks: {
chunks: 'all'
}
chunks: 'all',
},
},
plugins: [new webpack.LoaderOptionsPlugin({ debug: true })]
plugins: [new webpack.LoaderOptionsPlugin({ debug: true })],
};
32 changes: 22 additions & 10 deletions lib/ReactCardFlip.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,30 @@ var __assign = (this && this.__assign) || function () {
};
return __assign.apply(this, arguments);
};
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 (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var react_1 = require("react");
var ReactCardFlip = function (props) {
var flipDirection = props.flipDirection, infinite = props.infinite, flipSpeedFrontToBack = props.flipSpeedFrontToBack, flipSpeedBackToFront = props.flipSpeedBackToFront, _a = props.cardStyles, front = _a.front, back = _a.back, containerStyle = props.containerStyle, cardZIndex = props.cardZIndex;
var _a = props.cardStyles, back = _a.back, front = _a.front, cardZIndex = props.cardZIndex, containerStyle = props.containerStyle, flipDirection = props.flipDirection, flipSpeedFrontToBack = props.flipSpeedFrontToBack, flipSpeedBackToFront = props.flipSpeedBackToFront, infinite = props.infinite;
var _b = react_1.useState(props.isFlipped), isFlipped = _b[0], setFlipped = _b[1];
var _c = react_1.useState(0), rotation = _c[0], setRotation = _c[1];
react_1.useEffect(function () {
Expand All @@ -41,34 +53,34 @@ var ReactCardFlip = function (props) {
var frontRotateX = "rotateX(" + (infinite ? rotation : isFlipped ? 180 : 0) + "deg)";
var backRotateX = "rotateX(" + (infinite ? rotation + 180 : isFlipped ? 0 : -180) + "deg)";
var styles = {
back: __assign({ WebkitBackfaceVisibility: 'hidden', backfaceVisibility: 'hidden', height: '100%', left: '0', position: isFlipped ? 'relative' : 'absolute', top: '0', transform: flipDirection === 'horizontal' ? backRotateY : backRotateX, transformStyle: 'preserve-3d', transition: flipSpeedFrontToBack + "s", width: '100%' }, back),
container: {
perspective: '1000px',
zIndex: "" + cardZIndex
zIndex: "" + cardZIndex,
},
flipper: {
height: '100%',
position: 'relative',
width: '100%',
height: '100%'
},
front: __assign({ WebkitBackfaceVisibility: 'hidden', backfaceVisibility: 'hidden', left: '0', position: isFlipped ? 'absolute' : 'relative', top: '0', transform: flipDirection === 'horizontal' ? frontRotateY : frontRotateX, transformStyle: 'preserve-3d', width: '100%', height: '100%', zIndex: '2', transition: flipSpeedBackToFront + "s" }, front),
back: __assign({ WebkitBackfaceVisibility: 'hidden', backfaceVisibility: 'hidden', left: '0', position: isFlipped ? 'relative' : 'absolute', transform: flipDirection === 'horizontal' ? backRotateY : backRotateX, transformStyle: 'preserve-3d', top: '0', width: '100%', height: '100%', transition: flipSpeedFrontToBack + "s" }, back)
front: __assign({ WebkitBackfaceVisibility: 'hidden', backfaceVisibility: 'hidden', height: '100%', left: '0', position: isFlipped ? 'absolute' : 'relative', top: '0', transform: flipDirection === 'horizontal' ? frontRotateY : frontRotateX, transformStyle: 'preserve-3d', transition: flipSpeedBackToFront + "s", width: '100%', zIndex: '2' }, front),
};
return (React.createElement("div", { className: "react-card-flip", style: __assign(__assign({}, styles.container), containerStyle) },
React.createElement("div", { className: "react-card-flipper", style: styles.flipper },
React.createElement("div", { className: "react-card-front", style: styles.front }, getComponent(0)),
React.createElement("div", { className: "react-card-back", style: styles.back }, getComponent(1)))));
};
ReactCardFlip.defaultProps = {
containerStyle: {},
cardStyles: {
back: {},
front: {},
back: {}
},
cardZIndex: 'auto',
containerStyle: {},
flipDirection: 'horizontal',
flipSpeedBackToFront: 0.6,
flipSpeedFrontToBack: 0.6,
infinite: false,
isFlipped: false
isFlipped: false,
};
exports.default = ReactCardFlip;
Loading

0 comments on commit 60622d4

Please sign in to comment.