@likec4/diagram 1.47.0 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +8 -10
- package/adhoc-editor/package.json +4 -0
- package/dist/LikeC4Diagram.d.ts +2 -1
- package/dist/LikeC4Diagram.js +85 -81
- package/dist/LikeC4Diagram.props.d.ts +10 -6
- package/dist/LikeC4ModelProvider.d.ts +4 -4
- package/dist/LikeC4ModelProvider.js +2 -2
- package/dist/LikeC4ProjectsOverview.d.ts +3 -2
- package/dist/LikeC4ProjectsProvider.d.ts +2 -1
- package/dist/LikeC4ProjectsProvider.js +10 -8
- package/dist/LikeC4Styles.d.ts +3 -6
- package/dist/LikeC4Styles.js +44 -43
- package/dist/LikeC4View.d.ts +22 -1
- package/dist/LikeC4View.js +40 -25
- package/dist/ReactLikeC4.d.ts +13 -2
- package/dist/ReactLikeC4.js +8 -4
- package/dist/StaticLikeC4Diagram.d.ts +2 -1
- package/dist/StaticLikeC4Diagram.js +1 -0
- package/dist/_virtual/store-1b2fbb72.cjs.js +3 -0
- package/dist/_virtual/xstate-store-react.cjs.js +5 -0
- package/dist/_virtual/xstate-store-react.cjs2.js +3 -0
- package/dist/adhoc-editor/EditorPanel.d.ts +1 -0
- package/dist/adhoc-editor/EditorPanel.js +105 -0
- package/dist/adhoc-editor/ElementsTree.d.ts +2 -0
- package/dist/adhoc-editor/ElementsTree.js +142 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +4 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +74 -0
- package/dist/adhoc-editor/components/Tree.d.ts +48 -0
- package/dist/adhoc-editor/components/Tree.js +296 -0
- package/dist/adhoc-editor/hooks.d.ts +14 -0
- package/dist/adhoc-editor/hooks.js +29 -0
- package/dist/adhoc-editor/index.d.ts +2 -0
- package/dist/adhoc-editor/index.js +1 -0
- package/dist/adhoc-editor/state/ActorProvider.d.ts +5 -0
- package/dist/adhoc-editor/state/ActorProvider.js +40 -0
- package/dist/adhoc-editor/state/actor.d.ts +13 -0
- package/dist/adhoc-editor/state/actor.editor.d.ts +56 -0
- package/dist/adhoc-editor/state/actor.editor.js +205 -0
- package/dist/adhoc-editor/state/actor.js +16 -0
- package/dist/adhoc-editor/state/actor.layouter.d.ts +51 -0
- package/dist/adhoc-editor/state/actor.layouter.js +70 -0
- package/dist/adhoc-editor/state/actor.types.d.ts +63 -0
- package/dist/adhoc-editor/state/actor.types.js +29 -0
- package/dist/adhoc-editor/state/panel.d.ts +95 -0
- package/dist/adhoc-editor/state/panel.js +139 -0
- package/dist/adhoc-editor/state/utils.d.ts +17 -0
- package/dist/adhoc-editor/state/utils.js +32 -0
- package/dist/adhoc-editor/useElementsTree.d.ts +18 -0
- package/dist/adhoc-editor/useElementsTree.js +130 -0
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +6 -0
- package/dist/base/const.d.ts +2 -0
- package/dist/base/const.js +2 -1
- package/dist/base/updateEdges.js +26 -3
- package/dist/base/updateNodes.js +8 -5
- package/dist/base-primitives/Markdown.d.ts +1 -1
- package/dist/base-primitives/Markdown.js +1 -1
- package/dist/base-primitives/NodeHandles.d.ts +4 -2
- package/dist/base-primitives/NodeHandles.js +46 -19
- package/dist/base-primitives/compound/CompoundActionButton.js +28 -12
- package/dist/base-primitives/compound/CompoundDetailsButton.js +24 -9
- package/dist/base-primitives/compound/CompoundNodeContainer.js +11 -8
- package/dist/base-primitives/compound/CompoundTitle.js +1 -2
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +5 -2
- package/dist/base-primitives/edge/EdgeLabel.js +3 -4
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +2 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +17 -20
- package/dist/base-primitives/element/ElementActionButtons.js +57 -59
- package/dist/base-primitives/element/ElementData.d.ts +7 -7
- package/dist/base-primitives/element/ElementData.js +61 -48
- package/dist/base-primitives/element/ElementDetailsButton.js +48 -18
- package/dist/base-primitives/element/ElementNodeContainer.d.ts +5 -5
- package/dist/base-primitives/element/ElementNodeContainer.js +24 -10
- package/dist/base-primitives/element/ElementShape.d.ts +2 -2
- package/dist/base-primitives/element/ElementShape.js +70 -7
- package/dist/base-primitives/element/ElementTags.d.ts +6 -2
- package/dist/base-primitives/element/ElementTags.js +55 -32
- package/dist/base-primitives/index.d.ts +1 -1
- package/dist/base-primitives/memoEdge.js +1 -1
- package/dist/base-primitives/memoNode.js +1 -1
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +3 -3
- package/dist/components/NavigationPanel.d.ts +2 -2
- package/dist/components/NavigationPanel.js +5 -26
- package/dist/components/PortalToContainer.js +3 -4
- package/dist/components/RootContainer.js +9 -19
- package/dist/components/ViewNotFound.d.ts +3 -3
- package/dist/components/ViewNotFound.js +30 -26
- package/dist/context/CurrentViewModelProvider.d.ts +2 -0
- package/dist/context/CurrentViewModelProvider.js +12 -0
- package/dist/context/DefaultMantineProvider.d.ts +2 -0
- package/dist/context/DefaultMantineProvider.js +75 -0
- package/dist/context/DiagramEventHandlers.d.ts +5 -5
- package/dist/context/DiagramEventHandlers.js +10 -4
- package/dist/context/DiagramFeatures.d.ts +8 -7
- package/dist/context/DiagramFeatures.js +16 -13
- package/dist/context/EnsureMantine.d.ts +0 -3
- package/dist/context/EnsureMantine.js +3 -4
- package/dist/context/FramerMotionConfig.d.ts +1 -3
- package/dist/context/IconRenderer.d.ts +19 -4
- package/dist/context/IconRenderer.js +52 -25
- package/dist/context/LikeC4ModelContext.d.ts +10 -5
- package/dist/context/LikeC4ModelContext.js +11 -3
- package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
- package/dist/context/LikeC4ProjectsContext.js +6 -2
- package/dist/context/RootContainerContext.d.ts +10 -3
- package/dist/context/RootContainerContext.js +8 -3
- package/dist/context/TagStylesContext.js +13 -5
- package/dist/custom/hooks.d.ts +2 -2
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +16 -15
- package/dist/editor/LikeC4EditorCallbacks.d.ts +18 -0
- package/dist/editor/LikeC4EditorCallbacks.js +5 -0
- package/dist/editor/LikeC4EditorProvider.d.ts +30 -18
- package/dist/editor/LikeC4EditorProvider.js +3 -3
- package/dist/editor/applyChangesToManualLayout.js +7 -6
- package/dist/editor/editorActor.actions.d.ts +25 -25
- package/dist/editor/editorActor.actions.js +22 -22
- package/dist/editor/editorActor.setup.d.ts +84 -0
- package/dist/editor/editorActor.setup.js +38 -0
- package/dist/editor/editorActor.states.d.ts +9 -0
- package/dist/editor/{editorActor.js → editorActor.states.js} +21 -72
- package/dist/editor/index.d.ts +4 -3
- package/dist/editor/useEditorActorLogic.d.ts +2 -565
- package/dist/editor/useEditorActorLogic.js +14 -21
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/safeContext.d.ts +4 -5
- package/dist/hooks/useCallbackRef.d.ts +6 -0
- package/dist/hooks/useCallbackRef.js +7 -6
- package/dist/hooks/useCurrentView.js +5 -10
- package/dist/hooks/useCurrentViewModel.d.ts +8 -2
- package/dist/hooks/useCurrentViewModel.js +3 -7
- package/dist/hooks/useDiagram.d.ts +9 -1
- package/dist/hooks/useDiagram.js +10 -4
- package/dist/hooks/useDiagramCompareLayout.d.ts +6 -6
- package/dist/hooks/useDiagramCompareLayout.js +1 -1
- package/dist/hooks/useLikeC4ElementsTree.d.ts +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +2 -2
- package/dist/hooks/useLikeC4Model.d.ts +6 -2
- package/dist/hooks/useLikeC4Model.js +7 -9
- package/dist/hooks/useLikeC4Project.d.ts +4 -6
- package/dist/hooks/useLikeC4Project.js +19 -31
- package/dist/hooks/useLikeC4Styles.js +3 -9
- package/dist/hooks/useMantinePortalProps.d.ts +1 -1
- package/dist/hooks/useMediaPrint.d.ts +0 -2
- package/dist/hooks/useOverlaysActor.js +4 -4
- package/dist/hooks/useSearchActor.js +4 -4
- package/dist/hooks/useSetState.d.ts +6 -1
- package/dist/hooks/useSetState.js +7 -4
- package/dist/hooks/useXYFlow.d.ts +7 -1
- package/dist/hooks/useXYFlow.js +4 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +3 -1
- package/dist/likec4diagram/DiagramUI.js +1 -3
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -1
- package/dist/likec4diagram/DiagramXYFlow.js +29 -18
- package/dist/likec4diagram/convert-to-xyflow.d.ts +2 -1
- package/dist/likec4diagram/convert-to-xyflow.js +2 -6
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +34 -37
- package/dist/likec4diagram/custom/edges/edges.css.js +2 -1
- package/dist/likec4diagram/custom/edges/useControlPoints.js +3 -3
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +3 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +52 -34
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +7 -10
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +3 -20
- package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +286 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +10 -6
- package/dist/likec4diagram/custom/nodes/nodes.js +30 -8
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +5 -4
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +6 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +14 -9
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +4 -4
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +3 -3
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +16 -36
- package/dist/likec4diagram/relationship-popover/components.d.ts +7 -0
- package/dist/likec4diagram/relationship-popover/components.js +39 -0
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
- package/dist/likec4diagram/state/DiagramActorProvider.js +39 -66
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/createViewChange.js +16 -4
- package/dist/likec4diagram/state/diagram-api.d.ts +11 -0
- package/dist/likec4diagram/state/diagram-api.js +15 -0
- package/dist/likec4diagram/state/machine.actions.d.ts +92 -0
- package/dist/likec4diagram/state/machine.actions.js +127 -58
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +23 -2
- package/dist/likec4diagram/state/machine.actions.layout.js +68 -15
- package/dist/likec4diagram/state/machine.d.ts +1 -1
- package/dist/likec4diagram/state/machine.js +35 -31
- package/dist/likec4diagram/state/machine.setup.d.ts +40 -7
- package/dist/likec4diagram/state/machine.setup.js +13 -4
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +32 -2
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +1 -1
- package/dist/likec4diagram/state/machine.state.navigating.js +82 -50
- package/dist/likec4diagram/state/machine.state.ready.d.ts +565 -579
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +17 -148
- package/dist/likec4diagram/state/machine.state.ready.focused.js +6 -14
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +11 -96
- package/dist/likec4diagram/state/machine.state.ready.idle.js +7 -12
- package/dist/likec4diagram/state/machine.state.ready.js +89 -70
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +4 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +4 -3
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +145 -2
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +29 -21
- package/dist/likec4diagram/state/types.d.ts +1 -1
- package/dist/likec4diagram/state/utils.d.ts +14 -14
- package/dist/likec4diagram/state/utils.js +12 -4
- package/dist/likec4diagram/types.d.ts +11 -3
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +2 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.d.ts +12 -12
- package/dist/likec4diagram/useLayoutConstraints.js +126 -84
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +11 -3
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +7 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.d.ts +7 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +15 -8
- package/dist/navigationpanel/NavigationPanel.js +4 -3
- package/dist/navigationpanel/NavigationPanelControls.js +4 -2
- package/dist/navigationpanel/NavigationPanelDropdown.js +13 -13
- package/dist/navigationpanel/_common.d.ts +1 -1
- package/dist/navigationpanel/_common.js +2 -3
- package/dist/navigationpanel/actor.js +1 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
- package/dist/navigationpanel/comparepanel/ComparePanel.js +155 -29
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -0
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +264 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +4 -5
- package/dist/navigationpanel/controls/DetailsControls.js +7 -7
- package/dist/navigationpanel/controls/LayoutWarning.js +2 -2
- package/dist/navigationpanel/controls/LogoButton.js +1 -1
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.d.ts +1 -2
- package/dist/navigationpanel/controls/SearchControl.js +8 -12
- package/dist/navigationpanel/controls/ToggleReadonly.js +5 -6
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +12 -6
- package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
- package/dist/navigationpanel/editorpanel/styles.js +4 -4
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/styles.css.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +6 -6
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +77 -77
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
- package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/dist/store-1b2fbb72.cjs.js +742 -0
- package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/react/dist/xstate-store-react.cjs.js +175 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +15 -15
- package/dist/overlays/element-details/ElementDetailsCard.js +39 -40
- package/dist/overlays/element-details/MetadataValue.js +11 -12
- package/dist/overlays/element-details/TabPanelDeployments.js +8 -6
- package/dist/overlays/element-details/TabPanelRelationships.css.js +10 -30
- package/dist/overlays/element-details/TabPanelRelationships.js +4 -5
- package/dist/overlays/element-details/TabPanelStructure.css.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +3 -2
- package/dist/overlays/overlaysActor.js +19 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +0 -5
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -4
- package/dist/overlays/relationship-details/SelectEdge.css.js +6 -6
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/compute.js +1 -1
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationship-details/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +0 -5
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +116 -21
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/actor.js +1 -1
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +21 -6
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationships-browser/layout.d.ts +1 -1
- package/dist/overlays/relationships-browser/layout.js +1 -1
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -1
- package/dist/projects-overview/ProjectsOverview.js +2 -2
- package/dist/projects-overview/ProjectsOverviewXY.d.ts +1 -5
- package/dist/projects-overview/ProjectsOverviewXY.js +1 -1
- package/dist/projects-overview/actor.d.ts +1 -1
- package/dist/projects-overview/actor.js +8 -31
- package/dist/projects-overview/context.d.ts +2 -2
- package/dist/projects-overview/context.js +2 -1
- package/dist/projects-overview/custom/nodeTypes.js +1 -1
- package/dist/projects-overview/panel/ProjectsOverviewPanel.js +1 -1
- package/dist/search/Search.d.ts +2 -4
- package/dist/search/Search.js +67 -44
- package/dist/search/components/ElementsColumn.css.js +6 -6
- package/dist/search/components/ElementsColumn.js +93 -60
- package/dist/search/components/PickView.d.ts +3 -1
- package/dist/search/components/PickView.js +12 -7
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +2 -2
- package/dist/search/components/ViewsColum.d.ts +2 -1
- package/dist/search/components/ViewsColum.js +39 -35
- package/dist/search/components/ViewsColumn.css.js +1 -1
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/components/_shared.css.js +12 -12
- package/dist/search/components/utils.js +1 -4
- package/dist/search/hooks.d.ts +1 -6
- package/dist/search/hooks.js +15 -9
- package/dist/search/searchActor.d.ts +12 -2
- package/dist/search/searchActor.js +60 -4
- package/dist/shadowroot/ShadowRoot.d.ts +5 -2
- package/dist/shadowroot/ShadowRoot.js +25 -22
- package/dist/shadowroot/styles.css.d.ts +0 -2
- package/dist/shadowroot/styles.css.js +4 -36
- package/dist/styles-font.css2.js +1 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/view-bounds.d.ts +3 -2
- package/dist/utils/view-bounds.js +10 -6
- package/dist/utils/xyflow.d.ts +27 -6
- package/dist/utils/xyflow.js +68 -23
- package/package.json +39 -37
- package/panda.buildinfo.json +226 -161
- package/styles-font.css +1 -1
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/bundle/index.js +0 -51974
- package/bundle/package.json +0 -4
- package/dist/editor/__tests__/fixture.d.ts +0 -205
- package/dist/editor/editorActor.d.ts +0 -653
- package/dist/likec4diagram/relationship-popover/styles.css.d.ts +0 -2
- package/dist/likec4diagram/relationship-popover/styles.css.js +0 -28
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
- package/dist/overlays/relationships-browser/custom/styles.css.d.ts +0 -1
- package/dist/overlays/relationships-browser/custom/styles.css.js +0 -14
|
@@ -2,9 +2,9 @@ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
|
2
2
|
import { autoUpdate, computePosition, offset, autoPlacement, size, hide } from '@floating-ui/dom';
|
|
3
3
|
import { nameFromFqn } from '@likec4/core';
|
|
4
4
|
import { cx, css } from '@likec4/styles/css';
|
|
5
|
-
import { VStack,
|
|
5
|
+
import { VStack, HStack, Box, styled } from '@likec4/styles/jsx';
|
|
6
6
|
import { bleed } from '@likec4/styles/patterns';
|
|
7
|
-
import { Divider, ScrollAreaAutosize, Button, TooltipGroup, Tooltip as Tooltip$1
|
|
7
|
+
import { Divider, ScrollAreaAutosize, Button, TooltipGroup, ActionIcon, Text, Tooltip as Tooltip$1 } from '@mantine/core';
|
|
8
8
|
import { useActorRef, useSelector } from '@xstate/react';
|
|
9
9
|
import { shallowEqual } from 'fast-equals';
|
|
10
10
|
import { memo, useEffect, useCallback, useRef, useState, useLayoutEffect, Fragment, forwardRef } from 'react';
|
|
@@ -17,14 +17,14 @@ 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
|
-
import {
|
|
20
|
+
import { Endpoint, RelationshipTitle } from './components.js';
|
|
21
21
|
import { useDiagram } from '../../hooks/safeContext.js';
|
|
22
22
|
import { useRootContainerRef } from '../../context/RootContainerContext.js';
|
|
23
23
|
import { roundDpr } from '../../utils/roundDpr.js';
|
|
24
|
-
import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
25
|
-
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
26
|
-
import IconFileSymlink from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
27
|
-
import IconInfoCircle from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
24
|
+
import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js';
|
|
25
|
+
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
26
|
+
import IconFileSymlink from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
|
|
27
|
+
import IconInfoCircle from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js';
|
|
28
28
|
import { Markdown } from '../../base-primitives/Markdown.js';
|
|
29
29
|
|
|
30
30
|
function selectDiagramContext(c) {
|
|
@@ -158,7 +158,7 @@ const RelationshipPopoverInternal = ({
|
|
|
158
158
|
onMouseLeave
|
|
159
159
|
}) => {
|
|
160
160
|
const ref = useRef(null);
|
|
161
|
-
const { enableNavigateTo, enableVscode
|
|
161
|
+
const { enableNavigateTo, enableVscode } = useEnabledFeatures();
|
|
162
162
|
const { onOpenSource } = useDiagramEventHandlers();
|
|
163
163
|
const containerRef = useRootContainerRef();
|
|
164
164
|
const [referenceEl, setReferenceEl] = useState(null);
|
|
@@ -285,7 +285,6 @@ const RelationshipPopoverInternal = ({
|
|
|
285
285
|
paddingTop: "2"
|
|
286
286
|
},
|
|
287
287
|
children: [
|
|
288
|
-
enableCompareWithLatest && /* @__PURE__ */ jsx(EdgeDrifts, { diagramEdge }),
|
|
289
288
|
/* @__PURE__ */ jsx(
|
|
290
289
|
Button,
|
|
291
290
|
{
|
|
@@ -294,7 +293,7 @@ const RelationshipPopoverInternal = ({
|
|
|
294
293
|
size: "compact-xs",
|
|
295
294
|
style: {
|
|
296
295
|
alignSelf: "flex-start",
|
|
297
|
-
fontWeight:
|
|
296
|
+
fontWeight: "medium",
|
|
298
297
|
["--button-fz"]: "var(--font-sizes-xxs)"
|
|
299
298
|
},
|
|
300
299
|
onClick: (e) => {
|
|
@@ -326,25 +325,6 @@ const RelationshipPopoverInternal = ({
|
|
|
326
325
|
}
|
|
327
326
|
);
|
|
328
327
|
};
|
|
329
|
-
const EdgeDrifts = ({ diagramEdge }) => {
|
|
330
|
-
const drifts = diagramEdge.drifts;
|
|
331
|
-
if (!drifts || drifts.length === 0) {
|
|
332
|
-
return null;
|
|
333
|
-
}
|
|
334
|
-
return /* @__PURE__ */ jsx(
|
|
335
|
-
Notification,
|
|
336
|
-
{
|
|
337
|
-
color: "orange",
|
|
338
|
-
withBorder: false,
|
|
339
|
-
withCloseButton: false,
|
|
340
|
-
title: "Changes:",
|
|
341
|
-
children: drifts.map((drift) => /* @__PURE__ */ jsxs(Text, { mt: 2, size: "sm", lh: "xs", children: [
|
|
342
|
-
"- ",
|
|
343
|
-
drift
|
|
344
|
-
] }, drift))
|
|
345
|
-
}
|
|
346
|
-
);
|
|
347
|
-
};
|
|
348
328
|
const Relationship = forwardRef(({
|
|
349
329
|
viewId,
|
|
350
330
|
relationship: r,
|
|
@@ -363,7 +343,7 @@ const Relationship = forwardRef(({
|
|
|
363
343
|
"div",
|
|
364
344
|
{
|
|
365
345
|
style: {
|
|
366
|
-
fontWeight:
|
|
346
|
+
fontWeight: "bold",
|
|
367
347
|
fontSize: "10px",
|
|
368
348
|
color: "#868e96",
|
|
369
349
|
marginBottom: "2px",
|
|
@@ -390,7 +370,7 @@ const Relationship = forwardRef(({
|
|
|
390
370
|
"span",
|
|
391
371
|
{
|
|
392
372
|
style: {
|
|
393
|
-
fontWeight:
|
|
373
|
+
fontWeight: "bold",
|
|
394
374
|
minWidth: "110px",
|
|
395
375
|
color: "#495057"
|
|
396
376
|
},
|
|
@@ -436,9 +416,9 @@ const Relationship = forwardRef(({
|
|
|
436
416
|
}),
|
|
437
417
|
children: [
|
|
438
418
|
/* @__PURE__ */ jsx(HStack, { gap: "0.5", children: /* @__PURE__ */ jsxs(TooltipGroup, { openDelay: 200, children: [
|
|
439
|
-
/* @__PURE__ */ jsx(Tooltip, { label: sourceId.full, offset: 2, position: "top-start", children: /* @__PURE__ */ jsx(
|
|
419
|
+
/* @__PURE__ */ jsx(Tooltip, { label: sourceId.full, offset: 2, position: "top-start", children: /* @__PURE__ */ jsx(Endpoint, { likec4color: sourceNode.color, children: sourceId.short }) }),
|
|
440
420
|
/* @__PURE__ */ jsx(IconArrowRight, { stroke: 2.5, size: "11px", opacity: 0.65 }),
|
|
441
|
-
/* @__PURE__ */ jsx(Tooltip, { label: targetId.full, offset: 2, position: "top-start", children: /* @__PURE__ */ jsx(
|
|
421
|
+
/* @__PURE__ */ jsx(Tooltip, { label: targetId.full, offset: 2, position: "top-start", children: /* @__PURE__ */ jsx(Endpoint, { likec4color: targetNode.color, children: targetId.short }) }),
|
|
442
422
|
navigateTo && /* @__PURE__ */ jsx(Tooltip, { label: "Open dynamic view", children: /* @__PURE__ */ jsx(
|
|
443
423
|
ActionIcon,
|
|
444
424
|
{
|
|
@@ -472,7 +452,7 @@ const Relationship = forwardRef(({
|
|
|
472
452
|
) })
|
|
473
453
|
] }) }),
|
|
474
454
|
/* @__PURE__ */ jsxs(HStack, { gap: "xs", alignItems: "center", children: [
|
|
475
|
-
/* @__PURE__ */ jsx(
|
|
455
|
+
/* @__PURE__ */ jsx(RelationshipTitle, { children: r.title || "untitled" }),
|
|
476
456
|
metadataTooltipLabel && /* @__PURE__ */ jsx(
|
|
477
457
|
Tooltip,
|
|
478
458
|
{
|
|
@@ -540,10 +520,10 @@ const Label = styled("div", {
|
|
|
540
520
|
base: {
|
|
541
521
|
display: "block",
|
|
542
522
|
fontSize: "xxs",
|
|
543
|
-
fontWeight:
|
|
523
|
+
fontWeight: "medium",
|
|
544
524
|
userSelect: "none",
|
|
545
525
|
lineHeight: "sm",
|
|
546
|
-
color: "
|
|
526
|
+
color: "text.dimmed"
|
|
547
527
|
}
|
|
548
528
|
});
|
|
549
529
|
const Tooltip = Tooltip$1.withProps({
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Color } from '@likec4/core/types';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { StyledComponent } from '@likec4/styles';
|
|
4
|
+
export declare const Endpoint: ({ children, likec4color }: PropsWithChildren<{
|
|
5
|
+
likec4color: Color;
|
|
6
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const RelationshipTitle: StyledComponent<"div", {}>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { styled } from '@likec4/styles/jsx';
|
|
3
|
+
import { txt } from '@likec4/styles/patterns';
|
|
4
|
+
|
|
5
|
+
const Endpoint = ({ children, likec4color }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
"data-likec4-color": likec4color,
|
|
10
|
+
className: txt({
|
|
11
|
+
size: "xxs",
|
|
12
|
+
fontWeight: "medium",
|
|
13
|
+
whiteSpace: "nowrap",
|
|
14
|
+
paddingX: "1",
|
|
15
|
+
paddingY: "0.5",
|
|
16
|
+
rounded: "xs",
|
|
17
|
+
background: {
|
|
18
|
+
_light: "var(--likec4-palette-fill)/90",
|
|
19
|
+
_dark: "var(--likec4-palette-fill)/60"
|
|
20
|
+
},
|
|
21
|
+
color: {
|
|
22
|
+
_light: "var(--likec4-palette-hiContrast)",
|
|
23
|
+
_dark: "var(--likec4-palette-loContrast)"
|
|
24
|
+
}
|
|
25
|
+
}),
|
|
26
|
+
children
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
const RelationshipTitle = styled("div", {
|
|
31
|
+
base: {
|
|
32
|
+
whiteSpaceCollapse: "preserve-breaks",
|
|
33
|
+
fontSize: "sm",
|
|
34
|
+
lineHeight: "sm",
|
|
35
|
+
userSelect: "all"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export { Endpoint, RelationshipTitle };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { DiagramView, DynamicViewDisplayVariant, WhereOperator } from '@likec4/core/types';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
import { ViewPaddings } from '../../LikeC4Diagram.props';
|
|
4
|
-
export declare function DiagramActorProvider({ view, zoomable, pannable, nodesDraggable, nodesSelectable, fitViewPadding, where, children, dynamicViewVariant: _defaultVariant, }: PropsWithChildren<{
|
|
4
|
+
export declare function DiagramActorProvider({ id, view, zoomable, pannable, nodesDraggable, nodesSelectable, fitViewPadding, where, children, dynamicViewVariant: _defaultVariant, }: PropsWithChildren<{
|
|
5
|
+
id: string;
|
|
5
6
|
view: DiagramView;
|
|
6
7
|
zoomable: boolean;
|
|
7
8
|
pannable: boolean;
|
|
8
9
|
nodesDraggable: boolean;
|
|
9
10
|
nodesSelectable: boolean;
|
|
10
11
|
fitViewPadding: ViewPaddings;
|
|
11
|
-
where
|
|
12
|
-
dynamicViewVariant
|
|
12
|
+
where?: WhereOperator | null;
|
|
13
|
+
dynamicViewVariant?: DynamicViewDisplayVariant | undefined;
|
|
13
14
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import { useActorRef, useSelector } from '@xstate/react';
|
|
2
|
+
import { useActorRef } from '@xstate/react';
|
|
4
3
|
import { useStoreApi } from '@xyflow/react';
|
|
5
|
-
import { shallowEqual } from 'fast-equals';
|
|
6
4
|
import { useRef, useState, useEffect, memo } from 'react';
|
|
7
|
-
import {
|
|
5
|
+
import { isNullish } from 'remeda';
|
|
8
6
|
import { ErrorBoundary } from '../../components/ErrorFallback.js';
|
|
9
|
-
import {
|
|
7
|
+
import { useDiagramEventHandlersRef } from '../../context/DiagramEventHandlers.js';
|
|
10
8
|
import { useEnabledFeatures, DiagramFeatures } from '../../context/DiagramFeatures.js';
|
|
11
|
-
import { CurrentViewModelContext } from '../../context/LikeC4ModelContext.js';
|
|
12
9
|
import { useEditorActorLogic } from '../../editor/useEditorActorLogic.js';
|
|
13
10
|
import { DiagramActorContextProvider, DiagramApiContextProvider, useDiagram } from '../../hooks/safeContext.js';
|
|
14
|
-
import { useOnDiagramEvent,
|
|
15
|
-
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
11
|
+
import { useDiagramSnapshot, useOnDiagramEvent, selectDiagramActorContext } from '../../hooks/useDiagram.js';
|
|
16
12
|
import { useUpdateEffect } from '../../hooks/useUpdateEffect.js';
|
|
17
13
|
import { makeDiagramApi } from './diagram-api.js';
|
|
18
14
|
import { diagramMachine } from './machine.js';
|
|
19
15
|
import { DiagramToggledFeaturesPersistence } from './persistence.js';
|
|
20
16
|
|
|
21
17
|
function DiagramActorProvider({
|
|
18
|
+
id,
|
|
22
19
|
view,
|
|
23
20
|
zoomable,
|
|
24
21
|
pannable,
|
|
25
22
|
nodesDraggable,
|
|
26
23
|
nodesSelectable,
|
|
27
24
|
fitViewPadding,
|
|
28
|
-
where,
|
|
25
|
+
where = null,
|
|
29
26
|
children,
|
|
30
27
|
dynamicViewVariant: _defaultVariant
|
|
31
28
|
}) {
|
|
32
29
|
const xystore = useStoreApi();
|
|
33
|
-
const editorActor = useEditorActorLogic(
|
|
30
|
+
const editorActor = useEditorActorLogic();
|
|
31
|
+
const features = useEnabledFeatures();
|
|
34
32
|
const actor = useActorRef(
|
|
35
33
|
diagramMachine.provide({
|
|
36
34
|
actors: {
|
|
@@ -38,7 +36,7 @@ function DiagramActorProvider({
|
|
|
38
36
|
}
|
|
39
37
|
}),
|
|
40
38
|
{
|
|
41
|
-
id: `diagram`,
|
|
39
|
+
id: `diagram-${id}`,
|
|
42
40
|
systemId: "diagram",
|
|
43
41
|
// ...inspector,
|
|
44
42
|
input: {
|
|
@@ -50,6 +48,7 @@ function DiagramActorProvider({
|
|
|
50
48
|
nodesDraggable,
|
|
51
49
|
nodesSelectable,
|
|
52
50
|
where,
|
|
51
|
+
features,
|
|
53
52
|
dynamicViewVariant: _defaultVariant
|
|
54
53
|
}
|
|
55
54
|
}
|
|
@@ -57,10 +56,8 @@ function DiagramActorProvider({
|
|
|
57
56
|
const actorRef = useRef(actor);
|
|
58
57
|
if (actorRef.current !== actor) {
|
|
59
58
|
console.warn("DiagramMachine actor instance changed", {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
current: actor.getSnapshot().context
|
|
63
|
-
}
|
|
59
|
+
previous: actorRef.current.getSnapshot().context,
|
|
60
|
+
current: actor.getSnapshot().context
|
|
64
61
|
});
|
|
65
62
|
actorRef.current = actor;
|
|
66
63
|
}
|
|
@@ -70,42 +67,40 @@ function DiagramActorProvider({
|
|
|
70
67
|
if (api2.ref === actorRef) {
|
|
71
68
|
return api2;
|
|
72
69
|
}
|
|
73
|
-
console.
|
|
70
|
+
console.error(
|
|
74
71
|
"DiagramMachine actorRef changed, creating new DiagramApi instance, this should not happen during the lifetime of the actor"
|
|
75
72
|
);
|
|
76
73
|
return makeDiagramApi(actorRef);
|
|
77
74
|
});
|
|
78
75
|
}, [actorRef]);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
);
|
|
84
|
-
useEffect(
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
actor.send({ type: "update.features", features });
|
|
78
|
+
}, [actor, features]);
|
|
79
|
+
useUpdateEffect(
|
|
85
80
|
() => actor.send({
|
|
86
81
|
type: "update.inputs",
|
|
87
82
|
inputs: { zoomable, where, pannable, fitViewPadding, nodesDraggable, nodesSelectable }
|
|
88
83
|
}),
|
|
89
|
-
[zoomable, where, pannable, fitViewPadding,
|
|
84
|
+
[actor, zoomable, where, pannable, fitViewPadding, nodesDraggable, nodesSelectable]
|
|
90
85
|
);
|
|
91
86
|
useUpdateEffect(() => {
|
|
92
87
|
if (!_defaultVariant) return;
|
|
93
88
|
actor.send({ type: "switch.dynamicViewVariant", variant: _defaultVariant });
|
|
94
|
-
}, [
|
|
95
|
-
|
|
89
|
+
}, [actor, _defaultVariant]);
|
|
90
|
+
useEffect(
|
|
96
91
|
() => actor.send({ type: "update.view", view, source: "external" }),
|
|
97
92
|
[actor, view]
|
|
98
93
|
);
|
|
99
94
|
return /* @__PURE__ */ jsx(DiagramActorContextProvider, { value: actor, children: /* @__PURE__ */ jsxs(DiagramApiContextProvider, { value: api, children: [
|
|
100
|
-
/* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(
|
|
101
|
-
/* @__PURE__ */ jsx(
|
|
95
|
+
/* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(ToggledFeatures, { children }) }),
|
|
96
|
+
/* @__PURE__ */ jsx(PropagateDiagramActorEvents, {})
|
|
102
97
|
] }) });
|
|
103
98
|
}
|
|
104
|
-
const
|
|
99
|
+
const selectToggledFeatures = selectDiagramActorContext((context) => {
|
|
105
100
|
let toggledFeatures = context.toggledFeatures;
|
|
106
101
|
const hasDrifts = context.view.drifts != null && context.view.drifts.length > 0;
|
|
107
|
-
const enableCompareWithLatest = context.features.enableCompareWithLatest && (toggledFeatures.enableCompareWithLatest ?? false) && isNullish(context.activeWalkthrough)
|
|
108
|
-
const enableReadOnly = context.features.enableReadOnly || toggledFeatures.enableReadOnly || !!context.activeWalkthrough ||
|
|
102
|
+
const enableCompareWithLatest = hasDrifts && context.features.enableCompareWithLatest && (toggledFeatures.enableCompareWithLatest ?? false) && isNullish(context.activeWalkthrough);
|
|
103
|
+
const enableReadOnly = context.features.enableReadOnly || toggledFeatures.enableReadOnly || !!context.activeWalkthrough || enableCompareWithLatest && context.view._layout === "auto";
|
|
109
104
|
if (toggledFeatures.enableReadOnly !== enableReadOnly || toggledFeatures.enableCompareWithLatest !== enableCompareWithLatest) {
|
|
110
105
|
toggledFeatures = {
|
|
111
106
|
...toggledFeatures,
|
|
@@ -113,56 +108,34 @@ const selectFromActor = ({ context }) => {
|
|
|
113
108
|
enableReadOnly
|
|
114
109
|
};
|
|
115
110
|
}
|
|
116
|
-
return
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
};
|
|
124
|
-
function CurrentViewModelProvider({ children, actorRef }) {
|
|
125
|
-
const { viewId, toggledFeatures } = useSelector(
|
|
126
|
-
actorRef,
|
|
127
|
-
selectFromActor,
|
|
128
|
-
compareSelected
|
|
129
|
-
);
|
|
130
|
-
const likec4model = useLikeC4Model();
|
|
131
|
-
const viewmodel = likec4model.findView(viewId);
|
|
132
|
-
return /* @__PURE__ */ jsx(CurrentViewModelContext.Provider, { value: viewmodel, children: /* @__PURE__ */ jsx(DiagramFeatures, { overrides: toggledFeatures, children }) });
|
|
111
|
+
return toggledFeatures;
|
|
112
|
+
});
|
|
113
|
+
function ToggledFeatures({ children }) {
|
|
114
|
+
const toggledFeatures = useDiagramSnapshot(selectToggledFeatures);
|
|
115
|
+
useUpdateEffect(() => {
|
|
116
|
+
DiagramToggledFeaturesPersistence.write(toggledFeatures);
|
|
117
|
+
}, [toggledFeatures]);
|
|
118
|
+
return /* @__PURE__ */ jsx(DiagramFeatures, { overrides: toggledFeatures, children });
|
|
133
119
|
}
|
|
134
|
-
const
|
|
120
|
+
const PropagateDiagramActorEvents = memo(() => {
|
|
135
121
|
const diagram = useDiagram();
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
// onChange,
|
|
140
|
-
onLayoutTypeChange,
|
|
141
|
-
handlersRef
|
|
142
|
-
} = useDiagramEventHandlers();
|
|
143
|
-
useOnDiagramEvent("openSource", ({ params }) => onOpenSource?.(params));
|
|
144
|
-
useOnDiagramEvent("navigateTo", ({ viewId }) => onNavigateTo?.(viewId));
|
|
122
|
+
const handlers = useDiagramEventHandlersRef();
|
|
123
|
+
useOnDiagramEvent("openSource", ({ params }) => handlers.current.onOpenSource?.(params));
|
|
124
|
+
useOnDiagramEvent("navigateTo", ({ viewId }) => handlers.current.onNavigateTo?.(viewId));
|
|
145
125
|
useOnDiagramEvent("onLayoutTypeChange", ({ layoutType }) => {
|
|
146
|
-
onLayoutTypeChange?.(layoutType);
|
|
126
|
+
handlers.current.onLayoutTypeChange?.(layoutType);
|
|
147
127
|
});
|
|
148
128
|
useOnDiagramEvent(
|
|
149
129
|
"initialized",
|
|
150
130
|
({ instance: xyflow }) => {
|
|
151
131
|
try {
|
|
152
|
-
|
|
132
|
+
handlers.current.onInitialized?.({ diagram, xyflow });
|
|
153
133
|
} catch (error) {
|
|
154
134
|
console.error(error);
|
|
155
135
|
}
|
|
156
136
|
},
|
|
157
137
|
{ once: true }
|
|
158
138
|
);
|
|
159
|
-
const toggledFeatures = useDiagramContext(
|
|
160
|
-
(ctx) => ctx.toggledFeatures,
|
|
161
|
-
shallowEqual
|
|
162
|
-
);
|
|
163
|
-
useUpdateEffect(() => {
|
|
164
|
-
DiagramToggledFeaturesPersistence.write(omitBy(toggledFeatures, isNullish));
|
|
165
|
-
}, [toggledFeatures]);
|
|
166
139
|
return null;
|
|
167
140
|
});
|
|
168
141
|
|
|
@@ -23,4 +23,4 @@ export declare function focusNodesEdges(context: DiagramContext): {
|
|
|
23
23
|
} | null;
|
|
24
24
|
export declare function updateNodeData({ context, event }: ActionArg): Partial<DiagramContext>;
|
|
25
25
|
export declare function updateEdgeData({ context, event }: ActionArg): Partial<DiagramContext>;
|
|
26
|
-
export declare function resetEdgeControlPoints(nodeLookup: NodeLookup, edge: Types.Edge): [XYPoint
|
|
26
|
+
export declare function resetEdgeControlPoints(nodeLookup: NodeLookup, edge: Types.Edge): [XYPoint, XYPoint];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getNodeDimensions } from '@xyflow/system';
|
|
2
|
-
import { map,
|
|
2
|
+
import { map, hasAtLeast } from 'remeda';
|
|
3
3
|
import { calcViewBounds } from '../../utils/view-bounds.js';
|
|
4
4
|
import { isSamePoint, bezierControlPoints } from '../../utils/xyflow.js';
|
|
5
5
|
|
|
@@ -56,14 +56,26 @@ function createViewChange(parentContext) {
|
|
|
56
56
|
controlPoints = bezierControlPoints(data.points);
|
|
57
57
|
}
|
|
58
58
|
const _updated = {
|
|
59
|
-
...
|
|
59
|
+
...edge,
|
|
60
60
|
points: data.points
|
|
61
61
|
};
|
|
62
62
|
if (data.labelBBox) {
|
|
63
|
-
_updated.labelBBox =
|
|
63
|
+
_updated.labelBBox = {
|
|
64
|
+
x: Math.round(data.labelBBox.x),
|
|
65
|
+
y: Math.round(data.labelBBox.y),
|
|
66
|
+
width: Math.round(data.labelBBox.width),
|
|
67
|
+
height: Math.round(data.labelBBox.height)
|
|
68
|
+
};
|
|
69
|
+
} else {
|
|
70
|
+
_updated.labelBBox = null;
|
|
64
71
|
}
|
|
65
72
|
if (hasAtLeast(controlPoints, 1)) {
|
|
66
|
-
_updated.controlPoints = controlPoints
|
|
73
|
+
_updated.controlPoints = map(controlPoints, (v) => ({
|
|
74
|
+
x: Math.round(v.x),
|
|
75
|
+
y: Math.round(v.y)
|
|
76
|
+
}));
|
|
77
|
+
} else {
|
|
78
|
+
_updated.controlPoints = null;
|
|
67
79
|
}
|
|
68
80
|
return _updated;
|
|
69
81
|
});
|
|
@@ -62,6 +62,17 @@ export interface DiagramApi<A extends Any = Unknown> {
|
|
|
62
62
|
openRelationshipDetails(...params: [edgeId: EdgeId] | [source: Fqn<A>, target: Fqn<A>]): void;
|
|
63
63
|
updateNodeData(nodeId: NodeId, data: PartialDeep<Types.NodeData>): void;
|
|
64
64
|
updateEdgeData(edgeId: EdgeId, data: PartialDeep<Types.EdgeData>): void;
|
|
65
|
+
highlightNode(nodeId: NodeId): void;
|
|
66
|
+
highlightEdge(edgeId: EdgeId): void;
|
|
67
|
+
unhighlightAll(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Center viewport on a given node
|
|
70
|
+
*/
|
|
71
|
+
centerViewportOnNode(target: NodeId): void;
|
|
72
|
+
/**
|
|
73
|
+
* Center viewport on a given edge (centering on edge means including both source and target nodes in view)
|
|
74
|
+
*/
|
|
75
|
+
centerViewportOnEdge(target: EdgeId): void;
|
|
65
76
|
/**
|
|
66
77
|
* Start editing, either node or edge
|
|
67
78
|
*/
|
|
@@ -133,6 +133,21 @@ function makeDiagramApi(actorRef) {
|
|
|
133
133
|
},
|
|
134
134
|
switchDynamicViewVariant: (variant) => {
|
|
135
135
|
actorRef.current.send({ type: "switch.dynamicViewVariant", variant });
|
|
136
|
+
},
|
|
137
|
+
highlightNode: (nodeId) => {
|
|
138
|
+
actorRef.current.send({ type: "highlight.node", nodeId });
|
|
139
|
+
},
|
|
140
|
+
highlightEdge: (edgeId) => {
|
|
141
|
+
actorRef.current.send({ type: "highlight.edge", edgeId });
|
|
142
|
+
},
|
|
143
|
+
unhighlightAll: () => {
|
|
144
|
+
actorRef.current.send({ type: "unhighlight.all" });
|
|
145
|
+
},
|
|
146
|
+
centerViewportOnNode: (nodeId) => {
|
|
147
|
+
actorRef.current.send({ type: "xyflow.centerViewport", nodeId });
|
|
148
|
+
},
|
|
149
|
+
centerViewportOnEdge: (edgeId) => {
|
|
150
|
+
actorRef.current.send({ type: "xyflow.centerViewport", edgeId });
|
|
136
151
|
}
|
|
137
152
|
};
|
|
138
153
|
}
|