@likec4/diagram 1.43.0 → 1.45.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.
- package/bundle/index.js +14727 -13166
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +14 -9
- package/dist/LikeC4Diagram.props.d.ts +25 -15
- package/dist/LikeC4ProjectsProvider.js +1 -1
- package/dist/LikeC4Styles.js +0 -3
- package/dist/LikeC4View.d.ts +8 -3
- package/dist/LikeC4View.js +29 -14
- package/dist/ReactLikeC4.d.ts +2 -2
- package/dist/ReactLikeC4.js +2 -2
- package/dist/StaticLikeC4Diagram.js +1 -1
- package/dist/_virtual/_commonjsHelpers.js +3 -0
- package/dist/_virtual/assign-dea9f7c8.cjs.js +3 -0
- package/dist/_virtual/log-ec8d4df4.cjs.js +3 -0
- package/dist/_virtual/raise-da5b247f.cjs.js +3 -0
- package/dist/_virtual/xstate-actions.cjs.js +5 -0
- package/dist/_virtual/xstate-actions.cjs2.js +3 -0
- package/dist/_virtual/xstate-dev.cjs.js +3 -0
- package/dist/_virtual/xstate-guards.cjs.js +5 -0
- package/dist/_virtual/xstate-guards.cjs2.js +3 -0
- package/dist/base/Background.d.ts +2 -1
- package/dist/base/Background.js +11 -2
- package/dist/base/Base.d.ts +28 -0
- package/dist/base/BaseXYFlow.d.ts +5 -5
- package/dist/base/BaseXYFlow.js +38 -44
- package/dist/base/index.d.ts +6 -2
- package/dist/base/types.d.ts +1 -28
- package/dist/base/updateEdges.js +25 -14
- package/dist/base/updateNodes.d.ts +14 -0
- package/dist/base/updateNodes.js +51 -17
- package/dist/base-primitives/Markdown.d.ts +30 -4
- package/dist/base-primitives/Markdown.js +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +3 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +8 -1
- package/dist/base-primitives/edge/EdgeLabel.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeLabel.js +2 -0
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +4 -0
- package/dist/base-primitives/edge/EdgePath.d.ts +4 -0
- package/dist/base-primitives/edge/EdgePath.js +29 -5
- package/dist/base-primitives/element/ElementActionButtons.d.ts +6 -4
- package/dist/base-primitives/element/ElementActionButtons.js +3 -3
- package/dist/base-primitives/element/ElementData.d.ts +3 -3
- package/dist/base-primitives/element/ElementData.js +13 -7
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +3 -2
- package/dist/base-primitives/element/ElementDetailsButton.js +5 -5
- package/dist/base-primitives/element/ElementNodeContainer.css.js +15 -27
- package/dist/base-primitives/element/ElementShape.js +5 -5
- package/dist/base-primitives/element/ElementTags.d.ts +6 -4
- package/dist/base-primitives/element/ElementTags.js +2 -1
- package/dist/base-primitives/memoEdge.js +4 -2
- package/dist/base-primitives/memoNode.d.ts +1 -1
- package/dist/base-primitives/memoNode.js +3 -3
- package/dist/components/ErrorFallback.js +52 -35
- package/dist/components/Link.js +2 -2
- package/dist/context/DiagramEventHandlers.js +2 -1
- package/dist/context/DiagramFeatures.d.ts +25 -6
- package/dist/context/DiagramFeatures.js +28 -56
- package/dist/context/IconRenderer.js +6 -6
- package/dist/context/LikeC4ModelContext.js +3 -10
- package/dist/context/TagStylesContext.js +3 -19
- package/dist/context/index.d.ts +1 -1
- package/dist/custom/customNodes.js +3 -2
- package/dist/custom/hooks.d.ts +3 -3
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +5 -5
- package/dist/editor/LikeC4EditorContext.d.ts +21 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +4 -2
- package/dist/hooks/safeContext.d.ts +6 -3
- package/dist/hooks/safeContext.js +10 -3
- package/dist/hooks/useCallbackRef.d.ts +1 -0
- package/dist/hooks/useCallbackRef.js +13 -0
- package/dist/hooks/useCurrentView.d.ts +11 -0
- package/dist/hooks/{useCurrentViewId.js → useCurrentView.js} +7 -3
- package/dist/hooks/useCurrentViewModel.js +4 -1
- package/dist/hooks/useDiagram.d.ts +7 -113
- package/dist/hooks/useDiagram.js +7 -127
- package/dist/hooks/useDiagramCompareLayout.d.ts +35 -0
- package/dist/hooks/useDiagramCompareLayout.js +65 -0
- package/dist/hooks/useLikeC4Project.d.ts +6 -1
- package/dist/hooks/useLikeC4Project.js +14 -2
- package/dist/hooks/useMediaPrint.d.ts +6 -0
- package/dist/hooks/useUpdateEffect.js +2 -4
- package/dist/hooks/useXYFlow.d.ts +1 -0
- package/dist/hooks/useXYFlow.js +4 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/dist/likec4diagram/DiagramUI.js +14 -7
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -2
- package/dist/likec4diagram/DiagramXYFlow.js +60 -52
- package/dist/likec4diagram/convert-to-xyflow.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +38 -0
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +256 -217
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +9 -2
- package/dist/likec4diagram/custom/edges/edges.css.js +3 -4
- package/dist/likec4diagram/custom/edges/useControlPoints.d.ts +8 -0
- package/dist/likec4diagram/custom/edges/useControlPoints.js +58 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +7 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +60 -0
- package/dist/likec4diagram/custom/edges/utils.d.ts +0 -12
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +4 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.js +15 -10
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +50 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +7 -2
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +9 -1
- package/dist/likec4diagram/custom/nodes/nodes.js +74 -29
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +4 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +1 -11
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +7 -51
- package/dist/likec4diagram/custom/nodes/toolbar/types.d.ts +5 -0
- package/dist/likec4diagram/custom/nodes/toolbar/types.js +7 -0
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.d.ts +8 -0
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.js +44 -0
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +8 -10
- package/dist/likec4diagram/relationship-popover/actor.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
- package/dist/likec4diagram/state/DiagramActorProvider.js +95 -70
- package/dist/likec4diagram/state/assign.d.ts +13 -7
- package/dist/likec4diagram/state/assign.js +43 -282
- package/dist/likec4diagram/state/createViewChange.d.ts +3 -0
- package/dist/likec4diagram/state/createViewChange.js +79 -0
- package/dist/likec4diagram/state/diagram-api.d.ts +109 -0
- package/dist/likec4diagram/state/diagram-api.js +126 -0
- package/dist/likec4diagram/state/machine.actions.d.ts +1783 -0
- package/dist/likec4diagram/state/machine.actions.js +644 -0
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +579 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +129 -0
- package/dist/likec4diagram/state/machine.d.ts +22 -0
- package/dist/likec4diagram/state/machine.js +127 -0
- package/dist/likec4diagram/state/machine.setup.d.ts +327 -0
- package/dist/likec4diagram/state/machine.setup.js +93 -0
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +208 -0
- package/dist/likec4diagram/state/machine.state.initializing.js +55 -0
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +14 -0
- package/dist/likec4diagram/state/machine.state.navigating.js +178 -0
- package/dist/likec4diagram/state/machine.state.ready.d.ts +3131 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +386 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.js +85 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +474 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.js +96 -0
- package/dist/likec4diagram/state/machine.state.ready.js +262 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +128 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +40 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +511 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +177 -0
- package/dist/likec4diagram/state/mediaPrintActor.d.ts +12 -0
- package/dist/likec4diagram/state/mediaPrintActor.js +18 -0
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +31 -108
- package/dist/likec4diagram/state/syncManualLayoutActor.js +278 -142
- package/dist/likec4diagram/state/types.d.ts +7 -12
- package/dist/likec4diagram/state/utils.d.ts +19 -4
- package/dist/likec4diagram/state/utils.js +47 -4
- package/dist/likec4diagram/types.d.ts +8 -8
- package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +2 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +66 -0
- package/dist/likec4diagram/ui/index.d.ts +1 -0
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.js +5 -4
- package/dist/likec4diagram/useLayoutConstraints.d.ts +10 -5
- package/dist/likec4diagram/useLayoutConstraints.js +237 -61
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +0 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +14 -17
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +11 -8
- package/dist/navigationpanel/NavigationPanel.js +16 -8
- package/dist/navigationpanel/NavigationPanelControls.d.ts +2 -1
- package/dist/navigationpanel/NavigationPanelControls.js +23 -17
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +2 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +62 -42
- package/dist/navigationpanel/_common.d.ts +1 -1
- package/dist/navigationpanel/_common.js +4 -2
- package/dist/navigationpanel/actor.d.ts +9 -205
- package/dist/navigationpanel/actor.js +6 -5
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -0
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +59 -0
- package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +2 -0
- package/dist/navigationpanel/comparepanel/ComparePanel.js +42 -0
- package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -0
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +60 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +5 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +38 -0
- package/dist/navigationpanel/comparepanel/index.d.ts +1 -0
- package/dist/navigationpanel/controls/{ViewDetailsCard.d.ts → DetailsControls.d.ts} +1 -1
- package/dist/navigationpanel/controls/{ViewDetailsCard.js → DetailsControls.js} +18 -14
- package/dist/navigationpanel/controls/LayoutWarning.d.ts +2 -0
- package/dist/navigationpanel/controls/LayoutWarning.js +102 -0
- package/dist/navigationpanel/controls/NavigationButtons.js +4 -3
- package/dist/navigationpanel/controls/OpenSource.js +2 -2
- package/dist/navigationpanel/controls/SearchControl.d.ts +2 -1
- package/dist/navigationpanel/controls/SearchControl.js +15 -17
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +26 -18
- package/dist/navigationpanel/controls/index.d.ts +2 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -2
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +5 -5
- package/dist/navigationpanel/editorpanel/CenterCamera.js +5 -2
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +21 -20
- package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -2
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +16 -13
- package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -0
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +15 -0
- package/dist/navigationpanel/styles.css.d.ts +2 -2
- package/dist/navigationpanel/styles.css.js +4 -4
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +14 -8
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +66 -66
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +31 -14
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +2 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +68 -50
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/actions/dist/xstate-actions.cjs.js +37 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dev/dist/xstate-dev.cjs.js +59 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/assign-dea9f7c8.cjs.js +140 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/log-ec8d4df4.cjs.js +401 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/raise-da5b247f.cjs.js +2716 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/guards/dist/xstate-guards.cjs.js +26 -0
- package/dist/overlays/element-details/ElementDetails.js +7 -7
- package/dist/overlays/element-details/ElementDetailsCard.css.js +3 -3
- package/dist/overlays/element-details/ElementDetailsCard.js +7 -5
- package/dist/overlays/element-details/MetadataValue.d.ts +2 -1
- package/dist/overlays/element-details/MetadataValue.js +2 -2
- package/dist/overlays/element-details/TabPanelDeployments.js +6 -4
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +8 -82
- package/dist/overlays/element-details/actor.js +0 -8
- package/dist/overlays/overlay/Overlay.js +10 -10
- package/dist/overlays/overlaysActor.d.ts +7 -150
- package/dist/overlays/overlaysActor.js +183 -161
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/_types.d.ts +3 -4
- package/dist/overlays/relationship-details/actor.d.ts +6 -550
- package/dist/overlays/relationship-details/actor.js +18 -3
- package/dist/overlays/relationship-details/custom/ElementActions.js +8 -5
- package/dist/overlays/relationship-details/custom/edgeTypes.js +4 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.js +4 -1
- package/dist/overlays/relationship-details/hooks.js +1 -1
- package/dist/overlays/relationship-details/layout-to-xyflow.js +3 -5
- package/dist/overlays/relationship-details/layout.d.ts +3 -3
- package/dist/overlays/relationship-details/layout.js +4 -4
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -4
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/_types.d.ts +2 -3
- package/dist/overlays/relationships-browser/actor.d.ts +7 -673
- package/dist/overlays/relationships-browser/actor.js +132 -110
- package/dist/overlays/relationships-browser/custom/ElementActions.js +44 -37
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +4 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +4 -1
- package/dist/overlays/relationships-browser/hooks.js +7 -6
- package/dist/overlays/relationships-browser/layout.d.ts +2 -2
- package/dist/overlays/relationships-browser/layout.js +3 -3
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -3
- package/dist/overlays/types.d.ts +12 -13
- package/dist/search/Search.js +2 -1
- package/dist/search/components/ElementsColumn.js +5 -3
- package/dist/search/components/PickView.js +1 -1
- package/dist/search/components/SearchByTags.js +21 -44
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +6 -4
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/searchActor.d.ts +3 -66
- package/dist/shadowroot/ShadowRoot.d.ts +5 -7
- package/dist/shadowroot/ShadowRoot.js +8 -6
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +4 -4
- package/dist/utils/vector.d.ts +83 -21
- package/dist/utils/vector.js +98 -24
- package/dist/utils/view-bounds.d.ts +8 -0
- package/dist/utils/view-bounds.js +58 -0
- package/dist/utils/xyflow.d.ts +52 -8
- package/dist/utils/xyflow.js +31 -11
- package/package.json +26 -24
- package/panda.buildinfo.json +124 -71
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/hooks/useCurrentViewId.d.ts +0 -6
- package/dist/likec4diagram/custom/edges/utils.js +0 -23
- package/dist/likec4diagram/state/diagram-machine.d.ts +0 -2590
- package/dist/likec4diagram/state/diagram-machine.js +0 -1180
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.d.ts +0 -1
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.js +0 -56
- package/dist/utils/get-view-bounds.d.ts +0 -3
- package/dist/utils/get-view-bounds.js +0 -14
- /package/dist/base/{types.js → Base.js} +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { deepEqual } from 'fast-equals';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useCallbackRef } from '../../../hooks/useCallbackRef.js';
|
|
4
|
+
import { useUpdateEffect } from '../../../hooks/useUpdateEffect.js';
|
|
5
|
+
import { vector } from '../../../utils/vector.js';
|
|
6
|
+
import { bezierControlPoints } from '../../../utils/xyflow.js';
|
|
7
|
+
|
|
8
|
+
function useControlPoints({
|
|
9
|
+
sourceX,
|
|
10
|
+
sourceY,
|
|
11
|
+
targetX,
|
|
12
|
+
targetY,
|
|
13
|
+
data
|
|
14
|
+
}) {
|
|
15
|
+
const [controlPoints, setControlPoints] = useState(
|
|
16
|
+
() => data.controlPoints ?? bezierControlPoints(data.points)
|
|
17
|
+
);
|
|
18
|
+
useUpdateEffect(() => {
|
|
19
|
+
const next = data.controlPoints ?? bezierControlPoints(data.points);
|
|
20
|
+
setControlPoints((prev) => deepEqual(prev, next) ? prev : next);
|
|
21
|
+
}, [
|
|
22
|
+
data.controlPoints?.map((p) => `${Math.round(p.x)},${Math.round(p.y)}`).join("|") ?? "",
|
|
23
|
+
data.points.map((p) => `${Math.round(p[0])},${Math.round(p[1])}`).join("|")
|
|
24
|
+
]);
|
|
25
|
+
const insertControlPoint = useCallbackRef(({ x, y }) => {
|
|
26
|
+
const sourceV = vector(sourceX, sourceY);
|
|
27
|
+
const targetV = vector(targetX, targetY);
|
|
28
|
+
const points = [
|
|
29
|
+
data.dir === "back" ? targetV : sourceV,
|
|
30
|
+
...controlPoints.map(vector) || [],
|
|
31
|
+
data.dir === "back" ? sourceV : targetV
|
|
32
|
+
];
|
|
33
|
+
const newPointV = vector(x, y).round();
|
|
34
|
+
let insertionIndex = 0;
|
|
35
|
+
let minDistance = Infinity;
|
|
36
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
37
|
+
const a = points[i], b = points[i + 1], fromCurrentToNext = b.subtract(a), fromCurrentToNew = newPointV.subtract(a), fromNextToNew = newPointV.subtract(b);
|
|
38
|
+
if (fromCurrentToNext.dot(fromCurrentToNew) * fromCurrentToNext.dot(fromNextToNew) < 0) {
|
|
39
|
+
const distanceToEdge = Math.abs(fromCurrentToNext.cross(fromCurrentToNew).length() / fromCurrentToNext.length());
|
|
40
|
+
if (distanceToEdge < minDistance) {
|
|
41
|
+
minDistance = distanceToEdge;
|
|
42
|
+
insertionIndex = i;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const newControlPoints = controlPoints.slice();
|
|
47
|
+
newControlPoints.splice(insertionIndex, 0, { x: newPointV.x, y: newPointV.y });
|
|
48
|
+
setControlPoints(newControlPoints);
|
|
49
|
+
return newControlPoints;
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
controlPoints,
|
|
53
|
+
setControlPoints,
|
|
54
|
+
insertControlPoint
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { useControlPoints };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { XYPosition } from '@xyflow/react';
|
|
2
|
+
import { Types } from '../../types';
|
|
3
|
+
export declare function useRelationshipEdgePath({ props: { sourceX, sourceY, source, target, targetX, targetY, data, }, controlPoints, isControlPointDragging, }: {
|
|
4
|
+
props: Types.EdgeProps<'relationship'>;
|
|
5
|
+
controlPoints: XYPosition[];
|
|
6
|
+
isControlPointDragging: boolean;
|
|
7
|
+
}): string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { nonNullable } from '@likec4/core';
|
|
2
|
+
import { line, curveCatmullRomOpen } from 'd3-shape';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { isTruthy, first, last } from 'remeda';
|
|
5
|
+
import { useXYStore } from '../../../hooks/useXYFlow.js';
|
|
6
|
+
import { nodeToRect, getNodeIntersectionFromCenterToPoint, bezierPath, isEqualRects } from '../../../utils/xyflow.js';
|
|
7
|
+
|
|
8
|
+
const curve = line().curve(curveCatmullRomOpen.alpha(0.7)).x((d) => Math.round(d.x)).y((d) => Math.round(d.y));
|
|
9
|
+
const isSameRects = (a, b) => isEqualRects(a.sourceNode, b.sourceNode) && isEqualRects(a.targetNode, b.targetNode);
|
|
10
|
+
function useRelationshipEdgePath({
|
|
11
|
+
props: {
|
|
12
|
+
sourceX,
|
|
13
|
+
sourceY,
|
|
14
|
+
source,
|
|
15
|
+
target,
|
|
16
|
+
targetX,
|
|
17
|
+
targetY,
|
|
18
|
+
data
|
|
19
|
+
},
|
|
20
|
+
controlPoints,
|
|
21
|
+
isControlPointDragging
|
|
22
|
+
}) {
|
|
23
|
+
const {
|
|
24
|
+
sourceNode,
|
|
25
|
+
targetNode
|
|
26
|
+
} = useXYStore(
|
|
27
|
+
useCallback(({ nodeLookup }) => {
|
|
28
|
+
const sourceNode2 = nonNullable(nodeLookup.get(source), `source node ${source} not found`);
|
|
29
|
+
const targetNode2 = nonNullable(nodeLookup.get(target), `target node ${target} not found`);
|
|
30
|
+
return {
|
|
31
|
+
sourceNode: nodeToRect(sourceNode2),
|
|
32
|
+
targetNode: nodeToRect(targetNode2)
|
|
33
|
+
};
|
|
34
|
+
}, [source, target]),
|
|
35
|
+
isSameRects
|
|
36
|
+
);
|
|
37
|
+
const isModified = isTruthy(data.controlPoints) || isControlPointDragging;
|
|
38
|
+
if (isModified) {
|
|
39
|
+
const sourceCenterPos = { x: sourceX, y: sourceY };
|
|
40
|
+
const targetCenterPos = { x: targetX, y: targetY };
|
|
41
|
+
const nodeMargin = 6;
|
|
42
|
+
const points = data.dir === "back" ? [
|
|
43
|
+
targetCenterPos,
|
|
44
|
+
getNodeIntersectionFromCenterToPoint(targetNode, first(controlPoints) ?? sourceCenterPos, nodeMargin),
|
|
45
|
+
...controlPoints,
|
|
46
|
+
getNodeIntersectionFromCenterToPoint(sourceNode, last(controlPoints) ?? targetCenterPos, nodeMargin),
|
|
47
|
+
sourceCenterPos
|
|
48
|
+
] : [
|
|
49
|
+
sourceCenterPos,
|
|
50
|
+
getNodeIntersectionFromCenterToPoint(sourceNode, first(controlPoints) ?? targetCenterPos, nodeMargin),
|
|
51
|
+
...controlPoints,
|
|
52
|
+
getNodeIntersectionFromCenterToPoint(targetNode, last(controlPoints) ?? sourceCenterPos, nodeMargin),
|
|
53
|
+
targetCenterPos
|
|
54
|
+
];
|
|
55
|
+
return nonNullable(curve(points));
|
|
56
|
+
}
|
|
57
|
+
return bezierPath(data.points);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { useRelationshipEdgePath };
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
import { InternalNode, XYPosition, Position } from '@xyflow/react';
|
|
2
|
-
import { VectorImpl } from '../../../utils';
|
|
3
|
-
export declare function getNodeCenter(node: InternalNode): XYPosition;
|
|
4
|
-
/**
|
|
5
|
-
* Helper function returns the intersection point
|
|
6
|
-
* of the line between the center of the intersectionNode and the target
|
|
7
|
-
*
|
|
8
|
-
* @param intersectionNode the node that is the center of the line
|
|
9
|
-
* @param target position of the target
|
|
10
|
-
* @param nodeMargin the margin of the intersectionNode. The point will be placed at nodeMargin distance from the border of the node
|
|
11
|
-
* @returns coordinates of the intersection point
|
|
12
|
-
*/
|
|
13
|
-
export declare function getNodeIntersectionFromCenterToPoint(intersectionNode: InternalNode, target: XYPosition, nodeMargin?: number): VectorImpl;
|
|
14
2
|
export declare function getPointPosition(node: InternalNode, intersectionPoint: XYPosition): readonly [number, number, Position];
|
|
15
3
|
export declare function getEdgeParams(source: InternalNode, target: InternalNode): {
|
|
16
4
|
sx: number;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
3
|
-
import
|
|
3
|
+
import '@xstate/react';
|
|
4
|
+
import 'fast-equals';
|
|
5
|
+
import 'react';
|
|
6
|
+
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
4
7
|
import { CompoundActionButton } from '../../../base-primitives/compound/CompoundActionButton.js';
|
|
5
8
|
|
|
6
9
|
const CompoundActions = (props) => {
|
|
@@ -2,6 +2,7 @@ import { SimplifyDeep } from 'type-fest';
|
|
|
2
2
|
import { ElementActionButtons } from '../../../base-primitives';
|
|
3
3
|
import { BaseNodeData } from '../../../base/types';
|
|
4
4
|
import { Types } from '../../types';
|
|
5
|
+
import { NamedExoticComponent } from 'react';
|
|
5
6
|
type WithExtraButtons = {
|
|
6
7
|
/**
|
|
7
8
|
* Add extra action buttons
|
|
@@ -53,7 +54,7 @@ export type ElementActionsProps = SimplifyDeep<{
|
|
|
53
54
|
* />
|
|
54
55
|
* ```
|
|
55
56
|
*/
|
|
56
|
-
export declare const ElementActions:
|
|
57
|
+
export declare const ElementActions: NamedExoticComponent<ElementActionsProps>;
|
|
57
58
|
export type DeploymentElementActionsProps = SimplifyDeep<{
|
|
58
59
|
selected?: boolean;
|
|
59
60
|
data: Pick<Types.DeploymentElementNodeData, 'id' | 'modelFqn' | 'navigateTo'> & BaseNodeData;
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { deepEqual, shallowEqual } from 'fast-equals';
|
|
3
|
+
import { memo, useMemo } from 'react';
|
|
3
4
|
import { hasAtLeast } from 'remeda';
|
|
4
5
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import '@xstate/react';
|
|
7
|
+
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
8
|
+
import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
9
|
+
import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
|
|
8
10
|
import { ElementActionButtons } from '../../../base-primitives/element/ElementActionButtons.js';
|
|
9
11
|
|
|
10
|
-
const
|
|
12
|
+
const compareElementActionsProps = (a, b) => {
|
|
13
|
+
return deepEqual(a.data.id, b.data.id) && deepEqual(a.selected ?? false, b.selected ?? false) && deepEqual(a.data.modelFqn ?? null, b.data.modelFqn ?? null) && deepEqual(a.data.navigateTo ?? null, b.data.navigateTo ?? null) && deepEqual(a.data.hovered ?? false, b.data.hovered ?? false) && (!a.extraButtons && !b.extraButtons || shallowEqual(a.extraButtons, b.extraButtons));
|
|
14
|
+
};
|
|
15
|
+
const ElementActions = memo(({
|
|
11
16
|
extraButtons,
|
|
12
17
|
...props
|
|
13
18
|
}) => {
|
|
14
19
|
const { enableNavigateTo, enableRelationshipBrowser } = useEnabledFeatures();
|
|
15
20
|
const diagram = useDiagram();
|
|
16
|
-
const { navigateTo, modelFqn } = props.data;
|
|
21
|
+
const { id, navigateTo, modelFqn } = props.data;
|
|
17
22
|
let buttons = useMemo(() => {
|
|
18
23
|
const buttons2 = [];
|
|
19
24
|
if (navigateTo && enableNavigateTo) {
|
|
@@ -22,7 +27,7 @@ const ElementActions = ({
|
|
|
22
27
|
icon: /* @__PURE__ */ jsx(IconZoomScan, {}),
|
|
23
28
|
onClick: (e) => {
|
|
24
29
|
e.stopPropagation();
|
|
25
|
-
diagram.navigateTo(navigateTo,
|
|
30
|
+
diagram.navigateTo(navigateTo, id);
|
|
26
31
|
}
|
|
27
32
|
});
|
|
28
33
|
}
|
|
@@ -37,12 +42,12 @@ const ElementActions = ({
|
|
|
37
42
|
});
|
|
38
43
|
}
|
|
39
44
|
return buttons2;
|
|
40
|
-
}, [enableNavigateTo, enableRelationshipBrowser,
|
|
45
|
+
}, [enableNavigateTo, enableRelationshipBrowser, modelFqn, navigateTo, id, diagram]);
|
|
41
46
|
if (extraButtons && hasAtLeast(extraButtons, 1)) {
|
|
42
47
|
buttons = [...buttons, ...extraButtons];
|
|
43
48
|
}
|
|
44
49
|
return /* @__PURE__ */ jsx(ElementActionButtons, { ...props, buttons });
|
|
45
|
-
};
|
|
50
|
+
}, compareElementActionsProps);
|
|
46
51
|
const DeploymentElementActions = ({
|
|
47
52
|
extraButtons,
|
|
48
53
|
...props
|
|
@@ -73,7 +78,7 @@ const DeploymentElementActions = ({
|
|
|
73
78
|
});
|
|
74
79
|
}
|
|
75
80
|
return buttons2;
|
|
76
|
-
}, [enableNavigateTo, enableRelationshipBrowser,
|
|
81
|
+
}, [enableNavigateTo, enableRelationshipBrowser, modelFqn, navigateTo, id]);
|
|
77
82
|
if (extraButtons && hasAtLeast(extraButtons, 1)) {
|
|
78
83
|
buttons = [...buttons, ...extraButtons];
|
|
79
84
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Types } from '../../types';
|
|
2
|
+
export type NodeDriftsProps = {
|
|
3
|
+
nodeProps: Types.NodeProps;
|
|
4
|
+
position?: 'top' | 'bottom';
|
|
5
|
+
};
|
|
6
|
+
export declare function NodeDrifts({ nodeProps: { data }, position, }: NodeDriftsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Box } from '@likec4/styles/jsx';
|
|
3
|
+
import { Notification, Text } from '@mantine/core';
|
|
4
|
+
import { Position, NodeToolbar } from '@xyflow/react';
|
|
5
|
+
|
|
6
|
+
function NodeDrifts({
|
|
7
|
+
nodeProps: { data },
|
|
8
|
+
position = "bottom"
|
|
9
|
+
}) {
|
|
10
|
+
const drifts = data.drifts;
|
|
11
|
+
if (!drifts || drifts.length === 0) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const toolbarPosition = position === "top" ? Position.Top : Position.Bottom;
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
Box,
|
|
17
|
+
{
|
|
18
|
+
className: "likec4-node-drifts",
|
|
19
|
+
css: {
|
|
20
|
+
position: "absolute",
|
|
21
|
+
inset: "0",
|
|
22
|
+
pointerEvents: "none",
|
|
23
|
+
"& + .likec4-element-shape": {
|
|
24
|
+
outlineColor: "likec4.compare.manual.outline",
|
|
25
|
+
outlineWidth: {
|
|
26
|
+
base: "2px",
|
|
27
|
+
_light: "4px"
|
|
28
|
+
},
|
|
29
|
+
outlineStyle: "solid",
|
|
30
|
+
outlineOffset: "1"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
children: /* @__PURE__ */ jsx(NodeToolbar, { isVisible: data.hovered === true, align: "start", position: toolbarPosition, children: /* @__PURE__ */ jsx(
|
|
34
|
+
Notification,
|
|
35
|
+
{
|
|
36
|
+
color: "orange",
|
|
37
|
+
withBorder: false,
|
|
38
|
+
withCloseButton: false,
|
|
39
|
+
title: "Changes:",
|
|
40
|
+
children: drifts.map((drift) => /* @__PURE__ */ jsxs(Text, { mt: 2, size: "sm", lh: "xs", children: [
|
|
41
|
+
"- ",
|
|
42
|
+
drift
|
|
43
|
+
] }, drift))
|
|
44
|
+
}
|
|
45
|
+
) })
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { NodeDrifts };
|
|
@@ -3,7 +3,9 @@ import { css } from '@likec4/styles/css';
|
|
|
3
3
|
import { Box } from '@likec4/styles/jsx';
|
|
4
4
|
import { Handle, Position } from '@xyflow/react';
|
|
5
5
|
import { isTruthy } from 'remeda';
|
|
6
|
+
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
6
7
|
import { ElementActions } from './ElementActions.js';
|
|
8
|
+
import { NodeDrifts } from './NodeDrifts.js';
|
|
7
9
|
import { ElementDetailsButtonWithHandler } from './nodes.js';
|
|
8
10
|
import { ElementNodeContainer } from '../../../base-primitives/element/ElementNodeContainer.js';
|
|
9
11
|
import { ElementShape } from '../../../base-primitives/element/ElementShape.js';
|
|
@@ -67,8 +69,10 @@ const ActorStepPort = ({
|
|
|
67
69
|
};
|
|
68
70
|
const hasModelFqn = (data) => isTruthy(data.modelFqn);
|
|
69
71
|
function SequenceActorNode(props) {
|
|
72
|
+
const { enableElementDetails, enableCompareWithLatest } = useEnabledFeatures();
|
|
70
73
|
const data = props.data;
|
|
71
74
|
const {
|
|
75
|
+
id,
|
|
72
76
|
positionAbsoluteY,
|
|
73
77
|
data: {
|
|
74
78
|
viewHeight,
|
|
@@ -102,11 +106,12 @@ function SequenceActorNode(props) {
|
|
|
102
106
|
}
|
|
103
107
|
),
|
|
104
108
|
/* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
|
|
109
|
+
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
105
110
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
106
111
|
/* @__PURE__ */ jsx(ElementData, { ...props }),
|
|
107
112
|
hasModelFqn(data) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
108
113
|
/* @__PURE__ */ jsx(ElementActions, { ...props, data }),
|
|
109
|
-
/* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, {
|
|
114
|
+
enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { id, data })
|
|
110
115
|
] })
|
|
111
116
|
] }),
|
|
112
117
|
ports.map((p) => /* @__PURE__ */ jsx(ActorStepPort, { port: p, data: props.data }, p.id))
|
|
@@ -125,7 +130,7 @@ function SequenceParallelArea(props) {
|
|
|
125
130
|
borderWidth: 1,
|
|
126
131
|
"--_color": {
|
|
127
132
|
base: "var(--likec4-palette-stroke)",
|
|
128
|
-
_dark: "[color-mix(in
|
|
133
|
+
_dark: "[color-mix(in oklab, var(--likec4-palette-hiContrast) 40%, var(--likec4-palette-fill))]"
|
|
129
134
|
},
|
|
130
135
|
borderColor: "[var(--_color)/30]",
|
|
131
136
|
backgroundColor: "var(--likec4-palette-fill)/15",
|
|
@@ -2,6 +2,7 @@ export { CompoundActions } from './CompoundActions';
|
|
|
2
2
|
export { DeploymentElementActions, ElementActions } from './ElementActions';
|
|
3
3
|
export { CompoundDeploymentNode, CompoundDetailsButtonWithHandler, CompoundElementNode, DeploymentNode, ElementDetailsButtonWithHandler, ElementNode, ViewGroupNode, } from './nodes';
|
|
4
4
|
export { SequenceActorNode, SequenceParallelArea } from './SequenceActorNode';
|
|
5
|
+
export { NodeDrifts, type NodeDriftsProps } from './NodeDrifts';
|
|
5
6
|
export * from './CompoundActions';
|
|
6
7
|
export * from './ElementActions';
|
|
7
8
|
export * from './toolbar/CompoundToolbar';
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import { Fqn } from '@likec4/core';
|
|
2
|
+
import { BaseNodeData } from '../../../base/types';
|
|
1
3
|
import { Types } from '../../types';
|
|
2
|
-
export declare function ElementDetailsButtonWithHandler(props:
|
|
4
|
+
export declare function ElementDetailsButtonWithHandler(props: {
|
|
5
|
+
id: string;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
data: BaseNodeData & {
|
|
8
|
+
modelFqn?: Fqn | null | undefined;
|
|
9
|
+
};
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
3
11
|
export declare function CompoundDetailsButtonWithHandler(props: Types.NodeProps<'compound-deployment' | 'compound-element'>): import("react/jsx-runtime").JSX.Element | null;
|
|
4
12
|
/**
|
|
5
13
|
* Renders an element node.
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { css } from '@likec4/styles/css';
|
|
2
3
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
3
|
-
import
|
|
4
|
+
import '@xstate/react';
|
|
5
|
+
import 'fast-equals';
|
|
6
|
+
import 'react';
|
|
7
|
+
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
4
8
|
import { CompoundActions } from './CompoundActions.js';
|
|
5
9
|
import { DeploymentElementActions, ElementActions } from './ElementActions.js';
|
|
10
|
+
import { NodeDrifts } from './NodeDrifts.js';
|
|
6
11
|
import { CompoundDeploymentToolbar, CompoundElementToolbar } from './toolbar/CompoundToolbar.js';
|
|
7
12
|
import { DeploymentElementToolbar, ElementToolbar } from './toolbar/ElementToolbar.js';
|
|
8
13
|
import { CompoundNodeContainer } from '../../../base-primitives/compound/CompoundNodeContainer.js';
|
|
@@ -16,10 +21,9 @@ import { ElementTags } from '../../../base-primitives/element/ElementTags.js';
|
|
|
16
21
|
import { ElementDetailsButton } from '../../../base-primitives/element/ElementDetailsButton.js';
|
|
17
22
|
|
|
18
23
|
function ElementDetailsButtonWithHandler(props) {
|
|
19
|
-
const { enableElementDetails } = useEnabledFeatures();
|
|
20
24
|
const diagram = useDiagram();
|
|
21
25
|
const fqn = props.data.modelFqn;
|
|
22
|
-
if (!
|
|
26
|
+
if (!fqn) return null;
|
|
23
27
|
return /* @__PURE__ */ jsx(
|
|
24
28
|
ElementDetailsButton,
|
|
25
29
|
{
|
|
@@ -32,10 +36,9 @@ function ElementDetailsButtonWithHandler(props) {
|
|
|
32
36
|
);
|
|
33
37
|
}
|
|
34
38
|
function CompoundDetailsButtonWithHandler(props) {
|
|
35
|
-
const { enableElementDetails } = useEnabledFeatures();
|
|
36
39
|
const diagram = useDiagram();
|
|
37
40
|
const fqn = props.data.modelFqn;
|
|
38
|
-
if (!
|
|
41
|
+
if (!fqn) return null;
|
|
39
42
|
return /* @__PURE__ */ jsx(
|
|
40
43
|
CompoundDetailsButton,
|
|
41
44
|
{
|
|
@@ -48,54 +51,96 @@ function CompoundDetailsButtonWithHandler(props) {
|
|
|
48
51
|
);
|
|
49
52
|
}
|
|
50
53
|
function ElementNode(props) {
|
|
51
|
-
const { enableElementTags, enableReadOnly } = useEnabledFeatures();
|
|
54
|
+
const { enableElementTags, enableElementDetails, enableReadOnly, enableCompareWithLatest } = useEnabledFeatures();
|
|
52
55
|
return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
|
|
56
|
+
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
53
57
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
54
58
|
/* @__PURE__ */ jsx(ElementData, { ...props }),
|
|
55
59
|
enableElementTags && /* @__PURE__ */ jsx(ElementTags, { ...props }),
|
|
56
60
|
/* @__PURE__ */ jsx(ElementActions, { ...props }),
|
|
57
|
-
/* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
61
|
+
enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
58
62
|
!enableReadOnly && /* @__PURE__ */ jsx(ElementToolbar, { ...props }),
|
|
59
63
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
60
64
|
] });
|
|
61
65
|
}
|
|
62
66
|
function DeploymentNode(props) {
|
|
63
|
-
const { enableElementTags, enableReadOnly } = useEnabledFeatures();
|
|
67
|
+
const { enableElementTags, enableElementDetails, enableReadOnly, enableCompareWithLatest } = useEnabledFeatures();
|
|
64
68
|
return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
|
|
69
|
+
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
65
70
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
66
71
|
/* @__PURE__ */ jsx(ElementData, { ...props }),
|
|
67
72
|
enableElementTags && /* @__PURE__ */ jsx(ElementTags, { ...props }),
|
|
68
73
|
/* @__PURE__ */ jsx(DeploymentElementActions, { ...props }),
|
|
69
|
-
/* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
74
|
+
enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
70
75
|
!enableReadOnly && /* @__PURE__ */ jsx(DeploymentElementToolbar, { ...props }),
|
|
71
76
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
72
77
|
] });
|
|
73
78
|
}
|
|
79
|
+
const compoundHasDrifts = css({
|
|
80
|
+
outlineColor: "likec4.compare.manual.outline",
|
|
81
|
+
outlineWidth: {
|
|
82
|
+
base: "2px",
|
|
83
|
+
_light: "4px"
|
|
84
|
+
},
|
|
85
|
+
outlineStyle: "solid",
|
|
86
|
+
outlineOffset: "1"
|
|
87
|
+
});
|
|
88
|
+
const hasDrifts = (props) => {
|
|
89
|
+
return props.data.drifts && props.data.drifts.length > 0;
|
|
90
|
+
};
|
|
74
91
|
function CompoundElementNode(props) {
|
|
75
|
-
const { enableElementDetails, enableReadOnly } = useEnabledFeatures();
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
92
|
+
const { enableElementDetails, enableReadOnly, enableCompareWithLatest } = useEnabledFeatures();
|
|
93
|
+
const showDrifts = enableCompareWithLatest && hasDrifts(props);
|
|
94
|
+
return /* @__PURE__ */ jsxs(
|
|
95
|
+
CompoundNodeContainer,
|
|
96
|
+
{
|
|
97
|
+
className: showDrifts ? compoundHasDrifts : void 0,
|
|
98
|
+
nodeProps: props,
|
|
99
|
+
children: [
|
|
100
|
+
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
101
|
+
/* @__PURE__ */ jsx(CompoundTitle, { ...props }),
|
|
102
|
+
/* @__PURE__ */ jsx(CompoundActions, { ...props }),
|
|
103
|
+
enableElementDetails && /* @__PURE__ */ jsx(CompoundDetailsButtonWithHandler, { ...props }),
|
|
104
|
+
!enableReadOnly && /* @__PURE__ */ jsx(CompoundElementToolbar, { ...props }),
|
|
105
|
+
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
);
|
|
83
109
|
}
|
|
84
110
|
function CompoundDeploymentNode(props) {
|
|
85
|
-
const { enableElementDetails, enableReadOnly } = useEnabledFeatures();
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
111
|
+
const { enableElementDetails, enableReadOnly, enableCompareWithLatest } = useEnabledFeatures();
|
|
112
|
+
const showDrifts = enableCompareWithLatest && hasDrifts(props);
|
|
113
|
+
return /* @__PURE__ */ jsxs(
|
|
114
|
+
CompoundNodeContainer,
|
|
115
|
+
{
|
|
116
|
+
className: showDrifts ? compoundHasDrifts : void 0,
|
|
117
|
+
nodeProps: props,
|
|
118
|
+
children: [
|
|
119
|
+
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
120
|
+
/* @__PURE__ */ jsx(CompoundTitle, { ...props }),
|
|
121
|
+
/* @__PURE__ */ jsx(CompoundActions, { ...props }),
|
|
122
|
+
enableElementDetails && /* @__PURE__ */ jsx(CompoundDetailsButtonWithHandler, { ...props }),
|
|
123
|
+
!enableReadOnly && /* @__PURE__ */ jsx(CompoundDeploymentToolbar, { ...props }),
|
|
124
|
+
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
);
|
|
93
128
|
}
|
|
94
129
|
function ViewGroupNode(props) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
130
|
+
const { enableCompareWithLatest } = useEnabledFeatures();
|
|
131
|
+
const showDrifts = enableCompareWithLatest && hasDrifts(props);
|
|
132
|
+
return /* @__PURE__ */ jsxs(
|
|
133
|
+
CompoundNodeContainer,
|
|
134
|
+
{
|
|
135
|
+
className: showDrifts ? compoundHasDrifts : void 0,
|
|
136
|
+
nodeProps: props,
|
|
137
|
+
children: [
|
|
138
|
+
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
139
|
+
/* @__PURE__ */ jsx(CompoundTitle, { ...props }),
|
|
140
|
+
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
);
|
|
99
144
|
}
|
|
100
145
|
|
|
101
146
|
export { CompoundDeploymentNode, CompoundDetailsButtonWithHandler, CompoundElementNode, DeploymentNode, ElementDetailsButtonWithHandler, ElementNode, ViewGroupNode };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LikeC4Theme, ThemeColor } from '@likec4/core';
|
|
2
2
|
import { PopoverProps } from '@mantine/core';
|
|
3
|
-
import { OnStyleChange } from './
|
|
3
|
+
import { OnStyleChange } from './types';
|
|
4
4
|
type ColorButtonProps = Omit<PopoverProps, 'onChange'> & {
|
|
5
5
|
elementColor: ThemeColor;
|
|
6
6
|
elementOpacity?: number | undefined;
|
|
@@ -4,7 +4,7 @@ import { useUpdateEffect } from '@react-hookz/web';
|
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { keys } from 'remeda';
|
|
6
6
|
import { useLikeC4Styles } from '../../../../hooks/useLikeC4Styles.js';
|
|
7
|
-
import { SemanticColors } from './
|
|
7
|
+
import { SemanticColors } from './types.js';
|
|
8
8
|
|
|
9
9
|
function ColorButton({
|
|
10
10
|
elementColor,
|
|
@@ -2,9 +2,10 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Box, SegmentedControl } from '@mantine/core';
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
import { useEnabledFeatures } from '../../../../context/DiagramFeatures.js';
|
|
5
|
-
import {
|
|
5
|
+
import { GoToSourceButton, BrowseRelationshipsButton } from './_shared.js';
|
|
6
6
|
import { ColorButton } from './ColorButton.js';
|
|
7
7
|
import { Toolbar } from './Toolbar.js';
|
|
8
|
+
import { useHandlers } from './useHandlers.js';
|
|
8
9
|
|
|
9
10
|
function CompoundElementToolbar(props) {
|
|
10
11
|
const { enableVscode, enableRelationshipBrowser } = useEnabledFeatures();
|
|
@@ -3,11 +3,12 @@ import { ElementShapes } from '@likec4/core/styles';
|
|
|
3
3
|
import { Menu, MenuTarget, Button, MenuDropdown, MenuItem } from '@mantine/core';
|
|
4
4
|
import { useEnabledFeatures } from '../../../../context/DiagramFeatures.js';
|
|
5
5
|
import { stopPropagation } from '../../../../utils/xyflow.js';
|
|
6
|
-
import {
|
|
6
|
+
import { GoToSourceButton, BrowseRelationshipsButton } from './_shared.js';
|
|
7
7
|
import { ColorButton } from './ColorButton.js';
|
|
8
8
|
import { Toolbar } from './Toolbar.js';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import { useHandlers } from './useHandlers.js';
|
|
10
|
+
import IconSelector from '../../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
|
|
11
|
+
import IconCheck from '../../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
|
|
11
12
|
|
|
12
13
|
function ElementToolbar(props) {
|
|
13
14
|
const { enableVscode, enableRelationshipBrowser } = useEnabledFeatures();
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import { DeploymentFqn, Fqn
|
|
1
|
+
import { DeploymentFqn, Fqn } from '@likec4/core/types';
|
|
2
2
|
import { MergeExclusive } from 'type-fest';
|
|
3
|
-
import { Types } from '../../../types';
|
|
4
3
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
5
4
|
import { TooltipProps } from '@mantine/core';
|
|
6
|
-
export type OnStyleChange = (style: ViewChange.ChangeElementStyle['style']) => void;
|
|
7
|
-
export declare const SemanticColors: readonly ["primary", "secondary", "muted"];
|
|
8
|
-
export type ThemeColorKey = typeof SemanticColors[number];
|
|
9
|
-
export type ColorKey = Exclude<ThemeColor, ThemeColorKey>;
|
|
10
5
|
export declare const Tooltip: ForwardRefExoticComponent< TooltipProps & RefAttributes<HTMLDivElement> & {
|
|
11
6
|
component?: any;
|
|
12
7
|
renderRoot?: (props: Record<string, any>) => React.ReactNode;
|
|
13
8
|
}>;
|
|
14
|
-
export declare function useHandlers(target: Fqn | DeploymentFqn, props: Types.NodeProps): {
|
|
15
|
-
elementColor: "amber" | "blue" | "gray" | "slate" | "green" | "indigo" | "muted" | "primary" | "red" | "secondary" | "sky";
|
|
16
|
-
onColorPreview: (color: ThemeColor | null) => void;
|
|
17
|
-
onChange: OnStyleChange;
|
|
18
|
-
};
|
|
19
9
|
export declare function BrowseRelationshipsButton({ fqn }: {
|
|
20
10
|
fqn: Fqn;
|
|
21
11
|
}): import("react/jsx-runtime").JSX.Element;
|