@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,48 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { vstack } from '@likec4/styles/patterns';
|
|
3
|
+
import { TooltipGroup } from '@mantine/core';
|
|
4
|
+
import { AnimatePresence } from 'motion/react';
|
|
5
|
+
import * as m from 'motion/react-m';
|
|
6
|
+
import { CenterCamera } from './CenterCamera.js';
|
|
7
|
+
import { ChangeAutoLayoutButton } from './ChangeAutoLayoutButton.js';
|
|
8
|
+
import { LayoutDriftNotification } from './LayoutDriftNotification.js';
|
|
9
|
+
import { ManualLayoutToolsButton } from './ManualLayoutToolsButton.js';
|
|
10
|
+
import { useEnabledFeatures } from '../../context/DiagramFeatures.js';
|
|
11
|
+
|
|
12
|
+
function EditorPanel() {
|
|
13
|
+
const { enableReadOnly } = useEnabledFeatures();
|
|
14
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { children: !enableReadOnly && /* @__PURE__ */ jsx(
|
|
15
|
+
m.div,
|
|
16
|
+
{
|
|
17
|
+
layout: "position",
|
|
18
|
+
className: vstack({
|
|
19
|
+
gap: "xs",
|
|
20
|
+
layerStyle: "likec4.panel",
|
|
21
|
+
position: "relative",
|
|
22
|
+
cursor: "pointer",
|
|
23
|
+
padding: "xxs",
|
|
24
|
+
pointerEvents: "all"
|
|
25
|
+
}),
|
|
26
|
+
initial: {
|
|
27
|
+
opacity: 0,
|
|
28
|
+
translateX: -20
|
|
29
|
+
},
|
|
30
|
+
animate: {
|
|
31
|
+
opacity: 1,
|
|
32
|
+
translateX: 0
|
|
33
|
+
},
|
|
34
|
+
exit: {
|
|
35
|
+
opacity: 0,
|
|
36
|
+
translateX: -20
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ jsxs(TooltipGroup, { openDelay: 600, closeDelay: 120, children: [
|
|
39
|
+
/* @__PURE__ */ jsx(ChangeAutoLayoutButton, {}),
|
|
40
|
+
/* @__PURE__ */ jsx(ManualLayoutToolsButton, {}),
|
|
41
|
+
/* @__PURE__ */ jsx(LayoutDriftNotification, {}),
|
|
42
|
+
/* @__PURE__ */ jsx(CenterCamera, {})
|
|
43
|
+
] })
|
|
44
|
+
}
|
|
45
|
+
) });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { EditorPanel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LayoutDriftNotification: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { HoverCard, HoverCardTarget, ActionIcon, HoverCardDropdown, Notification, Text, Code } from '@mantine/core';
|
|
3
|
+
import { css } from '@likec4/styles/css';
|
|
4
|
+
import { useDiagramContext } from '../../hooks/useDiagram.js';
|
|
5
|
+
import { useMantinePortalProps } from '../../hooks/useMantinePortalProps.js';
|
|
6
|
+
import IconAlertTriangle from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js';
|
|
7
|
+
|
|
8
|
+
const LayoutDriftNotification = () => {
|
|
9
|
+
const portalProps = useMantinePortalProps();
|
|
10
|
+
const hasLayoutDrift = useDiagramContext((c) => c.view.hasLayoutDrift ?? false);
|
|
11
|
+
if (!hasLayoutDrift) return null;
|
|
12
|
+
return /* @__PURE__ */ jsxs(
|
|
13
|
+
HoverCard,
|
|
14
|
+
{
|
|
15
|
+
position: "right-start",
|
|
16
|
+
openDelay: 200,
|
|
17
|
+
closeDelay: 100,
|
|
18
|
+
...portalProps,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ jsx(HoverCardTarget, { children: /* @__PURE__ */ jsx(
|
|
21
|
+
ActionIcon,
|
|
22
|
+
{
|
|
23
|
+
color: "orange",
|
|
24
|
+
c: "orange",
|
|
25
|
+
className: css({
|
|
26
|
+
bg: "mantine.colors.orange.light"
|
|
27
|
+
}),
|
|
28
|
+
children: /* @__PURE__ */ jsx(IconAlertTriangle, {})
|
|
29
|
+
}
|
|
30
|
+
) }),
|
|
31
|
+
/* @__PURE__ */ jsx(HoverCardDropdown, { p: "0", children: /* @__PURE__ */ jsxs(
|
|
32
|
+
Notification,
|
|
33
|
+
{
|
|
34
|
+
color: "orange",
|
|
35
|
+
withBorder: false,
|
|
36
|
+
withCloseButton: false,
|
|
37
|
+
title: "Manual layout issues",
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsxs(Text, { mt: 2, size: "sm", lh: "xs", children: [
|
|
40
|
+
"View contains new elements or their sizes have changed,",
|
|
41
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
42
|
+
"last manual layout can not be applied."
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ jsxs(Text, { mt: "xs", size: "sm", lh: "xs", children: [
|
|
45
|
+
"Update view predicates or remove ",
|
|
46
|
+
/* @__PURE__ */ jsx(Code, { children: "@likec4-generated" })
|
|
47
|
+
] })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
) })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { LayoutDriftNotification };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { css } from '@likec4/styles/css';
|
|
3
|
+
import { hstack } from '@likec4/styles/patterns';
|
|
4
|
+
import { Popover, PopoverTarget, PopoverDropdown, TooltipGroup } from '@mantine/core';
|
|
5
|
+
import { useDiagram } from '../../hooks/useDiagram.js';
|
|
6
|
+
import { useMantinePortalProps } from '../../hooks/useMantinePortalProps.js';
|
|
7
|
+
import { PanelActionIcon } from '../_common.js';
|
|
8
|
+
import { Tooltip } from './_common.js';
|
|
9
|
+
import IconLayoutCollage from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js';
|
|
10
|
+
import IconLayoutBoardSplit from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js';
|
|
11
|
+
import IconLayoutAlignLeft from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js';
|
|
12
|
+
import IconLayoutAlignCenter from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js';
|
|
13
|
+
import IconLayoutAlignRight from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js';
|
|
14
|
+
import IconLayoutAlignTop from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js';
|
|
15
|
+
import IconLayoutAlignMiddle from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js';
|
|
16
|
+
import IconLayoutAlignBottom from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js';
|
|
17
|
+
import IconRouteOff from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js';
|
|
18
|
+
|
|
19
|
+
const Action = ({
|
|
20
|
+
label,
|
|
21
|
+
icon,
|
|
22
|
+
onClick
|
|
23
|
+
}) => /* @__PURE__ */ jsx(Tooltip, { label, withinPortal: false, position: "top", children: /* @__PURE__ */ jsx(
|
|
24
|
+
PanelActionIcon,
|
|
25
|
+
{
|
|
26
|
+
classNames: {
|
|
27
|
+
root: "action-icon",
|
|
28
|
+
icon: css({
|
|
29
|
+
"& > svg": {
|
|
30
|
+
width: "70%",
|
|
31
|
+
height: "70%"
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
},
|
|
35
|
+
onClick,
|
|
36
|
+
children: icon
|
|
37
|
+
}
|
|
38
|
+
) });
|
|
39
|
+
const ManualLayoutToolsButton = (props) => {
|
|
40
|
+
const diagram = useDiagram();
|
|
41
|
+
const portalProps = useMantinePortalProps();
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
43
|
+
Popover,
|
|
44
|
+
{
|
|
45
|
+
position: "right",
|
|
46
|
+
offset: {
|
|
47
|
+
mainAxis: 12
|
|
48
|
+
},
|
|
49
|
+
clickOutsideEvents: [
|
|
50
|
+
"pointerdown"
|
|
51
|
+
],
|
|
52
|
+
...portalProps,
|
|
53
|
+
...props,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsx(PopoverTarget, { children: /* @__PURE__ */ jsx(Tooltip, { label: "Manual layouting tools", children: /* @__PURE__ */ jsx(PanelActionIcon, { children: /* @__PURE__ */ jsx(IconLayoutCollage, {}) }) }) }),
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
PopoverDropdown,
|
|
58
|
+
{
|
|
59
|
+
className: hstack({
|
|
60
|
+
gap: "0.5",
|
|
61
|
+
layerStyle: "likec4.panel",
|
|
62
|
+
padding: "1",
|
|
63
|
+
pointerEvents: "all"
|
|
64
|
+
}),
|
|
65
|
+
children: /* @__PURE__ */ jsxs(TooltipGroup, { children: [
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
Action,
|
|
68
|
+
{
|
|
69
|
+
label: "Align in columns",
|
|
70
|
+
icon: /* @__PURE__ */ jsx(IconLayoutBoardSplit, {}),
|
|
71
|
+
onClick: (e) => {
|
|
72
|
+
e.stopPropagation();
|
|
73
|
+
diagram.align("Column");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
Action,
|
|
79
|
+
{
|
|
80
|
+
label: "Align left",
|
|
81
|
+
icon: /* @__PURE__ */ jsx(IconLayoutAlignLeft, {}),
|
|
82
|
+
onClick: (e) => {
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
diagram.align("Left");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
Action,
|
|
90
|
+
{
|
|
91
|
+
label: "Align center",
|
|
92
|
+
icon: /* @__PURE__ */ jsx(IconLayoutAlignCenter, {}),
|
|
93
|
+
onClick: (e) => {
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
diagram.align("Center");
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ jsx(
|
|
100
|
+
Action,
|
|
101
|
+
{
|
|
102
|
+
label: "Align right",
|
|
103
|
+
icon: /* @__PURE__ */ jsx(IconLayoutAlignRight, {}),
|
|
104
|
+
onClick: (e) => {
|
|
105
|
+
e.stopPropagation();
|
|
106
|
+
diagram.align("Right");
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ jsx(
|
|
111
|
+
Action,
|
|
112
|
+
{
|
|
113
|
+
label: "Align in rows",
|
|
114
|
+
icon: /* @__PURE__ */ jsx(IconLayoutBoardSplit, { style: { transform: "rotate(90deg)" } }),
|
|
115
|
+
onClick: (e) => {
|
|
116
|
+
e.stopPropagation();
|
|
117
|
+
diagram.align("Row");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ jsx(
|
|
122
|
+
Action,
|
|
123
|
+
{
|
|
124
|
+
label: "Align top",
|
|
125
|
+
icon: /* @__PURE__ */ jsx(IconLayoutAlignTop, {}),
|
|
126
|
+
onClick: (e) => {
|
|
127
|
+
e.stopPropagation();
|
|
128
|
+
diagram.align("Top");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
Action,
|
|
134
|
+
{
|
|
135
|
+
label: "Align middle",
|
|
136
|
+
icon: /* @__PURE__ */ jsx(IconLayoutAlignMiddle, {}),
|
|
137
|
+
onClick: (e) => {
|
|
138
|
+
e.stopPropagation();
|
|
139
|
+
diagram.align("Middle");
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
Action,
|
|
145
|
+
{
|
|
146
|
+
label: "Align bottom",
|
|
147
|
+
icon: /* @__PURE__ */ jsx(IconLayoutAlignBottom, {}),
|
|
148
|
+
onClick: (e) => {
|
|
149
|
+
e.stopPropagation();
|
|
150
|
+
diagram.align("Bottom");
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
/* @__PURE__ */ jsx(
|
|
155
|
+
Action,
|
|
156
|
+
{
|
|
157
|
+
label: "Reset all control points",
|
|
158
|
+
icon: /* @__PURE__ */ jsx(IconRouteOff, {}),
|
|
159
|
+
onClick: (e) => {
|
|
160
|
+
e.stopPropagation();
|
|
161
|
+
diagram.resetEdgeControlPoints();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
] })
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export { ManualLayoutToolsButton };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
+
import { TooltipProps } from '@mantine/core';
|
|
3
|
+
export declare const Tooltip: ForwardRefExoticComponent< TooltipProps & RefAttributes<HTMLDivElement> & {
|
|
4
|
+
component?: any;
|
|
5
|
+
renderRoot?: (props: Record<string, any>) => React.ReactNode;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Tooltip as Tooltip$1 } from '@mantine/core';
|
|
2
|
+
|
|
3
|
+
const Tooltip = Tooltip$1.withProps({
|
|
4
|
+
color: "dark",
|
|
5
|
+
fz: "xs",
|
|
6
|
+
openDelay: 600,
|
|
7
|
+
closeDelay: 120,
|
|
8
|
+
label: "",
|
|
9
|
+
children: null,
|
|
10
|
+
offset: 8,
|
|
11
|
+
position: "right"
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { Tooltip };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EditorPanel } from './EditorPanel';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const navigationButtons: string;
|
|
2
|
+
export declare const panel: string;
|
|
3
|
+
export declare const actionIconGroup: string;
|
|
4
|
+
export declare const autolayoutIcon: string;
|
|
5
|
+
export declare const autolayoutButton: string;
|
|
6
|
+
export declare const autolayoutIndicator: string;
|
|
7
|
+
export declare const spacingSliderBody: string;
|
|
8
|
+
export declare const spacingSliderThumb: string;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { css } from '@likec4/styles/css';
|
|
2
|
+
|
|
3
|
+
css({
|
|
4
|
+
gap: "xxs",
|
|
5
|
+
_empty: {
|
|
6
|
+
display: "none"
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
css({
|
|
10
|
+
top: "md",
|
|
11
|
+
left: "md",
|
|
12
|
+
margin: "0",
|
|
13
|
+
pointerEvents: "none",
|
|
14
|
+
"& :where(button, .action-icon, [role='dialog'])": {
|
|
15
|
+
pointerEvents: "all"
|
|
16
|
+
},
|
|
17
|
+
["& .action-icon"]: {
|
|
18
|
+
["--ai-size"]: "2rem"
|
|
19
|
+
},
|
|
20
|
+
["& .tabler-icon"]: {
|
|
21
|
+
width: "65%",
|
|
22
|
+
height: "65%"
|
|
23
|
+
},
|
|
24
|
+
_reduceGraphics: {
|
|
25
|
+
"& .action-icon": {
|
|
26
|
+
"--ai-radius": "0px"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
css({
|
|
31
|
+
shadow: {
|
|
32
|
+
base: "md",
|
|
33
|
+
_whenPanning: "none"
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
css({
|
|
37
|
+
["& .tabler-icon"]: {
|
|
38
|
+
width: "65%",
|
|
39
|
+
height: "65%"
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const autolayoutButton = css({
|
|
43
|
+
flex: "1 1 40%",
|
|
44
|
+
textAlign: "center",
|
|
45
|
+
fontWeight: 500,
|
|
46
|
+
padding: "[4px 6px]",
|
|
47
|
+
fontSize: "11px",
|
|
48
|
+
zIndex: 1
|
|
49
|
+
});
|
|
50
|
+
const autolayoutIndicator = css({
|
|
51
|
+
background: "mantine.colors.gray[2]",
|
|
52
|
+
borderRadius: "sm",
|
|
53
|
+
border: `1px solid`,
|
|
54
|
+
borderColor: "mantine.colors.gray[4]",
|
|
55
|
+
_dark: {
|
|
56
|
+
background: "mantine.colors.dark[5]",
|
|
57
|
+
borderColor: "mantine.colors.dark[4]"
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const spacingSliderBody = css({
|
|
61
|
+
position: "relative",
|
|
62
|
+
borderRadius: "sm",
|
|
63
|
+
background: "mantine.colors.gray[3]",
|
|
64
|
+
boxShadow: "inset 1px 1px 3px 0px #00000024",
|
|
65
|
+
_dark: {
|
|
66
|
+
background: "mantine.colors.dark[7]"
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const spacingSliderThumb = css({
|
|
70
|
+
position: "absolute",
|
|
71
|
+
width: 8,
|
|
72
|
+
height: 8,
|
|
73
|
+
border: `2px solid`,
|
|
74
|
+
borderColor: "mantine.colors.gray[5]",
|
|
75
|
+
borderRadius: 3,
|
|
76
|
+
transform: "translate(-50%, -50%)"
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export { autolayoutButton, autolayoutIndicator, spacingSliderBody, spacingSliderThumb };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ViewId } from '@likec4/core';
|
|
2
|
+
import { DependencyList, Provider } from 'react';
|
|
3
|
+
import { NavigationPanelActorContext, NavigationPanelActorEvent, NavigationPanelActorRef, NavigationPanelActorSnapshot } from './actor';
|
|
4
|
+
export declare const NavigationPanelActorContextProvider: Provider<NavigationPanelActorRef>;
|
|
5
|
+
export declare const useNavigationActorRef: () => NavigationPanelActorRef;
|
|
6
|
+
export declare function useNavigationActorSnapshot<T = unknown>(selector: (context: NavigationPanelActorSnapshot) => T, compare?: (a: NoInfer<T>, b: NoInfer<T>) => boolean, deps?: DependencyList): T;
|
|
7
|
+
export declare function useNavigationActorContext<T = unknown>(selector: (context: NavigationPanelActorContext) => T, compare?: (a: NoInfer<T>, b: NoInfer<T>) => boolean, deps?: DependencyList): T;
|
|
8
|
+
export interface NavigationActor {
|
|
9
|
+
readonly actorRef: NavigationPanelActorRef;
|
|
10
|
+
send: (event: NavigationPanelActorEvent) => void;
|
|
11
|
+
selectFolder: (folderPath: string) => void;
|
|
12
|
+
selectView: (viewId: ViewId) => void;
|
|
13
|
+
/**
|
|
14
|
+
* If the navigation dropdown is opened
|
|
15
|
+
*/
|
|
16
|
+
isOpened: () => boolean;
|
|
17
|
+
clearSearch: () => void;
|
|
18
|
+
closeDropdown: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function useNavigationActor(): NavigationActor;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useSelector } from '@xstate/react';
|
|
2
|
+
import { shallowEqual } from 'fast-equals';
|
|
3
|
+
import { createContext, useMemo, useContext } from 'react';
|
|
4
|
+
|
|
5
|
+
const NavigationPanelActorSafeContext = createContext(null);
|
|
6
|
+
NavigationPanelActorSafeContext.displayName = "NavigationPanelActorSafeContext";
|
|
7
|
+
const NavigationPanelActorContextProvider = NavigationPanelActorSafeContext.Provider;
|
|
8
|
+
const useNavigationActorRef = () => {
|
|
9
|
+
const ctx = useContext(NavigationPanelActorSafeContext);
|
|
10
|
+
if (ctx === null) {
|
|
11
|
+
throw new Error("NavigationPanelActorRef is not found in the context");
|
|
12
|
+
}
|
|
13
|
+
return ctx;
|
|
14
|
+
};
|
|
15
|
+
function useNavigationActorSnapshot(selector, compare = shallowEqual, deps) {
|
|
16
|
+
const actorRef = useNavigationActorRef();
|
|
17
|
+
return useSelector(actorRef, selector, compare);
|
|
18
|
+
}
|
|
19
|
+
function useNavigationActorContext(selector, compare = shallowEqual, deps) {
|
|
20
|
+
return useNavigationActorSnapshot((snapshot) => selector(snapshot.context), compare);
|
|
21
|
+
}
|
|
22
|
+
function useNavigationActor() {
|
|
23
|
+
const actorRef = useNavigationActorRef();
|
|
24
|
+
return useMemo(() => ({
|
|
25
|
+
actorRef,
|
|
26
|
+
send: (event) => actorRef.send(event),
|
|
27
|
+
selectFolder: (folderPath) => actorRef.send({ type: "select.folder", folderPath }),
|
|
28
|
+
selectView: (viewId) => actorRef.send({ type: "select.view", viewId }),
|
|
29
|
+
isOpened: () => {
|
|
30
|
+
const snapshot = actorRef.getSnapshot();
|
|
31
|
+
return snapshot.hasTag("active");
|
|
32
|
+
},
|
|
33
|
+
clearSearch: () => actorRef.send({ type: "searchQuery.change", value: "" }),
|
|
34
|
+
closeDropdown: () => actorRef.send({ type: "dropdown.dismiss" })
|
|
35
|
+
}), [actorRef]);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { NavigationPanelActorContextProvider, useNavigationActor, useNavigationActorContext, useNavigationActorRef, useNavigationActorSnapshot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NavigationPanel } from './NavigationPanel';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RecipeRuntimeFn } from '@likec4/styles/types';
|
|
2
|
+
export declare const breadcrumbTitle: RecipeRuntimeFn<{
|
|
3
|
+
truncate: {
|
|
4
|
+
true: {
|
|
5
|
+
truncate: boolean;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
dimmed: {
|
|
9
|
+
true: {
|
|
10
|
+
color: {
|
|
11
|
+
base: "mantine.colors.dimmed";
|
|
12
|
+
_hover: "mantine.colors.text";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { cva } from '@likec4/styles/css';
|
|
2
|
+
|
|
3
|
+
const breadcrumbTitle = cva({
|
|
4
|
+
base: {
|
|
5
|
+
fontSize: "sm",
|
|
6
|
+
fontWeight: "500",
|
|
7
|
+
transition: "fast",
|
|
8
|
+
color: {
|
|
9
|
+
base: "mantine.colors.text/90",
|
|
10
|
+
_hover: "mantine.colors.text"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
variants: {
|
|
14
|
+
truncate: {
|
|
15
|
+
"true": {
|
|
16
|
+
truncate: true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
dimmed: {
|
|
20
|
+
"true": {
|
|
21
|
+
color: {
|
|
22
|
+
base: "mantine.colors.dimmed",
|
|
23
|
+
_hover: "mantine.colors.text"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export { breadcrumbTitle };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { css } from '@likec4/styles/css';
|
|
3
|
+
import { Box } from '@likec4/styles/jsx';
|
|
4
|
+
import { Button, Badge, Portal } from '@mantine/core';
|
|
5
|
+
import { AnimatePresence } from 'motion/react';
|
|
6
|
+
import * as m from 'motion/react-m';
|
|
7
|
+
import { isTruthy } from 'remeda';
|
|
8
|
+
import { useDiagram, useDiagramContext } from '../../hooks/useDiagram.js';
|
|
9
|
+
import { Tooltip } from '../_common.js';
|
|
10
|
+
import { useNavigationActor } from '../hooks.js';
|
|
11
|
+
import IconPlayerStopFilled from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js';
|
|
12
|
+
import IconPlayerSkipBackFilled from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js';
|
|
13
|
+
import IconPlayerSkipForwardFilled from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js';
|
|
14
|
+
import { useMantinePortalProps } from '../../hooks/useMantinePortalProps.js';
|
|
15
|
+
import IconPlayerPlayFilled from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js';
|
|
16
|
+
|
|
17
|
+
const TriggerWalkthroughButton = Button.withProps({
|
|
18
|
+
// Button is polymorphic, but we dont want it to inherit the motion props
|
|
19
|
+
component: m.button,
|
|
20
|
+
// @ts-expect-error
|
|
21
|
+
layoutId: "trigger-dynamic-walkthrough",
|
|
22
|
+
variant: "filled",
|
|
23
|
+
size: "xs",
|
|
24
|
+
fw: "500",
|
|
25
|
+
className: css({
|
|
26
|
+
flexShrink: 0
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
const StartWalkthroughButton = () => {
|
|
30
|
+
const diagram = useDiagram();
|
|
31
|
+
const actor = useNavigationActor();
|
|
32
|
+
return /* @__PURE__ */ jsx(Tooltip, { label: "Start Dynamic View Walkthrough", children: /* @__PURE__ */ jsx(
|
|
33
|
+
TriggerWalkthroughButton,
|
|
34
|
+
{
|
|
35
|
+
onClick: (e) => {
|
|
36
|
+
e.stopPropagation();
|
|
37
|
+
actor.closeDropdown();
|
|
38
|
+
diagram.startWalkthrough();
|
|
39
|
+
},
|
|
40
|
+
rightSection: /* @__PURE__ */ jsx(IconPlayerPlayFilled, { size: 10 }),
|
|
41
|
+
children: "Start"
|
|
42
|
+
}
|
|
43
|
+
) });
|
|
44
|
+
};
|
|
45
|
+
const PrevNextButton = Button.withProps({
|
|
46
|
+
// Button is polymorphic, but we dont want it to inherit the motion props
|
|
47
|
+
component: m.button,
|
|
48
|
+
variant: "light",
|
|
49
|
+
size: "xs",
|
|
50
|
+
fw: "500"
|
|
51
|
+
});
|
|
52
|
+
const ParallelFrame = () => {
|
|
53
|
+
const { portalProps } = useMantinePortalProps();
|
|
54
|
+
return /* @__PURE__ */ jsx(Portal, { ...portalProps, children: /* @__PURE__ */ jsx(
|
|
55
|
+
Box,
|
|
56
|
+
{
|
|
57
|
+
css: {
|
|
58
|
+
position: "absolute",
|
|
59
|
+
margin: "0",
|
|
60
|
+
padding: "0",
|
|
61
|
+
top: "0",
|
|
62
|
+
left: "0",
|
|
63
|
+
width: "100%",
|
|
64
|
+
height: "100%",
|
|
65
|
+
border: `2px solid`,
|
|
66
|
+
borderColor: "mantine.colors.orange[6]",
|
|
67
|
+
pointerEvents: "none",
|
|
68
|
+
md: {
|
|
69
|
+
borderWidth: 4
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
) });
|
|
74
|
+
};
|
|
75
|
+
const ActiveWalkthroughControls = () => {
|
|
76
|
+
const diagram = useDiagram();
|
|
77
|
+
const {
|
|
78
|
+
isParallel,
|
|
79
|
+
hasNext,
|
|
80
|
+
hasPrevious,
|
|
81
|
+
currentStep,
|
|
82
|
+
totalSteps
|
|
83
|
+
} = useDiagramContext((s) => {
|
|
84
|
+
const currentStepIndex = s.xyedges.findIndex((e) => e.id === s.activeWalkthrough?.stepId);
|
|
85
|
+
return {
|
|
86
|
+
isParallel: isTruthy(s.activeWalkthrough?.parallelPrefix),
|
|
87
|
+
hasNext: currentStepIndex < s.xyedges.length - 1,
|
|
88
|
+
hasPrevious: currentStepIndex > 0,
|
|
89
|
+
currentStep: currentStepIndex + 1,
|
|
90
|
+
totalSteps: s.xyedges.length
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
return /* @__PURE__ */ jsxs(AnimatePresence, { propagate: true, children: [
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
TriggerWalkthroughButton,
|
|
96
|
+
{
|
|
97
|
+
variant: "light",
|
|
98
|
+
color: "orange",
|
|
99
|
+
mr: "sm",
|
|
100
|
+
onClick: (e) => {
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
diagram.stopWalkthrough();
|
|
103
|
+
},
|
|
104
|
+
rightSection: /* @__PURE__ */ jsx(IconPlayerStopFilled, { size: 10 }),
|
|
105
|
+
children: "Stop"
|
|
106
|
+
},
|
|
107
|
+
"trigger-dynamic-walkthrough"
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
PrevNextButton,
|
|
111
|
+
{
|
|
112
|
+
disabled: !hasPrevious,
|
|
113
|
+
onClick: () => diagram.walkthroughStep("previous"),
|
|
114
|
+
leftSection: /* @__PURE__ */ jsx(IconPlayerSkipBackFilled, { size: 10 }),
|
|
115
|
+
children: "Previous"
|
|
116
|
+
},
|
|
117
|
+
"prev"
|
|
118
|
+
),
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
Badge,
|
|
121
|
+
{
|
|
122
|
+
component: m.div,
|
|
123
|
+
size: "md",
|
|
124
|
+
radius: "sm",
|
|
125
|
+
variant: isParallel ? "gradient" : "transparent",
|
|
126
|
+
gradient: { from: "red", to: "orange", deg: 90 },
|
|
127
|
+
rightSection: /* @__PURE__ */ jsx(
|
|
128
|
+
m.div,
|
|
129
|
+
{
|
|
130
|
+
className: css({
|
|
131
|
+
fontSize: "xxs",
|
|
132
|
+
display: isParallel ? "block" : "none"
|
|
133
|
+
}),
|
|
134
|
+
children: "parallel"
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
className: css({
|
|
138
|
+
alignItems: "baseline"
|
|
139
|
+
}),
|
|
140
|
+
children: /* @__PURE__ */ jsxs(m.span, { children: [
|
|
141
|
+
currentStep,
|
|
142
|
+
" / ",
|
|
143
|
+
totalSteps
|
|
144
|
+
] })
|
|
145
|
+
},
|
|
146
|
+
"step-badge"
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ jsx(
|
|
149
|
+
PrevNextButton,
|
|
150
|
+
{
|
|
151
|
+
disabled: !hasNext,
|
|
152
|
+
onClick: () => diagram.walkthroughStep("next"),
|
|
153
|
+
rightSection: /* @__PURE__ */ jsx(IconPlayerSkipForwardFilled, { size: 10 }),
|
|
154
|
+
children: "Next"
|
|
155
|
+
},
|
|
156
|
+
"next"
|
|
157
|
+
),
|
|
158
|
+
isParallel && /* @__PURE__ */ jsx(ParallelFrame, {})
|
|
159
|
+
] });
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export { ActiveWalkthroughControls, StartWalkthroughButton };
|