likec4 1.27.1 → 1.27.2
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/__app__/src/main.js +2203 -6768
- package/__app__/src/style.css +1 -1
- package/dist/cli/index.mjs +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{likec4.D_ELXBwW.mjs → likec4.CfxVv3pJ.mjs} +1 -1
- package/dist/shared/{likec4.CcbefjP5.mjs → likec4.D_S6au6n.mjs} +1354 -1361
- package/dist/shared/{likec4.C0T-ybr5.d.mts → likec4.QmEWuoHf.d.mts} +4 -4
- package/dist/vite-plugin/index.d.mts +1 -1
- package/dist/vite-plugin/index.mjs +1 -1
- package/package.json +21 -21
- package/react/index.d.mts +33 -24
- package/react/index.mjs +54 -54
|
@@ -8665,10 +8665,10 @@ const a=super.elementToSubgraph(e,o);return e.children.length>1&&a.set(attribute
|
|
|
8665
8665
|
set(c?attribute.xlabel:attribute.label,f),e.color){const l=this.getRelationshipColorValues(e.color);r.attributes.apply({[attribute.color]:l.lineColor,[attribute.fontcolor]:l.labelColor});}let[i,u]=[e.head??DefaultArrowType,e.tail??"none"];return i==="none"&&u==="none"?(r.attributes.apply({[attribute.arrowtail]:"none",[attribute.arrowhead]:"none",[attribute.dir]:"none"}),r):e.dir==="both"?(r.attributes.apply({[attribute.arrowhead]:toArrowType(i),[attribute.arrowtail]:toArrowType(e.tail??i),[attribute.dir]:"both"}),!c&&ComputedNode$1.modelRef(w)!==ComputedNode$1.modelRef(v)&&r.attributes.set(attribute.constraint,false),r):(i!==DefaultArrowType&&r.attributes.set(
|
|
8666
8666
|
attribute.arrowhead,toArrowType(i)),u!=="none"&&r.attributes.set(attribute.arrowtail,toArrowType(u)),r)}}
|
|
8667
8667
|
|
|
8668
|
-
class DynamicViewPrinter extends DotPrinter{static toDot(t){return new DynamicViewPrinter(t).print()}postBuild(t){t.
|
|
8669
|
-
view,[s,p]=t.dir==="back"?[t.target,t.source]:[t.source,t.target],[T,h,
|
|
8670
|
-
`),w=extractStep(t.id),
|
|
8671
|
-
i!=="none"&&a!=="none"?(
|
|
8668
|
+
class DynamicViewPrinter extends DotPrinter{static toDot(t){return new DynamicViewPrinter(t).print()}postBuild(t){t.delete(attribute.TBbalance);}addEdge(t,b){const{nodes:n}=this.
|
|
8669
|
+
view,[s,p]=t.dir==="back"?[t.target,t.source]:[t.source,t.target],[T,h,d]=this.edgeEndpoint(s,r=>last(r)),[V,f,c]=this.edgeEndpoint(p,first),e=b.edge([h,f],{[attribute.likec4_id]:t.id,[attribute.style]:t.line??DefaultEdgeStyle});if(c&&e.attributes.set(attribute.lhead,c),d&&e.attributes.set(attribute.ltail,d),t.color&&t.color!==DefaultRelationshipColor){const r=this.getRelationshipColorValues(t.color);e.attributes.apply({[attribute.color]:r.lineColor,[attribute.fontcolor]:r.labelColor});}const y=[t.label?.trim(),t.technology?.trim()].filter(isTruthy).join(`
|
|
8670
|
+
`),w=extractStep(t.id),D=stepEdgeLabel(w,y);e.attributes.set(attribute.label,D);const u=this.graphology.getEdgeAttribute(t.id,"weight");t.source!==t.target&&u>1&&e.attributes.set(attribute.weight,u);const E=n.findIndex(r=>r.id===s);n.findIndex(r=>r.id===p)<E&&t.dir!=="back"&&e.attributes.apply({[attribute.constraint]:false});let[i,a]=[t.head??DefaultArrowType,t.tail??"none"];return t.dir==="back"?(e.attributes.apply({[attribute.arrowtail]:toArrowType(i),[attribute.minlen]:0,[attribute.dir]:"back"}),a!=="none"&&e.attributes.apply({[attribute.arrowhead]:toArrowType(a),[attribute.dir]:"both"}),e):i==="none"&&a==="none"||
|
|
8671
|
+
i!=="none"&&a!=="none"?(e.attributes.apply({[attribute.arrowhead]:toArrowType(i),[attribute.arrowtail]:toArrowType(a),[attribute.dir]:"both"}),e):i==="none"?(e.attributes.delete(attribute.arrowhead),e.attributes.apply({[attribute.arrowtail]:toArrowType(a),[attribute.minlen]:0,[attribute.dir]:"back"}),e):(i!==DefaultArrowType&&e.attributes.set(attribute.arrowhead,toArrowType(i)),e)}}
|
|
8672
8672
|
|
|
8673
8673
|
class ElementViewPrinter extends DotPrinter{postBuild(t){this.assignGroups();const b=new Set,w=this.view.nodes.reduce((l,i)=>(isCompound(i)&&(b.add(
|
|
8674
8674
|
i.id),l.push(i)),l),[]);let h=false;for(const l of w){const i=pipe(l.children,filter(n=>!this.compoundIds.has(n)),map(n=>this.computedNode(n)),filter(n=>n.inEdges.length===0&&n.outEdges.length===0));if(i.length<=2)continue;let s=2;switch(true){case i.length>11:s=4;break;case i.length>4:s=3;break}const g=nonNullable(this.getSubgraph(l.id),`Subgraph not found for ${l.id}`);let f=null;chunk(i,s).forEach(n=>{const a=n.length>1?g.createSubgraph({[attribute.rank]:"same"}):null;n.forEach((m,r)=>{const d=this.getGraphNode(m.id);d&&(a?.node(d.id),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{L as LikeC4VitePlugin}from"../shared/likec4.
|
|
1
|
+
export{L as LikeC4VitePlugin}from"../shared/likec4.CfxVv3pJ.mjs";import"node:path";import"../shared/likec4.D_S6au6n.mjs";import"node:fs";import"node:url";import"tty";import"node:util";import"util";import"path";import"os";import"crypto";import"net";import"url";import"fs";import"child_process";import"@likec4/core";import"@likec4/core/types";import"events";import"buffer";import"@hpcc-js/wasm-graphviz";import"@likec4/core/compute-view";import"@likec4/core/utils";import"node:process";import"boxen";import"node:child_process";
|
|
2
2
|
import"node:events";import"node:fs/promises";import"node:stream/promises";import"node:os";import"fs/promises";import"@likec4/core/model";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "likec4",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -77,31 +77,31 @@
|
|
|
77
77
|
"playwright": "^1.51.1",
|
|
78
78
|
"react": "^19.0.0",
|
|
79
79
|
"react-dom": "^19.0.0",
|
|
80
|
-
"rollup": "^4.
|
|
80
|
+
"rollup": "^4.38.0",
|
|
81
81
|
"type-fest": "^4.38.0",
|
|
82
|
-
"vite": "^6.2.
|
|
83
|
-
"@likec4/core": "1.27.
|
|
82
|
+
"vite": "^6.2.4",
|
|
83
|
+
"@likec4/core": "1.27.2"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@pandacss/dev": "^0.53.3",
|
|
87
87
|
"@dagrejs/dagre": "1.1.4",
|
|
88
88
|
"@fontsource/ibm-plex-sans": "^5.2.5",
|
|
89
|
-
"@mantine/core": "7.17.
|
|
90
|
-
"@mantine/hooks": "7.17.
|
|
89
|
+
"@mantine/core": "7.17.3",
|
|
90
|
+
"@mantine/hooks": "7.17.3",
|
|
91
91
|
"@nanostores/react": "0.8.4",
|
|
92
92
|
"@react-hookz/web": "^25.1.0",
|
|
93
93
|
"@tabler/icons-react": "3.31.0",
|
|
94
94
|
"@tanstack/react-router": "^1.114.13",
|
|
95
95
|
"@tanstack/router-cli": "^1.114.13",
|
|
96
96
|
"@tanstack/router-vite-plugin": "^1.114.13",
|
|
97
|
-
"@types/node": "^20.17.
|
|
97
|
+
"@types/node": "^20.17.28",
|
|
98
98
|
"@types/prop-types": "^15.7.14",
|
|
99
99
|
"@types/react": "^19.0.12",
|
|
100
100
|
"@types/react-dom": "^19.0.4",
|
|
101
|
-
"@types/semver": "^7.
|
|
101
|
+
"@types/semver": "^7.7.0",
|
|
102
102
|
"@types/yargs": "^17.0.33",
|
|
103
|
-
"@xyflow/react": "^12.
|
|
104
|
-
"@xyflow/system": "^0.0.
|
|
103
|
+
"@xyflow/react": "^12.5.2",
|
|
104
|
+
"@xyflow/system": "^0.0.53",
|
|
105
105
|
"dts-bundle-generator": "^9.5.1",
|
|
106
106
|
"autoprefixer": "^10.4.21",
|
|
107
107
|
"classnames": "^2.5.1",
|
|
@@ -114,14 +114,14 @@
|
|
|
114
114
|
"esm-env": "^1.2.2",
|
|
115
115
|
"fast-equals": "^5.2.2",
|
|
116
116
|
"fdir": "^6.4.3",
|
|
117
|
-
"framer-motion": "^12.
|
|
117
|
+
"framer-motion": "^12.6.2",
|
|
118
118
|
"get-port": "^7.1.0",
|
|
119
119
|
"glob": "^11.0.1",
|
|
120
120
|
"html-to-image": "^1.11.13",
|
|
121
121
|
"json5": "^2.2.3",
|
|
122
122
|
"ky": "^1.7.5",
|
|
123
123
|
"langium": "3.4.0",
|
|
124
|
-
"merge-error-cause": "^5.0.
|
|
124
|
+
"merge-error-cause": "^5.0.2",
|
|
125
125
|
"mkdirp": "^3.0.1",
|
|
126
126
|
"nano-spawn": "^0.2.0",
|
|
127
127
|
"nanostores": "0.11.4",
|
|
@@ -156,15 +156,15 @@
|
|
|
156
156
|
"wireit": "^0.14.11",
|
|
157
157
|
"which": "^5.0.0",
|
|
158
158
|
"yargs": "17.7.2",
|
|
159
|
-
"@likec4/style-preset": "1.27.
|
|
160
|
-
"@likec4/styles": "1.27.
|
|
161
|
-
"@likec4/diagram": "1.27.
|
|
162
|
-
"@likec4/
|
|
163
|
-
"@likec4/
|
|
164
|
-
"@likec4/
|
|
165
|
-
"@likec4/
|
|
166
|
-
"@likec4/log": "1.27.
|
|
167
|
-
"@likec4/tsconfig": "1.27.
|
|
159
|
+
"@likec4/style-preset": "1.27.2",
|
|
160
|
+
"@likec4/styles": "1.27.2",
|
|
161
|
+
"@likec4/diagram": "1.27.2",
|
|
162
|
+
"@likec4/icons": "1.27.2",
|
|
163
|
+
"@likec4/language-server": "1.27.2",
|
|
164
|
+
"@likec4/layouts": "1.27.2",
|
|
165
|
+
"@likec4/generators": "1.27.2",
|
|
166
|
+
"@likec4/log": "1.27.2",
|
|
167
|
+
"@likec4/tsconfig": "1.27.2"
|
|
168
168
|
},
|
|
169
169
|
"scripts": {
|
|
170
170
|
"typecheck": "tsc --build --verbose",
|
package/react/index.d.mts
CHANGED
|
@@ -945,8 +945,18 @@ type OnConnectStartParams = {
|
|
|
945
945
|
type OnConnectStart = (event: MouseEvent | TouchEvent, params: OnConnectStartParams) => void;
|
|
946
946
|
type OnConnect = (connection: Connection) => void;
|
|
947
947
|
type OnConnectEnd = (event: MouseEvent | TouchEvent, connectionState: FinalConnectionState) => void;
|
|
948
|
+
type PaddingUnit = "px" | "%";
|
|
949
|
+
type PaddingWithUnit = `${number}${PaddingUnit}` | number;
|
|
950
|
+
type Padding = PaddingWithUnit | {
|
|
951
|
+
top?: PaddingWithUnit;
|
|
952
|
+
right?: PaddingWithUnit;
|
|
953
|
+
bottom?: PaddingWithUnit;
|
|
954
|
+
left?: PaddingWithUnit;
|
|
955
|
+
x?: PaddingWithUnit;
|
|
956
|
+
y?: PaddingWithUnit;
|
|
957
|
+
};
|
|
948
958
|
type FitViewOptionsBase<NodeType extends NodeBase = NodeBase> = {
|
|
949
|
-
padding?:
|
|
959
|
+
padding?: Padding;
|
|
950
960
|
includeHiddenNodes?: boolean;
|
|
951
961
|
minZoom?: number;
|
|
952
962
|
maxZoom?: number;
|
|
@@ -979,7 +989,7 @@ type SetCenterOptions = ViewportHelperFunctionOptions & {
|
|
|
979
989
|
type FitBoundsOptions = ViewportHelperFunctionOptions & {
|
|
980
990
|
padding?: number;
|
|
981
991
|
};
|
|
982
|
-
type PanelPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
992
|
+
type PanelPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | "center-left" | "center-right";
|
|
983
993
|
type ProOptions = {
|
|
984
994
|
account?: string;
|
|
985
995
|
hideAttribution: boolean;
|
|
@@ -1117,7 +1127,7 @@ type OnSelectionChangeParams<NodeType extends Node$1 = Node$1, EdgeType extends
|
|
|
1117
1127
|
};
|
|
1118
1128
|
type OnSelectionChangeFunc<NodeType extends Node$1 = Node$1, EdgeType extends Edge = Edge> = (params: OnSelectionChangeParams<NodeType, EdgeType>) => void;
|
|
1119
1129
|
type FitViewOptions<NodeType extends Node$1 = Node$1> = FitViewOptionsBase<NodeType>;
|
|
1120
|
-
type FitView = (fitViewOptions?: FitViewOptions) => Promise<boolean>;
|
|
1130
|
+
type FitView<NodeType extends Node$1 = Node$1> = (fitViewOptions?: FitViewOptions<NodeType>) => Promise<boolean>;
|
|
1121
1131
|
type OnInit<NodeType extends Node$1 = Node$1, EdgeType extends Edge = Edge> = (reactFlowInstance: ReactFlowInstance<NodeType, EdgeType>) => void;
|
|
1122
1132
|
type ViewportHelperFunctions = {
|
|
1123
1133
|
/**
|
|
@@ -1158,17 +1168,6 @@ type ViewportHelperFunctions = {
|
|
|
1158
1168
|
* @returns Viewport
|
|
1159
1169
|
*/
|
|
1160
1170
|
getViewport: GetViewport;
|
|
1161
|
-
/**
|
|
1162
|
-
* Fits the view.
|
|
1163
|
-
*
|
|
1164
|
-
* @param options.padding - optional padding
|
|
1165
|
-
* @param options.includeHiddenNodes - optional includeHiddenNodes
|
|
1166
|
-
* @param options.minZoom - optional minZoom
|
|
1167
|
-
* @param options.maxZoom - optional maxZoom
|
|
1168
|
-
* @param options.duration - optional duration. If set, a transition will be applied
|
|
1169
|
-
* @param options.nodes - optional nodes to fit the view to
|
|
1170
|
-
*/
|
|
1171
|
-
fitView: FitView;
|
|
1172
1171
|
/**
|
|
1173
1172
|
* Sets the center of the view to the given position.
|
|
1174
1173
|
*
|
|
@@ -1222,7 +1221,14 @@ type SelectionDragHandler<NodeType extends Node$1 = Node$1> = (event: ReactMouse
|
|
|
1222
1221
|
type OnNodeDrag<NodeType extends Node$1 = Node$1> = (event: ReactMouseEvent, node: NodeType, nodes: NodeType[]) => void;
|
|
1223
1222
|
type NodeProps$1<NodeType extends Node$1 = Node$1> = NodeProps<NodeType>;
|
|
1224
1223
|
type EdgeLabelOptions = {
|
|
1225
|
-
|
|
1224
|
+
/**
|
|
1225
|
+
* The label or custom element to render along the edge. This is commonly a text label or some
|
|
1226
|
+
* custom controls.
|
|
1227
|
+
*/
|
|
1228
|
+
label?: ReactNode;
|
|
1229
|
+
/**
|
|
1230
|
+
* Custom styles to apply to the label.
|
|
1231
|
+
*/
|
|
1226
1232
|
labelStyle?: CSSProperties;
|
|
1227
1233
|
labelShowBg?: boolean;
|
|
1228
1234
|
labelBgStyle?: CSSProperties;
|
|
@@ -1988,6 +1994,7 @@ type GeneralHelpers<NodeType extends Node$1 = Node$1, EdgeType extends Edge = Ed
|
|
|
1988
1994
|
nodeId: string;
|
|
1989
1995
|
handleId?: string | null;
|
|
1990
1996
|
}) => NodeConnection[];
|
|
1997
|
+
fitView: FitView<NodeType>;
|
|
1991
1998
|
};
|
|
1992
1999
|
type ReactFlowInstance<NodeType extends Node$1 = Node$1, EdgeType extends Edge = Edge> = GeneralHelpers<NodeType, EdgeType> & Omit<ViewportHelperFunctions, "initialized"> & {
|
|
1993
2000
|
viewportInitialized: boolean;
|
|
@@ -2020,6 +2027,8 @@ type ChangeEvent = {
|
|
|
2020
2027
|
};
|
|
2021
2028
|
type OnChange = (event: ChangeEvent) => void;
|
|
2022
2029
|
type OverrideReactFlowProps = Pick<ReactFlowProps, "paneClickDistance" | "nodeClickDistance" | "selectionKeyCode" | "panActivationKeyCode" | "multiSelectionKeyCode" | "zoomActivationKeyCode" | "snapToGrid" | "snapGrid" | "onlyRenderVisibleElements" | "nodesDraggable" | "nodesFocusable" | "elementsSelectable" | "selectNodesOnDrag" | "panOnDrag" | "preventScrolling" | "zoomOnScroll" | "zoomOnPinch" | "panOnScroll" | "panOnScrollSpeed" | "panOnScrollMode" | "zoomOnDoubleClick" | "nodeDragThreshold">;
|
|
2030
|
+
type PaddingUnit$1 = "px" | "%";
|
|
2031
|
+
type PaddingWithUnit$1 = `${number}${PaddingUnit$1}` | number;
|
|
2023
2032
|
interface LikeC4DiagramProperties {
|
|
2024
2033
|
view: DiagramView;
|
|
2025
2034
|
className?: string | undefined;
|
|
@@ -2050,10 +2059,10 @@ interface LikeC4DiagramProperties {
|
|
|
2050
2059
|
*/
|
|
2051
2060
|
fitView?: boolean | undefined;
|
|
2052
2061
|
/**
|
|
2053
|
-
*
|
|
2054
|
-
* @default
|
|
2062
|
+
* Padding around the diagram
|
|
2063
|
+
* @default '8px'
|
|
2055
2064
|
*/
|
|
2056
|
-
fitViewPadding?:
|
|
2065
|
+
fitViewPadding?: PaddingWithUnit$1 | undefined;
|
|
2057
2066
|
/**
|
|
2058
2067
|
* @default false if readonly
|
|
2059
2068
|
*/
|
|
@@ -2222,10 +2231,10 @@ export interface LikeC4ViewProps<ViewId = string, Tag = string, Kind = string> {
|
|
|
2222
2231
|
*/
|
|
2223
2232
|
fitView?: boolean | undefined;
|
|
2224
2233
|
/**
|
|
2225
|
-
*
|
|
2226
|
-
* @default
|
|
2234
|
+
* Padding around the diagram
|
|
2235
|
+
* @default '8px'
|
|
2227
2236
|
*/
|
|
2228
|
-
fitViewPadding?:
|
|
2237
|
+
fitViewPadding?: PaddingWithUnit$1 | undefined;
|
|
2229
2238
|
/**
|
|
2230
2239
|
* Display diagram title / description
|
|
2231
2240
|
*
|
|
@@ -2302,10 +2311,10 @@ interface LikeC4BrowserProps {
|
|
|
2302
2311
|
*/
|
|
2303
2312
|
background?: "dots" | "lines" | "cross" | "transparent" | "solid" | undefined;
|
|
2304
2313
|
/**
|
|
2305
|
-
*
|
|
2306
|
-
* @default
|
|
2314
|
+
* Padding around the diagram
|
|
2315
|
+
* @default '16px'
|
|
2307
2316
|
*/
|
|
2308
|
-
fitViewPadding?:
|
|
2317
|
+
fitViewPadding?: PaddingWithUnit$1 | undefined;
|
|
2309
2318
|
/**
|
|
2310
2319
|
* Show/hide panel with top left controls,
|
|
2311
2320
|
* @default true
|