@likec4/diagram 1.0.0-next.10 → 1.0.0-next.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.
- package/dist/EmbeddedLikeC4Diagram.css.d.ts +0 -1
- package/dist/EmbeddedLikeC4Diagram.d.ts +3 -4
- package/dist/LikeC4Diagram.css.d.ts +0 -1
- package/dist/LikeC4Diagram.d.ts +1 -2
- package/dist/LikeC4Diagram.props.d.ts +19 -19
- package/dist/StaticLikeC4Diagram.d.ts +1 -2
- package/dist/hooks/index.d.ts +2 -3
- package/dist/hooks/useSetState.d.ts +3 -0
- package/dist/hooks/useUpdateEffect.d.ts +4 -0
- package/dist/icons/Clipboard.d.ts +0 -1
- package/dist/icons/Link.d.ts +0 -1
- package/dist/icons/ZoomIn.d.ts +0 -1
- package/dist/icons/index.d.ts +0 -1
- package/dist/index.css.d.ts +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.mjs +3175 -0
- package/dist/mantine/EnsureMantine.d.ts +2 -3
- package/dist/mantine/theme.d.ts +1 -0
- package/dist/mantine.css.d.ts +1 -0
- package/dist/state/DiagramContext.d.ts +359 -0
- package/dist/state/WhenInitialized.d.ts +3 -0
- package/dist/state/diagramStore.d.ts +397 -0
- package/dist/state/index.d.ts +4 -2
- package/dist/state/useDiagramStore.d.ts +360 -0
- package/dist/style.css +1215 -1
- package/dist/theme.css.d.ts +4 -1
- package/dist/ui/Camera.d.ts +0 -1
- package/dist/ui/KeepAspectRatio.css.d.ts +0 -1
- package/dist/ui/KeepAspectRatio.d.ts +0 -1
- package/dist/ui/OptionsPanel.css.d.ts +0 -1
- package/dist/ui/OptionsPanel.d.ts +0 -1
- package/dist/ui/index.d.ts +0 -1
- package/dist/ui/options/NodeOptions.d.ts +0 -1
- package/dist/xyflow/FitviewOnDiagramChange.d.ts +1 -5
- package/dist/xyflow/SyncWithDiagram.d.ts +5 -0
- package/dist/xyflow/XYFlowBackground.d.ts +0 -1
- package/dist/xyflow/XYFlowEvents.d.ts +5 -15
- package/dist/xyflow/XYFlowWrapper.d.ts +4 -5
- package/dist/xyflow/const.d.ts +1 -2
- package/dist/xyflow/diagram-to-xyflow.d.ts +1 -2
- package/dist/xyflow/edges/RelationshipEdge.d.ts +7 -7
- package/dist/xyflow/edges/edges.css.d.ts +0 -1
- package/dist/xyflow/edges/utils.d.ts +3 -4
- package/dist/xyflow/hooks/index.d.ts +2 -37
- package/dist/xyflow/hooks/{use-layout-/321/201onstraints.d.ts → useLayoutConstraints.d.ts} +2 -4
- package/dist/xyflow/hooks/useXYFlow.d.ts +266 -0
- package/dist/xyflow/nodes/compound/CompoundNode.css.d.ts +0 -1
- package/dist/xyflow/nodes/compound/CompoundNode.d.ts +0 -1
- package/dist/xyflow/nodes/compound/index.d.ts +0 -1
- package/dist/xyflow/nodes/element/ElementIcon.d.ts +0 -1
- package/dist/xyflow/nodes/element/ElementLink.css.d.ts +0 -1
- package/dist/xyflow/nodes/element/ElementLink.d.ts +1 -2
- package/dist/xyflow/nodes/element/ElementNode.d.ts +1 -3
- package/dist/xyflow/nodes/element/ElementShapeSvg.d.ts +0 -1
- package/dist/xyflow/nodes/element/element.css.d.ts +0 -1
- package/dist/xyflow/nodes/element/index.d.ts +1 -2
- package/dist/xyflow/nodes/shared/NavigateToBtn.d.ts +0 -1
- package/dist/xyflow/types.d.ts +20 -8
- package/dist/xyflow/utils.d.ts +0 -1
- package/package.json +31 -30
- package/dist/bundle.d.ts +0 -3
- package/dist/hooks/use-set-state.d.ts +0 -2
- package/dist/hooks/use-update-effect.d.ts +0 -4
- package/dist/index.js +0 -13043
- package/dist/mantine/index.d.ts +0 -3
- package/dist/state/DiagramState.d.ts +0 -162
- package/dist/xyflow/UpdateOnDiagramChange.d.ts +0 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LikeC4ColorScheme } from './LikeC4Diagram.props';
|
|
2
2
|
import { DiagramView } from '@likec4/core';
|
|
3
3
|
|
|
4
4
|
export type EmbeddedLikeC4DiagramProps = {
|
|
@@ -10,9 +10,8 @@ export type EmbeddedLikeC4DiagramProps = {
|
|
|
10
10
|
*
|
|
11
11
|
* @example 'light' | 'dark'
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
colorScheme?: LikeC4ColorScheme | undefined;
|
|
14
14
|
};
|
|
15
|
-
declare function EmbeddedLikeC4DiagramCmp({ viewId, views,
|
|
15
|
+
declare function EmbeddedLikeC4DiagramCmp({ viewId, views, colorScheme }: EmbeddedLikeC4DiagramProps): JSX.Element;
|
|
16
16
|
export declare const EmbeddedLikeC4Diagram: typeof EmbeddedLikeC4DiagramCmp;
|
|
17
17
|
export {};
|
|
18
|
-
//# sourceMappingURL=EmbeddedLikeC4Diagram.d.ts.map
|
package/dist/LikeC4Diagram.d.ts
CHANGED
|
@@ -1,5 +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,
|
|
5
|
-
//# sourceMappingURL=LikeC4Diagram.d.ts.map
|
|
4
|
+
export declare function LikeC4Diagram({ view, className, fitView, fitViewPadding, colorScheme, readonly, pannable, zoomable, nodesSelectable, nodesDraggable, background, controls, showElementLinks, initialWidth, initialHeight, keepAspectRatio, onCanvasClick, onCanvasContextMenu, onCanvasDblClick, onEdgeClick, onChange, onEdgeContextMenu, onNavigateTo, onNodeClick, onNodeContextMenu }: LikeC4DiagramProps): JSX.Element;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { XYBackgroundProps } from './xyflow/XYFlowBackground';
|
|
2
2
|
import { XYFlowEdge, XYFlowNode } from './xyflow/types';
|
|
3
3
|
import { SetRequired, Simplify } from 'type-fest';
|
|
4
|
+
import { MouseEvent as ReactMouseEvent } from 'react';
|
|
4
5
|
import { DiagramEdge, DiagramNode, DiagramView, ElementShape, Fqn, NonEmptyArray, ThemeColor } from '@likec4/core';
|
|
5
6
|
|
|
6
7
|
export type DiagramNodeWithNavigate = Simplify<SetRequired<DiagramNode, 'navigateTo'>>;
|
|
7
8
|
export type OnNavigateTo = (event: {
|
|
8
9
|
element: DiagramNodeWithNavigate;
|
|
9
10
|
xynode: XYFlowNode;
|
|
10
|
-
event:
|
|
11
|
+
event: ReactMouseEvent;
|
|
11
12
|
}) => void;
|
|
12
13
|
export type OnNodeClick = (event: {
|
|
13
14
|
element: DiagramNode;
|
|
14
15
|
xynode: XYFlowNode;
|
|
15
|
-
event:
|
|
16
|
+
event: ReactMouseEvent;
|
|
16
17
|
}) => void;
|
|
17
18
|
export type OnEdgeClick = (event: {
|
|
18
19
|
relation: DiagramEdge;
|
|
19
20
|
xyedge: XYFlowEdge;
|
|
20
|
-
event:
|
|
21
|
+
event: ReactMouseEvent;
|
|
21
22
|
}) => void;
|
|
22
23
|
/**
|
|
23
24
|
* On pane/canvas click (not on any node or edge)
|
|
24
25
|
*/
|
|
25
|
-
export type OnCanvasClick = (event:
|
|
26
|
+
export type OnCanvasClick = (event: ReactMouseEvent) => void;
|
|
26
27
|
export declare namespace Changes {
|
|
27
28
|
interface ChangeColor {
|
|
28
29
|
op: 'change-color';
|
|
@@ -40,7 +41,7 @@ export type ChangeEvent = {
|
|
|
40
41
|
changes: NonEmptyArray<Change>;
|
|
41
42
|
};
|
|
42
43
|
export type OnChange = (event: ChangeEvent) => void;
|
|
43
|
-
export type
|
|
44
|
+
export type LikeC4ColorScheme = 'light' | 'dark';
|
|
44
45
|
export interface LikeC4DiagramProperties {
|
|
45
46
|
view: DiagramView;
|
|
46
47
|
className?: string | undefined;
|
|
@@ -50,7 +51,7 @@ export interface LikeC4DiagramProperties {
|
|
|
50
51
|
*
|
|
51
52
|
* @example 'light' | 'dark'
|
|
52
53
|
*/
|
|
53
|
-
|
|
54
|
+
colorScheme?: LikeC4ColorScheme | undefined;
|
|
54
55
|
/**
|
|
55
56
|
* Show/hide controls menu
|
|
56
57
|
* @default false
|
|
@@ -99,20 +100,19 @@ export interface LikeC4DiagramProperties {
|
|
|
99
100
|
*/
|
|
100
101
|
background?: 'transparent' | 'solid' | XYBackgroundProps | undefined;
|
|
101
102
|
/**
|
|
102
|
-
*
|
|
103
|
-
* @default
|
|
103
|
+
* Display hovercards with element links
|
|
104
|
+
* @default true
|
|
104
105
|
*/
|
|
105
|
-
|
|
106
|
+
showElementLinks?: boolean | undefined;
|
|
106
107
|
}
|
|
107
108
|
export interface LikeC4DiagramEventHandlers {
|
|
108
|
-
onChange?: OnChange | undefined;
|
|
109
|
-
onNavigateTo?: OnNavigateTo | undefined;
|
|
110
|
-
onNodeClick?: OnNodeClick | undefined;
|
|
111
|
-
onNodeContextMenu?: OnNodeClick | undefined;
|
|
112
|
-
onCanvasContextMenu?: OnCanvasClick | undefined;
|
|
113
|
-
onEdgeClick?: OnEdgeClick | undefined;
|
|
114
|
-
onEdgeContextMenu?: OnEdgeClick | undefined;
|
|
115
|
-
onCanvasClick?: OnCanvasClick | undefined;
|
|
116
|
-
onCanvasDblClick?: OnCanvasClick | undefined;
|
|
109
|
+
onChange?: OnChange | null | undefined;
|
|
110
|
+
onNavigateTo?: OnNavigateTo | null | undefined;
|
|
111
|
+
onNodeClick?: OnNodeClick | null | undefined;
|
|
112
|
+
onNodeContextMenu?: OnNodeClick | null | undefined;
|
|
113
|
+
onCanvasContextMenu?: OnCanvasClick | null | undefined;
|
|
114
|
+
onEdgeClick?: OnEdgeClick | null | undefined;
|
|
115
|
+
onEdgeContextMenu?: OnEdgeClick | null | undefined;
|
|
116
|
+
onCanvasClick?: OnCanvasClick | null | undefined;
|
|
117
|
+
onCanvasDblClick?: OnCanvasClick | null | undefined;
|
|
117
118
|
}
|
|
118
|
-
//# sourceMappingURL=LikeC4Diagram.props.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LikeC4DiagramProperties } from './LikeC4Diagram.props';
|
|
2
2
|
|
|
3
|
-
export type StaticLikeC4DiagramProps = Pick<LikeC4DiagramProperties, 'view' | 'keepAspectRatio' | 'className' | '
|
|
3
|
+
export type StaticLikeC4DiagramProps = Pick<LikeC4DiagramProperties, 'view' | 'keepAspectRatio' | 'className' | 'colorScheme' | 'fitView' | 'fitViewPadding' | 'background' | 'initialWidth' | 'initialHeight'>;
|
|
4
4
|
export declare function StaticLikeC4Diagram({ view, fitView, fitViewPadding, background, ...rest }: StaticLikeC4DiagramProps): JSX.Element;
|
|
5
|
-
//# sourceMappingURL=StaticLikeC4Diagram.d.ts.map
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from './useSetState';
|
|
2
|
+
export * from './useUpdateEffect';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DependencyList, EffectCallback } from 'react';
|
|
2
|
+
import { DependenciesComparator, EffectHook } from '@react-hookz/web';
|
|
3
|
+
|
|
4
|
+
export declare function useUpdateEffect<Callback extends EffectCallback = EffectCallback, Deps extends DependencyList = DependencyList>(callback: Callback, deps: Deps, equalityFn?: DependenciesComparator<Deps>, effectHook?: EffectHook<Callback, Deps>): void;
|
package/dist/icons/Link.d.ts
CHANGED
package/dist/icons/ZoomIn.d.ts
CHANGED
package/dist/icons/index.d.ts
CHANGED
package/dist/index.css.d.ts
CHANGED