@likec4/diagram 1.5.0 → 1.6.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/LICENSE +1 -1
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.props.d.ts +18 -3
- package/dist/StaticLikeC4Diagram.d.ts +1 -1
- package/dist/index.mjs +3097 -3090
- package/dist/state/DiagramContext.d.ts +18 -9
- package/dist/state/diagramStore.d.ts +12 -2
- package/dist/style.css +149 -85
- package/dist/xyflow/nodes/element/ElementShapeSvg.d.ts +5 -0
- package/dist/xyflow/nodes/element/element.css.d.ts +4 -2
- package/package.json +13 -13
- package/src/LikeC4Diagram.props.ts +21 -3
- package/src/LikeC4Diagram.tsx +4 -1
- package/src/StaticLikeC4Diagram.tsx +1 -0
- package/src/state/DiagramContext.tsx +1 -1
- package/src/state/diagramStore.ts +8 -1
- package/src/ui/BackwardForwardPanel.tsx +1 -1
- package/src/xyflow/FitviewOnDiagramChange.tsx +1 -1
- package/src/xyflow/SelectEdgesOnNodeFocus.tsx +1 -1
- package/src/xyflow/SyncWithDiagram.tsx +1 -1
- package/src/xyflow/XYFlow.tsx +2 -1
- package/src/xyflow/XYFlowEvents.tsx +1 -1
- package/src/xyflow/XYFlowInner.tsx +1 -1
- package/src/xyflow/edges/RelationshipEdge.tsx +3 -3
- package/src/xyflow/edges/edges.css.ts +6 -6
- package/src/xyflow/hooks/useLayoutConstraints.ts +1 -1
- package/src/xyflow/nodes/compound/CompoundNode.tsx +1 -1
- package/src/xyflow/nodes/element/ElementLink.tsx +2 -1
- package/src/xyflow/nodes/element/ElementNode.tsx +70 -22
- package/src/xyflow/nodes/element/ElementShapeSvg.tsx +2 -2
- package/src/xyflow/nodes/element/element.css.ts +126 -54
- package/src/xyflow/nodes/shared/NavigateToBtn.tsx +1 -1
- package/dist/xyflow/nodes/element/ElementIcon.d.ts +0 -7
- package/src/xyflow/nodes/element/ElementIcon.tsx +0 -33
package/LICENSE
CHANGED
package/dist/LikeC4Diagram.d.ts
CHANGED
|
@@ -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, showNavigationButtons, 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, renderIcon }: LikeC4DiagramProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { BorderStyle, DiagramEdge, DiagramNode, DiagramView, EdgeId, ElementShape, Fqn, NonEmptyArray, ThemeColor, ViewID } from '@likec4/core';
|
|
2
2
|
import { XYPosition } from '@xyflow/system';
|
|
3
|
-
import { MouseEvent as ReactMouseEvent } from 'react';
|
|
4
|
-
import { SetRequired, Simplify } from 'type-fest';
|
|
3
|
+
import { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
|
5
4
|
import { XYFlowEdge, XYFlowNode } from './xyflow/types';
|
|
6
5
|
import { XYBackground } from './xyflow/XYFlowBackground';
|
|
7
6
|
|
|
8
|
-
export type DiagramNodeWithNavigate =
|
|
7
|
+
export type DiagramNodeWithNavigate = Omit<DiagramNode, 'navigateTo'> & {
|
|
8
|
+
navigateTo: ViewID;
|
|
9
|
+
};
|
|
10
|
+
type ElementIconNodeProps = {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
icon?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
export type ElementIconRenderer = (props: {
|
|
16
|
+
node: ElementIconNodeProps;
|
|
17
|
+
}) => ReactNode;
|
|
9
18
|
export type OnNavigateTo = {
|
|
10
19
|
(to: ViewID, event?: ReactMouseEvent, element?: DiagramNodeWithNavigate, xynode?: XYFlowNode): void;
|
|
11
20
|
};
|
|
@@ -136,6 +145,11 @@ export interface LikeC4DiagramProperties {
|
|
|
136
145
|
* @default false
|
|
137
146
|
*/
|
|
138
147
|
experimentalEdgeEditing?: boolean | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* Render custom icon for a node
|
|
150
|
+
* By default, if icon is http:// or https://, it will be rendered as an image
|
|
151
|
+
*/
|
|
152
|
+
renderIcon?: ElementIconRenderer | undefined;
|
|
139
153
|
}
|
|
140
154
|
export interface LikeC4DiagramEventHandlers {
|
|
141
155
|
onChange?: OnChange | null | undefined;
|
|
@@ -148,3 +162,4 @@ export interface LikeC4DiagramEventHandlers {
|
|
|
148
162
|
onCanvasClick?: OnCanvasClick | null | undefined;
|
|
149
163
|
onCanvasDblClick?: OnCanvasClick | null | undefined;
|
|
150
164
|
}
|
|
165
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LikeC4DiagramProperties } from './LikeC4Diagram.props';
|
|
2
2
|
|
|
3
|
-
export type StaticLikeC4DiagramProps = Pick<LikeC4DiagramProperties, 'view' | 'keepAspectRatio' | 'className' | 'fitView' | 'fitViewPadding' | 'background' | 'initialWidth' | 'initialHeight'>;
|
|
3
|
+
export type StaticLikeC4DiagramProps = Pick<LikeC4DiagramProperties, 'view' | 'keepAspectRatio' | 'className' | 'fitView' | 'fitViewPadding' | 'background' | 'initialWidth' | 'initialHeight' | 'renderIcon'>;
|
|
4
4
|
export declare function StaticLikeC4Diagram({ view, fitView, fitViewPadding, background, ...rest }: StaticLikeC4DiagramProps): import("react/jsx-runtime").JSX.Element;
|