@likec4/diagram 1.43.0 → 1.44.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 +5746 -4674
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +13 -10
- package/dist/LikeC4Diagram.props.d.ts +16 -7
- package/dist/LikeC4ProjectsProvider.js +1 -1
- package/dist/LikeC4View.d.ts +5 -0
- package/dist/LikeC4View.js +22 -11
- 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 +4 -3
- package/dist/base/updateNodes.js +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
- 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 +4 -0
- package/dist/base-primitives/edge/EdgeLabel.d.ts +1 -0
- 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 +9 -5
- package/dist/base-primitives/element/ElementActionButtons.d.ts +3 -2
- package/dist/base-primitives/element/ElementActionButtons.js +1 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +2 -5
- package/dist/base-primitives/element/ElementNodeContainer.css.js +15 -27
- 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 +24 -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 +2 -18
- package/dist/context/index.d.ts +1 -1
- package/dist/custom/customNodes.js +3 -2
- package/dist/custom/hooks.d.ts +1 -1
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +4 -4
- package/dist/editor/LikeC4EditorContext.d.ts +21 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +2 -1
- 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 +60 -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 +54 -51
- package/dist/likec4diagram/convert-to-xyflow.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +249 -220
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +7 -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/ElementNodeDrifts.d.ts +4 -0
- package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.js +46 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -1
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +9 -1
- package/dist/likec4diagram/custom/nodes/nodes.js +13 -9
- 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 +5 -7
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +3 -2
- package/dist/likec4diagram/state/DiagramActorProvider.js +96 -70
- package/dist/likec4diagram/state/assign.d.ts +4 -2
- package/dist/likec4diagram/state/assign.js +39 -103
- package/dist/likec4diagram/state/createViewChange.d.ts +3 -0
- package/dist/likec4diagram/state/createViewChange.js +90 -0
- package/dist/likec4diagram/state/diagram-api.d.ts +113 -0
- package/dist/likec4diagram/state/diagram-api.js +134 -0
- package/dist/likec4diagram/state/hotkeyActor.d.ts +7 -0
- package/dist/likec4diagram/state/hotkeyActor.js +17 -1
- package/dist/likec4diagram/state/machine.actions.d.ts +2099 -0
- package/dist/likec4diagram/state/machine.actions.js +735 -0
- package/dist/likec4diagram/state/machine.d.ts +3717 -0
- package/dist/likec4diagram/state/machine.js +141 -0
- package/dist/likec4diagram/state/machine.setup.d.ts +284 -0
- package/dist/likec4diagram/state/machine.setup.js +71 -0
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +183 -0
- package/dist/likec4diagram/state/machine.state.initializing.js +55 -0
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +117 -0
- package/dist/likec4diagram/state/machine.state.navigating.js +45 -0
- package/dist/likec4diagram/state/machine.state.ready.d.ts +3666 -0
- package/dist/likec4diagram/state/machine.state.ready.js +437 -0
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +220 -63
- package/dist/likec4diagram/state/syncManualLayoutActor.js +218 -143
- package/dist/likec4diagram/state/types.d.ts +4 -7
- package/dist/likec4diagram/state/utils.d.ts +4 -2
- package/dist/likec4diagram/state/utils.js +4 -1
- package/dist/likec4diagram/types.d.ts +6 -1
- 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.js +5 -4
- package/dist/likec4diagram/useLayoutConstraints.d.ts +10 -5
- package/dist/likec4diagram/useLayoutConstraints.js +225 -54
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +0 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +15 -15
- package/dist/navigationpanel/NavigationPanel.js +11 -7
- 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 +11 -7
- package/dist/navigationpanel/actor.js +5 -4
- 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 +19 -16
- 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 +10 -10
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +31 -14
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +2 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +66 -49
- 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.js +7 -5
- 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 +3 -2
- package/dist/overlays/overlaysActor.d.ts +304 -62
- package/dist/overlays/overlaysActor.js +132 -131
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/actor.d.ts +14 -2
- package/dist/overlays/relationship-details/actor.js +17 -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/relationships-browser/RelationshipsBrowser.js +6 -4
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/actor.d.ts +239 -173
- 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/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/shadowroot/ShadowRoot.js +1 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +4 -4
- package/dist/utils/vector.d.ts +78 -21
- package/dist/utils/vector.js +91 -24
- package/dist/utils/view-bounds.d.ts +8 -0
- package/dist/utils/view-bounds.js +57 -0
- package/dist/utils/xyflow.d.ts +49 -7
- package/dist/utils/xyflow.js +63 -11
- package/package.json +19 -18
- package/panda.buildinfo.json +107 -66
- 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,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 { extractMinimalInternalNode, getNodeIntersectionFromCenterToPoint, bezierPath, isEqualMinimalInternalNodes } 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 isSameNodes = (a, b) => isEqualMinimalInternalNodes(a.sourceNode, b.sourceNode) && isEqualMinimalInternalNodes(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: extractMinimalInternalNode(sourceNode2),
|
|
32
|
+
targetNode: extractMinimalInternalNode(targetNode2)
|
|
33
|
+
};
|
|
34
|
+
}, [source, target]),
|
|
35
|
+
isSameNodes
|
|
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,46 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Box } from '@likec4/styles/jsx';
|
|
3
|
+
import { Notification, Text } from '@mantine/core';
|
|
4
|
+
import { NodeToolbar, Position } from '@xyflow/react';
|
|
5
|
+
|
|
6
|
+
function ElementNodeDrifts({ data }) {
|
|
7
|
+
const drifts = data.drifts;
|
|
8
|
+
if (!drifts || drifts.length === 0) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
Box,
|
|
13
|
+
{
|
|
14
|
+
className: "likec4-node-drifts",
|
|
15
|
+
css: {
|
|
16
|
+
position: "absolute",
|
|
17
|
+
inset: "0",
|
|
18
|
+
pointerEvents: "none",
|
|
19
|
+
"& + .likec4-element-shape": {
|
|
20
|
+
outlineColor: "likec4.compare.manual.outline",
|
|
21
|
+
outlineWidth: {
|
|
22
|
+
base: "2px",
|
|
23
|
+
_light: "4px"
|
|
24
|
+
},
|
|
25
|
+
outlineStyle: "solid",
|
|
26
|
+
outlineOffset: "1"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
children: /* @__PURE__ */ jsx(NodeToolbar, { isVisible: data.hovered === true, align: "start", position: Position.Bottom, children: /* @__PURE__ */ jsx(
|
|
30
|
+
Notification,
|
|
31
|
+
{
|
|
32
|
+
color: "orange",
|
|
33
|
+
withBorder: false,
|
|
34
|
+
withCloseButton: false,
|
|
35
|
+
title: "Changes:",
|
|
36
|
+
children: drifts.map((drift) => /* @__PURE__ */ jsxs(Text, { mt: 2, size: "sm", lh: "xs", children: [
|
|
37
|
+
"- ",
|
|
38
|
+
drift
|
|
39
|
+
] }, drift))
|
|
40
|
+
}
|
|
41
|
+
) })
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { ElementNodeDrifts };
|
|
@@ -3,6 +3,7 @@ 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';
|
|
7
8
|
import { ElementDetailsButtonWithHandler } from './nodes.js';
|
|
8
9
|
import { ElementNodeContainer } from '../../../base-primitives/element/ElementNodeContainer.js';
|
|
@@ -67,8 +68,10 @@ const ActorStepPort = ({
|
|
|
67
68
|
};
|
|
68
69
|
const hasModelFqn = (data) => isTruthy(data.modelFqn);
|
|
69
70
|
function SequenceActorNode(props) {
|
|
71
|
+
const { enableElementDetails } = useEnabledFeatures();
|
|
70
72
|
const data = props.data;
|
|
71
73
|
const {
|
|
74
|
+
id,
|
|
72
75
|
positionAbsoluteY,
|
|
73
76
|
data: {
|
|
74
77
|
viewHeight,
|
|
@@ -106,7 +109,7 @@ function SequenceActorNode(props) {
|
|
|
106
109
|
/* @__PURE__ */ jsx(ElementData, { ...props }),
|
|
107
110
|
hasModelFqn(data) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
108
111
|
/* @__PURE__ */ jsx(ElementActions, { ...props, data }),
|
|
109
|
-
/* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, {
|
|
112
|
+
enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { id, data })
|
|
110
113
|
] })
|
|
111
114
|
] }),
|
|
112
115
|
ports.map((p) => /* @__PURE__ */ jsx(ActorStepPort, { port: p, data: props.data }, p.id))
|
|
@@ -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,12 @@
|
|
|
1
1
|
import { jsxs, 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 { CompoundActions } from './CompoundActions.js';
|
|
5
8
|
import { DeploymentElementActions, ElementActions } from './ElementActions.js';
|
|
9
|
+
import { ElementNodeDrifts } from './ElementNodeDrifts.js';
|
|
6
10
|
import { CompoundDeploymentToolbar, CompoundElementToolbar } from './toolbar/CompoundToolbar.js';
|
|
7
11
|
import { DeploymentElementToolbar, ElementToolbar } from './toolbar/ElementToolbar.js';
|
|
8
12
|
import { CompoundNodeContainer } from '../../../base-primitives/compound/CompoundNodeContainer.js';
|
|
@@ -16,10 +20,9 @@ import { ElementTags } from '../../../base-primitives/element/ElementTags.js';
|
|
|
16
20
|
import { ElementDetailsButton } from '../../../base-primitives/element/ElementDetailsButton.js';
|
|
17
21
|
|
|
18
22
|
function ElementDetailsButtonWithHandler(props) {
|
|
19
|
-
const { enableElementDetails } = useEnabledFeatures();
|
|
20
23
|
const diagram = useDiagram();
|
|
21
24
|
const fqn = props.data.modelFqn;
|
|
22
|
-
if (!
|
|
25
|
+
if (!fqn) return null;
|
|
23
26
|
return /* @__PURE__ */ jsx(
|
|
24
27
|
ElementDetailsButton,
|
|
25
28
|
{
|
|
@@ -32,10 +35,9 @@ function ElementDetailsButtonWithHandler(props) {
|
|
|
32
35
|
);
|
|
33
36
|
}
|
|
34
37
|
function CompoundDetailsButtonWithHandler(props) {
|
|
35
|
-
const { enableElementDetails } = useEnabledFeatures();
|
|
36
38
|
const diagram = useDiagram();
|
|
37
39
|
const fqn = props.data.modelFqn;
|
|
38
|
-
if (!
|
|
40
|
+
if (!fqn) return null;
|
|
39
41
|
return /* @__PURE__ */ jsx(
|
|
40
42
|
CompoundDetailsButton,
|
|
41
43
|
{
|
|
@@ -48,25 +50,27 @@ function CompoundDetailsButtonWithHandler(props) {
|
|
|
48
50
|
);
|
|
49
51
|
}
|
|
50
52
|
function ElementNode(props) {
|
|
51
|
-
const { enableElementTags, enableReadOnly } = useEnabledFeatures();
|
|
53
|
+
const { enableElementTags, enableElementDetails, enableReadOnly, enableCompareWithLatest } = useEnabledFeatures();
|
|
52
54
|
return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
|
|
55
|
+
enableCompareWithLatest && /* @__PURE__ */ jsx(ElementNodeDrifts, { ...props }),
|
|
53
56
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
54
57
|
/* @__PURE__ */ jsx(ElementData, { ...props }),
|
|
55
58
|
enableElementTags && /* @__PURE__ */ jsx(ElementTags, { ...props }),
|
|
56
59
|
/* @__PURE__ */ jsx(ElementActions, { ...props }),
|
|
57
|
-
/* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
60
|
+
enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
58
61
|
!enableReadOnly && /* @__PURE__ */ jsx(ElementToolbar, { ...props }),
|
|
59
62
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
60
63
|
] });
|
|
61
64
|
}
|
|
62
65
|
function DeploymentNode(props) {
|
|
63
|
-
const { enableElementTags, enableReadOnly } = useEnabledFeatures();
|
|
66
|
+
const { enableElementTags, enableElementDetails, enableReadOnly, enableCompareWithLatest } = useEnabledFeatures();
|
|
64
67
|
return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
|
|
68
|
+
enableCompareWithLatest && /* @__PURE__ */ jsx(ElementNodeDrifts, { ...props }),
|
|
65
69
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
66
70
|
/* @__PURE__ */ jsx(ElementData, { ...props }),
|
|
67
71
|
enableElementTags && /* @__PURE__ */ jsx(ElementTags, { ...props }),
|
|
68
72
|
/* @__PURE__ */ jsx(DeploymentElementActions, { ...props }),
|
|
69
|
-
/* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
73
|
+
enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
70
74
|
!enableReadOnly && /* @__PURE__ */ jsx(DeploymentElementToolbar, { ...props }),
|
|
71
75
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
72
76
|
] });
|
|
@@ -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;
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { invariant } from '@likec4/core';
|
|
3
2
|
import { Tooltip as Tooltip$1, ActionIcon } from '@mantine/core';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import '@xstate/react';
|
|
4
|
+
import 'fast-equals';
|
|
5
|
+
import 'react';
|
|
6
|
+
import { useDiagram } from '../../../../hooks/safeContext.js';
|
|
7
7
|
import { useDiagramEventHandlers } from '../../../../context/DiagramEventHandlers.js';
|
|
8
|
-
import IconFileSymlink from '../../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
9
|
-
import IconTransform from '../../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
8
|
+
import IconFileSymlink from '../../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.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';
|
|
10
10
|
|
|
11
|
-
const SemanticColors = [
|
|
12
|
-
"primary",
|
|
13
|
-
"secondary",
|
|
14
|
-
"muted"
|
|
15
|
-
];
|
|
16
11
|
const Tooltip = Tooltip$1.withProps({
|
|
17
12
|
color: "dark",
|
|
18
13
|
fz: "xs",
|
|
@@ -23,45 +18,6 @@ const Tooltip = Tooltip$1.withProps({
|
|
|
23
18
|
offset: 4,
|
|
24
19
|
withinPortal: false
|
|
25
20
|
});
|
|
26
|
-
function useHandlers(target, props) {
|
|
27
|
-
const { onChange: triggerOnChange } = useDiagramEventHandlers();
|
|
28
|
-
const diagram = useDiagram();
|
|
29
|
-
const [originalColor, setOriginalColor] = useState(null);
|
|
30
|
-
const onColorPreview = useCallbackRef((color) => {
|
|
31
|
-
if (color === null) {
|
|
32
|
-
invariant(originalColor, "originalColor is null");
|
|
33
|
-
setOriginalColor(null);
|
|
34
|
-
diagram.updateNodeData(props.data.id, {
|
|
35
|
-
color: originalColor
|
|
36
|
-
});
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
setOriginalColor((value) => value ?? props.data.color);
|
|
40
|
-
diagram.updateNodeData(props.data.id, {
|
|
41
|
-
color
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
const onChange = useCallbackRef((change) => {
|
|
45
|
-
triggerOnChange?.({
|
|
46
|
-
change: {
|
|
47
|
-
op: "change-element-style",
|
|
48
|
-
style: change,
|
|
49
|
-
targets: [target]
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
const { shape, color, ...style } = change;
|
|
53
|
-
diagram.updateNodeData(props.data.id, {
|
|
54
|
-
...shape && { shape },
|
|
55
|
-
...color && { color },
|
|
56
|
-
style
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
return {
|
|
60
|
-
elementColor: originalColor ?? props.data.color,
|
|
61
|
-
onColorPreview,
|
|
62
|
-
onChange
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
21
|
function BrowseRelationshipsButton({ fqn }) {
|
|
66
22
|
const diagram = useDiagram();
|
|
67
23
|
return /* @__PURE__ */ jsx(Tooltip, { label: "Browse relationships", children: /* @__PURE__ */ jsx(
|
|
@@ -113,4 +69,4 @@ function GoToSourceButton(props) {
|
|
|
113
69
|
) });
|
|
114
70
|
}
|
|
115
71
|
|
|
116
|
-
export { BrowseRelationshipsButton, GoToSourceButton,
|
|
72
|
+
export { BrowseRelationshipsButton, GoToSourceButton, Tooltip };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ThemeColor, ViewChange } from '@likec4/core/types';
|
|
2
|
+
export declare const SemanticColors: readonly ["primary", "secondary", "muted"];
|
|
3
|
+
export type OnStyleChange = (style: ViewChange.ChangeElementStyle['style']) => void;
|
|
4
|
+
export type ThemeColorKey = typeof SemanticColors[number];
|
|
5
|
+
export type ColorKey = Exclude<ThemeColor, ThemeColorKey>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DeploymentFqn, Fqn, ThemeColor } from '@likec4/core';
|
|
2
|
+
import { Types } from '../../../types';
|
|
3
|
+
import { OnStyleChange } from './types';
|
|
4
|
+
export declare function useHandlers(target: Fqn | DeploymentFqn, props: Types.NodeProps): {
|
|
5
|
+
elementColor: "amber" | "blue" | "gray" | "slate" | "green" | "indigo" | "muted" | "primary" | "red" | "secondary" | "sky";
|
|
6
|
+
onColorPreview: (color: ThemeColor | null) => void;
|
|
7
|
+
onChange: OnStyleChange;
|
|
8
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { useCallbackRef } from '../../../../hooks/useCallbackRef.js';
|
|
3
|
+
import '@xstate/react';
|
|
4
|
+
import 'fast-equals';
|
|
5
|
+
import { useDiagram } from '../../../../hooks/safeContext.js';
|
|
6
|
+
|
|
7
|
+
function useHandlers(target, props) {
|
|
8
|
+
const diagram = useDiagram();
|
|
9
|
+
const [originalColor, setOriginalColor] = useState(null);
|
|
10
|
+
const onColorPreview = useCallbackRef((color) => {
|
|
11
|
+
if (color === null) {
|
|
12
|
+
if (!originalColor) return;
|
|
13
|
+
setOriginalColor(null);
|
|
14
|
+
diagram.updateNodeData(props.data.id, {
|
|
15
|
+
color: originalColor
|
|
16
|
+
});
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
setOriginalColor((value) => value ?? props.data.color);
|
|
20
|
+
diagram.updateNodeData(props.data.id, {
|
|
21
|
+
color
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
const onChange = useCallbackRef((change) => {
|
|
25
|
+
const { shape, color, ...style } = change;
|
|
26
|
+
diagram.updateNodeData(props.data.id, {
|
|
27
|
+
...shape && { shape },
|
|
28
|
+
...color && { color },
|
|
29
|
+
style
|
|
30
|
+
});
|
|
31
|
+
diagram.triggerChange({
|
|
32
|
+
op: "change-element-style",
|
|
33
|
+
style: change,
|
|
34
|
+
targets: [target]
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
elementColor: originalColor ?? props.data.color,
|
|
39
|
+
onColorPreview,
|
|
40
|
+
onChange
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { useHandlers };
|
|
@@ -13,16 +13,17 @@ import { Link } from '../../components/Link.js';
|
|
|
13
13
|
import { PortalToContainer } from '../../components/PortalToContainer.js';
|
|
14
14
|
import { useDiagramEventHandlers } from '../../context/DiagramEventHandlers.js';
|
|
15
15
|
import { useEnabledFeatures } from '../../context/DiagramFeatures.js';
|
|
16
|
-
import {
|
|
16
|
+
import { useDiagramContext, useOnDiagramEvent } from '../../hooks/useDiagram.js';
|
|
17
17
|
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
18
18
|
import { findDiagramEdge, findDiagramNode } from '../state/utils.js';
|
|
19
19
|
import { RelationshipPopoverActorLogic } from './actor.js';
|
|
20
20
|
import { endpoint, title } from './styles.css.js';
|
|
21
|
+
import { useDiagram } from '../../hooks/safeContext.js';
|
|
21
22
|
import { useRootContainerRef } from '../../context/RootContainerContext.js';
|
|
22
23
|
import { roundDpr } from '../../utils/roundDpr.js';
|
|
23
|
-
import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
24
|
-
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
25
|
-
import IconFileSymlink from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
24
|
+
import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js';
|
|
25
|
+
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';
|
|
26
|
+
import IconFileSymlink from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
|
|
26
27
|
import { Markdown } from '../../base-primitives/Markdown.js';
|
|
27
28
|
|
|
28
29
|
function selectDiagramContext(c) {
|
|
@@ -56,9 +57,6 @@ const RelationshipPopover = memo(() => {
|
|
|
56
57
|
useOnDiagramEvent("edgeMouseLeave", () => {
|
|
57
58
|
actorRef.send({ type: "xyedge.mouseLeave" });
|
|
58
59
|
});
|
|
59
|
-
useOnDiagramEvent("edgeEditingStarted", () => {
|
|
60
|
-
actorRef.send({ type: "close" });
|
|
61
|
-
});
|
|
62
60
|
useOnDiagramEvent("walkthroughStarted", () => {
|
|
63
61
|
actorRef.send({ type: "close" });
|
|
64
62
|
});
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { DiagramView, DynamicViewDisplayVariant, WhereOperator } from '@likec4/core/types';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
import { ViewPadding } from '../../LikeC4Diagram.props';
|
|
4
|
-
export declare function DiagramActorProvider({ view, zoomable, pannable,
|
|
4
|
+
export declare function DiagramActorProvider({ view, zoomable, pannable, nodesDraggable, nodesSelectable, fitViewPadding, where, children, dynamicViewVariant: _defaultVariant, }: PropsWithChildren<{
|
|
5
5
|
view: DiagramView;
|
|
6
6
|
zoomable: boolean;
|
|
7
7
|
pannable: boolean;
|
|
8
|
-
|
|
8
|
+
nodesDraggable: boolean;
|
|
9
9
|
nodesSelectable: boolean;
|
|
10
|
+
fitViewPadding: ViewPadding;
|
|
10
11
|
where: WhereOperator | null;
|
|
11
12
|
dynamicViewVariant: DynamicViewDisplayVariant | undefined;
|
|
12
13
|
}>): import("react/jsx-runtime").JSX.Element;
|