@likec4/diagram 1.28.0 → 1.28.1
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/bundle/index.js +967 -1150
- package/dist/LikeC4CustomColors.js +2 -2
- package/dist/LikeC4Diagram.js +2 -2
- package/dist/LikeC4ModelProvider.js +1 -1
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +3 -0
- package/dist/_virtual/react.production.js +3 -0
- package/dist/base/BaseXYFlow.js +5 -5
- package/dist/base/primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base/primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base/primitives/compound/CompoundNodeContainer.d.ts +1 -1
- package/dist/base/primitives/compound/CompoundNodeContainer.js +2 -2
- package/dist/base/primitives/customEdge.d.ts +1 -1
- package/dist/base/primitives/customEdge.js +2 -2
- package/dist/base/primitives/customNode.js +2 -2
- package/dist/base/primitives/edge/EdgeContainer.js +1 -1
- package/dist/base/primitives/edge/EdgeLabel.js +1 -1
- package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -1
- package/dist/base/primitives/edge/EdgePath.d.ts +10 -42
- package/dist/base/primitives/edge/EdgePath.js +23 -16
- package/dist/base/primitives/edge/edge.css.js +1 -1
- package/dist/base/primitives/element/ElementActionButtons.js +1 -2
- package/dist/base/primitives/element/ElementDetailsButton.js +1 -2
- package/dist/base/primitives/element/ElementNodeContainer.js +3 -3
- package/dist/base/updateEdges.js +7 -2
- package/dist/base/updateNodes.js +11 -3
- package/dist/bundle/LikeC4View.js +3 -3
- package/dist/bundle/ReactLikeC4.js +1 -1
- package/dist/bundle/ShadowRoot.js +3 -3
- package/dist/bundle/styles.css.js +3 -3
- package/dist/context/ControlsCustomLayout.js +1 -1
- package/dist/context/DiagramEventHandlers.js +5 -5
- package/dist/context/DiagramFeatures.js +7 -7
- package/dist/context/EnsureMantine.js +2 -2
- package/dist/context/FramerMotionConfig.js +2 -2
- package/dist/context/IconRenderer.js +4 -4
- package/dist/context/ReduceGraphics.js +2 -2
- package/dist/context/RootContainer.js +5 -9
- package/dist/hooks/safeContext.js +3 -3
- package/dist/hooks/useCurrentViewId.js +1 -1
- package/dist/hooks/useDiagram.d.ts +4 -4
- package/dist/hooks/useDiagram.js +2 -2
- package/dist/hooks/useMantinePortalProps.js +2 -2
- package/dist/hooks/useSetState.js +3 -3
- package/dist/hooks/useUpdateEffect.js +1 -1
- package/dist/hooks/useXYFlow.d.ts +2 -2
- package/dist/likec4diagram/DiagramUI.js +2 -2
- package/dist/likec4diagram/DiagramXYFlow.js +2 -2
- package/dist/likec4diagram/custom/edges/NotePopover.js +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +7 -7
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +6 -6
- package/dist/likec4diagram/custom/index.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
- package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +4 -4
- package/dist/likec4diagram/ui/controls/Controls.js +6 -6
- package/dist/likec4diagram/ui/controls/NavigationButtons.js +1 -1
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.js +4 -4
- package/dist/likec4diagram/ui/search/ElementsColumn.js +88 -77
- package/dist/likec4diagram/ui/search/LikeC4Search.d.ts +2 -1
- package/dist/likec4diagram/ui/search/LikeC4Search.js +27 -24
- package/dist/likec4diagram/ui/search/SearchInput.js +1 -1
- package/dist/likec4diagram/ui/search/ViewsColum.js +3 -2
- package/dist/likec4diagram/ui/search/state.js +11 -9
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +1 -1
- package/dist/likec4diagram/useLayoutConstraints.js +3 -3
- package/dist/likec4model/LikeC4ModelContext.js +2 -2
- package/dist/likec4model/useLikeC4ElementsTree.js +2 -2
- package/dist/likec4model/useLikeC4Model.js +2 -2
- package/dist/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react.production.js +548 -0
- package/dist/node_modules/.pnpm/react@19.0.0/node_modules/react/index.js +15 -0
- package/dist/overlays/Overlays.js +6 -6
- package/dist/overlays/element-details/ElementDetailsCard.js +5 -5
- package/dist/overlays/element-details/TabPanelDeployments.js +7 -4
- package/dist/overlays/element-details/TabPanelRelationships.js +2 -2
- package/dist/overlays/element-details/TabPanelStructure.js +6 -3
- package/dist/overlays/element-details/actor.d.ts +2 -2
- package/dist/overlays/element-details/actorContext.js +3 -3
- package/dist/overlays/overlay/Overlay.js +8 -7
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +1 -1
- package/dist/overlays/relationship-details/RelationshipDetails.js +28 -23
- package/dist/overlays/relationship-details/SelectEdge.js +3 -6
- package/dist/overlays/relationship-details/actor.d.ts +4 -1
- package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/edgeTypes.js +1 -1
- package/dist/overlays/relationship-details/hooks.d.ts +4 -1
- package/dist/overlays/relationship-details/hooks.js +4 -4
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +9 -11
- package/dist/overlays/relationships-browser/SelectElement.js +8 -5
- package/dist/overlays/relationships-browser/actor.d.ts +2 -1
- package/dist/overlays/relationships-browser/actor.js +6 -12
- package/dist/overlays/relationships-browser/const.d.ts +2 -1
- package/dist/overlays/relationships-browser/const.js +6 -1
- package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +3 -4
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationships-browser/hooks.d.ts +2 -1
- package/dist/overlays/relationships-browser/hooks.js +4 -4
- package/dist/overlays/relationships-browser/layout.js +2 -2
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -2
- package/dist/state/DiagramActorProvider.js +5 -3
- package/dist/state/diagram-machine.d.ts +4 -4
- package/dist/state/diagram-machine.js +3 -4
- package/dist/styles.css.js +1 -1
- package/package.json +17 -13
- package/src/base/BaseXYFlow.tsx +2 -2
- package/src/base/primitives/compound/CompoundActionButton.tsx +1 -1
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +1 -1
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +1 -1
- package/src/base/primitives/edge/EdgePath.tsx +22 -14
- package/src/base/primitives/edge/edge.css.ts +1 -1
- package/src/base/primitives/element/ElementActionButtons.tsx +2 -2
- package/src/base/primitives/element/ElementDetailsButton.tsx +2 -2
- package/src/base/primitives/element/ElementNodeContainer.tsx +1 -1
- package/src/base/updateEdges.ts +6 -9
- package/src/base/updateNodes.ts +10 -14
- package/src/context/FramerMotionConfig.tsx +1 -1
- package/src/context/RootContainer.tsx +0 -4
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +2 -2
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +1 -1
- package/src/likec4diagram/ui/controls/Controls.tsx +53 -55
- package/src/likec4diagram/ui/controls/NavigationButtons.tsx +1 -1
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +1 -1
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -1
- package/src/likec4diagram/ui/search/ElementsColumn.tsx +94 -71
- package/src/likec4diagram/ui/search/LikeC4Search.tsx +48 -55
- package/src/likec4diagram/ui/search/ViewsColum.tsx +2 -2
- package/src/likec4diagram/ui/search/state.ts +8 -6
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +1 -1
- package/src/overlays/Overlays.tsx +2 -2
- package/src/overlays/element-details/ElementDetailsCard.tsx +1 -1
- package/src/overlays/element-details/TabPanelDeployments.tsx +2 -0
- package/src/overlays/element-details/TabPanelStructure.tsx +2 -1
- package/src/overlays/overlay/Overlay.tsx +2 -1
- package/src/overlays/relationship-details/RelationshipDetails.tsx +25 -16
- package/src/overlays/relationship-details/SelectEdge.tsx +0 -14
- package/src/overlays/relationship-details/actor.ts +2 -1
- package/src/overlays/relationship-details/custom/edgeTypes.tsx +1 -1
- package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +1 -3
- package/src/overlays/relationships-browser/SelectElement.tsx +2 -0
- package/src/overlays/relationships-browser/actor.ts +8 -13
- package/src/overlays/relationships-browser/const.ts +8 -1
- package/src/overlays/relationships-browser/custom/edgeTypes.tsx +2 -3
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +1 -1
- package/src/overlays/relationships-browser/useViewToNodesEdges.ts +1 -2
- package/src/state/DiagramActorProvider.tsx +4 -1
- package/src/state/diagram-machine.ts +2 -3
|
@@ -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 { r as reactExports } from '../../_virtual/index.js';
|
|
6
6
|
|
|
7
|
-
const RelationshipsBrowserActorContext = createContext(null);
|
|
7
|
+
const RelationshipsBrowserActorContext = reactExports.createContext(null);
|
|
8
8
|
function useRelationshipsBrowserActor() {
|
|
9
|
-
return nonNullable(useContext(RelationshipsBrowserActorContext), "No RelationshipsBrowserActorContext");
|
|
9
|
+
return nonNullable(reactExports.useContext(RelationshipsBrowserActorContext), "No RelationshipsBrowserActorContext");
|
|
10
10
|
}
|
|
11
11
|
function useRelationshipsBrowserState(selector, compare = shallowEqual) {
|
|
12
12
|
const actor = useRelationshipsBrowserActor();
|
|
@@ -14,7 +14,7 @@ function useRelationshipsBrowserState(selector, compare = shallowEqual) {
|
|
|
14
14
|
}
|
|
15
15
|
function useRelationshipsBrowser() {
|
|
16
16
|
const actor = useRelationshipsBrowserActor();
|
|
17
|
-
return useMemo(() => ({
|
|
17
|
+
return reactExports.useMemo(() => ({
|
|
18
18
|
actor,
|
|
19
19
|
get rootElementId() {
|
|
20
20
|
return `relationships-browser-${actor.sessionId.replaceAll(":", "_")}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as reactExports } from '../../_virtual/index.js';
|
|
2
2
|
import dagre from '@dagrejs/dagre';
|
|
3
3
|
import { toArray, invariant, ifind, DefaultMap } from '@likec4/core';
|
|
4
4
|
import { pipe, concat, map, groupBy, prop, forEachObj, filter, mapToObj, find, only, unique, tap, reduce, sortBy } from 'remeda';
|
|
@@ -454,7 +454,7 @@ function layoutRelationshipsView(data, scope) {
|
|
|
454
454
|
}
|
|
455
455
|
function useRelationshipsView(subject, viewId, scope) {
|
|
456
456
|
const model = useLikeC4Model(true);
|
|
457
|
-
return useMemo(() => {
|
|
457
|
+
return reactExports.useMemo(() => {
|
|
458
458
|
const view = viewId ? model.findView(viewId) : null;
|
|
459
459
|
const data = layoutRelationshipsView(
|
|
460
460
|
computeRelationshipsView(subject, model, viewId, scope),
|
|
@@ -41,7 +41,6 @@ function viewToNodesEdge(view) {
|
|
|
41
41
|
draggable: false,
|
|
42
42
|
selectable: true,
|
|
43
43
|
focusable: true,
|
|
44
|
-
deletable: false,
|
|
45
44
|
position,
|
|
46
45
|
zIndex: isCompound ? ZIndexes.Compound : ZIndexes.Element,
|
|
47
46
|
style: {
|
|
@@ -140,7 +139,7 @@ function viewToNodesEdge(view) {
|
|
|
140
139
|
zIndex: ZIndexes.Edge,
|
|
141
140
|
// selectable: selectable,
|
|
142
141
|
// hidden: !visiblePredicate(edge),
|
|
143
|
-
deletable: false,
|
|
142
|
+
// deletable: false,
|
|
144
143
|
data: {
|
|
145
144
|
sourceFqn: edge.sourceFqn,
|
|
146
145
|
targetFqn: edge.targetFqn,
|
|
@@ -3,7 +3,7 @@ import { useDeepCompareEffect } from '@react-hookz/web';
|
|
|
3
3
|
import { useActorRef, useSelector } from '@xstate/react';
|
|
4
4
|
import { useStoreApi } from '@xyflow/react';
|
|
5
5
|
import { shallowEqual } from 'fast-equals';
|
|
6
|
-
import {
|
|
6
|
+
import { r as reactExports } from '../_virtual/index.js';
|
|
7
7
|
import { useDiagramEventHandlersRef } from '../context/DiagramEventHandlers.js';
|
|
8
8
|
import { useEnabledFeatures, DiagramFeatures } from '../context/DiagramFeatures.js';
|
|
9
9
|
import { DiagramActorSafeContext } from '../hooks/safeContext.js';
|
|
@@ -27,7 +27,9 @@ function DiagramActorProvider({
|
|
|
27
27
|
diagramMachine.provide({
|
|
28
28
|
actions: {
|
|
29
29
|
"trigger:NavigateTo": (_, { viewId }) => {
|
|
30
|
-
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
handlersRef.current.onNavigateTo?.(viewId);
|
|
32
|
+
}, 30);
|
|
31
33
|
},
|
|
32
34
|
"trigger:OnChange": (_, params) => {
|
|
33
35
|
handlersRef.current.onChange?.(params);
|
|
@@ -61,7 +63,7 @@ function DiagramActorProvider({
|
|
|
61
63
|
useUpdateEffect(() => {
|
|
62
64
|
actorRef.send({ type: "update.inputs", inputs });
|
|
63
65
|
}, [inputs]);
|
|
64
|
-
useEffect(() => {
|
|
66
|
+
reactExports.useEffect(() => {
|
|
65
67
|
actorRef.send({ type: "update.features", features });
|
|
66
68
|
}, [features]);
|
|
67
69
|
const { xyedges, xynodes } = useViewToNodesEdges({
|
|
@@ -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
|
|
3
|
-
import { EdgeChange, NodeChange, Rect, Viewport, XYPosition } from '@xyflow/system';
|
|
2
|
+
import { ReactFlowInstance, useStoreApi } from '@xyflow/react';
|
|
3
|
+
import { EdgeChange, NodeChange, Rect, Viewport, EdgeMarkerType, HandleType, 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';
|
|
@@ -2210,7 +2210,7 @@ export declare const diagramMachine: StateMachine<Context, Events, {
|
|
|
2210
2210
|
readonly params: {
|
|
2211
2211
|
readonly duration: 0;
|
|
2212
2212
|
};
|
|
2213
|
-
},
|
|
2213
|
+
}, ActionFunction<Context, Events, Events, undefined, Values<{
|
|
2214
2214
|
syncManualLayoutActorLogic: {
|
|
2215
2215
|
src: "syncManualLayoutActorLogic";
|
|
2216
2216
|
logic: StateMachine<Readonly< Input>, SyncLayoutEvents, {}, never, {
|
|
@@ -2463,7 +2463,7 @@ export declare const diagramMachine: StateMachine<Context, Events, {
|
|
|
2463
2463
|
}>;
|
|
2464
2464
|
id: "overlays";
|
|
2465
2465
|
};
|
|
2466
|
-
}>, never, never, never, never
|
|
2466
|
+
}>, never, never, never, never>, "startSyncLayout"];
|
|
2467
2467
|
readonly target: "ready";
|
|
2468
2468
|
}, {
|
|
2469
2469
|
readonly target: "initializing";
|
|
@@ -332,7 +332,6 @@ const diagramMachine = setup({
|
|
|
332
332
|
type: "xyflow:fitDiagram",
|
|
333
333
|
params: { duration: 0 }
|
|
334
334
|
},
|
|
335
|
-
"startSyncLayout",
|
|
336
335
|
assign(({ context }) => ({
|
|
337
336
|
navigationHistory: {
|
|
338
337
|
currentIndex: 0,
|
|
@@ -342,7 +341,8 @@ const diagramMachine = setup({
|
|
|
342
341
|
viewport: { ...context.xyflow.getViewport() }
|
|
343
342
|
}]
|
|
344
343
|
}
|
|
345
|
-
}))
|
|
344
|
+
})),
|
|
345
|
+
"startSyncLayout"
|
|
346
346
|
],
|
|
347
347
|
target: "ready"
|
|
348
348
|
}, {
|
|
@@ -743,13 +743,11 @@ const diagramMachine = setup({
|
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
745
|
});
|
|
746
|
-
enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 80 });
|
|
747
746
|
} else {
|
|
748
747
|
enqueue({
|
|
749
748
|
type: "xyflow:setViewportCenter",
|
|
750
749
|
params: getBBoxCenter(event.view.bounds)
|
|
751
750
|
});
|
|
752
|
-
enqueue.raise({ type: "fitDiagram", duration: 200 }, { id: "fitDiagram", delay: 25 });
|
|
753
751
|
}
|
|
754
752
|
enqueue.assign(updateNavigationHistory);
|
|
755
753
|
enqueue.assign({
|
|
@@ -757,6 +755,7 @@ const diagramMachine = setup({
|
|
|
757
755
|
lastOnNavigate: null
|
|
758
756
|
});
|
|
759
757
|
enqueue("startSyncLayout");
|
|
758
|
+
enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 25 });
|
|
760
759
|
}),
|
|
761
760
|
target: "#idle"
|
|
762
761
|
}
|