@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
@@ -0,0 +1,190 @@
1
+ import "../../../_virtual/_rolldown/runtime.js";
2
+ import { useDiagram } from "../../../hooks/safeContext.js";
3
+ import { Markdown } from "../../../base-primitives/Markdown.js";
4
+ import { SEQ_CARD_LAYOUT_ID, SEQ_TRANSITION } from "./motion.js";
5
+ import { recessed } from "./depth-of-field.js";
6
+ import { NotesDot, StepBadge } from "./StepBadge.js";
7
+ import { css } from "@likec4/styles/css";
8
+ import { IconArrowRight } from "@tabler/icons-react";
9
+ import { useRef } from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { RichText } from "@likec4/core";
12
+ import { m } from "motion/react";
13
+ import { styled } from "@likec4/styles/jsx";
14
+ import { hstack } from "@likec4/styles/patterns";
15
+ //#region src/likec4diagram/ui/sequence-outline/StepRow.tsx
16
+ /** A step the walkthrough is not on: one line, clickable, recessed with its level. */
17
+ function StepRow({ node, recession, active }) {
18
+ const diagram = useDiagram();
19
+ if (active) return /* @__PURE__ */ jsx(ActiveStepCard, { node });
20
+ const { stepnum, source, target, label, notes } = node.nodeProps;
21
+ return /* @__PURE__ */ jsxs(m.div, {
22
+ layout: true,
23
+ className: hstack(css.raw(recessed, {
24
+ alignItems: "baseline",
25
+ gap: "2",
26
+ width: "100%",
27
+ paddingInline: "1.5",
28
+ paddingBlock: "1.5",
29
+ rounded: "sm",
30
+ cursor: "pointer",
31
+ color: "text",
32
+ userSelect: "none",
33
+ _hover: { background: "[var(--colors-color-palette-hovered, {colors.surface.sunken})]" }
34
+ })),
35
+ style: { ["--seq-r"]: recession },
36
+ onClick: () => diagram.walkthroughStep({ step: node.value }),
37
+ children: [
38
+ /* @__PURE__ */ jsx(StepBadge, { children: stepnum }),
39
+ /* @__PURE__ */ jsx(styled.span, {
40
+ css: {
41
+ flex: "1",
42
+ minWidth: "0",
43
+ fontSize: "xs",
44
+ lineHeight: "[18px]",
45
+ whiteSpace: "pre-line",
46
+ overflowWrap: "anywhere"
47
+ },
48
+ children: label ?? `${source} → ${target}`
49
+ }),
50
+ notes && /* @__PURE__ */ jsx(NotesDot, {})
51
+ ]
52
+ });
53
+ }
54
+ /** The step you are on: lifted onto its own surface, with room for its notes. */
55
+ var ActiveStepCard = ({ node }) => {
56
+ const ref = useRef(null);
57
+ const { stepnum, source, target, label, notes } = node.nodeProps;
58
+ return /* @__PURE__ */ jsxs(m.div, {
59
+ ref,
60
+ layoutId: SEQ_CARD_LAYOUT_ID,
61
+ layout: "position",
62
+ layoutAnchor: false,
63
+ layoutCrossfade: false,
64
+ transition: {
65
+ ...SEQ_TRANSITION,
66
+ when: "beforeChildren"
67
+ },
68
+ onLayoutAnimationComplete: () => {
69
+ ref.current?.scrollIntoView({ block: "nearest" });
70
+ },
71
+ className: css({
72
+ marginBlock: "2",
73
+ paddingInline: "3",
74
+ paddingBlock: "2.5",
75
+ rounded: "md",
76
+ background: "[var(--colors-color-palette-label, {colors.surface.sunken})]",
77
+ boxShadow: "md",
78
+ cursor: "default",
79
+ scrollMarginTop: "10",
80
+ scrollMarginBottom: "16"
81
+ }),
82
+ children: [
83
+ /* @__PURE__ */ jsxs(m.div, {
84
+ layout: "position",
85
+ className: hstack({
86
+ alignItems: "baseline",
87
+ gap: "2",
88
+ width: "100%"
89
+ }),
90
+ children: [/* @__PURE__ */ jsx(StepBadge, {
91
+ active: true,
92
+ children: stepnum
93
+ }), /* @__PURE__ */ jsx(styled.span, {
94
+ as: m.div,
95
+ css: {
96
+ flex: "1",
97
+ minWidth: "0",
98
+ fontSize: "md",
99
+ fontWeight: "medium",
100
+ lineHeight: "[20px]",
101
+ color: "text",
102
+ whiteSpace: "pre-line",
103
+ overflowWrap: "anywhere",
104
+ textWrap: "balance"
105
+ },
106
+ children: label ?? `${source} → ${target}`
107
+ })]
108
+ }),
109
+ label && /* @__PURE__ */ jsxs(m.div, {
110
+ layout: "y",
111
+ initial: {
112
+ visibility: "hidden",
113
+ overflow: "hidden",
114
+ height: 0
115
+ },
116
+ animate: {
117
+ visibility: "visible",
118
+ overflow: "visible",
119
+ height: "auto"
120
+ },
121
+ exit: {
122
+ visibility: "hidden",
123
+ overflow: "hidden",
124
+ height: 0
125
+ },
126
+ transition: SEQ_TRANSITION,
127
+ className: css({
128
+ marginTop: "1",
129
+ marginLeft: "[30px]",
130
+ textStyle: "dimmed.xxs",
131
+ fontSize: "[8px]",
132
+ color: "[color-mix(in srgb, {colors.text}, transparent 20%)]",
133
+ fontWeight: "medium",
134
+ letterSpacing: "caps.sm",
135
+ textTransform: "uppercase",
136
+ userSelect: "none"
137
+ }),
138
+ children: [
139
+ source,
140
+ /* @__PURE__ */ jsx(IconArrowRight, {
141
+ size: 10,
142
+ className: css({
143
+ display: "inline",
144
+ verticalAlign: "[-0.15em]",
145
+ marginInline: "1"
146
+ })
147
+ }),
148
+ target
149
+ ]
150
+ }, "label"),
151
+ notes && /* @__PURE__ */ jsx(m.div, {
152
+ layout: true,
153
+ initial: {
154
+ visibility: "hidden",
155
+ overflow: "hidden",
156
+ height: 10
157
+ },
158
+ animate: {
159
+ visibility: "visible",
160
+ overflow: "visible",
161
+ height: "auto"
162
+ },
163
+ exit: {
164
+ visibility: "hidden",
165
+ overflow: "hidden",
166
+ height: 10
167
+ },
168
+ transition: SEQ_TRANSITION,
169
+ children: /* @__PURE__ */ jsx(Markdown, {
170
+ value: RichText.from(notes),
171
+ fontSize: "md",
172
+ textScale: .95,
173
+ className: css({
174
+ marginTop: "2.5",
175
+ paddingTop: "2.5",
176
+ paddingBottom: "2",
177
+ borderTop: "subtle",
178
+ color: "text"
179
+ }),
180
+ style: {
181
+ borderTopColor: "oklch(from var(--_border-color) l c h / 25%)",
182
+ ["--_border-color"]: "var(--colors-color-palette-border, var(--colors-border-subtle))"
183
+ }
184
+ })
185
+ }, "Markdown")
186
+ ]
187
+ });
188
+ };
189
+ //#endregion
190
+ export { StepRow };
@@ -0,0 +1,238 @@
1
+ import { SnapshotFromStore, StoreFromStoreLogicCreator } from '@xstate/store-react';
2
+ import { PropsWithChildren } from 'react';
3
+ import { StepPath, DynamicViewFlow, LayoutedDynamicView, Any, DynamicViewFlowData, MarkdownOrString } from '@likec4/core';
4
+ import { MachineSnapshot, ActorRefFromLogic } from 'xstate';
5
+ import { DiagramContext } from '../../..';
6
+ import { Events } from '../../state/machine.setup';
7
+ import { OverlaysActorRef, OverlaysActorLogic } from '../../../overlays/overlaysActor';
8
+ import { SearchActorRef, SearchActorLogic } from '../../../search/searchActor';
9
+ import { BaseEditorActorRef } from '../../../editor/actor/setup';
10
+ import { NavigationPanelActorRef, NavigationPanelActorLogic } from '../../../navigationpanel/actor';
11
+ import { HotkeyActorLogic } from '../../state/hotkeyActor';
12
+ import { MediaPrintActorLogic } from '../../state/mediaPrintActor';
13
+ import { EditorActorLogic } from '../../../editor';
14
+ import { StoreLogicCreator, TriggerObject } from '@xstate/store';
15
+ import { OutlineTreeNodes } from './types';
16
+ declare const selectFlow: [selector: (snapshot: MachineSnapshot<DiagramContext, Events, {
17
+ overlays: OverlaysActorRef | undefined;
18
+ search: SearchActorRef | undefined;
19
+ editor: BaseEditorActorRef | undefined;
20
+ navigationPanel: NavigationPanelActorRef | undefined;
21
+ } & Omit<{
22
+ hotkey: ActorRefFromLogic<HotkeyActorLogic> | undefined;
23
+ overlays: ActorRefFromLogic<OverlaysActorLogic> | undefined;
24
+ search: ActorRefFromLogic<SearchActorLogic> | undefined;
25
+ mediaPrint: ActorRefFromLogic<MediaPrintActorLogic> | undefined;
26
+ editor: ActorRefFromLogic<EditorActorLogic> | undefined;
27
+ navigationPanel: ActorRefFromLogic<NavigationPanelActorLogic> | undefined;
28
+ }, "search" | "overlays" | "editor" | "navigationPanel">, "final" | "isReady" | "navigating" | "ready" | "initializing" | {
29
+ ready?: NonNullable<"idle" | "walkthrough" | "focused" | "printing">;
30
+ }, never, never, never, never>) => {
31
+ flow: DynamicViewFlow< LayoutedDynamicView<Any> & {
32
+ flow: DynamicViewFlowData;
33
+ }>;
34
+ activeStep: StepPath;
35
+ stepNum: number;
36
+ title: string;
37
+ description: MarkdownOrString | null;
38
+ outlinePanelWidth: number;
39
+ collapsed: {
40
+ [flowId: StepPath]: boolean;
41
+ };
42
+ prev: StepPath | null;
43
+ next: StepPath | null;
44
+ } | {
45
+ flow: null;
46
+ activeStep: null;
47
+ title: string;
48
+ description: MarkdownOrString | null;
49
+ stepNum?: never;
50
+ outlinePanelWidth?: never;
51
+ collapsed?: never;
52
+ prev?: never;
53
+ next?: never;
54
+ }, compare: (a: {
55
+ flow: DynamicViewFlow< LayoutedDynamicView<Any> & {
56
+ flow: DynamicViewFlowData;
57
+ }>;
58
+ activeStep: StepPath;
59
+ stepNum: number;
60
+ title: string;
61
+ description: MarkdownOrString | null;
62
+ outlinePanelWidth: number;
63
+ collapsed: {
64
+ [flowId: StepPath]: boolean;
65
+ };
66
+ prev: StepPath | null;
67
+ next: StepPath | null;
68
+ } | {
69
+ flow: null;
70
+ activeStep: null;
71
+ title: string;
72
+ description: MarkdownOrString | null;
73
+ stepNum?: never;
74
+ outlinePanelWidth?: never;
75
+ collapsed?: never;
76
+ prev?: never;
77
+ next?: never;
78
+ }, b: {
79
+ flow: DynamicViewFlow< LayoutedDynamicView<Any> & {
80
+ flow: DynamicViewFlowData;
81
+ }>;
82
+ activeStep: StepPath;
83
+ stepNum: number;
84
+ title: string;
85
+ description: MarkdownOrString | null;
86
+ outlinePanelWidth: number;
87
+ collapsed: {
88
+ [flowId: StepPath]: boolean;
89
+ };
90
+ prev: StepPath | null;
91
+ next: StepPath | null;
92
+ } | {
93
+ flow: null;
94
+ activeStep: null;
95
+ title: string;
96
+ description: MarkdownOrString | null;
97
+ stepNum?: never;
98
+ outlinePanelWidth?: never;
99
+ collapsed?: never;
100
+ prev?: never;
101
+ next?: never;
102
+ }) => boolean] & {
103
+ Out: {
104
+ flow: DynamicViewFlow< LayoutedDynamicView<Any> & {
105
+ flow: DynamicViewFlowData;
106
+ }>;
107
+ activeStep: StepPath;
108
+ stepNum: number;
109
+ title: string;
110
+ description: MarkdownOrString | null;
111
+ outlinePanelWidth: number;
112
+ collapsed: {
113
+ [flowId: StepPath]: boolean;
114
+ };
115
+ prev: StepPath | null;
116
+ next: StepPath | null;
117
+ } | {
118
+ flow: null;
119
+ activeStep: null;
120
+ title: string;
121
+ description: MarkdownOrString | null;
122
+ stepNum?: never;
123
+ outlinePanelWidth?: never;
124
+ collapsed?: never;
125
+ prev?: never;
126
+ next?: never;
127
+ };
128
+ };
129
+ type SelectFlowResult = Extract<typeof selectFlow.Out, {
130
+ activeStep: string;
131
+ }>;
132
+ declare const logic: StoreLogicCreator<{
133
+ ancestors: StepPath[];
134
+ outlineTree: OutlineTreeNodes;
135
+ flow: DynamicViewFlow< LayoutedDynamicView<Any> & {
136
+ flow: DynamicViewFlowData;
137
+ }>;
138
+ activeStep: StepPath;
139
+ stepNum: number;
140
+ title: string;
141
+ description: MarkdownOrString | null;
142
+ outlinePanelWidth: number;
143
+ collapsed: {
144
+ [flowId: StepPath]: boolean;
145
+ };
146
+ prev: StepPath | null;
147
+ next: StepPath | null;
148
+ }, {
149
+ updateInput: {
150
+ input: SelectFlowResult;
151
+ };
152
+ }, never, {
153
+ input: SelectFlowResult;
154
+ }, {
155
+ outlinePanelWidth: (context: {
156
+ ancestors: StepPath[];
157
+ outlineTree: OutlineTreeNodes;
158
+ flow: DynamicViewFlow< LayoutedDynamicView<Any> & {
159
+ flow: DynamicViewFlowData;
160
+ }>;
161
+ activeStep: StepPath;
162
+ stepNum: number;
163
+ title: string;
164
+ description: MarkdownOrString | null;
165
+ outlinePanelWidth: number;
166
+ collapsed: {
167
+ [flowId: StepPath]: boolean;
168
+ };
169
+ prev: StepPath | null;
170
+ next: StepPath | null;
171
+ }) => number;
172
+ activeDepth: (context: {
173
+ ancestors: StepPath[];
174
+ outlineTree: OutlineTreeNodes;
175
+ flow: DynamicViewFlow< LayoutedDynamicView<Any> & {
176
+ flow: DynamicViewFlowData;
177
+ }>;
178
+ activeStep: StepPath;
179
+ stepNum: number;
180
+ title: string;
181
+ description: MarkdownOrString | null;
182
+ outlinePanelWidth: number;
183
+ collapsed: {
184
+ [flowId: StepPath]: boolean;
185
+ };
186
+ prev: StepPath | null;
187
+ next: StepPath | null;
188
+ }) => number;
189
+ collapsed: (context: {
190
+ ancestors: StepPath[];
191
+ outlineTree: OutlineTreeNodes;
192
+ flow: DynamicViewFlow< LayoutedDynamicView<Any> & {
193
+ flow: DynamicViewFlowData;
194
+ }>;
195
+ activeStep: StepPath;
196
+ stepNum: number;
197
+ title: string;
198
+ description: MarkdownOrString | null;
199
+ outlinePanelWidth: number;
200
+ collapsed: {
201
+ [flowId: StepPath]: boolean;
202
+ };
203
+ prev: StepPath | null;
204
+ next: StepPath | null;
205
+ }) => {
206
+ [flowId: StepPath]: boolean;
207
+ };
208
+ outlineTree: (context: {
209
+ ancestors: StepPath[];
210
+ outlineTree: OutlineTreeNodes;
211
+ flow: DynamicViewFlow< LayoutedDynamicView<Any> & {
212
+ flow: DynamicViewFlowData;
213
+ }>;
214
+ activeStep: StepPath;
215
+ stepNum: number;
216
+ title: string;
217
+ description: MarkdownOrString | null;
218
+ outlinePanelWidth: number;
219
+ collapsed: {
220
+ [flowId: StepPath]: boolean;
221
+ };
222
+ prev: StepPath | null;
223
+ next: StepPath | null;
224
+ }) => OutlineTreeNodes;
225
+ }>;
226
+ type SequenceOutlineStore = StoreFromStoreLogicCreator<typeof logic>;
227
+ type SequenceOutlineStoreContext = SnapshotFromStore<SequenceOutlineStore>['context'];
228
+ export declare function StoreProvider({ children }: PropsWithChildren<{}>): import("react").JSX.Element | null;
229
+ export declare function useSelectContext<T>(selector: (context: SequenceOutlineStoreContext) => T): T;
230
+ export declare function useTrigger(): TriggerObject<{
231
+ updateInput: {
232
+ input: SelectFlowResult;
233
+ };
234
+ }>;
235
+ export declare function useIsCollapsed(step: StepPath): boolean;
236
+ export declare function useOutlineTree(): OutlineTreeNodes;
237
+ export declare function useOutlinePanelWidth(): number;
238
+ export {};
@@ -0,0 +1,94 @@
1
+ import "../../../_virtual/_rolldown/runtime.js";
2
+ import { roundDpr } from "../../../utils/roundDpr.js";
3
+ import { selectDiagramContext, useDiagramSelector } from "../../../hooks/safeContext.js";
4
+ import { buildTree } from "./tree.js";
5
+ import { createContext, use, useEffect } from "react";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import { shallowEqual } from "fast-equals";
8
+ import { dynamicViewFlow, flowAncestors, invariant, isDynamicViewWithFlow } from "@likec4/core";
9
+ import { extractViewTitleFromPath } from "@likec4/core/model";
10
+ import { createStoreLogic, useSelector, useStore } from "@xstate/store-react";
11
+ //#region src/likec4diagram/ui/sequence-outline/StoreProvider.tsx
12
+ var selectFlow = selectDiagramContext((s) => {
13
+ const title = extractViewTitleFromPath(s.view.title ?? "Untitled");
14
+ const description = s.view.description;
15
+ const activeStep = s.activeWalkthrough?.stepId ?? null;
16
+ if (activeStep) {
17
+ invariant(isDynamicViewWithFlow(s.view), "View is not a dynamic view with flow");
18
+ const flow = dynamicViewFlow(s.view);
19
+ const { prev, next } = flow.prevAndNext(activeStep, ({ id }) => s.collapsedSequenceFlows[id] ?? false);
20
+ return {
21
+ flow,
22
+ activeStep,
23
+ stepNum: s.xyedges.find((e) => e.data.id === activeStep)?.data.stepnum ?? 1,
24
+ title,
25
+ description,
26
+ outlinePanelWidth: s.activeWalkthrough?.outlinePanelWidth ?? 0,
27
+ collapsed: s.collapsedSequenceFlows,
28
+ prev,
29
+ next
30
+ };
31
+ }
32
+ return {
33
+ flow: null,
34
+ activeStep: null,
35
+ title,
36
+ description
37
+ };
38
+ });
39
+ var logic = createStoreLogic({
40
+ context: ({ input }) => ({
41
+ ...input,
42
+ ancestors: flowAncestors(input.activeStep),
43
+ outlineTree: buildTree(input.flow)
44
+ }),
45
+ on: { updateInput: (context, { input }) => ({
46
+ ...input,
47
+ ancestors: input.activeStep == context.activeStep ? context.ancestors : flowAncestors(input.activeStep),
48
+ outlineTree: input.flow === context.flow ? context.outlineTree : buildTree(input.flow)
49
+ }) },
50
+ selectors: {
51
+ outlinePanelWidth: (context) => roundDpr(context.outlinePanelWidth),
52
+ activeDepth: (context) => context.ancestors.length,
53
+ collapsed: (context) => context.collapsed,
54
+ outlineTree: (context) => context.outlineTree
55
+ }
56
+ });
57
+ function StoreProvider({ children }) {
58
+ const input = useDiagramSelector(selectFlow);
59
+ if (!input.flow) return null;
60
+ return /* @__PURE__ */ jsx(StoreGuard, {
61
+ input,
62
+ children
63
+ });
64
+ }
65
+ var Context = createContext({});
66
+ function StoreGuard({ children, input }) {
67
+ const store = useStore(logic, { input });
68
+ useEffect(() => {
69
+ store.trigger.updateInput({ input });
70
+ }, [input]);
71
+ useEffect(() => {
72
+ return store.inspect((event) => {
73
+ console.log("event", event);
74
+ }).unsubscribe;
75
+ }, [store]);
76
+ return /* @__PURE__ */ jsx(Context, {
77
+ value: store,
78
+ children
79
+ });
80
+ }
81
+ function useSelectContext(selector) {
82
+ const store = use(Context);
83
+ return useSelector(store, (s) => selector(s.context), shallowEqual);
84
+ }
85
+ function useIsCollapsed(step) {
86
+ const store = use(Context);
87
+ return useSelector(store.selectors.collapsed, (collapsed) => collapsed[step] ?? false);
88
+ }
89
+ function useOutlinePanelWidth() {
90
+ const store = use(Context);
91
+ return useSelector(store.selectors.outlinePanelWidth);
92
+ }
93
+ //#endregion
94
+ export { StoreProvider, useIsCollapsed, useOutlinePanelWidth, useSelectContext };
@@ -0,0 +1,21 @@
1
+ import { SystemStyleObject } from '@likec4/styles/types';
2
+ /** Distance, in nesting levels, between a level and the one the walkthrough stands on. */
3
+ export declare const recessionOf: (depth: number, activeDepth: number) => number;
4
+ /** Panel surface, shaded by the current `--seq-r`. */
5
+ export declare const shadedPanelBg: SystemStyleObject;
6
+ /** A row that has stepped back: lower contrast and saturation, restored on hover. */
7
+ export declare const recessed: SystemStyleObject;
8
+ /** A nesting level, as a full-bleed tonal band. Tone only — no border, no radius, no card. */
9
+ export declare const levelBand: SystemStyleObject;
10
+ /**
11
+ * A fragment nested *below* the level you are standing on: structure, not colour.
12
+ *
13
+ * Fills do not survive nesting — five levels of translucent fragment tint compound into mud,
14
+ * and a fragment you are not inside has no claim on the eye. Depth is carried by an indent and
15
+ * a hairline in the fragment's own colour; the tag pill and icon already say which kind it is.
16
+ */
17
+ export declare const nestedBand: SystemStyleObject;
18
+ /** The fragment you are standing inside, framed the way the canvas frames it. */
19
+ export declare const activeFrame: SystemStyleObject;
20
+ /** Hairline drawn around the fragment you are standing inside. */
21
+ export declare const activeFrameBorder: string;
@@ -0,0 +1,71 @@
1
+ import "../../../_virtual/_rolldown/runtime.js";
2
+ import { css } from "@likec4/styles/css";
3
+ //#region src/likec4diagram/ui/sequence-outline/depth-of-field.ts
4
+ /**
5
+ * The outline reads as a stack of planes: the nesting level the walkthrough is standing on
6
+ * renders at full strength, and every level *above* it steps back in contrast, saturation
7
+ * and surface tone. `--seq-r` is that distance (0 = you are here, capped at {@link MAX_RECESSION}).
8
+ *
9
+ * The recession is relative, not absolute — it is recomputed as the walkthrough enters and
10
+ * leaves a fragment, so stepping back out to the root flattens the panel again.
11
+ */
12
+ var MAX_RECESSION = 3;
13
+ /** Distance, in nesting levels, between a level and the one the walkthrough stands on. */
14
+ var recessionOf = (depth, activeDepth) => Math.min(MAX_RECESSION, Math.max(0, activeDepth - depth));
15
+ /** Per-level falloff, applied once per step of `--seq-r`. */
16
+ var OPACITY_STEP = .26;
17
+ var SATURATION_STEP = .286;
18
+ /** Panel surface, shaded by the current `--seq-r`. */
19
+ var shadedPanelBg = css.raw({ background: `[color-mix(in srgb, {colors.likec4.panel.bg}, #000 calc(var(--seq-r, 0) * 4.55%))]` });
20
+ /** A row that has stepped back: lower contrast and saturation, restored on hover. */
21
+ var recessed = css.raw({
22
+ opacity: `[calc(1 - var(--seq-r, 0) * ${OPACITY_STEP})]`,
23
+ filter: `[saturate(calc(1 - var(--seq-r, 0) * ${SATURATION_STEP}))]`,
24
+ _hover: {
25
+ opacity: "1",
26
+ filter: "[none]"
27
+ }
28
+ });
29
+ /** A nesting level, as a full-bleed tonal band. Tone only — no border, no radius, no card. */
30
+ var levelBand = css.raw(shadedPanelBg, {
31
+ position: "relative",
32
+ marginInline: "-2",
33
+ paddingInline: "2",
34
+ marginBlock: "0.5",
35
+ transitionProperty: "background",
36
+ transition: "slow"
37
+ });
38
+ /**
39
+ * A fragment nested *below* the level you are standing on: structure, not colour.
40
+ *
41
+ * Fills do not survive nesting — five levels of translucent fragment tint compound into mud,
42
+ * and a fragment you are not inside has no claim on the eye. Depth is carried by an indent and
43
+ * a hairline in the fragment's own colour; the tag pill and icon already say which kind it is.
44
+ */
45
+ var nestedBand = css.raw({
46
+ background: "transparent",
47
+ marginInline: "0",
48
+ marginBlock: "0.5",
49
+ paddingInline: "0",
50
+ paddingLeft: "2",
51
+ borderLeft: "default",
52
+ borderLeftColor: "colorPalette.border",
53
+ rounded: "0"
54
+ });
55
+ /** The fragment you are standing inside, framed the way the canvas frames it. */
56
+ var activeFrame = css.raw({
57
+ background: "[linear-gradient(var(--seq-frame-bg), var(--seq-frame-bg)), {colors.likec4.panel.bg}]",
58
+ paddingInline: "3",
59
+ paddingBlock: "1.5",
60
+ marginBlock: "0"
61
+ });
62
+ /** Hairline drawn around the fragment you are standing inside. */
63
+ var activeFrameBorder = css({
64
+ position: "absolute",
65
+ inset: "[0 10px 0 4px]",
66
+ border: "[1px solid {colors.colorPalette.border}]",
67
+ rounded: "md",
68
+ pointerEvents: "none"
69
+ });
70
+ //#endregion
71
+ export { activeFrame, activeFrameBorder, levelBand, nestedBand, recessed, recessionOf, shadedPanelBg };
@@ -0,0 +1,2 @@
1
+ export { SequenceOutlinePanel } from './SequenceOutlinePanel';
2
+ export type { OutlineTreeNodeData, OutlineTreeNodeFlow, OutlineTreeNodes, OutlineTreeNodeStep } from './types';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Shared-layout transitions. The frame, the card and the badge each carry a `layoutId`, so
3
+ * walking a step moves one element rather than swapping two — the frame travels to the branch
4
+ * you entered and the card slides to the step you landed on. House easing, one exponential
5
+ * ease-out; `MotionConfig` already drops these under reduced motion and reduced graphics.
6
+ */
7
+ export declare const SEQ_TRANSITION: {
8
+ readonly duration: 0.24;
9
+ readonly ease: readonly [0.2, 0.8, 0.2, 1];
10
+ };
11
+ export declare const SEQ_FRAME_LAYOUT_ID = "likec4-seq-active-frame";
12
+ export declare const SEQ_CARD_LAYOUT_ID = "likec4-seq-active-card";
13
+ export declare const SEQ_BADGE_LAYOUT_ID = "likec4-seq-active-badge";
@@ -0,0 +1,21 @@
1
+ //#region src/likec4diagram/ui/sequence-outline/motion.ts
2
+ /**
3
+ * Shared-layout transitions. The frame, the card and the badge each carry a `layoutId`, so
4
+ * walking a step moves one element rather than swapping two — the frame travels to the branch
5
+ * you entered and the card slides to the step you landed on. House easing, one exponential
6
+ * ease-out; `MotionConfig` already drops these under reduced motion and reduced graphics.
7
+ */
8
+ var SEQ_TRANSITION = {
9
+ duration: .24,
10
+ ease: [
11
+ .2,
12
+ .8,
13
+ .2,
14
+ 1
15
+ ]
16
+ };
17
+ var SEQ_FRAME_LAYOUT_ID = "likec4-seq-active-frame";
18
+ var SEQ_CARD_LAYOUT_ID = "likec4-seq-active-card";
19
+ var SEQ_BADGE_LAYOUT_ID = "likec4-seq-active-badge";
20
+ //#endregion
21
+ export { SEQ_BADGE_LAYOUT_ID, SEQ_CARD_LAYOUT_ID, SEQ_FRAME_LAYOUT_ID, SEQ_TRANSITION };
@@ -0,0 +1,10 @@
1
+ import { DynamicViewFlow } from '@likec4/core';
2
+ import { IconRepeat } from '@tabler/icons-react';
3
+ export type FlowType = DynamicViewFlow.SubFlowType;
4
+ export type FlowPresentation = {
5
+ readonly paletteClass: string;
6
+ readonly tag: string;
7
+ readonly Icon: typeof IconRepeat;
8
+ };
9
+ /** How each sub-flow operator is labelled and coloured in the outline. */
10
+ export declare const flowPresentation: Record<FlowType, FlowPresentation>;