@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,134 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { cx, css } from '@likec4/styles/css';
3
+ import { hstack } from '@likec4/styles/patterns';
4
+ import { UnstyledButton } from '@mantine/core';
5
+ import { useSelector } from '@xstate/react';
6
+ import { deepEqual } from 'fast-equals';
7
+ import { AnimatePresence } from 'motion/react';
8
+ import * as m from 'motion/react-m';
9
+ import { useEnabledFeatures } from '../context/DiagramFeatures.js';
10
+ import { BreadcrumbsSeparator } from './_common.js';
11
+ import { useNavigationActorRef } from './hooks.js';
12
+ import { breadcrumbTitle } from './styles.css.js';
13
+ import { BurgerButton } from './controls/BurgerButton.js';
14
+ import { NavigationButtons } from './controls/NavigationButtons.js';
15
+ import { StartWalkthroughButton } from './walkthrough/ActiveWalkthroughControls.js';
16
+ import { OpenSource } from './controls/OpenSource.js';
17
+ import { ToggleReadonly } from './controls/ToggleReadonly.js';
18
+ import { SearchControl } from './controls/SearchControl.js';
19
+
20
+ const selectBreadcrumbs = ({ context }) => {
21
+ const folder = context.viewModel.folder;
22
+ return {
23
+ folders: folder.isRoot ? [] : folder.breadcrumbs.map((s) => ({
24
+ folderPath: s.path,
25
+ title: s.title
26
+ })),
27
+ viewId: context.viewModel.id,
28
+ viewTitle: context.viewModel.titleOrUntitled,
29
+ isDynamicView: context.viewModel.isDynamicView(),
30
+ hasLinks: context.viewModel.links.length > 0
31
+ };
32
+ };
33
+ const NavigationPanelControls = () => {
34
+ const actor = useNavigationActorRef();
35
+ const {
36
+ enableSearch,
37
+ enableNavigationButtons,
38
+ enableDynamicViewWalkthrough,
39
+ enableReadOnly
40
+ } = useEnabledFeatures();
41
+ const {
42
+ folders,
43
+ viewTitle,
44
+ isDynamicView
45
+ } = useSelector(actor, selectBreadcrumbs, deepEqual);
46
+ const folderBreadcrumbs = folders.flatMap(({ folderPath, title }, i) => [
47
+ /* @__PURE__ */ jsx(
48
+ UnstyledButton,
49
+ {
50
+ component: m.button,
51
+ className: cx(
52
+ breadcrumbTitle({ dimmed: true, truncate: true }),
53
+ "mantine-active",
54
+ css({
55
+ maxWidth: "200px"
56
+ })
57
+ ),
58
+ visibleFrom: "sm",
59
+ title,
60
+ onMouseEnter: () => actor.send({ type: "breadcrumbs.mouseEnter.folder", folderPath }),
61
+ onMouseLeave: () => actor.send({ type: "breadcrumbs.mouseLeave.folder", folderPath }),
62
+ onClick: (e) => {
63
+ e.stopPropagation();
64
+ actor.send({ type: "breadcrumbs.click.folder", folderPath });
65
+ },
66
+ children: title
67
+ },
68
+ folderPath
69
+ ),
70
+ /* @__PURE__ */ jsx(BreadcrumbsSeparator, {}, `separator-${i}`)
71
+ ]);
72
+ const viewBreadcrumb = /* @__PURE__ */ jsx(
73
+ UnstyledButton,
74
+ {
75
+ component: m.button,
76
+ className: cx(
77
+ "mantine-active",
78
+ breadcrumbTitle({ truncate: true })
79
+ ),
80
+ title: viewTitle,
81
+ onMouseEnter: () => actor.send({ type: "breadcrumbs.mouseEnter.viewtitle" }),
82
+ onMouseLeave: () => actor.send({ type: "breadcrumbs.mouseLeave.viewtitle" }),
83
+ onClick: (e) => {
84
+ e.stopPropagation();
85
+ actor.send({ type: "breadcrumbs.click.viewtitle" });
86
+ },
87
+ children: viewTitle
88
+ },
89
+ "view-title"
90
+ );
91
+ return /* @__PURE__ */ jsxs(AnimatePresence, { propagate: true, children: [
92
+ /* @__PURE__ */ jsx(BurgerButton, {}),
93
+ enableNavigationButtons && /* @__PURE__ */ jsx(NavigationButtons, {}),
94
+ /* @__PURE__ */ jsxs(
95
+ m.div,
96
+ {
97
+ layout: "position",
98
+ className: hstack({
99
+ gap: 3,
100
+ flexShrink: 1,
101
+ flexGrow: 1,
102
+ overflow: "hidden",
103
+ md: {
104
+ marginRight: "md"
105
+ }
106
+ }),
107
+ children: [
108
+ folderBreadcrumbs,
109
+ viewBreadcrumb
110
+ ]
111
+ }
112
+ ),
113
+ enableDynamicViewWalkthrough && isDynamicView && /* @__PURE__ */ jsx(StartWalkthroughButton, {}),
114
+ /* @__PURE__ */ jsxs(
115
+ m.div,
116
+ {
117
+ layout: "position",
118
+ className: hstack({
119
+ gap: 1,
120
+ _empty: {
121
+ display: "none"
122
+ }
123
+ }),
124
+ children: [
125
+ /* @__PURE__ */ jsx(OpenSource, {}),
126
+ /* @__PURE__ */ jsx(ToggleReadonly, {})
127
+ ]
128
+ }
129
+ ),
130
+ enableSearch && /* @__PURE__ */ jsx(SearchControl, {})
131
+ ] });
132
+ };
133
+
134
+ export { NavigationPanelControls };
@@ -0,0 +1 @@
1
+ export declare function NavigationPanelDropdown(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,436 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { normalizeViewPath, VIEW_FOLDERS_SEPARATOR } from '@likec4/core/model';
3
+ import { ifilter, ifirst, toArray, compareNaturalHierarchically, nonexhaustive } from '@likec4/core/utils';
4
+ import { cx, css } from '@likec4/styles/css';
5
+ import { HStack, VStack, Box } from '@likec4/styles/jsx';
6
+ import { vstack, hstack } from '@likec4/styles/patterns';
7
+ import { PopoverDropdown, createScopedKeydownHandler, ScrollAreaAutosize, Input, rem, Button, Divider, Highlight, UnstyledButton, Breadcrumbs } from '@mantine/core';
8
+ import { useThrottledCallback, useUncontrolled } from '@mantine/hooks';
9
+ import { useSelector } from '@xstate/react';
10
+ import { deepEqual } from 'fast-equals';
11
+ import { isEmpty, pipe, sort, isArray } from 'remeda';
12
+ import { NavigationLink } from '../components/NavigationLink.js';
13
+ import { useLikeC4Model } from '../likec4model/useLikeC4Model.js';
14
+ import { useNavigationActor, useNavigationActorContext, useNavigationActorRef } from './hooks.js';
15
+ import { breadcrumbTitle } from './styles.css.js';
16
+ import IconSearch from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js';
17
+ import IconChevronRight from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
18
+ import IconStack2 from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js';
19
+ import IconZoomScan from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
20
+ import IconStarFilled from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js';
21
+ import IconFolderFilled from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js';
22
+
23
+ const scopedKeydownHandler = createScopedKeydownHandler({
24
+ siblingSelector: "[data-likec4-focusable]",
25
+ parentSelector: "[data-likec4-breadcrumbs-dropdown]",
26
+ activateOnFocus: false,
27
+ loop: true,
28
+ orientation: "vertical"
29
+ });
30
+ function NavigationPanelDropdown() {
31
+ const actor = useNavigationActor();
32
+ const searchQuery = useSelector(actor.actorRef, (s) => s.context.searchQuery);
33
+ const setSearchQuery = useThrottledCallback((value) => {
34
+ actor.send({ type: "searchQuery.change", value });
35
+ }, 250);
36
+ const hasSearchQuery = searchQuery.trim().length >= 2;
37
+ return /* @__PURE__ */ jsxs(
38
+ PopoverDropdown,
39
+ {
40
+ className: cx(
41
+ "nowheel",
42
+ vstack({
43
+ layerStyle: "likec4.dropdown",
44
+ gap: "sm",
45
+ pointerEvents: "all"
46
+ })
47
+ ),
48
+ "data-likec4-breadcrumbs-dropdown": true,
49
+ onMouseLeave: () => actor.send({ type: "dropdown.mouseLeave" }),
50
+ onMouseEnter: () => actor.send({ type: "dropdown.mouseEnter" }),
51
+ children: [
52
+ /* @__PURE__ */ jsx(HStack, { gap: "xs", children: /* @__PURE__ */ jsx(
53
+ SearchInput,
54
+ {
55
+ value: searchQuery,
56
+ onChange: setSearchQuery,
57
+ "data-likec4-focusable": true,
58
+ onKeyDown: scopedKeydownHandler
59
+ }
60
+ ) }),
61
+ /* @__PURE__ */ jsx(
62
+ ScrollAreaAutosize,
63
+ {
64
+ scrollbars: "xy",
65
+ type: "auto",
66
+ offsetScrollbars: "present",
67
+ classNames: {
68
+ root: css({
69
+ maxWidth: [
70
+ "calc(100vw - 20px)",
71
+ "calc(100cqw - 20px)"
72
+ ]
73
+ })
74
+ },
75
+ children: hasSearchQuery ? /* @__PURE__ */ jsx(SearchResults, { searchQuery: normalizeViewPath(searchQuery).toLowerCase() }) : /* @__PURE__ */ jsx(FolderColumns, {})
76
+ }
77
+ )
78
+ ]
79
+ }
80
+ );
81
+ }
82
+ const compare = compareNaturalHierarchically(VIEW_FOLDERS_SEPARATOR);
83
+ function SearchResults({ searchQuery }) {
84
+ const likec4model = useLikeC4Model();
85
+ const actor = useNavigationActor();
86
+ const isSearchByPath = searchQuery.includes(VIEW_FOLDERS_SEPARATOR);
87
+ const found = pipe(
88
+ likec4model.views(),
89
+ ifilter((v) => {
90
+ if (isSearchByPath && v.$view.title) {
91
+ return normalizeViewPath(v.$view.title).toLowerCase().includes(searchQuery);
92
+ }
93
+ return v.id.toLowerCase().includes(searchQuery) || !!v.title?.toLowerCase().includes(searchQuery);
94
+ }),
95
+ ifirst(20),
96
+ toArray(),
97
+ sort((a, b) => compare(a.folder.path, b.folder.path))
98
+ );
99
+ if (found.length === 0) return /* @__PURE__ */ jsx("div", { children: "no results" });
100
+ const highlight = isSearchByPath ? searchQuery.split(VIEW_FOLDERS_SEPARATOR) : searchQuery;
101
+ return /* @__PURE__ */ jsx(
102
+ ScrollAreaAutosize,
103
+ {
104
+ scrollbars: "xy",
105
+ offsetScrollbars: false,
106
+ className: css({
107
+ width: "100%",
108
+ maxWidth: [
109
+ "70vw",
110
+ "calc(100cqw - 250px)"
111
+ ],
112
+ maxHeight: [
113
+ "70vh",
114
+ "calc(100cqh - 250px)"
115
+ ]
116
+ }),
117
+ children: /* @__PURE__ */ jsx(VStack, { gap: 1, children: found.map((v) => /* @__PURE__ */ jsx(
118
+ FoundedView,
119
+ {
120
+ view: v,
121
+ highlight,
122
+ onClick: (e) => {
123
+ console.log("click");
124
+ e.stopPropagation();
125
+ actor.selectView(v.id);
126
+ },
127
+ "data-likec4-focusable": true,
128
+ onKeyDown: scopedKeydownHandler
129
+ },
130
+ v.id
131
+ )) })
132
+ }
133
+ );
134
+ }
135
+ const foundedViewClass = hstack({
136
+ gap: "2xs",
137
+ rounded: "sm",
138
+ px: "xs",
139
+ py: "2xs",
140
+ _hover: {
141
+ backgroundColor: {
142
+ base: "mantine.colors.gray[1]",
143
+ _dark: "mantine.colors.dark[5]"
144
+ }
145
+ },
146
+ _focus: {
147
+ outline: "none",
148
+ color: "mantine.colors.primary.lightColor!",
149
+ backgroundColor: "mantine.colors.primary.lightHover!"
150
+ }
151
+ });
152
+ const inheritColor = css({
153
+ _groupFocus: {
154
+ color: "[inherit!]",
155
+ transition: "none"
156
+ }
157
+ });
158
+ function FoundedView({ view, highlight, ...props }) {
159
+ const folder = view.folder;
160
+ const viewIcon = ViewTypeIcon[view.id === "index" ? "index" : view._type];
161
+ const viewLabel = /* @__PURE__ */ jsx(
162
+ Highlight,
163
+ {
164
+ component: "div",
165
+ className: cx(
166
+ inheritColor,
167
+ breadcrumbTitle({ truncate: true })
168
+ ),
169
+ maw: 350,
170
+ highlight,
171
+ children: view.title ?? view.id
172
+ },
173
+ view.id
174
+ );
175
+ const className = cx(
176
+ props.className,
177
+ "group",
178
+ foundedViewClass
179
+ );
180
+ if (folder.isRoot) {
181
+ return /* @__PURE__ */ jsxs(
182
+ UnstyledButton,
183
+ {
184
+ ...props,
185
+ className,
186
+ children: [
187
+ viewIcon,
188
+ viewLabel
189
+ ]
190
+ }
191
+ );
192
+ }
193
+ const breadcrumbs = folder.breadcrumbs.map((b) => /* @__PURE__ */ jsx(
194
+ Highlight,
195
+ {
196
+ component: "div",
197
+ className: cx(
198
+ css({
199
+ _groupHover: {
200
+ color: "mantine.colors.dimmed"
201
+ }
202
+ }),
203
+ inheritColor,
204
+ breadcrumbTitle({ dimmed: true, truncate: true })
205
+ ),
206
+ maw: 170,
207
+ highlight: isArray(highlight) ? highlight : [],
208
+ children: b.title
209
+ },
210
+ b.path
211
+ ));
212
+ breadcrumbs.push(
213
+ /* @__PURE__ */ jsxs(HStack, { gap: 4, children: [
214
+ viewIcon,
215
+ viewLabel
216
+ ] })
217
+ );
218
+ return /* @__PURE__ */ jsxs(
219
+ UnstyledButton,
220
+ {
221
+ ...props,
222
+ className,
223
+ children: [
224
+ folderIcon,
225
+ /* @__PURE__ */ jsx(Breadcrumbs, { separator: /* @__PURE__ */ jsx(IconChevronRight, { size: 12, stroke: 1.5 }), separatorMargin: 3, children: breadcrumbs })
226
+ ]
227
+ }
228
+ );
229
+ }
230
+ const btnRightSection = /* @__PURE__ */ jsx(IconChevronRight, { size: 12, stroke: 1.5, className: "mantine-rotate-rtl" });
231
+ const folderIcon = /* @__PURE__ */ jsx(
232
+ IconFolderFilled,
233
+ {
234
+ size: 16,
235
+ className: css({
236
+ opacity: {
237
+ base: 0.3,
238
+ _groupHover: 0.5,
239
+ _groupActive: 0.5
240
+ }
241
+ })
242
+ }
243
+ );
244
+ const viewTypeIconCss = css({
245
+ opacity: {
246
+ base: 0.3,
247
+ _dark: 0.5,
248
+ _groupHover: 0.7,
249
+ _groupActive: 0.7
250
+ }
251
+ });
252
+ const ViewTypeIcon = {
253
+ index: /* @__PURE__ */ jsx(IconStarFilled, { size: 16, className: viewTypeIconCss }),
254
+ element: /* @__PURE__ */ jsx(
255
+ IconZoomScan,
256
+ {
257
+ size: 18,
258
+ stroke: 2,
259
+ className: viewTypeIconCss
260
+ }
261
+ ),
262
+ deployment: /* @__PURE__ */ jsx(IconStack2, { size: 16, stroke: 1.5, className: viewTypeIconCss }),
263
+ dynamic: /* @__PURE__ */ jsx(IconStack2, { size: 16, stroke: 1.5, className: viewTypeIconCss })
264
+ };
265
+ const ColumnScrollArea = ScrollAreaAutosize.withProps({
266
+ scrollbars: "y",
267
+ className: css({
268
+ maxHeight: [
269
+ "calc(100vh - 50px)",
270
+ "calc(100cqh - 50px)"
271
+ ]
272
+ })
273
+ });
274
+ function folderColumn(folder, context) {
275
+ return {
276
+ folderPath: folder.path,
277
+ items: [
278
+ ...folder.folders.map((s) => ({
279
+ type: "folder",
280
+ folderPath: s.path,
281
+ title: s.title,
282
+ selected: context.selectedFolder.startsWith(s.path)
283
+ })),
284
+ ...folder.views.map((s) => ({
285
+ type: "view",
286
+ viewType: s.id === "index" ? "index" : s._type,
287
+ viewId: s.id,
288
+ title: s.title ?? s.id,
289
+ description: s.description.nonEmpty && s.description.text || null,
290
+ selected: s.id === context.viewModel.id
291
+ }))
292
+ ]
293
+ };
294
+ }
295
+ const selectColumns = (context) => {
296
+ const viewModel = context.viewModel;
297
+ const likec4model = viewModel.$model;
298
+ const columns = [
299
+ folderColumn(likec4model.rootViewFolder, context)
300
+ ];
301
+ const folder = likec4model.viewFolder(context.selectedFolder);
302
+ if (!folder.isRoot) {
303
+ for (const b of folder.breadcrumbs) {
304
+ columns.push(folderColumn(b, context));
305
+ }
306
+ }
307
+ return columns;
308
+ };
309
+ function FolderColumns() {
310
+ const columns = useNavigationActorContext(selectColumns, deepEqual);
311
+ return /* @__PURE__ */ jsx(HStack, { gap: "xs", alignItems: "stretch", children: columns.flatMap((column, i) => [
312
+ i > 0 && /* @__PURE__ */ jsx(Divider, { orientation: "vertical" }, "divider" + i),
313
+ /* @__PURE__ */ jsx(FolderColumn, { data: column }, column.folderPath)
314
+ ]) });
315
+ }
316
+ function FolderColumn({ data }) {
317
+ const actor = useNavigationActorRef();
318
+ const onItemClicked = (item) => (e) => {
319
+ e.stopPropagation();
320
+ if (item.type === "folder") {
321
+ actor.send({ type: "select.folder", folderPath: item.folderPath });
322
+ } else {
323
+ actor.send({ type: "select.view", viewId: item.viewId });
324
+ }
325
+ };
326
+ return /* @__PURE__ */ jsx(Box, { pb: "4", children: /* @__PURE__ */ jsx(ColumnScrollArea, { children: /* @__PURE__ */ jsx(VStack, { gap: 1, children: data.items.map((item, i) => /* @__PURE__ */ jsx(
327
+ FolderColumnItem,
328
+ {
329
+ columnItem: item,
330
+ onClick: onItemClicked(item)
331
+ },
332
+ `${data.folderPath}/${item.type}/${i}`
333
+ )) }) }) });
334
+ }
335
+ function FolderColumnItem({ columnItem, ...props }) {
336
+ switch (columnItem.type) {
337
+ case "folder":
338
+ return /* @__PURE__ */ jsx(
339
+ NavigationLink,
340
+ {
341
+ variant: "light",
342
+ active: columnItem.selected,
343
+ label: columnItem.title,
344
+ leftSection: folderIcon,
345
+ rightSection: btnRightSection,
346
+ maw: "300px",
347
+ miw: "200px",
348
+ ...props
349
+ },
350
+ columnItem.folderPath
351
+ );
352
+ case "view":
353
+ return /* @__PURE__ */ jsx(
354
+ NavigationLink,
355
+ {
356
+ variant: "filled",
357
+ active: columnItem.selected,
358
+ label: columnItem.title,
359
+ description: columnItem.description,
360
+ leftSection: ViewTypeIcon[columnItem.viewType],
361
+ maw: "300px",
362
+ miw: "200px",
363
+ ...props
364
+ },
365
+ columnItem.viewId
366
+ );
367
+ default:
368
+ nonexhaustive(columnItem);
369
+ }
370
+ }
371
+ function SearchInput({ onKeyDown, ...props }) {
372
+ const [_value, handleChange] = useUncontrolled({
373
+ ...props,
374
+ finalValue: ""
375
+ });
376
+ return /* @__PURE__ */ jsx(
377
+ Input,
378
+ {
379
+ size: "xs",
380
+ placeholder: "Search by title or id",
381
+ variant: "unstyled",
382
+ height: rem(26),
383
+ value: _value,
384
+ onKeyDown,
385
+ onChange: (e) => handleChange(e.currentTarget.value),
386
+ classNames: {
387
+ wrapper: css({
388
+ flexGrow: 1,
389
+ backgroundColor: {
390
+ base: "mantine.colors.gray[1]",
391
+ _dark: "mantine.colors.dark[5]/80",
392
+ _hover: {
393
+ base: "mantine.colors.gray[2]",
394
+ _dark: "mantine.colors.dark[4]"
395
+ },
396
+ _focus: {
397
+ base: "mantine.colors.gray[2]",
398
+ _dark: "mantine.colors.dark[4]"
399
+ }
400
+ },
401
+ rounded: "sm"
402
+ }),
403
+ input: css({
404
+ _placeholder: {
405
+ color: "mantine.colors.dimmed"
406
+ },
407
+ _focus: {
408
+ outline: "none"
409
+ }
410
+ })
411
+ },
412
+ style: {
413
+ ["--input-fz"]: "var(--mantine-font-size-sm)"
414
+ },
415
+ leftSection: /* @__PURE__ */ jsx(IconSearch, { size: 14 }),
416
+ rightSectionPointerEvents: "all",
417
+ rightSectionWidth: "min-content",
418
+ rightSection: !props.value || isEmpty(props.value) ? null : /* @__PURE__ */ jsx(
419
+ Button,
420
+ {
421
+ variant: "subtle",
422
+ h: "100%",
423
+ size: "compact-xs",
424
+ color: "gray",
425
+ onClick: (e) => {
426
+ e.stopPropagation();
427
+ handleChange("");
428
+ },
429
+ children: "clear"
430
+ }
431
+ )
432
+ }
433
+ );
434
+ }
435
+
436
+ export { NavigationPanelDropdown };
@@ -0,0 +1,15 @@
1
+ import { NavigationPanelActionIconVariant } from '@likec4/styles/recipes';
2
+ import { ActionIconProps, TooltipProps, BreadcrumbsProps } from '@mantine/core';
3
+ import { HTMLMotionProps } from 'motion/react';
4
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
5
+ export declare const Tooltip: ForwardRefExoticComponent< TooltipProps & RefAttributes<HTMLDivElement> & {
6
+ component?: any;
7
+ renderRoot?: (props: Record<string, any>) => React.ReactNode;
8
+ }>;
9
+ export declare const BreadcrumbsSeparator: () => import("react/jsx-runtime").JSX.Element;
10
+ export declare const Breadcrumbs: ForwardRefExoticComponent< BreadcrumbsProps & RefAttributes<HTMLDivElement> & {
11
+ component?: any;
12
+ renderRoot?: (props: Record<string, any>) => React.ReactNode;
13
+ }>;
14
+ export type PanelActionIconProps = Partial<NavigationPanelActionIconVariant> & Omit<ActionIconProps, keyof NavigationPanelActionIconVariant> & HTMLMotionProps<'button'>;
15
+ export declare const PanelActionIcon: ForwardRefExoticComponent<Omit<PanelActionIconProps, "ref"> & RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,69 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { cx, css } from '@likec4/styles/css';
3
+ import { navigationPanelActionIcon } from '@likec4/styles/recipes';
4
+ import { ActionIcon, ThemeIcon, Tooltip as Tooltip$1, Breadcrumbs } from '@mantine/core';
5
+ import * as m from 'motion/react-m';
6
+ import { forwardRef } from 'react';
7
+ import IconChevronRight from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
8
+
9
+ const Tooltip = Tooltip$1.withProps({
10
+ color: "dark",
11
+ fz: "xs",
12
+ openDelay: 600,
13
+ closeDelay: 120,
14
+ label: "",
15
+ children: null,
16
+ offset: 8,
17
+ withinPortal: false
18
+ });
19
+ const BreadcrumbsSeparator = () => /* @__PURE__ */ jsx(
20
+ ThemeIcon,
21
+ {
22
+ visibleFrom: "sm",
23
+ variant: "transparent",
24
+ size: 16,
25
+ className: css({
26
+ color: {
27
+ base: "mantine.colors.gray[5]",
28
+ _dark: "mantine.colors.dark[3]"
29
+ }
30
+ }),
31
+ children: /* @__PURE__ */ jsx(IconChevronRight, {})
32
+ }
33
+ );
34
+ Breadcrumbs.withProps({
35
+ separator: /* @__PURE__ */ jsx(BreadcrumbsSeparator, {}),
36
+ separatorMargin: 4
37
+ });
38
+ const PanelActionIcon = forwardRef(({
39
+ variant = "default",
40
+ className,
41
+ disabled = false,
42
+ ...others
43
+ }, ref) => /* @__PURE__ */ jsx(
44
+ ActionIcon,
45
+ {
46
+ size: "md",
47
+ variant: "transparent",
48
+ radius: "sm",
49
+ component: m.button,
50
+ ...!disabled && {
51
+ whileHover: {
52
+ scale: 1.085
53
+ },
54
+ whileTap: {
55
+ scale: 1,
56
+ translateY: 1
57
+ }
58
+ },
59
+ disabled,
60
+ ...others,
61
+ className: cx(
62
+ className,
63
+ navigationPanelActionIcon({ variant })
64
+ ),
65
+ ref
66
+ }
67
+ ));
68
+
69
+ export { BreadcrumbsSeparator, PanelActionIcon, Tooltip };