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

@byai/topology

Package Overview
Dependencies
Maintainers
3
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@byai/topology - npm Package Compare versions

Comparing version 1.3.23-beta-4 to 1.3.23-beta-5

32

dist/lib/components/line/index.js

@@ -78,29 +78,21 @@ var __extends = (this && this.__extends) || (function () {

}
Line.prototype.shouldComponentUpdate = function (nextProps) {
var _a = this.props, currentData = _a.data, currentHighLight = _a.highLight;
var nextData = nextProps.data, isReduceRender = nextProps.isReduceRender, nextHighLight = nextProps.highLight;
Line.prototype.shouldComponentUpdate = function (nextProps, nextStates) {
var _a = this.props, currentData = _a.data, currentHighLight = _a.highLight, currentSelected = _a.selected;
var nextData = nextProps.data, isReduceRender = nextProps.isReduceRender, nextHighLight = nextProps.highLight, nextSelected = nextProps.selected;
var currentHover = this.state.hover;
var nextHover = nextStates.hover;
var currentLinkiing = this.props.context.linking;
var _b = nextProps.context, dragging = _b.dragging, activeLine = _b.activeLine, nextLinking = _b.linking;
// const curLinking = nextLinking && !activeLine.origin && !currentData;
if (isReduceRender && nextData === currentData && dragging) {
return false;
}
// console.log('老 link => 新 link', currentLinkiing, nextLinking, currentLinkiing === nextLinking);
// console.log('老 highLight => 新 highLight', currentHighLight, nextHighLight, currentHighLight === nextHighLight);
// 连线中
// if (isReduceRender && nextData === currentData && currentLinkiing === nextLinking) {
// console.log('阻止连线中');
// return false;
// }
// nextHighLight
// if (isReduceRender && nextData === currentData && Boolean(currentHighLight) === Boolean(nextHighLight)) {
// console.log('阻止 nextHighLight');
// return false;
// }
if (isReduceRender && nextData === currentData
&& (Boolean(currentHighLight) === Boolean(nextHighLight) || Boolean(currentHighLight) === Boolean(nextHighLight))) {
// console.log('阻止');
var isStableLink = (currentLinkiing === nextLinking) && !(activeLine === null || activeLine === void 0 ? void 0 : activeLine.origin);
var isStableHightLight = Boolean(currentHighLight) === Boolean(nextHighLight);
var isStableSelected = currentSelected === nextSelected;
var isStableHover = currentHover === nextHover;
// TODO:自动布局需要更新线条
if (isReduceRender && nextData === currentData && isStableLink && isStableHightLight && isStableSelected && isStableHover) {
// console.log('阻止 nextHighLight');
return false;
}
// console.log('阻止逻辑', currentLinkiing === nextLinking, Boolean(currentHighLight) === Boolean(nextHighLight));
return true;

@@ -107,0 +99,0 @@ };

{
"name": "@byai/topology",
"version": "1.3.23-beta-4",
"version": "1.3.23-beta-5",
"description": "拓扑图组件",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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