@likec4/diagram 1.21.0 → 1.22.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.
Files changed (129) hide show
  1. package/dist/LikeC4Diagram.js +9 -13
  2. package/dist/base/BaseXYFlow.js +0 -1
  3. package/dist/base/index.d.ts +0 -1
  4. package/dist/base/primitives/compound/CompoundNodeContainer.js +2 -2
  5. package/dist/base/primitives/edge/EdgeLabel.js +2 -2
  6. package/dist/base/primitives/element/ElementNodeContainer.d.ts +6 -1
  7. package/dist/base/primitives/element/ElementNodeContainer.js +31 -13
  8. package/dist/base/primitives/element/ElementTitle.js +7 -3
  9. package/dist/base/primitives/element/styles.css.js +1 -1
  10. package/dist/{base → components}/Link.css.js +3 -3
  11. package/dist/components/SearchControl.css.d.ts +2 -0
  12. package/dist/components/SearchControl.css.js +7 -0
  13. package/dist/components/SearchControl.d.ts +5 -0
  14. package/dist/components/SearchControl.js +17 -0
  15. package/dist/context/IconRenderer.d.ts +10 -0
  16. package/dist/context/IconRenderer.js +34 -0
  17. package/dist/hooks/index.d.ts +0 -1
  18. package/dist/hooks/useDiagram.d.ts +4 -4
  19. package/dist/index.d.ts +1 -1
  20. package/dist/likec4diagram/DiagramUI.js +1 -4
  21. package/dist/likec4diagram/XYFlow.d.ts +6 -1
  22. package/dist/likec4diagram/XYFlow.js +28 -29
  23. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +3 -1
  24. package/dist/likec4diagram/state/actorContext.d.ts +16 -16
  25. package/dist/likec4diagram/state/assign.js +1 -1
  26. package/dist/likec4diagram/state/machine.d.ts +7 -7
  27. package/dist/likec4diagram/state/machine.js +10 -7
  28. package/dist/likec4diagram/ui/controls/Controls.js +63 -48
  29. package/dist/likec4diagram/ui/controls/NavigationButtons.js +44 -69
  30. package/dist/likec4diagram/ui/controls/_shared.js +1 -1
  31. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +5 -4
  32. package/dist/likec4diagram/ui/index.d.ts +2 -0
  33. package/dist/likec4diagram/ui/search/ElementsColumn.css.d.ts +15 -0
  34. package/dist/likec4diagram/ui/search/ElementsColumn.css.js +30 -0
  35. package/dist/likec4diagram/ui/search/ElementsColumn.d.ts +1 -0
  36. package/dist/likec4diagram/ui/search/ElementsColumn.js +243 -0
  37. package/dist/likec4diagram/ui/search/LikeC4Search.css.d.ts +8 -0
  38. package/dist/likec4diagram/ui/search/LikeC4Search.css.js +20 -0
  39. package/dist/likec4diagram/ui/search/LikeC4Search.d.ts +1 -0
  40. package/dist/likec4diagram/ui/search/LikeC4Search.js +265 -0
  41. package/dist/likec4diagram/ui/search/SearchInput.d.ts +1 -0
  42. package/dist/likec4diagram/ui/search/SearchInput.js +196 -0
  43. package/dist/likec4diagram/ui/search/ViewsColum.d.ts +9 -0
  44. package/dist/likec4diagram/ui/search/ViewsColum.js +130 -0
  45. package/dist/likec4diagram/ui/search/ViewsColumn.css.d.ts +5 -0
  46. package/dist/likec4diagram/ui/search/ViewsColumn.css.js +12 -0
  47. package/dist/likec4diagram/ui/search/_shared.css.d.ts +16 -0
  48. package/dist/likec4diagram/ui/search/_shared.css.js +5 -0
  49. package/dist/likec4diagram/ui/search/state.d.ts +19 -0
  50. package/dist/likec4diagram/ui/search/state.js +72 -0
  51. package/dist/likec4diagram/ui/search/utils.d.ts +3 -0
  52. package/dist/likec4diagram/ui/search/utils.js +23 -0
  53. package/dist/likec4diagram/useLayoutConstraints.js +4 -5
  54. package/dist/likec4model/useLikeC4ElementsTree.d.ts +1 -0
  55. package/dist/likec4model/useLikeC4ElementsTree.js +1 -0
  56. package/dist/overlays/Overlays.js +10 -10
  57. package/dist/overlays/element-details/ElementDetailsCard.js +20 -13
  58. package/dist/overlays/element-details/TabPanelDeployments.js +4 -2
  59. package/dist/overlays/overlay/Overlay.d.ts +6 -2
  60. package/dist/overlays/overlay/Overlay.js +18 -29
  61. package/dist/overlays/relationship-details/SelectEdge.js +1 -3
  62. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -5
  63. package/dist/overlays/relationships-browser/SelectElement.js +10 -6
  64. package/dist/overlays/relationships-browser/actor.d.ts +2 -2
  65. package/dist/overlays/relationships-browser/actor.js +8 -8
  66. package/dist/overlays/relationships-browser/custom/nodeTypes.js +2 -2
  67. package/dist/style.css +1 -1
  68. package/package.json +15 -14
  69. package/src/LikeC4Diagram.tsx +0 -1
  70. package/src/base/BaseXYFlow.tsx +0 -1
  71. package/src/base/index.ts +0 -2
  72. package/src/base/primitives/element/ElementNodeContainer.css.ts +4 -7
  73. package/src/base/primitives/element/ElementNodeContainer.tsx +36 -16
  74. package/src/base/primitives/element/ElementTitle.css.ts +12 -9
  75. package/src/base/primitives/element/ElementTitle.tsx +6 -2
  76. package/src/base/primitives/element/styles.css.ts +18 -40
  77. package/src/{base → components}/Link.css.ts +3 -3
  78. package/src/components/SearchControl.css.ts +69 -0
  79. package/src/components/SearchControl.tsx +33 -0
  80. package/src/context/IconRenderer.tsx +54 -1
  81. package/src/hooks/index.ts +0 -1
  82. package/src/index.ts +15 -1
  83. package/src/likec4diagram/DiagramUI.tsx +1 -8
  84. package/src/likec4diagram/XYFlow.tsx +30 -30
  85. package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +0 -1
  86. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.ts +1 -0
  87. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +3 -1
  88. package/src/likec4diagram/state/assign.ts +1 -1
  89. package/src/likec4diagram/state/machine.ts +12 -10
  90. package/src/likec4diagram/ui/controls/Controls.tsx +35 -25
  91. package/src/likec4diagram/ui/controls/NavigationButtons.tsx +36 -58
  92. package/src/likec4diagram/ui/controls/styles.css.ts +3 -1
  93. package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +111 -108
  94. package/src/likec4diagram/ui/index.ts +2 -0
  95. package/src/likec4diagram/ui/notation/NotationPanel.tsx +2 -3
  96. package/src/likec4diagram/ui/search/ElementsColumn.css.ts +119 -0
  97. package/src/likec4diagram/ui/search/ElementsColumn.tsx +291 -0
  98. package/src/likec4diagram/ui/search/LikeC4Search.css.ts +117 -0
  99. package/src/likec4diagram/ui/search/LikeC4Search.tsx +312 -0
  100. package/src/likec4diagram/ui/search/SearchInput.tsx +235 -0
  101. package/src/likec4diagram/ui/search/ViewsColum.tsx +158 -0
  102. package/src/likec4diagram/ui/search/ViewsColumn.css.ts +37 -0
  103. package/src/likec4diagram/ui/search/_shared.css.ts +104 -0
  104. package/src/likec4diagram/ui/search/state.ts +76 -0
  105. package/src/likec4diagram/ui/search/utils.ts +20 -0
  106. package/src/likec4diagram/useLayoutConstraints.ts +4 -5
  107. package/src/likec4model/useLikeC4ElementsTree.ts +4 -4
  108. package/src/overlays/Overlays.tsx +32 -26
  109. package/src/overlays/element-details/ElementDetailsCard.css.ts +4 -4
  110. package/src/overlays/element-details/ElementDetailsCard.tsx +246 -244
  111. package/src/overlays/element-details/TabPanelDeployments.tsx +4 -4
  112. package/src/overlays/overlay/Overlay.css.ts +10 -9
  113. package/src/overlays/overlay/Overlay.tsx +38 -26
  114. package/src/overlays/relationship-details/SelectEdge.css.ts +1 -0
  115. package/src/overlays/relationship-details/SelectEdge.tsx +2 -4
  116. package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +10 -5
  117. package/src/overlays/relationships-browser/SelectElement.tsx +88 -82
  118. package/src/overlays/relationships-browser/actor.ts +10 -10
  119. package/src/overlays/relationships-browser/custom/nodeTypes.tsx +2 -2
  120. package/dist/LikeC4Search.css.d.ts +0 -1
  121. package/dist/LikeC4Search.css.js +0 -5
  122. package/dist/LikeC4Search.d.ts +0 -2
  123. package/dist/LikeC4Search.js +0 -88
  124. package/src/LikeC4Search.css.ts +0 -12
  125. package/src/LikeC4Search.tsx +0 -91
  126. /package/dist/{base → components}/Link.css.d.ts +0 -0
  127. /package/dist/{base → components}/Link.d.ts +0 -0
  128. /package/dist/{base → components}/Link.js +0 -0
  129. /package/src/{base → components}/Link.tsx +0 -0
@@ -277,7 +277,7 @@ function resetEdgeControlPoints({ context }) {
277
277
  if (!sourceCenter || !targetCenter) {
278
278
  return [];
279
279
  }
280
- if (source == target) {
280
+ if (source === target) {
281
281
  const loopSize = 80;
282
282
  const centerOfTopBoundary = new VectorImpl(0, source.height || 0).mul(-0.5).add(sourceCenter);
283
283
  return [
@@ -1,4 +1,4 @@
1
- import { BBox, DiagramView, EdgeId, Fqn, NodeId, RelationId, StepEdgeId, ViewChange, ViewId, XYPoint, DiagramNode, Color, RelationshipLineType, NonEmptyArray } from '@likec4/core';
1
+ import { BBox, DiagramView, EdgeId, Fqn, NodeId, StepEdgeId, ViewChange, ViewId, XYPoint, DiagramNode, RelationId, Color, RelationshipLineType, NonEmptyArray } from '@likec4/core';
2
2
  import { ReactFlowInstance, useStoreApi, GeneralHelpers, ViewportHelperFunctions } from '@xyflow/react';
3
3
  import { EdgeChange, NodeChange, Rect, Viewport, EdgeMarkerType, HandleType } from '@xyflow/system';
4
4
  import { ActorRefFromLogic, SnapshotFrom, StateMachine, CallbackActorLogic, AnyEventObject, NonReducibleUnknown, EventObject, MetaObject, AnyActorLogic, ConditionalRequired, InputFrom, RequiredLogicInput, IsNotNever, ActorRef, MachineSnapshot, AnyActorRef, StateValue, ActionFunction, ActorLogic, Values, RequiredActorOptions, GetConcreteByKey, StopAction, CancelAction } from 'xstate';
@@ -70,10 +70,10 @@ export type Events = HotKeyEvent | {
70
70
  type: 'xyflow.init';
71
71
  instance: ReactFlowInstance<Types.Node, Types.Edge>;
72
72
  } | {
73
- type: 'xyflow.applyNodeChages';
73
+ type: 'xyflow.applyNodeChanges';
74
74
  changes: NodeChange<Types.Node>[];
75
75
  } | {
76
- type: 'xyflow.applyEdgeChages';
76
+ type: 'xyflow.applyEdgeChanges';
77
77
  changes: EdgeChange<Types.Edge>[];
78
78
  } | {
79
79
  type: 'xyflow.viewportMoved';
@@ -7600,9 +7600,9 @@ export declare const diagramMachine: StateMachine<DiagramContext, Events, {
7600
7600
  };
7601
7601
  };
7602
7602
  readonly on: {
7603
- readonly 'xyflow.applyNodeChages': {
7603
+ readonly 'xyflow.applyNodeChanges': {
7604
7604
  readonly actions: ActionFunction<DiagramContext, {
7605
- type: "xyflow.applyNodeChages";
7605
+ type: "xyflow.applyNodeChanges";
7606
7606
  changes: NodeChange<Types.Node>[];
7607
7607
  }, Events, undefined, Values<{
7608
7608
  hotkeyActor: {
@@ -7815,9 +7815,9 @@ export declare const diagramMachine: StateMachine<DiagramContext, Events, {
7815
7815
  };
7816
7816
  }>, never, never, never, never>;
7817
7817
  };
7818
- readonly 'xyflow.applyEdgeChages': {
7818
+ readonly 'xyflow.applyEdgeChanges': {
7819
7819
  readonly actions: ActionFunction<DiagramContext, {
7820
- type: "xyflow.applyEdgeChages";
7820
+ type: "xyflow.applyEdgeChanges";
7821
7821
  changes: EdgeChange<Types.Edge>[];
7822
7822
  }, Events, undefined, Values<{
7823
7823
  hotkeyActor: {
@@ -472,7 +472,7 @@ const diagramMachine = setup({
472
472
  pending: {
473
473
  entry: enqueueActions(({ enqueue }) => {
474
474
  enqueue.sendTo((c) => c.context.syncLayoutActorRef, { type: "stop" });
475
- enqueue.stopChild("layout");
475
+ enqueue.stopChild("syncLayout");
476
476
  enqueue({
477
477
  type: "trigger:NavigateTo",
478
478
  params: ({ context }) => ({
@@ -495,15 +495,16 @@ const diagramMachine = setup({
495
495
  }
496
496
  }
497
497
  });
498
+ enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 80 });
498
499
  } else {
499
500
  enqueue({
500
501
  type: "xyflow:setViewportCenter",
501
502
  params: getBBoxCenter(event.view.bounds)
502
503
  });
504
+ enqueue.raise({ type: "fitDiagram", duration: 200 }, { id: "fitDiagram", delay: 25 });
503
505
  }
504
506
  enqueue.assign(updateNavigationHistory);
505
507
  enqueue.assign(mergeXYNodesEdges);
506
- enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 75 });
507
508
  }),
508
509
  target: "done"
509
510
  }
@@ -602,12 +603,12 @@ const diagramMachine = setup({
602
603
  }
603
604
  },
604
605
  on: {
605
- "xyflow.applyNodeChages": {
606
+ "xyflow.applyNodeChanges": {
606
607
  actions: assign({
607
608
  xynodes: ({ context, event }) => applyNodeChanges(event.changes, context.xynodes)
608
609
  })
609
610
  },
610
- "xyflow.applyEdgeChages": {
611
+ "xyflow.applyEdgeChanges": {
611
612
  actions: assign({
612
613
  xyedges: ({ context, event }) => applyEdgeChanges(event.changes, context.xyedges)
613
614
  })
@@ -673,17 +674,19 @@ const diagramMachine = setup({
673
674
  }
674
675
  }
675
676
  });
677
+ enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 80 });
676
678
  } else {
677
679
  enqueue({
678
680
  type: "xyflow:setViewportCenter",
679
681
  params: getBBoxCenter(event.view.bounds)
680
682
  });
683
+ enqueue.raise({ type: "fitDiagram", duration: 200 }, { id: "fitDiagram", delay: 25 });
681
684
  }
682
685
  } else {
683
686
  enqueue.sendTo((c) => c.context.syncLayoutActorRef, { type: "synced" });
684
- }
685
- if (isAnotherView || !context.viewportChangedManually) {
686
- enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 90 });
687
+ if (!context.viewportChangedManually) {
688
+ enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 50 });
689
+ }
687
690
  }
688
691
  enqueue.assign(mergeXYNodesEdges);
689
692
  enqueue.assign({
@@ -1,18 +1,19 @@
1
- import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
- import { Stack, ActionIconGroup, Badge, Loader } from "@mantine/core";
3
- import { openSpotlight } from "@mantine/spotlight";
4
- import { IconSearch, IconFileSymlink, IconFocusCentered } from "@tabler/icons-react";
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { Group, Stack, ActionIconGroup, Badge, Loader } from "@mantine/core";
3
+ import { IconMenu2, IconFileSymlink, IconFocusCentered } from "@tabler/icons-react";
5
4
  import { clsx } from "clsx";
5
+ import { LayoutGroup } from "framer-motion";
6
6
  import { memo } from "react";
7
7
  import { useDiagram } from "../../../hooks/useDiagram.js";
8
8
  import { useDiagramSyncLayoutState } from "../../../hooks/useDiagramActor.js";
9
9
  import { useDiagramContext } from "../../../hooks/useDiagramContext.js";
10
- import { Tooltip, ActionIcon } from "./_shared.js";
10
+ import { LikeC4Search } from "../search/LikeC4Search.js";
11
+ import { ActionIcon, Tooltip } from "./_shared.js";
11
12
  import { ChangeAutoLayoutButton } from "./ChangeAutoLayoutButton.js";
12
13
  import { LayoutDriftNotification } from "./LayoutDriftNotification.js";
13
14
  import { ManualLayoutToolsButton } from "./ManualLayoutToolsButton.js";
14
15
  import { NavigationButtons } from "./NavigationButtons.js";
15
- import { actionIconGroup, panel } from "./styles.css.js";
16
+ import { navigationButtons, actionIconGroup, panel } from "./styles.css.js";
16
17
  import { useDiagramEventHandlers } from "../../../context/DiagramEventHandlers.js";
17
18
  import { useEnabledFeatures } from "../../../context/DiagramFeatures.js";
18
19
  import { useMantinePortalProps } from "../../../hooks/useMantinePortalProps.js";
@@ -25,72 +26,86 @@ const Controls = memo(() => {
25
26
  }));
26
27
  const diagram = useDiagram();
27
28
  const {
28
- onOpenSource
29
+ onOpenSource,
30
+ onBurgerMenuClick
29
31
  } = useDiagramEventHandlers();
30
32
  const {
31
33
  enableControls,
32
34
  enableSearch,
33
35
  enableNavigationButtons,
34
36
  enableReadOnly,
35
- enableEdgeEditing,
36
37
  enableVscode
37
38
  } = useEnabledFeatures();
38
39
  const notReadOnly = !enableReadOnly;
39
40
  const portalProps = useMantinePortalProps();
40
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
41
- Stack,
41
+ return /* @__PURE__ */ jsxs(
42
+ Group,
42
43
  {
44
+ align: "flex-start",
43
45
  className: clsx(
44
46
  "react-flow__panel",
45
47
  panel,
46
48
  "likec4-top-left-panel"
47
49
  ),
48
- align: "flex-start",
49
- onClick: stopPropagation,
50
50
  gap: "xs",
51
+ onClick: stopPropagation,
51
52
  children: [
52
- enableNavigationButtons && /* @__PURE__ */ jsx(NavigationButtons, {}),
53
- /* @__PURE__ */ jsxs(ActionIconGroup, { className: actionIconGroup, orientation: "vertical", children: [
54
- enableControls && enableSearch && /* @__PURE__ */ jsx(Tooltip, { label: "Search (Ctrl+F or ⌘+F)", ...portalProps, children: /* @__PURE__ */ jsx(
55
- ActionIcon,
53
+ /* @__PURE__ */ jsxs(Stack, { align: "flex-start", gap: "xs", children: [
54
+ /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsxs(
55
+ Group,
56
56
  {
57
- onClick: (e) => {
58
- e.stopPropagation();
59
- openSpotlight();
60
- },
61
- children: /* @__PURE__ */ jsx(IconSearch, {})
57
+ className: clsx(navigationButtons, "likec4-navigation-webview"),
58
+ gap: "xs",
59
+ children: [
60
+ onBurgerMenuClick && /* @__PURE__ */ jsx(
61
+ ActionIcon,
62
+ {
63
+ onClick: (e) => {
64
+ e.stopPropagation();
65
+ onBurgerMenuClick();
66
+ },
67
+ children: /* @__PURE__ */ jsx(IconMenu2, {})
68
+ }
69
+ ),
70
+ enableNavigationButtons && /* @__PURE__ */ jsx(NavigationButtons, {})
71
+ ]
62
72
  }
63
73
  ) }),
64
- enableVscode && /* @__PURE__ */ jsx(Tooltip, { label: "Open source", ...portalProps, children: /* @__PURE__ */ jsx(
65
- ActionIcon,
66
- {
67
- onClick: (e) => {
68
- e.stopPropagation();
69
- onOpenSource == null ? void 0 : onOpenSource({ view: viewId });
70
- },
71
- children: /* @__PURE__ */ jsx(IconFileSymlink, { stroke: 1.5 })
72
- }
73
- ) }),
74
- enableControls && hasLayoutDrift && /* @__PURE__ */ jsx(LayoutDriftNotification, { ...portalProps }),
75
- enableControls && notReadOnly && /* @__PURE__ */ jsxs(Fragment, { children: [
76
- /* @__PURE__ */ jsx(ChangeAutoLayoutButton, { ...portalProps }),
77
- /* @__PURE__ */ jsx(ManualLayoutToolsButton, { ...portalProps })
78
- ] }),
79
- enableControls && /* @__PURE__ */ jsx(Tooltip, { label: viewportChanged ? "Center camera" : "Camera is centered", ...portalProps, children: /* @__PURE__ */ jsx(
80
- ActionIcon,
81
- {
82
- onClick: (e) => {
83
- e.stopPropagation();
84
- diagram.fitDiagram();
85
- },
86
- children: /* @__PURE__ */ jsx(IconFocusCentered, {})
87
- }
88
- ) })
74
+ /* @__PURE__ */ jsxs(ActionIconGroup, { className: actionIconGroup, orientation: "vertical", children: [
75
+ enableVscode && /* @__PURE__ */ jsx(Tooltip, { label: "Open source", ...portalProps, children: /* @__PURE__ */ jsx(
76
+ ActionIcon,
77
+ {
78
+ onClick: (e) => {
79
+ e.stopPropagation();
80
+ onOpenSource == null ? void 0 : onOpenSource({ view: viewId });
81
+ },
82
+ children: /* @__PURE__ */ jsx(IconFileSymlink, { stroke: 1.5 })
83
+ }
84
+ ) }),
85
+ enableControls && hasLayoutDrift && /* @__PURE__ */ jsx(LayoutDriftNotification, { ...portalProps }),
86
+ enableControls && notReadOnly && /* @__PURE__ */ jsxs(Fragment, { children: [
87
+ /* @__PURE__ */ jsx(ChangeAutoLayoutButton, { ...portalProps }),
88
+ /* @__PURE__ */ jsx(ManualLayoutToolsButton, { ...portalProps })
89
+ ] }),
90
+ enableControls && /* @__PURE__ */ jsx(Tooltip, { label: viewportChanged ? "Center camera" : "Camera is centered", ...portalProps, children: /* @__PURE__ */ jsx(
91
+ ActionIcon,
92
+ {
93
+ onClick: (e) => {
94
+ e.stopPropagation();
95
+ diagram.fitDiagram();
96
+ },
97
+ children: /* @__PURE__ */ jsx(IconFocusCentered, {})
98
+ }
99
+ ) })
100
+ ] })
89
101
  ] }),
90
- notReadOnly && /* @__PURE__ */ jsx(SyncLayoutBadge, {})
102
+ /* @__PURE__ */ jsxs(Group, { children: [
103
+ enableSearch && /* @__PURE__ */ jsx(LikeC4Search, {}),
104
+ notReadOnly && /* @__PURE__ */ jsx(SyncLayoutBadge, {})
105
+ ] })
91
106
  ]
92
107
  }
93
- ) });
108
+ );
94
109
  });
95
110
  const SyncLayoutBadge = () => {
96
111
  const isPending = useDiagramSyncLayoutState((s) => s.hasTag("pending"));
@@ -1,16 +1,11 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { IconMenu2, IconChevronLeft, IconChevronRight } from "@tabler/icons-react";
3
- import { LayoutGroup, AnimatePresence, m } from "framer-motion";
4
- import { Group } from "@mantine/core";
5
- import clsx from "clsx";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { IconChevronLeft, IconChevronRight } from "@tabler/icons-react";
3
+ import { AnimatePresence, m } from "framer-motion";
6
4
  import { useDiagram } from "../../../hooks/useDiagram.js";
7
5
  import { useDiagramContext } from "../../../hooks/useDiagramContext.js";
8
6
  import { ActionIcon } from "./_shared.js";
9
- import { navigationButtons } from "./styles.css.js";
10
- import { useDiagramEventHandlers } from "../../../context/DiagramEventHandlers.js";
11
7
  const NavigationButtons = () => {
12
8
  const diagram = useDiagram();
13
- const { onBurgerMenuClick } = useDiagramEventHandlers();
14
9
  const {
15
10
  hasStepBack,
16
11
  hasStepForward
@@ -18,74 +13,54 @@ const NavigationButtons = () => {
18
13
  hasStepBack: s.navigationHistory.currentIndex > 0,
19
14
  hasStepForward: s.navigationHistory.currentIndex < s.navigationHistory.history.length - 1
20
15
  }));
21
- return /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsxs(
22
- Group,
23
- {
24
- className: clsx(navigationButtons, "likec4-navigation-webview"),
25
- align: "flex-start",
26
- gap: "xs",
27
- children: [
28
- onBurgerMenuClick && /* @__PURE__ */ jsx(
16
+ return /* @__PURE__ */ jsxs(AnimatePresence, { children: [
17
+ hasStepBack && /* @__PURE__ */ jsx(
18
+ m.div,
19
+ {
20
+ layout: true,
21
+ initial: { opacity: 0.05, transform: "translateX(-10px)" },
22
+ animate: { opacity: 1, transform: "translateX(0)" },
23
+ exit: {
24
+ opacity: 0.05,
25
+ transform: "translateX(-10px)"
26
+ },
27
+ children: /* @__PURE__ */ jsx(
29
28
  ActionIcon,
30
29
  {
31
30
  onClick: (e) => {
32
31
  e.stopPropagation();
33
- onBurgerMenuClick();
32
+ diagram.navigate("back");
34
33
  },
35
- children: /* @__PURE__ */ jsx(IconMenu2, {})
34
+ children: /* @__PURE__ */ jsx(IconChevronLeft, {})
36
35
  }
37
- ),
38
- /* @__PURE__ */ jsxs(AnimatePresence, { children: [
39
- hasStepBack && /* @__PURE__ */ jsx(
40
- m.div,
41
- {
42
- layout: true,
43
- initial: { opacity: 0.05, transform: "translateX(-10px)" },
44
- animate: { opacity: 1, transform: "translateX(0)" },
45
- exit: {
46
- opacity: 0.05,
47
- transform: "translateX(-10px)"
48
- },
49
- children: /* @__PURE__ */ jsx(
50
- ActionIcon,
51
- {
52
- onClick: (e) => {
53
- e.stopPropagation();
54
- diagram.navigate("back");
55
- },
56
- children: /* @__PURE__ */ jsx(IconChevronLeft, {})
57
- }
58
- )
59
- },
60
- "back"
61
- ),
62
- hasStepForward && /* @__PURE__ */ jsx(
63
- m.div,
64
- {
65
- layout: true,
66
- initial: { opacity: 0.05, transform: "translateX(10px)" },
67
- animate: { opacity: 1, transform: "translateX(0)" },
68
- exit: {
69
- opacity: 0,
70
- transform: "translateX(10px)"
71
- },
72
- children: /* @__PURE__ */ jsx(
73
- ActionIcon,
74
- {
75
- onClick: (e) => {
76
- e.stopPropagation();
77
- diagram.navigate("forward");
78
- },
79
- children: /* @__PURE__ */ jsx(IconChevronRight, {})
80
- }
81
- )
36
+ )
37
+ },
38
+ "back"
39
+ ),
40
+ hasStepForward && /* @__PURE__ */ jsx(
41
+ m.div,
42
+ {
43
+ layout: true,
44
+ initial: { opacity: 0.05, transform: "translateX(10px)" },
45
+ animate: { opacity: 1, transform: "translateX(0)" },
46
+ exit: {
47
+ opacity: 0,
48
+ transform: "translateX(10px)"
49
+ },
50
+ children: /* @__PURE__ */ jsx(
51
+ ActionIcon,
52
+ {
53
+ onClick: (e) => {
54
+ e.stopPropagation();
55
+ diagram.navigate("forward");
82
56
  },
83
- "forward"
84
- )
85
- ] })
86
- ]
87
- }
88
- ) });
57
+ children: /* @__PURE__ */ jsx(IconChevronRight, {})
58
+ }
59
+ )
60
+ },
61
+ "forward"
62
+ )
63
+ ] });
89
64
  };
90
65
  export {
91
66
  NavigationButtons
@@ -1,4 +1,4 @@
1
- import { Tooltip as Tooltip$1, ActionIcon as ActionIcon$1 } from "@mantine/core";
1
+ import { ActionIcon as ActionIcon$1, Tooltip as Tooltip$1 } from "@mantine/core";
2
2
  const Tooltip = Tooltip$1.withProps({
3
3
  color: "dark",
4
4
  fz: "xs",
@@ -4,23 +4,24 @@ import { useLocalStorage } from "@mantine/hooks";
4
4
  import { IconMenu } from "@tabler/icons-react";
5
5
  import clsx from "clsx";
6
6
  import { AnimatePresence, m } from "framer-motion";
7
+ import { Link } from "../../../components/Link.js";
7
8
  import { useDiagramContext } from "../../../hooks/useDiagramContext.js";
8
9
  import { card, title, description, container } from "./DiagramTitlePanel.css.js";
9
- import { Link } from "../../../base/Link.js";
10
10
  const selector = (s) => ({
11
11
  id: s.view.id,
12
12
  title: s.view.title ?? "untitled",
13
13
  description: s.view.description,
14
- links: s.view.links
14
+ links: s.view.links,
15
+ isNotActiveWalkthrough: s.activeWalkthrough === null
15
16
  });
16
17
  function DiagramTitlePanel() {
17
- const { id, title: title$1, description: description$1, links } = useDiagramContext(selector);
18
+ const { id, title: title$1, description: description$1, links, isNotActiveWalkthrough } = useDiagramContext(selector);
18
19
  const [isCollapsed, setCollapsed] = useLocalStorage({
19
20
  key: "diagram-title-webview-collapsed",
20
21
  defaultValue: false
21
22
  });
22
23
  const toggle = () => setCollapsed((v) => !v);
23
- return /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx(
24
+ return /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: isNotActiveWalkthrough && /* @__PURE__ */ jsx(
24
25
  m.div,
25
26
  {
26
27
  initial: { opacity: 0.05, scale: 0.7 },
@@ -1,2 +1,4 @@
1
1
  export { Controls } from './controls/Controls';
2
2
  export { DiagramTitlePanel } from './diagram-title/DiagramTitlePanel';
3
+ export { NotationPanel } from './notation/NotationPanel';
4
+ export { DynamicViewWalkthrough } from './walkthrough/DynamicViewWalkthrough';
@@ -0,0 +1,15 @@
1
+ export { focusable } from './_shared.css';
2
+ export declare const treeContainer: string;
3
+ export declare const treeNode: string;
4
+ export declare const treeRoot: string;
5
+ export declare const treeLabel: string;
6
+ export declare const treeSubtree: string;
7
+ export declare const iconSize: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
8
+ export declare const elementExpandIcon: string;
9
+ export declare const elementButton: string;
10
+ export declare const elementTitleAndId: string;
11
+ export declare const elementTitle: string;
12
+ export declare const elementId: string;
13
+ export declare const elementDescription: string;
14
+ export declare const elementIcon: string;
15
+ export declare const elementViewsCount: string;
@@ -0,0 +1,30 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ var focusable = "_1cfw8gr4";
4
+ var treeNode = "basone1";
5
+ var treeRoot = "basone2";
6
+ var treeLabel = "basone3";
7
+ var treeSubtree = "basone4";
8
+ var elementExpandIcon = "basone5";
9
+ var elementButton = "basone6 _1cfw8gr3";
10
+ var elementTitleAndId = "basone7";
11
+ var elementTitle = "basone8 _1cfw8gr5";
12
+ var elementId = "basone9";
13
+ var elementDescription = "basonea _1cfw8gr6";
14
+ var elementIcon = "basoneb";
15
+ var elementViewsCount = "basonec";
16
+ export {
17
+ elementButton,
18
+ elementDescription,
19
+ elementExpandIcon,
20
+ elementIcon,
21
+ elementId,
22
+ elementTitle,
23
+ elementTitleAndId,
24
+ elementViewsCount,
25
+ focusable,
26
+ treeLabel,
27
+ treeNode,
28
+ treeRoot,
29
+ treeSubtree
30
+ };
@@ -0,0 +1 @@
1
+ export declare function ElementsColumn(): import("react/jsx-runtime").JSX.Element;