@likec4/diagram 1.48.0 → 1.49.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/README.md +7 -9
- package/adhoc-editor/package.json +4 -0
- package/dist/LikeC4Diagram.d.ts +2 -1
- package/dist/LikeC4Diagram.js +77 -79
- package/dist/LikeC4Diagram.props.d.ts +9 -1
- package/dist/LikeC4ModelProvider.d.ts +4 -4
- package/dist/LikeC4ModelProvider.js +2 -2
- package/dist/LikeC4ProjectsOverview.d.ts +3 -2
- package/dist/LikeC4ProjectsProvider.d.ts +2 -1
- package/dist/LikeC4ProjectsProvider.js +4 -4
- package/dist/LikeC4Styles.d.ts +2 -1
- package/dist/LikeC4View.d.ts +14 -1
- package/dist/LikeC4View.js +31 -18
- package/dist/ReactLikeC4.d.ts +2 -1
- package/dist/ReactLikeC4.js +3 -1
- package/dist/StaticLikeC4Diagram.d.ts +2 -1
- package/dist/StaticLikeC4Diagram.js +1 -0
- package/dist/_virtual/store-1b2fbb72.cjs.js +3 -0
- package/dist/_virtual/xstate-store-react.cjs.js +5 -0
- package/dist/_virtual/xstate-store-react.cjs2.js +3 -0
- package/dist/adhoc-editor/EditorPanel.d.ts +1 -0
- package/dist/adhoc-editor/EditorPanel.js +105 -0
- package/dist/adhoc-editor/ElementsTree.d.ts +2 -0
- package/dist/adhoc-editor/ElementsTree.js +142 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +1 -1
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +46 -43
- package/dist/adhoc-editor/components/Tree.d.ts +48 -0
- package/dist/adhoc-editor/components/Tree.js +296 -0
- package/dist/adhoc-editor/hooks.d.ts +3 -3
- package/dist/adhoc-editor/hooks.js +5 -23
- package/dist/adhoc-editor/index.d.ts +1 -1
- package/dist/adhoc-editor/index.js +1 -0
- package/dist/adhoc-editor/{ActorProvider.d.ts → state/ActorProvider.d.ts} +1 -3
- package/dist/adhoc-editor/{ActorProvider.js → state/ActorProvider.js} +10 -11
- package/dist/adhoc-editor/state/actor.d.ts +13 -0
- package/dist/adhoc-editor/{actor.editor.d.ts → state/actor.editor.d.ts} +6 -4
- package/dist/adhoc-editor/state/actor.editor.js +205 -0
- package/dist/adhoc-editor/{actor.js → state/actor.js} +2 -6
- package/dist/adhoc-editor/{actor.layouter.d.ts → state/actor.layouter.d.ts} +7 -4
- package/dist/adhoc-editor/{actor.layouter.js → state/actor.layouter.js} +17 -13
- package/dist/adhoc-editor/{actor.types.d.ts → state/actor.types.d.ts} +12 -6
- package/dist/adhoc-editor/{actor.types.js → state/actor.types.js} +8 -1
- package/dist/adhoc-editor/state/panel.d.ts +95 -0
- package/dist/adhoc-editor/state/panel.js +139 -0
- package/dist/adhoc-editor/state/utils.d.ts +17 -0
- package/dist/adhoc-editor/state/utils.js +32 -0
- package/dist/adhoc-editor/useElementsTree.d.ts +18 -0
- package/dist/adhoc-editor/useElementsTree.js +130 -0
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +1 -1
- package/dist/base/const.d.ts +1 -0
- package/dist/base-primitives/compound/CompoundActionButton.js +26 -12
- package/dist/base-primitives/compound/CompoundDetailsButton.js +22 -9
- package/dist/base-primitives/compound/CompoundNodeContainer.js +5 -4
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeLabel.js +3 -4
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +2 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +12 -19
- package/dist/base-primitives/element/ElementActionButtons.js +35 -10
- package/dist/base-primitives/element/ElementDetailsButton.js +47 -18
- package/dist/base-primitives/element/ElementNodeContainer.d.ts +3 -3
- package/dist/base-primitives/element/ElementNodeContainer.js +23 -10
- package/dist/base-primitives/element/ElementShape.d.ts +2 -2
- package/dist/base-primitives/element/ElementShape.js +70 -7
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +3 -3
- package/dist/components/Logo.js +1 -1
- package/dist/components/NavigationPanel.js +2 -4
- package/dist/components/PortalToContainer.js +3 -4
- package/dist/components/RootContainer.js +9 -16
- package/dist/components/ViewNotFound.d.ts +3 -3
- package/dist/components/ViewNotFound.js +30 -26
- package/dist/context/CurrentViewModelProvider.d.ts +2 -0
- package/dist/context/CurrentViewModelProvider.js +12 -0
- package/dist/context/DefaultMantineProvider.d.ts +1 -1
- package/dist/context/DefaultMantineProvider.js +10 -1
- package/dist/context/DiagramEventHandlers.d.ts +5 -5
- package/dist/context/DiagramEventHandlers.js +10 -4
- package/dist/context/DiagramFeatures.d.ts +8 -7
- package/dist/context/DiagramFeatures.js +5 -3
- package/dist/context/FramerMotionConfig.d.ts +1 -3
- package/dist/context/IconRenderer.d.ts +5 -4
- package/dist/context/IconRenderer.js +51 -24
- package/dist/context/LikeC4ModelContext.d.ts +10 -5
- package/dist/context/LikeC4ModelContext.js +11 -3
- package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
- package/dist/context/LikeC4ProjectsContext.js +6 -2
- package/dist/context/RootContainerContext.d.ts +10 -3
- package/dist/context/RootContainerContext.js +8 -3
- package/dist/context/TagStylesContext.js +1 -1
- package/dist/custom/index.js +16 -15
- package/dist/editor/LikeC4EditorProvider.js +1 -1
- package/dist/editor/applyChangesToManualLayout.js +7 -7
- package/dist/editor/editorActor.actions.js +20 -20
- package/dist/editor/editorActor.states.js +0 -9
- package/dist/editor/useEditorActorLogic.d.ts +1 -2
- package/dist/editor/useEditorActorLogic.js +8 -11
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/safeContext.d.ts +4 -5
- package/dist/hooks/useCallbackRef.js +7 -6
- package/dist/hooks/useCurrentView.js +5 -10
- package/dist/hooks/useCurrentViewModel.d.ts +2 -6
- package/dist/hooks/useCurrentViewModel.js +3 -7
- package/dist/hooks/useDiagram.d.ts +9 -1
- package/dist/hooks/useDiagram.js +8 -2
- package/dist/hooks/useDiagramCompareLayout.d.ts +5 -5
- package/dist/hooks/useLikeC4ElementsTree.d.ts +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.d.ts +6 -2
- package/dist/hooks/useLikeC4Model.js +7 -9
- package/dist/hooks/useLikeC4Project.d.ts +4 -6
- package/dist/hooks/useLikeC4Project.js +19 -31
- package/dist/hooks/useLikeC4Styles.js +3 -9
- package/dist/hooks/useMantinePortalProps.d.ts +1 -1
- package/dist/hooks/useMediaPrint.d.ts +0 -2
- package/dist/hooks/useOverlaysActor.js +4 -4
- package/dist/hooks/useSearchActor.js +4 -4
- package/dist/index.d.ts +1 -3
- package/dist/index.js +2 -2
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -1
- package/dist/likec4diagram/DiagramXYFlow.js +5 -7
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +22 -24
- package/dist/likec4diagram/custom/edges/edges.css.js +2 -1
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +40 -55
- package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +3 -20
- package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +286 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -2
- package/dist/likec4diagram/custom/nodes/nodes.js +5 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +12 -8
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +8 -28
- package/dist/likec4diagram/state/DiagramActorProvider.js +30 -56
- package/dist/likec4diagram/state/diagram-api.d.ts +11 -0
- package/dist/likec4diagram/state/diagram-api.js +15 -0
- package/dist/likec4diagram/state/machine.actions.d.ts +27 -0
- package/dist/likec4diagram/state/machine.actions.js +78 -21
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +1 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +38 -3
- package/dist/likec4diagram/state/machine.js +4 -1
- package/dist/likec4diagram/state/machine.setup.d.ts +19 -2
- package/dist/likec4diagram/state/machine.state.navigating.js +1 -1
- package/dist/likec4diagram/state/machine.state.ready.d.ts +61 -1
- package/dist/likec4diagram/state/machine.state.ready.js +11 -3
- package/dist/likec4diagram/state/utils.d.ts +2 -1
- package/dist/likec4diagram/state/utils.js +1 -1
- package/dist/likec4diagram/types.d.ts +2 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.d.ts +12 -12
- package/dist/likec4diagram/useLayoutConstraints.js +125 -86
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +2 -0
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +7 -2
- package/dist/navigationpanel/NavigationPanel.js +2 -2
- package/dist/navigationpanel/NavigationPanelDropdown.js +13 -13
- package/dist/navigationpanel/_common.js +2 -2
- package/dist/navigationpanel/actor.js +1 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
- package/dist/navigationpanel/comparepanel/ComparePanel.js +155 -29
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -0
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +264 -0
- package/dist/navigationpanel/controls/DetailsControls.js +4 -4
- package/dist/navigationpanel/controls/LayoutWarning.js +1 -1
- package/dist/navigationpanel/controls/LogoButton.js +1 -1
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.js +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +3 -3
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +6 -6
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +16 -16
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
- package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/dist/store-1b2fbb72.cjs.js +742 -0
- package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/react/dist/xstate-store-react.cjs.js +175 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +11 -11
- package/dist/overlays/element-details/ElementDetailsCard.js +39 -40
- package/dist/overlays/element-details/MetadataValue.js +7 -7
- package/dist/overlays/element-details/TabPanelDeployments.js +4 -4
- package/dist/overlays/element-details/TabPanelRelationships.css.js +5 -5
- package/dist/overlays/element-details/TabPanelRelationships.js +4 -5
- package/dist/overlays/element-details/TabPanelStructure.css.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/overlaysActor.js +1 -1
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
- package/dist/overlays/relationship-details/SelectEdge.css.js +4 -4
- 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 +6 -6
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/actor.js +1 -1
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +1 -1
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -1
- package/dist/projects-overview/ProjectsOverview.js +2 -2
- package/dist/projects-overview/ProjectsOverviewXY.d.ts +1 -5
- package/dist/projects-overview/ProjectsOverviewXY.js +1 -1
- package/dist/projects-overview/actor.d.ts +1 -1
- package/dist/projects-overview/context.d.ts +2 -2
- package/dist/projects-overview/context.js +2 -1
- package/dist/projects-overview/custom/nodeTypes.js +1 -1
- package/dist/search/Search.d.ts +2 -1
- package/dist/search/Search.js +108 -87
- package/dist/search/components/ElementsColumn.css.js +3 -3
- package/dist/search/components/ElementsColumn.js +93 -59
- package/dist/search/components/PickView.js +8 -4
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +2 -2
- package/dist/search/components/ViewsColum.d.ts +2 -1
- package/dist/search/components/ViewsColum.js +39 -35
- package/dist/search/components/ViewsColumn.css.js +1 -1
- package/dist/search/components/_shared.css.js +11 -11
- package/dist/search/components/utils.js +1 -4
- package/dist/search/hooks.js +4 -1
- package/dist/search/searchActor.d.ts +12 -2
- package/dist/search/searchActor.js +60 -4
- package/dist/shadowroot/ShadowRoot.d.ts +5 -2
- package/dist/shadowroot/ShadowRoot.js +7 -5
- package/dist/shadowroot/styles.css.js +3 -2
- package/dist/styles.css2.js +1 -1
- package/dist/utils/view-bounds.d.ts +3 -2
- package/dist/utils/view-bounds.js +1 -1
- package/dist/utils/xyflow.d.ts +10 -5
- package/dist/utils/xyflow.js +24 -22
- package/package.json +29 -28
- package/panda.buildinfo.json +175 -86
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/bundle/index.js +0 -52554
- package/bundle/package.json +0 -4
- package/dist/adhoc-editor/EditorNavigationPanel.d.ts +0 -1
- package/dist/adhoc-editor/EditorNavigationPanel.js +0 -32
- package/dist/adhoc-editor/SelectElementOverlay.d.ts +0 -1
- package/dist/adhoc-editor/SelectElementOverlay.js +0 -124
- package/dist/adhoc-editor/actor.d.ts +0 -131
- package/dist/adhoc-editor/actor.editor.js +0 -96
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.js +0 -104
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
package/README.md
CHANGED
|
@@ -35,15 +35,13 @@ You need to prepare it and wrap your diagram with`LikeC4ModelProvider` component
|
|
|
35
35
|
|
|
36
36
|
See [📖 Documentation](https://likec4.dev/tooling/react/#likec4modelprovider) for examples.
|
|
37
37
|
|
|
38
|
-
## Bundled version
|
|
39
|
-
|
|
40
|
-
The easiest way to use this package is the bundled version.\
|
|
41
|
-
Diagram renders inside shadow DOM and has its own styles.
|
|
42
|
-
|
|
43
38
|
### LikeC4View
|
|
44
39
|
|
|
40
|
+
The easiest way to use this package is the `LikeC4View` component.\
|
|
41
|
+
It renders inside shadow DOM and has its own styles.
|
|
42
|
+
|
|
45
43
|
```tsx
|
|
46
|
-
import { LikeC4ModelProvider, LikeC4View } from '@likec4/diagram
|
|
44
|
+
import { LikeC4ModelProvider, LikeC4View } from '@likec4/diagram'
|
|
47
45
|
/**
|
|
48
46
|
* See https://likec4.dev/tooling/react/#likec4modelprovider
|
|
49
47
|
*/
|
|
@@ -68,7 +66,7 @@ See [LikeC4ViewProps](./src/LikeC4View.tsx) for available props.
|
|
|
68
66
|
You may need to import icons, if you use built-in node renderers.
|
|
69
67
|
|
|
70
68
|
```tsx
|
|
71
|
-
import { type ElementIconRenderer, LikeC4, LikeC4ModelProvider, LikeC4View } from '@likec4/diagram
|
|
69
|
+
import { type ElementIconRenderer, LikeC4, LikeC4ModelProvider, LikeC4View } from '@likec4/diagram'
|
|
72
70
|
import { lazy, Suspense } from 'react'
|
|
73
71
|
|
|
74
72
|
// Better to lazy load icons, bundle is quite large at the moment
|
|
@@ -100,7 +98,7 @@ function App() {
|
|
|
100
98
|
Component works in most usecases, but if you need more - use `ReactLikeC4`:
|
|
101
99
|
|
|
102
100
|
```tsx
|
|
103
|
-
import { ReactLikeC4, LikeC4ModelProvider } from '@likec4/diagram
|
|
101
|
+
import { ReactLikeC4, LikeC4ModelProvider } from '@likec4/diagram'
|
|
104
102
|
|
|
105
103
|
function App() {
|
|
106
104
|
const [viewId, setViewId] = useState('index')
|
|
@@ -279,7 +277,7 @@ function App() {
|
|
|
279
277
|
### Custom node renderer
|
|
280
278
|
|
|
281
279
|
LikeC4Diagram can use custom node renderers.\
|
|
282
|
-
Compose custom nodes renderers using primitives from `@likec4/diagram/custom
|
|
280
|
+
Compose custom nodes renderers using primitives from `@likec4/diagram/custom`.\
|
|
283
281
|
See [customNodes.tsx](./src/custom/customNodes.tsx) for examples.
|
|
284
282
|
|
|
285
283
|
```tsx
|
package/dist/LikeC4Diagram.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Any } from '@likec4/core/types';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
3
4
|
import { LikeC4DiagramEventHandlers, LikeC4DiagramProperties } from './LikeC4Diagram.props';
|
|
4
5
|
export type LikeC4DiagramProps<A extends Any = Any> = PropsWithChildren<LikeC4DiagramProperties<A> & LikeC4DiagramEventHandlers<A>>;
|
|
5
6
|
/**
|
|
@@ -8,4 +9,4 @@ export type LikeC4DiagramProps<A extends Any = Any> = PropsWithChildren<LikeC4Di
|
|
|
8
9
|
*
|
|
9
10
|
* Use {@link ReactLikeC4} or {@link LikeC4View} for ready-to-use component
|
|
10
11
|
*/
|
|
11
|
-
export declare function LikeC4Diagram<A extends Any = Any>({ onCanvasClick, onCanvasContextMenu, onCanvasDblClick, onEdgeClick, onEdgeContextMenu, onNavigateTo, onNodeClick, onNodeContextMenu, onOpenSource, onLogoClick, onLayoutTypeChange, onInitialized, view, className, controls, fitView, fitViewPadding: _fitViewPadding, pannable, zoomable, background, enableElementTags, enableFocusMode, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, enableCompareWithLatest, nodesSelectable, enableNotations, showNavigationButtons, enableDynamicViewWalkthrough, dynamicViewVariant, enableSearch, initialWidth, initialHeight, reduceGraphics, renderIcon, where, reactFlowProps, renderNodes, children, }: LikeC4DiagramProps<A>):
|
|
12
|
+
export declare function LikeC4Diagram<A extends Any = Any>({ onCanvasClick, onCanvasContextMenu, onCanvasDblClick, onEdgeClick, onEdgeContextMenu, onNavigateTo, onNodeClick, onNodeContextMenu, onOpenSource, onLogoClick, onLayoutTypeChange, onInitialized, view, className, controls, fitView, fitViewPadding: _fitViewPadding, pannable, zoomable, background, enableElementTags, enableFocusMode, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, enableCompareWithLatest, nodesSelectable, enableNotations, showNavigationButtons, enableDynamicViewWalkthrough, dynamicViewVariant, enableSearch, enableNotes, initialWidth, initialHeight, reduceGraphics, renderIcon, where, reactFlowProps, renderNodes, children, }: LikeC4DiagramProps<A>): JSX.Element;
|
package/dist/LikeC4Diagram.js
CHANGED
|
@@ -5,9 +5,10 @@ import { deepEqual } from 'fast-equals';
|
|
|
5
5
|
import { useRef, Profiler } from 'react';
|
|
6
6
|
import { isEmptyish, isPlainObject, mapValues } from 'remeda';
|
|
7
7
|
import { RootContainer } from './components/RootContainer.js';
|
|
8
|
+
import { CurrentViewModelProvider } from './context/CurrentViewModelProvider.js';
|
|
8
9
|
import { TagStylesProvider } from './context/TagStylesContext.js';
|
|
9
10
|
import { useId } from './hooks/useId.js';
|
|
10
|
-
import { useOptionalLikeC4Model } from './
|
|
11
|
+
import { useOptionalLikeC4Model } from './context/LikeC4ModelContext.js';
|
|
11
12
|
import { LikeC4DiagramUI } from './likec4diagram/DiagramUI.js';
|
|
12
13
|
import { LikeC4DiagramXYFlow } from './likec4diagram/DiagramXYFlow.js';
|
|
13
14
|
import { DiagramActorProvider } from './likec4diagram/state/DiagramActorProvider.js';
|
|
@@ -21,6 +22,8 @@ import { IconRendererProvider } from './context/IconRenderer.js';
|
|
|
21
22
|
import { DiagramFeatures } from './context/DiagramFeatures.js';
|
|
22
23
|
import { DiagramEventHandlers } from './context/DiagramEventHandlers.js';
|
|
23
24
|
|
|
25
|
+
const noop = () => {
|
|
26
|
+
};
|
|
24
27
|
function LikeC4Diagram({
|
|
25
28
|
onCanvasClick,
|
|
26
29
|
onCanvasContextMenu,
|
|
@@ -54,6 +57,7 @@ function LikeC4Diagram({
|
|
|
54
57
|
enableDynamicViewWalkthrough = false,
|
|
55
58
|
dynamicViewVariant,
|
|
56
59
|
enableSearch = false,
|
|
60
|
+
enableNotes = true,
|
|
57
61
|
initialWidth,
|
|
58
62
|
initialHeight,
|
|
59
63
|
reduceGraphics = "auto",
|
|
@@ -89,91 +93,85 @@ function LikeC4Diagram({
|
|
|
89
93
|
};
|
|
90
94
|
}
|
|
91
95
|
const isReducedGraphicsMode = reduceGraphics === "auto" ? pannable && view.bounds.width * view.bounds.height > 16e6 && view.nodes.some((n) => n.children?.length > 0) : reduceGraphics;
|
|
92
|
-
return /* @__PURE__ */ jsx(Profiler, { id: "LikeC4Diagram", onRender: (
|
|
93
|
-
|
|
94
|
-
FramerMotionConfig,
|
|
96
|
+
return /* @__PURE__ */ jsx(Profiler, { id: "LikeC4Diagram", onRender: noop, children: /* @__PURE__ */ jsx(EnsureMantine, { children: /* @__PURE__ */ jsx(FramerMotionConfig, { reducedMotion: isReducedGraphicsMode ? "always" : void 0, children: /* @__PURE__ */ jsx(IconRendererProvider, { value: renderIcon ?? null, children: /* @__PURE__ */ jsx(
|
|
97
|
+
DiagramFeatures,
|
|
95
98
|
{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
features: {
|
|
100
|
+
enableFitView: fitView,
|
|
101
|
+
enableEditor: hasEditor,
|
|
102
|
+
enableReadOnly: readonly,
|
|
103
|
+
enableFocusMode,
|
|
104
|
+
enableNavigateTo: !!onNavigateTo,
|
|
105
|
+
enableElementDetails: enableElementDetails && hasLikeC4Model,
|
|
106
|
+
enableRelationshipDetails: enableRelationshipDetails && hasLikeC4Model,
|
|
107
|
+
enableRelationshipBrowser: enableRelationshipBrowser && hasLikeC4Model,
|
|
108
|
+
enableSearch: enableSearch && hasLikeC4Model,
|
|
109
|
+
enableNavigationButtons: showNavigationButtons && !!onNavigateTo,
|
|
110
|
+
enableDynamicViewWalkthrough: view._type === "dynamic" && enableDynamicViewWalkthrough,
|
|
111
|
+
enableNotations,
|
|
112
|
+
enableVscode: !!onOpenSource,
|
|
113
|
+
enableControls: controls,
|
|
114
|
+
enableElementTags,
|
|
115
|
+
enableCompareWithLatest,
|
|
116
|
+
enableNotes
|
|
117
|
+
},
|
|
118
|
+
children: /* @__PURE__ */ jsxs(
|
|
119
|
+
DiagramEventHandlers,
|
|
99
120
|
{
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
enableVscode: !!onOpenSource,
|
|
114
|
-
enableControls: controls,
|
|
115
|
-
enableElementTags,
|
|
116
|
-
enableCompareWithLatest
|
|
121
|
+
handlers: {
|
|
122
|
+
onCanvasClick,
|
|
123
|
+
onCanvasContextMenu,
|
|
124
|
+
onCanvasDblClick,
|
|
125
|
+
onEdgeClick,
|
|
126
|
+
onEdgeContextMenu,
|
|
127
|
+
onNavigateTo,
|
|
128
|
+
onNodeClick,
|
|
129
|
+
onNodeContextMenu,
|
|
130
|
+
onOpenSource,
|
|
131
|
+
onLogoClick,
|
|
132
|
+
onInitialized,
|
|
133
|
+
onLayoutTypeChange
|
|
117
134
|
},
|
|
118
|
-
children:
|
|
119
|
-
|
|
120
|
-
{
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
onNavigateTo,
|
|
128
|
-
onNodeClick,
|
|
129
|
-
onNodeContextMenu,
|
|
130
|
-
onOpenSource,
|
|
131
|
-
onLogoClick,
|
|
132
|
-
onInitialized,
|
|
133
|
-
onLayoutTypeChange
|
|
134
|
-
},
|
|
135
|
-
children: [
|
|
136
|
-
/* @__PURE__ */ jsx(LikeC4Styles, { id }),
|
|
137
|
-
/* @__PURE__ */ jsx(TagStylesProvider, { rootSelector: `#${id}`, children: /* @__PURE__ */ jsx(RootContainer, { id, className, reduceGraphics: isReducedGraphicsMode, children: /* @__PURE__ */ jsx(
|
|
138
|
-
ReactFlowProvider,
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ jsx(LikeC4Styles, { id }),
|
|
137
|
+
/* @__PURE__ */ jsx(TagStylesProvider, { rootSelector: `#${id}`, children: /* @__PURE__ */ jsx(RootContainer, { id, className, reduceGraphics: isReducedGraphicsMode, children: /* @__PURE__ */ jsx(
|
|
138
|
+
ReactFlowProvider,
|
|
139
|
+
{
|
|
140
|
+
fitView,
|
|
141
|
+
...initialRef.current,
|
|
142
|
+
children: /* @__PURE__ */ jsx(
|
|
143
|
+
DiagramActorProvider,
|
|
139
144
|
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
children
|
|
162
|
-
}
|
|
163
|
-
),
|
|
164
|
-
/* @__PURE__ */ jsx(LikeC4DiagramUI, {})
|
|
165
|
-
]
|
|
166
|
-
}
|
|
167
|
-
)
|
|
145
|
+
id,
|
|
146
|
+
view,
|
|
147
|
+
zoomable,
|
|
148
|
+
pannable,
|
|
149
|
+
fitViewPadding,
|
|
150
|
+
nodesDraggable: hasEditor,
|
|
151
|
+
nodesSelectable,
|
|
152
|
+
where: where ?? null,
|
|
153
|
+
dynamicViewVariant,
|
|
154
|
+
children: /* @__PURE__ */ jsxs(CurrentViewModelProvider, { children: [
|
|
155
|
+
/* @__PURE__ */ jsx(
|
|
156
|
+
LikeC4DiagramXYFlow,
|
|
157
|
+
{
|
|
158
|
+
background,
|
|
159
|
+
reactFlowProps,
|
|
160
|
+
renderNodes,
|
|
161
|
+
children
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ jsx(LikeC4DiagramUI, {})
|
|
165
|
+
] })
|
|
168
166
|
}
|
|
169
|
-
)
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
|
|
167
|
+
)
|
|
168
|
+
}
|
|
169
|
+
) }) })
|
|
170
|
+
]
|
|
173
171
|
}
|
|
174
|
-
)
|
|
172
|
+
)
|
|
175
173
|
}
|
|
176
|
-
) }) });
|
|
174
|
+
) }) }) }) });
|
|
177
175
|
}
|
|
178
176
|
const toLiteralPaddingWithUnit = (value) => {
|
|
179
177
|
if (typeof value === "number") {
|
|
@@ -183,6 +183,12 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
|
|
|
183
183
|
* @default false
|
|
184
184
|
*/
|
|
185
185
|
enableElementTags?: boolean | undefined;
|
|
186
|
+
/**
|
|
187
|
+
* Display element notes, if they are present in the view
|
|
188
|
+
*
|
|
189
|
+
* @default true
|
|
190
|
+
*/
|
|
191
|
+
enableNotes?: boolean | undefined;
|
|
186
192
|
/**
|
|
187
193
|
* Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
|
|
188
194
|
* Enable it if you have a large or static view
|
|
@@ -194,6 +200,8 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
|
|
|
194
200
|
/**
|
|
195
201
|
* Render icon for an element, bundled or remote
|
|
196
202
|
* By default, if icon is http:// or https://, it will be rendered as an image
|
|
203
|
+
*
|
|
204
|
+
* Consider using `IconRendererProvider`
|
|
197
205
|
*/
|
|
198
206
|
renderIcon?: ElementIconRenderer | undefined;
|
|
199
207
|
/**
|
|
@@ -234,7 +242,7 @@ export type OnEdgeClick<A extends Any = Unknown> = (edge: DiagramEdge<A>, event:
|
|
|
234
242
|
* On pane/canvas click (not on any node or edge)
|
|
235
243
|
*/
|
|
236
244
|
export type OnCanvasClick = (event: ReactMouseEvent) => void;
|
|
237
|
-
export type OnCanvasContextMenu = (event: ReactMouseEvent
|
|
245
|
+
export type OnCanvasContextMenu = (event: ReactMouseEvent) => void;
|
|
238
246
|
export type OnInitialized = (params: {
|
|
239
247
|
diagram: DiagramApi;
|
|
240
248
|
xyflow: XYFlowInstance;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LikeC4Model } from '@likec4/core/model';
|
|
2
|
-
import { aux } from '@likec4/core/types';
|
|
3
2
|
import { PropsWithChildren } from 'react';
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
export interface LikeC4ModelProviderProps {
|
|
5
|
+
likec4model: LikeC4Model<any>;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Ensures LikeC4Model context
|
|
9
9
|
*/
|
|
10
|
-
export declare function LikeC4ModelProvider
|
|
10
|
+
export declare function LikeC4ModelProvider({ children, likec4model, }: PropsWithChildren<LikeC4ModelProviderProps>): JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { LikeC4ModelContextProvider } from './context/LikeC4ModelContext.js';
|
|
3
3
|
|
|
4
4
|
function LikeC4ModelProvider({
|
|
5
5
|
children,
|
|
6
6
|
likec4model
|
|
7
7
|
}) {
|
|
8
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
+
return /* @__PURE__ */ jsx(LikeC4ModelContextProvider, { value: likec4model, children });
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export { LikeC4ModelProvider };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
1
2
|
import { Simplify } from 'type-fest';
|
|
2
3
|
import { ProjectsOverviewProps } from './projects-overview';
|
|
3
|
-
export type LikeC4ProjectsOverviewProps = Simplify<
|
|
4
|
+
export type LikeC4ProjectsOverviewProps = Simplify<ProjectsOverviewProps & {
|
|
4
5
|
className?: string;
|
|
5
6
|
onSelectProject?: ProjectsOverviewProps['onNavigateToProject'];
|
|
6
7
|
}>;
|
|
7
|
-
export declare function LikeC4ProjectsOverview({ view, className, onNavigateToProject, ...props }: LikeC4ProjectsOverviewProps):
|
|
8
|
+
export declare function LikeC4ProjectsOverview({ view, className, onNavigateToProject, ...props }: LikeC4ProjectsOverviewProps): JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LikeC4Project, ProjectId } from '@likec4/core/types';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
3
4
|
export interface LikeC4ProjectsProviderProps {
|
|
4
5
|
/**
|
|
5
6
|
* Projects to be used in the navigation panel.
|
|
@@ -14,4 +15,4 @@ export interface LikeC4ProjectsProviderProps {
|
|
|
14
15
|
/**
|
|
15
16
|
* Ensures LikeC4Projects context
|
|
16
17
|
*/
|
|
17
|
-
export declare function LikeC4ProjectsProvider({ children, projects, onProjectChange: _onProjectChange, }: PropsWithChildren<LikeC4ProjectsProviderProps>):
|
|
18
|
+
export declare function LikeC4ProjectsProvider({ children, projects, onProjectChange: _onProjectChange, }: PropsWithChildren<LikeC4ProjectsProviderProps>): JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { deepEqual } from 'fast-equals';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { useOptionalProjectsContext, LikeC4ProjectsContextProvider } from './context/LikeC4ProjectsContext.js';
|
|
5
5
|
import { useCallbackRef } from './hooks/useCallbackRef.js';
|
|
6
6
|
|
|
7
7
|
function LikeC4ProjectsProvider({
|
|
@@ -9,7 +9,7 @@ function LikeC4ProjectsProvider({
|
|
|
9
9
|
projects,
|
|
10
10
|
onProjectChange: _onProjectChange
|
|
11
11
|
}) {
|
|
12
|
-
const outerScope =
|
|
12
|
+
const outerScope = useOptionalProjectsContext();
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
if (outerScope) {
|
|
15
15
|
console.warn("LikeC4ProjectsProvider should not be nested inside another one");
|
|
@@ -22,7 +22,7 @@ function LikeC4ProjectsProvider({
|
|
|
22
22
|
return deepEqual(current.projects, projects) ? current : { ...current, projects };
|
|
23
23
|
});
|
|
24
24
|
}, [projects]);
|
|
25
|
-
return /* @__PURE__ */ jsx(
|
|
25
|
+
return /* @__PURE__ */ jsx(LikeC4ProjectsContextProvider, { value, children });
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export { LikeC4ProjectsProvider };
|
package/dist/LikeC4Styles.d.ts
CHANGED
package/dist/LikeC4View.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
3
|
import { ElementIconRenderer, NodeRenderers, OverrideReactFlowProps, PaddingWithUnit, ViewPadding } from './LikeC4Diagram.props';
|
|
3
4
|
import type * as t from '@likec4/core/types';
|
|
4
5
|
export interface LikeC4ViewProps<A extends t.aux.Any = t.aux.UnknownLayouted> {
|
|
@@ -136,6 +137,12 @@ export interface LikeC4ViewProps<A extends t.aux.Any = t.aux.UnknownLayouted> {
|
|
|
136
137
|
* @default enableRelationshipDetails
|
|
137
138
|
*/
|
|
138
139
|
enableRelationshipBrowser?: boolean | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Display element notes, if they are present in the view
|
|
142
|
+
*
|
|
143
|
+
* @default false
|
|
144
|
+
*/
|
|
145
|
+
enableNotes?: boolean | undefined;
|
|
139
146
|
/**
|
|
140
147
|
* Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
|
|
141
148
|
*
|
|
@@ -243,6 +250,12 @@ export interface LikeC4BrowserProps {
|
|
|
243
250
|
* @default true
|
|
244
251
|
*/
|
|
245
252
|
enableCompareWithLatest?: boolean | undefined;
|
|
253
|
+
/**
|
|
254
|
+
* Display element notes, if they are present in the view
|
|
255
|
+
*
|
|
256
|
+
* @default true
|
|
257
|
+
*/
|
|
258
|
+
enableNotes?: boolean | undefined;
|
|
246
259
|
/**
|
|
247
260
|
* Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
|
|
248
261
|
*
|
|
@@ -268,4 +281,4 @@ export interface LikeC4BrowserProps {
|
|
|
268
281
|
*
|
|
269
282
|
* Component is wrapped in ShadowRoot to isolate styles.
|
|
270
283
|
*/
|
|
271
|
-
export declare function LikeC4View<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, className, pannable, zoomable, keepAspectRatio, colorScheme, injectFontCss, controls, layoutType: initialLayoutType, background, browser, showNavigationButtons, enableNotations, enableFocusMode, enableDynamicViewWalkthrough, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, reduceGraphics, mantineTheme, styleNonce, style, reactFlowProps, renderNodes, children, ...props }: LikeC4ViewProps<A>):
|
|
284
|
+
export declare function LikeC4View<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, className, pannable, zoomable, keepAspectRatio, colorScheme, injectFontCss, controls, layoutType: initialLayoutType, background, browser, showNavigationButtons, enableNotations, enableFocusMode, enableDynamicViewWalkthrough, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, enableNotes, reduceGraphics, mantineTheme, styleNonce, style, reactFlowProps, renderNodes, children, ...props }: LikeC4ViewProps<A>): JSX.Element;
|
package/dist/LikeC4View.js
CHANGED
|
@@ -6,15 +6,16 @@ import { AnimatePresence } from 'motion/react';
|
|
|
6
6
|
import { useRef, useState } from 'react';
|
|
7
7
|
import { isBoolean } from 'remeda';
|
|
8
8
|
import { FitViewPaddings } from './base/const.js';
|
|
9
|
-
import { ErrorMessage
|
|
10
|
-
import { FramerMotionConfig } from './context/FramerMotionConfig.js';
|
|
9
|
+
import { ErrorMessage } from './components/ViewNotFound.js';
|
|
11
10
|
import { useCallbackRef } from './hooks/useCallbackRef.js';
|
|
12
|
-
import
|
|
11
|
+
import 'fast-equals';
|
|
12
|
+
import { useOptionalLikeC4Model } from './context/LikeC4ModelContext.js';
|
|
13
13
|
import { LikeC4Diagram } from './LikeC4Diagram.js';
|
|
14
14
|
import { Overlay } from './overlays/overlay/Overlay.js';
|
|
15
15
|
import { ShadowRoot } from './shadowroot/ShadowRoot.js';
|
|
16
16
|
import { pickViewBounds } from './utils/view-bounds.js';
|
|
17
|
-
import
|
|
17
|
+
import { stopPropagation } from './utils/xyflow.js';
|
|
18
|
+
import IconX from './node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
18
19
|
|
|
19
20
|
const cssInteractive = css({
|
|
20
21
|
cursor: "pointer",
|
|
@@ -42,6 +43,7 @@ function LikeC4View({
|
|
|
42
43
|
enableElementDetails = false,
|
|
43
44
|
enableRelationshipDetails = false,
|
|
44
45
|
enableRelationshipBrowser = enableRelationshipDetails,
|
|
46
|
+
enableNotes = false,
|
|
45
47
|
reduceGraphics = "auto",
|
|
46
48
|
mantineTheme,
|
|
47
49
|
styleNonce,
|
|
@@ -64,18 +66,30 @@ function LikeC4View({
|
|
|
64
66
|
const onNavigateToThisView = useCallbackRef(() => {
|
|
65
67
|
onNavigateTo(viewId);
|
|
66
68
|
});
|
|
69
|
+
const closeBrowser = useCallbackRef(() => {
|
|
70
|
+
onNavigateTo(null);
|
|
71
|
+
});
|
|
67
72
|
if (!likec4model) {
|
|
68
|
-
return /* @__PURE__ */ jsx(ErrorMessage, { children: "LikeC4Model not found. Make sure you
|
|
73
|
+
return /* @__PURE__ */ jsx(ErrorMessage, { children: "LikeC4Model not found. Make sure you have LikeC4ModelProvider in the component tree." });
|
|
69
74
|
}
|
|
70
75
|
const viewModel = likec4model.findView(viewId);
|
|
71
76
|
if (!viewModel) {
|
|
72
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ jsxs(ErrorMessage, { children: [
|
|
78
|
+
"LikeC4 View ",
|
|
79
|
+
/* @__PURE__ */ jsx("code", { children: viewId }),
|
|
80
|
+
" not found in LikeC4Model.",
|
|
81
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
82
|
+
"Available views: ",
|
|
83
|
+
[...likec4model.views()].map((v) => v.id).join(", ")
|
|
84
|
+
] });
|
|
73
85
|
}
|
|
74
86
|
if (!viewModel.isLayouted()) {
|
|
75
87
|
return /* @__PURE__ */ jsxs(ErrorMessage, { children: [
|
|
76
|
-
|
|
77
|
-
viewId,
|
|
78
|
-
|
|
88
|
+
"LikeC4 View ",
|
|
89
|
+
/* @__PURE__ */ jsx("code", { children: viewId }),
|
|
90
|
+
" is not layouted.",
|
|
91
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
92
|
+
"Make sure you have LikeC4ModelProvider with layouted model."
|
|
79
93
|
] });
|
|
80
94
|
}
|
|
81
95
|
const view = initialLayoutType === "manual" ? viewModel.$layouted : viewModel.$view;
|
|
@@ -87,7 +101,7 @@ function LikeC4View({
|
|
|
87
101
|
const browserProps = isBoolean(browser) ? {} : browser;
|
|
88
102
|
const bounds = pickViewBounds(view, props.dynamicViewVariant);
|
|
89
103
|
const root = rootRef.current ? { root: rootRef.current } : void 0;
|
|
90
|
-
return /* @__PURE__ */
|
|
104
|
+
return /* @__PURE__ */ jsxs(
|
|
91
105
|
ShadowRoot,
|
|
92
106
|
{
|
|
93
107
|
ref: rootRef,
|
|
@@ -101,7 +115,7 @@ function LikeC4View({
|
|
|
101
115
|
className
|
|
102
116
|
),
|
|
103
117
|
style,
|
|
104
|
-
children:
|
|
118
|
+
children: [
|
|
105
119
|
/* @__PURE__ */ jsx(
|
|
106
120
|
LikeC4Diagram,
|
|
107
121
|
{
|
|
@@ -120,6 +134,7 @@ function LikeC4View({
|
|
|
120
134
|
enableElementDetails,
|
|
121
135
|
enableRelationshipBrowser,
|
|
122
136
|
enableElementTags: false,
|
|
137
|
+
enableNotes,
|
|
123
138
|
controls,
|
|
124
139
|
reduceGraphics,
|
|
125
140
|
className: cx(
|
|
@@ -137,7 +152,7 @@ function LikeC4View({
|
|
|
137
152
|
children
|
|
138
153
|
}
|
|
139
154
|
),
|
|
140
|
-
/* @__PURE__ */ jsx(AnimatePresence, { ...root, children: browserView && /* @__PURE__ */ jsxs(Overlay, { openDelay: 0, onClose:
|
|
155
|
+
/* @__PURE__ */ jsx(AnimatePresence, { ...root, children: browserView && /* @__PURE__ */ jsxs(Overlay, { openDelay: 0, onClose: closeBrowser, children: [
|
|
141
156
|
/* @__PURE__ */ jsx(
|
|
142
157
|
LikeC4Diagram,
|
|
143
158
|
{
|
|
@@ -154,6 +169,7 @@ function LikeC4View({
|
|
|
154
169
|
enableRelationshipDetails: true,
|
|
155
170
|
enableSearch: true,
|
|
156
171
|
enableElementTags: true,
|
|
172
|
+
enableNotes: true,
|
|
157
173
|
enableCompareWithLatest: true,
|
|
158
174
|
controls: true,
|
|
159
175
|
fitView: true,
|
|
@@ -165,20 +181,17 @@ function LikeC4View({
|
|
|
165
181
|
onLayoutTypeChange: setLayoutType
|
|
166
182
|
}
|
|
167
183
|
),
|
|
168
|
-
/* @__PURE__ */ jsx(Box, { pos: "absolute", top: "4", right: "4", zIndex: "999", children: /* @__PURE__ */ jsx(
|
|
184
|
+
/* @__PURE__ */ jsx(Box, { pos: "absolute", top: "4", right: "4", zIndex: "999", onClick: stopPropagation, children: /* @__PURE__ */ jsx(
|
|
169
185
|
ActionIcon,
|
|
170
186
|
{
|
|
171
187
|
variant: "default",
|
|
172
188
|
color: "gray",
|
|
173
|
-
onClick:
|
|
174
|
-
e.stopPropagation();
|
|
175
|
-
onNavigateTo(null);
|
|
176
|
-
},
|
|
189
|
+
onClick: closeBrowser,
|
|
177
190
|
children: /* @__PURE__ */ jsx(IconX, {})
|
|
178
191
|
}
|
|
179
192
|
) })
|
|
180
193
|
] }) })
|
|
181
|
-
]
|
|
194
|
+
]
|
|
182
195
|
}
|
|
183
196
|
);
|
|
184
197
|
}
|
package/dist/ReactLikeC4.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
3
|
import { LikeC4DiagramEventHandlers, LikeC4DiagramProperties } from './LikeC4Diagram.props';
|
|
3
4
|
import type * as t from '@likec4/core/types';
|
|
4
5
|
export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = {
|
|
@@ -43,4 +44,4 @@ export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = {
|
|
|
43
44
|
*
|
|
44
45
|
* Component is wrapped in ShadowRoot to isolate styles.
|
|
45
46
|
*/
|
|
46
|
-
export declare function ReactLikeC4<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, layoutType: initialLayoutType, className, colorScheme, injectFontCss, enableNotations, keepAspectRatio, style, mantineTheme, styleNonce, ...props }: ReactLikeC4Props<A>):
|
|
47
|
+
export declare function ReactLikeC4<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, layoutType: initialLayoutType, className, colorScheme, injectFontCss, enableNotations, keepAspectRatio, style, mantineTheme, styleNonce, ...props }: ReactLikeC4Props<A>): JSX.Element;
|
package/dist/ReactLikeC4.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
3
|
import { ErrorMessage, ViewNotFound } from './components/ViewNotFound.js';
|
|
4
|
-
import
|
|
4
|
+
import 'fast-equals';
|
|
5
|
+
import 'react';
|
|
6
|
+
import { useOptionalLikeC4Model } from './context/LikeC4ModelContext.js';
|
|
5
7
|
import { LikeC4Diagram } from './LikeC4Diagram.js';
|
|
6
8
|
import { ShadowRoot } from './shadowroot/ShadowRoot.js';
|
|
7
9
|
import { pickViewBounds } from './utils/view-bounds.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Any, UnknownLayouted } from '@likec4/core/types';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
3
|
import { LikeC4DiagramProperties } from './LikeC4Diagram.props';
|
|
3
4
|
export type StaticLikeC4DiagramProps<A extends Any> = Pick<LikeC4DiagramProperties<A>, 'view' | 'className' | 'fitView' | 'fitViewPadding' | 'background' | 'enableElementDetails' | 'enableRelationshipDetails' | 'enableRelationshipBrowser' | 'enableElementTags' | 'reduceGraphics' | 'initialWidth' | 'initialHeight' | 'renderIcon' | 'renderNodes' | 'dynamicViewVariant' | 'where'>;
|
|
4
5
|
/**
|
|
@@ -7,4 +8,4 @@ export type StaticLikeC4DiagramProps<A extends Any> = Pick<LikeC4DiagramProperti
|
|
|
7
8
|
*
|
|
8
9
|
* @internal
|
|
9
10
|
*/
|
|
10
|
-
export declare function StaticLikeC4Diagram<A extends Any = UnknownLayouted>({ view, fitView, fitViewPadding, enableRelationshipDetails, enableRelationshipBrowser, background, className, ...rest }: StaticLikeC4DiagramProps<A>):
|
|
11
|
+
export declare function StaticLikeC4Diagram<A extends Any = UnknownLayouted>({ view, fitView, fitViewPadding, enableRelationshipDetails, enableRelationshipBrowser, background, className, ...rest }: StaticLikeC4DiagramProps<A>): JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { __require as requireXstateStoreReact_cjs } from '../node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/react/dist/xstate-store-react.cjs.js';
|
|
2
|
+
|
|
3
|
+
var xstateStoreReact_cjsExports = requireXstateStoreReact_cjs();
|
|
4
|
+
|
|
5
|
+
export { xstateStoreReact_cjsExports as x };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EditorPanel: () => import("react/jsx-runtime").JSX.Element;
|