@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.
@@ -11,6 +11,7 @@ var hooks = require('@almadar/ui/hooks');
11
11
  var context = require('@almadar/ui/context');
12
12
  var evaluator = require('@almadar/evaluator');
13
13
  var reactDom = require('react-dom');
14
+ var ui = require('@almadar/runtime/ui');
14
15
  var reactRouterDom = require('react-router-dom');
15
16
  var ELK = require('elkjs/lib/elk.bundled.js');
16
17
  var SyntaxHighlighter = require('react-syntax-highlighter/dist/esm/prism-light.js');
@@ -1269,41 +1270,6 @@ function kebabToPascal(name) {
1269
1270
  return part.charAt(0).toUpperCase() + part.slice(1);
1270
1271
  }).join("");
1271
1272
  }
1272
- function loadLib(key, importer) {
1273
- let p = libPromises.get(key);
1274
- if (!p) {
1275
- p = importer();
1276
- libPromises.set(key, p);
1277
- }
1278
- return p;
1279
- }
1280
- function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
1281
- const Lazy = React73__namespace.default.lazy(async () => {
1282
- const lib = await loadLib(libKey, importer);
1283
- const Comp = pick(lib);
1284
- if (!Comp) {
1285
- warnFallback(fallbackName, family);
1286
- return { default: makeLucideAdapter(fallbackName, true) };
1287
- }
1288
- return { default: Comp };
1289
- });
1290
- const Wrapped = (props) => /* @__PURE__ */ jsxRuntime.jsx(
1291
- React73__namespace.default.Suspense,
1292
- {
1293
- fallback: /* @__PURE__ */ jsxRuntime.jsx(
1294
- "span",
1295
- {
1296
- "aria-hidden": true,
1297
- className: props.className,
1298
- style: { display: "inline-block", ...props.style }
1299
- }
1300
- ),
1301
- children: /* @__PURE__ */ jsxRuntime.jsx(Lazy, { ...props })
1302
- }
1303
- );
1304
- Wrapped.displayName = `Lazy.${libKey}.${fallbackName}`;
1305
- return Wrapped;
1306
- }
1307
1273
  function isComponentLike(v) {
1308
1274
  return v != null && (typeof v === "function" || typeof v === "object");
1309
1275
  }
@@ -1317,146 +1283,32 @@ function resolveLucide(name) {
1317
1283
  if (isComponentLike(asIs)) return asIs;
1318
1284
  return LucideIcons2__namespace.HelpCircle;
1319
1285
  }
1320
- function resolvePhosphor(name, weight, family) {
1321
- const target = phosphorAliases[name] ?? kebabToPascal(name);
1322
- return lazyFamilyIcon(
1323
- "phosphor",
1324
- () => import('@phosphor-icons/react'),
1325
- (lib) => {
1326
- const PhosphorComp = lib[target];
1327
- if (!PhosphorComp) return null;
1328
- const Component = PhosphorComp;
1329
- const Adapter = (props) => /* @__PURE__ */ jsxRuntime.jsx(
1330
- Component,
1331
- {
1332
- weight,
1333
- className: props.className,
1334
- style: props.style,
1335
- size: props.size ?? "1em"
1336
- }
1337
- );
1338
- Adapter.displayName = `Phosphor.${target}.${weight}`;
1339
- return Adapter;
1340
- },
1341
- name,
1342
- family
1343
- );
1344
- }
1345
- function resolveTabler(name, family) {
1346
- const suffix = tablerAliases[name] ?? kebabToPascal(name);
1347
- const target = `Icon${suffix}`;
1348
- return lazyFamilyIcon(
1349
- "tabler",
1350
- () => import('@tabler/icons-react'),
1351
- (lib) => {
1352
- const TablerComp = lib[target];
1353
- if (!TablerComp) return null;
1354
- const Component = TablerComp;
1355
- const Adapter = (props) => /* @__PURE__ */ jsxRuntime.jsx(
1356
- Component,
1357
- {
1358
- stroke: props.strokeWidth ?? 1.5,
1359
- className: props.className,
1360
- style: props.style,
1361
- size: props.size ?? 24
1362
- }
1363
- );
1364
- Adapter.displayName = `Tabler.${target}`;
1365
- return Adapter;
1366
- },
1367
- name,
1368
- family
1369
- );
1370
- }
1371
- function resolveFa(name, family) {
1372
- const suffix = faAliases[name] ?? kebabToPascal(name);
1373
- const target = `Fa${suffix}`;
1374
- return lazyFamilyIcon(
1375
- "fa",
1376
- () => import('react-icons/fa'),
1377
- (lib) => {
1378
- const FaComp = lib[target];
1379
- if (!FaComp) return null;
1380
- const Component = FaComp;
1381
- const Adapter = (props) => /* @__PURE__ */ jsxRuntime.jsx(
1382
- Component,
1383
- {
1384
- className: props.className,
1385
- style: props.style,
1386
- size: props.size ?? "1em"
1387
- }
1388
- );
1389
- Adapter.displayName = `Fa.${target}`;
1390
- return Adapter;
1391
- },
1392
- name,
1393
- family
1394
- );
1395
- }
1396
- function warnFallback(name, family) {
1397
- const key = `${family}::${name}`;
1398
- if (warned.has(key)) return;
1399
- warned.add(key);
1400
- if (typeof console !== "undefined") {
1401
- console.warn(
1402
- `[iconFamily] No '${name}' mapping in family '${family}'; falling back to lucide. Add an alias in lib/iconFamily.ts.`
1403
- );
1404
- }
1405
- }
1406
- function makeLucideAdapter(name, isFallback = false) {
1286
+ function makeLucideAdapter(name) {
1407
1287
  const LucideComp = resolveLucide(name);
1408
- const Adapter = (props) => {
1409
- const stroke = props.strokeWidth ?? (isFallback ? 2 : void 0);
1410
- const style = isFallback ? { ...props.style ?? {}, strokeWidth: stroke ?? 2 } : props.style;
1411
- return /* @__PURE__ */ jsxRuntime.jsx(
1412
- LucideComp,
1413
- {
1414
- className: props.className,
1415
- strokeWidth: stroke,
1416
- style,
1417
- size: props.size
1418
- }
1419
- );
1420
- };
1421
- Adapter.displayName = `Lucide.${name}${isFallback ? ".fallback" : ""}`;
1288
+ const Adapter = (props) => /* @__PURE__ */ jsxRuntime.jsx(
1289
+ LucideComp,
1290
+ {
1291
+ className: props.className,
1292
+ strokeWidth: props.strokeWidth,
1293
+ style: props.style,
1294
+ size: props.size
1295
+ }
1296
+ );
1297
+ Adapter.displayName = `Lucide.${name}`;
1422
1298
  return Adapter;
1423
1299
  }
1424
- function resolveIconForFamily(name, family) {
1425
- switch (family) {
1426
- case "lucide":
1427
- return makeLucideAdapter(name, false);
1428
- // Non-lucide families resolve to a lazy, Suspense-wrapped component that
1429
- // dynamic-imports the library on first render and falls back to lucide
1430
- // internally when the family lacks the icon (see lazyFamilyIcon).
1431
- case "phosphor-outline":
1432
- return resolvePhosphor(name, "regular", family);
1433
- case "phosphor-fill":
1434
- return resolvePhosphor(name, "fill", family);
1435
- case "phosphor-duotone":
1436
- return resolvePhosphor(name, "duotone", family);
1437
- case "tabler":
1438
- return resolveTabler(name, family);
1439
- case "fa-solid":
1440
- return resolveFa(name, family);
1441
- }
1442
- }
1443
- var DEFAULT_FAMILY, VALID_FAMILIES, cachedFamily, listeners, observer, libPromises, lucideAliases, phosphorAliases, tablerAliases, faAliases, warned;
1300
+ function resolveIconForFamily(name, _family) {
1301
+ return makeLucideAdapter(name);
1302
+ }
1303
+ var DEFAULT_FAMILY, VALID_FAMILIES, cachedFamily, listeners, observer, lucideAliases;
1444
1304
  var init_iconFamily = __esm({
1445
1305
  "lib/iconFamily.tsx"() {
1446
1306
  "use client";
1447
1307
  DEFAULT_FAMILY = "lucide";
1448
- VALID_FAMILIES = [
1449
- "lucide",
1450
- "phosphor-outline",
1451
- "phosphor-fill",
1452
- "phosphor-duotone",
1453
- "tabler",
1454
- "fa-solid"
1455
- ];
1308
+ VALID_FAMILIES = [DEFAULT_FAMILY];
1456
1309
  cachedFamily = null;
1457
1310
  listeners = /* @__PURE__ */ new Set();
1458
1311
  observer = null;
1459
- libPromises = /* @__PURE__ */ new Map();
1460
1312
  lucideAliases = {
1461
1313
  close: LucideIcons2__namespace.X,
1462
1314
  trash: LucideIcons2__namespace.Trash2,
@@ -1469,478 +1321,6 @@ var init_iconFamily = __esm({
1469
1321
  "sort-asc": LucideIcons2__namespace.ArrowUpNarrowWide,
1470
1322
  "sort-desc": LucideIcons2__namespace.ArrowDownNarrowWide
1471
1323
  };
1472
- phosphorAliases = {
1473
- // lucide name → phosphor PascalCase name
1474
- // Actions
1475
- plus: "Plus",
1476
- minus: "Minus",
1477
- x: "X",
1478
- check: "Check",
1479
- close: "X",
1480
- edit: "PencilSimple",
1481
- pencil: "PencilSimple",
1482
- trash: "Trash",
1483
- save: "FloppyDisk",
1484
- copy: "Copy",
1485
- share: "Share",
1486
- send: "PaperPlaneRight",
1487
- download: "DownloadSimple",
1488
- upload: "UploadSimple",
1489
- archive: "Archive",
1490
- refresh: "ArrowsClockwise",
1491
- loader: "CircleNotch",
1492
- link: "Link",
1493
- paperclip: "Paperclip",
1494
- // Navigation
1495
- "chevron-down": "CaretDown",
1496
- "chevron-up": "CaretUp",
1497
- "chevron-left": "CaretLeft",
1498
- "chevron-right": "CaretRight",
1499
- "arrow-up": "ArrowUp",
1500
- "arrow-down": "ArrowDown",
1501
- "arrow-left": "ArrowLeft",
1502
- "arrow-right": "ArrowRight",
1503
- menu: "List",
1504
- more: "DotsThree",
1505
- "more-vertical": "DotsThreeVertical",
1506
- "more-horizontal": "DotsThree",
1507
- external: "ArrowSquareOut",
1508
- "external-link": "ArrowSquareOut",
1509
- // Files
1510
- file: "File",
1511
- "file-text": "FileText",
1512
- "file-plus": "FilePlus",
1513
- "file-minus": "FileMinus",
1514
- folder: "Folder",
1515
- "folder-open": "FolderOpen",
1516
- document: "FileText",
1517
- // Charts
1518
- "bar-chart": "ChartBar",
1519
- "bar-chart-2": "ChartBar",
1520
- "bar-chart-3": "ChartBar",
1521
- "line-chart": "ChartLine",
1522
- "pie-chart": "ChartPie",
1523
- activity: "Pulse",
1524
- "trending-up": "TrendUp",
1525
- "trending-down": "TrendDown",
1526
- // Messages
1527
- message: "ChatCircle",
1528
- "message-circle": "ChatCircle",
1529
- "message-square": "ChatText",
1530
- "messages-square": "ChatsCircle",
1531
- comment: "ChatCircle",
1532
- comments: "ChatsCircle",
1533
- inbox: "Tray",
1534
- mail: "Envelope",
1535
- envelope: "Envelope",
1536
- // Status
1537
- "alert-circle": "WarningCircle",
1538
- "alert-triangle": "Warning",
1539
- "check-circle": "CheckCircle",
1540
- "x-circle": "XCircle",
1541
- info: "Info",
1542
- "help-circle": "Question",
1543
- "life-buoy": "Lifebuoy",
1544
- lifebuoy: "Lifebuoy",
1545
- warning: "Warning",
1546
- error: "WarningCircle",
1547
- // Media
1548
- image: "Image",
1549
- video: "VideoCamera",
1550
- film: "FilmStrip",
1551
- camera: "Camera",
1552
- music: "MusicNote",
1553
- play: "Play",
1554
- pause: "Pause",
1555
- stop: "Stop",
1556
- "skip-forward": "SkipForward",
1557
- "skip-back": "SkipBack",
1558
- volume: "SpeakerHigh",
1559
- "volume-2": "SpeakerHigh",
1560
- "volume-x": "SpeakerX",
1561
- mic: "Microphone",
1562
- "mic-off": "MicrophoneSlash",
1563
- // People
1564
- user: "User",
1565
- users: "Users",
1566
- "user-plus": "UserPlus",
1567
- "user-check": "UserCheck",
1568
- // Time
1569
- calendar: "Calendar",
1570
- clock: "Clock",
1571
- timer: "Timer",
1572
- // Location
1573
- map: "MapTrifold",
1574
- "map-pin": "MapPin",
1575
- navigation: "NavigationArrow",
1576
- compass: "Compass",
1577
- globe: "Globe",
1578
- target: "Target",
1579
- // Project / layout
1580
- kanban: "Kanban",
1581
- list: "List",
1582
- table: "Table",
1583
- grid: "GridFour",
1584
- layout: "Layout",
1585
- columns: "Columns",
1586
- rows: "Rows",
1587
- // Misc
1588
- bell: "Bell",
1589
- bookmark: "Bookmark",
1590
- briefcase: "Briefcase",
1591
- flag: "Flag",
1592
- tag: "Tag",
1593
- tags: "Tag",
1594
- star: "Star",
1595
- heart: "Heart",
1596
- home: "House",
1597
- settings: "Gear",
1598
- eye: "Eye",
1599
- "eye-off": "EyeSlash",
1600
- lock: "Lock",
1601
- unlock: "LockOpen",
1602
- key: "Key",
1603
- shield: "Shield",
1604
- search: "MagnifyingGlass",
1605
- filter: "Funnel",
1606
- "sort-asc": "SortAscending",
1607
- "sort-desc": "SortDescending",
1608
- zap: "Lightning",
1609
- sparkles: "Sparkle",
1610
- // Code
1611
- code: "Code",
1612
- terminal: "Terminal",
1613
- database: "Database",
1614
- server: "HardDrives",
1615
- cloud: "Cloud",
1616
- wifi: "WifiHigh",
1617
- package: "Package",
1618
- box: "Package",
1619
- // Theme
1620
- sun: "Sun",
1621
- moon: "Moon",
1622
- // Phone
1623
- phone: "Phone",
1624
- printer: "Printer",
1625
- // Hierarchy
1626
- tree: "Tree",
1627
- network: "Network"
1628
- };
1629
- tablerAliases = {
1630
- // lucide name → tabler suffix (after the `Icon` prefix)
1631
- // Actions
1632
- plus: "Plus",
1633
- minus: "Minus",
1634
- x: "X",
1635
- check: "Check",
1636
- close: "X",
1637
- edit: "Pencil",
1638
- pencil: "Pencil",
1639
- trash: "Trash",
1640
- save: "DeviceFloppy",
1641
- copy: "Copy",
1642
- share: "Share",
1643
- send: "Send",
1644
- download: "Download",
1645
- upload: "Upload",
1646
- archive: "Archive",
1647
- refresh: "Refresh",
1648
- loader: "Loader2",
1649
- link: "Link",
1650
- paperclip: "Paperclip",
1651
- external: "ExternalLink",
1652
- "external-link": "ExternalLink",
1653
- // Navigation
1654
- "chevron-down": "ChevronDown",
1655
- "chevron-up": "ChevronUp",
1656
- "chevron-left": "ChevronLeft",
1657
- "chevron-right": "ChevronRight",
1658
- "arrow-down": "ArrowDown",
1659
- "arrow-up": "ArrowUp",
1660
- "arrow-left": "ArrowLeft",
1661
- "arrow-right": "ArrowRight",
1662
- menu: "Menu2",
1663
- more: "Dots",
1664
- "more-vertical": "DotsVertical",
1665
- // Files
1666
- file: "File",
1667
- "file-text": "FileText",
1668
- "file-plus": "FilePlus",
1669
- "file-check": "FileCheck",
1670
- "file-minus": "FileMinus",
1671
- folder: "Folder",
1672
- "folder-open": "FolderOpen",
1673
- document: "FileText",
1674
- // Charts
1675
- "bar-chart": "ChartBar",
1676
- "bar-chart-2": "ChartBar",
1677
- "bar-chart-3": "ChartBar",
1678
- "line-chart": "ChartLine",
1679
- "pie-chart": "ChartPie",
1680
- activity: "Activity",
1681
- "trending-up": "TrendingUp",
1682
- "trending-down": "TrendingDown",
1683
- // Messages
1684
- message: "Message",
1685
- "message-circle": "MessageCircle",
1686
- "message-square": "Message2",
1687
- "messages-square": "Messages",
1688
- comment: "Message",
1689
- comments: "Messages",
1690
- inbox: "Inbox",
1691
- mail: "Mail",
1692
- envelope: "Mail",
1693
- // Status
1694
- "alert-circle": "AlertCircle",
1695
- "alert-triangle": "AlertTriangle",
1696
- "check-circle": "CircleCheck",
1697
- "x-circle": "CircleX",
1698
- info: "InfoCircle",
1699
- "help-circle": "HelpCircle",
1700
- "life-buoy": "Lifebuoy",
1701
- warning: "AlertTriangle",
1702
- error: "AlertOctagon",
1703
- // Media
1704
- image: "Photo",
1705
- video: "Video",
1706
- camera: "Camera",
1707
- music: "Music",
1708
- play: "PlayerPlay",
1709
- pause: "PlayerPause",
1710
- stop: "PlayerStop",
1711
- "skip-forward": "PlayerSkipForward",
1712
- "skip-back": "PlayerSkipBack",
1713
- volume: "Volume",
1714
- "volume-2": "Volume",
1715
- "volume-x": "VolumeOff",
1716
- mic: "Microphone",
1717
- "mic-off": "MicrophoneOff",
1718
- // People
1719
- user: "User",
1720
- users: "Users",
1721
- "user-plus": "UserPlus",
1722
- "user-check": "UserCheck",
1723
- // Time
1724
- calendar: "Calendar",
1725
- clock: "Clock",
1726
- timer: "Hourglass",
1727
- // Location
1728
- map: "Map",
1729
- "map-pin": "MapPin",
1730
- navigation: "Navigation",
1731
- compass: "Compass",
1732
- globe: "World",
1733
- target: "Target",
1734
- // Project / layout
1735
- kanban: "LayoutKanban",
1736
- list: "List",
1737
- table: "Table",
1738
- grid: "LayoutGrid",
1739
- layout: "Layout",
1740
- columns: "LayoutColumns",
1741
- rows: "LayoutRows",
1742
- // Misc
1743
- bell: "Bell",
1744
- bookmark: "Bookmark",
1745
- briefcase: "Briefcase",
1746
- flag: "Flag",
1747
- tag: "Tag",
1748
- tags: "Tags",
1749
- star: "Star",
1750
- heart: "Heart",
1751
- home: "Home",
1752
- settings: "Settings",
1753
- eye: "Eye",
1754
- "eye-off": "EyeOff",
1755
- lock: "Lock",
1756
- unlock: "LockOpen",
1757
- key: "Key",
1758
- shield: "Shield",
1759
- search: "Search",
1760
- filter: "Filter",
1761
- "sort-asc": "SortAscending",
1762
- "sort-desc": "SortDescending",
1763
- zap: "Bolt",
1764
- sparkles: "Sparkles",
1765
- // Code / data
1766
- code: "Code",
1767
- terminal: "Terminal",
1768
- database: "Database",
1769
- server: "Server",
1770
- cloud: "Cloud",
1771
- wifi: "Wifi",
1772
- package: "Package",
1773
- box: "Box",
1774
- // Theme
1775
- sun: "Sun",
1776
- moon: "Moon",
1777
- // Phone
1778
- phone: "Phone",
1779
- printer: "Printer",
1780
- // Hierarchy
1781
- tree: "Hierarchy",
1782
- network: "Network"
1783
- };
1784
- faAliases = {
1785
- // lucide name → fa-solid suffix (after the `Fa` prefix).
1786
- // react-icons/fa ships FontAwesome 5 — names like `FaFileText` don't exist
1787
- // (FA renamed to `FaFileAlt`). When you see a console.warn from
1788
- // [iconFamily] about an unmapped lucide name in this family, add the
1789
- // closest FA5 sibling here so the fallback stays in-family.
1790
- search: "Search",
1791
- close: "Times",
1792
- x: "Times",
1793
- loader: "Spinner",
1794
- refresh: "Sync",
1795
- "sort-asc": "SortAmountUp",
1796
- "sort-desc": "SortAmountDown",
1797
- "chevron-down": "ChevronDown",
1798
- "chevron-up": "ChevronUp",
1799
- "chevron-left": "ChevronLeft",
1800
- "chevron-right": "ChevronRight",
1801
- "help-circle": "QuestionCircle",
1802
- "alert-triangle": "ExclamationTriangle",
1803
- "alert-circle": "ExclamationCircle",
1804
- "check-circle": "CheckCircle",
1805
- "x-circle": "TimesCircle",
1806
- edit: "Edit",
1807
- pencil: "PencilAlt",
1808
- trash: "Trash",
1809
- send: "PaperPlane",
1810
- share: "ShareAlt",
1811
- external: "ExternalLinkAlt",
1812
- plus: "Plus",
1813
- minus: "Minus",
1814
- check: "Check",
1815
- star: "Star",
1816
- heart: "Heart",
1817
- home: "Home",
1818
- user: "User",
1819
- users: "Users",
1820
- "user-plus": "UserPlus",
1821
- "user-check": "UserCheck",
1822
- settings: "Cog",
1823
- menu: "Bars",
1824
- "arrow-up": "ArrowUp",
1825
- "arrow-down": "ArrowDown",
1826
- "arrow-left": "ArrowLeft",
1827
- "arrow-right": "ArrowRight",
1828
- copy: "Copy",
1829
- download: "Download",
1830
- upload: "Upload",
1831
- filter: "Filter",
1832
- calendar: "Calendar",
1833
- clock: "Clock",
1834
- bell: "Bell",
1835
- mail: "Envelope",
1836
- envelope: "Envelope",
1837
- lock: "Lock",
1838
- unlock: "LockOpen",
1839
- eye: "Eye",
1840
- "eye-off": "EyeSlash",
1841
- more: "EllipsisH",
1842
- "more-vertical": "EllipsisV",
1843
- info: "InfoCircle",
1844
- warning: "ExclamationTriangle",
1845
- error: "ExclamationCircle",
1846
- // Time
1847
- timer: "Hourglass",
1848
- // Files (FA renamed FileText → FileAlt)
1849
- file: "File",
1850
- "file-text": "FileAlt",
1851
- "file-plus": "FileMedical",
1852
- "file-minus": "FileExcel",
1853
- "file-check": "FileSignature",
1854
- document: "FileAlt",
1855
- // Charts (lucide BarChart2 / BarChart3 → FA ChartBar)
1856
- "bar-chart": "ChartBar",
1857
- "bar-chart-2": "ChartBar",
1858
- "bar-chart-3": "ChartBar",
1859
- "line-chart": "ChartLine",
1860
- "pie-chart": "ChartPie",
1861
- activity: "ChartLine",
1862
- "trending-up": "ChartLine",
1863
- "trending-down": "ChartLine",
1864
- // Messages (lucide MessageCircle/MessageSquare → FA CommentDots/CommentAlt)
1865
- message: "Comment",
1866
- "message-circle": "CommentDots",
1867
- "message-square": "CommentAlt",
1868
- "messages-square": "Comments",
1869
- comment: "Comment",
1870
- comments: "Comments",
1871
- inbox: "Inbox",
1872
- // Support / help
1873
- "life-buoy": "LifeRing",
1874
- lifebuoy: "LifeRing",
1875
- // Project / kanban (FA has no kanban; closest semantic is Tasks/Columns)
1876
- kanban: "Tasks",
1877
- columns: "Columns",
1878
- rows: "Bars",
1879
- layout: "ThLarge",
1880
- grid: "Th",
1881
- list: "List",
1882
- table: "Table",
1883
- // Storage / folders
1884
- folder: "Folder",
1885
- "folder-open": "FolderOpen",
1886
- archive: "Archive",
1887
- bookmark: "Bookmark",
1888
- briefcase: "Briefcase",
1889
- package: "Box",
1890
- box: "Box",
1891
- // Map / location
1892
- map: "Map",
1893
- "map-pin": "MapMarkerAlt",
1894
- navigation: "LocationArrow",
1895
- compass: "Compass",
1896
- globe: "Globe",
1897
- target: "Bullseye",
1898
- // Media
1899
- image: "Image",
1900
- video: "Video",
1901
- film: "Film",
1902
- camera: "Camera",
1903
- music: "Music",
1904
- play: "Play",
1905
- pause: "Pause",
1906
- stop: "Stop",
1907
- "skip-forward": "Forward",
1908
- "skip-back": "Backward",
1909
- volume: "VolumeUp",
1910
- "volume-2": "VolumeUp",
1911
- "volume-x": "VolumeMute",
1912
- mic: "Microphone",
1913
- "mic-off": "MicrophoneSlash",
1914
- phone: "Phone",
1915
- // Code / data
1916
- code: "Code",
1917
- terminal: "Terminal",
1918
- database: "Database",
1919
- server: "Server",
1920
- cloud: "Cloud",
1921
- wifi: "Wifi",
1922
- // Security
1923
- shield: "ShieldAlt",
1924
- key: "Key",
1925
- // Misc actions
1926
- printer: "Print",
1927
- save: "Save",
1928
- link: "Link",
1929
- unlink: "Unlink",
1930
- paperclip: "Paperclip",
1931
- flag: "Flag",
1932
- tag: "Tag",
1933
- tags: "Tags",
1934
- zap: "Bolt",
1935
- sparkles: "Magic",
1936
- // Theme
1937
- sun: "Sun",
1938
- moon: "Moon",
1939
- // Hierarchy (FA has no Tree icon for hierarchies; Sitemap is the org-chart icon)
1940
- tree: "Sitemap",
1941
- network: "NetworkWired"
1942
- };
1943
- warned = /* @__PURE__ */ new Set();
1944
1324
  }
1945
1325
  });
1946
1326
  function kebabToPascal2(name) {
@@ -2021,7 +1401,7 @@ var init_Icon = __esm({
2021
1401
  const family = useIconFamily();
2022
1402
  const RenderedComponent = React73__namespace.default.useMemo(() => {
2023
1403
  if (directIcon) return null;
2024
- return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
1404
+ return effectiveName ? resolveIconForFamily(effectiveName) : null;
2025
1405
  }, [directIcon, effectiveName, family]);
2026
1406
  const effectiveStrokeWidth = strokeWidth ?? void 0;
2027
1407
  const inlineStyle = {
@@ -2400,7 +1780,7 @@ var init_Button = __esm({
2400
1780
  ref,
2401
1781
  disabled: disabled || isLoading,
2402
1782
  className: cn(
2403
- "inline-flex items-center justify-center gap-2",
1783
+ "relative inline-flex items-center justify-center gap-2",
2404
1784
  "font-medium",
2405
1785
  "rounded-sm",
2406
1786
  "cursor-pointer",
@@ -2445,6 +1825,7 @@ var init_Input = __esm({
2445
1825
  icon: iconProp,
2446
1826
  clearable,
2447
1827
  onClear,
1828
+ action,
2448
1829
  value,
2449
1830
  options,
2450
1831
  rows: rows2 = 3,
@@ -2494,6 +1875,11 @@ var init_Input = __esm({
2494
1875
  onClear?.();
2495
1876
  }
2496
1877
  };
1878
+ const handleKeyDown = (e) => {
1879
+ if (action && e.key === "Enter") {
1880
+ eventBus.emit(`UI:${action}`, { value: e.currentTarget.value });
1881
+ }
1882
+ };
2497
1883
  const wrapField = (field) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", children: [
2498
1884
  label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-foreground mb-1", children: label }),
2499
1885
  field,
@@ -2567,6 +1953,7 @@ var init_Input = __esm({
2567
1953
  type,
2568
1954
  value,
2569
1955
  onChange: handleChange,
1956
+ onKeyDown: handleKeyDown,
2570
1957
  className: baseClassName,
2571
1958
  ...props
2572
1959
  }
@@ -3192,7 +2579,7 @@ var init_Badge = __esm({
3192
2579
  });
3193
2580
  function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
3194
2581
  const px = typeof size === "number" ? size : sizeMap[size];
3195
- const family = useIconFamily();
2582
+ useIconFamily();
3196
2583
  if (assetUrl?.url) {
3197
2584
  return /* @__PURE__ */ jsxRuntime.jsx(
3198
2585
  AtlasImage,
@@ -3204,7 +2591,7 @@ function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
3204
2591
  }
3205
2592
  );
3206
2593
  }
3207
- const I = typeof icon === "string" ? resolveIconForFamily(icon, family) : icon;
2594
+ const I = typeof icon === "string" ? resolveIconForFamily(icon) : icon;
3208
2595
  return /* @__PURE__ */ jsxRuntime.jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
3209
2596
  }
3210
2597
  var sizeMap;
@@ -7445,21 +6832,6 @@ var init_renderer = __esm({
7445
6832
  init_slot_definitions();
7446
6833
  }
7447
6834
  });
7448
-
7449
- // lib/wrapCallbackForEvent.ts
7450
- function wrapCallbackForEvent(qualifiedEvent, callbackArgs, emit) {
7451
- const argNames = (callbackArgs ?? []).map((a) => a.name);
7452
- if (argNames.length === 0) {
7453
- return () => emit(qualifiedEvent);
7454
- }
7455
- return (...args) => {
7456
- const payload = {};
7457
- for (let i = 0; i < argNames.length; i += 1) {
7458
- payload[argNames[i]] = args[i];
7459
- }
7460
- emit(qualifiedEvent, payload);
7461
- };
7462
- }
7463
6835
  var init_wrapCallbackForEvent = __esm({
7464
6836
  "lib/wrapCallbackForEvent.ts"() {
7465
6837
  }
@@ -15813,9 +15185,9 @@ var init_isometric = __esm({
15813
15185
  // lib/drawable/projector.ts
15814
15186
  function create2DProjector(opts) {
15815
15187
  const { scale, baseOffsetX, layout } = opts;
15816
- const tileWidth = exports.TILE_WIDTH * scale;
15817
- const floorHeight = exports.FLOOR_HEIGHT * scale;
15818
- const diamondTopY = (opts.diamondTopY ?? exports.DIAMOND_TOP_Y) * scale;
15188
+ const tileWidth = layout === "free" ? 1 : exports.TILE_WIDTH * scale;
15189
+ const floorHeight = layout === "free" ? 1 : exports.FLOOR_HEIGHT * scale;
15190
+ const diamondTopY = layout === "free" ? 0 : (opts.diamondTopY ?? exports.DIAMOND_TOP_Y) * scale;
15819
15191
  const squareGrid = layout === "flat" || layout === "free";
15820
15192
  const project = (pos) => layout === "free" ? { x: pos.x, y: pos.y } : isoToScreen(pos.x, pos.y, scale, baseOffsetX, layout);
15821
15193
  const anchorPoint = (pos, anchor) => {
@@ -15856,6 +15228,15 @@ var init_projector = __esm({
15856
15228
  }
15857
15229
  });
15858
15230
 
15231
+ // lib/drawable/contract.ts
15232
+ function isValidScenePos(pos) {
15233
+ return Number.isFinite(pos?.x) && Number.isFinite(pos?.y);
15234
+ }
15235
+ var init_contract = __esm({
15236
+ "lib/drawable/contract.ts"() {
15237
+ }
15238
+ });
15239
+
15859
15240
  // components/game/atoms/DrawSprite.tsx
15860
15241
  function DrawSprite(_props) {
15861
15242
  return null;
@@ -15865,10 +15246,12 @@ var init_DrawSprite = __esm({
15865
15246
  "components/game/atoms/DrawSprite.tsx"() {
15866
15247
  "use client";
15867
15248
  init_atlasSlice();
15249
+ init_contract();
15868
15250
  paintSprite = (painter, node, dctx) => {
15251
+ if (!node.asset?.url || !isValidScenePos(node.position)) return;
15869
15252
  const tex = painter.resolveTexture(node.asset.url);
15870
15253
  if (!tex) return;
15871
- let src = node.frame;
15254
+ let src = typeof node.frame === "object" ? node.frame : void 0;
15872
15255
  if (!src && isAtlasAsset(node.asset)) {
15873
15256
  const atlas = getAtlas(node.asset.atlas, dctx.invalidate);
15874
15257
  if (!atlas) return;
@@ -15913,7 +15296,9 @@ var paintShape;
15913
15296
  var init_DrawShape = __esm({
15914
15297
  "components/game/atoms/DrawShape.tsx"() {
15915
15298
  "use client";
15299
+ init_contract();
15916
15300
  paintShape = (painter, node, dctx) => {
15301
+ if (!isValidScenePos(node.position)) return;
15917
15302
  painter.save();
15918
15303
  if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
15919
15304
  switch (node.shape) {
@@ -15967,7 +15352,9 @@ var paintText;
15967
15352
  var init_DrawText = __esm({
15968
15353
  "components/game/atoms/DrawText.tsx"() {
15969
15354
  "use client";
15355
+ init_contract();
15970
15356
  paintText = (painter, node, dctx) => {
15357
+ if (!isValidScenePos(node.position)) return;
15971
15358
  const p = dctx.projector.anchorPoint(node.position, node.anchor ?? "center");
15972
15359
  const x = p.x + (node.offsetX ?? 0);
15973
15360
  const y = p.y + (node.offsetY ?? 0);
@@ -16072,12 +15459,14 @@ function collectDrawnItems(nodes) {
16072
15459
  case "draw-sprite":
16073
15460
  case "draw-shape":
16074
15461
  case "draw-text":
16075
- out.push({ pos: n.position, id: n.id });
15462
+ if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
16076
15463
  break;
16077
15464
  case "draw-sprite-layer":
16078
15465
  case "draw-shape-layer":
16079
15466
  case "draw-text-layer":
16080
- for (const it of n.items) out.push({ pos: it.position, id: it.id });
15467
+ for (const it of n.items) {
15468
+ if (isValidScenePos(it.position)) out.push({ pos: it.position, id: it.id });
15469
+ }
16081
15470
  break;
16082
15471
  }
16083
15472
  }
@@ -16092,6 +15481,7 @@ function buildHitIndex(items) {
16092
15481
  }
16093
15482
  var init_hitTest = __esm({
16094
15483
  "lib/drawable/hitTest.ts"() {
15484
+ init_contract();
16095
15485
  }
16096
15486
  });
16097
15487
  function normalizeBackdrop(bg) {
@@ -16117,14 +15507,16 @@ function Canvas2D({
16117
15507
  cameraPos,
16118
15508
  bgColor
16119
15509
  }) {
15510
+ const instanceId = React73.useMemo(() => Math.random().toString(36).slice(2, 8), []);
15511
+ function isDrawableLayer(node) {
15512
+ return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
15513
+ }
16120
15514
  const layerSummaries = drawables?.map((d) => {
16121
- if (!d || typeof d !== "object") return d;
16122
- const rec = d;
16123
- return { type: rec.type, itemsLen: Array.isArray(rec.items) ? rec.items.length : void 0, firstItem: Array.isArray(rec.items) ? rec.items[0] : void 0 };
15515
+ if (!isDrawableLayer(d)) return { type: d.type };
15516
+ return { type: d.type, itemsLen: d.items.length, firstItem: d.items[0] };
16124
15517
  });
16125
- console.error("[debug:Canvas2D] " + JSON.stringify({ projection, scale, cameraMode: camera, cameraPos, drawablesCount: drawables?.length, layerSummaries }));
15518
+ 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 });
16126
15519
  const backgroundImage = normalizeBackdrop(backgroundImageRaw);
16127
- const instanceId = React73.useMemo(() => Math.random().toString(36).slice(2, 8), []);
16128
15520
  const isFree = projection === "free";
16129
15521
  const squareGrid = projection === "flat" || isFree || projection === "side";
16130
15522
  const layout = projection === "side" ? "free" : projection;
@@ -16259,7 +15651,7 @@ function Canvas2D({
16259
15651
  }
16260
15652
  const containerRect = containerRef.current?.getBoundingClientRect();
16261
15653
  const canvasRect = canvas.getBoundingClientRect();
16262
- 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 }));
15654
+ 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 });
16263
15655
  const painter = createWebPainter(ctx, bumpAtlas);
16264
15656
  painter.save();
16265
15657
  painter.translate(viewportSize.width / 2, viewportSize.height / 2);
@@ -16471,6 +15863,7 @@ function Canvas2D({
16471
15863
  }
16472
15864
  );
16473
15865
  }
15866
+ var canvas2DLog;
16474
15867
  var init_Canvas2D = __esm({
16475
15868
  "components/game/molecules/Canvas2D.tsx"() {
16476
15869
  "use client";
@@ -16492,6 +15885,7 @@ var init_Canvas2D = __esm({
16492
15885
  init_paintDispatch();
16493
15886
  init_hitTest();
16494
15887
  init_isometric();
15888
+ canvas2DLog = logger.createLogger("almadar:ui:game-canvas");
16495
15889
  Canvas2D.displayName = "Canvas2D";
16496
15890
  }
16497
15891
  });
@@ -16530,7 +15924,7 @@ function Canvas({
16530
15924
  keyMap,
16531
15925
  keyUpMap
16532
15926
  }) {
16533
- console.error("[debug:Canvas] " + JSON.stringify({ mode, drawablesCount: drawables?.length, projection, camera }));
15927
+ canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
16534
15928
  const zoom = camera?.zoom;
16535
15929
  if (mode === "3d") {
16536
15930
  const props3d = {
@@ -16583,7 +15977,7 @@ function Canvas({
16583
15977
  }
16584
15978
  );
16585
15979
  }
16586
- var Canvas3DHost;
15980
+ var Canvas3DHost, canvasLog;
16587
15981
  var init_Canvas = __esm({
16588
15982
  "components/game/molecules/Canvas.tsx"() {
16589
15983
  "use client";
@@ -16591,6 +15985,7 @@ var init_Canvas = __esm({
16591
15985
  Canvas3DHost = React73.lazy(
16592
15986
  () => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
16593
15987
  );
15988
+ canvasLog = logger.createLogger("almadar:ui:game-canvas");
16594
15989
  Canvas.displayName = "Canvas";
16595
15990
  }
16596
15991
  });
@@ -20812,7 +20207,8 @@ function DataGrid({
20812
20207
  const { t } = hooks.useTranslate();
20813
20208
  const [selectedIds, setSelectedIds] = React73.useState(/* @__PURE__ */ new Set());
20814
20209
  const [visibleCount, setVisibleCount] = React73.useState(pageSize || Infinity);
20815
- const fieldDefs = fields ?? columns ?? [];
20210
+ const fieldDefs = (Array.isArray(fields) ? fields : void 0) ?? (Array.isArray(columns) ? columns : void 0) ?? [];
20211
+ const actionDefs = Array.isArray(itemActions) ? itemActions : [];
20816
20212
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
20817
20213
  const dnd = useDataDnd({
20818
20214
  items: allDataRaw,
@@ -20856,8 +20252,8 @@ function DataGrid({
20856
20252
  const titleField = fieldDefs.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fieldDefs[0];
20857
20253
  const badgeFields = fieldDefs.filter((f3) => f3.variant === "badge" && f3 !== titleField);
20858
20254
  const bodyFields = fieldDefs.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
20859
- const primaryActions = itemActions?.filter((a) => a.variant !== "danger") ?? [];
20860
- const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
20255
+ const primaryActions = actionDefs.filter((a) => a.variant !== "danger");
20256
+ const dangerActions = actionDefs.filter((a) => a.variant === "danger");
20861
20257
  const handleActionClick = (action, itemData) => (e) => {
20862
20258
  e.stopPropagation();
20863
20259
  const payload = {
@@ -37234,7 +36630,7 @@ function measureLabelWidth(text) {
37234
36630
  if (typeof document === "undefined") return text.length * 6;
37235
36631
  if (!labelMeasureCtx) labelMeasureCtx = document.createElement("canvas").getContext("2d");
37236
36632
  if (!labelMeasureCtx) return text.length * 6;
37237
- labelMeasureCtx.font = "10px system-ui";
36633
+ labelMeasureCtx.font = "12px system-ui";
37238
36634
  return labelMeasureCtx.measureText(text).width;
37239
36635
  }
37240
36636
  function getGroupColor(group, groups) {
@@ -37280,6 +36676,7 @@ var init_GraphCanvas = __esm({
37280
36676
  actions,
37281
36677
  onNodeClick,
37282
36678
  onNodeDoubleClick,
36679
+ onBadgeClick,
37283
36680
  nodeClickEvent,
37284
36681
  selectedNodeId,
37285
36682
  repulsion = 800,
@@ -37427,7 +36824,9 @@ var init_GraphCanvas = __esm({
37427
36824
  const dx = target.x - source.x;
37428
36825
  const dy = target.y - source.y;
37429
36826
  const dist = Math.sqrt(dx * dx + dy * dy) || 1;
37430
- const force = (dist - linkDistance) * 0.05;
36827
+ const w2 = edge.weight ?? 1;
36828
+ const linkTarget = linkDistance * (1 + (1 - Math.min(1, Math.max(0, w2))) * 1.5);
36829
+ const force = (dist - linkTarget) * 0.05;
37431
36830
  const fx = dx / dist * force;
37432
36831
  const fy = dy / dist * force;
37433
36832
  source.fx += fx;
@@ -37449,7 +36848,7 @@ var init_GraphCanvas = __esm({
37449
36848
  node.y = Math.max(30, Math.min(h - 30, node.y));
37450
36849
  }
37451
36850
  const LABEL_GAP = 12;
37452
- const LABEL_H = 12;
36851
+ const LABEL_H = 16;
37453
36852
  const pad = nodeSpacing / 2;
37454
36853
  for (let i = 0; i < nodes.length; i++) {
37455
36854
  for (let j = i + 1; j < nodes.length; j++) {
@@ -37504,6 +36903,11 @@ var init_GraphCanvas = __esm({
37504
36903
  const h = height;
37505
36904
  const nodes = nodesRef.current;
37506
36905
  const accentColor = resolveColor3("var(--color-accent)", canvas);
36906
+ const fontFamily = resolveColor3("var(--font-family)", canvas) || "system-ui";
36907
+ const fgColor = resolveColor3("var(--color-foreground)", canvas);
36908
+ const mutedColor = resolveColor3("var(--color-muted-foreground)", canvas) || fgColor;
36909
+ const bgColor = resolveColor3("var(--color-background)", canvas) || "#ffffff";
36910
+ const accentFg = resolveColor3("var(--color-accent-foreground)", canvas) || "#ffffff";
37507
36911
  const dpr = typeof window !== "undefined" && window.devicePixelRatio || 1;
37508
36912
  ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
37509
36913
  ctx.clearRect(0, 0, w, h);
@@ -37523,19 +36927,21 @@ var init_GraphCanvas = __esm({
37523
36927
  const target = nodes.find((n) => n.id === edge.target);
37524
36928
  if (!source || !target) continue;
37525
36929
  const incident = !!hoveredNode && (edge.source === hoveredNode || edge.target === hoveredNode);
37526
- ctx.globalAlpha = hoveredNode ? incident ? 1 : 0.05 : linkOpacity;
36930
+ const w2 = edge.weight ?? 1;
36931
+ ctx.globalAlpha = hoveredNode ? incident ? 1 : 0.05 : linkOpacity * w2;
37527
36932
  ctx.beginPath();
37528
36933
  ctx.moveTo(source.x, source.y);
37529
36934
  ctx.lineTo(target.x, target.y);
37530
36935
  ctx.strokeStyle = incident ? accentColor : edge.color || "#888888";
37531
- ctx.lineWidth = incident ? 2 : edge.weight ? Math.max(1, edge.weight) : 1;
36936
+ ctx.lineWidth = incident ? 2 : Math.max(0.75, w2);
37532
36937
  ctx.stroke();
37533
36938
  if (edge.label && showLabels) {
37534
36939
  const mx = (source.x + target.x) / 2;
37535
36940
  const my = (source.y + target.y) / 2;
37536
- ctx.fillStyle = "#888888";
37537
- ctx.font = "9px system-ui";
36941
+ ctx.fillStyle = mutedColor;
36942
+ ctx.font = `9px ${fontFamily}`;
37538
36943
  ctx.textAlign = "center";
36944
+ ctx.textBaseline = "alphabetic";
37539
36945
  ctx.fillText(edge.label, mx, my - 4);
37540
36946
  }
37541
36947
  }
@@ -37560,10 +36966,33 @@ var init_GraphCanvas = __esm({
37560
36966
  }
37561
36967
  ctx.stroke();
37562
36968
  if (showLabels && node.label) {
37563
- ctx.fillStyle = "#666666";
37564
- ctx.font = `${isSelected || isHovered ? "bold " : ""}10px system-ui`;
36969
+ ctx.font = `${isSelected || isHovered ? "600" : "500"} 12px ${fontFamily}`;
37565
36970
  ctx.textAlign = "center";
37566
- ctx.fillText(node.label, node.x, node.y + radius + 12);
36971
+ ctx.textBaseline = "middle";
36972
+ const ly = node.y + radius + 14;
36973
+ ctx.lineWidth = 3;
36974
+ ctx.lineJoin = "round";
36975
+ ctx.strokeStyle = bgColor;
36976
+ ctx.strokeText(node.label, node.x, ly);
36977
+ ctx.fillStyle = isSelected || isHovered ? fgColor : mutedColor;
36978
+ ctx.fillText(node.label, node.x, ly);
36979
+ }
36980
+ if (node.badge && node.badge > 1) {
36981
+ const bx = node.x + radius * 0.7;
36982
+ const by = node.y - radius * 0.7;
36983
+ const br = Math.max(7, Math.min(11, radius * 0.45));
36984
+ ctx.beginPath();
36985
+ ctx.arc(bx, by, br, 0, Math.PI * 2);
36986
+ ctx.fillStyle = accentColor;
36987
+ ctx.fill();
36988
+ ctx.strokeStyle = bgColor;
36989
+ ctx.lineWidth = 2;
36990
+ ctx.stroke();
36991
+ ctx.fillStyle = accentFg;
36992
+ ctx.font = `600 9px ${fontFamily}`;
36993
+ ctx.textAlign = "center";
36994
+ ctx.textBaseline = "middle";
36995
+ ctx.fillText(String(node.badge), bx, by + 0.5);
37567
36996
  }
37568
36997
  }
37569
36998
  ctx.restore();
@@ -37656,11 +37085,21 @@ var init_GraphCanvas = __esm({
37656
37085
  if (!coords) return;
37657
37086
  const node = nodeAt(coords.graphX, coords.graphY);
37658
37087
  if (node) {
37088
+ if (node.badge && node.badge > 1 && onBadgeClick) {
37089
+ const r = (node.size || 8) + (selectedNodeId === node.id ? 4 : 0);
37090
+ const bx = node.x + r * 0.7;
37091
+ const by = node.y - r * 0.7;
37092
+ const br = Math.max(7, Math.min(11, r * 0.45)) + 3;
37093
+ if (Math.hypot(coords.graphX - bx, coords.graphY - by) <= br) {
37094
+ onBadgeClick(node);
37095
+ return;
37096
+ }
37097
+ }
37659
37098
  handleNodeClick(node);
37660
37099
  }
37661
37100
  }
37662
37101
  },
37663
- [toCoords, nodeAt, handleNodeClick]
37102
+ [toCoords, nodeAt, handleNodeClick, onBadgeClick, selectedNodeId]
37664
37103
  );
37665
37104
  const handlePointerLeave = React73.useCallback(() => {
37666
37105
  setHoveredNode(null);
@@ -45847,7 +45286,7 @@ function SlotContentRenderer({
45847
45286
  if (typeof propValue !== "string") continue;
45848
45287
  const propDef = propsSchema[propKey];
45849
45288
  if (!propDef || propDef.kind !== "callback") continue;
45850
- renderedProps[propKey] = wrapCallbackForEvent(
45289
+ renderedProps[propKey] = ui.wrapCallbackForEvent(
45851
45290
  `UI:${propValue}`,
45852
45291
  propDef.callbackArgs,
45853
45292
  (eventKey, payload) => eventBus.emit(eventKey, payload)