@likec4/diagram 1.38.1 → 1.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/{chunk-BZV0K82k.js → chunk-Bg7UjtMS.js} +332 -326
- package/bundle/custom.js +59 -59
- package/bundle/index.js +244 -170
- package/dist/LikeC4Diagram.props.d.ts +15 -8
- package/dist/base/BaseXYFlow.js +5 -5
- package/dist/base/index.d.ts +1 -2
- package/dist/base/primitives/MarkdownBlock.js +2 -1
- package/dist/base/primitives/customEdge.d.ts +3 -3
- package/dist/base/primitives/element/ElementTitle.js +2 -10
- package/dist/base/types.d.ts +62 -5
- package/dist/base/types.js +54 -0
- package/dist/bundle/LikeC4View.d.ts +2 -2
- package/dist/bundle/LikeC4View.props.d.ts +4 -3
- package/dist/bundle/ReactLikeC4.d.ts +4 -4
- package/dist/custom/customNodes.d.ts +2 -1
- package/dist/hooks/useXYFlow.d.ts +28 -29
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +4 -5
- package/dist/likec4diagram/custom/nodes/ElementActions.js +1 -1
- package/dist/likec4diagram/types.d.ts +2 -1
- package/dist/likec4diagram/useViewToNodesEdges.js +1 -1
- package/dist/likec4model/LikeC4ModelContext.d.ts +5 -2
- package/dist/likec4model/useLikeC4ElementsTree.js +1 -1
- package/dist/likec4model/useLikeC4Model.d.ts +7 -20
- package/dist/navigationpanel/NavigationPanel.js +3 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +6 -4
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +1 -0
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +83 -0
- package/dist/overlays/element-details/actor.d.ts +556 -557
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +2 -3
- package/dist/overlays/relationship-details/actor.d.ts +1 -1
- package/dist/overlays/relationship-details/actor.js +7 -7
- package/dist/overlays/relationship-details/compute.js +2 -1
- package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +2 -3
- package/dist/overlays/relationship-details/hooks.d.ts +18 -19
- package/dist/overlays/relationship-details/layout.js +2 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +2 -3
- package/dist/overlays/relationships-browser/actor.d.ts +12 -12
- package/dist/overlays/relationships-browser/actor.js +8 -8
- package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +2 -3
- package/dist/overlays/relationships-browser/layout.js +2 -1
- package/dist/search/components/ElementsColumn.js +1 -1
- package/dist/state/DiagramActorProvider.js +2 -2
- package/dist/state/assign.js +6 -6
- package/dist/state/diagram-machine.js +14 -14
- package/dist/styles-min.css +1 -1
- package/dist/styles-xyflow.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/xyflow.js +2 -2
- package/package.json +16 -16
- package/panda.buildinfo.json +14 -11
- package/src/LikeC4Diagram.props.ts +16 -16
- package/src/base/index.ts +1 -2
- package/src/base/primitives/MarkdownBlock.tsx +1 -0
- package/src/base/primitives/customEdge.ts +5 -5
- package/src/base/primitives/element/ElementTitle.tsx +10 -22
- package/src/base/types.ts +122 -13
- package/src/bundle/LikeC4View.props.ts +4 -3
- package/src/bundle/LikeC4View.tsx +6 -6
- package/src/bundle/ReactLikeC4.tsx +7 -6
- package/src/custom/customNodes.ts +3 -1
- package/src/hooks/useSetState.ts +2 -2
- package/src/likec4diagram/custom/nodes/ElementActions.tsx +2 -1
- package/src/likec4diagram/types.ts +1 -1
- package/src/likec4diagram/useViewToNodesEdges.ts +1 -1
- package/src/likec4model/LikeC4ModelContext.tsx +5 -2
- package/src/likec4model/useLikeC4ElementsTree.ts +3 -3
- package/src/likec4model/useLikeC4Model.ts +8 -5
- package/src/navigationpanel/NavigationPanel.tsx +2 -0
- package/src/navigationpanel/NavigationPanelDropdown.tsx +1 -1
- package/src/navigationpanel/walkthrough/ActiveWalkthroughControls.tsx +3 -1
- package/src/navigationpanel/walkthrough/WalkthroughPanel.tsx +88 -0
- package/src/overlays/relationship-details/compute.ts +3 -12
- package/src/overlays/relationship-details/layout.ts +3 -3
- package/src/overlays/relationships-browser/actor.ts +2 -1
- package/src/overlays/relationships-browser/layout.ts +3 -3
- package/src/search/components/ElementsColumn.tsx +3 -3
- package/src/utils/xyflow.ts +2 -2
- package/dist/base/types.Base.d.ts +0 -54
- package/dist/base/types.Base.js +0 -48
- package/dist/likec4diagram/custom/edges/NotePopover.d.ts +0 -4
- package/src/base/types.Base.ts +0 -104
- package/src/likec4diagram/custom/edges/NotePopover.tsx +0 -95
- /package/dist/{likec4diagram/custom/edges/NotePopover.css.d.ts → navigationpanel/walkthrough/WalkthroughPanel.css.d.ts} +0 -0
- /package/src/{likec4diagram/custom/edges/NotePopover.css.ts → navigationpanel/walkthrough/WalkthroughPanel.css.ts} +0 -0
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
elements: {
|
|
10
|
-
[x: string]: Partial< ElementSpecification>;
|
|
11
|
-
};
|
|
12
|
-
deployments: {
|
|
13
|
-
[x: string]: Partial< ElementSpecification>;
|
|
14
|
-
};
|
|
15
|
-
relationships: {
|
|
16
|
-
[x: string]: Partial< RelationshipSpecification>;
|
|
17
|
-
};
|
|
18
|
-
metadataKeys?: string[];
|
|
19
|
-
customColors?: CustomColorDefinitions;
|
|
20
|
-
};
|
|
1
|
+
import { LikeC4Model, LikeC4ViewModel } from '@likec4/core/model';
|
|
2
|
+
import type * as t from '@likec4/core/types';
|
|
3
|
+
type Any = t.aux.Any;
|
|
4
|
+
export declare function useLikeC4Model<A extends Any = t.aux.UnknownLayouted>(): LikeC4Model<A>;
|
|
5
|
+
export declare function useLikeC4ViewModel<A extends Any = t.aux.UnknownLayouted>(viewId: t.aux.ViewId<A>): LikeC4ViewModel<A>;
|
|
6
|
+
export declare function useLikeC4Specification(): t.Specification<t.aux.UnknownLayouted>;
|
|
7
|
+
export {};
|
|
@@ -15,6 +15,7 @@ import { navigationPanelActorLogic } from './actor.js';
|
|
|
15
15
|
import { NavigationPanelActorContextProvider } from './hooks.js';
|
|
16
16
|
import { NavigationPanelControls } from './NavigationPanelControls.js';
|
|
17
17
|
import { NavigationPanelDropdown } from './NavigationPanelDropdown.js';
|
|
18
|
+
import { WalkthroughPanel } from './walkthrough/WalkthroughPanel.js';
|
|
18
19
|
import { EditorPanel } from './editorpanel/EditorPanel.js';
|
|
19
20
|
import { ActiveWalkthroughControls } from './walkthrough/ActiveWalkthroughControls.js';
|
|
20
21
|
|
|
@@ -69,7 +70,8 @@ const NavigationPanel = memo(() => {
|
|
|
69
70
|
},
|
|
70
71
|
children: /* @__PURE__ */ jsxs(NavigationPanelActorContextProvider, { value: actorRef, children: [
|
|
71
72
|
/* @__PURE__ */ jsx(NavigationPanelImpl, { actor: actorRef }),
|
|
72
|
-
/* @__PURE__ */ jsx(EditorPanel, {})
|
|
73
|
+
/* @__PURE__ */ jsx(EditorPanel, {}),
|
|
74
|
+
/* @__PURE__ */ jsx(WalkthroughPanel, {})
|
|
73
75
|
] })
|
|
74
76
|
}
|
|
75
77
|
) });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { ifilter, ifirst, toArray, compareNaturalHierarchically, nonexhaustive } from '@likec4/core';
|
|
3
2
|
import { normalizeViewPath, VIEW_FOLDERS_SEPARATOR } from '@likec4/core/model';
|
|
3
|
+
import { ifilter, ifirst, toArray, compareNaturalHierarchically, nonexhaustive } from '@likec4/core/utils';
|
|
4
4
|
import { cx, css } from '@likec4/styles/css';
|
|
5
5
|
import { HStack, VStack, Box } from '@likec4/styles/jsx';
|
|
6
6
|
import { vstack, hstack } from '@likec4/styles/patterns';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { RichText } from '@likec4/core';
|
|
2
3
|
import { css } from '@likec4/styles/css';
|
|
3
4
|
import { Box } from '@likec4/styles/jsx';
|
|
4
5
|
import { Button, Badge, Portal } from '@mantine/core';
|
|
@@ -79,7 +80,8 @@ const ActiveWalkthroughControls = () => {
|
|
|
79
80
|
hasNext,
|
|
80
81
|
hasPrevious,
|
|
81
82
|
currentStep,
|
|
82
|
-
totalSteps
|
|
83
|
+
totalSteps,
|
|
84
|
+
notes
|
|
83
85
|
} = useDiagramContext((s) => {
|
|
84
86
|
const currentStepIndex = s.xyedges.findIndex((e) => e.id === s.activeWalkthrough?.stepId);
|
|
85
87
|
return {
|
|
@@ -87,7 +89,8 @@ const ActiveWalkthroughControls = () => {
|
|
|
87
89
|
hasNext: currentStepIndex < s.xyedges.length - 1,
|
|
88
90
|
hasPrevious: currentStepIndex > 0,
|
|
89
91
|
currentStep: currentStepIndex + 1,
|
|
90
|
-
totalSteps: s.xyedges.length
|
|
92
|
+
totalSteps: s.xyedges.length,
|
|
93
|
+
notes: s.xyedges[currentStepIndex]?.data?.notes ?? RichText.EMPTY
|
|
91
94
|
};
|
|
92
95
|
});
|
|
93
96
|
return /* @__PURE__ */ jsxs(AnimatePresence, { propagate: true, children: [
|
|
@@ -103,8 +106,7 @@ const ActiveWalkthroughControls = () => {
|
|
|
103
106
|
},
|
|
104
107
|
rightSection: /* @__PURE__ */ jsx(IconPlayerStopFilled, { size: 10 }),
|
|
105
108
|
children: "Stop"
|
|
106
|
-
}
|
|
107
|
-
"trigger-dynamic-walkthrough"
|
|
109
|
+
}
|
|
108
110
|
),
|
|
109
111
|
/* @__PURE__ */ jsx(
|
|
110
112
|
PrevNextButton,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WalkthroughPanel: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { RichText } from '@likec4/core';
|
|
3
|
+
import { cx, css } from '@likec4/styles/css';
|
|
4
|
+
import { styled } from '@likec4/styles/jsx';
|
|
5
|
+
import { vstack } from '@likec4/styles/patterns';
|
|
6
|
+
import { ScrollAreaAutosize } from '@mantine/core';
|
|
7
|
+
import { isNonNull, isTruthy } from 'remeda';
|
|
8
|
+
import { useDiagramContext } from '../../hooks/useDiagram.js';
|
|
9
|
+
import { MarkdownBlock } from '../../base/primitives/MarkdownBlock.js';
|
|
10
|
+
|
|
11
|
+
const SectionHeader = styled("div", {
|
|
12
|
+
base: {
|
|
13
|
+
fontSize: "xs",
|
|
14
|
+
color: "mantine.colors.dimmed",
|
|
15
|
+
fontWeight: 500,
|
|
16
|
+
userSelect: "none",
|
|
17
|
+
mb: "xxs"
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
function selectWalkthroughNotes(s) {
|
|
21
|
+
const isActive = isNonNull(s.activeWalkthrough);
|
|
22
|
+
const activeStepIndex = isActive ? s.xyedges.findIndex((e) => e.id === s.activeWalkthrough?.stepId) : -1;
|
|
23
|
+
return {
|
|
24
|
+
isActive,
|
|
25
|
+
isParallel: isActive && isTruthy(s.activeWalkthrough?.parallelPrefix),
|
|
26
|
+
hasNext: isActive && activeStepIndex < s.xyedges.length - 1,
|
|
27
|
+
hasPrevious: isActive && activeStepIndex > 0,
|
|
28
|
+
notes: isActive ? s.xyedges[activeStepIndex]?.data?.notes ?? RichText.EMPTY : null
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const WalkthroughPanel = () => {
|
|
32
|
+
const { notes } = useDiagramContext(selectWalkthroughNotes);
|
|
33
|
+
if (!notes || notes.isEmpty) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return /* @__PURE__ */ jsx(styled.div, { position: "relative", children: /* @__PURE__ */ jsxs(
|
|
37
|
+
ScrollAreaAutosize,
|
|
38
|
+
{
|
|
39
|
+
className: cx(
|
|
40
|
+
"nowheel nopan nodrag",
|
|
41
|
+
vstack({
|
|
42
|
+
position: "absolute",
|
|
43
|
+
layerStyle: "likec4.dropdown",
|
|
44
|
+
gap: "sm",
|
|
45
|
+
padding: "md",
|
|
46
|
+
paddingTop: "xxs",
|
|
47
|
+
pointerEvents: "all",
|
|
48
|
+
maxWidth: "calc(100cqw - 32px)",
|
|
49
|
+
minWidth: "calc(100cqw - 50px)",
|
|
50
|
+
maxHeight: "calc(100cqh - 100px)",
|
|
51
|
+
width: "max-content",
|
|
52
|
+
cursor: "default",
|
|
53
|
+
overflow: "auto",
|
|
54
|
+
overscrollBehavior: "contain",
|
|
55
|
+
"@/sm": {
|
|
56
|
+
minWidth: 400,
|
|
57
|
+
maxWidth: 550
|
|
58
|
+
},
|
|
59
|
+
"@/lg": {
|
|
60
|
+
maxWidth: 700
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
),
|
|
64
|
+
type: "scroll",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "Notes" }),
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
MarkdownBlock,
|
|
69
|
+
{
|
|
70
|
+
value: notes,
|
|
71
|
+
fontSize: "sm",
|
|
72
|
+
emptyText: "No description",
|
|
73
|
+
className: css({
|
|
74
|
+
userSelect: "all"
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
) });
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export { WalkthroughPanel };
|