@almadar/ui 5.112.0 → 5.114.0

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.
@@ -12,6 +12,7 @@ import { useTranslate } from '@almadar/ui/hooks';
12
12
  import { useUISlots, useTheme } from '@almadar/ui/context';
13
13
  import { evaluate, createMinimalContext } from '@almadar/evaluator';
14
14
  import { createPortal } from 'react-dom';
15
+ import { wrapCallbackForEvent } from '@almadar/runtime/ui';
15
16
  import { Link, Outlet, useLocation } from 'react-router-dom';
16
17
  import ELK from 'elkjs/lib/elk.bundled.js';
17
18
  import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light.js';
@@ -1224,41 +1225,6 @@ function kebabToPascal(name) {
1224
1225
  return part.charAt(0).toUpperCase() + part.slice(1);
1225
1226
  }).join("");
1226
1227
  }
1227
- function loadLib(key, importer) {
1228
- let p = libPromises.get(key);
1229
- if (!p) {
1230
- p = importer();
1231
- libPromises.set(key, p);
1232
- }
1233
- return p;
1234
- }
1235
- function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
1236
- const Lazy = React73__default.lazy(async () => {
1237
- const lib = await loadLib(libKey, importer);
1238
- const Comp = pick(lib);
1239
- if (!Comp) {
1240
- warnFallback(fallbackName, family);
1241
- return { default: makeLucideAdapter(fallbackName, true) };
1242
- }
1243
- return { default: Comp };
1244
- });
1245
- const Wrapped = (props) => /* @__PURE__ */ jsx(
1246
- React73__default.Suspense,
1247
- {
1248
- fallback: /* @__PURE__ */ jsx(
1249
- "span",
1250
- {
1251
- "aria-hidden": true,
1252
- className: props.className,
1253
- style: { display: "inline-block", ...props.style }
1254
- }
1255
- ),
1256
- children: /* @__PURE__ */ jsx(Lazy, { ...props })
1257
- }
1258
- );
1259
- Wrapped.displayName = `Lazy.${libKey}.${fallbackName}`;
1260
- return Wrapped;
1261
- }
1262
1228
  function isComponentLike(v) {
1263
1229
  return v != null && (typeof v === "function" || typeof v === "object");
1264
1230
  }
@@ -1272,146 +1238,32 @@ function resolveLucide(name) {
1272
1238
  if (isComponentLike(asIs)) return asIs;
1273
1239
  return LucideIcons2.HelpCircle;
1274
1240
  }
1275
- function resolvePhosphor(name, weight, family) {
1276
- const target = phosphorAliases[name] ?? kebabToPascal(name);
1277
- return lazyFamilyIcon(
1278
- "phosphor",
1279
- () => import('@phosphor-icons/react'),
1280
- (lib) => {
1281
- const PhosphorComp = lib[target];
1282
- if (!PhosphorComp) return null;
1283
- const Component = PhosphorComp;
1284
- const Adapter = (props) => /* @__PURE__ */ jsx(
1285
- Component,
1286
- {
1287
- weight,
1288
- className: props.className,
1289
- style: props.style,
1290
- size: props.size ?? "1em"
1291
- }
1292
- );
1293
- Adapter.displayName = `Phosphor.${target}.${weight}`;
1294
- return Adapter;
1295
- },
1296
- name,
1297
- family
1298
- );
1299
- }
1300
- function resolveTabler(name, family) {
1301
- const suffix = tablerAliases[name] ?? kebabToPascal(name);
1302
- const target = `Icon${suffix}`;
1303
- return lazyFamilyIcon(
1304
- "tabler",
1305
- () => import('@tabler/icons-react'),
1306
- (lib) => {
1307
- const TablerComp = lib[target];
1308
- if (!TablerComp) return null;
1309
- const Component = TablerComp;
1310
- const Adapter = (props) => /* @__PURE__ */ jsx(
1311
- Component,
1312
- {
1313
- stroke: props.strokeWidth ?? 1.5,
1314
- className: props.className,
1315
- style: props.style,
1316
- size: props.size ?? 24
1317
- }
1318
- );
1319
- Adapter.displayName = `Tabler.${target}`;
1320
- return Adapter;
1321
- },
1322
- name,
1323
- family
1324
- );
1325
- }
1326
- function resolveFa(name, family) {
1327
- const suffix = faAliases[name] ?? kebabToPascal(name);
1328
- const target = `Fa${suffix}`;
1329
- return lazyFamilyIcon(
1330
- "fa",
1331
- () => import('react-icons/fa'),
1332
- (lib) => {
1333
- const FaComp = lib[target];
1334
- if (!FaComp) return null;
1335
- const Component = FaComp;
1336
- const Adapter = (props) => /* @__PURE__ */ jsx(
1337
- Component,
1338
- {
1339
- className: props.className,
1340
- style: props.style,
1341
- size: props.size ?? "1em"
1342
- }
1343
- );
1344
- Adapter.displayName = `Fa.${target}`;
1345
- return Adapter;
1346
- },
1347
- name,
1348
- family
1349
- );
1350
- }
1351
- function warnFallback(name, family) {
1352
- const key = `${family}::${name}`;
1353
- if (warned.has(key)) return;
1354
- warned.add(key);
1355
- if (typeof console !== "undefined") {
1356
- console.warn(
1357
- `[iconFamily] No '${name}' mapping in family '${family}'; falling back to lucide. Add an alias in lib/iconFamily.ts.`
1358
- );
1359
- }
1360
- }
1361
- function makeLucideAdapter(name, isFallback = false) {
1241
+ function makeLucideAdapter(name) {
1362
1242
  const LucideComp = resolveLucide(name);
1363
- const Adapter = (props) => {
1364
- const stroke = props.strokeWidth ?? (isFallback ? 2 : void 0);
1365
- const style = isFallback ? { ...props.style ?? {}, strokeWidth: stroke ?? 2 } : props.style;
1366
- return /* @__PURE__ */ jsx(
1367
- LucideComp,
1368
- {
1369
- className: props.className,
1370
- strokeWidth: stroke,
1371
- style,
1372
- size: props.size
1373
- }
1374
- );
1375
- };
1376
- Adapter.displayName = `Lucide.${name}${isFallback ? ".fallback" : ""}`;
1243
+ const Adapter = (props) => /* @__PURE__ */ jsx(
1244
+ LucideComp,
1245
+ {
1246
+ className: props.className,
1247
+ strokeWidth: props.strokeWidth,
1248
+ style: props.style,
1249
+ size: props.size
1250
+ }
1251
+ );
1252
+ Adapter.displayName = `Lucide.${name}`;
1377
1253
  return Adapter;
1378
1254
  }
1379
- function resolveIconForFamily(name, family) {
1380
- switch (family) {
1381
- case "lucide":
1382
- return makeLucideAdapter(name, false);
1383
- // Non-lucide families resolve to a lazy, Suspense-wrapped component that
1384
- // dynamic-imports the library on first render and falls back to lucide
1385
- // internally when the family lacks the icon (see lazyFamilyIcon).
1386
- case "phosphor-outline":
1387
- return resolvePhosphor(name, "regular", family);
1388
- case "phosphor-fill":
1389
- return resolvePhosphor(name, "fill", family);
1390
- case "phosphor-duotone":
1391
- return resolvePhosphor(name, "duotone", family);
1392
- case "tabler":
1393
- return resolveTabler(name, family);
1394
- case "fa-solid":
1395
- return resolveFa(name, family);
1396
- }
1397
- }
1398
- var DEFAULT_FAMILY, VALID_FAMILIES, cachedFamily, listeners, observer, libPromises, lucideAliases, phosphorAliases, tablerAliases, faAliases, warned;
1255
+ function resolveIconForFamily(name, _family) {
1256
+ return makeLucideAdapter(name);
1257
+ }
1258
+ var DEFAULT_FAMILY, VALID_FAMILIES, cachedFamily, listeners, observer, lucideAliases;
1399
1259
  var init_iconFamily = __esm({
1400
1260
  "lib/iconFamily.tsx"() {
1401
1261
  "use client";
1402
1262
  DEFAULT_FAMILY = "lucide";
1403
- VALID_FAMILIES = [
1404
- "lucide",
1405
- "phosphor-outline",
1406
- "phosphor-fill",
1407
- "phosphor-duotone",
1408
- "tabler",
1409
- "fa-solid"
1410
- ];
1263
+ VALID_FAMILIES = [DEFAULT_FAMILY];
1411
1264
  cachedFamily = null;
1412
1265
  listeners = /* @__PURE__ */ new Set();
1413
1266
  observer = null;
1414
- libPromises = /* @__PURE__ */ new Map();
1415
1267
  lucideAliases = {
1416
1268
  close: LucideIcons2.X,
1417
1269
  trash: LucideIcons2.Trash2,
@@ -1424,478 +1276,6 @@ var init_iconFamily = __esm({
1424
1276
  "sort-asc": LucideIcons2.ArrowUpNarrowWide,
1425
1277
  "sort-desc": LucideIcons2.ArrowDownNarrowWide
1426
1278
  };
1427
- phosphorAliases = {
1428
- // lucide name → phosphor PascalCase name
1429
- // Actions
1430
- plus: "Plus",
1431
- minus: "Minus",
1432
- x: "X",
1433
- check: "Check",
1434
- close: "X",
1435
- edit: "PencilSimple",
1436
- pencil: "PencilSimple",
1437
- trash: "Trash",
1438
- save: "FloppyDisk",
1439
- copy: "Copy",
1440
- share: "Share",
1441
- send: "PaperPlaneRight",
1442
- download: "DownloadSimple",
1443
- upload: "UploadSimple",
1444
- archive: "Archive",
1445
- refresh: "ArrowsClockwise",
1446
- loader: "CircleNotch",
1447
- link: "Link",
1448
- paperclip: "Paperclip",
1449
- // Navigation
1450
- "chevron-down": "CaretDown",
1451
- "chevron-up": "CaretUp",
1452
- "chevron-left": "CaretLeft",
1453
- "chevron-right": "CaretRight",
1454
- "arrow-up": "ArrowUp",
1455
- "arrow-down": "ArrowDown",
1456
- "arrow-left": "ArrowLeft",
1457
- "arrow-right": "ArrowRight",
1458
- menu: "List",
1459
- more: "DotsThree",
1460
- "more-vertical": "DotsThreeVertical",
1461
- "more-horizontal": "DotsThree",
1462
- external: "ArrowSquareOut",
1463
- "external-link": "ArrowSquareOut",
1464
- // Files
1465
- file: "File",
1466
- "file-text": "FileText",
1467
- "file-plus": "FilePlus",
1468
- "file-minus": "FileMinus",
1469
- folder: "Folder",
1470
- "folder-open": "FolderOpen",
1471
- document: "FileText",
1472
- // Charts
1473
- "bar-chart": "ChartBar",
1474
- "bar-chart-2": "ChartBar",
1475
- "bar-chart-3": "ChartBar",
1476
- "line-chart": "ChartLine",
1477
- "pie-chart": "ChartPie",
1478
- activity: "Pulse",
1479
- "trending-up": "TrendUp",
1480
- "trending-down": "TrendDown",
1481
- // Messages
1482
- message: "ChatCircle",
1483
- "message-circle": "ChatCircle",
1484
- "message-square": "ChatText",
1485
- "messages-square": "ChatsCircle",
1486
- comment: "ChatCircle",
1487
- comments: "ChatsCircle",
1488
- inbox: "Tray",
1489
- mail: "Envelope",
1490
- envelope: "Envelope",
1491
- // Status
1492
- "alert-circle": "WarningCircle",
1493
- "alert-triangle": "Warning",
1494
- "check-circle": "CheckCircle",
1495
- "x-circle": "XCircle",
1496
- info: "Info",
1497
- "help-circle": "Question",
1498
- "life-buoy": "Lifebuoy",
1499
- lifebuoy: "Lifebuoy",
1500
- warning: "Warning",
1501
- error: "WarningCircle",
1502
- // Media
1503
- image: "Image",
1504
- video: "VideoCamera",
1505
- film: "FilmStrip",
1506
- camera: "Camera",
1507
- music: "MusicNote",
1508
- play: "Play",
1509
- pause: "Pause",
1510
- stop: "Stop",
1511
- "skip-forward": "SkipForward",
1512
- "skip-back": "SkipBack",
1513
- volume: "SpeakerHigh",
1514
- "volume-2": "SpeakerHigh",
1515
- "volume-x": "SpeakerX",
1516
- mic: "Microphone",
1517
- "mic-off": "MicrophoneSlash",
1518
- // People
1519
- user: "User",
1520
- users: "Users",
1521
- "user-plus": "UserPlus",
1522
- "user-check": "UserCheck",
1523
- // Time
1524
- calendar: "Calendar",
1525
- clock: "Clock",
1526
- timer: "Timer",
1527
- // Location
1528
- map: "MapTrifold",
1529
- "map-pin": "MapPin",
1530
- navigation: "NavigationArrow",
1531
- compass: "Compass",
1532
- globe: "Globe",
1533
- target: "Target",
1534
- // Project / layout
1535
- kanban: "Kanban",
1536
- list: "List",
1537
- table: "Table",
1538
- grid: "GridFour",
1539
- layout: "Layout",
1540
- columns: "Columns",
1541
- rows: "Rows",
1542
- // Misc
1543
- bell: "Bell",
1544
- bookmark: "Bookmark",
1545
- briefcase: "Briefcase",
1546
- flag: "Flag",
1547
- tag: "Tag",
1548
- tags: "Tag",
1549
- star: "Star",
1550
- heart: "Heart",
1551
- home: "House",
1552
- settings: "Gear",
1553
- eye: "Eye",
1554
- "eye-off": "EyeSlash",
1555
- lock: "Lock",
1556
- unlock: "LockOpen",
1557
- key: "Key",
1558
- shield: "Shield",
1559
- search: "MagnifyingGlass",
1560
- filter: "Funnel",
1561
- "sort-asc": "SortAscending",
1562
- "sort-desc": "SortDescending",
1563
- zap: "Lightning",
1564
- sparkles: "Sparkle",
1565
- // Code
1566
- code: "Code",
1567
- terminal: "Terminal",
1568
- database: "Database",
1569
- server: "HardDrives",
1570
- cloud: "Cloud",
1571
- wifi: "WifiHigh",
1572
- package: "Package",
1573
- box: "Package",
1574
- // Theme
1575
- sun: "Sun",
1576
- moon: "Moon",
1577
- // Phone
1578
- phone: "Phone",
1579
- printer: "Printer",
1580
- // Hierarchy
1581
- tree: "Tree",
1582
- network: "Network"
1583
- };
1584
- tablerAliases = {
1585
- // lucide name → tabler suffix (after the `Icon` prefix)
1586
- // Actions
1587
- plus: "Plus",
1588
- minus: "Minus",
1589
- x: "X",
1590
- check: "Check",
1591
- close: "X",
1592
- edit: "Pencil",
1593
- pencil: "Pencil",
1594
- trash: "Trash",
1595
- save: "DeviceFloppy",
1596
- copy: "Copy",
1597
- share: "Share",
1598
- send: "Send",
1599
- download: "Download",
1600
- upload: "Upload",
1601
- archive: "Archive",
1602
- refresh: "Refresh",
1603
- loader: "Loader2",
1604
- link: "Link",
1605
- paperclip: "Paperclip",
1606
- external: "ExternalLink",
1607
- "external-link": "ExternalLink",
1608
- // Navigation
1609
- "chevron-down": "ChevronDown",
1610
- "chevron-up": "ChevronUp",
1611
- "chevron-left": "ChevronLeft",
1612
- "chevron-right": "ChevronRight",
1613
- "arrow-down": "ArrowDown",
1614
- "arrow-up": "ArrowUp",
1615
- "arrow-left": "ArrowLeft",
1616
- "arrow-right": "ArrowRight",
1617
- menu: "Menu2",
1618
- more: "Dots",
1619
- "more-vertical": "DotsVertical",
1620
- // Files
1621
- file: "File",
1622
- "file-text": "FileText",
1623
- "file-plus": "FilePlus",
1624
- "file-check": "FileCheck",
1625
- "file-minus": "FileMinus",
1626
- folder: "Folder",
1627
- "folder-open": "FolderOpen",
1628
- document: "FileText",
1629
- // Charts
1630
- "bar-chart": "ChartBar",
1631
- "bar-chart-2": "ChartBar",
1632
- "bar-chart-3": "ChartBar",
1633
- "line-chart": "ChartLine",
1634
- "pie-chart": "ChartPie",
1635
- activity: "Activity",
1636
- "trending-up": "TrendingUp",
1637
- "trending-down": "TrendingDown",
1638
- // Messages
1639
- message: "Message",
1640
- "message-circle": "MessageCircle",
1641
- "message-square": "Message2",
1642
- "messages-square": "Messages",
1643
- comment: "Message",
1644
- comments: "Messages",
1645
- inbox: "Inbox",
1646
- mail: "Mail",
1647
- envelope: "Mail",
1648
- // Status
1649
- "alert-circle": "AlertCircle",
1650
- "alert-triangle": "AlertTriangle",
1651
- "check-circle": "CircleCheck",
1652
- "x-circle": "CircleX",
1653
- info: "InfoCircle",
1654
- "help-circle": "HelpCircle",
1655
- "life-buoy": "Lifebuoy",
1656
- warning: "AlertTriangle",
1657
- error: "AlertOctagon",
1658
- // Media
1659
- image: "Photo",
1660
- video: "Video",
1661
- camera: "Camera",
1662
- music: "Music",
1663
- play: "PlayerPlay",
1664
- pause: "PlayerPause",
1665
- stop: "PlayerStop",
1666
- "skip-forward": "PlayerSkipForward",
1667
- "skip-back": "PlayerSkipBack",
1668
- volume: "Volume",
1669
- "volume-2": "Volume",
1670
- "volume-x": "VolumeOff",
1671
- mic: "Microphone",
1672
- "mic-off": "MicrophoneOff",
1673
- // People
1674
- user: "User",
1675
- users: "Users",
1676
- "user-plus": "UserPlus",
1677
- "user-check": "UserCheck",
1678
- // Time
1679
- calendar: "Calendar",
1680
- clock: "Clock",
1681
- timer: "Hourglass",
1682
- // Location
1683
- map: "Map",
1684
- "map-pin": "MapPin",
1685
- navigation: "Navigation",
1686
- compass: "Compass",
1687
- globe: "World",
1688
- target: "Target",
1689
- // Project / layout
1690
- kanban: "LayoutKanban",
1691
- list: "List",
1692
- table: "Table",
1693
- grid: "LayoutGrid",
1694
- layout: "Layout",
1695
- columns: "LayoutColumns",
1696
- rows: "LayoutRows",
1697
- // Misc
1698
- bell: "Bell",
1699
- bookmark: "Bookmark",
1700
- briefcase: "Briefcase",
1701
- flag: "Flag",
1702
- tag: "Tag",
1703
- tags: "Tags",
1704
- star: "Star",
1705
- heart: "Heart",
1706
- home: "Home",
1707
- settings: "Settings",
1708
- eye: "Eye",
1709
- "eye-off": "EyeOff",
1710
- lock: "Lock",
1711
- unlock: "LockOpen",
1712
- key: "Key",
1713
- shield: "Shield",
1714
- search: "Search",
1715
- filter: "Filter",
1716
- "sort-asc": "SortAscending",
1717
- "sort-desc": "SortDescending",
1718
- zap: "Bolt",
1719
- sparkles: "Sparkles",
1720
- // Code / data
1721
- code: "Code",
1722
- terminal: "Terminal",
1723
- database: "Database",
1724
- server: "Server",
1725
- cloud: "Cloud",
1726
- wifi: "Wifi",
1727
- package: "Package",
1728
- box: "Box",
1729
- // Theme
1730
- sun: "Sun",
1731
- moon: "Moon",
1732
- // Phone
1733
- phone: "Phone",
1734
- printer: "Printer",
1735
- // Hierarchy
1736
- tree: "Hierarchy",
1737
- network: "Network"
1738
- };
1739
- faAliases = {
1740
- // lucide name → fa-solid suffix (after the `Fa` prefix).
1741
- // react-icons/fa ships FontAwesome 5 — names like `FaFileText` don't exist
1742
- // (FA renamed to `FaFileAlt`). When you see a console.warn from
1743
- // [iconFamily] about an unmapped lucide name in this family, add the
1744
- // closest FA5 sibling here so the fallback stays in-family.
1745
- search: "Search",
1746
- close: "Times",
1747
- x: "Times",
1748
- loader: "Spinner",
1749
- refresh: "Sync",
1750
- "sort-asc": "SortAmountUp",
1751
- "sort-desc": "SortAmountDown",
1752
- "chevron-down": "ChevronDown",
1753
- "chevron-up": "ChevronUp",
1754
- "chevron-left": "ChevronLeft",
1755
- "chevron-right": "ChevronRight",
1756
- "help-circle": "QuestionCircle",
1757
- "alert-triangle": "ExclamationTriangle",
1758
- "alert-circle": "ExclamationCircle",
1759
- "check-circle": "CheckCircle",
1760
- "x-circle": "TimesCircle",
1761
- edit: "Edit",
1762
- pencil: "PencilAlt",
1763
- trash: "Trash",
1764
- send: "PaperPlane",
1765
- share: "ShareAlt",
1766
- external: "ExternalLinkAlt",
1767
- plus: "Plus",
1768
- minus: "Minus",
1769
- check: "Check",
1770
- star: "Star",
1771
- heart: "Heart",
1772
- home: "Home",
1773
- user: "User",
1774
- users: "Users",
1775
- "user-plus": "UserPlus",
1776
- "user-check": "UserCheck",
1777
- settings: "Cog",
1778
- menu: "Bars",
1779
- "arrow-up": "ArrowUp",
1780
- "arrow-down": "ArrowDown",
1781
- "arrow-left": "ArrowLeft",
1782
- "arrow-right": "ArrowRight",
1783
- copy: "Copy",
1784
- download: "Download",
1785
- upload: "Upload",
1786
- filter: "Filter",
1787
- calendar: "Calendar",
1788
- clock: "Clock",
1789
- bell: "Bell",
1790
- mail: "Envelope",
1791
- envelope: "Envelope",
1792
- lock: "Lock",
1793
- unlock: "LockOpen",
1794
- eye: "Eye",
1795
- "eye-off": "EyeSlash",
1796
- more: "EllipsisH",
1797
- "more-vertical": "EllipsisV",
1798
- info: "InfoCircle",
1799
- warning: "ExclamationTriangle",
1800
- error: "ExclamationCircle",
1801
- // Time
1802
- timer: "Hourglass",
1803
- // Files (FA renamed FileText → FileAlt)
1804
- file: "File",
1805
- "file-text": "FileAlt",
1806
- "file-plus": "FileMedical",
1807
- "file-minus": "FileExcel",
1808
- "file-check": "FileSignature",
1809
- document: "FileAlt",
1810
- // Charts (lucide BarChart2 / BarChart3 → FA ChartBar)
1811
- "bar-chart": "ChartBar",
1812
- "bar-chart-2": "ChartBar",
1813
- "bar-chart-3": "ChartBar",
1814
- "line-chart": "ChartLine",
1815
- "pie-chart": "ChartPie",
1816
- activity: "ChartLine",
1817
- "trending-up": "ChartLine",
1818
- "trending-down": "ChartLine",
1819
- // Messages (lucide MessageCircle/MessageSquare → FA CommentDots/CommentAlt)
1820
- message: "Comment",
1821
- "message-circle": "CommentDots",
1822
- "message-square": "CommentAlt",
1823
- "messages-square": "Comments",
1824
- comment: "Comment",
1825
- comments: "Comments",
1826
- inbox: "Inbox",
1827
- // Support / help
1828
- "life-buoy": "LifeRing",
1829
- lifebuoy: "LifeRing",
1830
- // Project / kanban (FA has no kanban; closest semantic is Tasks/Columns)
1831
- kanban: "Tasks",
1832
- columns: "Columns",
1833
- rows: "Bars",
1834
- layout: "ThLarge",
1835
- grid: "Th",
1836
- list: "List",
1837
- table: "Table",
1838
- // Storage / folders
1839
- folder: "Folder",
1840
- "folder-open": "FolderOpen",
1841
- archive: "Archive",
1842
- bookmark: "Bookmark",
1843
- briefcase: "Briefcase",
1844
- package: "Box",
1845
- box: "Box",
1846
- // Map / location
1847
- map: "Map",
1848
- "map-pin": "MapMarkerAlt",
1849
- navigation: "LocationArrow",
1850
- compass: "Compass",
1851
- globe: "Globe",
1852
- target: "Bullseye",
1853
- // Media
1854
- image: "Image",
1855
- video: "Video",
1856
- film: "Film",
1857
- camera: "Camera",
1858
- music: "Music",
1859
- play: "Play",
1860
- pause: "Pause",
1861
- stop: "Stop",
1862
- "skip-forward": "Forward",
1863
- "skip-back": "Backward",
1864
- volume: "VolumeUp",
1865
- "volume-2": "VolumeUp",
1866
- "volume-x": "VolumeMute",
1867
- mic: "Microphone",
1868
- "mic-off": "MicrophoneSlash",
1869
- phone: "Phone",
1870
- // Code / data
1871
- code: "Code",
1872
- terminal: "Terminal",
1873
- database: "Database",
1874
- server: "Server",
1875
- cloud: "Cloud",
1876
- wifi: "Wifi",
1877
- // Security
1878
- shield: "ShieldAlt",
1879
- key: "Key",
1880
- // Misc actions
1881
- printer: "Print",
1882
- save: "Save",
1883
- link: "Link",
1884
- unlink: "Unlink",
1885
- paperclip: "Paperclip",
1886
- flag: "Flag",
1887
- tag: "Tag",
1888
- tags: "Tags",
1889
- zap: "Bolt",
1890
- sparkles: "Magic",
1891
- // Theme
1892
- sun: "Sun",
1893
- moon: "Moon",
1894
- // Hierarchy (FA has no Tree icon for hierarchies; Sitemap is the org-chart icon)
1895
- tree: "Sitemap",
1896
- network: "NetworkWired"
1897
- };
1898
- warned = /* @__PURE__ */ new Set();
1899
1279
  }
1900
1280
  });
1901
1281
  function kebabToPascal2(name) {
@@ -1976,7 +1356,7 @@ var init_Icon = __esm({
1976
1356
  const family = useIconFamily();
1977
1357
  const RenderedComponent = React73__default.useMemo(() => {
1978
1358
  if (directIcon) return null;
1979
- return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
1359
+ return effectiveName ? resolveIconForFamily(effectiveName) : null;
1980
1360
  }, [directIcon, effectiveName, family]);
1981
1361
  const effectiveStrokeWidth = strokeWidth ?? void 0;
1982
1362
  const inlineStyle = {
@@ -2355,7 +1735,7 @@ var init_Button = __esm({
2355
1735
  ref,
2356
1736
  disabled: disabled || isLoading,
2357
1737
  className: cn(
2358
- "inline-flex items-center justify-center gap-2",
1738
+ "relative inline-flex items-center justify-center gap-2",
2359
1739
  "font-medium",
2360
1740
  "rounded-sm",
2361
1741
  "cursor-pointer",
@@ -2400,6 +1780,7 @@ var init_Input = __esm({
2400
1780
  icon: iconProp,
2401
1781
  clearable,
2402
1782
  onClear,
1783
+ action,
2403
1784
  value,
2404
1785
  options,
2405
1786
  rows: rows2 = 3,
@@ -2449,6 +1830,11 @@ var init_Input = __esm({
2449
1830
  onClear?.();
2450
1831
  }
2451
1832
  };
1833
+ const handleKeyDown = (e) => {
1834
+ if (action && e.key === "Enter") {
1835
+ eventBus.emit(`UI:${action}`, { value: e.currentTarget.value });
1836
+ }
1837
+ };
2452
1838
  const wrapField = (field) => /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
2453
1839
  label && /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-foreground mb-1", children: label }),
2454
1840
  field,
@@ -2522,6 +1908,7 @@ var init_Input = __esm({
2522
1908
  type,
2523
1909
  value,
2524
1910
  onChange: handleChange,
1911
+ onKeyDown: handleKeyDown,
2525
1912
  className: baseClassName,
2526
1913
  ...props
2527
1914
  }
@@ -3147,7 +2534,7 @@ var init_Badge = __esm({
3147
2534
  });
3148
2535
  function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
3149
2536
  const px = typeof size === "number" ? size : sizeMap[size];
3150
- const family = useIconFamily();
2537
+ useIconFamily();
3151
2538
  if (assetUrl?.url) {
3152
2539
  return /* @__PURE__ */ jsx(
3153
2540
  AtlasImage,
@@ -3159,7 +2546,7 @@ function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
3159
2546
  }
3160
2547
  );
3161
2548
  }
3162
- const I = typeof icon === "string" ? resolveIconForFamily(icon, family) : icon;
2549
+ const I = typeof icon === "string" ? resolveIconForFamily(icon) : icon;
3163
2550
  return /* @__PURE__ */ jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
3164
2551
  }
3165
2552
  var sizeMap;
@@ -7400,21 +6787,6 @@ var init_renderer = __esm({
7400
6787
  init_slot_definitions();
7401
6788
  }
7402
6789
  });
7403
-
7404
- // lib/wrapCallbackForEvent.ts
7405
- function wrapCallbackForEvent(qualifiedEvent, callbackArgs, emit) {
7406
- const argNames = (callbackArgs ?? []).map((a) => a.name);
7407
- if (argNames.length === 0) {
7408
- return () => emit(qualifiedEvent);
7409
- }
7410
- return (...args) => {
7411
- const payload = {};
7412
- for (let i = 0; i < argNames.length; i += 1) {
7413
- payload[argNames[i]] = args[i];
7414
- }
7415
- emit(qualifiedEvent, payload);
7416
- };
7417
- }
7418
6790
  var init_wrapCallbackForEvent = __esm({
7419
6791
  "lib/wrapCallbackForEvent.ts"() {
7420
6792
  }
@@ -15768,9 +15140,9 @@ var init_isometric = __esm({
15768
15140
  // lib/drawable/projector.ts
15769
15141
  function create2DProjector(opts) {
15770
15142
  const { scale, baseOffsetX, layout } = opts;
15771
- const tileWidth = TILE_WIDTH * scale;
15772
- const floorHeight = FLOOR_HEIGHT * scale;
15773
- const diamondTopY = (opts.diamondTopY ?? DIAMOND_TOP_Y) * scale;
15143
+ const tileWidth = layout === "free" ? 1 : TILE_WIDTH * scale;
15144
+ const floorHeight = layout === "free" ? 1 : FLOOR_HEIGHT * scale;
15145
+ const diamondTopY = layout === "free" ? 0 : (opts.diamondTopY ?? DIAMOND_TOP_Y) * scale;
15774
15146
  const squareGrid = layout === "flat" || layout === "free";
15775
15147
  const project = (pos) => layout === "free" ? { x: pos.x, y: pos.y } : isoToScreen(pos.x, pos.y, scale, baseOffsetX, layout);
15776
15148
  const anchorPoint = (pos, anchor) => {
@@ -15811,6 +15183,15 @@ var init_projector = __esm({
15811
15183
  }
15812
15184
  });
15813
15185
 
15186
+ // lib/drawable/contract.ts
15187
+ function isValidScenePos(pos) {
15188
+ return Number.isFinite(pos?.x) && Number.isFinite(pos?.y);
15189
+ }
15190
+ var init_contract = __esm({
15191
+ "lib/drawable/contract.ts"() {
15192
+ }
15193
+ });
15194
+
15814
15195
  // components/game/atoms/DrawSprite.tsx
15815
15196
  function DrawSprite(_props) {
15816
15197
  return null;
@@ -15820,10 +15201,12 @@ var init_DrawSprite = __esm({
15820
15201
  "components/game/atoms/DrawSprite.tsx"() {
15821
15202
  "use client";
15822
15203
  init_atlasSlice();
15204
+ init_contract();
15823
15205
  paintSprite = (painter, node, dctx) => {
15206
+ if (!node.asset?.url || !isValidScenePos(node.position)) return;
15824
15207
  const tex = painter.resolveTexture(node.asset.url);
15825
15208
  if (!tex) return;
15826
- let src = node.frame;
15209
+ let src = typeof node.frame === "object" ? node.frame : void 0;
15827
15210
  if (!src && isAtlasAsset(node.asset)) {
15828
15211
  const atlas = getAtlas(node.asset.atlas, dctx.invalidate);
15829
15212
  if (!atlas) return;
@@ -15868,7 +15251,9 @@ var paintShape;
15868
15251
  var init_DrawShape = __esm({
15869
15252
  "components/game/atoms/DrawShape.tsx"() {
15870
15253
  "use client";
15254
+ init_contract();
15871
15255
  paintShape = (painter, node, dctx) => {
15256
+ if (!isValidScenePos(node.position)) return;
15872
15257
  painter.save();
15873
15258
  if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
15874
15259
  switch (node.shape) {
@@ -15922,7 +15307,9 @@ var paintText;
15922
15307
  var init_DrawText = __esm({
15923
15308
  "components/game/atoms/DrawText.tsx"() {
15924
15309
  "use client";
15310
+ init_contract();
15925
15311
  paintText = (painter, node, dctx) => {
15312
+ if (!isValidScenePos(node.position)) return;
15926
15313
  const p = dctx.projector.anchorPoint(node.position, node.anchor ?? "center");
15927
15314
  const x = p.x + (node.offsetX ?? 0);
15928
15315
  const y = p.y + (node.offsetY ?? 0);
@@ -16027,12 +15414,14 @@ function collectDrawnItems(nodes) {
16027
15414
  case "draw-sprite":
16028
15415
  case "draw-shape":
16029
15416
  case "draw-text":
16030
- out.push({ pos: n.position, id: n.id });
15417
+ if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
16031
15418
  break;
16032
15419
  case "draw-sprite-layer":
16033
15420
  case "draw-shape-layer":
16034
15421
  case "draw-text-layer":
16035
- for (const it of n.items) out.push({ pos: it.position, id: it.id });
15422
+ for (const it of n.items) {
15423
+ if (isValidScenePos(it.position)) out.push({ pos: it.position, id: it.id });
15424
+ }
16036
15425
  break;
16037
15426
  }
16038
15427
  }
@@ -16047,6 +15436,7 @@ function buildHitIndex(items) {
16047
15436
  }
16048
15437
  var init_hitTest = __esm({
16049
15438
  "lib/drawable/hitTest.ts"() {
15439
+ init_contract();
16050
15440
  }
16051
15441
  });
16052
15442
  function normalizeBackdrop(bg) {
@@ -16072,14 +15462,16 @@ function Canvas2D({
16072
15462
  cameraPos,
16073
15463
  bgColor
16074
15464
  }) {
15465
+ const instanceId = useMemo(() => Math.random().toString(36).slice(2, 8), []);
15466
+ function isDrawableLayer(node) {
15467
+ return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
15468
+ }
16075
15469
  const layerSummaries = drawables?.map((d) => {
16076
- if (!d || typeof d !== "object") return d;
16077
- const rec = d;
16078
- return { type: rec.type, itemsLen: Array.isArray(rec.items) ? rec.items.length : void 0, firstItem: Array.isArray(rec.items) ? rec.items[0] : void 0 };
15470
+ if (!isDrawableLayer(d)) return { type: d.type };
15471
+ return { type: d.type, itemsLen: d.items.length, firstItem: d.items[0] };
16079
15472
  });
16080
- console.error("[debug:Canvas2D] " + JSON.stringify({ projection, scale, cameraMode: camera, cameraPos, drawablesCount: drawables?.length, layerSummaries }));
15473
+ canvas2DLog.debug("Canvas2D render", { instanceId, projection, scale, cameraMode: camera, cameraPos: cameraPos ? JSON.stringify(cameraPos) : void 0, drawablesCount: drawables?.length, layerSummaries: layerSummaries ? JSON.stringify(layerSummaries) : void 0 });
16081
15474
  const backgroundImage = normalizeBackdrop(backgroundImageRaw);
16082
- const instanceId = useMemo(() => Math.random().toString(36).slice(2, 8), []);
16083
15475
  const isFree = projection === "free";
16084
15476
  const squareGrid = projection === "flat" || isFree || projection === "side";
16085
15477
  const layout = projection === "side" ? "free" : projection;
@@ -16214,7 +15606,7 @@ function Canvas2D({
16214
15606
  }
16215
15607
  const containerRect = containerRef.current?.getBoundingClientRect();
16216
15608
  const canvasRect = canvas.getBoundingClientRect();
16217
- console.error("[debug:Canvas2D:draw:" + instanceId + "] " + JSON.stringify({ viewportSize, baseOffsetX, cam: { x: cam.x, y: cam.y, zoom: cam.zoom }, cameraPos, containerRect: containerRect ? { width: containerRect.width, height: containerRect.height } : null, canvasRect: canvasRect ? { width: canvasRect.width, height: canvasRect.height } : null }));
15609
+ canvas2DLog.debug("Canvas2D draw", { instanceId, viewportSize, baseOffsetX, cam: { x: cam.x, y: cam.y, zoom: cam.zoom }, cameraPos: cameraPos ? JSON.stringify(cameraPos) : void 0, containerRect: containerRect ? { width: containerRect.width, height: containerRect.height } : null, canvasRect: canvasRect ? { width: canvasRect.width, height: canvasRect.height } : null });
16218
15610
  const painter = createWebPainter(ctx, bumpAtlas);
16219
15611
  painter.save();
16220
15612
  painter.translate(viewportSize.width / 2, viewportSize.height / 2);
@@ -16426,6 +15818,7 @@ function Canvas2D({
16426
15818
  }
16427
15819
  );
16428
15820
  }
15821
+ var canvas2DLog;
16429
15822
  var init_Canvas2D = __esm({
16430
15823
  "components/game/molecules/Canvas2D.tsx"() {
16431
15824
  "use client";
@@ -16447,6 +15840,7 @@ var init_Canvas2D = __esm({
16447
15840
  init_paintDispatch();
16448
15841
  init_hitTest();
16449
15842
  init_isometric();
15843
+ canvas2DLog = createLogger("almadar:ui:game-canvas");
16450
15844
  Canvas2D.displayName = "Canvas2D";
16451
15845
  }
16452
15846
  });
@@ -16485,7 +15879,7 @@ function Canvas({
16485
15879
  keyMap,
16486
15880
  keyUpMap
16487
15881
  }) {
16488
- console.error("[debug:Canvas] " + JSON.stringify({ mode, drawablesCount: drawables?.length, projection, camera }));
15882
+ canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
16489
15883
  const zoom = camera?.zoom;
16490
15884
  if (mode === "3d") {
16491
15885
  const props3d = {
@@ -16538,7 +15932,7 @@ function Canvas({
16538
15932
  }
16539
15933
  );
16540
15934
  }
16541
- var Canvas3DHost;
15935
+ var Canvas3DHost, canvasLog;
16542
15936
  var init_Canvas = __esm({
16543
15937
  "components/game/molecules/Canvas.tsx"() {
16544
15938
  "use client";
@@ -16546,6 +15940,7 @@ var init_Canvas = __esm({
16546
15940
  Canvas3DHost = lazy(
16547
15941
  () => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
16548
15942
  );
15943
+ canvasLog = createLogger("almadar:ui:game-canvas");
16549
15944
  Canvas.displayName = "Canvas";
16550
15945
  }
16551
15946
  });
@@ -20767,7 +20162,8 @@ function DataGrid({
20767
20162
  const { t } = useTranslate();
20768
20163
  const [selectedIds, setSelectedIds] = useState(/* @__PURE__ */ new Set());
20769
20164
  const [visibleCount, setVisibleCount] = useState(pageSize || Infinity);
20770
- const fieldDefs = fields ?? columns ?? [];
20165
+ const fieldDefs = (Array.isArray(fields) ? fields : void 0) ?? (Array.isArray(columns) ? columns : void 0) ?? [];
20166
+ const actionDefs = Array.isArray(itemActions) ? itemActions : [];
20771
20167
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
20772
20168
  const dnd = useDataDnd({
20773
20169
  items: allDataRaw,
@@ -20811,8 +20207,8 @@ function DataGrid({
20811
20207
  const titleField = fieldDefs.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fieldDefs[0];
20812
20208
  const badgeFields = fieldDefs.filter((f3) => f3.variant === "badge" && f3 !== titleField);
20813
20209
  const bodyFields = fieldDefs.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
20814
- const primaryActions = itemActions?.filter((a) => a.variant !== "danger") ?? [];
20815
- const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
20210
+ const primaryActions = actionDefs.filter((a) => a.variant !== "danger");
20211
+ const dangerActions = actionDefs.filter((a) => a.variant === "danger");
20816
20212
  const handleActionClick = (action, itemData) => (e) => {
20817
20213
  e.stopPropagation();
20818
20214
  const payload = {
@@ -37189,7 +36585,7 @@ function measureLabelWidth(text) {
37189
36585
  if (typeof document === "undefined") return text.length * 6;
37190
36586
  if (!labelMeasureCtx) labelMeasureCtx = document.createElement("canvas").getContext("2d");
37191
36587
  if (!labelMeasureCtx) return text.length * 6;
37192
- labelMeasureCtx.font = "10px system-ui";
36588
+ labelMeasureCtx.font = "12px system-ui";
37193
36589
  return labelMeasureCtx.measureText(text).width;
37194
36590
  }
37195
36591
  function getGroupColor(group, groups) {
@@ -37235,6 +36631,7 @@ var init_GraphCanvas = __esm({
37235
36631
  actions,
37236
36632
  onNodeClick,
37237
36633
  onNodeDoubleClick,
36634
+ onBadgeClick,
37238
36635
  nodeClickEvent,
37239
36636
  selectedNodeId,
37240
36637
  repulsion = 800,
@@ -37382,7 +36779,9 @@ var init_GraphCanvas = __esm({
37382
36779
  const dx = target.x - source.x;
37383
36780
  const dy = target.y - source.y;
37384
36781
  const dist = Math.sqrt(dx * dx + dy * dy) || 1;
37385
- const force = (dist - linkDistance) * 0.05;
36782
+ const w2 = edge.weight ?? 1;
36783
+ const linkTarget = linkDistance * (1 + (1 - Math.min(1, Math.max(0, w2))) * 1.5);
36784
+ const force = (dist - linkTarget) * 0.05;
37386
36785
  const fx = dx / dist * force;
37387
36786
  const fy = dy / dist * force;
37388
36787
  source.fx += fx;
@@ -37404,7 +36803,7 @@ var init_GraphCanvas = __esm({
37404
36803
  node.y = Math.max(30, Math.min(h - 30, node.y));
37405
36804
  }
37406
36805
  const LABEL_GAP = 12;
37407
- const LABEL_H = 12;
36806
+ const LABEL_H = 16;
37408
36807
  const pad = nodeSpacing / 2;
37409
36808
  for (let i = 0; i < nodes.length; i++) {
37410
36809
  for (let j = i + 1; j < nodes.length; j++) {
@@ -37459,6 +36858,11 @@ var init_GraphCanvas = __esm({
37459
36858
  const h = height;
37460
36859
  const nodes = nodesRef.current;
37461
36860
  const accentColor = resolveColor3("var(--color-accent)", canvas);
36861
+ const fontFamily = resolveColor3("var(--font-family)", canvas) || "system-ui";
36862
+ const fgColor = resolveColor3("var(--color-foreground)", canvas);
36863
+ const mutedColor = resolveColor3("var(--color-muted-foreground)", canvas) || fgColor;
36864
+ const bgColor = resolveColor3("var(--color-background)", canvas) || "#ffffff";
36865
+ const accentFg = resolveColor3("var(--color-accent-foreground)", canvas) || "#ffffff";
37462
36866
  const dpr = typeof window !== "undefined" && window.devicePixelRatio || 1;
37463
36867
  ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
37464
36868
  ctx.clearRect(0, 0, w, h);
@@ -37478,19 +36882,21 @@ var init_GraphCanvas = __esm({
37478
36882
  const target = nodes.find((n) => n.id === edge.target);
37479
36883
  if (!source || !target) continue;
37480
36884
  const incident = !!hoveredNode && (edge.source === hoveredNode || edge.target === hoveredNode);
37481
- ctx.globalAlpha = hoveredNode ? incident ? 1 : 0.05 : linkOpacity;
36885
+ const w2 = edge.weight ?? 1;
36886
+ ctx.globalAlpha = hoveredNode ? incident ? 1 : 0.05 : linkOpacity * w2;
37482
36887
  ctx.beginPath();
37483
36888
  ctx.moveTo(source.x, source.y);
37484
36889
  ctx.lineTo(target.x, target.y);
37485
36890
  ctx.strokeStyle = incident ? accentColor : edge.color || "#888888";
37486
- ctx.lineWidth = incident ? 2 : edge.weight ? Math.max(1, edge.weight) : 1;
36891
+ ctx.lineWidth = incident ? 2 : Math.max(0.75, w2);
37487
36892
  ctx.stroke();
37488
36893
  if (edge.label && showLabels) {
37489
36894
  const mx = (source.x + target.x) / 2;
37490
36895
  const my = (source.y + target.y) / 2;
37491
- ctx.fillStyle = "#888888";
37492
- ctx.font = "9px system-ui";
36896
+ ctx.fillStyle = mutedColor;
36897
+ ctx.font = `9px ${fontFamily}`;
37493
36898
  ctx.textAlign = "center";
36899
+ ctx.textBaseline = "alphabetic";
37494
36900
  ctx.fillText(edge.label, mx, my - 4);
37495
36901
  }
37496
36902
  }
@@ -37515,10 +36921,33 @@ var init_GraphCanvas = __esm({
37515
36921
  }
37516
36922
  ctx.stroke();
37517
36923
  if (showLabels && node.label) {
37518
- ctx.fillStyle = "#666666";
37519
- ctx.font = `${isSelected || isHovered ? "bold " : ""}10px system-ui`;
36924
+ ctx.font = `${isSelected || isHovered ? "600" : "500"} 12px ${fontFamily}`;
37520
36925
  ctx.textAlign = "center";
37521
- ctx.fillText(node.label, node.x, node.y + radius + 12);
36926
+ ctx.textBaseline = "middle";
36927
+ const ly = node.y + radius + 14;
36928
+ ctx.lineWidth = 3;
36929
+ ctx.lineJoin = "round";
36930
+ ctx.strokeStyle = bgColor;
36931
+ ctx.strokeText(node.label, node.x, ly);
36932
+ ctx.fillStyle = isSelected || isHovered ? fgColor : mutedColor;
36933
+ ctx.fillText(node.label, node.x, ly);
36934
+ }
36935
+ if (node.badge && node.badge > 1) {
36936
+ const bx = node.x + radius * 0.7;
36937
+ const by = node.y - radius * 0.7;
36938
+ const br = Math.max(7, Math.min(11, radius * 0.45));
36939
+ ctx.beginPath();
36940
+ ctx.arc(bx, by, br, 0, Math.PI * 2);
36941
+ ctx.fillStyle = accentColor;
36942
+ ctx.fill();
36943
+ ctx.strokeStyle = bgColor;
36944
+ ctx.lineWidth = 2;
36945
+ ctx.stroke();
36946
+ ctx.fillStyle = accentFg;
36947
+ ctx.font = `600 9px ${fontFamily}`;
36948
+ ctx.textAlign = "center";
36949
+ ctx.textBaseline = "middle";
36950
+ ctx.fillText(String(node.badge), bx, by + 0.5);
37522
36951
  }
37523
36952
  }
37524
36953
  ctx.restore();
@@ -37611,11 +37040,21 @@ var init_GraphCanvas = __esm({
37611
37040
  if (!coords) return;
37612
37041
  const node = nodeAt(coords.graphX, coords.graphY);
37613
37042
  if (node) {
37043
+ if (node.badge && node.badge > 1 && onBadgeClick) {
37044
+ const r = (node.size || 8) + (selectedNodeId === node.id ? 4 : 0);
37045
+ const bx = node.x + r * 0.7;
37046
+ const by = node.y - r * 0.7;
37047
+ const br = Math.max(7, Math.min(11, r * 0.45)) + 3;
37048
+ if (Math.hypot(coords.graphX - bx, coords.graphY - by) <= br) {
37049
+ onBadgeClick(node);
37050
+ return;
37051
+ }
37052
+ }
37614
37053
  handleNodeClick(node);
37615
37054
  }
37616
37055
  }
37617
37056
  },
37618
- [toCoords, nodeAt, handleNodeClick]
37057
+ [toCoords, nodeAt, handleNodeClick, onBadgeClick, selectedNodeId]
37619
37058
  );
37620
37059
  const handlePointerLeave = useCallback(() => {
37621
37060
  setHoveredNode(null);