- {!isNotSet && isTabVisible && (
-
- {refAll.current.items.map(x => (
-
- {x.item()}
-
- ))}
-
- )}
-
- );
-};
diff --git a/assets/js/hooks/Mapper/components/mapInterface/components/WidgetsGrid/index.ts b/assets/js/hooks/Mapper/components/mapInterface/components/WidgetsGrid/index.ts
deleted file mode 100644
index 7a73e228..00000000
--- a/assets/js/hooks/Mapper/components/mapInterface/components/WidgetsGrid/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './WidgetsGrid';
diff --git a/assets/js/hooks/Mapper/components/ui-kit/WindowManager/WindowManager.tsx b/assets/js/hooks/Mapper/components/ui-kit/WindowManager/WindowManager.tsx
index bc86fd8f..b8082151 100644
--- a/assets/js/hooks/Mapper/components/ui-kit/WindowManager/WindowManager.tsx
+++ b/assets/js/hooks/Mapper/components/ui-kit/WindowManager/WindowManager.tsx
@@ -1,5 +1,7 @@
-import React, { useState, useRef, useEffect, useMemo } from 'react';
+import React, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
import styles from './WindowManager.module.scss';
+import debounce from 'lodash.debounce';
+import { WindowProps } from '@/hooks/Mapper/components/ui-kit/WindowManager/types.ts';
const MIN_WINDOW_SIZE = 100;
const SNAP_THRESHOLD = 10;
@@ -17,14 +19,6 @@ export const DefaultWindowState = {
height: 0,
};
-export type WindowProps = {
- id: number | string;
- content: (w: WindowProps) => React.ReactNode;
- position: { x: number; y: number };
- size: { width: number; height: number };
- zIndex: number;
-};
-
function getWindowsBySides(windows: WindowProps[], containerWidth: number, containerHeight: number) {
const centerX = containerWidth / 2;
const centerY = containerHeight / 2;
@@ -86,9 +80,10 @@ export const WindowWrapper = ({ onResize, onDrag, ...window }: WindowWrapperProp
type WindowManagerProps = {
windows: WindowProps[];
dragSelector?: string;
+ onChange?(windows: WindowProps[]): void;
};
-export const WindowManager: React.FC