@likec4/diagram 1.34.1 → 1.35.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 (266) hide show
  1. package/bundle/{chunk-Dd7et66b.js → chunk-C0Eg81Gj.js} +971 -1045
  2. package/bundle/custom.js +59 -55
  3. package/bundle/index.js +6656 -4263
  4. package/dist/LikeC4Diagram.props.d.ts +51 -4
  5. package/dist/LikeC4ModelProvider.d.ts +3 -3
  6. package/dist/base/BaseXYFlow.d.ts +2 -2
  7. package/dist/base/BaseXYFlow.js +3 -3
  8. package/dist/base/primitives/compound/CompoundActionButton.js +1 -1
  9. package/dist/base/primitives/compound/CompoundDetailsButton.js +1 -1
  10. package/dist/base/primitives/edge/EdgeActionButton.js +1 -1
  11. package/dist/base/primitives/element/ElementDetailsButton.js +1 -1
  12. package/dist/base/primitives/element/ElementNodeContainer.d.ts +3 -3
  13. package/dist/base/primitives/element/ElementTitle.js +9 -9
  14. package/dist/bundle/LikeC4View.js +3 -3
  15. package/dist/bundle/LikeC4View.props.d.ts +8 -4
  16. package/dist/bundle/custom.js +1 -0
  17. package/dist/bundle/index.js +1 -0
  18. package/dist/components/ErrorFallback.d.ts +2 -1
  19. package/dist/components/ErrorFallback.js +15 -2
  20. package/dist/components/Link.js +2 -2
  21. package/dist/components/NavigationLink.d.ts +6 -0
  22. package/dist/components/NavigationLink.js +25 -0
  23. package/dist/components/SearchControl.js +1 -1
  24. package/dist/context/ControlsCustomLayout.d.ts +0 -1
  25. package/dist/context/DiagramFeatures.d.ts +4 -1
  26. package/dist/context/IconRenderer.js +6 -6
  27. package/dist/custom/customNodes.js +10 -2
  28. package/dist/custom/hooks.d.ts +1 -0
  29. package/dist/custom/index.js +1 -0
  30. package/dist/hooks/useDiagram.d.ts +1 -2
  31. package/dist/hooks/useDiagram.js +1 -5
  32. package/dist/index.js +1 -0
  33. package/dist/likec4diagram/DiagramUI.js +8 -4
  34. package/dist/likec4diagram/DiagramXYFlow.js +1 -1
  35. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +4 -4
  36. package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
  37. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +2 -2
  38. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
  39. package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +1 -1
  40. package/dist/likec4diagram/ui/controls/Controls.js +11 -15
  41. package/dist/likec4diagram/ui/controls/LayoutDriftNotification.js +1 -1
  42. package/dist/likec4diagram/ui/controls/ManualLayoutToolsButton.js +9 -9
  43. package/dist/likec4diagram/ui/controls/NavigationButtons.js +4 -2
  44. package/dist/likec4diagram/ui/controls/ToggleReadonly.js +2 -2
  45. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +15 -13
  46. package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
  47. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +4 -4
  48. package/dist/likec4model/LikeC4ModelContext.d.ts +4 -1
  49. package/dist/likec4model/LikeC4ModelContext.js +2 -1
  50. package/dist/likec4model/index.d.ts +1 -0
  51. package/dist/likec4model/useCurrentViewModel.d.ts +2 -0
  52. package/dist/likec4model/useCurrentViewModel.js +12 -0
  53. package/dist/likec4model/useLikeC4Model.d.ts +2 -5
  54. package/dist/likec4model/useLikeC4Model.js +10 -16
  55. package/dist/navigationpanel/NavigationPanel.d.ts +2 -0
  56. package/dist/navigationpanel/NavigationPanel.js +124 -0
  57. package/dist/navigationpanel/NavigationPanelControls.d.ts +1 -0
  58. package/dist/navigationpanel/NavigationPanelControls.js +134 -0
  59. package/dist/navigationpanel/NavigationPanelDropdown.d.ts +1 -0
  60. package/dist/navigationpanel/NavigationPanelDropdown.js +436 -0
  61. package/dist/navigationpanel/_common.d.ts +15 -0
  62. package/dist/navigationpanel/_common.js +69 -0
  63. package/dist/navigationpanel/actor.d.ts +300 -0
  64. package/dist/navigationpanel/actor.js +240 -0
  65. package/dist/navigationpanel/controls/BurgerButton.d.ts +1 -0
  66. package/dist/navigationpanel/controls/BurgerButton.js +36 -0
  67. package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -0
  68. package/dist/navigationpanel/controls/NavigationButtons.js +44 -0
  69. package/dist/navigationpanel/controls/OpenSource.d.ts +1 -0
  70. package/dist/navigationpanel/controls/OpenSource.js +27 -0
  71. package/dist/navigationpanel/controls/SearchControl.d.ts +1 -0
  72. package/dist/navigationpanel/controls/SearchControl.js +68 -0
  73. package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -0
  74. package/dist/navigationpanel/controls/ToggleReadonly.js +69 -0
  75. package/dist/navigationpanel/controls/index.d.ts +5 -0
  76. package/dist/navigationpanel/editorpanel/CenterCamera.d.ts +1 -0
  77. package/dist/navigationpanel/editorpanel/CenterCamera.js +12 -0
  78. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -0
  79. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +157 -0
  80. package/dist/navigationpanel/editorpanel/EditorPanel.d.ts +1 -0
  81. package/dist/navigationpanel/editorpanel/EditorPanel.js +48 -0
  82. package/dist/navigationpanel/editorpanel/LayoutDriftNotification.d.ts +1 -0
  83. package/dist/navigationpanel/editorpanel/LayoutDriftNotification.js +56 -0
  84. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -0
  85. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +174 -0
  86. package/dist/navigationpanel/editorpanel/_common.d.ts +6 -0
  87. package/dist/navigationpanel/editorpanel/_common.js +14 -0
  88. package/dist/navigationpanel/editorpanel/index.d.ts +1 -0
  89. package/dist/navigationpanel/editorpanel/styles.d.ts +8 -0
  90. package/dist/navigationpanel/editorpanel/styles.js +79 -0
  91. package/dist/navigationpanel/hooks.d.ts +20 -0
  92. package/dist/navigationpanel/hooks.js +38 -0
  93. package/dist/navigationpanel/index.d.ts +1 -0
  94. package/dist/navigationpanel/styles.css.d.ts +16 -0
  95. package/dist/navigationpanel/styles.css.js +32 -0
  96. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.d.ts +2 -0
  97. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +157 -0
  98. package/dist/navigationpanel/walkthrough/index.d.ts +1 -0
  99. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.31.0_react@19.1.0 → @tabler_icons-react@3.34.1_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
  100. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.31.0_react@19.1.0 → @tabler_icons-react@3.34.1_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
  101. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +14 -0
  102. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +14 -0
  103. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +14 -0
  104. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +14 -0
  105. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +14 -0
  106. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +14 -0
  107. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +14 -0
  108. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +14 -0
  109. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +14 -0
  110. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +14 -0
  111. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +14 -0
  112. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +14 -0
  113. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +14 -0
  114. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +14 -0
  115. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +14 -0
  116. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +14 -0
  117. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +14 -0
  118. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +14 -0
  119. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +14 -0
  120. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +14 -0
  121. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +14 -0
  122. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +14 -0
  123. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +14 -0
  124. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +14 -0
  125. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +14 -0
  126. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +14 -0
  127. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +14 -0
  128. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +14 -0
  129. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +14 -0
  130. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu.js +14 -0
  131. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu2.js +14 -0
  132. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +14 -0
  133. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +14 -0
  134. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +14 -0
  135. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +14 -0
  136. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +14 -0
  137. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +14 -0
  138. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +14 -0
  139. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +14 -0
  140. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +14 -0
  141. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +14 -0
  142. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +14 -0
  143. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +14 -0
  144. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +14 -0
  145. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +14 -0
  146. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +14 -0
  147. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +14 -0
  148. package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
  149. package/dist/overlays/element-details/TabPanelDeployments.js +3 -3
  150. package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
  151. package/dist/overlays/element-details/TabPanelStructure.js +1 -1
  152. package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
  153. package/dist/overlays/relationship-details/SelectEdge.js +2 -2
  154. package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
  155. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +3 -3
  156. package/dist/overlays/relationships-browser/SelectElement.js +2 -2
  157. package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
  158. package/dist/search/components/ElementsColumn.js +1 -1
  159. package/dist/search/components/PickView.js +1 -1
  160. package/dist/search/components/SearchByTags.js +1 -1
  161. package/dist/search/components/SearchInput.js +1 -1
  162. package/dist/search/components/ViewsColum.js +2 -2
  163. package/dist/state/DiagramActorProvider.d.ts +2 -2
  164. package/dist/state/DiagramActorProvider.js +48 -10
  165. package/dist/state/diagram-machine.d.ts +2 -2
  166. package/dist/styles-min.css +1 -1
  167. package/dist/styles.css +1 -1
  168. package/dist/styles.css2.js +1 -1
  169. package/package.json +16 -15
  170. package/panda.buildinfo.json +170 -134
  171. package/src/LikeC4Diagram.props.ts +51 -3
  172. package/src/LikeC4ModelProvider.tsx +3 -3
  173. package/src/base/BaseXYFlow.tsx +4 -4
  174. package/src/base/primitives/element/ElementNodeContainer.tsx +2 -2
  175. package/src/base/primitives/element/ElementTitle.tsx +4 -4
  176. package/src/bundle/LikeC4View.props.ts +14 -4
  177. package/src/bundle/LikeC4View.tsx +2 -2
  178. package/src/components/ErrorFallback.tsx +16 -1
  179. package/src/components/NavigationLink.tsx +31 -0
  180. package/src/context/ControlsCustomLayout.ts +0 -1
  181. package/src/context/DiagramFeatures.tsx +6 -1
  182. package/src/custom/customNodes.tsx +10 -2
  183. package/src/custom/hooks.ts +3 -0
  184. package/src/hooks/useDiagram.ts +0 -8
  185. package/src/likec4diagram/DiagramUI.tsx +9 -3
  186. package/src/likec4diagram/DiagramXYFlow.tsx +1 -1
  187. package/src/likec4diagram/ui/controls/Controls.tsx +8 -18
  188. package/src/likec4diagram/ui/controls/NavigationButtons.tsx +2 -0
  189. package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +14 -11
  190. package/src/likec4model/LikeC4ModelContext.ts +5 -1
  191. package/src/likec4model/index.ts +3 -0
  192. package/src/likec4model/useCurrentViewModel.ts +10 -0
  193. package/src/likec4model/useLikeC4Model.ts +17 -27
  194. package/src/navigationpanel/NavigationPanel.tsx +136 -0
  195. package/src/navigationpanel/NavigationPanelControls.tsx +155 -0
  196. package/src/navigationpanel/NavigationPanelDropdown.tsx +523 -0
  197. package/src/navigationpanel/_common.tsx +81 -0
  198. package/src/navigationpanel/actor.ts +321 -0
  199. package/src/navigationpanel/controls/BurgerButton.tsx +32 -0
  200. package/src/navigationpanel/controls/NavigationButtons.tsx +36 -0
  201. package/src/navigationpanel/controls/OpenSource.tsx +28 -0
  202. package/src/navigationpanel/controls/SearchControl.tsx +64 -0
  203. package/src/navigationpanel/controls/ToggleReadonly.tsx +66 -0
  204. package/src/navigationpanel/controls/index.ts +5 -0
  205. package/src/navigationpanel/editorpanel/CenterCamera.tsx +15 -0
  206. package/src/navigationpanel/editorpanel/ChangeAutoLayoutButton.tsx +199 -0
  207. package/src/navigationpanel/editorpanel/EditorPanel.tsx +49 -0
  208. package/src/navigationpanel/editorpanel/LayoutDriftNotification.tsx +56 -0
  209. package/src/navigationpanel/editorpanel/ManualLayoutToolsButton.tsx +151 -0
  210. package/src/navigationpanel/editorpanel/_common.tsx +14 -0
  211. package/src/navigationpanel/editorpanel/index.ts +1 -0
  212. package/src/navigationpanel/editorpanel/styles.ts +84 -0
  213. package/src/navigationpanel/hooks.tsx +70 -0
  214. package/src/navigationpanel/index.ts +1 -0
  215. package/src/navigationpanel/styles.css.ts +30 -0
  216. package/src/navigationpanel/walkthrough/ActiveWalkthroughControls.tsx +160 -0
  217. package/src/navigationpanel/walkthrough/index.tsx +1 -0
  218. package/src/state/DiagramActorProvider.tsx +60 -12
  219. package/src/state/diagram-machine.ts +2 -2
  220. package/dist/base/primitives/element/ElementTitle.css.d.ts +0 -34
  221. package/dist/base/primitives/element/ElementTitle.css.js +0 -201
  222. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -13
  223. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -13
  224. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -13
  225. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -13
  226. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -13
  227. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -13
  228. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -13
  229. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -13
  230. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -13
  231. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -13
  232. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -13
  233. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -13
  234. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -13
  235. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -13
  236. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -13
  237. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -13
  238. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -13
  239. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -13
  240. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -13
  241. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -13
  242. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -13
  243. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -13
  244. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -13
  245. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -13
  246. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -13
  247. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -13
  248. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -13
  249. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu.js +0 -13
  250. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu2.js +0 -13
  251. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -13
  252. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -13
  253. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -13
  254. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -13
  255. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -13
  256. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -13
  257. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -13
  258. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -13
  259. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -13
  260. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -13
  261. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -13
  262. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -13
  263. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -13
  264. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -13
  265. package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -13
  266. package/src/base/primitives/element/ElementTitle.css.ts +0 -206
@@ -0,0 +1,199 @@
1
+ import type { AutoLayoutDirection } from '@likec4/core'
2
+ import {
3
+ Box,
4
+ Flex,
5
+ FloatingIndicator,
6
+ Popover,
7
+ PopoverDropdown,
8
+ PopoverTarget,
9
+ Text,
10
+ UnstyledButton,
11
+ } from '@mantine/core'
12
+ import {
13
+ type UseMovePosition,
14
+ clampUseMovePosition,
15
+ useHover,
16
+ useMergedRef,
17
+ useMove,
18
+ useUncontrolled,
19
+ } from '@mantine/hooks'
20
+ import { useDebouncedCallback } from '@react-hookz/web'
21
+ import { IconLayoutDashboard } from '@tabler/icons-react'
22
+ import { forwardRef, useState } from 'react'
23
+ import { useDiagramEventHandlers } from '../../context'
24
+ import { useDiagram, useDiagramContext } from '../../hooks/useDiagram'
25
+ import type { DiagramContext } from '../../state/types'
26
+ import { PanelActionIcon } from '../_common'
27
+ import { Tooltip } from './_common'
28
+ import * as css from './styles'
29
+
30
+ const selector = (state: DiagramContext) => ({
31
+ viewId: state.view.id,
32
+ autoLayout: state.view.autoLayout,
33
+ })
34
+
35
+ export const ChangeAutoLayoutButton = () => {
36
+ const { onChange } = useDiagramEventHandlers()
37
+ const diagram = useDiagram()
38
+ const [rootRef, setRootRef] = useState<HTMLDivElement | null>(null)
39
+ const [controlsRefs, setControlsRefs] = useState<Record<AutoLayoutDirection, HTMLButtonElement | null>>({} as any)
40
+ const {
41
+ autoLayout,
42
+ viewId,
43
+ } = useDiagramContext(selector)
44
+
45
+ const { ref, hovered: isSpacingHovered } = useHover()
46
+
47
+ const setControlRef = (name: AutoLayoutDirection) => (node: HTMLButtonElement) => {
48
+ controlsRefs[name] = node
49
+ setControlsRefs(controlsRefs)
50
+ }
51
+
52
+ const setAutoLayout = (direction: AutoLayoutDirection) => (event: React.MouseEvent<HTMLButtonElement>) => {
53
+ event.stopPropagation()
54
+ onChange?.({
55
+ change: {
56
+ op: 'change-autolayout',
57
+ layout: {
58
+ ...autoLayout,
59
+ direction,
60
+ },
61
+ },
62
+ })
63
+ }
64
+
65
+ const setSpacing = (nodeSep: number | null, rankSep: number | null) => {
66
+ // Force fitDiagram
67
+ diagram.fitDiagram()
68
+ onChange?.({
69
+ change: {
70
+ op: 'change-autolayout',
71
+ layout: {
72
+ ...autoLayout,
73
+ nodeSep,
74
+ rankSep,
75
+ },
76
+ },
77
+ })
78
+ }
79
+
80
+ return (
81
+ <Popover
82
+ position="right-start"
83
+ clickOutsideEvents={[
84
+ 'pointerdown',
85
+ ]}
86
+ radius="xs"
87
+ shadow="lg"
88
+ offset={{
89
+ mainAxis: 10,
90
+ }}>
91
+ <PopoverTarget>
92
+ <Tooltip label="Change Auto Layout">
93
+ <PanelActionIcon>
94
+ <IconLayoutDashboard />
95
+ </PanelActionIcon>
96
+ </Tooltip>
97
+ </PopoverTarget>
98
+ <PopoverDropdown className="likec4-top-left-panel" p={8} pt={6} opacity={isSpacingHovered ? 0.6 : 1}>
99
+ <Box pos={'relative'} ref={setRootRef}>
100
+ <FloatingIndicator
101
+ target={controlsRefs[autoLayout.direction]}
102
+ parent={rootRef}
103
+ className={css.autolayoutIndicator}
104
+ />
105
+ <Box mb={10}>
106
+ <Text inline fz={'xs'} c={'dimmed'} fw={500}>Auto layout:</Text>
107
+ </Box>
108
+ <Flex gap={2} wrap={'wrap'} justify={'stretch'} maw={160}>
109
+ <UnstyledButton className={css.autolayoutButton} ref={setControlRef('TB')} onClick={setAutoLayout('TB')}>
110
+ Top-Bottom
111
+ </UnstyledButton>
112
+ <UnstyledButton className={css.autolayoutButton} ref={setControlRef('BT')} onClick={setAutoLayout('BT')}>
113
+ Bottom-Top
114
+ </UnstyledButton>
115
+ <UnstyledButton className={css.autolayoutButton} ref={setControlRef('LR')} onClick={setAutoLayout('LR')}>
116
+ Left-Right
117
+ </UnstyledButton>
118
+ <UnstyledButton className={css.autolayoutButton} ref={setControlRef('RL')} onClick={setAutoLayout('RL')}>
119
+ Right-Left
120
+ </UnstyledButton>
121
+ </Flex>
122
+ <Box my={10}>
123
+ <Text inline fz={'xs'} c={'dimmed'} fw={500}>Spacing:</Text>
124
+ </Box>
125
+ <SpacingSliders
126
+ ref={ref}
127
+ isVertical={autoLayout.direction === 'TB' || autoLayout.direction === 'BT'}
128
+ key={viewId}
129
+ nodeSep={autoLayout.nodeSep}
130
+ rankSep={autoLayout.rankSep}
131
+ onChange={setSpacing}
132
+ />
133
+ </Box>
134
+ </PopoverDropdown>
135
+ </Popover>
136
+ )
137
+ }
138
+
139
+ const MAX_SPACING = 400
140
+ const SpacingSliders = forwardRef<HTMLDivElement | null, {
141
+ isVertical: boolean
142
+ nodeSep: number | undefined
143
+ rankSep: number | undefined
144
+ onChange: (nodeSep: number, rankSep: number) => void
145
+ }>(({
146
+ isVertical,
147
+ nodeSep,
148
+ rankSep,
149
+ onChange,
150
+ }, _ref) => {
151
+ if (!isVertical) {
152
+ ;[nodeSep, rankSep] = [rankSep, nodeSep]
153
+ }
154
+
155
+ const propagateChange = useDebouncedCallback(
156
+ ({ x, y }: UseMovePosition) => {
157
+ if (!isVertical) {
158
+ ;[x, y] = [y, x]
159
+ }
160
+ onChange(Math.round(x * MAX_SPACING), Math.round(y * MAX_SPACING))
161
+ },
162
+ [onChange, isVertical],
163
+ 250,
164
+ 2000,
165
+ )
166
+
167
+ const [value, setValue] = useUncontrolled({
168
+ defaultValue: clampUseMovePosition({
169
+ x: (nodeSep ?? 100) / MAX_SPACING,
170
+ y: (rankSep ?? 120) / MAX_SPACING,
171
+ }),
172
+ onChange: propagateChange,
173
+ })
174
+
175
+ const { ref } = useMove(setValue)
176
+
177
+ let nodeSepValue = Math.round(value.x * MAX_SPACING)
178
+ let rankSepValue = Math.round(value.y * MAX_SPACING)
179
+ if (!isVertical) {
180
+ ;[nodeSepValue, rankSepValue] = [rankSepValue, nodeSepValue]
181
+ }
182
+
183
+ const mergedRef = useMergedRef(ref, _ref)
184
+
185
+ return (
186
+ <Box ref={mergedRef} className={css.spacingSliderBody} pt={'100%'}>
187
+ <Box
188
+ className={css.spacingSliderThumb}
189
+ style={{
190
+ left: `${value.x * 100}%`,
191
+ top: `${value.y * 100}%`,
192
+ }}
193
+ />
194
+ <Box pos={'absolute'} left={2} bottom={2}>
195
+ <Text component="div" fz={8} c={'dimmed'} fw={500}>{rankSepValue}, {nodeSepValue}</Text>
196
+ </Box>
197
+ </Box>
198
+ )
199
+ })
@@ -0,0 +1,49 @@
1
+ import { vstack } from '@likec4/styles/patterns'
2
+ import { TooltipGroup } from '@mantine/core'
3
+ import { AnimatePresence } from 'motion/react'
4
+ import * as m from 'motion/react-m'
5
+ import { useEnabledFeatures } from '../../context'
6
+ import { CenterCamera } from './CenterCamera'
7
+ import { ChangeAutoLayoutButton } from './ChangeAutoLayoutButton'
8
+ import { LayoutDriftNotification } from './LayoutDriftNotification'
9
+ import { ManualLayoutToolsButton } from './ManualLayoutToolsButton'
10
+
11
+ export function EditorPanel() {
12
+ const { enableReadOnly } = useEnabledFeatures()
13
+ return (
14
+ <AnimatePresence>
15
+ {!enableReadOnly && (
16
+ <m.div
17
+ layout="position"
18
+ className={vstack({
19
+ gap: 'sm',
20
+ layerStyle: 'likec4.panel',
21
+ position: 'relative',
22
+ cursor: 'pointer',
23
+ padding: '4',
24
+ pointerEvents: 'all',
25
+ })}
26
+ initial={{
27
+ opacity: 0,
28
+ translateX: -20,
29
+ }}
30
+ animate={{
31
+ opacity: 1,
32
+ translateX: 0,
33
+ }}
34
+ exit={{
35
+ opacity: 0,
36
+ translateX: -20,
37
+ }}
38
+ >
39
+ <TooltipGroup>
40
+ <ChangeAutoLayoutButton />
41
+ <ManualLayoutToolsButton />
42
+ <LayoutDriftNotification />
43
+ <CenterCamera />
44
+ </TooltipGroup>
45
+ </m.div>
46
+ )}
47
+ </AnimatePresence>
48
+ )
49
+ }
@@ -0,0 +1,56 @@
1
+ import {
2
+ ActionIcon,
3
+ Code,
4
+ HoverCard,
5
+ HoverCardDropdown,
6
+ HoverCardTarget,
7
+ Notification,
8
+ Text,
9
+ } from '@mantine/core'
10
+ import {
11
+ IconAlertTriangle,
12
+ } from '@tabler/icons-react'
13
+
14
+ import { css } from '@likec4/styles/css'
15
+ import { useMantinePortalProps } from '../../hooks'
16
+ import { useDiagramContext } from '../../hooks/useDiagram'
17
+
18
+ export const LayoutDriftNotification = () => {
19
+ const portalProps = useMantinePortalProps()
20
+ const hasLayoutDrift = useDiagramContext(c => c.view.hasLayoutDrift ?? false)
21
+ if (!hasLayoutDrift) return null
22
+ return (
23
+ <HoverCard
24
+ position="right-start"
25
+ openDelay={200}
26
+ closeDelay={100}
27
+ {...portalProps}>
28
+ <HoverCardTarget>
29
+ <ActionIcon
30
+ color={'orange'}
31
+ c="orange"
32
+ className={css({
33
+ bg: 'mantine.colors.orange.light',
34
+ })}
35
+ >
36
+ <IconAlertTriangle />
37
+ </ActionIcon>
38
+ </HoverCardTarget>
39
+ <HoverCardDropdown p={'0'}>
40
+ <Notification
41
+ color="orange"
42
+ withBorder={false}
43
+ withCloseButton={false}
44
+ title="Manual layout issues">
45
+ <Text mt={2} size="sm" lh="xs">
46
+ View contains new elements or their sizes have changed,<br />
47
+ last manual layout can not be applied.
48
+ </Text>
49
+ <Text mt={'xs'} size="sm" lh="xs">
50
+ Update view predicates or remove <Code>@likec4-generated</Code>
51
+ </Text>
52
+ </Notification>
53
+ </HoverCardDropdown>
54
+ </HoverCard>
55
+ )
56
+ }
@@ -0,0 +1,151 @@
1
+ import { css } from '@likec4/styles/css'
2
+ import { hstack } from '@likec4/styles/patterns'
3
+ import {
4
+ type PopoverProps,
5
+ ActionIcon,
6
+ Popover,
7
+ PopoverDropdown,
8
+ PopoverTarget,
9
+ TooltipGroup,
10
+ } from '@mantine/core'
11
+ import {
12
+ IconLayoutAlignBottom,
13
+ IconLayoutAlignCenter,
14
+ IconLayoutAlignLeft,
15
+ IconLayoutAlignMiddle,
16
+ IconLayoutAlignRight,
17
+ IconLayoutAlignTop,
18
+ IconLayoutBoardSplit,
19
+ IconLayoutCollage,
20
+ IconRouteOff,
21
+ } from '@tabler/icons-react'
22
+ import { useDiagram } from '../../hooks/useDiagram'
23
+ import { PanelActionIcon } from '../_common'
24
+ import { Tooltip } from './_common'
25
+
26
+ const Action = ({
27
+ label,
28
+ icon,
29
+ onClick,
30
+ }: {
31
+ label: string
32
+ icon: React.ReactNode
33
+ onClick: React.MouseEventHandler
34
+ }) => (
35
+ <Tooltip label={label} withinPortal={false} position="top">
36
+ <ActionIcon
37
+ classNames={{
38
+ root: 'action-icon',
39
+ icon: css({
40
+ '& > svg': {
41
+ width: '70%',
42
+ height: '70%',
43
+ },
44
+ }),
45
+ }}
46
+ variant="subtle"
47
+ color="gray"
48
+ onClick={onClick}>
49
+ {icon}
50
+ </ActionIcon>
51
+ </Tooltip>
52
+ )
53
+
54
+ export const ManualLayoutToolsButton = (props: PopoverProps) => {
55
+ const diagram = useDiagram()
56
+
57
+ return (
58
+ <Popover
59
+ position="right-start"
60
+ offset={{
61
+ mainAxis: 10,
62
+ crossAxis: -2,
63
+ }}
64
+ clickOutsideEvents={[
65
+ 'pointerdown',
66
+ ]}
67
+ radius="sm"
68
+ shadow="lg"
69
+ {...props}>
70
+ <PopoverTarget>
71
+ <Tooltip label="Manual layouting tools">
72
+ <PanelActionIcon>
73
+ <IconLayoutCollage />
74
+ </PanelActionIcon>
75
+ </Tooltip>
76
+ </PopoverTarget>
77
+ <PopoverDropdown
78
+ className={hstack({
79
+ gap: 1,
80
+ layerStyle: 'likec4.panel',
81
+ p: '2',
82
+ })}>
83
+ <TooltipGroup>
84
+ <Action
85
+ label="Align in columns"
86
+ icon={<IconLayoutBoardSplit stroke={1.2} />}
87
+ onClick={e => {
88
+ e.stopPropagation()
89
+ diagram.align('Column')
90
+ }} />
91
+ <Action
92
+ label="Align left"
93
+ icon={<IconLayoutAlignLeft stroke={1.5} />}
94
+ onClick={e => {
95
+ e.stopPropagation()
96
+ diagram.align('Left')
97
+ }} />
98
+ <Action
99
+ label="Align center"
100
+ icon={<IconLayoutAlignCenter stroke={1.5} />}
101
+ onClick={e => {
102
+ e.stopPropagation()
103
+ diagram.align('Center')
104
+ }} />
105
+ <Action
106
+ label="Align right"
107
+ icon={<IconLayoutAlignRight stroke={1.5} />}
108
+ onClick={e => {
109
+ e.stopPropagation()
110
+ diagram.align('Right')
111
+ }} />
112
+ <Action
113
+ label="Align in rows"
114
+ icon={<IconLayoutBoardSplit stroke={1.5} style={{ transform: 'rotate(90deg)' }} />}
115
+ onClick={e => {
116
+ e.stopPropagation()
117
+ diagram.align('Row')
118
+ }} />
119
+ <Action
120
+ label="Align top"
121
+ icon={<IconLayoutAlignTop stroke={1.5} />}
122
+ onClick={e => {
123
+ e.stopPropagation()
124
+ diagram.align('Top')
125
+ }} />
126
+ <Action
127
+ label="Align middle"
128
+ icon={<IconLayoutAlignMiddle stroke={1.5} />}
129
+ onClick={e => {
130
+ e.stopPropagation()
131
+ diagram.align('Middle')
132
+ }} />
133
+ <Action
134
+ label="Align bottom"
135
+ icon={<IconLayoutAlignBottom stroke={1.5} />}
136
+ onClick={e => {
137
+ e.stopPropagation()
138
+ diagram.align('Bottom')
139
+ }} />
140
+ <Action
141
+ label="Reset all control points"
142
+ icon={<IconRouteOff stroke={1.5} />}
143
+ onClick={e => {
144
+ e.stopPropagation()
145
+ diagram.resetEdgeControlPoints()
146
+ }} />
147
+ </TooltipGroup>
148
+ </PopoverDropdown>
149
+ </Popover>
150
+ )
151
+ }
@@ -0,0 +1,14 @@
1
+ import {
2
+ Tooltip as MantineTooltip,
3
+ } from '@mantine/core'
4
+
5
+ export const Tooltip = MantineTooltip.withProps({
6
+ color: 'dark',
7
+ fz: 'xs',
8
+ openDelay: 600,
9
+ closeDelay: 120,
10
+ label: '',
11
+ children: null,
12
+ offset: 8,
13
+ position: 'right',
14
+ })
@@ -0,0 +1 @@
1
+ export { EditorPanel } from './EditorPanel'
@@ -0,0 +1,84 @@
1
+ import { css } from '@likec4/styles/css'
2
+
3
+ export const navigationButtons = css({
4
+ gap: 'micro',
5
+ _empty: {
6
+ display: 'none',
7
+ },
8
+ })
9
+
10
+ export const panel = css({
11
+ top: '1rem',
12
+ left: '1rem',
13
+ margin: 0,
14
+ pointerEvents: 'none',
15
+ '& :where(button, .action-icon, [role=\'dialog\'])': {
16
+ pointerEvents: 'all',
17
+ },
18
+ ['& .action-icon']: {
19
+ ['--ai-size']: '2rem',
20
+ },
21
+ ['& .tabler-icon']: {
22
+ width: '65%',
23
+ height: '65%',
24
+ },
25
+ _reduceGraphics: {
26
+ '& .action-icon': {
27
+ '--ai-radius': '0px',
28
+ },
29
+ },
30
+ })
31
+
32
+ export const actionIconGroup = css({
33
+ shadow: {
34
+ base: 'md',
35
+ _whenPanning: 'none',
36
+ },
37
+ })
38
+
39
+ export const autolayoutIcon = css({
40
+ ['& .tabler-icon']: {
41
+ width: '65%',
42
+ height: '65%',
43
+ },
44
+ })
45
+
46
+ export const autolayoutButton = css({
47
+ flex: '1 1 40%',
48
+ textAlign: 'center',
49
+ fontWeight: 500,
50
+ padding: '4px 6px',
51
+ fontSize: '11px',
52
+ zIndex: 1,
53
+ })
54
+
55
+ export const autolayoutIndicator = css({
56
+ background: 'mantine.colors.gray[2]',
57
+ borderRadius: 'sm',
58
+ border: `1px solid`,
59
+ borderColor: 'mantine.colors.gray[4]',
60
+ _dark: {
61
+ background: 'mantine.colors.dark[5]',
62
+ borderColor: 'mantine.colors.dark[4]',
63
+ },
64
+ })
65
+
66
+ export const spacingSliderBody = css({
67
+ position: 'relative',
68
+ borderRadius: 'sm',
69
+ background: 'mantine.colors.gray[3]',
70
+ boxShadow: 'inset 1px 1px 3px 0px #00000024',
71
+ _dark: {
72
+ background: 'mantine.colors.dark[7]',
73
+ },
74
+ })
75
+
76
+ export const spacingSliderThumb = css({
77
+ position: 'absolute',
78
+ width: 8,
79
+ height: 8,
80
+ border: `2px solid`,
81
+ borderColor: 'mantine.colors.gray[5]',
82
+ borderRadius: 3,
83
+ transform: 'translate(-50%, -50%)',
84
+ })
@@ -0,0 +1,70 @@
1
+ import type { ViewId } from '@likec4/core'
2
+ import { useSelector as useXstateSelector } from '@xstate/react'
3
+ import { shallowEqual } from 'fast-equals'
4
+ import { type DependencyList, createContext, useContext, useMemo } from 'react'
5
+ import type {
6
+ NavigationPanelActorContext,
7
+ NavigationPanelActorEvent,
8
+ NavigationPanelActorRef,
9
+ NavigationPanelActorSnapshot,
10
+ } from './actor'
11
+
12
+ const NavigationPanelActorSafeContext = createContext<NavigationPanelActorRef>(null as any)
13
+ NavigationPanelActorSafeContext.displayName = 'NavigationPanelActorSafeContext'
14
+
15
+ export const NavigationPanelActorContextProvider = NavigationPanelActorSafeContext.Provider
16
+
17
+ export const useNavigationActorRef = () => {
18
+ const ctx = useContext(NavigationPanelActorSafeContext)
19
+ if (ctx === null) {
20
+ throw new Error('NavigationPanelActorRef is not found in the context')
21
+ }
22
+ return ctx
23
+ }
24
+
25
+ export function useNavigationActorSnapshot<T = unknown>(
26
+ selector: (context: NavigationPanelActorSnapshot) => T,
27
+ compare: (a: NoInfer<T>, b: NoInfer<T>) => boolean = shallowEqual,
28
+ deps?: DependencyList,
29
+ ): T {
30
+ const actorRef = useNavigationActorRef()
31
+ return useXstateSelector(actorRef, selector, compare)
32
+ }
33
+
34
+ export function useNavigationActorContext<T = unknown>(
35
+ selector: (context: NavigationPanelActorContext) => T,
36
+ compare: (a: NoInfer<T>, b: NoInfer<T>) => boolean = shallowEqual,
37
+ deps?: DependencyList,
38
+ ): T {
39
+ return useNavigationActorSnapshot(snapshot => selector(snapshot.context), compare, deps)
40
+ }
41
+
42
+ export type NavigationActor = {
43
+ readonly actorRef: NavigationPanelActorRef
44
+ send: (event: NavigationPanelActorEvent) => void
45
+ selectFolder: (folderPath: string) => void
46
+ selectView: (viewId: ViewId) => void
47
+ /**
48
+ * If the navigation dropdown is opened
49
+ */
50
+ isOpened: () => boolean
51
+ clearSearch: () => void
52
+ closeDropdown: () => void
53
+ }
54
+
55
+ export function useNavigationActor(): NavigationActor {
56
+ const actorRef = useNavigationActorRef()
57
+
58
+ return useMemo(() => ({
59
+ actorRef,
60
+ send: (event: NavigationPanelActorEvent) => actorRef.send(event),
61
+ selectFolder: (folderPath: string) => actorRef.send({ type: 'select.folder', folderPath }),
62
+ selectView: (viewId: ViewId) => actorRef.send({ type: 'select.view', viewId }),
63
+ isOpened: () => {
64
+ const snapshot = actorRef.getSnapshot()
65
+ return snapshot.hasTag('active')
66
+ },
67
+ clearSearch: () => actorRef.send({ type: 'searchQuery.change', value: '' }),
68
+ closeDropdown: () => actorRef.send({ type: 'dropdown.dismiss' }),
69
+ }), [actorRef])
70
+ }
@@ -0,0 +1 @@
1
+ export { NavigationPanel } from './NavigationPanel'
@@ -0,0 +1,30 @@
1
+ import { cva } from '@likec4/styles/css'
2
+
3
+ export const breadcrumbTitle = cva({
4
+ base: {
5
+ fontSize: 'sm',
6
+ fontWeight: '500',
7
+ transition: 'fast',
8
+ // width: 'max-content',
9
+ alignSelf: 'stretch',
10
+ color: {
11
+ base: 'mantine.colors.text/90',
12
+ _hover: 'mantine.colors.text',
13
+ },
14
+ },
15
+ variants: {
16
+ truncate: {
17
+ 'true': {
18
+ truncate: true,
19
+ },
20
+ },
21
+ dimmed: {
22
+ 'true': {
23
+ color: {
24
+ base: 'mantine.colors.dimmed',
25
+ _hover: 'mantine.colors.text',
26
+ },
27
+ },
28
+ },
29
+ },
30
+ })