Socket
Socket
Sign inDemoInstall

@reactflow/node-toolbar

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reactflow/node-toolbar - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

7

dist/esm/index.js
import { jsx } from 'react/jsx-runtime';
import { useCallback } from 'react';
import { useStore, getRectOfNodes, internalsSymbol, Position } from '@reactflow/core';
import { useStore, useNodeId, getRectOfNodes, internalsSymbol, Position } from '@reactflow/core';
import cc from 'classcat';

@@ -58,4 +58,5 @@ import shallow from 'zustand/shallow';

function NodeToolbar({ nodeId, children, className, style, isVisible, position = Position.Top, offset = 10, ...rest }) {
const contextNodeId = useNodeId();
const nodesSelector = useCallback((state) => {
const nodeIds = typeof nodeId === 'string' ? [nodeId] : nodeId;
const nodeIds = Array.isArray(nodeId) ? nodeId : [nodeId || contextNodeId || ''];
return nodeIds.reduce((acc, id) => {

@@ -68,3 +69,3 @@ const node = state.nodeInternals.get(id);

}, []);
}, [nodeId]);
}, [nodeId, contextNodeId]);
const nodes = useStore(nodesSelector, nodesEqualityFn);

@@ -71,0 +72,0 @@ const { transform, nodeOrigin, selectedNodesCount } = useStore(storeSelector, shallow);

import { Position } from '@reactflow/core';
import type { HTMLAttributes } from 'react';
export declare type NodeToolbarProps = HTMLAttributes<HTMLDivElement> & {
nodeId: string | string[];
nodeId?: string | string[];
isVisible?: boolean;

@@ -6,0 +6,0 @@ position?: Position;

import { Position } from '@reactflow/core';
import type { HTMLAttributes } from 'react';
export declare type NodeToolbarProps = HTMLAttributes<HTMLDivElement> & {
nodeId: string | string[];
nodeId?: string | string[];
isVisible?: boolean;

@@ -6,0 +6,0 @@ position?: Position;

{
"name": "@reactflow/node-toolbar",
"version": "1.0.1",
"version": "1.0.2",
"description": "A toolbar component for React Flow that can be attached to a node.",

@@ -34,3 +34,3 @@ "keywords": [

"@babel/runtime": "^7.18.9",
"@reactflow/core": "11.3.1",
"@reactflow/core": "11.3.2",
"classcat": "^5.0.3",

@@ -37,0 +37,0 @@ "zustand": "^4.1.1"

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 too big to display

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