@likec4/diagram 1.34.2 → 1.35.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-C0Eg81Gj.js} +971 -1045
- package/bundle/custom.js +59 -55
- package/bundle/index.js +6656 -4263
- package/dist/LikeC4Diagram.props.d.ts +51 -4
- package/dist/LikeC4ModelProvider.d.ts +3 -3
- package/dist/base/BaseXYFlow.d.ts +2 -2
- package/dist/base/BaseXYFlow.js +3 -3
- package/dist/base/primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base/primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base/primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base/primitives/element/ElementDetailsButton.js +1 -1
- package/dist/base/primitives/element/ElementNodeContainer.d.ts +3 -3
- package/dist/base/primitives/element/ElementTitle.js +9 -9
- package/dist/bundle/LikeC4View.js +3 -3
- package/dist/bundle/LikeC4View.props.d.ts +8 -4
- package/dist/bundle/custom.js +1 -0
- package/dist/bundle/index.js +1 -0
- package/dist/components/ErrorFallback.d.ts +2 -1
- package/dist/components/ErrorFallback.js +15 -2
- package/dist/components/Link.js +2 -2
- package/dist/components/NavigationLink.d.ts +6 -0
- package/dist/components/NavigationLink.js +25 -0
- package/dist/components/SearchControl.js +1 -1
- package/dist/context/ControlsCustomLayout.d.ts +0 -1
- 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/hooks/useDiagram.d.ts +1 -2
- package/dist/hooks/useDiagram.js +1 -5
- package/dist/index.js +1 -0
- package/dist/likec4diagram/DiagramUI.js +8 -4
- package/dist/likec4diagram/DiagramXYFlow.js +1 -1
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +4 -4
- package/dist/likec4diagram/custom/nodes/ElementActions.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/diagram-title/DiagramTitlePanel.js +15 -13
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- 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/index.d.ts +1 -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/navigationpanel/NavigationPanel.d.ts +2 -0
- package/dist/navigationpanel/NavigationPanel.js +124 -0
- package/dist/navigationpanel/NavigationPanelControls.d.ts +1 -0
- package/dist/navigationpanel/NavigationPanelControls.js +134 -0
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +1 -0
- package/dist/navigationpanel/NavigationPanelDropdown.js +436 -0
- package/dist/navigationpanel/_common.d.ts +15 -0
- package/dist/navigationpanel/_common.js +69 -0
- package/dist/navigationpanel/actor.d.ts +300 -0
- package/dist/navigationpanel/actor.js +240 -0
- package/dist/navigationpanel/controls/BurgerButton.d.ts +1 -0
- package/dist/navigationpanel/controls/BurgerButton.js +36 -0
- package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -0
- package/dist/navigationpanel/controls/NavigationButtons.js +44 -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 +68 -0
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -0
- package/dist/navigationpanel/controls/ToggleReadonly.js +69 -0
- package/dist/navigationpanel/controls/index.d.ts +5 -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 +174 -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 +32 -0
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.d.ts +2 -0
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +157 -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/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/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.js +4 -4
- package/dist/overlays/element-details/TabPanelDeployments.js +3 -3
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
- 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.js +2 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/search/components/ElementsColumn.js +1 -1
- package/dist/search/components/PickView.js +1 -1
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +2 -2
- package/dist/state/DiagramActorProvider.d.ts +2 -2
- package/dist/state/DiagramActorProvider.js +48 -10
- package/dist/state/diagram-machine.d.ts +2 -2
- package/dist/styles-min.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css2.js +1 -1
- package/package.json +16 -15
- package/panda.buildinfo.json +170 -134
- package/src/LikeC4Diagram.props.ts +51 -3
- package/src/LikeC4ModelProvider.tsx +3 -3
- package/src/base/BaseXYFlow.tsx +4 -4
- package/src/base/primitives/element/ElementNodeContainer.tsx +2 -2
- package/src/base/primitives/element/ElementTitle.tsx +4 -4
- package/src/bundle/LikeC4View.props.ts +14 -4
- package/src/bundle/LikeC4View.tsx +2 -2
- package/src/components/ErrorFallback.tsx +16 -1
- package/src/components/NavigationLink.tsx +31 -0
- package/src/context/ControlsCustomLayout.ts +0 -1
- package/src/context/DiagramFeatures.tsx +6 -1
- package/src/custom/customNodes.tsx +10 -2
- package/src/custom/hooks.ts +3 -0
- package/src/hooks/useDiagram.ts +0 -8
- package/src/likec4diagram/DiagramUI.tsx +9 -3
- package/src/likec4diagram/DiagramXYFlow.tsx +1 -1
- package/src/likec4diagram/ui/controls/Controls.tsx +8 -18
- package/src/likec4diagram/ui/controls/NavigationButtons.tsx +2 -0
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +14 -11
- package/src/likec4model/LikeC4ModelContext.ts +5 -1
- package/src/likec4model/index.ts +3 -0
- package/src/likec4model/useCurrentViewModel.ts +10 -0
- package/src/likec4model/useLikeC4Model.ts +17 -27
- package/src/navigationpanel/NavigationPanel.tsx +136 -0
- package/src/navigationpanel/NavigationPanelControls.tsx +155 -0
- package/src/navigationpanel/NavigationPanelDropdown.tsx +523 -0
- package/src/navigationpanel/_common.tsx +81 -0
- package/src/navigationpanel/actor.ts +321 -0
- package/src/navigationpanel/controls/BurgerButton.tsx +32 -0
- package/src/navigationpanel/controls/NavigationButtons.tsx +36 -0
- package/src/navigationpanel/controls/OpenSource.tsx +28 -0
- package/src/navigationpanel/controls/SearchControl.tsx +64 -0
- package/src/navigationpanel/controls/ToggleReadonly.tsx +66 -0
- package/src/navigationpanel/controls/index.ts +5 -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 +151 -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 +30 -0
- package/src/navigationpanel/walkthrough/ActiveWalkthroughControls.tsx +160 -0
- package/src/navigationpanel/walkthrough/index.tsx +1 -0
- package/src/state/DiagramActorProvider.tsx +60 -12
- package/src/state/diagram-machine.ts +2 -2
- 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/src/base/primitives/element/ElementTitle.css.ts +0 -206
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { ViewId } from '@likec4/core/types'
|
|
2
|
+
import { isEmpty } from 'remeda'
|
|
3
|
+
import {
|
|
4
|
+
type ActorLogicFrom,
|
|
5
|
+
type ActorRefFrom,
|
|
6
|
+
type SnapshotFrom,
|
|
7
|
+
assertEvent,
|
|
8
|
+
assign,
|
|
9
|
+
emit,
|
|
10
|
+
raise,
|
|
11
|
+
setup,
|
|
12
|
+
} from 'xstate'
|
|
13
|
+
import type { CurrentViewModel } from '../likec4model/LikeC4ModelContext'
|
|
14
|
+
|
|
15
|
+
export interface NavigationPanelActorInput {
|
|
16
|
+
viewModel: CurrentViewModel
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type NavigationPanelActorEvent =
|
|
20
|
+
// Logic events
|
|
21
|
+
| { type: 'update.inputs'; inputs: NavigationPanelActorInput }
|
|
22
|
+
| { type: 'searchQuery.change'; value: string }
|
|
23
|
+
| { type: 'searchQuery.changed' }
|
|
24
|
+
| { type: 'select.folder'; folderPath: string }
|
|
25
|
+
| { type: 'select.view'; viewId: ViewId }
|
|
26
|
+
// Events from the UI
|
|
27
|
+
// - From breadcrumbs
|
|
28
|
+
| { type: 'breadcrumbs.mouseLeave' }
|
|
29
|
+
| { type: 'breadcrumbs.mouseEnter.root' }
|
|
30
|
+
| { type: 'breadcrumbs.mouseLeave.root' }
|
|
31
|
+
| { type: 'breadcrumbs.mouseEnter.folder'; folderPath: string }
|
|
32
|
+
| { type: 'breadcrumbs.mouseLeave.folder'; folderPath: string }
|
|
33
|
+
| { type: 'breadcrumbs.mouseEnter.viewtitle' }
|
|
34
|
+
| { type: 'breadcrumbs.mouseLeave.viewtitle' }
|
|
35
|
+
| { type: 'breadcrumbs.click.root' }
|
|
36
|
+
| { type: 'breadcrumbs.click.folder'; folderPath: string }
|
|
37
|
+
| { type: 'breadcrumbs.click.viewtitle' }
|
|
38
|
+
// - From dropdown
|
|
39
|
+
| { type: 'dropdown.mouseEnter' }
|
|
40
|
+
| { type: 'dropdown.mouseLeave' }
|
|
41
|
+
| { type: 'dropdown.dismiss' }
|
|
42
|
+
|
|
43
|
+
export type NavigationPanelActorEmitted = { type: 'trigger.navigateTo'; viewId: ViewId }
|
|
44
|
+
|
|
45
|
+
export type BreadcrumbItem =
|
|
46
|
+
| { type: 'folder'; folderPath: string; title: string }
|
|
47
|
+
| { type: 'viewtitle'; title: string }
|
|
48
|
+
|
|
49
|
+
export type DropdownColumnItem =
|
|
50
|
+
| {
|
|
51
|
+
type: 'folder'
|
|
52
|
+
folderPath: string
|
|
53
|
+
title: string
|
|
54
|
+
selected: boolean
|
|
55
|
+
}
|
|
56
|
+
| {
|
|
57
|
+
type: 'view'
|
|
58
|
+
viewType: 'element' | 'deployment' | 'dynamic' | 'index'
|
|
59
|
+
viewId: string
|
|
60
|
+
title: string
|
|
61
|
+
description: string | null
|
|
62
|
+
selected: boolean
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface NavigationPanelActorContext {
|
|
66
|
+
viewModel: CurrentViewModel
|
|
67
|
+
/**
|
|
68
|
+
* Who activated the dropdown
|
|
69
|
+
* (if `click` then the dropdown is always open until dismissed)
|
|
70
|
+
* @default 'hover'
|
|
71
|
+
*/
|
|
72
|
+
activatedBy: 'hover' | 'click'
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The folder that is currently selected in the dropdown
|
|
76
|
+
* By default it is the root
|
|
77
|
+
*/
|
|
78
|
+
selectedFolder: string
|
|
79
|
+
|
|
80
|
+
searchQuery: string
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const _actorLogic = setup({
|
|
84
|
+
types: {
|
|
85
|
+
context: {} as NavigationPanelActorContext,
|
|
86
|
+
events: {} as NavigationPanelActorEvent,
|
|
87
|
+
tags: 'active',
|
|
88
|
+
input: {} as NavigationPanelActorInput,
|
|
89
|
+
emitted: {} as NavigationPanelActorEmitted,
|
|
90
|
+
},
|
|
91
|
+
delays: {
|
|
92
|
+
'open timeout': 500,
|
|
93
|
+
'close timeout': 350,
|
|
94
|
+
},
|
|
95
|
+
actions: {
|
|
96
|
+
'update activatedBy': assign({
|
|
97
|
+
activatedBy: ({ context, event }) => {
|
|
98
|
+
switch (true) {
|
|
99
|
+
case event.type.includes('click'):
|
|
100
|
+
return 'click'
|
|
101
|
+
case event.type.includes('mouseEnter'):
|
|
102
|
+
return 'hover'
|
|
103
|
+
default:
|
|
104
|
+
return context.activatedBy
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
}),
|
|
108
|
+
'keep dropdown open': assign({
|
|
109
|
+
activatedBy: 'click',
|
|
110
|
+
}),
|
|
111
|
+
'update selected folder': assign(({ event }) => {
|
|
112
|
+
assertEvent(event, ['breadcrumbs.click.folder', 'select.folder'])
|
|
113
|
+
return { selectedFolder: event.folderPath }
|
|
114
|
+
}),
|
|
115
|
+
'reset selected folder': assign({
|
|
116
|
+
selectedFolder: ({ context }) => context.viewModel.folder.path,
|
|
117
|
+
}),
|
|
118
|
+
'update inputs': assign(({ context, event }) => {
|
|
119
|
+
assertEvent(event, 'update.inputs')
|
|
120
|
+
const viewChanged = event.inputs.viewModel.id !== context.viewModel.id
|
|
121
|
+
let selectedFolder = context.selectedFolder
|
|
122
|
+
if (!event.inputs.viewModel.folder.path.startsWith(selectedFolder)) {
|
|
123
|
+
selectedFolder = event.inputs.viewModel.folder.path
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
viewModel: event.inputs.viewModel,
|
|
127
|
+
selectedFolder,
|
|
128
|
+
// allow dropdown to close on mouse leave if view changed
|
|
129
|
+
activatedBy: viewChanged ? 'hover' : context.activatedBy,
|
|
130
|
+
}
|
|
131
|
+
}),
|
|
132
|
+
'reset search query': assign({
|
|
133
|
+
searchQuery: '',
|
|
134
|
+
}),
|
|
135
|
+
'update search query': assign(({ event }) => {
|
|
136
|
+
assertEvent(event, 'searchQuery.change')
|
|
137
|
+
return { searchQuery: event.value ?? '' }
|
|
138
|
+
}),
|
|
139
|
+
'emit trigger.navigateTo': emit(({ event }) => {
|
|
140
|
+
assertEvent(event, 'select.view')
|
|
141
|
+
return {
|
|
142
|
+
type: 'trigger.navigateTo' as const,
|
|
143
|
+
viewId: ViewId(event.viewId),
|
|
144
|
+
}
|
|
145
|
+
}),
|
|
146
|
+
},
|
|
147
|
+
guards: {
|
|
148
|
+
'was opened on hover': ({ context }) => context.activatedBy === 'hover',
|
|
149
|
+
'has search query': ({ context }) => !isEmpty(context.searchQuery),
|
|
150
|
+
'search query is empty': ({ context }) => isEmpty(context.searchQuery),
|
|
151
|
+
},
|
|
152
|
+
}).createMachine({
|
|
153
|
+
id: 'breadcrumbs',
|
|
154
|
+
context: ({ input }) => ({
|
|
155
|
+
...input,
|
|
156
|
+
breadcrumbs: [],
|
|
157
|
+
activatedBy: 'hover',
|
|
158
|
+
selectedFolder: '',
|
|
159
|
+
searchQuery: '',
|
|
160
|
+
folderColumns: [],
|
|
161
|
+
}),
|
|
162
|
+
initial: 'idle',
|
|
163
|
+
entry: [
|
|
164
|
+
'update activatedBy',
|
|
165
|
+
'reset selected folder',
|
|
166
|
+
],
|
|
167
|
+
on: {
|
|
168
|
+
'update.inputs': {
|
|
169
|
+
actions: 'update inputs',
|
|
170
|
+
},
|
|
171
|
+
'searchQuery.change': {
|
|
172
|
+
actions: [
|
|
173
|
+
'update search query',
|
|
174
|
+
raise({ type: 'searchQuery.changed' }),
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
states: {
|
|
179
|
+
idle: {
|
|
180
|
+
id: 'idle',
|
|
181
|
+
on: {
|
|
182
|
+
'breadcrumbs.mouseEnter.*': {
|
|
183
|
+
target: 'pending',
|
|
184
|
+
actions: 'update activatedBy',
|
|
185
|
+
},
|
|
186
|
+
'breadcrumbs.click.*': {
|
|
187
|
+
target: 'active',
|
|
188
|
+
actions: 'update activatedBy',
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
// Breadcrumbs are hovered, but dropdown is not opened yet
|
|
193
|
+
pending: {
|
|
194
|
+
on: {
|
|
195
|
+
'breadcrumbs.mouseEnter.*': {
|
|
196
|
+
actions: 'update activatedBy',
|
|
197
|
+
},
|
|
198
|
+
'breadcrumbs.mouseLeave.*': {
|
|
199
|
+
target: 'idle',
|
|
200
|
+
},
|
|
201
|
+
'breadcrumbs.click.*': {
|
|
202
|
+
target: 'active',
|
|
203
|
+
actions: 'update activatedBy',
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
after: {
|
|
207
|
+
'open timeout': {
|
|
208
|
+
target: 'active',
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
active: {
|
|
213
|
+
tags: ['active'],
|
|
214
|
+
initial: 'decide',
|
|
215
|
+
on: {
|
|
216
|
+
'dropdown.dismiss': {
|
|
217
|
+
target: '#idle',
|
|
218
|
+
},
|
|
219
|
+
'breadcrumbs.mouseLeave': {
|
|
220
|
+
guard: 'was opened on hover',
|
|
221
|
+
target: '.closing',
|
|
222
|
+
},
|
|
223
|
+
'dropdown.mouseLeave': {
|
|
224
|
+
guard: 'was opened on hover',
|
|
225
|
+
target: '.closing',
|
|
226
|
+
},
|
|
227
|
+
'searchQuery.changed': {
|
|
228
|
+
target: '.decide',
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
states: {
|
|
232
|
+
// Decide next state based on the search query
|
|
233
|
+
decide: {
|
|
234
|
+
always: [
|
|
235
|
+
{
|
|
236
|
+
guard: 'has search query',
|
|
237
|
+
target: 'search',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
target: 'opened',
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
},
|
|
244
|
+
opened: {
|
|
245
|
+
on: {
|
|
246
|
+
'searchQuery.changed': {
|
|
247
|
+
guard: 'has search query',
|
|
248
|
+
actions: 'keep dropdown open',
|
|
249
|
+
target: 'search',
|
|
250
|
+
},
|
|
251
|
+
'breadcrumbs.click.folder': {
|
|
252
|
+
actions: 'update selected folder',
|
|
253
|
+
target: 'opened',
|
|
254
|
+
reenter: true,
|
|
255
|
+
},
|
|
256
|
+
'breadcrumbs.click.viewtitle': {
|
|
257
|
+
actions: 'reset selected folder',
|
|
258
|
+
reenter: true,
|
|
259
|
+
target: 'opened',
|
|
260
|
+
},
|
|
261
|
+
'select.folder': {
|
|
262
|
+
actions: [
|
|
263
|
+
'keep dropdown open',
|
|
264
|
+
'update selected folder',
|
|
265
|
+
],
|
|
266
|
+
},
|
|
267
|
+
'select.view': {
|
|
268
|
+
actions: [
|
|
269
|
+
'emit trigger.navigateTo',
|
|
270
|
+
],
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
search: {
|
|
275
|
+
on: {
|
|
276
|
+
'breadcrumbs.click.folder': {
|
|
277
|
+
actions: [
|
|
278
|
+
'reset search query',
|
|
279
|
+
'update selected folder',
|
|
280
|
+
],
|
|
281
|
+
target: 'opened',
|
|
282
|
+
},
|
|
283
|
+
'breadcrumbs.click.*': {
|
|
284
|
+
actions: [
|
|
285
|
+
'reset search query',
|
|
286
|
+
'reset selected folder',
|
|
287
|
+
],
|
|
288
|
+
target: 'opened',
|
|
289
|
+
},
|
|
290
|
+
'select.view': {
|
|
291
|
+
actions: [
|
|
292
|
+
'emit trigger.navigateTo',
|
|
293
|
+
],
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
closing: {
|
|
298
|
+
on: {
|
|
299
|
+
'breadcrumbs.mouseEnter.*': {
|
|
300
|
+
target: 'decide',
|
|
301
|
+
},
|
|
302
|
+
'dropdown.mouseEnter': {
|
|
303
|
+
target: 'decide',
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
after: {
|
|
307
|
+
'close timeout': {
|
|
308
|
+
target: '#idle',
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
})
|
|
316
|
+
|
|
317
|
+
export interface NavigationPanelActorLogic extends ActorLogicFrom<typeof _actorLogic> {}
|
|
318
|
+
export const navigationPanelActorLogic: NavigationPanelActorLogic = _actorLogic
|
|
319
|
+
|
|
320
|
+
export type NavigationPanelActorSnapshot = SnapshotFrom<NavigationPanelActorLogic>
|
|
321
|
+
export interface NavigationPanelActorRef extends ActorRefFrom<NavigationPanelActorLogic> {}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IconMenu2 } from '@tabler/icons-react'
|
|
2
|
+
import { useDiagramEventHandlers } from '../../context'
|
|
3
|
+
import { PanelActionIcon } from '../_common'
|
|
4
|
+
import { useNavigationActorRef } from '../hooks'
|
|
5
|
+
|
|
6
|
+
export const BurgerButton = () => {
|
|
7
|
+
const actor = useNavigationActorRef()
|
|
8
|
+
const { onBurgerMenuClick } = useDiagramEventHandlers()
|
|
9
|
+
return (
|
|
10
|
+
<PanelActionIcon
|
|
11
|
+
layout="position"
|
|
12
|
+
onMouseEnter={() => {
|
|
13
|
+
actor.send({ type: 'breadcrumbs.mouseEnter.root' })
|
|
14
|
+
}}
|
|
15
|
+
onMouseLeave={() => {
|
|
16
|
+
actor.send({ type: 'breadcrumbs.mouseLeave.root' })
|
|
17
|
+
}}
|
|
18
|
+
onClick={e => {
|
|
19
|
+
e.stopPropagation()
|
|
20
|
+
if (onBurgerMenuClick) {
|
|
21
|
+
actor.send({ type: 'breadcrumbs.mouseLeave.root' })
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
onBurgerMenuClick()
|
|
24
|
+
}, 100)
|
|
25
|
+
} else {
|
|
26
|
+
actor.send({ type: 'breadcrumbs.click.root' })
|
|
27
|
+
}
|
|
28
|
+
}}
|
|
29
|
+
children={<IconMenu2 style={{ width: '80%', height: '80%' }} />}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { hstack } from '@likec4/styles/patterns'
|
|
2
|
+
import { IconArrowLeft, IconArrowRight } from '@tabler/icons-react'
|
|
3
|
+
import * as m from 'motion/react-m'
|
|
4
|
+
import { useDiagram, useDiagramContext } from '../../hooks/useDiagram'
|
|
5
|
+
import { PanelActionIcon } from '../_common'
|
|
6
|
+
|
|
7
|
+
export const NavigationButtons = () => {
|
|
8
|
+
const diagram = useDiagram()
|
|
9
|
+
const {
|
|
10
|
+
hasStepBack,
|
|
11
|
+
hasStepForward,
|
|
12
|
+
} = useDiagramContext(s => ({
|
|
13
|
+
hasStepBack: s.navigationHistory.currentIndex > 0,
|
|
14
|
+
hasStepForward: s.navigationHistory.currentIndex < s.navigationHistory.history.length - 1,
|
|
15
|
+
}))
|
|
16
|
+
return (
|
|
17
|
+
<m.div layout="position" className={hstack({ gap: 1, mdDown: { display: 'none' } })}>
|
|
18
|
+
<PanelActionIcon
|
|
19
|
+
disabled={!hasStepBack}
|
|
20
|
+
onClick={e => {
|
|
21
|
+
e.stopPropagation()
|
|
22
|
+
diagram.navigate('back')
|
|
23
|
+
}}
|
|
24
|
+
children={<IconArrowLeft size={14} />}
|
|
25
|
+
/>
|
|
26
|
+
<PanelActionIcon
|
|
27
|
+
disabled={!hasStepForward}
|
|
28
|
+
onClick={e => {
|
|
29
|
+
e.stopPropagation()
|
|
30
|
+
diagram.navigate('forward')
|
|
31
|
+
}}
|
|
32
|
+
children={<IconArrowRight size={14} />}
|
|
33
|
+
/>
|
|
34
|
+
</m.div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IconFileSymlink } from '@tabler/icons-react'
|
|
2
|
+
import { useDiagramEventHandlers } from '../../context/DiagramEventHandlers'
|
|
3
|
+
import { useEnabledFeatures } from '../../context/DiagramFeatures'
|
|
4
|
+
import { useCurrentViewId } from '../../hooks/useCurrentViewId'
|
|
5
|
+
import { PanelActionIcon, Tooltip } from '../_common'
|
|
6
|
+
|
|
7
|
+
export const OpenSource = () => {
|
|
8
|
+
const viewId = useCurrentViewId()
|
|
9
|
+
const { enableVscode } = useEnabledFeatures()
|
|
10
|
+
const { onOpenSource } = useDiagramEventHandlers()
|
|
11
|
+
|
|
12
|
+
if (!enableVscode) {
|
|
13
|
+
return null
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Tooltip label="Open View Source">
|
|
18
|
+
<PanelActionIcon
|
|
19
|
+
// variant="filled"
|
|
20
|
+
onClick={e => {
|
|
21
|
+
e.stopPropagation()
|
|
22
|
+
onOpenSource?.({ view: viewId })
|
|
23
|
+
}}
|
|
24
|
+
children={<IconFileSymlink size={12} stroke={1.5} style={{ width: '65%' }} />}
|
|
25
|
+
/>
|
|
26
|
+
</Tooltip>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { cx } from '@likec4/styles/css'
|
|
2
|
+
import { Box } from '@likec4/styles/jsx'
|
|
3
|
+
import { hstack } from '@likec4/styles/patterns'
|
|
4
|
+
import {
|
|
5
|
+
UnstyledButton,
|
|
6
|
+
} from '@mantine/core'
|
|
7
|
+
import {
|
|
8
|
+
IconSearch,
|
|
9
|
+
} from '@tabler/icons-react'
|
|
10
|
+
import { isMacOs } from '@xyflow/system'
|
|
11
|
+
import * as m from 'motion/react-m'
|
|
12
|
+
import { useDiagram } from '../../hooks/useDiagram'
|
|
13
|
+
|
|
14
|
+
export function SearchControl() {
|
|
15
|
+
const diagram = useDiagram()
|
|
16
|
+
const isMac = isMacOs()
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<UnstyledButton
|
|
20
|
+
component={m.button}
|
|
21
|
+
layout="position"
|
|
22
|
+
onClick={e => {
|
|
23
|
+
e.stopPropagation()
|
|
24
|
+
diagram.openSearch()
|
|
25
|
+
}}
|
|
26
|
+
whileTap={{
|
|
27
|
+
translateY: 1,
|
|
28
|
+
}}
|
|
29
|
+
className={cx(
|
|
30
|
+
'group',
|
|
31
|
+
hstack({
|
|
32
|
+
gap: '2xs',
|
|
33
|
+
paddingInline: 'sm',
|
|
34
|
+
paddingBlock: '2xs',
|
|
35
|
+
rounded: 'sm',
|
|
36
|
+
userSelect: 'none',
|
|
37
|
+
cursor: 'pointer',
|
|
38
|
+
color: {
|
|
39
|
+
base: 'likec4.panel.action-icon.text',
|
|
40
|
+
_hover: 'likec4.panel.action-icon.text.hover',
|
|
41
|
+
},
|
|
42
|
+
backgroundColor: {
|
|
43
|
+
base: 'likec4.panel.action-icon.bg',
|
|
44
|
+
_hover: 'likec4.panel.action-icon.bg.hover',
|
|
45
|
+
},
|
|
46
|
+
smDown: {
|
|
47
|
+
display: 'none',
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
)}>
|
|
51
|
+
<IconSearch size={14} stroke={2.5} />
|
|
52
|
+
<Box
|
|
53
|
+
css={{
|
|
54
|
+
fontSize: '11px',
|
|
55
|
+
fontWeight: 600,
|
|
56
|
+
lineHeight: 1,
|
|
57
|
+
opacity: 0.8,
|
|
58
|
+
whiteSpace: 'nowrap',
|
|
59
|
+
}}>
|
|
60
|
+
{isMac ? '⌘ + K' : 'Ctrl + K'}
|
|
61
|
+
</Box>
|
|
62
|
+
</UnstyledButton>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { css, cx } from '@likec4/styles/css'
|
|
2
|
+
import { hstack } from '@likec4/styles/patterns'
|
|
3
|
+
import { UnstyledButton } from '@mantine/core'
|
|
4
|
+
import { IconLock, IconLockOpen2 } from '@tabler/icons-react'
|
|
5
|
+
import * as m from 'motion/react-m'
|
|
6
|
+
import { useDiagram, useDiagramContext } from '../../hooks/useDiagram'
|
|
7
|
+
import type { DiagramContext } from '../../state/types'
|
|
8
|
+
|
|
9
|
+
const selector = (state: DiagramContext) => ({
|
|
10
|
+
visible: state.features.enableReadOnly !== true,
|
|
11
|
+
isReadOnly: state.toggledFeatures.enableReadOnly ?? state.features.enableReadOnly,
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export const ToggleReadonly = () => {
|
|
15
|
+
const { visible, isReadOnly } = useDiagramContext(selector)
|
|
16
|
+
const diagram = useDiagram()
|
|
17
|
+
|
|
18
|
+
if (!visible) {
|
|
19
|
+
return null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<UnstyledButton
|
|
24
|
+
component={m.button}
|
|
25
|
+
layout="position"
|
|
26
|
+
onClick={e => {
|
|
27
|
+
e.stopPropagation()
|
|
28
|
+
diagram.toggleFeature('ReadOnly')
|
|
29
|
+
}}
|
|
30
|
+
whileTap={{
|
|
31
|
+
translateY: 1,
|
|
32
|
+
}}
|
|
33
|
+
className={cx(
|
|
34
|
+
'group',
|
|
35
|
+
hstack({
|
|
36
|
+
gap: '2',
|
|
37
|
+
paddingInline: '2xs',
|
|
38
|
+
paddingBlock: '2xs',
|
|
39
|
+
rounded: 'sm',
|
|
40
|
+
userSelect: 'none',
|
|
41
|
+
cursor: 'pointer',
|
|
42
|
+
color: {
|
|
43
|
+
base: 'likec4.panel.action-icon.text',
|
|
44
|
+
_hover: 'likec4.panel.action-icon.text.hover',
|
|
45
|
+
},
|
|
46
|
+
backgroundColor: {
|
|
47
|
+
_hover: 'likec4.panel.action-icon.bg.hover',
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
)}>
|
|
51
|
+
{isReadOnly ? <IconLock size={14} stroke={2} /> : <IconLockOpen2 size={14} stroke={2} />}
|
|
52
|
+
{isReadOnly && (
|
|
53
|
+
<m.div
|
|
54
|
+
// layout="position"
|
|
55
|
+
className={css({
|
|
56
|
+
fontSize: '11px',
|
|
57
|
+
fontWeight: 600,
|
|
58
|
+
lineHeight: 1,
|
|
59
|
+
opacity: 0.8,
|
|
60
|
+
})}>
|
|
61
|
+
Unlock
|
|
62
|
+
</m.div>
|
|
63
|
+
)}
|
|
64
|
+
</UnstyledButton>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IconFocusCentered } from '@tabler/icons-react'
|
|
2
|
+
import { useDiagram } from '../../hooks/useDiagram'
|
|
3
|
+
import { PanelActionIcon } from '../_common'
|
|
4
|
+
import { Tooltip } from './_common'
|
|
5
|
+
|
|
6
|
+
export const CenterCamera = () => {
|
|
7
|
+
const diagram = useDiagram()
|
|
8
|
+
return (
|
|
9
|
+
<Tooltip label="Center camera">
|
|
10
|
+
<PanelActionIcon onClick={() => diagram.fitDiagram()}>
|
|
11
|
+
<IconFocusCentered />
|
|
12
|
+
</PanelActionIcon>
|
|
13
|
+
</Tooltip>
|
|
14
|
+
)
|
|
15
|
+
}
|