@likec4/diagram 1.34.2 → 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
@@ -1,42 +1,32 @@
1
1
  import type { aux, LikeC4Model, LikeC4ViewModel } from '@likec4/core/model'
2
- import { useContext } from 'react'
3
- import { isString } from 'remeda'
2
+ import { deepEqual } from 'fast-equals'
3
+ import { useContext, useEffect, useState } from 'react'
4
4
  import { LikeC4ModelContext } from './LikeC4ModelContext'
5
5
 
6
- export function useLikeC4Model<A extends aux.Any = aux.Unknown>(): LikeC4Model<A>
7
- export function useLikeC4Model<A extends aux.Any = aux.Unknown>(type: 'layouted'): LikeC4Model.Layouted<A>
8
- export function useLikeC4Model<A extends aux.Any = aux.Unknown>(type: 'computed'): LikeC4Model.Computed<A>
9
- // dprint-ignore
10
- export function useLikeC4Model<A extends aux.Any = aux.Unknown>(type: 'layouted' | 'computed' | undefined): LikeC4Model<A>
11
- export function useLikeC4Model(type?: 'layouted' | 'computed') {
6
+ export function useLikeC4Model<A extends aux.Any = aux.UnknownLayouted>(): LikeC4Model<A> {
12
7
  const model = useContext(LikeC4ModelContext)
13
-
14
8
  if (!model) {
15
9
  throw new Error('LikeC4Model not found. Make sure you have LikeC4ModelProvider.')
16
10
  }
17
-
18
- if (isString(type) && model.stage !== type) {
19
- throw new Error(`Invalid LikeC4ModelContext, expected "${type}" but got "${model.stage}" in context`)
20
- }
21
-
22
11
  return model
23
12
  }
24
13
 
25
- export function useLikeC4ViewModel<A extends aux.Any = aux.Unknown>(
26
- viewId: aux.LooseViewId<A>,
27
- ): LikeC4ViewModel<aux.toLayouted<A>> | null {
28
- const model = useLikeC4Model<A>('layouted')
29
- const view = model.findView(viewId)
30
- if (!view) {
31
- return null
32
- }
33
- if (!view.isDiagram()) {
34
- throw new Error(`View "${viewId}" is not layouted`)
35
- }
36
- return view as any
14
+ export function useLikeC4ViewModel<A extends aux.Any = aux.UnknownLayouted>(
15
+ viewId: aux.ViewId<A>,
16
+ ): LikeC4ViewModel<A> {
17
+ const model = useLikeC4Model<A>()
18
+ // const [view, setView] = useState(() => model.findView(viewId))
19
+ // useEffect(() => {
20
+ // setView(model.findView(viewId))
21
+ // }, [model, viewId])
22
+ return model.view(viewId)
37
23
  }
38
24
 
39
25
  export function useLikeC4Specification() {
40
26
  const model = useLikeC4Model()
41
- return model.$data.specification
27
+ const [specification, setSpecification] = useState(model.$data.specification)
28
+ useEffect(() => {
29
+ setSpecification(current => deepEqual(current, model.$data.specification) ? current : model.$data.specification)
30
+ }, [model])
31
+ return specification
42
32
  }
@@ -0,0 +1,136 @@
1
+ import { VStack } from '@likec4/styles/jsx'
2
+ import { hstack } from '@likec4/styles/patterns'
3
+ import {
4
+ Popover,
5
+ PopoverTarget,
6
+ Portal,
7
+ } from '@mantine/core'
8
+ import { useUpdateEffect } from '@react-hookz/web'
9
+ import { useActorRef, useSelector } from '@xstate/react'
10
+ import { AnimatePresence, LayoutGroup } from 'motion/react'
11
+ import * as m from 'motion/react-m'
12
+ import { memo, useEffect } from 'react'
13
+ import { useDiagramActorRef } from '../hooks/safeContext'
14
+ import { useDiagramContext } from '../hooks/useDiagram'
15
+ import { useMantinePortalProps } from '../hooks/useMantinePortalProps'
16
+ import { useCurrentViewModel } from '../likec4model/useCurrentViewModel'
17
+ import { type NavigationPanelActorRef, navigationPanelActorLogic } from './actor'
18
+ import { EditorPanel } from './editorpanel'
19
+ import { NavigationPanelActorContextProvider } from './hooks'
20
+ import { NavigationPanelControls } from './NavigationPanelControls'
21
+ import { NavigationPanelDropdown } from './NavigationPanelDropdown'
22
+ import { ActiveWalkthroughControls } from './walkthrough'
23
+
24
+ export const NavigationPanel = memo(() => {
25
+ const diagramActor = useDiagramActorRef()
26
+ const viewModel = useCurrentViewModel()
27
+ const { portalProps } = useMantinePortalProps()
28
+
29
+ const actorRef = useActorRef(
30
+ navigationPanelActorLogic,
31
+ {
32
+ input: {
33
+ viewModel,
34
+ },
35
+ },
36
+ )
37
+ useEffect(() => {
38
+ const subscription = actorRef.on('trigger.navigateTo', (event) => {
39
+ if (diagramActor.getSnapshot().context.view.id !== event.viewId) {
40
+ diagramActor.send({ type: 'navigate.to', viewId: event.viewId })
41
+ }
42
+ })
43
+ return () => subscription.unsubscribe()
44
+ }, [actorRef, diagramActor])
45
+
46
+ useUpdateEffect(() => {
47
+ actorRef.send({ type: 'update.inputs', inputs: { viewModel } })
48
+ }, [viewModel])
49
+
50
+ return (
51
+ <Portal {...portalProps}>
52
+ <VStack
53
+ className="react-flow__panel"
54
+ css={{
55
+ gap: 'sm',
56
+ margin: 'sm',
57
+ alignItems: 'flex-start',
58
+ pointerEvents: 'none',
59
+ top: 0,
60
+ left: 0,
61
+ maxWidth: [
62
+ 'calc(100vw - 2 * {spacing.sm})',
63
+ 'calc(100cqw - 2 * {spacing.sm})',
64
+ ],
65
+ width: 'max-content',
66
+ overflow: 'hidden',
67
+ smDown: {
68
+ margin: 0,
69
+ width: '100%',
70
+ gap: '2xs',
71
+ maxWidth: [
72
+ 'calc(100vw)',
73
+ 'calc(100cqw)',
74
+ ],
75
+ },
76
+ }}>
77
+ <NavigationPanelActorContextProvider value={actorRef}>
78
+ <NavigationPanelImpl actor={actorRef} />
79
+ <EditorPanel />
80
+ </NavigationPanelActorContextProvider>
81
+ </VStack>
82
+ </Portal>
83
+ )
84
+ })
85
+ NavigationPanel.displayName = 'NavigationPanel'
86
+
87
+ const NavigationPanelImpl = ({ actor }: { actor: NavigationPanelActorRef }) => {
88
+ const opened = useSelector(actor, s => s.hasTag('active'))
89
+ const portalProps = useMantinePortalProps()
90
+
91
+ return (
92
+ <Popover
93
+ offset={{
94
+ mainAxis: 4,
95
+ }}
96
+ middlewares={{ flip: false }}
97
+ opened={opened}
98
+ shadow="md"
99
+ position="bottom-start"
100
+ trapFocus
101
+ {...portalProps}
102
+ clickOutsideEvents={['pointerdown', 'mousedown', 'click']}
103
+ onDismiss={() => actor.send({ type: 'dropdown.dismiss' })}
104
+ >
105
+ <NavigationPanelPopoverTarget actor={actor} />
106
+ <NavigationPanelDropdown />
107
+ </Popover>
108
+ )
109
+ }
110
+ const NavigationPanelPopoverTarget = ({ actor }: { actor: NavigationPanelActorRef }) => {
111
+ const isActiveWalkthrough = useDiagramContext(c => c.activeWalkthrough !== null)
112
+
113
+ return (
114
+ <LayoutGroup>
115
+ <PopoverTarget>
116
+ <m.div
117
+ layout
118
+ className={hstack({
119
+ layerStyle: 'likec4.panel',
120
+ position: 'relative',
121
+ gap: 'xs',
122
+ cursor: 'pointer',
123
+ paddingRight: 'md',
124
+ pointerEvents: 'all',
125
+ width: '100%',
126
+ })}
127
+ onMouseLeave={() => actor.send({ type: 'breadcrumbs.mouseLeave' })}
128
+ >
129
+ <AnimatePresence mode="popLayout">
130
+ {isActiveWalkthrough ? <ActiveWalkthroughControls /> : <NavigationPanelControls />}
131
+ </AnimatePresence>
132
+ </m.div>
133
+ </PopoverTarget>
134
+ </LayoutGroup>
135
+ )
136
+ }
@@ -0,0 +1,155 @@
1
+ import { css, cx } from '@likec4/styles/css'
2
+ import { hstack } from '@likec4/styles/patterns'
3
+ import {
4
+ UnstyledButton,
5
+ } from '@mantine/core'
6
+ import { useSelector } from '@xstate/react'
7
+ import { deepEqual } from 'fast-equals'
8
+ import { AnimatePresence } from 'motion/react'
9
+ import * as m from 'motion/react-m'
10
+ import { useEnabledFeatures } from '../context/DiagramFeatures'
11
+ import { BreadcrumbsSeparator } from './_common'
12
+ import { type NavigationPanelActorSnapshot } from './actor'
13
+ import { BurgerButton, NavigationButtons, OpenSource, SearchControl, ToggleReadonly } from './controls'
14
+ import { useNavigationActorRef } from './hooks'
15
+ import { breadcrumbTitle } from './styles.css'
16
+ import { StartWalkthroughButton } from './walkthrough'
17
+
18
+ const selectBreadcrumbs = ({ context }: NavigationPanelActorSnapshot) => {
19
+ const folder = context.viewModel.folder
20
+ return {
21
+ folders: folder.isRoot ? [] : folder.breadcrumbs.map(s => ({
22
+ folderPath: s.path,
23
+ title: s.title,
24
+ })),
25
+ viewId: context.viewModel.id,
26
+ viewTitle: context.viewModel.titleOrUntitled,
27
+ isDynamicView: context.viewModel.isDynamicView(),
28
+ hasLinks: context.viewModel.links.length > 0,
29
+ }
30
+ }
31
+
32
+ export const NavigationPanelControls = () => {
33
+ const actor = useNavigationActorRef()
34
+ const {
35
+ enableSearch,
36
+ enableNavigationButtons,
37
+ enableDynamicViewWalkthrough,
38
+ enableReadOnly,
39
+ } = useEnabledFeatures()
40
+ const {
41
+ folders,
42
+ viewTitle,
43
+ isDynamicView,
44
+ } = useSelector(actor, selectBreadcrumbs, deepEqual)
45
+
46
+ const folderBreadcrumbs = folders.flatMap(({ folderPath, title }, i) => [
47
+ <UnstyledButton
48
+ key={folderPath}
49
+ component={m.button}
50
+ className={cx(
51
+ breadcrumbTitle({ dimmed: true, truncate: true }),
52
+ 'mantine-active',
53
+ css({
54
+ maxWidth: '200px',
55
+ }),
56
+ )}
57
+ visibleFrom="sm"
58
+ title={title}
59
+ onMouseEnter={() => actor.send({ type: 'breadcrumbs.mouseEnter.folder', folderPath })}
60
+ onMouseLeave={() => actor.send({ type: 'breadcrumbs.mouseLeave.folder', folderPath })}
61
+ onClick={e => {
62
+ e.stopPropagation()
63
+ actor.send({ type: 'breadcrumbs.click.folder', folderPath })
64
+ }}
65
+ >
66
+ {title}
67
+ </UnstyledButton>,
68
+ <BreadcrumbsSeparator key={`separator-${i}`} />,
69
+ ])
70
+
71
+ const viewBreadcrumb = (
72
+ <UnstyledButton
73
+ key={'view-title'}
74
+ component={m.button}
75
+ className={cx(
76
+ 'mantine-active',
77
+ breadcrumbTitle({ truncate: true }),
78
+ )}
79
+ title={viewTitle}
80
+ onMouseEnter={() => actor.send({ type: 'breadcrumbs.mouseEnter.viewtitle' })}
81
+ onMouseLeave={() => actor.send({ type: 'breadcrumbs.mouseLeave.viewtitle' })}
82
+ onClick={e => {
83
+ e.stopPropagation()
84
+ actor.send({ type: 'breadcrumbs.click.viewtitle' })
85
+ }}
86
+ >
87
+ {viewTitle}
88
+ </UnstyledButton>
89
+ )
90
+
91
+ return (
92
+ <AnimatePresence propagate>
93
+ <BurgerButton />
94
+ {enableNavigationButtons && <NavigationButtons />}
95
+ <m.div
96
+ layout="position"
97
+ className={hstack({
98
+ gap: 3,
99
+ flexShrink: 1,
100
+ flexGrow: 1,
101
+ overflow: 'hidden',
102
+ md: {
103
+ marginRight: 'md',
104
+ },
105
+ })}>
106
+ {folderBreadcrumbs}
107
+ {viewBreadcrumb}
108
+ </m.div>
109
+ {
110
+ /* <HStack gap={1}>
111
+ <PanelActionIcon
112
+ variant="subtle"
113
+ size={24}
114
+ component={m.button}
115
+ whileHover={{
116
+ scale: 1.085,
117
+ }}
118
+ whileTap={{
119
+ scale: 1,
120
+ translateY: 1,
121
+ }}
122
+ children={<IconInfoCircleFilled style={{ width: '85%', height: '85%' }} />}
123
+ />
124
+ <PanelActionIcon
125
+ variant="subtle"
126
+ size={24}
127
+ component={m.button}
128
+ whileHover={{
129
+ scale: 1.085,
130
+ }}
131
+ whileTap={{
132
+ scale: 1,
133
+ translateY: 1,
134
+ }}
135
+ children={<IconLink style={{ width: '85%', height: '85%' }} />}
136
+ />
137
+ </HStack> */
138
+ }
139
+
140
+ {enableDynamicViewWalkthrough && isDynamicView && <StartWalkthroughButton />}
141
+ <m.div
142
+ layout="position"
143
+ className={hstack({
144
+ gap: 1,
145
+ _empty: {
146
+ display: 'none',
147
+ },
148
+ })}>
149
+ <OpenSource />
150
+ <ToggleReadonly />
151
+ </m.div>
152
+ {enableSearch && <SearchControl />}
153
+ </AnimatePresence>
154
+ )
155
+ }