@almadar/ui 5.113.0 → 5.115.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) {
@@ -20772,7 +20162,8 @@ function DataGrid({
20772
20162
  const { t } = useTranslate();
20773
20163
  const [selectedIds, setSelectedIds] = useState(/* @__PURE__ */ new Set());
20774
20164
  const [visibleCount, setVisibleCount] = useState(pageSize || Infinity);
20775
- 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 : [];
20776
20167
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
20777
20168
  const dnd = useDataDnd({
20778
20169
  items: allDataRaw,
@@ -20816,8 +20207,8 @@ function DataGrid({
20816
20207
  const titleField = fieldDefs.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fieldDefs[0];
20817
20208
  const badgeFields = fieldDefs.filter((f3) => f3.variant === "badge" && f3 !== titleField);
20818
20209
  const bodyFields = fieldDefs.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
20819
- const primaryActions = itemActions?.filter((a) => a.variant !== "danger") ?? [];
20820
- 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");
20821
20212
  const handleActionClick = (action, itemData) => (e) => {
20822
20213
  e.stopPropagation();
20823
20214
  const payload = {
@@ -37194,7 +36585,7 @@ function measureLabelWidth(text) {
37194
36585
  if (typeof document === "undefined") return text.length * 6;
37195
36586
  if (!labelMeasureCtx) labelMeasureCtx = document.createElement("canvas").getContext("2d");
37196
36587
  if (!labelMeasureCtx) return text.length * 6;
37197
- labelMeasureCtx.font = "10px system-ui";
36588
+ labelMeasureCtx.font = "12px system-ui";
37198
36589
  return labelMeasureCtx.measureText(text).width;
37199
36590
  }
37200
36591
  function getGroupColor(group, groups) {
@@ -37240,6 +36631,7 @@ var init_GraphCanvas = __esm({
37240
36631
  actions,
37241
36632
  onNodeClick,
37242
36633
  onNodeDoubleClick,
36634
+ onBadgeClick,
37243
36635
  nodeClickEvent,
37244
36636
  selectedNodeId,
37245
36637
  repulsion = 800,
@@ -37357,7 +36749,7 @@ var init_GraphCanvas = __esm({
37357
36749
  nodesRef.current = simNodes;
37358
36750
  if (layout === "force") {
37359
36751
  let iterations = 0;
37360
- const maxIterations = 100;
36752
+ const maxIterations = 300;
37361
36753
  const tick = () => {
37362
36754
  const nodes = nodesRef.current;
37363
36755
  const centerX = w / 2;
@@ -37387,7 +36779,9 @@ var init_GraphCanvas = __esm({
37387
36779
  const dx = target.x - source.x;
37388
36780
  const dy = target.y - source.y;
37389
36781
  const dist = Math.sqrt(dx * dx + dy * dy) || 1;
37390
- const force = (dist - linkDistance) * 0.05;
36782
+ const w2 = Math.min(1, Math.max(0, edge.weight ?? 1));
36783
+ const linkTarget = linkDistance * (0.5 + (1 - w2) * 1.5);
36784
+ const force = (dist - linkTarget) * (0.04 + 0.1 * w2);
37391
36785
  const fx = dx / dist * force;
37392
36786
  const fy = dy / dist * force;
37393
36787
  source.fx += fx;
@@ -37395,9 +36789,27 @@ var init_GraphCanvas = __esm({
37395
36789
  target.fx -= fx;
37396
36790
  target.fy -= fy;
37397
36791
  }
36792
+ const centroids = /* @__PURE__ */ new Map();
37398
36793
  for (const node of nodes) {
37399
- node.fx += (centerX - node.x) * 0.01;
37400
- node.fy += (centerY - node.y) * 0.01;
36794
+ const g = node.group ?? "__none__";
36795
+ let c = centroids.get(g);
36796
+ if (!c) {
36797
+ c = { x: 0, y: 0, n: 0 };
36798
+ centroids.set(g, c);
36799
+ }
36800
+ c.x += node.x;
36801
+ c.y += node.y;
36802
+ c.n += 1;
36803
+ }
36804
+ for (const node of nodes) {
36805
+ const c = centroids.get(node.group ?? "__none__");
36806
+ if (c && c.n > 1) {
36807
+ node.fx += (c.x / c.n - node.x) * 0.04;
36808
+ node.fy += (c.y / c.n - node.y) * 0.04;
36809
+ } else {
36810
+ node.fx += (centerX - node.x) * 0.01;
36811
+ node.fy += (centerY - node.y) * 0.01;
36812
+ }
37401
36813
  }
37402
36814
  const damping = 0.9;
37403
36815
  for (const node of nodes) {
@@ -37409,7 +36821,7 @@ var init_GraphCanvas = __esm({
37409
36821
  node.y = Math.max(30, Math.min(h - 30, node.y));
37410
36822
  }
37411
36823
  const LABEL_GAP = 12;
37412
- const LABEL_H = 12;
36824
+ const LABEL_H = 16;
37413
36825
  const pad = nodeSpacing / 2;
37414
36826
  for (let i = 0; i < nodes.length; i++) {
37415
36827
  for (let j = i + 1; j < nodes.length; j++) {
@@ -37464,6 +36876,11 @@ var init_GraphCanvas = __esm({
37464
36876
  const h = height;
37465
36877
  const nodes = nodesRef.current;
37466
36878
  const accentColor = resolveColor3("var(--color-accent)", canvas);
36879
+ const fontFamily = resolveColor3("var(--font-family)", canvas) || "system-ui";
36880
+ const fgColor = resolveColor3("var(--color-foreground)", canvas);
36881
+ const mutedColor = resolveColor3("var(--color-muted-foreground)", canvas) || fgColor;
36882
+ const bgColor = resolveColor3("var(--color-background)", canvas) || "#ffffff";
36883
+ const accentFg = resolveColor3("var(--color-accent-foreground)", canvas) || "#ffffff";
37467
36884
  const dpr = typeof window !== "undefined" && window.devicePixelRatio || 1;
37468
36885
  ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
37469
36886
  ctx.clearRect(0, 0, w, h);
@@ -37483,19 +36900,21 @@ var init_GraphCanvas = __esm({
37483
36900
  const target = nodes.find((n) => n.id === edge.target);
37484
36901
  if (!source || !target) continue;
37485
36902
  const incident = !!hoveredNode && (edge.source === hoveredNode || edge.target === hoveredNode);
37486
- ctx.globalAlpha = hoveredNode ? incident ? 1 : 0.05 : linkOpacity;
36903
+ const w2 = edge.weight ?? 1;
36904
+ ctx.globalAlpha = hoveredNode ? incident ? 1 : 0.05 : linkOpacity * w2;
37487
36905
  ctx.beginPath();
37488
36906
  ctx.moveTo(source.x, source.y);
37489
36907
  ctx.lineTo(target.x, target.y);
37490
36908
  ctx.strokeStyle = incident ? accentColor : edge.color || "#888888";
37491
- ctx.lineWidth = incident ? 2 : edge.weight ? Math.max(1, edge.weight) : 1;
36909
+ ctx.lineWidth = incident ? 2 : Math.max(0.75, w2);
37492
36910
  ctx.stroke();
37493
36911
  if (edge.label && showLabels) {
37494
36912
  const mx = (source.x + target.x) / 2;
37495
36913
  const my = (source.y + target.y) / 2;
37496
- ctx.fillStyle = "#888888";
37497
- ctx.font = "9px system-ui";
36914
+ ctx.fillStyle = mutedColor;
36915
+ ctx.font = `9px ${fontFamily}`;
37498
36916
  ctx.textAlign = "center";
36917
+ ctx.textBaseline = "alphabetic";
37499
36918
  ctx.fillText(edge.label, mx, my - 4);
37500
36919
  }
37501
36920
  }
@@ -37520,10 +36939,33 @@ var init_GraphCanvas = __esm({
37520
36939
  }
37521
36940
  ctx.stroke();
37522
36941
  if (showLabels && node.label) {
37523
- ctx.fillStyle = "#666666";
37524
- ctx.font = `${isSelected || isHovered ? "bold " : ""}10px system-ui`;
36942
+ ctx.font = `${isSelected || isHovered ? "600" : "500"} 12px ${fontFamily}`;
37525
36943
  ctx.textAlign = "center";
37526
- ctx.fillText(node.label, node.x, node.y + radius + 12);
36944
+ ctx.textBaseline = "middle";
36945
+ const ly = node.y + radius + 14;
36946
+ ctx.lineWidth = 3;
36947
+ ctx.lineJoin = "round";
36948
+ ctx.strokeStyle = bgColor;
36949
+ ctx.strokeText(node.label, node.x, ly);
36950
+ ctx.fillStyle = isSelected || isHovered ? fgColor : mutedColor;
36951
+ ctx.fillText(node.label, node.x, ly);
36952
+ }
36953
+ if (node.badge && node.badge > 1) {
36954
+ const bx = node.x + radius * 0.7;
36955
+ const by = node.y - radius * 0.7;
36956
+ const br = Math.max(7, Math.min(11, radius * 0.45));
36957
+ ctx.beginPath();
36958
+ ctx.arc(bx, by, br, 0, Math.PI * 2);
36959
+ ctx.fillStyle = accentColor;
36960
+ ctx.fill();
36961
+ ctx.strokeStyle = bgColor;
36962
+ ctx.lineWidth = 2;
36963
+ ctx.stroke();
36964
+ ctx.fillStyle = accentFg;
36965
+ ctx.font = `600 9px ${fontFamily}`;
36966
+ ctx.textAlign = "center";
36967
+ ctx.textBaseline = "middle";
36968
+ ctx.fillText(String(node.badge), bx, by + 0.5);
37527
36969
  }
37528
36970
  }
37529
36971
  ctx.restore();
@@ -37616,11 +37058,21 @@ var init_GraphCanvas = __esm({
37616
37058
  if (!coords) return;
37617
37059
  const node = nodeAt(coords.graphX, coords.graphY);
37618
37060
  if (node) {
37061
+ if (node.badge && node.badge > 1 && onBadgeClick) {
37062
+ const r = (node.size || 8) + (selectedNodeId === node.id ? 4 : 0);
37063
+ const bx = node.x + r * 0.7;
37064
+ const by = node.y - r * 0.7;
37065
+ const br = Math.max(7, Math.min(11, r * 0.45)) + 3;
37066
+ if (Math.hypot(coords.graphX - bx, coords.graphY - by) <= br) {
37067
+ onBadgeClick(node);
37068
+ return;
37069
+ }
37070
+ }
37619
37071
  handleNodeClick(node);
37620
37072
  }
37621
37073
  }
37622
37074
  },
37623
- [toCoords, nodeAt, handleNodeClick]
37075
+ [toCoords, nodeAt, handleNodeClick, onBadgeClick, selectedNodeId]
37624
37076
  );
37625
37077
  const handlePointerLeave = useCallback(() => {
37626
37078
  setHoveredNode(null);