@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
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { RichText } from '@likec4/core/types';
|
|
3
2
|
import { cx } from '@likec4/styles/css';
|
|
4
3
|
import { Card, CardSection, Button, Group, Text, Spoiler, Stack } from '@mantine/core';
|
|
5
4
|
import { useLocalStorage } from '@mantine/hooks';
|
|
@@ -7,24 +6,27 @@ import { AnimatePresence, m } from 'motion/react';
|
|
|
7
6
|
import { Link } from '../../../components/Link.js';
|
|
8
7
|
import { useDiagramContext } from '../../../hooks/useDiagram.js';
|
|
9
8
|
import { card, title, description } from './DiagramTitlePanel.css.js';
|
|
10
|
-
import
|
|
9
|
+
import { useCurrentViewModel } from '../../../likec4model/useCurrentViewModel.js';
|
|
10
|
+
import IconMenu from '../../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu.js';
|
|
11
11
|
import { MarkdownBlock } from '../../../base/primitives/MarkdownBlock.js';
|
|
12
12
|
|
|
13
13
|
function selector(context) {
|
|
14
14
|
return {
|
|
15
|
-
id: context.view.id,
|
|
16
|
-
title: context.view.title ??
|
|
17
|
-
description: RichText.from(context.view.description),
|
|
18
|
-
links: context.view.links,
|
|
15
|
+
// id: context.view.id,
|
|
16
|
+
// title: context.view.title ?? 'untitled',
|
|
17
|
+
// description: RichText.from(context.view.description),
|
|
18
|
+
// links: context.view.links,
|
|
19
19
|
isNotActiveWalkthrough: context.activeWalkthrough === null
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
function DiagramTitlePanel() {
|
|
23
|
-
const
|
|
23
|
+
const view = useCurrentViewModel();
|
|
24
|
+
const { isNotActiveWalkthrough } = useDiagramContext(selector);
|
|
24
25
|
const [isCollapsed, setCollapsed] = useLocalStorage({
|
|
25
26
|
key: "diagram-title-webview-collapsed",
|
|
26
27
|
defaultValue: false
|
|
27
28
|
});
|
|
29
|
+
const title$1 = view.title ?? "untitled";
|
|
28
30
|
const toggle = () => setCollapsed((v) => !v);
|
|
29
31
|
return /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: isNotActiveWalkthrough && /* @__PURE__ */ jsx(
|
|
30
32
|
m.div,
|
|
@@ -111,12 +113,12 @@ function DiagramTitlePanel() {
|
|
|
111
113
|
"id:",
|
|
112
114
|
" "
|
|
113
115
|
] }),
|
|
114
|
-
id
|
|
116
|
+
view.id
|
|
115
117
|
]
|
|
116
118
|
}
|
|
117
119
|
)
|
|
118
120
|
] }),
|
|
119
|
-
description
|
|
121
|
+
view.description.nonEmpty && /* @__PURE__ */ jsx(
|
|
120
122
|
Spoiler,
|
|
121
123
|
{
|
|
122
124
|
maxHeight: 60,
|
|
@@ -127,12 +129,12 @@ function DiagramTitlePanel() {
|
|
|
127
129
|
{
|
|
128
130
|
className: description,
|
|
129
131
|
textScale: 0.9,
|
|
130
|
-
value: description
|
|
132
|
+
value: view.description
|
|
131
133
|
}
|
|
132
134
|
)
|
|
133
135
|
}
|
|
134
136
|
),
|
|
135
|
-
description
|
|
137
|
+
view.description.isEmpty && /* @__PURE__ */ jsx(
|
|
136
138
|
Text,
|
|
137
139
|
{
|
|
138
140
|
component: "div",
|
|
@@ -141,14 +143,14 @@ function DiagramTitlePanel() {
|
|
|
141
143
|
children: "no description"
|
|
142
144
|
}
|
|
143
145
|
),
|
|
144
|
-
links && /* @__PURE__ */ jsx(
|
|
146
|
+
view.links.length > 0 && /* @__PURE__ */ jsx(
|
|
145
147
|
Stack,
|
|
146
148
|
{
|
|
147
149
|
mt: "xs",
|
|
148
150
|
gap: 4,
|
|
149
151
|
justify: "stretch",
|
|
150
152
|
align: "stretch",
|
|
151
|
-
children: links.map((link) => /* @__PURE__ */ jsx(Link, { value: link }, link.url))
|
|
153
|
+
children: view.links.map((link) => /* @__PURE__ */ jsx(Link, { value: link }, link.url))
|
|
152
154
|
}
|
|
153
155
|
)
|
|
154
156
|
] })
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { css } from '@likec4/styles/css';
|
|
2
2
|
|
|
3
3
|
const container = css({
|
|
4
|
-
bottom: 0,
|
|
5
|
-
right: 0,
|
|
6
|
-
padding:
|
|
7
|
-
margin: 0
|
|
4
|
+
bottom: "0",
|
|
5
|
+
right: "0",
|
|
6
|
+
padding: "2",
|
|
7
|
+
margin: "0"
|
|
8
8
|
});
|
|
9
9
|
const icon = css({
|
|
10
10
|
["--ai-radius"]: "0px",
|
|
@@ -32,7 +32,7 @@ const card = css({
|
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
const tabPanel = css({
|
|
35
|
-
padding: "
|
|
35
|
+
padding: "xxs"
|
|
36
36
|
});
|
|
37
37
|
const elementNotation = css({
|
|
38
38
|
backgroundColor: "transparent",
|
|
@@ -54,8 +54,8 @@ const elementNotation = css({
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
css({
|
|
57
|
-
fill: "likec4
|
|
58
|
-
stroke: "likec4
|
|
57
|
+
fill: "var(--likec4-palette-fill)",
|
|
58
|
+
stroke: "var(--likec4-palette-stroke)",
|
|
59
59
|
strokeWidth: 1,
|
|
60
60
|
overflow: "visible",
|
|
61
61
|
width: "100%",
|
|
@@ -68,8 +68,8 @@ css({
|
|
|
68
68
|
const shapeBadge = css({
|
|
69
69
|
fontWeight: 500,
|
|
70
70
|
letterSpacing: "0.2px",
|
|
71
|
-
paddingTop: 0,
|
|
72
|
-
paddingBottom: 0,
|
|
71
|
+
paddingTop: "0",
|
|
72
|
+
paddingBottom: "0",
|
|
73
73
|
textTransform: "lowercase",
|
|
74
74
|
transition: "all 150ms ease-in-out",
|
|
75
75
|
cursor: "pointer",
|
|
@@ -78,8 +78,8 @@ const shapeBadge = css({
|
|
|
78
78
|
["--badge-padding-x"]: "3px",
|
|
79
79
|
["--badge-height"]: "13.5px",
|
|
80
80
|
["--badge-lh"]: "1",
|
|
81
|
-
["--badge-bg"]: "
|
|
82
|
-
["--badge-color"]: "
|
|
81
|
+
["--badge-bg"]: "var(--likec4-palette-fill)",
|
|
82
|
+
["--badge-color"]: "var(--likec4-palette-hiContrast)"
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
export { card, container, elementNotation, icon, shapeBadge, tabPanel };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { cx
|
|
2
|
+
import { cx } from '@likec4/styles/css';
|
|
3
3
|
import { Tooltip, ThemeIcon, ActionIcon, Paper, Tabs, TabsList, TabsTab, TabsPanel, ScrollAreaAutosize, Stack, Card, Group, Box, Badge, Text } from '@mantine/core';
|
|
4
4
|
import { useLocalStorage } from '@mantine/hooks';
|
|
5
5
|
import { AnimatePresence, m } from 'motion/react';
|
|
@@ -9,9 +9,9 @@ import { useDiagramContext, useDiagram } from '../../../hooks/useDiagram.js';
|
|
|
9
9
|
import { useXYStore } from '../../../hooks/useXYFlow.js';
|
|
10
10
|
import { container, icon, card, tabPanel, shapeBadge, elementNotation } from './NotationPanel.css.js';
|
|
11
11
|
import { useMantinePortalProps } from '../../../hooks/useMantinePortalProps.js';
|
|
12
|
-
import IconAlertTriangle from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
13
|
-
import IconHelpCircle from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
14
|
-
import IconArrowDownRight from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
12
|
+
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';
|
|
13
|
+
import IconHelpCircle from '../../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js';
|
|
14
|
+
import IconArrowDownRight from '../../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js';
|
|
15
15
|
import { ElementShape } from '../../../base/primitives/element/ElementShape.js';
|
|
16
16
|
|
|
17
17
|
const ElementNotation = ({ value }) => {
|
|
@@ -31,10 +31,7 @@ const ElementNotation = ({ value }) => {
|
|
|
31
31
|
px: "xs",
|
|
32
32
|
py: "sm",
|
|
33
33
|
className: cx(
|
|
34
|
-
elementNotation
|
|
35
|
-
css({
|
|
36
|
-
likec4Palette: color
|
|
37
|
-
})
|
|
34
|
+
elementNotation
|
|
38
35
|
),
|
|
39
36
|
"data-likec4-color": color,
|
|
40
37
|
onMouseEnter: () => {
|
|
@@ -2,17 +2,17 @@ import { css } from '@likec4/styles/css';
|
|
|
2
2
|
|
|
3
3
|
const container = css({
|
|
4
4
|
position: "absolute",
|
|
5
|
-
bottom: "
|
|
6
|
-
left: "50%",
|
|
5
|
+
bottom: "xxs",
|
|
6
|
+
left: "[50%]",
|
|
7
7
|
transform: "translateX(-50%)",
|
|
8
|
-
padding:
|
|
9
|
-
margin:
|
|
8
|
+
padding: "[0px]",
|
|
9
|
+
margin: "[0px]",
|
|
10
10
|
display: "flex",
|
|
11
11
|
flexDirection: "column",
|
|
12
|
-
gap: "0.4rem",
|
|
12
|
+
gap: "[0.4rem]",
|
|
13
13
|
alignItems: "center",
|
|
14
14
|
md: {
|
|
15
|
-
gap: "0.6rem"
|
|
15
|
+
gap: "[0.6rem]"
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
const tablerIcons = {
|
|
@@ -50,10 +50,10 @@ const btn = css({
|
|
|
50
50
|
});
|
|
51
51
|
const parallelStateFrame = css({
|
|
52
52
|
position: "absolute",
|
|
53
|
-
margin: 0,
|
|
54
|
-
padding: 0,
|
|
55
|
-
top: 0,
|
|
56
|
-
left: 0,
|
|
53
|
+
margin: "0",
|
|
54
|
+
padding: "0",
|
|
55
|
+
top: "0",
|
|
56
|
+
left: "0",
|
|
57
57
|
width: "100%",
|
|
58
58
|
height: "100%",
|
|
59
59
|
border: `2px solid`,
|
|
@@ -6,10 +6,10 @@ import { isTruthy, isNonNull } from 'remeda';
|
|
|
6
6
|
import { useDiagramContext, useDiagram } from '../../../hooks/useDiagram.js';
|
|
7
7
|
import { parallelStateFrame, btn, buttons, container } from './DynamicViewWalkthrough.css.js';
|
|
8
8
|
import { useXYStore } from '../../../hooks/useXYFlow.js';
|
|
9
|
-
import IconPlayerPlayFilled from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
10
|
-
import IconPlayerSkipBackFilled from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
11
|
-
import IconPlayerStopFilled from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
12
|
-
import IconPlayerSkipForwardFilled from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
9
|
+
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';
|
|
10
|
+
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';
|
|
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 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';
|
|
13
13
|
|
|
14
14
|
function DynamicViewWalkthrough() {
|
|
15
15
|
const isMobile = useXYStore((s) => s.width <= 750);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import { LikeC4Model } from '@likec4/core/model';
|
|
1
|
+
import { LikeC4Model, LikeC4ViewModel } from '@likec4/core/model';
|
|
2
|
+
import { aux, DiagramView } from '@likec4/core/types';
|
|
2
3
|
import { Context } from 'react';
|
|
3
4
|
export declare const LikeC4ModelContext: Context<LikeC4Model<any> | null>;
|
|
5
|
+
export type CurrentViewModel = LikeC4ViewModel<aux.UnknownLayouted, DiagramView<aux.UnknownLayouted>>;
|
|
6
|
+
export declare const CurrentViewModelContext: Context<CurrentViewModel | null>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LikeC4Project, ProjectId } from '@likec4/core/types';
|
|
2
|
+
import { Context } from 'react';
|
|
3
|
+
export type LikeC4ProjectsContext = {
|
|
4
|
+
projects: ReadonlyArray<LikeC4Project>;
|
|
5
|
+
onProjectChange: (id: ProjectId) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const LikeC4ProjectsContext: Context<LikeC4ProjectsContext | null>;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export { useCurrentViewModel, } from './useCurrentViewModel';
|
|
1
2
|
export { useLikeC4ElementsTree, } from './useLikeC4ElementsTree';
|
|
2
3
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel, } from './useLikeC4Model';
|
|
4
|
+
export { useChangeLikeC4Project, useHasProjects, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext, } from './useLikeC4Project';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { CurrentViewModelContext } from './LikeC4ModelContext.js';
|
|
3
|
+
|
|
4
|
+
function useCurrentViewModel() {
|
|
5
|
+
const vm = useContext(CurrentViewModelContext);
|
|
6
|
+
if (!vm) {
|
|
7
|
+
throw new Error("No LikeC4ViewModel in context found");
|
|
8
|
+
}
|
|
9
|
+
return vm;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { useCurrentViewModel };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { aux, LikeC4Model, LikeC4ViewModel } from '@likec4/core/model';
|
|
2
2
|
import { TagSpecification, ElementSpecification, RelationshipSpecification, CustomColorDefinitions } from '@likec4/core';
|
|
3
|
-
export declare function useLikeC4Model<A extends aux.Any = aux.
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function useLikeC4Model<A extends aux.Any = aux.Unknown>(type: 'computed'): LikeC4Model.Computed<A>;
|
|
6
|
-
export declare function useLikeC4Model<A extends aux.Any = aux.Unknown>(type: 'layouted' | 'computed' | undefined): LikeC4Model<A>;
|
|
7
|
-
export declare function useLikeC4ViewModel<A extends aux.Any = aux.Unknown>(viewId: aux.LooseViewId<A>): LikeC4ViewModel<aux.toLayouted<A>> | null;
|
|
3
|
+
export declare function useLikeC4Model<A extends aux.Any = aux.UnknownLayouted>(): LikeC4Model<A>;
|
|
4
|
+
export declare function useLikeC4ViewModel<A extends aux.Any = aux.UnknownLayouted>(viewId: aux.ViewId<A>): LikeC4ViewModel<A>;
|
|
8
5
|
export declare function useLikeC4Specification(): {
|
|
9
6
|
tags: {
|
|
10
7
|
[x: string]: TagSpecification;
|
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { deepEqual } from 'fast-equals';
|
|
2
|
+
import { useContext, useState, useEffect } from 'react';
|
|
3
3
|
import { LikeC4ModelContext } from './LikeC4ModelContext.js';
|
|
4
4
|
|
|
5
|
-
function useLikeC4Model(
|
|
5
|
+
function useLikeC4Model() {
|
|
6
6
|
const model = useContext(LikeC4ModelContext);
|
|
7
7
|
if (!model) {
|
|
8
8
|
throw new Error("LikeC4Model not found. Make sure you have LikeC4ModelProvider.");
|
|
9
9
|
}
|
|
10
|
-
if (isString(type) && model.stage !== type) {
|
|
11
|
-
throw new Error(`Invalid LikeC4ModelContext, expected "${type}" but got "${model.stage}" in context`);
|
|
12
|
-
}
|
|
13
10
|
return model;
|
|
14
11
|
}
|
|
15
12
|
function useLikeC4ViewModel(viewId) {
|
|
16
|
-
const model = useLikeC4Model(
|
|
17
|
-
|
|
18
|
-
if (!view) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
if (!view.isDiagram()) {
|
|
22
|
-
throw new Error(`View "${viewId}" is not layouted`);
|
|
23
|
-
}
|
|
24
|
-
return view;
|
|
13
|
+
const model = useLikeC4Model();
|
|
14
|
+
return model.view(viewId);
|
|
25
15
|
}
|
|
26
16
|
function useLikeC4Specification() {
|
|
27
17
|
const model = useLikeC4Model();
|
|
28
|
-
|
|
18
|
+
const [specification, setSpecification] = useState(model.$data.specification);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setSpecification((current) => deepEqual(current, model.$data.specification) ? current : model.$data.specification);
|
|
21
|
+
}, [model]);
|
|
22
|
+
return specification;
|
|
29
23
|
}
|
|
30
24
|
|
|
31
25
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LikeC4Project, ProjectId } from '@likec4/core/types';
|
|
2
|
+
import { LikeC4ProjectsContext } from './LikeC4ProjectsContext';
|
|
3
|
+
/**
|
|
4
|
+
* @returns The list of available projects, or empty array if no projects are available.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useLikeC4Projects(): ReadonlyArray<LikeC4Project>;
|
|
7
|
+
/**
|
|
8
|
+
* @returns The callback to change current project.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useChangeLikeC4Project(): (id: ProjectId) => void;
|
|
11
|
+
/**
|
|
12
|
+
* @returns The callback to change current project.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useLikeC4ProjectsContext(): LikeC4ProjectsContext;
|
|
15
|
+
/**
|
|
16
|
+
* @returns True if there are more than one project available in the context.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useHasProjects(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @returns The current project id.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useLikeC4ProjectId(): ProjectId;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { LikeC4ModelContext } from './LikeC4ModelContext.js';
|
|
3
|
+
import { LikeC4ProjectsContext } from './LikeC4ProjectsContext.js';
|
|
4
|
+
|
|
5
|
+
const emptyProjects = [];
|
|
6
|
+
const emptyOnProjectChange = () => {
|
|
7
|
+
};
|
|
8
|
+
const emptyContext = {
|
|
9
|
+
projects: emptyProjects,
|
|
10
|
+
onProjectChange: emptyOnProjectChange
|
|
11
|
+
};
|
|
12
|
+
function useLikeC4ProjectsContext() {
|
|
13
|
+
return useContext(LikeC4ProjectsContext) ?? emptyContext;
|
|
14
|
+
}
|
|
15
|
+
function useLikeC4ProjectId() {
|
|
16
|
+
const ctx = useContext(LikeC4ModelContext);
|
|
17
|
+
if (!ctx) {
|
|
18
|
+
throw new Error("No LikeC4ModelContext found");
|
|
19
|
+
}
|
|
20
|
+
return ctx.projectId;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { useLikeC4ProjectId, useLikeC4ProjectsContext };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { VStack } from '@likec4/styles/jsx';
|
|
3
|
+
import { hstack } from '@likec4/styles/patterns';
|
|
4
|
+
import { Portal, Popover, PopoverTarget } from '@mantine/core';
|
|
5
|
+
import { useUpdateEffect } from '@react-hookz/web';
|
|
6
|
+
import { useActorRef, useSelector } from '@xstate/react';
|
|
7
|
+
import { LayoutGroup, AnimatePresence } from 'motion/react';
|
|
8
|
+
import * as m from 'motion/react-m';
|
|
9
|
+
import { memo, useEffect } from 'react';
|
|
10
|
+
import { useDiagramActorRef } from '../hooks/safeContext.js';
|
|
11
|
+
import { useDiagramContext } from '../hooks/useDiagram.js';
|
|
12
|
+
import { useMantinePortalProps } from '../hooks/useMantinePortalProps.js';
|
|
13
|
+
import { useCurrentViewModel } from '../likec4model/useCurrentViewModel.js';
|
|
14
|
+
import { navigationPanelActorLogic } from './actor.js';
|
|
15
|
+
import { NavigationPanelActorContextProvider } from './hooks.js';
|
|
16
|
+
import { NavigationPanelControls } from './NavigationPanelControls.js';
|
|
17
|
+
import { NavigationPanelDropdown } from './NavigationPanelDropdown.js';
|
|
18
|
+
import { EditorPanel } from './editorpanel/EditorPanel.js';
|
|
19
|
+
import { ActiveWalkthroughControls } from './walkthrough/ActiveWalkthroughControls.js';
|
|
20
|
+
|
|
21
|
+
const NavigationPanel = memo(() => {
|
|
22
|
+
const diagramActor = useDiagramActorRef();
|
|
23
|
+
const viewModel = useCurrentViewModel();
|
|
24
|
+
const { portalProps } = useMantinePortalProps();
|
|
25
|
+
const actorRef = useActorRef(
|
|
26
|
+
navigationPanelActorLogic,
|
|
27
|
+
{
|
|
28
|
+
input: {
|
|
29
|
+
viewModel
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const subscription = actorRef.on("navigateTo", (event) => {
|
|
35
|
+
if (diagramActor.getSnapshot().context.view.id !== event.viewId) {
|
|
36
|
+
diagramActor.send({ type: "navigate.to", viewId: event.viewId });
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return () => subscription.unsubscribe();
|
|
40
|
+
}, [actorRef, diagramActor]);
|
|
41
|
+
useUpdateEffect(() => {
|
|
42
|
+
actorRef.send({ type: "update.inputs", inputs: { viewModel } });
|
|
43
|
+
}, [viewModel]);
|
|
44
|
+
return /* @__PURE__ */ jsx(Portal, { ...portalProps, children: /* @__PURE__ */ jsx(
|
|
45
|
+
VStack,
|
|
46
|
+
{
|
|
47
|
+
className: "react-flow__panel",
|
|
48
|
+
css: {
|
|
49
|
+
alignItems: "flex-start",
|
|
50
|
+
pointerEvents: "none",
|
|
51
|
+
top: "0",
|
|
52
|
+
left: "0",
|
|
53
|
+
margin: "0",
|
|
54
|
+
width: "100%",
|
|
55
|
+
gap: "xxs",
|
|
56
|
+
maxWidth: [
|
|
57
|
+
"calc(100vw)",
|
|
58
|
+
"calc(100cqw)"
|
|
59
|
+
],
|
|
60
|
+
"@/sm": {
|
|
61
|
+
margin: "xs",
|
|
62
|
+
gap: "xs",
|
|
63
|
+
width: "max-content",
|
|
64
|
+
maxWidth: [
|
|
65
|
+
"calc(100vw - 2 * {spacing.md})",
|
|
66
|
+
"calc(100cqw - 2 * {spacing.md})"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
children: /* @__PURE__ */ jsxs(NavigationPanelActorContextProvider, { value: actorRef, children: [
|
|
71
|
+
/* @__PURE__ */ jsx(NavigationPanelImpl, { actor: actorRef }),
|
|
72
|
+
/* @__PURE__ */ jsx(EditorPanel, {})
|
|
73
|
+
] })
|
|
74
|
+
}
|
|
75
|
+
) });
|
|
76
|
+
});
|
|
77
|
+
NavigationPanel.displayName = "NavigationPanel";
|
|
78
|
+
const NavigationPanelImpl = ({ actor }) => {
|
|
79
|
+
const opened = useSelector(actor, (s) => s.hasTag("active"));
|
|
80
|
+
const portalProps = useMantinePortalProps();
|
|
81
|
+
return /* @__PURE__ */ jsxs(
|
|
82
|
+
Popover,
|
|
83
|
+
{
|
|
84
|
+
offset: {
|
|
85
|
+
mainAxis: 2
|
|
86
|
+
},
|
|
87
|
+
middlewares: { flip: false },
|
|
88
|
+
opened,
|
|
89
|
+
position: "bottom-start",
|
|
90
|
+
trapFocus: true,
|
|
91
|
+
...portalProps,
|
|
92
|
+
clickOutsideEvents: ["pointerdown", "mousedown", "click"],
|
|
93
|
+
onDismiss: () => actor.send({ type: "dropdown.dismiss" }),
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsx(NavigationPanelPopoverTarget, { actor }),
|
|
96
|
+
/* @__PURE__ */ jsx(NavigationPanelDropdown, {})
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
const NavigationPanelPopoverTarget = ({ actor }) => {
|
|
102
|
+
const isActiveWalkthrough = useDiagramContext((c) => c.activeWalkthrough !== null);
|
|
103
|
+
return /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsx(PopoverTarget, { children: /* @__PURE__ */ jsx(
|
|
104
|
+
m.div,
|
|
105
|
+
{
|
|
106
|
+
layout: true,
|
|
107
|
+
className: hstack({
|
|
108
|
+
layerStyle: "likec4.panel",
|
|
109
|
+
position: "relative",
|
|
110
|
+
gap: "xs",
|
|
111
|
+
cursor: "pointer",
|
|
112
|
+
paddingRight: "md",
|
|
113
|
+
pointerEvents: "all",
|
|
114
|
+
width: "100%"
|
|
115
|
+
}),
|
|
116
|
+
onMouseLeave: () => actor.send({ type: "breadcrumbs.mouseLeave" }),
|
|
117
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: isActiveWalkthrough ? /* @__PURE__ */ jsx(ActiveWalkthroughControls, {}) : /* @__PURE__ */ jsx(NavigationPanelControls, {}) })
|
|
118
|
+
}
|
|
119
|
+
) }) });
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export { NavigationPanel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NavigationPanelControls: () => import("react/jsx-runtime").JSX.Element;
|