@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
@@ -0,0 +1,105 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { VStack, HStack, Txt, Box } from '@likec4/styles/jsx';
3
+ import { ActionIcon, Input, CloseButton } from '@mantine/core';
4
+ import { AnimatePresence } from 'motion/react';
5
+ import { Suspense } from 'react';
6
+ import { prop } from 'remeda';
7
+ import { Logo } from '../components/Logo.js';
8
+ import { ElementsTree } from './ElementsTree.js';
9
+ import { EditorPanelStoreProvider, useEditorPanelState, useEditorPanelTrigger, selectEditorPanelState } from './state/panel.js';
10
+ import IconTrash from '../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js';
11
+
12
+ const EditorPanel = () => {
13
+ return /* @__PURE__ */ jsx(EditorPanelStoreProvider, { children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ jsxs(
14
+ VStack,
15
+ {
16
+ css: {
17
+ position: "fixed",
18
+ top: "0",
19
+ left: "0",
20
+ gap: "1",
21
+ bottom: "0",
22
+ height: "auto",
23
+ overflow: "hidden",
24
+ layerStyle: "likec4.panel",
25
+ width: "[300px]",
26
+ rounded: "0"
27
+ },
28
+ onClick: (e) => {
29
+ e.stopPropagation();
30
+ const input = document.getElementById("search-input");
31
+ if (input) {
32
+ input.focus();
33
+ }
34
+ },
35
+ children: [
36
+ /* @__PURE__ */ jsxs(HStack, { p: "2", gap: "4", justifyItems: "stretch", children: [
37
+ /* @__PURE__ */ jsx(Logo, { style: { height: 16 } }),
38
+ /* @__PURE__ */ jsx(Txt, { size: "sm", fontWeight: "medium", flex: "1", children: "Explore" }),
39
+ /* @__PURE__ */ jsx(HStack, { gap: "1", children: /* @__PURE__ */ jsx(ActionIcon, { children: /* @__PURE__ */ jsx(IconTrash, {}) }) })
40
+ ] }),
41
+ /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(SearchInput, {}) }),
42
+ /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(ElementsTree, {}) })
43
+ ]
44
+ }
45
+ ) }) });
46
+ };
47
+ const selectInput = selectEditorPanelState(prop("searchInput"));
48
+ function SearchInput() {
49
+ const input = useEditorPanelState(selectInput);
50
+ const trigger = useEditorPanelTrigger();
51
+ const onChange = useEditorPanelTrigger((trigger2, event) => {
52
+ trigger2.inputChange({ value: event.currentTarget.value });
53
+ });
54
+ const clear = useEditorPanelTrigger((trigger2) => {
55
+ trigger2.inputChange({ value: "" });
56
+ });
57
+ return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
58
+ Input,
59
+ {
60
+ id: "search-input",
61
+ size: "xs",
62
+ variant: "filled",
63
+ placeholder: "Search by title, description or start with # or kind:",
64
+ value: input,
65
+ onChange,
66
+ "data-likec4-search-input": true,
67
+ rightSectionPointerEvents: "all",
68
+ rightSection: /* @__PURE__ */ jsx(
69
+ CloseButton,
70
+ {
71
+ size: "sm",
72
+ "aria-label": "Clear input",
73
+ onClick: clear,
74
+ style: { display: input ? void 0 : "none" }
75
+ }
76
+ ),
77
+ onKeyDownCapture: (e) => {
78
+ switch (e.key) {
79
+ case "Escape": {
80
+ e.stopPropagation();
81
+ e.preventDefault();
82
+ clear();
83
+ break;
84
+ }
85
+ case "Enter": {
86
+ e.stopPropagation();
87
+ e.preventDefault();
88
+ break;
89
+ }
90
+ case "ArrowDown": {
91
+ e.stopPropagation();
92
+ e.preventDefault();
93
+ trigger.inputKeyDown();
94
+ break;
95
+ }
96
+ default: {
97
+ return;
98
+ }
99
+ }
100
+ }
101
+ }
102
+ ) });
103
+ }
104
+
105
+ export { EditorPanel };
@@ -0,0 +1,2 @@
1
+ import { MemoExoticComponent } from 'react';
2
+ export declare const ElementsTree: MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1,142 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { invariant } from '@likec4/core/utils';
3
+ import { Box } from '@likec4/styles/jsx';
4
+ import { ScrollArea } from '@mantine/core';
5
+ import { mergeProps } from '@zag-js/react';
6
+ import { memo } from 'react';
7
+ import { Tree } from './components/Tree.js';
8
+ import { useEditorPanelTrigger } from './state/panel.js';
9
+ import { useElementsTree } from './useElementsTree.js';
10
+
11
+ const ElementsTree = memo(() => {
12
+ const api = useElementsTree();
13
+ const onClick = useEditorPanelTrigger((trigger, event) => {
14
+ const id = event.currentTarget.closest("[data-value]")?.getAttribute("data-value");
15
+ if (!id) {
16
+ return;
17
+ }
18
+ try {
19
+ event.stopPropagation();
20
+ event.preventDefault();
21
+ api.expand([id]);
22
+ trigger.elementClick({ id });
23
+ } catch (err) {
24
+ console.error("Failed to handle element click", err);
25
+ }
26
+ });
27
+ const rootProps = mergeProps(api.getRootProps(), {
28
+ onKeyDown: (e) => {
29
+ switch (e.key) {
30
+ case "Escape": {
31
+ const input = document.getElementById("search-input");
32
+ if (input) {
33
+ e.stopPropagation();
34
+ e.preventDefault();
35
+ input.focus();
36
+ }
37
+ break;
38
+ }
39
+ case "ArrowUp": {
40
+ console.log("ArrowUp", {
41
+ selected: api.selectedValue
42
+ });
43
+ break;
44
+ }
45
+ default: {
46
+ console.log(e.key);
47
+ return;
48
+ }
49
+ }
50
+ }
51
+ // onClick: useCallbackRef((e: MouseEvent) => {
52
+ // const lastnd = last(api.getVisibleNodes())
53
+ // if (lastnd) {
54
+ // e.stopPropagation()
55
+ // api.focus(lastnd.node.id)
56
+ // }
57
+ // }),
58
+ });
59
+ return /* @__PURE__ */ jsx(
60
+ ScrollArea,
61
+ {
62
+ flex: "1 1 100%",
63
+ scrollbars: "y",
64
+ type: "scroll",
65
+ scrollbarSize: "4px",
66
+ // className="arsars"
67
+ // styles={{
68
+ // content: {
69
+ // height: '100%',
70
+ // },
71
+ // }}
72
+ // viewportProps={{
73
+ // onClick: (e) => {
74
+ // const lastnd = api.getVisibleNodes().at(-1)?.node
75
+ // if (lastnd) {
76
+ // e.preventDefault()
77
+ // e.stopPropagation()
78
+ // setTimeout(() => {
79
+ // api.focus(lastnd.id)
80
+ // }, 50)
81
+ // }
82
+ // },
83
+ // }}
84
+ ...rootProps,
85
+ children: /* @__PURE__ */ jsxs(Tree.Root, { ...api.getTreeProps(), children: [
86
+ api.collection.rootNode.children.map((node, index) => /* @__PURE__ */ jsx(
87
+ TreeNode,
88
+ {
89
+ node,
90
+ api,
91
+ onClick
92
+ },
93
+ node.id
94
+ )),
95
+ !api.collection.getFirstNode() && /* @__PURE__ */ jsx(
96
+ Box,
97
+ {
98
+ css: {
99
+ p: "4",
100
+ textAlign: "center"
101
+ },
102
+ children: "Nothing found"
103
+ }
104
+ )
105
+ ] })
106
+ }
107
+ );
108
+ });
109
+ const TreeNode = ({ api, node, onClick }) => {
110
+ const indexPath = api.collection.getIndexPath(node.id);
111
+ invariant(indexPath, "Node not found in collection");
112
+ const nodeProps = { indexPath, node };
113
+ const state = api.getNodeState(nodeProps);
114
+ if (state.isBranch) {
115
+ return /* @__PURE__ */ jsxs(Tree.Branch, { ...api.getBranchProps(nodeProps), children: [
116
+ /* @__PURE__ */ jsxs(Tree.Control, { ...api.getBranchControlProps(nodeProps), children: [
117
+ /* @__PURE__ */ jsx(Tree.Icon, { element: node }),
118
+ /* @__PURE__ */ jsxs(Tree.Label, { ...api.getBranchTextProps(nodeProps), children: [
119
+ node.title,
120
+ /* @__PURE__ */ jsx(Tree.Indicator, { ...api.getBranchIndicatorProps(nodeProps) })
121
+ ] }),
122
+ /* @__PURE__ */ jsx(Tree.State, { node, state: node.state, onClick })
123
+ ] }),
124
+ /* @__PURE__ */ jsx(Tree.Content, { ...api.getBranchContentProps(nodeProps), children: state.expanded && node.children.map((childNode, index) => /* @__PURE__ */ jsx(
125
+ TreeNode,
126
+ {
127
+ node: childNode,
128
+ api,
129
+ onClick
130
+ },
131
+ childNode.id
132
+ )) })
133
+ ] });
134
+ }
135
+ return /* @__PURE__ */ jsxs(Tree.Item, { ...api.getItemProps(nodeProps), children: [
136
+ /* @__PURE__ */ jsx(Tree.Icon, { element: node }),
137
+ /* @__PURE__ */ jsx(Tree.Label, { ...api.getItemTextProps(nodeProps), children: node.title }),
138
+ /* @__PURE__ */ jsx(Tree.State, { node, state: node.state, onClick })
139
+ ] });
140
+ };
141
+
142
+ export { ElementsTree };
@@ -1,4 +1,4 @@
1
- import { AdhocViewService } from './actor.types';
1
+ import { AdhocViewService } from './state/actor.types';
2
2
  export declare function LikeC4AdHocViewEditor({ service }: {
3
3
  service: AdhocViewService;
4
4
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,59 +1,48 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { ReactFlowProvider } from '@xyflow/react';
3
- import { Profiler } from 'react';
3
+ import { useRef, Profiler, memo, useEffect } from 'react';
4
+ import { mapValues } from 'remeda';
4
5
  import { FitViewPaddings } from '../base/const.js';
5
6
  import { RootContainer } from '../components/RootContainer.js';
6
- import { DiagramFeatures } from '../context/DiagramFeatures.js';
7
+ import { DiagramFeatures, DefaultFeatures } from '../context/DiagramFeatures.js';
7
8
  import { EnsureMantine } from '../context/EnsureMantine.js';
8
9
  import { FramerMotionConfig } from '../context/FramerMotionConfig.js';
10
+ import { IconRendererProvider } from '../context/IconRenderer.js';
9
11
  import { TagStylesProvider } from '../context/TagStylesContext.js';
10
12
  import { useId } from '../hooks/useId.js';
11
13
  import { LikeC4DiagramXYFlow } from '../likec4diagram/DiagramXYFlow.js';
12
14
  import { DiagramActorProvider } from '../likec4diagram/state/DiagramActorProvider.js';
13
15
  import { LikeC4Styles } from '../LikeC4Styles.js';
14
- import { AdhocEditorActorProvider } from './ActorProvider.js';
15
- import { EditorNavigationPanel } from './EditorNavigationPanel.js';
16
- import { useAdhocView } from './hooks.js';
17
- import { SelectElementOverlay } from './SelectElementOverlay.js';
16
+ import { EditorPanel } from './EditorPanel.js';
17
+ import { useAdhocView, useAdhocEditorActor } from './hooks.js';
18
+ import { AdhocEditorActorProvider } from './state/ActorProvider.js';
19
+ import { useDiagram } from '../hooks/safeContext.js';
18
20
 
21
+ const noop = () => {
22
+ };
23
+ const defaultFeatures = {
24
+ ...mapValues(DefaultFeatures, () => false),
25
+ enableFitView: true,
26
+ enableReadOnly: true
27
+ };
19
28
  function LikeC4AdHocViewEditor({ service }) {
20
29
  const id = useId();
21
- return /* @__PURE__ */ jsx(Profiler, { id: "LikeC4AdHocViewEditor", onRender: () => {
22
- }, children: /* @__PURE__ */ jsx(EnsureMantine, { children: /* @__PURE__ */ jsx(FramerMotionConfig, { children: /* @__PURE__ */ jsxs(
23
- DiagramFeatures,
24
- {
25
- features: {
26
- enableFitView: true,
27
- enableEditor: false,
28
- enableReadOnly: true,
29
- enableFocusMode: false,
30
- enableNavigateTo: false,
31
- enableElementDetails: false,
32
- enableRelationshipDetails: false,
33
- enableRelationshipBrowser: false,
34
- enableSearch: false,
35
- enableNavigationButtons: false,
36
- enableDynamicViewWalkthrough: false,
37
- enableNotations: false,
38
- enableVscode: false,
39
- enableControls: false,
40
- enableElementTags: false,
41
- enableCompareWithLatest: false
42
- },
43
- children: [
44
- /* @__PURE__ */ jsx(LikeC4Styles, { id }),
45
- /* @__PURE__ */ jsx(TagStylesProvider, { rootSelector: `#${id}`, children: /* @__PURE__ */ jsx(RootContainer, { id, children: /* @__PURE__ */ jsxs(AdhocEditorActorProvider, { service, children: [
46
- /* @__PURE__ */ jsx(LikeC4AdHocView, { id }),
47
- /* @__PURE__ */ jsx(EditorNavigationPanel, {}),
48
- /* @__PURE__ */ jsx(SelectElementOverlay, {})
49
- ] }) }) })
50
- ]
51
- }
52
- ) }) }) });
30
+ const initialRef = useRef({
31
+ fitView: true,
32
+ defaultNodes: [],
33
+ defaultEdges: []
34
+ });
35
+ return /* @__PURE__ */ jsx(EnsureMantine, { children: /* @__PURE__ */ jsx(FramerMotionConfig, { children: /* @__PURE__ */ jsx(Profiler, { id: "LikeC4AdHocViewEditor", onRender: noop, children: /* @__PURE__ */ jsx(IconRendererProvider, { value: null, children: /* @__PURE__ */ jsx(AdhocEditorActorProvider, { service, children: /* @__PURE__ */ jsxs(DiagramFeatures, { features: defaultFeatures, children: [
36
+ /* @__PURE__ */ jsx(LikeC4Styles, { id }),
37
+ /* @__PURE__ */ jsx(TagStylesProvider, { rootSelector: `#${id}`, children: /* @__PURE__ */ jsx(RootContainer, { id, children: /* @__PURE__ */ jsxs(ReactFlowProvider, { ...initialRef.current, children: [
38
+ /* @__PURE__ */ jsx(LikeC4AdHocView, { id }),
39
+ /* @__PURE__ */ jsx(EditorPanel, {})
40
+ ] }) }) })
41
+ ] }) }) }) }) }) });
53
42
  }
54
- function LikeC4AdHocView({ id }) {
43
+ const LikeC4AdHocView = memo(({ id }) => {
55
44
  const view = useAdhocView();
56
- return /* @__PURE__ */ jsx(ReactFlowProvider, { fitView: true, initialNodes: [], initialEdges: [], children: /* @__PURE__ */ jsx(
45
+ return /* @__PURE__ */ jsxs(
57
46
  DiagramActorProvider,
58
47
  {
59
48
  id,
@@ -63,9 +52,23 @@ function LikeC4AdHocView({ id }) {
63
52
  fitViewPadding: FitViewPaddings.withControls,
64
53
  nodesDraggable: false,
65
54
  nodesSelectable: true,
66
- children: /* @__PURE__ */ jsx(LikeC4DiagramXYFlow, {})
55
+ children: [
56
+ /* @__PURE__ */ jsx(LikeC4DiagramXYFlow, {}),
57
+ /* @__PURE__ */ jsx(LikeC4AdHocEditorEvents, {})
58
+ ]
67
59
  }
68
- ) });
69
- }
60
+ );
61
+ });
62
+ const LikeC4AdHocEditorEvents = memo(() => {
63
+ const actorRef = useAdhocEditorActor();
64
+ const diagram = useDiagram();
65
+ useEffect(() => {
66
+ const subscription = actorRef.on("click.element", ({ id }) => {
67
+ diagram.focusOnElement(id);
68
+ });
69
+ return () => subscription.unsubscribe();
70
+ }, [actorRef, diagram]);
71
+ return null;
72
+ });
70
73
 
71
74
  export { LikeC4AdHocViewEditor };
@@ -0,0 +1,48 @@
1
+ import { RecipeVariantProps } from '@likec4/styles/css';
2
+ import { MouseEventHandler, PropsWithChildren, ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ import { IconOrShapeRenderer } from '../../context/IconRenderer';
4
+ import { TreeNodeData } from '../useElementsTree';
5
+ import { RecipeRuntimeFn, SlotRecipeRuntimeFn } from '@likec4/styles';
6
+ import { StyleContextRootProvider, StyleContextConsumer } from '@likec4/styles/jsx';
7
+ import { IconProps } from '../../../@tabler/icons-react/dist/esm/icons/index.mjs';
8
+ declare const statebtn: RecipeRuntimeFn<{
9
+ state: {
10
+ "include-explicit": {
11
+ backgroundColor: "grass.6";
12
+ color: "text";
13
+ };
14
+ "include-implicit": {
15
+ backgroundColor: "grass.6";
16
+ color: "text";
17
+ };
18
+ exclude: {
19
+ backgroundColor: "red.6";
20
+ color: "text";
21
+ };
22
+ disabled: {
23
+ color: "text.dimmed";
24
+ };
25
+ 'not-present': {
26
+ color: "text.dimmed";
27
+ backgroundColor: "default.hover/50";
28
+ };
29
+ };
30
+ }>;
31
+ declare const tree: SlotRecipeRuntimeFn<"icon" | "label" | "content" | "item" | "indicator" | "branch" | "control" | "state", {}>;
32
+ export type TreeVariants = RecipeVariantProps<typeof tree>;
33
+ export declare const Tree: {
34
+ Root: StyleContextRootProvider<"div", SlotRecipeRuntimeFn<"icon" | "label" | "content" | "item" | "indicator" | "branch" | "control" | "state", {}>>;
35
+ Branch: StyleContextConsumer<"div">;
36
+ Item: StyleContextConsumer<"div">;
37
+ Control: StyleContextConsumer<"div">;
38
+ State: ({ node, state, onClick, className, ...props }: PropsWithChildren<RecipeVariantProps<typeof statebtn> & {
39
+ node: TreeNodeData;
40
+ className?: string;
41
+ onClick?: MouseEventHandler<HTMLElement>;
42
+ }>) => import("react/jsx-runtime").JSX.Element;
43
+ Icon: typeof IconOrShapeRenderer;
44
+ Label: StyleContextConsumer<"div">;
45
+ Content: StyleContextConsumer<"div">;
46
+ Indicator: StyleContextConsumer<ForwardRefExoticComponent< IconProps & RefAttributes<SVGSVGElement>>>;
47
+ };
48
+ export {};