@likec4/diagram 1.22.1 → 1.23.1

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 (238) hide show
  1. package/dist/LikeC4Diagram.js +2 -3
  2. package/dist/base/BaseXYFlow.js +0 -1
  3. package/dist/base/example/custom.d.ts +1 -1
  4. package/dist/base/primitives/customEdge.d.ts +1 -1
  5. package/dist/base/primitives/edge/EdgePath.d.ts +1 -1
  6. package/dist/context/DiagramEventHandlers.d.ts +6 -2
  7. package/dist/context/DiagramEventHandlers.js +25 -20
  8. package/dist/context/DiagramFeatures.js +9 -22
  9. package/dist/{style.css → diagram.css} +1 -1
  10. package/dist/hooks/index.d.ts +0 -1
  11. package/dist/hooks/safeContext.d.ts +7 -0
  12. package/dist/hooks/safeContext.js +14 -0
  13. package/dist/hooks/useCurrentViewId.js +1 -1
  14. package/dist/hooks/useDiagram.d.ts +6587 -5969
  15. package/dist/hooks/useDiagram.js +26 -14
  16. package/dist/index.js +1 -1
  17. package/dist/likec4diagram/DiagramUI.js +12 -5
  18. package/dist/likec4diagram/XYFlow.js +3 -4
  19. package/dist/likec4diagram/custom/edges/NotePopover.js +1 -2
  20. package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +1 -1
  21. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +1 -1
  22. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +6 -7
  23. package/dist/likec4diagram/custom/index.d.ts +1 -1
  24. package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +1 -1
  25. package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +1 -2
  26. package/dist/likec4diagram/ui/controls/Controls.js +3 -13
  27. package/dist/likec4diagram/ui/controls/NavigationButtons.js +1 -2
  28. package/dist/likec4diagram/ui/controls/ToggleReadonly.js +1 -2
  29. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +8 -9
  30. package/dist/likec4diagram/ui/notation/NotationPanel.js +1 -2
  31. package/dist/likec4diagram/ui/search/LikeC4Search.js +2 -4
  32. package/dist/likec4diagram/ui/search/ViewsColum.js +1 -1
  33. package/dist/likec4diagram/ui/search/state.js +1 -1
  34. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +1 -2
  35. package/dist/likec4diagram/useViewToNodesEdges.d.ts +0 -1
  36. package/dist/likec4diagram/useViewToNodesEdges.js +0 -2
  37. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Accordion/Accordion.module.css.mjs.vanilla.css.js +1 -0
  38. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ActionIcon/ActionIcon.module.css.mjs.vanilla.css.js +1 -0
  39. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Affix/Affix.module.css.mjs.vanilla.css.js +1 -0
  40. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Alert/Alert.module.css.mjs.vanilla.css.js +1 -0
  41. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Anchor/Anchor.module.css.mjs.vanilla.css.js +1 -0
  42. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/AngleSlider/AngleSlider.module.css.mjs.vanilla.css.js +1 -0
  43. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/AppShell/AppShell.module.css.mjs.vanilla.css.js +1 -0
  44. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/AspectRatio/AspectRatio.module.css.mjs.vanilla.css.js +1 -0
  45. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Avatar/Avatar.module.css.mjs.vanilla.css.js +1 -0
  46. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/BackgroundImage/BackgroundImage.module.css.mjs.vanilla.css.js +1 -0
  47. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Badge/Badge.module.css.mjs.vanilla.css.js +1 -0
  48. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Blockquote/Blockquote.module.css.mjs.vanilla.css.js +1 -0
  49. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Breadcrumbs/Breadcrumbs.module.css.mjs.vanilla.css.js +1 -0
  50. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Burger/Burger.module.css.mjs.vanilla.css.js +1 -0
  51. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Button/Button.module.css.mjs.vanilla.css.js +1 -0
  52. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Card/Card.module.css.mjs.vanilla.css.js +1 -0
  53. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Center/Center.module.css.mjs.vanilla.css.js +1 -0
  54. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Checkbox/Checkbox.module.css.mjs.vanilla.css.js +1 -0
  55. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Checkbox/CheckboxCard/CheckboxCard.module.css.mjs.vanilla.css.js +1 -0
  56. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.module.css.mjs.vanilla.css.js +1 -0
  57. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Chip/Chip.module.css.mjs.vanilla.css.js +1 -0
  58. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/CloseButton/CloseButton.module.css.mjs.vanilla.css.js +1 -0
  59. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Code/Code.module.css.mjs.vanilla.css.js +1 -0
  60. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ColorInput/ColorInput.module.css.mjs.vanilla.css.js +1 -0
  61. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ColorPicker/ColorPicker.module.css.mjs.vanilla.css.js +1 -0
  62. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ColorSwatch/ColorSwatch.module.css.mjs.vanilla.css.js +1 -0
  63. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Combobox/Combobox.module.css.mjs.vanilla.css.js +1 -0
  64. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Container/Container.module.css.mjs.vanilla.css.js +1 -0
  65. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Dialog/Dialog.module.css.mjs.vanilla.css.js +1 -0
  66. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Divider/Divider.module.css.mjs.vanilla.css.js +1 -0
  67. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Drawer/Drawer.module.css.mjs.vanilla.css.js +1 -0
  68. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Fieldset/Fieldset.module.css.mjs.vanilla.css.js +1 -0
  69. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Flex/Flex.module.css.mjs.vanilla.css.js +1 -0
  70. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/FloatingIndicator/FloatingIndicator.module.css.mjs.vanilla.css.js +1 -0
  71. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Grid/Grid.module.css.mjs.vanilla.css.js +1 -0
  72. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Group/Group.module.css.mjs.vanilla.css.js +1 -0
  73. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Image/Image.module.css.mjs.vanilla.css.js +1 -0
  74. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Indicator/Indicator.module.css.mjs.vanilla.css.js +1 -0
  75. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/InlineInput/InlineInput.module.css.mjs.vanilla.css.js +1 -0
  76. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Input/Input.module.css.mjs.vanilla.css.js +1 -0
  77. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Kbd/Kbd.module.css.mjs.vanilla.css.js +1 -0
  78. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/List/List.module.css.mjs.vanilla.css.js +1 -0
  79. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Loader/Loader.module.css.mjs.vanilla.css.js +1 -0
  80. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/LoadingOverlay/LoadingOverlay.module.css.mjs.vanilla.css.js +1 -0
  81. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Mark/Mark.module.css.mjs.vanilla.css.js +1 -0
  82. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Menu/Menu.module.css.mjs.vanilla.css.js +1 -0
  83. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Modal/Modal.module.css.mjs.vanilla.css.js +1 -0
  84. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ModalBase/ModalBase.module.css.mjs.vanilla.css.js +1 -0
  85. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/NavLink/NavLink.module.css.mjs.vanilla.css.js +1 -0
  86. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Notification/Notification.module.css.mjs.vanilla.css.js +1 -0
  87. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/NumberInput/NumberInput.module.css.mjs.vanilla.css.js +1 -0
  88. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Overlay/Overlay.module.css.mjs.vanilla.css.js +1 -0
  89. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Pagination/Pagination.module.css.mjs.vanilla.css.js +1 -0
  90. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Paper/Paper.module.css.mjs.vanilla.css.js +1 -0
  91. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/PasswordInput/PasswordInput.module.css.mjs.vanilla.css.js +1 -0
  92. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Pill/Pill.module.css.mjs.vanilla.css.js +1 -0
  93. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/PillsInput/PillsInput.module.css.mjs.vanilla.css.js +1 -0
  94. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/PinInput/PinInput.module.css.mjs.vanilla.css.js +1 -0
  95. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Popover/Popover.module.css.mjs.vanilla.css.js +1 -0
  96. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Progress/Progress.module.css.mjs.vanilla.css.js +1 -0
  97. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Radio/Radio.module.css.mjs.vanilla.css.js +1 -0
  98. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Radio/RadioCard/RadioCard.module.css.mjs.vanilla.css.js +1 -0
  99. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Radio/RadioIndicator/RadioIndicator.module.css.mjs.vanilla.css.js +1 -0
  100. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Rating/Rating.module.css.mjs.vanilla.css.js +1 -0
  101. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/RingProgress/RingProgress.module.css.mjs.vanilla.css.js +1 -0
  102. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ScrollArea/ScrollArea.module.css.mjs.vanilla.css.js +1 -0
  103. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/SegmentedControl/SegmentedControl.module.css.mjs.vanilla.css.js +1 -0
  104. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/SemiCircleProgress/SemiCircleProgress.module.css.mjs.vanilla.css.js +1 -0
  105. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/SimpleGrid/SimpleGrid.module.css.mjs.vanilla.css.js +1 -0
  106. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Skeleton/Skeleton.module.css.mjs.vanilla.css.js +1 -0
  107. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Slider/Slider.module.css.mjs.vanilla.css.js +1 -0
  108. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Spoiler/Spoiler.module.css.mjs.vanilla.css.js +1 -0
  109. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Stack/Stack.module.css.mjs.vanilla.css.js +1 -0
  110. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Stepper/Stepper.module.css.mjs.vanilla.css.js +1 -0
  111. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Switch/Switch.module.css.mjs.vanilla.css.js +1 -0
  112. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Table/Table.module.css.mjs.vanilla.css.js +1 -0
  113. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/TableOfContents/TableOfContents.module.css.mjs.vanilla.css.js +1 -0
  114. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Tabs/Tabs.module.css.mjs.vanilla.css.js +1 -0
  115. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Text/Text.module.css.mjs.vanilla.css.js +1 -0
  116. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ThemeIcon/ThemeIcon.module.css.mjs.vanilla.css.js +1 -0
  117. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Timeline/Timeline.module.css.mjs.vanilla.css.js +1 -0
  118. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Title/Title.module.css.mjs.vanilla.css.js +1 -0
  119. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Tooltip/Tooltip.module.css.mjs.vanilla.css.js +1 -0
  120. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Tree/Tree.module.css.mjs.vanilla.css.js +1 -0
  121. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/TypographyStylesProvider/TypographyStylesProvider.module.css.mjs.vanilla.css.js +1 -0
  122. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/UnstyledButton/UnstyledButton.module.css.mjs.vanilla.css.js +1 -0
  123. package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/VisuallyHidden/VisuallyHidden.module.css.mjs.vanilla.css.js +1 -0
  124. package/dist/overlays/Overlays.d.ts +4 -1
  125. package/dist/overlays/Overlays.js +72 -60
  126. package/dist/overlays/element-details/ElementDetails.d.ts +6 -0
  127. package/dist/overlays/element-details/ElementDetails.js +31 -0
  128. package/dist/overlays/element-details/ElementDetailsCard.js +4 -9
  129. package/dist/overlays/element-details/TabPanelDeployments.js +1 -1
  130. package/dist/overlays/element-details/TabPanelRelationships.d.ts +3 -4
  131. package/dist/overlays/element-details/TabPanelRelationships.js +20 -20
  132. package/dist/overlays/element-details/actor.d.ts +20626 -0
  133. package/dist/overlays/element-details/actor.js +68 -0
  134. package/dist/overlays/element-details/actorContext.d.ts +7 -0
  135. package/dist/overlays/element-details/actorContext.js +14 -0
  136. package/dist/overlays/overlay/Overlay.css.js +87 -87
  137. package/dist/overlays/overlay/Overlay.js +16 -1
  138. package/dist/overlays/overlaysActor.d.ts +190 -0
  139. package/dist/overlays/overlaysActor.js +233 -0
  140. package/dist/overlays/relationship-details/actor.d.ts +130 -4
  141. package/dist/overlays/relationship-details/actor.js +2 -2
  142. package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +1 -1
  143. package/dist/overlays/relationship-details/custom/nodeTypes.js +17 -0
  144. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +17 -19
  145. package/dist/overlays/relationships-browser/actor.d.ts +1095 -8
  146. package/dist/overlays/relationships-browser/actor.js +181 -173
  147. package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -2
  148. package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +1 -1
  149. package/dist/overlays/relationships-browser/custom/nodeTypes.js +17 -0
  150. package/dist/overlays/relationships-browser/hooks.d.ts +1 -1
  151. package/dist/overlays/relationships-browser/hooks.js +7 -5
  152. package/dist/overlays/types.d.ts +29 -0
  153. package/dist/{likec4diagram/DiagramActor.d.ts → state/DiagramActorProvider.d.ts} +2 -2
  154. package/dist/state/DiagramActorProvider.js +77 -0
  155. package/dist/{likec4diagram/state → state}/assign.d.ts +2 -2
  156. package/dist/{likec4diagram/state → state}/assign.js +2 -2
  157. package/dist/state/diagram-machine.d.ts +11680 -0
  158. package/dist/{likec4diagram/state/machine.js → state/diagram-machine.js} +105 -194
  159. package/dist/{likec4diagram/state → state}/hotkeyActor.d.ts +1 -1
  160. package/dist/state/hotkeyActor.js +26 -0
  161. package/dist/state/inspector.d.ts +4 -0
  162. package/dist/{likec4diagram/state → state}/syncManualLayoutActor.d.ts +7 -8
  163. package/dist/{likec4diagram/state → state}/syncManualLayoutActor.js +3 -5
  164. package/dist/state/types.d.ts +19 -0
  165. package/dist/state/utils.d.ts +17 -0
  166. package/dist/{likec4diagram/state → state}/utils.js +20 -1
  167. package/package.json +20 -24
  168. package/src/LikeC4Diagram.tsx +3 -5
  169. package/src/base/BaseXYFlow.tsx +2 -1
  170. package/src/base/primitives/compound/CompoundTitle.css.ts +0 -5
  171. package/src/context/DiagramEventHandlers.tsx +27 -13
  172. package/src/context/DiagramFeatures.tsx +8 -21
  173. package/src/hooks/index.ts +0 -1
  174. package/src/hooks/safeContext.tsx +16 -0
  175. package/src/hooks/useCurrentViewId.ts +2 -2
  176. package/src/hooks/useDiagram.ts +42 -15
  177. package/src/likec4diagram/DiagramUI.tsx +14 -11
  178. package/src/likec4diagram/XYFlow.tsx +4 -5
  179. package/src/likec4diagram/custom/edges/NotePopover.tsx +1 -2
  180. package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +1 -1
  181. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +6 -7
  182. package/src/likec4diagram/custom/nodes/toolbar/Toolbar.tsx +1 -1
  183. package/src/likec4diagram/ui/controls/ChangeAutoLayoutButton.tsx +2 -3
  184. package/src/likec4diagram/ui/controls/Controls.tsx +2 -4
  185. package/src/likec4diagram/ui/controls/NavigationButtons.tsx +1 -2
  186. package/src/likec4diagram/ui/controls/ToggleReadonly.tsx +2 -3
  187. package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +8 -11
  188. package/src/likec4diagram/ui/notation/NotationPanel.tsx +2 -3
  189. package/src/likec4diagram/ui/search/LikeC4Search.tsx +1 -4
  190. package/src/likec4diagram/ui/search/ViewsColum.tsx +1 -1
  191. package/src/likec4diagram/ui/search/state.ts +1 -1
  192. package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +1 -2
  193. package/src/likec4diagram/useViewToNodesEdges.ts +0 -4
  194. package/src/overlays/Overlays.tsx +81 -71
  195. package/src/overlays/element-details/ElementDetails.tsx +33 -0
  196. package/src/overlays/element-details/ElementDetailsCard.tsx +8 -18
  197. package/src/overlays/element-details/TabPanelDeployments.tsx +1 -1
  198. package/src/overlays/element-details/TabPanelRelationships.tsx +33 -32
  199. package/src/overlays/element-details/actor.ts +102 -0
  200. package/src/overlays/element-details/actorContext.tsx +16 -0
  201. package/src/overlays/overlay/Overlay.tsx +14 -11
  202. package/src/overlays/overlaysActor.ts +278 -0
  203. package/src/overlays/relationship-details/actor.ts +8 -11
  204. package/src/overlays/relationship-details/custom/nodeTypes.tsx +18 -0
  205. package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +23 -29
  206. package/src/overlays/relationships-browser/actor.ts +216 -220
  207. package/src/overlays/relationships-browser/custom/ElementActions.tsx +3 -2
  208. package/src/overlays/relationships-browser/custom/nodeTypes.tsx +20 -0
  209. package/src/overlays/relationships-browser/hooks.ts +7 -5
  210. package/src/overlays/types.ts +39 -0
  211. package/src/state/DiagramActorProvider.tsx +97 -0
  212. package/src/{likec4diagram/state → state}/assign.ts +4 -4
  213. package/src/{likec4diagram/state/machine.ts → state/diagram-machine.ts} +130 -205
  214. package/src/state/hotkeyActor.ts +29 -0
  215. package/src/state/inspector.ts +5 -0
  216. package/src/{likec4diagram/state → state}/syncManualLayoutActor.ts +8 -12
  217. package/src/state/types.ts +23 -0
  218. package/src/{likec4diagram/state → state}/utils.ts +24 -2
  219. package/dist/hooks/useDiagramActor.d.ts +0 -5
  220. package/dist/hooks/useDiagramActor.js +0 -21
  221. package/dist/hooks/useDiagramContext.d.ts +0 -3
  222. package/dist/hooks/useDiagramContext.js +0 -10
  223. package/dist/likec4diagram/DiagramActor.js +0 -82
  224. package/dist/likec4diagram/state/actorContext.d.ts +0 -52075
  225. package/dist/likec4diagram/state/actorContext.js +0 -12
  226. package/dist/likec4diagram/state/hotkeyActor.js +0 -18
  227. package/dist/likec4diagram/state/inspector.d.ts +0 -5
  228. package/dist/likec4diagram/state/machine.d.ts +0 -11025
  229. package/dist/likec4diagram/state/utils.d.ts +0 -8
  230. package/src/hooks/useDiagramActor.ts +0 -27
  231. package/src/hooks/useDiagramContext.ts +0 -14
  232. package/src/likec4diagram/DiagramActor.tsx +0 -92
  233. package/src/likec4diagram/state/actorContext.ts +0 -8
  234. package/src/likec4diagram/state/hotkeyActor.ts +0 -20
  235. package/src/likec4diagram/state/inspector.ts +0 -23
  236. /package/dist/{likec4diagram/state → state}/aligners.d.ts +0 -0
  237. /package/dist/{likec4diagram/state → state}/aligners.js +0 -0
  238. /package/src/{likec4diagram/state → state}/aligners.ts +0 -0
@@ -0,0 +1,233 @@
1
+ import { getHotkeyHandler } from "@mantine/hooks";
2
+ import { last, isString, reverse } from "remeda";
3
+ import { setup, stopChild, spawnChild, enqueueActions, fromCallback, assertEvent } from "xstate";
4
+ import { elementDetailsLogic } from "./element-details/actor.js";
5
+ import { relationshipDetailsLogic } from "./relationship-details/actor.js";
6
+ import { relationshipsBrowserLogic } from "./relationships-browser/actor.js";
7
+ const hotkeyLogic = fromCallback(({ sendBack }) => {
8
+ const handler = getHotkeyHandler([
9
+ ["Escape", () => sendBack({ type: "close" }), {
10
+ preventDefault: true
11
+ }]
12
+ ]);
13
+ document.body.addEventListener("keydown", handler, { capture: true });
14
+ return () => {
15
+ document.body.removeEventListener("keydown", handler, { capture: true });
16
+ };
17
+ });
18
+ const overlaysActorLogic = setup({
19
+ types: {
20
+ context: {},
21
+ events: {},
22
+ emitted: {},
23
+ children: {}
24
+ },
25
+ actors: {
26
+ relationshipDetails: relationshipDetailsLogic,
27
+ elementDetails: elementDetailsLogic,
28
+ relationshipsBrowser: relationshipsBrowserLogic,
29
+ hotkey: hotkeyLogic
30
+ },
31
+ actions: {
32
+ "closeLastOverlay": enqueueActions(({ context, enqueue }) => {
33
+ var _a;
34
+ if (context.overlays.length === 0) {
35
+ return;
36
+ }
37
+ const lastOverlay = (_a = last(context.overlays)) == null ? void 0 : _a.id;
38
+ if (!lastOverlay) {
39
+ return;
40
+ }
41
+ enqueue.sendTo(lastOverlay, { type: "close" });
42
+ enqueue.stopChild(lastOverlay);
43
+ enqueue.assign({
44
+ overlays: context.overlays.filter((o) => o.id !== lastOverlay)
45
+ });
46
+ }),
47
+ "closeSpecificOverlay": enqueueActions(({ context, enqueue }, params) => {
48
+ var _a;
49
+ const toClose = (_a = context.overlays.find((o) => o.id === params.actorId)) == null ? void 0 : _a.id;
50
+ if (toClose) {
51
+ enqueue.sendTo(toClose, { type: "close" });
52
+ enqueue.stopChild(toClose);
53
+ enqueue.assign({
54
+ overlays: context.overlays.filter((o) => o.id !== toClose)
55
+ });
56
+ }
57
+ }),
58
+ "closeAllOverlays": enqueueActions(({ context, enqueue }) => {
59
+ for (const { id } of reverse(context.overlays)) {
60
+ enqueue.sendTo(id, { type: "close" });
61
+ enqueue.stopChild(id);
62
+ }
63
+ enqueue.assign({ overlays: [] });
64
+ }),
65
+ "openElementDetails": enqueueActions(({ context, enqueue, event }) => {
66
+ assertEvent(event, "open.elementDetails");
67
+ if (context.overlays.some((o) => o.type === "elementDetails" && o.subject === event.subject)) {
68
+ return;
69
+ }
70
+ const id = `elementDetails-${context.seq}`;
71
+ enqueue.spawnChild("elementDetails", {
72
+ id,
73
+ input: event
74
+ });
75
+ enqueue.assign({
76
+ seq: context.seq + 1,
77
+ overlays: [
78
+ ...context.overlays,
79
+ {
80
+ type: "elementDetails",
81
+ id,
82
+ subject: event.subject
83
+ }
84
+ ]
85
+ });
86
+ }),
87
+ "openRelationshipDetails": enqueueActions(({ context, enqueue, event }) => {
88
+ assertEvent(event, "open.relationshipDetails");
89
+ const currentOverlay = last(context.overlays);
90
+ if ((currentOverlay == null ? void 0 : currentOverlay.type) === "relationshipDetails") {
91
+ enqueue.sendTo(currentOverlay.id, {
92
+ type: "navigate.to",
93
+ edgeId: event.edgeId
94
+ });
95
+ return;
96
+ }
97
+ const id = `relationshipDetails-${context.seq}`;
98
+ enqueue.spawnChild("relationshipDetails", {
99
+ id,
100
+ input: event
101
+ });
102
+ enqueue.assign({
103
+ seq: context.seq + 1,
104
+ overlays: [
105
+ ...context.overlays,
106
+ {
107
+ type: "relationshipDetails",
108
+ id
109
+ }
110
+ ]
111
+ });
112
+ }),
113
+ "openRelationshipsBrowser": enqueueActions(({ context, enqueue, event }) => {
114
+ assertEvent(event, "open.relationshipsBrowser");
115
+ const currentOverlay = last(context.overlays);
116
+ if ((currentOverlay == null ? void 0 : currentOverlay.type) === "relationshipsBrowser") {
117
+ enqueue.sendTo(currentOverlay.id, {
118
+ type: "navigate.to",
119
+ subject: event.subject
120
+ });
121
+ return;
122
+ }
123
+ const id = `relationshipsBrowser-${context.seq}`;
124
+ enqueue.spawnChild("relationshipsBrowser", {
125
+ id,
126
+ input: event
127
+ });
128
+ enqueue.assign({
129
+ seq: context.seq + 1,
130
+ overlays: [
131
+ ...context.overlays,
132
+ {
133
+ type: "relationshipsBrowser",
134
+ id,
135
+ subject: event.subject
136
+ }
137
+ ]
138
+ });
139
+ }),
140
+ "listenToEsc": spawnChild("hotkey", {
141
+ id: "hotkey"
142
+ }),
143
+ "stopListeningToEsc": stopChild("hotkey")
144
+ },
145
+ guards: {
146
+ "has overlays?": ({ context }) => context.overlays.length > 0,
147
+ "close specific overlay?": ({ context, event }) => {
148
+ assertEvent(event, "close");
149
+ return isString(event.actorId) && context.overlays.some((o) => o.id === event.actorId);
150
+ },
151
+ "last: is relationshipDetails?": ({ context }) => {
152
+ const lastOverlay = last(context.overlays);
153
+ return (lastOverlay == null ? void 0 : lastOverlay.type) === "relationshipDetails";
154
+ },
155
+ "last: is relationshipsBrowser?": ({ context }) => {
156
+ const lastOverlay = last(context.overlays);
157
+ return (lastOverlay == null ? void 0 : lastOverlay.type) === "relationshipsBrowser";
158
+ }
159
+ }
160
+ }).createMachine({
161
+ id: "overlays",
162
+ context: () => ({
163
+ seq: 1,
164
+ overlays: []
165
+ }),
166
+ initial: "idle",
167
+ on: {
168
+ "open.elementDetails": {
169
+ actions: "openElementDetails",
170
+ target: ".active",
171
+ reenter: false
172
+ },
173
+ "open.relationshipDetails": {
174
+ actions: "openRelationshipDetails",
175
+ target: ".active",
176
+ reenter: false
177
+ },
178
+ "open.relationshipsBrowser": {
179
+ actions: "openRelationshipsBrowser",
180
+ target: ".active",
181
+ reenter: false
182
+ }
183
+ },
184
+ states: {
185
+ idle: {},
186
+ active: {
187
+ entry: "listenToEsc",
188
+ exit: "stopListeningToEsc",
189
+ on: {
190
+ "close": [
191
+ {
192
+ guard: "close specific overlay?",
193
+ actions: {
194
+ type: "closeSpecificOverlay",
195
+ params: ({ event }) => ({ actorId: event.actorId })
196
+ },
197
+ target: "closing"
198
+ },
199
+ {
200
+ actions: "closeLastOverlay",
201
+ target: "closing"
202
+ }
203
+ ],
204
+ "close.all": {
205
+ actions: [
206
+ "closeAllOverlays",
207
+ "stopListeningToEsc"
208
+ ],
209
+ target: "idle"
210
+ }
211
+ }
212
+ },
213
+ closing: {
214
+ always: [
215
+ {
216
+ guard: "has overlays?",
217
+ target: "active"
218
+ },
219
+ {
220
+ actions: "stopListeningToEsc",
221
+ target: "idle"
222
+ }
223
+ ]
224
+ }
225
+ },
226
+ exit: [
227
+ "stopListeningToEsc",
228
+ "closeAllOverlays"
229
+ ]
230
+ });
231
+ export {
232
+ overlaysActorLogic
233
+ };
@@ -1,6 +1,6 @@
1
1
  import { BBox, DiagramView, EdgeId } from '@likec4/core';
2
2
  import { ReactFlowInstance } from '@xyflow/react';
3
- import { ActorLogic, ActorRefFromLogic, MachineSnapshot, SnapshotFrom } from 'xstate';
3
+ import { ActorLogicFrom, ActorRefFromLogic, MachineSnapshot, SnapshotFrom, StateMachine, NonReducibleUnknown, EventObject, MetaObject, AnyActorLogic, ConditionalRequired, InputFrom, RequiredLogicInput, IsNotNever, ActorRef, AnyActorRef, StateValue, AnyEventObject, ActionFunction, CancelAction } from 'xstate';
4
4
  import { RelationshipDetailsTypes } from './_types';
5
5
  type XYFLowInstance = ReactFlowInstance<RelationshipDetailsTypes.Node, RelationshipDetailsTypes.Edge>;
6
6
  export type Input = {
@@ -34,8 +34,134 @@ export type Events = {
34
34
  } | {
35
35
  type: 'close';
36
36
  };
37
- export declare const relationshipDetailsActor: ActorLogic<MachineSnapshot<Context, Events, any, "opening" | "active" | "closed", any, any, any, any>, Events, Input, any, any>;
38
- export type RelationshipDetailsLogic = typeof relationshipDetailsActor;
39
- export type RelationshipDetailsActorRef = ActorRefFromLogic<typeof relationshipDetailsActor>;
37
+ export declare const relationshipDetailsLogic: StateMachine<Readonly<Input & {
38
+ xyflow: XYFLowInstance | null;
39
+ initialized: boolean;
40
+ }>, Events, {}, never, {
41
+ type: "xyflow:fitDiagram";
42
+ params: {
43
+ duration?: number;
44
+ bounds?: BBox;
45
+ } | undefined;
46
+ }, {
47
+ type: "enable: navigate.to";
48
+ params: unknown;
49
+ }, never, "active" | "closed" | "opening", string, Input, NonReducibleUnknown, EventObject, MetaObject, {
50
+ readonly initial: "opening";
51
+ readonly context: ({ input }: {
52
+ spawn: {
53
+ <TSrc extends never>(logic: TSrc, ...[options]: never): ActorRefFromLogic<never>;
54
+ <TLogic extends AnyActorLogic>(src: TLogic, ...[options]: ConditionalRequired<[options?: {
55
+ id?: never;
56
+ systemId?: string;
57
+ input?: InputFrom<TLogic>;
58
+ syncSnapshot?: boolean;
59
+ } & { [K in RequiredLogicInput<TLogic>]: unknown; }], IsNotNever<RequiredLogicInput<TLogic>>>): ActorRefFromLogic<TLogic>;
60
+ };
61
+ input: Input;
62
+ self: ActorRef<MachineSnapshot<Readonly<Input & {
63
+ xyflow: XYFLowInstance | null;
64
+ initialized: boolean;
65
+ }>, Events, Record<string, AnyActorRef | undefined>, StateValue, string, unknown, any, any>, Events, AnyEventObject>;
66
+ }) => {
67
+ initialized: false;
68
+ xyflow: null;
69
+ edgeId: EdgeId;
70
+ view: DiagramView;
71
+ };
72
+ readonly states: {
73
+ readonly opening: {
74
+ readonly on: {
75
+ readonly 'xyflow.init': {
76
+ readonly actions: ActionFunction<Readonly<Input & {
77
+ xyflow: XYFLowInstance | null;
78
+ initialized: boolean;
79
+ }>, {
80
+ type: "xyflow.init";
81
+ instance: XYFLowInstance;
82
+ }, Events, undefined, never, never, never, never, never>;
83
+ readonly target: "active";
84
+ };
85
+ readonly close: {
86
+ readonly target: "closed";
87
+ };
88
+ };
89
+ };
90
+ readonly active: {
91
+ readonly entry: {
92
+ readonly type: "xyflow:fitDiagram";
93
+ readonly params: {
94
+ readonly duration: 0;
95
+ };
96
+ };
97
+ readonly on: {
98
+ readonly 'navigate.to': {
99
+ readonly actions: readonly [ ActionFunction<Readonly<Input & {
100
+ xyflow: XYFLowInstance | null;
101
+ initialized: boolean;
102
+ }>, {
103
+ type: "navigate.to";
104
+ edgeId: EdgeId;
105
+ }, Events, undefined, never, never, never, never, never>, ActionFunction<Readonly<Input & {
106
+ xyflow: XYFLowInstance | null;
107
+ initialized: boolean;
108
+ }>, {
109
+ type: "navigate.to";
110
+ edgeId: EdgeId;
111
+ }, Events, undefined, never, never, never, never, never>];
112
+ };
113
+ readonly close: {
114
+ readonly target: "closed";
115
+ };
116
+ };
117
+ readonly exit: ActionFunction<Readonly<Input & {
118
+ xyflow: XYFLowInstance | null;
119
+ initialized: boolean;
120
+ }>, Events, Events, undefined, never, never, never, never, never>;
121
+ };
122
+ readonly closed: {
123
+ readonly type: "final";
124
+ };
125
+ };
126
+ readonly on: {
127
+ readonly fitDiagram: {
128
+ readonly actions: {
129
+ readonly type: "xyflow:fitDiagram";
130
+ readonly params: (data: {
131
+ context: Readonly<Input & {
132
+ xyflow: XYFLowInstance | null;
133
+ initialized: boolean;
134
+ }>;
135
+ event: {
136
+ type: "fitDiagram";
137
+ duration?: number;
138
+ bounds?: BBox;
139
+ };
140
+ }) => {
141
+ type: "fitDiagram";
142
+ duration?: number;
143
+ bounds?: BBox;
144
+ };
145
+ };
146
+ };
147
+ readonly 'xyflow.resized': {
148
+ readonly actions: readonly [ CancelAction<Readonly<Input & {
149
+ xyflow: XYFLowInstance | null;
150
+ initialized: boolean;
151
+ }>, {
152
+ type: "xyflow.resized";
153
+ }, undefined, Events>, ActionFunction<Readonly<Input & {
154
+ xyflow: XYFLowInstance | null;
155
+ initialized: boolean;
156
+ }>, {
157
+ type: "xyflow.resized";
158
+ }, Events, undefined, never, never, never, never, never>];
159
+ };
160
+ };
161
+ }>;
162
+ export interface RelationshipDetailsLogic extends ActorLogicFrom<typeof relationshipDetailsLogic> {
163
+ }
164
+ export interface RelationshipDetailsActorRef extends ActorRefFromLogic<RelationshipDetailsLogic> {
165
+ }
40
166
  export type RelationshipDetailsSnapshot = SnapshotFrom<RelationshipDetailsActorRef>;
41
167
  export {};
@@ -3,7 +3,7 @@ import "@xyflow/react";
3
3
  import { prop } from "remeda";
4
4
  import { setup, cancel, raise, assign } from "xstate";
5
5
  import { MinZoom } from "../../base/const.js";
6
- const relationshipDetailsActor = setup({
6
+ const relationshipDetailsLogic = setup({
7
7
  types: {
8
8
  context: {},
9
9
  input: {},
@@ -109,5 +109,5 @@ const relationshipDetailsActor = setup({
109
109
  }
110
110
  });
111
111
  export {
112
- relationshipDetailsActor
112
+ relationshipDetailsLogic
113
113
  };
@@ -7,9 +7,9 @@ export declare const edgeTypes: {
7
7
  target: string;
8
8
  style?: CSSProperties;
9
9
  id: string;
10
+ selected?: boolean;
10
11
  selectable?: boolean;
11
12
  deletable?: boolean;
12
- selected?: boolean;
13
13
  animated?: boolean;
14
14
  sourceX: number;
15
15
  sourceY: number;
@@ -2,23 +2,40 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { ElementActions } from "./ElementActions.js";
3
3
  import { Handle } from "@xyflow/react";
4
4
  import { Position } from "@xyflow/system";
5
+ import { useDiagram } from "../../../hooks/useDiagram.js";
5
6
  import { customNode } from "../../../base/primitives/customNode.js";
6
7
  import { CompoundNodeContainer } from "../../../base/primitives/compound/CompoundNodeContainer.js";
7
8
  import { CompoundTitle } from "../../../base/primitives/compound/CompoundTitle.js";
8
9
  import { ElementNodeContainer } from "../../../base/primitives/element/ElementNodeContainer.js";
9
10
  import { ElementShape } from "../../../base/primitives/element/ElementShape.js";
10
11
  import { ElementTitle } from "../../../base/primitives/element/ElementTitle.js";
12
+ import { ElementDetailsButton } from "../../../base/primitives/element/ElementDetailsButton.js";
13
+ const ElementDetailsButtonWithHandler = (props) => {
14
+ const diagram = useDiagram();
15
+ return /* @__PURE__ */ jsx(
16
+ ElementDetailsButton,
17
+ {
18
+ ...props,
19
+ onClick: (e) => {
20
+ e.stopPropagation();
21
+ diagram.openElementDetails(props.data.fqn);
22
+ }
23
+ }
24
+ );
25
+ };
11
26
  const nodeTypes = {
12
27
  element: customNode((props) => {
13
28
  return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
14
29
  /* @__PURE__ */ jsx(ElementShape, { ...props }),
15
30
  /* @__PURE__ */ jsx(ElementTitle, { ...props, iconSize: 40 }),
31
+ /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
16
32
  /* @__PURE__ */ jsx(ElementActions, { ...props }),
17
33
  /* @__PURE__ */ jsx(ElementPorts, { ...props })
18
34
  ] });
19
35
  }),
20
36
  compound: customNode((props) => {
21
37
  return /* @__PURE__ */ jsxs(CompoundNodeContainer, { nodeProps: props, children: [
38
+ /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
22
39
  /* @__PURE__ */ jsx(CompoundTitle, { ...props }),
23
40
  /* @__PURE__ */ jsx(CompoundPorts, { ...props })
24
41
  ] });
@@ -2,11 +2,11 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { ActionIcon, Group, Box } from "@mantine/core";
3
3
  import { useCallbackRef, useStateHistory } from "@mantine/hooks";
4
4
  import { IconX, IconChevronLeft, IconChevronRight } from "@tabler/icons-react";
5
- import { ReactFlowProvider, useStoreApi, Panel } from "@xyflow/react";
5
+ import { ReactFlowProvider, useStoreApi, useReactFlow, Panel } from "@xyflow/react";
6
6
  import clsx from "clsx";
7
7
  import { shallowEqual } from "fast-equals";
8
- import { AnimatePresence, LayoutGroup, m } from "framer-motion";
9
- import { useId, useRef, memo, useEffect } from "react";
8
+ import { LayoutGroup, AnimatePresence, m } from "framer-motion";
9
+ import { useRef, memo, useEffect } from "react";
10
10
  import { BaseXYFlow } from "../../base/BaseXYFlow.js";
11
11
  import { useRelationshipsView } from "./-useRelationshipsView.js";
12
12
  import { ViewPadding } from "./const.js";
@@ -15,28 +15,24 @@ import { nodeTypes } from "./custom/nodeTypes.js";
15
15
  import { RelationshipsBrowserActorContext, useRelationshipsBrowser, useRelationshipsBrowserState } from "./hooks.js";
16
16
  import { SelectElement } from "./SelectElement.js";
17
17
  function RelationshipsBrowser({ actorRef }) {
18
- const id = useId();
19
18
  const initialRef = useRef(null);
20
19
  if (initialRef.current == null) {
21
20
  initialRef.current = {
22
- initialNodes: [],
23
- initialEdges: []
21
+ defaultNodes: [],
22
+ defaultEdges: []
24
23
  };
25
24
  }
26
- return /* @__PURE__ */ jsx(RelationshipsBrowserActorContext.Provider, { value: actorRef, children: /* @__PURE__ */ jsx(ReactFlowProvider, { ...initialRef.current, children: /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(LayoutGroup, { id, children: /* @__PURE__ */ jsx(RelationshipsBrowserXYFlow, {}) }) }) }) });
25
+ return /* @__PURE__ */ jsx(RelationshipsBrowserActorContext.Provider, { value: actorRef, children: /* @__PURE__ */ jsx(ReactFlowProvider, { ...initialRef.current, children: /* @__PURE__ */ jsx(LayoutGroup, { id: actorRef.sessionId, inherit: false, children: /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(RelationshipsBrowserXYFlow, {}) }) }) }) });
27
26
  }
28
27
  const selector = (state) => ({
29
- initialized: state.context.initialized,
30
28
  isActive: state.hasTag("active"),
31
29
  nodes: state.context.xynodes,
32
30
  edges: state.context.xyedges
33
31
  });
34
- const selectorEq = (a, b) => a.initialized === b.initialized && a.isActive === b.isActive && shallowEqual(a.nodes, b.nodes) && shallowEqual(a.edges, b.edges);
32
+ const selectorEq = (a, b) => a.isActive === b.isActive && shallowEqual(a.nodes, b.nodes) && shallowEqual(a.edges, b.edges);
35
33
  const RelationshipsBrowserXYFlow = memo(() => {
36
- const xystore = useStoreApi();
37
34
  const browser = useRelationshipsBrowser();
38
35
  const {
39
- initialized,
40
36
  isActive,
41
37
  nodes,
42
38
  edges
@@ -47,16 +43,13 @@ const RelationshipsBrowserXYFlow = memo(() => {
47
43
  return /* @__PURE__ */ jsx(
48
44
  BaseXYFlow,
49
45
  {
50
- id: "relationships-browser",
46
+ id: `relationships-browser-${browser.actor.sessionId}`,
51
47
  nodes,
52
48
  edges,
53
- className: clsx(initialized && isActive ? "initialized" : "not-initialized"),
49
+ className: clsx(isActive ? "initialized" : "not-initialized"),
54
50
  nodeTypes,
55
51
  edgeTypes,
56
52
  fitViewPadding: ViewPadding,
57
- onInit: useCallbackRef((instance) => {
58
- browser.send({ type: "xyflow.init", instance, store: xystore });
59
- }),
60
53
  onNodeClick: useCallbackRef((e, node) => {
61
54
  e.stopPropagation();
62
55
  browser.send({ type: "xyflow.nodeClick", node });
@@ -86,7 +79,7 @@ const RelationshipsBrowserXYFlow = memo(() => {
86
79
  fitView: false,
87
80
  pannable: true,
88
81
  zoomable: true,
89
- children: initialized && /* @__PURE__ */ jsx(RelationshipsBrowserInner, {})
82
+ children: /* @__PURE__ */ jsx(RelationshipsBrowserInner, {})
90
83
  }
91
84
  );
92
85
  });
@@ -102,6 +95,11 @@ const RelationshipsBrowserInner = memo(() => {
102
95
  closeable,
103
96
  enableNavigationMenu
104
97
  } = useRelationshipsBrowserState(selector2);
98
+ const store = useStoreApi();
99
+ const instance = useReactFlow();
100
+ useEffect(() => {
101
+ browser.send({ type: "xyflow.init", instance, store });
102
+ }, [store, instance, browser]);
105
103
  const layouted = useRelationshipsView(subjectId);
106
104
  const [historySubjectId, historyOps, { history, current }] = useStateHistory(subjectId);
107
105
  useEffect(() => {
@@ -113,10 +111,10 @@ const RelationshipsBrowserInner = memo(() => {
113
111
  if (historySubjectId !== subjectId) {
114
112
  browser.navigateTo(historySubjectId);
115
113
  }
116
- }, [historySubjectId]);
114
+ }, [historySubjectId, browser]);
117
115
  useEffect(() => {
118
116
  browser.send({ type: "update.view", layouted });
119
- }, [layouted]);
117
+ }, [layouted, browser]);
120
118
  const hasStepBack = current > 0;
121
119
  const hasStepForward = current + 1 < history.length;
122
120
  return /* @__PURE__ */ jsxs(Fragment, { children: [