@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,539 @@
|
|
|
1
|
+
import { type LikeC4ViewsFolder, LikeC4ViewModel, normalizeViewPath, VIEW_FOLDERS_SEPARATOR } from '@likec4/core/model'
|
|
2
|
+
import type { ViewId } from '@likec4/core/types'
|
|
3
|
+
import { compareNaturalHierarchically, ifilter, ifirst, nonexhaustive, toArray } from '@likec4/core/utils'
|
|
4
|
+
import { css, cx } from '@likec4/styles/css'
|
|
5
|
+
import { Box, HStack, VStack } from '@likec4/styles/jsx'
|
|
6
|
+
import { hstack, vstack } from '@likec4/styles/patterns'
|
|
7
|
+
import {
|
|
8
|
+
Breadcrumbs,
|
|
9
|
+
Button,
|
|
10
|
+
createScopedKeydownHandler,
|
|
11
|
+
Divider,
|
|
12
|
+
Highlight,
|
|
13
|
+
Input,
|
|
14
|
+
PopoverDropdown,
|
|
15
|
+
rem,
|
|
16
|
+
ScrollAreaAutosize,
|
|
17
|
+
UnstyledButton,
|
|
18
|
+
} from '@mantine/core'
|
|
19
|
+
import { useThrottledCallback, useUncontrolled } from '@mantine/hooks'
|
|
20
|
+
import {
|
|
21
|
+
IconChevronRight,
|
|
22
|
+
IconFolderFilled,
|
|
23
|
+
IconSearch,
|
|
24
|
+
IconStack2,
|
|
25
|
+
IconStarFilled,
|
|
26
|
+
IconZoomScan,
|
|
27
|
+
} from '@tabler/icons-react'
|
|
28
|
+
import { useSelector } from '@xstate/react'
|
|
29
|
+
import { deepEqual } from 'fast-equals'
|
|
30
|
+
import type { ComponentPropsWithoutRef, KeyboardEventHandler } from 'react'
|
|
31
|
+
import { isArray, isEmpty, pipe, sort } from 'remeda'
|
|
32
|
+
import { type NavigationLinkProps, NavigationLink } from '../components/NavigationLink'
|
|
33
|
+
import { useLikeC4Model } from '../likec4model/useLikeC4Model'
|
|
34
|
+
import type { NavigationPanelActorContext } from './actor'
|
|
35
|
+
import { ProjectsMenu } from './dropdown/ProjectsMenu'
|
|
36
|
+
import { useNavigationActor, useNavigationActorContext, useNavigationActorRef } from './hooks'
|
|
37
|
+
import { breadcrumbTitle } from './styles.css'
|
|
38
|
+
|
|
39
|
+
const scopedKeydownHandler = createScopedKeydownHandler({
|
|
40
|
+
siblingSelector: '[data-likec4-focusable]',
|
|
41
|
+
parentSelector: '[data-likec4-breadcrumbs-dropdown]',
|
|
42
|
+
activateOnFocus: false,
|
|
43
|
+
loop: true,
|
|
44
|
+
orientation: 'vertical',
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
export function NavigationPanelDropdown() {
|
|
48
|
+
const actor = useNavigationActor()
|
|
49
|
+
const searchQuery = useSelector(actor.actorRef, s => s.context.searchQuery)
|
|
50
|
+
|
|
51
|
+
const setSearchQuery = useThrottledCallback((value: string) => {
|
|
52
|
+
actor.send({ type: 'searchQuery.change', value })
|
|
53
|
+
}, 250)
|
|
54
|
+
|
|
55
|
+
const hasSearchQuery = searchQuery.trim().length >= 2
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<PopoverDropdown
|
|
59
|
+
className={cx(
|
|
60
|
+
'nowheel',
|
|
61
|
+
vstack({
|
|
62
|
+
layerStyle: 'likec4.dropdown',
|
|
63
|
+
gap: 'xs',
|
|
64
|
+
pointerEvents: 'all',
|
|
65
|
+
}),
|
|
66
|
+
)}
|
|
67
|
+
data-likec4-breadcrumbs-dropdown
|
|
68
|
+
onMouseLeave={() => actor.send({ type: 'dropdown.mouseLeave' })}
|
|
69
|
+
onMouseEnter={() => actor.send({ type: 'dropdown.mouseEnter' })}
|
|
70
|
+
>
|
|
71
|
+
<ProjectsMenu />
|
|
72
|
+
<HStack gap="xs">
|
|
73
|
+
<SearchInput
|
|
74
|
+
value={searchQuery}
|
|
75
|
+
onChange={setSearchQuery}
|
|
76
|
+
data-likec4-focusable
|
|
77
|
+
onKeyDown={scopedKeydownHandler}
|
|
78
|
+
/>
|
|
79
|
+
{
|
|
80
|
+
/* <Button
|
|
81
|
+
variant="default"
|
|
82
|
+
size={'xs'}
|
|
83
|
+
onClick={(e) => {
|
|
84
|
+
e.stopPropagation()
|
|
85
|
+
actor.send({ type: 'dropdown.dismiss' })
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
Close
|
|
89
|
+
</Button> */
|
|
90
|
+
}
|
|
91
|
+
</HStack>
|
|
92
|
+
<ScrollAreaAutosize
|
|
93
|
+
scrollbars="xy"
|
|
94
|
+
type="auto"
|
|
95
|
+
offsetScrollbars="present"
|
|
96
|
+
classNames={{
|
|
97
|
+
root: css({
|
|
98
|
+
maxWidth: [
|
|
99
|
+
'calc(100vw - 50px)',
|
|
100
|
+
'calc(100cqw - 50px)',
|
|
101
|
+
],
|
|
102
|
+
}),
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
{hasSearchQuery
|
|
106
|
+
? <SearchResults searchQuery={normalizeViewPath(searchQuery).toLowerCase()} />
|
|
107
|
+
: <FolderColumns />}
|
|
108
|
+
</ScrollAreaAutosize>
|
|
109
|
+
</PopoverDropdown>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const compare = compareNaturalHierarchically(VIEW_FOLDERS_SEPARATOR)
|
|
114
|
+
function SearchResults({ searchQuery }: { searchQuery: string }) {
|
|
115
|
+
const likec4model = useLikeC4Model()
|
|
116
|
+
const actor = useNavigationActor()
|
|
117
|
+
const isSearchByPath = searchQuery.includes(VIEW_FOLDERS_SEPARATOR)
|
|
118
|
+
|
|
119
|
+
const found = pipe(
|
|
120
|
+
likec4model.views(),
|
|
121
|
+
ifilter(v => {
|
|
122
|
+
// if search query contains folder separator, search in view data
|
|
123
|
+
if (isSearchByPath && v.$view.title) {
|
|
124
|
+
return normalizeViewPath(v.$view.title).toLowerCase().includes(searchQuery)
|
|
125
|
+
}
|
|
126
|
+
return v.id.toLowerCase().includes(searchQuery) || !!v.title?.toLowerCase().includes(searchQuery)
|
|
127
|
+
}),
|
|
128
|
+
ifirst(20),
|
|
129
|
+
toArray(),
|
|
130
|
+
sort((a, b) => compare(a.folder.path, b.folder.path)),
|
|
131
|
+
)
|
|
132
|
+
if (found.length === 0) return <div>no results</div>
|
|
133
|
+
|
|
134
|
+
const highlight = isSearchByPath ? searchQuery.split(VIEW_FOLDERS_SEPARATOR) : searchQuery
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<ScrollAreaAutosize
|
|
138
|
+
scrollbars="xy"
|
|
139
|
+
offsetScrollbars={false}
|
|
140
|
+
className={css({
|
|
141
|
+
width: '100%',
|
|
142
|
+
maxWidth: [
|
|
143
|
+
'calc(100vw - 250px)',
|
|
144
|
+
'calc(100cqw - 250px)',
|
|
145
|
+
],
|
|
146
|
+
maxHeight: [
|
|
147
|
+
'calc(100vh - 200px)',
|
|
148
|
+
'calc(100cqh - 200px)',
|
|
149
|
+
],
|
|
150
|
+
})}>
|
|
151
|
+
<VStack gap="[1px]">
|
|
152
|
+
{found.map(v => (
|
|
153
|
+
<FoundedView
|
|
154
|
+
key={v.id}
|
|
155
|
+
view={v}
|
|
156
|
+
highlight={highlight}
|
|
157
|
+
onClick={e => {
|
|
158
|
+
console.log('click')
|
|
159
|
+
e.stopPropagation()
|
|
160
|
+
actor.selectView(v.id)
|
|
161
|
+
}}
|
|
162
|
+
data-likec4-focusable
|
|
163
|
+
onKeyDown={scopedKeydownHandler}
|
|
164
|
+
/>
|
|
165
|
+
))}
|
|
166
|
+
</VStack>
|
|
167
|
+
</ScrollAreaAutosize>
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
interface FoundedViewProps {
|
|
171
|
+
view: LikeC4ViewModel
|
|
172
|
+
highlight: string | string[]
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const foundedViewClass = hstack({
|
|
176
|
+
gap: 'xxs',
|
|
177
|
+
rounded: 'sm',
|
|
178
|
+
px: 'xs',
|
|
179
|
+
py: 'xxs',
|
|
180
|
+
_hover: {
|
|
181
|
+
backgroundColor: {
|
|
182
|
+
base: 'mantine.colors.gray[1]',
|
|
183
|
+
_dark: 'mantine.colors.dark[5]',
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
_focus: {
|
|
187
|
+
outline: 'none',
|
|
188
|
+
color: 'mantine.colors.primary.lightColor!',
|
|
189
|
+
backgroundColor: 'mantine.colors.primary.lightHover!',
|
|
190
|
+
},
|
|
191
|
+
})
|
|
192
|
+
const inheritColor = css({
|
|
193
|
+
_groupFocus: {
|
|
194
|
+
color: '[inherit!]',
|
|
195
|
+
transition: 'none',
|
|
196
|
+
},
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
function FoundedView(
|
|
200
|
+
{ view, highlight, ...props }: FoundedViewProps & Omit<ComponentPropsWithoutRef<'button'>, keyof FoundedViewProps>,
|
|
201
|
+
) {
|
|
202
|
+
const folder = view.folder
|
|
203
|
+
|
|
204
|
+
const viewIcon = ViewTypeIcon[view.id === 'index' ? 'index' : view._type]
|
|
205
|
+
const viewLabel = (
|
|
206
|
+
<Highlight
|
|
207
|
+
key={view.id}
|
|
208
|
+
component={'div'}
|
|
209
|
+
className={cx(
|
|
210
|
+
inheritColor,
|
|
211
|
+
breadcrumbTitle({ truncate: true }),
|
|
212
|
+
css({
|
|
213
|
+
'& > mark': {
|
|
214
|
+
backgroundColor: {
|
|
215
|
+
base: 'mantine.colors.yellow[2]/90',
|
|
216
|
+
_dark: 'mantine.colors.yellow[5]/80',
|
|
217
|
+
_groupFocus: '[transparent]',
|
|
218
|
+
},
|
|
219
|
+
color: {
|
|
220
|
+
_groupFocus: '[inherit!]',
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
}),
|
|
224
|
+
)}
|
|
225
|
+
maw={350}
|
|
226
|
+
highlight={highlight}
|
|
227
|
+
>
|
|
228
|
+
{view.title ?? view.id}
|
|
229
|
+
</Highlight>
|
|
230
|
+
)
|
|
231
|
+
const className = cx(
|
|
232
|
+
props.className,
|
|
233
|
+
'group',
|
|
234
|
+
foundedViewClass,
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
if (folder.isRoot) {
|
|
238
|
+
return (
|
|
239
|
+
<UnstyledButton
|
|
240
|
+
{...props}
|
|
241
|
+
className={className}
|
|
242
|
+
>
|
|
243
|
+
{viewIcon}
|
|
244
|
+
{viewLabel}
|
|
245
|
+
</UnstyledButton>
|
|
246
|
+
)
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const breadcrumbs = folder.breadcrumbs.map(b => (
|
|
250
|
+
<Highlight
|
|
251
|
+
key={b.path}
|
|
252
|
+
component={'div'}
|
|
253
|
+
className={cx(
|
|
254
|
+
css({
|
|
255
|
+
_groupHover: {
|
|
256
|
+
color: 'mantine.colors.dimmed',
|
|
257
|
+
},
|
|
258
|
+
}),
|
|
259
|
+
inheritColor,
|
|
260
|
+
breadcrumbTitle({ dimmed: true, truncate: true }),
|
|
261
|
+
)}
|
|
262
|
+
maw={170}
|
|
263
|
+
highlight={isArray(highlight) ? highlight : []}
|
|
264
|
+
>
|
|
265
|
+
{b.title}
|
|
266
|
+
</Highlight>
|
|
267
|
+
))
|
|
268
|
+
breadcrumbs.push(
|
|
269
|
+
<HStack gap="[4px]">
|
|
270
|
+
{viewIcon}
|
|
271
|
+
{viewLabel}
|
|
272
|
+
</HStack>,
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
return (
|
|
276
|
+
<UnstyledButton
|
|
277
|
+
{...props}
|
|
278
|
+
className={className}
|
|
279
|
+
>
|
|
280
|
+
{folderIcon}
|
|
281
|
+
<Breadcrumbs separator={<IconChevronRight size={12} stroke={1.5} />} separatorMargin={3}>
|
|
282
|
+
{breadcrumbs}
|
|
283
|
+
</Breadcrumbs>
|
|
284
|
+
</UnstyledButton>
|
|
285
|
+
)
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const btnRightSection = <IconChevronRight size={12} stroke={1.5} className="mantine-rotate-rtl" />
|
|
289
|
+
const folderIcon = (
|
|
290
|
+
<IconFolderFilled
|
|
291
|
+
size={16}
|
|
292
|
+
// stroke={1.5}
|
|
293
|
+
className={css({
|
|
294
|
+
opacity: {
|
|
295
|
+
base: 0.3,
|
|
296
|
+
_groupHover: 0.5,
|
|
297
|
+
_groupActive: 0.5,
|
|
298
|
+
_groupFocus: 0.5,
|
|
299
|
+
},
|
|
300
|
+
})} />
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
const viewTypeIconCss = css({
|
|
304
|
+
opacity: {
|
|
305
|
+
base: 0.3,
|
|
306
|
+
_dark: 0.5,
|
|
307
|
+
_groupHover: 0.8,
|
|
308
|
+
_groupActive: 0.8,
|
|
309
|
+
_groupFocus: 0.8,
|
|
310
|
+
},
|
|
311
|
+
})
|
|
312
|
+
const ViewTypeIcon = {
|
|
313
|
+
index: <IconStarFilled size={16} className={viewTypeIconCss} />,
|
|
314
|
+
element: (
|
|
315
|
+
<IconZoomScan
|
|
316
|
+
size={18}
|
|
317
|
+
stroke={2}
|
|
318
|
+
className={viewTypeIconCss} />
|
|
319
|
+
),
|
|
320
|
+
deployment: <IconStack2 size={16} stroke={1.5} className={viewTypeIconCss} />,
|
|
321
|
+
dynamic: <IconStack2 size={16} stroke={1.5} className={viewTypeIconCss} />,
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
const ColumnScrollArea = ScrollAreaAutosize.withProps({
|
|
325
|
+
scrollbars: 'y',
|
|
326
|
+
className: css({
|
|
327
|
+
maxHeight: [
|
|
328
|
+
'calc(100vh - 160px)',
|
|
329
|
+
'calc(100cqh - 160px)',
|
|
330
|
+
],
|
|
331
|
+
}),
|
|
332
|
+
})
|
|
333
|
+
|
|
334
|
+
type ColumnItem =
|
|
335
|
+
| {
|
|
336
|
+
type: 'folder'
|
|
337
|
+
folderPath: string
|
|
338
|
+
title: string
|
|
339
|
+
selected: boolean
|
|
340
|
+
}
|
|
341
|
+
| {
|
|
342
|
+
type: 'view'
|
|
343
|
+
viewType: 'element' | 'deployment' | 'dynamic' | 'index'
|
|
344
|
+
viewId: ViewId
|
|
345
|
+
title: string
|
|
346
|
+
description: string | null
|
|
347
|
+
selected: boolean
|
|
348
|
+
}
|
|
349
|
+
type FolderColumnData = {
|
|
350
|
+
folderPath: string
|
|
351
|
+
items: Array<ColumnItem>
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function folderColumn(
|
|
355
|
+
folder: LikeC4ViewsFolder,
|
|
356
|
+
context: Pick<NavigationPanelActorContext, 'selectedFolder' | 'viewModel'>,
|
|
357
|
+
): FolderColumnData {
|
|
358
|
+
return {
|
|
359
|
+
folderPath: folder.path,
|
|
360
|
+
items: [
|
|
361
|
+
...folder.folders.map(s => ({
|
|
362
|
+
type: 'folder' as const,
|
|
363
|
+
folderPath: s.path,
|
|
364
|
+
title: s.title,
|
|
365
|
+
selected: context.selectedFolder.startsWith(s.path),
|
|
366
|
+
})),
|
|
367
|
+
...folder.views.map(s => ({
|
|
368
|
+
type: 'view' as const,
|
|
369
|
+
viewType: s.id === 'index' ? 'index' as const : s._type,
|
|
370
|
+
viewId: s.id,
|
|
371
|
+
title: s.title ?? s.id,
|
|
372
|
+
description: s.description.nonEmpty && s.description.text || null,
|
|
373
|
+
selected: s.id === context.viewModel.id,
|
|
374
|
+
})),
|
|
375
|
+
],
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
const selectColumns = (context: NavigationPanelActorContext): FolderColumnData[] => {
|
|
380
|
+
const viewModel = context.viewModel
|
|
381
|
+
const likec4model = viewModel.$model
|
|
382
|
+
const columns = [
|
|
383
|
+
folderColumn(likec4model.rootViewFolder, context),
|
|
384
|
+
]
|
|
385
|
+
const folder = likec4model.viewFolder(context.selectedFolder)
|
|
386
|
+
if (!folder.isRoot) {
|
|
387
|
+
for (const b of folder.breadcrumbs) {
|
|
388
|
+
columns.push(folderColumn(b, context))
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return columns
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function FolderColumns() {
|
|
395
|
+
const columns = useNavigationActorContext(selectColumns, deepEqual)
|
|
396
|
+
return (
|
|
397
|
+
<HStack gap="xs" alignItems="stretch">
|
|
398
|
+
{columns.flatMap((column, i) => [
|
|
399
|
+
i > 0 && <Divider orientation="vertical" key={'divider' + i} />,
|
|
400
|
+
<FolderColumn key={column.folderPath} data={column} />,
|
|
401
|
+
])}
|
|
402
|
+
</HStack>
|
|
403
|
+
)
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
function FolderColumn({ data }: { data: FolderColumnData }) {
|
|
407
|
+
const actor = useNavigationActorRef()
|
|
408
|
+
|
|
409
|
+
const onItemClicked = (item: ColumnItem) => (e: React.MouseEvent) => {
|
|
410
|
+
e.stopPropagation()
|
|
411
|
+
if (item.type === 'folder') {
|
|
412
|
+
actor.send({ type: 'select.folder', folderPath: item.folderPath })
|
|
413
|
+
} else {
|
|
414
|
+
actor.send({ type: 'select.view', viewId: item.viewId })
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
return (
|
|
419
|
+
<Box mb={'1'}>
|
|
420
|
+
<ColumnScrollArea>
|
|
421
|
+
<VStack gap="[1px]">
|
|
422
|
+
{data.items.map((item, i) => (
|
|
423
|
+
<FolderColumnItem
|
|
424
|
+
key={`${data.folderPath}/${item.type}/${i}`}
|
|
425
|
+
columnItem={item}
|
|
426
|
+
onClick={onItemClicked(item)}
|
|
427
|
+
/>
|
|
428
|
+
))}
|
|
429
|
+
</VStack>
|
|
430
|
+
</ColumnScrollArea>
|
|
431
|
+
</Box>
|
|
432
|
+
)
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
function FolderColumnItem({ columnItem, ...props }: { columnItem: ColumnItem } & NavigationLinkProps) {
|
|
436
|
+
switch (columnItem.type) {
|
|
437
|
+
case 'folder':
|
|
438
|
+
return (
|
|
439
|
+
<NavigationLink
|
|
440
|
+
key={columnItem.folderPath}
|
|
441
|
+
variant="light"
|
|
442
|
+
active={columnItem.selected}
|
|
443
|
+
label={columnItem.title}
|
|
444
|
+
leftSection={folderIcon}
|
|
445
|
+
rightSection={btnRightSection}
|
|
446
|
+
maw="300px"
|
|
447
|
+
miw="200px"
|
|
448
|
+
{...props}
|
|
449
|
+
/>
|
|
450
|
+
)
|
|
451
|
+
case 'view':
|
|
452
|
+
return (
|
|
453
|
+
<NavigationLink
|
|
454
|
+
key={columnItem.viewId}
|
|
455
|
+
variant="filled"
|
|
456
|
+
active={columnItem.selected}
|
|
457
|
+
label={columnItem.title}
|
|
458
|
+
description={columnItem.description}
|
|
459
|
+
leftSection={ViewTypeIcon[columnItem.viewType]}
|
|
460
|
+
maw="300px"
|
|
461
|
+
miw="200px"
|
|
462
|
+
{...props}
|
|
463
|
+
/>
|
|
464
|
+
)
|
|
465
|
+
default:
|
|
466
|
+
nonexhaustive(columnItem)
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function SearchInput({ onKeyDown, ...props }: {
|
|
471
|
+
value?: string
|
|
472
|
+
defaultValue?: string
|
|
473
|
+
onChange?: (value: string) => void
|
|
474
|
+
onKeyDown?: KeyboardEventHandler<HTMLElement>
|
|
475
|
+
}) {
|
|
476
|
+
const [_value, handleChange] = useUncontrolled({
|
|
477
|
+
...props,
|
|
478
|
+
finalValue: '',
|
|
479
|
+
})
|
|
480
|
+
return (
|
|
481
|
+
<Input
|
|
482
|
+
size="xs"
|
|
483
|
+
placeholder="Search by title or id"
|
|
484
|
+
variant="unstyled"
|
|
485
|
+
height={rem(26)}
|
|
486
|
+
value={_value}
|
|
487
|
+
onKeyDown={onKeyDown}
|
|
488
|
+
onChange={e => handleChange(e.currentTarget.value)}
|
|
489
|
+
classNames={{
|
|
490
|
+
wrapper: css({
|
|
491
|
+
flexGrow: 1,
|
|
492
|
+
backgroundColor: {
|
|
493
|
+
base: 'mantine.colors.gray[1]',
|
|
494
|
+
_dark: 'mantine.colors.dark[5]/80',
|
|
495
|
+
_hover: {
|
|
496
|
+
base: 'mantine.colors.gray[2]',
|
|
497
|
+
_dark: 'mantine.colors.dark[4]',
|
|
498
|
+
},
|
|
499
|
+
_focus: {
|
|
500
|
+
base: 'mantine.colors.gray[2]',
|
|
501
|
+
_dark: 'mantine.colors.dark[4]',
|
|
502
|
+
},
|
|
503
|
+
},
|
|
504
|
+
rounded: 'sm',
|
|
505
|
+
}),
|
|
506
|
+
input: css({
|
|
507
|
+
_placeholder: {
|
|
508
|
+
color: 'mantine.colors.dimmed',
|
|
509
|
+
},
|
|
510
|
+
_focus: {
|
|
511
|
+
outline: 'none',
|
|
512
|
+
},
|
|
513
|
+
}),
|
|
514
|
+
}}
|
|
515
|
+
style={{
|
|
516
|
+
['--input-fz']: 'var(--mantine-font-size-sm)',
|
|
517
|
+
}}
|
|
518
|
+
leftSection={<IconSearch size={14} />}
|
|
519
|
+
rightSectionPointerEvents="all"
|
|
520
|
+
rightSectionWidth={'min-content'}
|
|
521
|
+
rightSection={!props.value || isEmpty(props.value)
|
|
522
|
+
? null
|
|
523
|
+
: (
|
|
524
|
+
<Button
|
|
525
|
+
variant="subtle"
|
|
526
|
+
h="100%"
|
|
527
|
+
size={'compact-xs'}
|
|
528
|
+
color="gray"
|
|
529
|
+
onClick={(e) => {
|
|
530
|
+
e.stopPropagation()
|
|
531
|
+
handleChange('')
|
|
532
|
+
}}
|
|
533
|
+
>
|
|
534
|
+
clear
|
|
535
|
+
</Button>
|
|
536
|
+
)}
|
|
537
|
+
/>
|
|
538
|
+
)
|
|
539
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { css, cx } from '@likec4/styles/css'
|
|
2
|
+
import {
|
|
3
|
+
type NavigationPanelActionIconVariant,
|
|
4
|
+
navigationPanelActionIcon,
|
|
5
|
+
} from '@likec4/styles/recipes'
|
|
6
|
+
import {
|
|
7
|
+
type ActionIconProps,
|
|
8
|
+
ActionIcon,
|
|
9
|
+
Breadcrumbs as MantineBreadcrumbs,
|
|
10
|
+
ThemeIcon,
|
|
11
|
+
Tooltip as MantineTooltip,
|
|
12
|
+
} from '@mantine/core'
|
|
13
|
+
import { IconChevronRight } from '@tabler/icons-react'
|
|
14
|
+
import type { HTMLMotionProps } from 'motion/react'
|
|
15
|
+
import * as m from 'motion/react-m'
|
|
16
|
+
import { forwardRef } from 'react'
|
|
17
|
+
|
|
18
|
+
export const Tooltip = MantineTooltip.withProps({
|
|
19
|
+
color: 'dark',
|
|
20
|
+
fz: 'xs',
|
|
21
|
+
openDelay: 600,
|
|
22
|
+
closeDelay: 120,
|
|
23
|
+
label: '',
|
|
24
|
+
children: null,
|
|
25
|
+
offset: 8,
|
|
26
|
+
withinPortal: false,
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
export const BreadcrumbsSeparator = () => (
|
|
30
|
+
<ThemeIcon
|
|
31
|
+
variant="transparent"
|
|
32
|
+
size={16}
|
|
33
|
+
className={css({
|
|
34
|
+
display: {
|
|
35
|
+
base: 'none',
|
|
36
|
+
'@/md': 'flex',
|
|
37
|
+
},
|
|
38
|
+
color: {
|
|
39
|
+
base: 'mantine.colors.gray[5]',
|
|
40
|
+
_dark: 'mantine.colors.dark[3]',
|
|
41
|
+
},
|
|
42
|
+
})}>
|
|
43
|
+
<IconChevronRight />
|
|
44
|
+
</ThemeIcon>
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
export const Breadcrumbs = MantineBreadcrumbs.withProps({
|
|
48
|
+
separator: <BreadcrumbsSeparator />,
|
|
49
|
+
separatorMargin: 4,
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
export type PanelActionIconProps =
|
|
53
|
+
& Partial<NavigationPanelActionIconVariant>
|
|
54
|
+
& Omit<ActionIconProps, keyof NavigationPanelActionIconVariant>
|
|
55
|
+
& HTMLMotionProps<'button'>
|
|
56
|
+
|
|
57
|
+
export const PanelActionIcon = forwardRef<HTMLButtonElement, PanelActionIconProps>(({
|
|
58
|
+
variant = 'default',
|
|
59
|
+
className,
|
|
60
|
+
disabled = false,
|
|
61
|
+
...others
|
|
62
|
+
}, ref) => (
|
|
63
|
+
<ActionIcon
|
|
64
|
+
size="md"
|
|
65
|
+
variant="transparent"
|
|
66
|
+
radius="sm"
|
|
67
|
+
component={m.button}
|
|
68
|
+
{...!disabled && {
|
|
69
|
+
whileHover: {
|
|
70
|
+
scale: 1.085,
|
|
71
|
+
},
|
|
72
|
+
whileTap: {
|
|
73
|
+
scale: 1,
|
|
74
|
+
translateY: 1,
|
|
75
|
+
},
|
|
76
|
+
}}
|
|
77
|
+
disabled={disabled}
|
|
78
|
+
{...others}
|
|
79
|
+
className={cx(
|
|
80
|
+
className,
|
|
81
|
+
navigationPanelActionIcon({ variant }),
|
|
82
|
+
)}
|
|
83
|
+
ref={ref} />
|
|
84
|
+
))
|