@likec4/diagram 1.34.2 → 1.36.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/bundle/{chunk-Dd7et66b.js → chunk-7MPUJFHj.js} +1102 -1172
- package/bundle/custom.js +59 -55
- package/bundle/index.js +8918 -5681
- package/dist/LikeC4Diagram.js +6 -6
- package/dist/LikeC4Diagram.props.d.ts +53 -7
- package/dist/LikeC4ModelProvider.d.ts +4 -4
- package/dist/LikeC4ProjectsProvider.d.ts +17 -0
- package/dist/LikeC4ProjectsProvider.js +22 -0
- package/dist/LikeC4Styles.d.ts +1 -0
- package/dist/LikeC4Styles.js +94 -0
- package/dist/StaticLikeC4Diagram.d.ts +3 -3
- package/dist/base/BaseXYFlow.d.ts +2 -2
- package/dist/base/BaseXYFlow.js +26 -29
- package/dist/base/primitives/MarkdownBlock.d.ts +7 -1
- package/dist/base/primitives/MarkdownBlock.js +1 -1
- package/dist/base/primitives/compound/CompoundActionButton.js +3 -3
- package/dist/base/primitives/compound/CompoundDetailsButton.js +3 -3
- package/dist/base/primitives/compound/CompoundNodeContainer.css.js +4 -4
- package/dist/base/primitives/compound/CompoundNodeContainer.js +1 -4
- package/dist/base/primitives/compound/CompoundTitle.js +9 -8
- package/dist/base/primitives/compound/actionbtns.css.js +6 -6
- package/dist/base/primitives/edge/EdgeActionButton.js +3 -3
- package/dist/base/primitives/edge/EdgeContainer.js +4 -7
- package/dist/base/primitives/edge/EdgeLabel.css.d.ts +0 -22
- package/dist/base/primitives/edge/EdgeLabel.css.js +6 -84
- package/dist/base/primitives/edge/EdgeLabel.js +16 -6
- package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -6
- package/dist/base/primitives/edge/EdgeMarkers.js +3 -3
- package/dist/base/primitives/edge/edge.css.d.ts +0 -2
- package/dist/base/primitives/edge/edge.css.js +1 -55
- package/dist/base/primitives/element/ElementActionButtons.js +2 -2
- package/dist/base/primitives/element/ElementDetailsButton.js +9 -8
- package/dist/base/primitives/element/ElementNodeContainer.css.js +4 -4
- package/dist/base/primitives/element/ElementNodeContainer.d.ts +3 -3
- package/dist/base/primitives/element/ElementNodeContainer.js +1 -4
- package/dist/base/primitives/element/ElementShape.css.js +11 -11
- package/dist/base/primitives/element/ElementTags.d.ts +1 -0
- package/dist/base/primitives/element/ElementTags.js +17 -14
- package/dist/base/primitives/element/ElementTitle.js +9 -9
- package/dist/bundle/LikeC4View.d.ts +1 -1
- package/dist/bundle/LikeC4View.js +10 -4
- package/dist/bundle/LikeC4View.props.d.ts +9 -6
- package/dist/bundle/ReactLikeC4.d.ts +1 -1
- package/dist/bundle/ViewNotFound.js +1 -1
- package/dist/bundle/custom.js +1 -0
- package/dist/bundle/index.d.ts +2 -1
- package/dist/bundle/index.js +2 -0
- package/dist/bundle/styles.css.js +1 -1
- package/dist/components/ErrorFallback.d.ts +2 -1
- package/dist/components/ErrorFallback.js +16 -3
- package/dist/components/GithubIcon.d.ts +2 -0
- package/dist/components/GithubIcon.js +17 -0
- package/dist/components/Link.d.ts +4 -3
- package/dist/components/Link.js +86 -89
- package/dist/components/NavigationLink.d.ts +6 -0
- package/dist/components/NavigationLink.js +25 -0
- package/dist/components/SearchControl.css.js +6 -5
- package/dist/components/SearchControl.js +1 -1
- package/dist/context/ControlsCustomLayout.d.ts +0 -1
- package/dist/context/DiagramEventHandlers.d.ts +6 -6
- package/dist/context/DiagramEventHandlers.js +4 -7
- package/dist/context/DiagramFeatures.d.ts +4 -1
- package/dist/context/IconRenderer.js +6 -6
- package/dist/custom/customNodes.js +10 -2
- package/dist/custom/hooks.d.ts +1 -0
- package/dist/custom/index.js +1 -0
- package/dist/globals.css.js +3 -0
- package/dist/hooks/useDiagram.d.ts +1 -2
- package/dist/hooks/useDiagram.js +1 -5
- package/dist/hooks/useXYFlow.d.ts +10 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/likec4diagram/DiagramUI.js +8 -4
- package/dist/likec4diagram/DiagramXYFlow.js +1 -1
- package/dist/likec4diagram/custom/edges/NotePopover.css.js +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +1 -1
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.js +7 -7
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +7 -7
- package/dist/likec4diagram/custom/edges/edges.css.js +4 -4
- package/dist/likec4diagram/custom/index.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
- package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +1 -1
- package/dist/likec4diagram/ui/controls/Controls.js +11 -15
- package/dist/likec4diagram/ui/controls/LayoutDriftNotification.js +1 -1
- package/dist/likec4diagram/ui/controls/ManualLayoutToolsButton.js +9 -9
- package/dist/likec4diagram/ui/controls/NavigationButtons.js +4 -2
- package/dist/likec4diagram/ui/controls/ToggleReadonly.js +2 -2
- package/dist/likec4diagram/ui/controls/styles.css.js +5 -5
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +15 -13
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +11 -11
- package/dist/likec4diagram/ui/notation/NotationPanel.js +5 -8
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.js +10 -10
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +4 -4
- package/dist/likec4model/LikeC4ModelContext.d.ts +4 -1
- package/dist/likec4model/LikeC4ModelContext.js +2 -1
- package/dist/likec4model/LikeC4ProjectsContext.d.ts +7 -0
- package/dist/likec4model/LikeC4ProjectsContext.js +5 -0
- package/dist/likec4model/index.d.ts +2 -0
- package/dist/likec4model/useCurrentViewModel.d.ts +2 -0
- package/dist/likec4model/useCurrentViewModel.js +12 -0
- package/dist/likec4model/useLikeC4Model.d.ts +2 -5
- package/dist/likec4model/useLikeC4Model.js +10 -16
- package/dist/likec4model/useLikeC4Project.d.ts +22 -0
- package/dist/likec4model/useLikeC4Project.js +23 -0
- package/dist/navigationpanel/NavigationPanel.d.ts +2 -0
- package/dist/navigationpanel/NavigationPanel.js +122 -0
- package/dist/navigationpanel/NavigationPanelControls.d.ts +1 -0
- package/dist/navigationpanel/NavigationPanelControls.js +147 -0
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +1 -0
- package/dist/navigationpanel/NavigationPanelDropdown.js +452 -0
- package/dist/navigationpanel/_common.d.ts +15 -0
- package/dist/navigationpanel/_common.js +72 -0
- package/dist/navigationpanel/actor.d.ts +296 -0
- package/dist/navigationpanel/actor.js +239 -0
- package/dist/navigationpanel/controls/BurgerButton.d.ts +1 -0
- package/dist/navigationpanel/controls/BurgerButton.js +34 -0
- package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -0
- package/dist/navigationpanel/controls/NavigationButtons.js +57 -0
- package/dist/navigationpanel/controls/OpenSource.d.ts +1 -0
- package/dist/navigationpanel/controls/OpenSource.js +27 -0
- package/dist/navigationpanel/controls/SearchControl.d.ts +1 -0
- package/dist/navigationpanel/controls/SearchControl.js +70 -0
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -0
- package/dist/navigationpanel/controls/ToggleReadonly.js +69 -0
- package/dist/navigationpanel/controls/ViewDetailsCard.d.ts +2 -0
- package/dist/navigationpanel/controls/ViewDetailsCard.js +232 -0
- package/dist/navigationpanel/controls/index.d.ts +6 -0
- package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -0
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +75 -0
- package/dist/navigationpanel/editorpanel/CenterCamera.d.ts +1 -0
- package/dist/navigationpanel/editorpanel/CenterCamera.js +12 -0
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -0
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +157 -0
- package/dist/navigationpanel/editorpanel/EditorPanel.d.ts +1 -0
- package/dist/navigationpanel/editorpanel/EditorPanel.js +48 -0
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.d.ts +1 -0
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.js +56 -0
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -0
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +173 -0
- package/dist/navigationpanel/editorpanel/_common.d.ts +6 -0
- package/dist/navigationpanel/editorpanel/_common.js +14 -0
- package/dist/navigationpanel/editorpanel/index.d.ts +1 -0
- package/dist/navigationpanel/editorpanel/styles.d.ts +8 -0
- package/dist/navigationpanel/editorpanel/styles.js +79 -0
- package/dist/navigationpanel/hooks.d.ts +20 -0
- package/dist/navigationpanel/hooks.js +38 -0
- package/dist/navigationpanel/index.d.ts +1 -0
- package/dist/navigationpanel/styles.css.d.ts +16 -0
- package/dist/navigationpanel/styles.css.js +30 -0
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.d.ts +2 -0
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +162 -0
- package/dist/navigationpanel/walkthrough/index.d.ts +1 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.31.0_react@19.1.0 → @tabler_icons-react@3.34.1_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.31.0_react@19.1.0 → @tabler_icons-react@3.34.1_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu2.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +14 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +18 -17
- package/dist/overlays/element-details/ElementDetailsCard.js +12 -17
- package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -4
- package/dist/overlays/element-details/TabPanelDeployments.js +3 -3
- package/dist/overlays/element-details/TabPanelRelationships.css.js +7 -7
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/overlay/Overlay.css.d.ts +3 -3
- package/dist/overlays/overlay/Overlay.css.js +8 -7
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
- package/dist/overlays/relationship-details/SelectEdge.css.js +8 -8
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +3 -3
- package/dist/overlays/relationships-browser/SelectElement.css.js +1 -1
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/search/Search.js +6 -6
- package/dist/search/components/ElementsColumn.css.js +5 -5
- package/dist/search/components/ElementsColumn.js +1 -1
- package/dist/search/components/PickView.js +1 -1
- package/dist/search/components/SearchByTags.js +4 -3
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +3 -3
- package/dist/search/components/ViewsColumn.css.js +1 -1
- package/dist/search/components/_shared.css.js +3 -3
- package/dist/search/components/styles.css.js +5 -5
- package/dist/state/DiagramActorProvider.d.ts +2 -2
- package/dist/state/DiagramActorProvider.js +82 -25
- package/dist/state/diagram-machine.d.ts +31 -249
- package/dist/state/diagram-machine.js +16 -16
- package/dist/styles-min.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css2.js +1 -1
- package/package.json +20 -17
- package/panda.buildinfo.json +368 -404
- package/src/LikeC4Diagram.props.ts +53 -5
- package/src/LikeC4Diagram.tsx +2 -2
- package/src/LikeC4ModelProvider.tsx +6 -6
- package/src/LikeC4ProjectsProvider.tsx +41 -0
- package/src/LikeC4Styles.tsx +107 -0
- package/src/StaticLikeC4Diagram.tsx +3 -3
- package/src/base/BaseXYFlow.tsx +28 -33
- package/src/base/primitives/MarkdownBlock.tsx +11 -3
- package/src/base/primitives/compound/CompoundActionButton.tsx +2 -2
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +2 -2
- package/src/base/primitives/compound/CompoundNodeContainer.css.ts +4 -13
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +0 -3
- package/src/base/primitives/compound/CompoundTitle.tsx +8 -8
- package/src/base/primitives/compound/actionbtns.css.ts +6 -6
- package/src/base/primitives/edge/EdgeActionButton.tsx +2 -2
- package/src/base/primitives/edge/EdgeContainer.tsx +3 -6
- package/src/base/primitives/edge/EdgeLabel.css.ts +4 -83
- package/src/base/primitives/edge/EdgeLabel.tsx +16 -10
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +1 -6
- package/src/base/primitives/edge/EdgeMarkers.tsx +3 -3
- package/src/base/primitives/edge/edge.css.ts +0 -60
- package/src/base/primitives/element/ElementActionButtons.tsx +2 -2
- package/src/base/primitives/element/ElementDetailsButton.tsx +7 -7
- package/src/base/primitives/element/ElementNodeContainer.css.ts +4 -4
- package/src/base/primitives/element/ElementNodeContainer.tsx +2 -5
- package/src/base/primitives/element/ElementShape.css.ts +11 -11
- package/src/base/primitives/element/ElementTags.tsx +17 -14
- package/src/base/primitives/element/ElementTitle.tsx +4 -4
- package/src/bundle/LikeC4View.props.ts +15 -6
- package/src/bundle/LikeC4View.tsx +12 -5
- package/src/bundle/ReactLikeC4.tsx +1 -2
- package/src/bundle/ViewNotFound.tsx +1 -1
- package/src/bundle/index.ts +2 -1
- package/src/bundle/styles.css.ts +1 -1
- package/src/components/ErrorFallback.tsx +17 -2
- package/src/components/GithubIcon.tsx +16 -0
- package/src/components/Link.tsx +102 -113
- package/src/components/NavigationLink.tsx +32 -0
- package/src/components/SearchControl.css.ts +5 -5
- package/src/context/ControlsCustomLayout.ts +0 -1
- package/src/context/DiagramEventHandlers.tsx +12 -12
- package/src/context/DiagramFeatures.tsx +6 -1
- package/src/custom/customNodes.tsx +10 -2
- package/src/custom/hooks.ts +3 -0
- package/src/globals.css +71 -0
- package/src/hooks/useDiagram.ts +0 -8
- package/src/index.ts +5 -0
- package/src/likec4diagram/DiagramUI.tsx +9 -3
- package/src/likec4diagram/DiagramXYFlow.tsx +1 -1
- package/src/likec4diagram/custom/edges/NotePopover.css.ts +2 -2
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +1 -1
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.ts +7 -7
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +3 -3
- package/src/likec4diagram/custom/edges/edges.css.ts +4 -4
- package/src/likec4diagram/custom/nodes/toolbar/CompoundToolbar.tsx +2 -2
- package/src/likec4diagram/ui/controls/Controls.tsx +8 -18
- package/src/likec4diagram/ui/controls/NavigationButtons.tsx +2 -0
- package/src/likec4diagram/ui/controls/styles.css.ts +5 -5
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +14 -11
- package/src/likec4diagram/ui/notation/NotationPanel.css.ts +11 -11
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -4
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.ts +10 -10
- package/src/likec4model/LikeC4ModelContext.ts +5 -1
- package/src/likec4model/LikeC4ProjectsContext.ts +9 -0
- package/src/likec4model/index.ts +11 -0
- package/src/likec4model/useCurrentViewModel.ts +10 -0
- package/src/likec4model/useLikeC4Model.ts +17 -27
- package/src/likec4model/useLikeC4Project.ts +61 -0
- package/src/navigationpanel/NavigationPanel.tsx +135 -0
- package/src/navigationpanel/NavigationPanelControls.tsx +133 -0
- package/src/navigationpanel/NavigationPanelDropdown.tsx +539 -0
- package/src/navigationpanel/_common.tsx +84 -0
- package/src/navigationpanel/actor.ts +320 -0
- package/src/navigationpanel/controls/BurgerButton.tsx +30 -0
- package/src/navigationpanel/controls/NavigationButtons.tsx +44 -0
- package/src/navigationpanel/controls/OpenSource.tsx +28 -0
- package/src/navigationpanel/controls/SearchControl.tsx +66 -0
- package/src/navigationpanel/controls/ToggleReadonly.tsx +66 -0
- package/src/navigationpanel/controls/ViewDetailsCard.tsx +244 -0
- package/src/navigationpanel/controls/index.ts +6 -0
- package/src/navigationpanel/dropdown/ProjectsMenu.tsx +74 -0
- package/src/navigationpanel/editorpanel/CenterCamera.tsx +15 -0
- package/src/navigationpanel/editorpanel/ChangeAutoLayoutButton.tsx +199 -0
- package/src/navigationpanel/editorpanel/EditorPanel.tsx +49 -0
- package/src/navigationpanel/editorpanel/LayoutDriftNotification.tsx +56 -0
- package/src/navigationpanel/editorpanel/ManualLayoutToolsButton.tsx +148 -0
- package/src/navigationpanel/editorpanel/_common.tsx +14 -0
- package/src/navigationpanel/editorpanel/index.ts +1 -0
- package/src/navigationpanel/editorpanel/styles.ts +84 -0
- package/src/navigationpanel/hooks.tsx +70 -0
- package/src/navigationpanel/index.ts +1 -0
- package/src/navigationpanel/styles.css.ts +28 -0
- package/src/navigationpanel/walkthrough/ActiveWalkthroughControls.tsx +165 -0
- package/src/navigationpanel/walkthrough/index.tsx +1 -0
- package/src/overlays/element-details/ElementDetailsCard.css.ts +17 -17
- package/src/overlays/element-details/ElementDetailsCard.tsx +8 -13
- package/src/overlays/element-details/TabPanelDeployments.css.ts +4 -4
- package/src/overlays/element-details/TabPanelRelationships.css.ts +7 -7
- package/src/overlays/overlay/Overlay.css.ts +7 -7
- package/src/overlays/relationship-details/SelectEdge.css.ts +8 -8
- package/src/overlays/relationships-browser/SelectElement.css.ts +1 -1
- package/src/search/Search.tsx +6 -6
- package/src/search/components/ElementsColumn.css.ts +5 -5
- package/src/search/components/SearchByTags.tsx +2 -2
- package/src/search/components/ViewsColum.tsx +1 -1
- package/src/search/components/ViewsColumn.css.ts +1 -1
- package/src/search/components/_shared.css.ts +3 -3
- package/src/search/components/styles.css.ts +5 -5
- package/src/state/DiagramActorProvider.tsx +104 -31
- package/src/state/diagram-machine.ts +24 -18
- package/dist/LikeC4CustomColors.d.ts +0 -2
- package/dist/LikeC4CustomColors.js +0 -45
- package/dist/base/primitives/element/ElementTitle.css.d.ts +0 -34
- package/dist/base/primitives/element/ElementTitle.css.js +0 -201
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu2.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -13
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -13
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +0 -45
- package/src/LikeC4CustomColors.tsx +0 -85
- package/src/base/primitives/element/ElementTitle.css.ts +0 -206
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
Any,
|
|
3
|
+
aux,
|
|
3
4
|
DiagramEdge,
|
|
4
5
|
DiagramNode,
|
|
5
6
|
LayoutedView,
|
|
6
7
|
ViewChange,
|
|
7
8
|
WhereOperator,
|
|
8
9
|
} from '@likec4/core/types'
|
|
9
|
-
import type * as aux from '@likec4/core/types/_aux'
|
|
10
10
|
import type { ReactFlowProps as XYFlowProps } from '@xyflow/react'
|
|
11
11
|
import type { MouseEvent as ReactMouseEvent, ReactNode } from 'react'
|
|
12
12
|
import type { SetRequired } from 'type-fest'
|
|
@@ -86,6 +86,26 @@ export type OverrideReactFlowProps = Pick<
|
|
|
86
86
|
export type PaddingUnit = 'px' | '%'
|
|
87
87
|
export type PaddingWithUnit = `${number}${PaddingUnit}` | number
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Padding around the diagram
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* {
|
|
94
|
+
* top: '8px',
|
|
95
|
+
* right: '8px',
|
|
96
|
+
* bottom: '8px',
|
|
97
|
+
* left: '8px',
|
|
98
|
+
* }
|
|
99
|
+
*/
|
|
100
|
+
export type ViewPadding = PaddingWithUnit | {
|
|
101
|
+
top?: PaddingWithUnit
|
|
102
|
+
right?: PaddingWithUnit
|
|
103
|
+
bottom?: PaddingWithUnit
|
|
104
|
+
left?: PaddingWithUnit
|
|
105
|
+
x?: PaddingWithUnit
|
|
106
|
+
y?: PaddingWithUnit
|
|
107
|
+
}
|
|
108
|
+
|
|
89
109
|
export interface LikeC4DiagramProperties<A extends aux.Any> {
|
|
90
110
|
view: LayoutedView<A>
|
|
91
111
|
|
|
@@ -108,10 +128,11 @@ export interface LikeC4DiagramProperties<A extends aux.Any> {
|
|
|
108
128
|
readonly?: boolean | undefined
|
|
109
129
|
/**
|
|
110
130
|
* Show/hide panel with top left controls,
|
|
131
|
+
* - `next` - Experimental navigation panel
|
|
111
132
|
*
|
|
112
133
|
* @default true if not readonly
|
|
113
134
|
*/
|
|
114
|
-
controls?: boolean | undefined
|
|
135
|
+
controls?: boolean | 'next' | undefined
|
|
115
136
|
/**
|
|
116
137
|
* If set, initial viewport will show all nodes & edges
|
|
117
138
|
* @default true
|
|
@@ -121,8 +142,29 @@ export interface LikeC4DiagramProperties<A extends aux.Any> {
|
|
|
121
142
|
/**
|
|
122
143
|
* Padding around the diagram
|
|
123
144
|
* @default '8px'
|
|
145
|
+
*
|
|
146
|
+
* @see {@link ViewPadding}
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```tsx
|
|
150
|
+
* <LikeC4Diagram
|
|
151
|
+
* fitViewPadding={{
|
|
152
|
+
* x: '16px',
|
|
153
|
+
* y: '16px',
|
|
154
|
+
* }}
|
|
155
|
+
* />
|
|
156
|
+
*
|
|
157
|
+
* <LikeC4Diagram
|
|
158
|
+
* fitViewPadding={{
|
|
159
|
+
* top: '8px',
|
|
160
|
+
* right: '8px',
|
|
161
|
+
* bottom: '8px',
|
|
162
|
+
* left: '8px',
|
|
163
|
+
* }}
|
|
164
|
+
* />
|
|
165
|
+
* ```
|
|
124
166
|
*/
|
|
125
|
-
fitViewPadding?:
|
|
167
|
+
fitViewPadding?: ViewPadding | undefined
|
|
126
168
|
|
|
127
169
|
/**
|
|
128
170
|
* @default false if readonly
|
|
@@ -223,8 +265,9 @@ export interface LikeC4DiagramProperties<A extends aux.Any> {
|
|
|
223
265
|
/**
|
|
224
266
|
* Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
|
|
225
267
|
* Enable it if you have a large or static view
|
|
268
|
+
* - `auto` - will be `true` if view has more then 3000 * 2000 pixels
|
|
226
269
|
*
|
|
227
|
-
* @default 'auto'
|
|
270
|
+
* @default 'auto'
|
|
228
271
|
*/
|
|
229
272
|
reduceGraphics?: 'auto' | boolean | undefined
|
|
230
273
|
|
|
@@ -236,6 +279,11 @@ export interface LikeC4DiagramProperties<A extends aux.Any> {
|
|
|
236
279
|
|
|
237
280
|
/**
|
|
238
281
|
* Customize layout of the controls on the top left
|
|
282
|
+
*
|
|
283
|
+
* @note
|
|
284
|
+
* Ignored if `controls="next"`
|
|
285
|
+
*
|
|
286
|
+
* @see {@link controls}
|
|
239
287
|
*/
|
|
240
288
|
renderControls?: ControlsCustomLayout | undefined
|
|
241
289
|
|
|
@@ -271,7 +319,7 @@ export type OpenSourceParams<A extends aux.Any = aux.Any> =
|
|
|
271
319
|
view: aux.StrictViewId<A>
|
|
272
320
|
}
|
|
273
321
|
|
|
274
|
-
export interface LikeC4DiagramEventHandlers<A extends aux.Any> {
|
|
322
|
+
export interface LikeC4DiagramEventHandlers<A extends aux.Any = aux.Any> {
|
|
275
323
|
onChange?: OnChange | null | undefined
|
|
276
324
|
onNavigateTo?: OnNavigateTo<A> | null | undefined
|
|
277
325
|
onNodeClick?: OnNodeClick<A> | null | undefined
|
package/src/LikeC4Diagram.tsx
CHANGED
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
} from './context'
|
|
12
12
|
import { ControlsCustomLayoutProvider } from './context/ControlsCustomLayout'
|
|
13
13
|
import { ReduceGraphicsContext } from './context/ReduceGraphics'
|
|
14
|
-
import { LikeC4CustomColors } from './LikeC4CustomColors'
|
|
15
14
|
import { type LikeC4DiagramEventHandlers, type LikeC4DiagramProperties } from './LikeC4Diagram.props'
|
|
16
15
|
import { LikeC4DiagramXYFlow } from './likec4diagram/DiagramXYFlow'
|
|
17
16
|
import type { Types } from './likec4diagram/types'
|
|
17
|
+
import { LikeC4Styles } from './LikeC4Styles'
|
|
18
18
|
import { DiagramActorProvider } from './state/DiagramActorProvider'
|
|
19
19
|
|
|
20
20
|
export type LikeC4DiagramProps<A extends Any = Any> = PropsWithChildren<
|
|
@@ -129,8 +129,8 @@ export function LikeC4Diagram<A extends Any = Any>({
|
|
|
129
129
|
onBurgerMenuClick,
|
|
130
130
|
}}>
|
|
131
131
|
<ReduceGraphicsContext reduceGraphics={isReducedGraphicsMode}>
|
|
132
|
+
<LikeC4Styles />
|
|
132
133
|
<RootContainer className={className} reduceGraphics={isReducedGraphicsMode}>
|
|
133
|
-
<LikeC4CustomColors />
|
|
134
134
|
<XYFlowProvider
|
|
135
135
|
fitView={fitView}
|
|
136
136
|
{...initialRef.current}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
1
|
+
import { LikeC4Model } from '@likec4/core/model'
|
|
2
|
+
import type { aux } from '@likec4/core/types'
|
|
3
3
|
import { type PropsWithChildren } from 'react'
|
|
4
4
|
import { LikeC4ModelContext } from './likec4model/LikeC4ModelContext'
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export interface LikeC4ModelProviderProps<A extends aux.Any = aux.Unknown> {
|
|
7
7
|
likec4model: LikeC4Model<A>
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Ensures LikeC4Model context
|
|
12
12
|
*/
|
|
13
|
-
export function LikeC4ModelProvider<A extends Any = Unknown>({
|
|
13
|
+
export function LikeC4ModelProvider<A extends aux.Any = aux.Unknown>({
|
|
14
14
|
children,
|
|
15
15
|
likec4model,
|
|
16
|
-
}: LikeC4ModelProviderProps<A
|
|
16
|
+
}: PropsWithChildren<LikeC4ModelProviderProps<A>>) {
|
|
17
17
|
return (
|
|
18
18
|
<LikeC4ModelContext.Provider value={likec4model}>
|
|
19
19
|
{children}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { LikeC4Project, ProjectId } from '@likec4/core/types'
|
|
2
|
+
import { useCallbackRef } from '@mantine/hooks'
|
|
3
|
+
import { useCustomCompareMemo } from '@react-hookz/web'
|
|
4
|
+
import { shallowEqual } from 'fast-equals'
|
|
5
|
+
import { type PropsWithChildren, useContext } from 'react'
|
|
6
|
+
import { LikeC4ProjectsContext } from './likec4model/LikeC4ProjectsContext'
|
|
7
|
+
|
|
8
|
+
export interface LikeC4ProjectsProviderProps {
|
|
9
|
+
/**
|
|
10
|
+
* Projects to be used in the navigation panel.
|
|
11
|
+
* Current project is taken from the LikeC4Model
|
|
12
|
+
*/
|
|
13
|
+
projects: ReadonlyArray<LikeC4Project>
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Optional callback when another project is selected.
|
|
17
|
+
*/
|
|
18
|
+
onProjectChange?: (id: ProjectId) => void
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Ensures LikeC4Projects context
|
|
23
|
+
*/
|
|
24
|
+
export function LikeC4ProjectsProvider({
|
|
25
|
+
children,
|
|
26
|
+
projects,
|
|
27
|
+
onProjectChange: _onProjectChange,
|
|
28
|
+
}: PropsWithChildren<LikeC4ProjectsProviderProps>) {
|
|
29
|
+
const outerScope = useContext(LikeC4ProjectsContext)
|
|
30
|
+
if (outerScope) {
|
|
31
|
+
console.warn('LikeC4ProjectsProvider should not be nested inside another one')
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const onProjectChange = useCallbackRef(_onProjectChange)
|
|
35
|
+
const value = useCustomCompareMemo(() => ({ projects, onProjectChange }), [projects, onProjectChange], shallowEqual)
|
|
36
|
+
return (
|
|
37
|
+
<LikeC4ProjectsContext.Provider value={value}>
|
|
38
|
+
{children}
|
|
39
|
+
</LikeC4ProjectsContext.Provider>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type CustomColorDefinitions,
|
|
3
|
+
type ThemeColorValues,
|
|
4
|
+
defaultTheme,
|
|
5
|
+
ThemeColors,
|
|
6
|
+
} from '@likec4/core'
|
|
7
|
+
import { useMantineStyleNonce } from '@mantine/core'
|
|
8
|
+
import { mix, scale, toHex, toRgba } from 'khroma'
|
|
9
|
+
import { entries, join, map, pipe, range } from 'remeda'
|
|
10
|
+
import globalsCss from './globals.css?inline'
|
|
11
|
+
import { useLikeC4Specification } from './likec4model'
|
|
12
|
+
|
|
13
|
+
const scheme = (scheme: 'dark' | 'light') => `[data-mantine-color-scheme="${scheme}"]`
|
|
14
|
+
|
|
15
|
+
const whenDark = scheme('dark')
|
|
16
|
+
const whenLight = scheme('light')
|
|
17
|
+
|
|
18
|
+
const MAX_DEPTH = 5
|
|
19
|
+
const generateCompoundColors = (name: string, colors: ThemeColorValues, depth: number) => {
|
|
20
|
+
const compoundDarkColor = (color: string) =>
|
|
21
|
+
toHex(
|
|
22
|
+
scale(color, {
|
|
23
|
+
l: -22 - 5 * depth,
|
|
24
|
+
s: -10 - 6 * depth,
|
|
25
|
+
}),
|
|
26
|
+
)
|
|
27
|
+
const compoundLightColor = (color: string) =>
|
|
28
|
+
toHex(
|
|
29
|
+
scale(color, {
|
|
30
|
+
l: -20 - 3 * depth,
|
|
31
|
+
s: -3 - 6 * depth,
|
|
32
|
+
}),
|
|
33
|
+
)
|
|
34
|
+
const selector = `:where([data-likec4-color="${name}"][data-compound-depth="${depth}"])`
|
|
35
|
+
|
|
36
|
+
return `
|
|
37
|
+
${selector} {
|
|
38
|
+
--likec4-palette-fill: ${compoundLightColor(colors.elements.fill)};
|
|
39
|
+
--likec4-palette-stroke: ${compoundLightColor(colors.elements.stroke)};
|
|
40
|
+
}
|
|
41
|
+
${whenDark} ${selector} {
|
|
42
|
+
--likec4-palette-fill: ${compoundDarkColor(colors.elements.fill)};
|
|
43
|
+
--likec4-palette-stroke: ${compoundDarkColor(colors.elements.stroke)};
|
|
44
|
+
}
|
|
45
|
+
`.trim()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function toStyle(name: string, colors: ThemeColorValues): string {
|
|
49
|
+
const selector = `:where([data-likec4-color=${name}])`
|
|
50
|
+
return [
|
|
51
|
+
`
|
|
52
|
+
${selector} {
|
|
53
|
+
--likec4-palette-fill: ${colors.elements.fill};
|
|
54
|
+
--likec4-palette-stroke: ${colors.elements.stroke};
|
|
55
|
+
--likec4-palette-hiContrast: ${colors.elements.hiContrast};
|
|
56
|
+
--likec4-palette-loContrast: ${colors.elements.loContrast};
|
|
57
|
+
--likec4-palette-relation-stroke: ${colors.relationships.lineColor};
|
|
58
|
+
--likec4-palette-relation-label: ${colors.relationships.labelColor};
|
|
59
|
+
--likec4-palette-relation-label-bg: ${colors.relationships.labelBgColor};
|
|
60
|
+
}
|
|
61
|
+
${whenLight} ${selector} {
|
|
62
|
+
--likec4-palette-relation-stroke-selected: ${toRgba(mix(colors.relationships.lineColor, 'black', 85))};
|
|
63
|
+
}
|
|
64
|
+
${whenDark} ${selector} {
|
|
65
|
+
--likec4-palette-relation-stroke-selected: ${toRgba(mix(colors.relationships.lineColor, 'white', 70))};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
`.trim(),
|
|
69
|
+
...range(1, MAX_DEPTH + 1).map((depth) => generateCompoundColors(name, colors, depth)),
|
|
70
|
+
].join('\n')
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const builtInColors = ThemeColors.map((color) =>
|
|
74
|
+
toStyle(color, {
|
|
75
|
+
elements: defaultTheme.elements[color],
|
|
76
|
+
relationships: defaultTheme.relationships[color],
|
|
77
|
+
})
|
|
78
|
+
).join('\n')
|
|
79
|
+
|
|
80
|
+
function generateCustomColorStyles(customColors: CustomColorDefinitions) {
|
|
81
|
+
return pipe(
|
|
82
|
+
entries(customColors),
|
|
83
|
+
map(([name, color]) => toStyle(name, color)),
|
|
84
|
+
join('\n'),
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function LikeC4Styles() {
|
|
89
|
+
const nonce = useMantineStyleNonce()?.()
|
|
90
|
+
|
|
91
|
+
const customColors = useLikeC4Specification().customColors
|
|
92
|
+
const customColorsStyles = customColors ? generateCustomColorStyles(customColors) : ''
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<>
|
|
96
|
+
<style type="text/css" data-likec4-global dangerouslySetInnerHTML={{ __html: globalsCss }} nonce={nonce} />
|
|
97
|
+
<style type="text/css" data-likec4-colors dangerouslySetInnerHTML={{ __html: builtInColors }} nonce={nonce} />
|
|
98
|
+
{customColorsStyles && (
|
|
99
|
+
<style
|
|
100
|
+
type="text/css"
|
|
101
|
+
data-likec4-custom-colors
|
|
102
|
+
dangerouslySetInnerHTML={{ __html: customColorsStyles }}
|
|
103
|
+
nonce={nonce} />
|
|
104
|
+
)}
|
|
105
|
+
</>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { Any, UnknownLayouted } from '@likec4/core/types'
|
|
2
2
|
import { LikeC4Diagram } from './LikeC4Diagram'
|
|
3
3
|
import type { LikeC4DiagramProperties } from './LikeC4Diagram.props'
|
|
4
4
|
|
|
5
|
-
export type StaticLikeC4DiagramProps<A extends
|
|
5
|
+
export type StaticLikeC4DiagramProps<A extends Any> = Pick<
|
|
6
6
|
LikeC4DiagramProperties<A>,
|
|
7
7
|
| 'view'
|
|
8
8
|
| 'className'
|
|
@@ -21,7 +21,7 @@ export type StaticLikeC4DiagramProps<A extends aux.Any> = Pick<
|
|
|
21
21
|
| 'where'
|
|
22
22
|
>
|
|
23
23
|
|
|
24
|
-
export function StaticLikeC4Diagram<A extends
|
|
24
|
+
export function StaticLikeC4Diagram<A extends Any = UnknownLayouted>({
|
|
25
25
|
view,
|
|
26
26
|
fitView = true,
|
|
27
27
|
fitViewPadding = '8px',
|
package/src/base/BaseXYFlow.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css, cx } from '@likec4/styles/css'
|
|
1
|
+
import { css, cva, cx } from '@likec4/styles/css'
|
|
2
2
|
import { useCallbackRef } from '@mantine/hooks'
|
|
3
3
|
import {
|
|
4
4
|
type ReactFlowProps,
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
ReactFlow,
|
|
7
7
|
useStore,
|
|
8
8
|
} from '@xyflow/react'
|
|
9
|
-
import { Fragment
|
|
9
|
+
import { Fragment } from 'react'
|
|
10
10
|
import type { SetRequired, Simplify } from 'type-fest'
|
|
11
11
|
import { useUpdateEffect } from '../hooks/useUpdateEffect'
|
|
12
12
|
import { useIsZoomTooSmall, useXYStoreApi } from '../hooks/useXYFlow'
|
|
13
|
-
import type {
|
|
13
|
+
import type { ViewPadding } from '../LikeC4Diagram.props'
|
|
14
14
|
import { stopPropagation } from '../utils/xyflow'
|
|
15
15
|
import { type XYBackground, Background } from './Background'
|
|
16
16
|
import { MaxZoom, MinZoom } from './const'
|
|
@@ -23,7 +23,7 @@ export type BaseXYFlowProps<NodeType extends Base.Node, EdgeType extends Base.Ed
|
|
|
23
23
|
nodesSelectable?: boolean
|
|
24
24
|
nodesDraggable?: boolean
|
|
25
25
|
background?: 'transparent' | 'solid' | XYBackground
|
|
26
|
-
fitViewPadding?:
|
|
26
|
+
fitViewPadding?: ViewPadding | undefined
|
|
27
27
|
onViewportResize?: undefined | (() => void)
|
|
28
28
|
}
|
|
29
29
|
& SetRequired<
|
|
@@ -44,32 +44,26 @@ export type BaseXYFlowProps<NodeType extends Base.Node, EdgeType extends Base.Ed
|
|
|
44
44
|
>
|
|
45
45
|
>
|
|
46
46
|
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// '(hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none)': {
|
|
56
|
-
// // TODO: this workaround disables animations in Safari (to improve performance)
|
|
57
|
-
// vars: {
|
|
58
|
-
// [vars.safariAnimationHook]: '',
|
|
59
|
-
// },
|
|
60
|
-
// },
|
|
61
|
-
// },
|
|
62
|
-
|
|
63
|
-
['--xy-background-color']: '{colors.mantine.colors.body}',
|
|
64
|
-
['--xy-background-pattern-color']: {
|
|
65
|
-
_dark: '{colors.mantine.colors.dark[5]}',
|
|
66
|
-
_light: '{colors.mantine.colors.gray[4]}',
|
|
47
|
+
const cssReactFlow = cva({
|
|
48
|
+
base: {
|
|
49
|
+
'& .react-flow__pane': {
|
|
50
|
+
WebkitUserSelect: 'none',
|
|
51
|
+
},
|
|
52
|
+
'& .react-flow__attribution': {
|
|
53
|
+
display: 'none',
|
|
54
|
+
},
|
|
67
55
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
56
|
+
variants: {
|
|
57
|
+
transparent: {
|
|
58
|
+
true: {
|
|
59
|
+
background: 'transparent !important',
|
|
60
|
+
['--xy-background-color']: 'transparent !important',
|
|
61
|
+
},
|
|
62
|
+
false: {
|
|
63
|
+
['--xy-background-color']: '{colors.likec4.background}',
|
|
64
|
+
['--xy-background-pattern-color']: '{colors.likec4.background.pattern}',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
73
67
|
},
|
|
74
68
|
})
|
|
75
69
|
|
|
@@ -106,8 +100,9 @@ export const BaseXYFlow = <
|
|
|
106
100
|
nodes={nodes}
|
|
107
101
|
edges={edges}
|
|
108
102
|
className={cx(
|
|
109
|
-
cssReactFlow
|
|
110
|
-
|
|
103
|
+
cssReactFlow({
|
|
104
|
+
transparent: background === 'transparent',
|
|
105
|
+
}),
|
|
111
106
|
className,
|
|
112
107
|
)}
|
|
113
108
|
{...isZoomTooSmall && {
|
|
@@ -122,12 +117,12 @@ export const BaseXYFlow = <
|
|
|
122
117
|
maxZoom={zoomable ? MaxZoom : 1}
|
|
123
118
|
minZoom={zoomable ? MinZoom : 1}
|
|
124
119
|
fitView={fitView}
|
|
125
|
-
fitViewOptions={
|
|
120
|
+
fitViewOptions={{
|
|
126
121
|
minZoom: MinZoom,
|
|
127
122
|
maxZoom: 1,
|
|
128
123
|
padding: fitViewPadding,
|
|
129
124
|
includeHiddenNodes: false,
|
|
130
|
-
}
|
|
125
|
+
}}
|
|
131
126
|
preventScrolling={zoomable || pannable}
|
|
132
127
|
defaultMarkerColor="var(--xy-edge-stroke)"
|
|
133
128
|
noDragClassName="nodrag"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type RichTextOrEmpty as RichTextType } from '@likec4/core/types'
|
|
2
2
|
import { cx } from '@likec4/styles/css'
|
|
3
3
|
import { type BoxProps, Box } from '@likec4/styles/jsx'
|
|
4
|
-
import {
|
|
4
|
+
import { markdownBlock } from '@likec4/styles/recipes'
|
|
5
|
+
import type { JsxStyleProps } from '@likec4/styles/types'
|
|
5
6
|
import { Text } from '@mantine/core'
|
|
6
7
|
import { forwardRef } from 'react'
|
|
7
8
|
|
|
@@ -14,10 +15,17 @@ export type MarkdownBlockProps = Omit<BoxProps, 'dangerouslySetInnerHTML' | 'chi
|
|
|
14
15
|
*/
|
|
15
16
|
uselikec4palette?: boolean
|
|
16
17
|
/**
|
|
17
|
-
* Scale factor for the
|
|
18
|
+
* Scale factor for the block
|
|
18
19
|
* @default 1
|
|
19
20
|
*/
|
|
20
21
|
textScale?: number
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Font size for the block
|
|
25
|
+
* @default 'md'
|
|
26
|
+
*/
|
|
27
|
+
fontSize?: JsxStyleProps['fontSize']
|
|
28
|
+
|
|
21
29
|
/**
|
|
22
30
|
* If true, the component will not render anything if the value is empty.
|
|
23
31
|
* @default false
|
|
@@ -44,7 +52,7 @@ export const MarkdownBlock = forwardRef<HTMLDivElement, MarkdownBlockProps>(({
|
|
|
44
52
|
}
|
|
45
53
|
const content = value.nonEmpty
|
|
46
54
|
? { dangerouslySetInnerHTML: { __html: value.html } }
|
|
47
|
-
: { children: <Text component="span" fz={'xs'} c="dimmed">{emptyText}</Text> }
|
|
55
|
+
: { children: <Text component="span" fz={'xs'} c="dimmed" style={{ userSelect: 'none' }}>{emptyText}</Text> }
|
|
48
56
|
return (
|
|
49
57
|
<Box
|
|
50
58
|
ref={ref}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { css, sva } from '@likec4/styles/css'
|
|
2
2
|
|
|
3
|
-
// export const _compoundOpacity = '--_compound-opacity'
|
|
4
|
-
// const compoundOpacity = `var(${_compoundOpacity})`
|
|
5
|
-
// // const varCompoundOpacity = createVar('compound-opacity')
|
|
6
|
-
|
|
7
|
-
// export const _borderTransparency = '--_compound-border-transparency'
|
|
8
|
-
// const borderTransparency = `var(${_borderTransparency})`
|
|
9
|
-
|
|
10
|
-
// export const _borderWidth =
|
|
11
|
-
// const borderWidth = `var(${_borderWidth})`
|
|
12
3
|
export const borderWidth = {
|
|
13
4
|
var: '--_border-width',
|
|
14
5
|
ref: 'var(--_border-width, 2px)',
|
|
@@ -46,7 +37,7 @@ const root = css.raw({
|
|
|
46
37
|
width: '100%',
|
|
47
38
|
height: '100%',
|
|
48
39
|
border: 'transparent',
|
|
49
|
-
background: 'likec4
|
|
40
|
+
background: 'var(--likec4-palette-fill)',
|
|
50
41
|
backgroundClip: 'padding-box',
|
|
51
42
|
transitionDelay: '.075ms',
|
|
52
43
|
},
|
|
@@ -84,7 +75,7 @@ const compoundBorder = css.raw({
|
|
|
84
75
|
background: 'transparent',
|
|
85
76
|
borderStyle: 'dashed',
|
|
86
77
|
borderWidth: `[${borderWidth.ref}]`,
|
|
87
|
-
borderColor: `[color-mix(in srgb,
|
|
78
|
+
borderColor: `[color-mix(in srgb, var(--likec4-palette-stroke) ${borderOpacityPercent.ref}, transparent)]`,
|
|
88
79
|
})
|
|
89
80
|
|
|
90
81
|
const indicatorSvg = css.raw({
|
|
@@ -108,12 +99,12 @@ const indicatorSvg = css.raw({
|
|
|
108
99
|
})
|
|
109
100
|
|
|
110
101
|
const indicatorRect = css.raw({
|
|
111
|
-
stroke: `[color-mix(in srgb,
|
|
102
|
+
stroke: `[color-mix(in srgb, var(--likec4-palette-stroke) 60%, var(--likec4-palette-hiContrast))]`,
|
|
112
103
|
strokeWidth: '4',
|
|
113
104
|
fill: '[none]',
|
|
114
105
|
animationStyle: 'indicator',
|
|
115
106
|
_light: {
|
|
116
|
-
stroke: `[color-mix(in srgb,
|
|
107
|
+
stroke: `[color-mix(in srgb, var(--likec4-palette-stroke) 80%, var(--likec4-palette-hiContrast))]`,
|
|
117
108
|
},
|
|
118
109
|
})
|
|
119
110
|
|
|
@@ -19,10 +19,10 @@ const titleContainer = css({
|
|
|
19
19
|
position: 'absolute',
|
|
20
20
|
display: 'flex',
|
|
21
21
|
alignItems: 'center',
|
|
22
|
-
gap: '
|
|
23
|
-
left: '14px',
|
|
24
|
-
top: '4px',
|
|
25
|
-
right: '30px',
|
|
22
|
+
gap: '1.5', // 6px
|
|
23
|
+
left: '[14px]',
|
|
24
|
+
top: '[4px]',
|
|
25
|
+
right: '[30px]',
|
|
26
26
|
width: 'auto',
|
|
27
27
|
minHeight: '30px',
|
|
28
28
|
[`:where(.react-flow__node.draggable) &`]: {
|
|
@@ -30,7 +30,7 @@ const titleContainer = css({
|
|
|
30
30
|
cursor: 'grab',
|
|
31
31
|
},
|
|
32
32
|
[`.likec4-compound-node:has(.compound-action) &`]: {
|
|
33
|
-
paddingLeft: '22px',
|
|
33
|
+
paddingLeft: '[22px]',
|
|
34
34
|
},
|
|
35
35
|
})
|
|
36
36
|
|
|
@@ -41,11 +41,11 @@ const titleText = css({
|
|
|
41
41
|
fontSize: '15px',
|
|
42
42
|
textTransform: 'uppercase',
|
|
43
43
|
letterSpacing: '0.2px',
|
|
44
|
-
color: 'likec4
|
|
44
|
+
color: 'var(--likec4-palette-loContrast)',
|
|
45
45
|
'[data-compound-title-inverse] &': {
|
|
46
46
|
color: {
|
|
47
|
-
base: '[color-mix(in srgb,
|
|
48
|
-
_light: 'likec4
|
|
47
|
+
base: '[color-mix(in srgb, var(--likec4-palette-loContrast) 60%, var(--likec4-palette-fill))]',
|
|
48
|
+
_light: 'var(--likec4-palette-stroke)',
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
51
|
})
|
|
@@ -5,14 +5,14 @@ export const compoundActionBtn = cva({
|
|
|
5
5
|
transitionDuration: 'normal',
|
|
6
6
|
'[data-compound-title-inverse] &': {
|
|
7
7
|
_dark: {
|
|
8
|
-
'--actionbtn-color': 'color-mix(in srgb,
|
|
8
|
+
'--actionbtn-color': 'color-mix(in srgb, var(--likec4-palette-loContrast) 60%, var(--likec4-palette-fill))',
|
|
9
9
|
},
|
|
10
10
|
_light: {
|
|
11
|
-
'--actionbtn-color': '
|
|
12
|
-
'--actionbtn-color-hovered': '
|
|
13
|
-
'--actionbtn-color-hovered-btn': '
|
|
14
|
-
'--actionbtn-bg-hovered': `
|
|
15
|
-
'--actionbtn-bg-hovered-btn': `
|
|
11
|
+
'--actionbtn-color': 'var(--likec4-palette-stroke)',
|
|
12
|
+
'--actionbtn-color-hovered': 'var(--likec4-palette-stroke)',
|
|
13
|
+
'--actionbtn-color-hovered-btn': 'var(--likec4-palette-hiContrast)',
|
|
14
|
+
'--actionbtn-bg-hovered': `var(--likec4-palette-fill)/50`,
|
|
15
|
+
'--actionbtn-bg-hovered-btn': `var(--likec4-palette-fill)`,
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { cx } from '@likec4/styles/css'
|
|
2
|
+
import { edgeActionBtn } from '@likec4/styles/recipes'
|
|
2
3
|
import { ActionIcon } from '@mantine/core'
|
|
3
4
|
import { IconZoomScan } from '@tabler/icons-react'
|
|
4
5
|
import { stopPropagation } from '../../../utils/xyflow'
|
|
5
|
-
import { actionBtn } from './edge.css'
|
|
6
6
|
|
|
7
7
|
type EdgeActionBtnProps = {
|
|
8
8
|
icon?: React.ReactNode
|
|
@@ -12,7 +12,7 @@ type EdgeActionBtnProps = {
|
|
|
12
12
|
export function EdgeActionButton({ icon, onClick }: EdgeActionBtnProps) {
|
|
13
13
|
return (
|
|
14
14
|
<ActionIcon
|
|
15
|
-
className={cx('nodrag nopan',
|
|
15
|
+
className={cx('nodrag nopan', edgeActionBtn())}
|
|
16
16
|
onPointerDownCapture={stopPropagation}
|
|
17
17
|
onClick={onClick}
|
|
18
18
|
role="button"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { invariant } from '@likec4/core'
|
|
2
2
|
import type { DiagramEdge } from '@likec4/core/types'
|
|
3
|
-
import {
|
|
3
|
+
import { cx } from '@likec4/styles/css'
|
|
4
4
|
import { type PropsWithChildren } from 'react'
|
|
5
5
|
import type { UndefinedOnPartialDeep } from 'type-fest'
|
|
6
6
|
import type { EdgeProps } from '../../types'
|
|
@@ -38,12 +38,9 @@ export function EdgeContainer({
|
|
|
38
38
|
}: EdgeContainerProps) {
|
|
39
39
|
const props = {
|
|
40
40
|
className: cx(
|
|
41
|
-
css({
|
|
42
|
-
likec4RelationPalette: color,
|
|
43
|
-
}),
|
|
44
|
-
styles.edgeVars,
|
|
45
|
-
styles.edgeContainer,
|
|
46
41
|
className,
|
|
42
|
+
styles.edgeContainer,
|
|
43
|
+
'likec4-edge-container',
|
|
47
44
|
),
|
|
48
45
|
'data-likec4-color': color,
|
|
49
46
|
'data-edge-dir': data.dir ?? 'forward',
|