@likec4/diagram 1.3.0 → 1.4.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.
Files changed (44) hide show
  1. package/dist/LikeC4Diagram.d.ts +1 -1
  2. package/dist/LikeC4Diagram.props.d.ts +6 -1
  3. package/dist/index.mjs +270 -168
  4. package/dist/state/DiagramContext.d.ts +155 -154
  5. package/dist/state/diagramStore.d.ts +154 -154
  6. package/dist/state/index.d.ts +0 -1
  7. package/dist/state/useDiagramStore.d.ts +3 -4622
  8. package/dist/state/useNavigationHistory.d.ts +5 -0
  9. package/dist/style.css +86 -54
  10. package/dist/theme.css.d.ts +5 -0
  11. package/dist/ui/BackwardForwardPanel.css.d.ts +1 -0
  12. package/dist/ui/BackwardForwardPanel.d.ts +1 -0
  13. package/dist/ui/DiagramTitlePanel.css.d.ts +1 -1
  14. package/dist/ui/OptionsPanel.d.ts +1 -3
  15. package/dist/xyflow/XYFlowEvents.d.ts +4 -4
  16. package/dist/xyflow/XYFlowInner.d.ts +1 -0
  17. package/dist/xyflow/edges/RelationshipEdge.d.ts +1 -1
  18. package/dist/xyflow/hooks/useXYFlow.d.ts +9 -9
  19. package/dist/xyflow/nodes/element/element.css.d.ts +1 -0
  20. package/dist/xyflow/types.d.ts +1 -1
  21. package/package.json +10 -10
  22. package/src/LikeC4Diagram.css.ts +11 -1
  23. package/src/LikeC4Diagram.props.ts +10 -3
  24. package/src/LikeC4Diagram.tsx +30 -7
  25. package/src/globals.css.ts +1 -1
  26. package/src/state/DiagramContext.tsx +3 -3
  27. package/src/state/diagramStore.ts +27 -30
  28. package/src/state/index.ts +0 -1
  29. package/src/state/useDiagramStore.ts +6 -13
  30. package/src/state/useNavigationHistory.ts +39 -0
  31. package/src/theme.css.ts +5 -0
  32. package/src/ui/BackwardForwardPanel.css.ts +22 -0
  33. package/src/ui/BackwardForwardPanel.tsx +59 -0
  34. package/src/ui/DiagramTitlePanel.css.ts +11 -5
  35. package/src/ui/DiagramTitlePanel.tsx +105 -93
  36. package/src/ui/OptionsPanel.tsx +28 -19
  37. package/src/xyflow/XYFlowInner.tsx +5 -2
  38. package/src/xyflow/diagram-to-xyflow.ts +2 -13
  39. package/src/xyflow/edges/RelationshipEdge.tsx +11 -8
  40. package/src/xyflow/edges/edges.css.ts +14 -10
  41. package/src/xyflow/hooks/useLayoutConstraints.ts +2 -1
  42. package/src/xyflow/nodes/compound/CompoundNode.css.ts +8 -8
  43. package/src/xyflow/nodes/element/ElementNode.tsx +7 -8
  44. package/src/xyflow/nodes/element/element.css.ts +18 -5
@@ -1,4 +1,4 @@
1
1
  import { LikeC4DiagramEventHandlers, LikeC4DiagramProperties } from './LikeC4Diagram.props';
2
2
 
3
3
  export type LikeC4DiagramProps = LikeC4DiagramProperties & LikeC4DiagramEventHandlers;
4
- export declare function LikeC4Diagram({ view, className, fitView, fitViewPadding, readonly, pannable, zoomable, nodesSelectable, nodesDraggable, background, controls, showElementLinks, showDiagramTitle, enableDynamicViewWalkthrough, initialWidth, initialHeight, keepAspectRatio, experimentalEdgeEditing, onCanvasClick, onCanvasContextMenu, onCanvasDblClick, onEdgeClick, onChange, onEdgeContextMenu, onNavigateTo, onNodeClick, onNodeContextMenu }: LikeC4DiagramProps): import("react/jsx-runtime").JSX.Element;
4
+ export declare function LikeC4Diagram({ view, className, fitView, fitViewPadding, readonly, pannable, zoomable, nodesSelectable, nodesDraggable, background, controls, showElementLinks, showDiagramTitle, showNavigationButtons, enableDynamicViewWalkthrough, initialWidth, initialHeight, keepAspectRatio, experimentalEdgeEditing, onCanvasClick, onCanvasContextMenu, onCanvasDblClick, onEdgeClick, onChange, onEdgeContextMenu, onNavigateTo, onNodeClick, onNodeContextMenu }: LikeC4DiagramProps): import("react/jsx-runtime").JSX.Element;
@@ -7,7 +7,7 @@ import { XYBackground } from './xyflow/XYFlowBackground';
7
7
 
8
8
  export type DiagramNodeWithNavigate = Simplify<SetRequired<DiagramNode, 'navigateTo'>>;
9
9
  export type OnNavigateTo = {
10
- (to: ViewID, event: ReactMouseEvent, element: DiagramNodeWithNavigate, xynode: XYFlowNode): void;
10
+ (to: ViewID, event?: ReactMouseEvent, element?: DiagramNodeWithNavigate, xynode?: XYFlowNode): void;
11
11
  };
12
12
  export type OnNodeClick = (event: {
13
13
  element: DiagramNode;
@@ -121,6 +121,11 @@ export interface LikeC4DiagramProperties {
121
121
  * @default true
122
122
  */
123
123
  showDiagramTitle?: boolean | undefined;
124
+ /**
125
+ * Show back/forward navigation buttons
126
+ * @default false
127
+ */
128
+ showNavigationButtons?: undefined | boolean;
124
129
  /**
125
130
  * If Walkthrough for dynamic views should be enabled
126
131
  * @default false