@likec4/diagram 1.29.1 → 1.31.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/README.md +324 -5
- package/bundle/chunk-BBzMXzCg.js +21383 -0
- package/bundle/custom.js +62 -0
- package/bundle/index.js +17459 -38163
- package/dist/LikeC4CustomColors.js +2 -2
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +4 -2
- package/dist/LikeC4Diagram.props.d.ts +6 -1
- package/dist/LikeC4ModelProvider.d.ts +3 -3
- package/dist/LikeC4ModelProvider.js +0 -1
- package/dist/StaticLikeC4Diagram.d.ts +1 -1
- package/dist/base/BaseXYFlow.js +3 -3
- package/dist/base/primitives/compound/CompoundActionButton.d.ts +3 -2
- package/dist/base/primitives/compound/CompoundDetailsButton.d.ts +3 -2
- package/dist/base/primitives/compound/CompoundNodeContainer.d.ts +7 -3
- package/dist/base/primitives/compound/CompoundNodeContainer.js +3 -2
- package/dist/base/primitives/customEdge.d.ts +2 -35
- package/dist/base/primitives/customEdge.js +2 -2
- package/dist/base/primitives/customNode.d.ts +2 -2
- package/dist/base/primitives/customNode.js +9 -2
- package/dist/base/primitives/edge/EdgeContainer.js +0 -1
- package/dist/base/primitives/edge/EdgeLabel.js +0 -1
- package/dist/base/primitives/edge/EdgeLabelContainer.js +0 -2
- package/dist/base/primitives/edge/EdgePath.js +2 -2
- package/dist/base/primitives/element/ElementNodeContainer.d.ts +24 -22
- package/dist/base/primitives/element/ElementNodeContainer.js +66 -68
- package/dist/base/primitives/element/ElementShape.d.ts +8 -4
- package/dist/base/primitives/element/ElementShape.js +4 -3
- package/dist/base/primitives/element/ElementTitle.css.d.ts +1 -1
- package/dist/base/primitives/element/ElementTitle.js +0 -1
- package/dist/base/types.d.ts +5 -5
- package/dist/bundle/LikeC4View.js +6 -3
- package/dist/bundle/LikeC4View.props.d.ts +5 -1
- package/dist/bundle/ReactLikeC4.js +1 -2
- package/dist/bundle/ShadowRoot.js +3 -3
- package/dist/bundle/custom.d.ts +1 -0
- package/dist/bundle/index.d.ts +3 -1
- package/dist/bundle/index.js +9 -0
- package/dist/bundle/styles.css.js +5 -5
- package/dist/components/SearchControl.js +2 -2
- package/dist/context/ControlsCustomLayout.js +0 -1
- package/dist/context/DiagramEventHandlers.js +5 -5
- package/dist/context/DiagramFeatures.d.ts +2 -4
- package/dist/context/DiagramFeatures.js +15 -16
- package/dist/context/EnsureMantine.js +9 -4
- package/dist/context/FramerMotionConfig.js +0 -1
- package/dist/context/IconRenderer.js +7 -7
- package/dist/context/ReduceGraphics.js +6 -6
- package/dist/context/RootContainer.js +5 -5
- package/dist/context/index.d.ts +1 -1
- package/dist/custom/components.d.ts +5 -0
- package/dist/custom/customNodes.d.ts +218 -0
- package/dist/custom/hooks.d.ts +10 -0
- package/dist/custom/index.d.ts +4 -0
- package/dist/hooks/safeContext.js +3 -3
- package/dist/hooks/useCurrentViewId.d.ts +5 -1
- package/dist/hooks/useCurrentViewId.js +1 -2
- package/dist/hooks/useDiagram.d.ts +14 -12544
- package/dist/hooks/useDiagram.js +3 -5
- package/dist/hooks/useMantinePortalProps.js +2 -2
- package/dist/hooks/useSetState.js +3 -3
- package/dist/hooks/useUpdateEffect.js +0 -1
- package/dist/hooks/useXYFlow.d.ts +64 -64
- package/dist/hooks/useXYFlow.js +2 -2
- package/dist/index.d.ts +2 -4
- package/dist/index.js +8 -3
- package/dist/likec4diagram/DiagramUI.js +2 -2
- package/dist/likec4diagram/DiagramXYFlow.d.ts +1 -1
- package/dist/likec4diagram/DiagramXYFlow.js +25 -7
- package/dist/likec4diagram/custom/edges/NotePopover.js +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +9 -13
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +8 -8
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +14 -12
- package/dist/likec4diagram/custom/index.d.ts +15 -19
- package/dist/likec4diagram/custom/index.js +3 -3
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +2 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +27 -4
- package/dist/likec4diagram/custom/nodes/ElementActions.js +67 -53
- package/dist/likec4diagram/custom/nodes/index.d.ts +8 -0
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +10 -0
- package/dist/likec4diagram/custom/nodes/{nodeTypes.js → nodes.js} +39 -39
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +6 -7
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.ts +3 -2
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
- package/dist/likec4diagram/types.d.ts +15 -7
- package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +4 -4
- package/dist/likec4diagram/ui/controls/Controls.js +2 -2
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +2 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.js +6 -8
- package/dist/likec4diagram/ui/search/ElementsColumn.js +6 -7
- package/dist/likec4diagram/ui/search/LikeC4Search.js +3 -3
- package/dist/likec4diagram/ui/search/SearchInput.js +0 -1
- package/dist/likec4diagram/ui/search/_shared.css.d.ts +1 -1
- package/dist/likec4diagram/ui/search/state.js +3 -4
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +4 -4
- package/dist/likec4diagram/useLayoutConstraints.js +3 -4
- package/dist/likec4diagram/useViewToNodesEdges.js +2 -0
- package/dist/likec4model/LikeC4ModelContext.d.ts +2 -2
- package/dist/likec4model/LikeC4ModelContext.js +2 -2
- package/dist/likec4model/useLikeC4ElementsTree.d.ts +1 -1
- package/dist/likec4model/useLikeC4ElementsTree.js +3 -3
- package/dist/likec4model/useLikeC4Model.d.ts +1 -1
- package/dist/likec4model/useLikeC4Model.js +2 -2
- package/dist/overlays/Overlays.d.ts +2 -3
- package/dist/overlays/Overlays.js +5 -6
- package/dist/overlays/element-details/ElementDetailsCard.css.js +13 -9
- package/dist/overlays/element-details/ElementDetailsCard.js +98 -105
- package/dist/overlays/element-details/TabPanelDeployments.js +4 -4
- package/dist/overlays/element-details/TabPanelRelationships.js +2 -2
- package/dist/overlays/element-details/TabPanelStructure.js +3 -3
- package/dist/overlays/element-details/actor.d.ts +6905 -19690
- package/dist/overlays/element-details/actor.js +0 -2
- package/dist/overlays/element-details/actorContext.js +3 -3
- package/dist/overlays/overlay/Overlay.d.ts +11 -1
- package/dist/overlays/overlay/Overlay.js +8 -8
- package/dist/overlays/overlaysActor.d.ts +4 -2
- package/dist/overlays/overlaysActor.js +2 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +4 -8
- package/dist/overlays/relationship-details/RelationshipDetails.js +12 -12
- package/dist/overlays/relationship-details/SelectEdge.js +2 -3
- package/dist/overlays/relationship-details/_types.d.ts +6 -5
- package/dist/overlays/relationship-details/actor.d.ts +3 -3
- package/dist/overlays/relationship-details/compute.js +3 -3
- package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +4 -8
- package/dist/overlays/relationship-details/custom/edgeTypes.js +2 -2
- package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +3 -31
- package/dist/overlays/relationship-details/hooks.d.ts +27 -27
- package/dist/overlays/relationship-details/hooks.js +4 -4
- package/dist/overlays/relationship-details/layout.js +2 -3
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +4 -8
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +8 -8
- package/dist/overlays/relationships-browser/SelectElement.js +5 -5
- package/dist/overlays/relationships-browser/_types.d.ts +6 -5
- package/dist/overlays/relationships-browser/actor.d.ts +63 -428
- package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +4 -8
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +2 -2
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +10 -14
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -2
- package/dist/overlays/relationships-browser/hooks.d.ts +4 -61
- package/dist/overlays/relationships-browser/hooks.js +4 -4
- package/dist/overlays/relationships-browser/layout.js +3 -4
- package/dist/state/DiagramActorProvider.js +3 -3
- package/dist/state/diagram-machine.d.ts +186 -10369
- package/dist/state/diagram-machine.js +2 -1
- package/dist/state/hotkeyActor.d.ts +4 -2
- package/dist/state/syncManualLayoutActor.d.ts +14 -3
- package/dist/state/syncManualLayoutActor.js +2 -1
- package/dist/state/types.d.ts +5 -4
- package/dist/state/utils.d.ts +1 -1
- package/dist/styles-font.css +1 -0
- package/dist/styles-min.css +1 -0
- package/dist/styles-xyflow.css +1 -0
- package/dist/styles.css +1 -0
- package/dist/styles.css2.js +3 -0
- package/package.json +46 -21
- package/panda.buildinfo.json +979 -0
- package/src/LikeC4Diagram.props.ts +7 -1
- package/src/LikeC4Diagram.tsx +2 -0
- package/src/LikeC4ModelProvider.tsx +3 -3
- package/src/StaticLikeC4Diagram.tsx +1 -0
- package/src/base/Background.tsx +0 -4
- package/src/base/primitives/compound/CompoundActionButton.tsx +7 -4
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +7 -4
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +8 -7
- package/src/base/primitives/customEdge.ts +1 -1
- package/src/base/primitives/{customNode.ts → customNode.tsx} +11 -3
- package/src/base/primitives/element/ElementNodeContainer.tsx +87 -80
- package/src/base/primitives/element/ElementShape.tsx +11 -10
- package/src/base/types.ts +28 -33
- package/src/bundle/LikeC4View.props.ts +6 -1
- package/src/bundle/LikeC4View.tsx +3 -0
- package/src/bundle/ReactLikeC4.tsx +1 -1
- package/src/bundle/custom.ts +1 -0
- package/src/bundle/index.ts +20 -1
- package/src/bundle/styles.css.ts +1 -1
- package/src/components/SearchControl.tsx +1 -1
- package/src/context/DiagramFeatures.tsx +12 -8
- package/src/context/EnsureMantine.tsx +13 -3
- package/src/context/IconRenderer.tsx +4 -2
- package/src/context/ReduceGraphics.tsx +6 -6
- package/src/context/index.ts +0 -1
- package/src/custom/components.ts +47 -0
- package/src/custom/customNodes.tsx +244 -0
- package/src/custom/hooks.ts +35 -0
- package/src/custom/index.ts +5 -0
- package/src/hooks/useCurrentViewId.ts +9 -1
- package/src/hooks/useDiagram.ts +30 -9
- package/src/index.ts +4 -8
- package/src/likec4diagram/DiagramXYFlow.tsx +28 -5
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +1 -1
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +9 -7
- package/src/likec4diagram/custom/{index.tsx → index.ts} +2 -2
- package/src/likec4diagram/custom/nodes/CompoundActions.tsx +2 -2
- package/src/likec4diagram/custom/nodes/ElementActions.tsx +100 -57
- package/src/likec4diagram/custom/nodes/index.ts +17 -0
- package/src/likec4diagram/custom/nodes/{nodeTypes.tsx → nodes.tsx} +52 -36
- package/src/likec4diagram/custom/nodes/toolbar/CompoundToolbar.tsx +3 -4
- package/src/likec4diagram/custom/nodes/toolbar/ElementToolbar.tsx +3 -3
- package/src/likec4diagram/custom/nodes/toolbar/Toolbar.tsx +5 -4
- package/src/likec4diagram/types.ts +19 -9
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +1 -1
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -2
- package/src/likec4diagram/ui/search/ElementsColumn.tsx +2 -4
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +1 -1
- package/src/likec4diagram/useViewToNodesEdges.ts +2 -0
- package/src/likec4model/LikeC4ModelContext.ts +2 -2
- package/src/likec4model/useLikeC4ElementsTree.ts +3 -1
- package/src/likec4model/useLikeC4Model.ts +1 -1
- package/src/overlays/Overlays.tsx +2 -3
- package/src/overlays/element-details/ElementDetailsCard.css.ts +14 -22
- package/src/overlays/element-details/ElementDetailsCard.tsx +18 -16
- package/src/overlays/overlay/Overlay.tsx +3 -4
- package/src/overlays/overlaysActor.ts +4 -3
- package/src/overlays/relationship-details/RelationshipDetails.tsx +1 -1
- package/src/overlays/relationship-details/SelectEdge.tsx +0 -2
- package/src/overlays/relationship-details/_types.ts +16 -13
- package/src/overlays/relationship-details/custom/edgeTypes.tsx +2 -2
- package/src/overlays/relationships-browser/_types.ts +18 -15
- package/src/overlays/relationships-browser/actor.ts +2 -2
- package/src/overlays/relationships-browser/custom/edgeTypes.tsx +2 -2
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +1 -2
- package/src/state/DiagramActorProvider.tsx +2 -2
- package/src/state/diagram-machine.ts +13 -8
- package/src/state/hotkeyActor.ts +4 -2
- package/src/state/syncManualLayoutActor.ts +9 -3
- package/src/state/types.ts +9 -3
- package/src/state/utils.ts +3 -3
- package/src/styles-min.css +2 -0
- package/src/styles-xyflow.css +1 -0
- package/dist/_virtual/_commonjsHelpers.js +0 -5
- package/dist/_virtual/default-map.js +0 -7
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index2.js +0 -3
- package/dist/_virtual/react.production.js +0 -3
- package/dist/_virtual/set.js +0 -5
- package/dist/_virtual/set2.js +0 -3
- package/dist/base/xyflowMachine.d.ts +0 -212
- package/dist/likec4diagram/custom/nodes/nodeTypes.d.ts +0 -8
- package/dist/node_modules/.pnpm/mnemonist@0.40.3_patch_hash_5c12abb43fcff6fd81e53021b89075d53249640d165a2556cc1e58d71201a13a/node_modules/mnemonist/default-map.js +0 -172
- package/dist/node_modules/.pnpm/mnemonist@0.40.3_patch_hash_5c12abb43fcff6fd81e53021b89075d53249640d165a2556cc1e58d71201a13a/node_modules/mnemonist/set.js +0 -369
- package/dist/node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.production.js +0 -556
- package/dist/node_modules/.pnpm/react@19.1.0/node_modules/react/index.js +0 -15
- package/dist/packages/core/src/compute-view/relationships-view/compute.js +0 -123
- package/dist/packages/core/src/compute-view/relationships-view/utils.js +0 -68
- package/dist/packages/core/src/errors/index.js +0 -15
- package/dist/packages/core/src/model/connection/model/ConnectionModel.js +0 -121
- package/dist/packages/core/src/model/connection/model/find.js +0 -39
- package/dist/packages/core/src/model/connection/ops.js +0 -7
- package/dist/packages/core/src/utils/const.js +0 -3
- package/dist/packages/core/src/utils/fqn.js +0 -51
- package/dist/packages/core/src/utils/guards.js +0 -7
- package/dist/packages/core/src/utils/iterable/filter.js +0 -21
- package/dist/packages/core/src/utils/iterable/find.js +0 -21
- package/dist/packages/core/src/utils/iterable/map.js +0 -18
- package/dist/packages/core/src/utils/iterable/some.js +0 -21
- package/dist/packages/core/src/utils/iterable/to.js +0 -14
- package/dist/packages/core/src/utils/set.js +0 -48
- package/dist/packages/core/src/utils/string-hash.js +0 -13
- package/dist/styles.css.js +0 -3
- package/src/base/xyflowMachine.ts +0 -75
- /package/dist/{bundle/font.css.js → styles-font.css2.js} +0 -0
- /package/src/{bundle/font.css → styles-font.css} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
2
|
|
|
3
|
-
const ElementDetailsActorContext =
|
|
3
|
+
const ElementDetailsActorContext = createContext(null);
|
|
4
4
|
ElementDetailsActorContext.displayName = "ElementDetailsActorContext";
|
|
5
5
|
const useElementDetailsActorRef = () => {
|
|
6
|
-
const ctx =
|
|
6
|
+
const ctx = useContext(ElementDetailsActorContext);
|
|
7
7
|
if (ctx === null) {
|
|
8
8
|
throw new Error("ElementDetailsActorRef is not provided");
|
|
9
9
|
}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import { ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
|
|
1
|
+
import { PropsWithChildren, ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
|
|
2
|
+
export type OverlayProps = PropsWithChildren<{
|
|
3
|
+
overlayLevel?: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
classes?: {
|
|
6
|
+
dialog?: string;
|
|
7
|
+
body?: string;
|
|
8
|
+
};
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onClick?: never;
|
|
11
|
+
}>;
|
|
2
12
|
export declare const Overlay: ForwardRefExoticComponent<{
|
|
3
13
|
overlayLevel?: number;
|
|
4
14
|
className?: string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
|
-
import { RemoveScroll
|
|
3
|
+
import { RemoveScroll } 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 'motion/react';
|
|
7
|
-
import {
|
|
7
|
+
import { forwardRef, useState, useRef, useEffect } from 'react';
|
|
8
8
|
import { overlay, backdropOpacity, backdropBlur, level } from './Overlay.css.js';
|
|
9
9
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
10
10
|
|
|
11
|
-
const Overlay =
|
|
11
|
+
const Overlay = forwardRef(({
|
|
12
12
|
onClose,
|
|
13
13
|
className,
|
|
14
14
|
classes,
|
|
@@ -16,9 +16,9 @@ const Overlay = reactExports.forwardRef(({
|
|
|
16
16
|
children,
|
|
17
17
|
...rest
|
|
18
18
|
}, ref) => {
|
|
19
|
-
const [opened, setOpened] =
|
|
20
|
-
const dialogRef =
|
|
21
|
-
const isClosingRef =
|
|
19
|
+
const [opened, setOpened] = useState(false);
|
|
20
|
+
const dialogRef = useRef(null);
|
|
21
|
+
const isClosingRef = useRef(false);
|
|
22
22
|
const motionNotReduced = useReducedMotionConfig() !== true;
|
|
23
23
|
const onCloseRef = useSyncedRef(onClose);
|
|
24
24
|
const close = useDebouncedCallback(
|
|
@@ -30,7 +30,7 @@ const Overlay = reactExports.forwardRef(({
|
|
|
30
30
|
[],
|
|
31
31
|
50
|
|
32
32
|
);
|
|
33
|
-
|
|
33
|
+
useEffect(() => {
|
|
34
34
|
const cancel = (e) => {
|
|
35
35
|
e.preventDefault();
|
|
36
36
|
e.stopPropagation();
|
|
@@ -104,7 +104,7 @@ const Overlay = reactExports.forwardRef(({
|
|
|
104
104
|
close();
|
|
105
105
|
},
|
|
106
106
|
...rest,
|
|
107
|
-
children: /* @__PURE__ */ jsx(RemoveScroll, { forwardProps: true, removeScrollBar: false, children: /* @__PURE__ */ jsx(
|
|
107
|
+
children: /* @__PURE__ */ jsx(RemoveScroll, { forwardProps: true, removeScrollBar: false, children: /* @__PURE__ */ jsx("div", { className: cx(styles.body, "overlay-body", classes?.body), children: opened && /* @__PURE__ */ jsx(Fragment, { children }) }) })
|
|
108
108
|
}
|
|
109
109
|
);
|
|
110
110
|
});
|
|
@@ -38,7 +38,7 @@ export type OverlayActorEmitedEvent = {
|
|
|
38
38
|
} | {
|
|
39
39
|
type: 'idle';
|
|
40
40
|
};
|
|
41
|
-
|
|
41
|
+
declare const _overlaysActorLogic: StateMachine<OverlaysContext, OverlayActorEvent, {
|
|
42
42
|
[x: `elementDetails-${number}`]: ActorRefFromLogic<ElementDetailsLogic> | undefined;
|
|
43
43
|
[x: `relationshipsBrowser-${number}`]: ActorRefFromLogic<Overlays.RelationshipsBrowser.Logic> | undefined;
|
|
44
44
|
[x: `relationshipDetails-${number}`]: ActorRefFromLogic<Overlays.RelationshipDetails.Logic> | undefined;
|
|
@@ -183,8 +183,10 @@ export declare const overlaysActorLogic: StateMachine<OverlaysContext, OverlayAc
|
|
|
183
183
|
};
|
|
184
184
|
readonly exit: readonly ["stopListeningToEsc", "closeAllOverlays"];
|
|
185
185
|
}>;
|
|
186
|
-
export interface OverlaysActorLogic extends ActorLogicFrom<typeof
|
|
186
|
+
export interface OverlaysActorLogic extends ActorLogicFrom<typeof _overlaysActorLogic> {
|
|
187
187
|
}
|
|
188
|
+
export declare const overlaysActorLogic: OverlaysActorLogic;
|
|
188
189
|
export type OverlaysActorSnapshot = SnapshotFrom<OverlaysActorLogic>;
|
|
189
190
|
export interface OverlaysActorRef extends ActorRefFrom<OverlaysActorLogic> {
|
|
190
191
|
}
|
|
192
|
+
export {};
|
|
@@ -19,7 +19,7 @@ const hotkeyLogic = fromCallback(({ sendBack }) => {
|
|
|
19
19
|
document.body.removeEventListener("keydown", handler, { capture: true });
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
|
-
const
|
|
22
|
+
const _overlaysActorLogic = setup({
|
|
23
23
|
types: {
|
|
24
24
|
context: {},
|
|
25
25
|
events: {},
|
|
@@ -231,5 +231,6 @@ const overlaysActorLogic = setup({
|
|
|
231
231
|
"closeAllOverlays"
|
|
232
232
|
]
|
|
233
233
|
});
|
|
234
|
+
const overlaysActorLogic = _overlaysActorLogic;
|
|
234
235
|
|
|
235
236
|
export { overlaysActorLogic };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { RelationshipDetailsActorRef } from './actor';
|
|
2
|
-
import {
|
|
2
|
+
import { FunctionComponent, CSSProperties, ReactNode } from 'react';
|
|
3
3
|
import { Position } from '@xyflow/system';
|
|
4
4
|
import { RelationId, Color, ViewId, RelationshipLineType } from '@likec4/core';
|
|
5
5
|
export declare const edgeTypes: {
|
|
6
|
-
relationship:
|
|
6
|
+
relationship: FunctionComponent<{
|
|
7
7
|
id: string;
|
|
8
8
|
selected?: boolean;
|
|
9
9
|
selectable?: boolean;
|
|
10
10
|
deletable?: boolean;
|
|
11
11
|
style?: CSSProperties;
|
|
12
|
+
animated?: boolean;
|
|
12
13
|
source: string;
|
|
13
14
|
target: string;
|
|
14
|
-
animated?: boolean;
|
|
15
15
|
sourceX: number;
|
|
16
16
|
sourceY: number;
|
|
17
17
|
targetX: number;
|
|
@@ -30,11 +30,10 @@ export declare const edgeTypes: {
|
|
|
30
30
|
markerEnd?: string;
|
|
31
31
|
pathOptions?: any;
|
|
32
32
|
interactionWidth?: number;
|
|
33
|
-
data: {
|
|
33
|
+
data: import("../../base").Base.EdgeData & {
|
|
34
34
|
hovered?: boolean;
|
|
35
35
|
active?: boolean;
|
|
36
36
|
dimmed?: import("../../base").Base.Dimmed;
|
|
37
|
-
} & {
|
|
38
37
|
relationId: RelationId;
|
|
39
38
|
color: Color | undefined;
|
|
40
39
|
label: string | null;
|
|
@@ -42,9 +41,6 @@ export declare const edgeTypes: {
|
|
|
42
41
|
description?: string | undefined | undefined;
|
|
43
42
|
navigateTo: ViewId | null;
|
|
44
43
|
line: RelationshipLineType;
|
|
45
|
-
hovered?: boolean;
|
|
46
|
-
active?: boolean;
|
|
47
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
48
44
|
};
|
|
49
45
|
}>;
|
|
50
46
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { invariant, nonNullable, isAncestor } from '@likec4/core';
|
|
3
|
+
import { cx } from '@likec4/styles/css';
|
|
3
4
|
import { ActionIcon, Group } from '@mantine/core';
|
|
4
5
|
import { useCallbackRef, useStateHistory } from '@mantine/hooks';
|
|
5
6
|
import { IconX, IconChevronLeft, IconChevronRight } from '@tabler/icons-react';
|
|
6
7
|
import { useSelector } from '@xstate/react';
|
|
7
8
|
import { ReactFlowProvider, Panel, useStoreApi, useReactFlow } from '@xyflow/react';
|
|
8
|
-
import clsx from 'clsx';
|
|
9
9
|
import { deepEqual } from 'fast-equals';
|
|
10
10
|
import { LayoutGroup, AnimatePresence, m } from 'motion/react';
|
|
11
|
-
import {
|
|
11
|
+
import { useRef, memo, useMemo, useEffect } from 'react';
|
|
12
12
|
import { isTruthy, find } from 'remeda';
|
|
13
13
|
import { BaseXYFlow } from '../../base/BaseXYFlow.js';
|
|
14
14
|
import { useLikeC4Model } from '../../likec4model/useLikeC4Model.js';
|
|
@@ -27,7 +27,7 @@ const edgeTypes = {
|
|
|
27
27
|
relationship: RelationshipEdge
|
|
28
28
|
};
|
|
29
29
|
function RelationshipDetails({ actorRef }) {
|
|
30
|
-
const initialRef =
|
|
30
|
+
const initialRef = useRef(null);
|
|
31
31
|
if (initialRef.current == null) {
|
|
32
32
|
initialRef.current = {
|
|
33
33
|
defaultNodes: [],
|
|
@@ -43,12 +43,12 @@ const selectSubject = (state) => ({
|
|
|
43
43
|
...state.context.subject,
|
|
44
44
|
viewId: state.context.viewId
|
|
45
45
|
});
|
|
46
|
-
const SyncRelationshipDetailsXYFlow =
|
|
46
|
+
const SyncRelationshipDetailsXYFlow = memo(() => {
|
|
47
47
|
const actor = useRelationshipDetailsActor();
|
|
48
48
|
const subject = useSelector(actor, selectSubject, deepEqual);
|
|
49
49
|
const likec4model = useLikeC4Model(true);
|
|
50
50
|
const view = likec4model.findView(subject.viewId) ?? null;
|
|
51
|
-
const data =
|
|
51
|
+
const data = useMemo(() => {
|
|
52
52
|
let data2;
|
|
53
53
|
if ("edgeId" in subject && isTruthy(subject.edgeId)) {
|
|
54
54
|
invariant(view, `view ${subject.viewId} not found`);
|
|
@@ -70,12 +70,12 @@ const SyncRelationshipDetailsXYFlow = reactExports.memo(() => {
|
|
|
70
70
|
]);
|
|
71
71
|
const store = useStoreApi();
|
|
72
72
|
const instance = useReactFlow();
|
|
73
|
-
|
|
73
|
+
useEffect(() => {
|
|
74
74
|
if (instance.viewportInitialized) {
|
|
75
75
|
actor.send({ type: "xyflow.init", instance, store });
|
|
76
76
|
}
|
|
77
77
|
}, [store, instance.viewportInitialized, actor]);
|
|
78
|
-
|
|
78
|
+
useEffect(() => {
|
|
79
79
|
if (data !== null) {
|
|
80
80
|
actor.send({ type: "update.layoutData", data });
|
|
81
81
|
}
|
|
@@ -89,7 +89,7 @@ const selector = ({ context }) => ({
|
|
|
89
89
|
nodes: context.xynodes,
|
|
90
90
|
edges: context.xyedges
|
|
91
91
|
});
|
|
92
|
-
const RelationshipDetailsInner =
|
|
92
|
+
const RelationshipDetailsInner = memo(() => {
|
|
93
93
|
const browser = useRelationshipDetails();
|
|
94
94
|
const {
|
|
95
95
|
initialized,
|
|
@@ -102,7 +102,7 @@ const RelationshipDetailsInner = reactExports.memo(() => {
|
|
|
102
102
|
id: browser.rootElementId,
|
|
103
103
|
nodes,
|
|
104
104
|
edges,
|
|
105
|
-
className:
|
|
105
|
+
className: cx(initialized ? "initialized" : "not-initialized"),
|
|
106
106
|
nodeTypes,
|
|
107
107
|
edgeTypes,
|
|
108
108
|
onNodesChange: useCallbackRef((changes) => {
|
|
@@ -168,7 +168,7 @@ const topLeftPanelselector = ({ context }) => ({
|
|
|
168
168
|
subject: context.subject,
|
|
169
169
|
viewId: context.viewId
|
|
170
170
|
});
|
|
171
|
-
const TopLeftPanel =
|
|
171
|
+
const TopLeftPanel = memo(() => {
|
|
172
172
|
const { subject, viewId } = useRelationshipDetailsState(topLeftPanelselector, deepEqual);
|
|
173
173
|
const likec4model = useLikeC4Model(true);
|
|
174
174
|
const view = likec4model.findView(viewId);
|
|
@@ -188,12 +188,12 @@ const TopLeftPanelInner = ({ edge, view }) => {
|
|
|
188
188
|
const browser = useRelationshipDetails();
|
|
189
189
|
const edgeId = edge.id;
|
|
190
190
|
const [historyEdgeId, historyOps, { history, current }] = useStateHistory(edge.id);
|
|
191
|
-
|
|
191
|
+
useEffect(() => {
|
|
192
192
|
if (historyEdgeId !== edgeId) {
|
|
193
193
|
historyOps.set(edgeId);
|
|
194
194
|
}
|
|
195
195
|
}, [edgeId]);
|
|
196
|
-
|
|
196
|
+
useEffect(() => {
|
|
197
197
|
if (historyEdgeId !== edgeId) {
|
|
198
198
|
browser.navigateTo(historyEdgeId);
|
|
199
199
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import '@likec4/core';
|
|
3
2
|
import { Popover, PopoverTarget, Button, Box, Text, ThemeIcon, PopoverDropdown, ScrollAreaAutosize } from '@mantine/core';
|
|
4
3
|
import { IconArrowRight, IconSelector } from '@tabler/icons-react';
|
|
5
|
-
import {
|
|
4
|
+
import { useRef } from 'react';
|
|
6
5
|
import { useRelationshipDetails } from './hooks.js';
|
|
7
6
|
import { edgeSource, edgeTarget, scrollArea, edgeGrid, edgeRow, edgeArrow, edgeLabel } from './SelectEdge.css.js';
|
|
8
7
|
|
|
@@ -11,7 +10,7 @@ const SelectEdge = ({
|
|
|
11
10
|
view
|
|
12
11
|
}) => {
|
|
13
12
|
const browser = useRelationshipDetails();
|
|
14
|
-
const viewport =
|
|
13
|
+
const viewport = useRef(null);
|
|
15
14
|
const edgeSource$1 = view.nodes.find((n) => n.id === edge.source);
|
|
16
15
|
const edgeTarget$1 = view.nodes.find((n) => n.id === edge.target);
|
|
17
16
|
const edges = view.edges.flatMap((edge2) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Color, DiagramNode, Fqn, IconUrl, RelationId, RelationshipLineType, ViewId } from '@likec4/core';
|
|
2
|
+
import { Simplify } from 'type-fest';
|
|
2
3
|
import { Base, NonOptional, ReactFlowEdge, ReactFlowNode } from '../../base/types';
|
|
3
4
|
export declare namespace RelationshipDetailsTypes {
|
|
4
5
|
type Column = 'sources' | 'targets';
|
|
@@ -9,24 +10,24 @@ export declare namespace RelationshipDetailsTypes {
|
|
|
9
10
|
in: string[];
|
|
10
11
|
out: string[];
|
|
11
12
|
};
|
|
12
|
-
type ElementNodeData = Base.NodeData
|
|
13
|
+
type ElementNodeData = Base.NodeData & NonOptional<Pick<DiagramNode, 'title' | 'technology' | 'description' | 'color' | 'shape' | 'width' | 'height' | 'navigateTo' | 'style'>> & {
|
|
13
14
|
column: Column;
|
|
14
15
|
fqn: Fqn;
|
|
15
16
|
icon: IconUrl;
|
|
16
17
|
ports: Ports;
|
|
17
|
-
}
|
|
18
|
-
type CompoundNodeData = Base.NodeData
|
|
18
|
+
};
|
|
19
|
+
type CompoundNodeData = Base.NodeData & NonOptional<Pick<DiagramNode, 'title' | 'color' | 'style'>> & {
|
|
19
20
|
column: Column;
|
|
20
21
|
fqn: Fqn;
|
|
21
22
|
depth: number;
|
|
22
23
|
icon?: IconUrl;
|
|
23
24
|
ports: Ports;
|
|
24
|
-
}
|
|
25
|
+
};
|
|
25
26
|
type ElementNode = ReactFlowNode<ElementNodeData, 'element'>;
|
|
26
27
|
type CompoundNode = ReactFlowNode<CompoundNodeData, 'compound'>;
|
|
27
28
|
type Node = ElementNode | CompoundNode;
|
|
28
29
|
type NodeData = Node['data'];
|
|
29
|
-
type EdgeData = Base.EdgeData
|
|
30
|
+
type EdgeData = Simplify<Base.EdgeData & {
|
|
30
31
|
relationId: RelationId;
|
|
31
32
|
color: Color | undefined;
|
|
32
33
|
label: string | null;
|
|
@@ -621,6 +621,9 @@ export declare const relationshipDetailsLogic: StateMachine<Readonly<{
|
|
|
621
621
|
focusable?: boolean;
|
|
622
622
|
type: "relationship";
|
|
623
623
|
data: {
|
|
624
|
+
hovered?: boolean;
|
|
625
|
+
active?: boolean;
|
|
626
|
+
dimmed?: Base.Dimmed;
|
|
624
627
|
relationId: RelationId;
|
|
625
628
|
color: Color | undefined;
|
|
626
629
|
label: string | null;
|
|
@@ -628,9 +631,6 @@ export declare const relationshipDetailsLogic: StateMachine<Readonly<{
|
|
|
628
631
|
description?: string | undefined | undefined;
|
|
629
632
|
navigateTo: ViewId | null;
|
|
630
633
|
line: RelationshipLineType;
|
|
631
|
-
hovered?: boolean;
|
|
632
|
-
active?: boolean;
|
|
633
|
-
dimmed?: Base.Dimmed;
|
|
634
634
|
};
|
|
635
635
|
}[];
|
|
636
636
|
bounds: BBox;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hasAtLeast, invariant, isAncestor, sortParentsFirst } from '@likec4/core';
|
|
2
|
-
import { treeFromElements } from '
|
|
3
|
-
import {
|
|
2
|
+
import { treeFromElements } from '@likec4/core/compute-view/relationships';
|
|
3
|
+
import { modelConnection } from '@likec4/core/model';
|
|
4
4
|
|
|
5
5
|
const finalize = (elements, explicits) => {
|
|
6
6
|
if (elements.size > 2 && explicits.size !== elements.size) {
|
|
@@ -96,7 +96,7 @@ function computeRelationshipDetailsViewData({
|
|
|
96
96
|
if (target) {
|
|
97
97
|
addExplicit(target, "target");
|
|
98
98
|
}
|
|
99
|
-
const [connection] = findConnection(source, target, "directed");
|
|
99
|
+
const [connection] = modelConnection.findConnection(source, target, "directed");
|
|
100
100
|
if (!connection) {
|
|
101
101
|
return {
|
|
102
102
|
sources,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FunctionComponent, CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { Position } from '@xyflow/system';
|
|
3
3
|
import { RelationId, Color, ViewId, RelationshipLineType } from '@likec4/core';
|
|
4
|
-
export declare const RelationshipEdge:
|
|
4
|
+
export declare const RelationshipEdge: FunctionComponent<{
|
|
5
5
|
id: string;
|
|
6
6
|
selected?: boolean;
|
|
7
7
|
selectable?: boolean;
|
|
8
8
|
deletable?: boolean;
|
|
9
9
|
style?: CSSProperties;
|
|
10
|
+
animated?: boolean;
|
|
10
11
|
source: string;
|
|
11
12
|
target: string;
|
|
12
|
-
animated?: boolean;
|
|
13
13
|
sourceX: number;
|
|
14
14
|
sourceY: number;
|
|
15
15
|
targetX: number;
|
|
@@ -28,11 +28,10 @@ export declare const RelationshipEdge: NamedExoticComponent<{
|
|
|
28
28
|
markerEnd?: string;
|
|
29
29
|
pathOptions?: any;
|
|
30
30
|
interactionWidth?: number;
|
|
31
|
-
data: {
|
|
31
|
+
data: import("../../../base").Base.EdgeData & {
|
|
32
32
|
hovered?: boolean;
|
|
33
33
|
active?: boolean;
|
|
34
34
|
dimmed?: import("../../../base").Base.Dimmed;
|
|
35
|
-
} & {
|
|
36
35
|
relationId: RelationId;
|
|
37
36
|
color: Color | undefined;
|
|
38
37
|
label: string | null;
|
|
@@ -40,8 +39,5 @@ export declare const RelationshipEdge: NamedExoticComponent<{
|
|
|
40
39
|
description?: string | undefined | undefined;
|
|
41
40
|
navigateTo: ViewId | null;
|
|
42
41
|
line: RelationshipLineType;
|
|
43
|
-
hovered?: boolean;
|
|
44
|
-
active?: boolean;
|
|
45
|
-
dimmed?: import("../../../base").Base.Dimmed;
|
|
46
42
|
};
|
|
47
43
|
}>;
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { getBezierPath } from '@xyflow/system';
|
|
3
3
|
import { useDiagram } from '../../../hooks/useDiagram.js';
|
|
4
4
|
import { customEdge } from '../../../base/primitives/customEdge.js';
|
|
5
|
-
import {
|
|
5
|
+
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
6
6
|
import { EdgeContainer } from '../../../base/primitives/edge/EdgeContainer.js';
|
|
7
7
|
import { EdgePath } from '../../../base/primitives/edge/EdgePath.js';
|
|
8
8
|
import { EdgeLabelContainer } from '../../../base/primitives/edge/EdgeLabelContainer.js';
|
|
@@ -10,7 +10,7 @@ import { EdgeLabel } from '../../../base/primitives/edge/EdgeLabel.js';
|
|
|
10
10
|
import { EdgeActionButton } from '../../../base/primitives/edge/EdgeActionButton.js';
|
|
11
11
|
|
|
12
12
|
const RelationshipEdge = customEdge((props) => {
|
|
13
|
-
const { enableNavigateTo } =
|
|
13
|
+
const { enableNavigateTo } = useEnabledFeatures();
|
|
14
14
|
const {
|
|
15
15
|
sourceX,
|
|
16
16
|
targetY,
|
|
@@ -1,36 +1,8 @@
|
|
|
1
1
|
import { NodeProps } from '../../../base';
|
|
2
2
|
import { RelationshipDetailsTypes } from '../_types';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
style: ElementStyle;
|
|
9
|
-
title: string;
|
|
10
|
-
technology: string | null;
|
|
11
|
-
description: string | null;
|
|
12
|
-
color: Color;
|
|
13
|
-
shape: "rectangle" | "person" | "browser" | "mobile" | "cylinder" | "storage" | "queue";
|
|
14
|
-
navigateTo: ViewId<string> | null | undefined;
|
|
15
|
-
column: RelationshipDetailsTypes.Column;
|
|
16
|
-
fqn: Fqn;
|
|
17
|
-
icon: IconUrl;
|
|
18
|
-
ports: RelationshipDetailsTypes.Ports;
|
|
19
|
-
hovered?: boolean;
|
|
20
|
-
dimmed?: import("../../../base").Base.Dimmed;
|
|
21
|
-
}>>;
|
|
22
|
-
export declare const CompoundNode: NamedExoticComponent<NodeProps<{
|
|
23
|
-
style: ElementStyle;
|
|
24
|
-
title: string;
|
|
25
|
-
color: Color;
|
|
26
|
-
column: RelationshipDetailsTypes.Column;
|
|
27
|
-
fqn: Fqn;
|
|
28
|
-
depth: number;
|
|
29
|
-
icon?: IconUrl;
|
|
30
|
-
ports: RelationshipDetailsTypes.Ports;
|
|
31
|
-
hovered?: boolean;
|
|
32
|
-
dimmed?: import("../../../base").Base.Dimmed;
|
|
33
|
-
}>>;
|
|
3
|
+
import { MemoExoticComponent } from 'react';
|
|
4
|
+
export declare const ElementNode: MemoExoticComponent<(props: NodeProps<RelationshipDetailsTypes.ElementNodeData, string>) => import("react/jsx-runtime").JSX.Element>;
|
|
5
|
+
export declare const CompoundNode: MemoExoticComponent<(props: NodeProps<RelationshipDetailsTypes.CompoundNodeData, string>) => import("react/jsx-runtime").JSX.Element>;
|
|
34
6
|
type ElementPortsProps = NodeProps<Pick<RelationshipDetailsTypes.ElementNodeData, 'ports' | 'height'>>;
|
|
35
7
|
export declare const ElementPorts: ({ data: { ports, height: h } }: ElementPortsProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
8
|
type CompoundPortsProps = NodeProps<Pick<RelationshipDetailsTypes.CompoundNodeData, 'ports'>>;
|
|
@@ -48,6 +48,9 @@ export declare function useRelationshipDetails(): {
|
|
|
48
48
|
focusable?: boolean;
|
|
49
49
|
type: "relationship";
|
|
50
50
|
data: {
|
|
51
|
+
hovered?: boolean;
|
|
52
|
+
active?: boolean;
|
|
53
|
+
dimmed?: import("../../base").Base.Dimmed;
|
|
51
54
|
relationId: RelationId;
|
|
52
55
|
color: Color | undefined;
|
|
53
56
|
label: string | null;
|
|
@@ -55,9 +58,6 @@ export declare function useRelationshipDetails(): {
|
|
|
55
58
|
description?: string | undefined | undefined;
|
|
56
59
|
navigateTo: ViewId | null;
|
|
57
60
|
line: RelationshipLineType;
|
|
58
|
-
hovered?: boolean;
|
|
59
|
-
active?: boolean;
|
|
60
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
61
61
|
};
|
|
62
62
|
}> & ViewportHelperFunctions & {
|
|
63
63
|
viewportInitialized: boolean;
|
|
@@ -91,6 +91,9 @@ export declare function useRelationshipDetails(): {
|
|
|
91
91
|
focusable?: boolean;
|
|
92
92
|
type: "relationship";
|
|
93
93
|
data: {
|
|
94
|
+
hovered?: boolean;
|
|
95
|
+
active?: boolean;
|
|
96
|
+
dimmed?: import("../../base").Base.Dimmed;
|
|
94
97
|
relationId: RelationId;
|
|
95
98
|
color: Color | undefined;
|
|
96
99
|
label: string | null;
|
|
@@ -98,9 +101,6 @@ export declare function useRelationshipDetails(): {
|
|
|
98
101
|
description?: string | undefined | undefined;
|
|
99
102
|
navigateTo: ViewId | null;
|
|
100
103
|
line: RelationshipLineType;
|
|
101
|
-
hovered?: boolean;
|
|
102
|
-
active?: boolean;
|
|
103
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
104
104
|
};
|
|
105
105
|
}>;
|
|
106
106
|
setState: (partial: ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
@@ -131,6 +131,9 @@ export declare function useRelationshipDetails(): {
|
|
|
131
131
|
focusable?: boolean;
|
|
132
132
|
type: "relationship";
|
|
133
133
|
data: {
|
|
134
|
+
hovered?: boolean;
|
|
135
|
+
active?: boolean;
|
|
136
|
+
dimmed?: import("../../base").Base.Dimmed;
|
|
134
137
|
relationId: RelationId;
|
|
135
138
|
color: Color | undefined;
|
|
136
139
|
label: string | null;
|
|
@@ -138,9 +141,6 @@ export declare function useRelationshipDetails(): {
|
|
|
138
141
|
description?: string | undefined | undefined;
|
|
139
142
|
navigateTo: ViewId | null;
|
|
140
143
|
line: RelationshipLineType;
|
|
141
|
-
hovered?: boolean;
|
|
142
|
-
active?: boolean;
|
|
143
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
144
144
|
};
|
|
145
145
|
}> | Partial< ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
146
146
|
id: string;
|
|
@@ -170,6 +170,9 @@ export declare function useRelationshipDetails(): {
|
|
|
170
170
|
focusable?: boolean;
|
|
171
171
|
type: "relationship";
|
|
172
172
|
data: {
|
|
173
|
+
hovered?: boolean;
|
|
174
|
+
active?: boolean;
|
|
175
|
+
dimmed?: import("../../base").Base.Dimmed;
|
|
173
176
|
relationId: RelationId;
|
|
174
177
|
color: Color | undefined;
|
|
175
178
|
label: string | null;
|
|
@@ -177,9 +180,6 @@ export declare function useRelationshipDetails(): {
|
|
|
177
180
|
description?: string | undefined | undefined;
|
|
178
181
|
navigateTo: ViewId | null;
|
|
179
182
|
line: RelationshipLineType;
|
|
180
|
-
hovered?: boolean;
|
|
181
|
-
active?: boolean;
|
|
182
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
183
183
|
};
|
|
184
184
|
}>> | ((state: ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
185
185
|
id: string;
|
|
@@ -209,6 +209,9 @@ export declare function useRelationshipDetails(): {
|
|
|
209
209
|
focusable?: boolean;
|
|
210
210
|
type: "relationship";
|
|
211
211
|
data: {
|
|
212
|
+
hovered?: boolean;
|
|
213
|
+
active?: boolean;
|
|
214
|
+
dimmed?: import("../../base").Base.Dimmed;
|
|
212
215
|
relationId: RelationId;
|
|
213
216
|
color: Color | undefined;
|
|
214
217
|
label: string | null;
|
|
@@ -216,9 +219,6 @@ export declare function useRelationshipDetails(): {
|
|
|
216
219
|
description?: string | undefined | undefined;
|
|
217
220
|
navigateTo: ViewId | null;
|
|
218
221
|
line: RelationshipLineType;
|
|
219
|
-
hovered?: boolean;
|
|
220
|
-
active?: boolean;
|
|
221
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
222
222
|
};
|
|
223
223
|
}>) => ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
224
224
|
id: string;
|
|
@@ -248,6 +248,9 @@ export declare function useRelationshipDetails(): {
|
|
|
248
248
|
focusable?: boolean;
|
|
249
249
|
type: "relationship";
|
|
250
250
|
data: {
|
|
251
|
+
hovered?: boolean;
|
|
252
|
+
active?: boolean;
|
|
253
|
+
dimmed?: import("../../base").Base.Dimmed;
|
|
251
254
|
relationId: RelationId;
|
|
252
255
|
color: Color | undefined;
|
|
253
256
|
label: string | null;
|
|
@@ -255,9 +258,6 @@ export declare function useRelationshipDetails(): {
|
|
|
255
258
|
description?: string | undefined | undefined;
|
|
256
259
|
navigateTo: ViewId | null;
|
|
257
260
|
line: RelationshipLineType;
|
|
258
|
-
hovered?: boolean;
|
|
259
|
-
active?: boolean;
|
|
260
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
261
261
|
};
|
|
262
262
|
}> | Partial< ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
263
263
|
id: string;
|
|
@@ -287,6 +287,9 @@ export declare function useRelationshipDetails(): {
|
|
|
287
287
|
focusable?: boolean;
|
|
288
288
|
type: "relationship";
|
|
289
289
|
data: {
|
|
290
|
+
hovered?: boolean;
|
|
291
|
+
active?: boolean;
|
|
292
|
+
dimmed?: import("../../base").Base.Dimmed;
|
|
290
293
|
relationId: RelationId;
|
|
291
294
|
color: Color | undefined;
|
|
292
295
|
label: string | null;
|
|
@@ -294,9 +297,6 @@ export declare function useRelationshipDetails(): {
|
|
|
294
297
|
description?: string | undefined | undefined;
|
|
295
298
|
navigateTo: ViewId | null;
|
|
296
299
|
line: RelationshipLineType;
|
|
297
|
-
hovered?: boolean;
|
|
298
|
-
active?: boolean;
|
|
299
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
300
300
|
};
|
|
301
301
|
}>>), replace?: boolean | undefined) => void;
|
|
302
302
|
subscribe: (listener: (state: ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
@@ -327,6 +327,9 @@ export declare function useRelationshipDetails(): {
|
|
|
327
327
|
focusable?: boolean;
|
|
328
328
|
type: "relationship";
|
|
329
329
|
data: {
|
|
330
|
+
hovered?: boolean;
|
|
331
|
+
active?: boolean;
|
|
332
|
+
dimmed?: import("../../base").Base.Dimmed;
|
|
330
333
|
relationId: RelationId;
|
|
331
334
|
color: Color | undefined;
|
|
332
335
|
label: string | null;
|
|
@@ -334,9 +337,6 @@ export declare function useRelationshipDetails(): {
|
|
|
334
337
|
description?: string | undefined | undefined;
|
|
335
338
|
navigateTo: ViewId | null;
|
|
336
339
|
line: RelationshipLineType;
|
|
337
|
-
hovered?: boolean;
|
|
338
|
-
active?: boolean;
|
|
339
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
340
340
|
};
|
|
341
341
|
}>, prevState: ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
342
342
|
id: string;
|
|
@@ -366,6 +366,9 @@ export declare function useRelationshipDetails(): {
|
|
|
366
366
|
focusable?: boolean;
|
|
367
367
|
type: "relationship";
|
|
368
368
|
data: {
|
|
369
|
+
hovered?: boolean;
|
|
370
|
+
active?: boolean;
|
|
371
|
+
dimmed?: import("../../base").Base.Dimmed;
|
|
369
372
|
relationId: RelationId;
|
|
370
373
|
color: Color | undefined;
|
|
371
374
|
label: string | null;
|
|
@@ -373,9 +376,6 @@ export declare function useRelationshipDetails(): {
|
|
|
373
376
|
description?: string | undefined | undefined;
|
|
374
377
|
navigateTo: ViewId | null;
|
|
375
378
|
line: RelationshipLineType;
|
|
376
|
-
hovered?: boolean;
|
|
377
|
-
active?: boolean;
|
|
378
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
379
379
|
};
|
|
380
380
|
}>) => void) => () => void;
|
|
381
381
|
} | null;
|
|
@@ -2,11 +2,11 @@ import { nonNullable } from '@likec4/core';
|
|
|
2
2
|
import { useCallbackRef } from '@mantine/hooks';
|
|
3
3
|
import { useSelector } from '@xstate/react';
|
|
4
4
|
import { shallowEqual } from 'fast-equals';
|
|
5
|
-
import {
|
|
5
|
+
import { createContext, useMemo, useContext } from 'react';
|
|
6
6
|
|
|
7
|
-
const RelationshipDetailsActorContext =
|
|
7
|
+
const RelationshipDetailsActorContext = createContext(null);
|
|
8
8
|
function useRelationshipDetailsActor() {
|
|
9
|
-
return nonNullable(
|
|
9
|
+
return nonNullable(useContext(RelationshipDetailsActorContext), "No RelationshipDetailsActorContext");
|
|
10
10
|
}
|
|
11
11
|
function useRelationshipDetailsState(selector, compare = shallowEqual) {
|
|
12
12
|
const select = useCallbackRef(selector);
|
|
@@ -15,7 +15,7 @@ function useRelationshipDetailsState(selector, compare = shallowEqual) {
|
|
|
15
15
|
}
|
|
16
16
|
function useRelationshipDetails() {
|
|
17
17
|
const actor = useRelationshipDetailsActor();
|
|
18
|
-
return
|
|
18
|
+
return useMemo(() => ({
|
|
19
19
|
actor,
|
|
20
20
|
get rootElementId() {
|
|
21
21
|
return `relationship-details-${actor.sessionId.replaceAll(":", "_")}`;
|