@eventcatalog/core 5.0.0-beta.12 → 5.0.0-beta.14

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 (90) hide show
  1. package/LICENSE +13 -12
  2. package/dist/analytics/analytics.cjs +1 -1
  3. package/dist/analytics/analytics.js +2 -2
  4. package/dist/analytics/log-build.cjs +1 -1
  5. package/dist/analytics/log-build.js +3 -3
  6. package/dist/catalog-runtime.cjs +1 -1
  7. package/dist/{chunk-TSY5CC27.js → chunk-4KE3EUDJ.js} +1 -1
  8. package/dist/{chunk-FY6MSP6J.js → chunk-I3XDOICA.js} +1 -1
  9. package/dist/{chunk-QB7X34OD.js → chunk-OFK7U7BX.js} +1 -1
  10. package/dist/{chunk-CX2VB7AI.js → chunk-PI5YNZZZ.js} +1 -1
  11. package/dist/{chunk-BWC4YKW3.js → chunk-WY6M3RPT.js} +1 -1
  12. package/dist/constants.cjs +1 -1
  13. package/dist/constants.js +1 -1
  14. package/dist/eventcatalog.cjs +11 -6
  15. package/dist/eventcatalog.js +14 -9
  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/astro.config.mjs +13 -1
  25. package/eventcatalog/integrations/skip-startup-reload.mjs +31 -0
  26. package/eventcatalog/integrations/stable-dependency-order.mjs +29 -0
  27. package/eventcatalog/src/components/CatalogGraph/CatalogForceGraph.tsx +39 -0
  28. package/eventcatalog/src/components/MDX/NodeGraph/AstroNodeGraph.tsx +11 -3
  29. package/eventcatalog/src/components/Search/SearchDataLoader.astro +16 -28
  30. package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +37 -76
  31. package/eventcatalog/src/components/SideNav/NestedSideBar/storage.ts +2 -0
  32. package/eventcatalog/src/components/SideNav/NestedSideBar/utils.ts +122 -1
  33. package/eventcatalog/src/components/SideNav/SideNav.astro +9 -1
  34. package/eventcatalog/src/features/mcp/apps/canvas/shared.ts +3 -3
  35. package/eventcatalog/src/features/mcp/apps/canvas/styles.css +3 -1
  36. package/eventcatalog/src/features/mcp/apps/canvas/view.tsx +7 -5
  37. package/eventcatalog/src/features/mcp/apps/generated/canvas.html +133 -71
  38. package/eventcatalog/src/features/mcp/apps/generated/viewer.html +66 -66
  39. package/eventcatalog/src/features/studio/agent-choreography.ts +5 -4
  40. package/eventcatalog/src/features/studio/agents.ts +28 -0
  41. package/eventcatalog/src/features/studio/api/canvases-api.ts +1 -1
  42. package/eventcatalog/src/features/studio/canvas-actions.ts +22 -14
  43. package/eventcatalog/src/features/studio/canvas-preview.ts +1 -2
  44. package/eventcatalog/src/features/studio/catalog.ts +1 -4
  45. package/eventcatalog/src/features/studio/components/CanvasHeader.tsx +246 -115
  46. package/eventcatalog/src/features/studio/components/CanvasStatusMenu.tsx +7 -3
  47. package/eventcatalog/src/features/studio/components/ConnectAgentDialog.tsx +272 -119
  48. package/eventcatalog/src/features/studio/components/ConnectionsChooser.tsx +1 -2
  49. package/eventcatalog/src/features/studio/components/DeleteCanvasDialog.tsx +1 -1
  50. package/eventcatalog/src/features/studio/components/JoinForm.tsx +101 -26
  51. package/eventcatalog/src/features/studio/components/LeftPanel.tsx +102 -241
  52. package/eventcatalog/src/features/studio/components/NodeDetails.tsx +183 -0
  53. package/eventcatalog/src/features/studio/components/OpenInStudioDialog.tsx +1 -1
  54. package/eventcatalog/src/features/studio/components/Presence.tsx +6 -8
  55. package/eventcatalog/src/features/studio/components/ShareDialog.tsx +277 -141
  56. package/eventcatalog/src/features/studio/components/ShortcutsDialog.tsx +41 -0
  57. package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +1005 -354
  58. package/eventcatalog/src/features/studio/document-name.ts +7 -0
  59. package/eventcatalog/src/features/studio/from-visualiser.ts +1 -1
  60. package/eventcatalog/src/features/studio/hooks/presence-sender.ts +19 -2
  61. package/eventcatalog/src/features/studio/hooks/use-canvas-webmcp.ts +9 -3
  62. package/eventcatalog/src/features/studio/hooks/use-comments.ts +2 -2
  63. package/eventcatalog/src/features/studio/hooks/use-studio-flow.ts +162 -23
  64. package/eventcatalog/src/features/studio/identity.ts +23 -1
  65. package/eventcatalog/src/features/studio/pages/[id].astro +2 -1
  66. package/eventcatalog/src/features/studio/pages/index.astro +1 -2
  67. package/eventcatalog/src/features/studio/server/canvas-mcp.ts +7 -22
  68. package/eventcatalog/src/features/studio/server/runtime.ts +4 -5
  69. package/package.json +3 -3
  70. package/eventcatalog/src/features/studio/canvas-doc.ts +0 -569
  71. package/eventcatalog/src/features/studio/clipboard.ts +0 -97
  72. package/eventcatalog/src/features/studio/components/CanvasControls.tsx +0 -119
  73. package/eventcatalog/src/features/studio/components/Comments.tsx +0 -777
  74. package/eventcatalog/src/features/studio/components/ContainerChooser.tsx +0 -145
  75. package/eventcatalog/src/features/studio/components/DragGhost.tsx +0 -115
  76. package/eventcatalog/src/features/studio/components/Picture.tsx +0 -21
  77. package/eventcatalog/src/features/studio/components/PropertiesPanel.tsx +0 -212
  78. package/eventcatalog/src/features/studio/components/canvas-nodes.tsx +0 -271
  79. package/eventcatalog/src/features/studio/components/icons.ts +0 -53
  80. package/eventcatalog/src/features/studio/components/status.ts +0 -53
  81. package/eventcatalog/src/features/studio/edges.ts +0 -56
  82. package/eventcatalog/src/features/studio/flow-state.ts +0 -121
  83. package/eventcatalog/src/features/studio/grouping.ts +0 -230
  84. package/eventcatalog/src/features/studio/hooks/use-counter-scale.ts +0 -20
  85. package/eventcatalog/src/features/studio/layout.ts +0 -56
  86. package/eventcatalog/src/features/studio/level-layout.ts +0 -145
  87. package/eventcatalog/src/features/studio/levels.ts +0 -337
  88. package/eventcatalog/src/features/studio/node-types.ts +0 -245
  89. package/eventcatalog/src/features/studio/placement.ts +0 -197
  90. package/eventcatalog/src/features/studio/studio.css +0 -273
@@ -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
- });