@likec4/diagram 1.3.0 → 1.4.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.
Files changed (44) hide show
  1. package/dist/LikeC4Diagram.d.ts +1 -1
  2. package/dist/LikeC4Diagram.props.d.ts +6 -1
  3. package/dist/index.mjs +270 -168
  4. package/dist/state/DiagramContext.d.ts +155 -154
  5. package/dist/state/diagramStore.d.ts +154 -154
  6. package/dist/state/index.d.ts +0 -1
  7. package/dist/state/useDiagramStore.d.ts +3 -4622
  8. package/dist/state/useNavigationHistory.d.ts +5 -0
  9. package/dist/style.css +86 -54
  10. package/dist/theme.css.d.ts +5 -0
  11. package/dist/ui/BackwardForwardPanel.css.d.ts +1 -0
  12. package/dist/ui/BackwardForwardPanel.d.ts +1 -0
  13. package/dist/ui/DiagramTitlePanel.css.d.ts +1 -1
  14. package/dist/ui/OptionsPanel.d.ts +1 -3
  15. package/dist/xyflow/XYFlowEvents.d.ts +4 -4
  16. package/dist/xyflow/XYFlowInner.d.ts +1 -0
  17. package/dist/xyflow/edges/RelationshipEdge.d.ts +1 -1
  18. package/dist/xyflow/hooks/useXYFlow.d.ts +9 -9
  19. package/dist/xyflow/nodes/element/element.css.d.ts +1 -0
  20. package/dist/xyflow/types.d.ts +1 -1
  21. package/package.json +10 -10
  22. package/src/LikeC4Diagram.css.ts +11 -1
  23. package/src/LikeC4Diagram.props.ts +10 -3
  24. package/src/LikeC4Diagram.tsx +30 -7
  25. package/src/globals.css.ts +1 -1
  26. package/src/state/DiagramContext.tsx +3 -3
  27. package/src/state/diagramStore.ts +27 -30
  28. package/src/state/index.ts +0 -1
  29. package/src/state/useDiagramStore.ts +6 -13
  30. package/src/state/useNavigationHistory.ts +39 -0
  31. package/src/theme.css.ts +5 -0
  32. package/src/ui/BackwardForwardPanel.css.ts +22 -0
  33. package/src/ui/BackwardForwardPanel.tsx +59 -0
  34. package/src/ui/DiagramTitlePanel.css.ts +11 -5
  35. package/src/ui/DiagramTitlePanel.tsx +105 -93
  36. package/src/ui/OptionsPanel.tsx +28 -19
  37. package/src/xyflow/XYFlowInner.tsx +5 -2
  38. package/src/xyflow/diagram-to-xyflow.ts +2 -13
  39. package/src/xyflow/edges/RelationshipEdge.tsx +11 -8
  40. package/src/xyflow/edges/edges.css.ts +14 -10
  41. package/src/xyflow/hooks/useLayoutConstraints.ts +2 -1
  42. package/src/xyflow/nodes/compound/CompoundNode.css.ts +8 -8
  43. package/src/xyflow/nodes/element/ElementNode.tsx +7 -8
  44. package/src/xyflow/nodes/element/element.css.ts +18 -5
@@ -0,0 +1,5 @@
1
+ export declare function useNavigationHistory(): {
2
+ hasBack: boolean;
3
+ hasForward: boolean;
4
+ ops: import('@mantine/hooks').UseStateHistoryHandlers<import('@likec4/core').ViewID>;
5
+ };
package/dist/style.css CHANGED
@@ -1274,6 +1274,11 @@ svg.react-flow__connectionline {
1274
1274
  }
1275
1275
  :where(._2h8g8h4, ._2h8g8h3) .react-flow__attribution {
1276
1276
  display: none;
1277
+ }
1278
+ @supports (hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none) {
1279
+ ._2h8g8h1 {
1280
+ --likec4-safari-animation-hook: ;
1281
+ }
1277
1282
  }@keyframes bexn7q6 {
1278
1283
  from {
1279
1284
  stroke-dashoffset: 36;
@@ -1313,7 +1318,7 @@ svg.react-flow__connectionline {
1313
1318
  opacity: 0.8;
1314
1319
  transition: opacity 600ms ease-in-out, filter 600ms ease-in-out;
1315
1320
  transition-delay: 200ms;
1316
- filter: grayscale(0.85) blur(1px);
1321
+ filter: grayscale(0.85) var(--likec4-safari-animation-hook, blur(1px));
1317
1322
  will-change: opacity, filter;
1318
1323
  }
1319
1324
  .bexn7q3 {
@@ -1356,20 +1361,25 @@ svg.react-flow__connectionline {
1356
1361
  animation-duration: 800ms;
1357
1362
  animation-iteration-count: infinite;
1358
1363
  animation-timing-function: linear;
1364
+ animation-name: bexn7q6;
1365
+ animation-play-state: paused;
1359
1366
  }
1360
1367
  :where([data-edge-hovered='true']) .bexn7q7 {
1361
- animation-name: bexn7q6;
1368
+ animation-play-state: running;
1362
1369
  animation-delay: 350ms;
1363
- transition: stroke,stroke-width 130ms ease-out;
1370
+ transition: stroke 130ms ease-out,stroke-width 130ms ease-out;
1364
1371
  }
1365
1372
  :where(.react-flow__edge.selected, [data-edge-active='true']) .bexn7q7 {
1366
- animation-name: bexn7q6;
1373
+ animation-play-state: running;
1367
1374
  animation-delay: 0ms;
1368
- transition: stroke,stroke-width 130ms ease-out;
1375
+ transition: stroke 130ms ease-out,stroke-width 130ms ease-out;
1369
1376
  }
1370
1377
  :where([data-edge-dir='back']) .bexn7q7 {
1371
1378
  animation-direction: reverse;
1372
1379
  }
1380
+ .bexn7q2 .bexn7q7 {
1381
+ animation-play-state: paused;
1382
+ }
1373
1383
  .bexn7qb {
1374
1384
  --bexn7qa: translate(var(--bexn7q8, -50%), var(--bexn7q9, -50%));
1375
1385
  top: 0;
@@ -1390,10 +1400,10 @@ svg.react-flow__connectionline {
1390
1400
  transform: var(--bexn7qa) scale(1.1);
1391
1401
  }
1392
1402
  .bexn7qb:is(.bexn7q2) {
1393
- opacity: 0.8;
1403
+ opacity: 0.6;
1394
1404
  transition: opacity 600ms ease-in-out, filter 600ms ease-in-out;
1395
1405
  transition-delay: 200ms;
1396
- filter: grayscale(0.85) blur(2px);
1406
+ filter: grayscale(0.85) var(--likec4-safari-animation-hook, blur(1px));
1397
1407
  will-change: opacity, filter;
1398
1408
  }
1399
1409
  .bexn7qc {
@@ -1440,7 +1450,7 @@ svg.react-flow__connectionline {
1440
1450
  opacity: 0.25;
1441
1451
  transition: opacity 600ms ease-in-out, filter 600ms ease-in-out;
1442
1452
  transition-delay: 200ms;
1443
- filter: grayscale(0.85) blur(1px);
1453
+ filter: grayscale(0.85) var(--likec4-safari-animation-hook, blur(1px));
1444
1454
  will-change: opacity, filter;
1445
1455
  }
1446
1456
  .lbtzdo4 {
@@ -1487,11 +1497,8 @@ svg.react-flow__connectionline {
1487
1497
  transition-delay: 200ms;
1488
1498
  opacity: calc(var(--lbtzdo2, 1) + var(--lbtzdo5));
1489
1499
  }
1490
- :where(.react-flow__node.selected) .lbtzdo6 {
1491
- --lbtzdo5: .05;
1492
- }
1493
1500
  :where([data-hovered]) .lbtzdo6 {
1494
- --lbtzdo5: .1;
1501
+ --lbtzdo5: .07;
1495
1502
  }
1496
1503
  .lbtzdo7 {
1497
1504
  font-family: var(--likec4-compound-font-family);
@@ -1573,7 +1580,7 @@ svg.react-flow__connectionline {
1573
1580
  }
1574
1581
  .lbtzdoe:hover {
1575
1582
  box-shadow: var(--mantine-shadow-lg);
1576
- transform: scale(1.466);
1583
+ transform: scale(1.42);
1577
1584
  opacity: 1;
1578
1585
  transition-delay: 0;
1579
1586
  }
@@ -1598,7 +1605,7 @@ svg.react-flow__connectionline {
1598
1605
  width: 70%;
1599
1606
  height: 70%;
1600
1607
  stroke-width: 1.5;
1601
- }@keyframes _1b6tkn4 {
1608
+ }@keyframes _1b6tkn5 {
1602
1609
  from {
1603
1610
  opacity: 0.6;
1604
1611
  }
@@ -1615,48 +1622,58 @@ svg.react-flow__connectionline {
1615
1622
  display: flex;
1616
1623
  align-items: stretch;
1617
1624
  }
1618
- .react-flow__node-element:has(._1b6tkn3) {
1625
+ :where(.react-flow__node.selected) ._1b6tkn2 {
1626
+ will-change: transform;
1627
+ }
1628
+ ._1b6tkn2[data-hovered="true"] {
1629
+ will-change: transform;
1630
+ }
1631
+ ._1b6tkn3 {
1632
+ will-change: transform;
1633
+ }
1634
+ .react-flow__node-element:has(._1b6tkn4) {
1619
1635
  opacity: 0.25;
1620
1636
  transition: opacity 600ms ease-in-out, filter 600ms ease-in-out;
1621
1637
  transition-delay: 200ms;
1622
- filter: grayscale(0.85) blur(2px);
1638
+ filter: grayscale(0.85) var(--likec4-safari-animation-hook, blur(2px));
1623
1639
  will-change: opacity, filter;
1624
1640
  }
1625
- ._1b6tkn5 {
1641
+ ._1b6tkn6 {
1626
1642
  stroke: var(--likec4-element-loContrast);
1627
1643
  transform-origin: center center;
1628
1644
  stroke-width: 6;
1629
1645
  animation-duration: 800ms;
1630
- animation-name: _1b6tkn4;
1631
1646
  animation-iteration-count: infinite;
1632
1647
  animation-direction: alternate;
1648
+ opacity: 0.6;
1633
1649
  visibility: hidden;
1634
1650
  }
1635
- :where(.react-flow__node.selected) ._1b6tkn5 {
1651
+ :where(.react-flow__node.selected) ._1b6tkn6 {
1636
1652
  visibility: visible;
1653
+ animation-name: var(--likec4-safari-animation-hook, _1b6tkn5);
1637
1654
  }
1638
- :where(.react-flow__node:focus-visible, ._1b6tkn2:focus-visible) ._1b6tkn5 {
1639
- animation-name: none;
1655
+ :where(.react-flow__node:focus-visible, ._1b6tkn2:focus-visible) ._1b6tkn6 {
1640
1656
  stroke-width: 10;
1641
1657
  stroke: var(--mantine-primary-color-outline, var(--mantine-primary-color-filled, var(--likec4-element-stroke)));
1642
1658
  visibility: visible;
1643
1659
  }
1644
- :where([data-likec4-shape="queue"], [data-likec4-shape="cylinder"], [data-likec4-shape="storage"]) ._1b6tkn5 {
1660
+ :where([data-likec4-shape="queue"], [data-likec4-shape="cylinder"], [data-likec4-shape="storage"]) ._1b6tkn6 {
1645
1661
  stroke-width: 10;
1646
1662
  }
1647
- ._1b6tkn3 ._1b6tkn5 {
1663
+ ._1b6tkn4 ._1b6tkn6 {
1648
1664
  visibility: hidden;
1665
+ display: none;
1649
1666
  }
1650
- ._1b6tkn6 {
1667
+ ._1b6tkn7 {
1651
1668
  fill: var(--likec4-element-fill);
1652
1669
  }
1653
- ._1b6tkn7 {
1670
+ ._1b6tkn8 {
1654
1671
  fill: var(--likec4-element-stroke);
1655
1672
  }
1656
- ._1b6tkn8 {
1673
+ ._1b6tkn9 {
1657
1674
  fill: var(--_1b6tkn0);
1658
1675
  }
1659
- ._1b6tkn9 {
1676
+ ._1b6tkna {
1660
1677
  flex: 0 0 auto;
1661
1678
  font-family: var(--likec4-element-font-family);
1662
1679
  font-optical-sizing: auto;
@@ -1668,7 +1685,7 @@ svg.react-flow__connectionline {
1668
1685
  text-wrap: balance;
1669
1686
  color: var(--likec4-element-hiContrast);
1670
1687
  }
1671
- ._1b6tkna {
1688
+ ._1b6tknb {
1672
1689
  flex: 0 1 auto;
1673
1690
  font-family: var(--likec4-element-font-family);
1674
1691
  font-optical-sizing: auto;
@@ -1683,7 +1700,7 @@ svg.react-flow__connectionline {
1683
1700
  text-overflow: ellipsis;
1684
1701
  overflow: hidden;
1685
1702
  }
1686
- ._1b6tknb {
1703
+ ._1b6tknc {
1687
1704
  flex: 0 0 auto;
1688
1705
  font-family: var(--likec4-element-font-family);
1689
1706
  font-optical-sizing: auto;
@@ -1696,10 +1713,10 @@ svg.react-flow__connectionline {
1696
1713
  opacity: 0.92;
1697
1714
  color: var(--likec4-element-loContrast);
1698
1715
  }
1699
- ._1b6tkn2:hover ._1b6tknb {
1716
+ ._1b6tkn2:hover ._1b6tknc {
1700
1717
  opacity: 1;
1701
1718
  }
1702
- ._1b6tknc {
1719
+ ._1b6tknd {
1703
1720
  --_1b6tkn1: calc(1.5rem * var(--mantine-scale));
1704
1721
  flex: 1;
1705
1722
  padding: var(--_1b6tkn1);
@@ -1710,24 +1727,24 @@ svg.react-flow__connectionline {
1710
1727
  overflow: hidden;
1711
1728
  gap: calc(0.5rem * var(--mantine-scale));
1712
1729
  }
1713
- ._1b6tknc:has(._1b6tkna):has(._1b6tknb) {
1730
+ ._1b6tknd:has(._1b6tknb):has(._1b6tknc) {
1714
1731
  gap: calc(0.375rem * var(--mantine-scale));
1715
1732
  }
1716
- :where([data-likec4-shape="queue"], [data-likec4-shape="mobile"]) ._1b6tknc {
1733
+ :where([data-likec4-shape="queue"], [data-likec4-shape="mobile"]) ._1b6tknd {
1717
1734
  padding-left: calc(2.5rem * var(--mantine-scale));
1718
1735
  padding-right: calc(1.25rem * var(--mantine-scale));
1719
1736
  }
1720
- :where([data-likec4-shape="cylinder"], [data-likec4-shape="storage"]) ._1b6tknc {
1737
+ :where([data-likec4-shape="cylinder"], [data-likec4-shape="storage"]) ._1b6tknd {
1721
1738
  padding-top: calc(2.125rem * var(--mantine-scale));
1722
1739
  }
1723
- :where([data-likec4-shape="browser"]) ._1b6tknc {
1740
+ :where([data-likec4-shape="browser"]) ._1b6tknd {
1724
1741
  padding-top: calc(2rem * var(--mantine-scale));
1725
1742
  padding-bottom: calc(1.75rem * var(--mantine-scale));
1726
1743
  }
1727
- ._1b6tkne {
1728
- --_1b6tknd: 30px;
1729
- flex: 0 1 var(--_1b6tknd);
1730
- max-height: var(--_1b6tknd);
1744
+ ._1b6tknf {
1745
+ --_1b6tkne: 30px;
1746
+ flex: 0 1 var(--_1b6tkne);
1747
+ max-height: var(--_1b6tkne);
1731
1748
  margin-top: -8px;
1732
1749
  position: relative;
1733
1750
  user-select: none;
@@ -1735,17 +1752,17 @@ svg.react-flow__connectionline {
1735
1752
  overflow: visible;
1736
1753
  mix-blend-mode: hard-light;
1737
1754
  }
1738
- ._1b6tkne img {
1755
+ ._1b6tknf img {
1739
1756
  position: absolute;
1740
1757
  left: 0;
1741
1758
  bottom: 0;
1742
1759
  width: 100%;
1743
1760
  height: auto;
1744
1761
  object-fit: contain;
1745
- max-height: calc(var(--_1b6tknd) + 16px);
1762
+ max-height: calc(var(--_1b6tkne) + 16px);
1746
1763
  }
1747
- ._1b6tknh {
1748
- --_1b6tknf:
1764
+ ._1b6tkni {
1765
+ --_1b6tkng:
1749
1766
  drop-shadow(0 2px 1px rgba(0, 0, 0, 0.21))
1750
1767
  drop-shadow(0 1px 1px color-mix(in srgb, var(--likec4-element-stroke) 40%, transparent))
1751
1768
  drop-shadow(0 5px 3px rgba(0, 0, 0, 0.1))
@@ -1757,15 +1774,15 @@ svg.react-flow__connectionline {
1757
1774
  fill: var(--likec4-element-fill);
1758
1775
  stroke: var(--likec4-element-stroke);
1759
1776
  overflow: visible;
1760
- filter: var(--_1b6tkng, var(--_1b6tknf));
1777
+ filter: var(--_1b6tknh, var(--_1b6tkng));
1761
1778
  transition: filter 300ms ease-out;
1762
1779
  transition-delay: 0ms;
1763
1780
  z-index: -1;
1764
1781
  }
1765
- :where(.react-flow__node.selected, .react-flow__node:focus-visible, ._1b6tkn2:focus-visible) ._1b6tknh {
1782
+ :where(.react-flow__node.selected, .react-flow__node:focus-visible, ._1b6tkn2:focus-visible) ._1b6tkni {
1766
1783
  filter: none;
1767
1784
  }
1768
- ._1b6tkni {
1785
+ ._1b6tknj {
1769
1786
  --ai-bg: color-mix(in srgb , var(--likec4-element-fill), transparent 99%);
1770
1787
  --ai-bg-hover: color-mix(in srgb , var(--likec4-element-fill) 65%, var(--likec4-element-stroke));
1771
1788
  --ai-hover: color-mix(in srgb , var(--likec4-element-fill) 50%, var(--likec4-element-stroke));
@@ -1783,28 +1800,28 @@ svg.react-flow__connectionline {
1783
1800
  transition-delay: 0ms;
1784
1801
  background-color: var(--ai-bg);
1785
1802
  }
1786
- ._1b6tkni:hover {
1803
+ ._1b6tknj:hover {
1787
1804
  box-shadow: var(--mantine-shadow-lg);
1788
1805
  transform: translate(-50%, 0) scale(1.35);
1789
1806
  opacity: 1;
1790
1807
  transition-delay: 0;
1791
1808
  }
1792
- ._1b6tkni:active {
1809
+ ._1b6tknj:active {
1793
1810
  transform: translate(-50%, 0) scale(1.02);
1794
1811
  opacity: 1;
1795
1812
  transition-delay: 0;
1796
1813
  }
1797
- :where([data-likec4-shape='browser']) ._1b6tkni {
1814
+ :where([data-likec4-shape='browser']) ._1b6tknj {
1798
1815
  bottom: 3px;
1799
1816
  }
1800
- :where(.react-flow__node:not(.dragging) ._1b6tkn2:hover) ._1b6tkni:not(:hover) {
1817
+ :where(.react-flow__node:not(.dragging) ._1b6tkn2:hover) ._1b6tknj:not(:hover) {
1801
1818
  --ai-bg: var(--ai-bg-hover);
1802
1819
  box-shadow: var(--mantine-shadow-lg);
1803
1820
  transform: translate(-50%, 0) scale(1.185);
1804
1821
  opacity: 1;
1805
1822
  transition-delay: 250ms;
1806
1823
  }
1807
- ._1b6tkni svg.icon {
1824
+ ._1b6tknj svg.icon {
1808
1825
  width: 65%;
1809
1826
  height: 65%;
1810
1827
  stroke-width: 1.5;
@@ -1859,6 +1876,18 @@ svg.react-flow__connectionline {
1859
1876
  }
1860
1877
  ._4ysv0o2 {
1861
1878
  text-align: left;
1879
+ }._19mimxc0 {
1880
+ top: var(--likec4-navigation-panel-top, 1rem);
1881
+ left: var(--likec4-navigation-panel-left, 1rem);
1882
+ margin: 0;
1883
+ }
1884
+ ._19mimxc0 .mantine-ActionIcon-root {
1885
+ --ai-size: var(--ai-size-md);
1886
+ }
1887
+ @media (min-width: 62em) {
1888
+ ._19mimxc0 .mantine-ActionIcon-root {
1889
+ --ai-size: var(--ai-size-lg);
1890
+ }
1862
1891
  }.hbkbtj0 {
1863
1892
  bottom: 0;
1864
1893
  left: 0;
@@ -1867,11 +1896,14 @@ svg.react-flow__connectionline {
1867
1896
  }
1868
1897
  .hbkbtj1 {
1869
1898
  cursor: default;
1870
- min-width: 100px;
1899
+ min-width: 150px;
1871
1900
  max-width: calc(100vw - 16px);
1872
1901
  background-color: color-mix(in srgb, var(--mantine-color-body), transparent 20%);
1873
- -webkit-backdrop-filter: blur(8px);
1874
- backdrop-filter: blur(8px);
1902
+ -webkit-backdrop-filter: var(--likec4-safari-animation-hook, blur(8px));
1903
+ backdrop-filter: var(--likec4-safari-animation-hook, blur(8px));
1904
+ }
1905
+ :where([data-mantine-color-scheme='dark']) .hbkbtj1 {
1906
+ background-color: color-mix(in srgb, var(--mantine-color-dark-6), transparent 20%);
1875
1907
  }
1876
1908
  .hbkbtj3 {
1877
1909
  white-space-collapse: preserve-breaks;
@@ -1,4 +1,5 @@
1
1
  export declare const vars: {
2
+ safariAnimationHook: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
2
3
  default: {
3
4
  font: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
4
5
  };
@@ -31,6 +32,10 @@ export declare const vars: {
31
32
  top: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
32
33
  right: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
33
34
  };
35
+ navigationPanel: {
36
+ top: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
37
+ left: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
38
+ };
34
39
  };
35
40
  export declare const xyvars: {
36
41
  background: {
@@ -0,0 +1 @@
1
+ export declare const panel: string;
@@ -0,0 +1 @@
1
+ export declare function BackwardForwardPanel(): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  export declare const container: string;
2
- export declare const paper: string;
2
+ export declare const card: string;
3
3
  export declare const title: string;
4
4
  export declare const description: string;
@@ -1,3 +1 @@
1
- /// <reference types="react" />
2
- declare const OptionsPanelMemo: import('react').NamedExoticComponent<object>;
3
- export default OptionsPanelMemo;
1
+ export default function OptionsPanel(): import("react/jsx-runtime").JSX.Element;
@@ -28,7 +28,7 @@ export declare function useXYFlowEvents(): {
28
28
  labelBgBorderRadius?: number;
29
29
  style?: import('react').CSSProperties;
30
30
  className?: string;
31
- updatable?: import('@xyflow/react').EdgeUpdatable;
31
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
32
32
  focusable?: boolean;
33
33
  data: import('./types').RelationshipData;
34
34
  readonly id: string;
@@ -59,7 +59,7 @@ export declare function useXYFlowEvents(): {
59
59
  labelBgBorderRadius?: number;
60
60
  style?: import('react').CSSProperties;
61
61
  className?: string;
62
- updatable?: import('@xyflow/react').EdgeUpdatable;
62
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
63
63
  focusable?: boolean;
64
64
  data: import('./types').RelationshipData;
65
65
  readonly id: string;
@@ -91,7 +91,7 @@ export declare function useXYFlowEvents(): {
91
91
  labelBgBorderRadius?: number;
92
92
  style?: import('react').CSSProperties;
93
93
  className?: string;
94
- updatable?: import('@xyflow/react').EdgeUpdatable;
94
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
95
95
  focusable?: boolean;
96
96
  data: import('./types').RelationshipData;
97
97
  readonly id: string;
@@ -120,7 +120,7 @@ export declare function useXYFlowEvents(): {
120
120
  labelBgBorderRadius?: number;
121
121
  style?: import('react').CSSProperties;
122
122
  className?: string;
123
- updatable?: import('@xyflow/react').EdgeUpdatable;
123
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
124
124
  focusable?: boolean;
125
125
  data: import('./types').RelationshipData;
126
126
  readonly id: string;
@@ -5,6 +5,7 @@ type XYFlowInnerProps = PropsWithChildren<{
5
5
  background: NonNullable<LikeC4DiagramProperties['background']>;
6
6
  controls: boolean;
7
7
  showDiagramTitle: boolean;
8
+ showNavigationButtons: boolean;
8
9
  enableDynamicViewWalkthrough: boolean;
9
10
  }>;
10
11
  export declare const XYFlowInner: import('react').NamedExoticComponent<XYFlowInnerProps>;
@@ -23,7 +23,7 @@ export declare const RelationshipEdge: import('react').NamedExoticComponent<Edge
23
23
  labelBgBorderRadius?: number;
24
24
  style?: import('react').CSSProperties;
25
25
  className?: string;
26
- updatable?: import('@xyflow/react').EdgeUpdatable;
26
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
27
27
  focusable?: boolean;
28
28
  data: import('../types').RelationshipData;
29
29
  readonly id: string;
@@ -23,7 +23,7 @@ export declare const useXYFlow: () => import('@xyflow/react').ReactFlowInstance<
23
23
  labelBgBorderRadius?: number;
24
24
  style?: import('react').CSSProperties;
25
25
  className?: string;
26
- updatable?: import('@xyflow/react').EdgeUpdatable;
26
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
27
27
  focusable?: boolean;
28
28
  data: import('../types').RelationshipData;
29
29
  readonly id: string;
@@ -58,7 +58,7 @@ export declare const useXYStoreApi: () => {
58
58
  labelBgBorderRadius?: number;
59
59
  style?: import('react').CSSProperties;
60
60
  className?: string;
61
- updatable?: import('@xyflow/react').EdgeUpdatable;
61
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
62
62
  focusable?: boolean;
63
63
  data: import('../types').RelationshipData;
64
64
  readonly id: string;
@@ -87,7 +87,7 @@ export declare const useXYStoreApi: () => {
87
87
  labelBgBorderRadius?: number;
88
88
  style?: import('react').CSSProperties;
89
89
  className?: string;
90
- updatable?: import('@xyflow/react').EdgeUpdatable;
90
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
91
91
  focusable?: boolean;
92
92
  data: import('../types').RelationshipData;
93
93
  readonly id: string;
@@ -115,7 +115,7 @@ export declare const useXYStoreApi: () => {
115
115
  labelBgBorderRadius?: number;
116
116
  style?: import('react').CSSProperties;
117
117
  className?: string;
118
- updatable?: import('@xyflow/react').EdgeUpdatable;
118
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
119
119
  focusable?: boolean;
120
120
  data: import('../types').RelationshipData;
121
121
  readonly id: string;
@@ -143,7 +143,7 @@ export declare const useXYStoreApi: () => {
143
143
  labelBgBorderRadius?: number;
144
144
  style?: import('react').CSSProperties;
145
145
  className?: string;
146
- updatable?: import('@xyflow/react').EdgeUpdatable;
146
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
147
147
  focusable?: boolean;
148
148
  data: import('../types').RelationshipData;
149
149
  readonly id: string;
@@ -171,7 +171,7 @@ export declare const useXYStoreApi: () => {
171
171
  labelBgBorderRadius?: number;
172
172
  style?: import('react').CSSProperties;
173
173
  className?: string;
174
- updatable?: import('@xyflow/react').EdgeUpdatable;
174
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
175
175
  focusable?: boolean;
176
176
  data: import('../types').RelationshipData;
177
177
  readonly id: string;
@@ -199,7 +199,7 @@ export declare const useXYStoreApi: () => {
199
199
  labelBgBorderRadius?: number;
200
200
  style?: import('react').CSSProperties;
201
201
  className?: string;
202
- updatable?: import('@xyflow/react').EdgeUpdatable;
202
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
203
203
  focusable?: boolean;
204
204
  data: import('../types').RelationshipData;
205
205
  readonly id: string;
@@ -228,7 +228,7 @@ export declare const useXYStoreApi: () => {
228
228
  labelBgBorderRadius?: number;
229
229
  style?: import('react').CSSProperties;
230
230
  className?: string;
231
- updatable?: import('@xyflow/react').EdgeUpdatable;
231
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
232
232
  focusable?: boolean;
233
233
  data: import('../types').RelationshipData;
234
234
  readonly id: string;
@@ -256,7 +256,7 @@ export declare const useXYStoreApi: () => {
256
256
  labelBgBorderRadius?: number;
257
257
  style?: import('react').CSSProperties;
258
258
  className?: string;
259
- updatable?: import('@xyflow/react').EdgeUpdatable;
259
+ reconnectable?: boolean | import('@xyflow/react').HandleType;
260
260
  focusable?: boolean;
261
261
  data: import('../types').RelationshipData;
262
262
  readonly id: string;
@@ -1,5 +1,6 @@
1
1
  export declare const stokeFillMix: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
2
2
  export declare const container: string;
3
+ export declare const containerAnimated: string;
3
4
  export declare const dimmed: string;
4
5
  export declare const indicator: string;
5
6
  export declare const fillElementFill: string;
@@ -62,7 +62,7 @@ export declare namespace XYFlowEdge {
62
62
  labelBgBorderRadius?: number;
63
63
  style?: import("react").CSSProperties;
64
64
  className?: string;
65
- updatable?: import("@xyflow/react").EdgeUpdatable;
65
+ reconnectable?: boolean | import("@xyflow/react").HandleType;
66
66
  focusable?: boolean;
67
67
  data: RelationshipData;
68
68
  readonly id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/diagram",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "license": "MIT",
5
5
  "bugs": "https://github.com/likec4/likec4/issues",
6
6
  "homepage": "https://likec4.dev",
@@ -48,18 +48,18 @@
48
48
  "clean": "run -T rimraf -v -g 'dist/*' .tsbuildinfo"
49
49
  },
50
50
  "dependencies": {
51
- "@likec4/core": "1.3.0",
51
+ "@likec4/core": "1.4.0",
52
52
  "@react-hookz/web": "^24.0.4",
53
- "@tabler/icons-react": "^3.0.0",
53
+ "@tabler/icons-react": "^3.7.0",
54
54
  "@vanilla-extract/css": "^1.15.3",
55
55
  "@vanilla-extract/css-utils": "^0.1.4",
56
56
  "@vanilla-extract/dynamic": "^2.1.1",
57
57
  "d3-shape": "^3.2.0",
58
58
  "esm-env": "^1.0.0",
59
59
  "fast-equals": "^5.0.1",
60
- "framer-motion": "^11.2.2",
60
+ "framer-motion": "^11.2.12",
61
61
  "remeda": "^1.61.0",
62
- "zustand": "^4.5.2"
62
+ "zustand": "^4.5.4"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@mantine/core": "7.10.2",
@@ -68,7 +68,7 @@
68
68
  "react-dom": "^18.3.1"
69
69
  },
70
70
  "devDependencies": {
71
- "@likec4/tsconfig": "1.3.0",
71
+ "@likec4/tsconfig": "1.4.0",
72
72
  "@lume/kiwi": "^0.4.3",
73
73
  "@mantine/core": "7.10.2",
74
74
  "@mantine/hooks": "7.10.2",
@@ -78,10 +78,10 @@
78
78
  "@types/d3-shape": "^3",
79
79
  "@types/react": "^18.3.3",
80
80
  "@types/react-dom": "^18.3.0",
81
- "@vanilla-extract/esbuild-plugin": "^2.3.7",
81
+ "@vanilla-extract/esbuild-plugin": "^2.3.8",
82
82
  "@vitejs/plugin-react": "^4.3.1",
83
- "@xyflow/react": "12.0.0-next.21",
84
- "@xyflow/system": "0.0.29",
83
+ "@xyflow/react": "12.0.0-next.24",
84
+ "@xyflow/system": "0.0.30",
85
85
  "bezier-js": "^6.1.4",
86
86
  "clsx": "^2.1.1",
87
87
  "execa": "^9.1.0",
@@ -91,7 +91,7 @@
91
91
  "tilg": "^0.1.1",
92
92
  "type-fest": "^4.18.2",
93
93
  "typescript": "^5.4.5",
94
- "vite": "5.3.1",
94
+ "vite": "5.3.2",
95
95
  "vite-plugin-dts": "^3.9.1"
96
96
  }
97
97
  }
@@ -9,7 +9,17 @@ export const keepAspectRatioContainer = style({
9
9
  padding: 0
10
10
  })
11
11
 
12
- export const cssReactFlow = style({})
12
+ export const cssReactFlow = style({
13
+ '@supports': {
14
+ // https://wojtek.im/journal/targeting-safari-with-css-media-query
15
+ '(hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none)': {
16
+ // TODO: this workaround disables animations in Safari (to improve performance)
17
+ vars: {
18
+ [vars.safariAnimationHook]: ''
19
+ }
20
+ }
21
+ }
22
+ })
13
23
 
14
24
  globalStyle(`.react-flow${cssReactFlow}`, {
15
25
  vars: {
@@ -21,9 +21,10 @@ export type DiagramNodeWithNavigate = Simplify<SetRequired<DiagramNode, 'navigat
21
21
  export type OnNavigateTo = {
22
22
  (
23
23
  to: ViewID,
24
- event: ReactMouseEvent,
25
- element: DiagramNodeWithNavigate,
26
- xynode: XYFlowNode
24
+ // These fields present if navigateTo triggered by a node click
25
+ event?: ReactMouseEvent,
26
+ element?: DiagramNodeWithNavigate,
27
+ xynode?: XYFlowNode
27
28
  ): void
28
29
  }
29
30
  export type OnNodeClick = (
@@ -159,6 +160,12 @@ export interface LikeC4DiagramProperties {
159
160
  */
160
161
  showDiagramTitle?: boolean | undefined
161
162
 
163
+ /**
164
+ * Show back/forward navigation buttons
165
+ * @default false
166
+ */
167
+ showNavigationButtons?: undefined | boolean
168
+
162
169
  /**
163
170
  * If Walkthrough for dynamic views should be enabled
164
171
  * @default false