@likec4/diagram 1.59.2 → 1.59.4
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/README.md +53 -0
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +36 -21
- package/dist/LikeC4Diagram.props.d.ts +23 -0
- package/dist/LikeC4MantineProvider.d.ts +24 -0
- package/dist/LikeC4MantineProvider.js +156 -0
- package/dist/LikeC4ProjectsOverview.js +1 -1
- package/dist/LikeC4ProjectsProvider.d.ts +17 -2
- package/dist/LikeC4Styles.d.ts +13 -3
- package/dist/LikeC4Styles.js +10 -6
- package/dist/LikeC4View.js +2 -2
- package/dist/StaticLikeC4Diagram.d.ts +1 -1
- package/dist/base/BaseXYFlow.d.ts +1 -1
- package/dist/base/BaseXYFlow.js +19 -9
- package/dist/base/const.d.ts +1 -0
- package/dist/base/const.js +3 -1
- package/dist/base-primitives/Markdown.d.ts +3 -3
- package/dist/base-primitives/compound/CompoundNodeContainer.js +2 -3
- package/dist/base-primitives/compound/CompoundTitle.js +5 -4
- package/dist/base-primitives/compound/actionbtns.css.d.ts +3 -3
- package/dist/base-primitives/compound/actionbtns.css.js +3 -3
- package/dist/base-primitives/element/ElementData.js +6 -1
- package/dist/base-primitives/element/ElementShape.js +9 -10
- package/dist/base-primitives/element/ElementTags.d.ts +2 -2
- package/dist/base-primitives/element/ElementTags.js +5 -5
- package/dist/components/EmptyBox.d.ts +3 -0
- package/dist/components/EmptyBox.js +9 -0
- package/dist/components/ErrorFallback.js +7 -6
- package/dist/components/FloatingWindow.d.ts +18 -0
- package/dist/components/FloatingWindow.js +89 -0
- package/dist/components/Link.js +7 -7
- package/dist/components/NavigationPanel.d.ts +2 -2
- package/dist/components/NavigationPanel.js +5 -6
- package/dist/components/SearchControl.css.js +10 -12
- package/dist/components/ViewIcon.d.ts +11 -0
- package/dist/components/ViewIcon.js +71 -0
- package/dist/context/CurrentViewModelProvider.js +2 -1
- package/dist/context/DiagramEventHandlers.js +4 -2
- package/dist/context/EnsureMantine.js +3 -3
- package/dist/context/IconRenderer.d.ts +2 -1
- package/dist/context/IconRenderer.js +78 -26
- package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
- package/dist/context/TagStylesContext.d.ts +11 -4
- package/dist/context/TagStylesContext.js +39 -27
- package/dist/custom/index.d.ts +3 -0
- package/dist/custom/index.js +7 -4
- package/dist/editor/LikeC4EditorCallbacks.d.ts +20 -1
- package/dist/editor/LikeC4EditorCallbacks.js +4 -1
- package/dist/editor/actor/setup.d.ts +1 -0
- package/dist/editor/actor/setup.js +17 -12
- package/dist/editor/actor/state.sync-queue.js +1 -0
- package/dist/editor/applyChangesToManualLayout.js +5 -2
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/useEditorActorLogic.js +10 -3
- package/dist/hooks/safeContext.d.ts +12 -4
- package/dist/hooks/safeContext.js +2 -2
- package/dist/hooks/useCurrentView.js +5 -5
- package/dist/hooks/useDiagram.js +3 -23
- package/dist/hooks/useDiagramCompareLayout.d.ts +16 -6
- package/dist/hooks/useDiagramCompareLayout.js +20 -17
- package/dist/hooks/useEditorActor.js +3 -5
- package/dist/hooks/useLikeC4Model.js +8 -3
- package/dist/hooks/useLikeC4Project.d.ts +4 -3
- package/dist/hooks/useOverlaysActor.d.ts +1 -1
- package/dist/hooks/useUpdateEffect.js +2 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +8 -6
- package/dist/likec4diagram/DiagramUI.js +4 -3
- package/dist/likec4diagram/DiagramXYFlow.d.ts +6 -0
- package/dist/likec4diagram/DiagramXYFlow.js +33 -19
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +4 -4
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +2 -4
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +1 -3
- package/dist/likec4diagram/custom/edges/edges.css.js +13 -13
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +3 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +2 -2
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +4 -4
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +2 -2
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +8 -5
- package/dist/likec4diagram/custom/nodes/nodes.js +8 -5
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +9 -8
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +3 -2
- package/dist/likec4diagram/relationship-popover/components.d.ts +1 -1
- package/dist/likec4diagram/relationship-popover/components.js +6 -2
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +7 -2
- package/dist/likec4diagram/state/DiagramActorProvider.js +20 -4
- package/dist/likec4diagram/state/assign.js +1 -1
- package/dist/likec4diagram/state/createViewChange.js +1 -6
- package/dist/likec4diagram/state/diagram-api.d.ts +2 -2
- package/dist/likec4diagram/state/diagram-api.js +3 -2
- package/dist/likec4diagram/state/machine.actions.js +15 -8
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +1 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +7 -5
- package/dist/likec4diagram/state/machine.setup.d.ts +10 -1
- package/dist/likec4diagram/state/machine.setup.js +15 -9
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +2 -26
- package/dist/likec4diagram/state/machine.state.initializing.js +9 -6
- package/dist/likec4diagram/state/machine.state.navigating.js +1 -1
- package/dist/likec4diagram/state/machine.state.ready.d.ts +134 -3
- package/dist/likec4diagram/state/machine.state.ready.js +2 -1
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +106 -1
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +40 -7
- package/dist/likec4diagram/state/utils.d.ts +1 -1
- package/dist/likec4diagram/state/utils.js +7 -4
- package/dist/likec4diagram/ui/FloatingSequenceActors.js +2 -1
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +16 -10
- package/dist/likec4diagram/ui/index.d.ts +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +13 -15
- package/dist/likec4diagram/ui/notation/NotationPanel.js +9 -9
- package/dist/likec4diagram/ui/sequence-outline/ActiveTrail.d.ts +9 -0
- package/dist/likec4diagram/ui/sequence-outline/ActiveTrail.js +81 -0
- package/dist/likec4diagram/ui/sequence-outline/FlowRow.d.ts +11 -0
- package/dist/likec4diagram/ui/sequence-outline/FlowRow.js +70 -0
- package/dist/likec4diagram/ui/sequence-outline/OutlineBody.d.ts +2 -0
- package/dist/likec4diagram/ui/sequence-outline/OutlineBody.js +106 -0
- package/dist/likec4diagram/ui/sequence-outline/OutlineHeader.d.ts +2 -0
- package/dist/likec4diagram/ui/sequence-outline/OutlineHeader.js +140 -0
- package/dist/likec4diagram/ui/sequence-outline/OutlineNodes.d.ts +17 -0
- package/dist/likec4diagram/ui/sequence-outline/OutlineNodes.js +83 -0
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +4 -0
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +49 -525
- package/dist/likec4diagram/ui/sequence-outline/StepBadge.d.ts +8 -0
- package/dist/likec4diagram/ui/sequence-outline/StepBadge.js +52 -0
- package/dist/likec4diagram/ui/sequence-outline/StepRow.d.ts +7 -0
- package/dist/likec4diagram/ui/sequence-outline/StepRow.js +190 -0
- package/dist/likec4diagram/ui/sequence-outline/StoreProvider.d.ts +238 -0
- package/dist/likec4diagram/ui/sequence-outline/StoreProvider.js +94 -0
- package/dist/likec4diagram/ui/sequence-outline/depth-of-field.d.ts +21 -0
- package/dist/likec4diagram/ui/sequence-outline/depth-of-field.js +71 -0
- package/dist/likec4diagram/ui/sequence-outline/index.d.ts +2 -0
- package/dist/likec4diagram/ui/sequence-outline/motion.d.ts +13 -0
- package/dist/likec4diagram/ui/sequence-outline/motion.js +21 -0
- package/dist/likec4diagram/ui/sequence-outline/presentation.d.ts +10 -0
- package/dist/likec4diagram/ui/sequence-outline/presentation.js +80 -0
- package/dist/likec4diagram/ui/sequence-outline/tree.d.ts +9 -0
- package/dist/likec4diagram/ui/sequence-outline/tree.js +67 -0
- package/dist/likec4diagram/ui/sequence-outline/{state.d.ts → types.d.ts} +4 -2
- package/dist/likec4diagram/ui/sequence-outline/types.js +12 -0
- package/dist/likec4diagram/useLayoutConstraints.js +13 -1
- package/dist/likec4diagram/xyflow-sequence/layouter.js +8 -10
- package/dist/likec4diagram/xyflow-sequence/sequence-view-to-xy.js +1 -0
- package/dist/likec4diagram/xyflow-sequence/utils.js +0 -1
- package/dist/navigationpanel/NavigationPanel.js +45 -41
- package/dist/navigationpanel/NavigationPanelControls.js +102 -63
- package/dist/navigationpanel/NavigationPanelDropdown.js +52 -77
- package/dist/navigationpanel/_common.d.ts +6 -6
- package/dist/navigationpanel/_common.js +31 -42
- package/dist/navigationpanel/actor.actions.js +6 -5
- package/dist/navigationpanel/actor.js +2 -2
- package/dist/navigationpanel/actor.setup.d.ts +6 -6
- package/dist/navigationpanel/actor.setup.js +2 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -4
- package/dist/navigationpanel/comparepanel/ComparePanel.js +8 -10
- package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +11 -9
- package/dist/navigationpanel/controls/LayoutWarning.js +69 -72
- package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -1
- package/dist/navigationpanel/controls/NavigationButtons.js +8 -8
- package/dist/navigationpanel/controls/OpenSource.d.ts +1 -1
- package/dist/navigationpanel/controls/OpenSource.js +5 -8
- package/dist/navigationpanel/controls/SearchControl.js +24 -9
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +4 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +56 -76
- package/dist/navigationpanel/controls/ViewDetailsButton.d.ts +5 -0
- package/dist/navigationpanel/controls/ViewDetailsButton.js +121 -0
- package/dist/navigationpanel/controls/index.d.ts +1 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +27 -16
- package/dist/navigationpanel/editorpanel/ApplySemanticLayout.js +2 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +12 -10
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -0
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +19 -10
- package/dist/navigationpanel/editorpanel/styles.js +8 -15
- package/dist/navigationpanel/hooks.d.ts +6 -2
- package/dist/navigationpanel/styles.css.d.ts +2 -2
- package/dist/navigationpanel/styles.css.js +0 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -2
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +5 -4
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +10 -39
- package/dist/navigationpanel/walkthrough/DynamicViewModeSwitcher.d.ts +1 -0
- package/dist/navigationpanel/walkthrough/DynamicViewModeSwitcher.js +49 -0
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +8 -8
- package/dist/navigationpanel/windows/ViewDetailsWindow.d.ts +1 -0
- package/dist/navigationpanel/windows/ViewDetailsWindow.js +379 -0
- package/dist/overlays/Overlays.js +29 -17
- package/dist/overlays/element-details/ElementDetailsCard.css.js +28 -36
- package/dist/overlays/element-details/ElementDetailsCard.js +3 -3
- package/dist/overlays/element-details/MetadataValue.js +18 -16
- package/dist/overlays/element-details/TabPanelDeployments.css.js +6 -14
- package/dist/overlays/element-details/TabPanelRelationships.css.js +8 -12
- package/dist/overlays/element-details/TabPanelStructure.css.js +4 -8
- package/dist/overlays/hooks.d.ts +3 -1
- package/dist/overlays/overlay/Overlay.js +8 -7
- package/dist/overlays/overlaysActor.js +20 -17
- package/dist/overlays/relationship-details/RelationshipDetails.js +2 -1
- package/dist/overlays/relationship-details/SelectEdge.css.js +14 -9
- package/dist/overlays/relationship-details/actor.js +1 -1
- package/dist/overlays/relationship-details/hooks.js +2 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +6 -0
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +15 -8
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -8
- package/dist/overlays/relationships-browser/SelectElement.js +5 -1
- package/dist/overlays/relationships-browser/actor.js +3 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.js +39 -38
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +7 -9
- package/dist/overlays/relationships-browser/hooks.js +2 -1
- package/dist/projects-overview/ProjectsOverview.js +8 -7
- package/dist/projects-overview/actor.js +1 -1
- package/dist/projects-overview/hooks.js +2 -1
- package/dist/search/Search.js +9 -7
- package/dist/search/components/ElementsColumn.css.js +6 -5
- package/dist/search/components/ElementsColumn.js +4 -3
- package/dist/search/components/SearchByTags.js +3 -3
- package/dist/search/components/ViewsColum.js +46 -43
- package/dist/search/components/ViewsColumn.css.js +4 -4
- package/dist/search/components/_shared.css.d.ts +2 -2
- package/dist/search/components/_shared.css.js +31 -46
- package/dist/search/components/styles.css.js +4 -4
- package/dist/search/hooks.js +2 -1
- package/dist/shadowroot/ShadowRoot.js +6 -5
- package/dist/styles2.js +1 -1
- package/dist/utils/index.js +3 -3
- package/package.json +29 -29
- package/panda.buildinfo.json +342 -299
- package/styles-min.css +1 -1
- package/styles-xyflow.css +1 -1
- package/styles.css +1 -1
- package/dist/context/DefaultMantineProvider.d.ts +0 -2
- package/dist/context/DefaultMantineProvider.js +0 -48
- package/dist/likec4diagram/ui/sequence-outline/state.js +0 -55
- package/dist/navigationpanel/controls/DetailsControls.d.ts +0 -2
- package/dist/navigationpanel/controls/DetailsControls.js +0 -223
|
@@ -27,12 +27,12 @@ function TruncatedValue({ value, isExpanded }) {
|
|
|
27
27
|
padding: "xs",
|
|
28
28
|
userSelect: "all",
|
|
29
29
|
color: "text",
|
|
30
|
-
lineHeight:
|
|
30
|
+
lineHeight: "md",
|
|
31
31
|
whiteSpace: isExpanded ? "pre-wrap" : "nowrap",
|
|
32
32
|
overflow: isExpanded ? "visible" : "hidden",
|
|
33
33
|
textOverflow: isExpanded ? "unset" : "ellipsis",
|
|
34
34
|
wordBreak: isExpanded ? "break-word" : "normal",
|
|
35
|
-
minWidth: 0,
|
|
35
|
+
minWidth: "0",
|
|
36
36
|
width: "100%"
|
|
37
37
|
}),
|
|
38
38
|
children: value
|
|
@@ -50,16 +50,16 @@ function MultiValueDisplay({ values, isExpanded }) {
|
|
|
50
50
|
fontSize: "xs",
|
|
51
51
|
color: "mantine.gray[5]",
|
|
52
52
|
fontWeight: "medium",
|
|
53
|
-
flexShrink: 0,
|
|
53
|
+
flexShrink: "0",
|
|
54
54
|
_dark: { color: "mantine.dark[3]" }
|
|
55
55
|
}),
|
|
56
56
|
children: "•"
|
|
57
57
|
}), /* @__PURE__ */ jsx(Box, {
|
|
58
58
|
className: css({
|
|
59
|
-
minHeight: "32px",
|
|
59
|
+
minHeight: "[32px]",
|
|
60
60
|
display: "flex",
|
|
61
61
|
alignItems: "center",
|
|
62
|
-
flex: 1
|
|
62
|
+
flex: "1"
|
|
63
63
|
}),
|
|
64
64
|
children: /* @__PURE__ */ jsx(TruncatedValue, {
|
|
65
65
|
value,
|
|
@@ -70,13 +70,13 @@ function MultiValueDisplay({ values, isExpanded }) {
|
|
|
70
70
|
});
|
|
71
71
|
return /* @__PURE__ */ jsx(Box, {
|
|
72
72
|
className: css({
|
|
73
|
-
minHeight: "32px",
|
|
73
|
+
minHeight: "[32px]",
|
|
74
74
|
display: "flex",
|
|
75
75
|
alignItems: "center",
|
|
76
76
|
padding: "xs",
|
|
77
77
|
gap: "xs",
|
|
78
78
|
flexWrap: "wrap",
|
|
79
|
-
minWidth: 0,
|
|
79
|
+
minWidth: "0",
|
|
80
80
|
overflow: "hidden"
|
|
81
81
|
}),
|
|
82
82
|
children: values.map((value, index) => /* @__PURE__ */ jsxs(Flex, {
|
|
@@ -90,14 +90,15 @@ function MultiValueDisplay({ values, isExpanded }) {
|
|
|
90
90
|
backgroundColor: "white",
|
|
91
91
|
color: "text",
|
|
92
92
|
borderRadius: "sm",
|
|
93
|
-
|
|
93
|
+
borderWidth: "default",
|
|
94
|
+
borderStyle: "solid",
|
|
94
95
|
borderColor: "mantine.gray[3]",
|
|
95
96
|
whiteSpace: "nowrap",
|
|
96
97
|
overflow: "hidden",
|
|
97
98
|
textOverflow: "ellipsis",
|
|
98
|
-
maxWidth: "min(200px, 100%)",
|
|
99
|
-
minWidth: "60px",
|
|
100
|
-
flex: "0 1 auto",
|
|
99
|
+
maxWidth: "[min(200px, 100%)]",
|
|
100
|
+
minWidth: "[60px]",
|
|
101
|
+
flex: "[0 1 auto]",
|
|
101
102
|
userSelect: "all",
|
|
102
103
|
_dark: {
|
|
103
104
|
backgroundColor: "mantine.dark[9]",
|
|
@@ -111,7 +112,7 @@ function MultiValueDisplay({ values, isExpanded }) {
|
|
|
111
112
|
fontSize: "xs",
|
|
112
113
|
color: "mantine.gray[5]",
|
|
113
114
|
fontWeight: "medium",
|
|
114
|
-
flexShrink: 0,
|
|
115
|
+
flexShrink: "0",
|
|
115
116
|
_dark: { color: "mantine.dark[3]" }
|
|
116
117
|
}),
|
|
117
118
|
children: "•"
|
|
@@ -141,13 +142,14 @@ function MetadataValue({ label, value }) {
|
|
|
141
142
|
padding: "[4px 8px]",
|
|
142
143
|
borderRadius: "sm",
|
|
143
144
|
whiteSpace: "nowrap",
|
|
144
|
-
|
|
145
|
+
transitionProperty: "common",
|
|
146
|
+
transition: "medium",
|
|
145
147
|
_hover: {
|
|
146
148
|
backgroundColor: "mantine.gray[1]",
|
|
147
|
-
color: "
|
|
149
|
+
color: "primary.body",
|
|
148
150
|
_dark: {
|
|
149
151
|
backgroundColor: "mantine.dark[7]",
|
|
150
|
-
color: "
|
|
152
|
+
color: "primary.body.hover"
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
155
|
}),
|
|
@@ -203,7 +205,7 @@ function MetadataValue({ label, value }) {
|
|
|
203
205
|
isExpanded
|
|
204
206
|
}) : /* @__PURE__ */ jsx(Box, {
|
|
205
207
|
className: css({
|
|
206
|
-
minHeight: "32px",
|
|
208
|
+
minHeight: "[32px]",
|
|
207
209
|
display: "flex",
|
|
208
210
|
alignItems: "center"
|
|
209
211
|
}),
|
|
@@ -10,14 +10,7 @@ var label = css({
|
|
|
10
10
|
transition: "fast",
|
|
11
11
|
color: "mantine.gray[7]",
|
|
12
12
|
_dark: { color: "mantine.dark[1]" },
|
|
13
|
-
"& > *": { transition: "fast" }
|
|
14
|
-
_hover: {
|
|
15
|
-
transitionTimingFunction: "out",
|
|
16
|
-
"& > :not([data-no-transform])": {
|
|
17
|
-
transitionTimingFunction: "out",
|
|
18
|
-
transform: "translateX(1px)"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
13
|
+
"& > *": { transition: "fast" }
|
|
21
14
|
});
|
|
22
15
|
var nodeLabel = cx(label);
|
|
23
16
|
var instanceLabel = cx(label, css({
|
|
@@ -25,18 +18,17 @@ var instanceLabel = cx(label, css({
|
|
|
25
18
|
width: "100%",
|
|
26
19
|
justifyContent: "stretch",
|
|
27
20
|
flexWrap: "nowrap",
|
|
28
|
-
height: "36px",
|
|
21
|
+
height: "[36px]",
|
|
29
22
|
paddingInlineStart: "[16px]",
|
|
30
23
|
paddingInlineEnd: "2.5",
|
|
31
24
|
borderRadius: "sm",
|
|
32
25
|
alignItems: "center",
|
|
33
|
-
color: "
|
|
34
|
-
|
|
35
|
-
_hover: { background: "mantine.gray.lightHover" },
|
|
26
|
+
color: "text.default",
|
|
27
|
+
_hover: { background: "surface.hover" },
|
|
36
28
|
"& .tabler-icon": {
|
|
37
29
|
transition: "fast",
|
|
38
|
-
|
|
39
|
-
opacity: .65
|
|
30
|
+
boxSize: "[90%]",
|
|
31
|
+
opacity: "[0.65]"
|
|
40
32
|
}
|
|
41
33
|
}));
|
|
42
34
|
//#endregion
|
|
@@ -8,7 +8,7 @@ var fqn = css({
|
|
|
8
8
|
padding: "[3px 6px]",
|
|
9
9
|
borderRadius: "xs",
|
|
10
10
|
background: `var(--likec4-palette-fill)/75`,
|
|
11
|
-
lineHeight: 1.2,
|
|
11
|
+
lineHeight: "[1.2]",
|
|
12
12
|
color: "var(--likec4-palette-hiContrast)"
|
|
13
13
|
});
|
|
14
14
|
var relationshipStat = css({
|
|
@@ -24,17 +24,13 @@ var relationshipStat = css({
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
var xyflow = css({
|
|
27
|
-
flex: "1 1 100%",
|
|
27
|
+
flex: "[1 1 100%]",
|
|
28
28
|
position: "relative",
|
|
29
29
|
width: "100%",
|
|
30
30
|
height: "100%",
|
|
31
|
-
background: "
|
|
31
|
+
background: "surface.sunken",
|
|
32
32
|
border: "default",
|
|
33
|
-
borderRadius: "sm"
|
|
34
|
-
_light: {
|
|
35
|
-
borderColor: "mantine.gray[3]",
|
|
36
|
-
background: "mantine.gray[1]"
|
|
37
|
-
}
|
|
33
|
+
borderRadius: "sm"
|
|
38
34
|
});
|
|
39
35
|
css({
|
|
40
36
|
_before: {
|
|
@@ -46,7 +42,7 @@ css({
|
|
|
46
42
|
fontWeight: "medium",
|
|
47
43
|
lineHeight: "1",
|
|
48
44
|
color: "text.dimmed",
|
|
49
|
-
opacity: .85,
|
|
45
|
+
opacity: "[0.85]",
|
|
50
46
|
transform: "translateY(-100%) translateY(-2px)"
|
|
51
47
|
},
|
|
52
48
|
_light: { "& .mantine-SegmentedControl-root": { background: "mantine.gray[3]" } }
|
|
@@ -56,11 +52,11 @@ css({
|
|
|
56
52
|
fontSize: "xl",
|
|
57
53
|
fontWeight: "bold",
|
|
58
54
|
padding: "[1px 5px]",
|
|
59
|
-
minWidth: "24px",
|
|
55
|
+
minWidth: "[24px]",
|
|
60
56
|
textAlign: "center",
|
|
61
57
|
borderRadius: "sm",
|
|
62
|
-
background: "
|
|
63
|
-
color: "default
|
|
58
|
+
background: "surface.sunken",
|
|
59
|
+
color: "text.default",
|
|
64
60
|
[`&[data-zero]`]: { color: "text.dimmed" },
|
|
65
61
|
[`&[data-missing]`]: {
|
|
66
62
|
color: "mantine.orange[4]",
|
|
@@ -7,8 +7,8 @@ var treeNodeLabel = css({
|
|
|
7
7
|
var elementLabel = css({
|
|
8
8
|
display: "inline-flex",
|
|
9
9
|
transition: "fast",
|
|
10
|
-
border:
|
|
11
|
-
|
|
10
|
+
border: "default",
|
|
11
|
+
borderStyle: "dashed",
|
|
12
12
|
borderRadius: "sm",
|
|
13
13
|
px: "md",
|
|
14
14
|
py: "xs",
|
|
@@ -20,12 +20,8 @@ var elementLabel = css({
|
|
|
20
20
|
_hover: {
|
|
21
21
|
transitionTimingFunction: "out",
|
|
22
22
|
borderStyle: "solid",
|
|
23
|
-
color: "default
|
|
24
|
-
background: "
|
|
25
|
-
"& > *": {
|
|
26
|
-
transitionTimingFunction: "out",
|
|
27
|
-
transform: "translateX(1px)"
|
|
28
|
-
}
|
|
23
|
+
color: "text.default",
|
|
24
|
+
background: "surface.hover"
|
|
29
25
|
}
|
|
30
26
|
});
|
|
31
27
|
//#endregion
|
package/dist/overlays/hooks.d.ts
CHANGED
|
@@ -9,7 +9,9 @@ export declare const OverlaysActorContext: Provider<OverlaysActorRef>, selectOve
|
|
|
9
9
|
[key: `elementDetails-${number}`]: import("./types").Overlays.ElementDetails.ActorRef | undefined;
|
|
10
10
|
[key: `relationshipDetails-${number}`]: import("./types").Overlays.RelationshipDetails.ActorRef | undefined;
|
|
11
11
|
[key: `relationshipsBrowser-${number}`]: import("./types").Overlays.RelationshipsBrowser.ActorRef | undefined;
|
|
12
|
-
}, any, never, any, any, any>) => T, compare: (a: T, b: T) => boolean]
|
|
12
|
+
}, any, never, any, any, any>) => T, compare: (a: T, b: T) => boolean] & {
|
|
13
|
+
Out: T;
|
|
14
|
+
}, useSelectOverlaysActor: {
|
|
13
15
|
<T>(select: (state: MachineSnapshot<OverlaysContext, OverlayActorEvent, {
|
|
14
16
|
[key: `elementDetails-${number}`]: import("./types").Overlays.ElementDetails.ActorRef | undefined;
|
|
15
17
|
[key: `relationshipDetails-${number}`]: import("./types").Overlays.RelationshipDetails.ActorRef | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { stopPropagation } from "../../utils/xyflow.js";
|
|
3
3
|
import { cx } from "@likec4/styles/css";
|
|
4
|
-
import { forwardRef, useEffect,
|
|
4
|
+
import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
6
6
|
import { useTimeoutEffect } from "@react-hookz/web";
|
|
7
7
|
import { RemoveScroll } from "@mantine/core";
|
|
@@ -29,6 +29,11 @@ var Overlay = forwardRef(({ onClose, className, classes, overlayLevel = 0, child
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
const isPresent = useIsPresent();
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const dialog = dialogRef.current;
|
|
34
|
+
if (dialog && !dialog.open) dialog.showModal();
|
|
35
|
+
if (openDelay === 0) setOpened(true);
|
|
36
|
+
}, []);
|
|
32
37
|
useEffect(() => {
|
|
33
38
|
if (isPresent) return;
|
|
34
39
|
const dialog = dialogRef.current;
|
|
@@ -37,11 +42,6 @@ var Overlay = forwardRef(({ onClose, className, classes, overlayLevel = 0, child
|
|
|
37
42
|
if (dialog?.open) dialog.close();
|
|
38
43
|
};
|
|
39
44
|
}, [isPresent]);
|
|
40
|
-
useLayoutEffect(() => {
|
|
41
|
-
const dialog = dialogRef.current;
|
|
42
|
-
if (dialog && !dialog.open) dialog.showModal();
|
|
43
|
-
if (openDelay === 0) setOpened(true);
|
|
44
|
-
}, []);
|
|
45
45
|
useTimeoutEffect(() => setOpened(true), openDelay > 0 ? openDelay : void 0);
|
|
46
46
|
const overlayRecipe = overlay({
|
|
47
47
|
fullscreen,
|
|
@@ -79,7 +79,7 @@ var Overlay = forwardRef(({ onClose, className, classes, overlayLevel = 0, child
|
|
|
79
79
|
}
|
|
80
80
|
}), [overlayLevel, targetBackdropOpacity]);
|
|
81
81
|
return /* @__PURE__ */ jsx(m.dialog, {
|
|
82
|
-
ref: useMergedRef(dialogRef,
|
|
82
|
+
ref: useMergedRef(dialogRef, ref),
|
|
83
83
|
className: cx(classes?.dialog, className, overlayRecipe, fullscreen && RemoveScroll.classNames.fullWidth),
|
|
84
84
|
layout: true,
|
|
85
85
|
style: { [cssVarLevel]: overlayLevel },
|
|
@@ -103,6 +103,7 @@ var Overlay = forwardRef(({ onClose, className, classes, overlayLevel = 0, child
|
|
|
103
103
|
children: /* @__PURE__ */ jsx(RemoveScroll, {
|
|
104
104
|
forwardProps: true,
|
|
105
105
|
children: /* @__PURE__ */ jsx("div", {
|
|
106
|
+
ref: focusTrapRef,
|
|
106
107
|
className: cx(classes?.body, "likec4-overlay-body"),
|
|
107
108
|
children: opened && /* @__PURE__ */ jsx(Fragment$1, { children })
|
|
108
109
|
})
|
|
@@ -6,6 +6,20 @@ import { isString, last, reverse } from "remeda";
|
|
|
6
6
|
import { getHotkeyHandler } from "@mantine/hooks";
|
|
7
7
|
import { assertEvent, fromCallback, setup } from "xstate";
|
|
8
8
|
//#region src/overlays/overlaysActor.ts
|
|
9
|
+
var hotkeyLogic = fromCallback(({ sendBack }) => {
|
|
10
|
+
const handler = getHotkeyHandler([[
|
|
11
|
+
"Escape",
|
|
12
|
+
(event) => {
|
|
13
|
+
event.stopPropagation();
|
|
14
|
+
sendBack({ type: "close" });
|
|
15
|
+
},
|
|
16
|
+
{ preventDefault: true }
|
|
17
|
+
]]);
|
|
18
|
+
document.body.addEventListener("keydown", handler, { capture: true });
|
|
19
|
+
return () => {
|
|
20
|
+
document.body.removeEventListener("keydown", handler, { capture: true });
|
|
21
|
+
};
|
|
22
|
+
});
|
|
9
23
|
var machine = setup({
|
|
10
24
|
types: {
|
|
11
25
|
context: {},
|
|
@@ -17,20 +31,7 @@ var machine = setup({
|
|
|
17
31
|
relationshipDetails: relationshipDetailsLogic,
|
|
18
32
|
elementDetails: elementDetailsLogic,
|
|
19
33
|
relationshipsBrowser: relationshipsBrowserLogic,
|
|
20
|
-
hotkey:
|
|
21
|
-
const handler = getHotkeyHandler([[
|
|
22
|
-
"Escape",
|
|
23
|
-
(event) => {
|
|
24
|
-
event.stopPropagation();
|
|
25
|
-
sendBack({ type: "close" });
|
|
26
|
-
},
|
|
27
|
-
{ preventDefault: true }
|
|
28
|
-
]]);
|
|
29
|
-
document.body.addEventListener("keydown", handler, { capture: true });
|
|
30
|
-
return () => {
|
|
31
|
-
document.body.removeEventListener("keydown", handler, { capture: true });
|
|
32
|
-
};
|
|
33
|
-
})
|
|
34
|
+
hotkey: hotkeyLogic
|
|
34
35
|
},
|
|
35
36
|
guards: {
|
|
36
37
|
"has overlays?": ({ context }) => context.overlays.length > 0,
|
|
@@ -136,6 +137,10 @@ var openRelationshipsBrowser = () => machine.enqueueActions(({ context, enqueue,
|
|
|
136
137
|
subject: event.subject,
|
|
137
138
|
viewId: event.viewId
|
|
138
139
|
});
|
|
140
|
+
enqueue.sendTo(currentOverlay.id, {
|
|
141
|
+
type: "change.scope",
|
|
142
|
+
scope: event.viewId ? event.scope : "global"
|
|
143
|
+
});
|
|
139
144
|
return;
|
|
140
145
|
}
|
|
141
146
|
const id = `relationshipsBrowser-${context.seq}`;
|
|
@@ -167,9 +172,7 @@ var openOverlay = () => machine.enqueueActions(({ enqueue, event }) => {
|
|
|
167
172
|
case "open.relationshipDetails":
|
|
168
173
|
enqueue(openRelationshipDetails());
|
|
169
174
|
break;
|
|
170
|
-
case "open.relationshipsBrowser":
|
|
171
|
-
enqueue(openRelationshipsBrowser());
|
|
172
|
-
break;
|
|
175
|
+
case "open.relationshipsBrowser": enqueue(openRelationshipsBrowser());
|
|
173
176
|
}
|
|
174
177
|
});
|
|
175
178
|
var listenToEsc = () => machine.spawnChild("hotkey", { id: "hotkey" });
|
|
@@ -56,7 +56,8 @@ var SyncRelationshipDetailsXYFlow = memo(() => {
|
|
|
56
56
|
let data;
|
|
57
57
|
if ("edgeId" in subject && isTruthy(subject.edgeId)) {
|
|
58
58
|
invariant(view, `view ${subject.viewId} not found`);
|
|
59
|
-
|
|
59
|
+
const edge = nonNullable(view.findEdge(subject.edgeId), `edge ${subject.edgeId} not found in ${subject.viewId}`);
|
|
60
|
+
data = computeEdgeDetailsViewData([edge.id], view);
|
|
60
61
|
} else if (!!subject.source && !!subject.target) data = computeRelationshipDetailsViewData({
|
|
61
62
|
source: likec4model.element(subject.source),
|
|
62
63
|
target: likec4model.element(subject.target)
|
|
@@ -8,7 +8,7 @@ var edgeEnpoint = css.raw({
|
|
|
8
8
|
color: "text/90",
|
|
9
9
|
fontSize: "xs",
|
|
10
10
|
fontWeight: "medium",
|
|
11
|
-
lineHeight: "
|
|
11
|
+
lineHeight: "xs"
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
var edgeSource = css({
|
|
@@ -25,8 +25,9 @@ var edgeLabel = cx(edgeLabelclass, css({
|
|
|
25
25
|
display: "grid",
|
|
26
26
|
gridColumnStart: 1,
|
|
27
27
|
gridColumnEnd: 4,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
borderBottomWidth: "default",
|
|
29
|
+
borderBottomStyle: "solid",
|
|
30
|
+
borderBottomColor: "border.default",
|
|
30
31
|
marginBottom: "0",
|
|
31
32
|
padding: "[0 4px 5px 4px]",
|
|
32
33
|
width: "100%",
|
|
@@ -43,28 +44,32 @@ var edgeRow = css({
|
|
|
43
44
|
borderBottom: "none",
|
|
44
45
|
marginBottom: "0"
|
|
45
46
|
},
|
|
46
|
-
"& > *": {
|
|
47
|
+
"& > *": {
|
|
48
|
+
transitionProperty: "common",
|
|
49
|
+
transition: "medium"
|
|
50
|
+
},
|
|
47
51
|
"&:is(:hover, [data-selected=true]) > *": {
|
|
48
|
-
|
|
52
|
+
transitionProperty: "common",
|
|
53
|
+
transition: "medium",
|
|
49
54
|
cursor: "pointer",
|
|
50
|
-
backgroundColor: "
|
|
55
|
+
backgroundColor: "surface.hover"
|
|
51
56
|
}
|
|
52
57
|
});
|
|
53
58
|
var edgeGrid = css({
|
|
54
59
|
display: "grid",
|
|
55
60
|
gridTemplateColumns: "1fr 30px 1fr",
|
|
56
|
-
gridAutoRows: "min-content max-content",
|
|
61
|
+
gridAutoRows: "[min-content max-content]",
|
|
57
62
|
gap: "0",
|
|
58
63
|
alignItems: "stretch"
|
|
59
64
|
});
|
|
60
65
|
css({
|
|
61
66
|
display: "grid",
|
|
62
67
|
gridTemplateColumns: "min-content 1fr",
|
|
63
|
-
gridAutoRows: "min-content max-content",
|
|
68
|
+
gridAutoRows: "[min-content max-content]",
|
|
64
69
|
gap: "[10px 12px]",
|
|
65
70
|
alignItems: "baseline",
|
|
66
71
|
justifyItems: "start"
|
|
67
72
|
});
|
|
68
|
-
var scrollArea = css({ maxHeight: ["70vh", "calc(100cqh - 70px)"] });
|
|
73
|
+
var scrollArea = css({ maxHeight: ["[70vh]", "[calc(100cqh - 70px)]"] });
|
|
69
74
|
//#endregion
|
|
70
75
|
export { edgeArrow, edgeGrid, edgeLabel, edgeRow, edgeSource, edgeTarget, scrollArea };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { Base } from "../../base/Base.js";
|
|
3
2
|
import { MinZoom } from "../../base/const.js";
|
|
3
|
+
import { Base } from "../../base/Base.js";
|
|
4
4
|
import { updateEdges } from "../../base/updateEdges.js";
|
|
5
5
|
import { updateNodes } from "../../base/updateNodes.js";
|
|
6
6
|
import { typedSystem } from "../../likec4diagram/state/utils.js";
|
|
@@ -11,7 +11,8 @@ function useRelationshipDetailsActor() {
|
|
|
11
11
|
}
|
|
12
12
|
function useRelationshipDetailsState(selector, compare = shallowEqual) {
|
|
13
13
|
const select = useCallbackRef(selector);
|
|
14
|
-
|
|
14
|
+
const actor = useRelationshipDetailsActor();
|
|
15
|
+
return useSelector(actor, select, compare);
|
|
15
16
|
}
|
|
16
17
|
function useRelationshipDetails() {
|
|
17
18
|
const actor = useRelationshipDetailsActor();
|
|
@@ -3,3 +3,9 @@ export type RelationshipsBrowserProps = {
|
|
|
3
3
|
actorRef: RelationshipsBrowserActorRef;
|
|
4
4
|
};
|
|
5
5
|
export declare function RelationshipsBrowser({ actorRef }: RelationshipsBrowserProps): import("react").JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* Builds a shareable URL with the relationships parameter.
|
|
8
|
+
* Handles both browser history routing and hash-based routing.
|
|
9
|
+
* Preserves base paths when app is hosted under a sub-path.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildRelationshipUrl(subjectId: string, scope: 'global' | 'view'): string;
|
|
@@ -152,9 +152,11 @@ var RelationshipsBrowserInner = memo(() => {
|
|
|
152
152
|
useEffect(() => {
|
|
153
153
|
browser.updateView(layouted);
|
|
154
154
|
}, [layouted, browser]);
|
|
155
|
+
const hasStepBack = current > 0;
|
|
156
|
+
const hasStepForward = current + 1 < history.length;
|
|
155
157
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(TopLeftPanel, {
|
|
156
|
-
hasStepBack
|
|
157
|
-
hasStepForward
|
|
158
|
+
hasStepBack,
|
|
159
|
+
hasStepForward,
|
|
158
160
|
onStepBack: () => historyOps.back(),
|
|
159
161
|
onStepForward: () => historyOps.forward()
|
|
160
162
|
}), closeable && /* @__PURE__ */ jsx(Panel, {
|
|
@@ -162,7 +164,10 @@ var RelationshipsBrowserInner = memo(() => {
|
|
|
162
164
|
children: /* @__PURE__ */ jsxs(Group, {
|
|
163
165
|
gap: 4,
|
|
164
166
|
wrap: "nowrap",
|
|
165
|
-
children: [/* @__PURE__ */ jsx(CopyLinkButton, {
|
|
167
|
+
children: [/* @__PURE__ */ jsx(CopyLinkButton, {
|
|
168
|
+
subjectId,
|
|
169
|
+
scope
|
|
170
|
+
}), /* @__PURE__ */ jsx(ActionIcon, {
|
|
166
171
|
variant: "default",
|
|
167
172
|
color: "gray",
|
|
168
173
|
onClick: (e) => {
|
|
@@ -248,15 +253,17 @@ var Tooltip$1 = Tooltip.withProps({
|
|
|
248
253
|
* Handles both browser history routing and hash-based routing.
|
|
249
254
|
* Preserves base paths when app is hosted under a sub-path.
|
|
250
255
|
*/
|
|
251
|
-
function buildRelationshipUrl(subjectId) {
|
|
256
|
+
function buildRelationshipUrl(subjectId, scope) {
|
|
252
257
|
const currentUrl = new URL(window.location.href);
|
|
253
258
|
if (currentUrl.hash.startsWith("#/")) {
|
|
254
259
|
const hashUrl = new URL(currentUrl.hash.substring(1), currentUrl.origin);
|
|
255
260
|
hashUrl.searchParams.set("relationships", subjectId);
|
|
261
|
+
hashUrl.searchParams.set("relationshipsScope", scope);
|
|
256
262
|
const cleanPath = hashUrl.pathname.replace(/\/$/, "");
|
|
257
263
|
return `${currentUrl.origin}${currentUrl.pathname}${currentUrl.search}#${cleanPath}${hashUrl.search}`;
|
|
258
264
|
}
|
|
259
265
|
currentUrl.searchParams.set("relationships", subjectId);
|
|
266
|
+
currentUrl.searchParams.set("relationshipsScope", scope);
|
|
260
267
|
return currentUrl.href;
|
|
261
268
|
}
|
|
262
269
|
/**
|
|
@@ -264,7 +271,7 @@ function buildRelationshipUrl(subjectId) {
|
|
|
264
271
|
* Shows visual feedback for both success and failure states.
|
|
265
272
|
* Note: Clipboard API requires HTTPS or localhost. This is a browser security restriction, not a code issue.
|
|
266
273
|
*/
|
|
267
|
-
var CopyLinkButton = ({ subjectId }) => {
|
|
274
|
+
var CopyLinkButton = ({ subjectId, scope }) => {
|
|
268
275
|
const clipboard = useClipboard({ timeout: 2e3 });
|
|
269
276
|
const [copyError, setCopyError] = useState(false);
|
|
270
277
|
const errorTimeoutRef = useRef(null);
|
|
@@ -275,7 +282,7 @@ var CopyLinkButton = ({ subjectId }) => {
|
|
|
275
282
|
clearTimeout(errorTimeoutRef.current);
|
|
276
283
|
errorTimeoutRef.current = null;
|
|
277
284
|
}
|
|
278
|
-
const url = buildRelationshipUrl(subjectId);
|
|
285
|
+
const url = buildRelationshipUrl(subjectId, scope);
|
|
279
286
|
if (!window.isSecureContext) {
|
|
280
287
|
setCopyError(true);
|
|
281
288
|
errorTimeoutRef.current = window.setTimeout(() => {
|
|
@@ -323,10 +330,10 @@ var CopyLinkButton = ({ subjectId }) => {
|
|
|
323
330
|
variant: "default",
|
|
324
331
|
color: "gray",
|
|
325
332
|
onClick: handleCopy,
|
|
326
|
-
"aria-label": "Copy
|
|
333
|
+
"aria-label": "Copy relationship URL",
|
|
327
334
|
children: buttonState.icon
|
|
328
335
|
})
|
|
329
336
|
});
|
|
330
337
|
};
|
|
331
338
|
//#endregion
|
|
332
|
-
export { RelationshipsBrowser };
|
|
339
|
+
export { RelationshipsBrowser, buildRelationshipUrl };
|
|
@@ -7,13 +7,7 @@ var SelectElement_css_exports = /* @__PURE__ */ __exportAll({
|
|
|
7
7
|
scrollArea: () => scrollArea
|
|
8
8
|
});
|
|
9
9
|
var node = css({ margin: "0" });
|
|
10
|
-
var label = css({ _hover: {
|
|
11
|
-
|
|
12
|
-
_dark: {
|
|
13
|
-
backgroundColor: "default.hover",
|
|
14
|
-
color: "white"
|
|
15
|
-
}
|
|
16
|
-
} });
|
|
17
|
-
var scrollArea = css({ maxHeight: ["70vh", "calc(100cqh - 70px)"] });
|
|
10
|
+
var label = css({ _hover: { backgroundColor: "surface.hover" } });
|
|
11
|
+
var scrollArea = css({ maxHeight: ["[70vh]", "[calc(100cqh - 70px)]"] });
|
|
18
12
|
//#endregion
|
|
19
13
|
export { SelectElement_css_exports, label, node, scrollArea };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { useDiagramEventHandlers } from "../../context/DiagramEventHandlers.js";
|
|
2
3
|
import { useLikeC4Model } from "../../hooks/useLikeC4Model.js";
|
|
3
4
|
import { useRelationshipsBrowser, useRelationshipsBrowserState } from "./hooks.js";
|
|
4
5
|
import { useLikeC4ElementsTree } from "../../hooks/useLikeC4ElementsTree.js";
|
|
@@ -22,6 +23,7 @@ var selector2 = (state) => {
|
|
|
22
23
|
};
|
|
23
24
|
var SelectElement = memo(() => {
|
|
24
25
|
const browser = useRelationshipsBrowser();
|
|
26
|
+
const { onRelationshipBrowserScopeChange } = useDiagramEventHandlers();
|
|
25
27
|
const { subjectId, viewId, scope, subjectExistsInScope, enableSelectSubject, enableChangeScope } = useRelationshipsBrowserState(selector2);
|
|
26
28
|
const root = useRef(null);
|
|
27
29
|
const viewport = useRef(null);
|
|
@@ -176,7 +178,9 @@ var SelectElement = memo(() => {
|
|
|
176
178
|
paddingRight: 8
|
|
177
179
|
} },
|
|
178
180
|
onChange: (value) => {
|
|
179
|
-
|
|
181
|
+
const nextScope = value;
|
|
182
|
+
browser.changeScope(nextScope);
|
|
183
|
+
onRelationshipBrowserScopeChange?.(nextScope);
|
|
180
184
|
},
|
|
181
185
|
data: [{
|
|
182
186
|
label: "Global",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { MinZoom, ZIndexes } from "../../base/const.js";
|
|
2
3
|
import { getNodeCenter } from "../../utils/xyflow.js";
|
|
3
4
|
import { Base } from "../../base/Base.js";
|
|
4
|
-
import { MinZoom, ZIndexes } from "../../base/const.js";
|
|
5
5
|
import { updateEdges } from "../../base/updateEdges.js";
|
|
6
6
|
import { updateNodes } from "../../base/updateNodes.js";
|
|
7
7
|
import { typedSystem } from "../../likec4diagram/state/utils.js";
|
|
@@ -43,7 +43,8 @@ var layouter = fromPromise(async ({ input, self, signal }) => {
|
|
|
43
43
|
x: nextSubjectNode.position.x + (nextSubjectNode.initialWidth ?? 0) / 2,
|
|
44
44
|
y: nextSubjectNode.position.y + (nextSubjectNode.initialHeight ?? 0) / 2
|
|
45
45
|
};
|
|
46
|
-
const
|
|
46
|
+
const currentSubjectInternalNode = xyflow.getInternalNode(currentSubjectNode.id);
|
|
47
|
+
const currentSubjectCenter = getNodeCenter(currentSubjectInternalNode);
|
|
47
48
|
const nested = /* @__PURE__ */ new Set();
|
|
48
49
|
currentNodes.forEach((n) => {
|
|
49
50
|
if (n.id === existingNode.id) return;
|