@likec4/diagram 1.44.0 → 1.45.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/bundle/index.js +18160 -17671
- package/dist/LikeC4Diagram.js +7 -5
- package/dist/LikeC4Diagram.props.d.ts +9 -8
- package/dist/LikeC4Styles.js +0 -3
- package/dist/LikeC4View.d.ts +3 -3
- package/dist/LikeC4View.js +7 -3
- package/dist/ReactLikeC4.d.ts +2 -2
- package/dist/base/Base.d.ts +1 -1
- package/dist/base/updateEdges.js +25 -15
- package/dist/base/updateNodes.d.ts +14 -0
- package/dist/base/updateNodes.js +51 -18
- package/dist/base-primitives/Markdown.d.ts +30 -4
- package/dist/base-primitives/Markdown.js +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +3 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +4 -1
- package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -2
- package/dist/base-primitives/edge/EdgePath.js +24 -4
- package/dist/base-primitives/element/ElementActionButtons.d.ts +3 -2
- package/dist/base-primitives/element/ElementActionButtons.js +2 -2
- package/dist/base-primitives/element/ElementData.d.ts +3 -3
- package/dist/base-primitives/element/ElementData.js +13 -7
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +3 -2
- package/dist/base-primitives/element/ElementDetailsButton.js +3 -0
- package/dist/base-primitives/element/ElementShape.js +5 -5
- package/dist/base-primitives/element/ElementTags.d.ts +6 -4
- package/dist/context/DiagramFeatures.d.ts +1 -0
- package/dist/context/TagStylesContext.js +1 -1
- package/dist/custom/hooks.d.ts +2 -2
- package/dist/custom/index.js +1 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/useDiagramCompareLayout.js +7 -2
- package/dist/hooks/useLikeC4Project.d.ts +6 -1
- package/dist/hooks/useLikeC4Project.js +14 -2
- package/dist/hooks/useMediaPrint.d.ts +6 -0
- package/dist/likec4diagram/DiagramXYFlow.js +11 -6
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +38 -0
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +24 -14
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +3 -1
- package/dist/likec4diagram/custom/edges/useControlPoints.js +3 -3
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +5 -5
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/{ElementNodeDrifts.js → NodeDrifts.js} +8 -4
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -2
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.js +64 -23
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +3 -3
- package/dist/likec4diagram/relationship-popover/actor.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +2 -2
- package/dist/likec4diagram/state/DiagramActorProvider.js +0 -1
- package/dist/likec4diagram/state/assign.d.ts +10 -6
- package/dist/likec4diagram/state/assign.js +17 -192
- package/dist/likec4diagram/state/createViewChange.js +15 -26
- package/dist/likec4diagram/state/diagram-api.d.ts +2 -6
- package/dist/likec4diagram/state/diagram-api.js +2 -10
- package/dist/likec4diagram/state/hotkeyActor.d.ts +0 -7
- package/dist/likec4diagram/state/hotkeyActor.js +1 -17
- package/dist/likec4diagram/state/machine.actions.d.ts +430 -746
- package/dist/likec4diagram/state/machine.actions.js +193 -284
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +579 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +129 -0
- package/dist/likec4diagram/state/machine.d.ts +17 -3712
- package/dist/likec4diagram/state/machine.js +59 -73
- package/dist/likec4diagram/state/machine.setup.d.ts +61 -18
- package/dist/likec4diagram/state/machine.setup.js +27 -5
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +25 -0
- package/dist/likec4diagram/state/machine.state.initializing.js +5 -5
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +5 -108
- package/dist/likec4diagram/state/machine.state.navigating.js +167 -34
- package/dist/likec4diagram/state/machine.state.ready.d.ts +2316 -2851
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +386 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.js +85 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +474 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.js +96 -0
- package/dist/likec4diagram/state/machine.state.ready.js +144 -319
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +128 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +40 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +511 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +177 -0
- package/dist/likec4diagram/state/mediaPrintActor.d.ts +12 -0
- package/dist/likec4diagram/state/mediaPrintActor.js +18 -0
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +6 -240
- package/dist/likec4diagram/state/syncManualLayoutActor.js +150 -89
- package/dist/likec4diagram/state/types.d.ts +5 -7
- package/dist/likec4diagram/state/utils.d.ts +15 -2
- package/dist/likec4diagram/state/utils.js +43 -3
- package/dist/likec4diagram/types.d.ts +8 -13
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -2
- package/dist/likec4diagram/useLayoutConstraints.js +107 -102
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +12 -15
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +11 -8
- package/dist/navigationpanel/NavigationPanel.js +5 -1
- package/dist/navigationpanel/actor.d.ts +4 -204
- package/dist/navigationpanel/actor.js +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +8 -3
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +66 -66
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +4 -3
- package/dist/overlays/element-details/ElementDetailsCard.css.js +3 -3
- package/dist/overlays/element-details/MetadataValue.d.ts +2 -1
- package/dist/overlays/element-details/actor.d.ts +8 -83
- package/dist/overlays/element-details/actor.js +0 -8
- package/dist/overlays/overlay/Overlay.js +10 -10
- package/dist/overlays/overlaysActor.d.ts +7 -392
- package/dist/overlays/overlaysActor.js +67 -46
- package/dist/overlays/relationship-details/_types.d.ts +3 -4
- package/dist/overlays/relationship-details/actor.d.ts +6 -562
- package/dist/overlays/relationship-details/actor.js +1 -0
- package/dist/overlays/relationship-details/layout-to-xyflow.js +3 -5
- package/dist/overlays/relationship-details/layout.d.ts +3 -3
- package/dist/overlays/relationship-details/layout.js +4 -4
- package/dist/overlays/relationships-browser/_types.d.ts +2 -3
- package/dist/overlays/relationships-browser/actor.d.ts +7 -739
- package/dist/overlays/relationships-browser/layout.d.ts +2 -2
- package/dist/overlays/relationships-browser/layout.js +3 -3
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -3
- package/dist/overlays/types.d.ts +12 -13
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/searchActor.d.ts +3 -66
- package/dist/shadowroot/ShadowRoot.d.ts +5 -7
- package/dist/shadowroot/ShadowRoot.js +7 -5
- package/dist/styles.css2.js +1 -1
- package/dist/utils/vector.d.ts +5 -0
- package/dist/utils/vector.js +7 -0
- package/dist/utils/view-bounds.js +7 -6
- package/dist/utils/xyflow.d.ts +4 -2
- package/dist/utils/xyflow.js +18 -50
- package/package.json +19 -18
- package/panda.buildinfo.json +17 -5
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.d.ts +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RelationshipsViewData } from '@likec4/core/compute-view/relationships';
|
|
2
|
-
import { DiagramEdge, DiagramNode, DiagramView, ElementKind, Fqn,
|
|
2
|
+
import { DiagramEdge, DiagramNode, DiagramView, ElementKind, Fqn, MarkdownOrString, ViewId } from '@likec4/core/types';
|
|
3
3
|
import { LikeC4ViewModel } from '@likec4/core/model';
|
|
4
4
|
import { RelationshipsBrowserTypes } from './_types';
|
|
5
5
|
export type LayoutRelationshipsViewResult = {
|
|
@@ -12,7 +12,7 @@ export type LayoutRelationshipsViewResult = {
|
|
|
12
12
|
export declare namespace LayoutRelationshipsViewResult {
|
|
13
13
|
const Empty: ElementKind;
|
|
14
14
|
type Node = Omit<DiagramNode, 'deploymentRef' | 'description' | 'inEdges' | 'outEdges'> & {
|
|
15
|
-
description:
|
|
15
|
+
description: MarkdownOrString | null;
|
|
16
16
|
column: RelationshipsBrowserTypes.Column;
|
|
17
17
|
ports: RelationshipsBrowserTypes.Ports;
|
|
18
18
|
existsInCurrentView: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computeRelationshipsView, treeFromElements } from '@likec4/core/compute-view/relationships';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import dagre from '@dagrejs/dagre';
|
|
4
|
-
import {
|
|
4
|
+
import { preferSummary, exact } from '@likec4/core/types';
|
|
5
5
|
import { toArray, invariant, ifind, nonNullable, DefaultMap } from '@likec4/core/utils';
|
|
6
6
|
import { pipe, concat, map, groupBy, prop, forEachObj, filter, mapToObj, omit, find, only, unique, tap, reduce, sortBy } from 'remeda';
|
|
7
7
|
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
@@ -329,7 +329,7 @@ function layoutRelationshipsView(data, scope) {
|
|
|
329
329
|
x: position.x,
|
|
330
330
|
y: position.y,
|
|
331
331
|
title: "empty node",
|
|
332
|
-
description:
|
|
332
|
+
description: null,
|
|
333
333
|
technology: null,
|
|
334
334
|
tags: [],
|
|
335
335
|
links: [],
|
|
@@ -372,7 +372,7 @@ function layoutRelationshipsView(data, scope) {
|
|
|
372
372
|
x: position.x,
|
|
373
373
|
y: position.y,
|
|
374
374
|
title: element.title,
|
|
375
|
-
description: element
|
|
375
|
+
description: preferSummary(element.$element) ?? null,
|
|
376
376
|
technology: element.technology,
|
|
377
377
|
tags: [...element.tags],
|
|
378
378
|
links: null,
|
package/dist/overlays/types.d.ts
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Events as RelationshipsBrowserEvents, Input as RelationshipsBrowserInput, RelationshipsBrowserLogic } from './relationships-browser/actor';
|
|
1
|
+
import { ElementDetailsActorRef, ElementDetailsInput, ElementDetailsLogic } from './element-details/actor';
|
|
2
|
+
import { RelationshipDetailsActorRef, RelationshipDetailsInput, RelationshipDetailsLogic } from './relationship-details/actor';
|
|
3
|
+
import { RelationshipsBrowserActorRef, RelationshipsBrowserInput, RelationshipsBrowserLogic } from './relationships-browser/actor';
|
|
5
4
|
export declare namespace Overlays {
|
|
6
5
|
namespace ElementDetails {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
interface Input extends ElementDetailsInput {
|
|
7
|
+
}
|
|
8
|
+
interface Logic extends ElementDetailsLogic {
|
|
9
|
+
}
|
|
10
|
+
interface ActorRef extends ElementDetailsActorRef {
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
namespace RelationshipDetails {
|
|
14
|
-
type Events = RelationshipDetailsEvents;
|
|
15
14
|
type Input = RelationshipDetailsInput;
|
|
16
15
|
interface Logic extends RelationshipDetailsLogic {
|
|
17
16
|
}
|
|
18
|
-
interface ActorRef extends
|
|
17
|
+
interface ActorRef extends RelationshipDetailsActorRef {
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
namespace RelationshipsBrowser {
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
interface Input extends RelationshipsBrowserInput {
|
|
22
|
+
}
|
|
24
23
|
interface Logic extends RelationshipsBrowserLogic {
|
|
25
24
|
}
|
|
26
|
-
interface ActorRef extends
|
|
25
|
+
interface ActorRef extends RelationshipsBrowserActorRef {
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SlotRecipeRuntimeFn, SlotRecipeVariantRecord } from '@likec4/styles';
|
|
2
2
|
export declare const focusable = "likec4-focusable";
|
|
3
3
|
export declare const emptyBoX: string;
|
|
4
|
-
export declare const buttonsva: SlotRecipeRuntimeFn<"
|
|
4
|
+
export declare const buttonsva: SlotRecipeRuntimeFn<"title" | "description" | "icon" | "root" | "descriptionColor", SlotRecipeVariantRecord<"title" | "description" | "icon" | "root" | "descriptionColor">>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fqn } from '@likec4/core/types';
|
|
2
|
-
import {
|
|
2
|
+
import { ActorRef, SnapshotFrom, StateMachine } from 'xstate';
|
|
3
3
|
export type SearchActorEvent = {
|
|
4
4
|
type: 'open';
|
|
5
5
|
search?: string | undefined;
|
|
@@ -19,72 +19,9 @@ export interface SearchContext {
|
|
|
19
19
|
searchValue: string;
|
|
20
20
|
pickViewFor: Fqn | null;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
"change searchValue": {
|
|
24
|
-
type: "change searchValue";
|
|
25
|
-
params: NonReducibleUnknown;
|
|
26
|
-
};
|
|
27
|
-
"reset pickViewFor": {
|
|
28
|
-
type: "reset pickViewFor";
|
|
29
|
-
params: NonReducibleUnknown;
|
|
30
|
-
};
|
|
31
|
-
}>, never, never, "inactive" | "opened" | "pickView", string, NonReducibleUnknown, NonReducibleUnknown, EventObject, MetaObject, {
|
|
32
|
-
readonly id: "search";
|
|
33
|
-
readonly context: {
|
|
34
|
-
readonly openedWithSearch: null;
|
|
35
|
-
readonly searchValue: "";
|
|
36
|
-
readonly pickViewFor: null;
|
|
37
|
-
};
|
|
38
|
-
readonly initial: "inactive";
|
|
39
|
-
readonly on: {
|
|
40
|
-
readonly close: {
|
|
41
|
-
readonly target: ".inactive";
|
|
42
|
-
readonly actions: "reset pickViewFor";
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
readonly states: {
|
|
46
|
-
readonly inactive: {
|
|
47
|
-
readonly on: {
|
|
48
|
-
readonly open: {
|
|
49
|
-
readonly target: "opened";
|
|
50
|
-
readonly actions: readonly [ ActionFunction<SearchContext, {
|
|
51
|
-
type: "open";
|
|
52
|
-
search?: string | undefined;
|
|
53
|
-
}, SearchActorEvent, undefined, never, never, never, never, never>];
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
readonly opened: {
|
|
58
|
-
readonly on: {
|
|
59
|
-
readonly open: {
|
|
60
|
-
readonly actions: "change searchValue";
|
|
61
|
-
};
|
|
62
|
-
readonly 'change.search': {
|
|
63
|
-
readonly actions: "change searchValue";
|
|
64
|
-
};
|
|
65
|
-
readonly 'pickview.open': {
|
|
66
|
-
readonly target: "pickView";
|
|
67
|
-
readonly actions: ActionFunction<SearchContext, {
|
|
68
|
-
type: "pickview.open";
|
|
69
|
-
elementFqn: Fqn;
|
|
70
|
-
}, SearchActorEvent, undefined, never, never, never, never, never>;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
readonly pickView: {
|
|
75
|
-
readonly on: {
|
|
76
|
-
readonly 'pickview.close': {
|
|
77
|
-
readonly target: "opened";
|
|
78
|
-
readonly actions: "reset pickViewFor";
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
}>;
|
|
84
|
-
export interface SearchActorLogic extends ActorLogicFrom<typeof _searchActorLogic> {
|
|
22
|
+
export interface SearchActorLogic extends StateMachine<SearchContext, SearchActorEvent, {}, any, any, any, any, any, never, never, any, any, any, any> {
|
|
85
23
|
}
|
|
86
24
|
export declare const searchActorLogic: SearchActorLogic;
|
|
87
25
|
export type SearchActorSnapshot = SnapshotFrom<SearchActorLogic>;
|
|
88
|
-
export interface SearchActorRef extends
|
|
26
|
+
export interface SearchActorRef extends ActorRef<SearchActorSnapshot, SearchActorEvent> {
|
|
89
27
|
}
|
|
90
|
-
export {};
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { MantineThemeOverride } from '@mantine/core';
|
|
2
|
-
import { HTMLAttributes } from 'react';
|
|
3
|
-
|
|
2
|
+
import { HTMLAttributes, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export declare const ShadowRoot: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
4
4
|
injectFontCss?: boolean | undefined;
|
|
5
5
|
styleNonce?: string | (() => string) | undefined;
|
|
6
|
-
mode?:
|
|
6
|
+
mode?: "open" | "closed";
|
|
7
7
|
delegatesFocus?: boolean;
|
|
8
|
-
colorScheme?:
|
|
8
|
+
colorScheme?: "light" | "dark" | undefined;
|
|
9
9
|
keepAspectRatio?: false | undefined | {
|
|
10
10
|
width: number;
|
|
11
11
|
height: number;
|
|
12
12
|
};
|
|
13
13
|
theme?: MantineThemeOverride | undefined;
|
|
14
|
-
}
|
|
15
|
-
export declare function ShadowRoot({ children, theme, injectFontCss, styleNonce, colorScheme: explicitColorScheme, keepAspectRatio, ...props }: ShadowRootProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export {};
|
|
14
|
+
} & RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { MantineProvider } from '@mantine/core';
|
|
3
|
-
import {
|
|
3
|
+
import { useMergedRef } from '@mantine/hooks';
|
|
4
|
+
import { forwardRef, useRef, useCallback } from 'react';
|
|
4
5
|
import root from 'react-shadow';
|
|
5
6
|
import { isDefined } from 'remeda';
|
|
6
7
|
import { FramerMotionConfig } from '../context/FramerMotionConfig.js';
|
|
@@ -49,7 +50,7 @@ function useShadowRootStyle(instanceId, keepAspectRatio = false) {
|
|
|
49
50
|
}
|
|
50
51
|
`.trim();
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
const ShadowRoot = forwardRef(({
|
|
53
54
|
children,
|
|
54
55
|
theme = DefaultTheme,
|
|
55
56
|
injectFontCss = true,
|
|
@@ -57,7 +58,7 @@ function ShadowRoot({
|
|
|
57
58
|
colorScheme: explicitColorScheme,
|
|
58
59
|
keepAspectRatio = false,
|
|
59
60
|
...props
|
|
60
|
-
}) {
|
|
61
|
+
}, ref) => {
|
|
61
62
|
const colorScheme = useColorScheme(explicitColorScheme);
|
|
62
63
|
const id = useId();
|
|
63
64
|
const cssstyle = useShadowRootStyle(id, keepAspectRatio);
|
|
@@ -87,7 +88,7 @@ function ShadowRoot({
|
|
|
87
88
|
/* @__PURE__ */ jsx(Root, { ssr: false, ...props, styleSheets, "data-likec4-instance": id, children: /* @__PURE__ */ jsx(
|
|
88
89
|
"div",
|
|
89
90
|
{
|
|
90
|
-
ref: rootRef,
|
|
91
|
+
ref: useMergedRef(rootRef, ref),
|
|
91
92
|
"data-mantine-color-scheme": colorScheme,
|
|
92
93
|
className: "likec4-shadow-root",
|
|
93
94
|
children: /* @__PURE__ */ jsx(
|
|
@@ -105,6 +106,7 @@ function ShadowRoot({
|
|
|
105
106
|
}
|
|
106
107
|
) })
|
|
107
108
|
] });
|
|
108
|
-
}
|
|
109
|
+
});
|
|
110
|
+
ShadowRoot.displayName = "ShadowRoot";
|
|
109
111
|
|
|
110
112
|
export { ShadowRoot };
|