@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
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { css, cx } from '@likec4/styles/css'
|
|
2
|
+
import { Box, HStack, styled } from '@likec4/styles/jsx'
|
|
3
|
+
import { hstack, vstack } from '@likec4/styles/patterns'
|
|
4
|
+
import {
|
|
5
|
+
type PopoverProps,
|
|
6
|
+
Badge,
|
|
7
|
+
Popover,
|
|
8
|
+
Text,
|
|
9
|
+
UnstyledButton,
|
|
10
|
+
} from '@mantine/core'
|
|
11
|
+
import { IconId, IconLink } from '@tabler/icons-react'
|
|
12
|
+
import * as m from 'motion/react-m'
|
|
13
|
+
import { ElementTag, MarkdownBlock } from '../../base/primitives'
|
|
14
|
+
import { Link } from '../../components/Link'
|
|
15
|
+
import { useDiagram } from '../../hooks/useDiagram'
|
|
16
|
+
import { useMantinePortalProps } from '../../hooks/useMantinePortalProps'
|
|
17
|
+
import type { NavigationPanelActorSnapshot } from '../actor'
|
|
18
|
+
import { useNavigationActorSnapshot } from '../hooks'
|
|
19
|
+
|
|
20
|
+
const selector = ({ context }: NavigationPanelActorSnapshot) => {
|
|
21
|
+
const view = context.viewModel
|
|
22
|
+
return {
|
|
23
|
+
id: view.id,
|
|
24
|
+
title: view.titleOrUntitled,
|
|
25
|
+
description: view.description,
|
|
26
|
+
tags: view.tags,
|
|
27
|
+
links: view.links,
|
|
28
|
+
relativePath: view.$view.relativePath,
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type ViewDetailsCardData = ReturnType<typeof selector>
|
|
33
|
+
|
|
34
|
+
export const ViewDetailsCard = (props: PopoverProps) => {
|
|
35
|
+
const data = useNavigationActorSnapshot(selector)
|
|
36
|
+
const portalProps = useMantinePortalProps()
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Popover
|
|
40
|
+
position="bottom-end"
|
|
41
|
+
shadow="xl"
|
|
42
|
+
clickOutsideEvents={['pointerdown', 'mousedown', 'click']}
|
|
43
|
+
trapFocus
|
|
44
|
+
{...portalProps}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
<ViewDetailsCardTrigger linksCount={data.links.length} />
|
|
48
|
+
<ViewDetailsCardDropdown data={data} />
|
|
49
|
+
</Popover>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const ViewDetailsCardTrigger = ({ linksCount }: { linksCount: number }) => (
|
|
54
|
+
<Popover.Target>
|
|
55
|
+
<UnstyledButton
|
|
56
|
+
component={m.button}
|
|
57
|
+
layout="position"
|
|
58
|
+
whileTap={{
|
|
59
|
+
scale: 0.95,
|
|
60
|
+
translateY: 1,
|
|
61
|
+
}}
|
|
62
|
+
className={cx(
|
|
63
|
+
'group',
|
|
64
|
+
hstack({
|
|
65
|
+
gap: '2',
|
|
66
|
+
paddingInline: 'xxs',
|
|
67
|
+
paddingBlock: 'xxs',
|
|
68
|
+
rounded: 'sm',
|
|
69
|
+
userSelect: 'none',
|
|
70
|
+
cursor: 'pointer',
|
|
71
|
+
color: {
|
|
72
|
+
base: 'likec4.panel.action-icon.text',
|
|
73
|
+
_hover: 'likec4.panel.action-icon.text.hover',
|
|
74
|
+
},
|
|
75
|
+
backgroundColor: {
|
|
76
|
+
_hover: 'likec4.panel.action-icon.bg.hover',
|
|
77
|
+
},
|
|
78
|
+
display: {
|
|
79
|
+
base: 'none',
|
|
80
|
+
'@/xs': 'flex',
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
``,
|
|
84
|
+
)}>
|
|
85
|
+
<IconId size={16} stroke={1.8} />
|
|
86
|
+
{linksCount > 0 && (
|
|
87
|
+
<HStack gap={'[1px]'}>
|
|
88
|
+
<IconLink size={14} stroke={2} />
|
|
89
|
+
<Box
|
|
90
|
+
css={{
|
|
91
|
+
fontSize: '11px',
|
|
92
|
+
fontWeight: 600,
|
|
93
|
+
lineHeight: 1,
|
|
94
|
+
opacity: 0.8,
|
|
95
|
+
}}>
|
|
96
|
+
{linksCount}
|
|
97
|
+
</Box>
|
|
98
|
+
</HStack>
|
|
99
|
+
)}
|
|
100
|
+
</UnstyledButton>
|
|
101
|
+
</Popover.Target>
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
const SectionHeader = styled('div', {
|
|
105
|
+
base: {
|
|
106
|
+
fontSize: 'xs',
|
|
107
|
+
color: 'mantine.colors.dimmed',
|
|
108
|
+
fontWeight: 500,
|
|
109
|
+
userSelect: 'none',
|
|
110
|
+
mb: 'xxs',
|
|
111
|
+
},
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
const ViewDetailsCardDropdown = ({
|
|
115
|
+
data: {
|
|
116
|
+
id,
|
|
117
|
+
title,
|
|
118
|
+
description,
|
|
119
|
+
tags,
|
|
120
|
+
links,
|
|
121
|
+
relativePath,
|
|
122
|
+
},
|
|
123
|
+
}: { data: ViewDetailsCardData }) => {
|
|
124
|
+
const diagram = useDiagram()
|
|
125
|
+
return (
|
|
126
|
+
<Popover.Dropdown
|
|
127
|
+
className={cx(
|
|
128
|
+
'nowheel nopan nodrag',
|
|
129
|
+
vstack({
|
|
130
|
+
margin: 'xs',
|
|
131
|
+
layerStyle: 'likec4.dropdown',
|
|
132
|
+
gap: 'md',
|
|
133
|
+
padding: 'md',
|
|
134
|
+
pointerEvents: 'all',
|
|
135
|
+
maxWidth: 'calc(100cqw - 32px)',
|
|
136
|
+
minWidth: 'calc(100cqw - 50px)',
|
|
137
|
+
maxHeight: 'calc(100cqh - 100px)',
|
|
138
|
+
width: 'max-content',
|
|
139
|
+
cursor: 'default',
|
|
140
|
+
'@/sm': {
|
|
141
|
+
minWidth: 400,
|
|
142
|
+
maxWidth: 550,
|
|
143
|
+
},
|
|
144
|
+
'@/lg': {
|
|
145
|
+
maxWidth: 700,
|
|
146
|
+
},
|
|
147
|
+
}),
|
|
148
|
+
)}>
|
|
149
|
+
<section>
|
|
150
|
+
<Text component="div" fw={500} size="xl">{title}</Text>
|
|
151
|
+
<HStack alignItems={'flex-start'} mt="1">
|
|
152
|
+
<ViewBadge label="id" value={id} />
|
|
153
|
+
{/* {relativePath && <ViewBadge label="source" value={relativePath} />} */}
|
|
154
|
+
<HStack gap="xs" flexWrap="wrap">
|
|
155
|
+
{tags.map((tag, i) => (
|
|
156
|
+
<ElementTag
|
|
157
|
+
key={tag}
|
|
158
|
+
tag={tag}
|
|
159
|
+
cursor="pointer"
|
|
160
|
+
onClick={e => {
|
|
161
|
+
e.stopPropagation()
|
|
162
|
+
diagram.openSearch(`#${tag}`)
|
|
163
|
+
}} />
|
|
164
|
+
))}
|
|
165
|
+
</HStack>
|
|
166
|
+
</HStack>
|
|
167
|
+
</section>
|
|
168
|
+
{links.length > 0 && (
|
|
169
|
+
<section className={hstack({ alignItems: 'baseline' })}>
|
|
170
|
+
<SectionHeader>Links</SectionHeader>
|
|
171
|
+
<HStack gap="xs" flexWrap="wrap">
|
|
172
|
+
{links.map((link, i) => <Link key={`${i}-${link.url}`} value={link} />)}
|
|
173
|
+
</HStack>
|
|
174
|
+
</section>
|
|
175
|
+
)}
|
|
176
|
+
{description.isEmpty && (
|
|
177
|
+
<Text component="div" fw={500} size="xs" c="dimmed" my="md" style={{ userSelect: 'none' }}>No description</Text>
|
|
178
|
+
)}
|
|
179
|
+
{description.nonEmpty && (
|
|
180
|
+
<section>
|
|
181
|
+
<SectionHeader>Description</SectionHeader>
|
|
182
|
+
<MarkdownBlock
|
|
183
|
+
value={description}
|
|
184
|
+
fontSize="sm"
|
|
185
|
+
emptyText="No description"
|
|
186
|
+
className={css({
|
|
187
|
+
userSelect: 'all',
|
|
188
|
+
})}
|
|
189
|
+
/>
|
|
190
|
+
</section>
|
|
191
|
+
)}
|
|
192
|
+
</Popover.Dropdown>
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const ViewBadge = ({
|
|
197
|
+
label,
|
|
198
|
+
value,
|
|
199
|
+
}: {
|
|
200
|
+
label: string
|
|
201
|
+
value: string
|
|
202
|
+
}) => {
|
|
203
|
+
return (
|
|
204
|
+
<HStack gap="0.5">
|
|
205
|
+
<ViewBadgeLabel>{label}</ViewBadgeLabel>
|
|
206
|
+
<Badge
|
|
207
|
+
size="sm"
|
|
208
|
+
radius="sm"
|
|
209
|
+
variant="light"
|
|
210
|
+
color="gray"
|
|
211
|
+
tt="none"
|
|
212
|
+
fw={500}
|
|
213
|
+
classNames={{
|
|
214
|
+
root: css({
|
|
215
|
+
width: 'max-content',
|
|
216
|
+
overflow: 'visible',
|
|
217
|
+
px: '1',
|
|
218
|
+
color: {
|
|
219
|
+
_light: 'mantine.colors.gray[8]',
|
|
220
|
+
},
|
|
221
|
+
}),
|
|
222
|
+
label: css({
|
|
223
|
+
overflow: 'visible',
|
|
224
|
+
}),
|
|
225
|
+
section: css({
|
|
226
|
+
opacity: 0.5,
|
|
227
|
+
userSelect: 'none',
|
|
228
|
+
marginInlineEnd: '0.5',
|
|
229
|
+
}),
|
|
230
|
+
}}>
|
|
231
|
+
{value}
|
|
232
|
+
</Badge>
|
|
233
|
+
</HStack>
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const ViewBadgeLabel = styled('div', {
|
|
238
|
+
base: {
|
|
239
|
+
color: 'mantine.colors.dimmed',
|
|
240
|
+
fontWeight: 500,
|
|
241
|
+
fontSize: 'xxs',
|
|
242
|
+
userSelect: 'none',
|
|
243
|
+
},
|
|
244
|
+
})
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BurgerButton } from './BurgerButton'
|
|
2
|
+
export { NavigationButtons } from './NavigationButtons'
|
|
3
|
+
export { OpenSource } from './OpenSource'
|
|
4
|
+
export { SearchControl } from './SearchControl'
|
|
5
|
+
export { ToggleReadonly } from './ToggleReadonly'
|
|
6
|
+
export { ViewDetailsCard } from './ViewDetailsCard'
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { css } from '@likec4/styles/css'
|
|
2
|
+
import { Box, HStack } from '@likec4/styles/jsx'
|
|
3
|
+
import { type ButtonProps, Button, Menu, MenuDropdown, MenuItem, MenuTarget } from '@mantine/core'
|
|
4
|
+
import { IconChevronDown } from '@tabler/icons-react'
|
|
5
|
+
import { useLikeC4ProjectId, useLikeC4ProjectsContext } from '../../likec4model/useLikeC4Project'
|
|
6
|
+
|
|
7
|
+
export function ProjectsMenu(props: ButtonProps) {
|
|
8
|
+
const { projects, onProjectChange } = useLikeC4ProjectsContext()
|
|
9
|
+
const projectId = useLikeC4ProjectId()
|
|
10
|
+
|
|
11
|
+
if (projects.length <= 1) {
|
|
12
|
+
return null
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<HStack gap="0.5" alignItems="baseline">
|
|
17
|
+
<Box
|
|
18
|
+
css={{
|
|
19
|
+
fontWeight: '400',
|
|
20
|
+
fontSize: 'xxs',
|
|
21
|
+
color: 'mantine.colors.dimmed',
|
|
22
|
+
userSelect: 'none',
|
|
23
|
+
}}>
|
|
24
|
+
Project
|
|
25
|
+
</Box>
|
|
26
|
+
<Menu shadow="md" position="bottom-start" offset={{ mainAxis: 2 }} closeOnItemClick>
|
|
27
|
+
<MenuTarget>
|
|
28
|
+
<Button
|
|
29
|
+
tabIndex={-1}
|
|
30
|
+
autoFocus={false}
|
|
31
|
+
variant="subtle"
|
|
32
|
+
size="compact-xs"
|
|
33
|
+
color="gray"
|
|
34
|
+
classNames={{
|
|
35
|
+
root: css({
|
|
36
|
+
fontWeight: '400',
|
|
37
|
+
fontSize: 'xxs',
|
|
38
|
+
height: 'auto',
|
|
39
|
+
lineHeight: 1.1,
|
|
40
|
+
color: {
|
|
41
|
+
_light: 'mantine.colors.gray[9]',
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
section: css({
|
|
45
|
+
'&:is([data-position="right"])': {
|
|
46
|
+
marginInlineStart: '1',
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
}}
|
|
50
|
+
rightSection={<IconChevronDown opacity={0.5} size={12} stroke={1.5} />}
|
|
51
|
+
{...props}>
|
|
52
|
+
{projectId}
|
|
53
|
+
</Button>
|
|
54
|
+
</MenuTarget>
|
|
55
|
+
|
|
56
|
+
<MenuDropdown>
|
|
57
|
+
{projects.map(({ id, title }) => (
|
|
58
|
+
<MenuItem
|
|
59
|
+
key={id}
|
|
60
|
+
onClick={(e) => {
|
|
61
|
+
if (projectId === id) {
|
|
62
|
+
e.stopPropagation()
|
|
63
|
+
return
|
|
64
|
+
}
|
|
65
|
+
onProjectChange(id)
|
|
66
|
+
}}>
|
|
67
|
+
{title ?? id}
|
|
68
|
+
</MenuItem>
|
|
69
|
+
))}
|
|
70
|
+
</MenuDropdown>
|
|
71
|
+
</Menu>
|
|
72
|
+
</HStack>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IconFocusCentered } from '@tabler/icons-react'
|
|
2
|
+
import { useDiagram } from '../../hooks/useDiagram'
|
|
3
|
+
import { PanelActionIcon } from '../_common'
|
|
4
|
+
import { Tooltip } from './_common'
|
|
5
|
+
|
|
6
|
+
export const CenterCamera = () => {
|
|
7
|
+
const diagram = useDiagram()
|
|
8
|
+
return (
|
|
9
|
+
<Tooltip label="Center camera">
|
|
10
|
+
<PanelActionIcon onClick={() => diagram.fitDiagram()}>
|
|
11
|
+
<IconFocusCentered />
|
|
12
|
+
</PanelActionIcon>
|
|
13
|
+
</Tooltip>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import type { AutoLayoutDirection } from '@likec4/core'
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Flex,
|
|
5
|
+
FloatingIndicator,
|
|
6
|
+
Popover,
|
|
7
|
+
PopoverDropdown,
|
|
8
|
+
PopoverTarget,
|
|
9
|
+
Text,
|
|
10
|
+
UnstyledButton,
|
|
11
|
+
} from '@mantine/core'
|
|
12
|
+
import {
|
|
13
|
+
type UseMovePosition,
|
|
14
|
+
clampUseMovePosition,
|
|
15
|
+
useHover,
|
|
16
|
+
useMergedRef,
|
|
17
|
+
useMove,
|
|
18
|
+
useUncontrolled,
|
|
19
|
+
} from '@mantine/hooks'
|
|
20
|
+
import { useDebouncedCallback } from '@react-hookz/web'
|
|
21
|
+
import { IconLayoutDashboard } from '@tabler/icons-react'
|
|
22
|
+
import { forwardRef, useState } from 'react'
|
|
23
|
+
import { useDiagramEventHandlers } from '../../context'
|
|
24
|
+
import { useDiagram, useDiagramContext } from '../../hooks/useDiagram'
|
|
25
|
+
import type { DiagramContext } from '../../state/types'
|
|
26
|
+
import { PanelActionIcon } from '../_common'
|
|
27
|
+
import { Tooltip } from './_common'
|
|
28
|
+
import * as css from './styles'
|
|
29
|
+
|
|
30
|
+
const selector = (state: DiagramContext) => ({
|
|
31
|
+
viewId: state.view.id,
|
|
32
|
+
autoLayout: state.view.autoLayout,
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
export const ChangeAutoLayoutButton = () => {
|
|
36
|
+
const { onChange } = useDiagramEventHandlers()
|
|
37
|
+
const diagram = useDiagram()
|
|
38
|
+
const [rootRef, setRootRef] = useState<HTMLDivElement | null>(null)
|
|
39
|
+
const [controlsRefs, setControlsRefs] = useState<Record<AutoLayoutDirection, HTMLButtonElement | null>>({} as any)
|
|
40
|
+
const {
|
|
41
|
+
autoLayout,
|
|
42
|
+
viewId,
|
|
43
|
+
} = useDiagramContext(selector)
|
|
44
|
+
|
|
45
|
+
const { ref, hovered: isSpacingHovered } = useHover()
|
|
46
|
+
|
|
47
|
+
const setControlRef = (name: AutoLayoutDirection) => (node: HTMLButtonElement) => {
|
|
48
|
+
controlsRefs[name] = node
|
|
49
|
+
setControlsRefs(controlsRefs)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const setAutoLayout = (direction: AutoLayoutDirection) => (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
53
|
+
event.stopPropagation()
|
|
54
|
+
onChange?.({
|
|
55
|
+
change: {
|
|
56
|
+
op: 'change-autolayout',
|
|
57
|
+
layout: {
|
|
58
|
+
...autoLayout,
|
|
59
|
+
direction,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const setSpacing = (nodeSep: number | null, rankSep: number | null) => {
|
|
66
|
+
// Force fitDiagram
|
|
67
|
+
diagram.fitDiagram()
|
|
68
|
+
onChange?.({
|
|
69
|
+
change: {
|
|
70
|
+
op: 'change-autolayout',
|
|
71
|
+
layout: {
|
|
72
|
+
...autoLayout,
|
|
73
|
+
nodeSep,
|
|
74
|
+
rankSep,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<Popover
|
|
82
|
+
position="right-start"
|
|
83
|
+
clickOutsideEvents={[
|
|
84
|
+
'pointerdown',
|
|
85
|
+
]}
|
|
86
|
+
radius="xs"
|
|
87
|
+
shadow="lg"
|
|
88
|
+
offset={{
|
|
89
|
+
mainAxis: 10,
|
|
90
|
+
}}>
|
|
91
|
+
<PopoverTarget>
|
|
92
|
+
<Tooltip label="Change Auto Layout">
|
|
93
|
+
<PanelActionIcon>
|
|
94
|
+
<IconLayoutDashboard />
|
|
95
|
+
</PanelActionIcon>
|
|
96
|
+
</Tooltip>
|
|
97
|
+
</PopoverTarget>
|
|
98
|
+
<PopoverDropdown className="likec4-top-left-panel" p={8} pt={6} opacity={isSpacingHovered ? 0.6 : 1}>
|
|
99
|
+
<Box pos={'relative'} ref={setRootRef}>
|
|
100
|
+
<FloatingIndicator
|
|
101
|
+
target={controlsRefs[autoLayout.direction]}
|
|
102
|
+
parent={rootRef}
|
|
103
|
+
className={css.autolayoutIndicator}
|
|
104
|
+
/>
|
|
105
|
+
<Box mb={10}>
|
|
106
|
+
<Text inline fz={'xs'} c={'dimmed'} fw={500}>Auto layout:</Text>
|
|
107
|
+
</Box>
|
|
108
|
+
<Flex gap={2} wrap={'wrap'} justify={'stretch'} maw={160}>
|
|
109
|
+
<UnstyledButton className={css.autolayoutButton} ref={setControlRef('TB')} onClick={setAutoLayout('TB')}>
|
|
110
|
+
Top-Bottom
|
|
111
|
+
</UnstyledButton>
|
|
112
|
+
<UnstyledButton className={css.autolayoutButton} ref={setControlRef('BT')} onClick={setAutoLayout('BT')}>
|
|
113
|
+
Bottom-Top
|
|
114
|
+
</UnstyledButton>
|
|
115
|
+
<UnstyledButton className={css.autolayoutButton} ref={setControlRef('LR')} onClick={setAutoLayout('LR')}>
|
|
116
|
+
Left-Right
|
|
117
|
+
</UnstyledButton>
|
|
118
|
+
<UnstyledButton className={css.autolayoutButton} ref={setControlRef('RL')} onClick={setAutoLayout('RL')}>
|
|
119
|
+
Right-Left
|
|
120
|
+
</UnstyledButton>
|
|
121
|
+
</Flex>
|
|
122
|
+
<Box my={10}>
|
|
123
|
+
<Text inline fz={'xs'} c={'dimmed'} fw={500}>Spacing:</Text>
|
|
124
|
+
</Box>
|
|
125
|
+
<SpacingSliders
|
|
126
|
+
ref={ref}
|
|
127
|
+
isVertical={autoLayout.direction === 'TB' || autoLayout.direction === 'BT'}
|
|
128
|
+
key={viewId}
|
|
129
|
+
nodeSep={autoLayout.nodeSep}
|
|
130
|
+
rankSep={autoLayout.rankSep}
|
|
131
|
+
onChange={setSpacing}
|
|
132
|
+
/>
|
|
133
|
+
</Box>
|
|
134
|
+
</PopoverDropdown>
|
|
135
|
+
</Popover>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const MAX_SPACING = 400
|
|
140
|
+
const SpacingSliders = forwardRef<HTMLDivElement | null, {
|
|
141
|
+
isVertical: boolean
|
|
142
|
+
nodeSep: number | undefined
|
|
143
|
+
rankSep: number | undefined
|
|
144
|
+
onChange: (nodeSep: number, rankSep: number) => void
|
|
145
|
+
}>(({
|
|
146
|
+
isVertical,
|
|
147
|
+
nodeSep,
|
|
148
|
+
rankSep,
|
|
149
|
+
onChange,
|
|
150
|
+
}, _ref) => {
|
|
151
|
+
if (!isVertical) {
|
|
152
|
+
;[nodeSep, rankSep] = [rankSep, nodeSep]
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const propagateChange = useDebouncedCallback(
|
|
156
|
+
({ x, y }: UseMovePosition) => {
|
|
157
|
+
if (!isVertical) {
|
|
158
|
+
;[x, y] = [y, x]
|
|
159
|
+
}
|
|
160
|
+
onChange(Math.round(x * MAX_SPACING), Math.round(y * MAX_SPACING))
|
|
161
|
+
},
|
|
162
|
+
[onChange, isVertical],
|
|
163
|
+
250,
|
|
164
|
+
2000,
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
const [value, setValue] = useUncontrolled({
|
|
168
|
+
defaultValue: clampUseMovePosition({
|
|
169
|
+
x: (nodeSep ?? 100) / MAX_SPACING,
|
|
170
|
+
y: (rankSep ?? 120) / MAX_SPACING,
|
|
171
|
+
}),
|
|
172
|
+
onChange: propagateChange,
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
const { ref } = useMove(setValue)
|
|
176
|
+
|
|
177
|
+
let nodeSepValue = Math.round(value.x * MAX_SPACING)
|
|
178
|
+
let rankSepValue = Math.round(value.y * MAX_SPACING)
|
|
179
|
+
if (!isVertical) {
|
|
180
|
+
;[nodeSepValue, rankSepValue] = [rankSepValue, nodeSepValue]
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const mergedRef = useMergedRef(ref, _ref)
|
|
184
|
+
|
|
185
|
+
return (
|
|
186
|
+
<Box ref={mergedRef} className={css.spacingSliderBody} pt={'100%'}>
|
|
187
|
+
<Box
|
|
188
|
+
className={css.spacingSliderThumb}
|
|
189
|
+
style={{
|
|
190
|
+
left: `${value.x * 100}%`,
|
|
191
|
+
top: `${value.y * 100}%`,
|
|
192
|
+
}}
|
|
193
|
+
/>
|
|
194
|
+
<Box pos={'absolute'} left={2} bottom={2}>
|
|
195
|
+
<Text component="div" fz={8} c={'dimmed'} fw={500}>{rankSepValue}, {nodeSepValue}</Text>
|
|
196
|
+
</Box>
|
|
197
|
+
</Box>
|
|
198
|
+
)
|
|
199
|
+
})
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { vstack } from '@likec4/styles/patterns'
|
|
2
|
+
import { TooltipGroup } from '@mantine/core'
|
|
3
|
+
import { AnimatePresence } from 'motion/react'
|
|
4
|
+
import * as m from 'motion/react-m'
|
|
5
|
+
import { useEnabledFeatures } from '../../context'
|
|
6
|
+
import { CenterCamera } from './CenterCamera'
|
|
7
|
+
import { ChangeAutoLayoutButton } from './ChangeAutoLayoutButton'
|
|
8
|
+
import { LayoutDriftNotification } from './LayoutDriftNotification'
|
|
9
|
+
import { ManualLayoutToolsButton } from './ManualLayoutToolsButton'
|
|
10
|
+
|
|
11
|
+
export function EditorPanel() {
|
|
12
|
+
const { enableReadOnly } = useEnabledFeatures()
|
|
13
|
+
return (
|
|
14
|
+
<AnimatePresence>
|
|
15
|
+
{!enableReadOnly && (
|
|
16
|
+
<m.div
|
|
17
|
+
layout="position"
|
|
18
|
+
className={vstack({
|
|
19
|
+
gap: 'xs',
|
|
20
|
+
layerStyle: 'likec4.panel',
|
|
21
|
+
position: 'relative',
|
|
22
|
+
cursor: 'pointer',
|
|
23
|
+
padding: 'xxs',
|
|
24
|
+
pointerEvents: 'all',
|
|
25
|
+
})}
|
|
26
|
+
initial={{
|
|
27
|
+
opacity: 0,
|
|
28
|
+
translateX: -20,
|
|
29
|
+
}}
|
|
30
|
+
animate={{
|
|
31
|
+
opacity: 1,
|
|
32
|
+
translateX: 0,
|
|
33
|
+
}}
|
|
34
|
+
exit={{
|
|
35
|
+
opacity: 0,
|
|
36
|
+
translateX: -20,
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<TooltipGroup openDelay={600} closeDelay={120}>
|
|
40
|
+
<ChangeAutoLayoutButton />
|
|
41
|
+
<ManualLayoutToolsButton />
|
|
42
|
+
<LayoutDriftNotification />
|
|
43
|
+
<CenterCamera />
|
|
44
|
+
</TooltipGroup>
|
|
45
|
+
</m.div>
|
|
46
|
+
)}
|
|
47
|
+
</AnimatePresence>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ActionIcon,
|
|
3
|
+
Code,
|
|
4
|
+
HoverCard,
|
|
5
|
+
HoverCardDropdown,
|
|
6
|
+
HoverCardTarget,
|
|
7
|
+
Notification,
|
|
8
|
+
Text,
|
|
9
|
+
} from '@mantine/core'
|
|
10
|
+
import {
|
|
11
|
+
IconAlertTriangle,
|
|
12
|
+
} from '@tabler/icons-react'
|
|
13
|
+
|
|
14
|
+
import { css } from '@likec4/styles/css'
|
|
15
|
+
import { useMantinePortalProps } from '../../hooks'
|
|
16
|
+
import { useDiagramContext } from '../../hooks/useDiagram'
|
|
17
|
+
|
|
18
|
+
export const LayoutDriftNotification = () => {
|
|
19
|
+
const portalProps = useMantinePortalProps()
|
|
20
|
+
const hasLayoutDrift = useDiagramContext(c => c.view.hasLayoutDrift ?? false)
|
|
21
|
+
if (!hasLayoutDrift) return null
|
|
22
|
+
return (
|
|
23
|
+
<HoverCard
|
|
24
|
+
position="right-start"
|
|
25
|
+
openDelay={200}
|
|
26
|
+
closeDelay={100}
|
|
27
|
+
{...portalProps}>
|
|
28
|
+
<HoverCardTarget>
|
|
29
|
+
<ActionIcon
|
|
30
|
+
color={'orange'}
|
|
31
|
+
c="orange"
|
|
32
|
+
className={css({
|
|
33
|
+
bg: 'mantine.colors.orange.light',
|
|
34
|
+
})}
|
|
35
|
+
>
|
|
36
|
+
<IconAlertTriangle />
|
|
37
|
+
</ActionIcon>
|
|
38
|
+
</HoverCardTarget>
|
|
39
|
+
<HoverCardDropdown p={'0'}>
|
|
40
|
+
<Notification
|
|
41
|
+
color="orange"
|
|
42
|
+
withBorder={false}
|
|
43
|
+
withCloseButton={false}
|
|
44
|
+
title="Manual layout issues">
|
|
45
|
+
<Text mt={2} size="sm" lh="xs">
|
|
46
|
+
View contains new elements or their sizes have changed,<br />
|
|
47
|
+
last manual layout can not be applied.
|
|
48
|
+
</Text>
|
|
49
|
+
<Text mt={'xs'} size="sm" lh="xs">
|
|
50
|
+
Update view predicates or remove <Code>@likec4-generated</Code>
|
|
51
|
+
</Text>
|
|
52
|
+
</Notification>
|
|
53
|
+
</HoverCardDropdown>
|
|
54
|
+
</HoverCard>
|
|
55
|
+
)
|
|
56
|
+
}
|