@likec4/diagram 1.59.3 → 1.59.4
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/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +36 -21
- package/dist/LikeC4Diagram.props.d.ts +23 -0
- package/dist/LikeC4MantineProvider.d.ts +24 -0
- package/dist/LikeC4MantineProvider.js +156 -0
- package/dist/LikeC4ProjectsOverview.js +1 -1
- package/dist/LikeC4ProjectsProvider.d.ts +17 -2
- package/dist/LikeC4Styles.d.ts +13 -3
- package/dist/LikeC4Styles.js +8 -5
- package/dist/LikeC4View.js +2 -2
- package/dist/StaticLikeC4Diagram.d.ts +1 -1
- package/dist/base/BaseXYFlow.d.ts +1 -1
- package/dist/base/BaseXYFlow.js +11 -8
- package/dist/base/const.d.ts +1 -0
- package/dist/base/const.js +3 -1
- package/dist/base-primitives/Markdown.d.ts +3 -3
- package/dist/base-primitives/compound/actionbtns.css.d.ts +3 -3
- package/dist/base-primitives/compound/actionbtns.css.js +3 -3
- package/dist/base-primitives/element/ElementTags.d.ts +2 -2
- package/dist/base-primitives/element/ElementTags.js +5 -5
- package/dist/components/EmptyBox.d.ts +3 -0
- package/dist/components/EmptyBox.js +9 -0
- package/dist/components/ErrorFallback.js +7 -6
- package/dist/components/FloatingWindow.d.ts +18 -0
- package/dist/components/FloatingWindow.js +89 -0
- package/dist/components/Link.js +7 -7
- package/dist/components/NavigationPanel.d.ts +2 -2
- package/dist/components/NavigationPanel.js +5 -6
- package/dist/components/SearchControl.css.js +10 -12
- package/dist/components/ViewIcon.d.ts +11 -0
- package/dist/components/ViewIcon.js +71 -0
- package/dist/context/DiagramEventHandlers.js +2 -1
- package/dist/context/EnsureMantine.js +3 -3
- package/dist/context/IconRenderer.d.ts +2 -1
- package/dist/context/IconRenderer.js +38 -2
- package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
- package/dist/context/TagStylesContext.d.ts +9 -3
- package/dist/context/TagStylesContext.js +19 -19
- package/dist/custom/index.d.ts +3 -0
- package/dist/custom/index.js +6 -3
- package/dist/editor/applyChangesToManualLayout.js +4 -1
- package/dist/hooks/safeContext.d.ts +12 -4
- package/dist/hooks/safeContext.js +2 -2
- package/dist/hooks/useCurrentView.js +5 -5
- package/dist/hooks/useDiagram.js +1 -23
- package/dist/hooks/useDiagramCompareLayout.d.ts +4 -4
- package/dist/hooks/useDiagramCompareLayout.js +14 -16
- package/dist/hooks/useEditorActor.js +3 -5
- package/dist/hooks/useLikeC4Model.js +8 -3
- package/dist/hooks/useLikeC4Project.d.ts +4 -3
- package/dist/hooks/useOverlaysActor.d.ts +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +6 -5
- package/dist/likec4diagram/DiagramXYFlow.d.ts +5 -0
- package/dist/likec4diagram/DiagramXYFlow.js +20 -13
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +4 -4
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +1 -1
- package/dist/likec4diagram/custom/edges/edges.css.js +13 -13
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +2 -2
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +4 -4
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +2 -2
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +8 -5
- package/dist/likec4diagram/custom/nodes/nodes.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +5 -5
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +2 -0
- package/dist/likec4diagram/relationship-popover/components.d.ts +1 -1
- package/dist/likec4diagram/relationship-popover/components.js +6 -2
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +7 -2
- package/dist/likec4diagram/state/DiagramActorProvider.js +20 -4
- package/dist/likec4diagram/state/diagram-api.d.ts +2 -2
- package/dist/likec4diagram/state/diagram-api.js +3 -2
- package/dist/likec4diagram/state/machine.actions.js +9 -6
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +1 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +7 -5
- package/dist/likec4diagram/state/machine.setup.d.ts +10 -1
- package/dist/likec4diagram/state/machine.setup.js +6 -1
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +2 -26
- package/dist/likec4diagram/state/machine.state.initializing.js +9 -6
- package/dist/likec4diagram/state/machine.state.navigating.js +1 -1
- package/dist/likec4diagram/state/machine.state.ready.d.ts +134 -3
- package/dist/likec4diagram/state/machine.state.ready.js +2 -1
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +106 -1
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +39 -6
- package/dist/likec4diagram/state/utils.d.ts +1 -1
- package/dist/likec4diagram/state/utils.js +1 -2
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +16 -10
- package/dist/likec4diagram/ui/index.d.ts +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +13 -15
- package/dist/likec4diagram/ui/notation/NotationPanel.js +9 -9
- package/dist/likec4diagram/ui/sequence-outline/ActiveTrail.d.ts +9 -0
- package/dist/likec4diagram/ui/sequence-outline/ActiveTrail.js +81 -0
- package/dist/likec4diagram/ui/sequence-outline/FlowRow.d.ts +11 -0
- package/dist/likec4diagram/ui/sequence-outline/FlowRow.js +70 -0
- package/dist/likec4diagram/ui/sequence-outline/OutlineBody.d.ts +2 -0
- package/dist/likec4diagram/ui/sequence-outline/OutlineBody.js +106 -0
- package/dist/likec4diagram/ui/sequence-outline/OutlineHeader.d.ts +2 -0
- package/dist/likec4diagram/ui/sequence-outline/OutlineHeader.js +140 -0
- package/dist/likec4diagram/ui/sequence-outline/OutlineNodes.d.ts +17 -0
- package/dist/likec4diagram/ui/sequence-outline/OutlineNodes.js +83 -0
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +4 -0
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +49 -527
- package/dist/likec4diagram/ui/sequence-outline/StepBadge.d.ts +8 -0
- package/dist/likec4diagram/ui/sequence-outline/StepBadge.js +52 -0
- package/dist/likec4diagram/ui/sequence-outline/StepRow.d.ts +7 -0
- package/dist/likec4diagram/ui/sequence-outline/StepRow.js +190 -0
- package/dist/likec4diagram/ui/sequence-outline/StoreProvider.d.ts +238 -0
- package/dist/likec4diagram/ui/sequence-outline/StoreProvider.js +94 -0
- package/dist/likec4diagram/ui/sequence-outline/depth-of-field.d.ts +21 -0
- package/dist/likec4diagram/ui/sequence-outline/depth-of-field.js +71 -0
- package/dist/likec4diagram/ui/sequence-outline/index.d.ts +2 -0
- package/dist/likec4diagram/ui/sequence-outline/motion.d.ts +13 -0
- package/dist/likec4diagram/ui/sequence-outline/motion.js +21 -0
- package/dist/likec4diagram/ui/sequence-outline/presentation.d.ts +10 -0
- package/dist/likec4diagram/ui/sequence-outline/presentation.js +80 -0
- package/dist/likec4diagram/ui/sequence-outline/tree.d.ts +9 -0
- package/dist/likec4diagram/ui/sequence-outline/tree.js +67 -0
- package/dist/likec4diagram/ui/sequence-outline/{state.d.ts → types.d.ts} +4 -2
- package/dist/likec4diagram/ui/sequence-outline/types.js +12 -0
- package/dist/likec4diagram/useLayoutConstraints.js +9 -12
- package/dist/likec4diagram/xyflow-sequence/sequence-view-to-xy.js +1 -0
- package/dist/likec4diagram/xyflow-sequence/utils.js +0 -1
- package/dist/navigationpanel/NavigationPanel.js +45 -41
- package/dist/navigationpanel/NavigationPanelControls.js +102 -63
- package/dist/navigationpanel/NavigationPanelDropdown.js +51 -77
- package/dist/navigationpanel/_common.d.ts +6 -6
- package/dist/navigationpanel/_common.js +31 -42
- package/dist/navigationpanel/actor.actions.js +6 -5
- package/dist/navigationpanel/actor.js +2 -2
- package/dist/navigationpanel/actor.setup.d.ts +6 -6
- package/dist/navigationpanel/actor.setup.js +2 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -4
- package/dist/navigationpanel/comparepanel/ComparePanel.js +8 -10
- package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +11 -9
- package/dist/navigationpanel/controls/LayoutWarning.js +69 -72
- package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -1
- package/dist/navigationpanel/controls/NavigationButtons.js +8 -8
- package/dist/navigationpanel/controls/OpenSource.d.ts +1 -1
- package/dist/navigationpanel/controls/OpenSource.js +5 -8
- package/dist/navigationpanel/controls/SearchControl.js +24 -9
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +4 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +56 -76
- package/dist/navigationpanel/controls/ViewDetailsButton.d.ts +5 -0
- package/dist/navigationpanel/controls/ViewDetailsButton.js +121 -0
- package/dist/navigationpanel/controls/index.d.ts +1 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +27 -16
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +10 -9
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -8
- package/dist/navigationpanel/editorpanel/styles.js +8 -15
- package/dist/navigationpanel/hooks.d.ts +6 -2
- package/dist/navigationpanel/styles.css.d.ts +2 -2
- package/dist/navigationpanel/styles.css.js +0 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -2
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +5 -4
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +9 -36
- package/dist/navigationpanel/walkthrough/DynamicViewModeSwitcher.d.ts +1 -0
- package/dist/navigationpanel/walkthrough/DynamicViewModeSwitcher.js +49 -0
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +8 -8
- package/dist/navigationpanel/windows/ViewDetailsWindow.d.ts +1 -0
- package/dist/navigationpanel/windows/ViewDetailsWindow.js +379 -0
- package/dist/overlays/Overlays.js +29 -17
- package/dist/overlays/element-details/ElementDetailsCard.css.js +28 -36
- package/dist/overlays/element-details/ElementDetailsCard.js +1 -1
- package/dist/overlays/element-details/MetadataValue.js +18 -16
- package/dist/overlays/element-details/TabPanelDeployments.css.js +6 -14
- package/dist/overlays/element-details/TabPanelRelationships.css.js +8 -12
- package/dist/overlays/element-details/TabPanelStructure.css.js +4 -8
- package/dist/overlays/hooks.d.ts +3 -1
- package/dist/overlays/overlay/Overlay.js +8 -7
- package/dist/overlays/overlaysActor.js +4 -0
- package/dist/overlays/relationship-details/SelectEdge.css.js +14 -9
- package/dist/overlays/relationship-details/actor.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +6 -0
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +11 -6
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -8
- package/dist/overlays/relationships-browser/SelectElement.js +5 -1
- package/dist/overlays/relationships-browser/actor.js +1 -1
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +7 -9
- package/dist/projects-overview/actor.js +1 -1
- package/dist/search/Search.js +9 -7
- package/dist/search/components/ElementsColumn.css.js +6 -5
- package/dist/search/components/ElementsColumn.js +4 -3
- package/dist/search/components/SearchByTags.js +3 -3
- package/dist/search/components/ViewsColum.js +36 -35
- package/dist/search/components/ViewsColumn.css.js +4 -4
- package/dist/search/components/_shared.css.d.ts +2 -2
- package/dist/search/components/_shared.css.js +31 -46
- package/dist/search/components/styles.css.js +4 -4
- package/dist/shadowroot/ShadowRoot.js +2 -3
- package/dist/styles2.js +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +10 -10
- package/panda.buildinfo.json +340 -298
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/context/DefaultMantineProvider.d.ts +0 -2
- package/dist/context/DefaultMantineProvider.js +0 -48
- package/dist/likec4diagram/ui/sequence-outline/state.js +0 -55
- package/dist/navigationpanel/controls/DetailsControls.d.ts +0 -2
- package/dist/navigationpanel/controls/DetailsControls.js +0 -224
|
@@ -4,7 +4,7 @@ import { css } from "@likec4/styles/css";
|
|
|
4
4
|
import { IconChevronDown } from "@tabler/icons-react";
|
|
5
5
|
import { memo } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { Button, Menu, MenuDropdown, MenuItem, MenuTarget } from "@mantine/core";
|
|
7
|
+
import { Button, Menu, MenuDropdown, MenuItem, MenuTarget, ScrollArea } from "@mantine/core";
|
|
8
8
|
import { Box as Box$1, HStack } from "@likec4/styles/jsx";
|
|
9
9
|
//#region src/navigationpanel/dropdown/ProjectsMenu.tsx
|
|
10
10
|
var ProjectsMenu = memo((_) => {
|
|
@@ -18,13 +18,13 @@ var ProjectsMenu = memo((_) => {
|
|
|
18
18
|
function WithProjectsMenu({ projects, onProjectChange }) {
|
|
19
19
|
const projectId = useLikeC4ProjectId();
|
|
20
20
|
return /* @__PURE__ */ jsxs(HStack, {
|
|
21
|
-
gap: "
|
|
21
|
+
gap: "1",
|
|
22
22
|
alignItems: "baseline",
|
|
23
23
|
children: [/* @__PURE__ */ jsx(Box$1, {
|
|
24
24
|
css: {
|
|
25
25
|
fontWeight: "normal",
|
|
26
26
|
fontSize: "xxs",
|
|
27
|
-
color: "
|
|
27
|
+
color: "text.dimmed",
|
|
28
28
|
userSelect: "none"
|
|
29
29
|
},
|
|
30
30
|
children: "Project"
|
|
@@ -32,20 +32,28 @@ function WithProjectsMenu({ projects, onProjectChange }) {
|
|
|
32
32
|
withinPortal: false,
|
|
33
33
|
shadow: "md",
|
|
34
34
|
position: "bottom-start",
|
|
35
|
-
|
|
35
|
+
classNames: { itemLabel: css({
|
|
36
|
+
fontSize: "xs",
|
|
37
|
+
truncate: true,
|
|
38
|
+
maxWidth: "[250px]"
|
|
39
|
+
}) },
|
|
40
|
+
offset: { mainAxis: 3 },
|
|
36
41
|
children: [/* @__PURE__ */ jsx(MenuTarget, { children: /* @__PURE__ */ jsx(Button, {
|
|
37
42
|
tabIndex: -1,
|
|
38
43
|
autoFocus: false,
|
|
39
44
|
variant: "subtle",
|
|
40
45
|
size: "compact-xs",
|
|
41
46
|
color: "gray",
|
|
47
|
+
radius: "sm",
|
|
48
|
+
maw: 300,
|
|
42
49
|
classNames: {
|
|
43
50
|
root: css({
|
|
44
51
|
fontWeight: "normal",
|
|
45
52
|
fontSize: "xxs",
|
|
46
53
|
height: "auto",
|
|
47
|
-
lineHeight:
|
|
48
|
-
|
|
54
|
+
lineHeight: "tight",
|
|
55
|
+
px: "1",
|
|
56
|
+
py: "0.5"
|
|
49
57
|
}),
|
|
50
58
|
section: css({ "&:is([data-position=\"right\"])": { marginInlineStart: "1" } })
|
|
51
59
|
},
|
|
@@ -55,16 +63,19 @@ function WithProjectsMenu({ projects, onProjectChange }) {
|
|
|
55
63
|
stroke: 1.5
|
|
56
64
|
}),
|
|
57
65
|
children: projectId
|
|
58
|
-
}) }), /* @__PURE__ */ jsx(MenuDropdown, { children:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
}) }), /* @__PURE__ */ jsx(MenuDropdown, { children: /* @__PURE__ */ jsx(ScrollArea.Autosize, {
|
|
67
|
+
mah: "calc(100cqh - 200px)",
|
|
68
|
+
children: projects.map(({ id, title }) => /* @__PURE__ */ jsx(MenuItem, {
|
|
69
|
+
onClick: (e) => {
|
|
70
|
+
if (projectId === id) {
|
|
71
|
+
e.stopPropagation();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
onProjectChange(id);
|
|
75
|
+
},
|
|
76
|
+
children: title ?? id
|
|
77
|
+
}, id))
|
|
78
|
+
}) })]
|
|
68
79
|
})]
|
|
69
80
|
});
|
|
70
81
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { useDiagram } from "../../hooks/safeContext.js";
|
|
3
|
-
import {
|
|
2
|
+
import { selectDiagramContext, useDiagram, useDiagramSelector } from "../../hooks/safeContext.js";
|
|
3
|
+
import { useMantinePortalProps } from "../../hooks/useMantinePortalProps.js";
|
|
4
4
|
import { PanelActionIcon } from "../_common.js";
|
|
5
5
|
import { Tooltip as Tooltip$1 } from "./_common.js";
|
|
6
6
|
import { autolayoutButton, autolayoutIndicator, spacingSliderBody, spacingSliderThumb } from "./styles.js";
|
|
@@ -8,19 +8,21 @@ import { IconLayoutDashboard } from "@tabler/icons-react";
|
|
|
8
8
|
import { forwardRef, useState } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { useDebouncedCallback } from "@react-hookz/web";
|
|
11
|
+
import { deepEqual } from "fast-equals";
|
|
11
12
|
import { Box, Flex, FloatingIndicator, Popover, PopoverDropdown, PopoverTarget, Text, UnstyledButton } from "@mantine/core";
|
|
12
13
|
import { clampUseMovePosition, useHover, useMergedRef, useMove, useUncontrolled } from "@mantine/hooks";
|
|
13
14
|
//#region src/navigationpanel/editorpanel/ChangeAutoLayoutButton.tsx
|
|
14
|
-
var selector = (state) => ({
|
|
15
|
+
var selector = selectDiagramContext((state) => ({
|
|
15
16
|
viewId: state.view.id,
|
|
16
17
|
isManualLayout: state.view._layout === "manual",
|
|
17
18
|
autoLayout: state.view.autoLayout
|
|
18
|
-
});
|
|
19
|
+
}), deepEqual);
|
|
19
20
|
var ChangeAutoLayoutButton = () => {
|
|
20
21
|
const diagram = useDiagram();
|
|
21
22
|
const [rootRef, setRootRef] = useState(null);
|
|
22
23
|
const [controlsRefs, setControlsRefs] = useState({});
|
|
23
|
-
const { autoLayout, viewId, isManualLayout } =
|
|
24
|
+
const { autoLayout, viewId, isManualLayout } = useDiagramSelector(selector);
|
|
25
|
+
const portalProps = useMantinePortalProps();
|
|
24
26
|
const { ref, hovered: isSpacingHovered } = useHover();
|
|
25
27
|
const setControlRef = (name) => (node) => {
|
|
26
28
|
controlsRefs[name] = node;
|
|
@@ -52,12 +54,11 @@ var ChangeAutoLayoutButton = () => {
|
|
|
52
54
|
return /* @__PURE__ */ jsxs(Popover, {
|
|
53
55
|
position: "right-start",
|
|
54
56
|
clickOutsideEvents: ["pointerdown"],
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
offset: { mainAxis: 10 },
|
|
57
|
+
offset: { mainAxis: 12 },
|
|
58
|
+
...portalProps,
|
|
58
59
|
children: [/* @__PURE__ */ jsx(PopoverTarget, { children: /* @__PURE__ */ jsx(Tooltip$1, {
|
|
59
60
|
label: "Change Auto Layout",
|
|
60
|
-
children: /* @__PURE__ */ jsx(PanelActionIcon, { children: /* @__PURE__ */ jsx(IconLayoutDashboard, {}) })
|
|
61
|
+
children: /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(PanelActionIcon, { children: /* @__PURE__ */ jsx(IconLayoutDashboard, {}) }) })
|
|
61
62
|
}) }), /* @__PURE__ */ jsx(PopoverDropdown, {
|
|
62
63
|
className: "likec4-top-left-panel",
|
|
63
64
|
p: 8,
|
|
@@ -7,7 +7,9 @@ import { css } from "@likec4/styles/css";
|
|
|
7
7
|
import { IconLayoutAlignBottom, IconLayoutAlignCenter, IconLayoutAlignLeft, IconLayoutAlignMiddle, IconLayoutAlignRight, IconLayoutAlignTop, IconLayoutBoardSplit, IconLayoutCollage, IconRouteOff } from "@tabler/icons-react";
|
|
8
8
|
import { memo, useState } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { Popover, PopoverDropdown, PopoverTarget
|
|
10
|
+
import { Popover, PopoverDropdown, PopoverTarget } from "@mantine/core";
|
|
11
|
+
import "@mantine/hooks";
|
|
12
|
+
import { Box as Box$1 } from "@likec4/styles/jsx";
|
|
11
13
|
import { hstack } from "@likec4/styles/patterns";
|
|
12
14
|
//#region src/navigationpanel/editorpanel/ManualLayoutToolsButton.tsx
|
|
13
15
|
var Action = ({ label, icon, onClick }) => /* @__PURE__ */ jsx(Tooltip$1, {
|
|
@@ -18,8 +20,8 @@ var Action = ({ label, icon, onClick }) => /* @__PURE__ */ jsx(Tooltip$1, {
|
|
|
18
20
|
classNames: {
|
|
19
21
|
root: "action-icon",
|
|
20
22
|
icon: css({ "& > svg": {
|
|
21
|
-
width: "70%",
|
|
22
|
-
height: "70%"
|
|
23
|
+
width: "[70%]",
|
|
24
|
+
height: "[70%]"
|
|
23
25
|
} })
|
|
24
26
|
},
|
|
25
27
|
onClick,
|
|
@@ -34,7 +36,6 @@ var ManualLayoutToolsButton = memo(() => {
|
|
|
34
36
|
const portalProps = useMantinePortalProps();
|
|
35
37
|
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
36
38
|
return /* @__PURE__ */ jsxs(Popover, {
|
|
37
|
-
opened: isPopoverOpen,
|
|
38
39
|
onChange: setIsPopoverOpen,
|
|
39
40
|
position: "right",
|
|
40
41
|
offset: { mainAxis: 12 },
|
|
@@ -43,15 +44,15 @@ var ManualLayoutToolsButton = memo(() => {
|
|
|
43
44
|
children: [/* @__PURE__ */ jsx(PopoverTarget, { children: /* @__PURE__ */ jsx(Tooltip$1, {
|
|
44
45
|
label: "Manual layouting tools",
|
|
45
46
|
...manualLayoutTooltipProps(isPopoverOpen),
|
|
46
|
-
children: /* @__PURE__ */ jsx(PanelActionIcon, { children: /* @__PURE__ */ jsx(IconLayoutCollage, {}) })
|
|
47
|
-
}) }), /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ jsx(Box$1, { children: /* @__PURE__ */ jsx(PanelActionIcon, { children: /* @__PURE__ */ jsx(IconLayoutCollage, {}) }) })
|
|
48
|
+
}) }), /* @__PURE__ */ jsxs(PopoverDropdown, {
|
|
48
49
|
className: hstack({
|
|
49
50
|
gap: "0.5",
|
|
50
51
|
layerStyle: "likec4.panel",
|
|
51
52
|
padding: "1",
|
|
52
53
|
pointerEvents: "all"
|
|
53
54
|
}),
|
|
54
|
-
children:
|
|
55
|
+
children: [
|
|
55
56
|
/* @__PURE__ */ jsx(Action, {
|
|
56
57
|
label: "Align in columns",
|
|
57
58
|
icon: /* @__PURE__ */ jsx(IconLayoutBoardSplit, {}),
|
|
@@ -124,7 +125,7 @@ var ManualLayoutToolsButton = memo(() => {
|
|
|
124
125
|
diagram.resetEdgeControlPoints();
|
|
125
126
|
}
|
|
126
127
|
})
|
|
127
|
-
]
|
|
128
|
+
]
|
|
128
129
|
})]
|
|
129
130
|
});
|
|
130
131
|
});
|
|
@@ -10,32 +10,26 @@ css({
|
|
|
10
10
|
pointerEvents: "none",
|
|
11
11
|
"& :where(button, .action-icon, [role='dialog'])": { pointerEvents: "all" },
|
|
12
12
|
["& .action-icon"]: { ["--ai-size"]: "2rem" },
|
|
13
|
-
["& .tabler-icon"]: {
|
|
14
|
-
width: "65%",
|
|
15
|
-
height: "65%"
|
|
16
|
-
},
|
|
13
|
+
["& .tabler-icon"]: { boxSize: "[65%]" },
|
|
17
14
|
_reduceGraphics: { "& .action-icon": { "--ai-radius": "0px" } }
|
|
18
15
|
});
|
|
19
16
|
css({ shadow: {
|
|
20
17
|
base: "md",
|
|
21
18
|
_whenPanning: "none"
|
|
22
19
|
} });
|
|
23
|
-
css({ ["& .tabler-icon"]: {
|
|
24
|
-
width: "65%",
|
|
25
|
-
height: "65%"
|
|
26
|
-
} });
|
|
20
|
+
css({ ["& .tabler-icon"]: { boxSize: "[65%]" } });
|
|
27
21
|
var autolayoutButton = css({
|
|
28
|
-
flex: "1 1 40%",
|
|
22
|
+
flex: "[1 1 40%]",
|
|
29
23
|
textAlign: "center",
|
|
30
24
|
fontWeight: "medium",
|
|
31
25
|
padding: "[4px 6px]",
|
|
32
|
-
fontSize: "11px",
|
|
33
|
-
zIndex:
|
|
26
|
+
fontSize: "[11px]",
|
|
27
|
+
zIndex: "base"
|
|
34
28
|
});
|
|
35
29
|
var autolayoutIndicator = css({
|
|
36
30
|
background: "mantine.gray[2]",
|
|
37
31
|
borderRadius: "sm",
|
|
38
|
-
border: `
|
|
32
|
+
border: `default`,
|
|
39
33
|
borderColor: "mantine.gray[4]",
|
|
40
34
|
_dark: {
|
|
41
35
|
background: "mantine.dark[5]",
|
|
@@ -51,9 +45,8 @@ var spacingSliderBody = css({
|
|
|
51
45
|
});
|
|
52
46
|
var spacingSliderThumb = css({
|
|
53
47
|
position: "absolute",
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
border: `2px solid`,
|
|
48
|
+
boxSize: "[8px]",
|
|
49
|
+
border: `strong`,
|
|
57
50
|
borderColor: "mantine.gray[5]",
|
|
58
51
|
borderRadius: "sm",
|
|
59
52
|
transform: "translate(-50%, -50%)"
|
|
@@ -5,11 +5,15 @@ import { Context } from './actor.setup';
|
|
|
5
5
|
import { MachineSnapshot } from 'xstate';
|
|
6
6
|
export declare const NavigationPanelActorContextProvider: Provider<NavigationPanelActorRef>, selectNavigationContext: <T>(select: (state: Context) => T, compare?: ((old: NoInfer<T>, next: NoInfer<T>) => boolean) | undefined) => [selector: (snapshot: MachineSnapshot<Context, NavigationPanelActorEvent, any, "pending" | "idle" | "active" | {
|
|
7
7
|
active?: NonNullable<"search" | "opened" | "decide" | "closing">;
|
|
8
|
-
}, "active", any, any, any>) => T, compare: (a: T, b: T) => boolean]
|
|
8
|
+
}, "active", any, any, any>) => T, compare: (a: T, b: T) => boolean] & {
|
|
9
|
+
Out: T;
|
|
10
|
+
}, selectNavigationSnapshot: <T>(select: (state: MachineSnapshot<Context, NavigationPanelActorEvent, any, "pending" | "idle" | "active" | {
|
|
9
11
|
active?: NonNullable<"search" | "opened" | "decide" | "closing">;
|
|
10
12
|
}, "active", any, any, any>) => T, compare?: ((old: NoInfer<T>, next: NoInfer<T>) => boolean) | undefined) => [selector: (snapshot: MachineSnapshot<Context, NavigationPanelActorEvent, any, "pending" | "idle" | "active" | {
|
|
11
13
|
active?: NonNullable<"search" | "opened" | "decide" | "closing">;
|
|
12
|
-
}, "active", any, any, any>) => T, compare: (a: T, b: T) => boolean]
|
|
14
|
+
}, "active", any, any, any>) => T, compare: (a: T, b: T) => boolean] & {
|
|
15
|
+
Out: T;
|
|
16
|
+
}, useNavigationActorRef: () => NavigationPanelActorRef, useNavigationActorSelector: {
|
|
13
17
|
<T>(select: (state: MachineSnapshot<Context, NavigationPanelActorEvent, any, "pending" | "idle" | "active" | {
|
|
14
18
|
active?: NonNullable<"search" | "opened" | "decide" | "closing">;
|
|
15
19
|
}, "active", any, any, any>) => T): T;
|
|
@@ -32,10 +32,11 @@ var ParallelFrame = () => {
|
|
|
32
32
|
left: "0",
|
|
33
33
|
width: "100%",
|
|
34
34
|
height: "100%",
|
|
35
|
-
|
|
35
|
+
borderWidth: "strong",
|
|
36
|
+
borderStyle: "solid",
|
|
36
37
|
borderColor: "likec4.walkthrough.parallelFrame",
|
|
37
38
|
pointerEvents: "none",
|
|
38
|
-
md: { borderWidth: "
|
|
39
|
+
md: { borderWidth: "extra" }
|
|
39
40
|
} })
|
|
40
41
|
});
|
|
41
42
|
};
|
|
@@ -3,6 +3,7 @@ import { ForwardRefExoticComponent, Key, AriaRole, ClipboardEventHandler, Compos
|
|
|
3
3
|
import { MotionProps } from 'motion/react';
|
|
4
4
|
export declare const TriggerWalkthroughButton: ForwardRefExoticComponent<Omit<ButtonProps & {
|
|
5
5
|
key?: Key | null | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
6
7
|
color?: string | undefined;
|
|
7
8
|
content?: string | undefined;
|
|
8
9
|
translate?: "yes" | "no" | undefined;
|
|
@@ -188,7 +189,7 @@ export declare const TriggerWalkthroughButton: ForwardRefExoticComponent<Omit<Bu
|
|
|
188
189
|
suppressContentEditableWarning?: boolean | undefined;
|
|
189
190
|
suppressHydrationWarning?: boolean | undefined;
|
|
190
191
|
accessKey?: string | undefined;
|
|
191
|
-
autoCapitalize?: (string & {}) | "
|
|
192
|
+
autoCapitalize?: "none" | (string & {}) | "on" | "off" | "sentences" | "words" | "characters" | undefined;
|
|
192
193
|
autoFocus?: boolean | undefined;
|
|
193
194
|
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
|
|
194
195
|
contextMenu?: string | undefined;
|
|
@@ -229,7 +230,7 @@ export declare const TriggerWalkthroughButton: ForwardRefExoticComponent<Omit<Bu
|
|
|
229
230
|
part?: string | undefined;
|
|
230
231
|
"aria-activedescendant"?: string | undefined;
|
|
231
232
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
232
|
-
"aria-autocomplete"?: "
|
|
233
|
+
"aria-autocomplete"?: "none" | "list" | "inline" | "both" | undefined;
|
|
233
234
|
"aria-braillelabel"?: string | undefined;
|
|
234
235
|
"aria-brailleroledescription"?: string | undefined;
|
|
235
236
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -265,7 +266,7 @@ export declare const TriggerWalkthroughButton: ForwardRefExoticComponent<Omit<Bu
|
|
|
265
266
|
"aria-posinset"?: number | undefined;
|
|
266
267
|
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
267
268
|
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
268
|
-
"aria-relevant"?: "
|
|
269
|
+
"aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
269
270
|
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
270
271
|
"aria-roledescription"?: string | undefined;
|
|
271
272
|
"aria-rowcount"?: number | undefined;
|
|
@@ -282,11 +283,11 @@ export declare const TriggerWalkthroughButton: ForwardRefExoticComponent<Omit<Bu
|
|
|
282
283
|
name?: string | undefined;
|
|
283
284
|
value?: string | number | readonly string[] | undefined;
|
|
284
285
|
ref?: Ref<HTMLButtonElement> | undefined;
|
|
285
|
-
disabled?: boolean | undefined;
|
|
286
286
|
formAction?: string | ((formData: FormData) => void | Promise<void>) | undefined;
|
|
287
287
|
formEncType?: string | undefined;
|
|
288
288
|
formMethod?: string | undefined;
|
|
289
289
|
formNoValidate?: boolean | undefined;
|
|
290
290
|
formTarget?: string | undefined;
|
|
291
291
|
} & MotionProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
292
|
+
export declare function StartWalkthroughButton(): import("react").JSX.Element;
|
|
292
293
|
export declare function DynamicViewControls(): import("react").JSX.Element;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { useEnabledFeatures } from "../../context/DiagramFeatures.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useDiagram } from "../../hooks/safeContext.js";
|
|
4
4
|
import { Tooltip as Tooltip$1 } from "../_common.js";
|
|
5
5
|
import { useNavigationActor } from "../hooks.js";
|
|
6
|
+
import { DynamicViewModeSwitcher } from "./DynamicViewModeSwitcher.js";
|
|
6
7
|
import { css } from "@likec4/styles/css";
|
|
7
8
|
import { IconPlayerPlayFilled } from "@tabler/icons-react";
|
|
8
9
|
import { forwardRef } from "react";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import
|
|
11
|
-
import { Button
|
|
12
|
-
import
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import "@likec4/core";
|
|
12
|
+
import { Button } from "@mantine/core";
|
|
13
|
+
import "motion/react";
|
|
13
14
|
import * as m$1 from "motion/react-m";
|
|
14
15
|
//#region src/navigationpanel/walkthrough/DynamicViewControls.tsx
|
|
15
16
|
var TriggerWalkthroughButton = forwardRef((props, ref) => /* @__PURE__ */ jsx(Button, {
|
|
@@ -42,7 +43,7 @@ function StartWalkthroughButton() {
|
|
|
42
43
|
},
|
|
43
44
|
initial: {
|
|
44
45
|
opacity: 0,
|
|
45
|
-
scale: .
|
|
46
|
+
scale: .9,
|
|
46
47
|
translateX: -10
|
|
47
48
|
},
|
|
48
49
|
animate: {
|
|
@@ -72,36 +73,8 @@ function StartWalkthroughButton() {
|
|
|
72
73
|
})
|
|
73
74
|
});
|
|
74
75
|
}
|
|
75
|
-
var DynamicViewModeSwitcher = forwardRef(({ value, onChange }, ref) => /* @__PURE__ */ jsx(m$1.div, {
|
|
76
|
-
ref,
|
|
77
|
-
layout: "position",
|
|
78
|
-
children: /* @__PURE__ */ jsx(SegmentedControl, {
|
|
79
|
-
size: "xs",
|
|
80
|
-
value,
|
|
81
|
-
onChange: (variant) => {
|
|
82
|
-
invariant(variant === "diagram" || variant === "sequence", "Invalid dynamic view variant");
|
|
83
|
-
onChange(variant);
|
|
84
|
-
},
|
|
85
|
-
classNames: { label: css({ fontSize: "xxs" }) },
|
|
86
|
-
data: [{
|
|
87
|
-
value: "diagram",
|
|
88
|
-
label: "Diagram"
|
|
89
|
-
}, {
|
|
90
|
-
value: "sequence",
|
|
91
|
-
label: "Sequence"
|
|
92
|
-
}]
|
|
93
|
-
})
|
|
94
|
-
}));
|
|
95
|
-
var selectDynamicViewVariant = selectDiagramContext((c) => c.dynamicViewVariant);
|
|
96
76
|
function DynamicViewControls() {
|
|
97
|
-
|
|
98
|
-
const diagram = useDiagram();
|
|
99
|
-
return /* @__PURE__ */ jsxs(AnimatePresence, { children: [/* @__PURE__ */ jsx(DynamicViewModeSwitcher, {
|
|
100
|
-
value: dynamicViewVariant,
|
|
101
|
-
onChange: (mode) => {
|
|
102
|
-
diagram.switchDynamicViewVariant(mode);
|
|
103
|
-
}
|
|
104
|
-
}), /* @__PURE__ */ jsx(StartWalkthroughButton, {}, "trigger-dynamic-walkthrough")] });
|
|
77
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DynamicViewModeSwitcher, {}), /* @__PURE__ */ jsx(StartWalkthroughButton, {})] });
|
|
105
78
|
}
|
|
106
79
|
//#endregion
|
|
107
|
-
export { DynamicViewControls, TriggerWalkthroughButton };
|
|
80
|
+
export { DynamicViewControls, StartWalkthroughButton, TriggerWalkthroughButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DynamicViewModeSwitcher(): import("react").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { selectDiagramContext, useDiagram, useDiagramSelector } from "../../hooks/safeContext.js";
|
|
3
|
+
import { css } from "@likec4/styles/css";
|
|
4
|
+
import { useRef } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { SegmentedControl } from "@mantine/core";
|
|
7
|
+
import { m } from "motion/react";
|
|
8
|
+
//#region src/navigationpanel/walkthrough/DynamicViewModeSwitcher.tsx
|
|
9
|
+
var dynamicViewModes = [{
|
|
10
|
+
value: "diagram",
|
|
11
|
+
label: "Diagram"
|
|
12
|
+
}, {
|
|
13
|
+
value: "sequence",
|
|
14
|
+
label: "Sequence"
|
|
15
|
+
}];
|
|
16
|
+
var selectDynamicViewVariant = selectDiagramContext((c) => c.dynamicViewVariant);
|
|
17
|
+
function DynamicViewModeSwitcher() {
|
|
18
|
+
const value = useDiagramSelector(selectDynamicViewVariant);
|
|
19
|
+
const diagram = useDiagram();
|
|
20
|
+
const controlAnimation = useRef({
|
|
21
|
+
initial: {
|
|
22
|
+
opacity: 0,
|
|
23
|
+
translateX: -10
|
|
24
|
+
},
|
|
25
|
+
animate: {
|
|
26
|
+
opacity: 1,
|
|
27
|
+
translateX: 0
|
|
28
|
+
},
|
|
29
|
+
exit: {
|
|
30
|
+
opacity: 0,
|
|
31
|
+
translateX: -10
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return /* @__PURE__ */ jsx(m.div, {
|
|
35
|
+
layout: "position",
|
|
36
|
+
...controlAnimation.current,
|
|
37
|
+
children: /* @__PURE__ */ jsx(SegmentedControl, {
|
|
38
|
+
value,
|
|
39
|
+
data: dynamicViewModes,
|
|
40
|
+
onChange: (variant) => {
|
|
41
|
+
diagram.switchDynamicViewVariant(variant);
|
|
42
|
+
},
|
|
43
|
+
size: "xs",
|
|
44
|
+
classNames: { label: css({ fontSize: "xxs" }) }
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { DynamicViewModeSwitcher };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import {
|
|
2
|
+
import { selectDiagramContext, useDiagramSelector } from "../../hooks/safeContext.js";
|
|
3
3
|
import { Markdown } from "../../base-primitives/Markdown.js";
|
|
4
4
|
import { memo } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -17,7 +17,7 @@ var SectionHeader = styled("div", { base: {
|
|
|
17
17
|
userSelect: "none",
|
|
18
18
|
mb: "xxs"
|
|
19
19
|
} });
|
|
20
|
-
var selectWalkthroughNotes =
|
|
20
|
+
var selectWalkthroughNotes = selectDiagramContext((s) => {
|
|
21
21
|
const isActive = isNonNull(s.activeWalkthrough);
|
|
22
22
|
const activeStepIndex = isActive ? s.xyedges.findIndex((e) => e.id === s.activeWalkthrough?.stepId) : -1;
|
|
23
23
|
return {
|
|
@@ -29,7 +29,7 @@ var selectWalkthroughNotes = selectDiagramActorContext((s) => {
|
|
|
29
29
|
};
|
|
30
30
|
});
|
|
31
31
|
var WalkthroughPanel = memo(() => {
|
|
32
|
-
const { isActive, notes: _notes } =
|
|
32
|
+
const { isActive, notes: _notes } = useDiagramSelector(selectWalkthroughNotes);
|
|
33
33
|
const notes = _notes ? RichText.from(_notes) : RichText.EMPTY;
|
|
34
34
|
return /* @__PURE__ */ jsx(AnimatePresence, { children: isActive && !notes.isEmpty && /* @__PURE__ */ jsx(m.div, {
|
|
35
35
|
layout: "position",
|
|
@@ -40,17 +40,17 @@ var WalkthroughPanel = memo(() => {
|
|
|
40
40
|
padding: "md",
|
|
41
41
|
paddingTop: "xxs",
|
|
42
42
|
pointerEvents: "all",
|
|
43
|
-
maxWidth:
|
|
43
|
+
maxWidth: "[300px]",
|
|
44
44
|
height: "max-content",
|
|
45
|
-
maxHeight: "calc(100cqh - 100px)",
|
|
45
|
+
maxHeight: "[calc(100cqh - 100px)]",
|
|
46
46
|
width: "max-content",
|
|
47
47
|
cursor: "default",
|
|
48
48
|
overflow: "hidden",
|
|
49
49
|
"@/sm": {
|
|
50
|
-
minWidth:
|
|
51
|
-
maxWidth:
|
|
50
|
+
minWidth: "[400px]",
|
|
51
|
+
maxWidth: "[550px]"
|
|
52
52
|
},
|
|
53
|
-
"@/lg": { maxWidth:
|
|
53
|
+
"@/lg": { maxWidth: "[700px]" }
|
|
54
54
|
}),
|
|
55
55
|
initial: {
|
|
56
56
|
opacity: 0,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ViewDetailsWindow(): import("react").JSX.Element;
|