@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.
Files changed (202) hide show
  1. package/dist/LikeC4Diagram.d.ts +1 -1
  2. package/dist/LikeC4Diagram.js +36 -21
  3. package/dist/LikeC4Diagram.props.d.ts +23 -0
  4. package/dist/LikeC4MantineProvider.d.ts +24 -0
  5. package/dist/LikeC4MantineProvider.js +156 -0
  6. package/dist/LikeC4ProjectsOverview.js +1 -1
  7. package/dist/LikeC4ProjectsProvider.d.ts +17 -2
  8. package/dist/LikeC4Styles.d.ts +13 -3
  9. package/dist/LikeC4Styles.js +8 -5
  10. package/dist/LikeC4View.js +2 -2
  11. package/dist/StaticLikeC4Diagram.d.ts +1 -1
  12. package/dist/base/BaseXYFlow.d.ts +1 -1
  13. package/dist/base/BaseXYFlow.js +11 -8
  14. package/dist/base/const.d.ts +1 -0
  15. package/dist/base/const.js +3 -1
  16. package/dist/base-primitives/Markdown.d.ts +3 -3
  17. package/dist/base-primitives/compound/actionbtns.css.d.ts +3 -3
  18. package/dist/base-primitives/compound/actionbtns.css.js +3 -3
  19. package/dist/base-primitives/element/ElementTags.d.ts +2 -2
  20. package/dist/base-primitives/element/ElementTags.js +5 -5
  21. package/dist/components/EmptyBox.d.ts +3 -0
  22. package/dist/components/EmptyBox.js +9 -0
  23. package/dist/components/ErrorFallback.js +7 -6
  24. package/dist/components/FloatingWindow.d.ts +18 -0
  25. package/dist/components/FloatingWindow.js +89 -0
  26. package/dist/components/Link.js +7 -7
  27. package/dist/components/NavigationPanel.d.ts +2 -2
  28. package/dist/components/NavigationPanel.js +5 -6
  29. package/dist/components/SearchControl.css.js +10 -12
  30. package/dist/components/ViewIcon.d.ts +11 -0
  31. package/dist/components/ViewIcon.js +71 -0
  32. package/dist/context/DiagramEventHandlers.js +2 -1
  33. package/dist/context/EnsureMantine.js +3 -3
  34. package/dist/context/IconRenderer.d.ts +2 -1
  35. package/dist/context/IconRenderer.js +38 -2
  36. package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
  37. package/dist/context/TagStylesContext.d.ts +9 -3
  38. package/dist/context/TagStylesContext.js +19 -19
  39. package/dist/custom/index.d.ts +3 -0
  40. package/dist/custom/index.js +6 -3
  41. package/dist/editor/applyChangesToManualLayout.js +4 -1
  42. package/dist/hooks/safeContext.d.ts +12 -4
  43. package/dist/hooks/safeContext.js +2 -2
  44. package/dist/hooks/useCurrentView.js +5 -5
  45. package/dist/hooks/useDiagram.js +1 -23
  46. package/dist/hooks/useDiagramCompareLayout.d.ts +4 -4
  47. package/dist/hooks/useDiagramCompareLayout.js +14 -16
  48. package/dist/hooks/useEditorActor.js +3 -5
  49. package/dist/hooks/useLikeC4Model.js +8 -3
  50. package/dist/hooks/useLikeC4Project.d.ts +4 -3
  51. package/dist/hooks/useOverlaysActor.d.ts +1 -1
  52. package/dist/index.d.ts +4 -3
  53. package/dist/index.js +6 -5
  54. package/dist/likec4diagram/DiagramXYFlow.d.ts +5 -0
  55. package/dist/likec4diagram/DiagramXYFlow.js +20 -13
  56. package/dist/likec4diagram/custom/edges/EdgeDrifts.js +4 -4
  57. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +1 -1
  58. package/dist/likec4diagram/custom/edges/edges.css.js +13 -13
  59. package/dist/likec4diagram/custom/nodes/NodeDrifts.js +2 -2
  60. package/dist/likec4diagram/custom/nodes/NodeNotes.js +4 -4
  61. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +2 -2
  62. package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +8 -5
  63. package/dist/likec4diagram/custom/nodes/nodes.js +2 -2
  64. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
  65. package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +5 -5
  66. package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +1 -1
  67. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +2 -0
  68. package/dist/likec4diagram/relationship-popover/components.d.ts +1 -1
  69. package/dist/likec4diagram/relationship-popover/components.js +6 -2
  70. package/dist/likec4diagram/state/DiagramActorProvider.d.ts +7 -2
  71. package/dist/likec4diagram/state/DiagramActorProvider.js +20 -4
  72. package/dist/likec4diagram/state/diagram-api.d.ts +2 -2
  73. package/dist/likec4diagram/state/diagram-api.js +3 -2
  74. package/dist/likec4diagram/state/machine.actions.js +9 -6
  75. package/dist/likec4diagram/state/machine.actions.layout.d.ts +1 -0
  76. package/dist/likec4diagram/state/machine.actions.layout.js +7 -5
  77. package/dist/likec4diagram/state/machine.setup.d.ts +10 -1
  78. package/dist/likec4diagram/state/machine.setup.js +6 -1
  79. package/dist/likec4diagram/state/machine.state.initializing.d.ts +2 -26
  80. package/dist/likec4diagram/state/machine.state.initializing.js +9 -6
  81. package/dist/likec4diagram/state/machine.state.navigating.js +1 -1
  82. package/dist/likec4diagram/state/machine.state.ready.d.ts +134 -3
  83. package/dist/likec4diagram/state/machine.state.ready.js +2 -1
  84. package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +106 -1
  85. package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +39 -6
  86. package/dist/likec4diagram/state/utils.d.ts +1 -1
  87. package/dist/likec4diagram/state/utils.js +1 -2
  88. package/dist/likec4diagram/ui/LayoutDriftFrame.js +16 -10
  89. package/dist/likec4diagram/ui/index.d.ts +1 -1
  90. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +13 -15
  91. package/dist/likec4diagram/ui/notation/NotationPanel.js +9 -9
  92. package/dist/likec4diagram/ui/sequence-outline/ActiveTrail.d.ts +9 -0
  93. package/dist/likec4diagram/ui/sequence-outline/ActiveTrail.js +81 -0
  94. package/dist/likec4diagram/ui/sequence-outline/FlowRow.d.ts +11 -0
  95. package/dist/likec4diagram/ui/sequence-outline/FlowRow.js +70 -0
  96. package/dist/likec4diagram/ui/sequence-outline/OutlineBody.d.ts +2 -0
  97. package/dist/likec4diagram/ui/sequence-outline/OutlineBody.js +106 -0
  98. package/dist/likec4diagram/ui/sequence-outline/OutlineHeader.d.ts +2 -0
  99. package/dist/likec4diagram/ui/sequence-outline/OutlineHeader.js +140 -0
  100. package/dist/likec4diagram/ui/sequence-outline/OutlineNodes.d.ts +17 -0
  101. package/dist/likec4diagram/ui/sequence-outline/OutlineNodes.js +83 -0
  102. package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +4 -0
  103. package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +49 -527
  104. package/dist/likec4diagram/ui/sequence-outline/StepBadge.d.ts +8 -0
  105. package/dist/likec4diagram/ui/sequence-outline/StepBadge.js +52 -0
  106. package/dist/likec4diagram/ui/sequence-outline/StepRow.d.ts +7 -0
  107. package/dist/likec4diagram/ui/sequence-outline/StepRow.js +190 -0
  108. package/dist/likec4diagram/ui/sequence-outline/StoreProvider.d.ts +238 -0
  109. package/dist/likec4diagram/ui/sequence-outline/StoreProvider.js +94 -0
  110. package/dist/likec4diagram/ui/sequence-outline/depth-of-field.d.ts +21 -0
  111. package/dist/likec4diagram/ui/sequence-outline/depth-of-field.js +71 -0
  112. package/dist/likec4diagram/ui/sequence-outline/index.d.ts +2 -0
  113. package/dist/likec4diagram/ui/sequence-outline/motion.d.ts +13 -0
  114. package/dist/likec4diagram/ui/sequence-outline/motion.js +21 -0
  115. package/dist/likec4diagram/ui/sequence-outline/presentation.d.ts +10 -0
  116. package/dist/likec4diagram/ui/sequence-outline/presentation.js +80 -0
  117. package/dist/likec4diagram/ui/sequence-outline/tree.d.ts +9 -0
  118. package/dist/likec4diagram/ui/sequence-outline/tree.js +67 -0
  119. package/dist/likec4diagram/ui/sequence-outline/{state.d.ts → types.d.ts} +4 -2
  120. package/dist/likec4diagram/ui/sequence-outline/types.js +12 -0
  121. package/dist/likec4diagram/useLayoutConstraints.js +9 -12
  122. package/dist/likec4diagram/xyflow-sequence/sequence-view-to-xy.js +1 -0
  123. package/dist/likec4diagram/xyflow-sequence/utils.js +0 -1
  124. package/dist/navigationpanel/NavigationPanel.js +45 -41
  125. package/dist/navigationpanel/NavigationPanelControls.js +102 -63
  126. package/dist/navigationpanel/NavigationPanelDropdown.js +51 -77
  127. package/dist/navigationpanel/_common.d.ts +6 -6
  128. package/dist/navigationpanel/_common.js +31 -42
  129. package/dist/navigationpanel/actor.actions.js +6 -5
  130. package/dist/navigationpanel/actor.js +2 -2
  131. package/dist/navigationpanel/actor.setup.d.ts +6 -6
  132. package/dist/navigationpanel/actor.setup.js +2 -1
  133. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -4
  134. package/dist/navigationpanel/comparepanel/ComparePanel.js +8 -10
  135. package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -1
  136. package/dist/navigationpanel/comparepanel/DriftsSummary.js +11 -9
  137. package/dist/navigationpanel/controls/LayoutWarning.js +69 -72
  138. package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -1
  139. package/dist/navigationpanel/controls/NavigationButtons.js +8 -8
  140. package/dist/navigationpanel/controls/OpenSource.d.ts +1 -1
  141. package/dist/navigationpanel/controls/OpenSource.js +5 -8
  142. package/dist/navigationpanel/controls/SearchControl.js +24 -9
  143. package/dist/navigationpanel/controls/ToggleReadonly.d.ts +4 -1
  144. package/dist/navigationpanel/controls/ToggleReadonly.js +56 -76
  145. package/dist/navigationpanel/controls/ViewDetailsButton.d.ts +5 -0
  146. package/dist/navigationpanel/controls/ViewDetailsButton.js +121 -0
  147. package/dist/navigationpanel/controls/index.d.ts +1 -1
  148. package/dist/navigationpanel/dropdown/ProjectsMenu.js +27 -16
  149. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +10 -9
  150. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -8
  151. package/dist/navigationpanel/editorpanel/styles.js +8 -15
  152. package/dist/navigationpanel/hooks.d.ts +6 -2
  153. package/dist/navigationpanel/styles.css.d.ts +2 -2
  154. package/dist/navigationpanel/styles.css.js +0 -1
  155. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -2
  156. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +5 -4
  157. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +9 -36
  158. package/dist/navigationpanel/walkthrough/DynamicViewModeSwitcher.d.ts +1 -0
  159. package/dist/navigationpanel/walkthrough/DynamicViewModeSwitcher.js +49 -0
  160. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +8 -8
  161. package/dist/navigationpanel/windows/ViewDetailsWindow.d.ts +1 -0
  162. package/dist/navigationpanel/windows/ViewDetailsWindow.js +379 -0
  163. package/dist/overlays/Overlays.js +29 -17
  164. package/dist/overlays/element-details/ElementDetailsCard.css.js +28 -36
  165. package/dist/overlays/element-details/ElementDetailsCard.js +1 -1
  166. package/dist/overlays/element-details/MetadataValue.js +18 -16
  167. package/dist/overlays/element-details/TabPanelDeployments.css.js +6 -14
  168. package/dist/overlays/element-details/TabPanelRelationships.css.js +8 -12
  169. package/dist/overlays/element-details/TabPanelStructure.css.js +4 -8
  170. package/dist/overlays/hooks.d.ts +3 -1
  171. package/dist/overlays/overlay/Overlay.js +8 -7
  172. package/dist/overlays/overlaysActor.js +4 -0
  173. package/dist/overlays/relationship-details/SelectEdge.css.js +14 -9
  174. package/dist/overlays/relationship-details/actor.js +1 -1
  175. package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +6 -0
  176. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +11 -6
  177. package/dist/overlays/relationships-browser/SelectElement.css.js +2 -8
  178. package/dist/overlays/relationships-browser/SelectElement.js +5 -1
  179. package/dist/overlays/relationships-browser/actor.js +1 -1
  180. package/dist/overlays/relationships-browser/custom/EmptyNode.js +7 -9
  181. package/dist/projects-overview/actor.js +1 -1
  182. package/dist/search/Search.js +9 -7
  183. package/dist/search/components/ElementsColumn.css.js +6 -5
  184. package/dist/search/components/ElementsColumn.js +4 -3
  185. package/dist/search/components/SearchByTags.js +3 -3
  186. package/dist/search/components/ViewsColum.js +36 -35
  187. package/dist/search/components/ViewsColumn.css.js +4 -4
  188. package/dist/search/components/_shared.css.d.ts +2 -2
  189. package/dist/search/components/_shared.css.js +31 -46
  190. package/dist/search/components/styles.css.js +4 -4
  191. package/dist/shadowroot/ShadowRoot.js +2 -3
  192. package/dist/styles2.js +1 -1
  193. package/dist/utils/index.js +1 -1
  194. package/package.json +10 -10
  195. package/panda.buildinfo.json +340 -298
  196. package/styles-min.css +1 -1
  197. package/styles.css +1 -1
  198. package/dist/context/DefaultMantineProvider.d.ts +0 -2
  199. package/dist/context/DefaultMantineProvider.js +0 -48
  200. package/dist/likec4diagram/ui/sequence-outline/state.js +0 -55
  201. package/dist/navigationpanel/controls/DetailsControls.d.ts +0 -2
  202. package/dist/navigationpanel/controls/DetailsControls.js +0 -224
@@ -1,541 +1,63 @@
1
1
  import "../../../_virtual/_rolldown/runtime.js";
2
- import { selectDiagramContext, useDiagram, useDiagramSelector } from "../../../hooks/safeContext.js";
3
- import { useOnDiagramEvent } from "../../../hooks/useDiagram.js";
4
- import { Markdown } from "../../../base-primitives/Markdown.js";
5
2
  import { PortalToContainer } from "../../../components/PortalToContainer.js";
6
- import { useTreeData } from "./state.js";
7
- import { css, cx } from "@likec4/styles/css";
8
- import { IconAlertTriangle, IconArrowFork, IconArrowGuide, IconArrowRight, IconChevronRight, IconCornerDownRight, IconDirectionSignFilled, IconListTree, IconPlayerSkipBackFilled, IconPlayerSkipForwardFilled, IconPlayerStop, IconRepeat } from "@tabler/icons-react";
9
- import { memo, useMemo } from "react";
10
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
- import { mapToObj, only } from "remeda";
12
- import { RichText, dynamicViewFlow, flowAncestors, hasProp, isDynamicView } from "@likec4/core";
13
- import { ActionIcon, Button, CloseButton, ScrollArea, Spoiler, Tooltip, Tree, useTree } from "@mantine/core";
14
- import { AnimatePresence, m } from "motion/react";
15
- import { Box as Box$1, HStack, Txt, VStack, styled } from "@likec4/styles/jsx";
3
+ import { SEQ_TRANSITION } from "./motion.js";
4
+ import { StoreProvider, useOutlinePanelWidth } from "./StoreProvider.js";
5
+ import { OutlineBody } from "./OutlineBody.js";
6
+ import { OutlineHeader } from "./OutlineHeader.js";
7
+ import { memo } from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { AnimatePresence, LayoutGroup, MotionConfig, m } from "motion/react";
16
10
  import { vstack } from "@likec4/styles/patterns";
17
- import { extractViewTitleFromPath } from "@likec4/core/model";
18
11
  //#region src/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.tsx
19
12
  /**
20
- * PandaCSS `colorPalette` classes for each sub-flow palette.
21
- * Declared as literals so the static analyzer can extract them.
13
+ * Side panel shown while a dynamic view walkthrough is running: the view title and progress,
14
+ * the trail of fragments the current step sits in, and the outline of every step.
22
15
  */
23
- var palette = {
24
- loop: css({ colorPalette: "subflow.loop" }),
25
- opt: css({ colorPalette: "subflow.opt" }),
26
- par: css({ colorPalette: "subflow.par" }),
27
- break: css({ colorPalette: "subflow.break" }),
28
- alt: css({ colorPalette: "subflow.alt" }),
29
- try: css({ colorPalette: "subflow.try" })
30
- };
31
- var flowPresentation = {
32
- loop: {
33
- paletteClass: palette.loop,
34
- tag: "loop",
35
- Icon: IconRepeat
36
- },
37
- opt: {
38
- paletteClass: palette.opt,
39
- tag: "opt",
40
- Icon: IconArrowGuide
41
- },
42
- par: {
43
- paletteClass: palette.par,
44
- tag: "par",
45
- Icon: IconArrowFork
46
- },
47
- break: {
48
- paletteClass: palette.break,
49
- tag: "break",
50
- Icon: IconPlayerStop
51
- },
52
- alt: {
53
- paletteClass: palette.alt,
54
- tag: "alt",
55
- Icon: IconArrowFork
56
- },
57
- "alt-when": {
58
- paletteClass: palette.alt,
59
- tag: "when",
60
- Icon: IconCornerDownRight
61
- },
62
- "alt-else": {
63
- paletteClass: palette.alt,
64
- tag: "else",
65
- Icon: IconCornerDownRight
66
- },
67
- "alt-if": {
68
- paletteClass: palette.alt,
69
- tag: "if",
70
- Icon: IconCornerDownRight
71
- },
72
- try: {
73
- paletteClass: palette.try,
74
- tag: "try",
75
- Icon: IconAlertTriangle
76
- },
77
- "try-block": {
78
- paletteClass: palette.try,
79
- tag: "block",
80
- Icon: IconCornerDownRight
81
- },
82
- "try-catch": {
83
- paletteClass: palette.break,
84
- tag: "catch",
85
- Icon: IconCornerDownRight
86
- },
87
- "try-finally": {
88
- paletteClass: palette.break,
89
- tag: "finally",
90
- Icon: IconCornerDownRight
91
- }
92
- };
93
- var SectionLabel = styled("div", { base: {
94
- textStyle: "dimmed.xs",
95
- fontWeight: "semibold",
96
- letterSpacing: "wider",
97
- textTransform: "uppercase",
98
- userSelect: "none"
99
- } });
100
- /** Numeric step badge (e.g. `12`). */
101
- var StepNum = styled("div", { base: {
102
- flex: "none",
103
- display: "flex",
104
- alignItems: "center",
105
- justifyContent: "center",
106
- minWidth: "22px",
107
- height: "18px",
108
- paddingInline: "1",
109
- rounded: "sm",
110
- bg: "surface.sunken",
111
- color: "text.dimmed",
112
- fontSize: "[10px]",
113
- fontWeight: "bold",
114
- fontVariantNumeric: "tabular-nums",
115
- userSelect: "none"
116
- } });
117
- /** Small pill tag for the sub-flow operator (`loop`, `par`, `try`, …). */
118
- var FlowTag = styled("div", { base: {
119
- flex: "none",
120
- paddingInline: "1.5",
121
- paddingBlock: "0.5",
122
- rounded: "sm",
123
- bg: "colorPalette.label",
124
- color: "colorPalette.text",
125
- fontSize: "[9px]",
126
- fontWeight: "bold",
127
- lineHeight: "xs",
128
- letterSpacing: "tight",
129
- textTransform: "uppercase",
130
- userSelect: "none"
131
- } });
132
- var rowBase = css.raw({
133
- display: "flex",
134
- alignItems: "center",
135
- gap: "2",
136
- width: "100%",
137
- paddingInline: "1.5",
138
- paddingBlock: "1",
139
- rounded: "md",
140
- cursor: "pointer",
141
- color: "text",
142
- userSelect: "none",
143
- transition: "background-color 120ms ease",
144
- _hover: { bg: "surface.sunken/60" },
145
- "&[data-selected=\"true\"]": {
146
- bg: "mantine.primary.light",
147
- color: "mantine.primary.lightColor"
148
- }
149
- });
150
- var labelText = css.raw({
151
- flex: "1",
152
- minWidth: "0",
153
- fontSize: "xs",
154
- whiteSpace: "nowrap",
155
- overflow: "hidden",
156
- textOverflow: "ellipsis"
157
- });
158
- var LabelSpan = styled("span", { base: labelText });
159
- /**
160
- * Height of the leading step badge; also the line-height of the first label line
161
- * so that a multiline label keeps its first line aligned with the badge/arrow.
162
- */
163
- var rowLeadingHeight = "18px";
164
- /** Groups the step badge and arrow so they stay centered against the first label line. */
165
- var leadingIcons = css.raw({
166
- flex: "none",
167
- display: "flex",
168
- alignItems: "center",
169
- gap: "2",
170
- height: rowLeadingHeight
171
- });
172
- /** Multiline label: preserves explicit newlines, wraps long lines, first line aligned with the badge. */
173
- var multilineLabelText = css.raw({
174
- flex: "1",
175
- minWidth: "0",
176
- fontSize: "xs",
177
- lineHeight: rowLeadingHeight,
178
- whiteSpace: "pre-line",
179
- overflowWrap: "anywhere"
180
- });
181
- var MultilineLabelSpan = styled("span", { base: multilineLabelText });
182
- var selectFlow = selectDiagramContext((s) => {
183
- const title = extractViewTitleFromPath(s.view.title ?? "Untitled");
184
- const description = s.view.description;
185
- const activeStep = s.activeWalkthrough?.stepId ?? null;
186
- if (activeStep) return {
187
- flow: isDynamicView(s.view) && hasProp(s.view, "flow") ? dynamicViewFlow(s.view) : null,
188
- activeStep,
189
- title,
190
- description,
191
- outlinePanelWidth: s.activeWalkthrough?.outlinePanelWidth ?? 0,
192
- collapsed: s.collapsedSequenceFlows
193
- };
194
- return {
195
- flow: null,
196
- activeStep: null,
197
- title,
198
- description
199
- };
200
- });
201
16
  var SequenceOutlinePanel = memo(() => {
202
- const props = useDiagramSelector(selectFlow);
203
- return /* @__PURE__ */ jsx(PortalToContainer, { children: /* @__PURE__ */ jsx(AnimatePresence, {
204
- propagate: true,
205
- children: props.activeStep && props.flow && /* @__PURE__ */ jsx(m.div, {
206
- layout: "position",
207
- className: vstack({
208
- position: "absolute",
209
- top: "0",
210
- left: "0",
211
- layerStyle: "likec4.panel",
212
- rounded: "0",
213
- gap: "0",
214
- padding: "0",
215
- pointerEvents: "all",
216
- maxWidth: "85cqw",
217
- height: "100cqh",
218
- maxHeight: "100cqh",
219
- cursor: "default",
220
- overflow: "hidden"
221
- }),
222
- style: { width: props.outlinePanelWidth },
223
- initial: {
224
- opacity: .5,
225
- translateX: -40
226
- },
227
- animate: {
228
- opacity: 1,
229
- translateX: 0
230
- },
231
- exit: {
232
- opacity: 0,
233
- translateX: -props.outlinePanelWidth
234
- },
235
- children: /* @__PURE__ */ jsx(SequenceOutlinePanelBody, {
236
- title: props.title,
237
- description: props.description,
238
- activeStep: props.activeStep,
239
- flow: props.flow,
240
- collapsed: props.collapsed
241
- })
242
- })
243
- }) });
17
+ return /* @__PURE__ */ jsx(StoreProvider, { children: /* @__PURE__ */ jsx(PortalToContainer, { children: /* @__PURE__ */ jsx(MotionConfig, {
18
+ transition: SEQ_TRANSITION,
19
+ children: /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsx(AnimatePresence, {
20
+ propagate: true,
21
+ mode: "popLayout",
22
+ anchorY: "top",
23
+ children: /* @__PURE__ */ jsxs(SequenceOutlinePanelShell, { children: [/* @__PURE__ */ jsx(OutlineHeader, {}), /* @__PURE__ */ jsx(OutlineBody, {})] })
24
+ }) })
25
+ }) }) });
244
26
  });
245
27
  SequenceOutlinePanel.displayName = "SequenceOutlinePanel";
246
- function SequenceOutlinePanelBody(props) {
247
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(OutlineHeader, {
248
- title: props.title,
249
- flow: props.flow,
250
- description: props.description
251
- }), /* @__PURE__ */ jsx(OutlineBody, {
252
- activeStep: props.activeStep,
253
- flow: props.flow,
254
- collapsed: props.collapsed
255
- })] });
256
- }
257
- var OutlineHeader = ({ title, flow, description }) => {
258
- const diagram = useDiagram();
259
- const stepCount = flow.stepsCount;
260
- return /* @__PURE__ */ jsxs(VStack, {
261
- css: {
262
- gap: "2.5",
263
- width: "100%",
264
- paddingInline: "2.5",
265
- paddingBlock: "2",
266
- borderBottom: "1px solid {colors.likec4.panel.border}"
267
- },
268
- children: [/* @__PURE__ */ jsxs(HStack, {
269
- css: {
270
- gap: "2.5",
271
- alignItems: "center",
272
- width: "100%",
273
- padding: "0"
274
- },
275
- children: [
276
- /* @__PURE__ */ jsx(Box$1, {
277
- css: {
278
- flex: "none",
279
- display: "flex",
280
- alignItems: "center",
281
- justifyContent: "center",
282
- boxSize: "20px",
283
- rounded: "sm",
284
- colorPalette: "subflow.loop",
285
- bg: "colorPalette.label",
286
- color: "colorPalette.text"
287
- },
288
- children: /* @__PURE__ */ jsx(IconDirectionSignFilled, { size: 14 })
289
- }),
290
- /* @__PURE__ */ jsxs(VStack, {
291
- css: {
292
- gap: "0",
293
- alignItems: "stretch",
294
- flex: "1",
295
- minWidth: "0"
296
- },
297
- children: [/* @__PURE__ */ jsx(styled.div, {
298
- css: {
299
- fontSize: "sm",
300
- fontWeight: "semibold",
301
- color: "text",
302
- whiteSpace: "nowrap",
303
- overflow: "hidden",
304
- textOverflow: "ellipsis"
305
- },
306
- children: title ?? "Sequence"
307
- }), /* @__PURE__ */ jsxs(Txt, {
308
- size: "xxs",
309
- dimmed: true,
310
- noUserSelect: true,
311
- children: [
312
- stepCount,
313
- " ",
314
- stepCount === 1 ? "step" : "steps"
315
- ]
316
- })]
317
- }),
318
- /* @__PURE__ */ jsx(Box$1, {
319
- css: {
320
- flex: "none",
321
- alignItems: "center",
322
- justifyContent: "center"
323
- },
324
- children: /* @__PURE__ */ jsx(CloseButton, {
325
- size: "sm",
326
- onClick: () => diagram.stopWalkthrough()
327
- })
328
- })
329
- ]
330
- }), description && /* @__PURE__ */ jsx(Spoiler, {
331
- showLabel: /* @__PURE__ */ jsx(Txt, {
332
- size: "xxs",
333
- children: "show description"
334
- }),
335
- hideLabel: /* @__PURE__ */ jsx(Txt, {
336
- size: "xxs",
337
- children: "hide"
338
- }),
339
- maxHeight: 16,
340
- children: /* @__PURE__ */ jsx(Markdown, {
341
- value: RichText.from(description),
342
- className: css({ color: "text.dimmed" }),
343
- fontSize: "xxs"
344
- })
345
- })]
346
- });
347
- };
348
- var OutlineBody = ({ activeStep, flow, collapsed }) => {
349
- const diagram = useDiagram();
350
- const treeData = useTreeData(flow, collapsed);
351
- const initialExpandedState = useMemo(() => mapToObj(flowAncestors(activeStep), (id) => [id, true]), []);
352
- const tree = useTree({
353
- initialSelectedState: [activeStep],
354
- initialExpandedState,
355
- multiple: false,
356
- onSelectedStateChange(selected) {
357
- const step = only(selected);
358
- if (step && flow.isStep(step)) diagram.walkthroughStep({ step });
359
- }
360
- });
361
- useOnDiagramEvent("walkthroughStep", ({ stepId }) => {
362
- if (!tree.selectedState.includes(stepId)) {
363
- const ancestors = flowAncestors(stepId);
364
- if (ancestors.length > 0) {
365
- const expanded = { ...tree.expandedState };
366
- for (const parent of ancestors) expanded[parent] = true;
367
- tree.setExpandedState(expanded);
368
- }
369
- tree.setSelectedState([stepId]);
370
- }
371
- });
372
- const allCollapsed = useMemo(() => Object.values(tree.expandedState).every((v) => !v), [tree.expandedState]);
373
- const { prev, next } = flow.prevAndNext(activeStep, (flowId) => collapsed[flowId] ?? false);
374
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(HStack, {
375
- css: {
376
- justifyContent: "space-between",
377
- alignItems: "center",
378
- width: "100%",
379
- paddingInline: "2.5",
380
- paddingTop: "2",
381
- paddingBottom: "1"
382
- },
383
- children: [
384
- /* @__PURE__ */ jsx(SectionLabel, {
385
- flex: "1",
386
- children: "Outline"
387
- }),
388
- /* @__PURE__ */ jsx(Tooltip, {
389
- label: allCollapsed ? "Expand all" : "Collapse all",
390
- fz: "xs",
391
- openDelay: 500,
392
- withinPortal: false,
393
- children: /* @__PURE__ */ jsx(ActionIcon, {
394
- tabIndex: -1,
395
- variant: "subtle",
396
- size: "sm",
397
- onClick: () => allCollapsed ? tree.expandAllNodes() : tree.collapseAllNodes(),
398
- children: /* @__PURE__ */ jsx(IconListTree, { size: 14 })
399
- })
400
- }),
401
- /* @__PURE__ */ jsx(Button, {
402
- tabIndex: -1,
403
- size: "compact-xs",
404
- variant: "light",
405
- className: css({ fontSize: "xxs" }),
406
- leftSection: /* @__PURE__ */ jsx(IconPlayerSkipBackFilled, { size: 10 }),
407
- onClick: () => prev && diagram.walkthroughStep({ step: prev }),
408
- disabled: !prev,
409
- children: "Back"
410
- }),
411
- /* @__PURE__ */ jsx(Button, {
412
- tabIndex: -1,
413
- size: "compact-xs",
414
- variant: "light",
415
- className: css({ fontSize: "xxs" }),
416
- rightSection: /* @__PURE__ */ jsx(IconPlayerSkipForwardFilled, { size: 10 }),
417
- onClick: () => next && diagram.walkthroughStep({ step: next }),
418
- disabled: !next,
419
- children: "Next"
420
- })
421
- ]
422
- }), /* @__PURE__ */ jsx(ScrollArea, {
423
- type: "auto",
424
- overscrollBehavior: "contain",
425
- className: css({
426
- flex: "1",
427
- width: "100%",
428
- minHeight: "0"
429
- }),
430
- children: /* @__PURE__ */ jsx(Tree, {
431
- levelOffset: "var(--spacing-2\\.5)",
432
- data: treeData,
433
- tree,
434
- selectOnClick: true,
435
- classNames: { root: css({
436
- paddingInline: "2",
437
- paddingBottom: "3"
438
- }) },
439
- styles: { node: { paddingInlineStart: "var(--label-offset)" } },
440
- renderNode: renderTreeNode
441
- })
442
- })] });
443
- };
444
- var renderTreeNode = ((payload) => {
445
- return payload.node.nodeProps.type === "step" ? /* @__PURE__ */ jsx(StepRow, { ...payload }) : /* @__PURE__ */ jsx(FlowRow, { ...payload });
446
- });
447
- var StepRow = ({ node, elementProps, selected }) => {
448
- const { stepnum, source, target, label, notes } = node.nodeProps;
449
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Box$1, {
450
- ...elementProps,
451
- className: cx(elementProps.className, css(rowBase, { alignItems: "flex-start" })),
452
- children: [/* @__PURE__ */ jsxs(Box$1, {
453
- className: css(leadingIcons),
454
- children: [/* @__PURE__ */ jsx(StepNum, { children: stepnum }), /* @__PURE__ */ jsx(IconArrowRight, {
455
- size: 13,
456
- className: css({
457
- flex: "none",
458
- color: "text.dimmed"
459
- })
460
- })]
461
- }), label ? /* @__PURE__ */ jsx(MultilineLabelSpan, { children: label }) : /* @__PURE__ */ jsxs(HStack, {
462
- css: {
463
- gap: "1",
464
- minWidth: "0",
465
- flex: "1",
466
- minHeight: rowLeadingHeight
467
- },
468
- children: [
469
- /* @__PURE__ */ jsx(LabelSpan, {
470
- css: {
471
- flex: "none",
472
- color: "text.dimmed"
473
- },
474
- children: source
475
- }),
476
- /* @__PURE__ */ jsx(IconArrowRight, {
477
- size: 11,
478
- className: css({
479
- flex: "none",
480
- color: "text.dimmed"
481
- })
482
- }),
483
- /* @__PURE__ */ jsx(LabelSpan, { children: target })
484
- ]
485
- })]
486
- }), notes && /* @__PURE__ */ jsx(Markdown, {
487
- value: RichText.from(notes),
488
- fontSize: "sm",
489
- textScale: .9,
490
- className: css({
491
- background: "surface.sunken",
492
- border: "1px solid {colors.surface.sunken.border}",
493
- rounded: "md",
28
+ var SequenceOutlinePanelShell = ({ children }) => {
29
+ const outlinePanelWidth = useOutlinePanelWidth();
30
+ return /* @__PURE__ */ jsx(m.div, {
31
+ layout: "position",
32
+ className: vstack({
33
+ position: "absolute",
34
+ top: "0",
35
+ left: "0",
36
+ layerStyle: "likec4.panel",
37
+ rounded: "0",
38
+ gap: "0",
39
+ padding: "0",
40
+ pointerEvents: "all",
41
+ maxWidth: "[85cqw]",
42
+ height: "100cqh",
43
+ maxHeight: "100cqh",
494
44
  cursor: "default",
495
- marginBlockStart: "1",
496
- marginBlockEnd: "2",
497
- paddingInline: "4",
498
- paddingBlock: "2"
45
+ overflow: "hidden"
499
46
  }),
500
- style: {
501
- marginInlineStart: "calc(-1 * var(--label-offset))",
502
- display: selected ? "block" : "none"
503
- }
504
- })] });
505
- };
506
- var FlowRow = ({ node, expanded, elementProps }) => {
507
- const { type, title } = node.nodeProps;
508
- const { paletteClass, tag, Icon } = flowPresentation[type];
509
- return /* @__PURE__ */ jsxs(Box$1, {
510
- ...elementProps,
511
- className: cx(elementProps.className, paletteClass, css(rowBase)),
512
- children: [
513
- /* @__PURE__ */ jsx(IconChevronRight, {
514
- size: 14,
515
- className: css({
516
- flex: "none",
517
- color: "text.dimmed",
518
- transition: "transform 150ms ease",
519
- "&[data-expanded=\"true\"]": { transform: "rotate(90deg)" }
520
- }),
521
- "data-expanded": expanded
522
- }),
523
- /* @__PURE__ */ jsx(Icon, {
524
- size: 14,
525
- className: css({
526
- flex: "none",
527
- color: "colorPalette.text"
528
- })
529
- }),
530
- /* @__PURE__ */ jsx(styled.span, {
531
- css: {
532
- ...labelText,
533
- fontWeight: "medium"
534
- },
535
- children: title ?? tag
536
- }),
537
- /* @__PURE__ */ jsx(FlowTag, { children: tag })
538
- ]
47
+ style: { width: outlinePanelWidth },
48
+ initial: {
49
+ opacity: .5,
50
+ translateX: -40
51
+ },
52
+ animate: {
53
+ opacity: 1,
54
+ translateX: 0
55
+ },
56
+ exit: {
57
+ opacity: 0,
58
+ translateX: -40
59
+ },
60
+ children
539
61
  });
540
62
  };
541
63
  //#endregion
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ /** The step number pill. The active one carries the shared `layoutId`, so it travels between steps. */
3
+ export declare const StepBadge: ({ children, active }: {
4
+ children: ReactNode;
5
+ active?: boolean;
6
+ }) => import("react").JSX.Element;
7
+ /** Marks a step that carries notes, without letting the note reflow the list. */
8
+ export declare const NotesDot: () => import("react").JSX.Element;
@@ -0,0 +1,52 @@
1
+ import "../../../_virtual/_rolldown/runtime.js";
2
+ import { SEQ_BADGE_LAYOUT_ID, SEQ_TRANSITION } from "./motion.js";
3
+ import { css } from "@likec4/styles/css";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { m } from "motion/react";
6
+ import { Box } from "@likec4/styles/jsx";
7
+ //#region src/likec4diagram/ui/sequence-outline/StepBadge.tsx
8
+ var stepBadgeBase = css.raw({
9
+ flex: "none",
10
+ display: "flex",
11
+ alignItems: "center",
12
+ justifyContent: "center",
13
+ minWidth: "[20px]",
14
+ height: "[18px]",
15
+ paddingInline: "1",
16
+ rounded: "sm",
17
+ bg: "surface.sunken",
18
+ color: "text.dimmed",
19
+ fontSize: "[10px]",
20
+ fontWeight: "bold",
21
+ fontVariantNumeric: "tabular-nums",
22
+ userSelect: "none"
23
+ });
24
+ var stepBadgeActive = css.raw(stepBadgeBase, {
25
+ minWidth: "[22px]",
26
+ height: "[20px]",
27
+ background: "[linear-gradient(var(--seq-badge-bg), var(--seq-badge-bg)), {colors.likec4.panel.bg}]",
28
+ color: "[var(--seq-badge-fg)]",
29
+ fontSize: "[11px]"
30
+ });
31
+ /** The step number pill. The active one carries the shared `layoutId`, so it travels between steps. */
32
+ var StepBadge = ({ children, active }) => active ? /* @__PURE__ */ jsx(m.div, {
33
+ layoutId: SEQ_BADGE_LAYOUT_ID,
34
+ layout: "position",
35
+ transition: SEQ_TRANSITION,
36
+ className: css(stepBadgeActive),
37
+ children
38
+ }) : /* @__PURE__ */ jsx("div", {
39
+ className: css(stepBadgeBase),
40
+ children
41
+ });
42
+ /** Marks a step that carries notes, without letting the note reflow the list. */
43
+ var NotesDot = () => /* @__PURE__ */ jsx(Box, { css: {
44
+ flex: "none",
45
+ alignSelf: "flex-start",
46
+ boxSize: "[5px]",
47
+ marginTop: "[7px]",
48
+ rounded: "pill",
49
+ bg: "text.dimmed"
50
+ } });
51
+ //#endregion
52
+ export { NotesDot, StepBadge };
@@ -0,0 +1,7 @@
1
+ import { OutlineTreeNodeStep } from './types';
2
+ /** A step the walkthrough is not on: one line, clickable, recessed with its level. */
3
+ export declare function StepRow({ node, recession, active }: {
4
+ active: boolean;
5
+ node: OutlineTreeNodeStep;
6
+ recession: number;
7
+ }): import("react").JSX.Element;