@likec4/diagram 1.59.2 → 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.
Files changed (233) hide show
  1. package/README.md +53 -0
  2. package/dist/LikeC4Diagram.d.ts +1 -1
  3. package/dist/LikeC4Diagram.js +36 -21
  4. package/dist/LikeC4Diagram.props.d.ts +23 -0
  5. package/dist/LikeC4MantineProvider.d.ts +24 -0
  6. package/dist/LikeC4MantineProvider.js +156 -0
  7. package/dist/LikeC4ProjectsOverview.js +1 -1
  8. package/dist/LikeC4ProjectsProvider.d.ts +17 -2
  9. package/dist/LikeC4Styles.d.ts +13 -3
  10. package/dist/LikeC4Styles.js +10 -6
  11. package/dist/LikeC4View.js +2 -2
  12. package/dist/StaticLikeC4Diagram.d.ts +1 -1
  13. package/dist/base/BaseXYFlow.d.ts +1 -1
  14. package/dist/base/BaseXYFlow.js +19 -9
  15. package/dist/base/const.d.ts +1 -0
  16. package/dist/base/const.js +3 -1
  17. package/dist/base-primitives/Markdown.d.ts +3 -3
  18. package/dist/base-primitives/compound/CompoundNodeContainer.js +2 -3
  19. package/dist/base-primitives/compound/CompoundTitle.js +5 -4
  20. package/dist/base-primitives/compound/actionbtns.css.d.ts +3 -3
  21. package/dist/base-primitives/compound/actionbtns.css.js +3 -3
  22. package/dist/base-primitives/element/ElementData.js +6 -1
  23. package/dist/base-primitives/element/ElementShape.js +9 -10
  24. package/dist/base-primitives/element/ElementTags.d.ts +2 -2
  25. package/dist/base-primitives/element/ElementTags.js +5 -5
  26. package/dist/components/EmptyBox.d.ts +3 -0
  27. package/dist/components/EmptyBox.js +9 -0
  28. package/dist/components/ErrorFallback.js +7 -6
  29. package/dist/components/FloatingWindow.d.ts +18 -0
  30. package/dist/components/FloatingWindow.js +89 -0
  31. package/dist/components/Link.js +7 -7
  32. package/dist/components/NavigationPanel.d.ts +2 -2
  33. package/dist/components/NavigationPanel.js +5 -6
  34. package/dist/components/SearchControl.css.js +10 -12
  35. package/dist/components/ViewIcon.d.ts +11 -0
  36. package/dist/components/ViewIcon.js +71 -0
  37. package/dist/context/CurrentViewModelProvider.js +2 -1
  38. package/dist/context/DiagramEventHandlers.js +4 -2
  39. package/dist/context/EnsureMantine.js +3 -3
  40. package/dist/context/IconRenderer.d.ts +2 -1
  41. package/dist/context/IconRenderer.js +78 -26
  42. package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
  43. package/dist/context/TagStylesContext.d.ts +11 -4
  44. package/dist/context/TagStylesContext.js +39 -27
  45. package/dist/custom/index.d.ts +3 -0
  46. package/dist/custom/index.js +7 -4
  47. package/dist/editor/LikeC4EditorCallbacks.d.ts +20 -1
  48. package/dist/editor/LikeC4EditorCallbacks.js +4 -1
  49. package/dist/editor/actor/setup.d.ts +1 -0
  50. package/dist/editor/actor/setup.js +17 -12
  51. package/dist/editor/actor/state.sync-queue.js +1 -0
  52. package/dist/editor/applyChangesToManualLayout.js +5 -2
  53. package/dist/editor/index.d.ts +1 -1
  54. package/dist/editor/useEditorActorLogic.js +10 -3
  55. package/dist/hooks/safeContext.d.ts +12 -4
  56. package/dist/hooks/safeContext.js +2 -2
  57. package/dist/hooks/useCurrentView.js +5 -5
  58. package/dist/hooks/useDiagram.js +3 -23
  59. package/dist/hooks/useDiagramCompareLayout.d.ts +16 -6
  60. package/dist/hooks/useDiagramCompareLayout.js +20 -17
  61. package/dist/hooks/useEditorActor.js +3 -5
  62. package/dist/hooks/useLikeC4Model.js +8 -3
  63. package/dist/hooks/useLikeC4Project.d.ts +4 -3
  64. package/dist/hooks/useOverlaysActor.d.ts +1 -1
  65. package/dist/hooks/useUpdateEffect.js +2 -1
  66. package/dist/index.d.ts +6 -4
  67. package/dist/index.js +8 -6
  68. package/dist/likec4diagram/DiagramUI.js +4 -3
  69. package/dist/likec4diagram/DiagramXYFlow.d.ts +6 -0
  70. package/dist/likec4diagram/DiagramXYFlow.js +33 -19
  71. package/dist/likec4diagram/custom/edges/EdgeDrifts.js +4 -4
  72. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +2 -4
  73. package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +1 -3
  74. package/dist/likec4diagram/custom/edges/edges.css.js +13 -13
  75. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +3 -2
  76. package/dist/likec4diagram/custom/nodes/NodeDrifts.js +2 -2
  77. package/dist/likec4diagram/custom/nodes/NodeNotes.js +4 -4
  78. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +2 -2
  79. package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +8 -5
  80. package/dist/likec4diagram/custom/nodes/nodes.js +8 -5
  81. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
  82. package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +9 -8
  83. package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +1 -1
  84. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +3 -2
  85. package/dist/likec4diagram/relationship-popover/components.d.ts +1 -1
  86. package/dist/likec4diagram/relationship-popover/components.js +6 -2
  87. package/dist/likec4diagram/state/DiagramActorProvider.d.ts +7 -2
  88. package/dist/likec4diagram/state/DiagramActorProvider.js +20 -4
  89. package/dist/likec4diagram/state/assign.js +1 -1
  90. package/dist/likec4diagram/state/createViewChange.js +1 -6
  91. package/dist/likec4diagram/state/diagram-api.d.ts +2 -2
  92. package/dist/likec4diagram/state/diagram-api.js +3 -2
  93. package/dist/likec4diagram/state/machine.actions.js +15 -8
  94. package/dist/likec4diagram/state/machine.actions.layout.d.ts +1 -0
  95. package/dist/likec4diagram/state/machine.actions.layout.js +7 -5
  96. package/dist/likec4diagram/state/machine.setup.d.ts +10 -1
  97. package/dist/likec4diagram/state/machine.setup.js +15 -9
  98. package/dist/likec4diagram/state/machine.state.initializing.d.ts +2 -26
  99. package/dist/likec4diagram/state/machine.state.initializing.js +9 -6
  100. package/dist/likec4diagram/state/machine.state.navigating.js +1 -1
  101. package/dist/likec4diagram/state/machine.state.ready.d.ts +134 -3
  102. package/dist/likec4diagram/state/machine.state.ready.js +2 -1
  103. package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +106 -1
  104. package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +40 -7
  105. package/dist/likec4diagram/state/utils.d.ts +1 -1
  106. package/dist/likec4diagram/state/utils.js +7 -4
  107. package/dist/likec4diagram/ui/FloatingSequenceActors.js +2 -1
  108. package/dist/likec4diagram/ui/LayoutDriftFrame.js +16 -10
  109. package/dist/likec4diagram/ui/index.d.ts +1 -1
  110. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +13 -15
  111. package/dist/likec4diagram/ui/notation/NotationPanel.js +9 -9
  112. package/dist/likec4diagram/ui/sequence-outline/ActiveTrail.d.ts +9 -0
  113. package/dist/likec4diagram/ui/sequence-outline/ActiveTrail.js +81 -0
  114. package/dist/likec4diagram/ui/sequence-outline/FlowRow.d.ts +11 -0
  115. package/dist/likec4diagram/ui/sequence-outline/FlowRow.js +70 -0
  116. package/dist/likec4diagram/ui/sequence-outline/OutlineBody.d.ts +2 -0
  117. package/dist/likec4diagram/ui/sequence-outline/OutlineBody.js +106 -0
  118. package/dist/likec4diagram/ui/sequence-outline/OutlineHeader.d.ts +2 -0
  119. package/dist/likec4diagram/ui/sequence-outline/OutlineHeader.js +140 -0
  120. package/dist/likec4diagram/ui/sequence-outline/OutlineNodes.d.ts +17 -0
  121. package/dist/likec4diagram/ui/sequence-outline/OutlineNodes.js +83 -0
  122. package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +4 -0
  123. package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +49 -525
  124. package/dist/likec4diagram/ui/sequence-outline/StepBadge.d.ts +8 -0
  125. package/dist/likec4diagram/ui/sequence-outline/StepBadge.js +52 -0
  126. package/dist/likec4diagram/ui/sequence-outline/StepRow.d.ts +7 -0
  127. package/dist/likec4diagram/ui/sequence-outline/StepRow.js +190 -0
  128. package/dist/likec4diagram/ui/sequence-outline/StoreProvider.d.ts +238 -0
  129. package/dist/likec4diagram/ui/sequence-outline/StoreProvider.js +94 -0
  130. package/dist/likec4diagram/ui/sequence-outline/depth-of-field.d.ts +21 -0
  131. package/dist/likec4diagram/ui/sequence-outline/depth-of-field.js +71 -0
  132. package/dist/likec4diagram/ui/sequence-outline/index.d.ts +2 -0
  133. package/dist/likec4diagram/ui/sequence-outline/motion.d.ts +13 -0
  134. package/dist/likec4diagram/ui/sequence-outline/motion.js +21 -0
  135. package/dist/likec4diagram/ui/sequence-outline/presentation.d.ts +10 -0
  136. package/dist/likec4diagram/ui/sequence-outline/presentation.js +80 -0
  137. package/dist/likec4diagram/ui/sequence-outline/tree.d.ts +9 -0
  138. package/dist/likec4diagram/ui/sequence-outline/tree.js +67 -0
  139. package/dist/likec4diagram/ui/sequence-outline/{state.d.ts → types.d.ts} +4 -2
  140. package/dist/likec4diagram/ui/sequence-outline/types.js +12 -0
  141. package/dist/likec4diagram/useLayoutConstraints.js +13 -1
  142. package/dist/likec4diagram/xyflow-sequence/layouter.js +8 -10
  143. package/dist/likec4diagram/xyflow-sequence/sequence-view-to-xy.js +1 -0
  144. package/dist/likec4diagram/xyflow-sequence/utils.js +0 -1
  145. package/dist/navigationpanel/NavigationPanel.js +45 -41
  146. package/dist/navigationpanel/NavigationPanelControls.js +102 -63
  147. package/dist/navigationpanel/NavigationPanelDropdown.js +52 -77
  148. package/dist/navigationpanel/_common.d.ts +6 -6
  149. package/dist/navigationpanel/_common.js +31 -42
  150. package/dist/navigationpanel/actor.actions.js +6 -5
  151. package/dist/navigationpanel/actor.js +2 -2
  152. package/dist/navigationpanel/actor.setup.d.ts +6 -6
  153. package/dist/navigationpanel/actor.setup.js +2 -1
  154. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -4
  155. package/dist/navigationpanel/comparepanel/ComparePanel.js +8 -10
  156. package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -1
  157. package/dist/navigationpanel/comparepanel/DriftsSummary.js +11 -9
  158. package/dist/navigationpanel/controls/LayoutWarning.js +69 -72
  159. package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -1
  160. package/dist/navigationpanel/controls/NavigationButtons.js +8 -8
  161. package/dist/navigationpanel/controls/OpenSource.d.ts +1 -1
  162. package/dist/navigationpanel/controls/OpenSource.js +5 -8
  163. package/dist/navigationpanel/controls/SearchControl.js +24 -9
  164. package/dist/navigationpanel/controls/ToggleReadonly.d.ts +4 -1
  165. package/dist/navigationpanel/controls/ToggleReadonly.js +56 -76
  166. package/dist/navigationpanel/controls/ViewDetailsButton.d.ts +5 -0
  167. package/dist/navigationpanel/controls/ViewDetailsButton.js +121 -0
  168. package/dist/navigationpanel/controls/index.d.ts +1 -1
  169. package/dist/navigationpanel/dropdown/ProjectsMenu.js +27 -16
  170. package/dist/navigationpanel/editorpanel/ApplySemanticLayout.js +2 -1
  171. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +12 -10
  172. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -0
  173. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +19 -10
  174. package/dist/navigationpanel/editorpanel/styles.js +8 -15
  175. package/dist/navigationpanel/hooks.d.ts +6 -2
  176. package/dist/navigationpanel/styles.css.d.ts +2 -2
  177. package/dist/navigationpanel/styles.css.js +0 -1
  178. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -2
  179. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +5 -4
  180. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +10 -39
  181. package/dist/navigationpanel/walkthrough/DynamicViewModeSwitcher.d.ts +1 -0
  182. package/dist/navigationpanel/walkthrough/DynamicViewModeSwitcher.js +49 -0
  183. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +8 -8
  184. package/dist/navigationpanel/windows/ViewDetailsWindow.d.ts +1 -0
  185. package/dist/navigationpanel/windows/ViewDetailsWindow.js +379 -0
  186. package/dist/overlays/Overlays.js +29 -17
  187. package/dist/overlays/element-details/ElementDetailsCard.css.js +28 -36
  188. package/dist/overlays/element-details/ElementDetailsCard.js +3 -3
  189. package/dist/overlays/element-details/MetadataValue.js +18 -16
  190. package/dist/overlays/element-details/TabPanelDeployments.css.js +6 -14
  191. package/dist/overlays/element-details/TabPanelRelationships.css.js +8 -12
  192. package/dist/overlays/element-details/TabPanelStructure.css.js +4 -8
  193. package/dist/overlays/hooks.d.ts +3 -1
  194. package/dist/overlays/overlay/Overlay.js +8 -7
  195. package/dist/overlays/overlaysActor.js +20 -17
  196. package/dist/overlays/relationship-details/RelationshipDetails.js +2 -1
  197. package/dist/overlays/relationship-details/SelectEdge.css.js +14 -9
  198. package/dist/overlays/relationship-details/actor.js +1 -1
  199. package/dist/overlays/relationship-details/hooks.js +2 -1
  200. package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +6 -0
  201. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +15 -8
  202. package/dist/overlays/relationships-browser/SelectElement.css.js +2 -8
  203. package/dist/overlays/relationships-browser/SelectElement.js +5 -1
  204. package/dist/overlays/relationships-browser/actor.js +3 -2
  205. package/dist/overlays/relationships-browser/custom/ElementActions.js +39 -38
  206. package/dist/overlays/relationships-browser/custom/EmptyNode.js +7 -9
  207. package/dist/overlays/relationships-browser/hooks.js +2 -1
  208. package/dist/projects-overview/ProjectsOverview.js +8 -7
  209. package/dist/projects-overview/actor.js +1 -1
  210. package/dist/projects-overview/hooks.js +2 -1
  211. package/dist/search/Search.js +9 -7
  212. package/dist/search/components/ElementsColumn.css.js +6 -5
  213. package/dist/search/components/ElementsColumn.js +4 -3
  214. package/dist/search/components/SearchByTags.js +3 -3
  215. package/dist/search/components/ViewsColum.js +46 -43
  216. package/dist/search/components/ViewsColumn.css.js +4 -4
  217. package/dist/search/components/_shared.css.d.ts +2 -2
  218. package/dist/search/components/_shared.css.js +31 -46
  219. package/dist/search/components/styles.css.js +4 -4
  220. package/dist/search/hooks.js +2 -1
  221. package/dist/shadowroot/ShadowRoot.js +6 -5
  222. package/dist/styles2.js +1 -1
  223. package/dist/utils/index.js +3 -3
  224. package/package.json +29 -29
  225. package/panda.buildinfo.json +342 -299
  226. package/styles-min.css +1 -1
  227. package/styles-xyflow.css +1 -1
  228. package/styles.css +1 -1
  229. package/dist/context/DefaultMantineProvider.d.ts +0 -2
  230. package/dist/context/DefaultMantineProvider.js +0 -48
  231. package/dist/likec4diagram/ui/sequence-outline/state.js +0 -55
  232. package/dist/navigationpanel/controls/DetailsControls.d.ts +0 -2
  233. package/dist/navigationpanel/controls/DetailsControls.js +0 -223
@@ -1,7 +1,6 @@
1
1
  import "../../../_virtual/_rolldown/runtime.js";
2
2
  import { useXYStore } from "../../../hooks/useXYFlow.js";
3
- import { useDiagram } from "../../../hooks/safeContext.js";
4
- import { useDiagramContext } from "../../../hooks/useDiagram.js";
3
+ import { selectDiagramContext, useDiagram, useDiagramSelector } from "../../../hooks/safeContext.js";
5
4
  import { useMantinePortalProps } from "../../../hooks/useMantinePortalProps.js";
6
5
  import { ElementShape } from "../../../base-primitives/element/ElementShape.js";
7
6
  import { card, container, elementNotation, icon, shapeBadge, tabPanel } from "./NotationPanel.css.js";
@@ -9,6 +8,7 @@ import { cx } from "@likec4/styles/css";
9
8
  import { IconArrowDownRight, IconHelpCircle } from "@tabler/icons-react";
10
9
  import { memo, useState } from "react";
11
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { deepEqual } from "fast-equals";
12
12
  import { ceil, isNonNullish } from "remeda";
13
13
  import { ActionIcon, Badge, Box, Card, Group, Paper, ScrollAreaAutosize, Stack, Tabs, TabsList, TabsPanel, TabsTab, Text, Tooltip } from "@mantine/core";
14
14
  import { AnimatePresence, m } from "motion/react";
@@ -81,13 +81,13 @@ var ElementNotation = ({ value }) => {
81
81
  })
82
82
  });
83
83
  };
84
- var selector = (s) => ({
84
+ var selector = selectDiagramContext((s) => ({
85
85
  id: s.view.id,
86
86
  notations: s.view.notation?.nodes ?? []
87
- });
87
+ }), deepEqual);
88
88
  var NotationPanel = memo(() => {
89
89
  const height = useXYStore((s) => s.height);
90
- const { id, notations } = useDiagramContext(selector);
90
+ const { id, notations } = useDiagramSelector(selector);
91
91
  const [isCollapsed, setCollapsed] = useLocalStorage({
92
92
  key: "notation-webview-collapsed",
93
93
  defaultValue: true
@@ -111,13 +111,10 @@ var NotationPanel = memo(() => {
111
111
  className: container,
112
112
  children: /* @__PURE__ */ jsx(Tooltip, {
113
113
  label: "Show notation",
114
- color: "dark",
115
- fz: "xs",
116
114
  ...portalProps,
117
115
  children: /* @__PURE__ */ jsx(ActionIcon, {
118
116
  size: "lg",
119
117
  variant: "default",
120
- color: "gray",
121
118
  className: icon,
122
119
  onClick: () => setCollapsed(false),
123
120
  children: /* @__PURE__ */ jsx(IconHelpCircle, { stroke: 1.5 })
@@ -152,7 +149,10 @@ var NotationPanel = memo(() => {
152
149
  variant: "subtle",
153
150
  color: "gray",
154
151
  ml: 2,
155
- style: { alignSelf: "center" },
152
+ style: {
153
+ alignSelf: "center",
154
+ opacity: .7
155
+ },
156
156
  onClick: () => setCollapsed(true),
157
157
  children: /* @__PURE__ */ jsx(IconArrowDownRight, { stroke: 2 })
158
158
  }),
@@ -0,0 +1,9 @@
1
+ import { OutlineTreeNodes } from './types';
2
+ /**
3
+ * Sticky "you are here" trail: the fragments the active step is nested inside.
4
+ * Each segment jumps the walkthrough to the first step of that fragment.
5
+ */
6
+ export declare const ActiveTrail: ({ ancestors, tree }: {
7
+ ancestors: readonly string[];
8
+ tree: OutlineTreeNodes;
9
+ }) => import("react").JSX.Element | null;
@@ -0,0 +1,81 @@
1
+ import "../../../_virtual/_rolldown/runtime.js";
2
+ import { useDiagram } from "../../../hooks/safeContext.js";
3
+ import { flowPresentation } from "./presentation.js";
4
+ import { collectTrail, firstStepOf } from "./tree.js";
5
+ import { IconChevronRight } from "@tabler/icons-react";
6
+ import { Fragment } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { HStack, styled } from "@likec4/styles/jsx";
9
+ //#region src/likec4diagram/ui/sequence-outline/ActiveTrail.tsx
10
+ /**
11
+ * Sticky "you are here" trail: the fragments the active step is nested inside.
12
+ * Each segment jumps the walkthrough to the first step of that fragment.
13
+ */
14
+ var ActiveTrail = ({ ancestors, tree }) => {
15
+ const diagram = useDiagram();
16
+ const trail = collectTrail(tree, ancestors);
17
+ if (trail.length === 0) return null;
18
+ return /* @__PURE__ */ jsx(HStack, {
19
+ css: {
20
+ gap: "1",
21
+ flexWrap: "wrap",
22
+ marginBottom: "1.5",
23
+ paddingInline: "2.5",
24
+ paddingBlock: "1.5",
25
+ bg: "likec4.panel.bg",
26
+ borderBottom: "panel",
27
+ textStyle: "dimmed.xxs",
28
+ fontWeight: "semibold",
29
+ letterSpacing: "caps.sm",
30
+ textTransform: "uppercase",
31
+ userSelect: "none",
32
+ "& svg": {
33
+ flex: "none",
34
+ opacity: "[0.5]"
35
+ }
36
+ },
37
+ children: trail.map((node, i) => {
38
+ const { paletteClass, tag } = flowPresentation[node.nodeProps.type];
39
+ const label = node.nodeProps.title ? `${tag} ${node.nodeProps.title}` : tag;
40
+ const last = i === trail.length - 1;
41
+ const firstStep = firstStepOf(node.children);
42
+ return /* @__PURE__ */ jsxs(Fragment, { children: [i > 0 && /* @__PURE__ */ jsx(IconChevronRight, { size: 10 }), /* @__PURE__ */ jsx(styled.button, {
43
+ type: "button",
44
+ className: last ? paletteClass : void 0,
45
+ title: `Jump to the first step of ${label}`,
46
+ disabled: !firstStep,
47
+ onClick: () => firstStep && diagram.walkthroughStep({ step: firstStep }),
48
+ css: {
49
+ appearance: "none",
50
+ border: "none",
51
+ background: "transparent",
52
+ padding: "0",
53
+ font: "inherit",
54
+ letterSpacing: "[inherit]",
55
+ textTransform: "inherit",
56
+ cursor: "pointer",
57
+ rounded: "sm",
58
+ transitionProperty: "colors",
59
+ transition: "fast",
60
+ maxWidth: "[200px]",
61
+ truncate: true,
62
+ ...last ? {
63
+ fontWeight: "extrabold",
64
+ color: "colorPalette.text"
65
+ } : {
66
+ color: "inherit",
67
+ _hover: { color: "text" }
68
+ },
69
+ _disabled: { cursor: "default" },
70
+ _focusVisible: {
71
+ outline: "[2px solid {colors.primary.border}]",
72
+ outlineOffset: "[2px]"
73
+ }
74
+ },
75
+ children: label
76
+ })] }, node.value);
77
+ })
78
+ });
79
+ };
80
+ //#endregion
81
+ export { ActiveTrail };
@@ -0,0 +1,11 @@
1
+ import { OutlineTreeNodeFlow } from './types';
2
+ import { StyledComponent } from '@likec4/styles/types';
3
+ export declare const FlowTag: StyledComponent<"div", {
4
+ dimmed?: boolean | undefined;
5
+ }>;
6
+ /** The header line of a sub-flow: its icon, title and operator tag. */
7
+ export declare const FlowRow: ({ node, recession, isCollapsed }: {
8
+ node: OutlineTreeNodeFlow;
9
+ recession: number;
10
+ isCollapsed?: boolean;
11
+ }) => import("react").JSX.Element;
@@ -0,0 +1,70 @@
1
+ import "../../../_virtual/_rolldown/runtime.js";
2
+ import { flowPresentation } from "./presentation.js";
3
+ import { recessed } from "./depth-of-field.js";
4
+ import { css, cva } from "@likec4/styles/css";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { m } from "motion/react";
7
+ import { styled } from "@likec4/styles/jsx";
8
+ import { hstack } from "@likec4/styles/patterns";
9
+ //#region src/likec4diagram/ui/sequence-outline/FlowRow.tsx
10
+ /** Small pill tag for the sub-flow operator (`loop`, `par`, `try`, …). */
11
+ var flowTagBase = cva({
12
+ base: {
13
+ flex: "none",
14
+ paddingInline: "1.5",
15
+ paddingBlock: "0.5",
16
+ rounded: "sm",
17
+ bg: "colorPalette.label",
18
+ color: "colorPalette.text",
19
+ fontSize: "[9px]",
20
+ fontWeight: "bold",
21
+ lineHeight: "xs",
22
+ letterSpacing: "tight",
23
+ textTransform: "uppercase",
24
+ userSelect: "none"
25
+ },
26
+ variants: { dimmed: { true: { opacity: "0.7" } } }
27
+ });
28
+ var FlowTag = styled("div", flowTagBase);
29
+ /** The header line of a sub-flow: its icon, title and operator tag. */
30
+ var FlowRow = ({ node, recession, isCollapsed }) => {
31
+ const { tag, Icon } = flowPresentation[node.nodeProps.type];
32
+ return /* @__PURE__ */ jsxs(m.div, {
33
+ layout: true,
34
+ className: hstack(css.raw(recessed, {
35
+ alignItems: "center",
36
+ gap: "1.5",
37
+ marginTop: "2",
38
+ marginBottom: "0.5",
39
+ paddingInline: "1.5",
40
+ paddingBlock: "0.5",
41
+ color: "text",
42
+ userSelect: "none"
43
+ }, isCollapsed ? { bg: "colorPalette.label" } : void 0)),
44
+ style: { ["--seq-r"]: recession },
45
+ children: [
46
+ /* @__PURE__ */ jsx(Icon, {
47
+ size: 13,
48
+ className: css({
49
+ flex: "none",
50
+ color: "colorPalette.text"
51
+ })
52
+ }),
53
+ /* @__PURE__ */ jsx(styled.span, {
54
+ css: {
55
+ flex: "1",
56
+ minWidth: "0",
57
+ fontSize: "xs",
58
+ fontWeight: "medium",
59
+ whiteSpace: "nowrap",
60
+ overflow: "hidden",
61
+ textOverflow: "ellipsis"
62
+ },
63
+ children: node.nodeProps.title ?? tag
64
+ }),
65
+ /* @__PURE__ */ jsx(FlowTag, { children: tag })
66
+ ]
67
+ });
68
+ };
69
+ //#endregion
70
+ export { FlowRow, FlowTag };
@@ -0,0 +1,2 @@
1
+ /** Prev/next controls, the "you are here" trail, and the scrollable outline itself. */
2
+ export declare const OutlineBody: () => import("react").JSX.Element;
@@ -0,0 +1,106 @@
1
+ import "../../../_virtual/_rolldown/runtime.js";
2
+ import { useDiagram } from "../../../hooks/safeContext.js";
3
+ import { ActiveTrail } from "./ActiveTrail.js";
4
+ import { recessionOf, shadedPanelBg } from "./depth-of-field.js";
5
+ import { useSelectContext } from "./StoreProvider.js";
6
+ import { OutlineNodes } from "./OutlineNodes.js";
7
+ import { css } from "@likec4/styles/css";
8
+ import { IconPlayerSkipBackFilled, IconPlayerSkipForwardFilled } from "@tabler/icons-react";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ import "remeda";
11
+ import "@likec4/core";
12
+ import { Button, ScrollArea } from "@mantine/core";
13
+ import "motion/react";
14
+ import { HStack, styled } from "@likec4/styles/jsx";
15
+ //#region src/likec4diagram/ui/sequence-outline/OutlineBody.tsx
16
+ /** Prev/next controls, the "you are here" trail, and the scrollable outline itself. */
17
+ var OutlineBody = () => {
18
+ const { activeStep, next, prev, tree, ancestors } = useSelectContext((s) => ({
19
+ activeStep: s.activeStep,
20
+ prev: s.prev,
21
+ next: s.next,
22
+ tree: s.outlineTree,
23
+ ancestors: s.ancestors
24
+ }));
25
+ const diagram = useDiagram();
26
+ const activeDepth = ancestors.length;
27
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
28
+ /* @__PURE__ */ jsxs(HStack, {
29
+ css: {
30
+ justifyContent: "space-between",
31
+ alignItems: "center",
32
+ width: "100%",
33
+ paddingInline: "2.5",
34
+ paddingTop: "2",
35
+ paddingBottom: "1"
36
+ },
37
+ children: [
38
+ /* @__PURE__ */ jsx(styled.div, {
39
+ css: {
40
+ flex: "1",
41
+ textStyle: "dimmed.xs",
42
+ fontWeight: "semibold",
43
+ letterSpacing: "caps.sm",
44
+ textTransform: "uppercase",
45
+ userSelect: "none"
46
+ },
47
+ children: "Outline"
48
+ }),
49
+ /* @__PURE__ */ jsx(Button, {
50
+ tabIndex: -1,
51
+ size: "compact-xs",
52
+ variant: "light",
53
+ className: css({ fontSize: "xxs" }),
54
+ leftSection: /* @__PURE__ */ jsx(IconPlayerSkipBackFilled, { size: 10 }),
55
+ onClick: () => prev && diagram.walkthroughStep({ step: prev }),
56
+ disabled: !prev,
57
+ children: "Back"
58
+ }),
59
+ /* @__PURE__ */ jsx(Button, {
60
+ tabIndex: -1,
61
+ size: "compact-xs",
62
+ variant: "light",
63
+ className: css({ fontSize: "xxs" }),
64
+ rightSection: /* @__PURE__ */ jsx(IconPlayerSkipForwardFilled, { size: 10 }),
65
+ onClick: () => next && diagram.walkthroughStep({ step: next }),
66
+ disabled: !next,
67
+ children: "Next"
68
+ })
69
+ ]
70
+ }),
71
+ /* @__PURE__ */ jsx(ActiveTrail, {
72
+ ancestors,
73
+ tree
74
+ }),
75
+ /* @__PURE__ */ jsx(ScrollArea, {
76
+ type: "auto",
77
+ overscrollBehavior: "contain",
78
+ scrollbars: "y",
79
+ offsetScrollbars: "present",
80
+ className: css({
81
+ flex: "1",
82
+ width: "100%",
83
+ minHeight: "0"
84
+ }),
85
+ classNames: { viewport: css(shadedPanelBg, {
86
+ paddingInline: "2",
87
+ paddingBottom: "4",
88
+ transitionProperty: "background",
89
+ transition: "slow"
90
+ }) },
91
+ style: {
92
+ ["--seq-r"]: recessionOf(0, activeDepth),
93
+ ["--seq-badge-bg"]: "var(--colors-primary-body)",
94
+ ["--seq-badge-fg"]: "var(--colors-primary-text)"
95
+ },
96
+ children: /* @__PURE__ */ jsx(OutlineNodes, {
97
+ nodes: tree,
98
+ depth: 0,
99
+ activeStep,
100
+ activeDepth
101
+ })
102
+ })
103
+ ] });
104
+ };
105
+ //#endregion
106
+ export { OutlineBody };
@@ -0,0 +1,2 @@
1
+ /** View title, walkthrough progress and the (optional) view description. */
2
+ export declare const OutlineHeader: () => import("react").JSX.Element;
@@ -0,0 +1,140 @@
1
+ import "../../../_virtual/_rolldown/runtime.js";
2
+ import { useDiagram } from "../../../hooks/safeContext.js";
3
+ import { Markdown } from "../../../base-primitives/Markdown.js";
4
+ import { useSelectContext } from "./StoreProvider.js";
5
+ import { css } from "@likec4/styles/css";
6
+ import { IconDirectionSignFilled } from "@tabler/icons-react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { RichText } from "@likec4/core";
9
+ import { CloseButton, Spoiler } from "@mantine/core";
10
+ import { Box as Box$1, HStack, Txt, VStack, styled } from "@likec4/styles/jsx";
11
+ //#region src/likec4diagram/ui/sequence-outline/OutlineHeader.tsx
12
+ /** View title, walkthrough progress and the (optional) view description. */
13
+ var OutlineHeader = () => {
14
+ const diagram = useDiagram();
15
+ const { title, description, stepnum, stepCount } = useSelectContext((s) => ({
16
+ title: s.title,
17
+ description: s.description,
18
+ stepnum: s.stepNum,
19
+ stepCount: s.flow.steps.length
20
+ }));
21
+ const pad = String(stepCount).length;
22
+ return /* @__PURE__ */ jsxs(VStack, {
23
+ css: {
24
+ gap: "2.5",
25
+ width: "100%",
26
+ paddingInline: "2.5",
27
+ paddingBlock: "2",
28
+ borderBottom: "panel"
29
+ },
30
+ children: [/* @__PURE__ */ jsxs(HStack, {
31
+ css: {
32
+ gap: "2.5",
33
+ alignItems: "flex-start",
34
+ width: "100%",
35
+ padding: "0"
36
+ },
37
+ children: [
38
+ /* @__PURE__ */ jsx(Box$1, {
39
+ css: {
40
+ flex: "none",
41
+ display: "flex",
42
+ alignItems: "center",
43
+ justifyContent: "center",
44
+ boxSize: "[20px]",
45
+ rounded: "sm",
46
+ colorPalette: "subflow.loop",
47
+ bg: "colorPalette.label",
48
+ color: "colorPalette.text"
49
+ },
50
+ children: /* @__PURE__ */ jsx(IconDirectionSignFilled, { size: 14 })
51
+ }),
52
+ /* @__PURE__ */ jsxs(VStack, {
53
+ css: {
54
+ gap: "0",
55
+ alignItems: "stretch",
56
+ flex: "1",
57
+ minWidth: "0"
58
+ },
59
+ children: [
60
+ /* @__PURE__ */ jsx(styled.div, {
61
+ css: {
62
+ fontSize: "sm",
63
+ fontWeight: "semibold",
64
+ color: "text",
65
+ whiteSpace: "nowrap",
66
+ overflow: "hidden",
67
+ textOverflow: "ellipsis"
68
+ },
69
+ children: title ?? "Sequence"
70
+ }),
71
+ /* @__PURE__ */ jsxs(styled.div, {
72
+ css: {
73
+ marginTop: "0.5",
74
+ textStyle: "dimmed.xxs",
75
+ fontWeight: "medium",
76
+ letterSpacing: "caps.sm",
77
+ textTransform: "uppercase",
78
+ fontVariantNumeric: "tabular-nums",
79
+ userSelect: "none"
80
+ },
81
+ children: [
82
+ "Step ",
83
+ String(stepnum).padStart(pad, "0"),
84
+ " / ",
85
+ stepCount
86
+ ]
87
+ }),
88
+ /* @__PURE__ */ jsx(Box$1, {
89
+ css: {
90
+ height: "[2px]",
91
+ marginTop: "1.5",
92
+ rounded: "xs",
93
+ bg: "border.subtle",
94
+ overflow: "hidden"
95
+ },
96
+ children: /* @__PURE__ */ jsx(styled.div, {
97
+ css: {
98
+ height: "100%",
99
+ rounded: "xs",
100
+ bg: "primary.body",
101
+ transitionProperty: "[width]",
102
+ transition: "slow"
103
+ },
104
+ style: { width: `${stepnum / stepCount * 100}%` }
105
+ })
106
+ })
107
+ ]
108
+ }),
109
+ /* @__PURE__ */ jsx(Box$1, {
110
+ css: {
111
+ flex: "none",
112
+ alignItems: "center",
113
+ justifyContent: "center"
114
+ },
115
+ children: /* @__PURE__ */ jsx(CloseButton, {
116
+ size: "sm",
117
+ onClick: () => diagram.stopWalkthrough()
118
+ })
119
+ })
120
+ ]
121
+ }), description && /* @__PURE__ */ jsx(Spoiler, {
122
+ showLabel: /* @__PURE__ */ jsx(Txt, {
123
+ size: "xxs",
124
+ children: "show description"
125
+ }),
126
+ hideLabel: /* @__PURE__ */ jsx(Txt, {
127
+ size: "xxs",
128
+ children: "hide"
129
+ }),
130
+ maxHeight: 16,
131
+ children: /* @__PURE__ */ jsx(Markdown, {
132
+ value: RichText.from(description),
133
+ className: css({ color: "text.dimmed" }),
134
+ fontSize: "xxs"
135
+ })
136
+ })]
137
+ });
138
+ };
139
+ //#endregion
140
+ export { OutlineHeader };
@@ -0,0 +1,17 @@
1
+ import { StepPath } from '@likec4/core';
2
+ import { OutlineTreeNodes } from './types';
3
+ export type OutlineNodesProps = {
4
+ nodes: OutlineTreeNodes;
5
+ /** Nesting level of `nodes`, 0 at the root of the outline. */
6
+ depth: number;
7
+ activeStep: StepPath;
8
+ /** Nesting level the walkthrough currently stands on. */
9
+ activeDepth: number;
10
+ };
11
+ /**
12
+ * Renders one nesting level of the outline, recursing into sub-flows.
13
+ *
14
+ * A fragment on the path to the active step is framed and tinted; every other level is
15
+ * pushed back by {@link recessionOf}.
16
+ */
17
+ export declare function OutlineNodes(props: OutlineNodesProps): import("react").JSX.Element;
@@ -0,0 +1,83 @@
1
+ import "../../../_virtual/_rolldown/runtime.js";
2
+ import { SEQ_TRANSITION } from "./motion.js";
3
+ import { flowPresentation } from "./presentation.js";
4
+ import { isOutlineFlowNode } from "./types.js";
5
+ import { activeFrame, activeFrameBorder, levelBand, nestedBand, recessionOf } from "./depth-of-field.js";
6
+ import { FlowRow } from "./FlowRow.js";
7
+ import { StepRow } from "./StepRow.js";
8
+ import { useIsCollapsed, useSelectContext } from "./StoreProvider.js";
9
+ import { css, cx } from "@likec4/styles/css";
10
+ import { Activity } from "react";
11
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
+ import { m } from "motion/react";
13
+ import "@likec4/styles/jsx";
14
+ //#region src/likec4diagram/ui/sequence-outline/OutlineNodes.tsx
15
+ function renderNodes({ nodes, depth, activeStep, activeDepth }) {
16
+ const recession = recessionOf(depth, activeDepth);
17
+ return nodes.map((node) => {
18
+ if (!isOutlineFlowNode(node)) return /* @__PURE__ */ jsx(StepRow, {
19
+ node,
20
+ recession,
21
+ active: node.value === activeStep
22
+ }, node.value);
23
+ return /* @__PURE__ */ jsx(OutlineFlowNode, {
24
+ node,
25
+ depth,
26
+ activeStep,
27
+ activeDepth
28
+ }, node.value);
29
+ });
30
+ }
31
+ /**
32
+ * Renders one nesting level of the outline, recursing into sub-flows.
33
+ *
34
+ * A fragment on the path to the active step is framed and tinted; every other level is
35
+ * pushed back by {@link recessionOf}.
36
+ */
37
+ function OutlineNodes(props) {
38
+ return /* @__PURE__ */ jsx(Fragment$1, { children: renderNodes(props) });
39
+ }
40
+ function OutlineFlowNode({ node, depth, activeStep, activeDepth }) {
41
+ const recession = recessionOf(depth, activeDepth);
42
+ const isCollapsed = useIsCollapsed(node.value);
43
+ const ancestorIndex = useSelectContext((s) => s.ancestors.indexOf(node.value));
44
+ const onPath = ancestorIndex >= 0;
45
+ const myDepth = onPath ? ancestorIndex + 1 : depth;
46
+ const isCurrentLevel = activeDepth === myDepth;
47
+ const { paletteClass } = flowPresentation[node.nodeProps.type];
48
+ return /* @__PURE__ */ jsxs("div", {
49
+ className: cx(paletteClass, css(levelBand, isCurrentLevel && !onPath && nestedBand, isCurrentLevel && onPath && activeFrame)),
50
+ style: {
51
+ ["--seq-r"]: recessionOf(myDepth, activeDepth),
52
+ ["--seq-frame-bg"]: "var(--colors-color-palette)",
53
+ ["--seq-badge-bg"]: "var(--colors-color-palette-text)",
54
+ ["--seq-badge-fg"]: "var(--colors-likec4-panel-bg)"
55
+ },
56
+ children: [
57
+ isCurrentLevel && onPath && /* @__PURE__ */ jsx(m.div, {
58
+ layoutId: "likec4-seq-active-frame",
59
+ layout: "position",
60
+ layoutAnchor: false,
61
+ layoutCrossfade: false,
62
+ className: activeFrameBorder,
63
+ transition: SEQ_TRANSITION
64
+ }),
65
+ /* @__PURE__ */ jsx(FlowRow, {
66
+ node,
67
+ isCollapsed,
68
+ recession
69
+ }),
70
+ /* @__PURE__ */ jsx(Activity, {
71
+ mode: isCollapsed ? "hidden" : "visible",
72
+ children: /* @__PURE__ */ jsx(OutlineNodes, {
73
+ nodes: node.children,
74
+ depth: myDepth,
75
+ activeStep,
76
+ activeDepth
77
+ })
78
+ })
79
+ ]
80
+ });
81
+ }
82
+ //#endregion
83
+ export { OutlineNodes };
@@ -1,2 +1,6 @@
1
1
  import { MemoExoticComponent } from 'react';
2
+ /**
3
+ * Side panel shown while a dynamic view walkthrough is running: the view title and progress,
4
+ * the trail of fragments the current step sits in, and the outline of every step.
5
+ */
2
6
  export declare const SequenceOutlinePanel: MemoExoticComponent<() => import("react").JSX.Element>;