@likec4/diagram 1.58.0 → 1.59.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/dist/LikeC4Diagram.js +1 -1
- package/dist/LikeC4Diagram.props.d.ts +1 -1
- package/dist/LikeC4Styles.js +1 -1
- package/dist/LikeC4View.js +2 -2
- package/dist/ReactLikeC4.d.ts +1 -1
- package/dist/base/Base.d.ts +3 -2
- package/dist/base/Base.js +14 -26
- package/dist/base/BaseXYFlow.d.ts +2 -1
- package/dist/base/BaseXYFlow.js +63 -4
- package/dist/base/keyboardZoom.d.ts +3 -0
- package/dist/base/keyboardZoom.js +20 -0
- package/dist/base/updateEdges.js +7 -16
- package/dist/base/updateNodes.js +3 -9
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +2 -1
- package/dist/base-primitives/compound/CompoundActionButton.js +5 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +2 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +5 -2
- package/dist/base-primitives/compound/CompoundTitle.d.ts +7 -1
- package/dist/base-primitives/compound/CompoundTitle.js +2 -1
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +2 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +2 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +4 -2
- package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -0
- package/dist/base-primitives/edge/EdgeLabel.js +2 -5
- package/dist/base-primitives/element/ElementActionButtons.d.ts +1 -0
- package/dist/base-primitives/element/ElementActionButtons.js +4 -1
- package/dist/base-primitives/element/ElementData.d.ts +3 -1
- package/dist/base-primitives/element/ElementData.js +2 -1
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +2 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +5 -2
- package/dist/base-primitives/element/ElementNodeContainer.js +1 -1
- package/dist/base-primitives/element/ElementShape.js +3 -0
- package/dist/components/ErrorFallback.js +3 -5
- package/dist/components/Link.js +6 -6
- package/dist/components/NavigationPanel.js +1 -1
- package/dist/components/SearchControl.css.js +11 -11
- package/dist/context/TagStylesContext.d.ts +3 -3
- package/dist/context/TagStylesContext.js +16 -16
- package/dist/custom/index.d.ts +1 -0
- package/dist/custom/index.js +3 -2
- package/dist/editor/actor/actions.js +1 -1
- package/dist/editor/actor/machine.d.ts +4 -6
- package/dist/editor/actor/setup.d.ts +16 -2
- package/dist/editor/actor/setup.js +5 -4
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/safeContext.d.ts +156 -3
- package/dist/hooks/safeContext.js +60 -12
- package/dist/hooks/useCurrentViewModel.js +1 -1
- package/dist/hooks/useDiagram.d.ts +8 -0
- package/dist/hooks/useDiagram.js +9 -2
- package/dist/hooks/useEditorActor.js +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.js +1 -1
- package/dist/hooks/useXYFlow.d.ts +1 -0
- package/dist/hooks/useXYFlow.js +5 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/likec4diagram/DiagramUI.js +19 -6
- package/dist/likec4diagram/DiagramXYFlow.js +39 -14
- package/dist/likec4diagram/convert-to-xyflow.d.ts +3 -5
- package/dist/likec4diagram/convert-to-xyflow.js +29 -10
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +13 -4
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +11 -4
- package/dist/likec4diagram/custom/edges/edges.css.js +1 -1
- package/dist/likec4diagram/custom/index.d.ts +2 -1
- package/dist/likec4diagram/custom/index.js +5 -3
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +1 -0
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +13 -3
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +0 -4
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +32 -19
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.d.ts +2 -0
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +234 -0
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.js +20 -5
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -14
- package/dist/likec4diagram/relationship-popover/components.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.js +11 -20
- package/dist/likec4diagram/state/aligners.js +1 -1
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/assign.js +1 -1
- package/dist/likec4diagram/state/createViewChange.js +1 -1
- package/dist/likec4diagram/state/diagram-api.d.ts +18 -10
- package/dist/likec4diagram/state/diagram-api.js +333 -229
- package/dist/likec4diagram/state/machine.actions.d.ts +1026 -332
- package/dist/likec4diagram/state/machine.actions.js +115 -44
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +123 -51
- package/dist/likec4diagram/state/machine.actions.layout.js +40 -33
- package/dist/likec4diagram/state/machine.d.ts +154 -16
- package/dist/likec4diagram/state/machine.js +5 -41
- package/dist/likec4diagram/state/machine.setup.d.ts +84 -19
- package/dist/likec4diagram/state/machine.setup.js +65 -12
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +59 -33
- package/dist/likec4diagram/state/machine.state.navigating.js +7 -3
- package/dist/likec4diagram/state/machine.state.ready.d.ts +1540 -476
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +294 -53
- package/dist/likec4diagram/state/machine.state.ready.focused.js +3 -3
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +264 -73
- package/dist/likec4diagram/state/machine.state.ready.idle.js +31 -6
- package/dist/likec4diagram/state/machine.state.ready.js +22 -16
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +23 -9
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +288 -84
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +135 -66
- package/dist/likec4diagram/state/types.d.ts +4 -2
- package/dist/likec4diagram/state/utils.d.ts +7 -0
- package/dist/likec4diagram/state/utils.js +36 -34
- package/dist/likec4diagram/types.d.ts +47 -3
- package/dist/likec4diagram/ui/FloatingSequenceActors.d.ts +6 -0
- package/dist/likec4diagram/ui/FloatingSequenceActors.js +155 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +2 -2
- package/dist/likec4diagram/ui/index.d.ts +2 -0
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -5
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +2 -0
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +519 -0
- package/dist/likec4diagram/ui/sequence-outline/state.d.ts +36 -0
- package/dist/likec4diagram/ui/sequence-outline/state.js +55 -0
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +1 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +112 -60
- package/dist/likec4diagram/xyflow-sequence/_types.d.ts +55 -5
- package/dist/likec4diagram/xyflow-sequence/const.d.ts +5 -5
- package/dist/likec4diagram/xyflow-sequence/const.js +4 -4
- package/dist/likec4diagram/xyflow-sequence/layouter.d.ts +30 -6
- package/dist/likec4diagram/xyflow-sequence/layouter.js +561 -0
- package/dist/likec4diagram/xyflow-sequence/{sequence-layout.d.ts → sequence-view-to-xy.d.ts} +8 -2
- package/dist/likec4diagram/xyflow-sequence/{sequence-layout.js → sequence-view-to-xy.js} +111 -14
- package/dist/likec4diagram/xyflow-sequence/sequence-view.d.ts +2 -7
- package/dist/likec4diagram/xyflow-sequence/sequence-view.js +144 -0
- package/dist/likec4diagram/xyflow-sequence/utils.d.ts +9 -1
- package/dist/likec4diagram/xyflow-sequence/utils.js +96 -0
- package/dist/navigationpanel/NavigationPanel.d.ts +5 -2
- package/dist/navigationpanel/NavigationPanel.js +58 -59
- package/dist/navigationpanel/NavigationPanelDropdown.js +45 -38
- package/dist/navigationpanel/_common.js +2 -2
- package/dist/navigationpanel/actor.actions.d.ts +19 -0
- package/dist/navigationpanel/actor.actions.js +45 -0
- package/dist/navigationpanel/actor.d.ts +34 -96
- package/dist/navigationpanel/actor.js +21 -84
- package/dist/navigationpanel/actor.setup.d.ts +98 -0
- package/dist/navigationpanel/actor.setup.js +31 -0
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +4 -5
- package/dist/navigationpanel/controls/DetailsControls.js +7 -8
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/styles.js +8 -8
- package/dist/navigationpanel/hooks.d.ts +20 -5
- package/dist/navigationpanel/hooks.js +4 -18
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +2 -2
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +4 -4
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +23 -25
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +5 -5
- package/dist/overlays/Overlays.d.ts +4 -2
- package/dist/overlays/Overlays.js +10 -10
- package/dist/overlays/element-details/ElementDetailsCard.css.js +17 -17
- package/dist/overlays/element-details/MetadataValue.js +15 -15
- package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -5
- package/dist/overlays/element-details/TabPanelRelationships.css.js +11 -11
- package/dist/overlays/element-details/TabPanelRelationships.js +1 -1
- package/dist/overlays/element-details/TabPanelStructure.css.js +2 -2
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +2 -3
- package/dist/overlays/hooks.d.ts +28 -0
- package/dist/overlays/hooks.js +5 -0
- package/dist/overlays/overlay/Overlay.js +34 -25
- package/dist/overlays/overlaysActor.js +0 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
- package/dist/overlays/relationships-browser/actor.js +79 -78
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationships-browser/hooks.js +1 -1
- package/dist/overlays/relationships-browser/layout.js +2 -2
- package/dist/projects-overview/actor.js +4 -4
- package/dist/search/Search.js +1 -1
- package/dist/search/components/ElementsColumn.css.js +2 -2
- package/dist/search/components/ViewsColum.js +1 -1
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/components/_shared.css.js +23 -23
- package/dist/search/components/styles.css.js +4 -4
- package/dist/shadowroot/ShadowRoot.d.ts +1 -1
- package/dist/shadowroot/ShadowRoot.js +76 -28
- package/dist/styles2.js +1 -1
- package/dist/utils/defineActors.d.ts +21 -0
- package/dist/utils/defineActors.js +13 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +5 -4
- package/dist/utils/readableText.d.ts +11 -0
- package/dist/utils/readableText.js +18 -0
- package/package.json +18 -30
- package/panda.buildinfo.json +267 -288
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/adhoc-editor/package.json +0 -4
- package/dist/adhoc-editor/EditorPanel.d.ts +0 -1
- package/dist/adhoc-editor/EditorPanel.js +0 -106
- package/dist/adhoc-editor/ElementsTree.d.ts +0 -2
- package/dist/adhoc-editor/ElementsTree.js +0 -112
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +0 -4
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +0 -83
- package/dist/adhoc-editor/components/Tree.d.ts +0 -48
- package/dist/adhoc-editor/components/Tree.js +0 -213
- package/dist/adhoc-editor/hooks.d.ts +0 -14
- package/dist/adhoc-editor/hooks.js +0 -34
- package/dist/adhoc-editor/index.d.ts +0 -2
- package/dist/adhoc-editor/index.js +0 -2
- package/dist/adhoc-editor/state/ActorProvider.d.ts +0 -5
- package/dist/adhoc-editor/state/ActorProvider.js +0 -37
- package/dist/adhoc-editor/state/actor.d.ts +0 -13
- package/dist/adhoc-editor/state/actor.editor.d.ts +0 -56
- package/dist/adhoc-editor/state/actor.editor.js +0 -167
- package/dist/adhoc-editor/state/actor.js +0 -14
- package/dist/adhoc-editor/state/actor.layouter.d.ts +0 -51
- package/dist/adhoc-editor/state/actor.layouter.js +0 -54
- package/dist/adhoc-editor/state/actor.types.d.ts +0 -63
- package/dist/adhoc-editor/state/actor.types.js +0 -25
- package/dist/adhoc-editor/state/panel.d.ts +0 -95
- package/dist/adhoc-editor/state/panel.js +0 -124
- package/dist/adhoc-editor/state/utils.d.ts +0 -17
- package/dist/adhoc-editor/state/utils.js +0 -25
- package/dist/adhoc-editor/useElementsTree.d.ts +0 -18
- package/dist/adhoc-editor/useElementsTree.js +0 -98
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +0 -6
- package/dist/context/ShadowRootContext.d.ts +0 -3
- package/dist/context/ShadowRootContext.js +0 -5
- package/dist/shadowroot/styles.d.ts +0 -13
- package/dist/shadowroot/styles.js +0 -60
|
@@ -26,7 +26,7 @@ type WithExtraButtons = {
|
|
|
26
26
|
};
|
|
27
27
|
export type ElementActionsProps = SimplifyDeep<{
|
|
28
28
|
selected?: boolean;
|
|
29
|
-
data: Pick<Types.ElementNodeData, 'id' | 'modelFqn' | 'navigateTo'> & BaseNodeData;
|
|
29
|
+
data: Pick<Types.ElementNodeData, 'id' | 'modelFqn' | 'navigateTo' | 'title'> & BaseNodeData;
|
|
30
30
|
}> & WithExtraButtons;
|
|
31
31
|
/**
|
|
32
32
|
* Center-Bottom action bar, includes zoom-in and browse relationships actions, if the features are enabled.
|
|
@@ -56,7 +56,7 @@ export type ElementActionsProps = SimplifyDeep<{
|
|
|
56
56
|
export declare function ElementActions({ extraButtons, ...props }: ElementActionsProps): import("react").JSX.Element;
|
|
57
57
|
export type DeploymentElementActionsProps = SimplifyDeep<{
|
|
58
58
|
selected?: boolean;
|
|
59
|
-
data: Pick<Types.DeploymentElementNodeData, 'id' | 'modelFqn' | 'navigateTo'> & BaseNodeData;
|
|
59
|
+
data: Pick<Types.DeploymentElementNodeData, 'id' | 'modelFqn' | 'navigateTo' | 'title'> & BaseNodeData;
|
|
60
60
|
}> & WithExtraButtons;
|
|
61
61
|
/**
|
|
62
62
|
* Center-Bottom action bar, includes zoom-in and browse relationships actions, if the features are enabled.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { useEnabledFeatures } from "../../../context/DiagramFeatures.js";
|
|
3
3
|
import { useDiagram } from "../../../hooks/safeContext.js";
|
|
4
|
+
import { readableText } from "../../../utils/readableText.js";
|
|
4
5
|
import { ElementActionButtons } from "../../../base-primitives/element/ElementActionButtons.js";
|
|
5
6
|
import { IconTransform, IconZoomScan } from "@tabler/icons-react";
|
|
6
7
|
import { useMemo } from "react";
|
|
@@ -35,11 +36,13 @@ import { hasAtLeast } from "remeda";
|
|
|
35
36
|
function ElementActions({ extraButtons, ...props }) {
|
|
36
37
|
const { enableNavigateTo, enableRelationshipBrowser } = useEnabledFeatures();
|
|
37
38
|
const diagram = useDiagram();
|
|
38
|
-
const { id, navigateTo, modelFqn } = props.data;
|
|
39
|
+
const { id, navigateTo, modelFqn, title } = props.data;
|
|
39
40
|
let buttons = useMemo(() => {
|
|
40
41
|
const buttons = [];
|
|
42
|
+
const labelTitle = readableText(title) || id;
|
|
41
43
|
if (navigateTo && enableNavigateTo) buttons.push({
|
|
42
44
|
key: "navigate",
|
|
45
|
+
ariaLabel: "Navigate to view",
|
|
43
46
|
icon: /* @__PURE__ */ jsx(IconZoomScan, {}),
|
|
44
47
|
onClick: (e) => {
|
|
45
48
|
e.stopPropagation();
|
|
@@ -48,6 +51,7 @@ function ElementActions({ extraButtons, ...props }) {
|
|
|
48
51
|
});
|
|
49
52
|
if (enableRelationshipBrowser) buttons.push({
|
|
50
53
|
key: "relationships",
|
|
54
|
+
ariaLabel: `Browse ${labelTitle} relationships`,
|
|
51
55
|
icon: /* @__PURE__ */ jsx(IconTransform, {}),
|
|
52
56
|
onClick: (e) => {
|
|
53
57
|
e.stopPropagation();
|
|
@@ -61,6 +65,7 @@ function ElementActions({ extraButtons, ...props }) {
|
|
|
61
65
|
modelFqn,
|
|
62
66
|
navigateTo,
|
|
63
67
|
id,
|
|
68
|
+
title,
|
|
64
69
|
diagram
|
|
65
70
|
]);
|
|
66
71
|
if (extraButtons && hasAtLeast(extraButtons, 1)) buttons = [...buttons, ...extraButtons];
|
|
@@ -97,11 +102,13 @@ function ElementActions({ extraButtons, ...props }) {
|
|
|
97
102
|
var DeploymentElementActions = ({ extraButtons, ...props }) => {
|
|
98
103
|
const { enableNavigateTo, enableRelationshipBrowser } = useEnabledFeatures();
|
|
99
104
|
const diagram = useDiagram();
|
|
100
|
-
const { id, navigateTo, modelFqn } = props.data;
|
|
105
|
+
const { id, navigateTo, modelFqn, title } = props.data;
|
|
101
106
|
let buttons = useMemo(() => {
|
|
102
107
|
const buttons = [];
|
|
108
|
+
const labelTitle = readableText(title) || id;
|
|
103
109
|
if (navigateTo && enableNavigateTo) buttons.push({
|
|
104
110
|
key: "navigate",
|
|
111
|
+
ariaLabel: "Navigate to view",
|
|
105
112
|
icon: /* @__PURE__ */ jsx(IconZoomScan, {}),
|
|
106
113
|
onClick: (e) => {
|
|
107
114
|
e.stopPropagation();
|
|
@@ -110,6 +117,7 @@ var DeploymentElementActions = ({ extraButtons, ...props }) => {
|
|
|
110
117
|
});
|
|
111
118
|
if (enableRelationshipBrowser && !!modelFqn) buttons.push({
|
|
112
119
|
key: "relationships",
|
|
120
|
+
ariaLabel: `Browse ${labelTitle} relationships`,
|
|
113
121
|
icon: /* @__PURE__ */ jsx(IconTransform, {}),
|
|
114
122
|
onClick: (e) => {
|
|
115
123
|
e.stopPropagation();
|
|
@@ -122,7 +130,9 @@ var DeploymentElementActions = ({ extraButtons, ...props }) => {
|
|
|
122
130
|
enableRelationshipBrowser,
|
|
123
131
|
modelFqn,
|
|
124
132
|
navigateTo,
|
|
125
|
-
id
|
|
133
|
+
id,
|
|
134
|
+
title,
|
|
135
|
+
diagram
|
|
126
136
|
]);
|
|
127
137
|
if (extraButtons && hasAtLeast(extraButtons, 1)) buttons = [...buttons, ...extraButtons];
|
|
128
138
|
return /* @__PURE__ */ jsx(ElementActionButtons, {
|
|
@@ -31,10 +31,6 @@ function NodeNotesInternal({ data }) {
|
|
|
31
31
|
min: 250,
|
|
32
32
|
max: 500
|
|
33
33
|
});
|
|
34
|
-
clamp(data.height ?? 0, {
|
|
35
|
-
min: 200,
|
|
36
|
-
max: 600
|
|
37
|
-
});
|
|
38
34
|
const [expanded, handlers] = useDisclosure(false, {});
|
|
39
35
|
const id = stringHash(data.id + (markdown.md ?? markdown.txt));
|
|
40
36
|
const onClickCapture = useCallbackRef$1((e) => {
|
|
@@ -12,6 +12,7 @@ import { css } from "@likec4/styles/css";
|
|
|
12
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { Handle, Position } from "@xyflow/react";
|
|
14
14
|
import { isTruthy } from "remeda";
|
|
15
|
+
import { m } from "motion/react";
|
|
15
16
|
import { Box } from "@likec4/styles/jsx";
|
|
16
17
|
//#region src/likec4diagram/custom/nodes/SequenceActorNode.tsx
|
|
17
18
|
var positionMap = {
|
|
@@ -20,26 +21,37 @@ var positionMap = {
|
|
|
20
21
|
top: Position.Top,
|
|
21
22
|
bottom: Position.Bottom
|
|
22
23
|
};
|
|
23
|
-
var ActorStepPort = ({ data, port: p }) => {
|
|
24
|
-
|
|
24
|
+
var ActorStepPort = ({ nodeProps: { selected, data }, port: p }) => {
|
|
25
|
+
let scaleX = 1;
|
|
26
|
+
let scaleY = 1;
|
|
27
|
+
if (data.hovered || selected) {
|
|
28
|
+
scaleX = 1.8;
|
|
29
|
+
scaleY = 1.1;
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(m.div, {
|
|
25
32
|
"data-likec4-color": data.color,
|
|
26
33
|
className: css({
|
|
27
34
|
position: "absolute",
|
|
28
35
|
backgroundColor: "var(--likec4-palette-fill)",
|
|
29
|
-
rounded: "xs"
|
|
30
|
-
width: {
|
|
31
|
-
base: "5px",
|
|
32
|
-
_whenHovered: "7px",
|
|
33
|
-
_whenSelected: "7px"
|
|
34
|
-
},
|
|
35
|
-
transition: "fast",
|
|
36
|
-
translateX: "-1/2",
|
|
37
|
-
translateY: "-1/2",
|
|
38
|
-
translate: "auto"
|
|
36
|
+
rounded: "xs"
|
|
39
37
|
}),
|
|
38
|
+
initial: false,
|
|
39
|
+
animate: {
|
|
40
|
+
scaleX,
|
|
41
|
+
scaleY
|
|
42
|
+
},
|
|
43
|
+
transition: {
|
|
44
|
+
type: "spring",
|
|
45
|
+
stiffness: 400,
|
|
46
|
+
damping: 30
|
|
47
|
+
},
|
|
40
48
|
style: {
|
|
49
|
+
x: "-50%",
|
|
50
|
+
y: "-50%",
|
|
41
51
|
top: p.cy,
|
|
42
52
|
left: p.cx,
|
|
53
|
+
width: 5,
|
|
54
|
+
visibility: p.hidden ? "hidden" : "visible",
|
|
43
55
|
height: p.height
|
|
44
56
|
}
|
|
45
57
|
}), /* @__PURE__ */ jsx(Handle, {
|
|
@@ -73,16 +85,15 @@ function SequenceActorNode(props) {
|
|
|
73
85
|
pointerEvents: "none",
|
|
74
86
|
transition: "fast",
|
|
75
87
|
translateX: "-1/2",
|
|
76
|
-
translate: "auto"
|
|
88
|
+
translate: "auto",
|
|
89
|
+
zIndex: "z-0"
|
|
77
90
|
}),
|
|
78
91
|
style: {
|
|
79
92
|
backgroundColor: "var(--likec4-palette-stroke)",
|
|
80
93
|
opacity: isHovered ? .6 : .4,
|
|
81
94
|
left: "50%",
|
|
82
95
|
width: isHovered ? 3 : 2,
|
|
83
|
-
height: viewHeight - positionAbsoluteY
|
|
84
|
-
zIndex: -1,
|
|
85
|
-
pointerEvents: "none"
|
|
96
|
+
height: viewHeight - positionAbsoluteY
|
|
86
97
|
}
|
|
87
98
|
}),
|
|
88
99
|
/* @__PURE__ */ jsxs(ElementNodeContainer, {
|
|
@@ -90,7 +101,10 @@ function SequenceActorNode(props) {
|
|
|
90
101
|
children: [
|
|
91
102
|
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
92
103
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
93
|
-
/* @__PURE__ */ jsx(ElementData, {
|
|
104
|
+
/* @__PURE__ */ jsx(ElementData, {
|
|
105
|
+
...props,
|
|
106
|
+
"aria-hidden": true
|
|
107
|
+
}),
|
|
94
108
|
hasModelFqn(props) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
95
109
|
/* @__PURE__ */ jsx(ElementActions, { ...props }),
|
|
96
110
|
enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, {
|
|
@@ -104,7 +118,7 @@ function SequenceActorNode(props) {
|
|
|
104
118
|
}),
|
|
105
119
|
ports.map((p) => /* @__PURE__ */ jsx(ActorStepPort, {
|
|
106
120
|
port: p,
|
|
107
|
-
|
|
121
|
+
nodeProps: props
|
|
108
122
|
}, p.id))
|
|
109
123
|
] });
|
|
110
124
|
}
|
|
@@ -116,7 +130,6 @@ function SequenceParallelArea(props) {
|
|
|
116
130
|
height: "100%",
|
|
117
131
|
border: "default",
|
|
118
132
|
rounded: "sm",
|
|
119
|
-
borderWidth: 1,
|
|
120
133
|
"--_color": {
|
|
121
134
|
base: "var(--likec4-palette-stroke)",
|
|
122
135
|
_dark: "[color-mix(in oklab, var(--likec4-palette-hiContrast) 40%, var(--likec4-palette-fill))]"
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { useDiagram } from "../../../hooks/safeContext.js";
|
|
3
|
+
import { css, cx, sva } from "@likec4/styles/css";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import "@likec4/core";
|
|
6
|
+
import { hstack } from "@likec4/styles/patterns";
|
|
7
|
+
//#region src/likec4diagram/custom/nodes/SequenceSubFlow.tsx
|
|
8
|
+
var labelStyle = css.raw({
|
|
9
|
+
color: "colorPalette.text",
|
|
10
|
+
fontSize: "[9px]",
|
|
11
|
+
fontWeight: "bold",
|
|
12
|
+
lineHeight: "xs",
|
|
13
|
+
letterSpacing: "tight",
|
|
14
|
+
textTransform: "uppercase"
|
|
15
|
+
});
|
|
16
|
+
var withBorder = css.raw({ border: "{borderWidths.2} solid {colors.colorPalette.border}" });
|
|
17
|
+
var withBackground = css.raw({
|
|
18
|
+
background: "colorPalette",
|
|
19
|
+
["&[data-state=\"hovered\"]"]: {
|
|
20
|
+
background: "colorPalette.hovered",
|
|
21
|
+
transition: "faster",
|
|
22
|
+
transitionDelay: "faster",
|
|
23
|
+
transitionTimingFunction: "out",
|
|
24
|
+
transitionProperty: "background"
|
|
25
|
+
},
|
|
26
|
+
["&[data-state=\"collapsed\"]"]: { background: "colorPalette.label" }
|
|
27
|
+
});
|
|
28
|
+
var recipe = sva({
|
|
29
|
+
slots: [
|
|
30
|
+
"root",
|
|
31
|
+
"content",
|
|
32
|
+
"label",
|
|
33
|
+
"title"
|
|
34
|
+
],
|
|
35
|
+
base: {
|
|
36
|
+
root: css.raw({
|
|
37
|
+
width: "100%",
|
|
38
|
+
height: "100%",
|
|
39
|
+
padding: "0"
|
|
40
|
+
}),
|
|
41
|
+
content: hstack.raw({
|
|
42
|
+
gap: "2",
|
|
43
|
+
width: "100%",
|
|
44
|
+
alignItems: "center"
|
|
45
|
+
}),
|
|
46
|
+
label: css.raw(labelStyle),
|
|
47
|
+
title: css.raw({
|
|
48
|
+
flex: "1",
|
|
49
|
+
color: `[oklch(from {colors.colorPalette.text} l calc(c - 0.15) h)]`,
|
|
50
|
+
fontSize: "xs",
|
|
51
|
+
lineHeight: "xxs",
|
|
52
|
+
fontWeight: "medium",
|
|
53
|
+
truncate: true
|
|
54
|
+
})
|
|
55
|
+
},
|
|
56
|
+
variants: { variant: {
|
|
57
|
+
subflow: {
|
|
58
|
+
root: css.raw(withBackground, withBorder, { rounded: "md" }),
|
|
59
|
+
label: css.raw(withBorder, {
|
|
60
|
+
alignSelf: "stretch",
|
|
61
|
+
paddingInline: "2",
|
|
62
|
+
paddingBlock: "1",
|
|
63
|
+
background: "colorPalette.label",
|
|
64
|
+
width: "max-content",
|
|
65
|
+
borderTopLeftRadius: "sm",
|
|
66
|
+
borderBottomRightRadius: "sm",
|
|
67
|
+
borderTop: "none",
|
|
68
|
+
borderLeft: "none",
|
|
69
|
+
[":is([data-state=\"collapsed\"]) &"]: {
|
|
70
|
+
background: "none",
|
|
71
|
+
borderColor: "transparent"
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
},
|
|
75
|
+
branch: {
|
|
76
|
+
root: css.raw(withBackground, withBorder, {
|
|
77
|
+
rounded: "0",
|
|
78
|
+
borderTopWidth: "1",
|
|
79
|
+
["&[data-is-last=\"true\"]"]: {
|
|
80
|
+
borderBottomLeftRadius: "md",
|
|
81
|
+
borderBottomRightRadius: "md"
|
|
82
|
+
},
|
|
83
|
+
["&:not([data-is-last=\"true\"])"]: { borderBottomWidth: "1" },
|
|
84
|
+
["&[data-state=\"collapsed\"]"]: { background: "colorPalette.header" }
|
|
85
|
+
}),
|
|
86
|
+
label: css.raw({
|
|
87
|
+
position: "relative",
|
|
88
|
+
background: "colorPalette.label",
|
|
89
|
+
paddingLeft: "4.5",
|
|
90
|
+
paddingRight: "2",
|
|
91
|
+
paddingBlock: "1",
|
|
92
|
+
marginBlock: "2",
|
|
93
|
+
marginInlineStart: "2",
|
|
94
|
+
rounded: "sm",
|
|
95
|
+
minWidth: "[40px]",
|
|
96
|
+
width: "min-content",
|
|
97
|
+
textAlign: "center",
|
|
98
|
+
_before: {
|
|
99
|
+
position: "absolute",
|
|
100
|
+
content: "\" \"",
|
|
101
|
+
background: "currentColor",
|
|
102
|
+
width: "[5px]",
|
|
103
|
+
height: "[5px]",
|
|
104
|
+
opacity: "[.6]",
|
|
105
|
+
rounded: "pill",
|
|
106
|
+
top: "[50%]",
|
|
107
|
+
left: "2",
|
|
108
|
+
transform: "translateY(-50%)"
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
},
|
|
112
|
+
withbranches: { content: css.raw(withBorder, {
|
|
113
|
+
width: "100%",
|
|
114
|
+
borderTopLeftRadius: "md",
|
|
115
|
+
borderTopRightRadius: "md",
|
|
116
|
+
paddingInline: "2",
|
|
117
|
+
borderBottomWidth: "1",
|
|
118
|
+
background: "colorPalette.header"
|
|
119
|
+
}) }
|
|
120
|
+
} },
|
|
121
|
+
defaultVariants: { variant: "subflow" },
|
|
122
|
+
className: "seq-subflow"
|
|
123
|
+
});
|
|
124
|
+
/**
|
|
125
|
+
* PandaCSS `colorPalette` classes for each sub-flow palette.
|
|
126
|
+
* Declared as literals so the static analyzer can extract them.
|
|
127
|
+
*/
|
|
128
|
+
var palette = {
|
|
129
|
+
loop: css({ colorPalette: "subflow.loop" }),
|
|
130
|
+
opt: css({ colorPalette: "subflow.opt" }),
|
|
131
|
+
par: css({ colorPalette: "subflow.par" }),
|
|
132
|
+
break: css({ colorPalette: "subflow.break" }),
|
|
133
|
+
alt: css({ colorPalette: "subflow.alt" }),
|
|
134
|
+
try: css({ colorPalette: "subflow.try" })
|
|
135
|
+
};
|
|
136
|
+
var flowPresentation = {
|
|
137
|
+
loop: {
|
|
138
|
+
paletteClass: palette.loop,
|
|
139
|
+
variant: "subflow",
|
|
140
|
+
label: "loop"
|
|
141
|
+
},
|
|
142
|
+
opt: {
|
|
143
|
+
paletteClass: palette.opt,
|
|
144
|
+
variant: "subflow",
|
|
145
|
+
label: "opt"
|
|
146
|
+
},
|
|
147
|
+
par: {
|
|
148
|
+
paletteClass: palette.par,
|
|
149
|
+
variant: "subflow",
|
|
150
|
+
label: "par"
|
|
151
|
+
},
|
|
152
|
+
break: {
|
|
153
|
+
paletteClass: palette.break,
|
|
154
|
+
variant: "subflow",
|
|
155
|
+
label: "break"
|
|
156
|
+
},
|
|
157
|
+
alt: {
|
|
158
|
+
paletteClass: palette.alt,
|
|
159
|
+
variant: "withbranches",
|
|
160
|
+
label: "alt"
|
|
161
|
+
},
|
|
162
|
+
"alt-when": {
|
|
163
|
+
paletteClass: palette.alt,
|
|
164
|
+
variant: "branch",
|
|
165
|
+
label: "when"
|
|
166
|
+
},
|
|
167
|
+
"alt-else": {
|
|
168
|
+
paletteClass: palette.alt,
|
|
169
|
+
variant: "branch",
|
|
170
|
+
label: "else"
|
|
171
|
+
},
|
|
172
|
+
"alt-if": {
|
|
173
|
+
paletteClass: palette.alt,
|
|
174
|
+
variant: "branch",
|
|
175
|
+
label: "if"
|
|
176
|
+
},
|
|
177
|
+
try: {
|
|
178
|
+
paletteClass: palette.try,
|
|
179
|
+
variant: "withbranches",
|
|
180
|
+
label: "try"
|
|
181
|
+
},
|
|
182
|
+
"try-block": {
|
|
183
|
+
paletteClass: palette.try,
|
|
184
|
+
variant: "branch",
|
|
185
|
+
label: "block"
|
|
186
|
+
},
|
|
187
|
+
"try-catch": {
|
|
188
|
+
paletteClass: palette.break,
|
|
189
|
+
variant: "branch",
|
|
190
|
+
label: "catch"
|
|
191
|
+
},
|
|
192
|
+
"try-finally": {
|
|
193
|
+
paletteClass: palette.break,
|
|
194
|
+
variant: "branch",
|
|
195
|
+
label: "finally"
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
function SequenceSubflowArea(props) {
|
|
199
|
+
const { data } = props;
|
|
200
|
+
const isDimmed = data.dimmed ?? false;
|
|
201
|
+
const diagram = useDiagram();
|
|
202
|
+
const toggleSequenceFlow = (event) => {
|
|
203
|
+
event.stopPropagation();
|
|
204
|
+
diagram.toggleSequenceFlow(data.flowId);
|
|
205
|
+
};
|
|
206
|
+
const { paletteClass, variant, label } = flowPresentation[data.flowType];
|
|
207
|
+
const classes = recipe({ variant });
|
|
208
|
+
const headerHeight = data.flowType === "alt" || data.flowType === "try" ? data.headerHeight : void 0;
|
|
209
|
+
let state = void 0;
|
|
210
|
+
if (data.collapsed === true) state = "collapsed";
|
|
211
|
+
else if (data.hovered) state = "hovered";
|
|
212
|
+
return /* @__PURE__ */ jsx("div", {
|
|
213
|
+
className: cx(classes.root, paletteClass),
|
|
214
|
+
"data-is-first": data.isFirst === true,
|
|
215
|
+
"data-is-last": data.isLast === true,
|
|
216
|
+
"data-state": state,
|
|
217
|
+
...isDimmed !== false && { "data-likec4-dimmed": isDimmed },
|
|
218
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
219
|
+
className: classes.content,
|
|
220
|
+
style: { height: headerHeight },
|
|
221
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
222
|
+
className: classes.label,
|
|
223
|
+
onClick: toggleSequenceFlow,
|
|
224
|
+
children: label
|
|
225
|
+
}), data.title && /* @__PURE__ */ jsx("div", {
|
|
226
|
+
className: classes.title,
|
|
227
|
+
onClick: toggleSequenceFlow,
|
|
228
|
+
children: data.title
|
|
229
|
+
})]
|
|
230
|
+
})
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
//#endregion
|
|
234
|
+
export { SequenceSubflowArea };
|
|
@@ -2,6 +2,7 @@ export { CompoundActions } from './CompoundActions';
|
|
|
2
2
|
export { DeploymentElementActions, ElementActions } from './ElementActions';
|
|
3
3
|
export { CompoundDeploymentNode, CompoundDetailsButtonWithHandler, CompoundElementNode, DeploymentNode, ElementDetailsButtonWithHandler, ElementNode, ViewGroupNode, } from './nodes';
|
|
4
4
|
export { SequenceActorNode, SequenceParallelArea } from './SequenceActorNode';
|
|
5
|
+
export { SequenceSubflowArea } from './SequenceSubFlow';
|
|
5
6
|
export { NodeDrifts, type NodeDriftsProps } from './NodeDrifts';
|
|
6
7
|
export * from './CompoundActions';
|
|
7
8
|
export * from './ElementActions';
|
|
@@ -72,7 +72,10 @@ function ElementNode(props) {
|
|
|
72
72
|
children: [
|
|
73
73
|
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
74
74
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
75
|
-
/* @__PURE__ */ jsx(ElementData, {
|
|
75
|
+
/* @__PURE__ */ jsx(ElementData, {
|
|
76
|
+
...props,
|
|
77
|
+
"aria-hidden": true
|
|
78
|
+
}),
|
|
76
79
|
enableElementTags && /* @__PURE__ */ jsx(ElementTags, { ...props }),
|
|
77
80
|
/* @__PURE__ */ jsx(ElementActions, { ...props }),
|
|
78
81
|
enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
@@ -89,7 +92,10 @@ function DeploymentNode(props) {
|
|
|
89
92
|
children: [
|
|
90
93
|
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
91
94
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
92
|
-
/* @__PURE__ */ jsx(ElementData, {
|
|
95
|
+
/* @__PURE__ */ jsx(ElementData, {
|
|
96
|
+
...props,
|
|
97
|
+
"aria-hidden": true
|
|
98
|
+
}),
|
|
93
99
|
enableElementTags && /* @__PURE__ */ jsx(ElementTags, { ...props }),
|
|
94
100
|
/* @__PURE__ */ jsx(DeploymentElementActions, { ...props }),
|
|
95
101
|
enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
@@ -115,7 +121,10 @@ function CompoundElementNode(props) {
|
|
|
115
121
|
nodeProps: props,
|
|
116
122
|
children: [
|
|
117
123
|
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
118
|
-
/* @__PURE__ */ jsx(CompoundTitle, {
|
|
124
|
+
/* @__PURE__ */ jsx(CompoundTitle, {
|
|
125
|
+
...props,
|
|
126
|
+
"aria-hidden": true
|
|
127
|
+
}),
|
|
119
128
|
/* @__PURE__ */ jsx(CompoundActions, { ...props }),
|
|
120
129
|
enableElementDetails && /* @__PURE__ */ jsx(CompoundDetailsButtonWithHandler, { ...props }),
|
|
121
130
|
!enableReadOnly && /* @__PURE__ */ jsx(CompoundElementToolbar, { ...props }),
|
|
@@ -130,7 +139,10 @@ function CompoundDeploymentNode(props) {
|
|
|
130
139
|
nodeProps: props,
|
|
131
140
|
children: [
|
|
132
141
|
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
133
|
-
/* @__PURE__ */ jsx(CompoundTitle, {
|
|
142
|
+
/* @__PURE__ */ jsx(CompoundTitle, {
|
|
143
|
+
...props,
|
|
144
|
+
"aria-hidden": true
|
|
145
|
+
}),
|
|
134
146
|
/* @__PURE__ */ jsx(CompoundActions, { ...props }),
|
|
135
147
|
enableElementDetails && /* @__PURE__ */ jsx(CompoundDetailsButtonWithHandler, { ...props }),
|
|
136
148
|
!enableReadOnly && /* @__PURE__ */ jsx(CompoundDeploymentToolbar, { ...props }),
|
|
@@ -145,7 +157,10 @@ function ViewGroupNode(props) {
|
|
|
145
157
|
nodeProps: props,
|
|
146
158
|
children: [
|
|
147
159
|
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
148
|
-
/* @__PURE__ */ jsx(CompoundTitle, {
|
|
160
|
+
/* @__PURE__ */ jsx(CompoundTitle, {
|
|
161
|
+
...props,
|
|
162
|
+
"aria-hidden": true
|
|
163
|
+
}),
|
|
149
164
|
/* @__PURE__ */ jsx(DefaultHandles, { direction: props.data.viewLayoutDir })
|
|
150
165
|
]
|
|
151
166
|
});
|
|
@@ -100,4 +100,4 @@ function BorderStyleOption({ elementBorderStyle = "none", onChange }) {
|
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
//#endregion
|
|
103
|
-
export { BorderStyleOption, BrowseRelationshipsButton, GoToSourceButton };
|
|
103
|
+
export { BorderStyleOption, BrowseRelationshipsButton, GoToSourceButton, Tooltip$1 as Tooltip };
|
|
@@ -3,8 +3,8 @@ import { roundDpr } from "../../utils/roundDpr.js";
|
|
|
3
3
|
import { useRootContainerRef } from "../../context/RootContainerContext.js";
|
|
4
4
|
import { useDiagramEventHandlers } from "../../context/DiagramEventHandlers.js";
|
|
5
5
|
import { useEnabledFeatures } from "../../context/DiagramFeatures.js";
|
|
6
|
-
import { useDiagram } from "../../hooks/safeContext.js";
|
|
7
|
-
import {
|
|
6
|
+
import { selectDiagramContext, useDiagram, useDiagramSelector } from "../../hooks/safeContext.js";
|
|
7
|
+
import { useOnDiagramEvent } from "../../hooks/useDiagram.js";
|
|
8
8
|
import { useLikeC4Model } from "../../hooks/useLikeC4Model.js";
|
|
9
9
|
import { findDiagramEdge, findDiagramNode } from "../state/utils.js";
|
|
10
10
|
import { Markdown } from "../../base-primitives/Markdown.js";
|
|
@@ -25,7 +25,7 @@ import { Box as Box$1, HStack, VStack, styled } from "@likec4/styles/jsx";
|
|
|
25
25
|
import { bleed } from "@likec4/styles/patterns";
|
|
26
26
|
import { autoPlacement, autoUpdate, computePosition, hide, offset, size } from "@floating-ui/dom";
|
|
27
27
|
//#region src/likec4diagram/relationship-popover/RelationshipPopover.tsx
|
|
28
|
-
|
|
28
|
+
var selector = selectDiagramContext((c) => {
|
|
29
29
|
let selected = null;
|
|
30
30
|
for (const edge of c.xyedges) if (edge.selected) {
|
|
31
31
|
if (selected) {
|
|
@@ -38,12 +38,12 @@ function selectDiagramContext(c) {
|
|
|
38
38
|
viewId: c.view.id,
|
|
39
39
|
selected
|
|
40
40
|
};
|
|
41
|
-
}
|
|
41
|
+
});
|
|
42
42
|
var RelationshipPopover = memo(() => {
|
|
43
43
|
const likec4model = useLikeC4Model();
|
|
44
44
|
const actorRef = useActorRef(RelationshipPopoverActorLogic);
|
|
45
45
|
const diagram = useDiagram();
|
|
46
|
-
const { viewId, selected } =
|
|
46
|
+
const { viewId, selected } = useDiagramSelector(selector);
|
|
47
47
|
const openedEdgeId = useSelector(actorRef, (s) => s.hasTag("opened") ? s.context.edgeId : null);
|
|
48
48
|
useOnDiagramEvent("navigateTo", () => {
|
|
49
49
|
actorRef.send({ type: "close" });
|
|
@@ -95,14 +95,14 @@ var RelationshipPopover = memo(() => {
|
|
|
95
95
|
diagram,
|
|
96
96
|
openedEdgeId
|
|
97
97
|
]);
|
|
98
|
-
const { diagramEdge, sourceNode, targetNode } =
|
|
98
|
+
const { diagramEdge, sourceNode, targetNode } = useDiagramSelector(useCallback(({ context: ctx }) => {
|
|
99
99
|
const diagramEdge = openedEdgeId ? findDiagramEdge(ctx, openedEdgeId) : null;
|
|
100
100
|
return {
|
|
101
101
|
diagramEdge,
|
|
102
102
|
sourceNode: diagramEdge ? findDiagramNode(ctx, diagramEdge.source) : null,
|
|
103
103
|
targetNode: diagramEdge ? findDiagramNode(ctx, diagramEdge.target) : null
|
|
104
104
|
};
|
|
105
|
-
},
|
|
105
|
+
}, [openedEdgeId]), shallowEqual);
|
|
106
106
|
if (!diagramEdge || !sourceNode || !targetNode || isEmpty(diagramEdge.relations)) return null;
|
|
107
107
|
const [direct, nested] = pipe(diagramEdge.relations, map((id) => {
|
|
108
108
|
try {
|
|
@@ -340,8 +340,8 @@ var Relationship = forwardRef(({ viewId, relationship: r, sourceNode, targetNode
|
|
|
340
340
|
gap: "1",
|
|
341
341
|
rounded: "sm",
|
|
342
342
|
backgroundColor: { _hover: {
|
|
343
|
-
base: "mantine.
|
|
344
|
-
_dark: "mantine.
|
|
343
|
+
base: "mantine.gray[1]",
|
|
344
|
+
_dark: "mantine.dark[5]/70"
|
|
345
345
|
} }
|
|
346
346
|
}),
|
|
347
347
|
children: [
|
|
@@ -448,7 +448,7 @@ var Relationship = forwardRef(({ viewId, relationship: r, sourceNode, targetNode
|
|
|
448
448
|
className: css({
|
|
449
449
|
userSelect: "all",
|
|
450
450
|
wordBreak: "break-word",
|
|
451
|
-
minWidth: 0
|
|
451
|
+
minWidth: "0"
|
|
452
452
|
}),
|
|
453
453
|
children: r.kind
|
|
454
454
|
})]
|
|
@@ -460,7 +460,7 @@ var Relationship = forwardRef(({ viewId, relationship: r, sourceNode, targetNode
|
|
|
460
460
|
className: css({
|
|
461
461
|
userSelect: "all",
|
|
462
462
|
wordBreak: "break-word",
|
|
463
|
-
minWidth: 0
|
|
463
|
+
minWidth: "0"
|
|
464
464
|
}),
|
|
465
465
|
children: r.technology
|
|
466
466
|
})]
|
|
@@ -469,10 +469,11 @@ var Relationship = forwardRef(({ viewId, relationship: r, sourceNode, targetNode
|
|
|
469
469
|
css: {
|
|
470
470
|
paddingLeft: "2.5",
|
|
471
471
|
py: "1.5",
|
|
472
|
-
|
|
472
|
+
borderLeftWidth: "2",
|
|
473
|
+
borderLeftStyle: "dotted",
|
|
473
474
|
borderLeftColor: {
|
|
474
|
-
base: "mantine.
|
|
475
|
-
_dark: "mantine.
|
|
475
|
+
base: "mantine.gray[3]",
|
|
476
|
+
_dark: "mantine.dark[4]"
|
|
476
477
|
}
|
|
477
478
|
},
|
|
478
479
|
children: /* @__PURE__ */ jsx(Markdown, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Color } from '@likec4/core/types';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
import { StyledComponent } from '../../../styled-system';
|
|
3
|
+
import { StyledComponent } from '../../../styled-system/types';
|
|
4
4
|
export declare const Endpoint: ({ children, likec4color }: PropsWithChildren<{
|
|
5
5
|
likec4color: Color;
|
|
6
6
|
}>) => import("react").JSX.Element;
|