@aiready/components 0.13.12 → 0.13.13
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/charts/ForceDirectedGraph.js +19 -22
- package/dist/charts/ForceDirectedGraph.js.map +1 -1
- package/dist/hooks/useForceSimulation.d.ts +1 -0
- package/dist/hooks/useForceSimulation.js +20 -19
- package/dist/hooks/useForceSimulation.js.map +1 -1
- package/dist/index.d.ts +20 -20
- package/dist/index.js +187 -279
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/charts/ForceDirectedGraph.tsx +30 -22
- package/src/components/icons/IconBase.tsx +31 -0
- package/src/components/icons/index.tsx +99 -164
- package/src/hooks/simulation-helpers.ts +31 -0
- package/src/hooks/simulation-types.ts +158 -0
- package/src/hooks/useForceSimulation.ts +20 -175
package/dist/index.js
CHANGED
|
@@ -246,6 +246,14 @@ function Modal({
|
|
|
246
246
|
)
|
|
247
247
|
] }) });
|
|
248
248
|
}
|
|
249
|
+
var STROKE_ICON_PROPS = {
|
|
250
|
+
strokeWidth: 2,
|
|
251
|
+
strokeLinecap: "round",
|
|
252
|
+
strokeLinejoin: "round"
|
|
253
|
+
};
|
|
254
|
+
function createStrokeIcon(_name, children, additionalProps) {
|
|
255
|
+
return /* @__PURE__ */ jsx(IconBase, { ...STROKE_ICON_PROPS, ...additionalProps, children });
|
|
256
|
+
}
|
|
249
257
|
var IconBase = ({
|
|
250
258
|
className = "w-6 h-6",
|
|
251
259
|
children,
|
|
@@ -266,65 +274,45 @@ var IconBase = ({
|
|
|
266
274
|
);
|
|
267
275
|
};
|
|
268
276
|
function AlertCircleIcon(props) {
|
|
269
|
-
return
|
|
270
|
-
|
|
271
|
-
{
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
278
|
-
/* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
279
|
-
/* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
280
|
-
]
|
|
281
|
-
}
|
|
277
|
+
return createStrokeIcon(
|
|
278
|
+
"AlertCircle",
|
|
279
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
280
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
281
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
282
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
283
|
+
] }),
|
|
284
|
+
props
|
|
282
285
|
);
|
|
283
286
|
}
|
|
284
287
|
function AlertTriangleIcon(props) {
|
|
285
|
-
return
|
|
286
|
-
|
|
287
|
-
{
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
/* @__PURE__ */ jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
294
|
-
/* @__PURE__ */ jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
295
|
-
/* @__PURE__ */ jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
296
|
-
]
|
|
297
|
-
}
|
|
288
|
+
return createStrokeIcon(
|
|
289
|
+
"AlertTriangle",
|
|
290
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
291
|
+
/* @__PURE__ */ jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
292
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
293
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
294
|
+
] }),
|
|
295
|
+
props
|
|
298
296
|
);
|
|
299
297
|
}
|
|
300
298
|
function ArrowRightIcon(props) {
|
|
301
|
-
return
|
|
302
|
-
|
|
303
|
-
{
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
children: [
|
|
309
|
-
/* @__PURE__ */ jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
310
|
-
/* @__PURE__ */ jsx("polyline", { points: "12 5 19 12 12 19" })
|
|
311
|
-
]
|
|
312
|
-
}
|
|
299
|
+
return createStrokeIcon(
|
|
300
|
+
"ArrowRight",
|
|
301
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
302
|
+
/* @__PURE__ */ jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
303
|
+
/* @__PURE__ */ jsx("polyline", { points: "12 5 19 12 12 19" })
|
|
304
|
+
] }),
|
|
305
|
+
props
|
|
313
306
|
);
|
|
314
307
|
}
|
|
315
308
|
function BrainIcon(props) {
|
|
316
|
-
return
|
|
317
|
-
|
|
318
|
-
{
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
children: [
|
|
324
|
-
/* @__PURE__ */ jsx("path", { d: "M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.74-3.41A2.5 2.5 0 0 1 2 14c0-1.5 1-2 1-2s-1-.5-1-2a2.5 2.5 0 0 1 2.3-2.48A2.5 2.5 0 0 1 7 5.5a2.5 2.5 0 0 1 2.5-3.5z" }),
|
|
325
|
-
/* @__PURE__ */ jsx("path", { d: "M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.74-3.41A2.5 2.5 0 0 0 22 14c0-1.5-1-2-1-2s1-.5 1-2a2.5 2.5 0 0 0-2.3-2.48A2.5 2.5 0 0 0 17 5.5a2.5 2.5 0 0 0-2.5-3.5z" })
|
|
326
|
-
]
|
|
327
|
-
}
|
|
309
|
+
return createStrokeIcon(
|
|
310
|
+
"Brain",
|
|
311
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
312
|
+
/* @__PURE__ */ jsx("path", { d: "M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.74-3.41A2.5 2.5 0 0 1 2 14c0-1.5 1-2 1-2s-1-.5-1-2a2.5 2.5 0 0 1 2.3-2.48A2.5 2.5 0 0 1 7 5.5a2.5 2.5 0 0 1 2.5-3.5z" }),
|
|
313
|
+
/* @__PURE__ */ jsx("path", { d: "M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.74-3.41A2.5 2.5 0 0 0 22 14c0-1.5-1-2-1-2s1-.5 1-2a2.5 2.5 0 0 0-2.3-2.48A2.5 2.5 0 0 0 17 5.5a2.5 2.5 0 0 0-2.5-3.5z" })
|
|
314
|
+
] }),
|
|
315
|
+
props
|
|
328
316
|
);
|
|
329
317
|
}
|
|
330
318
|
function ChartIcon(props) {
|
|
@@ -336,93 +324,63 @@ function ChartIcon(props) {
|
|
|
336
324
|
] });
|
|
337
325
|
}
|
|
338
326
|
function ClockIcon(props) {
|
|
339
|
-
return
|
|
340
|
-
|
|
341
|
-
{
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
children: [
|
|
347
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
348
|
-
/* @__PURE__ */ jsx("polyline", { points: "12 6 12 12 16 14" })
|
|
349
|
-
]
|
|
350
|
-
}
|
|
327
|
+
return createStrokeIcon(
|
|
328
|
+
"Clock",
|
|
329
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
330
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
331
|
+
/* @__PURE__ */ jsx("polyline", { points: "12 6 12 12 16 14" })
|
|
332
|
+
] }),
|
|
333
|
+
props
|
|
351
334
|
);
|
|
352
335
|
}
|
|
353
336
|
function FileIcon(props) {
|
|
354
|
-
return
|
|
355
|
-
|
|
356
|
-
{
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
children: [
|
|
362
|
-
/* @__PURE__ */ jsx("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
|
|
363
|
-
/* @__PURE__ */ jsx("polyline", { points: "14 2 14 8 20 8" })
|
|
364
|
-
]
|
|
365
|
-
}
|
|
337
|
+
return createStrokeIcon(
|
|
338
|
+
"File",
|
|
339
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
340
|
+
/* @__PURE__ */ jsx("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
|
|
341
|
+
/* @__PURE__ */ jsx("polyline", { points: "14 2 14 8 20 8" })
|
|
342
|
+
] }),
|
|
343
|
+
props
|
|
366
344
|
);
|
|
367
345
|
}
|
|
368
346
|
function HammerIcon(props) {
|
|
369
|
-
return
|
|
370
|
-
|
|
371
|
-
{
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
children: [
|
|
377
|
-
/* @__PURE__ */ jsx("path", { d: "M18.42 13.59L7.46 2.63a1 1 0 0 0-1.42 0l-4.7 4.7a1 1 0 0 0 0 1.42L11 18.23l1.07-1.07-1.41-1.41 1.42-1.42 1.41 1.41 1.41-1.41-1.41-1.41 1.42-1.42 1.41 1.41 2-2z" }),
|
|
378
|
-
/* @__PURE__ */ jsx("path", { d: "M13 18l6 6" })
|
|
379
|
-
]
|
|
380
|
-
}
|
|
347
|
+
return createStrokeIcon(
|
|
348
|
+
"Hammer",
|
|
349
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
350
|
+
/* @__PURE__ */ jsx("path", { d: "M18.42 13.59L7.46 2.63a1 1 0 0 0-1.42 0l-4.7 4.7a1 1 0 0 0 0 1.42L11 18.23l1.07-1.07-1.41-1.41 1.42-1.42 1.41 1.41 1.41-1.41-1.41-1.41 1.42-1.42 1.41 1.41 2-2z" }),
|
|
351
|
+
/* @__PURE__ */ jsx("path", { d: "M13 18l6 6" })
|
|
352
|
+
] }),
|
|
353
|
+
props
|
|
381
354
|
);
|
|
382
355
|
}
|
|
383
356
|
function InfoIcon(props) {
|
|
384
|
-
return
|
|
385
|
-
|
|
386
|
-
{
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
393
|
-
/* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
394
|
-
/* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
395
|
-
]
|
|
396
|
-
}
|
|
357
|
+
return createStrokeIcon(
|
|
358
|
+
"Info",
|
|
359
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
360
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
361
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
362
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
363
|
+
] }),
|
|
364
|
+
props
|
|
397
365
|
);
|
|
398
366
|
}
|
|
399
367
|
function PlayIcon(props) {
|
|
400
|
-
return
|
|
401
|
-
|
|
402
|
-
{
|
|
403
|
-
|
|
404
|
-
strokeLinecap: "round",
|
|
405
|
-
strokeLinejoin: "round",
|
|
406
|
-
...props,
|
|
407
|
-
children: /* @__PURE__ */ jsx("polygon", { points: "5 3 19 12 5 21 5 3" })
|
|
408
|
-
}
|
|
368
|
+
return createStrokeIcon(
|
|
369
|
+
"Play",
|
|
370
|
+
/* @__PURE__ */ jsx("polygon", { points: "5 3 19 12 5 21 5 3" }),
|
|
371
|
+
props
|
|
409
372
|
);
|
|
410
373
|
}
|
|
411
374
|
function RefreshCwIcon(props) {
|
|
412
|
-
return
|
|
413
|
-
|
|
414
|
-
{
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
/* @__PURE__ */ jsx("path", { d: "M21 3v5h-5" }),
|
|
422
|
-
/* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
|
|
423
|
-
/* @__PURE__ */ jsx("path", { d: "M3 21v-5h5" })
|
|
424
|
-
]
|
|
425
|
-
}
|
|
375
|
+
return createStrokeIcon(
|
|
376
|
+
"RefreshCw",
|
|
377
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
378
|
+
/* @__PURE__ */ jsx("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
379
|
+
/* @__PURE__ */ jsx("path", { d: "M21 3v5h-5" }),
|
|
380
|
+
/* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
|
|
381
|
+
/* @__PURE__ */ jsx("path", { d: "M3 21v-5h5" })
|
|
382
|
+
] }),
|
|
383
|
+
props
|
|
426
384
|
);
|
|
427
385
|
}
|
|
428
386
|
function RobotIcon(props) {
|
|
@@ -455,61 +413,41 @@ function RocketIcon(props) {
|
|
|
455
413
|
] });
|
|
456
414
|
}
|
|
457
415
|
function SaveIcon(props) {
|
|
458
|
-
return
|
|
459
|
-
|
|
460
|
-
{
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
/* @__PURE__ */ jsx("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }),
|
|
467
|
-
/* @__PURE__ */ jsx("polyline", { points: "17 21 17 13 7 13 7 21" }),
|
|
468
|
-
/* @__PURE__ */ jsx("polyline", { points: "7 3 7 8 15 8" })
|
|
469
|
-
]
|
|
470
|
-
}
|
|
416
|
+
return createStrokeIcon(
|
|
417
|
+
"Save",
|
|
418
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
419
|
+
/* @__PURE__ */ jsx("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }),
|
|
420
|
+
/* @__PURE__ */ jsx("polyline", { points: "17 21 17 13 7 13 7 21" }),
|
|
421
|
+
/* @__PURE__ */ jsx("polyline", { points: "7 3 7 8 15 8" })
|
|
422
|
+
] }),
|
|
423
|
+
props
|
|
471
424
|
);
|
|
472
425
|
}
|
|
473
426
|
function SettingsIcon(props) {
|
|
474
|
-
return
|
|
475
|
-
|
|
476
|
-
{
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
children: [
|
|
482
|
-
/* @__PURE__ */ jsx("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.1a2 2 0 0 1-1-1.72v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
|
|
483
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" })
|
|
484
|
-
]
|
|
485
|
-
}
|
|
427
|
+
return createStrokeIcon(
|
|
428
|
+
"Settings",
|
|
429
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
430
|
+
/* @__PURE__ */ jsx("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.1a2 2 0 0 1-1-1.72v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
|
|
431
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" })
|
|
432
|
+
] }),
|
|
433
|
+
props
|
|
486
434
|
);
|
|
487
435
|
}
|
|
488
436
|
function ShieldCheckIcon(props) {
|
|
489
|
-
return
|
|
490
|
-
|
|
491
|
-
{
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
children: [
|
|
497
|
-
/* @__PURE__ */ jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }),
|
|
498
|
-
/* @__PURE__ */ jsx("path", { d: "M9 12l2 2 4-4" })
|
|
499
|
-
]
|
|
500
|
-
}
|
|
437
|
+
return createStrokeIcon(
|
|
438
|
+
"ShieldCheck",
|
|
439
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
440
|
+
/* @__PURE__ */ jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }),
|
|
441
|
+
/* @__PURE__ */ jsx("path", { d: "M9 12l2 2 4-4" })
|
|
442
|
+
] }),
|
|
443
|
+
props
|
|
501
444
|
);
|
|
502
445
|
}
|
|
503
446
|
function ShieldIcon(props) {
|
|
504
|
-
return
|
|
505
|
-
|
|
506
|
-
{
|
|
507
|
-
|
|
508
|
-
strokeLinecap: "round",
|
|
509
|
-
strokeLinejoin: "round",
|
|
510
|
-
...props,
|
|
511
|
-
children: /* @__PURE__ */ jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" })
|
|
512
|
-
}
|
|
447
|
+
return createStrokeIcon(
|
|
448
|
+
"Shield",
|
|
449
|
+
/* @__PURE__ */ jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }),
|
|
450
|
+
props
|
|
513
451
|
);
|
|
514
452
|
}
|
|
515
453
|
function TargetIcon(props) {
|
|
@@ -527,92 +465,62 @@ function TargetIcon(props) {
|
|
|
527
465
|
] });
|
|
528
466
|
}
|
|
529
467
|
function TerminalIcon(props) {
|
|
530
|
-
return
|
|
531
|
-
|
|
532
|
-
{
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
children: [
|
|
538
|
-
/* @__PURE__ */ jsx("polyline", { points: "4 17 10 11 4 5" }),
|
|
539
|
-
/* @__PURE__ */ jsx("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
540
|
-
]
|
|
541
|
-
}
|
|
468
|
+
return createStrokeIcon(
|
|
469
|
+
"Terminal",
|
|
470
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
471
|
+
/* @__PURE__ */ jsx("polyline", { points: "4 17 10 11 4 5" }),
|
|
472
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
473
|
+
] }),
|
|
474
|
+
props
|
|
542
475
|
);
|
|
543
476
|
}
|
|
544
477
|
function TrashIcon(props) {
|
|
545
|
-
return
|
|
546
|
-
|
|
547
|
-
{
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
children: [
|
|
553
|
-
/* @__PURE__ */ jsx("polyline", { points: "3 6 5 6 21 6" }),
|
|
554
|
-
/* @__PURE__ */ jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
555
|
-
]
|
|
556
|
-
}
|
|
478
|
+
return createStrokeIcon(
|
|
479
|
+
"Trash",
|
|
480
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
481
|
+
/* @__PURE__ */ jsx("polyline", { points: "3 6 5 6 21 6" }),
|
|
482
|
+
/* @__PURE__ */ jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
483
|
+
] }),
|
|
484
|
+
props
|
|
557
485
|
);
|
|
558
486
|
}
|
|
559
487
|
function TrendingUpIcon(props) {
|
|
560
|
-
return
|
|
561
|
-
|
|
562
|
-
{
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
children: [
|
|
568
|
-
/* @__PURE__ */ jsx("polyline", { points: "23 6 13.5 15.5 8.5 10.5 1 18" }),
|
|
569
|
-
/* @__PURE__ */ jsx("polyline", { points: "17 6 23 6 23 12" })
|
|
570
|
-
]
|
|
571
|
-
}
|
|
488
|
+
return createStrokeIcon(
|
|
489
|
+
"TrendingUp",
|
|
490
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
491
|
+
/* @__PURE__ */ jsx("polyline", { points: "23 6 13.5 15.5 8.5 10.5 1 18" }),
|
|
492
|
+
/* @__PURE__ */ jsx("polyline", { points: "17 6 23 6 23 12" })
|
|
493
|
+
] }),
|
|
494
|
+
props
|
|
572
495
|
);
|
|
573
496
|
}
|
|
574
497
|
function UploadIcon(props) {
|
|
575
|
-
return
|
|
576
|
-
|
|
577
|
-
{
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
/* @__PURE__ */ jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v4" }),
|
|
584
|
-
/* @__PURE__ */ jsx("polyline", { points: "17 8 12 3 7 8" }),
|
|
585
|
-
/* @__PURE__ */ jsx("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
|
|
586
|
-
]
|
|
587
|
-
}
|
|
498
|
+
return createStrokeIcon(
|
|
499
|
+
"Upload",
|
|
500
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
501
|
+
/* @__PURE__ */ jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v4" }),
|
|
502
|
+
/* @__PURE__ */ jsx("polyline", { points: "17 8 12 3 7 8" }),
|
|
503
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
|
|
504
|
+
] }),
|
|
505
|
+
props
|
|
588
506
|
);
|
|
589
507
|
}
|
|
590
508
|
function WalletIcon(props) {
|
|
591
|
-
return
|
|
592
|
-
|
|
593
|
-
{
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
/* @__PURE__ */ jsx("path", { d: "M21 12V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-1" }),
|
|
600
|
-
/* @__PURE__ */ jsx("path", { d: "M16 12h5" }),
|
|
601
|
-
/* @__PURE__ */ jsx("circle", { cx: "16", cy: "12", r: "1" })
|
|
602
|
-
]
|
|
603
|
-
}
|
|
509
|
+
return createStrokeIcon(
|
|
510
|
+
"Wallet",
|
|
511
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
512
|
+
/* @__PURE__ */ jsx("path", { d: "M21 12V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-1" }),
|
|
513
|
+
/* @__PURE__ */ jsx("path", { d: "M16 12h5" }),
|
|
514
|
+
/* @__PURE__ */ jsx("circle", { cx: "16", cy: "12", r: "1" })
|
|
515
|
+
] }),
|
|
516
|
+
props
|
|
604
517
|
);
|
|
605
518
|
}
|
|
606
519
|
function ZapIcon(props) {
|
|
607
|
-
return
|
|
608
|
-
|
|
609
|
-
{
|
|
610
|
-
|
|
611
|
-
strokeLinecap: "round",
|
|
612
|
-
strokeLinejoin: "round",
|
|
613
|
-
...props,
|
|
614
|
-
children: /* @__PURE__ */ jsx("polygon", { points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2" })
|
|
615
|
-
}
|
|
520
|
+
return createStrokeIcon(
|
|
521
|
+
"Zap",
|
|
522
|
+
/* @__PURE__ */ jsx("polygon", { points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2" }),
|
|
523
|
+
props
|
|
616
524
|
);
|
|
617
525
|
}
|
|
618
526
|
var Container = React2.forwardRef(
|
|
@@ -2111,6 +2019,24 @@ function useD3WithResize(renderFn, dependencies = []) {
|
|
|
2111
2019
|
}, dependencies);
|
|
2112
2020
|
return ref;
|
|
2113
2021
|
}
|
|
2022
|
+
|
|
2023
|
+
// src/hooks/simulation-helpers.ts
|
|
2024
|
+
function stabilizeNodes(nodes) {
|
|
2025
|
+
nodes.forEach((n) => {
|
|
2026
|
+
n.vx = 0;
|
|
2027
|
+
n.vy = 0;
|
|
2028
|
+
if (typeof n.x === "number") n.x = Number(n.x.toFixed(3));
|
|
2029
|
+
if (typeof n.y === "number") n.y = Number(n.y.toFixed(3));
|
|
2030
|
+
});
|
|
2031
|
+
}
|
|
2032
|
+
function seedRandomPositions(nodes, width, height) {
|
|
2033
|
+
nodes.forEach((n) => {
|
|
2034
|
+
n.x = Math.random() * width;
|
|
2035
|
+
n.y = Math.random() * height;
|
|
2036
|
+
n.vx = (Math.random() - 0.5) * 10;
|
|
2037
|
+
n.vy = (Math.random() - 0.5) * 10;
|
|
2038
|
+
});
|
|
2039
|
+
}
|
|
2114
2040
|
function useForceSimulation(initialNodes, initialLinks, options) {
|
|
2115
2041
|
const {
|
|
2116
2042
|
chargeStrength = -300,
|
|
@@ -2158,12 +2084,7 @@ function useForceSimulation(initialNodes, initialLinks, options) {
|
|
|
2158
2084
|
n.vy = (Math.random() - 0.5) * 2;
|
|
2159
2085
|
});
|
|
2160
2086
|
} catch (e) {
|
|
2161
|
-
nodesCopy
|
|
2162
|
-
n.x = Math.random() * width;
|
|
2163
|
-
n.y = Math.random() * height;
|
|
2164
|
-
n.vx = (Math.random() - 0.5) * 10;
|
|
2165
|
-
n.vy = (Math.random() - 0.5) * 10;
|
|
2166
|
-
});
|
|
2087
|
+
seedRandomPositions(nodesCopy, width, height);
|
|
2167
2088
|
}
|
|
2168
2089
|
const simulation = d34.forceSimulation(
|
|
2169
2090
|
nodesCopy
|
|
@@ -2231,12 +2152,7 @@ function useForceSimulation(initialNodes, initialLinks, options) {
|
|
|
2231
2152
|
stopTimeoutRef.current = globalThis.setTimeout(() => {
|
|
2232
2153
|
try {
|
|
2233
2154
|
if (stabilizeOnStop) {
|
|
2234
|
-
nodesCopy
|
|
2235
|
-
n.vx = 0;
|
|
2236
|
-
n.vy = 0;
|
|
2237
|
-
if (typeof n.x === "number") n.x = Number(n.x.toFixed(3));
|
|
2238
|
-
if (typeof n.y === "number") n.y = Number(n.y.toFixed(3));
|
|
2239
|
-
});
|
|
2155
|
+
stabilizeNodes(nodesCopy);
|
|
2240
2156
|
}
|
|
2241
2157
|
simulation.alpha(0);
|
|
2242
2158
|
simulation.stop();
|
|
@@ -2259,12 +2175,7 @@ function useForceSimulation(initialNodes, initialLinks, options) {
|
|
|
2259
2175
|
if (simulation.alpha() <= alphaMin) {
|
|
2260
2176
|
try {
|
|
2261
2177
|
if (stabilizeOnStop) {
|
|
2262
|
-
nodesCopy
|
|
2263
|
-
n.vx = 0;
|
|
2264
|
-
n.vy = 0;
|
|
2265
|
-
if (typeof n.x === "number") n.x = Number(n.x.toFixed(3));
|
|
2266
|
-
if (typeof n.y === "number") n.y = Number(n.y.toFixed(3));
|
|
2267
|
-
});
|
|
2178
|
+
stabilizeNodes(nodesCopy);
|
|
2268
2179
|
}
|
|
2269
2180
|
simulation.stop();
|
|
2270
2181
|
} catch (e) {
|
|
@@ -2702,6 +2613,17 @@ function useWindowDrag(enableDrag, svgRef, transformRef, dragActiveRef, dragNode
|
|
|
2702
2613
|
};
|
|
2703
2614
|
}, [enableDrag, svgRef, transformRef, dragActiveRef, dragNodeRef, onDragEnd]);
|
|
2704
2615
|
}
|
|
2616
|
+
function pinNode(node) {
|
|
2617
|
+
node.fx = node.x;
|
|
2618
|
+
node.fy = node.y;
|
|
2619
|
+
}
|
|
2620
|
+
function unpinNode(node) {
|
|
2621
|
+
node.fx = null;
|
|
2622
|
+
node.fy = null;
|
|
2623
|
+
}
|
|
2624
|
+
function unpinAllNodes(nodes) {
|
|
2625
|
+
nodes.forEach(unpinNode);
|
|
2626
|
+
}
|
|
2705
2627
|
var ForceDirectedGraph = forwardRef(
|
|
2706
2628
|
({
|
|
2707
2629
|
nodes: initialNodes,
|
|
@@ -2784,26 +2706,19 @@ var ForceDirectedGraph = forwardRef(
|
|
|
2784
2706
|
pinAll: () => {
|
|
2785
2707
|
const newPinned = /* @__PURE__ */ new Set();
|
|
2786
2708
|
nodes.forEach((node) => {
|
|
2787
|
-
node
|
|
2788
|
-
node.fy = node.y;
|
|
2709
|
+
pinNode(node);
|
|
2789
2710
|
newPinned.add(node.id);
|
|
2790
2711
|
});
|
|
2791
2712
|
setPinnedNodes(newPinned);
|
|
2792
2713
|
restart();
|
|
2793
2714
|
},
|
|
2794
2715
|
unpinAll: () => {
|
|
2795
|
-
nodes
|
|
2796
|
-
node.fx = null;
|
|
2797
|
-
node.fy = null;
|
|
2798
|
-
});
|
|
2716
|
+
unpinAllNodes(nodes);
|
|
2799
2717
|
setPinnedNodes(/* @__PURE__ */ new Set());
|
|
2800
2718
|
restart();
|
|
2801
2719
|
},
|
|
2802
2720
|
resetLayout: () => {
|
|
2803
|
-
nodes
|
|
2804
|
-
node.fx = null;
|
|
2805
|
-
node.fy = null;
|
|
2806
|
-
});
|
|
2721
|
+
unpinAllNodes(nodes);
|
|
2807
2722
|
setPinnedNodes(/* @__PURE__ */ new Set());
|
|
2808
2723
|
restart();
|
|
2809
2724
|
},
|
|
@@ -2895,8 +2810,7 @@ var ForceDirectedGraph = forwardRef(
|
|
|
2895
2810
|
event.stopPropagation();
|
|
2896
2811
|
dragActiveRef.current = true;
|
|
2897
2812
|
dragNodeRef.current = node;
|
|
2898
|
-
node
|
|
2899
|
-
node.fy = node.y;
|
|
2813
|
+
pinNode(node);
|
|
2900
2814
|
setPinnedNodes((prev) => /* @__PURE__ */ new Set([...prev, node.id]));
|
|
2901
2815
|
stop();
|
|
2902
2816
|
},
|
|
@@ -2915,8 +2829,7 @@ var ForceDirectedGraph = forwardRef(
|
|
|
2915
2829
|
if (!event.active) restart();
|
|
2916
2830
|
dragActiveRef.current = true;
|
|
2917
2831
|
dragNodeRef.current = node;
|
|
2918
|
-
node
|
|
2919
|
-
node.fy = node.y;
|
|
2832
|
+
pinNode(node);
|
|
2920
2833
|
setPinnedNodes((prev) => /* @__PURE__ */ new Set([...prev, node.id]));
|
|
2921
2834
|
}).on("drag", (event) => {
|
|
2922
2835
|
if (!dragActiveRef.current || !dragNodeRef.current) return;
|
|
@@ -2947,12 +2860,10 @@ var ForceDirectedGraph = forwardRef(
|
|
|
2947
2860
|
event.stopPropagation();
|
|
2948
2861
|
if (!enableDrag) return;
|
|
2949
2862
|
if (node.fx === null || node.fx === void 0) {
|
|
2950
|
-
node
|
|
2951
|
-
node.fy = node.y;
|
|
2863
|
+
pinNode(node);
|
|
2952
2864
|
setPinnedNodes((prev) => /* @__PURE__ */ new Set([...prev, node.id]));
|
|
2953
2865
|
} else {
|
|
2954
|
-
node
|
|
2955
|
-
node.fy = null;
|
|
2866
|
+
unpinNode(node);
|
|
2956
2867
|
setPinnedNodes((prev) => {
|
|
2957
2868
|
const next = new Set(prev);
|
|
2958
2869
|
next.delete(node.id);
|
|
@@ -2971,10 +2882,7 @@ var ForceDirectedGraph = forwardRef(
|
|
|
2971
2882
|
height,
|
|
2972
2883
|
className: cn("bg-white dark:bg-gray-900", className),
|
|
2973
2884
|
onDoubleClick: () => {
|
|
2974
|
-
nodes
|
|
2975
|
-
n.fx = null;
|
|
2976
|
-
n.fy = null;
|
|
2977
|
-
});
|
|
2885
|
+
unpinAllNodes(nodes);
|
|
2978
2886
|
setPinnedNodes(/* @__PURE__ */ new Set());
|
|
2979
2887
|
restart();
|
|
2980
2888
|
},
|