Comparing version 1.2.0 to 1.3.0
@@ -1,4 +0,4 @@ | ||
import * as React from "react"; | ||
/// <reference types="react" /> | ||
export declare type MountyProps = { | ||
children: (props: MountyState) => React.ReactNode | React.ReactNode[]; | ||
children(props: MountyState): JSX.Element; | ||
in: boolean; | ||
@@ -20,21 +20,2 @@ timeout?: number; | ||
}; | ||
export declare class Mounty extends React.Component<MountyProps, MountyState> { | ||
static defaultProps: { | ||
ready: boolean; | ||
timeout: number; | ||
shouldUnmount: boolean; | ||
}; | ||
state: { | ||
active: boolean; | ||
ready: boolean; | ||
entering: boolean; | ||
entered: boolean; | ||
exiting: boolean; | ||
exited: boolean; | ||
}; | ||
componentDidMount(): void; | ||
componentDidUpdate(): void; | ||
enter(): void; | ||
exit(): void; | ||
render(): {}; | ||
} | ||
export declare function Mounty({ children, in: isIn, timeout, shouldUnmount, ...events }: MountyProps): JSX.Element; |
@@ -1,2 +0,2 @@ | ||
import{Component as t}from"react";var e=function(t){var e,n;function i(){var e;return(e=t.apply(this,arguments)||this).state={active:e.props.in,ready:!1,entering:!1,entered:!1,exiting:!1,exited:!1},e}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var o=i.prototype;return o.componentDidMount=function(){this.state.active&&this.enter()},o.componentDidUpdate=function(){var t=this.state,e=t.active,n=this.props.in;n===e||t.entering||t.exiting||(!n&&e?this.exit():n&&!e&&this.enter())},o.enter=function(){var t=this,e=this.props,n=e.timeout,i=e.onEntering,o=e.onEntered;this.setState({active:!0,entered:!1,exited:!1},function(){setTimeout(function(){t.setState({ready:!0,entering:!0},function(){i&&i(),setTimeout(function(){t.setState({entering:!1,entered:!0},function(){o&&o()})},n)})},10)})},o.exit=function(){var t=this,e=this.props,n=e.timeout,i=e.onExiting,o=e.onExited;this.setState({ready:!1,exiting:!0,exited:!1,entered:!1},function(){i&&i(),setTimeout(function(){t.setState({active:!1,exiting:!1,exited:!0},function(){o&&o()})},n)})},o.render=function(){return!this.state.active&&this.props.shouldUnmount?null:this.props.children(this.state)},i}(t);e.defaultProps={ready:!1,timeout:0,shouldUnmount:!1};export{e as Mounty}; | ||
import{useState as n,useEffect as e}from"react";function t(){return(t=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}).apply(this,arguments)}function i(i){var r=i.children,o=i.in,u=i.timeout,c=i.shouldUnmount,a=function(n,e){if(null==n)return{};var t,i,r={},o=Object.keys(n);for(i=0;i<o.length;i++)e.indexOf(t=o[i])>=0||(r[t]=n[t]);return r}(i,["children","in","timeout","shouldUnmount"]),d=n({active:o,ready:o,entering:!1,entered:o,exiting:!1,exited:!1}),f=d[0],g=d[1];return e(function(){o&&!f.active?(g(function(n){return t({},n,{active:!0,entered:!1,exited:!1})}),setTimeout(function(){g(function(n){return t({},n,{ready:!0,entering:!0})}),a.onEntering&&a.onEntering(),setTimeout(function(){g(function(n){return t({},n,{entering:!1,entered:!0})}),a.onEntered&&a.onEntered()},u)},0)):!o&&f.active&&(g(function(n){return t({},n,{exiting:!0,ready:!1,entered:!1})}),a.onExiting&&a.onExiting(),setTimeout(function(){g(function(n){return t({},n,{active:!1,exiting:!1,exited:!0})}),a.onExited&&a.onExited()},u))},[o]),!f.active&&c?null:r(f)}export{i as Mounty}; | ||
//# sourceMappingURL=mounty.es.js.map |
@@ -1,2 +0,2 @@ | ||
var t=function(t){var e,n;function i(){var e;return(e=t.apply(this,arguments)||this).state={active:e.props.in,ready:!1,entering:!1,entered:!1,exiting:!1,exited:!1},e}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var o=i.prototype;return o.componentDidMount=function(){this.state.active&&this.enter()},o.componentDidUpdate=function(){var t=this.state,e=t.active,n=this.props.in;n===e||t.entering||t.exiting||(!n&&e?this.exit():n&&!e&&this.enter())},o.enter=function(){var t=this,e=this.props,n=e.timeout,i=e.onEntering,o=e.onEntered;this.setState({active:!0,entered:!1,exited:!1},function(){setTimeout(function(){t.setState({ready:!0,entering:!0},function(){i&&i(),setTimeout(function(){t.setState({entering:!1,entered:!0},function(){o&&o()})},n)})},10)})},o.exit=function(){var t=this,e=this.props,n=e.timeout,i=e.onExiting,o=e.onExited;this.setState({ready:!1,exiting:!0,exited:!1,entered:!1},function(){i&&i(),setTimeout(function(){t.setState({active:!1,exiting:!1,exited:!0},function(){o&&o()})},n)})},o.render=function(){return!this.state.active&&this.props.shouldUnmount?null:this.props.children(this.state)},i}(require("react").Component);t.defaultProps={ready:!1,timeout:0,shouldUnmount:!1},exports.Mounty=t; | ||
var n=require("react");function e(){return(e=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}).apply(this,arguments)}exports.Mounty=function(t){var i=t.children,r=t.in,o=t.timeout,u=t.shouldUnmount,c=function(n,e){if(null==n)return{};var t,i,r={},o=Object.keys(n);for(i=0;i<o.length;i++)e.indexOf(t=o[i])>=0||(r[t]=n[t]);return r}(t,["children","in","timeout","shouldUnmount"]),a=n.useState({active:r,ready:r,entering:!1,entered:r,exiting:!1,exited:!1}),f=a[0],d=a[1];return n.useEffect(function(){r&&!f.active?(d(function(n){return e({},n,{active:!0,entered:!1,exited:!1})}),setTimeout(function(){d(function(n){return e({},n,{ready:!0,entering:!0})}),c.onEntering&&c.onEntering(),setTimeout(function(){d(function(n){return e({},n,{entering:!1,entered:!0})}),c.onEntered&&c.onEntered()},o)},0)):!r&&f.active&&(d(function(n){return e({},n,{exiting:!0,ready:!1,entered:!1})}),c.onExiting&&c.onExiting(),setTimeout(function(){d(function(n){return e({},n,{active:!1,exiting:!1,exited:!0})}),c.onExited&&c.onExited()},o))},[r]),!f.active&&u?null:i(f)}; | ||
//# sourceMappingURL=mounty.js.map |
@@ -1,2 +0,2 @@ | ||
import{Component as t}from"react";var e=function(t){var e,n;function i(){var e;return(e=t.apply(this,arguments)||this).state={active:e.props.in,ready:!1,entering:!1,entered:!1,exiting:!1,exited:!1},e}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var o=i.prototype;return o.componentDidMount=function(){this.state.active&&this.enter()},o.componentDidUpdate=function(){var t=this.state,e=t.active,n=this.props.in;n===e||t.entering||t.exiting||(!n&&e?this.exit():n&&!e&&this.enter())},o.enter=function(){var t=this,e=this.props,n=e.timeout,i=e.onEntering,o=e.onEntered;this.setState({active:!0,entered:!1,exited:!1},function(){setTimeout(function(){t.setState({ready:!0,entering:!0},function(){i&&i(),setTimeout(function(){t.setState({entering:!1,entered:!0},function(){o&&o()})},n)})},10)})},o.exit=function(){var t=this,e=this.props,n=e.timeout,i=e.onExiting,o=e.onExited;this.setState({ready:!1,exiting:!0,exited:!1,entered:!1},function(){i&&i(),setTimeout(function(){t.setState({active:!1,exiting:!1,exited:!0},function(){o&&o()})},n)})},o.render=function(){return!this.state.active&&this.props.shouldUnmount?null:this.props.children(this.state)},i}(t);e.defaultProps={ready:!1,timeout:0,shouldUnmount:!1};export{e as Mounty}; | ||
import{useState as n,useEffect as e}from"react";function t(){return(t=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}).apply(this,arguments)}function i(i){var r=i.children,o=i.in,u=i.timeout,c=i.shouldUnmount,a=function(n,e){if(null==n)return{};var t,i,r={},o=Object.keys(n);for(i=0;i<o.length;i++)e.indexOf(t=o[i])>=0||(r[t]=n[t]);return r}(i,["children","in","timeout","shouldUnmount"]),d=n({active:o,ready:o,entering:!1,entered:o,exiting:!1,exited:!1}),f=d[0],g=d[1];return e(function(){o&&!f.active?(g(function(n){return t({},n,{active:!0,entered:!1,exited:!1})}),setTimeout(function(){g(function(n){return t({},n,{ready:!0,entering:!0})}),a.onEntering&&a.onEntering(),setTimeout(function(){g(function(n){return t({},n,{entering:!1,entered:!0})}),a.onEntered&&a.onEntered()},u)},0)):!o&&f.active&&(g(function(n){return t({},n,{exiting:!0,ready:!1,entered:!1})}),a.onExiting&&a.onExiting(),setTimeout(function(){g(function(n){return t({},n,{active:!1,exiting:!1,exited:!0})}),a.onExited&&a.onExited()},u))},[o]),!f.active&&c?null:r(f)}export{i as Mounty}; | ||
//# sourceMappingURL=mounty.modern.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t=t||self).mounty={},t.react)}(this,function(t,e){var n=function(t){var e,n;function i(){var e;return(e=t.apply(this,arguments)||this).state={active:e.props.in,ready:!1,entering:!1,entered:!1,exiting:!1,exited:!1},e}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var o=i.prototype;return o.componentDidMount=function(){this.state.active&&this.enter()},o.componentDidUpdate=function(){var t=this.state,e=t.active,n=this.props.in;n===e||t.entering||t.exiting||(!n&&e?this.exit():n&&!e&&this.enter())},o.enter=function(){var t=this,e=this.props,n=e.timeout,i=e.onEntering,o=e.onEntered;this.setState({active:!0,entered:!1,exited:!1},function(){setTimeout(function(){t.setState({ready:!0,entering:!0},function(){i&&i(),setTimeout(function(){t.setState({entering:!1,entered:!0},function(){o&&o()})},n)})},10)})},o.exit=function(){var t=this,e=this.props,n=e.timeout,i=e.onExiting,o=e.onExited;this.setState({ready:!1,exiting:!0,exited:!1,entered:!1},function(){i&&i(),setTimeout(function(){t.setState({active:!1,exiting:!1,exited:!0},function(){o&&o()})},n)})},o.render=function(){return!this.state.active&&this.props.shouldUnmount?null:this.props.children(this.state)},i}(e.Component);n.defaultProps={ready:!1,timeout:0,shouldUnmount:!1},t.Mounty=n}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n((e=e||self).mounty={},e.react)}(this,function(e,n){function t(){return(t=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}e.Mounty=function(e){var i=e.children,r=e.in,o=e.timeout,u=e.shouldUnmount,c=function(e,n){if(null==e)return{};var t,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n.indexOf(t=o[i])>=0||(r[t]=e[t]);return r}(e,["children","in","timeout","shouldUnmount"]),f=n.useState({active:r,ready:r,entering:!1,entered:r,exiting:!1,exited:!1}),d=f[0],a=f[1];return n.useEffect(function(){r&&!d.active?(a(function(e){return t({},e,{active:!0,entered:!1,exited:!1})}),setTimeout(function(){a(function(e){return t({},e,{ready:!0,entering:!0})}),c.onEntering&&c.onEntering(),setTimeout(function(){a(function(e){return t({},e,{entering:!1,entered:!0})}),c.onEntered&&c.onEntered()},o)},0)):!r&&d.active&&(a(function(e){return t({},e,{exiting:!0,ready:!1,entered:!1})}),c.onExiting&&c.onExiting(),setTimeout(function(){a(function(e){return t({},e,{active:!1,exiting:!1,exited:!0})}),c.onExited&&c.onExited()},o))},[r]),!d.active&&u?null:i(d)}}); | ||
//# sourceMappingURL=mounty.umd.js.map |
{ | ||
"name": "mounty", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "A tiny React transition manager with mount/unmount support and a familiar API.", | ||
@@ -46,2 +46,4 @@ "source": "index.tsx", | ||
"microbundle": "^0.12.0-next.8", | ||
"react": ">= 16.9", | ||
"react-dom": ">= 16.9", | ||
"ts-jest": "^25.2.0", | ||
@@ -65,6 +67,5 @@ "ts-node": "^8.6.2", | ||
}, | ||
"dependencies": { | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0" | ||
"peerDependencies": { | ||
"react": ">= 16.9" | ||
} | ||
} |
@@ -1,5 +0,4 @@ | ||
# mounty | ||
# mounty ![npm](https://img.shields.io/npm/v/mounty) [![](https://badgen.net/bundlephobia/minzip/mounty)](https://bundlephobia.com/result?p=mounty) | ||
A tiny React transition manager with mount/unmount support and a familiar API. **~500bytes | ||
gzipped.** | ||
A tiny React transition manager with mount/unmount support and a familiar API. | ||
@@ -6,0 +5,0 @@ ### Install |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
20193
14
46
49
+ Addedreact@19.0.0(transitive)
- Removedreact@^16.12.0
- Removedreact-dom@^16.12.0
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact@16.14.0(transitive)
- Removedreact-dom@16.14.0(transitive)
- Removedreact-is@16.13.1(transitive)
- Removedscheduler@0.19.1(transitive)