@likec4/diagram 1.18.0 → 1.19.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/LICENSE +1 -1
- package/dist/LikeC4CustomColors.d.ts +7 -0
- package/dist/LikeC4CustomColors.js +30 -0
- package/dist/LikeC4Diagram.css.d.ts +5 -0
- package/dist/LikeC4Diagram.css.js +13 -0
- package/dist/LikeC4Diagram.d.ts +6 -0
- package/dist/LikeC4Diagram.js +194 -0
- package/dist/LikeC4Diagram.props.d.ts +166 -0
- package/dist/LikeC4ModelProvider.d.ts +9 -0
- package/dist/LikeC4ModelProvider.js +12 -0
- package/dist/LikeC4Search.css.d.ts +1 -0
- package/dist/LikeC4Search.css.js +5 -0
- package/dist/LikeC4Search.d.ts +2 -0
- package/dist/LikeC4Search.js +96 -0
- package/dist/StaticLikeC4Diagram.d.ts +3 -0
- package/dist/StaticLikeC4Diagram.js +41 -0
- package/dist/_virtual/_commonjsHelpers.js +6 -0
- package/dist/controls/Text.d.ts +2 -0
- package/dist/controls/Text.js +7 -0
- package/dist/controls/action-button-bar/ActionButtonBar.css.d.ts +1 -0
- package/dist/controls/action-button-bar/ActionButtonBar.css.js +5 -0
- package/dist/controls/action-button-bar/ActionButtonBar.d.ts +9 -0
- package/dist/controls/action-button-bar/ActionButtonBar.js +100 -0
- package/dist/controls/action-button-bar/useActionButtonBarCtx.d.ts +10 -0
- package/dist/controls/action-button-bar/useActionButtonBarCtx.js +9 -0
- package/dist/controls/action-buttons/ActionButton.css.d.ts +1 -0
- package/dist/controls/action-buttons/ActionButton.css.js +5 -0
- package/dist/controls/action-buttons/ActionButton.d.ts +9 -0
- package/dist/controls/action-buttons/ActionButton.js +66 -0
- package/dist/controls/action-buttons/ActionButtons.d.ts +12 -0
- package/dist/controls/action-buttons/ActionButtons.js +99 -0
- package/dist/globals.css.d.ts +1 -0
- package/dist/globals.css.js +92 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useDiagramState.d.ts +6 -0
- package/dist/hooks/useDiagramState.js +27 -0
- package/dist/hooks/useMantinePortalProps.d.ts +9 -0
- package/dist/hooks/useMantinePortalProps.js +9 -0
- package/dist/hooks/useSetState.d.ts +2 -0
- package/dist/hooks/useSetState.js +19 -0
- package/dist/hooks/useUpdateEffect.d.ts +4 -0
- package/dist/hooks/useUpdateEffect.js +32 -0
- package/dist/hooks/useXYFlow.d.ts +270 -0
- package/dist/hooks/useXYFlow.js +20 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +25 -0
- package/dist/likec4model/LikeC4ModelContext.d.ts +3 -0
- package/dist/likec4model/LikeC4ModelContext.js +5 -0
- package/dist/likec4model/index.d.ts +2 -0
- package/dist/likec4model/useLikeC4ElementsTree.d.ts +12 -0
- package/dist/likec4model/useLikeC4ElementsTree.js +25 -0
- package/dist/likec4model/useLikeC4Model.d.ts +20 -0
- package/dist/likec4model/useLikeC4Model.js +55 -0
- package/dist/overlays/OverlayContext.d.ts +10 -0
- package/dist/overlays/OverlayContext.js +9 -0
- package/dist/overlays/Overlays.css.d.ts +3 -0
- package/dist/overlays/Overlays.css.js +7 -0
- package/dist/overlays/Overlays.d.ts +2 -0
- package/dist/overlays/Overlays.js +137 -0
- package/dist/overlays/edge-details/EdgeDetailsXYFlow.d.ts +5 -0
- package/dist/overlays/edge-details/EdgeDetailsXYFlow.js +185 -0
- package/dist/overlays/edge-details/SelectEdge.css.d.ts +7 -0
- package/dist/overlays/edge-details/SelectEdge.css.js +17 -0
- package/dist/overlays/edge-details/SelectEdge.d.ts +5 -0
- package/dist/overlays/edge-details/SelectEdge.js +129 -0
- package/dist/overlays/edge-details/_types.d.ts +14 -0
- package/dist/overlays/edge-details/use-layouted-edge-details.d.ts +21 -0
- package/dist/overlays/edge-details/use-layouted-edge-details.js +270 -0
- package/dist/overlays/edge-details/xyflow/CompoundNode.d.ts +5 -0
- package/dist/overlays/edge-details/xyflow/CompoundNode.js +76 -0
- package/dist/overlays/edge-details/xyflow/ElementNode.d.ts +5 -0
- package/dist/overlays/edge-details/xyflow/ElementNode.js +159 -0
- package/dist/overlays/edge-details/xyflow/RelationshipEdge.d.ts +3 -0
- package/dist/overlays/edge-details/xyflow/RelationshipEdge.js +84 -0
- package/dist/overlays/edge-details/xyflow/styles.css.d.ts +9 -0
- package/dist/overlays/edge-details/xyflow/styles.css.js +21 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.d.ts +16 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +33 -0
- package/dist/overlays/element-details/ElementDetailsCard.d.ts +7 -0
- package/dist/overlays/element-details/ElementDetailsCard.js +484 -0
- package/dist/overlays/element-details/TabPanelDeployments.css.d.ts +4 -0
- package/dist/overlays/element-details/TabPanelDeployments.css.js +11 -0
- package/dist/overlays/element-details/TabPanelDeployments.d.ts +7 -0
- package/dist/overlays/element-details/TabPanelDeployments.js +173 -0
- package/dist/overlays/element-details/TabPanelRelationships.css.d.ts +5 -0
- package/dist/overlays/element-details/TabPanelRelationships.css.js +11 -0
- package/dist/overlays/element-details/TabPanelRelationships.d.ts +8 -0
- package/dist/overlays/element-details/TabPanelRelationships.js +157 -0
- package/dist/overlays/element-details/TabPanelStructure.css.d.ts +2 -0
- package/dist/overlays/element-details/TabPanelStructure.css.js +7 -0
- package/dist/overlays/element-details/TabPanelStructure.d.ts +25 -0
- package/dist/overlays/element-details/TabPanelStructure.js +91 -0
- package/dist/overlays/index.d.ts +1 -0
- package/dist/overlays/relationships-of/RelationshipsOverlay.d.ts +5 -0
- package/dist/overlays/relationships-of/RelationshipsOverlay.js +193 -0
- package/dist/overlays/relationships-of/RelationshipsXYFlow.d.ts +19 -0
- package/dist/overlays/relationships-of/RelationshipsXYFlow.js +290 -0
- package/dist/overlays/relationships-of/SelectElement.css.d.ts +2 -0
- package/dist/overlays/relationships-of/SelectElement.css.js +7 -0
- package/dist/overlays/relationships-of/SelectElement.d.ts +7 -0
- package/dist/overlays/relationships-of/SelectElement.js +126 -0
- package/dist/overlays/relationships-of/_types.d.ts +28 -0
- package/dist/overlays/relationships-of/use-layouted-relationships.d.ts +22 -0
- package/dist/overlays/relationships-of/use-layouted-relationships.js +496 -0
- package/dist/overlays/relationships-of/xyflow/CompoundNode.d.ts +6 -0
- package/dist/overlays/relationships-of/xyflow/CompoundNode.js +120 -0
- package/dist/overlays/relationships-of/xyflow/ElementNode.d.ts +6 -0
- package/dist/overlays/relationships-of/xyflow/ElementNode.js +194 -0
- package/dist/overlays/relationships-of/xyflow/EmptyNode.d.ts +5 -0
- package/dist/overlays/relationships-of/xyflow/EmptyNode.js +18 -0
- package/dist/overlays/relationships-of/xyflow/RelationshipEdge.d.ts +3 -0
- package/dist/overlays/relationships-of/xyflow/RelationshipEdge.js +123 -0
- package/dist/overlays/relationships-of/xyflow/styles.css.d.ts +14 -0
- package/dist/overlays/relationships-of/xyflow/styles.css.js +24 -0
- package/dist/overlays/shared/xyflow/RelationshipEdge.css.d.ts +4 -0
- package/dist/overlays/shared/xyflow/RelationshipEdge.css.js +12 -0
- package/dist/overlays/shared/xyflow/_types.d.ts +77 -0
- package/dist/state/DiagramContext.d.ts +1609 -0
- package/dist/state/DiagramContext.js +101 -0
- package/dist/state/aligners.d.ts +42 -0
- package/dist/state/aligners.js +349 -0
- package/dist/state/diagram-to-xyflow.d.ts +11 -0
- package/dist/state/diagram-to-xyflow.js +113 -0
- package/dist/state/diagramStore.d.ts +1705 -0
- package/dist/state/diagramStore.js +808 -0
- package/dist/state/diagramStore.layout.d.ts +4 -0
- package/dist/state/diagramStore.layout.js +56 -0
- package/dist/style.css +1 -0
- package/dist/theme-vars.css.d.ts +72 -0
- package/dist/theme-vars.css.js +6 -0
- package/dist/theme-vars.css.ts.vanilla.css.js +1 -0
- package/dist/theme-vars.d.ts +3 -0
- package/dist/theme-vars.js +5 -0
- package/dist/ui/DiagramTitlePanel.css.d.ts +4 -0
- package/dist/ui/DiagramTitlePanel.css.js +11 -0
- package/dist/ui/DiagramTitlePanel.d.ts +1 -0
- package/dist/ui/DiagramTitlePanel.js +159 -0
- package/dist/ui/DynamicViewWalkthrough.css.d.ts +4 -0
- package/dist/ui/DynamicViewWalkthrough.css.js +11 -0
- package/dist/ui/DynamicViewWalkthrough.d.ts +1 -0
- package/dist/ui/DynamicViewWalkthrough.js +156 -0
- package/dist/ui/EnsureMantine.d.ts +7 -0
- package/dist/ui/EnsureMantine.js +14 -0
- package/dist/ui/FramerMotionConfig.d.ts +2 -0
- package/dist/ui/FramerMotionConfig.js +14 -0
- package/dist/ui/Link.d.ts +4 -0
- package/dist/ui/Link.js +36 -0
- package/dist/ui/notation/NotationPanel.css.d.ts +6 -0
- package/dist/ui/notation/NotationPanel.css.js +16 -0
- package/dist/ui/notation/NotationPanel.d.ts +1 -0
- package/dist/ui/notation/NotationPanel.js +250 -0
- package/dist/ui/notation/index.d.ts +1 -0
- package/dist/ui/top-left/ChangeAutoLayoutButton.d.ts +2 -0
- package/dist/ui/top-left/ChangeAutoLayoutButton.js +159 -0
- package/dist/ui/top-left/ManualLayoutToolsButton.d.ts +2 -0
- package/dist/ui/top-left/ManualLayoutToolsButton.js +137 -0
- package/dist/ui/top-left/TopLeftPanel.d.ts +4 -0
- package/dist/ui/top-left/TopLeftPanel.js +211 -0
- package/dist/ui/top-left/_shared.d.ts +7 -0
- package/dist/ui/top-left/_shared.js +22 -0
- package/dist/ui/top-left/styles.css.d.ts +8 -0
- package/dist/ui/top-left/styles.css.js +17 -0
- package/dist/utils/types.d.ts +8 -0
- package/dist/utils/vector.d.ts +24 -0
- package/dist/utils/vector.js +55 -0
- package/dist/xyflow/EdgeMarkers.d.ts +12 -0
- package/dist/xyflow/EdgeMarkers.js +192 -0
- package/dist/xyflow/FitviewOnDiagramChange.d.ts +4 -0
- package/dist/xyflow/FitviewOnDiagramChange.js +72 -0
- package/dist/xyflow/SelectEdgesOnNodeFocus.d.ts +1 -0
- package/dist/xyflow/SelectEdgesOnNodeFocus.js +96 -0
- package/dist/xyflow/XYFlow.d.ts +8 -0
- package/dist/xyflow/XYFlow.js +145 -0
- package/dist/xyflow/XYFlowBackground.d.ts +10 -0
- package/dist/xyflow/XYFlowBackground.js +25 -0
- package/dist/xyflow/XYFlowInner.d.ts +8 -0
- package/dist/xyflow/XYFlowInner.js +41 -0
- package/dist/xyflow/const.d.ts +7 -0
- package/dist/xyflow/const.js +12 -0
- package/dist/xyflow/edges/EdgeLabel.d.ts +7 -0
- package/dist/xyflow/edges/EdgeLabel.js +160 -0
- package/dist/xyflow/edges/RelationshipEdge.d.ts +6 -0
- package/dist/xyflow/edges/RelationshipEdge.js +443 -0
- package/dist/xyflow/edges/RelationshipsDropdownMenu.css.d.ts +4 -0
- package/dist/xyflow/edges/RelationshipsDropdownMenu.css.js +11 -0
- package/dist/xyflow/edges/RelationshipsDropdownMenu.d.ts +13 -0
- package/dist/xyflow/edges/RelationshipsDropdownMenu.js +211 -0
- package/dist/xyflow/edges/edges.css.d.ts +17 -0
- package/dist/xyflow/edges/edges.css.js +37 -0
- package/dist/xyflow/edges/utils.d.ts +16 -0
- package/dist/xyflow/edges/utils.js +24 -0
- package/dist/xyflow/nodes/AnimateVariants.d.ts +1313 -0
- package/dist/xyflow/nodes/AnimateVariants.js +123 -0
- package/dist/xyflow/nodes/Node.css.d.ts +3 -0
- package/dist/xyflow/nodes/Node.css.js +9 -0
- package/dist/xyflow/nodes/compound/CompoundNode.css.d.ts +14 -0
- package/dist/xyflow/nodes/compound/CompoundNode.css.js +27 -0
- package/dist/xyflow/nodes/compound/CompoundNode.d.ts +6 -0
- package/dist/xyflow/nodes/compound/CompoundNode.js +216 -0
- package/dist/xyflow/nodes/compound/index.d.ts +1 -0
- package/dist/xyflow/nodes/element/ElementLink.css.d.ts +3 -0
- package/dist/xyflow/nodes/element/ElementLink.d.ts +6 -0
- package/dist/xyflow/nodes/element/ElementNode.d.ts +6 -0
- package/dist/xyflow/nodes/element/ElementNode.js +190 -0
- package/dist/xyflow/nodes/element/ElementShapeSvg.d.ts +17 -0
- package/dist/xyflow/nodes/element/ElementShapeSvg.js +175 -0
- package/dist/xyflow/nodes/element/element.css.d.ts +18 -0
- package/dist/xyflow/nodes/element/element.css.js +31 -0
- package/dist/xyflow/nodes/element/index.d.ts +1 -0
- package/dist/xyflow/nodes/shared/ElementIcon.d.ts +8 -0
- package/dist/xyflow/nodes/shared/ElementIcon.js +38 -0
- package/dist/xyflow/nodes/shared/Toolbar.d.ts +9 -0
- package/dist/xyflow/nodes/shared/Toolbar.js +436 -0
- package/dist/xyflow/types.d.ts +36 -0
- package/dist/xyflow/useLayoutConstraints.d.ts +42 -0
- package/dist/xyflow/useLayoutConstraints.js +226 -0
- package/dist/xyflow/useXYFlowEvents.d.ts +160 -0
- package/dist/xyflow/useXYFlowEvents.js +275 -0
- package/dist/xyflow/utils.d.ts +22 -0
- package/dist/xyflow/utils.js +72 -0
- package/package.json +34 -27
- package/src/LikeC4Diagram.tsx +4 -4
- package/src/LikeC4Search.css.ts +12 -0
- package/src/LikeC4Search.tsx +39 -90
- package/src/controls/Text.ts +5 -0
- package/src/controls/action-button-bar/ActionButtonBar.css.ts +13 -0
- package/src/controls/action-button-bar/ActionButtonBar.tsx +138 -0
- package/src/controls/action-button-bar/useActionButtonBarCtx.ts +13 -0
- package/src/controls/action-buttons/ActionButton.css.ts +29 -0
- package/src/controls/action-buttons/ActionButton.tsx +66 -0
- package/src/controls/action-buttons/ActionButtons.tsx +138 -0
- package/src/hooks/useXYFlow.ts +8 -8
- package/src/index.ts +12 -6
- package/src/likec4model/index.ts +12 -2
- package/src/overlays/edge-details/EdgeDetailsXYFlow.tsx +18 -12
- package/src/overlays/edge-details/_types.ts +13 -37
- package/src/overlays/edge-details/use-layouted-edge-details.ts +16 -14
- package/src/overlays/edge-details/xyflow/CompoundNode.tsx +3 -11
- package/src/overlays/edge-details/xyflow/ElementNode.tsx +4 -11
- package/src/overlays/edge-details/xyflow/RelationshipEdge.tsx +3 -3
- package/src/overlays/edge-details/xyflow/styles.css.ts +1 -59
- package/src/overlays/relationships-of/RelationshipsXYFlow.tsx +23 -23
- package/src/overlays/relationships-of/_types.ts +20 -58
- package/src/overlays/relationships-of/use-layouted-relationships.ts +36 -40
- package/src/overlays/relationships-of/xyflow/CompoundNode.tsx +9 -13
- package/src/overlays/relationships-of/xyflow/ElementNode.tsx +12 -15
- package/src/overlays/relationships-of/xyflow/EmptyNode.tsx +4 -7
- package/src/overlays/relationships-of/xyflow/RelationshipEdge.tsx +16 -14
- package/src/overlays/shared/xyflow/RelationshipEdge.css.ts +60 -0
- package/src/overlays/shared/xyflow/_types.ts +87 -0
- package/src/state/diagram-to-xyflow.ts +6 -7
- package/src/state/diagramStore.layout.ts +3 -4
- package/src/state/diagramStore.ts +35 -37
- package/src/theme-vars.css.ts +81 -0
- package/src/theme-vars.ts +8 -81
- package/src/ui/DiagramTitlePanel.tsx +6 -6
- package/src/utils/types.ts +6 -0
- package/src/xyflow/SelectEdgesOnNodeFocus.tsx +3 -3
- package/src/xyflow/XYFlow.tsx +2 -2
- package/src/xyflow/edges/EdgeLabel.tsx +25 -18
- package/src/xyflow/edges/RelationshipEdge.tsx +5 -3
- package/src/xyflow/edges/RelationshipsDropdownMenu.tsx +3 -3
- package/src/xyflow/edges/edges.css.ts +68 -74
- package/src/xyflow/edges/utils.ts +6 -6
- package/src/xyflow/nodes/AnimateVariants.ts +143 -0
- package/src/xyflow/nodes/Node.css.ts +44 -0
- package/src/xyflow/nodes/compound/CompoundNode.css.ts +1 -64
- package/src/xyflow/nodes/compound/CompoundNode.tsx +69 -182
- package/src/xyflow/nodes/element/ElementLink.tsx +2 -3
- package/src/xyflow/nodes/element/ElementNode.tsx +64 -266
- package/src/xyflow/nodes/element/element.css.ts +0 -57
- package/src/xyflow/nodes/shared/Toolbar.tsx +30 -30
- package/src/xyflow/types.ts +48 -51
- package/src/xyflow/useLayoutConstraints.ts +9 -9
- package/src/xyflow/useXYFlowEvents.ts +13 -30
- package/src/xyflow/utils.ts +2 -2
- package/src/xyflow/nodes/use-animate-variants.tsx +0 -64
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { nonexhaustive } from "@likec4/core";
|
|
3
|
+
import { toDomPrecision } from "../../utils.js";
|
|
4
|
+
import { fillMixStroke, fillElementFill } from "./element.css.js";
|
|
5
|
+
function cylinderSVGPath(diameter, height, tilt = 0.065) {
|
|
6
|
+
const radius = Math.round(diameter / 2);
|
|
7
|
+
const rx = radius;
|
|
8
|
+
const ry = toDomPrecision(tilt * radius);
|
|
9
|
+
const tiltAdjustedHeight = height - 2 * ry;
|
|
10
|
+
const path = ` M ${diameter},${ry}
|
|
11
|
+
a ${rx},${ry} 0,0,0 ${-diameter} 0
|
|
12
|
+
l 0,${tiltAdjustedHeight}
|
|
13
|
+
a ${rx},${ry} 0,0,0 ${diameter} 0
|
|
14
|
+
l 0,${-tiltAdjustedHeight}
|
|
15
|
+
z
|
|
16
|
+
`.replace(/\s+/g, " ").trim();
|
|
17
|
+
return {
|
|
18
|
+
path,
|
|
19
|
+
ry,
|
|
20
|
+
rx
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function queueSVGPath(width, height, tilt = 0.185) {
|
|
24
|
+
const diameter = height;
|
|
25
|
+
const radius = Math.round(diameter / 2);
|
|
26
|
+
const ry = radius;
|
|
27
|
+
const rx = toDomPrecision(diameter / 2 * tilt);
|
|
28
|
+
const tiltAdjustedWidth = width - 2 * rx;
|
|
29
|
+
const path = `
|
|
30
|
+
M ${rx},0
|
|
31
|
+
a ${rx},${ry} 0,0,0 0 ${diameter}
|
|
32
|
+
l ${tiltAdjustedWidth},0
|
|
33
|
+
a ${rx},${ry} 0,0,0 0 ${-diameter}
|
|
34
|
+
z`.replace(/\s+/g, " ").trim();
|
|
35
|
+
return {
|
|
36
|
+
path,
|
|
37
|
+
ry,
|
|
38
|
+
rx
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const PersonIcon = {
|
|
42
|
+
width: 115,
|
|
43
|
+
height: 120,
|
|
44
|
+
path: `M57.9197 0C10.9124 0 33.5766 54.75 33.5766 54.75C38.6131 62.25 45.3285 60.75 45.3285 66C45.3285 70.5 39.4526 72 33.5766 72.75C24.3431 72.75 15.9489 71.25 7.55474 84.75C2.51825 93 0 120 0 120H115C115 120 112.482 93 108.285 84.75C99.8905 70.5 91.4963 72.75 82.2628 72C76.3869 71.25 70.5109 69.75 70.5109 65.25C70.5109 60.75 77.2263 62.25 82.2628 54C82.2628 54.75 104.927 0 57.9197 0V0Z`
|
|
45
|
+
};
|
|
46
|
+
function ElementShapeSvg({ shape, w, h }) {
|
|
47
|
+
switch (shape) {
|
|
48
|
+
case "mobile": {
|
|
49
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
"rect",
|
|
52
|
+
{
|
|
53
|
+
width: w,
|
|
54
|
+
height: h,
|
|
55
|
+
rx: 6,
|
|
56
|
+
className: fillMixStroke,
|
|
57
|
+
strokeWidth: 0
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ jsxs("g", { className: fillElementFill, strokeWidth: 0, children: [
|
|
61
|
+
/* @__PURE__ */ jsx("circle", { cx: 17, cy: h / 2, r: 12 }),
|
|
62
|
+
/* @__PURE__ */ jsx("rect", { x: 33, y: 12, width: w - 44, height: h - 24, rx: 5 })
|
|
63
|
+
] })
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
case "browser": {
|
|
67
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
"rect",
|
|
70
|
+
{
|
|
71
|
+
width: w,
|
|
72
|
+
height: h,
|
|
73
|
+
rx: 6,
|
|
74
|
+
className: fillMixStroke,
|
|
75
|
+
strokeWidth: 0
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ jsxs("g", { className: fillElementFill, strokeWidth: 0, children: [
|
|
79
|
+
/* @__PURE__ */ jsx("circle", { cx: 16, cy: 17, r: 7 }),
|
|
80
|
+
/* @__PURE__ */ jsx("circle", { cx: 36, cy: 17, r: 7 }),
|
|
81
|
+
/* @__PURE__ */ jsx("circle", { cx: 56, cy: 17, r: 7 }),
|
|
82
|
+
/* @__PURE__ */ jsx("rect", { x: 70, y: 8, width: w - 80, height: 17, rx: 4 }),
|
|
83
|
+
/* @__PURE__ */ jsx("rect", { x: 10, y: 32, width: w - 20, height: h - 42, rx: 4 })
|
|
84
|
+
] })
|
|
85
|
+
] });
|
|
86
|
+
}
|
|
87
|
+
case "person": {
|
|
88
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
"rect",
|
|
91
|
+
{
|
|
92
|
+
width: w,
|
|
93
|
+
height: h,
|
|
94
|
+
rx: 6,
|
|
95
|
+
strokeWidth: 0
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
"svg",
|
|
100
|
+
{
|
|
101
|
+
x: w - PersonIcon.width - 6,
|
|
102
|
+
y: h - PersonIcon.height,
|
|
103
|
+
width: PersonIcon.width,
|
|
104
|
+
height: PersonIcon.height,
|
|
105
|
+
viewBox: `0 0 ${PersonIcon.width} ${PersonIcon.height}`,
|
|
106
|
+
className: fillMixStroke,
|
|
107
|
+
children: /* @__PURE__ */ jsx(
|
|
108
|
+
"path",
|
|
109
|
+
{
|
|
110
|
+
strokeWidth: 0,
|
|
111
|
+
d: PersonIcon.path
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] });
|
|
117
|
+
}
|
|
118
|
+
case "queue": {
|
|
119
|
+
const { path, rx, ry } = queueSVGPath(w, h);
|
|
120
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
121
|
+
/* @__PURE__ */ jsx("path", { d: path, strokeWidth: 2 }),
|
|
122
|
+
/* @__PURE__ */ jsx("ellipse", { cx: rx, cy: ry, ry: ry - 0.75, rx, className: fillMixStroke, strokeWidth: 2 })
|
|
123
|
+
] });
|
|
124
|
+
}
|
|
125
|
+
case "storage":
|
|
126
|
+
case "cylinder": {
|
|
127
|
+
const { path, rx, ry } = cylinderSVGPath(w, h);
|
|
128
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
129
|
+
/* @__PURE__ */ jsx("path", { d: path, strokeWidth: 2 }),
|
|
130
|
+
/* @__PURE__ */ jsx("ellipse", { cx: rx, cy: ry, ry, rx: rx - 0.75, className: fillMixStroke, strokeWidth: 2 })
|
|
131
|
+
] });
|
|
132
|
+
}
|
|
133
|
+
case "rectangle": {
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
"rect",
|
|
136
|
+
{
|
|
137
|
+
width: w,
|
|
138
|
+
height: h,
|
|
139
|
+
rx: 6,
|
|
140
|
+
strokeWidth: 0
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
default: {
|
|
145
|
+
return nonexhaustive(shape);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function SelectedIndicator({ shape, w, h }) {
|
|
150
|
+
switch (shape) {
|
|
151
|
+
case "queue":
|
|
152
|
+
return /* @__PURE__ */ jsx("path", { d: queueSVGPath(w, h).path });
|
|
153
|
+
case "storage":
|
|
154
|
+
case "cylinder": {
|
|
155
|
+
return /* @__PURE__ */ jsx("path", { d: cylinderSVGPath(w, h).path });
|
|
156
|
+
}
|
|
157
|
+
default: {
|
|
158
|
+
return /* @__PURE__ */ jsx(
|
|
159
|
+
"rect",
|
|
160
|
+
{
|
|
161
|
+
x: -1,
|
|
162
|
+
y: -1,
|
|
163
|
+
width: w + 2,
|
|
164
|
+
height: h + 2,
|
|
165
|
+
rx: 6
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
export {
|
|
172
|
+
ElementShapeSvg,
|
|
173
|
+
SelectedIndicator,
|
|
174
|
+
cylinderSVGPath
|
|
175
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const stokeFillMix: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
2
|
+
export declare const container: string;
|
|
3
|
+
export declare const handleCenter: string;
|
|
4
|
+
export declare const containerAnimated: string;
|
|
5
|
+
export declare const indicator: string;
|
|
6
|
+
export declare const fillElementFill: string;
|
|
7
|
+
export declare const fillElementStroke: string;
|
|
8
|
+
export declare const fillMixStroke: string;
|
|
9
|
+
export declare const hasIcon: string;
|
|
10
|
+
export declare const title: string;
|
|
11
|
+
export declare const description: string;
|
|
12
|
+
export declare const technology: string;
|
|
13
|
+
export declare const elementDataContainer: string;
|
|
14
|
+
export declare const elementTextData: string;
|
|
15
|
+
export declare const elementIcon: string;
|
|
16
|
+
export declare const shapeSvgMultiple: string;
|
|
17
|
+
export declare const shapeSvg: string;
|
|
18
|
+
export declare const bottomButtonsContainer: string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
var container = "_1b6tkn1";
|
|
3
|
+
var handleCenter = "_1b6tkn2";
|
|
4
|
+
var containerAnimated = "_1b6tkn3";
|
|
5
|
+
var indicator = "_1b6tkn6";
|
|
6
|
+
var fillElementFill = "_1b6tkn7";
|
|
7
|
+
var fillMixStroke = "_1b6tkn9";
|
|
8
|
+
var hasIcon = "_1b6tkna";
|
|
9
|
+
var title = "_1b6tknd";
|
|
10
|
+
var description = "_1b6tkne";
|
|
11
|
+
var technology = "_1b6tknf";
|
|
12
|
+
var elementDataContainer = "_1b6tkng";
|
|
13
|
+
var elementTextData = "_1b6tknh";
|
|
14
|
+
var elementIcon = "_1b6tkni";
|
|
15
|
+
var shapeSvg = "_1b6tknl";
|
|
16
|
+
export {
|
|
17
|
+
container,
|
|
18
|
+
containerAnimated,
|
|
19
|
+
description,
|
|
20
|
+
elementDataContainer,
|
|
21
|
+
elementIcon,
|
|
22
|
+
elementTextData,
|
|
23
|
+
fillElementFill,
|
|
24
|
+
fillMixStroke,
|
|
25
|
+
handleCenter,
|
|
26
|
+
hasIcon,
|
|
27
|
+
indicator,
|
|
28
|
+
shapeSvg,
|
|
29
|
+
technology,
|
|
30
|
+
title
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ElementNodeMemo as ElementNode } from './ElementNode';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DiagramNode } from '@likec4/core';
|
|
2
|
+
import { ElementIconRenderer } from '../../../LikeC4Diagram.props';
|
|
3
|
+
export declare const ElementIcon: ({ element, viewId, className, renderIcon: RenderIcon }: {
|
|
4
|
+
element: DiagramNode;
|
|
5
|
+
viewId: string;
|
|
6
|
+
className: string;
|
|
7
|
+
renderIcon: ElementIconRenderer | null;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { m } from "framer-motion";
|
|
4
|
+
const ElementIcon = ({
|
|
5
|
+
element,
|
|
6
|
+
viewId,
|
|
7
|
+
className,
|
|
8
|
+
renderIcon: RenderIcon
|
|
9
|
+
}) => {
|
|
10
|
+
if (!element.icon || element.icon === "none") {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
let icon = null;
|
|
14
|
+
if (element.icon.startsWith("http://") || element.icon.startsWith("https://")) {
|
|
15
|
+
icon = /* @__PURE__ */ jsx("img", { src: element.icon, alt: element.title });
|
|
16
|
+
} else if (RenderIcon) {
|
|
17
|
+
icon = /* @__PURE__ */ jsx(RenderIcon, { node: element });
|
|
18
|
+
}
|
|
19
|
+
if (!icon) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
m.div,
|
|
24
|
+
{
|
|
25
|
+
layoutId: `${viewId}:element:icon:${element.id}`,
|
|
26
|
+
className: clsx(
|
|
27
|
+
className,
|
|
28
|
+
"likec4-element-icon"
|
|
29
|
+
),
|
|
30
|
+
"data-likec4-icon": element.icon,
|
|
31
|
+
children: icon
|
|
32
|
+
},
|
|
33
|
+
`${viewId}:element:icon:${element.id}`
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
ElementIcon
|
|
38
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ThemeColor, DiagramNode } from '@likec4/core';
|
|
2
|
+
import { NodeToolbarProps } from '@xyflow/react';
|
|
3
|
+
type ToolbarProps = NodeToolbarProps & {
|
|
4
|
+
element: DiagramNode;
|
|
5
|
+
onColorPreview: (color: ThemeColor | null) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function CompoundToolbar({ element, onColorPreview, ...props }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function ElementToolbar({ element, onColorPreview, ...props }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|