@cyber-harbour/ui 1.0.45 → 1.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -6,7 +6,6 @@ import { CSSProperties, DefaultTheme, WebTarget } from 'styled-components';
6
6
  import * as styled_components_dist_types from 'styled-components/dist/types';
7
7
  import { DefaultTheme as DefaultTheme$1 } from 'styled-components/dist/types';
8
8
  import { PopoverPosition, PopoverAlign } from 'react-tiny-popover';
9
- import { GraphData, NodeObject } from 'react-force-graph-2d';
10
9
 
11
10
  declare const GlobalStyle: react.NamedExoticComponent<styled_components.ExecutionProps & object>;
12
11
 
@@ -217,6 +216,7 @@ type Theme = {
217
216
  graph2D: {
218
217
  ring: {
219
218
  highlightFill: string;
219
+ selectionFill: string;
220
220
  };
221
221
  button: {
222
222
  stroke: string;
@@ -838,31 +838,68 @@ type ContainerProps = FabricComponent<{
838
838
  }>;
839
839
  declare const Container: ({ maxWidth, ...props }: ContainerProps) => react_jsx_runtime.JSX.Element;
840
840
 
841
+ declare const Graph2D: any;
842
+
843
+ interface Graph2DRef {
844
+ /**
845
+ * Масштабирует график так, чтобы все узлы были видны
846
+ * @param duration Длительность анимации масштабирования в миллисекундах
847
+ * @param padding Отступ от краев в пикселях
848
+ */
849
+ zoomToFit: (duration?: number, padding?: number) => void;
850
+ /**
851
+ * Добавляет новые узлы и связи на график
852
+ * @param newNodes Массив новых узлов для добавления
853
+ * @param newLinks Массив новых связей для добавления
854
+ * @param options Опции для настройки поведения при добавлении
855
+ * - smoothAppearance: если true, существующие узлы не будут двигаться,
856
+ * а новые появятся плавно рядом со связанными узлами
857
+ * - transitionDuration: длительность анимации появления новых узлов в миллисекундах
858
+ */
859
+ addNodes: (newNodes: NodeObject[], newLinks?: LinkObject[], options?: {
860
+ smoothAppearance?: boolean;
861
+ transitionDuration?: number;
862
+ }) => void;
863
+ /**
864
+ * Удаляет узлы и связанные с ними связи из графа
865
+ * @param nodeIds Массив идентификаторов узлов для удаления
866
+ */
867
+ removeNodes: (nodeIds: (string | number)[]) => void;
868
+ }
841
869
  interface Graph2DProps {
842
- graphData?: GraphData;
843
- linkSource?: string;
844
- linkTarget?: string;
870
+ graphData: GraphData;
845
871
  loading?: boolean;
846
- width?: number;
847
- height?: number;
848
- config?: {
849
- fontSize: number;
850
- maxZoom: number;
851
- nodeSizeBase: number;
852
- nodeAreaFactor: number;
853
- textPaddingFactor: number;
854
- gridSpacing: number;
855
- dotSize: number;
856
- };
872
+ width: number;
873
+ height: number;
874
+ buttons?: NodeButton[];
857
875
  onNodeClick?: (node: NodeObject) => void;
858
- onLinkClick?: (link: NodeObject) => void;
859
- onNodeHover?: (node: NodeObject | null) => void;
860
- onLinkHover?: (link: NodeObject | null) => void;
861
876
  onBackgroundClick?: () => void;
862
- onClickLoadNodes?: (node: NodeObject) => void;
877
+ onNodeHover?: (node: NodeObject | null) => void;
863
878
  }
864
-
865
- declare const Graph2D: ({ graphData, width, height, linkTarget, linkSource, loading, config, onNodeClick, onNodeHover, onLinkHover, onLinkClick, onBackgroundClick, onClickLoadNodes, }: Graph2DProps) => react_jsx_runtime.JSX.Element;
879
+ interface NodeButton {
880
+ img: string;
881
+ hoverImg: string;
882
+ onClick: (node: NodeObject) => void;
883
+ }
884
+ type GraphData<NodeType = {}, LinkType = {}> = {
885
+ nodes: NodeObject<NodeType>[];
886
+ links: LinkObject<NodeType, LinkType>[];
887
+ };
888
+ type NodeObject<NodeType = {}> = NodeType & {
889
+ id?: string | number;
890
+ x?: number;
891
+ y?: number;
892
+ vx?: number;
893
+ vy?: number;
894
+ fx?: number;
895
+ fy?: number;
896
+ [others: string]: any;
897
+ };
898
+ type LinkObject<NodeType = {}, LinkType = {}> = LinkType & {
899
+ source: string | number | NodeObject<NodeType>;
900
+ target: string | number | NodeObject<NodeType>;
901
+ [others: string]: any;
902
+ };
866
903
 
867
904
  interface FullscreenCardProps {
868
905
  children: any;
@@ -876,4 +913,4 @@ interface FullscreenCardProps {
876
913
  }
877
914
  declare const FullscreenCard: ({ isActive, position, top, left, right, bottom, ...props }: FullscreenCardProps) => react_jsx_runtime.JSX.Element;
878
915
 
879
- export { type Action, AlertIcon, ApiIcon, ArrowCircleTopRightIcon, ArrowRightIcon, BallsMenu, Box, type Breakpoint, BugReportIcon, Button, type ButtonColor, type ButtonElementStyle, type ButtonProps, type ButtonSize, type ButtonSizeStyle, type ButtonState, type ButtonVariant, CalendarIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseCircleIcon, ClosedLockIcon, type ColorVariant, type ColumnTable, Container, ContextMenu, ContextMenuDelimiter, CrossIcon, DataSetsIcon, DeepSearchIcon, DisabledVisibleIcon, DocsIcon, DownloadIcon, EditUserIcon, EmptyData, type EmptyDataProps, EnableVisibleIcon, EnterArrowLeftIcon, type FabricComponent, FiltersIcon, FlexContainer, FlexItem, FullscreenCard, GlobalStyle, Graph2D, type Graph2DProps, Header, HeaderDelimeter, HeaderSection, HomepageIcon, InfoCircleFilledIcon, InfoCircleIcon, Input, type InputElementProps, type InputElementStyle, type InputProps, type InputSize, type InputSizeStyle, type InputState, type InputVariant, Line, ListMenu, ListMenuItem, type ListMenuItemAnchorProps, type ListMenuItemBase, type ListMenuItemButtonProps, type ListMenuItemProps, type ListMenuProps, ListMenuSection, type ListMenuSectionProps, MapRadarIcon, MaximizeIcon, MoonIcon, type NestedColorPaths, OpenLockIcon, OrganizationIcon, PageLayout, Pagination, type PaginationProps, PasswordFinderIcon, PhonebookIcon, PlusIcon, PrintIcon, Profiler2Icon, ProfilerIcon, type RenderCellProps, type RenderHeaderCellProps, RowActionsMenu, SandBoxIcon, SearchIcon, Select, Sidebar, SidebarContext, SidebarDelimeter, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, StatisticIcon, StyledContainer, SunIcon, Table, type TextAreaElementProps, type Theme, type ThemeMode, ThemeProvider, Typography, type TypographyVariant, UnfoldIcon, UpRightArrowCircleIcon, UsersIcon, VectorIcon, convertPaletteToRem, createComponent, darkTheme, darkThemePx, getBreakpoint, getButtonSizeStyles, getButtonStyles, getInputStyles, getTypographyStyles, lightTheme, lightThemePx, pxToRem, remToPx, resolveThemeColor, useContextMenuControl };
916
+ export { type Action, AlertIcon, ApiIcon, ArrowCircleTopRightIcon, ArrowRightIcon, BallsMenu, Box, type Breakpoint, BugReportIcon, Button, type ButtonColor, type ButtonElementStyle, type ButtonProps, type ButtonSize, type ButtonSizeStyle, type ButtonState, type ButtonVariant, CalendarIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseCircleIcon, ClosedLockIcon, type ColorVariant, type ColumnTable, Container, ContextMenu, ContextMenuDelimiter, CrossIcon, DataSetsIcon, DeepSearchIcon, DisabledVisibleIcon, DocsIcon, DownloadIcon, EditUserIcon, EmptyData, type EmptyDataProps, EnableVisibleIcon, EnterArrowLeftIcon, type FabricComponent, FiltersIcon, FlexContainer, FlexItem, FullscreenCard, GlobalStyle, Graph2D, type Graph2DProps, type Graph2DRef, type GraphData, Header, HeaderDelimeter, HeaderSection, HomepageIcon, InfoCircleFilledIcon, InfoCircleIcon, Input, type InputElementProps, type InputElementStyle, type InputProps, type InputSize, type InputSizeStyle, type InputState, type InputVariant, Line, type LinkObject, ListMenu, ListMenuItem, type ListMenuItemAnchorProps, type ListMenuItemBase, type ListMenuItemButtonProps, type ListMenuItemProps, type ListMenuProps, ListMenuSection, type ListMenuSectionProps, MapRadarIcon, MaximizeIcon, MoonIcon, type NestedColorPaths, type NodeButton, type NodeObject, OpenLockIcon, OrganizationIcon, PageLayout, Pagination, type PaginationProps, PasswordFinderIcon, PhonebookIcon, PlusIcon, PrintIcon, Profiler2Icon, ProfilerIcon, type RenderCellProps, type RenderHeaderCellProps, RowActionsMenu, SandBoxIcon, SearchIcon, Select, Sidebar, SidebarContext, SidebarDelimeter, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, StatisticIcon, StyledContainer, SunIcon, Table, type TextAreaElementProps, type Theme, type ThemeMode, ThemeProvider, Typography, type TypographyVariant, UnfoldIcon, UpRightArrowCircleIcon, UsersIcon, VectorIcon, convertPaletteToRem, createComponent, darkTheme, darkThemePx, getBreakpoint, getButtonSizeStyles, getButtonStyles, getInputStyles, getTypographyStyles, lightTheme, lightThemePx, pxToRem, remToPx, resolveThemeColor, useContextMenuControl };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,6 @@ import { CSSProperties, DefaultTheme, WebTarget } from 'styled-components';
6
6
  import * as styled_components_dist_types from 'styled-components/dist/types';
7
7
  import { DefaultTheme as DefaultTheme$1 } from 'styled-components/dist/types';
8
8
  import { PopoverPosition, PopoverAlign } from 'react-tiny-popover';
9
- import { GraphData, NodeObject } from 'react-force-graph-2d';
10
9
 
11
10
  declare const GlobalStyle: react.NamedExoticComponent<styled_components.ExecutionProps & object>;
12
11
 
@@ -217,6 +216,7 @@ type Theme = {
217
216
  graph2D: {
218
217
  ring: {
219
218
  highlightFill: string;
219
+ selectionFill: string;
220
220
  };
221
221
  button: {
222
222
  stroke: string;
@@ -838,31 +838,68 @@ type ContainerProps = FabricComponent<{
838
838
  }>;
839
839
  declare const Container: ({ maxWidth, ...props }: ContainerProps) => react_jsx_runtime.JSX.Element;
840
840
 
841
+ declare const Graph2D: any;
842
+
843
+ interface Graph2DRef {
844
+ /**
845
+ * Масштабирует график так, чтобы все узлы были видны
846
+ * @param duration Длительность анимации масштабирования в миллисекундах
847
+ * @param padding Отступ от краев в пикселях
848
+ */
849
+ zoomToFit: (duration?: number, padding?: number) => void;
850
+ /**
851
+ * Добавляет новые узлы и связи на график
852
+ * @param newNodes Массив новых узлов для добавления
853
+ * @param newLinks Массив новых связей для добавления
854
+ * @param options Опции для настройки поведения при добавлении
855
+ * - smoothAppearance: если true, существующие узлы не будут двигаться,
856
+ * а новые появятся плавно рядом со связанными узлами
857
+ * - transitionDuration: длительность анимации появления новых узлов в миллисекундах
858
+ */
859
+ addNodes: (newNodes: NodeObject[], newLinks?: LinkObject[], options?: {
860
+ smoothAppearance?: boolean;
861
+ transitionDuration?: number;
862
+ }) => void;
863
+ /**
864
+ * Удаляет узлы и связанные с ними связи из графа
865
+ * @param nodeIds Массив идентификаторов узлов для удаления
866
+ */
867
+ removeNodes: (nodeIds: (string | number)[]) => void;
868
+ }
841
869
  interface Graph2DProps {
842
- graphData?: GraphData;
843
- linkSource?: string;
844
- linkTarget?: string;
870
+ graphData: GraphData;
845
871
  loading?: boolean;
846
- width?: number;
847
- height?: number;
848
- config?: {
849
- fontSize: number;
850
- maxZoom: number;
851
- nodeSizeBase: number;
852
- nodeAreaFactor: number;
853
- textPaddingFactor: number;
854
- gridSpacing: number;
855
- dotSize: number;
856
- };
872
+ width: number;
873
+ height: number;
874
+ buttons?: NodeButton[];
857
875
  onNodeClick?: (node: NodeObject) => void;
858
- onLinkClick?: (link: NodeObject) => void;
859
- onNodeHover?: (node: NodeObject | null) => void;
860
- onLinkHover?: (link: NodeObject | null) => void;
861
876
  onBackgroundClick?: () => void;
862
- onClickLoadNodes?: (node: NodeObject) => void;
877
+ onNodeHover?: (node: NodeObject | null) => void;
863
878
  }
864
-
865
- declare const Graph2D: ({ graphData, width, height, linkTarget, linkSource, loading, config, onNodeClick, onNodeHover, onLinkHover, onLinkClick, onBackgroundClick, onClickLoadNodes, }: Graph2DProps) => react_jsx_runtime.JSX.Element;
879
+ interface NodeButton {
880
+ img: string;
881
+ hoverImg: string;
882
+ onClick: (node: NodeObject) => void;
883
+ }
884
+ type GraphData<NodeType = {}, LinkType = {}> = {
885
+ nodes: NodeObject<NodeType>[];
886
+ links: LinkObject<NodeType, LinkType>[];
887
+ };
888
+ type NodeObject<NodeType = {}> = NodeType & {
889
+ id?: string | number;
890
+ x?: number;
891
+ y?: number;
892
+ vx?: number;
893
+ vy?: number;
894
+ fx?: number;
895
+ fy?: number;
896
+ [others: string]: any;
897
+ };
898
+ type LinkObject<NodeType = {}, LinkType = {}> = LinkType & {
899
+ source: string | number | NodeObject<NodeType>;
900
+ target: string | number | NodeObject<NodeType>;
901
+ [others: string]: any;
902
+ };
866
903
 
867
904
  interface FullscreenCardProps {
868
905
  children: any;
@@ -876,4 +913,4 @@ interface FullscreenCardProps {
876
913
  }
877
914
  declare const FullscreenCard: ({ isActive, position, top, left, right, bottom, ...props }: FullscreenCardProps) => react_jsx_runtime.JSX.Element;
878
915
 
879
- export { type Action, AlertIcon, ApiIcon, ArrowCircleTopRightIcon, ArrowRightIcon, BallsMenu, Box, type Breakpoint, BugReportIcon, Button, type ButtonColor, type ButtonElementStyle, type ButtonProps, type ButtonSize, type ButtonSizeStyle, type ButtonState, type ButtonVariant, CalendarIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseCircleIcon, ClosedLockIcon, type ColorVariant, type ColumnTable, Container, ContextMenu, ContextMenuDelimiter, CrossIcon, DataSetsIcon, DeepSearchIcon, DisabledVisibleIcon, DocsIcon, DownloadIcon, EditUserIcon, EmptyData, type EmptyDataProps, EnableVisibleIcon, EnterArrowLeftIcon, type FabricComponent, FiltersIcon, FlexContainer, FlexItem, FullscreenCard, GlobalStyle, Graph2D, type Graph2DProps, Header, HeaderDelimeter, HeaderSection, HomepageIcon, InfoCircleFilledIcon, InfoCircleIcon, Input, type InputElementProps, type InputElementStyle, type InputProps, type InputSize, type InputSizeStyle, type InputState, type InputVariant, Line, ListMenu, ListMenuItem, type ListMenuItemAnchorProps, type ListMenuItemBase, type ListMenuItemButtonProps, type ListMenuItemProps, type ListMenuProps, ListMenuSection, type ListMenuSectionProps, MapRadarIcon, MaximizeIcon, MoonIcon, type NestedColorPaths, OpenLockIcon, OrganizationIcon, PageLayout, Pagination, type PaginationProps, PasswordFinderIcon, PhonebookIcon, PlusIcon, PrintIcon, Profiler2Icon, ProfilerIcon, type RenderCellProps, type RenderHeaderCellProps, RowActionsMenu, SandBoxIcon, SearchIcon, Select, Sidebar, SidebarContext, SidebarDelimeter, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, StatisticIcon, StyledContainer, SunIcon, Table, type TextAreaElementProps, type Theme, type ThemeMode, ThemeProvider, Typography, type TypographyVariant, UnfoldIcon, UpRightArrowCircleIcon, UsersIcon, VectorIcon, convertPaletteToRem, createComponent, darkTheme, darkThemePx, getBreakpoint, getButtonSizeStyles, getButtonStyles, getInputStyles, getTypographyStyles, lightTheme, lightThemePx, pxToRem, remToPx, resolveThemeColor, useContextMenuControl };
916
+ export { type Action, AlertIcon, ApiIcon, ArrowCircleTopRightIcon, ArrowRightIcon, BallsMenu, Box, type Breakpoint, BugReportIcon, Button, type ButtonColor, type ButtonElementStyle, type ButtonProps, type ButtonSize, type ButtonSizeStyle, type ButtonState, type ButtonVariant, CalendarIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseCircleIcon, ClosedLockIcon, type ColorVariant, type ColumnTable, Container, ContextMenu, ContextMenuDelimiter, CrossIcon, DataSetsIcon, DeepSearchIcon, DisabledVisibleIcon, DocsIcon, DownloadIcon, EditUserIcon, EmptyData, type EmptyDataProps, EnableVisibleIcon, EnterArrowLeftIcon, type FabricComponent, FiltersIcon, FlexContainer, FlexItem, FullscreenCard, GlobalStyle, Graph2D, type Graph2DProps, type Graph2DRef, type GraphData, Header, HeaderDelimeter, HeaderSection, HomepageIcon, InfoCircleFilledIcon, InfoCircleIcon, Input, type InputElementProps, type InputElementStyle, type InputProps, type InputSize, type InputSizeStyle, type InputState, type InputVariant, Line, type LinkObject, ListMenu, ListMenuItem, type ListMenuItemAnchorProps, type ListMenuItemBase, type ListMenuItemButtonProps, type ListMenuItemProps, type ListMenuProps, ListMenuSection, type ListMenuSectionProps, MapRadarIcon, MaximizeIcon, MoonIcon, type NestedColorPaths, type NodeButton, type NodeObject, OpenLockIcon, OrganizationIcon, PageLayout, Pagination, type PaginationProps, PasswordFinderIcon, PhonebookIcon, PlusIcon, PrintIcon, Profiler2Icon, ProfilerIcon, type RenderCellProps, type RenderHeaderCellProps, RowActionsMenu, SandBoxIcon, SearchIcon, Select, Sidebar, SidebarContext, SidebarDelimeter, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, StatisticIcon, StyledContainer, SunIcon, Table, type TextAreaElementProps, type Theme, type ThemeMode, ThemeProvider, Typography, type TypographyVariant, UnfoldIcon, UpRightArrowCircleIcon, UsersIcon, VectorIcon, convertPaletteToRem, createComponent, darkTheme, darkThemePx, getBreakpoint, getButtonSizeStyles, getButtonStyles, getInputStyles, getTypographyStyles, lightTheme, lightThemePx, pxToRem, remToPx, resolveThemeColor, useContextMenuControl };