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