@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.
Files changed (67) hide show
  1. package/dist/EmbeddedLikeC4Diagram.css.d.ts +0 -1
  2. package/dist/EmbeddedLikeC4Diagram.d.ts +3 -4
  3. package/dist/LikeC4Diagram.css.d.ts +0 -1
  4. package/dist/LikeC4Diagram.d.ts +1 -2
  5. package/dist/LikeC4Diagram.props.d.ts +19 -19
  6. package/dist/StaticLikeC4Diagram.d.ts +1 -2
  7. package/dist/hooks/index.d.ts +2 -3
  8. package/dist/hooks/useSetState.d.ts +3 -0
  9. package/dist/hooks/useUpdateEffect.d.ts +4 -0
  10. package/dist/icons/Clipboard.d.ts +0 -1
  11. package/dist/icons/Link.d.ts +0 -1
  12. package/dist/icons/ZoomIn.d.ts +0 -1
  13. package/dist/icons/index.d.ts +0 -1
  14. package/dist/index.css.d.ts +0 -1
  15. package/dist/index.d.ts +0 -2
  16. package/dist/index.mjs +3175 -0
  17. package/dist/mantine/EnsureMantine.d.ts +2 -3
  18. package/dist/mantine/theme.d.ts +1 -0
  19. package/dist/mantine.css.d.ts +1 -0
  20. package/dist/state/DiagramContext.d.ts +359 -0
  21. package/dist/state/WhenInitialized.d.ts +3 -0
  22. package/dist/state/diagramStore.d.ts +397 -0
  23. package/dist/state/index.d.ts +4 -2
  24. package/dist/state/useDiagramStore.d.ts +360 -0
  25. package/dist/style.css +1215 -1
  26. package/dist/theme.css.d.ts +4 -1
  27. package/dist/ui/Camera.d.ts +0 -1
  28. package/dist/ui/KeepAspectRatio.css.d.ts +0 -1
  29. package/dist/ui/KeepAspectRatio.d.ts +0 -1
  30. package/dist/ui/OptionsPanel.css.d.ts +0 -1
  31. package/dist/ui/OptionsPanel.d.ts +0 -1
  32. package/dist/ui/index.d.ts +0 -1
  33. package/dist/ui/options/NodeOptions.d.ts +0 -1
  34. package/dist/xyflow/FitviewOnDiagramChange.d.ts +1 -5
  35. package/dist/xyflow/SyncWithDiagram.d.ts +5 -0
  36. package/dist/xyflow/XYFlowBackground.d.ts +0 -1
  37. package/dist/xyflow/XYFlowEvents.d.ts +5 -15
  38. package/dist/xyflow/XYFlowWrapper.d.ts +4 -5
  39. package/dist/xyflow/const.d.ts +1 -2
  40. package/dist/xyflow/diagram-to-xyflow.d.ts +1 -2
  41. package/dist/xyflow/edges/RelationshipEdge.d.ts +7 -7
  42. package/dist/xyflow/edges/edges.css.d.ts +0 -1
  43. package/dist/xyflow/edges/utils.d.ts +3 -4
  44. package/dist/xyflow/hooks/index.d.ts +2 -37
  45. package/dist/xyflow/hooks/{use-layout-/321/201onstraints.d.ts → useLayoutConstraints.d.ts} +2 -4
  46. package/dist/xyflow/hooks/useXYFlow.d.ts +266 -0
  47. package/dist/xyflow/nodes/compound/CompoundNode.css.d.ts +0 -1
  48. package/dist/xyflow/nodes/compound/CompoundNode.d.ts +0 -1
  49. package/dist/xyflow/nodes/compound/index.d.ts +0 -1
  50. package/dist/xyflow/nodes/element/ElementIcon.d.ts +0 -1
  51. package/dist/xyflow/nodes/element/ElementLink.css.d.ts +0 -1
  52. package/dist/xyflow/nodes/element/ElementLink.d.ts +1 -2
  53. package/dist/xyflow/nodes/element/ElementNode.d.ts +1 -3
  54. package/dist/xyflow/nodes/element/ElementShapeSvg.d.ts +0 -1
  55. package/dist/xyflow/nodes/element/element.css.d.ts +0 -1
  56. package/dist/xyflow/nodes/element/index.d.ts +1 -2
  57. package/dist/xyflow/nodes/shared/NavigateToBtn.d.ts +0 -1
  58. package/dist/xyflow/types.d.ts +20 -8
  59. package/dist/xyflow/utils.d.ts +0 -1
  60. package/package.json +31 -30
  61. package/dist/bundle.d.ts +0 -3
  62. package/dist/hooks/use-set-state.d.ts +0 -2
  63. package/dist/hooks/use-update-effect.d.ts +0 -4
  64. package/dist/index.js +0 -13043
  65. package/dist/mantine/index.d.ts +0 -3
  66. package/dist/state/DiagramState.d.ts +0 -162
  67. package/dist/xyflow/UpdateOnDiagramChange.d.ts +0 -10
@@ -3,4 +3,3 @@ export declare const modalBody: string;
3
3
  export declare const modalHeader: string;
4
4
  export declare const modalCloseButtonBox: string;
5
5
  export declare const modalCloseButton: string;
6
- //# sourceMappingURL=EmbeddedLikeC4Diagram.css.d.ts.map
@@ -1,4 +1,4 @@
1
- import { LikeC4ColorMode } from './LikeC4Diagram.props';
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
- colorMode?: LikeC4ColorMode | undefined;
13
+ colorScheme?: LikeC4ColorScheme | undefined;
14
14
  };
15
- declare function EmbeddedLikeC4DiagramCmp({ viewId, views, colorMode }: EmbeddedLikeC4DiagramProps): JSX.Element;
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
@@ -2,4 +2,3 @@ export declare const cssReactFlow: string;
2
2
  export declare const cssDisablePan: string;
3
3
  export declare const cssTransparentBg: string;
4
4
  export declare const cssNoControls: string;
5
- //# sourceMappingURL=LikeC4Diagram.css.d.ts.map
@@ -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, colorMode, readonly, pannable, zoomable, nodesSelectable, nodesDraggable, background, controls, disableHovercards, initialWidth, initialHeight, keepAspectRatio, ...eventHandlers }: LikeC4DiagramProps): JSX.Element;
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: React.MouseEvent;
11
+ event: ReactMouseEvent;
11
12
  }) => void;
12
13
  export type OnNodeClick = (event: {
13
14
  element: DiagramNode;
14
15
  xynode: XYFlowNode;
15
- event: React.MouseEvent;
16
+ event: ReactMouseEvent;
16
17
  }) => void;
17
18
  export type OnEdgeClick = (event: {
18
19
  relation: DiagramEdge;
19
20
  xyedge: XYFlowEdge;
20
- event: React.MouseEvent;
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: React.MouseEvent) => void;
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 LikeC4ColorMode = 'light' | 'dark';
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
- colorMode?: LikeC4ColorMode | undefined;
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
- * Disable element hovercards, such as links and properties
103
- * @default false
103
+ * Display hovercards with element links
104
+ * @default true
104
105
  */
105
- disableHovercards?: boolean | undefined;
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' | 'colorMode' | 'fitView' | 'fitViewPadding' | 'background' | 'initialWidth' | 'initialHeight'>;
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
@@ -1,3 +1,2 @@
1
- export * from './use-set-state';
2
- export * from './use-update-effect';
3
- //# sourceMappingURL=index.d.ts.map
1
+ export * from './useSetState';
2
+ export * from './useUpdateEffect';
@@ -0,0 +1,3 @@
1
+ import { NonEmptyObject } from 'type-fest';
2
+
3
+ export declare function useSetState<T extends object>(initialState: T | (() => T)): readonly [T, (statePartial: NonEmptyObject<Partial<T>> | ((current: T) => NonEmptyObject<Partial<T>>)) => void];
@@ -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;
@@ -1,4 +1,3 @@
1
1
  import { SVGProps } from 'react';
2
2
 
3
3
  export declare const ClipboardCopy: import('react').ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
4
- //# sourceMappingURL=Clipboard.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { SVGProps } from 'react';
2
2
 
3
3
  export declare const Link: import('react').ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
4
- //# sourceMappingURL=Link.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { SVGProps } from 'react';
2
2
 
3
3
  export declare const ZoomIn: import('react').ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
4
- //# sourceMappingURL=ZoomIn.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export * from './Clipboard';
2
2
  export * from './Link';
3
3
  export * from './ZoomIn';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare const scope: string;
2
- //# sourceMappingURL=index.css.d.ts.map
package/dist/index.d.ts CHANGED
@@ -7,5 +7,3 @@ export type * from './LikeC4Diagram';
7
7
  export type * from './LikeC4Diagram.props';
8
8
  export type * from './StaticLikeC4Diagram';
9
9
  export type * from './xyflow/types';
10
- export * from './bundle';
11
- //# sourceMappingURL=index.d.ts.map