@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
|
@@ -11,7 +11,7 @@ import { Overlay } from '../overlays/overlay/Overlay.js';
|
|
|
11
11
|
import { ShadowRoot } from './ShadowRoot.js';
|
|
12
12
|
import { useColorScheme, useShadowRootStyle, cssInteractive } from './styles.css.js';
|
|
13
13
|
import { ViewNotFound, ErrorMessage } from './ViewNotFound.js';
|
|
14
|
-
import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.
|
|
14
|
+
import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
15
15
|
|
|
16
16
|
function LikeC4View({
|
|
17
17
|
viewId,
|
|
@@ -31,6 +31,12 @@ function LikeC4View({
|
|
|
31
31
|
}
|
|
32
32
|
return /* @__PURE__ */ jsx(LikeC4ViewInner, { view: view.$view, ...props });
|
|
33
33
|
}
|
|
34
|
+
const DEFAULT_BROWSER_PADDING = {
|
|
35
|
+
top: "50px",
|
|
36
|
+
bottom: "16px",
|
|
37
|
+
left: "16px",
|
|
38
|
+
right: "16px"
|
|
39
|
+
};
|
|
34
40
|
const LikeC4ViewInner = memo(({
|
|
35
41
|
view,
|
|
36
42
|
className,
|
|
@@ -60,7 +66,7 @@ const LikeC4ViewInner = memo(({
|
|
|
60
66
|
renderNodes,
|
|
61
67
|
...props
|
|
62
68
|
}) => {
|
|
63
|
-
const likec4model = useLikeC4Model(
|
|
69
|
+
const likec4model = useLikeC4Model();
|
|
64
70
|
const colorScheme = useColorScheme(explicitColorScheme);
|
|
65
71
|
const [shadowRootProps, cssstyle] = useShadowRootStyle(keepAspectRatio, view);
|
|
66
72
|
const [browserViewId, onNavigateTo] = useState(null);
|
|
@@ -149,10 +155,10 @@ const LikeC4ViewInner = memo(({
|
|
|
149
155
|
enableRelationshipDetails: true,
|
|
150
156
|
enableSearch: true,
|
|
151
157
|
enableElementTags: true,
|
|
152
|
-
controls:
|
|
158
|
+
controls: "next",
|
|
153
159
|
readonly: true,
|
|
154
160
|
fitView: true,
|
|
155
|
-
fitViewPadding:
|
|
161
|
+
fitViewPadding: DEFAULT_BROWSER_PADDING,
|
|
156
162
|
...props,
|
|
157
163
|
...browserProps,
|
|
158
164
|
showNotations: (browserProps.showNotations ?? true) && (browserView.notation?.nodes.length ?? 0) > 0,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { WhereOperator } from '@likec4/core/types';
|
|
1
|
+
import { aux, WhereOperator } from '@likec4/core/types';
|
|
2
2
|
import { CSSProperties } from 'react';
|
|
3
|
-
import { CustomNodes, ElementIconRenderer, OverrideReactFlowProps, PaddingWithUnit } from '../LikeC4Diagram.props';
|
|
4
|
-
import type * as aux from '@likec4/core/types/_aux';
|
|
3
|
+
import { CustomNodes, ElementIconRenderer, OverrideReactFlowProps, PaddingWithUnit, ViewPadding } from '../LikeC4Diagram.props';
|
|
5
4
|
export interface LikeC4ViewProps<A extends aux.Any> {
|
|
6
5
|
/**
|
|
7
6
|
* View to display.
|
|
@@ -58,8 +57,10 @@ export interface LikeC4ViewProps<A extends aux.Any> {
|
|
|
58
57
|
/**
|
|
59
58
|
* Padding around the diagram
|
|
60
59
|
* @default '8px'
|
|
60
|
+
*
|
|
61
|
+
* @see {@link ViewPadding}
|
|
61
62
|
*/
|
|
62
|
-
fitViewPadding?:
|
|
63
|
+
fitViewPadding?: ViewPadding | undefined;
|
|
63
64
|
/**
|
|
64
65
|
* Display diagram title / description
|
|
65
66
|
*
|
|
@@ -151,9 +152,11 @@ export interface LikeC4BrowserProps {
|
|
|
151
152
|
fitViewPadding?: PaddingWithUnit | undefined;
|
|
152
153
|
/**
|
|
153
154
|
* Show/hide panel with top left controls,
|
|
154
|
-
*
|
|
155
|
+
* - `next` - show navigation panel (Experimental)
|
|
156
|
+
*
|
|
157
|
+
* @default `next`
|
|
155
158
|
*/
|
|
156
|
-
controls?: boolean | undefined;
|
|
159
|
+
controls?: boolean | 'next' | undefined;
|
|
157
160
|
/**
|
|
158
161
|
* Display diagram title / description
|
|
159
162
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { aux } from '@likec4/core/types';
|
|
1
2
|
import { CSSProperties } from 'react';
|
|
2
3
|
import { LikeC4DiagramProps } from '../LikeC4Diagram';
|
|
3
|
-
import type * as aux from '@likec4/core/types/_aux';
|
|
4
4
|
export type ReactLikeC4Props<A extends aux.Any> = Omit<LikeC4DiagramProps<A>, 'view'> & {
|
|
5
5
|
viewId: aux.ViewId<A>;
|
|
6
6
|
/**
|
package/dist/bundle/custom.js
CHANGED
|
@@ -25,6 +25,7 @@ export { useCurrentViewId } from '../hooks/useCurrentViewId.js';
|
|
|
25
25
|
export { useDiagram, useDiagramContext } from '../hooks/useDiagram.js';
|
|
26
26
|
export { useDiagramActorRef } from '../hooks/safeContext.js';
|
|
27
27
|
export { useXYFlow, useXYInternalNode, useXYStore, useXYStoreApi } from '../hooks/useXYFlow.js';
|
|
28
|
+
export { useCurrentViewModel } from '../likec4model/useCurrentViewModel.js';
|
|
28
29
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from '../likec4model/useLikeC4Model.js';
|
|
29
30
|
export { useMantinePortalProps } from '../hooks/useMantinePortalProps.js';
|
|
30
31
|
export { useSetState } from '../hooks/useSetState.js';
|
package/dist/bundle/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export type { ChangeEvent, CustomNodes, DiagramNodeWithNavigate, ElementIconRend
|
|
|
2
2
|
export { LikeC4View } from './LikeC4View';
|
|
3
3
|
export type { LikeC4BrowserProps, LikeC4ViewProps } from './LikeC4View.props';
|
|
4
4
|
export { ReactLikeC4, type ReactLikeC4Props } from './ReactLikeC4';
|
|
5
|
-
export {
|
|
5
|
+
export { LikeC4ProjectsProvider, type LikeC4ProjectsProviderProps } from '../LikeC4ProjectsProvider';
|
|
6
|
+
export { LikeC4ModelProvider, type LikeC4ModelProviderProps } from './LikeC4ModelProvider';
|
|
6
7
|
export { ViewNotFound } from './ViewNotFound';
|
|
7
8
|
export * from '../custom/hooks';
|
package/dist/bundle/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { LikeC4View } from './LikeC4View.js';
|
|
2
2
|
export { ReactLikeC4 } from './ReactLikeC4.js';
|
|
3
|
+
export { LikeC4ProjectsProvider } from '../LikeC4ProjectsProvider.js';
|
|
3
4
|
export { LikeC4ModelProvider } from './LikeC4ModelProvider.js';
|
|
4
5
|
export { ViewNotFound } from './ViewNotFound.js';
|
|
5
6
|
export { useDiagramEventHandlers } from '../context/DiagramEventHandlers.js';
|
|
@@ -8,6 +9,7 @@ export { useCurrentViewId } from '../hooks/useCurrentViewId.js';
|
|
|
8
9
|
export { useDiagram, useDiagramContext } from '../hooks/useDiagram.js';
|
|
9
10
|
export { useDiagramActorRef } from '../hooks/safeContext.js';
|
|
10
11
|
export { useXYFlow, useXYInternalNode, useXYStore, useXYStoreApi } from '../hooks/useXYFlow.js';
|
|
12
|
+
export { useCurrentViewModel } from '../likec4model/useCurrentViewModel.js';
|
|
11
13
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from '../likec4model/useLikeC4Model.js';
|
|
12
14
|
export { useMantinePortalProps } from '../hooks/useMantinePortalProps.js';
|
|
13
15
|
export { useSetState } from '../hooks/useSetState.js';
|
|
@@ -12,7 +12,7 @@ const DefaultTheme = createTheme({
|
|
|
12
12
|
primaryColor: "indigo",
|
|
13
13
|
cursorType: "pointer",
|
|
14
14
|
defaultRadius: "sm",
|
|
15
|
-
fontFamily: "var(--
|
|
15
|
+
fontFamily: "var(--likec4-app-font, var(--likec4-app-font-default))",
|
|
16
16
|
headings: {
|
|
17
17
|
fontWeight: "500",
|
|
18
18
|
sizes: {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { FallbackProps } from 'react-error-boundary';
|
|
1
|
+
import { ErrorBoundaryProps, FallbackProps } from 'react-error-boundary';
|
|
2
2
|
export declare function ErrorFallback({ error, resetErrorBoundary }: FallbackProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function ErrorBoundary(props: Pick<ErrorBoundaryProps, 'onReset' | 'onError' | 'children'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { Box } from '@likec4/styles/jsx';
|
|
3
3
|
import { Notification, ScrollAreaAutosize, Code, Group, Button } from '@mantine/core';
|
|
4
|
-
import
|
|
4
|
+
import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
|
|
5
|
+
import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
5
6
|
|
|
6
7
|
function ErrorFallback({ error, resetErrorBoundary }) {
|
|
7
8
|
const errorString = error instanceof Error ? error.message : "Unknown error";
|
|
8
|
-
return /* @__PURE__ */ jsx(Box, { pos: "fixed", top: 0, left: 0, w: "100%", p: 0, style: { zIndex: 1e3 }, children: /* @__PURE__ */ jsxs(
|
|
9
|
+
return /* @__PURE__ */ jsx(Box, { pos: "fixed", top: "0", left: "0", w: "100%", p: "0", style: { zIndex: 1e3 }, children: /* @__PURE__ */ jsxs(
|
|
9
10
|
Notification,
|
|
10
11
|
{
|
|
11
12
|
icon: /* @__PURE__ */ jsx(IconX, { style: { width: 16, height: 16 } }),
|
|
@@ -25,5 +26,17 @@ function ErrorFallback({ error, resetErrorBoundary }) {
|
|
|
25
26
|
}
|
|
26
27
|
) });
|
|
27
28
|
}
|
|
29
|
+
function ErrorBoundary(props) {
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
ErrorBoundary$1,
|
|
32
|
+
{
|
|
33
|
+
FallbackComponent: ErrorFallback,
|
|
34
|
+
onError: (err, info) => {
|
|
35
|
+
console.error(err, info);
|
|
36
|
+
},
|
|
37
|
+
...props
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
28
41
|
|
|
29
|
-
export { ErrorFallback };
|
|
42
|
+
export { ErrorBoundary, ErrorFallback };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
const GithubIcon = forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
5
|
+
"svg",
|
|
6
|
+
{
|
|
7
|
+
height: "24",
|
|
8
|
+
width: "24",
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
...props,
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
ref,
|
|
13
|
+
children: /* @__PURE__ */ jsx("path", { d: "M12 1C5.923 1 1 5.923 1 12c0 4.867 3.149 8.979 7.521 10.436.55.096.756-.233.756-.522 0-.262-.013-1.128-.013-2.049-2.764.509-3.479-.674-3.699-1.292-.124-.317-.66-1.293-1.127-1.554-.385-.207-.936-.715-.014-.729.866-.014 1.485.797 1.691 1.128.99 1.663 2.571 1.196 3.204.907.096-.715.385-1.196.701-1.471-2.448-.275-5.005-1.224-5.005-5.432 0-1.196.426-2.186 1.128-2.956-.111-.275-.496-1.402.11-2.915 0 0 .921-.288 3.024 1.128a10.193 10.193 0 0 1 2.75-.371c.936 0 1.871.123 2.75.371 2.104-1.43 3.025-1.128 3.025-1.128.605 1.513.221 2.64.111 2.915.701.77 1.127 1.747 1.127 2.956 0 4.222-2.571 5.157-5.019 5.432.399.344.743 1.004.743 2.035 0 1.471-.014 2.654-.014 3.025 0 .289.206.632.756.522C19.851 20.979 23 16.854 23 12c0-6.077-4.922-11-11-11Z" })
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
export { GithubIcon };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Link as LinkData } from '@likec4/core';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { BadgeProps } from '@mantine/core';
|
|
3
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
export declare const Link: ForwardRefExoticComponent<Omit<BadgeProps, "children" | "classNames"> & {
|
|
4
5
|
value: LinkData;
|
|
5
|
-
}
|
|
6
|
+
} & RefAttributes<HTMLDivElement>>;
|
package/dist/components/Link.js
CHANGED
|
@@ -1,108 +1,105 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { css, cx } from '@likec4/styles/css';
|
|
3
|
+
import { Badge, CopyButton, ActionIcon } from '@mantine/core';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { GithubIcon } from './GithubIcon.js';
|
|
6
|
+
import IconCheck from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
|
|
7
|
+
import IconCopy from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js';
|
|
7
8
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
color: "mantine.colors.dark[1]"
|
|
24
|
-
},
|
|
25
|
-
_hover: {
|
|
26
|
-
transitionTimingFunction: "out",
|
|
27
|
-
color: "mantine.colors.defaultColor",
|
|
28
|
-
background: "mantine.colors.defaultHover"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
variants: {
|
|
32
|
-
size: {
|
|
33
|
-
sm: {
|
|
34
|
-
minHeight: "22px",
|
|
35
|
-
padding: "2px 8px 2px 2px"
|
|
36
|
-
},
|
|
37
|
-
md: {
|
|
38
|
-
minHeight: "30px",
|
|
39
|
-
padding: "3px 16px 3px 3px"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const titleBox = css({
|
|
45
|
-
flex: "1 1 100%",
|
|
46
|
-
transition: `transform 100ms {easings.inOut}`,
|
|
47
|
-
_groupHover: {
|
|
48
|
-
transitionTimingFunction: "out",
|
|
49
|
-
transitionDelay: "50ms",
|
|
50
|
-
transform: "translateX(1px)"
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
function Link({
|
|
54
|
-
value,
|
|
55
|
-
size = "md"
|
|
56
|
-
}) {
|
|
57
|
-
const isNormalSize = size === "md";
|
|
58
|
-
const url = value.url.includes("://") ? value.url : new window.URL(value.url, window.location.href).toString();
|
|
59
|
-
return /* @__PURE__ */ jsx(CopyButton, { value: url, children: ({ copied, copy }) => /* @__PURE__ */ jsxs(
|
|
60
|
-
Anchor,
|
|
61
|
-
{
|
|
62
|
-
href: url,
|
|
63
|
-
target: "_blank",
|
|
64
|
-
underline: "never",
|
|
65
|
-
className: cx(
|
|
66
|
-
"group",
|
|
67
|
-
link({ size })
|
|
68
|
-
),
|
|
69
|
-
onClick: stopPropagation,
|
|
70
|
-
children: [
|
|
71
|
-
/* @__PURE__ */ jsx(
|
|
9
|
+
const GITHUB_PREFIX = "https://github.com/";
|
|
10
|
+
const Link = forwardRef(
|
|
11
|
+
({ value, className, ...props }, ref) => {
|
|
12
|
+
const url = value.url.includes("://") ? value.url : new window.URL(value.url, window.location.href).toString();
|
|
13
|
+
let isGithub = url.startsWith(GITHUB_PREFIX);
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Badge,
|
|
16
|
+
{
|
|
17
|
+
ref,
|
|
18
|
+
variant: "default",
|
|
19
|
+
radius: "sm",
|
|
20
|
+
size: "sm",
|
|
21
|
+
tt: "none",
|
|
22
|
+
leftSection: value.title ? /* @__PURE__ */ jsx(Fragment, { children: value.title }) : null,
|
|
23
|
+
rightSection: /* @__PURE__ */ jsx(CopyButton, { value: url, timeout: 1500, children: ({ copy, copied }) => /* @__PURE__ */ jsx(
|
|
72
24
|
ActionIcon,
|
|
73
25
|
{
|
|
74
26
|
className: css({
|
|
75
|
-
|
|
27
|
+
opacity: copied ? 1 : 0.45,
|
|
28
|
+
transition: "fast",
|
|
29
|
+
_hover: {
|
|
30
|
+
opacity: 1
|
|
31
|
+
}
|
|
76
32
|
}),
|
|
77
33
|
tabIndex: -1,
|
|
78
|
-
size:
|
|
79
|
-
variant: copied ? "light" : "
|
|
34
|
+
size: "20",
|
|
35
|
+
variant: copied ? "light" : "transparent",
|
|
80
36
|
color: copied ? "teal" : "gray",
|
|
37
|
+
"data-active": copied,
|
|
81
38
|
onClick: (e) => {
|
|
82
39
|
e.stopPropagation();
|
|
83
40
|
e.preventDefault();
|
|
84
41
|
copy();
|
|
85
42
|
},
|
|
86
|
-
children: copied ? /* @__PURE__ */ jsx(IconCheck, {}) : /* @__PURE__ */ jsx(IconCopy, {
|
|
43
|
+
children: copied ? /* @__PURE__ */ jsx(IconCheck, {}) : /* @__PURE__ */ jsx(IconCopy, { stroke: 2.5 })
|
|
87
44
|
}
|
|
88
|
-
),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
45
|
+
) }),
|
|
46
|
+
...props,
|
|
47
|
+
className: cx(className, "group"),
|
|
48
|
+
classNames: {
|
|
49
|
+
root: css({
|
|
50
|
+
flexWrap: "nowrap",
|
|
51
|
+
minHeight: 24,
|
|
52
|
+
maxWidth: 500,
|
|
53
|
+
userSelect: "all",
|
|
54
|
+
pr: "0",
|
|
55
|
+
_hover: {
|
|
56
|
+
backgroundColor: {
|
|
57
|
+
base: "mantine.colors.gray[1]",
|
|
58
|
+
_dark: "mantine.colors.dark[5]"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
section: css({
|
|
63
|
+
'&:is([data-position="left"])': {
|
|
64
|
+
color: "mantine.colors.dimmed",
|
|
65
|
+
userSelect: "none",
|
|
66
|
+
pointerEvents: "none",
|
|
67
|
+
_groupHover: {
|
|
68
|
+
color: "[inherit]",
|
|
69
|
+
opacity: 0.7
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}),
|
|
73
|
+
label: css({
|
|
74
|
+
"& > a": {
|
|
75
|
+
color: "[inherit]",
|
|
76
|
+
cursor: "pointer",
|
|
77
|
+
transition: "fast",
|
|
78
|
+
opacity: {
|
|
79
|
+
base: 0.7,
|
|
80
|
+
_hover: 1
|
|
81
|
+
},
|
|
82
|
+
textDecoration: {
|
|
83
|
+
base: "none",
|
|
84
|
+
_hover: "underline"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
},
|
|
89
|
+
children: /* @__PURE__ */ jsxs("a", { href: url, target: "_blank", children: [
|
|
90
|
+
isGithub && /* @__PURE__ */ jsx(
|
|
91
|
+
GithubIcon,
|
|
92
92
|
{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
lh: isNormalSize ? 1.3 : 1.2,
|
|
97
|
-
fw: value.title ? 500 : 400,
|
|
98
|
-
children: value.title || url
|
|
93
|
+
height: "12",
|
|
94
|
+
width: "12",
|
|
95
|
+
style: { verticalAlign: "middle", marginRight: "4px" }
|
|
99
96
|
}
|
|
100
97
|
),
|
|
101
|
-
|
|
98
|
+
isGithub ? url.replace(GITHUB_PREFIX, "") : url
|
|
102
99
|
] })
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
);
|
|
107
104
|
|
|
108
105
|
export { Link };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NavLinkProps } from '@mantine/core';
|
|
2
|
+
import { ComponentPropsWithoutRef, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface NavigationLinkProps extends Omit<NavLinkProps, 'classNames'>, Omit<ComponentPropsWithoutRef<'button'>, keyof NavLinkProps> {
|
|
4
|
+
truncateLabel?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const NavigationLink: ForwardRefExoticComponent<NavigationLinkProps & RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cx } from '@likec4/styles/css';
|
|
3
|
+
import { navigationLink } from '@likec4/styles/recipes';
|
|
4
|
+
import { NavLink } from '@mantine/core';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
const NavigationLink = forwardRef(({ className, truncateLabel = true, ...others }, ref) => /* @__PURE__ */ jsx(
|
|
8
|
+
NavLink,
|
|
9
|
+
{
|
|
10
|
+
...others,
|
|
11
|
+
component: "button",
|
|
12
|
+
classNames: navigationLink({
|
|
13
|
+
truncateLabel
|
|
14
|
+
}),
|
|
15
|
+
className: cx(
|
|
16
|
+
"group",
|
|
17
|
+
"mantine-active",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
ref
|
|
21
|
+
}
|
|
22
|
+
));
|
|
23
|
+
NavigationLink.displayName = "NavigationLink";
|
|
24
|
+
|
|
25
|
+
export { NavigationLink };
|
|
@@ -3,7 +3,7 @@ import { css } from '@likec4/styles/css';
|
|
|
3
3
|
const root = css({
|
|
4
4
|
height: "30px",
|
|
5
5
|
paddingLeft: "sm",
|
|
6
|
-
paddingRight: "
|
|
6
|
+
paddingRight: "1",
|
|
7
7
|
borderRadius: "sm",
|
|
8
8
|
// TODO
|
|
9
9
|
// color: fallbackVar('var(--search-color)', 'mantine.colors.placeholder)',
|
|
@@ -39,21 +39,22 @@ const placeholder = css({
|
|
|
39
39
|
fontSize: "sm",
|
|
40
40
|
// mantine.fontSizes.sm,
|
|
41
41
|
fontWeight: 500,
|
|
42
|
-
paddingRight: "
|
|
42
|
+
paddingRight: "2.5",
|
|
43
|
+
// 10px
|
|
43
44
|
color: "mantine.colors.placeholder",
|
|
44
45
|
flex: "1",
|
|
45
46
|
sm: {
|
|
46
|
-
paddingRight: "30px"
|
|
47
|
+
paddingRight: "[30px]"
|
|
47
48
|
},
|
|
48
49
|
md: {
|
|
49
|
-
paddingRight: "50px"
|
|
50
|
+
paddingRight: "[50px]"
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
const shortcut = css({
|
|
53
54
|
fontSize: "11px",
|
|
54
55
|
fontWeight: 600,
|
|
55
56
|
lineHeight: 1,
|
|
56
|
-
padding: "4px 7px",
|
|
57
|
+
padding: "[4px 7px]",
|
|
57
58
|
borderRadius: "sm",
|
|
58
59
|
border: "1px solid",
|
|
59
60
|
transition: "fast",
|
|
@@ -3,7 +3,7 @@ import { cx } from '@likec4/styles/css';
|
|
|
3
3
|
import { UnstyledButton, Group, Text } from '@mantine/core';
|
|
4
4
|
import { isMacOs } from '@xyflow/system';
|
|
5
5
|
import { placeholder, shortcut, root } from './SearchControl.css.js';
|
|
6
|
-
import IconSearch from '../node_modules/.pnpm/@tabler_icons-react@3.
|
|
6
|
+
import IconSearch from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js';
|
|
7
7
|
|
|
8
8
|
function SearchControl({ className, ...others }) {
|
|
9
9
|
const isMac = isMacOs();
|
|
@@ -4,7 +4,6 @@ export type ControlsCustomLayoutProps = {
|
|
|
4
4
|
navigationButtons: ReactNode;
|
|
5
5
|
search: ReactNode;
|
|
6
6
|
actionsGroup: ReactNode;
|
|
7
|
-
syncInProgressBadge: ReactNode;
|
|
8
7
|
};
|
|
9
8
|
export type ControlsCustomLayout = (props: ControlsCustomLayoutProps) => ReactNode;
|
|
10
9
|
export declare const ControlsCustomLayoutProvider: ({ children, value }: {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aux } from '@likec4/core/types';
|
|
2
2
|
import { PropsWithChildren, RefObject } from 'react';
|
|
3
3
|
import { LikeC4DiagramEventHandlers } from '../LikeC4Diagram.props';
|
|
4
4
|
type RequiredOrNull<T> = {
|
|
5
5
|
[P in keyof T]-?: NonNullable<T[P]> | null;
|
|
6
6
|
};
|
|
7
|
-
type
|
|
8
|
-
handlersRef: RefObject<LikeC4DiagramEventHandlers<Any>>;
|
|
7
|
+
export type DiagramEventHandlersContext = RequiredOrNull<LikeC4DiagramEventHandlers<aux.Any>> & {
|
|
8
|
+
handlersRef: RefObject<LikeC4DiagramEventHandlers<aux.Any>>;
|
|
9
9
|
};
|
|
10
|
-
export declare function DiagramEventHandlers<A extends Any>({ handlers, children, }: PropsWithChildren<{
|
|
10
|
+
export declare function DiagramEventHandlers<A extends aux.Any>({ handlers, children, }: PropsWithChildren<{
|
|
11
11
|
handlers: LikeC4DiagramEventHandlers<A>;
|
|
12
12
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare function useDiagramEventHandlers():
|
|
14
|
-
export declare function useDiagramEventHandlersRef(): RefObject<LikeC4DiagramEventHandlers<
|
|
13
|
+
export declare function useDiagramEventHandlers(): DiagramEventHandlersContext;
|
|
14
|
+
export declare function useDiagramEventHandlersRef<A extends aux.Any = aux.Any>(): RefObject<LikeC4DiagramEventHandlers<A>>;
|
|
15
15
|
export {};
|
|
@@ -16,7 +16,7 @@ const HandlerNames = [
|
|
|
16
16
|
"onChange",
|
|
17
17
|
"onCanvasDblClick"
|
|
18
18
|
];
|
|
19
|
-
const
|
|
19
|
+
const DiagramEventHandlersReactContext = createContext({
|
|
20
20
|
...mapToObj(HandlerNames, (name) => [name, null]),
|
|
21
21
|
handlersRef: {
|
|
22
22
|
current: {}
|
|
@@ -37,13 +37,10 @@ function DiagramEventHandlers({
|
|
|
37
37
|
}),
|
|
38
38
|
handlersRef
|
|
39
39
|
}), [handlersRef, ...deps]);
|
|
40
|
-
return /* @__PURE__ */ jsx(
|
|
40
|
+
return /* @__PURE__ */ jsx(DiagramEventHandlersReactContext.Provider, { value, children });
|
|
41
41
|
}
|
|
42
42
|
function useDiagramEventHandlers() {
|
|
43
|
-
return useContext(
|
|
44
|
-
}
|
|
45
|
-
function useDiagramEventHandlersRef() {
|
|
46
|
-
return useContext(DiagramEventHandlersContext).handlersRef;
|
|
43
|
+
return useContext(DiagramEventHandlersReactContext);
|
|
47
44
|
}
|
|
48
45
|
|
|
49
|
-
export { DiagramEventHandlers, useDiagramEventHandlers
|
|
46
|
+
export { DiagramEventHandlers, useDiagramEventHandlers };
|
|
@@ -2,8 +2,11 @@ import { ExclusiveUnion } from '@likec4/core/types';
|
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
declare const FeatureNames: readonly ["Controls", "ReadOnly", "FocusMode", "NavigateTo", "ElementDetails", "RelationshipDetails", "RelationshipBrowser", "Search", "NavigationButtons", "Notations", "DynamicViewWalkthrough", "EdgeEditing", "ViewTitle", "FitView", "Vscode", "ElementTags"];
|
|
4
4
|
export type FeatureName = typeof FeatureNames[number];
|
|
5
|
+
type CustomFeatures = {
|
|
6
|
+
enableControls: 'next' | boolean;
|
|
7
|
+
};
|
|
5
8
|
export type EnabledFeatures = {
|
|
6
|
-
[P in `enable${FeatureName}`]: boolean;
|
|
9
|
+
[P in `enable${FeatureName}`]: P extends keyof CustomFeatures ? CustomFeatures[P] : boolean;
|
|
7
10
|
};
|
|
8
11
|
export declare const AllDisabled: EnabledFeatures;
|
|
9
12
|
export declare function DiagramFeatures({ children, features, overrides, }: PropsWithChildren<ExclusiveUnion<{
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
3
|
import { useContext, createContext } from 'react';
|
|
4
|
-
import IconCylinder from '../node_modules/.pnpm/@tabler_icons-react@3.
|
|
5
|
-
import IconRectangularPrism from '../node_modules/.pnpm/@tabler_icons-react@3.
|
|
6
|
-
import IconReorder from '../node_modules/.pnpm/@tabler_icons-react@3.
|
|
7
|
-
import IconUser from '../node_modules/.pnpm/@tabler_icons-react@3.
|
|
8
|
-
import IconDeviceMobile from '../node_modules/.pnpm/@tabler_icons-react@3.
|
|
9
|
-
import IconBrowser from '../node_modules/.pnpm/@tabler_icons-react@3.
|
|
4
|
+
import IconCylinder from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js';
|
|
5
|
+
import IconRectangularPrism from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js';
|
|
6
|
+
import IconReorder from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js';
|
|
7
|
+
import IconUser from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js';
|
|
8
|
+
import IconDeviceMobile from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js';
|
|
9
|
+
import IconBrowser from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js';
|
|
10
10
|
|
|
11
11
|
const IconRendererContext = createContext(null);
|
|
12
12
|
function IconRendererProvider({
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { DEV } from 'esm-env';
|
|
3
|
+
import { useLikeC4ViewModel } from '../likec4model/useLikeC4Model.js';
|
|
3
4
|
import { customNode } from '../base/primitives/customNode.js';
|
|
4
5
|
|
|
5
6
|
function customDiagramNode(Node) {
|
|
6
7
|
return customNode((props) => {
|
|
7
|
-
const viewModel =
|
|
8
|
+
const viewModel = useLikeC4ViewModel(props.data.viewId);
|
|
9
|
+
if (!viewModel) {
|
|
10
|
+
if (DEV) {
|
|
11
|
+
throw new Error(`View "${props.data.viewId}" not found, requested by customNode "${props.id}"`);
|
|
12
|
+
}
|
|
13
|
+
console.error(`View "${props.data.viewId}" not found in likec4model`, { props });
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
8
16
|
const model = viewModel.node(props.id);
|
|
9
17
|
return /* @__PURE__ */ jsx(Node, { nodeProps: props, nodeModel: model });
|
|
10
18
|
});
|
package/dist/custom/hooks.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { type EnabledFeatures, type FeatureName, useEnabledFeatures, } from '../
|
|
|
4
4
|
export { useCurrentViewId, } from '../hooks/useCurrentViewId';
|
|
5
5
|
export { type DiagramApi, useDiagram, useDiagramActorRef, useDiagramContext, } from '../hooks/useDiagram';
|
|
6
6
|
export { useXYFlow, useXYInternalNode, useXYStore, useXYStoreApi, type XYFlowInstance, type XYStoreApi, } from '../hooks/useXYFlow';
|
|
7
|
+
export { useCurrentViewModel, } from '../likec4model/useCurrentViewModel';
|
|
7
8
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel, } from '../likec4model/useLikeC4Model';
|
|
8
9
|
export { useMantinePortalProps } from '../hooks/useMantinePortalProps';
|
|
9
10
|
export { useSetState } from '../hooks/useSetState';
|
package/dist/custom/index.js
CHANGED
|
@@ -25,6 +25,7 @@ export { useCurrentViewId } from '../hooks/useCurrentViewId.js';
|
|
|
25
25
|
export { useDiagram, useDiagramContext } from '../hooks/useDiagram.js';
|
|
26
26
|
export { useDiagramActorRef } from '../hooks/safeContext.js';
|
|
27
27
|
export { useXYFlow, useXYInternalNode, useXYStore, useXYStoreApi } from '../hooks/useXYFlow.js';
|
|
28
|
+
export { useCurrentViewModel } from '../likec4model/useCurrentViewModel.js';
|
|
28
29
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from '../likec4model/useLikeC4Model.js';
|
|
29
30
|
export { useMantinePortalProps } from '../hooks/useMantinePortalProps.js';
|
|
30
31
|
export { useSetState } from '../hooks/useSetState.js';
|