@likec4/diagram 1.27.3 → 1.28.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 (55) hide show
  1. package/bundle/index.js +564 -443
  2. package/dist/base/primitives/customEdge.d.ts +1 -1
  3. package/dist/base/primitives/edge/EdgeActionButton.d.ts +1 -2
  4. package/dist/base/primitives/edge/EdgePath.d.ts +1 -1
  5. package/dist/base/primitives/element/ElementActionButtons.d.ts +1 -1
  6. package/dist/base/primitives/element/ElementActionButtons.js +5 -3
  7. package/dist/base/primitives/element/ElementDetailsButton.js +5 -1
  8. package/dist/bundle/styles.css.js +2 -2
  9. package/dist/hooks/useDiagram.d.ts +3 -7
  10. package/dist/hooks/useXYFlow.d.ts +2 -2
  11. package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
  12. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +11 -1
  13. package/dist/likec4diagram/custom/index.d.ts +2 -1
  14. package/dist/likec4diagram/ui/notation/NotationPanel.js +0 -1
  15. package/dist/overlays/Overlays.js +2 -2
  16. package/dist/overlays/element-details/actor.d.ts +303 -303
  17. package/dist/overlays/overlay/Overlay.css.d.ts +2 -25
  18. package/dist/overlays/overlay/Overlay.css.js +0 -40
  19. package/dist/overlays/overlay/Overlay.d.ts +1 -1
  20. package/dist/overlays/overlay/Overlay.js +97 -88
  21. package/dist/overlays/overlaysActor.js +4 -1
  22. package/dist/overlays/relationship-details/RelationshipDetails.d.ts +1 -1
  23. package/dist/overlays/relationship-details/actor.d.ts +1 -2
  24. package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +1 -1
  25. package/dist/overlays/relationship-details/custom/nodeTypes.js +1 -1
  26. package/dist/overlays/relationship-details/hooks.d.ts +2 -3
  27. package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
  28. package/dist/overlays/relationships-browser/actor.d.ts +2 -3
  29. package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +1 -1
  30. package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
  31. package/dist/overlays/relationships-browser/hooks.d.ts +2 -3
  32. package/dist/state/diagram-machine.d.ts +2 -2
  33. package/dist/state/hotkeyActor.js +12 -3
  34. package/dist/styles.css.js +1 -1
  35. package/package.json +10 -10
  36. package/src/base/primitives/compound/CompoundNodeContainer.css.ts +0 -3
  37. package/src/base/primitives/edge/EdgeActionButton.tsx +1 -2
  38. package/src/base/primitives/element/ElementActionButtons.tsx +5 -3
  39. package/src/base/primitives/element/ElementDetailsButton.tsx +4 -0
  40. package/src/base/primitives/element/ElementNodeContainer.css.ts +0 -18
  41. package/src/bundle/styles.css.ts +7 -2
  42. package/src/components/SearchControl.css.ts +4 -8
  43. package/src/hooks/useDiagram.ts +1 -1
  44. package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +7 -1
  45. package/src/likec4diagram/custom/edges/edges.css.ts +0 -2
  46. package/src/likec4diagram/ui/notation/NotationPanel.css.ts +0 -4
  47. package/src/likec4diagram/ui/notation/NotationPanel.tsx +0 -1
  48. package/src/likec4diagram/ui/search/ViewsColumn.css.ts +0 -4
  49. package/src/overlays/Overlays.tsx +2 -2
  50. package/src/overlays/overlay/Overlay.css.ts +0 -40
  51. package/src/overlays/overlay/Overlay.tsx +107 -98
  52. package/src/overlays/overlaysActor.ts +5 -1
  53. package/src/overlays/relationship-details/custom/nodeTypes.tsx +1 -1
  54. package/src/overlays/relationships-browser/custom/nodeTypes.tsx +1 -1
  55. package/src/state/hotkeyActor.ts +13 -3
@@ -1,28 +1,5 @@
1
- import { SlotRecipeRuntimeFn } from '@likec4/styles/types';
1
+ import { SlotRecipeRuntimeFn, SlotRecipeVariantRecord } from '@likec4/styles/types';
2
2
  export declare const backdropBlur = "--_blur";
3
3
  export declare const backdropOpacity = "--_opacity";
4
4
  export declare const level = "--_level";
5
- export declare const overlay: SlotRecipeRuntimeFn<"body" | "dialog", {
6
- level: {
7
- 0: {
8
- dialog: {
9
- "--_level": "0";
10
- };
11
- };
12
- 1: {
13
- dialog: {
14
- "--_level": "1";
15
- };
16
- };
17
- 2: {
18
- dialog: {
19
- "--_level": "2";
20
- };
21
- };
22
- 3: {
23
- dialog: {
24
- "--_level": "3";
25
- };
26
- };
27
- };
28
- }>;
5
+ export declare const overlay: SlotRecipeRuntimeFn<"body" | "dialog", SlotRecipeVariantRecord<"body" | "dialog">>;
@@ -59,22 +59,6 @@ const dialog = css.raw({
59
59
  xl: {
60
60
  [offset]: "4rem"
61
61
  }
62
- // inset: '[calc(2rem + var(--_level, 0) * 1rem), 2rem, 2rem, 2rem]',
63
- // width: 'calc(100vw - 4rem)',
64
- // height: 'calc(100vh - 4rem - var(--_level, 0) * 1rem)',
65
- // },
66
- // lg: {
67
- // inset: '[calc(4rem + var(--_level, 0) * 1rem), 4rem, 4rem, 4rem]',
68
- // width: 'calc(100vw - 8rem)',
69
- // height: 'calc(100vh - 8rem)',
70
- // },
71
- // xl: {
72
- // [borderRadius]: '8px',
73
- // padding: '8px',
74
- // inset: '[calc(5rem + var(--_level, 0) * 1rem), 5rem, 5rem, 5rem]',
75
- // width: 'calc(100vw - 10rem)',
76
- // height: 'calc(100vh - 10rem - var(--_level, 0) * 1rem)',
77
- // },
78
62
  });
79
63
  const body = css.raw({
80
64
  position: "relative",
@@ -94,30 +78,6 @@ const overlay = sva({
94
78
  base: {
95
79
  dialog,
96
80
  body
97
- },
98
- variants: {
99
- level: {
100
- 0: {
101
- dialog: {
102
- [level]: "0"
103
- }
104
- },
105
- 1: {
106
- dialog: {
107
- [level]: "1"
108
- }
109
- },
110
- 2: {
111
- dialog: {
112
- [level]: "2"
113
- }
114
- },
115
- 3: {
116
- dialog: {
117
- [level]: "3"
118
- }
119
- }
120
- }
121
81
  }
122
82
  });
123
83
 
@@ -1,6 +1,6 @@
1
1
  import { ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
2
2
  export declare const Overlay: ForwardRefExoticComponent<{
3
- overlayLevel?: 0 | 1 | 2 | 3;
3
+ overlayLevel?: number;
4
4
  className?: string;
5
5
  classes?: {
6
6
  dialog?: string;
@@ -4,100 +4,109 @@ import { RemoveScroll, Box } from '@mantine/core';
4
4
  import { useMergedRef } from '@mantine/hooks';
5
5
  import { useSyncedRef, useDebouncedCallback, useTimeoutEffect } from '@react-hookz/web';
6
6
  import { useReducedMotionConfig, m } from 'framer-motion';
7
- import { forwardRef, useState, useRef, useLayoutEffect } from 'react';
8
- import { overlay, backdropOpacity, backdropBlur } from './Overlay.css.js';
7
+ import { forwardRef, useState, useRef, useEffect } from 'react';
8
+ import { overlay, backdropOpacity, backdropBlur, level } from './Overlay.css.js';
9
9
  import { stopPropagation } from '../../utils/xyflow.js';
10
10
 
11
- const Overlay = forwardRef(
12
- ({ children, onClose, className, classes, overlayLevel = 0, ...rest }, ref) => {
13
- const [opened, setOpened] = useState(false);
14
- const dialogRef = useRef(null);
15
- const isClosingRef = useRef(false);
16
- const motionNotReduced = useReducedMotionConfig() !== true;
17
- const onCloseRef = useSyncedRef(onClose);
18
- const close = useDebouncedCallback(
19
- () => {
20
- if (isClosingRef.current) return;
21
- isClosingRef.current = true;
22
- onCloseRef.current();
11
+ const Overlay = forwardRef(({
12
+ onClose,
13
+ className,
14
+ classes,
15
+ overlayLevel = 0,
16
+ children,
17
+ ...rest
18
+ }, ref) => {
19
+ const [opened, setOpened] = useState(false);
20
+ const dialogRef = useRef(null);
21
+ const isClosingRef = useRef(false);
22
+ const motionNotReduced = useReducedMotionConfig() !== true;
23
+ const onCloseRef = useSyncedRef(onClose);
24
+ const close = useDebouncedCallback(
25
+ () => {
26
+ if (isClosingRef.current) return;
27
+ isClosingRef.current = true;
28
+ onCloseRef.current();
29
+ },
30
+ [],
31
+ 50
32
+ );
33
+ useEffect(() => {
34
+ const cancel = (e) => {
35
+ e.preventDefault();
36
+ close();
37
+ };
38
+ dialogRef.current?.addEventListener("cancel", cancel, { capture: true });
39
+ return () => {
40
+ dialogRef.current?.removeEventListener("cancel", cancel, { capture: true });
41
+ };
42
+ }, []);
43
+ useTimeoutEffect(() => {
44
+ if (!dialogRef.current?.open) {
45
+ dialogRef.current?.showModal();
46
+ }
47
+ }, 30);
48
+ useTimeoutEffect(() => {
49
+ setOpened(true);
50
+ }, 120);
51
+ const styles = overlay({
52
+ level: overlayLevel
53
+ });
54
+ return /* @__PURE__ */ jsx(
55
+ m.dialog,
56
+ {
57
+ ref: useMergedRef(dialogRef, ref),
58
+ className: cx(RemoveScroll.classNames.fullWidth, styles.dialog, classes?.dialog, className),
59
+ layout: true,
60
+ style: {
61
+ // @ts-ignore
62
+ [level]: overlayLevel
23
63
  },
24
- [],
25
- 50
26
- );
27
- useLayoutEffect(() => {
28
- const cancel = (e) => {
29
- e.preventDefault();
30
- close();
31
- };
32
- dialogRef.current?.addEventListener("cancel", cancel, { capture: true });
33
- return () => {
34
- dialogRef.current?.removeEventListener("cancel", cancel, { capture: true });
35
- };
36
- }, []);
37
- useTimeoutEffect(() => {
38
- if (!dialogRef.current?.open) {
39
- dialogRef.current?.showModal();
40
- }
41
- }, 20);
42
- useTimeoutEffect(() => {
43
- setOpened(true);
44
- }, 120);
45
- const styles = overlay({
46
- level: overlayLevel
47
- });
48
- return /* @__PURE__ */ jsx(
49
- m.dialog,
50
- {
51
- ref: useMergedRef(dialogRef, ref),
52
- className: cx(RemoveScroll.classNames.fullWidth, styles.dialog, classes?.dialog, className),
53
- layout: true,
54
- ...motionNotReduced ? {
55
- initial: {
56
- [backdropBlur]: "0px",
57
- [backdropOpacity]: "0%",
58
- scale: overlayLevel > 0 ? 0.9 : 1.075,
59
- opacity: 0
60
- },
61
- animate: {
62
- [backdropBlur]: overlayLevel > 0 ? "4px" : "8px",
63
- [backdropOpacity]: overlayLevel > 0 ? "50%" : "60%",
64
- scale: 1,
65
- opacity: 1,
66
- transition: {
67
- delay: 0.075
68
- }
69
- },
70
- exit: {
71
- scale: 1.2,
72
- opacity: 0,
73
- [backdropBlur]: "0px",
74
- [backdropOpacity]: "0%"
75
- }
76
- } : {
77
- initial: {
78
- [backdropBlur]: "8px",
79
- [backdropOpacity]: "60%"
80
- }
64
+ ...motionNotReduced ? {
65
+ initial: {
66
+ [backdropBlur]: "0px",
67
+ [backdropOpacity]: "0%",
68
+ scale: overlayLevel > 0 ? 0.9 : 1.075,
69
+ opacity: 0
81
70
  },
82
- onClick: (e) => {
83
- e.stopPropagation();
84
- if (e.target?.nodeName?.toUpperCase() === "DIALOG") {
85
- dialogRef.current?.close();
86
- return;
71
+ animate: {
72
+ [backdropBlur]: overlayLevel > 0 ? "4px" : "8px",
73
+ [backdropOpacity]: overlayLevel > 0 ? "50%" : "60%",
74
+ scale: 1,
75
+ opacity: 1,
76
+ transition: {
77
+ delay: 0.075
87
78
  }
88
79
  },
89
- onDoubleClick: stopPropagation,
90
- onPointerDown: stopPropagation,
91
- onClose: (e) => {
92
- e.stopPropagation();
93
- close();
94
- },
95
- ...rest,
96
- children: /* @__PURE__ */ jsx(RemoveScroll, { forwardProps: true, removeScrollBar: false, children: /* @__PURE__ */ jsx(Box, { className: cx(styles.body, "overlay-body", classes?.body), children: opened && /* @__PURE__ */ jsx(Fragment, { children }) }) })
97
- }
98
- );
99
- }
100
- );
80
+ exit: {
81
+ scale: 1.2,
82
+ opacity: 0,
83
+ [backdropBlur]: "0px",
84
+ [backdropOpacity]: "0%"
85
+ }
86
+ } : {
87
+ initial: {
88
+ [backdropBlur]: "8px",
89
+ [backdropOpacity]: "60%"
90
+ }
91
+ },
92
+ onClick: (e) => {
93
+ e.stopPropagation();
94
+ if (e.target?.nodeName?.toUpperCase() === "DIALOG") {
95
+ dialogRef.current?.close();
96
+ return;
97
+ }
98
+ },
99
+ onDoubleClick: stopPropagation,
100
+ onPointerDown: stopPropagation,
101
+ onClose: (e) => {
102
+ e.stopPropagation();
103
+ close();
104
+ },
105
+ ...rest,
106
+ children: /* @__PURE__ */ jsx(RemoveScroll, { forwardProps: true, removeScrollBar: false, children: /* @__PURE__ */ jsx(Box, { className: cx(styles.body, "overlay-body", classes?.body), children: opened && /* @__PURE__ */ jsx(Fragment, { children }) }) })
107
+ }
108
+ );
109
+ });
101
110
  Overlay.displayName = "Overlay";
102
111
 
103
112
  export { Overlay };
@@ -7,7 +7,10 @@ import { relationshipsBrowserLogic } from './relationships-browser/actor.js';
7
7
 
8
8
  const hotkeyLogic = fromCallback(({ sendBack }) => {
9
9
  const handler = getHotkeyHandler([
10
- ["Escape", () => sendBack({ type: "close" }), {
10
+ ["Escape", (event) => {
11
+ event.stopPropagation();
12
+ sendBack({ type: "close" });
13
+ }, {
11
14
  preventDefault: true
12
15
  }]
13
16
  ]);
@@ -1,6 +1,6 @@
1
1
  import { RelationshipDetailsActorRef } from './actor';
2
2
  import { NamedExoticComponent, CSSProperties, ReactNode } from 'react';
3
- import { Position } from '@xyflow/system';
3
+ import { Position } from '@xyflow/react';
4
4
  import { RelationId, Color, ViewId, RelationshipLineType } from '@likec4/core';
5
5
  export declare const edgeTypes: {
6
6
  relationship: NamedExoticComponent<{
@@ -1,10 +1,9 @@
1
1
  import { BBox, EdgeId, ExclusiveUnion, Fqn, ViewId, RelationId, Color, RelationshipLineType } from '@likec4/core';
2
- import { EdgeChange, NodeChange, ReactFlowInstance, useStoreApi } from '@xyflow/react';
2
+ import { EdgeChange, NodeChange, ReactFlowInstance, useStoreApi, EdgeMarkerType, HandleType } from '@xyflow/react';
3
3
  import { ActorLogicFrom, ActorRefFromLogic, SnapshotFrom, StateMachine, Values, NonReducibleUnknown, EventObject, MetaObject, AnyActorLogic, ConditionalRequired, InputFrom, RequiredLogicInput, IsNotNever, ActorRef, MachineSnapshot, AnyActorRef, StateValue, AnyEventObject, ActionFunction, CancelAction } from 'xstate';
4
4
  import { Base } from '../../base';
5
5
  import { RelationshipDetailsTypes } from './_types';
6
6
  import { LayoutResult } from './layout';
7
- import { EdgeMarkerType, HandleType } from '@xyflow/system';
8
7
  import { ReactNode, CSSProperties } from 'react';
9
8
  type XYFLowInstance = ReactFlowInstance<RelationshipDetailsTypes.Node, RelationshipDetailsTypes.Edge>;
10
9
  type XYStoreApi = ReturnType<typeof useStoreApi<RelationshipDetailsTypes.Node, RelationshipDetailsTypes.Edge>>;
@@ -1,5 +1,5 @@
1
1
  import { NamedExoticComponent, CSSProperties, ReactNode } from 'react';
2
- import { Position } from '@xyflow/system';
2
+ import { Position } from '@xyflow/react';
3
3
  import { RelationId, Color, ViewId, RelationshipLineType } from '@likec4/core';
4
4
  export declare const RelationshipEdge: NamedExoticComponent<{
5
5
  id: string;
@@ -27,7 +27,7 @@ const ElementDetailsButtonWithHandler = (props) => {
27
27
  const ElementNode = customNode((props) => {
28
28
  return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
29
29
  /* @__PURE__ */ jsx(ElementShape, { ...props }),
30
- /* @__PURE__ */ jsx(ElementTitle, { ...props, iconSize: 40 }),
30
+ /* @__PURE__ */ jsx(ElementTitle, { ...props }),
31
31
  /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
32
32
  /* @__PURE__ */ jsx(ElementActions, { ...props }),
33
33
  /* @__PURE__ */ jsx(ElementPorts, { ...props })
@@ -1,8 +1,7 @@
1
1
  import { EdgeId, Fqn, ViewId, RelationId, Color, RelationshipLineType, BBox } from '@likec4/core';
2
2
  import { RelationshipDetailsActorRef, RelationshipDetailsSnapshot, Events } from './actor';
3
3
  import { Context, ReactNode, CSSProperties } from 'react';
4
- import { GeneralHelpers, ViewportHelperFunctions, ReactFlowState } from '@xyflow/react';
5
- import { EdgeMarkerType, HandleType } from '@xyflow/system';
4
+ import { GeneralHelpers, EdgeMarkerType, HandleType, ViewportHelperFunctions, ReactFlowState } from '@xyflow/react';
6
5
  export declare const RelationshipDetailsActorContext: Context<RelationshipDetailsActorRef | null>;
7
6
  export declare function useRelationshipDetailsActor(): RelationshipDetailsActorRef;
8
7
  export declare function useRelationshipDetailsState<T = unknown>(selector: (state: RelationshipDetailsSnapshot) => T, compare?: (a: NoInfer<T>, b: NoInfer<T>) => boolean): T;
@@ -57,7 +56,7 @@ export declare function useRelationshipDetails(): {
57
56
  active?: boolean;
58
57
  dimmed?: import("../../base").Base.Dimmed;
59
58
  };
60
- }> & Omit< ViewportHelperFunctions, "initialized"> & {
59
+ }> & ViewportHelperFunctions & {
61
60
  viewportInitialized: boolean;
62
61
  }) | null;
63
62
  xystore: {
@@ -1,6 +1,6 @@
1
1
  import { RelationshipsBrowserActorRef } from './actor';
2
2
  import { NamedExoticComponent, CSSProperties, ReactNode } from 'react';
3
- import { Position } from '@xyflow/system';
3
+ import { Position } from '@xyflow/react';
4
4
  import { Fqn, NonEmptyArray, RelationId, Color, ViewId, RelationshipLineType } from '@likec4/core';
5
5
  export declare const edgeTypes: {
6
6
  relationship: NamedExoticComponent<{
@@ -1,10 +1,9 @@
1
1
  import { BBox, Fqn, ViewId, NonEmptyArray, RelationId, Color, RelationshipLineType } from '@likec4/core';
2
- import { EdgeChange, NodeChange, ReactFlowInstance, useStoreApi, GeneralHelpers, ViewportHelperFunctions, ReactFlowState } from '@xyflow/react';
2
+ import { EdgeChange, NodeChange, ReactFlowInstance, useStoreApi, EdgeMarkerType, HandleType, GeneralHelpers, ViewportHelperFunctions, ReactFlowState } from '@xyflow/react';
3
3
  import { ActorLogicFrom, ActorRefFromLogic, SnapshotFrom, PromiseActorLogic, EventObject, StateMachine, Values, NonReducibleUnknown, MetaObject, ConditionalRequired, InputFrom, RequiredActorOptions, IsNotNever, GetConcreteByKey, AnyActorLogic, RequiredLogicInput, ActorRef, MachineSnapshot, AnyActorRef, StateValue, AnyEventObject, ActionFunction, CancelAction, DoneActorEvent } from 'xstate';
4
4
  import { Base } from '../../base';
5
5
  import { RelationshipsBrowserTypes } from './_types';
6
6
  import { LayoutRelationshipsViewResult } from './layout';
7
- import { EdgeMarkerType, HandleType } from '@xyflow/system';
8
7
  import { ReactNode, CSSProperties } from 'react';
9
8
  type XYFLowInstance = ReactFlowInstance<RelationshipsBrowserTypes.Node, RelationshipsBrowserTypes.Edge>;
10
9
  export type XYStoreApi = ReturnType<typeof useStoreApi<RelationshipsBrowserTypes.Node, RelationshipsBrowserTypes.Edge>>;
@@ -1140,7 +1139,7 @@ export declare const relationshipsBrowserLogic: StateMachine<Readonly<{
1140
1139
  active?: boolean;
1141
1140
  dimmed?: Base.Dimmed;
1142
1141
  };
1143
- }> & Omit< ViewportHelperFunctions, "initialized"> & {
1142
+ }> & ViewportHelperFunctions & {
1144
1143
  viewportInitialized: boolean;
1145
1144
  };
1146
1145
  xystore: {
@@ -1,5 +1,5 @@
1
1
  import { NamedExoticComponent, CSSProperties, ReactNode } from 'react';
2
- import { Position } from '@xyflow/system';
2
+ import { Position } from '@xyflow/react';
3
3
  import { Fqn, NonEmptyArray, RelationId, Color, ViewId, RelationshipLineType } from '@likec4/core';
4
4
  export declare const RelationshipEdge: NamedExoticComponent<{
5
5
  id: string;
@@ -29,7 +29,7 @@ const ElementDetailsButtonWithHandler = (props) => {
29
29
  const ElementNode = customNode((props) => {
30
30
  return /* @__PURE__ */ jsxs(ElementNodeContainer, { component: m.div, layoutId: props.id, nodeProps: props, children: [
31
31
  /* @__PURE__ */ jsx(ElementShape, { ...props }),
32
- /* @__PURE__ */ jsx(ElementTitle, { ...props, iconSize: 40 }),
32
+ /* @__PURE__ */ jsx(ElementTitle, { ...props }),
33
33
  /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
34
34
  /* @__PURE__ */ jsx(ElementActions, { ...props }),
35
35
  /* @__PURE__ */ jsx(ElementPorts, { ...props })
@@ -2,8 +2,7 @@ import { Fqn, ViewId, NonEmptyArray, RelationId, Color, RelationshipLineType } f
2
2
  import { RelationshipsBrowserActorRef, RelationshipsBrowserSnapshot, XYStoreApi, Events } from './actor';
3
3
  import { LayoutRelationshipsViewResult } from './layout';
4
4
  import { Context, ReactNode, CSSProperties } from 'react';
5
- import { GeneralHelpers, ViewportHelperFunctions } from '@xyflow/react';
6
- import { EdgeMarkerType, HandleType } from '@xyflow/system';
5
+ import { GeneralHelpers, EdgeMarkerType, HandleType, ViewportHelperFunctions } from '@xyflow/react';
7
6
  export declare const RelationshipsBrowserActorContext: Context<RelationshipsBrowserActorRef | null>;
8
7
  export declare function useRelationshipsBrowserActor(): RelationshipsBrowserActorRef;
9
8
  export declare function useRelationshipsBrowserState<T>(selector: (state: RelationshipsBrowserSnapshot) => T, compare?: (a: T, b: T) => boolean): T;
@@ -57,7 +56,7 @@ export declare function useRelationshipsBrowser(): {
57
56
  active?: boolean;
58
57
  dimmed?: import("../../base").Base.Dimmed;
59
58
  };
60
- }> & Omit< ViewportHelperFunctions, "initialized"> & {
59
+ }> & ViewportHelperFunctions & {
61
60
  viewportInitialized: boolean;
62
61
  }) | null;
63
62
  xystore: XYStoreApi | null;
@@ -1,6 +1,6 @@
1
1
  import { BBox, DiagramView, EdgeId, ElementNotation, Fqn, NodeId, StepEdgeId, ViewChange, ViewId, XYPoint, NonEmptyArray, Point, Color, RelationshipLineType, RelationshipArrowType } from '@likec4/core';
2
- import { ReactFlowInstance, useStoreApi } from '@xyflow/react';
3
- import { EdgeChange, NodeChange, Rect, Viewport, EdgeMarkerType, HandleType, XYPosition } from '@xyflow/system';
2
+ import { ReactFlowInstance, useStoreApi, EdgeMarkerType, HandleType } from '@xyflow/react';
3
+ import { EdgeChange, NodeChange, Rect, Viewport, XYPosition } from '@xyflow/system';
4
4
  import { ActorLogicFrom, ActorRef, AnyEventObject, Snapshot, StateMachine, ActorRefFromLogic, NonReducibleUnknown, EventObject, MetaObject, AnyActorLogic, ConditionalRequired, InputFrom, RequiredLogicInput, IsNotNever, MachineSnapshot, AnyActorRef, StateValue, ActionFunction, CallbackActorLogic, Values, RequiredActorOptions, GetConcreteByKey, CancelAction, StopAction } from 'xstate';
5
5
  import { Base } from '../base/types';
6
6
  import { EnabledFeatures, FeatureName } from '../context/DiagramFeatures';
@@ -3,15 +3,24 @@ import { fromCallback } from 'xstate';
3
3
 
4
4
  const hotkeyActorLogic = fromCallback(({ sendBack }) => {
5
5
  const escHandler = getHotkeyHandler([
6
- ["Escape", () => sendBack({ type: "key.esc" }), {
6
+ ["Escape", (event) => {
7
+ event.stopPropagation();
8
+ sendBack({ type: "key.esc" });
9
+ }, {
7
10
  preventDefault: true
8
11
  }]
9
12
  ]);
10
13
  const arrowshandler = getHotkeyHandler([
11
- ["ArrowLeft", () => sendBack({ type: "key.arrow.left" }), {
14
+ ["ArrowLeft", (event) => {
15
+ event.stopPropagation();
16
+ sendBack({ type: "key.arrow.left" });
17
+ }, {
12
18
  preventDefault: true
13
19
  }],
14
- ["ArrowRight", () => sendBack({ type: "key.arrow.right" }), {
20
+ ["ArrowRight", (event) => {
21
+ event.stopPropagation();
22
+ sendBack({ type: "key.arrow.right" });
23
+ }, {
15
24
  preventDefault: true
16
25
  }]
17
26
  ]);