@likec4/diagram 1.48.0 → 1.49.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 (303) hide show
  1. package/README.md +7 -9
  2. package/adhoc-editor/package.json +4 -0
  3. package/dist/LikeC4Diagram.d.ts +2 -1
  4. package/dist/LikeC4Diagram.js +77 -79
  5. package/dist/LikeC4Diagram.props.d.ts +9 -1
  6. package/dist/LikeC4ModelProvider.d.ts +4 -4
  7. package/dist/LikeC4ModelProvider.js +2 -2
  8. package/dist/LikeC4ProjectsOverview.d.ts +3 -2
  9. package/dist/LikeC4ProjectsProvider.d.ts +2 -1
  10. package/dist/LikeC4ProjectsProvider.js +4 -4
  11. package/dist/LikeC4Styles.d.ts +2 -1
  12. package/dist/LikeC4View.d.ts +14 -1
  13. package/dist/LikeC4View.js +31 -18
  14. package/dist/ReactLikeC4.d.ts +2 -1
  15. package/dist/ReactLikeC4.js +3 -1
  16. package/dist/StaticLikeC4Diagram.d.ts +2 -1
  17. package/dist/StaticLikeC4Diagram.js +1 -0
  18. package/dist/_virtual/store-1b2fbb72.cjs.js +3 -0
  19. package/dist/_virtual/xstate-store-react.cjs.js +5 -0
  20. package/dist/_virtual/xstate-store-react.cjs2.js +3 -0
  21. package/dist/adhoc-editor/EditorPanel.d.ts +1 -0
  22. package/dist/adhoc-editor/EditorPanel.js +105 -0
  23. package/dist/adhoc-editor/ElementsTree.d.ts +2 -0
  24. package/dist/adhoc-editor/ElementsTree.js +142 -0
  25. package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +1 -1
  26. package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +46 -43
  27. package/dist/adhoc-editor/components/Tree.d.ts +48 -0
  28. package/dist/adhoc-editor/components/Tree.js +296 -0
  29. package/dist/adhoc-editor/hooks.d.ts +3 -3
  30. package/dist/adhoc-editor/hooks.js +5 -23
  31. package/dist/adhoc-editor/index.d.ts +1 -1
  32. package/dist/adhoc-editor/index.js +1 -0
  33. package/dist/adhoc-editor/{ActorProvider.d.ts → state/ActorProvider.d.ts} +1 -3
  34. package/dist/adhoc-editor/{ActorProvider.js → state/ActorProvider.js} +10 -11
  35. package/dist/adhoc-editor/state/actor.d.ts +13 -0
  36. package/dist/adhoc-editor/{actor.editor.d.ts → state/actor.editor.d.ts} +6 -4
  37. package/dist/adhoc-editor/state/actor.editor.js +205 -0
  38. package/dist/adhoc-editor/{actor.js → state/actor.js} +2 -6
  39. package/dist/adhoc-editor/{actor.layouter.d.ts → state/actor.layouter.d.ts} +7 -4
  40. package/dist/adhoc-editor/{actor.layouter.js → state/actor.layouter.js} +17 -13
  41. package/dist/adhoc-editor/{actor.types.d.ts → state/actor.types.d.ts} +12 -6
  42. package/dist/adhoc-editor/{actor.types.js → state/actor.types.js} +8 -1
  43. package/dist/adhoc-editor/state/panel.d.ts +95 -0
  44. package/dist/adhoc-editor/state/panel.js +139 -0
  45. package/dist/adhoc-editor/state/utils.d.ts +17 -0
  46. package/dist/adhoc-editor/state/utils.js +32 -0
  47. package/dist/adhoc-editor/useElementsTree.d.ts +18 -0
  48. package/dist/adhoc-editor/useElementsTree.js +130 -0
  49. package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +1 -1
  50. package/dist/base/const.d.ts +1 -0
  51. package/dist/base-primitives/compound/CompoundActionButton.js +26 -12
  52. package/dist/base-primitives/compound/CompoundDetailsButton.js +22 -9
  53. package/dist/base-primitives/compound/CompoundNodeContainer.js +5 -4
  54. package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
  55. package/dist/base-primitives/edge/EdgeLabel.js +3 -4
  56. package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +2 -1
  57. package/dist/base-primitives/edge/EdgeLabelContainer.js +12 -19
  58. package/dist/base-primitives/element/ElementActionButtons.js +35 -10
  59. package/dist/base-primitives/element/ElementDetailsButton.js +47 -18
  60. package/dist/base-primitives/element/ElementNodeContainer.d.ts +3 -3
  61. package/dist/base-primitives/element/ElementNodeContainer.js +23 -10
  62. package/dist/base-primitives/element/ElementShape.d.ts +2 -2
  63. package/dist/base-primitives/element/ElementShape.js +70 -7
  64. package/dist/components/ErrorFallback.js +1 -1
  65. package/dist/components/Link.js +3 -3
  66. package/dist/components/Logo.js +1 -1
  67. package/dist/components/NavigationPanel.js +2 -4
  68. package/dist/components/PortalToContainer.js +3 -4
  69. package/dist/components/RootContainer.js +9 -16
  70. package/dist/components/ViewNotFound.d.ts +3 -3
  71. package/dist/components/ViewNotFound.js +30 -26
  72. package/dist/context/CurrentViewModelProvider.d.ts +2 -0
  73. package/dist/context/CurrentViewModelProvider.js +12 -0
  74. package/dist/context/DefaultMantineProvider.d.ts +1 -1
  75. package/dist/context/DefaultMantineProvider.js +10 -1
  76. package/dist/context/DiagramEventHandlers.d.ts +5 -5
  77. package/dist/context/DiagramEventHandlers.js +10 -4
  78. package/dist/context/DiagramFeatures.d.ts +8 -7
  79. package/dist/context/DiagramFeatures.js +5 -3
  80. package/dist/context/FramerMotionConfig.d.ts +1 -3
  81. package/dist/context/IconRenderer.d.ts +5 -4
  82. package/dist/context/IconRenderer.js +51 -24
  83. package/dist/context/LikeC4ModelContext.d.ts +10 -5
  84. package/dist/context/LikeC4ModelContext.js +11 -3
  85. package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
  86. package/dist/context/LikeC4ProjectsContext.js +6 -2
  87. package/dist/context/RootContainerContext.d.ts +10 -3
  88. package/dist/context/RootContainerContext.js +8 -3
  89. package/dist/context/TagStylesContext.js +1 -1
  90. package/dist/custom/index.js +16 -15
  91. package/dist/editor/LikeC4EditorProvider.js +1 -1
  92. package/dist/editor/applyChangesToManualLayout.js +7 -7
  93. package/dist/editor/editorActor.actions.js +20 -20
  94. package/dist/editor/editorActor.states.js +0 -9
  95. package/dist/editor/useEditorActorLogic.d.ts +1 -2
  96. package/dist/editor/useEditorActorLogic.js +8 -11
  97. package/dist/hooks/index.d.ts +2 -2
  98. package/dist/hooks/safeContext.d.ts +4 -5
  99. package/dist/hooks/useCallbackRef.js +7 -6
  100. package/dist/hooks/useCurrentView.js +5 -10
  101. package/dist/hooks/useCurrentViewModel.d.ts +2 -6
  102. package/dist/hooks/useCurrentViewModel.js +3 -7
  103. package/dist/hooks/useDiagram.d.ts +9 -1
  104. package/dist/hooks/useDiagram.js +8 -2
  105. package/dist/hooks/useDiagramCompareLayout.d.ts +5 -5
  106. package/dist/hooks/useLikeC4ElementsTree.d.ts +1 -1
  107. package/dist/hooks/useLikeC4ElementsTree.js +1 -1
  108. package/dist/hooks/useLikeC4Model.d.ts +6 -2
  109. package/dist/hooks/useLikeC4Model.js +7 -9
  110. package/dist/hooks/useLikeC4Project.d.ts +4 -6
  111. package/dist/hooks/useLikeC4Project.js +19 -31
  112. package/dist/hooks/useLikeC4Styles.js +3 -9
  113. package/dist/hooks/useMantinePortalProps.d.ts +1 -1
  114. package/dist/hooks/useMediaPrint.d.ts +0 -2
  115. package/dist/hooks/useOverlaysActor.js +4 -4
  116. package/dist/hooks/useSearchActor.js +4 -4
  117. package/dist/index.d.ts +1 -3
  118. package/dist/index.js +2 -2
  119. package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -1
  120. package/dist/likec4diagram/DiagramXYFlow.js +5 -7
  121. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +22 -24
  122. package/dist/likec4diagram/custom/edges/edges.css.js +2 -1
  123. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +40 -55
  124. package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
  125. package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -2
  126. package/dist/likec4diagram/custom/nodes/NodeDrifts.js +3 -20
  127. package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +6 -0
  128. package/dist/likec4diagram/custom/nodes/NodeNotes.js +286 -0
  129. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -2
  130. package/dist/likec4diagram/custom/nodes/nodes.js +5 -2
  131. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +12 -8
  132. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +3 -3
  133. package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +1 -1
  134. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +8 -28
  135. package/dist/likec4diagram/state/DiagramActorProvider.js +30 -56
  136. package/dist/likec4diagram/state/diagram-api.d.ts +11 -0
  137. package/dist/likec4diagram/state/diagram-api.js +15 -0
  138. package/dist/likec4diagram/state/machine.actions.d.ts +27 -0
  139. package/dist/likec4diagram/state/machine.actions.js +78 -21
  140. package/dist/likec4diagram/state/machine.actions.layout.d.ts +1 -0
  141. package/dist/likec4diagram/state/machine.actions.layout.js +38 -3
  142. package/dist/likec4diagram/state/machine.js +4 -1
  143. package/dist/likec4diagram/state/machine.setup.d.ts +19 -2
  144. package/dist/likec4diagram/state/machine.state.navigating.js +1 -1
  145. package/dist/likec4diagram/state/machine.state.ready.d.ts +61 -1
  146. package/dist/likec4diagram/state/machine.state.ready.js +11 -3
  147. package/dist/likec4diagram/state/utils.d.ts +2 -1
  148. package/dist/likec4diagram/state/utils.js +1 -1
  149. package/dist/likec4diagram/types.d.ts +2 -2
  150. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +1 -1
  151. package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
  152. package/dist/likec4diagram/useLayoutConstraints.d.ts +12 -12
  153. package/dist/likec4diagram/useLayoutConstraints.js +125 -86
  154. package/dist/likec4diagram/xyflow-diagram/diagram-view.js +2 -0
  155. package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +7 -2
  156. package/dist/navigationpanel/NavigationPanel.js +2 -2
  157. package/dist/navigationpanel/NavigationPanelDropdown.js +13 -13
  158. package/dist/navigationpanel/_common.js +2 -2
  159. package/dist/navigationpanel/actor.js +1 -1
  160. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
  161. package/dist/navigationpanel/comparepanel/ComparePanel.js +155 -29
  162. package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
  163. package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -0
  164. package/dist/navigationpanel/comparepanel/DriftsSummary.js +264 -0
  165. package/dist/navigationpanel/controls/DetailsControls.js +4 -4
  166. package/dist/navigationpanel/controls/LayoutWarning.js +1 -1
  167. package/dist/navigationpanel/controls/LogoButton.js +1 -1
  168. package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
  169. package/dist/navigationpanel/controls/OpenSource.js +1 -1
  170. package/dist/navigationpanel/controls/SearchControl.js +1 -1
  171. package/dist/navigationpanel/controls/ToggleReadonly.js +3 -3
  172. package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
  173. package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
  174. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
  175. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
  176. package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
  177. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +6 -6
  178. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +16 -16
  179. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
  180. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +1 -1
  181. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
  182. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
  183. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +2 -2
  184. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
  185. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
  186. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
  187. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
  188. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +2 -2
  189. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
  190. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
  191. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
  192. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
  193. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +14 -0
  194. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +2 -2
  195. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +2 -2
  196. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
  197. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
  198. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
  199. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +2 -2
  200. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +14 -0
  201. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
  202. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
  203. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +14 -0
  204. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
  205. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +2 -2
  206. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +2 -2
  207. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +2 -2
  208. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +2 -2
  209. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +2 -2
  210. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +2 -2
  211. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +2 -2
  212. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +2 -2
  213. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
  214. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
  215. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +2 -2
  216. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +2 -2
  217. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
  218. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
  219. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
  220. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
  221. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +2 -2
  222. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +2 -2
  223. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +14 -0
  224. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +2 -2
  225. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
  226. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
  227. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
  228. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +2 -2
  229. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
  230. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +1 -1
  231. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
  232. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
  233. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
  234. package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/dist/store-1b2fbb72.cjs.js +742 -0
  235. package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/react/dist/xstate-store-react.cjs.js +175 -0
  236. package/dist/overlays/element-details/ElementDetailsCard.css.js +11 -11
  237. package/dist/overlays/element-details/ElementDetailsCard.js +39 -40
  238. package/dist/overlays/element-details/MetadataValue.js +7 -7
  239. package/dist/overlays/element-details/TabPanelDeployments.js +4 -4
  240. package/dist/overlays/element-details/TabPanelRelationships.css.js +5 -5
  241. package/dist/overlays/element-details/TabPanelRelationships.js +4 -5
  242. package/dist/overlays/element-details/TabPanelStructure.css.js +3 -3
  243. package/dist/overlays/element-details/TabPanelStructure.js +1 -1
  244. package/dist/overlays/overlaysActor.js +1 -1
  245. package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
  246. package/dist/overlays/relationship-details/SelectEdge.css.js +4 -4
  247. package/dist/overlays/relationship-details/SelectEdge.js +2 -2
  248. package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
  249. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -6
  250. package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
  251. package/dist/overlays/relationships-browser/SelectElement.js +2 -2
  252. package/dist/overlays/relationships-browser/actor.js +1 -1
  253. package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
  254. package/dist/overlays/relationships-browser/custom/EmptyNode.js +1 -1
  255. package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -1
  256. package/dist/projects-overview/ProjectsOverview.js +2 -2
  257. package/dist/projects-overview/ProjectsOverviewXY.d.ts +1 -5
  258. package/dist/projects-overview/ProjectsOverviewXY.js +1 -1
  259. package/dist/projects-overview/actor.d.ts +1 -1
  260. package/dist/projects-overview/context.d.ts +2 -2
  261. package/dist/projects-overview/context.js +2 -1
  262. package/dist/projects-overview/custom/nodeTypes.js +1 -1
  263. package/dist/search/Search.d.ts +2 -1
  264. package/dist/search/Search.js +108 -87
  265. package/dist/search/components/ElementsColumn.css.js +3 -3
  266. package/dist/search/components/ElementsColumn.js +93 -59
  267. package/dist/search/components/PickView.js +8 -4
  268. package/dist/search/components/SearchByTags.js +1 -1
  269. package/dist/search/components/SearchInput.js +2 -2
  270. package/dist/search/components/ViewsColum.d.ts +2 -1
  271. package/dist/search/components/ViewsColum.js +39 -35
  272. package/dist/search/components/ViewsColumn.css.js +1 -1
  273. package/dist/search/components/_shared.css.js +11 -11
  274. package/dist/search/components/utils.js +1 -4
  275. package/dist/search/hooks.js +4 -1
  276. package/dist/search/searchActor.d.ts +12 -2
  277. package/dist/search/searchActor.js +60 -4
  278. package/dist/shadowroot/ShadowRoot.d.ts +5 -2
  279. package/dist/shadowroot/ShadowRoot.js +7 -5
  280. package/dist/shadowroot/styles.css.js +3 -2
  281. package/dist/styles.css2.js +1 -1
  282. package/dist/utils/view-bounds.d.ts +3 -2
  283. package/dist/utils/view-bounds.js +1 -1
  284. package/dist/utils/xyflow.d.ts +10 -5
  285. package/dist/utils/xyflow.js +24 -22
  286. package/package.json +29 -28
  287. package/panda.buildinfo.json +175 -86
  288. package/styles-min.css +1 -1
  289. package/styles.css +1 -1
  290. package/bundle/index.js +0 -52554
  291. package/bundle/package.json +0 -4
  292. package/dist/adhoc-editor/EditorNavigationPanel.d.ts +0 -1
  293. package/dist/adhoc-editor/EditorNavigationPanel.js +0 -32
  294. package/dist/adhoc-editor/SelectElementOverlay.d.ts +0 -1
  295. package/dist/adhoc-editor/SelectElementOverlay.js +0 -124
  296. package/dist/adhoc-editor/actor.d.ts +0 -131
  297. package/dist/adhoc-editor/actor.editor.js +0 -96
  298. package/dist/adhoc-editor/viewrules/ViewRulesPanel.js +0 -104
  299. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.js +0 -14
  300. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -14
  301. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -14
  302. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -14
  303. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
@@ -1,80 +1,110 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { ifilter, sortParentsFirst, isAncestor, nameFromFqn } from '@likec4/core/utils';
2
+ import { ifilter, imap, toArray, isAncestor, stringHash, nameFromFqn } from '@likec4/core/utils';
3
3
  import { cx } from '@likec4/styles/css';
4
- import { useTree, Tree, ActionIcon, UnstyledButton, Box, Group, Highlight, Tooltip, Text } from '@mantine/core';
4
+ import { Txt } from '@likec4/styles/jsx';
5
+ import { useTree, Tree, ActionIcon, UnstyledButton, Box, Group, Highlight, Tooltip } from '@mantine/core';
5
6
  import * as m from 'motion/react-m';
6
7
  import { memo, useMemo, useEffect } from 'react';
7
- import { isEmpty, pipe, reduce, only, first } from 'remeda';
8
+ import { pipe, filter, hasAtLeast, reduce, only, first, last } from 'remeda';
8
9
  import { IconOrShapeRenderer } from '../../context/IconRenderer.js';
9
10
  import { useCallbackRef } from '../../hooks/useCallbackRef.js';
10
- import '@xstate/react';
11
- import 'fast-equals';
12
- import { useDiagram } from '../../hooks/safeContext.js';
13
- import { sortByLabel } from '../../hooks/useLikeC4ElementsTree.js';
14
11
  import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
15
12
  import { useNormalizedSearch, useSearchActor } from '../hooks.js';
16
13
  import { focusable, buttonsva } from './_shared.css.js';
17
14
  import { treeSubtree, treeLabel, treeRoot, treeNode, elementIcon, elementExpandIcon, elementTitleAndId, elementId, elementViewsCount } from './ElementsColumn.css.js';
18
- import { whenSearchAnimationEnds, stopAndPrevent, moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
15
+ import { stopAndPrevent, moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
19
16
  import { NothingFound } from './ViewsColum.js';
20
- import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
17
+ import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
21
18
 
22
- const btn = buttonsva();
23
- const ElementsColumn = memo(() => {
19
+ function useElementsColumnData() {
24
20
  const model = useLikeC4Model();
21
+ const allElements = useMemo(() => pipe(
22
+ model.elements(),
23
+ ifilter((i) => !i.imported),
24
+ imap((element) => ({
25
+ label: element.title,
26
+ value: element.id,
27
+ element,
28
+ // searchTerms,
29
+ viewsCount: [...element.views()].length,
30
+ children: []
31
+ })),
32
+ toArray()
33
+ ), [model]);
25
34
  const search = useNormalizedSearch();
26
- const data = useMemo(() => {
35
+ return useMemo(() => {
27
36
  const searchTerms = search.split(".");
28
37
  let elements;
29
- if (isEmpty(searchTerms) || searchTerms[0] === "kind:") {
30
- elements = model.elements();
31
- } else {
32
- elements = ifilter(model.elements(), (element) => {
33
- if (search.startsWith("kind:")) {
34
- return element.kind.toLocaleLowerCase().startsWith(search.slice(5));
38
+ if (search === "" || search === "kind:") {
39
+ elements = allElements;
40
+ } else if (search.startsWith("kind:")) {
41
+ const searchKind = search.slice(5);
42
+ elements = filter(allElements, ({ element }) => {
43
+ return element.kind.toLocaleLowerCase()[searchKind.length > 4 ? "startsWith" : "includes"](searchKind);
44
+ });
45
+ } else if (search.startsWith("#")) {
46
+ const searchTag = search.slice(1);
47
+ elements = filter(allElements, ({ element }) => {
48
+ return element.tags.some((tag) => tag.toLocaleLowerCase().includes(searchTag));
49
+ });
50
+ } else if (hasAtLeast(searchTerms, 2)) {
51
+ const satisfies = (element) => {
52
+ const fqnParts = element.id.toLocaleLowerCase().split(".");
53
+ if (fqnParts.length < searchTerms.length) {
54
+ return false;
35
55
  }
36
- if (search.startsWith("#")) {
37
- return element.tags.some((tag) => tag.toLocaleLowerCase().includes(search.slice(1)));
56
+ let lastMatchIndex = 0;
57
+ for (let i = 0; i < fqnParts.length; i++) {
58
+ if (fqnParts[i].includes(searchTerms[lastMatchIndex])) {
59
+ lastMatchIndex++;
60
+ if (lastMatchIndex === searchTerms.length) {
61
+ return true;
62
+ }
63
+ continue;
64
+ }
38
65
  }
39
- const value = element.title + " " + element.id + " " + element.summary.text;
66
+ return false;
67
+ };
68
+ elements = filter(allElements, ({ element }) => satisfies(element));
69
+ } else {
70
+ elements = filter(allElements, ({ element }) => {
71
+ const value = element.title + " " + element.name + " " + (element.summary.md || "");
40
72
  return value.toLocaleLowerCase().includes(search);
41
73
  });
42
74
  }
43
75
  const byid = {};
44
- const { all, roots } = pipe(
45
- [...elements],
46
- sortParentsFirst,
47
- reduce((acc, element) => {
48
- const treeItem = {
49
- label: element.title,
50
- value: element.id,
51
- element,
52
- searchTerms,
53
- children: []
54
- };
76
+ const { hash, all, roots } = pipe(
77
+ elements,
78
+ reduce((acc, treeItem) => {
79
+ treeItem.children = [];
55
80
  byid[treeItem.value] = treeItem;
56
81
  const parent = acc.all.findLast((root) => isAncestor(root.value, treeItem.value));
57
82
  if (parent) {
58
83
  parent.children.push(treeItem);
59
- if (parent.children.length > 1) {
60
- parent.children.sort(sortByLabel);
61
- }
62
84
  } else {
63
85
  acc.roots.push(treeItem);
64
86
  }
65
87
  acc.all.push(treeItem);
88
+ acc.hash = stringHash(acc.hash + treeItem.value);
66
89
  return acc;
67
90
  }, {
91
+ hash: "empty",
68
92
  all: [],
69
93
  roots: []
70
94
  })
71
95
  );
72
96
  return {
97
+ hash,
73
98
  all,
74
99
  byid,
75
- roots: roots.sort(sortByLabel)
100
+ roots,
101
+ searchTerms: hasAtLeast(searchTerms, 1) ? searchTerms : [search]
76
102
  };
77
- }, [model, search]);
103
+ }, [allElements, search]);
104
+ }
105
+ const btn = buttonsva();
106
+ const ElementsColumn = memo(() => {
107
+ const data = useElementsColumnData();
78
108
  const handleClick = useHandleElementSelection();
79
109
  if (data.all.length === 0) {
80
110
  return /* @__PURE__ */ jsx(NothingFound, {});
@@ -85,8 +115,10 @@ const setHoveredNode = () => {
85
115
  };
86
116
  function ElementsTree({
87
117
  data: {
118
+ searchTerms,
88
119
  all,
89
120
  byid,
121
+ hash,
90
122
  roots
91
123
  },
92
124
  handleClick
@@ -102,7 +134,7 @@ function ElementsTree({
102
134
  tree.expand(nd.value);
103
135
  }
104
136
  }
105
- }, [all]);
137
+ }, [hash]);
106
138
  const onKeyDownCapture = useCallbackRef((e) => {
107
139
  const target = e.target;
108
140
  const id = target.getAttribute("data-value");
@@ -154,12 +186,12 @@ function ElementsTree({
154
186
  subtree: treeSubtree
155
187
  },
156
188
  onKeyDownCapture,
157
- renderNode: (p) => /* @__PURE__ */ jsx(ElementTreeNode, { ...p, handleClick })
189
+ renderNode: (p) => /* @__PURE__ */ jsx(ElementTreeNode, { ...p, searchTerms, handleClick })
158
190
  }
159
191
  );
160
192
  }
161
- function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClick }) {
162
- const { element, searchTerms } = node;
193
+ function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClick, searchTerms }) {
194
+ const { label, element, viewsCount } = node;
163
195
  const elementIcon$1 = IconOrShapeRenderer({
164
196
  element: {
165
197
  id: element.id,
@@ -169,7 +201,6 @@ function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClic
169
201
  },
170
202
  className: cx(btn.icon, elementIcon)
171
203
  });
172
- const views = [...element.views()];
173
204
  const key = `@tree.${node.value}`;
174
205
  return /* @__PURE__ */ jsxs(m.div, { layoutId: key, ...elementProps, children: [
175
206
  /* @__PURE__ */ jsx(
@@ -203,7 +234,7 @@ function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClic
203
234
  tabIndex: -1,
204
235
  "data-value": element.id,
205
236
  className: cx(btn.root, "group", "likec4-element-button"),
206
- ...views.length > 0 && {
237
+ ...viewsCount > 0 && {
207
238
  onClick: (e) => {
208
239
  if (!hasChildren || expanded) {
209
240
  e.stopPropagation();
@@ -215,23 +246,32 @@ function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClic
215
246
  elementIcon$1,
216
247
  /* @__PURE__ */ jsxs(Box, { style: { flexGrow: 1 }, children: [
217
248
  /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", align: "center", className: elementTitleAndId, children: [
218
- /* @__PURE__ */ jsx(Highlight, { component: "div", highlight: searchTerms, className: btn.title, children: node.label }),
249
+ /* @__PURE__ */ jsx(Highlight, { component: "div", highlight: searchTerms, className: btn.title, children: label }),
219
250
  /* @__PURE__ */ jsx(Tooltip, { label: element.id, withinPortal: false, fz: "xs", disabled: !element.id.includes("."), children: /* @__PURE__ */ jsx(
220
251
  Highlight,
221
252
  {
222
253
  component: "div",
223
- highlight: searchTerms,
254
+ highlight: last(searchTerms),
224
255
  className: cx(elementId, btn.descriptionColor),
225
256
  children: nameFromFqn(element.id)
226
257
  }
227
258
  ) })
228
259
  ] }),
229
- /* @__PURE__ */ jsx(Highlight, { component: "div", highlight: searchTerms, className: btn.description, lineClamp: 1, children: element.summary.text || "No description" })
260
+ /* @__PURE__ */ jsx(
261
+ Highlight,
262
+ {
263
+ component: "div",
264
+ highlight: element.summary.nonEmpty ? searchTerms : [],
265
+ className: btn.description,
266
+ lineClamp: 1,
267
+ children: element.summary.nonEmpty ? element.summary.text : "No description"
268
+ }
269
+ )
230
270
  ] }),
231
- /* @__PURE__ */ jsx(Text, { component: "div", className: cx(elementViewsCount, btn.descriptionColor), fz: "xs", children: views.length === 0 ? "No views" : /* @__PURE__ */ jsxs(Fragment, { children: [
232
- views.length,
271
+ /* @__PURE__ */ jsx(Txt, { as: "div", className: cx(elementViewsCount, btn.descriptionColor), size: "xs", children: viewsCount === 0 ? "No views" : /* @__PURE__ */ jsxs(Fragment, { children: [
272
+ viewsCount,
233
273
  " view",
234
- views.length > 1 ? "s" : ""
274
+ viewsCount > 1 ? "s" : ""
235
275
  ] }) })
236
276
  ]
237
277
  }
@@ -239,7 +279,6 @@ function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClic
239
279
  ] });
240
280
  }
241
281
  function useHandleElementSelection() {
242
- const diagram = useDiagram();
243
282
  const searchActorRef = useSearchActor();
244
283
  return useCallbackRef((element) => {
245
284
  const views = [...element.views()];
@@ -252,16 +291,11 @@ function useHandleElementSelection() {
252
291
  searchActorRef.send({ type: "pickview.open", elementFqn });
253
292
  return;
254
293
  }
255
- const isSameView = onlyOneViewId === diagram.currentView.id;
256
- searchActorRef.send({ type: "close" });
257
- whenSearchAnimationEnds(() => {
258
- if (isSameView) {
259
- diagram.focusOnElement(elementFqn);
260
- return;
261
- }
262
- diagram.navigateTo(onlyOneViewId, void 0, elementFqn);
294
+ searchActorRef.send({
295
+ type: "navigate.to",
296
+ viewId: onlyOneViewId,
297
+ focusOnElement: elementFqn
263
298
  });
264
- return;
265
299
  });
266
300
  }
267
301
 
@@ -1,16 +1,18 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import { FocusTrap, Group, Title, ActionIcon, ScrollAreaAutosize, Stack } from '@mantine/core';
3
- import { useWindowEvent } from '@mantine/hooks';
3
+ import { useWindowEvent, useCallbackRef } from '@mantine/hooks';
4
4
  import * as m from 'motion/react-m';
5
+ import { useCurrentViewId } from '../../hooks/useCurrentView.js';
5
6
  import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
6
7
  import { pickviewBackdrop, pickview, pickviewGroup } from './styles.css.js';
7
8
  import { ViewButton } from './ViewsColum.js';
8
- import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
9
+ import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
9
10
 
10
11
  function PickView({
11
12
  searchActorRef,
12
13
  elementFqn
13
14
  }) {
15
+ const currentViewId = useCurrentViewId();
14
16
  const element = useLikeC4Model().element(elementFqn);
15
17
  const scoped = [];
16
18
  const others = [];
@@ -26,7 +28,7 @@ function PickView({
26
28
  };
27
29
  useWindowEvent(
28
30
  "keydown",
29
- (event) => {
31
+ useCallbackRef((event) => {
30
32
  try {
31
33
  if (event.key === "Escape") {
32
34
  event.stopPropagation();
@@ -36,7 +38,7 @@ function PickView({
36
38
  } catch (e) {
37
39
  console.warn(e);
38
40
  }
39
- },
41
+ }),
40
42
  {
41
43
  capture: true
42
44
  }
@@ -101,6 +103,7 @@ function PickView({
101
103
  ViewButton,
102
104
  {
103
105
  view,
106
+ currentViewId,
104
107
  search: "",
105
108
  loop: true,
106
109
  focusOnElement: elementFqn,
@@ -117,6 +120,7 @@ function PickView({
117
120
  ViewButton,
118
121
  {
119
122
  view,
123
+ currentViewId,
120
124
  search: "",
121
125
  loop: true,
122
126
  focusOnElement: elementFqn,
@@ -7,7 +7,7 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
7
7
  import { useUpdateSearch, useNormalizedSearch } from '../hooks.js';
8
8
  import { focusToFirstFoundElement, moveFocusToSearchInput } from './utils.js';
9
9
  import { ElementTag } from '../../base-primitives/element/ElementTags.js';
10
- import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
10
+ import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
11
11
 
12
12
  function SearchByTags() {
13
13
  const ref = useRef(null);
@@ -7,7 +7,7 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
7
7
  import { useSearchActor, useSearch } from '../hooks.js';
8
8
  import { input } from './styles.css.js';
9
9
  import { moveFocusToSearchInput, stopAndPrevent, focusToFirstFoundElement } from './utils.js';
10
- import IconSearch from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js';
10
+ import IconSearch from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js';
11
11
 
12
12
  function startingWithKind(search) {
13
13
  return search.match(/^(k|ki|kin|kind|kind:)$/) != null;
@@ -56,7 +56,7 @@ const LikeC4SearchInput = memo(() => {
56
56
  /* @__PURE__ */ jsx(ComboboxEmpty, { children: "No tags found" }, "empty-tags")
57
57
  ];
58
58
  } else {
59
- isExactMatch = likec4model.tags.some((tag) => tag.toLocaleLowerCase() === searchTag);
59
+ isExactMatch = alloptions.some((tag) => tag.toLocaleLowerCase() === searchTag);
60
60
  options = alloptions.map((tag) => /* @__PURE__ */ jsxs(ComboboxOption, { value: `#${tag}`, children: [
61
61
  /* @__PURE__ */ jsx(Text, { component: "span", opacity: 0.5, mr: 1, fz: "sm", children: "#" }),
62
62
  tag
@@ -4,8 +4,9 @@ import { ElementProps, UnstyledButtonProps } from '@mantine/core';
4
4
  import { MemoExoticComponent } from 'react';
5
5
  export declare const NothingFound: () => import("react/jsx-runtime").JSX.Element;
6
6
  export declare const ViewsColumn: MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
7
- export declare function ViewButton({ className, view, loop, search, focusOnElement, ...props }: {
7
+ export declare function ViewButton({ className, view, loop, search, focusOnElement, currentViewId, ...props }: {
8
8
  view: LikeC4Model.View;
9
+ currentViewId: string;
9
10
  search: string;
10
11
  loop?: boolean;
11
12
  focusOnElement?: Fqn;
@@ -1,39 +1,47 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { preferSummary } from '@likec4/core/types';
2
3
  import { cx } from '@likec4/styles/css';
3
4
  import { Box } from '@likec4/styles/jsx';
4
- import { Stack, VisuallyHidden, UnstyledButton, createScopedKeydownHandler, ThemeIcon, Group, Highlight, Badge } from '@mantine/core';
5
+ import { Stack, VisuallyHidden, UnstyledButton, ThemeIcon, Group, Highlight, Badge, createScopedKeydownHandler } from '@mantine/core';
5
6
  import * as m from 'motion/react-m';
6
- import { memo, useRef } from 'react';
7
+ import { memo, useRef, useMemo } from 'react';
7
8
  import { first } from 'remeda';
8
9
  import { useCurrentViewId } from '../../hooks/useCurrentView.js';
9
- import '@xstate/react';
10
- import 'fast-equals';
11
- import { useDiagram } from '../../hooks/safeContext.js';
12
10
  import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
13
11
  import { useNormalizedSearch, useSearchActor } from '../hooks.js';
14
- import { emptyBoX, buttonsva, focusable } from './_shared.css.js';
15
- import { moveFocusToSearchInput, queryAllFocusable, centerY, whenSearchAnimationEnds } from './utils.js';
12
+ import { emptyBoX, focusable, buttonsva } from './_shared.css.js';
13
+ import { moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
16
14
  import { viewButton } from './ViewsColumn.css.js';
17
- import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js';
18
- import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
15
+ import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js';
16
+ import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
19
17
 
20
18
  const NothingFound = () => /* @__PURE__ */ jsx(Box, { className: emptyBoX, children: "Nothing found" });
19
+ const useFoundViews = () => {
20
+ const currentViewId = useCurrentViewId();
21
+ const likec4model = useLikeC4Model();
22
+ const search = useNormalizedSearch();
23
+ return useMemo(() => {
24
+ let views = [...likec4model.views()];
25
+ if (search) {
26
+ if (search.startsWith("kind:")) {
27
+ views = [];
28
+ } else {
29
+ const searchTag = search.startsWith("#") ? search.slice(1) : null;
30
+ views = views.filter((view) => {
31
+ if (searchTag) {
32
+ return view.tags.some((tag) => tag.toLocaleLowerCase().includes(searchTag));
33
+ }
34
+ const desc = preferSummary(view.$view)?.md || " ";
35
+ return `${view.id} ${view.title} ${desc}`.toLocaleLowerCase().includes(search);
36
+ });
37
+ }
38
+ }
39
+ return [views, search, currentViewId];
40
+ }, [likec4model, search, currentViewId]);
41
+ };
21
42
  const ViewsColumn = memo(() => {
22
43
  const ref = useRef(null);
23
- let views = [...useLikeC4Model().views()];
24
- let search = useNormalizedSearch();
25
- if (search) {
26
- if (search.startsWith("kind:")) {
27
- views = [];
28
- } else {
29
- views = views.filter((view) => {
30
- if (search.startsWith("#")) {
31
- return view.tags.some((tag) => tag.toLocaleLowerCase().includes(search.slice(1)));
32
- }
33
- return `${view.id} ${view.title} ${view.description.text}`.toLocaleLowerCase().includes(search);
34
- });
35
- }
36
- }
44
+ const [views, search, currentViewId] = useFoundViews();
37
45
  return /* @__PURE__ */ jsxs(
38
46
  Stack,
39
47
  {
@@ -71,6 +79,7 @@ const ViewsColumn = memo(() => {
71
79
  ViewButton,
72
80
  {
73
81
  view,
82
+ currentViewId,
74
83
  search,
75
84
  tabIndex: i === 0 ? 0 : -1
76
85
  }
@@ -80,20 +89,15 @@ const ViewsColumn = memo(() => {
80
89
  );
81
90
  });
82
91
  const btn = buttonsva();
83
- function ViewButton({ className, view, loop = false, search, focusOnElement, ...props }) {
92
+ function ViewButton({ className, view, loop = false, search, focusOnElement, currentViewId, ...props }) {
84
93
  const searchActorRef = useSearchActor();
85
- const diagram = useDiagram();
86
94
  const nextViewId = view.id;
87
- const currentViewId = useCurrentViewId();
88
95
  const isCurrentView = nextViewId === currentViewId;
89
96
  const navigate = () => {
90
- searchActorRef.send({ type: "close" });
91
- whenSearchAnimationEnds(() => {
92
- if (isCurrentView && focusOnElement) {
93
- diagram.focusOnElement(focusOnElement);
94
- return;
95
- }
96
- diagram.navigateTo(nextViewId, void 0, focusOnElement);
97
+ searchActorRef.send({
98
+ type: "navigate.to",
99
+ viewId: nextViewId,
100
+ focusOnElement
97
101
  });
98
102
  };
99
103
  return /* @__PURE__ */ jsxs(
@@ -124,7 +128,7 @@ function ViewButton({ className, view, loop = false, search, focusOnElement, ...
124
128
  /* @__PURE__ */ jsx(ThemeIcon, { variant: "transparent", className: btn.icon, children: view.isDeploymentView() ? /* @__PURE__ */ jsx(IconStack2, { stroke: 1.8 }) : /* @__PURE__ */ jsx(IconZoomScan, { stroke: 1.8 }) }),
125
129
  /* @__PURE__ */ jsxs(Box, { style: { flexGrow: 1 }, children: [
126
130
  /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", align: "center", children: [
127
- /* @__PURE__ */ jsx(Highlight, { component: "div", highlight: search, className: btn.title, children: view.title || "untitled" }),
131
+ /* @__PURE__ */ jsx(Highlight, { component: "div", highlight: search, className: btn.title, children: view.titleOrUntitled }),
128
132
  isCurrentView && /* @__PURE__ */ jsx(Badge, { size: "xs", fz: 9, radius: "sm", children: "current" })
129
133
  ] }),
130
134
  /* @__PURE__ */ jsx(
@@ -18,7 +18,7 @@ const viewButton = cx(
18
18
  css({
19
19
  marginTop: "1",
20
20
  // transition: transitions.fast,
21
- // color: `[var(${descriptionColor}, {colors.mantine.colors.dimmed})]`,
21
+ // color: `[var(${descriptionColor}, {colors.text.dimmed})]`,
22
22
  fontSize: "13px",
23
23
  lineHeight: "1.4",
24
24
  [`:where(.likec4-view-btn[data-disabled]) &`]: {
@@ -9,7 +9,7 @@ const _treenodefocus = ".mantine-Tree-node:focus > .mantine-Tree-label &";
9
9
  const button = css.raw({
10
10
  display: "flex",
11
11
  width: "100%",
12
- background: "mantine.colors.body",
12
+ background: "body",
13
13
  rounded: "sm",
14
14
  padding: `[12px 8px 12px 14px]`,
15
15
  minHeight: "60px",
@@ -17,10 +17,10 @@ const button = css.raw({
17
17
  // alignItems: 'flex-start',
18
18
  // transition: `all 50ms ${easings.inOut}`,
19
19
  border: `1px solid`,
20
- borderColor: "mantine.colors.defaultBorder",
20
+ borderColor: "default.border",
21
21
  // [titleColor]: '{colors.mantine.colors.dark[1]}',
22
- // [iconColor]: '{colors.mantine.colors.dimmed}',
23
- // [descriptionColor]: '{colors.mantine.colors.dimmed}',
22
+ // [iconColor]: '{colors.text.dimmed}',
23
+ // [descriptionColor]: '{colors.text.dimmed}',
24
24
  _hover: {
25
25
  ...buttonFocused,
26
26
  borderColor: "mantine.colors.primary[9]",
@@ -52,7 +52,7 @@ const iconSize = {
52
52
  };
53
53
  const icon = css.raw({
54
54
  color: {
55
- base: "mantine.colors.dimmed",
55
+ base: "text.dimmed",
56
56
  _light: "mantine.colors.gray[5]",
57
57
  _groupHover: "mantine.colors.primary[0]",
58
58
  _groupFocus: "mantine.colors.primary[0]"
@@ -98,23 +98,23 @@ const title = css.raw({
98
98
  _light: "mantine.colors.gray[7]",
99
99
  _groupHover: {
100
100
  base: "mantine.colors.primary[1]",
101
- _light: "mantine.colors.white"
101
+ _light: "white"
102
102
  },
103
103
  _groupFocus: {
104
104
  base: "mantine.colors.primary[1]",
105
- _light: "mantine.colors.white"
105
+ _light: "white"
106
106
  }
107
107
  },
108
108
  [_treenodefocus]: {
109
109
  color: {
110
110
  base: "mantine.colors.primary[1]",
111
- _light: "mantine.colors.white"
111
+ _light: "white"
112
112
  }
113
113
  }
114
114
  });
115
115
  const descriptionColor = css.raw({
116
116
  color: {
117
- base: "mantine.colors.dimmed",
117
+ base: "text.dimmed",
118
118
  _groupHover: {
119
119
  base: "mantine.colors.primary[1]",
120
120
  _light: "mantine.colors.primary[0]"
@@ -137,13 +137,13 @@ const emptyBoX = css({
137
137
  width: "100%",
138
138
  height: "100%",
139
139
  border: `2px dashed`,
140
- borderColor: "mantine.colors.defaultBorder",
140
+ borderColor: "default.border",
141
141
  rounded: "md",
142
142
  display: "flex",
143
143
  justifyContent: "center",
144
144
  alignItems: "center",
145
145
  fontSize: "md",
146
- color: "mantine.colors.dimmed",
146
+ color: "text.dimmed",
147
147
  padding: "md",
148
148
  paddingBlock: "xl"
149
149
  });
@@ -54,8 +54,5 @@ function queryAllFocusable(from, where, selector = `.${focusable}`) {
54
54
  const elements = root.querySelectorAll(`[data-likec4-search-${where}] ${selector}`);
55
55
  return [...elements];
56
56
  }
57
- function whenSearchAnimationEnds(callback) {
58
- setTimeout(callback, 400);
59
- }
60
57
 
61
- export { centerY, focusToFirstFoundElement, moveFocusToSearchInput, queryAllFocusable, stopAndPrevent, whenSearchAnimationEnds };
58
+ export { centerY, focusToFirstFoundElement, moveFocusToSearchInput, queryAllFocusable, stopAndPrevent };
@@ -20,8 +20,11 @@ function useSearch() {
20
20
  }
21
21
  const selectNormalizedSearchValue = (s) => {
22
22
  let v = selectSearchValue(s);
23
- if (v === "") return "";
23
+ if (v === "") return v;
24
24
  v = v.trim().toLowerCase();
25
+ if (v.startsWith("#") && v.length <= 2) {
26
+ return "";
27
+ }
25
28
  return v.length > 1 ? v : "";
26
29
  };
27
30
  function useNormalizedSearch() {
@@ -1,4 +1,4 @@
1
- import { Fqn } from '@likec4/core/types';
1
+ import { Fqn, ViewId } from '@likec4/core/types';
2
2
  import { ActorRef, SnapshotFrom, StateMachine } from 'xstate';
3
3
  export type SearchActorEvent = {
4
4
  type: 'open';
@@ -11,6 +11,12 @@ export type SearchActorEvent = {
11
11
  } | {
12
12
  type: 'pickview.open';
13
13
  elementFqn: Fqn;
14
+ } | {
15
+ type: 'navigate.to';
16
+ viewId: ViewId;
17
+ focusOnElement?: Fqn | undefined;
18
+ } | {
19
+ type: 'animation.presence.end';
14
20
  } | {
15
21
  type: 'pickview.close';
16
22
  };
@@ -18,8 +24,12 @@ export interface SearchContext {
18
24
  openedWithSearch: string | null;
19
25
  searchValue: string;
20
26
  pickViewFor: Fqn | null;
27
+ navigateTo: {
28
+ viewId: ViewId;
29
+ focusOnElement?: Fqn | undefined;
30
+ } | null;
21
31
  }
22
- export interface SearchActorLogic extends StateMachine<SearchContext, SearchActorEvent, {}, any, any, any, any, 'inactive' | 'opened' | 'pickView', never, never, any, any, any, any> {
32
+ export interface SearchActorLogic extends StateMachine<SearchContext, SearchActorEvent, {}, any, any, any, any, 'inactive' | 'opened' | 'pickView' | 'waitAnimationEnd', never, never, any, any, any, any> {
23
33
  }
24
34
  export declare const searchActorLogic: SearchActorLogic;
25
35
  export type SearchActorSnapshot = SnapshotFrom<SearchActorLogic>;