@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
|
@@ -7,7 +7,7 @@ export const menuDropdown = css({
|
|
|
7
7
|
})
|
|
8
8
|
|
|
9
9
|
export const menuItemRelationship = css({
|
|
10
|
-
gap:
|
|
10
|
+
gap: '1',
|
|
11
11
|
})
|
|
12
12
|
|
|
13
13
|
export const endpoint = css({
|
|
@@ -15,17 +15,17 @@ export const endpoint = css({
|
|
|
15
15
|
fontSize: 'xxs',
|
|
16
16
|
fontWeight: 500,
|
|
17
17
|
whiteSpace: 'nowrap',
|
|
18
|
-
padding: '2px 4px',
|
|
19
|
-
borderRadius:
|
|
20
|
-
background: `likec4
|
|
18
|
+
padding: '[2px 4px]',
|
|
19
|
+
borderRadius: '[2px]',
|
|
20
|
+
background: `var(--likec4-palette-fill)/30`,
|
|
21
21
|
lineHeight: '[1.11]',
|
|
22
22
|
mixBlendMode: 'hard-light',
|
|
23
23
|
color: {
|
|
24
|
-
_light: `[color-mix(in srgb,
|
|
25
|
-
_dark: 'likec4
|
|
24
|
+
_light: `[color-mix(in srgb, var(--likec4-palette-stroke), {colors.likec4.mixColor} 60%)]`,
|
|
25
|
+
_dark: 'var(--likec4-palette-loContrast)',
|
|
26
26
|
},
|
|
27
27
|
// _dark: {
|
|
28
|
-
// background: `likec4
|
|
28
|
+
// background: `var(--likec4-palette-fill)/60`,
|
|
29
29
|
// },
|
|
30
30
|
})
|
|
31
31
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
nameFromFqn,
|
|
6
6
|
} from '@likec4/core'
|
|
7
7
|
import type { LikeC4Model } from '@likec4/core/model'
|
|
8
|
-
import {
|
|
8
|
+
import { cx } from '@likec4/styles/css'
|
|
9
9
|
import {
|
|
10
10
|
type StackProps,
|
|
11
11
|
ActionIcon,
|
|
@@ -203,11 +203,11 @@ const Relationship = forwardRef<
|
|
|
203
203
|
return (
|
|
204
204
|
<Stack ref={ref} className={cx(styles.menuItemRelationship, className)} {...props}>
|
|
205
205
|
<Group gap={4}>
|
|
206
|
-
<Text component="div"
|
|
206
|
+
<Text component="div" data-likec4-color={sourceNode.color} className={styles.endpoint}>
|
|
207
207
|
{sourceId}
|
|
208
208
|
</Text>
|
|
209
209
|
<IconArrowRight stroke={2.5} size={'11px'} opacity={0.65} />
|
|
210
|
-
<Text component="div"
|
|
210
|
+
<Text component="div" data-likec4-color={targetNode.color} className={styles.endpoint}>
|
|
211
211
|
{targetId}
|
|
212
212
|
</Text>
|
|
213
213
|
{(navigateTo || !!onOpenSource) && (
|
|
@@ -6,14 +6,14 @@ export const controlPointsContainer = css({
|
|
|
6
6
|
overflow: 'visible',
|
|
7
7
|
position: 'absolute',
|
|
8
8
|
pointerEvents: 'none',
|
|
9
|
-
top: 0,
|
|
10
|
-
left: 0,
|
|
9
|
+
top: '0',
|
|
10
|
+
left: '0',
|
|
11
11
|
mixBlendMode: 'normal',
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
export const controlPoint = css({
|
|
15
|
-
fill: `likec4
|
|
16
|
-
stroke: `likec4
|
|
15
|
+
fill: `var(--likec4-palette-relation-stroke)`,
|
|
16
|
+
stroke: `var(--likec4-palette-relation-stroke)`,
|
|
17
17
|
fillOpacity: 0.75,
|
|
18
18
|
strokeWidth: 1,
|
|
19
19
|
cursor: 'grab',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cx } from '@likec4/styles/css'
|
|
2
|
+
import { hstack } from '@likec4/styles/patterns'
|
|
2
3
|
import { ActionIconGroup, Badge, Box, Group, Loader, Stack } from '@mantine/core'
|
|
3
4
|
import { IconFileSymlink, IconFocusCentered, IconMenu2 } from '@tabler/icons-react'
|
|
4
5
|
import { LayoutGroup, m } from 'motion/react'
|
|
@@ -7,7 +8,7 @@ import { SearchControl } from '../../../components/SearchControl'
|
|
|
7
8
|
import { useDiagramEventHandlers, useEnabledFeatures } from '../../../context'
|
|
8
9
|
import { type ControlsCustomLayout, useControlsCustomLayout } from '../../../context/ControlsCustomLayout'
|
|
9
10
|
import { useMantinePortalProps } from '../../../hooks'
|
|
10
|
-
import { useDiagram, useDiagramContext
|
|
11
|
+
import { useDiagram, useDiagramContext } from '../../../hooks/useDiagram'
|
|
11
12
|
import { stopPropagation } from '../../../utils'
|
|
12
13
|
import { ActionIcon, Tooltip } from './_shared'
|
|
13
14
|
import { ChangeAutoLayoutButton } from './ChangeAutoLayoutButton'
|
|
@@ -23,9 +24,7 @@ const ControlsDefaultLayout: ControlsCustomLayout = ({
|
|
|
23
24
|
search,
|
|
24
25
|
actionsGroup,
|
|
25
26
|
}) => (
|
|
26
|
-
<
|
|
27
|
-
component={m.div}
|
|
28
|
-
// @ts-expect-error group component not fully polymorphic
|
|
27
|
+
<m.div
|
|
29
28
|
initial={{
|
|
30
29
|
opacity: 0.05,
|
|
31
30
|
translateX: -30,
|
|
@@ -41,13 +40,15 @@ const ControlsDefaultLayout: ControlsCustomLayout = ({
|
|
|
41
40
|
translateX: -30,
|
|
42
41
|
translateY: -10,
|
|
43
42
|
}}
|
|
44
|
-
align="flex-start"
|
|
45
43
|
className={cx(
|
|
44
|
+
hstack({
|
|
45
|
+
gap: 'sm',
|
|
46
|
+
alignItems: 'flex-start',
|
|
47
|
+
}),
|
|
46
48
|
'react-flow__panel',
|
|
47
49
|
css.panel,
|
|
48
50
|
'likec4-top-left-panel',
|
|
49
51
|
)}
|
|
50
|
-
gap="xs"
|
|
51
52
|
onClick={stopPropagation}
|
|
52
53
|
>
|
|
53
54
|
<Stack align="flex-start" gap="xs">
|
|
@@ -64,7 +65,7 @@ const ControlsDefaultLayout: ControlsCustomLayout = ({
|
|
|
64
65
|
<Box>
|
|
65
66
|
{search}
|
|
66
67
|
</Box>
|
|
67
|
-
</
|
|
68
|
+
</m.div>
|
|
68
69
|
)
|
|
69
70
|
|
|
70
71
|
export const Controls = memo(() => {
|
|
@@ -110,7 +111,6 @@ export const Controls = memo(() => {
|
|
|
110
111
|
}}
|
|
111
112
|
/>
|
|
112
113
|
)}
|
|
113
|
-
syncInProgressBadge={<SyncLayoutBadge />}
|
|
114
114
|
actionsGroup={
|
|
115
115
|
<ActionIconGroup className={css.actionIconGroup} orientation="vertical">
|
|
116
116
|
{enableVscode && (
|
|
@@ -151,13 +151,3 @@ export const Controls = memo(() => {
|
|
|
151
151
|
</>
|
|
152
152
|
)
|
|
153
153
|
})
|
|
154
|
-
|
|
155
|
-
const SyncLayoutBadge = () => {
|
|
156
|
-
const isPending = useDiagramSyncLayoutState(s => s.hasTag('pending'))
|
|
157
|
-
if (!isPending) return null
|
|
158
|
-
return (
|
|
159
|
-
<Badge color="pink" radius={'xs'} size="xs" variant="light" leftSection={<Loader color={'orange'} size={8} />}>
|
|
160
|
-
Pending...
|
|
161
|
-
</Badge>
|
|
162
|
-
)
|
|
163
|
-
}
|
|
@@ -19,6 +19,7 @@ export const NavigationButtons = () => {
|
|
|
19
19
|
<AnimatePresence>
|
|
20
20
|
{hasStepBack && (
|
|
21
21
|
<ActionIcon
|
|
22
|
+
variant="subtle"
|
|
22
23
|
component={m.button}
|
|
23
24
|
onClick={e => {
|
|
24
25
|
e.stopPropagation()
|
|
@@ -38,6 +39,7 @@ export const NavigationButtons = () => {
|
|
|
38
39
|
)}
|
|
39
40
|
{hasStepForward && (
|
|
40
41
|
<ActionIcon
|
|
42
|
+
variant="subtle"
|
|
41
43
|
component={m.button}
|
|
42
44
|
layout
|
|
43
45
|
initial={{ opacity: 0.05, transform: 'translateX(10px)' }}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { css } from '@likec4/styles/css'
|
|
2
2
|
|
|
3
3
|
export const navigationButtons = css({
|
|
4
|
-
gap: '
|
|
4
|
+
gap: 'xxs',
|
|
5
5
|
_empty: {
|
|
6
6
|
display: 'none',
|
|
7
7
|
},
|
|
8
8
|
})
|
|
9
9
|
|
|
10
10
|
export const panel = css({
|
|
11
|
-
top: '
|
|
12
|
-
left: '
|
|
13
|
-
margin: 0,
|
|
11
|
+
top: 'md',
|
|
12
|
+
left: 'md',
|
|
13
|
+
margin: '0',
|
|
14
14
|
pointerEvents: 'none',
|
|
15
15
|
'& :where(button, .action-icon, [role=\'dialog\'])': {
|
|
16
16
|
pointerEvents: 'all',
|
|
@@ -47,7 +47,7 @@ export const autolayoutButton = css({
|
|
|
47
47
|
flex: '1 1 40%',
|
|
48
48
|
textAlign: 'center',
|
|
49
49
|
fontWeight: 500,
|
|
50
|
-
padding: '4px 6px',
|
|
50
|
+
padding: '[4px 6px]',
|
|
51
51
|
fontSize: '11px',
|
|
52
52
|
zIndex: 1,
|
|
53
53
|
})
|
|
@@ -7,25 +7,28 @@ import { AnimatePresence, m } from 'motion/react'
|
|
|
7
7
|
import { MarkdownBlock } from '../../../base/primitives'
|
|
8
8
|
import { Link } from '../../../components/Link'
|
|
9
9
|
import { useDiagramContext } from '../../../hooks/useDiagram'
|
|
10
|
+
import { useCurrentViewModel } from '../../../likec4model'
|
|
10
11
|
import type { DiagramContext } from '../../../state/types'
|
|
11
12
|
import * as styles from './DiagramTitlePanel.css'
|
|
12
13
|
|
|
13
14
|
function selector(context: DiagramContext) {
|
|
14
15
|
return {
|
|
15
|
-
id: context.view.id,
|
|
16
|
-
title: context.view.title ?? 'untitled',
|
|
17
|
-
description: RichText.from(context.view.description),
|
|
18
|
-
links: context.view.links,
|
|
16
|
+
// id: context.view.id,
|
|
17
|
+
// title: context.view.title ?? 'untitled',
|
|
18
|
+
// description: RichText.from(context.view.description),
|
|
19
|
+
// links: context.view.links,
|
|
19
20
|
isNotActiveWalkthrough: context.activeWalkthrough === null,
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export function DiagramTitlePanel() {
|
|
24
|
-
const
|
|
25
|
+
const view = useCurrentViewModel()
|
|
26
|
+
const { isNotActiveWalkthrough } = useDiagramContext(selector)
|
|
25
27
|
const [isCollapsed, setCollapsed] = useLocalStorage({
|
|
26
28
|
key: 'diagram-title-webview-collapsed',
|
|
27
29
|
defaultValue: false,
|
|
28
30
|
})
|
|
31
|
+
const title = view.title ?? 'untitled'
|
|
29
32
|
const toggle = () => setCollapsed(v => !v)
|
|
30
33
|
|
|
31
34
|
return (
|
|
@@ -124,10 +127,10 @@ export function DiagramTitlePanel() {
|
|
|
124
127
|
userSelect: 'all',
|
|
125
128
|
}}>
|
|
126
129
|
<span style={{ userSelect: 'none' }}>id:{' '}</span>
|
|
127
|
-
{id}
|
|
130
|
+
{view.id}
|
|
128
131
|
</Text>
|
|
129
132
|
</Group>
|
|
130
|
-
{description.nonEmpty && (
|
|
133
|
+
{view.description.nonEmpty && (
|
|
131
134
|
<Spoiler
|
|
132
135
|
maxHeight={60}
|
|
133
136
|
showLabel={
|
|
@@ -143,10 +146,10 @@ export function DiagramTitlePanel() {
|
|
|
143
146
|
<MarkdownBlock
|
|
144
147
|
className={styles.description}
|
|
145
148
|
textScale={0.9}
|
|
146
|
-
value={description} />
|
|
149
|
+
value={view.description} />
|
|
147
150
|
</Spoiler>
|
|
148
151
|
)}
|
|
149
|
-
{description.isEmpty && (
|
|
152
|
+
{view.description.isEmpty && (
|
|
150
153
|
<Text
|
|
151
154
|
component={'div'}
|
|
152
155
|
size="xs"
|
|
@@ -154,13 +157,13 @@ export function DiagramTitlePanel() {
|
|
|
154
157
|
no description
|
|
155
158
|
</Text>
|
|
156
159
|
)}
|
|
157
|
-
{links && (
|
|
160
|
+
{view.links.length > 0 && (
|
|
158
161
|
<Stack
|
|
159
162
|
mt={'xs'}
|
|
160
163
|
gap={4}
|
|
161
164
|
justify="stretch"
|
|
162
165
|
align="stretch">
|
|
163
|
-
{links.map((link) => <Link value={link} key={link.url} />)}
|
|
166
|
+
{view.links.map((link) => <Link value={link} key={link.url} />)}
|
|
164
167
|
</Stack>
|
|
165
168
|
)}
|
|
166
169
|
</>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { css } from '@likec4/styles/css'
|
|
2
2
|
|
|
3
3
|
export 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
|
|
|
10
10
|
export const icon = css({
|
|
@@ -35,7 +35,7 @@ export const card = css({
|
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
export const tabPanel = css({
|
|
38
|
-
padding: '
|
|
38
|
+
padding: 'xxs',
|
|
39
39
|
})
|
|
40
40
|
|
|
41
41
|
// export const description = css({
|
|
@@ -69,8 +69,8 @@ export const elementNotation = css({
|
|
|
69
69
|
})
|
|
70
70
|
|
|
71
71
|
export const shapeSvg = css({
|
|
72
|
-
fill: 'likec4
|
|
73
|
-
stroke: 'likec4
|
|
72
|
+
fill: 'var(--likec4-palette-fill)',
|
|
73
|
+
stroke: 'var(--likec4-palette-stroke)',
|
|
74
74
|
strokeWidth: 1,
|
|
75
75
|
overflow: 'visible',
|
|
76
76
|
width: '100%',
|
|
@@ -84,8 +84,8 @@ export const shapeSvg = css({
|
|
|
84
84
|
export const shapeBadge = css({
|
|
85
85
|
fontWeight: 500,
|
|
86
86
|
letterSpacing: '0.2px',
|
|
87
|
-
paddingTop: 0,
|
|
88
|
-
paddingBottom: 0,
|
|
87
|
+
paddingTop: '0',
|
|
88
|
+
paddingBottom: '0',
|
|
89
89
|
textTransform: 'lowercase',
|
|
90
90
|
transition: 'all 150ms ease-in-out',
|
|
91
91
|
cursor: 'pointer',
|
|
@@ -94,6 +94,6 @@ export const shapeBadge = css({
|
|
|
94
94
|
['--badge-padding-x']: '3px',
|
|
95
95
|
['--badge-height']: '13.5px',
|
|
96
96
|
['--badge-lh']: '1',
|
|
97
|
-
['--badge-bg']: '
|
|
98
|
-
['--badge-color']: '
|
|
97
|
+
['--badge-bg']: 'var(--likec4-palette-fill)',
|
|
98
|
+
['--badge-color']: 'var(--likec4-palette-hiContrast)',
|
|
99
99
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComputedNode, type NodeNotation as ElementNotationData } from '@likec4/core'
|
|
2
|
-
import {
|
|
2
|
+
import { cx, cx as clsx } from '@likec4/styles/css'
|
|
3
3
|
import {
|
|
4
4
|
ActionIcon,
|
|
5
5
|
Badge,
|
|
@@ -48,9 +48,6 @@ const ElementNotation = ({ value }: { value: ElementNotationData }) => {
|
|
|
48
48
|
py={'sm'}
|
|
49
49
|
className={cx(
|
|
50
50
|
styles.elementNotation,
|
|
51
|
-
css({
|
|
52
|
-
likec4Palette: color,
|
|
53
|
-
}),
|
|
54
51
|
)}
|
|
55
52
|
data-likec4-color={color}
|
|
56
53
|
onMouseEnter={() => {
|
|
@@ -3,17 +3,17 @@ import type { SystemStyleObject } from '@likec4/styles/types'
|
|
|
3
3
|
|
|
4
4
|
export const container = css({
|
|
5
5
|
position: 'absolute',
|
|
6
|
-
bottom: '
|
|
7
|
-
left: '50%',
|
|
6
|
+
bottom: 'xxs',
|
|
7
|
+
left: '[50%]',
|
|
8
8
|
transform: 'translateX(-50%)',
|
|
9
|
-
padding:
|
|
10
|
-
margin:
|
|
9
|
+
padding: '[0px]',
|
|
10
|
+
margin: '[0px]',
|
|
11
11
|
display: 'flex',
|
|
12
12
|
flexDirection: 'column',
|
|
13
|
-
gap: '0.4rem',
|
|
13
|
+
gap: '[0.4rem]',
|
|
14
14
|
alignItems: 'center',
|
|
15
15
|
md: {
|
|
16
|
-
gap: '0.6rem',
|
|
16
|
+
gap: '[0.6rem]',
|
|
17
17
|
},
|
|
18
18
|
})
|
|
19
19
|
|
|
@@ -55,10 +55,10 @@ export const btn = css({
|
|
|
55
55
|
|
|
56
56
|
export const parallelStateFrame = css({
|
|
57
57
|
position: 'absolute',
|
|
58
|
-
margin: 0,
|
|
59
|
-
padding: 0,
|
|
60
|
-
top: 0,
|
|
61
|
-
left: 0,
|
|
58
|
+
margin: '0',
|
|
59
|
+
padding: '0',
|
|
60
|
+
top: '0',
|
|
61
|
+
left: '0',
|
|
62
62
|
width: '100%',
|
|
63
63
|
height: '100%',
|
|
64
64
|
border: `2px solid`,
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { LikeC4Model } from '@likec4/core/model'
|
|
1
|
+
import type { LikeC4Model, LikeC4ViewModel } from '@likec4/core/model'
|
|
2
|
+
import type { aux, DiagramView } from '@likec4/core/types'
|
|
2
3
|
import { createContext } from 'react'
|
|
3
4
|
|
|
4
5
|
export const LikeC4ModelContext = createContext<LikeC4Model<any> | null>(null)
|
|
6
|
+
|
|
7
|
+
export type CurrentViewModel = LikeC4ViewModel<aux.UnknownLayouted, DiagramView<aux.UnknownLayouted>>
|
|
8
|
+
export const CurrentViewModelContext = createContext<CurrentViewModel | null>(null)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LikeC4Project, ProjectId } from '@likec4/core/types'
|
|
2
|
+
import { createContext } from 'react'
|
|
3
|
+
|
|
4
|
+
export type LikeC4ProjectsContext = {
|
|
5
|
+
projects: ReadonlyArray<LikeC4Project>
|
|
6
|
+
onProjectChange: (id: ProjectId) => void
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const LikeC4ProjectsContext = createContext<LikeC4ProjectsContext | null>(null)
|
package/src/likec4model/index.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export {
|
|
2
|
+
useCurrentViewModel,
|
|
3
|
+
} from './useCurrentViewModel'
|
|
1
4
|
export {
|
|
2
5
|
useLikeC4ElementsTree,
|
|
3
6
|
} from './useLikeC4ElementsTree'
|
|
@@ -6,3 +9,11 @@ export {
|
|
|
6
9
|
useLikeC4Specification,
|
|
7
10
|
useLikeC4ViewModel,
|
|
8
11
|
} from './useLikeC4Model'
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
useChangeLikeC4Project,
|
|
15
|
+
useHasProjects,
|
|
16
|
+
useLikeC4ProjectId,
|
|
17
|
+
useLikeC4Projects,
|
|
18
|
+
useLikeC4ProjectsContext,
|
|
19
|
+
} from './useLikeC4Project'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext } from 'react'
|
|
2
|
+
import { type CurrentViewModel, CurrentViewModelContext } from './LikeC4ModelContext'
|
|
3
|
+
|
|
4
|
+
export function useCurrentViewModel(): CurrentViewModel {
|
|
5
|
+
const vm = useContext(CurrentViewModelContext)
|
|
6
|
+
if (!vm) {
|
|
7
|
+
throw new Error('No LikeC4ViewModel in context found')
|
|
8
|
+
}
|
|
9
|
+
return vm
|
|
10
|
+
}
|
|
@@ -1,42 +1,32 @@
|
|
|
1
1
|
import type { aux, LikeC4Model, LikeC4ViewModel } from '@likec4/core/model'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { deepEqual } from 'fast-equals'
|
|
3
|
+
import { useContext, useEffect, useState } from 'react'
|
|
4
4
|
import { LikeC4ModelContext } from './LikeC4ModelContext'
|
|
5
5
|
|
|
6
|
-
export function useLikeC4Model<A extends aux.Any = aux.
|
|
7
|
-
export function useLikeC4Model<A extends aux.Any = aux.Unknown>(type: 'layouted'): LikeC4Model.Layouted<A>
|
|
8
|
-
export function useLikeC4Model<A extends aux.Any = aux.Unknown>(type: 'computed'): LikeC4Model.Computed<A>
|
|
9
|
-
// dprint-ignore
|
|
10
|
-
export function useLikeC4Model<A extends aux.Any = aux.Unknown>(type: 'layouted' | 'computed' | undefined): LikeC4Model<A>
|
|
11
|
-
export function useLikeC4Model(type?: 'layouted' | 'computed') {
|
|
6
|
+
export function useLikeC4Model<A extends aux.Any = aux.UnknownLayouted>(): LikeC4Model<A> {
|
|
12
7
|
const model = useContext(LikeC4ModelContext)
|
|
13
|
-
|
|
14
8
|
if (!model) {
|
|
15
9
|
throw new Error('LikeC4Model not found. Make sure you have LikeC4ModelProvider.')
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
if (isString(type) && model.stage !== type) {
|
|
19
|
-
throw new Error(`Invalid LikeC4ModelContext, expected "${type}" but got "${model.stage}" in context`)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
11
|
return model
|
|
23
12
|
}
|
|
24
13
|
|
|
25
|
-
export function useLikeC4ViewModel<A extends aux.Any = aux.
|
|
26
|
-
viewId: aux.
|
|
27
|
-
): LikeC4ViewModel<
|
|
28
|
-
const model = useLikeC4Model<A>(
|
|
29
|
-
const view = model.findView(viewId)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
throw new Error(`View "${viewId}" is not layouted`)
|
|
35
|
-
}
|
|
36
|
-
return view as any
|
|
14
|
+
export function useLikeC4ViewModel<A extends aux.Any = aux.UnknownLayouted>(
|
|
15
|
+
viewId: aux.ViewId<A>,
|
|
16
|
+
): LikeC4ViewModel<A> {
|
|
17
|
+
const model = useLikeC4Model<A>()
|
|
18
|
+
// const [view, setView] = useState(() => model.findView(viewId))
|
|
19
|
+
// useEffect(() => {
|
|
20
|
+
// setView(model.findView(viewId))
|
|
21
|
+
// }, [model, viewId])
|
|
22
|
+
return model.view(viewId)
|
|
37
23
|
}
|
|
38
24
|
|
|
39
25
|
export function useLikeC4Specification() {
|
|
40
26
|
const model = useLikeC4Model()
|
|
41
|
-
|
|
27
|
+
const [specification, setSpecification] = useState(model.$data.specification)
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setSpecification(current => deepEqual(current, model.$data.specification) ? current : model.$data.specification)
|
|
30
|
+
}, [model])
|
|
31
|
+
return specification
|
|
42
32
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type LikeC4Project, type ProjectId } from '@likec4/core/types'
|
|
2
|
+
import { useContext } from 'react'
|
|
3
|
+
import { LikeC4ModelContext } from './LikeC4ModelContext'
|
|
4
|
+
import { LikeC4ProjectsContext } from './LikeC4ProjectsContext'
|
|
5
|
+
|
|
6
|
+
const emptyProjects: ReadonlyArray<LikeC4Project> = []
|
|
7
|
+
/**
|
|
8
|
+
* @returns The list of available projects, or empty array if no projects are available.
|
|
9
|
+
*/
|
|
10
|
+
export function useLikeC4Projects(): ReadonlyArray<LikeC4Project> {
|
|
11
|
+
const ctx = useContext(LikeC4ProjectsContext)
|
|
12
|
+
if (!ctx) {
|
|
13
|
+
return emptyProjects
|
|
14
|
+
}
|
|
15
|
+
return ctx.projects
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const emptyOnProjectChange: (id: ProjectId) => void = () => {}
|
|
19
|
+
/**
|
|
20
|
+
* @returns The callback to change current project.
|
|
21
|
+
*/
|
|
22
|
+
export function useChangeLikeC4Project(): (id: ProjectId) => void {
|
|
23
|
+
const ctx = useContext(LikeC4ProjectsContext)
|
|
24
|
+
if (!ctx) {
|
|
25
|
+
return emptyOnProjectChange
|
|
26
|
+
}
|
|
27
|
+
return ctx.onProjectChange
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const emptyContext: LikeC4ProjectsContext = {
|
|
31
|
+
projects: emptyProjects,
|
|
32
|
+
onProjectChange: emptyOnProjectChange,
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @returns The callback to change current project.
|
|
36
|
+
*/
|
|
37
|
+
export function useLikeC4ProjectsContext(): LikeC4ProjectsContext {
|
|
38
|
+
return useContext(LikeC4ProjectsContext) ?? emptyContext
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @returns True if there are more than one project available in the context.
|
|
43
|
+
*/
|
|
44
|
+
export function useHasProjects(): boolean {
|
|
45
|
+
const ctx = useContext(LikeC4ProjectsContext)
|
|
46
|
+
if (!ctx) {
|
|
47
|
+
return false
|
|
48
|
+
}
|
|
49
|
+
return ctx.projects.length > 1
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @returns The current project id.
|
|
54
|
+
*/
|
|
55
|
+
export function useLikeC4ProjectId(): ProjectId {
|
|
56
|
+
const ctx = useContext(LikeC4ModelContext)
|
|
57
|
+
if (!ctx) {
|
|
58
|
+
throw new Error('No LikeC4ModelContext found')
|
|
59
|
+
}
|
|
60
|
+
return ctx.projectId as ProjectId
|
|
61
|
+
}
|