@likec4/diagram 1.36.1 → 1.37.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/{chunk-DHvr-RGh.js → chunk-DSORWspW.js} +1008 -988
- package/bundle/custom.js +64 -56
- package/bundle/index.js +3539 -3315
- package/dist/LikeC4Diagram.props.d.ts +5 -5
- package/dist/LikeC4Styles.js +17 -15
- package/dist/StaticLikeC4Diagram.d.ts +1 -1
- package/dist/StaticLikeC4Diagram.js +3 -0
- package/dist/base/BaseXYFlow.d.ts +1 -1
- package/dist/base/BaseXYFlow.js +25 -27
- package/dist/base/const.d.ts +4 -4
- package/dist/base/const.js +5 -4
- package/dist/base/primitives/MarkdownBlock.js +4 -1
- package/dist/base/primitives/compound/CompoundActionButton.js +27 -42
- package/dist/base/primitives/compound/CompoundDetailsButton.js +23 -48
- package/dist/base/primitives/compound/CompoundNodeContainer.js +16 -48
- package/dist/base/primitives/compound/CompoundTitle.js +5 -80
- package/dist/base/primitives/compound/actionbtns.css.js +1 -13
- package/dist/base/primitives/customEdge.d.ts +1 -1
- package/dist/base/primitives/customNode.d.ts +4 -4
- package/dist/base/primitives/customNode.js +7 -7
- package/dist/base/primitives/edge/EdgeLabel.d.ts +5 -4
- package/dist/base/primitives/edge/EdgeLabel.js +39 -21
- package/dist/base/primitives/edge/EdgeLabelContainer.js +11 -23
- package/dist/base/primitives/edge/edge.css.js +19 -11
- package/dist/base/primitives/element/ElementShape.js +38 -18
- package/dist/base/primitives/element/ElementTags.js +7 -4
- package/dist/base/primitives/element/ElementTitle.js +10 -2
- package/dist/base/types.d.ts +17 -21
- package/dist/bundle/LikeC4View.d.ts +2 -2
- package/dist/bundle/LikeC4View.js +4 -1
- package/dist/bundle/LikeC4View.props.d.ts +2 -2
- package/dist/bundle/ReactLikeC4.d.ts +3 -3
- package/dist/bundle/custom.js +2 -1
- package/dist/bundle/index.js +2 -1
- package/dist/components/Link.js +3 -2
- package/dist/context/ReduceGraphics.js +2 -5
- package/dist/context/RootContainer.js +1 -5
- package/dist/custom/customNodes.d.ts +32 -26
- package/dist/custom/customNodes.js +12 -8
- package/dist/custom/hooks.d.ts +2 -1
- package/dist/custom/index.js +2 -1
- package/dist/globals.css.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useDiagram.d.ts +18 -1
- package/dist/hooks/useDiagram.js +18 -2
- package/dist/hooks/useXYFlow.d.ts +40 -21
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/likec4diagram/DiagramUI.js +5 -2
- package/dist/likec4diagram/DiagramXYFlow.js +9 -9
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +3 -3
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +27 -44
- package/dist/likec4diagram/custom/index.js +3 -3
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +8 -6
- package/dist/likec4diagram/custom/nodes/nodes.js +13 -14
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +3 -2
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +2 -2
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.d.ts +2 -0
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +441 -0
- package/dist/likec4diagram/relationship-popover/actor.d.ts +177 -0
- package/dist/likec4diagram/relationship-popover/actor.js +155 -0
- package/dist/likec4diagram/relationship-popover/styles.css.d.ts +2 -0
- package/dist/likec4diagram/{custom/edges/RelationshipsDropdownMenu.css.js → relationship-popover/styles.css.js} +4 -17
- package/dist/likec4diagram/useLayoutConstraints.js +0 -1
- package/dist/likec4model/useLikeC4ElementsTree.js +1 -1
- package/dist/likec4model/useLikeC4Project.js +15 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +1 -2
- package/dist/navigationpanel/actor.js +1 -2
- package/dist/navigationpanel/controls/NavigationButtons.js +1 -5
- package/dist/navigationpanel/controls/ViewDetailsCard.js +2 -0
- package/dist/overlays/element-details/actor.d.ts +564 -8
- package/dist/overlays/overlay/Overlay.css.d.ts +1 -1
- package/dist/overlays/relationship-details/actor.d.ts +3 -1
- package/dist/overlays/relationship-details/hooks.d.ts +19 -1
- package/dist/overlays/relationship-details/layout-to-xyflow.js +0 -1
- package/dist/overlays/relationship-details/layout.js +1 -2
- package/dist/overlays/relationships-browser/actor.d.ts +26 -2
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +16 -0
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +18 -8
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -1
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/state/DiagramActorProvider.js +2 -19
- package/dist/state/assign.js +24 -10
- package/dist/state/diagram-machine.d.ts +149 -474
- package/dist/state/diagram-machine.js +94 -54
- package/dist/state/types.d.ts +1 -1
- package/dist/styles-min.css +1 -1
- package/dist/styles-xyflow.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/roundDpr.d.ts +1 -0
- package/dist/utils/roundDpr.js +20 -0
- package/dist/utils/xyflow.d.ts +0 -1
- package/dist/utils/xyflow.js +1 -7
- package/package.json +11 -10
- package/panda.buildinfo.json +90 -155
- package/src/LikeC4Diagram.props.ts +5 -5
- package/src/LikeC4Styles.tsx +22 -14
- package/src/StaticLikeC4Diagram.tsx +3 -0
- package/src/base/BaseXYFlow.tsx +26 -29
- package/src/base/const.ts +5 -4
- package/src/base/primitives/MarkdownBlock.tsx +6 -1
- package/src/base/primitives/compound/CompoundActionButton.tsx +31 -43
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +26 -48
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +15 -43
- package/src/base/primitives/compound/CompoundTitle.tsx +4 -76
- package/src/base/primitives/compound/actionbtns.css.ts +0 -12
- package/src/base/primitives/customEdge.ts +1 -1
- package/src/base/primitives/customNode.tsx +20 -24
- package/src/base/primitives/edge/EdgeLabel.tsx +23 -8
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +9 -21
- package/src/base/primitives/edge/edge.css.ts +19 -11
- package/src/base/primitives/element/ElementShape.tsx +40 -18
- package/src/base/primitives/element/ElementTags.tsx +7 -4
- package/src/base/primitives/element/ElementTitle.tsx +23 -11
- package/src/base/types.ts +21 -25
- package/src/bundle/LikeC4View.props.ts +2 -2
- package/src/bundle/LikeC4View.tsx +8 -5
- package/src/bundle/ReactLikeC4.tsx +3 -3
- package/src/components/Link.tsx +3 -2
- package/src/context/RootContainer.tsx +1 -5
- package/src/context/TagStylesContext.tsx +2 -0
- package/src/custom/{customNodes.tsx → customNodes.ts} +58 -52
- package/src/custom/hooks.ts +7 -0
- package/src/globals.css +58 -5
- package/src/hooks/index.ts +1 -1
- package/src/hooks/useDiagram.ts +39 -5
- package/src/hooks/useXYFlow.ts +3 -1
- package/src/index.ts +1 -0
- package/src/likec4diagram/DiagramUI.tsx +3 -0
- package/src/likec4diagram/DiagramXYFlow.tsx +9 -11
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +25 -49
- package/src/likec4diagram/custom/index.ts +5 -4
- package/src/likec4diagram/custom/nodes/nodes.tsx +13 -11
- package/src/likec4diagram/custom/nodes/toolbar/CompoundToolbar.tsx +3 -2
- package/src/likec4diagram/relationship-popover/RelationshipPopover.tsx +535 -0
- package/src/likec4diagram/relationship-popover/actor.ts +192 -0
- package/src/likec4diagram/{custom/edges/RelationshipsDropdownMenu.css.ts → relationship-popover/styles.css.ts} +3 -19
- package/src/likec4diagram/useLayoutConstraints.ts +0 -1
- package/src/likec4model/useLikeC4ElementsTree.ts +1 -1
- package/src/navigationpanel/NavigationPanelDropdown.tsx +1 -2
- package/src/navigationpanel/actor.ts +2 -2
- package/src/navigationpanel/controls/NavigationButtons.tsx +1 -5
- package/src/navigationpanel/controls/ViewDetailsCard.tsx +2 -0
- package/src/overlays/relationship-details/layout-to-xyflow.ts +0 -1
- package/src/overlays/relationship-details/layout.ts +4 -3
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +22 -8
- package/src/overlays/relationships-browser/useViewToNodesEdges.ts +0 -1
- package/src/state/DiagramActorProvider.tsx +2 -20
- package/src/state/assign.ts +24 -10
- package/src/state/diagram-machine.ts +101 -53
- package/src/state/types.ts +4 -1
- package/src/utils/index.ts +2 -1
- package/src/utils/roundDpr.ts +27 -0
- package/src/utils/xyflow.ts +0 -7
- package/dist/base/primitives/compound/CompoundNodeContainer.css.d.ts +0 -35
- package/dist/base/primitives/compound/CompoundNodeContainer.css.js +0 -132
- package/dist/base/primitives/edge/EdgeLabel.css.d.ts +0 -7
- package/dist/base/primitives/edge/EdgeLabel.css.js +0 -57
- package/dist/base/primitives/element/ElementShape.css.d.ts +0 -6
- package/dist/base/primitives/element/ElementShape.css.js +0 -107
- package/dist/likec4diagram/custom/edges/NotePopover.css.js +0 -21
- package/dist/likec4diagram/custom/edges/NotePopover.js +0 -91
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.d.ts +0 -5
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.d.ts +0 -13
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +0 -215
- package/dist/likec4diagram/custom/index.d.ts +0 -62
- package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +0 -10
- package/src/base/primitives/compound/CompoundNodeContainer.css.ts +0 -138
- package/src/base/primitives/edge/EdgeLabel.css.ts +0 -64
- package/src/base/primitives/element/ElementShape.css.ts +0 -112
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +0 -281
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { nonNullable } from '@likec4/core';
|
|
3
3
|
import { cx } from '@likec4/styles/css';
|
|
4
4
|
import { useDebouncedEffect } from '@react-hookz/web';
|
|
@@ -8,32 +8,30 @@ import { useState, useRef, useEffect } from 'react';
|
|
|
8
8
|
import { isTruthy, first, last } from 'remeda';
|
|
9
9
|
import { ZIndexes } from '../../../base/const.js';
|
|
10
10
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
11
|
-
import { useDiagram
|
|
11
|
+
import { useDiagram } from '../../../hooks/useDiagram.js';
|
|
12
12
|
import { useXYStoreApi, useXYFlow, useXYInternalNode } from '../../../hooks/useXYFlow.js';
|
|
13
|
+
import { roundDpr } from '../../../utils/roundDpr.js';
|
|
13
14
|
import { VectorImpl, vector } from '../../../utils/vector.js';
|
|
14
15
|
import { isSamePoint, bezierControlPoints, bezierPath } from '../../../utils/xyflow.js';
|
|
15
16
|
import { controlDragging, controlPointsContainer, controlPoint } from './edges.css.js';
|
|
16
|
-
import { NotePopover } from './NotePopover.js';
|
|
17
|
-
import { RelationshipsDropdownMenu } from './RelationshipsDropdownMenu.js';
|
|
18
17
|
import { getNodeIntersectionFromCenterToPoint } from './utils.js';
|
|
19
18
|
import { customEdge } from '../../../base/primitives/customEdge.js';
|
|
20
|
-
import { useIsPanning } from '../../../context/ReduceGraphics.js';
|
|
21
|
-
import { EdgeLabel } from '../../../base/primitives/edge/EdgeLabel.js';
|
|
22
|
-
import { EdgeActionButton } from '../../../base/primitives/edge/EdgeActionButton.js';
|
|
23
19
|
import { EdgeContainer } from '../../../base/primitives/edge/EdgeContainer.js';
|
|
24
20
|
import { EdgePath } from '../../../base/primitives/edge/EdgePath.js';
|
|
25
21
|
import { EdgeLabelContainer } from '../../../base/primitives/edge/EdgeLabelContainer.js';
|
|
22
|
+
import { EdgeLabel } from '../../../base/primitives/edge/EdgeLabel.js';
|
|
23
|
+
import { EdgeActionButton } from '../../../base/primitives/edge/EdgeActionButton.js';
|
|
26
24
|
|
|
27
25
|
const curve = line().curve(curveCatmullRomOpen).x((d) => d.x).y((d) => d.y);
|
|
28
|
-
const selectActiveStepId = (s) => s.context.activeWalkthrough?.stepId ?? null;
|
|
29
26
|
const RelationshipEdge = customEdge((props) => {
|
|
30
|
-
const isPanning = useIsPanning();
|
|
31
27
|
const [isControlPointDragging, setIsControlPointDragging] = useState(false);
|
|
32
28
|
const xyflowStore = useXYStoreApi();
|
|
33
29
|
const xyflow = useXYFlow();
|
|
34
30
|
const diagram = useDiagram();
|
|
35
|
-
const
|
|
36
|
-
|
|
31
|
+
const {
|
|
32
|
+
enableNavigateTo,
|
|
33
|
+
enableEdgeEditing
|
|
34
|
+
} = useEnabledFeatures();
|
|
37
35
|
const {
|
|
38
36
|
id,
|
|
39
37
|
source,
|
|
@@ -93,8 +91,8 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
93
91
|
if (!path) return;
|
|
94
92
|
const dompoint = path.getPointAtLength(path.getTotalLength() * 0.5);
|
|
95
93
|
const point = {
|
|
96
|
-
x:
|
|
97
|
-
y:
|
|
94
|
+
x: roundDpr(dompoint.x),
|
|
95
|
+
y: roundDpr(dompoint.y)
|
|
98
96
|
};
|
|
99
97
|
setLabelPos((current) => isSamePoint(current, point) ? current : point);
|
|
100
98
|
}, [edgePath]);
|
|
@@ -132,13 +130,16 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
132
130
|
};
|
|
133
131
|
if (!isSamePoint(pointer, clientPoint)) {
|
|
134
132
|
setIsControlPointDragging(true);
|
|
135
|
-
hasMoved
|
|
133
|
+
if (!hasMoved) {
|
|
134
|
+
diagram.send({ type: "xyflow.edgeEditingStarted", edge: props.data });
|
|
135
|
+
hasMoved = true;
|
|
136
|
+
}
|
|
136
137
|
pointer = clientPoint;
|
|
137
138
|
const { x, y } = xyflow.screenToFlowPosition(pointer, { snapToGrid: false });
|
|
138
139
|
const cp = controlPoints.slice();
|
|
139
140
|
cp[index] = {
|
|
140
|
-
x:
|
|
141
|
-
y:
|
|
141
|
+
x: roundDpr(x),
|
|
142
|
+
y: roundDpr(y)
|
|
142
143
|
};
|
|
143
144
|
diagram.updateEdgeData(id, {
|
|
144
145
|
controlPoints: cp
|
|
@@ -244,33 +245,6 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
244
245
|
if (hovered || active) {
|
|
245
246
|
zIndex = ZIndexes.Element + 1;
|
|
246
247
|
}
|
|
247
|
-
let edgeLabel = /* @__PURE__ */ jsx(EdgeLabel, { edgeProps: props, children: !isControlPointDragging && navigateTo && /* @__PURE__ */ jsx(
|
|
248
|
-
EdgeActionButton,
|
|
249
|
-
{
|
|
250
|
-
...props,
|
|
251
|
-
onClick: (e) => {
|
|
252
|
-
e.stopPropagation();
|
|
253
|
-
diagram.navigateTo(navigateTo);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
) });
|
|
257
|
-
if (!isControlPointDragging && !isPanning) {
|
|
258
|
-
const notes = props.data.notes;
|
|
259
|
-
if (notes && activeWalkthroughStep === props.id) {
|
|
260
|
-
edgeLabel = /* @__PURE__ */ jsx(NotePopover, { notes: notes.txt ?? notes.md, children: edgeLabel });
|
|
261
|
-
} else if (enableRelationshipDetails) {
|
|
262
|
-
edgeLabel = /* @__PURE__ */ jsx(
|
|
263
|
-
RelationshipsDropdownMenu,
|
|
264
|
-
{
|
|
265
|
-
disabled: !!dimmed,
|
|
266
|
-
source,
|
|
267
|
-
target,
|
|
268
|
-
edgeId,
|
|
269
|
-
children: edgeLabel
|
|
270
|
-
}
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
248
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
275
249
|
/* @__PURE__ */ jsxs(EdgeContainer, { ...props, className: cx(isControlPointDragging && controlDragging), children: [
|
|
276
250
|
/* @__PURE__ */ jsx(
|
|
@@ -293,7 +267,16 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
293
267
|
y: labelY,
|
|
294
268
|
translate: isModified ? "translate(-50%, 0)" : void 0
|
|
295
269
|
},
|
|
296
|
-
children:
|
|
270
|
+
children: /* @__PURE__ */ jsx(EdgeLabel, { edgeProps: props, children: navigateTo && /* @__PURE__ */ jsx(
|
|
271
|
+
EdgeActionButton,
|
|
272
|
+
{
|
|
273
|
+
...props,
|
|
274
|
+
onClick: (e) => {
|
|
275
|
+
e.stopPropagation();
|
|
276
|
+
diagram.navigateTo(navigateTo);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
) })
|
|
297
280
|
}
|
|
298
281
|
)
|
|
299
282
|
] }),
|
|
@@ -4,9 +4,9 @@ import { ViewGroupNode, CompoundDeploymentNode, CompoundElementNode, DeploymentN
|
|
|
4
4
|
const BuiltinNodes = {
|
|
5
5
|
element: ElementNode,
|
|
6
6
|
deployment: DeploymentNode,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
compoundElement: CompoundElementNode,
|
|
8
|
+
compoundDeployment: CompoundDeploymentNode,
|
|
9
|
+
viewGroup: ViewGroupNode
|
|
10
10
|
};
|
|
11
11
|
const edgeTypes = {
|
|
12
12
|
relationship: RelationshipEdge
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { NodeProps } from '../../../base';
|
|
2
|
+
import { CustomNodes as CustomNodesType } from '../../../custom/customNodes';
|
|
2
3
|
import { Types } from '../../types';
|
|
3
|
-
|
|
4
|
+
type CustomNodes = Required<CustomNodesType>;
|
|
4
5
|
export declare function ElementDetailsButtonWithHandler(props: NodeProps<Types.ElementNodeData | Types.DeploymentElementNodeData>): import("react/jsx-runtime").JSX.Element | null;
|
|
5
6
|
export declare function CompoundDetailsButtonWithHandler(props: NodeProps<Types.CompoundElementNodeData | Types.CompoundDeploymentNodeData>): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
-
export declare const ElementNode:
|
|
7
|
-
export declare const DeploymentNode:
|
|
8
|
-
export declare const CompoundElementNode:
|
|
9
|
-
export declare const CompoundDeploymentNode:
|
|
10
|
-
export declare const ViewGroupNode:
|
|
7
|
+
export declare const ElementNode: CustomNodes['element'];
|
|
8
|
+
export declare const DeploymentNode: CustomNodes['deployment'];
|
|
9
|
+
export declare const CompoundElementNode: CustomNodes['compoundElement'];
|
|
10
|
+
export declare const CompoundDeploymentNode: CustomNodes['compoundDeployment'];
|
|
11
|
+
export declare const ViewGroupNode: CustomNodes['viewGroup'];
|
|
12
|
+
export {};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
3
3
|
import { useDiagram } from '../../../hooks/useDiagram.js';
|
|
4
4
|
import { CompoundActions } from './CompoundActions.js';
|
|
5
5
|
import { DeploymentElementActions, ElementActions } from './ElementActions.js';
|
|
6
|
-
import {
|
|
6
|
+
import { CompoundDeploymentToolbar, CompoundElementToolbar } from './toolbar/CompoundToolbar.js';
|
|
7
7
|
import { DeploymentElementToolbar, ElementToolbar } from './toolbar/ElementToolbar.js';
|
|
8
|
-
import { customNode } from '../../../base/primitives/customNode.js';
|
|
9
|
-
import { CompoundDetailsButton } from '../../../base/primitives/compound/CompoundDetailsButton.js';
|
|
10
8
|
import { CompoundNodeContainer } from '../../../base/primitives/compound/CompoundNodeContainer.js';
|
|
11
9
|
import { CompoundTitle } from '../../../base/primitives/compound/CompoundTitle.js';
|
|
12
10
|
import { DefaultHandles } from '../../../base/primitives/NodeHandles.js';
|
|
11
|
+
import { CompoundDetailsButton } from '../../../base/primitives/compound/CompoundDetailsButton.js';
|
|
13
12
|
import { ElementNodeContainer } from '../../../base/primitives/element/ElementNodeContainer.js';
|
|
14
13
|
import { ElementShape } from '../../../base/primitives/element/ElementShape.js';
|
|
15
14
|
import { ElementTitle } from '../../../base/primitives/element/ElementTitle.js';
|
|
@@ -48,7 +47,7 @@ function CompoundDetailsButtonWithHandler(props) {
|
|
|
48
47
|
}
|
|
49
48
|
);
|
|
50
49
|
}
|
|
51
|
-
const ElementNode =
|
|
50
|
+
const ElementNode = (props) => {
|
|
52
51
|
const { enableElementTags, enableReadOnly } = useEnabledFeatures();
|
|
53
52
|
return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
|
|
54
53
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
@@ -59,9 +58,9 @@ const ElementNode = customNode((props) => {
|
|
|
59
58
|
!enableReadOnly && /* @__PURE__ */ jsx(ElementToolbar, { ...props }),
|
|
60
59
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
61
60
|
] });
|
|
62
|
-
}
|
|
61
|
+
};
|
|
63
62
|
ElementNode.displayName = "ElementNode";
|
|
64
|
-
const DeploymentNode =
|
|
63
|
+
const DeploymentNode = (props) => {
|
|
65
64
|
const { enableElementTags, enableReadOnly } = useEnabledFeatures();
|
|
66
65
|
return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
|
|
67
66
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
@@ -72,9 +71,9 @@ const DeploymentNode = customNode((props) => {
|
|
|
72
71
|
!enableReadOnly && /* @__PURE__ */ jsx(DeploymentElementToolbar, { ...props }),
|
|
73
72
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
74
73
|
] });
|
|
75
|
-
}
|
|
74
|
+
};
|
|
76
75
|
DeploymentNode.displayName = "DeploymentNode";
|
|
77
|
-
const CompoundElementNode =
|
|
76
|
+
const CompoundElementNode = (props) => {
|
|
78
77
|
const { enableElementDetails, enableReadOnly } = useEnabledFeatures();
|
|
79
78
|
return /* @__PURE__ */ jsxs(CompoundNodeContainer, { nodeProps: props, children: [
|
|
80
79
|
/* @__PURE__ */ jsx(CompoundTitle, { ...props }),
|
|
@@ -83,9 +82,9 @@ const CompoundElementNode = customNode((props) => {
|
|
|
83
82
|
!enableReadOnly && /* @__PURE__ */ jsx(CompoundElementToolbar, { ...props }),
|
|
84
83
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
85
84
|
] });
|
|
86
|
-
}
|
|
85
|
+
};
|
|
87
86
|
CompoundElementNode.displayName = "CompoundElementNode";
|
|
88
|
-
const CompoundDeploymentNode =
|
|
87
|
+
const CompoundDeploymentNode = (props) => {
|
|
89
88
|
const { enableElementDetails, enableReadOnly } = useEnabledFeatures();
|
|
90
89
|
return /* @__PURE__ */ jsxs(CompoundNodeContainer, { nodeProps: props, children: [
|
|
91
90
|
/* @__PURE__ */ jsx(CompoundTitle, { ...props }),
|
|
@@ -94,12 +93,12 @@ const CompoundDeploymentNode = customNode((props) => {
|
|
|
94
93
|
!enableReadOnly && /* @__PURE__ */ jsx(CompoundDeploymentToolbar, { ...props }),
|
|
95
94
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
96
95
|
] });
|
|
97
|
-
}
|
|
96
|
+
};
|
|
98
97
|
CompoundDeploymentNode.displayName = "CompoundDeploymentNode";
|
|
99
|
-
const ViewGroupNode =
|
|
98
|
+
const ViewGroupNode = (props) => /* @__PURE__ */ jsxs(CompoundNodeContainer, { nodeProps: props, children: [
|
|
100
99
|
/* @__PURE__ */ jsx(CompoundTitle, { ...props }),
|
|
101
100
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
102
|
-
] })
|
|
101
|
+
] });
|
|
103
102
|
ViewGroupNode.displayName = "ViewGroupNode";
|
|
104
103
|
|
|
105
104
|
export { CompoundDeploymentNode, CompoundDetailsButtonWithHandler, CompoundElementNode, DeploymentNode, ElementDetailsButtonWithHandler, ElementNode, ViewGroupNode };
|
|
@@ -15,6 +15,7 @@ function CompoundElementToolbar(props) {
|
|
|
15
15
|
}
|
|
16
16
|
} = props;
|
|
17
17
|
const { elementColor, onColorPreview, onChange } = useHandlers(modelFqn, props);
|
|
18
|
+
const opacity = style?.opacity ?? 100;
|
|
18
19
|
return /* @__PURE__ */ jsxs(
|
|
19
20
|
Toolbar,
|
|
20
21
|
{
|
|
@@ -28,7 +29,7 @@ function CompoundElementToolbar(props) {
|
|
|
28
29
|
elementColor,
|
|
29
30
|
onColorPreview,
|
|
30
31
|
isOpacityEditable: true,
|
|
31
|
-
elementOpacity:
|
|
32
|
+
elementOpacity: opacity,
|
|
32
33
|
onChange,
|
|
33
34
|
position: "left-start"
|
|
34
35
|
}
|
|
@@ -36,7 +37,7 @@ function CompoundElementToolbar(props) {
|
|
|
36
37
|
/* @__PURE__ */ jsx(
|
|
37
38
|
BorderStyleOption,
|
|
38
39
|
{
|
|
39
|
-
elementBorderStyle: style?.border,
|
|
40
|
+
elementBorderStyle: style?.border ?? (opacity < 99 ? "dashed" : "none"),
|
|
40
41
|
onChange
|
|
41
42
|
}
|
|
42
43
|
),
|
|
@@ -16,7 +16,7 @@ export declare const themedColors: ({
|
|
|
16
16
|
value: ColorLiteral;
|
|
17
17
|
})[];
|
|
18
18
|
export declare const colors: {
|
|
19
|
-
key: "
|
|
19
|
+
key: "amber" | "blue" | "gray" | "slate" | "green" | "indigo" | "red" | "sky";
|
|
20
20
|
value: ColorLiteral;
|
|
21
21
|
}[];
|
|
22
22
|
export type ThemeColorKey = typeof themedColors[0]['key'];
|
|
@@ -26,7 +26,7 @@ export declare const Tooltip: ForwardRefExoticComponent< TooltipProps & RefAttri
|
|
|
26
26
|
renderRoot?: (props: Record<string, any>) => React.ReactNode;
|
|
27
27
|
}>;
|
|
28
28
|
export declare function useHandlers(target: Fqn | DeploymentFqn, props: NodeProps<Types.NodeData>): {
|
|
29
|
-
elementColor: "
|
|
29
|
+
elementColor: "amber" | "blue" | "gray" | "slate" | "green" | "indigo" | "muted" | "primary" | "red" | "secondary" | "sky";
|
|
30
30
|
onColorPreview: (color: ThemeColor | null) => void;
|
|
31
31
|
onChange: OnStyleChange;
|
|
32
32
|
};
|