@eventcatalog/core 5.0.0-beta.11 → 5.0.0-beta.13
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 +1 -1
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +4 -4
- package/dist/catalog-runtime.cjs +1 -1
- package/dist/{chunk-MFEMKQZ6.js → chunk-BO2HHVZ3.js} +1 -1
- package/dist/{chunk-4YFM63DS.js → chunk-JPT3QC5V.js} +1 -1
- package/dist/{chunk-76DAAJLV.js → chunk-PLTLW45Q.js} +5 -5
- package/dist/{chunk-WM4QYMIA.js → chunk-T75DOVFP.js} +1 -1
- package/dist/{chunk-LQZ7IG7B.js → chunk-XA5W6DXX.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +2 -2
- package/dist/eventcatalog.js +14 -14
- package/dist/federation/federate.js +3 -3
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/runtime-dependencies/@eventcatalog__visualiser__studio-fonts.css.mjs +3 -0
- package/dist/runtime-dependencies/@eventcatalog__visualiser__studio.css.mjs +3 -0
- package/dist/runtime-dependencies/@eventcatalog__visualiser__studio.mjs +3 -0
- package/dist/runtime-dependencies/manifest.json +3 -0
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +2 -0
- package/eventcatalog/src/components/MDX/NodeGraph/AstroNodeGraph.tsx +42 -3
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +5 -1
- package/eventcatalog/src/components/NavigationProgress.astro +7 -0
- package/eventcatalog/src/features/mcp/apps/architecture-diagram/node-chat.tsx +6 -45
- package/eventcatalog/src/features/mcp/apps/canvas/shared.ts +3 -3
- package/eventcatalog/src/features/mcp/apps/canvas/styles.css +3 -1
- package/eventcatalog/src/features/mcp/apps/canvas/view.tsx +7 -5
- package/eventcatalog/src/features/mcp/apps/generated/canvas.html +132 -70
- package/eventcatalog/src/features/mcp/apps/generated/viewer.html +71 -71
- package/eventcatalog/src/features/studio/agent-choreography.ts +13 -10
- package/eventcatalog/src/features/studio/agents.ts +28 -0
- package/eventcatalog/src/features/studio/api/canvases-api.ts +64 -15
- package/eventcatalog/src/features/studio/api/client.ts +6 -1
- package/eventcatalog/src/features/studio/canvas-actions.ts +160 -34
- package/eventcatalog/src/features/studio/canvas-preview.ts +1 -2
- package/eventcatalog/src/features/studio/catalog.ts +16 -14
- package/eventcatalog/src/features/studio/components/CanvasHeader.tsx +263 -115
- package/eventcatalog/src/features/studio/components/CanvasStatusMenu.tsx +15 -14
- package/eventcatalog/src/features/studio/components/ConnectAgentDialog.tsx +272 -119
- package/eventcatalog/src/features/studio/components/ConnectionsChooser.tsx +1 -2
- package/eventcatalog/src/features/studio/components/DeleteCanvasDialog.tsx +28 -44
- package/eventcatalog/src/features/studio/components/Dialog.tsx +60 -0
- package/eventcatalog/src/features/studio/components/JoinForm.tsx +101 -26
- package/eventcatalog/src/features/studio/components/LeftPanel.tsx +119 -230
- package/eventcatalog/src/features/studio/components/NodeDetails.tsx +183 -0
- package/eventcatalog/src/features/studio/components/OpenInStudioDialog.tsx +79 -0
- package/eventcatalog/src/features/studio/components/Presence.tsx +52 -45
- package/eventcatalog/src/features/studio/components/ShareDialog.tsx +277 -141
- package/eventcatalog/src/features/studio/components/ShortcutsDialog.tsx +41 -0
- package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +1286 -411
- package/eventcatalog/src/features/studio/document-name.ts +7 -0
- package/eventcatalog/src/features/studio/from-visualiser.ts +138 -0
- package/eventcatalog/src/features/studio/hooks/presence-sender.ts +19 -2
- package/eventcatalog/src/features/studio/hooks/use-canvas-webmcp.ts +9 -3
- package/eventcatalog/src/features/studio/hooks/use-comments.ts +2 -2
- package/eventcatalog/src/features/studio/hooks/use-follow-camera.ts +8 -3
- package/eventcatalog/src/features/studio/hooks/use-studio-flow.ts +223 -30
- package/eventcatalog/src/features/studio/identity.ts +23 -1
- package/eventcatalog/src/features/studio/limits.ts +2 -0
- package/eventcatalog/src/features/studio/pages/[id].astro +2 -1
- package/eventcatalog/src/features/studio/pages/index.astro +2 -2
- package/eventcatalog/src/features/studio/server/canvas-mcp.ts +8 -23
- package/eventcatalog/src/features/studio/server/runtime.ts +16 -9
- package/eventcatalog/src/utils/node-graphs/domain-levels-node-graph.ts +3 -3
- package/eventcatalog/src/utils/node-graphs/node-resource.ts +67 -0
- package/eventcatalog/src/utils/node-graphs/systems-node-graph.ts +1 -1
- package/package.json +3 -3
- package/eventcatalog/src/features/studio/canvas-doc.ts +0 -414
- package/eventcatalog/src/features/studio/clipboard.ts +0 -97
- package/eventcatalog/src/features/studio/components/CanvasControls.tsx +0 -154
- package/eventcatalog/src/features/studio/components/Comments.tsx +0 -770
- package/eventcatalog/src/features/studio/components/ContainerChooser.tsx +0 -145
- package/eventcatalog/src/features/studio/components/DragGhost.tsx +0 -115
- package/eventcatalog/src/features/studio/components/Picture.tsx +0 -21
- package/eventcatalog/src/features/studio/components/PropertiesPanel.tsx +0 -212
- package/eventcatalog/src/features/studio/components/canvas-nodes.tsx +0 -255
- package/eventcatalog/src/features/studio/components/icons.ts +0 -53
- package/eventcatalog/src/features/studio/components/status.ts +0 -53
- package/eventcatalog/src/features/studio/edges.ts +0 -56
- package/eventcatalog/src/features/studio/flow-state.ts +0 -92
- package/eventcatalog/src/features/studio/grouping.ts +0 -226
- package/eventcatalog/src/features/studio/layout.ts +0 -42
- package/eventcatalog/src/features/studio/levels.ts +0 -282
- package/eventcatalog/src/features/studio/node-types.ts +0 -205
- package/eventcatalog/src/features/studio/placement.ts +0 -197
- package/eventcatalog/src/features/studio/studio.css +0 -273
- package/dist/{chunk-KHACCTW2.js → chunk-ZEY2XUJN.js} +4 -4
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { memo, type ReactNode } from 'react';
|
|
2
|
-
import { useReactFlow, useStore } from '@xyflow/react';
|
|
3
|
-
import { Maximize, MessageCircle, Redo, SendToBack, StickyNote, Undo, ZoomIn, ZoomOut } from 'lucide-react';
|
|
4
|
-
import { LEVELS, type Level } from '../levels';
|
|
5
|
-
|
|
6
|
-
// The canvas's bottom bar: layout, view, levels of detail, undo, comments and notes
|
|
7
|
-
|
|
8
|
-
export const FIT_VIEW_OPTIONS = { padding: { top: '80px', right: '60px', bottom: '100px', left: '60px' } } as const;
|
|
9
|
-
|
|
10
|
-
function ControlButton({
|
|
11
|
-
label,
|
|
12
|
-
onClick,
|
|
13
|
-
disabled,
|
|
14
|
-
active,
|
|
15
|
-
children,
|
|
16
|
-
}: {
|
|
17
|
-
label: string;
|
|
18
|
-
onClick: () => void;
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
active?: boolean;
|
|
21
|
-
children: ReactNode;
|
|
22
|
-
}) {
|
|
23
|
-
return (
|
|
24
|
-
<button
|
|
25
|
-
title={label}
|
|
26
|
-
aria-label={label}
|
|
27
|
-
onClick={onClick}
|
|
28
|
-
disabled={disabled}
|
|
29
|
-
className={`rounded-full p-2 transition-colors ${
|
|
30
|
-
disabled
|
|
31
|
-
? 'cursor-not-allowed opacity-40'
|
|
32
|
-
: active
|
|
33
|
-
? 'bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent))]'
|
|
34
|
-
: 'text-[rgb(var(--ec-icon-color))] hover:bg-[rgb(var(--ec-page-border)/0.5)] hover:text-[rgb(var(--ec-icon-hover))]'
|
|
35
|
-
}`}
|
|
36
|
-
>
|
|
37
|
-
{children}
|
|
38
|
-
</button>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** Isolated, so the bar only re-renders when the zoom changes (not on every pan) */
|
|
43
|
-
function ZoomLevel() {
|
|
44
|
-
const zoom = useStore((state) => Math.round(state.transform[2] * 100));
|
|
45
|
-
return <div className="w-12 text-center text-xs font-medium tabular-nums text-[rgb(var(--ec-page-text-muted))]">{zoom}%</div>;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const Divider = () => <div className="mx-1 h-6 w-px bg-[rgb(var(--ec-page-border))]" />;
|
|
49
|
-
|
|
50
|
-
function LevelSwitch({
|
|
51
|
-
level,
|
|
52
|
-
onChange,
|
|
53
|
-
unavailable,
|
|
54
|
-
}: {
|
|
55
|
-
level: Level;
|
|
56
|
-
onChange: (level: Level) => void;
|
|
57
|
-
unavailable: Partial<Record<Level, string | undefined>>;
|
|
58
|
-
}) {
|
|
59
|
-
return (
|
|
60
|
-
<div role="group" aria-label="Level of detail" className="flex items-center gap-0.5">
|
|
61
|
-
{LEVELS.map(({ level: value, description }) => {
|
|
62
|
-
const reason = unavailable[value];
|
|
63
|
-
const active = value === level;
|
|
64
|
-
return (
|
|
65
|
-
<button
|
|
66
|
-
key={value}
|
|
67
|
-
title={`Level ${value}: ${description}${reason ? `. ${reason}` : ''}`}
|
|
68
|
-
// Stays focusable when unavailable, so its title can say why
|
|
69
|
-
aria-disabled={!!reason}
|
|
70
|
-
aria-pressed={active}
|
|
71
|
-
onClick={() => !reason && onChange(value)}
|
|
72
|
-
className={`h-8 min-w-8 rounded-full px-2 text-xs font-semibold tabular-nums transition-colors ${
|
|
73
|
-
reason
|
|
74
|
-
? 'cursor-not-allowed opacity-40'
|
|
75
|
-
: active
|
|
76
|
-
? 'bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent))]'
|
|
77
|
-
: 'text-[rgb(var(--ec-page-text-muted))] hover:bg-[rgb(var(--ec-page-border)/0.5)]'
|
|
78
|
-
}`}
|
|
79
|
-
>
|
|
80
|
-
L{value}
|
|
81
|
-
</button>
|
|
82
|
-
);
|
|
83
|
-
})}
|
|
84
|
-
</div>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export default memo(function CanvasControls({
|
|
89
|
-
level,
|
|
90
|
-
onLevelChange,
|
|
91
|
-
unavailableLevels,
|
|
92
|
-
editable,
|
|
93
|
-
onReorder,
|
|
94
|
-
canUndo,
|
|
95
|
-
canRedo,
|
|
96
|
-
onUndo,
|
|
97
|
-
onRedo,
|
|
98
|
-
commentMode,
|
|
99
|
-
onToggleCommentMode,
|
|
100
|
-
onAddNote,
|
|
101
|
-
}: {
|
|
102
|
-
level: Level;
|
|
103
|
-
onLevelChange: (level: Level) => void;
|
|
104
|
-
unavailableLevels: Partial<Record<Level, string | undefined>>;
|
|
105
|
-
/** L1 and L2 are read only views of the canvas */
|
|
106
|
-
editable: boolean;
|
|
107
|
-
onReorder: () => void;
|
|
108
|
-
canUndo: boolean;
|
|
109
|
-
canRedo: boolean;
|
|
110
|
-
onUndo: () => void;
|
|
111
|
-
onRedo: () => void;
|
|
112
|
-
commentMode: boolean;
|
|
113
|
-
onToggleCommentMode: () => void;
|
|
114
|
-
onAddNote: () => void;
|
|
115
|
-
}) {
|
|
116
|
-
const { fitView, zoomIn, zoomOut } = useReactFlow();
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<div className="absolute bottom-4 left-1/2 z-10 -translate-x-1/2">
|
|
120
|
-
<div className="flex items-center gap-1 rounded-full border px-2 py-1 shadow-lg bg-[rgb(var(--ec-card-bg))] border-[rgb(var(--ec-page-border))]">
|
|
121
|
-
<ControlButton label="Reorder diagram (the visualiser's layout)" onClick={onReorder} disabled={!editable}>
|
|
122
|
-
<SendToBack className="h-4 w-4" />
|
|
123
|
-
</ControlButton>
|
|
124
|
-
<ControlButton label="Fit view" onClick={() => void fitView({ ...FIT_VIEW_OPTIONS, duration: 500 })}>
|
|
125
|
-
<Maximize className="h-4 w-4" />
|
|
126
|
-
</ControlButton>
|
|
127
|
-
<ControlButton label="Zoom out" onClick={() => void zoomOut({ duration: 200 })}>
|
|
128
|
-
<ZoomOut className="h-4 w-4" />
|
|
129
|
-
</ControlButton>
|
|
130
|
-
<ZoomLevel />
|
|
131
|
-
<ControlButton label="Zoom in" onClick={() => void zoomIn({ duration: 200 })}>
|
|
132
|
-
<ZoomIn className="h-4 w-4" />
|
|
133
|
-
</ControlButton>
|
|
134
|
-
<Divider />
|
|
135
|
-
<LevelSwitch level={level} onChange={onLevelChange} unavailable={unavailableLevels} />
|
|
136
|
-
<Divider />
|
|
137
|
-
<ControlButton label="Undo (⌘Z)" onClick={onUndo} disabled={!canUndo}>
|
|
138
|
-
<Undo className="h-4 w-4" />
|
|
139
|
-
</ControlButton>
|
|
140
|
-
<ControlButton label="Redo (⇧⌘Z)" onClick={onRedo} disabled={!canRedo}>
|
|
141
|
-
<Redo className="h-4 w-4" />
|
|
142
|
-
</ControlButton>
|
|
143
|
-
<Divider />
|
|
144
|
-
<ControlButton label="Comment (C)" onClick={onToggleCommentMode} active={commentMode} disabled={!editable}>
|
|
145
|
-
<MessageCircle className="h-4 w-4" />
|
|
146
|
-
</ControlButton>
|
|
147
|
-
{/* Notes can be added on every level, and are shown on the level they're added on */}
|
|
148
|
-
<ControlButton label={editable ? 'Add sticky note' : `Add sticky note to L${level}`} onClick={onAddNote}>
|
|
149
|
-
<StickyNote className="h-4 w-4 text-yellow-500" />
|
|
150
|
-
</ControlButton>
|
|
151
|
-
</div>
|
|
152
|
-
</div>
|
|
153
|
-
);
|
|
154
|
-
});
|