@abdellatifui/react 3.1.89 → 3.1.90
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/nextgen.d.ts +5 -0
- package/dist/nextgen.js +257 -202
- package/dist/nextgen.js.map +1 -1
- package/dist/style.css +12 -1
- package/dist/types/components/NetworkMap/Map.d.ts +1 -0
- package/dist/types/components/NetworkMap/Map.d.ts.map +1 -1
- package/dist/types/components/NetworkMap/SourcePort.d.ts.map +1 -1
- package/dist/types/components/NetworkMap/types.d.ts +5 -0
- package/dist/types/components/NetworkMap/types.d.ts.map +1 -1
- package/dist/types/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/types/stories/Map/map.stories.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/nextgen.js
CHANGED
|
@@ -12441,17 +12441,14 @@ const Sidebar = forwardRef((props, ref) => {
|
|
|
12441
12441
|
}
|
|
12442
12442
|
} = props;
|
|
12443
12443
|
const content = useMemo(() => {
|
|
12444
|
-
|
|
12445
|
-
return children;
|
|
12446
|
-
}
|
|
12447
|
-
return null;
|
|
12444
|
+
return children ? children : null;
|
|
12448
12445
|
}, [children]);
|
|
12449
12446
|
const handleOpen = useCallback(() => {
|
|
12450
12447
|
var _a;
|
|
12451
12448
|
(_a = modelRef.current) == null ? void 0 : _a.open();
|
|
12452
|
-
|
|
12449
|
+
setTimeout(() => {
|
|
12453
12450
|
setIsOpen(true);
|
|
12454
|
-
},
|
|
12451
|
+
}, 50);
|
|
12455
12452
|
}, []);
|
|
12456
12453
|
const handleClose = useCallback(() => {
|
|
12457
12454
|
var _a;
|
|
@@ -14428,7 +14425,8 @@ const PortText = (props) => {
|
|
|
14428
14425
|
rotation,
|
|
14429
14426
|
isVisible,
|
|
14430
14427
|
data,
|
|
14431
|
-
isFocused
|
|
14428
|
+
isFocused,
|
|
14429
|
+
fontSize
|
|
14432
14430
|
} = props;
|
|
14433
14431
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14434
14432
|
"div",
|
|
@@ -14445,21 +14443,24 @@ const PortText = (props) => {
|
|
|
14445
14443
|
alignItems: "center",
|
|
14446
14444
|
justifyContent: "center",
|
|
14447
14445
|
backgroundColor: data == null ? void 0 : data.linkColorHex,
|
|
14448
|
-
opacity: isVisible ? 1 : 0
|
|
14446
|
+
opacity: isVisible ? 1 : 0,
|
|
14447
|
+
fontSize: fontSize + "rem"
|
|
14449
14448
|
},
|
|
14450
14449
|
children: text
|
|
14451
14450
|
}
|
|
14452
14451
|
);
|
|
14453
14452
|
};
|
|
14454
14453
|
const SourcesPorts = (props) => {
|
|
14455
|
-
var _a, _b, _c, _d
|
|
14454
|
+
var _a, _b, _c, _d;
|
|
14456
14455
|
const {
|
|
14457
14456
|
data,
|
|
14458
14457
|
mapApi,
|
|
14459
14458
|
currentZoomLevel,
|
|
14460
14459
|
hoveredConnection,
|
|
14461
14460
|
mapDragging,
|
|
14462
|
-
getEndpointText
|
|
14461
|
+
getEndpointText,
|
|
14462
|
+
mapRotating,
|
|
14463
|
+
fontSize
|
|
14463
14464
|
} = props;
|
|
14464
14465
|
const [midpoint, setMidpoint] = useState(null);
|
|
14465
14466
|
const [isVisible, setIsVisible] = useState(true);
|
|
@@ -14480,7 +14481,7 @@ const SourcesPorts = (props) => {
|
|
|
14480
14481
|
} else if (currentZoomLevel > 6) {
|
|
14481
14482
|
setIsVisible(true);
|
|
14482
14483
|
}
|
|
14483
|
-
}, [currentZoomLevel]);
|
|
14484
|
+
}, [currentZoomLevel, mapDragging]);
|
|
14484
14485
|
useEffect(() => {
|
|
14485
14486
|
if (!hoveredConnection) {
|
|
14486
14487
|
setIsVisible(true);
|
|
@@ -14495,24 +14496,8 @@ const SourcesPorts = (props) => {
|
|
|
14495
14496
|
setIsFocused(false);
|
|
14496
14497
|
}
|
|
14497
14498
|
}, [hoveredConnection == null ? void 0 : hoveredConnection.u_id, data == null ? void 0 : data.u_id, currentZoomLevel]);
|
|
14498
|
-
useEffect(() => {
|
|
14499
|
-
const map = mapApi == null ? void 0 : mapApi.current;
|
|
14500
|
-
if (!map) return;
|
|
14501
|
-
const onMove = () => setViewportRevision((v) => v + 1);
|
|
14502
|
-
map.on("move", onMove);
|
|
14503
|
-
map.on("zoom", onMove);
|
|
14504
|
-
map.on("rotate", onMove);
|
|
14505
|
-
return () => {
|
|
14506
|
-
try {
|
|
14507
|
-
map.off("move", onMove);
|
|
14508
|
-
map.off("zoom", onMove);
|
|
14509
|
-
map.off("rotate", onMove);
|
|
14510
|
-
} catch (e) {
|
|
14511
|
-
}
|
|
14512
|
-
};
|
|
14513
|
-
}, [mapApi == null ? void 0 : mapApi.current]);
|
|
14514
14499
|
const sourceLabel = useMemo(() => {
|
|
14515
|
-
var _a2, _b2, _c2, _d2,
|
|
14500
|
+
var _a2, _b2, _c2, _d2, _e, _f;
|
|
14516
14501
|
try {
|
|
14517
14502
|
const map = mapApi == null ? void 0 : mapApi.current;
|
|
14518
14503
|
if (!map || !(data == null ? void 0 : data.source) || !(data == null ? void 0 : data.destination)) return null;
|
|
@@ -14525,7 +14510,7 @@ const SourcesPorts = (props) => {
|
|
|
14525
14510
|
const uy = dy / length2;
|
|
14526
14511
|
const nx = -uy;
|
|
14527
14512
|
const ny = ux;
|
|
14528
|
-
const markerHalfSize = ((
|
|
14513
|
+
const markerHalfSize = ((_e = data == null ? void 0 : data.source) == null ? void 0 : _e.markerSize) ? ((_f = data == null ? void 0 : data.source) == null ? void 0 : _f.markerSize) / 2 : 12;
|
|
14529
14514
|
const totalLength = length2;
|
|
14530
14515
|
const defaultOffset = { along: 100, perpendicular: 0 };
|
|
14531
14516
|
const customOffset = (data == null ? void 0 : data.sourcePortOffset) || {};
|
|
@@ -14547,9 +14532,9 @@ const SourcesPorts = (props) => {
|
|
|
14547
14532
|
} catch (e) {
|
|
14548
14533
|
return null;
|
|
14549
14534
|
}
|
|
14550
|
-
}, [mapApi == null ? void 0 : mapApi.current,
|
|
14535
|
+
}, [mapApi == null ? void 0 : mapApi.current, mapRotating, currentZoomLevel]);
|
|
14551
14536
|
const destinationLabel = useMemo(() => {
|
|
14552
|
-
var _a2, _b2, _c2, _d2,
|
|
14537
|
+
var _a2, _b2, _c2, _d2, _e, _f;
|
|
14553
14538
|
try {
|
|
14554
14539
|
const map = mapApi == null ? void 0 : mapApi.current;
|
|
14555
14540
|
if (!map || !(data == null ? void 0 : data.source) || !(data == null ? void 0 : data.destination)) return null;
|
|
@@ -14562,7 +14547,7 @@ const SourcesPorts = (props) => {
|
|
|
14562
14547
|
const uy = dy / length2;
|
|
14563
14548
|
const nx = -uy;
|
|
14564
14549
|
const ny = ux;
|
|
14565
|
-
const markerHalfSize = ((
|
|
14550
|
+
const markerHalfSize = ((_e = data == null ? void 0 : data.destination) == null ? void 0 : _e.markerSize) ? ((_f = data == null ? void 0 : data.destination) == null ? void 0 : _f.markerSize) / 2 : 12;
|
|
14566
14551
|
const totalLength = length2;
|
|
14567
14552
|
const defaultOffset = { along: 100, perpendicular: 0 };
|
|
14568
14553
|
const customOffset = (data == null ? void 0 : data.destinationPortOffset) || {};
|
|
@@ -14584,20 +14569,21 @@ const SourcesPorts = (props) => {
|
|
|
14584
14569
|
} catch (e) {
|
|
14585
14570
|
return null;
|
|
14586
14571
|
}
|
|
14587
|
-
}, [mapApi == null ? void 0 : mapApi.current,
|
|
14572
|
+
}, [mapApi == null ? void 0 : mapApi.current, mapRotating, currentZoomLevel]);
|
|
14588
14573
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
14589
14574
|
sourceLabel && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14590
14575
|
CustomMarker$1,
|
|
14591
14576
|
{
|
|
14592
|
-
longitude: (
|
|
14593
|
-
latitude: (
|
|
14577
|
+
longitude: (_a = sourceLabel == null ? void 0 : sourceLabel.position) == null ? void 0 : _a.lng,
|
|
14578
|
+
latitude: (_b = sourceLabel == null ? void 0 : sourceLabel.position) == null ? void 0 : _b.lat,
|
|
14594
14579
|
offset: [0, 0],
|
|
14595
14580
|
children: getEndpointText ? getEndpointText({
|
|
14596
14581
|
...data,
|
|
14597
14582
|
rotation: sourceLabel == null ? void 0 : sourceLabel.rotation,
|
|
14598
14583
|
isVisible,
|
|
14599
14584
|
text: data == null ? void 0 : data.sourcePort,
|
|
14600
|
-
isFocused
|
|
14585
|
+
isFocused,
|
|
14586
|
+
fontSize
|
|
14601
14587
|
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14602
14588
|
PortText,
|
|
14603
14589
|
{
|
|
@@ -14605,7 +14591,8 @@ const SourcesPorts = (props) => {
|
|
|
14605
14591
|
rotation: sourceLabel == null ? void 0 : sourceLabel.rotation,
|
|
14606
14592
|
isVisible,
|
|
14607
14593
|
data,
|
|
14608
|
-
isFocused
|
|
14594
|
+
isFocused,
|
|
14595
|
+
fontSize
|
|
14609
14596
|
}
|
|
14610
14597
|
)
|
|
14611
14598
|
}
|
|
@@ -14613,15 +14600,16 @@ const SourcesPorts = (props) => {
|
|
|
14613
14600
|
destinationLabel && (data == null ? void 0 : data.destinationPort) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14614
14601
|
CustomMarker$1,
|
|
14615
14602
|
{
|
|
14616
|
-
longitude: (
|
|
14617
|
-
latitude: (
|
|
14603
|
+
longitude: (_c = destinationLabel == null ? void 0 : destinationLabel.position) == null ? void 0 : _c.lng,
|
|
14604
|
+
latitude: (_d = destinationLabel == null ? void 0 : destinationLabel.position) == null ? void 0 : _d.lat,
|
|
14618
14605
|
offset: [0, 0],
|
|
14619
14606
|
children: getEndpointText ? getEndpointText({
|
|
14620
14607
|
...data,
|
|
14621
14608
|
rotation: destinationLabel == null ? void 0 : destinationLabel.rotation,
|
|
14622
14609
|
isVisible,
|
|
14623
14610
|
text: data == null ? void 0 : data.destinationPort,
|
|
14624
|
-
isFocused
|
|
14611
|
+
isFocused,
|
|
14612
|
+
fontSize
|
|
14625
14613
|
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14626
14614
|
PortText,
|
|
14627
14615
|
{
|
|
@@ -14630,7 +14618,8 @@ const SourcesPorts = (props) => {
|
|
|
14630
14618
|
isVisible,
|
|
14631
14619
|
data,
|
|
14632
14620
|
getEndpointText,
|
|
14633
|
-
isFocused
|
|
14621
|
+
isFocused,
|
|
14622
|
+
fontSize
|
|
14634
14623
|
}
|
|
14635
14624
|
)
|
|
14636
14625
|
}
|
|
@@ -14638,6 +14627,7 @@ const SourcesPorts = (props) => {
|
|
|
14638
14627
|
] });
|
|
14639
14628
|
};
|
|
14640
14629
|
const SourcesPorts$1 = memo(SourcesPorts);
|
|
14630
|
+
const baseFont = 0.75;
|
|
14641
14631
|
const mapStyles = [
|
|
14642
14632
|
{ "name": "street1", url: "https://api.maptiler.com/maps/streets/style.json?key=4s1cX8zNpChcrWFsQqbP" },
|
|
14643
14633
|
{ "name": "street2", url: "https://api.maptiler.com/maps/streets-v2/style.json?key=4s1cX8zNpChcrWFsQqbP" },
|
|
@@ -14658,14 +14648,20 @@ function DeckGLOverlay(props) {
|
|
|
14658
14648
|
const NetworkMapComponent = forwardRef((props, ref) => {
|
|
14659
14649
|
const {
|
|
14660
14650
|
nodes = [],
|
|
14651
|
+
initialZoomLevel = 6,
|
|
14661
14652
|
connections = [],
|
|
14662
14653
|
linkHighlightedColorHex = "#ffffff",
|
|
14663
14654
|
defaultLinkColorHex = "#1d6591",
|
|
14664
14655
|
defaultAnimationLinkColor = "#f0f3f5",
|
|
14665
14656
|
hideLinksOnDrag = false,
|
|
14657
|
+
MapLogo,
|
|
14658
|
+
boundMargin = 0.5,
|
|
14659
|
+
MapLogoClassName,
|
|
14660
|
+
MapLogoStyle,
|
|
14666
14661
|
linkAnimation = true,
|
|
14667
14662
|
onConnClick = () => {
|
|
14668
14663
|
},
|
|
14664
|
+
onConnection,
|
|
14669
14665
|
onNodeClick = () => {
|
|
14670
14666
|
},
|
|
14671
14667
|
getEndpointText,
|
|
@@ -14701,6 +14697,7 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14701
14697
|
className = ""
|
|
14702
14698
|
} = props;
|
|
14703
14699
|
const networkMapRef = useRef();
|
|
14700
|
+
const mapId = useGeneratedId(4, true, false);
|
|
14704
14701
|
const mapApi = useRef({});
|
|
14705
14702
|
useRef();
|
|
14706
14703
|
const [currentCoordinates, setCurrentCoordinates] = useState([]);
|
|
@@ -14716,10 +14713,11 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14716
14713
|
const [hoveredNode, setHoveredNode] = useState({});
|
|
14717
14714
|
const [mapZooming, setMapZooming] = useState(false);
|
|
14718
14715
|
const [startLinkCounterRerender, setStartLinkCounterRerender] = useState(false);
|
|
14719
|
-
const [currentZoomLevel, setCurrentZoomLevel] = useState(
|
|
14716
|
+
const [currentZoomLevel, setCurrentZoomLevel] = useState(initialZoomLevel);
|
|
14720
14717
|
const [mapRotating, setMapRotating] = useState();
|
|
14721
14718
|
const [inViewNodes, setInViewNodes] = useState([]);
|
|
14722
14719
|
const [inViewConnections, setInViewConnections] = useState([]);
|
|
14720
|
+
const [hasInternet, setHasInternet] = useState(true);
|
|
14723
14721
|
useEffect(() => {
|
|
14724
14722
|
if (debug) {
|
|
14725
14723
|
console.log(props);
|
|
@@ -14788,6 +14786,11 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14788
14786
|
nodeSizeScaler
|
|
14789
14787
|
}));
|
|
14790
14788
|
}, [linkAnimation, nodeSizeScaler, maxZoomOutForLinkCount, showLinkCount, mapApi == null ? void 0 : mapApi.current, isolateNonSelectedLinksOnNodeClick, draggingMode, showHoveredLinksOnly, mapStyle == null ? void 0 : mapStyle.name, hideLinks, defaultLinkColorHex, linkHighlightedColorHex, defaultAnimationLinkColor, enableNativeContextMenu, enableLngLatBox, hideLinksOnDrag, maxZoomOutForLinkCount, nodeSizeScaler]);
|
|
14789
|
+
const sourcePortsFontSizePercentage = useMemo(() => {
|
|
14790
|
+
const scale = currentZoomLevel / initialZoomLevel;
|
|
14791
|
+
const fontSize = baseFont * scale - 0.3;
|
|
14792
|
+
return fontSize;
|
|
14793
|
+
}, [currentZoomLevel]);
|
|
14791
14794
|
function _onLinkSelected(obj) {
|
|
14792
14795
|
setSelectedConn(obj);
|
|
14793
14796
|
onConnClick(obj);
|
|
@@ -14933,6 +14936,7 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14933
14936
|
}));
|
|
14934
14937
|
}
|
|
14935
14938
|
useImperativeHandle(ref, () => ({
|
|
14939
|
+
id: mapId,
|
|
14936
14940
|
getCanvas: () => {
|
|
14937
14941
|
var _a, _b;
|
|
14938
14942
|
return (_b = (_a = mapApi.current) == null ? void 0 : _a.getCanvas) == null ? void 0 : _b.call(_a);
|
|
@@ -14948,6 +14952,22 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14948
14952
|
saveOptions,
|
|
14949
14953
|
loadOptions,
|
|
14950
14954
|
FlyToNodeApi,
|
|
14955
|
+
setCurrentZoomLevel,
|
|
14956
|
+
setOptions,
|
|
14957
|
+
setMapDragging,
|
|
14958
|
+
hasInternet,
|
|
14959
|
+
setMapZooming,
|
|
14960
|
+
setMapRotating,
|
|
14961
|
+
setStartLinkCounterRerender,
|
|
14962
|
+
setInViewNodes,
|
|
14963
|
+
setInViewConnections,
|
|
14964
|
+
setHoveredNode,
|
|
14965
|
+
setHoveredConnection,
|
|
14966
|
+
setContextMenuEvent,
|
|
14967
|
+
setNodeContextMenuEvent,
|
|
14968
|
+
setSelectedConn,
|
|
14969
|
+
setSelectedNode,
|
|
14970
|
+
setOnScreenLinksGroup,
|
|
14951
14971
|
...mapApi.current
|
|
14952
14972
|
}));
|
|
14953
14973
|
const _menuItems = useMemo(() => {
|
|
@@ -14983,8 +15003,9 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14983
15003
|
setStartLinkCounterRerender(true);
|
|
14984
15004
|
const bounds = (_a = mapApi.current) == null ? void 0 : _a.getBounds();
|
|
14985
15005
|
console.log("Bounds : ", bounds);
|
|
15006
|
+
const MARGIN = boundMargin;
|
|
14986
15007
|
const filtered = _nodes.filter(
|
|
14987
|
-
(n) => n.location.lng >= bounds.getWest() && n.location.lng <= bounds.getEast() && n.location.lat >= bounds.getSouth() && n.location.lat <= bounds.getNorth()
|
|
15008
|
+
(n) => n.location.lng >= bounds.getWest() - MARGIN && n.location.lng <= bounds.getEast() + MARGIN && n.location.lat >= bounds.getSouth() - MARGIN && n.location.lat <= bounds.getNorth() + MARGIN
|
|
14988
15009
|
);
|
|
14989
15010
|
console.log("In View Nodes : ", filtered);
|
|
14990
15011
|
const cs = [...new Set(filtered.flatMap((node2) => node2 == null ? void 0 : node2.connections))];
|
|
@@ -15012,175 +15033,209 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
15012
15033
|
onLinkMouseOver({ event: e, data: e == null ? void 0 : e.object, type: "connection", id: (_c = e == null ? void 0 : e.object) == null ? void 0 : _c.id, mapApi });
|
|
15013
15034
|
}
|
|
15014
15035
|
};
|
|
15015
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15016
|
-
"w-full h-full relative rounded overflow-hidden",
|
|
15017
|
-
className
|
|
15018
|
-
), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
15036
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15019
15037
|
"div",
|
|
15020
15038
|
{
|
|
15021
|
-
|
|
15022
|
-
|
|
15023
|
-
|
|
15024
|
-
|
|
15025
|
-
|
|
15026
|
-
|
|
15027
|
-
|
|
15028
|
-
|
|
15029
|
-
|
|
15030
|
-
|
|
15031
|
-
|
|
15032
|
-
},
|
|
15033
|
-
className: "network-map-canvas w-full h-full",
|
|
15034
|
-
ref: networkMapRef,
|
|
15035
|
-
children: [
|
|
15036
|
-
enableNativeContextMenu && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
15037
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15038
|
-
ContextMenu,
|
|
15039
|
-
{
|
|
15040
|
-
event: contextMenuEvent,
|
|
15041
|
-
items: {
|
|
15042
|
-
title: _menuTitle,
|
|
15043
|
-
items: _menuItems
|
|
15044
|
-
}
|
|
15045
|
-
}
|
|
15046
|
-
),
|
|
15047
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15048
|
-
ContextMenu,
|
|
15049
|
-
{
|
|
15050
|
-
event: NodeContextMenuEvent,
|
|
15051
|
-
items: {
|
|
15052
|
-
title: _nodeMenuTitle,
|
|
15053
|
-
items: _nodeMenuItems
|
|
15054
|
-
}
|
|
15039
|
+
id: "#" + mapId,
|
|
15040
|
+
className: cn(
|
|
15041
|
+
"w-full h-full relative rounded overflow-hidden abdellatifuimap",
|
|
15042
|
+
className
|
|
15043
|
+
),
|
|
15044
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
15045
|
+
"div",
|
|
15046
|
+
{
|
|
15047
|
+
onContextMenu: (e) => {
|
|
15048
|
+
if (!(selectedConn == null ? void 0 : selectedConn.x)) {
|
|
15049
|
+
return;
|
|
15055
15050
|
}
|
|
15056
|
-
|
|
15057
|
-
|
|
15058
|
-
|
|
15059
|
-
|
|
15060
|
-
|
|
15061
|
-
|
|
15062
|
-
|
|
15063
|
-
|
|
15064
|
-
|
|
15065
|
-
|
|
15066
|
-
|
|
15067
|
-
|
|
15068
|
-
initialViewState: {
|
|
15069
|
-
longitude: 31.233334,
|
|
15070
|
-
latitude: 30.033333,
|
|
15071
|
-
zoom: 9,
|
|
15072
|
-
bearing: 0,
|
|
15073
|
-
minZoom: 3,
|
|
15074
|
-
maxZoom: 10
|
|
15075
|
-
},
|
|
15076
|
-
mapStyle: MapStyleUrl,
|
|
15077
|
-
onZoom: (e) => {
|
|
15078
|
-
var _a;
|
|
15079
|
-
setCurrentZoomLevel((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.getZoom());
|
|
15080
|
-
setMapZooming((prev2) => !prev2);
|
|
15081
|
-
},
|
|
15082
|
-
onRotate: (e) => {
|
|
15083
|
-
var _a;
|
|
15084
|
-
setMapRotating((_a = e == null ? void 0 : e.viewState) == null ? void 0 : _a.bearing);
|
|
15085
|
-
},
|
|
15086
|
-
onDragStart: () => setMapDragging(true),
|
|
15087
|
-
onDragEnd: () => setMapDragging(false),
|
|
15088
|
-
onMoveEnd: handleMoveEnd,
|
|
15089
|
-
...mapProps,
|
|
15090
|
-
children: [
|
|
15051
|
+
setContextMenuEvent(e);
|
|
15052
|
+
onLinkContextMenu({
|
|
15053
|
+
data: selectedConn,
|
|
15054
|
+
event: e,
|
|
15055
|
+
mapApi,
|
|
15056
|
+
type: "connection"
|
|
15057
|
+
});
|
|
15058
|
+
},
|
|
15059
|
+
className: "network-map-canvas w-full h-full",
|
|
15060
|
+
ref: networkMapRef,
|
|
15061
|
+
children: [
|
|
15062
|
+
enableNativeContextMenu && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
15091
15063
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15092
|
-
|
|
15064
|
+
ContextMenu,
|
|
15093
15065
|
{
|
|
15094
|
-
|
|
15095
|
-
|
|
15096
|
-
|
|
15097
|
-
|
|
15098
|
-
|
|
15099
|
-
var _a, _b;
|
|
15100
|
-
(_b = (_a = prev2 == null ? void 0 : prev2.object) == null ? void 0 : _a.nodes) == null ? void 0 : _b.map((item) => {
|
|
15101
|
-
var _a2, _b2;
|
|
15102
|
-
(_b2 = (_a2 = item == null ? void 0 : item.ref) == null ? void 0 : _a2.current) == null ? void 0 : _b2.changeMarkerOutline(false);
|
|
15103
|
-
});
|
|
15104
|
-
return {};
|
|
15105
|
-
});
|
|
15106
|
-
setOnScreenLinksGroup({ connections: [], nodes: [], countBoxes: [] });
|
|
15107
|
-
}
|
|
15108
|
-
},
|
|
15109
|
-
style: { zIndex: 0 }
|
|
15066
|
+
event: contextMenuEvent,
|
|
15067
|
+
items: {
|
|
15068
|
+
title: _menuTitle,
|
|
15069
|
+
items: _menuItems
|
|
15070
|
+
}
|
|
15110
15071
|
}
|
|
15111
15072
|
),
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15115
|
-
PinItem$1,
|
|
15116
|
-
{
|
|
15117
|
-
name: item == null ? void 0 : item.name,
|
|
15118
|
-
item,
|
|
15119
|
-
nodeSizeScaler,
|
|
15120
|
-
longitude: (_a = item == null ? void 0 : item.location) == null ? void 0 : _a.lng,
|
|
15121
|
-
options: options2,
|
|
15122
|
-
CreateMapObjectsScheme,
|
|
15123
|
-
latitude: (_b = item == null ? void 0 : item.location) == null ? void 0 : _b.lat,
|
|
15124
|
-
nodeIconMapper,
|
|
15125
|
-
hoveredConnection,
|
|
15126
|
-
onScreenLinksGroup,
|
|
15127
|
-
selectedNode,
|
|
15128
|
-
onNodeSelected: _onNodeSelected,
|
|
15129
|
-
onNodeMouseOver: _onNodeMouseOver,
|
|
15130
|
-
mapApi,
|
|
15131
|
-
nodes: _nodes,
|
|
15132
|
-
connections: _conns,
|
|
15133
|
-
setNodeContextMenuEvent
|
|
15134
|
-
},
|
|
15135
|
-
"_node_" + (item == null ? void 0 : item.elementId)
|
|
15136
|
-
);
|
|
15137
|
-
}),
|
|
15138
|
-
getOverLinkElement && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15139
|
-
LinkOverContainer,
|
|
15073
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15074
|
+
ContextMenu,
|
|
15140
15075
|
{
|
|
15141
|
-
|
|
15142
|
-
|
|
15143
|
-
|
|
15144
|
-
|
|
15145
|
-
|
|
15076
|
+
event: NodeContextMenuEvent,
|
|
15077
|
+
items: {
|
|
15078
|
+
title: _nodeMenuTitle,
|
|
15079
|
+
items: _nodeMenuItems
|
|
15080
|
+
}
|
|
15146
15081
|
}
|
|
15147
|
-
)
|
|
15148
|
-
|
|
15149
|
-
|
|
15150
|
-
|
|
15151
|
-
|
|
15152
|
-
|
|
15153
|
-
|
|
15154
|
-
|
|
15155
|
-
|
|
15156
|
-
|
|
15157
|
-
|
|
15158
|
-
|
|
15159
|
-
|
|
15160
|
-
|
|
15161
|
-
|
|
15162
|
-
|
|
15163
|
-
|
|
15164
|
-
|
|
15165
|
-
|
|
15166
|
-
|
|
15167
|
-
|
|
15168
|
-
|
|
15169
|
-
|
|
15170
|
-
|
|
15171
|
-
|
|
15172
|
-
|
|
15173
|
-
|
|
15174
|
-
|
|
15175
|
-
|
|
15176
|
-
|
|
15177
|
-
|
|
15178
|
-
|
|
15179
|
-
|
|
15180
|
-
|
|
15181
|
-
|
|
15082
|
+
)
|
|
15083
|
+
] }),
|
|
15084
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
15085
|
+
Map$1,
|
|
15086
|
+
{
|
|
15087
|
+
ref: mapApi,
|
|
15088
|
+
onMoveStart: () => setStartLinkCounterRerender(false),
|
|
15089
|
+
style: {
|
|
15090
|
+
width: "100%",
|
|
15091
|
+
height: "100%",
|
|
15092
|
+
position: "relative"
|
|
15093
|
+
},
|
|
15094
|
+
initialViewState: {
|
|
15095
|
+
longitude: 31.233334,
|
|
15096
|
+
latitude: 30.033333,
|
|
15097
|
+
zoom: initialZoomLevel,
|
|
15098
|
+
bearing: 0,
|
|
15099
|
+
minZoom: 3,
|
|
15100
|
+
maxZoom: 10
|
|
15101
|
+
},
|
|
15102
|
+
mapStyle: MapStyleUrl,
|
|
15103
|
+
onZoom: (e) => {
|
|
15104
|
+
var _a;
|
|
15105
|
+
setCurrentZoomLevel((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.getZoom());
|
|
15106
|
+
setMapZooming((prev2) => !prev2);
|
|
15107
|
+
},
|
|
15108
|
+
onRotate: (e) => {
|
|
15109
|
+
var _a;
|
|
15110
|
+
setMapRotating((_a = e == null ? void 0 : e.viewState) == null ? void 0 : _a.bearing);
|
|
15111
|
+
},
|
|
15112
|
+
onDragStart: () => setMapDragging(true),
|
|
15113
|
+
onDragEnd: () => setMapDragging(false),
|
|
15114
|
+
onMoveEnd: handleMoveEnd,
|
|
15115
|
+
onSourceData: (e) => {
|
|
15116
|
+
if (onConnection) {
|
|
15117
|
+
onConnection({ mapApi: mapApi.current, event: e, hasInternet: true });
|
|
15118
|
+
}
|
|
15119
|
+
},
|
|
15120
|
+
onError: (e) => {
|
|
15121
|
+
var _a;
|
|
15122
|
+
const x = ((_a = e.error) == null ? void 0 : _a.status) == 0;
|
|
15123
|
+
if (onConnection) {
|
|
15124
|
+
onConnection({ mapApi: mapApi.current, event: e, hasInternet: x == 0 ? false : true });
|
|
15125
|
+
}
|
|
15126
|
+
},
|
|
15127
|
+
...mapProps,
|
|
15128
|
+
children: [
|
|
15129
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15130
|
+
DeckGLOverlay,
|
|
15131
|
+
{
|
|
15132
|
+
layers: [...paths],
|
|
15133
|
+
onHover: handleHover,
|
|
15134
|
+
onClick: (e) => {
|
|
15135
|
+
if (!(e == null ? void 0 : e.layer)) {
|
|
15136
|
+
setSelectedConn((prev2) => {
|
|
15137
|
+
var _a, _b;
|
|
15138
|
+
(_b = (_a = prev2 == null ? void 0 : prev2.object) == null ? void 0 : _a.nodes) == null ? void 0 : _b.map((item) => {
|
|
15139
|
+
var _a2, _b2;
|
|
15140
|
+
(_b2 = (_a2 = item == null ? void 0 : item.ref) == null ? void 0 : _a2.current) == null ? void 0 : _b2.changeMarkerOutline(false);
|
|
15141
|
+
});
|
|
15142
|
+
return {};
|
|
15143
|
+
});
|
|
15144
|
+
setOnScreenLinksGroup({ connections: [], nodes: [], countBoxes: [] });
|
|
15145
|
+
}
|
|
15146
|
+
},
|
|
15147
|
+
style: { zIndex: 0 }
|
|
15148
|
+
}
|
|
15149
|
+
),
|
|
15150
|
+
inViewNodes == null ? void 0 : inViewNodes.map((item) => {
|
|
15151
|
+
var _a, _b;
|
|
15152
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15153
|
+
PinItem$1,
|
|
15154
|
+
{
|
|
15155
|
+
name: item == null ? void 0 : item.name,
|
|
15156
|
+
item,
|
|
15157
|
+
nodeSizeScaler,
|
|
15158
|
+
longitude: (_a = item == null ? void 0 : item.location) == null ? void 0 : _a.lng,
|
|
15159
|
+
options: options2,
|
|
15160
|
+
CreateMapObjectsScheme,
|
|
15161
|
+
latitude: (_b = item == null ? void 0 : item.location) == null ? void 0 : _b.lat,
|
|
15162
|
+
nodeIconMapper,
|
|
15163
|
+
hoveredConnection,
|
|
15164
|
+
onScreenLinksGroup,
|
|
15165
|
+
selectedNode,
|
|
15166
|
+
onNodeSelected: _onNodeSelected,
|
|
15167
|
+
onNodeMouseOver: _onNodeMouseOver,
|
|
15168
|
+
mapApi,
|
|
15169
|
+
nodes: _nodes,
|
|
15170
|
+
connections: _conns,
|
|
15171
|
+
setNodeContextMenuEvent
|
|
15172
|
+
},
|
|
15173
|
+
"_node_" + (item == null ? void 0 : item.elementId)
|
|
15174
|
+
);
|
|
15175
|
+
}),
|
|
15176
|
+
getOverLinkElement && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15177
|
+
LinkOverContainer,
|
|
15178
|
+
{
|
|
15179
|
+
conn: hoveredConnection,
|
|
15180
|
+
coordinates: currentCoordinates,
|
|
15181
|
+
mapApi,
|
|
15182
|
+
getOverLinkElement,
|
|
15183
|
+
getOverLinkElementDelay
|
|
15184
|
+
}
|
|
15185
|
+
),
|
|
15186
|
+
showLinkCount && !mapDragging && (inViewConnections == null ? void 0 : inViewConnections.map((con, index) => {
|
|
15187
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15188
|
+
LinkCountCircule$1,
|
|
15189
|
+
{
|
|
15190
|
+
data: con,
|
|
15191
|
+
mapApi,
|
|
15192
|
+
mapDragging,
|
|
15193
|
+
getCenterBox,
|
|
15194
|
+
hoveredConnection
|
|
15195
|
+
},
|
|
15196
|
+
"_lnk_count_circule_" + (con == null ? void 0 : con.u_id)
|
|
15197
|
+
);
|
|
15198
|
+
})),
|
|
15199
|
+
showEndpoints && (inViewConnections == null ? void 0 : inViewConnections.map((con, index) => {
|
|
15200
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15201
|
+
SourcesPorts$1,
|
|
15202
|
+
{
|
|
15203
|
+
fontSize: sourcePortsFontSizePercentage,
|
|
15204
|
+
data: con,
|
|
15205
|
+
mapApi,
|
|
15206
|
+
currentZoomLevel,
|
|
15207
|
+
hoveredConnection,
|
|
15208
|
+
mapDragging,
|
|
15209
|
+
getEndpointText,
|
|
15210
|
+
mapRotating
|
|
15211
|
+
},
|
|
15212
|
+
"_source_port_" + (con == null ? void 0 : con.u_id)
|
|
15213
|
+
);
|
|
15214
|
+
})),
|
|
15215
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15216
|
+
NavigationControl,
|
|
15217
|
+
{}
|
|
15218
|
+
),
|
|
15219
|
+
MapLogo && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15220
|
+
"div",
|
|
15221
|
+
{
|
|
15222
|
+
className: cn(
|
|
15223
|
+
"absolute border bg-white p-2 w-fit h-fit z-50 bottom-2 left-2 cursor-default hover:scale-105 transition-all duration-300 select-none",
|
|
15224
|
+
MapLogoClassName
|
|
15225
|
+
),
|
|
15226
|
+
style: MapLogoStyle || {},
|
|
15227
|
+
children: MapLogo
|
|
15228
|
+
}
|
|
15229
|
+
),
|
|
15230
|
+
enableLngLatBox && /* @__PURE__ */ jsxRuntimeExports.jsx(LngLatBox, { coordinates: currentCoordinates })
|
|
15231
|
+
]
|
|
15232
|
+
}
|
|
15233
|
+
)
|
|
15234
|
+
]
|
|
15235
|
+
}
|
|
15236
|
+
)
|
|
15182
15237
|
}
|
|
15183
|
-
)
|
|
15238
|
+
);
|
|
15184
15239
|
});
|
|
15185
15240
|
const NetworkMap = memo(NetworkMapComponent);
|
|
15186
15241
|
const Accordion = AccordionPrimitive.Root;
|