@eventcatalog/core 5.0.0-beta.12 → 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.
Files changed (82) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +4 -4
  5. package/dist/catalog-runtime.cjs +1 -1
  6. package/dist/{chunk-FY6MSP6J.js → chunk-BO2HHVZ3.js} +1 -1
  7. package/dist/{chunk-CX2VB7AI.js → chunk-JPT3QC5V.js} +1 -1
  8. package/dist/{chunk-BWC4YKW3.js → chunk-PLTLW45Q.js} +5 -5
  9. package/dist/{chunk-TSY5CC27.js → chunk-T75DOVFP.js} +1 -1
  10. package/dist/{chunk-QB7X34OD.js → chunk-XA5W6DXX.js} +1 -1
  11. package/dist/constants.cjs +1 -1
  12. package/dist/constants.js +1 -1
  13. package/dist/eventcatalog.cjs +2 -2
  14. package/dist/eventcatalog.js +14 -14
  15. package/dist/federation/federate.js +3 -3
  16. package/dist/generate.cjs +1 -1
  17. package/dist/generate.js +3 -3
  18. package/dist/runtime-dependencies/@eventcatalog__visualiser__studio-fonts.css.mjs +3 -0
  19. package/dist/runtime-dependencies/@eventcatalog__visualiser__studio.css.mjs +3 -0
  20. package/dist/runtime-dependencies/@eventcatalog__visualiser__studio.mjs +3 -0
  21. package/dist/runtime-dependencies/manifest.json +3 -0
  22. package/dist/utils/cli-logger.cjs +1 -1
  23. package/dist/utils/cli-logger.js +2 -2
  24. package/eventcatalog/src/components/MDX/NodeGraph/AstroNodeGraph.tsx +11 -3
  25. package/eventcatalog/src/features/mcp/apps/canvas/shared.ts +3 -3
  26. package/eventcatalog/src/features/mcp/apps/canvas/styles.css +3 -1
  27. package/eventcatalog/src/features/mcp/apps/canvas/view.tsx +7 -5
  28. package/eventcatalog/src/features/mcp/apps/generated/canvas.html +133 -71
  29. package/eventcatalog/src/features/mcp/apps/generated/viewer.html +66 -66
  30. package/eventcatalog/src/features/studio/agent-choreography.ts +5 -4
  31. package/eventcatalog/src/features/studio/agents.ts +28 -0
  32. package/eventcatalog/src/features/studio/api/canvases-api.ts +1 -1
  33. package/eventcatalog/src/features/studio/canvas-actions.ts +22 -14
  34. package/eventcatalog/src/features/studio/canvas-preview.ts +1 -2
  35. package/eventcatalog/src/features/studio/catalog.ts +1 -4
  36. package/eventcatalog/src/features/studio/components/CanvasHeader.tsx +246 -115
  37. package/eventcatalog/src/features/studio/components/CanvasStatusMenu.tsx +7 -3
  38. package/eventcatalog/src/features/studio/components/ConnectAgentDialog.tsx +272 -119
  39. package/eventcatalog/src/features/studio/components/ConnectionsChooser.tsx +1 -2
  40. package/eventcatalog/src/features/studio/components/DeleteCanvasDialog.tsx +1 -1
  41. package/eventcatalog/src/features/studio/components/JoinForm.tsx +101 -26
  42. package/eventcatalog/src/features/studio/components/LeftPanel.tsx +102 -241
  43. package/eventcatalog/src/features/studio/components/NodeDetails.tsx +183 -0
  44. package/eventcatalog/src/features/studio/components/OpenInStudioDialog.tsx +1 -1
  45. package/eventcatalog/src/features/studio/components/Presence.tsx +6 -8
  46. package/eventcatalog/src/features/studio/components/ShareDialog.tsx +277 -141
  47. package/eventcatalog/src/features/studio/components/ShortcutsDialog.tsx +41 -0
  48. package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +1005 -354
  49. package/eventcatalog/src/features/studio/document-name.ts +7 -0
  50. package/eventcatalog/src/features/studio/from-visualiser.ts +1 -1
  51. package/eventcatalog/src/features/studio/hooks/presence-sender.ts +19 -2
  52. package/eventcatalog/src/features/studio/hooks/use-canvas-webmcp.ts +9 -3
  53. package/eventcatalog/src/features/studio/hooks/use-comments.ts +2 -2
  54. package/eventcatalog/src/features/studio/hooks/use-studio-flow.ts +162 -23
  55. package/eventcatalog/src/features/studio/identity.ts +23 -1
  56. package/eventcatalog/src/features/studio/pages/[id].astro +2 -1
  57. package/eventcatalog/src/features/studio/pages/index.astro +1 -2
  58. package/eventcatalog/src/features/studio/server/canvas-mcp.ts +7 -22
  59. package/eventcatalog/src/features/studio/server/runtime.ts +4 -5
  60. package/package.json +3 -3
  61. package/eventcatalog/src/features/studio/canvas-doc.ts +0 -569
  62. package/eventcatalog/src/features/studio/clipboard.ts +0 -97
  63. package/eventcatalog/src/features/studio/components/CanvasControls.tsx +0 -119
  64. package/eventcatalog/src/features/studio/components/Comments.tsx +0 -777
  65. package/eventcatalog/src/features/studio/components/ContainerChooser.tsx +0 -145
  66. package/eventcatalog/src/features/studio/components/DragGhost.tsx +0 -115
  67. package/eventcatalog/src/features/studio/components/Picture.tsx +0 -21
  68. package/eventcatalog/src/features/studio/components/PropertiesPanel.tsx +0 -212
  69. package/eventcatalog/src/features/studio/components/canvas-nodes.tsx +0 -271
  70. package/eventcatalog/src/features/studio/components/icons.ts +0 -53
  71. package/eventcatalog/src/features/studio/components/status.ts +0 -53
  72. package/eventcatalog/src/features/studio/edges.ts +0 -56
  73. package/eventcatalog/src/features/studio/flow-state.ts +0 -121
  74. package/eventcatalog/src/features/studio/grouping.ts +0 -230
  75. package/eventcatalog/src/features/studio/hooks/use-counter-scale.ts +0 -20
  76. package/eventcatalog/src/features/studio/layout.ts +0 -56
  77. package/eventcatalog/src/features/studio/level-layout.ts +0 -145
  78. package/eventcatalog/src/features/studio/levels.ts +0 -337
  79. package/eventcatalog/src/features/studio/node-types.ts +0 -245
  80. package/eventcatalog/src/features/studio/placement.ts +0 -197
  81. package/eventcatalog/src/features/studio/studio.css +0 -273
  82. package/dist/{chunk-KHACCTW2.js → chunk-ZEY2XUJN.js} +4 -4
@@ -1,119 +0,0 @@
1
- import { memo } from 'react';
2
- import { useReactFlow } from '@xyflow/react';
3
- import { Maximize, MessageCircle, Redo, SendToBack, StickyNote, Undo, ZoomIn, ZoomOut } from 'lucide-react';
4
- import { DIAGRAM_FIT_VIEW_OPTIONS, Toolbar, ToolbarButton, ToolbarDivider, ZoomLevel } from '@eventcatalog/visualiser';
5
- import { LEVELS, type Level } from '../levels';
6
-
7
- // The canvas's bottom bar: layout, view, levels of detail, undo, comments and notes. Built from the visualiser's
8
- // toolbar, so it looks and works like a diagram's bar (in the same places: the view on the left, then the levels).
9
-
10
- // Fitted like the visualiser fits a diagram
11
- export const FIT_VIEW_OPTIONS = DIAGRAM_FIT_VIEW_OPTIONS;
12
-
13
- // Why comments can't be added on L1 or L2 (they're pinned to the canvas, L3)
14
- const EDIT_IN_L3 = 'Only on L3, where comments are pinned';
15
-
16
- function LevelSwitch({
17
- level,
18
- onChange,
19
- unavailable,
20
- }: {
21
- level: Level;
22
- onChange: (level: Level) => void;
23
- unavailable: Partial<Record<Level, string | undefined>>;
24
- }) {
25
- return (
26
- <div role="group" aria-label="Level of detail" className="flex items-center gap-0.5">
27
- {LEVELS.map(({ level: value, description }) => (
28
- <ToolbarButton
29
- key={value}
30
- label={`Level ${value}: ${description}`}
31
- hint={unavailable[value]}
32
- active={value === level}
33
- disabled={!!unavailable[value]}
34
- onClick={() => onChange(value)}
35
- >
36
- <span className="text-xs font-semibold">L{value}</span>
37
- </ToolbarButton>
38
- ))}
39
- </div>
40
- );
41
- }
42
-
43
- export default memo(function CanvasControls({
44
- level,
45
- onLevelChange,
46
- unavailableLevels,
47
- editable,
48
- onReorder,
49
- canUndo,
50
- canRedo,
51
- onUndo,
52
- onRedo,
53
- commentMode,
54
- onToggleCommentMode,
55
- onAddNote,
56
- }: {
57
- level: Level;
58
- onLevelChange: (level: Level) => void;
59
- unavailableLevels: Partial<Record<Level, string | undefined>>;
60
- /** L3, the canvas itself (comments are there; L1 and L2 are arranged on their own) */
61
- editable: boolean;
62
- onReorder: () => void;
63
- canUndo: boolean;
64
- canRedo: boolean;
65
- onUndo: () => void;
66
- onRedo: () => void;
67
- commentMode: boolean;
68
- onToggleCommentMode: () => void;
69
- onAddNote: () => void;
70
- }) {
71
- const { fitView, zoomIn, zoomOut } = useReactFlow();
72
-
73
- return (
74
- // Where the visualiser's bar is (React Flow's bottom-center panel)
75
- <div className="absolute bottom-[15px] left-1/2 z-10 -translate-x-1/2">
76
- <Toolbar>
77
- <ToolbarButton
78
- label={editable ? "Reorder diagram (the visualiser's layout)" : `Reorder L${level} (the visualiser's layout)`}
79
- onClick={onReorder}
80
- >
81
- <SendToBack className="h-4 w-4" />
82
- </ToolbarButton>
83
- <ToolbarButton label="Fit view" onClick={() => void fitView({ ...FIT_VIEW_OPTIONS, duration: 500 })}>
84
- <Maximize className="h-4 w-4" />
85
- </ToolbarButton>
86
- <ToolbarButton label="Zoom out" onClick={() => void zoomOut({ duration: 200 })}>
87
- <ZoomOut className="h-4 w-4" />
88
- </ToolbarButton>
89
- <ZoomLevel />
90
- <ToolbarButton label="Zoom in" onClick={() => void zoomIn({ duration: 200 })}>
91
- <ZoomIn className="h-4 w-4" />
92
- </ToolbarButton>
93
- <ToolbarDivider />
94
- <LevelSwitch level={level} onChange={onLevelChange} unavailable={unavailableLevels} />
95
- <ToolbarDivider />
96
- <ToolbarButton label="Undo (⌘Z)" hint={canUndo ? undefined : 'Nothing to undo'} disabled={!canUndo} onClick={onUndo}>
97
- <Undo className="h-4 w-4" />
98
- </ToolbarButton>
99
- <ToolbarButton label="Redo (⇧⌘Z)" hint={canRedo ? undefined : 'Nothing to redo'} disabled={!canRedo} onClick={onRedo}>
100
- <Redo className="h-4 w-4" />
101
- </ToolbarButton>
102
- <ToolbarDivider />
103
- <ToolbarButton
104
- label="Comment (C)"
105
- hint={editable ? undefined : EDIT_IN_L3}
106
- active={commentMode}
107
- disabled={!editable}
108
- onClick={onToggleCommentMode}
109
- >
110
- <MessageCircle className="h-4 w-4" />
111
- </ToolbarButton>
112
- {/* Notes can be added on every level, and are shown on the level they're added on */}
113
- <ToolbarButton label={editable ? 'Add sticky note' : `Add sticky note to L${level}`} onClick={onAddNote}>
114
- <StickyNote className="h-4 w-4 text-yellow-500" />
115
- </ToolbarButton>
116
- </Toolbar>
117
- </div>
118
- );
119
- });