Socket
Socket
Sign inDemoInstall

rc-notification

Package Overview
Dependencies
Maintainers
8
Versions
75
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.6.0 to 5.6.1

19

es/NoticeList.js

@@ -27,10 +27,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";

var dictRef = useRef({});
var _useState = useState(null),
var latestNoticeRef = useRef(null);
var _useState = useState([]),
_useState2 = _slicedToArray(_useState, 2),
latestNotice = _useState2[0],
setLatestNotice = _useState2[1];
var _useState3 = useState([]),
_useState4 = _slicedToArray(_useState3, 2),
hoverKeys = _useState4[0],
setHoverKeys = _useState4[1];
hoverKeys = _useState2[0],
setHoverKeys = _useState2[1];
var keys = configList.map(function (config) {

@@ -71,3 +68,3 @@ return {

var _keys2;
setLatestNotice(dictRef.current[(_keys2 = keys[keys.length - 1]) === null || _keys2 === void 0 ? void 0 : _keys2.key]);
latestNoticeRef.current = dictRef.current[(_keys2 = keys[keys.length - 1]) === null || _keys2 === void 0 ? void 0 : _keys2.key];
}

@@ -111,4 +108,4 @@ }, [keys, stack]);

if (index > 0) {
var _dictRef$current$strK, _dictRef$current$strK2, _dictRef$current$strK3;
stackStyle.height = expanded ? (_dictRef$current$strK = dictRef.current[strKey]) === null || _dictRef$current$strK === void 0 ? void 0 : _dictRef$current$strK.offsetHeight : latestNotice === null || latestNotice === void 0 ? void 0 : latestNotice.offsetHeight;
var _dictRef$current$strK, _latestNoticeRef$curr, _latestNoticeRef$curr2, _dictRef$current$strK2, _latestNoticeRef$curr3, _dictRef$current$strK3;
stackStyle.height = expanded ? (_dictRef$current$strK = dictRef.current[strKey]) === null || _dictRef$current$strK === void 0 ? void 0 : _dictRef$current$strK.offsetHeight : (_latestNoticeRef$curr = latestNoticeRef.current) === null || _latestNoticeRef$curr === void 0 ? void 0 : _latestNoticeRef$curr.offsetHeight;

@@ -122,3 +119,3 @@ // Transform

var transformY = (expanded ? verticalOffset : index * offset) * (placement.startsWith('top') ? 1 : -1);
var scaleX = !expanded && latestNotice !== null && latestNotice !== void 0 && latestNotice.offsetWidth && (_dictRef$current$strK2 = dictRef.current[strKey]) !== null && _dictRef$current$strK2 !== void 0 && _dictRef$current$strK2.offsetWidth ? ((latestNotice === null || latestNotice === void 0 ? void 0 : latestNotice.offsetWidth) - offset * 2 * (index < 3 ? index : 3)) / ((_dictRef$current$strK3 = dictRef.current[strKey]) === null || _dictRef$current$strK3 === void 0 ? void 0 : _dictRef$current$strK3.offsetWidth) : 1;
var scaleX = !expanded && (_latestNoticeRef$curr2 = latestNoticeRef.current) !== null && _latestNoticeRef$curr2 !== void 0 && _latestNoticeRef$curr2.offsetWidth && (_dictRef$current$strK2 = dictRef.current[strKey]) !== null && _dictRef$current$strK2 !== void 0 && _dictRef$current$strK2.offsetWidth ? (((_latestNoticeRef$curr3 = latestNoticeRef.current) === null || _latestNoticeRef$curr3 === void 0 ? void 0 : _latestNoticeRef$curr3.offsetWidth) - offset * 2 * (index < 3 ? index : 3)) / ((_dictRef$current$strK3 = dictRef.current[strKey]) === null || _dictRef$current$strK3 === void 0 ? void 0 : _dictRef$current$strK3.offsetWidth) : 1;
stackStyle.transform = "translate3d(".concat(transformX, ", ").concat(transformY, "px, 0) scaleX(").concat(scaleX, ")");

@@ -125,0 +122,0 @@ } else {

@@ -37,10 +37,7 @@ "use strict";

var dictRef = (0, _react.useRef)({});
var _useState = (0, _react.useState)(null),
var latestNoticeRef = (0, _react.useRef)(null);
var _useState = (0, _react.useState)([]),
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
latestNotice = _useState2[0],
setLatestNotice = _useState2[1];
var _useState3 = (0, _react.useState)([]),
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
hoverKeys = _useState4[0],
setHoverKeys = _useState4[1];
hoverKeys = _useState2[0],
setHoverKeys = _useState2[1];
var keys = configList.map(function (config) {

@@ -81,3 +78,3 @@ return {

var _keys2;
setLatestNotice(dictRef.current[(_keys2 = keys[keys.length - 1]) === null || _keys2 === void 0 ? void 0 : _keys2.key]);
latestNoticeRef.current = dictRef.current[(_keys2 = keys[keys.length - 1]) === null || _keys2 === void 0 ? void 0 : _keys2.key];
}

@@ -121,4 +118,4 @@ }, [keys, stack]);

if (index > 0) {
var _dictRef$current$strK, _dictRef$current$strK2, _dictRef$current$strK3;
stackStyle.height = expanded ? (_dictRef$current$strK = dictRef.current[strKey]) === null || _dictRef$current$strK === void 0 ? void 0 : _dictRef$current$strK.offsetHeight : latestNotice === null || latestNotice === void 0 ? void 0 : latestNotice.offsetHeight;
var _dictRef$current$strK, _latestNoticeRef$curr, _latestNoticeRef$curr2, _dictRef$current$strK2, _latestNoticeRef$curr3, _dictRef$current$strK3;
stackStyle.height = expanded ? (_dictRef$current$strK = dictRef.current[strKey]) === null || _dictRef$current$strK === void 0 ? void 0 : _dictRef$current$strK.offsetHeight : (_latestNoticeRef$curr = latestNoticeRef.current) === null || _latestNoticeRef$curr === void 0 ? void 0 : _latestNoticeRef$curr.offsetHeight;

@@ -132,3 +129,3 @@ // Transform

var transformY = (expanded ? verticalOffset : index * offset) * (placement.startsWith('top') ? 1 : -1);
var scaleX = !expanded && latestNotice !== null && latestNotice !== void 0 && latestNotice.offsetWidth && (_dictRef$current$strK2 = dictRef.current[strKey]) !== null && _dictRef$current$strK2 !== void 0 && _dictRef$current$strK2.offsetWidth ? ((latestNotice === null || latestNotice === void 0 ? void 0 : latestNotice.offsetWidth) - offset * 2 * (index < 3 ? index : 3)) / ((_dictRef$current$strK3 = dictRef.current[strKey]) === null || _dictRef$current$strK3 === void 0 ? void 0 : _dictRef$current$strK3.offsetWidth) : 1;
var scaleX = !expanded && (_latestNoticeRef$curr2 = latestNoticeRef.current) !== null && _latestNoticeRef$curr2 !== void 0 && _latestNoticeRef$curr2.offsetWidth && (_dictRef$current$strK2 = dictRef.current[strKey]) !== null && _dictRef$current$strK2 !== void 0 && _dictRef$current$strK2.offsetWidth ? (((_latestNoticeRef$curr3 = latestNoticeRef.current) === null || _latestNoticeRef$curr3 === void 0 ? void 0 : _latestNoticeRef$curr3.offsetWidth) - offset * 2 * (index < 3 ? index : 3)) / ((_dictRef$current$strK3 = dictRef.current[strKey]) === null || _dictRef$current$strK3 === void 0 ? void 0 : _dictRef$current$strK3.offsetWidth) : 1;
stackStyle.transform = "translate3d(".concat(transformX, ", ").concat(transformY, "px, 0) scaleX(").concat(scaleX, ")");

@@ -135,0 +132,0 @@ } else {

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

@@ -44,3 +44,4 @@ "engines": {

"lint": "eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js",
"test": "vitest",
"test": "vitest --watch=false",
"test:watch": "vitest",
"coverage": "vitest run --coverage",

@@ -56,8 +57,8 @@ "now-build": "npm run build",

"@rc-component/father-plugin": "^1.0.2",
"@testing-library/jest-dom": "^5.0.0",
"@testing-library/react": "^13.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^15.0.7",
"@types/classnames": "^2.2.10",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@types/testing-library__jest-dom": "^5.0.0",
"@types/testing-library__jest-dom": "^6.0.0",
"@umijs/fabric": "^2.0.0",

@@ -71,10 +72,10 @@ "@vitest/coverage-v8": "^0.34.2",

"husky": "^8.0.3",
"jsdom": "^22.1.0",
"less": "^3.10.3",
"jsdom": "^24.0.0",
"less": "^4.2.0",
"lint-staged": "^14.0.1",
"np": "^6.0.0",
"np": "^10.0.5",
"prettier": "^3.0.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"typescript": "^4.0.5",
"typescript": "^5.4.5",
"vitest": "^0.34.2"

@@ -81,0 +82,0 @@ },

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