@abdellatifui/react 3.1.90 → 3.1.92
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 +1 -0
- package/dist/nextgen.js +215 -74
- package/dist/nextgen.js.map +1 -1
- package/dist/style.css +50 -0
- package/dist/types/components/NetworkMap/CustomMarker.d.ts.map +1 -1
- package/dist/types/components/NetworkMap/CustomNavigateButtons.d.ts +4 -0
- package/dist/types/components/NetworkMap/CustomNavigateButtons.d.ts.map +1 -0
- package/dist/types/components/NetworkMap/LinkCountCircule.d.ts.map +1 -1
- package/dist/types/components/NetworkMap/LinkOverContainer.d.ts.map +1 -1
- 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 +1 -0
- package/dist/types/components/NetworkMap/types.d.ts.map +1 -1
- package/dist/types/components/NetworkMap/useCreatePath.d.ts.map +1 -1
- package/dist/types/stories/Map/map.stories.d.ts +4 -0
- package/dist/types/stories/Map/map.stories.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/nextgen.d.ts
CHANGED
package/dist/nextgen.js
CHANGED
|
@@ -14,7 +14,7 @@ import { LayerExtension, _mergeShaders } from "@deck.gl/core";
|
|
|
14
14
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
15
15
|
import { Cross2Icon, MagnifyingGlassIcon, ChevronDownIcon, ArrowLeftIcon, ArrowRightIcon, CheckIcon as CheckIcon$2, InfoCircledIcon, QuestionMarkCircledIcon } from "@radix-ui/react-icons";
|
|
16
16
|
import $ from "jquery";
|
|
17
|
-
import { CheckIcon as CheckIcon$1, Copy, CheckCheck, Info, ChevronUp, ChevronDown, X, Check, ChevronRight, ChevronLeft, EllipsisVertical, Eye, EyeOff, Filter, Search, ArrowUpDown, Rows4, FoldHorizontal, Grid2x2CheckIcon, Download, FilterX, RotateCw, Fullscreen, Brackets, LucideEllipsisVertical, Columns3, AlertTriangle, GripHorizontal, CircleCheckBig, CircleAlert, TriangleAlert, CircleHelp } from "lucide-react";
|
|
17
|
+
import { CheckIcon as CheckIcon$1, MapPin, Copy, CheckCheck, Info, ChevronUp, ChevronDown, X, Check, ChevronRight, ChevronLeft, EllipsisVertical, Eye, EyeOff, Filter, Search, ArrowUpDown, Rows4, FoldHorizontal, Grid2x2CheckIcon, Download, FilterX, RotateCw, Fullscreen, Brackets, LucideEllipsisVertical, Columns3, AlertTriangle, GripHorizontal, CircleCheckBig, CircleAlert, TriangleAlert, CircleHelp } from "lucide-react";
|
|
18
18
|
export * from "lucide-react";
|
|
19
19
|
import copy$1 from "copy-to-clipboard";
|
|
20
20
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
@@ -12722,13 +12722,13 @@ const LazyContainer = (props) => {
|
|
|
12722
12722
|
) });
|
|
12723
12723
|
};
|
|
12724
12724
|
const hex2rgb = (hex) => {
|
|
12725
|
-
let hexValue = hex.startsWith("#") ? hex.slice(1) : hex;
|
|
12726
|
-
if (hexValue.length === 3) {
|
|
12725
|
+
let hexValue = (hex == null ? void 0 : hex.startsWith("#")) ? hex == null ? void 0 : hex.slice(1) : hex;
|
|
12726
|
+
if ((hexValue == null ? void 0 : hexValue.length) === 3) {
|
|
12727
12727
|
hexValue = hexValue.split("").map((char2) => char2 + char2).join("");
|
|
12728
12728
|
}
|
|
12729
|
-
const r2 = parseInt(hexValue.substring(0, 2), 16);
|
|
12730
|
-
const g = parseInt(hexValue.substring(2, 4), 16);
|
|
12731
|
-
const b = parseInt(hexValue.substring(4, 6), 16);
|
|
12729
|
+
const r2 = parseInt(hexValue == null ? void 0 : hexValue.substring(0, 2), 16);
|
|
12730
|
+
const g = parseInt(hexValue == null ? void 0 : hexValue.substring(2, 4), 16);
|
|
12731
|
+
const b = parseInt(hexValue == null ? void 0 : hexValue.substring(4, 6), 16);
|
|
12732
12732
|
return [r2, g, b];
|
|
12733
12733
|
};
|
|
12734
12734
|
const createDefaultNodeTempate = (params) => {
|
|
@@ -14144,11 +14144,19 @@ const useCreatePath = ({ connections = [], mapApi, options: options2, selectedCo
|
|
|
14144
14144
|
const [currentTime, setTime] = useState(0);
|
|
14145
14145
|
const loopLength = 20;
|
|
14146
14146
|
const animationSpeed = 5;
|
|
14147
|
-
const layer0conns = useMemo(
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14147
|
+
const layer0conns = useMemo(
|
|
14148
|
+
() => {
|
|
14149
|
+
var _a;
|
|
14150
|
+
const seen = /* @__PURE__ */ new Set();
|
|
14151
|
+
const f0 = (_a = connections == null ? void 0 : connections.filter((item) => (item == null ? void 0 : item.layer) === 0 && (item == null ? void 0 : item.destination) && (item == null ? void 0 : item.source))) == null ? void 0 : _a.filter((item) => {
|
|
14152
|
+
if (seen.has(item.sourcesId)) return false;
|
|
14153
|
+
seen.add(item.sourcesId);
|
|
14154
|
+
return true;
|
|
14155
|
+
});
|
|
14156
|
+
return f0;
|
|
14157
|
+
},
|
|
14158
|
+
[connections]
|
|
14159
|
+
);
|
|
14152
14160
|
const layer1conns = useMemo(() => {
|
|
14153
14161
|
console.log("layer1conns", connections);
|
|
14154
14162
|
const a = connections == null ? void 0 : connections.filter((item) => (item == null ? void 0 : item.layer) == 1);
|
|
@@ -14204,7 +14212,6 @@ const useCreatePath = ({ connections = [], mapApi, options: options2, selectedCo
|
|
|
14204
14212
|
}
|
|
14205
14213
|
return d.linkColor ? d.linkColor : options2 == null ? void 0 : options2.defaultLinkColorHex;
|
|
14206
14214
|
},
|
|
14207
|
-
// opacity: options?.draggingMode ? 0 : 1 ,
|
|
14208
14215
|
main: true,
|
|
14209
14216
|
capRounded: true,
|
|
14210
14217
|
visible: mapDragging && (options2 == null ? void 0 : options2.hideLinksOnDrag) || (options2 == null ? void 0 : options2.draggingMode) && (options2 == null ? void 0 : options2.hideLinksOnDrag) || (options2 == null ? void 0 : options2.hideLinks) ? false : true,
|
|
@@ -14282,7 +14289,9 @@ const CustomMarker = (props) => {
|
|
|
14282
14289
|
latitude,
|
|
14283
14290
|
children,
|
|
14284
14291
|
offset = [0, 0],
|
|
14285
|
-
markerProps = {}
|
|
14292
|
+
markerProps = {},
|
|
14293
|
+
style: style2 = {},
|
|
14294
|
+
className = {}
|
|
14286
14295
|
} = props;
|
|
14287
14296
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14288
14297
|
Marker,
|
|
@@ -14290,8 +14299,12 @@ const CustomMarker = (props) => {
|
|
|
14290
14299
|
longitude,
|
|
14291
14300
|
latitude,
|
|
14292
14301
|
anchor: "center",
|
|
14302
|
+
className: cn(
|
|
14303
|
+
"group z-30 isolate hover:z-40",
|
|
14304
|
+
className
|
|
14305
|
+
),
|
|
14293
14306
|
style: {
|
|
14294
|
-
|
|
14307
|
+
...style2
|
|
14295
14308
|
},
|
|
14296
14309
|
offset,
|
|
14297
14310
|
children
|
|
@@ -14299,7 +14312,7 @@ const CustomMarker = (props) => {
|
|
|
14299
14312
|
);
|
|
14300
14313
|
};
|
|
14301
14314
|
const CustomMarker$1 = memo(CustomMarker);
|
|
14302
|
-
function ConnectionBadge({ data, getCenterBox, points, mapApi, hoveredConnection }) {
|
|
14315
|
+
function ConnectionBadge({ data, getCenterBox, points, mapApi, hoveredConnection, setSupressLinkHover }) {
|
|
14303
14316
|
const element = useMemo(() => {
|
|
14304
14317
|
if (!data) return null;
|
|
14305
14318
|
const visible = (hoveredConnection == null ? void 0 : hoveredConnection.u_id) == (data == null ? void 0 : data.u_id) ? true : false;
|
|
@@ -14310,6 +14323,8 @@ function ConnectionBadge({ data, getCenterBox, points, mapApi, hoveredConnection
|
|
|
14310
14323
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(StyledTooltip, { title: "Number of connections", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14311
14324
|
"div",
|
|
14312
14325
|
{
|
|
14326
|
+
onMouseEnter: () => setSupressLinkHover(true),
|
|
14327
|
+
onMouseLeave: () => setSupressLinkHover(false),
|
|
14313
14328
|
id: "#" + (data == null ? void 0 : data.connCountBoxId),
|
|
14314
14329
|
style: {
|
|
14315
14330
|
backgroundColor: data == null ? void 0 : data.linkColorHex,
|
|
@@ -14334,7 +14349,9 @@ const LinkCountCircule = (props) => {
|
|
|
14334
14349
|
mapApi,
|
|
14335
14350
|
mapZooming,
|
|
14336
14351
|
getCenterBox,
|
|
14337
|
-
hoveredConnection
|
|
14352
|
+
hoveredConnection,
|
|
14353
|
+
draggingMode: draggingMode2,
|
|
14354
|
+
setSupressLinkHover
|
|
14338
14355
|
} = props;
|
|
14339
14356
|
const [midpoint, setMidpoint] = useState(null);
|
|
14340
14357
|
const [isVisible, setIsVisible] = useState(true);
|
|
@@ -14361,6 +14378,9 @@ const LinkCountCircule = (props) => {
|
|
|
14361
14378
|
{
|
|
14362
14379
|
longitude: midpoint == null ? void 0 : midpoint.lng,
|
|
14363
14380
|
latitude: midpoint == null ? void 0 : midpoint.lat,
|
|
14381
|
+
style: {
|
|
14382
|
+
opacity: draggingMode2 ? 0 : 1
|
|
14383
|
+
},
|
|
14364
14384
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14365
14385
|
ConnectionBadge,
|
|
14366
14386
|
{
|
|
@@ -14368,7 +14388,8 @@ const LinkCountCircule = (props) => {
|
|
|
14368
14388
|
mapApi,
|
|
14369
14389
|
points: midpoint,
|
|
14370
14390
|
getCenterBox,
|
|
14371
|
-
hoveredConnection
|
|
14391
|
+
hoveredConnection,
|
|
14392
|
+
setSupressLinkHover
|
|
14372
14393
|
}
|
|
14373
14394
|
)
|
|
14374
14395
|
}
|
|
@@ -14408,7 +14429,10 @@ const LinkOverContainer = (props) => {
|
|
|
14408
14429
|
onMouseLeave: () => {
|
|
14409
14430
|
setElement(null);
|
|
14410
14431
|
},
|
|
14411
|
-
className:
|
|
14432
|
+
className: cn(
|
|
14433
|
+
"absolute z-30 pointer-events-auto",
|
|
14434
|
+
draggingMode && "hidden"
|
|
14435
|
+
),
|
|
14412
14436
|
style: {
|
|
14413
14437
|
transform: "translate(-50%, -50%)",
|
|
14414
14438
|
left: position2[0],
|
|
@@ -14419,6 +14443,7 @@ const LinkOverContainer = (props) => {
|
|
|
14419
14443
|
);
|
|
14420
14444
|
};
|
|
14421
14445
|
const PortText = (props) => {
|
|
14446
|
+
var _a;
|
|
14422
14447
|
const ref = useRef(null);
|
|
14423
14448
|
const {
|
|
14424
14449
|
text,
|
|
@@ -14426,27 +14451,57 @@ const PortText = (props) => {
|
|
|
14426
14451
|
isVisible,
|
|
14427
14452
|
data,
|
|
14428
14453
|
isFocused,
|
|
14429
|
-
fontSize
|
|
14454
|
+
fontSize,
|
|
14455
|
+
isSource,
|
|
14456
|
+
setSupressLinkHover
|
|
14430
14457
|
} = props;
|
|
14458
|
+
const vsConnectionHander = (data2) => {
|
|
14459
|
+
console.log(data2);
|
|
14460
|
+
};
|
|
14431
14461
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14432
14462
|
"div",
|
|
14433
14463
|
{
|
|
14434
14464
|
ref,
|
|
14465
|
+
onMouseEnter: (e) => {
|
|
14466
|
+
console.log(data);
|
|
14467
|
+
setSupressLinkHover(true);
|
|
14468
|
+
},
|
|
14469
|
+
onMouseLeave: (e) => {
|
|
14470
|
+
setSupressLinkHover(false);
|
|
14471
|
+
},
|
|
14435
14472
|
className: cn(
|
|
14436
|
-
"w-fit h-fit font-geist text-xs
|
|
14437
|
-
isFocused && "!scale-[1.5]"
|
|
14473
|
+
"space-y-[2px] hover:space-y-1 w-fit h-fit hover:bg-black/50 font-geist text-xs rounded text-accent p-1 cursor-default pointer-events-all hover:!scale-[1.5] transition-all duration-300",
|
|
14474
|
+
isFocused && "!scale-[1.5]",
|
|
14475
|
+
!isVisible && "opacity-0"
|
|
14438
14476
|
),
|
|
14439
14477
|
style: {
|
|
14440
14478
|
transform: `rotate(${rotation}deg)`,
|
|
14441
14479
|
transformOrigin: "50% 50%",
|
|
14442
|
-
|
|
14480
|
+
position: "relative",
|
|
14443
14481
|
alignItems: "center",
|
|
14444
14482
|
justifyContent: "center",
|
|
14445
|
-
backgroundColor: data == null ? void 0 : data.linkColorHex,
|
|
14446
|
-
opacity: isVisible ? 1 : 0,
|
|
14447
14483
|
fontSize: fontSize + "rem"
|
|
14448
14484
|
},
|
|
14449
|
-
children:
|
|
14485
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: (_a = data == null ? void 0 : data.linksGroup) == null ? void 0 : _a.map((item) => {
|
|
14486
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
14487
|
+
"div",
|
|
14488
|
+
{
|
|
14489
|
+
className: cn(
|
|
14490
|
+
"flex gap-x-2 px-1 group/2 w-fit rounded-full relative hover:ring-[4px] outline-offset-1 outline-blue-600 transition-all duration-300 ease-in-out"
|
|
14491
|
+
),
|
|
14492
|
+
id: `#sub-${item == null ? void 0 : item.u_id}`,
|
|
14493
|
+
onMouseEnter: () => vsConnectionHander(item),
|
|
14494
|
+
style: {
|
|
14495
|
+
backgroundColor: data == null ? void 0 : data.linkColorHex
|
|
14496
|
+
},
|
|
14497
|
+
children: [
|
|
14498
|
+
(item == null ? void 0 : item.isSource) ? item == null ? void 0 : item.sourcePort : item == null ? void 0 : item.destinationPort,
|
|
14499
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[0px] group-hover/2:text-xs text-black/80 -translate-x-full group-hover/2:translate-x-0 transition-all duration-300 ease-in-out relative flex gap-x-2", children: isSource ? item == null ? void 0 : item.destinationPort : item == null ? void 0 : item.sourcePort })
|
|
14500
|
+
]
|
|
14501
|
+
},
|
|
14502
|
+
"txtport-" + (item == null ? void 0 : item.u_id)
|
|
14503
|
+
);
|
|
14504
|
+
}) })
|
|
14450
14505
|
}
|
|
14451
14506
|
);
|
|
14452
14507
|
};
|
|
@@ -14460,7 +14515,10 @@ const SourcesPorts = (props) => {
|
|
|
14460
14515
|
mapDragging,
|
|
14461
14516
|
getEndpointText,
|
|
14462
14517
|
mapRotating,
|
|
14463
|
-
fontSize
|
|
14518
|
+
fontSize,
|
|
14519
|
+
draggingMode: draggingMode2,
|
|
14520
|
+
supressLinkHover,
|
|
14521
|
+
setSupressLinkHover
|
|
14464
14522
|
} = props;
|
|
14465
14523
|
const [midpoint, setMidpoint] = useState(null);
|
|
14466
14524
|
const [isVisible, setIsVisible] = useState(true);
|
|
@@ -14473,6 +14531,10 @@ const SourcesPorts = (props) => {
|
|
|
14473
14531
|
setIsVisible(false);
|
|
14474
14532
|
return;
|
|
14475
14533
|
} else {
|
|
14534
|
+
if (mapDragging) {
|
|
14535
|
+
setIsVisible(false);
|
|
14536
|
+
return;
|
|
14537
|
+
}
|
|
14476
14538
|
setIsVisible(true);
|
|
14477
14539
|
}
|
|
14478
14540
|
if (currentZoomLevel < 5) {
|
|
@@ -14483,6 +14545,12 @@ const SourcesPorts = (props) => {
|
|
|
14483
14545
|
}
|
|
14484
14546
|
}, [currentZoomLevel, mapDragging]);
|
|
14485
14547
|
useEffect(() => {
|
|
14548
|
+
if (draggingMode2) {
|
|
14549
|
+
setIsVisible(false);
|
|
14550
|
+
return;
|
|
14551
|
+
} else {
|
|
14552
|
+
setIsVisible(true);
|
|
14553
|
+
}
|
|
14486
14554
|
if (!hoveredConnection) {
|
|
14487
14555
|
setIsVisible(true);
|
|
14488
14556
|
setIsFocused(false);
|
|
@@ -14495,7 +14563,7 @@ const SourcesPorts = (props) => {
|
|
|
14495
14563
|
setIsVisible(false);
|
|
14496
14564
|
setIsFocused(false);
|
|
14497
14565
|
}
|
|
14498
|
-
}, [hoveredConnection == null ? void 0 : hoveredConnection.u_id, data == null ? void 0 : data.u_id, currentZoomLevel]);
|
|
14566
|
+
}, [hoveredConnection == null ? void 0 : hoveredConnection.u_id, data == null ? void 0 : data.u_id, currentZoomLevel, draggingMode2]);
|
|
14499
14567
|
const sourceLabel = useMemo(() => {
|
|
14500
14568
|
var _a2, _b2, _c2, _d2, _e, _f;
|
|
14501
14569
|
try {
|
|
@@ -14532,7 +14600,7 @@ const SourcesPorts = (props) => {
|
|
|
14532
14600
|
} catch (e) {
|
|
14533
14601
|
return null;
|
|
14534
14602
|
}
|
|
14535
|
-
}, [mapApi == null ? void 0 : mapApi.current, mapRotating, currentZoomLevel]);
|
|
14603
|
+
}, [mapApi == null ? void 0 : mapApi.current, mapRotating, currentZoomLevel, draggingMode2]);
|
|
14536
14604
|
const destinationLabel = useMemo(() => {
|
|
14537
14605
|
var _a2, _b2, _c2, _d2, _e, _f;
|
|
14538
14606
|
try {
|
|
@@ -14569,7 +14637,7 @@ const SourcesPorts = (props) => {
|
|
|
14569
14637
|
} catch (e) {
|
|
14570
14638
|
return null;
|
|
14571
14639
|
}
|
|
14572
|
-
}, [mapApi == null ? void 0 : mapApi.current, mapRotating, currentZoomLevel]);
|
|
14640
|
+
}, [mapApi == null ? void 0 : mapApi.current, mapRotating, currentZoomLevel, draggingMode2]);
|
|
14573
14641
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
14574
14642
|
sourceLabel && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14575
14643
|
CustomMarker$1,
|
|
@@ -14583,7 +14651,12 @@ const SourcesPorts = (props) => {
|
|
|
14583
14651
|
isVisible,
|
|
14584
14652
|
text: data == null ? void 0 : data.sourcePort,
|
|
14585
14653
|
isFocused,
|
|
14586
|
-
fontSize
|
|
14654
|
+
fontSize,
|
|
14655
|
+
isSource: true,
|
|
14656
|
+
draggingMode: draggingMode2,
|
|
14657
|
+
supressLinkHover,
|
|
14658
|
+
setSupressLinkHover,
|
|
14659
|
+
vsConn: data == null ? void 0 : data.destinationPort
|
|
14587
14660
|
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14588
14661
|
PortText,
|
|
14589
14662
|
{
|
|
@@ -14592,7 +14665,11 @@ const SourcesPorts = (props) => {
|
|
|
14592
14665
|
isVisible,
|
|
14593
14666
|
data,
|
|
14594
14667
|
isFocused,
|
|
14595
|
-
fontSize
|
|
14668
|
+
fontSize,
|
|
14669
|
+
isSource: true,
|
|
14670
|
+
supressLinkHover,
|
|
14671
|
+
setSupressLinkHover,
|
|
14672
|
+
vsConn: data == null ? void 0 : data.destinationPort
|
|
14596
14673
|
}
|
|
14597
14674
|
)
|
|
14598
14675
|
}
|
|
@@ -14609,7 +14686,12 @@ const SourcesPorts = (props) => {
|
|
|
14609
14686
|
isVisible,
|
|
14610
14687
|
text: data == null ? void 0 : data.destinationPort,
|
|
14611
14688
|
isFocused,
|
|
14612
|
-
fontSize
|
|
14689
|
+
fontSize,
|
|
14690
|
+
isSource: false,
|
|
14691
|
+
draggingMode: draggingMode2,
|
|
14692
|
+
supressLinkHover,
|
|
14693
|
+
setSupressLinkHover,
|
|
14694
|
+
vsConn: data == null ? void 0 : data.sourcePort
|
|
14613
14695
|
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14614
14696
|
PortText,
|
|
14615
14697
|
{
|
|
@@ -14619,7 +14701,11 @@ const SourcesPorts = (props) => {
|
|
|
14619
14701
|
data,
|
|
14620
14702
|
getEndpointText,
|
|
14621
14703
|
isFocused,
|
|
14622
|
-
fontSize
|
|
14704
|
+
fontSize,
|
|
14705
|
+
isSource: false,
|
|
14706
|
+
supressLinkHover,
|
|
14707
|
+
setSupressLinkHover,
|
|
14708
|
+
vsConn: data == null ? void 0 : data.sourcePort
|
|
14623
14709
|
}
|
|
14624
14710
|
)
|
|
14625
14711
|
}
|
|
@@ -14627,6 +14713,20 @@ const SourcesPorts = (props) => {
|
|
|
14627
14713
|
] });
|
|
14628
14714
|
};
|
|
14629
14715
|
const SourcesPorts$1 = memo(SourcesPorts);
|
|
14716
|
+
const CustomNavigateButtons = (props) => {
|
|
14717
|
+
const {
|
|
14718
|
+
mapApi,
|
|
14719
|
+
showGoNodeControlButton
|
|
14720
|
+
} = props;
|
|
14721
|
+
const onMapPinClick = () => {
|
|
14722
|
+
var _a, _b, _c, _d;
|
|
14723
|
+
(_d = mapApi == null ? void 0 : mapApi.current) == null ? void 0 : _d.FlyToNodeApi(
|
|
14724
|
+
(_c = (_b = (_a = mapApi == null ? void 0 : mapApi.current) == null ? void 0 : _a.nodes) == null ? void 0 : _b[0]) == null ? void 0 : _c.elementId
|
|
14725
|
+
);
|
|
14726
|
+
};
|
|
14727
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute bottom-10 overflow-hidden right-3 z-50 min-h-[60px] w-[25px] gap-2 bg-white border rounded-full flex flex-wrap items-center justify-center py-1", children: showGoNodeControlButton && /* @__PURE__ */ jsxRuntimeExports.jsx(StyledTooltip, { title: "Go to first node", children: /* @__PURE__ */ jsxRuntimeExports.jsx(MapPin, { onClick: onMapPinClick, className: "text-blue-600 hover:bg-accent rounded-full", size: 18 }) }) });
|
|
14728
|
+
};
|
|
14729
|
+
const CustomNavigateButtons$1 = memo(CustomNavigateButtons);
|
|
14630
14730
|
const baseFont = 0.75;
|
|
14631
14731
|
const mapStyles = [
|
|
14632
14732
|
{ "name": "street1", url: "https://api.maptiler.com/maps/streets/style.json?key=4s1cX8zNpChcrWFsQqbP" },
|
|
@@ -14659,6 +14759,7 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14659
14759
|
MapLogoClassName,
|
|
14660
14760
|
MapLogoStyle,
|
|
14661
14761
|
linkAnimation = true,
|
|
14762
|
+
showGoNodeControlButton = true,
|
|
14662
14763
|
onConnClick = () => {
|
|
14663
14764
|
},
|
|
14664
14765
|
onConnection,
|
|
@@ -14684,7 +14785,7 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14684
14785
|
hideLinks = false,
|
|
14685
14786
|
getCenterBox,
|
|
14686
14787
|
enableLngLatBox = true,
|
|
14687
|
-
draggingMode = false,
|
|
14788
|
+
draggingMode: draggingMode2 = false,
|
|
14688
14789
|
mapProps = {},
|
|
14689
14790
|
menuItems = [],
|
|
14690
14791
|
nodeMenuItems = [],
|
|
@@ -14718,6 +14819,7 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14718
14819
|
const [inViewNodes, setInViewNodes] = useState([]);
|
|
14719
14820
|
const [inViewConnections, setInViewConnections] = useState([]);
|
|
14720
14821
|
const [hasInternet, setHasInternet] = useState(true);
|
|
14822
|
+
const [supressLinkHover, setSupressLinkHover] = useState(false);
|
|
14721
14823
|
useEffect(() => {
|
|
14722
14824
|
if (debug) {
|
|
14723
14825
|
console.log(props);
|
|
@@ -14739,7 +14841,7 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14739
14841
|
hideLinksOnDrag,
|
|
14740
14842
|
hideLinks,
|
|
14741
14843
|
showHoveredLinksOnly,
|
|
14742
|
-
draggingMode,
|
|
14844
|
+
draggingMode: draggingMode2,
|
|
14743
14845
|
isolateNonSelectedLinksOnNodeClick,
|
|
14744
14846
|
staticMapColor,
|
|
14745
14847
|
mapStyle
|
|
@@ -14779,13 +14881,13 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14779
14881
|
showHoveredLinksOnly,
|
|
14780
14882
|
hideLinks,
|
|
14781
14883
|
mapStyle,
|
|
14782
|
-
draggingMode,
|
|
14884
|
+
draggingMode: draggingMode2,
|
|
14783
14885
|
isolateNonSelectedLinksOnNodeClick,
|
|
14784
14886
|
showLinkCount,
|
|
14785
14887
|
maxZoomOutForLinkCount,
|
|
14786
14888
|
nodeSizeScaler
|
|
14787
14889
|
}));
|
|
14788
|
-
}, [linkAnimation, nodeSizeScaler, maxZoomOutForLinkCount, showLinkCount, mapApi == null ? void 0 : mapApi.current, isolateNonSelectedLinksOnNodeClick,
|
|
14890
|
+
}, [linkAnimation, nodeSizeScaler, maxZoomOutForLinkCount, showLinkCount, mapApi == null ? void 0 : mapApi.current, isolateNonSelectedLinksOnNodeClick, draggingMode2, showHoveredLinksOnly, mapStyle == null ? void 0 : mapStyle.name, hideLinks, defaultLinkColorHex, linkHighlightedColorHex, defaultAnimationLinkColor, enableNativeContextMenu, enableLngLatBox, hideLinksOnDrag, maxZoomOutForLinkCount, nodeSizeScaler]);
|
|
14789
14891
|
const sourcePortsFontSizePercentage = useMemo(() => {
|
|
14790
14892
|
const scale = currentZoomLevel / initialZoomLevel;
|
|
14791
14893
|
const fontSize = baseFont * scale - 0.3;
|
|
@@ -14797,21 +14899,13 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14797
14899
|
}
|
|
14798
14900
|
const CreateMapObjectsScheme = useCallback((_nodes2, _connections, updateOnly = false) => {
|
|
14799
14901
|
if (!mapApi.current) return;
|
|
14800
|
-
const processedNodes = _nodes2.map((node2) =>
|
|
14801
|
-
|
|
14802
|
-
|
|
14803
|
-
|
|
14804
|
-
|
|
14805
|
-
|
|
14806
|
-
if (((item == null ? void 0 : item.sourceId) == (conn == null ? void 0 : conn.sourceId) && (item == null ? void 0 : item.destinationId) == (conn == null ? void 0 : conn.destinationId) || (item == null ? void 0 : item.destinationId) == (conn == null ? void 0 : conn.sourceId) && (item == null ? void 0 : item.sourceId) == (conn == null ? void 0 : conn.destinationId)) && (item == null ? void 0 : item.layer) == 0) {
|
|
14807
|
-
return item;
|
|
14808
|
-
}
|
|
14809
|
-
return null;
|
|
14810
|
-
});
|
|
14811
|
-
return s == null ? void 0 : s.filter((item) => item != null);
|
|
14812
|
-
};
|
|
14902
|
+
const processedNodes = _nodes2.map((node2) => {
|
|
14903
|
+
return {
|
|
14904
|
+
...node2,
|
|
14905
|
+
connections: []
|
|
14906
|
+
};
|
|
14907
|
+
});
|
|
14813
14908
|
const processedConnections = updateOnly ? _connections : _connections == null ? void 0 : _connections.map((conn) => {
|
|
14814
|
-
const linksGroup = countHowManyDuplicateConnections(conn);
|
|
14815
14909
|
return {
|
|
14816
14910
|
...conn,
|
|
14817
14911
|
u_id: conn.u_id || useRandomId(),
|
|
@@ -14827,19 +14921,40 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14827
14921
|
data: conn,
|
|
14828
14922
|
connCountBoxId: useRandomId(),
|
|
14829
14923
|
timestamp: [0, 5, 10, 15],
|
|
14830
|
-
|
|
14831
|
-
|
|
14924
|
+
sourcesId: (conn.sourceId + conn.destinationId).toString().split("").sort().join(""),
|
|
14925
|
+
fullSourcesId: (conn.sourceId + (conn == null ? void 0 : conn.sourcePort) + conn.destinationId + (conn == null ? void 0 : conn.destinationPort)).toString().split("").sort().join("")
|
|
14832
14926
|
};
|
|
14833
14927
|
});
|
|
14928
|
+
processedConnections == null ? void 0 : processedConnections.map((con) => {
|
|
14929
|
+
const sourcesId = con == null ? void 0 : con.sourcesId;
|
|
14930
|
+
const s = processedConnections == null ? void 0 : processedConnections.filter((item) => (item == null ? void 0 : item.sourcesId) == sourcesId);
|
|
14931
|
+
con.linkCount = s == null ? void 0 : s.length;
|
|
14932
|
+
con.linksGroup = s;
|
|
14933
|
+
});
|
|
14934
|
+
if (debug) {
|
|
14935
|
+
console.log("Processed Nodes", processedNodes);
|
|
14936
|
+
console.log("Processed Connections", processedConnections);
|
|
14937
|
+
}
|
|
14938
|
+
const seen = /* @__PURE__ */ new Set();
|
|
14939
|
+
const f0 = [];
|
|
14940
|
+
const ignored = [];
|
|
14941
|
+
for (const conn of processedConnections || []) {
|
|
14942
|
+
if (seen.has(conn.sourcesId)) {
|
|
14943
|
+
ignored.push(conn.sourceId);
|
|
14944
|
+
continue;
|
|
14945
|
+
}
|
|
14946
|
+
f0.push(conn);
|
|
14947
|
+
seen.add(conn.sourcesId);
|
|
14948
|
+
}
|
|
14834
14949
|
processedNodes.forEach((node2, nodeIndex) => {
|
|
14835
|
-
|
|
14950
|
+
f0.forEach((conn, connIndex) => {
|
|
14836
14951
|
const key = (node2 == null ? void 0 : node2.elementId) === (conn == null ? void 0 : conn.sourceId) ? "source" : (node2 == null ? void 0 : node2.elementId) === (conn == null ? void 0 : conn.destinationId) ? "destination" : null;
|
|
14837
14952
|
if (key) {
|
|
14838
|
-
|
|
14839
|
-
...
|
|
14953
|
+
f0[connIndex].nodes = [
|
|
14954
|
+
...f0[connIndex].nodes,
|
|
14840
14955
|
node2
|
|
14841
14956
|
];
|
|
14842
|
-
|
|
14957
|
+
f0[connIndex][key] = node2 == null ? void 0 : node2.location;
|
|
14843
14958
|
processedNodes[nodeIndex].connections = [
|
|
14844
14959
|
...processedNodes[nodeIndex].connections,
|
|
14845
14960
|
conn
|
|
@@ -14847,12 +14962,18 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14847
14962
|
}
|
|
14848
14963
|
});
|
|
14849
14964
|
});
|
|
14850
|
-
if (debug) {
|
|
14851
|
-
console.log("Processed Nodes", processedNodes);
|
|
14852
|
-
console.log("Processed Connections", processedConnections);
|
|
14853
|
-
}
|
|
14854
14965
|
setNodes(processedNodes);
|
|
14855
|
-
setConns(
|
|
14966
|
+
setConns(f0);
|
|
14967
|
+
console.log(
|
|
14968
|
+
"seen ",
|
|
14969
|
+
seen.length,
|
|
14970
|
+
"f0 ",
|
|
14971
|
+
f0.length,
|
|
14972
|
+
"ignored ",
|
|
14973
|
+
ignored.length,
|
|
14974
|
+
"all",
|
|
14975
|
+
connections.length
|
|
14976
|
+
);
|
|
14856
14977
|
}, [mapApi]);
|
|
14857
14978
|
useEffect(() => {
|
|
14858
14979
|
if (!mapApi.current) return;
|
|
@@ -14941,6 +15062,7 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14941
15062
|
var _a, _b;
|
|
14942
15063
|
return (_b = (_a = mapApi.current) == null ? void 0 : _a.getCanvas) == null ? void 0 : _b.call(_a);
|
|
14943
15064
|
},
|
|
15065
|
+
props,
|
|
14944
15066
|
createNode,
|
|
14945
15067
|
removeNode,
|
|
14946
15068
|
getNodes,
|
|
@@ -14968,8 +15090,14 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
14968
15090
|
setSelectedConn,
|
|
14969
15091
|
setSelectedNode,
|
|
14970
15092
|
setOnScreenLinksGroup,
|
|
14971
|
-
...mapApi.current
|
|
14972
|
-
|
|
15093
|
+
...mapApi.current,
|
|
15094
|
+
inViewConnections,
|
|
15095
|
+
inViewNodes,
|
|
15096
|
+
connections,
|
|
15097
|
+
nodes,
|
|
15098
|
+
setSupressLinkHover,
|
|
15099
|
+
supressLinkHover
|
|
15100
|
+
}), [debug, showAllLinks, showGoNodeControlButton]);
|
|
14973
15101
|
const _menuItems = useMemo(() => {
|
|
14974
15102
|
return (menuItems == null ? void 0 : menuItems.map((item) => ({
|
|
14975
15103
|
...item,
|
|
@@ -15015,6 +15143,9 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
15015
15143
|
};
|
|
15016
15144
|
const handleHover = (e) => {
|
|
15017
15145
|
var _a, _b, _c;
|
|
15146
|
+
if (supressLinkHover) {
|
|
15147
|
+
return;
|
|
15148
|
+
}
|
|
15018
15149
|
if (!e.layer) {
|
|
15019
15150
|
setHoveredConnection(null);
|
|
15020
15151
|
}
|
|
@@ -15165,10 +15296,11 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
15165
15296
|
selectedNode,
|
|
15166
15297
|
onNodeSelected: _onNodeSelected,
|
|
15167
15298
|
onNodeMouseOver: _onNodeMouseOver,
|
|
15168
|
-
mapApi,
|
|
15299
|
+
mapApi: ref,
|
|
15169
15300
|
nodes: _nodes,
|
|
15170
15301
|
connections: _conns,
|
|
15171
|
-
setNodeContextMenuEvent
|
|
15302
|
+
setNodeContextMenuEvent,
|
|
15303
|
+
setSupressLinkHover
|
|
15172
15304
|
},
|
|
15173
15305
|
"_node_" + (item == null ? void 0 : item.elementId)
|
|
15174
15306
|
);
|
|
@@ -15178,9 +15310,10 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
15178
15310
|
{
|
|
15179
15311
|
conn: hoveredConnection,
|
|
15180
15312
|
coordinates: currentCoordinates,
|
|
15181
|
-
mapApi,
|
|
15313
|
+
mapApi: ref,
|
|
15182
15314
|
getOverLinkElement,
|
|
15183
|
-
getOverLinkElementDelay
|
|
15315
|
+
getOverLinkElementDelay,
|
|
15316
|
+
draggingMode: draggingMode2
|
|
15184
15317
|
}
|
|
15185
15318
|
),
|
|
15186
15319
|
showLinkCount && !mapDragging && (inViewConnections == null ? void 0 : inViewConnections.map((con, index) => {
|
|
@@ -15188,10 +15321,12 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
15188
15321
|
LinkCountCircule$1,
|
|
15189
15322
|
{
|
|
15190
15323
|
data: con,
|
|
15191
|
-
mapApi,
|
|
15324
|
+
mapApi: ref,
|
|
15192
15325
|
mapDragging,
|
|
15193
15326
|
getCenterBox,
|
|
15194
|
-
hoveredConnection
|
|
15327
|
+
hoveredConnection,
|
|
15328
|
+
draggingMode: draggingMode2,
|
|
15329
|
+
setSupressLinkHover
|
|
15195
15330
|
},
|
|
15196
15331
|
"_lnk_count_circule_" + (con == null ? void 0 : con.u_id)
|
|
15197
15332
|
);
|
|
@@ -15202,19 +15337,25 @@ const NetworkMapComponent = forwardRef((props, ref) => {
|
|
|
15202
15337
|
{
|
|
15203
15338
|
fontSize: sourcePortsFontSizePercentage,
|
|
15204
15339
|
data: con,
|
|
15205
|
-
mapApi,
|
|
15340
|
+
mapApi: ref,
|
|
15206
15341
|
currentZoomLevel,
|
|
15207
15342
|
hoveredConnection,
|
|
15208
15343
|
mapDragging,
|
|
15209
15344
|
getEndpointText,
|
|
15210
|
-
mapRotating
|
|
15345
|
+
mapRotating,
|
|
15346
|
+
draggingMode: draggingMode2,
|
|
15347
|
+
setSupressLinkHover
|
|
15211
15348
|
},
|
|
15212
15349
|
"_source_port_" + (con == null ? void 0 : con.u_id)
|
|
15213
15350
|
);
|
|
15214
15351
|
})),
|
|
15352
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(NavigationControl, {}),
|
|
15215
15353
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15216
|
-
|
|
15217
|
-
{
|
|
15354
|
+
CustomNavigateButtons$1,
|
|
15355
|
+
{
|
|
15356
|
+
mapApi: ref,
|
|
15357
|
+
showGoNodeControlButton
|
|
15358
|
+
}
|
|
15218
15359
|
),
|
|
15219
15360
|
MapLogo && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15220
15361
|
"div",
|