Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-notification

Package Overview
Dependencies
Maintainers
8
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-notification - npm Package Compare versions

Comparing version 5.5.0 to 5.6.0

1

es/hooks/useNotification.d.ts

@@ -18,2 +18,3 @@ import type { CSSMotionProps } from 'rc-motion';

showProgress?: boolean;
pauseOnHover?: boolean;
/** @private. Config for notification holder style. Safe to remove if refactor */

@@ -20,0 +21,0 @@ className?: (placement: Placement) => string;

@@ -8,2 +8,3 @@ import type React from 'react';

showProgress?: boolean;
pauseOnHover?: boolean;
closeIcon?: React.ReactNode;

@@ -10,0 +11,0 @@ closable?: boolean | ({

14

es/Notice.js

@@ -16,2 +16,4 @@ import _extends from "@babel/runtime/helpers/esm/extends";

showProgress = props.showProgress,
_props$pauseOnHover = props.pauseOnHover,
pauseOnHover = _props$pauseOnHover === void 0 ? true : _props$pauseOnHover,
eventKey = props.eventKey,

@@ -60,3 +62,5 @@ content = props.content,

return function () {
clearTimeout(timeout);
if (pauseOnHover) {
clearTimeout(timeout);
}
setSpentTime(Date.now() - start);

@@ -68,3 +72,3 @@ };

React.useEffect(function () {
if (!mergedHovering && mergedShowProgress) {
if (!mergedHovering && mergedShowProgress && (pauseOnHover || spentTime === 0)) {
var start = performance.now();

@@ -85,7 +89,9 @@ var animationFrame;

return function () {
cancelAnimationFrame(animationFrame);
if (pauseOnHover) {
cancelAnimationFrame(animationFrame);
}
};
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [duration, mergedHovering, mergedShowProgress, times]);
}, [duration, spentTime, mergedHovering, mergedShowProgress, times]);

@@ -92,0 +98,0 @@ // ======================== Closable ========================

@@ -18,2 +18,3 @@ import type { CSSMotionProps } from 'rc-motion';

showProgress?: boolean;
pauseOnHover?: boolean;
/** @private. Config for notification holder style. Safe to remove if refactor */

@@ -20,0 +21,0 @@ className?: (placement: Placement) => string;

@@ -8,2 +8,3 @@ import type React from 'react';

showProgress?: boolean;
pauseOnHover?: boolean;
closeIcon?: React.ReactNode;

@@ -10,0 +11,0 @@ closable?: boolean | ({

@@ -26,2 +26,4 @@ "use strict";

showProgress = props.showProgress,
_props$pauseOnHover = props.pauseOnHover,
pauseOnHover = _props$pauseOnHover === void 0 ? true : _props$pauseOnHover,
eventKey = props.eventKey,

@@ -70,3 +72,5 @@ content = props.content,

return function () {
clearTimeout(timeout);
if (pauseOnHover) {
clearTimeout(timeout);
}
setSpentTime(Date.now() - start);

@@ -78,3 +82,3 @@ };

React.useEffect(function () {
if (!mergedHovering && mergedShowProgress) {
if (!mergedHovering && mergedShowProgress && (pauseOnHover || spentTime === 0)) {
var start = performance.now();

@@ -95,7 +99,9 @@ var animationFrame;

return function () {
cancelAnimationFrame(animationFrame);
if (pauseOnHover) {
cancelAnimationFrame(animationFrame);
}
};
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [duration, mergedHovering, mergedShowProgress, times]);
}, [duration, spentTime, mergedHovering, mergedShowProgress, times]);

@@ -102,0 +108,0 @@ // ======================== Closable ========================

{
"name": "rc-notification",
"version": "5.5.0",
"version": "5.6.0",
"description": "notification ui component for react",

@@ -5,0 +5,0 @@ "engines": {

@@ -140,2 +140,8 @@ # rc-notification

<tr>
<td>pauseOnHover</td>
<td>boolean</td>
<td>true</td>
<td>keep the timer running or not on hover</td>
</tr>
<tr>
<td>style</td>

@@ -142,0 +148,0 @@ <td>Object</td>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc