@likec4/diagram 1.57.0 → 1.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LikeC4Diagram.js +1 -1
- package/dist/LikeC4Diagram.props.d.ts +1 -1
- package/dist/LikeC4Styles.js +1 -1
- package/dist/LikeC4View.js +2 -2
- package/dist/ReactLikeC4.d.ts +1 -1
- package/dist/base/Base.d.ts +3 -2
- package/dist/base/Base.js +14 -26
- package/dist/base/BaseXYFlow.d.ts +2 -1
- package/dist/base/BaseXYFlow.js +63 -4
- package/dist/base/keyboardZoom.d.ts +3 -0
- package/dist/base/keyboardZoom.js +20 -0
- package/dist/base/updateEdges.js +7 -16
- package/dist/base/updateNodes.js +3 -9
- package/dist/base-primitives/Markdown.d.ts +1 -1
- package/dist/base-primitives/NodeHandles.d.ts +1 -1
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +2 -1
- package/dist/base-primitives/compound/CompoundActionButton.js +5 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +2 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +5 -2
- package/dist/base-primitives/compound/CompoundNodeContainer.d.ts +1 -1
- package/dist/base-primitives/compound/CompoundTitle.d.ts +7 -1
- package/dist/base-primitives/compound/CompoundTitle.js +2 -1
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +2 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +2 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +4 -2
- package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -0
- package/dist/base-primitives/edge/EdgeLabel.js +2 -5
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeMarkers.d.ts +8 -8
- package/dist/base-primitives/element/ElementActionButtons.d.ts +2 -1
- package/dist/base-primitives/element/ElementActionButtons.js +4 -1
- package/dist/base-primitives/element/ElementData.d.ts +4 -2
- package/dist/base-primitives/element/ElementData.js +2 -1
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +2 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +5 -2
- package/dist/base-primitives/element/ElementNodeContainer.js +1 -1
- package/dist/base-primitives/element/ElementShape.d.ts +1 -1
- package/dist/base-primitives/element/ElementShape.js +3 -0
- package/dist/base-primitives/element/ElementTags.d.ts +1 -1
- package/dist/base-primitives/element/ElementTags.js +1 -3
- package/dist/components/ErrorFallback.d.ts +2 -2
- package/dist/components/ErrorFallback.js +3 -5
- package/dist/components/Link.js +6 -6
- package/dist/components/NavigationPanel.d.ts +2 -2
- package/dist/components/NavigationPanel.js +1 -1
- package/dist/components/PortalToContainer.d.ts +1 -1
- package/dist/components/RootContainer.d.ts +1 -1
- package/dist/components/SearchControl.css.js +11 -11
- package/dist/components/SearchControl.d.ts +2 -2
- package/dist/components/ViewNotFound.d.ts +2 -2
- package/dist/context/CurrentViewModelProvider.d.ts +1 -1
- package/dist/context/DefaultMantineProvider.d.ts +1 -1
- package/dist/context/DiagramEventHandlers.d.ts +1 -1
- package/dist/context/EnsureMantine.d.ts +1 -1
- package/dist/context/FramerMotionConfig.d.ts +3 -3
- package/dist/context/FramerMotionConfig.js +2 -2
- package/dist/context/IconRenderer.d.ts +2 -2
- package/dist/context/IconRenderer.js +32 -12
- package/dist/context/LikeC4ModelContext.d.ts +1 -1
- package/dist/context/TagStylesContext.d.ts +4 -3
- package/dist/context/TagStylesContext.js +20 -22
- package/dist/custom/index.d.ts +1 -0
- package/dist/custom/index.js +3 -2
- package/dist/editor/LikeC4EditorProvider.d.ts +2 -2
- package/dist/editor/actor/actions.d.ts +74 -15
- package/dist/editor/actor/actions.js +91 -25
- package/dist/editor/actor/hotkey.d.ts +1 -1
- package/dist/editor/actor/hotkey.js +7 -0
- package/dist/editor/actor/machine.d.ts +4 -6
- package/dist/editor/actor/machine.js +1 -0
- package/dist/editor/actor/setup.d.ts +25 -4
- package/dist/editor/actor/setup.js +8 -6
- package/dist/editor/actor/state.editor.d.ts +64 -14
- package/dist/editor/actor/state.editor.js +12 -11
- package/dist/editor/actor/state.sync-queue.d.ts +283 -91
- package/dist/editor/actor/state.sync-queue.js +93 -56
- package/dist/editor/actor/types.d.ts +6 -1
- package/dist/editor/actor/types.js +1 -1
- package/dist/editor/useEditorActorLogic.js +14 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/safeContext.d.ts +156 -3
- package/dist/hooks/safeContext.js +60 -12
- package/dist/hooks/useCurrentViewModel.js +1 -1
- package/dist/hooks/useDiagram.d.ts +8 -0
- package/dist/hooks/useDiagram.js +9 -2
- package/dist/hooks/useEditorActor.d.ts +5 -0
- package/dist/hooks/useEditorActor.js +4 -3
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.js +1 -1
- package/dist/hooks/useXYFlow.d.ts +1 -0
- package/dist/hooks/useXYFlow.js +5 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -2
- package/dist/likec4diagram/DiagramUI.d.ts +1 -1
- package/dist/likec4diagram/DiagramUI.js +19 -6
- package/dist/likec4diagram/DiagramXYFlow.js +54 -17
- package/dist/likec4diagram/convert-to-xyflow.d.ts +3 -5
- package/dist/likec4diagram/convert-to-xyflow.js +29 -10
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +1 -1
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +140 -18
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.d.ts +1 -1
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +11 -4
- package/dist/likec4diagram/custom/edges/edges.css.d.ts +1 -0
- package/dist/likec4diagram/custom/edges/edges.css.js +6 -2
- package/dist/likec4diagram/custom/index.d.ts +2 -1
- package/dist/likec4diagram/custom/index.js +5 -3
- package/dist/likec4diagram/custom/nodes/CompoundActions.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +1 -0
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +4 -4
- package/dist/likec4diagram/custom/nodes/ElementActions.js +13 -3
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +0 -4
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +32 -19
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.d.ts +2 -0
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +234 -0
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +7 -7
- package/dist/likec4diagram/custom/nodes/nodes.js +20 -5
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.d.ts +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -14
- package/dist/likec4diagram/relationship-popover/components.d.ts +2 -2
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.js +11 -20
- package/dist/likec4diagram/state/aligners.js +1 -1
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/assign.js +1 -1
- package/dist/likec4diagram/state/createViewChange.js +2 -1
- package/dist/likec4diagram/state/diagram-api.d.ts +18 -10
- package/dist/likec4diagram/state/diagram-api.js +333 -229
- package/dist/likec4diagram/state/machine.actions.d.ts +1026 -332
- package/dist/likec4diagram/state/machine.actions.js +118 -46
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +123 -51
- package/dist/likec4diagram/state/machine.actions.layout.js +40 -33
- package/dist/likec4diagram/state/machine.d.ts +154 -16
- package/dist/likec4diagram/state/machine.js +5 -41
- package/dist/likec4diagram/state/machine.setup.d.ts +84 -19
- package/dist/likec4diagram/state/machine.setup.js +65 -12
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +59 -33
- package/dist/likec4diagram/state/machine.state.navigating.js +7 -3
- package/dist/likec4diagram/state/machine.state.ready.d.ts +1540 -476
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +294 -53
- package/dist/likec4diagram/state/machine.state.ready.focused.js +3 -3
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +264 -73
- package/dist/likec4diagram/state/machine.state.ready.idle.js +31 -6
- package/dist/likec4diagram/state/machine.state.ready.js +22 -16
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +23 -9
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +288 -84
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +135 -66
- package/dist/likec4diagram/state/types.d.ts +4 -2
- package/dist/likec4diagram/state/utils.d.ts +7 -0
- package/dist/likec4diagram/state/utils.js +36 -34
- package/dist/likec4diagram/types.d.ts +49 -3
- package/dist/likec4diagram/ui/FloatingSequenceActors.d.ts +6 -0
- package/dist/likec4diagram/ui/FloatingSequenceActors.js +155 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +1 -1
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +2 -2
- package/dist/likec4diagram/ui/index.d.ts +2 -0
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -5
- package/dist/likec4diagram/ui/notation/NotationPanel.d.ts +1 -1
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +2 -0
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +519 -0
- package/dist/likec4diagram/ui/sequence-outline/state.d.ts +36 -0
- package/dist/likec4diagram/ui/sequence-outline/state.js +55 -0
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +1 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +116 -62
- package/dist/likec4diagram/xyflow-sequence/_types.d.ts +55 -5
- package/dist/likec4diagram/xyflow-sequence/const.d.ts +5 -5
- package/dist/likec4diagram/xyflow-sequence/const.js +4 -4
- package/dist/likec4diagram/xyflow-sequence/layouter.d.ts +30 -6
- package/dist/likec4diagram/xyflow-sequence/layouter.js +561 -0
- package/dist/likec4diagram/xyflow-sequence/{sequence-layout.d.ts → sequence-view-to-xy.d.ts} +8 -2
- package/dist/likec4diagram/xyflow-sequence/{sequence-layout.js → sequence-view-to-xy.js} +112 -14
- package/dist/likec4diagram/xyflow-sequence/sequence-view.d.ts +2 -7
- package/dist/likec4diagram/xyflow-sequence/sequence-view.js +144 -0
- package/dist/likec4diagram/xyflow-sequence/utils.d.ts +9 -1
- package/dist/likec4diagram/xyflow-sequence/utils.js +96 -0
- package/dist/navigationpanel/NavigationPanel.d.ts +5 -2
- package/dist/navigationpanel/NavigationPanel.js +58 -59
- package/dist/navigationpanel/NavigationPanelControls.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +47 -40
- package/dist/navigationpanel/_common.d.ts +2 -2
- package/dist/navigationpanel/_common.js +2 -2
- package/dist/navigationpanel/actor.actions.d.ts +19 -0
- package/dist/navigationpanel/actor.actions.js +45 -0
- package/dist/navigationpanel/actor.d.ts +34 -96
- package/dist/navigationpanel/actor.js +21 -84
- package/dist/navigationpanel/actor.setup.d.ts +98 -0
- package/dist/navigationpanel/actor.setup.js +31 -0
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +4 -5
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +1 -1
- package/dist/navigationpanel/controls/DetailsControls.d.ts +1 -1
- package/dist/navigationpanel/controls/DetailsControls.js +7 -8
- package/dist/navigationpanel/controls/LayoutWarning.d.ts +1 -1
- package/dist/navigationpanel/controls/LogoButton.d.ts +1 -1
- package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -1
- package/dist/navigationpanel/controls/OpenSource.d.ts +1 -1
- package/dist/navigationpanel/controls/SearchControl.d.ts +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/CenterCamera.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/EditorPanel.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/styles.js +8 -8
- package/dist/navigationpanel/hooks.d.ts +20 -5
- package/dist/navigationpanel/hooks.js +4 -18
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +2 -2
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +5 -5
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +23 -25
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +5 -5
- package/dist/overlays/Overlays.d.ts +4 -2
- package/dist/overlays/Overlays.js +10 -10
- package/dist/overlays/element-details/ElementDetails.d.ts +1 -1
- package/dist/overlays/element-details/ElementDetailsCard.css.js +17 -17
- package/dist/overlays/element-details/ElementDetailsCard.d.ts +1 -1
- package/dist/overlays/element-details/MetadataValue.d.ts +2 -2
- package/dist/overlays/element-details/MetadataValue.js +15 -15
- package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -5
- package/dist/overlays/element-details/TabPanelRelationships.css.js +11 -11
- package/dist/overlays/element-details/TabPanelRelationships.d.ts +1 -1
- package/dist/overlays/element-details/TabPanelRelationships.js +1 -1
- package/dist/overlays/element-details/TabPanelStructure.css.js +2 -2
- package/dist/overlays/element-details/TabPanelStructure.d.ts +2 -2
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +2 -3
- package/dist/overlays/hooks.d.ts +28 -0
- package/dist/overlays/hooks.js +5 -0
- package/dist/overlays/overlay/Overlay.js +34 -25
- package/dist/overlays/overlaysActor.js +0 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +1 -1
- package/dist/overlays/relationship-details/SelectEdge.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/ElementActions.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +4 -4
- package/dist/overlays/relationship-details/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
- package/dist/overlays/relationships-browser/SelectElement.d.ts +1 -1
- package/dist/overlays/relationships-browser/actor.js +79 -78
- package/dist/overlays/relationships-browser/custom/ElementActions.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/EmptyNode.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +4 -4
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationships-browser/hooks.js +1 -1
- package/dist/overlays/relationships-browser/layout.js +2 -2
- package/dist/projects-overview/ProjectsOverview.d.ts +1 -1
- package/dist/projects-overview/actor.js +4 -4
- package/dist/projects-overview/custom/nodeTypes.d.ts +1 -1
- package/dist/projects-overview/panel/ProjectsOverviewPanel.d.ts +1 -1
- package/dist/search/Search.d.ts +1 -1
- package/dist/search/Search.js +1 -1
- package/dist/search/XStateSearchAdapter.d.ts +1 -1
- package/dist/search/components/ElementsColumn.css.js +2 -2
- package/dist/search/components/ElementsColumn.d.ts +1 -1
- package/dist/search/components/PickView.d.ts +1 -1
- package/dist/search/components/SearchByTags.d.ts +1 -1
- package/dist/search/components/SearchInput.d.ts +1 -1
- package/dist/search/components/ViewsColum.d.ts +3 -3
- package/dist/search/components/ViewsColum.js +1 -1
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/components/_shared.css.js +23 -23
- package/dist/search/components/styles.css.js +4 -4
- package/dist/shadowroot/ShadowRoot.d.ts +2 -3
- package/dist/shadowroot/ShadowRoot.js +95 -41
- package/dist/shadowroot/index.d.ts +1 -0
- package/dist/styles2.js +1 -1
- package/dist/utils/defineActors.d.ts +21 -0
- package/dist/utils/defineActors.js +13 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +5 -4
- package/dist/utils/readableText.d.ts +11 -0
- package/dist/utils/readableText.js +18 -0
- package/package.json +30 -43
- package/panda.buildinfo.json +271 -295
- package/styles-min.css +1 -1
- package/styles-xyflow.css +1 -1
- package/styles.css +1 -1
- package/adhoc-editor/package.json +0 -4
- package/dist/adhoc-editor/EditorPanel.d.ts +0 -1
- package/dist/adhoc-editor/EditorPanel.js +0 -106
- package/dist/adhoc-editor/ElementsTree.d.ts +0 -2
- package/dist/adhoc-editor/ElementsTree.js +0 -112
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +0 -4
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +0 -83
- package/dist/adhoc-editor/components/Tree.d.ts +0 -48
- package/dist/adhoc-editor/components/Tree.js +0 -213
- package/dist/adhoc-editor/hooks.d.ts +0 -14
- package/dist/adhoc-editor/hooks.js +0 -34
- package/dist/adhoc-editor/index.d.ts +0 -2
- package/dist/adhoc-editor/index.js +0 -2
- package/dist/adhoc-editor/state/ActorProvider.d.ts +0 -5
- package/dist/adhoc-editor/state/ActorProvider.js +0 -37
- package/dist/adhoc-editor/state/actor.d.ts +0 -13
- package/dist/adhoc-editor/state/actor.editor.d.ts +0 -56
- package/dist/adhoc-editor/state/actor.editor.js +0 -167
- package/dist/adhoc-editor/state/actor.js +0 -14
- package/dist/adhoc-editor/state/actor.layouter.d.ts +0 -51
- package/dist/adhoc-editor/state/actor.layouter.js +0 -54
- package/dist/adhoc-editor/state/actor.types.d.ts +0 -63
- package/dist/adhoc-editor/state/actor.types.js +0 -25
- package/dist/adhoc-editor/state/panel.d.ts +0 -95
- package/dist/adhoc-editor/state/panel.js +0 -124
- package/dist/adhoc-editor/state/utils.d.ts +0 -17
- package/dist/adhoc-editor/state/utils.js +0 -25
- package/dist/adhoc-editor/useElementsTree.d.ts +0 -18
- package/dist/adhoc-editor/useElementsTree.js +0 -98
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +0 -6
- package/dist/shadowroot/styles.css.d.ts +0 -12
- package/dist/shadowroot/styles.css.js +0 -59
|
@@ -1,8 +1,49 @@
|
|
|
1
1
|
import "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { ZIndexes } from "../../base/const.js";
|
|
3
|
+
import { readableText } from "../../utils/readableText.js";
|
|
3
4
|
import { hasAtLeast, pick } from "remeda";
|
|
4
|
-
import { GroupElementKind, Queue, invariant, nonNullable, whereOperatorAsPredicate } from "@likec4/core";
|
|
5
|
+
import { GroupElementKind, Queue, invariant, isStepPath, nonNullable, whereOperatorAsPredicate } from "@likec4/core";
|
|
5
6
|
//#region src/likec4diagram/xyflow-diagram/diagram-view.ts
|
|
7
|
+
function sentence(parts) {
|
|
8
|
+
return parts.filter((part) => !!part).map((part) => part.endsWith(".") ? part : `${part}.`).join(" ");
|
|
9
|
+
}
|
|
10
|
+
function nodeAriaLabel(node) {
|
|
11
|
+
const title = readableText(node.title) ?? node.id;
|
|
12
|
+
const description = readableText(node.description);
|
|
13
|
+
const notes = readableText(node.notes);
|
|
14
|
+
if (node.kind === GroupElementKind) {
|
|
15
|
+
const childCount = node.children.length;
|
|
16
|
+
return sentence([
|
|
17
|
+
title,
|
|
18
|
+
"Group",
|
|
19
|
+
`Contains ${childCount} ${childCount === 1 ? "node" : "nodes"}`,
|
|
20
|
+
notes && `Notes: ${notes}`
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
return sentence([
|
|
24
|
+
title,
|
|
25
|
+
`Node kind: ${node.kind}`,
|
|
26
|
+
node.technology && `Technology: ${node.technology}`,
|
|
27
|
+
description && `Description: ${description}`,
|
|
28
|
+
notes && `Notes: ${notes}`,
|
|
29
|
+
node.navigateTo && `Opens view ${node.navigateTo}`
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
function edgeAriaLabel(edge, source, target) {
|
|
33
|
+
const sourceTitle = readableText(source.title) ?? source.id;
|
|
34
|
+
const targetTitle = readableText(target.title) ?? target.id;
|
|
35
|
+
const label = readableText(edge.label);
|
|
36
|
+
const description = readableText(edge.description);
|
|
37
|
+
const notes = readableText(edge.notes);
|
|
38
|
+
return sentence([
|
|
39
|
+
`Relationship from ${sourceTitle} to ${targetTitle}`,
|
|
40
|
+
label && `Label: ${label}`,
|
|
41
|
+
edge.technology && `Technology: ${edge.technology}`,
|
|
42
|
+
description && `Description: ${description}`,
|
|
43
|
+
notes && `Notes: ${notes}`,
|
|
44
|
+
edge.navigateTo && `Opens view ${edge.navigateTo}`
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
6
47
|
/**
|
|
7
48
|
* Convert a diagram view to XY flow nodes and edges.
|
|
8
49
|
* @param opts
|
|
@@ -17,6 +58,8 @@ function diagramToXY(opts) {
|
|
|
17
58
|
const xyedges = [];
|
|
18
59
|
const nodeLookup = /* @__PURE__ */ new Map();
|
|
19
60
|
const viewLayoutDir = view.autoLayout?.direction ?? "TB";
|
|
61
|
+
const isDynamic = view._type === "dynamic";
|
|
62
|
+
const deletable = view._type !== "dynamic";
|
|
20
63
|
const queue = Queue.from(view.nodes.reduce((acc, node) => {
|
|
21
64
|
nodeLookup.set(node.id, node);
|
|
22
65
|
if (!node.parent) acc.push({
|
|
@@ -56,34 +99,83 @@ function diagramToXY(opts) {
|
|
|
56
99
|
}
|
|
57
100
|
const base = {
|
|
58
101
|
id: ns + node.id,
|
|
59
|
-
deletable
|
|
102
|
+
deletable,
|
|
60
103
|
position,
|
|
61
104
|
zIndex: isCompound ? ZIndexes.Compound : ZIndexes.Element,
|
|
62
105
|
style: {
|
|
63
106
|
width: node.width,
|
|
64
107
|
height: node.height
|
|
65
108
|
},
|
|
109
|
+
ariaLabel: nodeAriaLabel(node),
|
|
66
110
|
initialWidth: node.width,
|
|
67
111
|
initialHeight: node.height,
|
|
68
112
|
hidden: node.kind !== GroupElementKind && !visiblePredicate(node),
|
|
69
113
|
...parent && { parentId: ns + parent.id }
|
|
70
114
|
};
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
115
|
+
const modelFqn = node.modelRef ?? null;
|
|
116
|
+
const deploymentFqn = node.deploymentRef ?? null;
|
|
117
|
+
const navigateTo = { navigateTo: node.navigateTo ?? null };
|
|
118
|
+
/**
|
|
119
|
+
* Compound nodes
|
|
120
|
+
*/
|
|
121
|
+
if (isCompound) {
|
|
122
|
+
const compoundData = {
|
|
123
|
+
viewId: view.id,
|
|
124
|
+
id: node.id,
|
|
125
|
+
title: node.title,
|
|
126
|
+
color: node.color,
|
|
127
|
+
shape: node.shape,
|
|
128
|
+
style: node.style,
|
|
129
|
+
depth: node.depth ?? 0,
|
|
130
|
+
icon: node.icon ?? "none",
|
|
131
|
+
tags: node.tags ?? null,
|
|
132
|
+
x: node.x,
|
|
133
|
+
y: node.y,
|
|
134
|
+
drifts: node.drifts ?? null,
|
|
135
|
+
notes: node.notes,
|
|
136
|
+
viewLayoutDir
|
|
137
|
+
};
|
|
138
|
+
switch (true) {
|
|
139
|
+
case node.kind === GroupElementKind:
|
|
140
|
+
xynodes.push({
|
|
141
|
+
...base,
|
|
142
|
+
type: "view-group",
|
|
143
|
+
data: {
|
|
144
|
+
isViewGroup: true,
|
|
145
|
+
...compoundData
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
break;
|
|
149
|
+
case !!deploymentFqn:
|
|
150
|
+
xynodes.push({
|
|
151
|
+
...base,
|
|
152
|
+
type: "compound-deployment",
|
|
153
|
+
data: {
|
|
154
|
+
...compoundData,
|
|
155
|
+
...navigateTo,
|
|
156
|
+
deploymentFqn,
|
|
157
|
+
modelFqn
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
break;
|
|
161
|
+
default:
|
|
162
|
+
invariant(!!modelFqn, "ModelRef expected");
|
|
163
|
+
xynodes.push({
|
|
164
|
+
...base,
|
|
165
|
+
type: "compound-element",
|
|
166
|
+
data: {
|
|
167
|
+
...compoundData,
|
|
168
|
+
...navigateTo,
|
|
169
|
+
modelFqn
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (!modelFqn && !deploymentFqn) {
|
|
176
|
+
console.error("Invalid node", node);
|
|
177
|
+
throw new Error("Element should have either modelRef or deploymentRef");
|
|
178
|
+
}
|
|
87
179
|
const leafNodeData = {
|
|
88
180
|
viewId: view.id,
|
|
89
181
|
id: node.id,
|
|
@@ -105,49 +197,7 @@ function diagramToXY(opts) {
|
|
|
105
197
|
drifts: node.drifts ?? null,
|
|
106
198
|
viewLayoutDir
|
|
107
199
|
};
|
|
108
|
-
if (node.kind === GroupElementKind) {
|
|
109
|
-
xynodes.push({
|
|
110
|
-
...base,
|
|
111
|
-
type: "view-group",
|
|
112
|
-
data: {
|
|
113
|
-
isViewGroup: true,
|
|
114
|
-
...compoundData
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
const modelFqn = node.modelRef ?? null;
|
|
120
|
-
const deploymentFqn = node.deploymentRef ?? null;
|
|
121
|
-
if (!modelFqn && !deploymentFqn) {
|
|
122
|
-
console.error("Invalid node", node);
|
|
123
|
-
throw new Error("Element should have either modelRef or deploymentRef");
|
|
124
|
-
}
|
|
125
|
-
const navigateTo = { navigateTo: node.navigateTo ?? null };
|
|
126
200
|
switch (true) {
|
|
127
|
-
case isCompound && !!deploymentFqn:
|
|
128
|
-
xynodes.push({
|
|
129
|
-
...base,
|
|
130
|
-
type: "compound-deployment",
|
|
131
|
-
data: {
|
|
132
|
-
...compoundData,
|
|
133
|
-
...navigateTo,
|
|
134
|
-
deploymentFqn,
|
|
135
|
-
modelFqn
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
break;
|
|
139
|
-
case isCompound:
|
|
140
|
-
invariant(!!modelFqn, "ModelRef expected");
|
|
141
|
-
xynodes.push({
|
|
142
|
-
...base,
|
|
143
|
-
type: "compound-element",
|
|
144
|
-
data: {
|
|
145
|
-
...compoundData,
|
|
146
|
-
...navigateTo,
|
|
147
|
-
modelFqn
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
break;
|
|
151
201
|
case !!deploymentFqn:
|
|
152
202
|
xynodes.push({
|
|
153
203
|
...base,
|
|
@@ -173,6 +223,7 @@ function diagramToXY(opts) {
|
|
|
173
223
|
});
|
|
174
224
|
}
|
|
175
225
|
}
|
|
226
|
+
let stepnum = 1;
|
|
176
227
|
for (const edge of view.edges) {
|
|
177
228
|
const source = edge.source;
|
|
178
229
|
const target = edge.target;
|
|
@@ -186,9 +237,10 @@ function diagramToXY(opts) {
|
|
|
186
237
|
type: "relationship",
|
|
187
238
|
source: ns + source,
|
|
188
239
|
target: ns + target,
|
|
240
|
+
ariaLabel: edgeAriaLabel(edge, nodeById(source), nodeById(target)),
|
|
189
241
|
zIndex: ZIndexes.Edge,
|
|
190
242
|
hidden: !visiblePredicate(edge),
|
|
191
|
-
deletable
|
|
243
|
+
deletable,
|
|
192
244
|
data: {
|
|
193
245
|
id: edge.id,
|
|
194
246
|
label: edge.label,
|
|
@@ -197,6 +249,7 @@ function diagramToXY(opts) {
|
|
|
197
249
|
navigateTo: edge.navigateTo,
|
|
198
250
|
controlPoints: edge.controlPoints ?? null,
|
|
199
251
|
labelBBox: edge.labelBBox ?? null,
|
|
252
|
+
isLabelCustomized: edge.isLabelCustomized ?? false,
|
|
200
253
|
labelXY: null,
|
|
201
254
|
points: edge.points,
|
|
202
255
|
color: edge.color ?? "gray",
|
|
@@ -205,7 +258,8 @@ function diagramToXY(opts) {
|
|
|
205
258
|
head: edge.head ?? "normal",
|
|
206
259
|
tail: edge.tail ?? "none",
|
|
207
260
|
astPath: edge.astPath,
|
|
208
|
-
drifts: edge.drifts ?? null
|
|
261
|
+
drifts: edge.drifts ?? null,
|
|
262
|
+
...isDynamic && isStepPath(edge.id) && { stepnum: stepnum++ }
|
|
209
263
|
},
|
|
210
264
|
interactionWidth: 20
|
|
211
265
|
});
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { DiagramEdge, DiagramNode,
|
|
1
|
+
import { BBox, DiagramEdge, DiagramNode, NodeId, StepPath, ViewId } from '@likec4/core/types';
|
|
2
|
+
export type Spacing = number | Partial<{
|
|
3
|
+
top: number;
|
|
4
|
+
left: number;
|
|
5
|
+
right: number;
|
|
6
|
+
bottom: number;
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}>;
|
|
2
10
|
export type Step = {
|
|
3
|
-
id:
|
|
11
|
+
id: StepPath;
|
|
4
12
|
from: {
|
|
5
13
|
column: number;
|
|
6
14
|
row: number;
|
|
@@ -18,7 +26,7 @@ export type Step = {
|
|
|
18
26
|
};
|
|
19
27
|
isSelfLoop: boolean;
|
|
20
28
|
isBack: boolean;
|
|
21
|
-
|
|
29
|
+
parent: StepPath | null;
|
|
22
30
|
offset: number;
|
|
23
31
|
edge: DiagramEdge;
|
|
24
32
|
};
|
|
@@ -28,8 +36,7 @@ export type Compound = {
|
|
|
28
36
|
to: DiagramNode;
|
|
29
37
|
nested: Compound[];
|
|
30
38
|
};
|
|
31
|
-
export type
|
|
32
|
-
parallelPrefix: string;
|
|
39
|
+
export type Rect = {
|
|
33
40
|
min: {
|
|
34
41
|
column: number;
|
|
35
42
|
row: number;
|
|
@@ -39,3 +46,46 @@ export type ParallelRect = {
|
|
|
39
46
|
row: number;
|
|
40
47
|
};
|
|
41
48
|
};
|
|
49
|
+
export type ParallelRect = Rect & {
|
|
50
|
+
parallelPrefix: string;
|
|
51
|
+
};
|
|
52
|
+
export interface SequenceActorStepPort {
|
|
53
|
+
id: string;
|
|
54
|
+
cx: number;
|
|
55
|
+
cy: number;
|
|
56
|
+
height: number;
|
|
57
|
+
type: 'target' | 'source';
|
|
58
|
+
position: 'left' | 'right' | 'top' | 'bottom';
|
|
59
|
+
hidden?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface SequenceActor {
|
|
62
|
+
id: NodeId;
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
width: number;
|
|
66
|
+
height: number;
|
|
67
|
+
ports: Array<SequenceActorStepPort>;
|
|
68
|
+
}
|
|
69
|
+
export interface SequenceCompound {
|
|
70
|
+
id: NodeId;
|
|
71
|
+
origin: NodeId;
|
|
72
|
+
x: number;
|
|
73
|
+
y: number;
|
|
74
|
+
width: number;
|
|
75
|
+
height: number;
|
|
76
|
+
depth: number;
|
|
77
|
+
}
|
|
78
|
+
export interface SequenceParallelArea {
|
|
79
|
+
parallelPrefix: string;
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
}
|
|
85
|
+
export interface SequenceViewLayout {
|
|
86
|
+
id: ViewId;
|
|
87
|
+
actors: Array<SequenceActor>;
|
|
88
|
+
compounds: Array<SequenceCompound>;
|
|
89
|
+
parallelAreas: Array<SequenceParallelArea>;
|
|
90
|
+
bounds: BBox;
|
|
91
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare const ACTOR_GAP =
|
|
2
|
-
export declare const COLUMN_GAP =
|
|
3
|
-
export declare const MIN_ROW_HEIGHT =
|
|
4
|
-
export declare const PORT_HEIGHT =
|
|
1
|
+
export declare const ACTOR_GAP = 80;
|
|
2
|
+
export declare const COLUMN_GAP = 50;
|
|
3
|
+
export declare const MIN_ROW_HEIGHT = 100;
|
|
4
|
+
export declare const PORT_HEIGHT = 24;
|
|
5
5
|
export declare const STEP_LABEL_MARGIN = 50;
|
|
6
6
|
export declare const FIRST_STEP_OFFSET = 30;
|
|
7
7
|
export declare const CONTINUOUS_OFFSET = 22;
|
|
8
8
|
export declare const SeqZIndex: {
|
|
9
9
|
compound: number;
|
|
10
|
-
|
|
10
|
+
subflows: number;
|
|
11
11
|
actor: number;
|
|
12
12
|
step: number;
|
|
13
13
|
};
|
|
@@ -1,15 +1,31 @@
|
|
|
1
|
-
import { BBox, DiagramNode, NonEmptyArray } from '@likec4/core/types';
|
|
1
|
+
import { BBox, DiagramNode, DynamicViewFlow, NonEmptyArray, StepPath } from '@likec4/core/types';
|
|
2
2
|
import { Compound, Step } from './_types';
|
|
3
|
+
import * as kiwi from '@lume/kiwi';
|
|
4
|
+
export interface BBoxVars {
|
|
5
|
+
x1: kiwi.Expression | kiwi.Variable;
|
|
6
|
+
y1: kiwi.Expression | kiwi.Variable;
|
|
7
|
+
x2: kiwi.Expression | kiwi.Variable;
|
|
8
|
+
y2: kiwi.Expression | kiwi.Variable;
|
|
9
|
+
}
|
|
10
|
+
export declare const Strength: {
|
|
11
|
+
required: number;
|
|
12
|
+
strong: number;
|
|
13
|
+
medium: number;
|
|
14
|
+
soft: number;
|
|
15
|
+
weak: number;
|
|
16
|
+
};
|
|
3
17
|
export declare class SequenceViewLayouter {
|
|
4
18
|
#private;
|
|
5
|
-
constructor({ actors, steps, compounds, }: {
|
|
19
|
+
constructor({ actors, steps, compounds, flow, collapsedFlows, }: {
|
|
6
20
|
actors: NonEmptyArray<DiagramNode>;
|
|
7
21
|
steps: Array<Step>;
|
|
8
22
|
compounds: Array<Compound>;
|
|
23
|
+
flow: DynamicViewFlow;
|
|
24
|
+
collapsedFlows: StepPath[];
|
|
9
25
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}>;
|
|
26
|
+
getSubflowAreas(): Array<{
|
|
27
|
+
id: StepPath;
|
|
28
|
+
} & BBox>;
|
|
13
29
|
getActorBox(actor: DiagramNode): BBox;
|
|
14
30
|
getCompoundBoxes(): Array<BBox & {
|
|
15
31
|
node: DiagramNode;
|
|
@@ -20,6 +36,7 @@ export declare class SequenceViewLayouter {
|
|
|
20
36
|
cy: number;
|
|
21
37
|
height: number;
|
|
22
38
|
};
|
|
39
|
+
isStepCollapsed(step: Step): boolean;
|
|
23
40
|
getViewBounds(): {
|
|
24
41
|
x: number;
|
|
25
42
|
y: number;
|
|
@@ -29,9 +46,16 @@ export declare class SequenceViewLayouter {
|
|
|
29
46
|
private actorBox;
|
|
30
47
|
private addActors;
|
|
31
48
|
private addStep;
|
|
32
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Recursively adds a compound and its nested compounds to the layout.
|
|
51
|
+
* Also updates offsets of the actor boxes to accommodate the compound.
|
|
52
|
+
*/
|
|
33
53
|
private addCompound;
|
|
34
54
|
private ensureRow;
|
|
55
|
+
private collapseRect;
|
|
56
|
+
private getRectBounds;
|
|
57
|
+
private wrapAroundRect;
|
|
58
|
+
private createSubflowAreas;
|
|
35
59
|
private newVar;
|
|
36
60
|
/**
|
|
37
61
|
* Adds a required constraint:
|