@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
@@ -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>;