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