@likec4/diagram 1.17.1 → 1.19.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/LICENSE +1 -1
- package/dist/LikeC4CustomColors.d.ts +7 -0
- package/dist/LikeC4CustomColors.js +30 -0
- package/dist/LikeC4Diagram.css.d.ts +5 -0
- package/dist/LikeC4Diagram.css.js +13 -0
- package/dist/LikeC4Diagram.d.ts +6 -0
- package/dist/LikeC4Diagram.js +194 -0
- package/dist/LikeC4Diagram.props.d.ts +166 -0
- package/dist/LikeC4ModelProvider.d.ts +9 -0
- package/dist/LikeC4ModelProvider.js +12 -0
- package/dist/LikeC4Search.css.d.ts +1 -0
- package/dist/LikeC4Search.css.js +5 -0
- package/dist/LikeC4Search.d.ts +2 -0
- package/dist/LikeC4Search.js +96 -0
- package/dist/StaticLikeC4Diagram.d.ts +3 -0
- package/dist/StaticLikeC4Diagram.js +41 -0
- package/dist/_virtual/_commonjsHelpers.js +6 -0
- package/dist/controls/Text.d.ts +2 -0
- package/dist/controls/Text.js +7 -0
- package/dist/controls/action-button-bar/ActionButtonBar.css.d.ts +1 -0
- package/dist/controls/action-button-bar/ActionButtonBar.css.js +5 -0
- package/dist/controls/action-button-bar/ActionButtonBar.d.ts +9 -0
- package/dist/controls/action-button-bar/ActionButtonBar.js +100 -0
- package/dist/controls/action-button-bar/useActionButtonBarCtx.d.ts +10 -0
- package/dist/controls/action-button-bar/useActionButtonBarCtx.js +9 -0
- package/dist/controls/action-buttons/ActionButton.css.d.ts +1 -0
- package/dist/controls/action-buttons/ActionButton.css.js +5 -0
- package/dist/controls/action-buttons/ActionButton.d.ts +9 -0
- package/dist/controls/action-buttons/ActionButton.js +66 -0
- package/dist/controls/action-buttons/ActionButtons.d.ts +12 -0
- package/dist/controls/action-buttons/ActionButtons.js +99 -0
- package/dist/globals.css.d.ts +1 -0
- package/dist/globals.css.js +92 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useDiagramState.d.ts +6 -0
- package/dist/hooks/useDiagramState.js +27 -0
- package/dist/hooks/useMantinePortalProps.d.ts +9 -0
- package/dist/hooks/useMantinePortalProps.js +9 -0
- package/dist/hooks/useSetState.d.ts +2 -0
- package/dist/hooks/useSetState.js +19 -0
- package/dist/hooks/useUpdateEffect.d.ts +4 -0
- package/dist/hooks/useUpdateEffect.js +32 -0
- package/dist/hooks/useXYFlow.d.ts +270 -0
- package/dist/hooks/useXYFlow.js +20 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +25 -0
- package/dist/likec4model/LikeC4ModelContext.d.ts +3 -0
- package/dist/likec4model/LikeC4ModelContext.js +5 -0
- package/dist/likec4model/index.d.ts +2 -0
- package/dist/likec4model/useLikeC4ElementsTree.d.ts +12 -0
- package/dist/likec4model/useLikeC4ElementsTree.js +25 -0
- package/dist/likec4model/useLikeC4Model.d.ts +20 -0
- package/dist/likec4model/useLikeC4Model.js +55 -0
- package/dist/overlays/OverlayContext.d.ts +10 -0
- package/dist/overlays/OverlayContext.js +9 -0
- package/dist/overlays/Overlays.css.d.ts +3 -0
- package/dist/overlays/Overlays.css.js +7 -0
- package/dist/overlays/Overlays.d.ts +2 -0
- package/dist/overlays/Overlays.js +137 -0
- package/dist/overlays/edge-details/EdgeDetailsXYFlow.d.ts +5 -0
- package/dist/overlays/edge-details/EdgeDetailsXYFlow.js +185 -0
- package/dist/overlays/edge-details/SelectEdge.css.d.ts +7 -0
- package/dist/overlays/edge-details/SelectEdge.css.js +17 -0
- package/dist/overlays/edge-details/SelectEdge.d.ts +5 -0
- package/dist/overlays/edge-details/SelectEdge.js +129 -0
- package/dist/overlays/edge-details/_types.d.ts +14 -0
- package/dist/overlays/edge-details/use-layouted-edge-details.d.ts +21 -0
- package/dist/overlays/edge-details/use-layouted-edge-details.js +270 -0
- package/dist/overlays/edge-details/xyflow/CompoundNode.d.ts +5 -0
- package/dist/overlays/edge-details/xyflow/CompoundNode.js +76 -0
- package/dist/overlays/edge-details/xyflow/ElementNode.d.ts +5 -0
- package/dist/overlays/edge-details/xyflow/ElementNode.js +159 -0
- package/dist/overlays/edge-details/xyflow/RelationshipEdge.d.ts +3 -0
- package/dist/overlays/edge-details/xyflow/RelationshipEdge.js +84 -0
- package/dist/overlays/edge-details/xyflow/styles.css.d.ts +9 -0
- package/dist/overlays/edge-details/xyflow/styles.css.js +21 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.d.ts +16 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +33 -0
- package/dist/overlays/element-details/ElementDetailsCard.d.ts +7 -0
- package/dist/overlays/element-details/ElementDetailsCard.js +484 -0
- package/dist/overlays/element-details/TabPanelDeployments.css.d.ts +4 -0
- package/dist/overlays/element-details/TabPanelDeployments.css.js +11 -0
- package/dist/overlays/element-details/TabPanelDeployments.d.ts +7 -0
- package/dist/overlays/element-details/TabPanelDeployments.js +173 -0
- package/dist/overlays/element-details/TabPanelRelationships.css.d.ts +5 -0
- package/dist/overlays/element-details/TabPanelRelationships.css.js +11 -0
- package/dist/overlays/element-details/TabPanelRelationships.d.ts +8 -0
- package/dist/overlays/element-details/TabPanelRelationships.js +157 -0
- package/dist/overlays/element-details/TabPanelStructure.css.d.ts +2 -0
- package/dist/overlays/element-details/TabPanelStructure.css.js +7 -0
- package/dist/overlays/element-details/TabPanelStructure.d.ts +25 -0
- package/dist/overlays/element-details/TabPanelStructure.js +91 -0
- package/dist/overlays/index.d.ts +1 -0
- package/dist/overlays/relationships-of/RelationshipsOverlay.d.ts +5 -0
- package/dist/overlays/relationships-of/RelationshipsOverlay.js +193 -0
- package/dist/overlays/relationships-of/RelationshipsXYFlow.d.ts +19 -0
- package/dist/overlays/relationships-of/RelationshipsXYFlow.js +290 -0
- package/dist/overlays/relationships-of/SelectElement.css.d.ts +2 -0
- package/dist/overlays/relationships-of/SelectElement.css.js +7 -0
- package/dist/overlays/relationships-of/SelectElement.d.ts +7 -0
- package/dist/overlays/relationships-of/SelectElement.js +126 -0
- package/dist/overlays/relationships-of/_types.d.ts +28 -0
- package/dist/overlays/relationships-of/use-layouted-relationships.d.ts +22 -0
- package/dist/overlays/relationships-of/use-layouted-relationships.js +496 -0
- package/dist/overlays/relationships-of/xyflow/CompoundNode.d.ts +6 -0
- package/dist/overlays/relationships-of/xyflow/CompoundNode.js +120 -0
- package/dist/overlays/relationships-of/xyflow/ElementNode.d.ts +6 -0
- package/dist/overlays/relationships-of/xyflow/ElementNode.js +194 -0
- package/dist/overlays/relationships-of/xyflow/EmptyNode.d.ts +5 -0
- package/dist/overlays/relationships-of/xyflow/EmptyNode.js +18 -0
- package/dist/overlays/relationships-of/xyflow/RelationshipEdge.d.ts +3 -0
- package/dist/overlays/relationships-of/xyflow/RelationshipEdge.js +123 -0
- package/dist/overlays/relationships-of/xyflow/styles.css.d.ts +14 -0
- package/dist/overlays/relationships-of/xyflow/styles.css.js +24 -0
- package/dist/overlays/shared/xyflow/RelationshipEdge.css.d.ts +4 -0
- package/dist/overlays/shared/xyflow/RelationshipEdge.css.js +12 -0
- package/dist/overlays/shared/xyflow/_types.d.ts +77 -0
- package/dist/state/DiagramContext.d.ts +1609 -0
- package/dist/state/DiagramContext.js +101 -0
- package/dist/state/aligners.d.ts +42 -0
- package/dist/state/aligners.js +349 -0
- package/dist/state/diagram-to-xyflow.d.ts +11 -0
- package/dist/state/diagram-to-xyflow.js +113 -0
- package/dist/state/diagramStore.d.ts +1705 -0
- package/dist/state/diagramStore.js +808 -0
- package/dist/state/diagramStore.layout.d.ts +4 -0
- package/dist/state/diagramStore.layout.js +56 -0
- package/dist/style.css +1 -0
- package/dist/theme-vars.css.d.ts +72 -0
- package/dist/theme-vars.css.js +6 -0
- package/dist/theme-vars.css.ts.vanilla.css.js +1 -0
- package/dist/theme-vars.d.ts +3 -0
- package/dist/theme-vars.js +5 -0
- package/dist/ui/DiagramTitlePanel.css.d.ts +4 -0
- package/dist/ui/DiagramTitlePanel.css.js +11 -0
- package/dist/ui/DiagramTitlePanel.d.ts +1 -0
- package/dist/ui/DiagramTitlePanel.js +159 -0
- package/dist/ui/DynamicViewWalkthrough.css.d.ts +4 -0
- package/dist/ui/DynamicViewWalkthrough.css.js +11 -0
- package/dist/ui/DynamicViewWalkthrough.d.ts +1 -0
- package/dist/ui/DynamicViewWalkthrough.js +156 -0
- package/dist/ui/EnsureMantine.d.ts +7 -0
- package/dist/ui/EnsureMantine.js +14 -0
- package/dist/ui/FramerMotionConfig.d.ts +2 -0
- package/dist/ui/FramerMotionConfig.js +14 -0
- package/dist/ui/Link.d.ts +4 -0
- package/dist/ui/Link.js +36 -0
- package/dist/ui/notation/NotationPanel.css.d.ts +6 -0
- package/dist/ui/notation/NotationPanel.css.js +16 -0
- package/dist/ui/notation/NotationPanel.d.ts +1 -0
- package/dist/ui/notation/NotationPanel.js +250 -0
- package/dist/ui/notation/index.d.ts +1 -0
- package/dist/ui/top-left/ChangeAutoLayoutButton.d.ts +2 -0
- package/dist/ui/top-left/ChangeAutoLayoutButton.js +159 -0
- package/dist/ui/top-left/ManualLayoutToolsButton.d.ts +2 -0
- package/dist/ui/top-left/ManualLayoutToolsButton.js +137 -0
- package/dist/ui/top-left/TopLeftPanel.d.ts +4 -0
- package/dist/ui/top-left/TopLeftPanel.js +211 -0
- package/dist/ui/top-left/_shared.d.ts +7 -0
- package/dist/ui/top-left/_shared.js +22 -0
- package/dist/ui/top-left/styles.css.d.ts +8 -0
- package/dist/ui/top-left/styles.css.js +17 -0
- package/dist/utils/types.d.ts +8 -0
- package/dist/utils/vector.d.ts +24 -0
- package/dist/utils/vector.js +55 -0
- package/dist/xyflow/EdgeMarkers.d.ts +12 -0
- package/dist/xyflow/EdgeMarkers.js +192 -0
- package/dist/xyflow/FitviewOnDiagramChange.d.ts +4 -0
- package/dist/xyflow/FitviewOnDiagramChange.js +72 -0
- package/dist/xyflow/SelectEdgesOnNodeFocus.d.ts +1 -0
- package/dist/xyflow/SelectEdgesOnNodeFocus.js +96 -0
- package/dist/xyflow/XYFlow.d.ts +8 -0
- package/dist/xyflow/XYFlow.js +145 -0
- package/dist/xyflow/XYFlowBackground.d.ts +10 -0
- package/dist/xyflow/XYFlowBackground.js +25 -0
- package/dist/xyflow/XYFlowInner.d.ts +8 -0
- package/dist/xyflow/XYFlowInner.js +41 -0
- package/dist/xyflow/const.d.ts +7 -0
- package/dist/xyflow/const.js +12 -0
- package/dist/xyflow/edges/EdgeLabel.d.ts +7 -0
- package/dist/xyflow/edges/EdgeLabel.js +160 -0
- package/dist/xyflow/edges/RelationshipEdge.d.ts +6 -0
- package/dist/xyflow/edges/RelationshipEdge.js +443 -0
- package/dist/xyflow/edges/RelationshipsDropdownMenu.css.d.ts +4 -0
- package/dist/xyflow/edges/RelationshipsDropdownMenu.css.js +11 -0
- package/dist/xyflow/edges/RelationshipsDropdownMenu.d.ts +13 -0
- package/dist/xyflow/edges/RelationshipsDropdownMenu.js +211 -0
- package/dist/xyflow/edges/edges.css.d.ts +17 -0
- package/dist/xyflow/edges/edges.css.js +37 -0
- package/dist/xyflow/edges/utils.d.ts +16 -0
- package/dist/xyflow/edges/utils.js +24 -0
- package/dist/xyflow/nodes/AnimateVariants.d.ts +1313 -0
- package/dist/xyflow/nodes/AnimateVariants.js +123 -0
- package/dist/xyflow/nodes/Node.css.d.ts +3 -0
- package/dist/xyflow/nodes/Node.css.js +9 -0
- package/dist/xyflow/nodes/compound/CompoundNode.css.d.ts +14 -0
- package/dist/xyflow/nodes/compound/CompoundNode.css.js +27 -0
- package/dist/xyflow/nodes/compound/CompoundNode.d.ts +6 -0
- package/dist/xyflow/nodes/compound/CompoundNode.js +216 -0
- package/dist/xyflow/nodes/compound/index.d.ts +1 -0
- package/dist/xyflow/nodes/element/ElementLink.css.d.ts +3 -0
- package/dist/xyflow/nodes/element/ElementLink.d.ts +6 -0
- package/dist/xyflow/nodes/element/ElementNode.d.ts +6 -0
- package/dist/xyflow/nodes/element/ElementNode.js +190 -0
- package/dist/xyflow/nodes/element/ElementShapeSvg.d.ts +17 -0
- package/dist/xyflow/nodes/element/ElementShapeSvg.js +175 -0
- package/dist/xyflow/nodes/element/element.css.d.ts +18 -0
- package/dist/xyflow/nodes/element/element.css.js +31 -0
- package/dist/xyflow/nodes/element/index.d.ts +1 -0
- package/dist/xyflow/nodes/shared/ElementIcon.d.ts +8 -0
- package/dist/xyflow/nodes/shared/ElementIcon.js +38 -0
- package/dist/xyflow/nodes/shared/Toolbar.d.ts +9 -0
- package/dist/xyflow/nodes/shared/Toolbar.js +436 -0
- package/dist/xyflow/types.d.ts +36 -0
- package/dist/xyflow/useLayoutConstraints.d.ts +42 -0
- package/dist/xyflow/useLayoutConstraints.js +226 -0
- package/dist/xyflow/useXYFlowEvents.d.ts +160 -0
- package/dist/xyflow/useXYFlowEvents.js +275 -0
- package/dist/xyflow/utils.d.ts +22 -0
- package/dist/xyflow/utils.js +72 -0
- package/package.json +40 -31
- package/src/LikeC4Diagram.props.ts +21 -12
- package/src/LikeC4Diagram.tsx +8 -10
- package/src/LikeC4Search.css.ts +12 -0
- package/src/LikeC4Search.tsx +45 -93
- package/src/controls/Text.ts +5 -0
- package/src/controls/action-button-bar/ActionButtonBar.css.ts +13 -0
- package/src/controls/action-button-bar/ActionButtonBar.tsx +138 -0
- package/src/controls/action-button-bar/useActionButtonBarCtx.ts +13 -0
- package/src/controls/action-buttons/ActionButton.css.ts +29 -0
- package/src/controls/action-buttons/ActionButton.tsx +66 -0
- package/src/controls/action-buttons/ActionButtons.tsx +138 -0
- package/src/hooks/useDiagramState.ts +8 -3
- package/src/hooks/useXYFlow.ts +9 -8
- package/src/index.ts +12 -6
- package/src/likec4model/index.ts +12 -2
- package/src/likec4model/useLikeC4ElementsTree.ts +6 -13
- package/src/likec4model/useLikeC4Model.ts +21 -11
- package/src/overlays/Overlays.tsx +96 -63
- package/src/overlays/edge-details/EdgeDetailsXYFlow.tsx +18 -10
- package/src/overlays/edge-details/_types.ts +13 -33
- package/src/overlays/edge-details/use-layouted-edge-details.ts +35 -26
- package/src/overlays/edge-details/xyflow/CompoundNode.tsx +3 -11
- package/src/overlays/edge-details/xyflow/ElementNode.tsx +8 -13
- package/src/overlays/edge-details/xyflow/RelationshipEdge.tsx +7 -7
- package/src/overlays/edge-details/xyflow/styles.css.ts +1 -59
- package/src/overlays/element-details/ElementDetailsCard.tsx +91 -78
- package/src/overlays/element-details/TabPanelDeployments.css.ts +69 -0
- package/src/overlays/element-details/TabPanelDeployments.tsx +217 -0
- package/src/overlays/element-details/TabPanelRelationships.tsx +8 -9
- package/src/overlays/element-details/TabPanelStructure.tsx +10 -10
- package/src/overlays/relationships-of/RelationshipsOverlay.tsx +1 -1
- package/src/overlays/relationships-of/RelationshipsXYFlow.tsx +26 -34
- package/src/overlays/relationships-of/SelectElement.tsx +2 -2
- package/src/overlays/relationships-of/_types.ts +20 -58
- package/src/overlays/relationships-of/use-layouted-relationships.ts +54 -59
- package/src/overlays/relationships-of/xyflow/CompoundNode.tsx +10 -16
- package/src/overlays/relationships-of/xyflow/ElementNode.tsx +24 -21
- package/src/overlays/relationships-of/xyflow/EmptyNode.tsx +4 -7
- package/src/overlays/relationships-of/xyflow/RelationshipEdge.tsx +16 -15
- package/src/overlays/shared/xyflow/RelationshipEdge.css.ts +60 -0
- package/src/overlays/shared/xyflow/_types.ts +87 -0
- package/src/state/diagram-to-xyflow.ts +6 -7
- package/src/state/diagramStore.layout.ts +3 -4
- package/src/state/diagramStore.ts +63 -48
- package/src/theme-vars.css.ts +81 -0
- package/src/theme-vars.ts +8 -81
- package/src/ui/DiagramTitlePanel.tsx +7 -34
- package/src/ui/Link.tsx +40 -0
- package/src/ui/notation/NotationPanel.tsx +4 -2
- package/src/ui/top-left/ChangeAutoLayoutButton.tsx +2 -2
- package/src/ui/top-left/TopLeftPanel.tsx +5 -5
- package/src/utils/types.ts +6 -0
- package/src/xyflow/SelectEdgesOnNodeFocus.tsx +3 -3
- package/src/xyflow/XYFlow.tsx +2 -2
- package/src/xyflow/edges/EdgeLabel.tsx +26 -19
- package/src/xyflow/edges/RelationshipEdge.tsx +5 -3
- package/src/xyflow/edges/RelationshipsDropdownMenu.tsx +23 -10
- package/src/xyflow/edges/edges.css.ts +68 -74
- package/src/xyflow/edges/utils.ts +6 -6
- package/src/xyflow/nodes/AnimateVariants.ts +143 -0
- package/src/xyflow/nodes/Node.css.ts +44 -0
- package/src/xyflow/nodes/compound/CompoundNode.css.ts +27 -75
- package/src/xyflow/nodes/compound/CompoundNode.tsx +82 -163
- package/src/xyflow/nodes/element/ElementLink.tsx +2 -3
- package/src/xyflow/nodes/element/ElementNode.tsx +73 -252
- package/src/xyflow/nodes/element/element.css.ts +40 -64
- package/src/xyflow/nodes/shared/ElementIcon.tsx +1 -1
- package/src/xyflow/nodes/shared/Toolbar.tsx +51 -35
- package/src/xyflow/types.ts +48 -51
- package/src/xyflow/useLayoutConstraints.ts +10 -10
- package/src/xyflow/useXYFlowEvents.ts +31 -35
- package/src/xyflow/utils.ts +2 -2
- package/src/ui/OptionsPanel.css.ts +0 -9
- package/src/ui/OptionsPanel.tsx +0 -70
- package/src/ui/options/EdgeOptions.tsx +0 -142
- package/src/ui/options/NodeOptions.tsx +0 -362
- package/src/xyflow/nodes/element/ElementDetails.css.ts +0 -101
- package/src/xyflow/nodes/element/ElementDetails.tsx +0 -393
- package/src/xyflow/nodes/use-animate-variants.tsx +0 -64
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Text,
|
|
13
13
|
TooltipGroup
|
|
14
14
|
} from '@mantine/core'
|
|
15
|
+
import { openSpotlight } from '@mantine/spotlight'
|
|
15
16
|
import {
|
|
16
17
|
IconAlertTriangle,
|
|
17
18
|
IconChevronLeft,
|
|
@@ -31,7 +32,6 @@ import { ActionIcon, Tooltip } from './_shared'
|
|
|
31
32
|
import { ChangeAutoLayoutButton } from './ChangeAutoLayoutButton'
|
|
32
33
|
import { ManualLayoutToolsButton } from './ManualLayoutToolsButton'
|
|
33
34
|
import * as css from './styles.css'
|
|
34
|
-
import { openSpotlight } from '@mantine/spotlight'
|
|
35
35
|
|
|
36
36
|
const historySelector = (s: DiagramState) => ({
|
|
37
37
|
showBurgerMenu: !!s.onBurgerMenuClick,
|
|
@@ -158,7 +158,7 @@ export const TopLeftPanel = () => {
|
|
|
158
158
|
showFitDiagram: s.controls && s.fitViewEnabled && s.zoomable && isNotWalkthrough,
|
|
159
159
|
showLayoutDriftWarning: s.controls && !s.readonly && s.view.hasLayoutDrift === true && isNotActive,
|
|
160
160
|
showChangeAutoLayout: s.controls && s.isEditable() && isNotActive,
|
|
161
|
-
showGoToSource: s.controls && !!s.
|
|
161
|
+
showGoToSource: s.controls && !!s.onOpenSource && isNotWalkthrough,
|
|
162
162
|
viewportChanged: s.viewportChanged,
|
|
163
163
|
showManualLayoutTools: s.controls && s.readonly !== true && s.experimentalEdgeEditing === true
|
|
164
164
|
})
|
|
@@ -179,10 +179,10 @@ export const TopLeftPanel = () => {
|
|
|
179
179
|
{showNavigationButtons && <BackwardForwardButtons />}
|
|
180
180
|
<ActionIconGroup className={css.actionIconGroup} orientation="vertical">
|
|
181
181
|
{enableSearch && (
|
|
182
|
-
<Tooltip label="Search">
|
|
182
|
+
<Tooltip label="Search (Ctrl+F or ⌘+F)">
|
|
183
183
|
<ActionIcon
|
|
184
184
|
onClick={() => openSpotlight()}
|
|
185
|
-
|
|
185
|
+
>
|
|
186
186
|
<IconSearch />
|
|
187
187
|
</ActionIcon>
|
|
188
188
|
</Tooltip>
|
|
@@ -192,7 +192,7 @@ export const TopLeftPanel = () => {
|
|
|
192
192
|
<ActionIcon
|
|
193
193
|
onClick={e => {
|
|
194
194
|
e.stopPropagation()
|
|
195
|
-
store.getState().onOpenSourceView
|
|
195
|
+
store.getState().onOpenSourceView()
|
|
196
196
|
}}>
|
|
197
197
|
<IconFileSymlink stroke={1.5} />
|
|
198
198
|
</ActionIcon>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Edge, Node } from '@xyflow/react'
|
|
2
|
+
import type { Merge } from 'type-fest'
|
|
3
|
+
|
|
4
|
+
export type AddNodeData<T extends Node, Data> = Omit<T, 'data'> & { data: Merge<T['data'], Data> }
|
|
5
|
+
|
|
6
|
+
export type AddEdgeData<T extends Edge, Data> = Omit<T, 'data'> & { data: Merge<T['data'], Data> }
|
|
@@ -5,7 +5,7 @@ import { getBoundsOfRects, getViewportForBounds } from '@xyflow/system'
|
|
|
5
5
|
import { useUpdateEffect } from '../hooks'
|
|
6
6
|
import { useDiagramState, useDiagramStoreApi } from '../hooks/useDiagramState'
|
|
7
7
|
import { MinZoom } from './const'
|
|
8
|
-
import type {
|
|
8
|
+
import type { DiagramFlowTypes } from './types'
|
|
9
9
|
import { nodeToRect } from './utils'
|
|
10
10
|
|
|
11
11
|
export function SelectEdgesOnNodeFocus() {
|
|
@@ -22,8 +22,8 @@ export function SelectEdgesOnNodeFocus() {
|
|
|
22
22
|
return
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const edgeChanges = [] as EdgeChange<
|
|
26
|
-
const nodeChanges = [] as NodeChange<
|
|
25
|
+
const edgeChanges = [] as EdgeChange<DiagramFlowTypes.Edge>[]
|
|
26
|
+
const nodeChanges = [] as NodeChange<DiagramFlowTypes.Node>[]
|
|
27
27
|
const {
|
|
28
28
|
edgeLookup,
|
|
29
29
|
nodeLookup,
|
package/src/xyflow/XYFlow.tsx
CHANGED
|
@@ -8,9 +8,9 @@ import { MaxZoom, MinZoom } from './const'
|
|
|
8
8
|
import { RelationshipEdge } from './edges/RelationshipEdge'
|
|
9
9
|
import { CompoundNode } from './nodes/compound'
|
|
10
10
|
import { ElementNode } from './nodes/element'
|
|
11
|
-
import { XYFlowEdge, XYFlowNode } from './types'
|
|
12
11
|
import { useLayoutConstraints } from './useLayoutConstraints'
|
|
13
12
|
import { useXYFlowEvents } from './useXYFlowEvents'
|
|
13
|
+
import type { DiagramFlowTypes } from './types'
|
|
14
14
|
|
|
15
15
|
const nodeTypes = {
|
|
16
16
|
element: ElementNode,
|
|
@@ -117,7 +117,7 @@ export function XYFlow({
|
|
|
117
117
|
// }, [])
|
|
118
118
|
|
|
119
119
|
return (
|
|
120
|
-
<ReactFlow<
|
|
120
|
+
<ReactFlow<DiagramFlowTypes.Node, DiagramFlowTypes.Edge>
|
|
121
121
|
className={className}
|
|
122
122
|
style={style}
|
|
123
123
|
{...colorMode && { colorMode }}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { extractStep, isStepEdgeId
|
|
1
|
+
import { type ViewId, extractStep, isStepEdgeId } from '@likec4/core'
|
|
2
2
|
import {
|
|
3
|
+
type BoxProps,
|
|
3
4
|
ActionIcon,
|
|
4
5
|
Box,
|
|
5
|
-
type BoxProps,
|
|
6
6
|
Button,
|
|
7
7
|
CloseButton,
|
|
8
8
|
Group,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
PopoverTarget,
|
|
12
12
|
ScrollAreaAutosize,
|
|
13
13
|
Stack,
|
|
14
|
-
Text
|
|
14
|
+
Text,
|
|
15
15
|
} from '@mantine/core'
|
|
16
16
|
import { useDebouncedEffect } from '@react-hookz/web'
|
|
17
17
|
import { IconZoomScan } from '@tabler/icons-react'
|
|
@@ -21,21 +21,21 @@ import { type PropsWithChildren, type ReactNode, useState } from 'react'
|
|
|
21
21
|
import { isTruthy } from 'remeda'
|
|
22
22
|
import { useDiagramState, useDiagramStoreApi, useMantinePortalProps } from '../../hooks'
|
|
23
23
|
import { useLikeC4Model } from '../../likec4model/useLikeC4Model'
|
|
24
|
-
import type {
|
|
24
|
+
import type { DiagramFlowTypes } from '../types'
|
|
25
25
|
import { stopPropagation } from '../utils'
|
|
26
26
|
import * as edgesCss from './edges.css'
|
|
27
27
|
import { RelationshipsDropdownMenu } from './RelationshipsDropdownMenu'
|
|
28
28
|
|
|
29
29
|
export interface EdgeLabelProps extends Omit<BoxProps, 'label'> {
|
|
30
30
|
isDimmed: boolean
|
|
31
|
-
edgeData:
|
|
31
|
+
edgeData: DiagramFlowTypes.DiagramEdgeData
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export const EdgeLabel = ({
|
|
35
35
|
isDimmed,
|
|
36
36
|
edgeData: {
|
|
37
37
|
label,
|
|
38
|
-
edge
|
|
38
|
+
edge,
|
|
39
39
|
},
|
|
40
40
|
...props
|
|
41
41
|
}: EdgeLabelProps) => {
|
|
@@ -43,11 +43,11 @@ export const EdgeLabel = ({
|
|
|
43
43
|
const {
|
|
44
44
|
enableRelationshipDetails,
|
|
45
45
|
isActiveWalkthroughStep,
|
|
46
|
-
hasOnNavigateTo
|
|
46
|
+
hasOnNavigateTo,
|
|
47
47
|
} = useDiagramState(s => ({
|
|
48
48
|
enableRelationshipDetails: s.enableRelationshipDetails,
|
|
49
49
|
isActiveWalkthroughStep: s.activeWalkthrough?.stepId === edge.id,
|
|
50
|
-
hasOnNavigateTo: !!s.onNavigateTo
|
|
50
|
+
hasOnNavigateTo: !!s.onNavigateTo,
|
|
51
51
|
}))
|
|
52
52
|
const notes = isActiveWalkthroughStep ? (edge.notes ?? null) : null
|
|
53
53
|
const stepNum = isStepEdgeId(edge.id) ? extractStep(edge.id) : null
|
|
@@ -79,13 +79,20 @@ export const EdgeLabel = ({
|
|
|
79
79
|
{stepNum}
|
|
80
80
|
</Box>
|
|
81
81
|
)}
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
<Stack gap={4} align="center">
|
|
83
|
+
{isTruthy(label?.text) && (
|
|
84
|
+
<Text component="div" className={edgesCss.edgeLabelText} lineClamp={5}>
|
|
85
|
+
{label.text}
|
|
86
|
+
</Text>
|
|
87
|
+
)}
|
|
88
|
+
{isTruthy(edge.technology) && (
|
|
89
|
+
<Text component="div" className={edgesCss.edgeLabelTechnology}>
|
|
90
|
+
{'[ ' + edge.technology + ' ]'}
|
|
91
|
+
</Text>
|
|
92
|
+
)}
|
|
93
|
+
{navigateTo && <NavigateToBtn viewId={navigateTo} />}
|
|
94
|
+
</Stack>
|
|
95
|
+
</Box>,
|
|
89
96
|
)}
|
|
90
97
|
</EdgeLabelRenderer>
|
|
91
98
|
)
|
|
@@ -95,11 +102,11 @@ const NotePopover = ({ notes, children }: PropsWithChildren<{ notes: string }>)
|
|
|
95
102
|
const {
|
|
96
103
|
nextDynamicStep,
|
|
97
104
|
hasNext,
|
|
98
|
-
hasPrevious
|
|
105
|
+
hasPrevious,
|
|
99
106
|
} = useDiagramState(s => ({
|
|
100
107
|
nextDynamicStep: s.nextDynamicStep,
|
|
101
108
|
hasNext: s.activeWalkthrough?.hasNext ?? false,
|
|
102
|
-
hasPrevious: s.activeWalkthrough?.hasPrevious ?? false
|
|
109
|
+
hasPrevious: s.activeWalkthrough?.hasPrevious ?? false,
|
|
103
110
|
}))
|
|
104
111
|
|
|
105
112
|
const [isOpened, setIsOpened] = useState(false)
|
|
@@ -110,7 +117,7 @@ const NotePopover = ({ notes, children }: PropsWithChildren<{ notes: string }>)
|
|
|
110
117
|
setIsOpened(true)
|
|
111
118
|
},
|
|
112
119
|
[],
|
|
113
|
-
300
|
|
120
|
+
300,
|
|
114
121
|
)
|
|
115
122
|
|
|
116
123
|
return (
|
|
@@ -162,7 +169,7 @@ const NotePopover = ({ notes, children }: PropsWithChildren<{ notes: string }>)
|
|
|
162
169
|
}
|
|
163
170
|
|
|
164
171
|
type NavigateToBtnProps = {
|
|
165
|
-
viewId:
|
|
172
|
+
viewId: ViewId
|
|
166
173
|
}
|
|
167
174
|
|
|
168
175
|
function NavigateToBtn({ viewId }: NavigateToBtnProps) {
|
|
@@ -20,11 +20,11 @@ import { useXYStoreApi } from '../../hooks/useXYFlow'
|
|
|
20
20
|
import { vector, VectorImpl } from '../../utils/vector'
|
|
21
21
|
import { ZIndexes } from '../const'
|
|
22
22
|
import { EdgeMarkers, type EdgeMarkerType } from '../EdgeMarkers'
|
|
23
|
-
import { type XYFlowEdge } from '../types'
|
|
24
23
|
import { bezierControlPoints } from '../utils'
|
|
25
24
|
import { EdgeLabel } from './EdgeLabel'
|
|
26
25
|
import * as edgesCss from './edges.css'
|
|
27
26
|
import { getNodeIntersectionFromCenterToPoint } from './utils'
|
|
27
|
+
import type { DiagramFlowTypes } from '../types'
|
|
28
28
|
// import { getEdgeParams } from './utils'
|
|
29
29
|
|
|
30
30
|
// function getBend(a: XYPosition, b: XYPosition, c: XYPosition, size = 8): string {
|
|
@@ -115,7 +115,9 @@ const sameControlPoints = (a: XYPosition[] | null, b: XYPosition[] | null) => {
|
|
|
115
115
|
return a.every((ap, i) => isSamePoint(ap, b[i]!))
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
type DiagramEdgeProps = EdgeProps<DiagramFlowTypes.Edge>
|
|
119
|
+
|
|
120
|
+
const isEqualProps = (prev: DiagramEdgeProps, next: DiagramEdgeProps) => (
|
|
119
121
|
prev.id === next.id
|
|
120
122
|
&& eq(prev.source, next.source)
|
|
121
123
|
&& eq(prev.target, next.target)
|
|
@@ -134,7 +136,7 @@ const curve = d3line<XYPosition>()
|
|
|
134
136
|
.x(d => d.x)
|
|
135
137
|
.y(d => d.y)
|
|
136
138
|
|
|
137
|
-
export const RelationshipEdge = memo<
|
|
139
|
+
export const RelationshipEdge = memo<DiagramEdgeProps>(function RelationshipEdgeR({
|
|
138
140
|
id,
|
|
139
141
|
data,
|
|
140
142
|
sourceX,
|
|
@@ -16,13 +16,14 @@ import {
|
|
|
16
16
|
Tooltip as MantineTooltip,
|
|
17
17
|
TooltipGroup
|
|
18
18
|
} from '@mantine/core'
|
|
19
|
-
import { IconArrowRight,
|
|
19
|
+
import { IconArrowRight, IconFileSymlink, IconInfoCircle, IconZoomScan } from '@tabler/icons-react'
|
|
20
20
|
import clsx from 'clsx'
|
|
21
21
|
import { forwardRef, Fragment, type MouseEventHandler, type PropsWithChildren, useCallback } from 'react'
|
|
22
22
|
import { filter, isTruthy, map, partition, pick, pipe } from 'remeda'
|
|
23
23
|
import { useDiagramState, useDiagramStoreApi, useMantinePortalProps, useXYNodesData } from '../../hooks'
|
|
24
|
-
import
|
|
24
|
+
import { Link } from '../../ui/Link'
|
|
25
25
|
import * as css from './RelationshipsDropdownMenu.css'
|
|
26
|
+
import type { DiagramFlowTypes } from '../types'
|
|
26
27
|
|
|
27
28
|
const stopPropagation: MouseEventHandler = (e) => e.stopPropagation()
|
|
28
29
|
|
|
@@ -43,7 +44,7 @@ export function RelationshipsDropdownMenu({
|
|
|
43
44
|
likec4model,
|
|
44
45
|
children
|
|
45
46
|
}: PropsWithChildren<{
|
|
46
|
-
edge:
|
|
47
|
+
edge: DiagramFlowTypes.DiagramEdgeData['edge']
|
|
47
48
|
disabled?: boolean | undefined
|
|
48
49
|
likec4model: LikeC4Model
|
|
49
50
|
}>) {
|
|
@@ -72,7 +73,7 @@ export function RelationshipsDropdownMenu({
|
|
|
72
73
|
}
|
|
73
74
|
}),
|
|
74
75
|
filter(isTruthy),
|
|
75
|
-
partition(r => r.
|
|
76
|
+
partition(r => r.source.id === edge.source && r.target.id === edge.target)
|
|
76
77
|
)
|
|
77
78
|
|
|
78
79
|
const onClickOpenOverlay = useCallback((e: React.MouseEvent): void => {
|
|
@@ -84,7 +85,7 @@ export function RelationshipsDropdownMenu({
|
|
|
84
85
|
}
|
|
85
86
|
}, [edge.id, openOverlay, enableRelationshipBrowser])
|
|
86
87
|
|
|
87
|
-
const renderRelationship = (relationship: LikeC4Model.
|
|
88
|
+
const renderRelationship = (relationship: LikeC4Model.AnyRelation, index: number) => (
|
|
88
89
|
<Fragment key={relationship.id}>
|
|
89
90
|
{index > 0 && <MenuDivider opacity={0.65} />}
|
|
90
91
|
<MenuItem
|
|
@@ -155,8 +156,8 @@ export function RelationshipsDropdownMenu({
|
|
|
155
156
|
const Relationship = forwardRef<
|
|
156
157
|
HTMLDivElement,
|
|
157
158
|
StackProps & {
|
|
158
|
-
relationship: LikeC4Model.
|
|
159
|
-
edge:
|
|
159
|
+
relationship: LikeC4Model.AnyRelation
|
|
160
|
+
edge: DiagramFlowTypes.DiagramEdgeData['edge']
|
|
160
161
|
sourceNode: DiagramNode
|
|
161
162
|
targetNode: DiagramNode
|
|
162
163
|
}
|
|
@@ -175,12 +176,13 @@ const Relationship = forwardRef<
|
|
|
175
176
|
hasOnNavigateTo
|
|
176
177
|
} = useDiagramState(s => ({
|
|
177
178
|
viewId: s.view.id,
|
|
178
|
-
hasOnOpenSourceRelation: !!s.
|
|
179
|
+
hasOnOpenSourceRelation: !!s.onOpenSource,
|
|
179
180
|
hasOnNavigateTo: !!s.onNavigateTo
|
|
180
181
|
}))
|
|
181
182
|
const sourceId = nameFromFqn(edge.source) + r.source.id.slice(edge.source.length)
|
|
182
183
|
const targetId = nameFromFqn(edge.target) + r.target.id.slice(edge.target.length)
|
|
183
|
-
const navigateTo = hasOnNavigateTo && r.
|
|
184
|
+
const navigateTo = hasOnNavigateTo && r.navigateTo?.id !== viewId ? r.navigateTo?.id : undefined
|
|
185
|
+
const links = r.links
|
|
184
186
|
|
|
185
187
|
return (
|
|
186
188
|
<Stack ref={ref} className={clsx(css.menuItemRelationship, className)} {...props}>
|
|
@@ -223,7 +225,9 @@ const Relationship = forwardRef<
|
|
|
223
225
|
onPointerDownCapture={stopPropagation}
|
|
224
226
|
onClick={event => {
|
|
225
227
|
event.stopPropagation()
|
|
226
|
-
diagramApi.getState().
|
|
228
|
+
diagramApi.getState().onOpenSource?.({
|
|
229
|
+
relation: r.id
|
|
230
|
+
})
|
|
227
231
|
}}
|
|
228
232
|
role="button"
|
|
229
233
|
>
|
|
@@ -235,6 +239,15 @@ const Relationship = forwardRef<
|
|
|
235
239
|
)}
|
|
236
240
|
</Group>
|
|
237
241
|
<Box className={css.title}>{r.title || 'untitled'}</Box>
|
|
242
|
+
{r.description && <Text size="xs" c="dimmed">{r.description}</Text>}
|
|
243
|
+
{links.length > 0 && (
|
|
244
|
+
<Stack
|
|
245
|
+
gap={3}
|
|
246
|
+
justify="stretch"
|
|
247
|
+
align="stretch">
|
|
248
|
+
{links.map((link) => <Link key={link.url} link={link} />)}
|
|
249
|
+
</Stack>
|
|
250
|
+
)}
|
|
238
251
|
</Stack>
|
|
239
252
|
)
|
|
240
253
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { rem } from '@mantine/core'
|
|
2
2
|
import { createVar, fallbackVar, globalStyle, keyframes, style } from '@vanilla-extract/css'
|
|
3
|
-
import { mantine, vars, xyvars } from '../../theme-vars'
|
|
3
|
+
import { mantine, transitions, vars, xyvars } from '../../theme-vars'
|
|
4
4
|
|
|
5
5
|
const mixColor = createVar('mix-color')
|
|
6
6
|
|
|
@@ -11,16 +11,16 @@ export const container = style({
|
|
|
11
11
|
[xyvars.edge.strokeSelected]: `color-mix(in srgb, ${vars.relation.lineColor}, ${mixColor} 35%)`,
|
|
12
12
|
[xyvars.edge.labelColor]: `color-mix(in srgb, ${vars.relation.labelColor}, rgba(255 255 255 / 0.85) 40%)`,
|
|
13
13
|
[xyvars.edge.labelBgColor]: `color-mix(in srgb, ${vars.relation.labelBgColor}, transparent 40%)`,
|
|
14
|
-
[xyvars.edge.strokeWidth]: '3'
|
|
15
|
-
}
|
|
14
|
+
[xyvars.edge.strokeWidth]: '3',
|
|
15
|
+
},
|
|
16
16
|
})
|
|
17
17
|
|
|
18
18
|
globalStyle(`:where([data-mantine-color-scheme="dark"]) ${container}`, {
|
|
19
19
|
vars: {
|
|
20
20
|
[mixColor]: `white`,
|
|
21
21
|
[xyvars.edge.labelColor]: vars.relation.labelColor,
|
|
22
|
-
[xyvars.edge.labelBgColor]: `color-mix(in srgb, ${vars.relation.labelBgColor}, transparent 50%)
|
|
23
|
-
}
|
|
22
|
+
[xyvars.edge.labelBgColor]: `color-mix(in srgb, ${vars.relation.labelBgColor}, transparent 50%)`,
|
|
23
|
+
},
|
|
24
24
|
})
|
|
25
25
|
|
|
26
26
|
const isSelected = '.react-flow__edge.selected'
|
|
@@ -28,29 +28,29 @@ const isSelected = '.react-flow__edge.selected'
|
|
|
28
28
|
globalStyle(`:where(${isSelected}) ${container}`, {
|
|
29
29
|
vars: {
|
|
30
30
|
[xyvars.edge.stroke]: xyvars.edge.strokeSelected,
|
|
31
|
-
[xyvars.edge.strokeWidth]: '3'
|
|
32
|
-
}
|
|
31
|
+
[xyvars.edge.strokeWidth]: '3',
|
|
32
|
+
},
|
|
33
33
|
})
|
|
34
34
|
|
|
35
35
|
globalStyle(`${container}:is([data-edge-hovered='true'],[data-edge-active='true'])`, {
|
|
36
36
|
vars: {
|
|
37
37
|
// [xyvars.edge.stroke]: `color-mix(in srgb, ${vars.relation.lineColor}, ${mixColor} 35%)`,
|
|
38
38
|
[xyvars.edge.stroke]: xyvars.edge.strokeSelected,
|
|
39
|
-
[xyvars.edge.strokeWidth]: '3'
|
|
40
|
-
}
|
|
39
|
+
[xyvars.edge.strokeWidth]: '3',
|
|
40
|
+
},
|
|
41
41
|
})
|
|
42
42
|
|
|
43
43
|
globalStyle(`:where(${isSelected}) ${container}[data-edge-hovered='true']`, {
|
|
44
44
|
vars: {
|
|
45
|
-
[xyvars.edge.strokeWidth]: '4'
|
|
46
|
-
}
|
|
45
|
+
[xyvars.edge.strokeWidth]: '4',
|
|
46
|
+
},
|
|
47
47
|
})
|
|
48
48
|
|
|
49
49
|
globalStyle(`.likec4-diagram .react-flow__edges > svg`, {
|
|
50
|
-
mixBlendMode: 'plus-lighter'
|
|
50
|
+
mixBlendMode: 'plus-lighter',
|
|
51
51
|
})
|
|
52
52
|
globalStyle(`:where([data-mantine-color-scheme="light"]) .likec4-diagram .react-flow__edges > svg`, {
|
|
53
|
-
mixBlendMode: 'screen'
|
|
53
|
+
mixBlendMode: 'screen',
|
|
54
54
|
})
|
|
55
55
|
|
|
56
56
|
export const dimmed = style({})
|
|
@@ -60,7 +60,7 @@ globalStyle(`.likec4-diagram .react-flow__edges > svg:has(${dimmed})`, {
|
|
|
60
60
|
transition: 'opacity 600ms ease-in-out, filter 600ms ease-in-out',
|
|
61
61
|
transitionDelay: '200ms',
|
|
62
62
|
filter: `grayscale(0.85) ${fallbackVar(vars.safariAnimationHook, 'blur(1px)')}`,
|
|
63
|
-
willChange: 'opacity, filter'
|
|
63
|
+
willChange: 'opacity, filter',
|
|
64
64
|
})
|
|
65
65
|
|
|
66
66
|
export const edgePathBg = style({
|
|
@@ -74,15 +74,15 @@ export const edgePathBg = style({
|
|
|
74
74
|
selectors: {
|
|
75
75
|
[`:where(${isSelected}, [data-edge-active='true'], [data-edge-hovered='true']) &`]: {
|
|
76
76
|
strokeWidth: `calc(${xyvars.edge.strokeWidth} + 8)`,
|
|
77
|
-
strokeOpacity: 0.15
|
|
78
|
-
}
|
|
79
|
-
}
|
|
77
|
+
strokeOpacity: 0.15,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
80
|
})
|
|
81
81
|
|
|
82
82
|
// To fix issue with marker not inheriting color from path - we need to create container
|
|
83
83
|
export const markerContext = style({
|
|
84
84
|
fill: xyvars.edge.stroke,
|
|
85
|
-
stroke: xyvars.edge.stroke
|
|
85
|
+
stroke: xyvars.edge.stroke,
|
|
86
86
|
})
|
|
87
87
|
|
|
88
88
|
export const controlPoint = style({
|
|
@@ -96,7 +96,7 @@ export const controlPoint = style({
|
|
|
96
96
|
':hover': {
|
|
97
97
|
stroke: mantine.colors.primaryColors.filledHover,
|
|
98
98
|
strokeWidth: 9,
|
|
99
|
-
transition: 'stroke 100ms ease-out, stroke-width 100ms ease-out'
|
|
99
|
+
transition: 'stroke 100ms ease-out, stroke-width 100ms ease-out',
|
|
100
100
|
},
|
|
101
101
|
selectors: {
|
|
102
102
|
[`:where(${isSelected}, [data-edge-hovered='true']) &`]: {
|
|
@@ -104,26 +104,26 @@ export const controlPoint = style({
|
|
|
104
104
|
transition: 'fill-opacity 150ms ease-out, stroke 150ms ease-out, stroke-width 150ms ease-out',
|
|
105
105
|
transitionDelay: '50ms',
|
|
106
106
|
fillOpacity: 1,
|
|
107
|
-
strokeWidth: 5
|
|
108
|
-
}
|
|
109
|
-
}
|
|
107
|
+
strokeWidth: 5,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
110
|
})
|
|
111
111
|
|
|
112
112
|
export const controlDragging = style({
|
|
113
|
-
cursor: 'grabbing'
|
|
113
|
+
cursor: 'grabbing',
|
|
114
114
|
})
|
|
115
115
|
|
|
116
116
|
globalStyle(`${controlDragging} *`, {
|
|
117
|
-
cursor: 'grabbing !important'
|
|
117
|
+
cursor: 'grabbing !important',
|
|
118
118
|
})
|
|
119
119
|
|
|
120
120
|
const strokeKeyframes = keyframes({
|
|
121
121
|
'from': {
|
|
122
|
-
strokeDashoffset: 18 * 2 + 10
|
|
122
|
+
strokeDashoffset: 18 * 2 + 10,
|
|
123
123
|
},
|
|
124
124
|
'to': {
|
|
125
|
-
strokeDashoffset: 10
|
|
126
|
-
}
|
|
125
|
+
strokeDashoffset: 10,
|
|
126
|
+
},
|
|
127
127
|
})
|
|
128
128
|
|
|
129
129
|
export const cssEdgePath = style({
|
|
@@ -136,20 +136,20 @@ export const cssEdgePath = style({
|
|
|
136
136
|
[`:where([data-edge-hovered='true']) &`]: {
|
|
137
137
|
animationName: strokeKeyframes,
|
|
138
138
|
animationDelay: '450ms',
|
|
139
|
-
transition: 'stroke 130ms ease-out,stroke-width 130ms ease-out'
|
|
139
|
+
transition: 'stroke 130ms ease-out,stroke-width 130ms ease-out',
|
|
140
140
|
},
|
|
141
141
|
[`:where(${isSelected}, [data-edge-active='true'], [data-edge-animated='true']) &`]: {
|
|
142
142
|
animationName: strokeKeyframes,
|
|
143
143
|
animationDelay: '0ms',
|
|
144
|
-
transition: 'stroke 130ms ease-out,stroke-width 130ms ease-out'
|
|
144
|
+
transition: 'stroke 130ms ease-out,stroke-width 130ms ease-out',
|
|
145
145
|
},
|
|
146
146
|
[`:where([data-edge-dir='back']) &`]: {
|
|
147
|
-
animationDirection: 'reverse'
|
|
147
|
+
animationDirection: 'reverse',
|
|
148
148
|
},
|
|
149
149
|
[`${dimmed} &`]: {
|
|
150
|
-
animationPlayState: 'paused'
|
|
151
|
-
}
|
|
152
|
-
}
|
|
150
|
+
animationPlayState: 'paused',
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
153
|
})
|
|
154
154
|
|
|
155
155
|
const labelBorderRadius = 2
|
|
@@ -167,12 +167,12 @@ export const stepEdgeNumber = style({
|
|
|
167
167
|
fontVariantNumeric: 'tabular-nums',
|
|
168
168
|
selectors: {
|
|
169
169
|
[`:where([data-mantine-color-scheme="dark"]) :where([data-likec4-color="gray"]) &`]: {
|
|
170
|
-
backgroundColor: `color-mix(in srgb, ${vars.relation.labelBgColor}, ${mixColor} 15%)
|
|
170
|
+
backgroundColor: `color-mix(in srgb, ${vars.relation.labelBgColor}, ${mixColor} 15%)`,
|
|
171
171
|
},
|
|
172
172
|
[`:where([data-edge-active='true']) &`]: {
|
|
173
|
-
backgroundColor: 'transparent'
|
|
174
|
-
}
|
|
175
|
-
}
|
|
173
|
+
backgroundColor: 'transparent',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
176
|
})
|
|
177
177
|
|
|
178
178
|
export const varLabelX = createVar('label-x')
|
|
@@ -197,43 +197,50 @@ export const edgeLabel = style({
|
|
|
197
197
|
borderRadius: labelBorderRadius,
|
|
198
198
|
transform: varTranslate,
|
|
199
199
|
vars: {
|
|
200
|
-
[varTranslate]: `translate(${fallbackVar(varLabelX, '-50%')}, ${fallbackVar(varLabelY, '-50%')})
|
|
200
|
+
[varTranslate]: `translate(${fallbackVar(varLabelX, '-50%')}, ${fallbackVar(varLabelY, '-50%')})`,
|
|
201
201
|
},
|
|
202
202
|
selectors: {
|
|
203
203
|
'&[data-edge-hovered="true"]': {
|
|
204
204
|
transition: 'all 140ms ease-in-out',
|
|
205
|
-
transform: `${varTranslate} scale(1.12)
|
|
205
|
+
transform: `${varTranslate} scale(1.12)`,
|
|
206
206
|
},
|
|
207
207
|
[`&:has(${stepEdgeNumber})`]: {
|
|
208
208
|
padding: 0,
|
|
209
|
-
gap: 2
|
|
209
|
+
gap: 2,
|
|
210
210
|
},
|
|
211
211
|
[`&:is(${dimmed})`]: {
|
|
212
212
|
opacity: 0.3,
|
|
213
213
|
transition: 'opacity 600ms ease-in-out, filter 600ms ease-in-out',
|
|
214
214
|
transitionDelay: '200ms',
|
|
215
215
|
filter: `grayscale(0.85) ${fallbackVar(vars.safariAnimationHook, 'blur(1px)')}`,
|
|
216
|
-
willChange: 'opacity, filter'
|
|
217
|
-
}
|
|
218
|
-
}
|
|
216
|
+
willChange: 'opacity, filter',
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
219
|
})
|
|
220
220
|
|
|
221
221
|
export const edgeLabelText = style({
|
|
222
|
-
textAlign: 'center',
|
|
223
222
|
whiteSpaceCollapse: 'preserve-breaks',
|
|
224
223
|
fontSize: rem(14),
|
|
225
|
-
lineHeight: 1.185
|
|
224
|
+
lineHeight: 1.185,
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
export const edgeLabelTechnology = style({
|
|
228
|
+
textAlign: 'center',
|
|
229
|
+
whiteSpaceCollapse: 'preserve-breaks',
|
|
230
|
+
fontSize: rem(11),
|
|
231
|
+
lineHeight: 1,
|
|
232
|
+
opacity: 0.75,
|
|
226
233
|
})
|
|
227
234
|
|
|
228
235
|
globalStyle(`${edgeLabel}:has(${stepEdgeNumber}) ${edgeLabelText}`, {
|
|
229
|
-
padding: '2px 5px 4px 2px'
|
|
236
|
+
padding: '2px 5px 4px 2px',
|
|
230
237
|
})
|
|
231
238
|
|
|
232
239
|
export const edgeNoteCloseButton = style({
|
|
233
240
|
position: 'absolute',
|
|
234
241
|
top: 4,
|
|
235
242
|
right: 4,
|
|
236
|
-
zIndex: 9
|
|
243
|
+
zIndex: 9,
|
|
237
244
|
})
|
|
238
245
|
|
|
239
246
|
export const edgeNoteText = style({
|
|
@@ -243,52 +250,39 @@ export const edgeNoteText = style({
|
|
|
243
250
|
textWrap: 'pretty',
|
|
244
251
|
lineHeight: 1.25,
|
|
245
252
|
vars: {
|
|
246
|
-
'--text-fz': mantine.fontSizes.sm
|
|
253
|
+
'--text-fz': mantine.fontSizes.sm,
|
|
247
254
|
},
|
|
248
255
|
'@media': {
|
|
249
256
|
[mantine.largerThan('md')]: {
|
|
250
257
|
vars: {
|
|
251
|
-
'--text-fz': mantine.fontSizes.md
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
258
|
+
'--text-fz': mantine.fontSizes.md,
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
255
262
|
})
|
|
256
263
|
|
|
257
264
|
export const cssNavigateBtn = style({
|
|
258
265
|
zIndex: 'calc(var(--layer-overlays, 1) + 1)',
|
|
259
|
-
position: 'absolute',
|
|
260
266
|
pointerEvents: 'all',
|
|
261
|
-
left: '50%',
|
|
262
|
-
top: 'calc(100% + 1px)',
|
|
263
267
|
color: xyvars.edge.labelColor,
|
|
264
268
|
cursor: 'pointer',
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
transition: 'all 150ms ease-in-out',
|
|
268
|
-
transform: 'translate(-50%, 0)',
|
|
269
|
-
transitionDelay: '0ms',
|
|
269
|
+
opacity: 1,
|
|
270
|
+
transition: transitions.fast,
|
|
270
271
|
backgroundColor: 'var(--ai-bg)',
|
|
271
272
|
vars: {
|
|
272
273
|
'--ai-bg': vars.relation.labelBgColor,
|
|
273
|
-
'--ai-hover': `color-mix(in srgb , ${vars.relation.labelBgColor}, ${mixColor} 10%)
|
|
274
|
-
},
|
|
275
|
-
selectors: {
|
|
276
|
-
[`:is(${dimmed}) &`]: {
|
|
277
|
-
display: 'none'
|
|
278
|
-
}
|
|
274
|
+
'--ai-hover': `color-mix(in srgb , ${vars.relation.labelBgColor}, ${mixColor} 10%)`,
|
|
279
275
|
},
|
|
280
276
|
':hover': {
|
|
281
|
-
|
|
282
|
-
transform: 'translate(-50%, 0) scale(1.3)',
|
|
283
|
-
opacity: 1
|
|
277
|
+
transform: 'translateY(1px) scale(1.15)',
|
|
284
278
|
},
|
|
285
279
|
':active': {
|
|
286
|
-
transform: '
|
|
287
|
-
}
|
|
280
|
+
transform: 'translateY(-1px) scale(0.9)',
|
|
281
|
+
},
|
|
288
282
|
})
|
|
289
283
|
globalStyle(`${cssNavigateBtn} .tabler-icon`, {
|
|
290
|
-
width: '
|
|
291
|
-
height: '
|
|
292
|
-
strokeWidth: 2
|
|
284
|
+
width: '80%',
|
|
285
|
+
height: '80%',
|
|
286
|
+
strokeWidth: 2,
|
|
293
287
|
})
|
|
294
288
|
export const cssNavigateBtnIcon = style({})
|