@likec4/diagram 1.60.0 → 1.61.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 +63 -11
- package/dist/LikeC4Diagram.d.mts +4 -6
- package/dist/LikeC4Diagram.mjs +13 -12
- package/dist/LikeC4Diagram.props.d.mts +5 -7
- package/dist/LikeC4MantineProvider.d.mts +1 -2
- package/dist/LikeC4MantineProvider.mjs +26 -11
- package/dist/LikeC4ModelProvider.d.mts +1 -3
- package/dist/LikeC4ModelProvider.mjs +1 -2
- package/dist/LikeC4ProjectsOverview.d.mts +1 -3
- package/dist/LikeC4ProjectsOverview.mjs +1 -2
- package/dist/LikeC4ProjectsProvider.d.mts +1 -2
- package/dist/LikeC4ProjectsProvider.mjs +2 -3
- package/dist/LikeC4Styles.d.mts +1 -2
- package/dist/LikeC4Styles.mjs +11 -6
- package/dist/LikeC4View.d.mts +3 -5
- package/dist/LikeC4View.mjs +12 -11
- package/dist/ReactLikeC4.d.mts +3 -5
- package/dist/ReactLikeC4.mjs +8 -7
- package/dist/StaticLikeC4Diagram.d.mts +1 -3
- package/dist/StaticLikeC4Diagram.mjs +1 -2
- package/dist/_virtual/_rolldown/runtime.mjs +1 -2
- package/dist/base/Background.mjs +1 -2
- package/dist/base/Base.d.mts +1 -2
- package/dist/base/Base.mjs +1 -2
- package/dist/base/BaseXYFlow.mjs +12 -10
- package/dist/base/const.d.mts +1 -3
- package/dist/base/const.mjs +1 -2
- package/dist/base/keyboardZoom.mjs +1 -2
- package/dist/base/types.d.mts +2 -4
- package/dist/base/updateEdges.mjs +1 -2
- package/dist/base/updateNodes.mjs +1 -2
- package/dist/base-primitives/Markdown.d.mts +5 -5
- package/dist/base-primitives/Markdown.mjs +22 -11
- package/dist/base-primitives/NodeHandles.d.mts +1 -3
- package/dist/base-primitives/NodeHandles.mjs +1 -2
- package/dist/base-primitives/compound/CompoundActionButton.d.mts +1 -2
- package/dist/base-primitives/compound/CompoundActionButton.mjs +3 -4
- package/dist/base-primitives/compound/CompoundDetailsButton.d.mts +1 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.mjs +3 -4
- package/dist/base-primitives/compound/CompoundNodeContainer.d.mts +1 -2
- package/dist/base-primitives/compound/CompoundNodeContainer.mjs +1 -2
- package/dist/base-primitives/compound/CompoundTitle.d.mts +1 -2
- package/dist/base-primitives/compound/CompoundTitle.mjs +1 -2
- package/dist/base-primitives/compound/actionbtns.css.mjs +1 -2
- package/dist/base-primitives/edge/EdgeActionButton.mjs +2 -3
- package/dist/base-primitives/edge/EdgeContainer.mjs +2 -3
- package/dist/base-primitives/edge/EdgeLabel.mjs +3 -3
- package/dist/base-primitives/edge/EdgeLabelContainer.mjs +2 -3
- package/dist/base-primitives/edge/EdgeMarkers.mjs +1 -2
- package/dist/base-primitives/edge/EdgePath.mjs +1 -2
- package/dist/base-primitives/element/ElementActionButtons.d.mts +1 -2
- package/dist/base-primitives/element/ElementActionButtons.mjs +2 -3
- package/dist/base-primitives/element/ElementData.d.mts +1 -2
- package/dist/base-primitives/element/ElementData.mjs +1 -2
- package/dist/base-primitives/element/ElementDetailsButton.d.mts +1 -2
- package/dist/base-primitives/element/ElementDetailsButton.mjs +2 -3
- package/dist/base-primitives/element/ElementNodeContainer.d.mts +1 -2
- package/dist/base-primitives/element/ElementNodeContainer.mjs +2 -3
- package/dist/base-primitives/element/ElementShape.d.mts +11 -6
- package/dist/base-primitives/element/ElementShape.mjs +10 -5
- package/dist/base-primitives/element/ElementTags.d.mts +6 -3
- package/dist/base-primitives/element/ElementTags.mjs +2 -4
- package/dist/base-primitives/index.d.mts +5 -5
- package/dist/base-primitives/memoEdge.d.mts +2 -6
- package/dist/base-primitives/memoEdge.mjs +1 -2
- package/dist/base-primitives/memoNode.d.mts +2 -6
- package/dist/components/EmptyBox.mjs +1 -2
- package/dist/components/ErrorFallback.d.mts +4 -3
- package/dist/components/ErrorFallback.mjs +61 -56
- package/dist/components/FloatingWindow.mjs +3 -4
- package/dist/components/GithubIcon.mjs +1 -2
- package/dist/components/Link.mjs +3 -4
- package/dist/components/Logo.d.mts +3 -5
- package/dist/components/Logo.mjs +28 -35
- package/dist/components/NavigationLink.mjs +1 -2
- package/dist/components/NavigationPanel.mjs +11 -11
- package/dist/components/PortalToContainer.d.mts +1 -3
- package/dist/components/PortalToContainer.mjs +1 -2
- package/dist/components/RootContainer.mjs +1 -2
- package/dist/components/SearchControl.css.mjs +1 -2
- package/dist/components/SearchControl.d.mts +1 -2
- package/dist/components/SearchControl.mjs +2 -3
- package/dist/components/ViewIcon.mjs +5 -6
- package/dist/components/ViewNotFound.mjs +1 -2
- package/dist/components/markdown/MarkdownWithRefs.mjs +268 -0
- package/dist/components/markdown/markdown-refs.mjs +145 -0
- package/dist/components/markdown/useMarkdownRefsInteractivity.mjs +126 -0
- package/dist/context/ComparingLayoutsContext.mjs +24 -0
- package/dist/context/CurrentViewModelProvider.mjs +1 -2
- package/dist/context/DiagramEventHandlers.mjs +3 -4
- package/dist/context/DiagramFeatures.d.mts +2 -3
- package/dist/context/DiagramFeatures.mjs +15 -9
- package/dist/context/EnsureMantine.mjs +1 -2
- package/dist/context/FramerMotionConfig.d.mts +1 -3
- package/dist/context/FramerMotionConfig.mjs +1 -2
- package/dist/context/IconRenderer.d.mts +1 -3
- package/dist/context/IconRenderer.mjs +14 -14
- package/dist/context/LikeC4ModelContext.d.mts +1 -2
- package/dist/context/LikeC4ModelContext.mjs +1 -2
- package/dist/context/LikeC4ProjectsContext.d.mts +1 -3
- package/dist/context/LikeC4ProjectsContext.mjs +1 -2
- package/dist/context/RootContainerContext.mjs +1 -2
- package/dist/context/TagStylesContext.d.mts +1 -2
- package/dist/context/TagStylesContext.mjs +7 -19
- package/dist/custom/builtins.d.mts +4 -1
- package/dist/custom/customNodes.d.mts +164 -7
- package/dist/custom/customNodes.mjs +387 -8
- package/dist/custom/index.d.mts +18 -30
- package/dist/custom/index.mjs +11 -19
- package/dist/custom/primitives.d.mts +3 -5
- package/dist/customization/CustomizationContext.d.mts +50 -0
- package/dist/customization/CustomizationContext.mjs +64 -0
- package/dist/customization/customizable.d.mts +32 -0
- package/dist/customization/customizable.mjs +75 -0
- package/dist/customization/customization-types.d.mts +40 -0
- package/dist/customization/customization-types.mjs +8 -0
- package/dist/customization/stableComponents.mjs +35 -0
- package/dist/editor/LikeC4EditorCallbacks.d.mts +1 -3
- package/dist/editor/LikeC4EditorCallbacks.mjs +1 -2
- package/dist/editor/LikeC4EditorProvider.d.mts +1 -3
- package/dist/editor/LikeC4EditorProvider.mjs +1 -2
- package/dist/editor/actor/actions.mjs +2 -3
- package/dist/editor/actor/hotkey.d.mts +1 -3
- package/dist/editor/actor/hotkey.mjs +1 -2
- package/dist/editor/actor/machine.d.mts +2 -4
- package/dist/editor/actor/machine.mjs +1 -2
- package/dist/editor/actor/setup.d.mts +1 -2
- package/dist/editor/actor/setup.mjs +1 -2
- package/dist/editor/actor/state.editor.mjs +2 -3
- package/dist/editor/actor/state.sync-queue.mjs +2 -3
- package/dist/editor/actor/types.d.mts +1 -3
- package/dist/editor/actor/types.mjs +1 -2
- package/dist/editor/applyChangesToManualLayout.mjs +1 -2
- package/dist/editor/index.d.mts +1 -1
- package/dist/editor/useEditorActorLogic.mjs +3 -4
- package/dist/hooks/safeContext.d.mts +16 -35
- package/dist/hooks/safeContext.mjs +1 -2
- package/dist/hooks/useCallbackRef.mjs +1 -2
- package/dist/hooks/useCurrentView.d.mts +1 -3
- package/dist/hooks/useCurrentView.mjs +1 -2
- package/dist/hooks/useCurrentViewModel.d.mts +0 -2
- package/dist/hooks/useCurrentViewModel.mjs +1 -2
- package/dist/hooks/useDiagram.d.mts +3 -12
- package/dist/hooks/useDiagram.mjs +11 -10
- package/dist/hooks/useDiagramCompareLayout.d.mts +2 -4
- package/dist/hooks/useDiagramCompareLayout.mjs +12 -21
- package/dist/hooks/useDiagramMarkdownRefActions.mjs +35 -0
- package/dist/hooks/useEdgeLabelFontLoader.mjs +29 -0
- package/dist/hooks/useEdgeTracks.mjs +2 -3
- package/dist/hooks/useEditorActor.mjs +1 -2
- package/dist/hooks/useId.mjs +1 -2
- package/dist/hooks/useLikeC4ElementsTree.mjs +1 -2
- package/dist/hooks/useLikeC4Model.d.mts +0 -2
- package/dist/hooks/useLikeC4Model.mjs +1 -2
- package/dist/hooks/useLikeC4Project.d.mts +2 -4
- package/dist/hooks/useLikeC4Project.mjs +1 -2
- package/dist/hooks/useLikeC4Styles.d.mts +1 -3
- package/dist/hooks/useLikeC4Styles.mjs +1 -2
- package/dist/hooks/useMantinePortalProps.mjs +1 -2
- package/dist/hooks/useSetState.mjs +1 -2
- package/dist/hooks/useUpdateEffect.d.mts +0 -2
- package/dist/hooks/useUpdateEffect.mjs +1 -2
- package/dist/hooks/useXYFlow.d.mts +1 -3
- package/dist/hooks/useXYFlow.mjs +1 -2
- package/dist/index.d.mts +20 -18
- package/dist/index.mjs +20 -18
- package/dist/likec4diagram/DiagramUI.mjs +14 -11
- package/dist/likec4diagram/DiagramXYFlow.mjs +34 -34
- package/dist/likec4diagram/convert-to-xyflow.mjs +7 -3
- package/dist/likec4diagram/custom/edges/EdgeDrifts.mjs +4 -3
- package/dist/likec4diagram/custom/edges/RelationshipEdge.mjs +18 -14
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.mjs +3 -4
- package/dist/likec4diagram/custom/edges/useControlPoints.mjs +2 -3
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.mjs +2 -3
- package/dist/likec4diagram/custom/index.mjs +4 -5
- package/dist/likec4diagram/custom/nodes/CompoundActions.d.mts +1 -2
- package/dist/likec4diagram/custom/nodes/CompoundActions.mjs +2 -3
- package/dist/likec4diagram/custom/nodes/ElementActions.d.mts +3 -4
- package/dist/likec4diagram/custom/nodes/ElementActions.mjs +4 -5
- package/dist/likec4diagram/custom/nodes/GraphElementNode.d.mts +6 -1
- package/dist/likec4diagram/custom/nodes/GraphElementNode.mjs +3 -4
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.mts +6 -1
- package/dist/likec4diagram/custom/nodes/NodeDrifts.mjs +4 -3
- package/dist/likec4diagram/custom/nodes/NodeNotes.mjs +3 -5
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.d.mts +1 -3
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.mjs +3 -4
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.d.mts +3 -1
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.mjs +1 -2
- package/dist/likec4diagram/custom/nodes/index.d.mts +4 -4
- package/dist/likec4diagram/custom/nodes/nodes.d.mts +3 -4
- package/dist/likec4diagram/custom/nodes/nodes.mjs +19 -21
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.mjs +1 -2
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.d.mts +1 -3
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.mjs +1 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.mts +1 -3
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.mjs +4 -5
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.mts +1 -3
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.mjs +4 -6
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.mjs +3 -4
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.mjs +1 -2
- package/dist/likec4diagram/custom/nodes/toolbar/types.mjs +1 -2
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.mjs +1 -2
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.mjs +29 -12
- package/dist/likec4diagram/relationship-popover/actor.mjs +1 -2
- package/dist/likec4diagram/relationship-popover/components.mjs +1 -2
- package/dist/likec4diagram/state/DiagramActorProvider.mjs +22 -34
- package/dist/likec4diagram/state/aligners.d.mts +1 -3
- package/dist/likec4diagram/state/aligners.mjs +1 -2
- package/dist/likec4diagram/state/assign.mjs +3 -4
- package/dist/likec4diagram/state/createViewChange.mjs +1 -2
- package/dist/likec4diagram/state/diagram-api.d.mts +33 -16
- package/dist/likec4diagram/state/diagram-api.mjs +55 -31
- package/dist/likec4diagram/state/hotkeyActor.d.mts +1 -3
- package/dist/likec4diagram/state/hotkeyActor.mjs +12 -6
- package/dist/likec4diagram/state/machine.actions.layout.mjs +2 -3
- package/dist/likec4diagram/state/machine.actions.mjs +81 -44
- package/dist/likec4diagram/state/machine.d.mts +107 -15
- package/dist/likec4diagram/state/machine.mjs +3 -4
- package/dist/likec4diagram/state/machine.setup.d.mts +14 -10
- package/dist/likec4diagram/state/machine.setup.mjs +55 -28
- package/dist/likec4diagram/state/machine.state.initializing.mjs +3 -4
- package/dist/likec4diagram/state/machine.state.navigating.mjs +3 -6
- package/dist/likec4diagram/state/machine.state.ready.comparing.mjs +63 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.mjs +10 -7
- package/dist/likec4diagram/state/machine.state.ready.idle.mjs +10 -7
- package/dist/likec4diagram/state/machine.state.ready.mjs +8 -8
- package/dist/likec4diagram/state/machine.state.ready.printing.mjs +3 -4
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.mjs +5 -6
- package/dist/likec4diagram/state/mediaPrintActor.d.mts +1 -3
- package/dist/likec4diagram/state/mediaPrintActor.mjs +1 -2
- package/dist/likec4diagram/state/persistence.mjs +12 -5
- package/dist/likec4diagram/state/types.d.mts +1 -3
- package/dist/likec4diagram/state/utils.mjs +2 -3
- package/dist/likec4diagram/types.d.mts +1 -3
- package/dist/likec4diagram/ui/FloatingSequenceActors.mjs +5 -7
- package/dist/likec4diagram/ui/notation/NotationPanel.css.mjs +1 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.mjs +6 -7
- package/dist/likec4diagram/ui/sequence-outline/ActiveTrail.mjs +2 -3
- package/dist/likec4diagram/ui/sequence-outline/FlowRow.mjs +3 -4
- package/dist/likec4diagram/ui/sequence-outline/OutlineBody.mjs +4 -7
- package/dist/likec4diagram/ui/sequence-outline/OutlineHeader.mjs +4 -5
- package/dist/likec4diagram/ui/sequence-outline/OutlineNodes.mjs +4 -6
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.mjs +2 -3
- package/dist/likec4diagram/ui/sequence-outline/StepBadge.mjs +1 -2
- package/dist/likec4diagram/ui/sequence-outline/StepRow.mjs +7 -8
- package/dist/likec4diagram/ui/sequence-outline/StoreProvider.mjs +3 -9
- package/dist/likec4diagram/ui/sequence-outline/depth-of-field.mjs +1 -2
- package/dist/likec4diagram/ui/sequence-outline/motion.mjs +1 -2
- package/dist/likec4diagram/ui/sequence-outline/presentation.mjs +7 -8
- package/dist/likec4diagram/ui/sequence-outline/tree.mjs +1 -2
- package/dist/likec4diagram/ui/sequence-outline/types.mjs +1 -2
- package/dist/likec4diagram/useLayoutConstraints.mjs +5 -10
- package/dist/likec4diagram/useNodeDragHandlers.mjs +28 -0
- package/dist/likec4diagram/xyflow-diagram/diagram-view.mjs +9 -2
- package/dist/likec4diagram/xyflow-graph/graph-view-to-xy.mjs +1 -2
- package/dist/likec4diagram/xyflow-graph/useGraphForceSimulation.mjs +3 -6
- package/dist/likec4diagram/xyflow-props.mjs +25 -0
- package/dist/likec4diagram/xyflow-sequence/const.mjs +1 -2
- package/dist/likec4diagram/xyflow-sequence/layouter.mjs +2 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-view-to-xy.mjs +2 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-view.mjs +2 -3
- package/dist/likec4diagram/xyflow-sequence/utils.mjs +1 -2
- package/dist/navigationpanel/ElementViewControls.mjs +6 -7
- package/dist/navigationpanel/NavigationPanel.mjs +38 -67
- package/dist/navigationpanel/NavigationPanelControls.mjs +35 -114
- package/dist/navigationpanel/NavigationPanelDropdown.mjs +37 -34
- package/dist/navigationpanel/_common.mjs +3 -4
- package/dist/navigationpanel/actor.actions.mjs +1 -2
- package/dist/navigationpanel/actor.d.mts +0 -2
- package/dist/navigationpanel/actor.mjs +2 -3
- package/dist/navigationpanel/actor.setup.d.mts +1 -3
- package/dist/navigationpanel/actor.setup.mjs +1 -2
- package/dist/navigationpanel/comparepanel/ComparePanel.mjs +160 -90
- package/dist/navigationpanel/comparepanel/DriftsSummary.mjs +173 -142
- package/dist/{likec4diagram/ui → navigationpanel/comparepanel}/LayoutDriftFrame.mjs +6 -12
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.mjs +14 -19
- package/dist/navigationpanel/controls/LayoutWarning.mjs +3 -4
- package/dist/navigationpanel/controls/LogoButton.mjs +5 -23
- package/dist/navigationpanel/controls/NavigationBreadcrumbs.mjs +110 -0
- package/dist/navigationpanel/controls/NavigationButtons.mjs +3 -4
- package/dist/navigationpanel/controls/OpenSource.mjs +2 -3
- package/dist/navigationpanel/controls/SearchControl.mjs +2 -3
- package/dist/navigationpanel/controls/ToggleReadonly.mjs +36 -21
- package/dist/navigationpanel/controls/ViewDetailsButton.mjs +12 -15
- package/dist/navigationpanel/dropdown/ProjectsMenu.mjs +46 -13
- package/dist/navigationpanel/editorpanel/ApplySemanticLayout.mjs +3 -4
- package/dist/navigationpanel/editorpanel/CenterCamera.mjs +2 -3
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.mjs +3 -4
- package/dist/navigationpanel/editorpanel/EditorPanel.mjs +4 -4
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.mjs +11 -13
- package/dist/navigationpanel/editorpanel/ToggleReadonly.mjs +2 -3
- package/dist/navigationpanel/editorpanel/_common.mjs +1 -2
- package/dist/navigationpanel/editorpanel/styles.mjs +1 -2
- package/dist/navigationpanel/hooks.mjs +1 -2
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.mjs +5 -6
- package/dist/navigationpanel/walkthrough/DynamicViewControls.mjs +7 -9
- package/dist/navigationpanel/walkthrough/DynamicViewModeSwitcher.mjs +1 -2
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.mjs +3 -4
- package/dist/navigationpanel/windows/ViewDetailsWindow.mjs +44 -38
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowFork.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowGuide.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.mjs +1 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCaretRightFilled.mjs +16 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCornerDownRight.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStop.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRepeat.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRobot.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSparkles.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.mjs +1 -2
- package/dist/overlays/Overlays.mjs +4 -5
- package/dist/overlays/element-details/ElementDetails.mjs +2 -3
- package/dist/overlays/element-details/ElementDetailsCard.css.mjs +148 -102
- package/dist/overlays/element-details/ElementDetailsCard.mjs +503 -256
- package/dist/overlays/element-details/MetadataValue.mjs +115 -222
- package/dist/overlays/element-details/PropertiesSplit.mjs +162 -0
- package/dist/overlays/element-details/TabPanelDeployments.css.mjs +1 -2
- package/dist/overlays/element-details/TabPanelDeployments.mjs +5 -6
- package/dist/overlays/element-details/TabPanelRelationships.css.mjs +1 -2
- package/dist/overlays/element-details/TabPanelRelationships.mjs +6 -7
- package/dist/overlays/element-details/TabPanelStructure.css.mjs +1 -2
- package/dist/overlays/element-details/TabPanelStructure.mjs +3 -4
- package/dist/overlays/element-details/TabPanelViews.mjs +51 -0
- package/dist/overlays/element-details/actor.d.mts +6 -7
- package/dist/overlays/element-details/actor.mjs +31 -15
- package/dist/overlays/element-details/actorContext.mjs +1 -2
- package/dist/overlays/element-details/subject.d.mts +12 -0
- package/dist/overlays/element-details/subject.mjs +15 -0
- package/dist/overlays/hooks.mjs +1 -2
- package/dist/overlays/overlay/Overlay.d.mts +1 -3
- package/dist/overlays/overlay/Overlay.mjs +4 -5
- package/dist/overlays/overlaysActor.d.mts +12 -5
- package/dist/overlays/overlaysActor.mjs +24 -6
- package/dist/overlays/relationship-details/RelationshipDetails.mjs +16 -8
- package/dist/overlays/relationship-details/SelectEdge.css.mjs +1 -2
- package/dist/overlays/relationship-details/SelectEdge.mjs +3 -4
- package/dist/overlays/relationship-details/_types.d.mts +6 -4
- package/dist/overlays/relationship-details/actor.d.mts +0 -2
- package/dist/overlays/relationship-details/actor.mjs +2 -3
- package/dist/overlays/relationship-details/compute.mjs +1 -2
- package/dist/overlays/relationship-details/custom/ElementActions.mjs +6 -7
- package/dist/overlays/relationship-details/custom/edgeTypes.mjs +8 -13
- package/dist/overlays/relationship-details/custom/nodeTypes.mjs +8 -6
- package/dist/overlays/relationship-details/hooks.mjs +1 -2
- package/dist/overlays/relationship-details/layout-to-xyflow.mjs +3 -3
- package/dist/overlays/relationship-details/layout.d.mts +1 -3
- package/dist/overlays/relationship-details/layout.mjs +39 -13
- package/dist/overlays/relationships-browser/RelationshipsBrowser.mjs +12 -13
- package/dist/overlays/relationships-browser/SelectElement.css.mjs +1 -2
- package/dist/overlays/relationships-browser/SelectElement.mjs +4 -5
- package/dist/overlays/relationships-browser/_types.d.mts +6 -4
- package/dist/overlays/relationships-browser/actor.d.mts +0 -2
- package/dist/overlays/relationships-browser/actor.mjs +4 -5
- package/dist/overlays/relationships-browser/const.mjs +1 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.mjs +6 -7
- package/dist/overlays/relationships-browser/custom/EmptyNode.mjs +1 -2
- package/dist/overlays/relationships-browser/custom/edgeTypes.mjs +14 -17
- package/dist/overlays/relationships-browser/custom/nodeTypes.mjs +12 -7
- package/dist/overlays/relationships-browser/hooks.mjs +1 -2
- package/dist/overlays/relationships-browser/layout.d.mts +1 -3
- package/dist/overlays/relationships-browser/layout.mjs +73 -24
- package/dist/overlays/relationships-browser/useViewToNodesEdges.mjs +2 -2
- package/dist/overlays/types.d.mts +5 -7
- package/dist/projects-overview/ProjectsOverview.d.mts +1 -3
- package/dist/projects-overview/ProjectsOverview.mjs +1 -2
- package/dist/projects-overview/ProjectsOverviewXY.d.mts +1 -3
- package/dist/projects-overview/ProjectsOverviewXY.mjs +3 -4
- package/dist/projects-overview/actor.mjs +1 -2
- package/dist/projects-overview/context.mjs +1 -2
- package/dist/projects-overview/custom/edgeTypes.mjs +2 -3
- package/dist/projects-overview/custom/nodeTypes.mjs +3 -4
- package/dist/projects-overview/hooks.mjs +1 -2
- package/dist/projects-overview/layouted-to-xyflow.mjs +1 -2
- package/dist/projects-overview/panel/ProjectsOverviewPanel.mjs +1 -2
- package/dist/projects-overview/persistence.mjs +1 -2
- package/dist/search/Search.d.mts +1 -3
- package/dist/search/Search.mjs +13 -12
- package/dist/search/SearchContext.d.mts +1 -3
- package/dist/search/SearchContext.mjs +1 -2
- package/dist/search/XStateSearchAdapter.mjs +1 -2
- package/dist/search/components/ElementsColumn.css.mjs +1 -2
- package/dist/search/components/ElementsColumn.mjs +31 -9
- package/dist/search/components/PickView.mjs +3 -4
- package/dist/search/components/SearchByTags.mjs +3 -4
- package/dist/search/components/SearchInput.mjs +3 -4
- package/dist/search/components/ViewsColum.mjs +20 -20
- package/dist/search/components/ViewsColumn.css.mjs +1 -2
- package/dist/search/components/_shared.css.mjs +1 -2
- package/dist/search/components/styles.css.mjs +1 -2
- package/dist/search/components/utils.mjs +32 -3
- package/dist/search/fuzzy.mjs +27 -0
- package/dist/search/hooks.mjs +1 -2
- package/dist/search/metadata-search.mjs +32 -0
- package/dist/search/searchActor.d.mts +1 -3
- package/dist/search/searchActor.mjs +1 -2
- package/dist/shadowroot/ShadowRoot.mjs +8 -7
- package/dist/styles-font2.mjs +1 -2
- package/dist/styles-min.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles2.mjs +2 -3
- package/dist/utils/defineActors.d.mts +1 -3
- package/dist/utils/defineActors.mjs +1 -2
- package/dist/utils/edge-corners.mjs +2 -3
- package/dist/utils/edge-endpoints.mjs +1 -2
- package/dist/utils/edge-label.mjs +1 -2
- package/dist/utils/edge-path-through-label.mjs +51 -0
- package/dist/utils/edge-path.mjs +1 -2
- package/dist/utils/edge-tracks.mjs +1 -2
- package/dist/utils/filterProjects.d.mts +10 -0
- package/dist/utils/filterProjects.mjs +36 -0
- package/dist/utils/index.mjs +1 -0
- package/dist/utils/measure-edge-label.mjs +129 -0
- package/dist/utils/readableText.mjs +1 -2
- package/dist/utils/roundDpr.mjs +1 -2
- package/dist/utils/search-event.mjs +17 -0
- package/dist/utils/view-bounds.d.mts +1 -3
- package/dist/utils/view-bounds.mjs +1 -2
- package/dist/utils/view-routing.mjs +1 -2
- package/dist/utils/xyflow.mjs +2 -3
- package/dist/webcomponent/defineWebcomponent.d.mts +12 -0
- package/dist/webcomponent/defineWebcomponent.mjs +93 -0
- package/package.json +29 -26
- package/panda.buildinfo.json +211 -208
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/base-primitives/memoNode.mjs +0 -23
- package/dist/context/DiagramEventHandlers.d.mts +0 -11
- package/dist/custom/hooks.d.mts +0 -17
- package/dist/hooks/useSetState.d.mts +0 -10
- package/dist/likec4diagram/custom/edges/edges.css.mjs +0 -50
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.mjs +0 -69
- package/dist/navigationpanel/comparepanel/ComparePanelControls.mjs +0 -56
- package/dist/navigationpanel/styles.css.mjs +0 -23
- package/src/styles-font.css +0 -114
- package/src/styles-min.css +0 -2
- package/src/styles-xyflow.css +0 -1
- package/src/styles.css +0 -3
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ Contents:
|
|
|
25
25
|
- [With PandaCSS](#with-pandacss)
|
|
26
26
|
- [Usage](#usage)
|
|
27
27
|
- [Customization](#customization)
|
|
28
|
+
- [UI slots (experimental)](#ui-slots-experimental)
|
|
28
29
|
- [Node renderer](#custom-node-renderer)
|
|
29
30
|
- [Styles](#custom-styles)
|
|
30
31
|
|
|
@@ -35,6 +36,8 @@ You need to prepare it and wrap your diagram with`LikeC4ModelProvider` component
|
|
|
35
36
|
|
|
36
37
|
See [📖 Documentation](https://likec4.dev/tooling/react/#likec4modelprovider) for examples.
|
|
37
38
|
|
|
39
|
+
## Bundled version
|
|
40
|
+
|
|
38
41
|
### LikeC4View
|
|
39
42
|
|
|
40
43
|
The easiest way to use this package is the `LikeC4View` component.\
|
|
@@ -49,7 +52,7 @@ import { likec4model } from './likec4-model.ts'
|
|
|
49
52
|
|
|
50
53
|
function App() {
|
|
51
54
|
return (
|
|
52
|
-
<LikeC4ModelProvider
|
|
55
|
+
<LikeC4ModelProvider likec4model={likec4model}>
|
|
53
56
|
<LikeC4View
|
|
54
57
|
viewId="index1"
|
|
55
58
|
onNodeClick={(nodeId) => console.log(nodeId)}
|
|
@@ -66,7 +69,7 @@ See [LikeC4ViewProps](./src/LikeC4View.tsx) for available props.
|
|
|
66
69
|
You may need to import icons, if you use built-in node renderers.
|
|
67
70
|
|
|
68
71
|
```tsx
|
|
69
|
-
import { type ElementIconRenderer,
|
|
72
|
+
import { type ElementIconRenderer, LikeC4ModelProvider, LikeC4View } from '@likec4/diagram'
|
|
70
73
|
import { lazy, Suspense } from 'react'
|
|
71
74
|
|
|
72
75
|
// Better to lazy load icons, bundle is quite large at the moment
|
|
@@ -82,7 +85,7 @@ const IconRenderer: ElementIconRenderer = (props) => {
|
|
|
82
85
|
|
|
83
86
|
function App() {
|
|
84
87
|
return (
|
|
85
|
-
<LikeC4ModelProvider
|
|
88
|
+
<LikeC4ModelProvider likec4model={likec4model}>
|
|
86
89
|
<LikeC4View
|
|
87
90
|
viewId="index1"
|
|
88
91
|
renderIcon={IconRenderer}
|
|
@@ -103,7 +106,7 @@ import { ReactLikeC4, LikeC4ModelProvider } from '@likec4/diagram'
|
|
|
103
106
|
function App() {
|
|
104
107
|
const [viewId, setViewId] = useState('index')
|
|
105
108
|
return (
|
|
106
|
-
<LikeC4ModelProvider
|
|
109
|
+
<LikeC4ModelProvider likec4model={likec4model}>
|
|
107
110
|
<ReactLikeC4
|
|
108
111
|
viewId={viewId}
|
|
109
112
|
pannable
|
|
@@ -124,8 +127,8 @@ function App() {
|
|
|
124
127
|
|
|
125
128
|
### `likec4/react`
|
|
126
129
|
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
If you already use the [`likec4`](https://www.npmjs.com/package/likec4) package, you do not need to install this one:
|
|
131
|
+
`likec4/react` exports everything from `@likec4/diagram` and `@likec4/diagram/custom`.
|
|
129
132
|
|
|
130
133
|
## Library version
|
|
131
134
|
|
|
@@ -172,13 +175,12 @@ Here are the options:
|
|
|
172
175
|
### With PandaCSS
|
|
173
176
|
|
|
174
177
|
```bash
|
|
175
|
-
pnpm add @likec4/styles
|
|
178
|
+
pnpm add @likec4/styles @likec4/style-preset
|
|
176
179
|
```
|
|
177
180
|
|
|
178
181
|
Configure your `panda.config.ts`:
|
|
179
182
|
|
|
180
183
|
```ts
|
|
181
|
-
import likec4preset from '@likec4/styles/preset'
|
|
182
184
|
import { defineConfig } from '@pandacss/dev'
|
|
183
185
|
|
|
184
186
|
export default defineConfig({
|
|
@@ -191,7 +193,7 @@ export default defineConfig({
|
|
|
191
193
|
'@likec4/styles',
|
|
192
194
|
],
|
|
193
195
|
presets: [
|
|
194
|
-
|
|
196
|
+
'@likec4/style-preset',
|
|
195
197
|
],
|
|
196
198
|
theme: {
|
|
197
199
|
extend: {
|
|
@@ -327,6 +329,56 @@ actions that modify a saved manual layout.
|
|
|
327
329
|
|
|
328
330
|
## Customization
|
|
329
331
|
|
|
332
|
+
There are two customization layers:
|
|
333
|
+
|
|
334
|
+
1. **UI slots** — replace or wrap shell components (`LikeC4Diagram`, logos, …) via `CustomizationProvider`
|
|
335
|
+
2. **Node renderers** — customize how individual diagram nodes are drawn via `renderNodes`
|
|
336
|
+
|
|
337
|
+
### UI slots (experimental)
|
|
338
|
+
|
|
339
|
+
> [!WARNING]
|
|
340
|
+
> Experimental API — slot names and helper signatures may change.
|
|
341
|
+
|
|
342
|
+
Wrap your diagram tree with `CustomizationProvider` and pass overrides from `defineCustomComponents`.
|
|
343
|
+
|
|
344
|
+
- **replace** — provide a component with the same props as the slot
|
|
345
|
+
- **wrap** — use `wrap` from `defineCustomComponents`; your component receives `{ Original, ...props }`
|
|
346
|
+
|
|
347
|
+
```tsx
|
|
348
|
+
import { LikeC4ModelProvider, LikeC4View } from '@likec4/diagram'
|
|
349
|
+
import {
|
|
350
|
+
CustomizationProvider,
|
|
351
|
+
defineCustomComponents,
|
|
352
|
+
} from '@likec4/diagram/custom'
|
|
353
|
+
|
|
354
|
+
const components = defineCustomComponents(({ wrap }) => ({
|
|
355
|
+
// Replace the logo SVG entirely
|
|
356
|
+
LogoSvg: (props) => (
|
|
357
|
+
<svg {...props}>
|
|
358
|
+
<text>Brand</text>
|
|
359
|
+
</svg>
|
|
360
|
+
),
|
|
361
|
+
// Wrap the diagram to inject default props
|
|
362
|
+
LikeC4View: wrap(({ Original, ...props }) => <Original {...props} pannable={false} />),
|
|
363
|
+
}))
|
|
364
|
+
|
|
365
|
+
function App() {
|
|
366
|
+
return (
|
|
367
|
+
<CustomizationProvider components={components}>
|
|
368
|
+
<LikeC4ModelProvider likec4model={likec4model}>
|
|
369
|
+
<LikeC4View viewId="index" />
|
|
370
|
+
</LikeC4ModelProvider>
|
|
371
|
+
</CustomizationProvider>
|
|
372
|
+
)
|
|
373
|
+
}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Registered slots today: `LikeC4Diagram`, `LikeC4View`, `ReactLikeC4`, `LogoSvg`, `LogoIconSvg`, `NavigationPanelLogo`.
|
|
377
|
+
|
|
378
|
+
Keep the `components` object referentially stable (module scope) so HMR keeps override identities stable.
|
|
379
|
+
|
|
380
|
+
When using the bundled React package, import the same helpers from `likec4/react`.
|
|
381
|
+
|
|
330
382
|
### Custom node renderer
|
|
331
383
|
|
|
332
384
|
LikeC4Diagram can use custom node renderers.\
|
|
@@ -337,11 +389,11 @@ See [customNodes.tsx](./src/custom/customNodes.tsx) for examples.
|
|
|
337
389
|
import { LikeC4Diagram } from '@likec4/diagram'
|
|
338
390
|
import {
|
|
339
391
|
ElementActions,
|
|
392
|
+
ElementData,
|
|
340
393
|
ElementDetailsButtonWithHandler,
|
|
341
394
|
elementNode,
|
|
342
395
|
ElementNodeContainer,
|
|
343
396
|
ElementShape,
|
|
344
|
-
ElementTitle,
|
|
345
397
|
ElementToolbar,
|
|
346
398
|
IfNotReadOnly,
|
|
347
399
|
} from '@likec4/diagram/custom'
|
|
@@ -351,7 +403,7 @@ const renderNodes = {
|
|
|
351
403
|
element: elementNode(({ nodeProps, nodeModel }) => (
|
|
352
404
|
<ElementNodeContainer nodeProps={nodeProps}>
|
|
353
405
|
<ElementShape {...nodeProps} />
|
|
354
|
-
<
|
|
406
|
+
<ElementData {...nodeProps} />
|
|
355
407
|
<ElementActions
|
|
356
408
|
{...nodeProps}
|
|
357
409
|
extraButtons={[
|
package/dist/LikeC4Diagram.d.mts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { Customizable } from "./customization/customization-types.mjs";
|
|
2
3
|
import { LikeC4DiagramEventHandlers, LikeC4DiagramProperties } from "./LikeC4Diagram.props.mjs";
|
|
3
4
|
import { PropsWithChildren } from "react";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
//#region src/LikeC4Diagram.d.ts
|
|
7
|
-
export type LikeC4DiagramProps<A extends Any = Any> = PropsWithChildren<LikeC4DiagramProperties<A> & LikeC4DiagramEventHandlers<A>>;
|
|
5
|
+
import * as t from "@likec4/core/types";
|
|
6
|
+
export type LikeC4DiagramProps<A extends t.Any = t.Any> = PropsWithChildren<LikeC4DiagramProperties<A> & LikeC4DiagramEventHandlers<A>>;
|
|
8
7
|
/**
|
|
9
8
|
* Low-level component to display LikeC4 view
|
|
10
9
|
* Expects CSS to be injected
|
|
11
10
|
*
|
|
12
11
|
* Use {@link ReactLikeC4} or {@link LikeC4View} for ready-to-use component
|
|
13
12
|
*/
|
|
14
|
-
export declare
|
|
15
|
-
//#endregion
|
|
13
|
+
export declare const LikeC4Diagram: Customizable<(<A extends t.Any = t.Any>(props: LikeC4DiagramProps<A>) => import("react").JSX.Element), "LikeC4Diagram">;
|
package/dist/LikeC4Diagram.mjs
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { IconRendererProvider } from "./context/IconRenderer.mjs";
|
|
3
2
|
import { FitViewPaddings, MaxZoom, MinZoom } from "./base/const.mjs";
|
|
4
3
|
import { RootContainer } from "./components/RootContainer.mjs";
|
|
5
4
|
import { DiagramEventHandlers } from "./context/DiagramEventHandlers.mjs";
|
|
6
5
|
import { DiagramFeatures } from "./context/DiagramFeatures.mjs";
|
|
7
6
|
import { EnsureMantine } from "./context/EnsureMantine.mjs";
|
|
8
7
|
import { FramerMotionConfig } from "./context/FramerMotionConfig.mjs";
|
|
9
|
-
import {
|
|
8
|
+
import { IconRendererProvider } from "./context/IconRenderer.mjs";
|
|
10
9
|
import { CurrentViewModelProvider } from "./context/CurrentViewModelProvider.mjs";
|
|
11
10
|
import { TagStylesProvider } from "./context/TagStylesContext.mjs";
|
|
11
|
+
import { customizable } from "./customization/customizable.mjs";
|
|
12
12
|
import { useOptionalLikeC4Editor } from "./editor/LikeC4EditorProvider.mjs";
|
|
13
|
-
import { useId } from "./hooks/useId.mjs";
|
|
14
|
-
import {
|
|
13
|
+
import { useId as useId$1 } from "./hooks/useId.mjs";
|
|
14
|
+
import { useOptionalLikeC4Model } from "./context/LikeC4ModelContext.mjs";
|
|
15
15
|
import { convertToXYFlow } from "./likec4diagram/convert-to-xyflow.mjs";
|
|
16
|
-
import { LikeC4Styles } from "./LikeC4Styles.mjs";
|
|
17
16
|
import { LikeC4DiagramUI } from "./likec4diagram/DiagramUI.mjs";
|
|
18
17
|
import { LikeC4DiagramXYFlow } from "./likec4diagram/DiagramXYFlow.mjs";
|
|
19
18
|
import { DiagramActorProvider } from "./likec4diagram/state/DiagramActorProvider.mjs";
|
|
19
|
+
import { LikeC4Styles } from "./LikeC4Styles.mjs";
|
|
20
|
+
import { pickViewBounds } from "./utils/view-bounds.mjs";
|
|
20
21
|
import { Profiler, useRef } from "react";
|
|
21
22
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
23
|
import { useCustomCompareMemo } from "@react-hookz/web";
|
|
@@ -24,7 +25,7 @@ import { ReactFlowProvider } from "@xyflow/react";
|
|
|
24
25
|
import { deepEqual } from "fast-equals";
|
|
25
26
|
import { isEmptyish, isPlainObject, mapValues } from "remeda";
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
// src/LikeC4Diagram.tsx
|
|
28
29
|
const noop = () => {};
|
|
29
30
|
/**
|
|
30
31
|
* Low-level component to display LikeC4 view
|
|
@@ -32,14 +33,15 @@ const noop = () => {};
|
|
|
32
33
|
*
|
|
33
34
|
* Use {@link ReactLikeC4} or {@link LikeC4View} for ready-to-use component
|
|
34
35
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
const LikeC4Diagram = customizable("LikeC4Diagram")((props) => {
|
|
37
|
+
let { onCanvasClick, onCanvasContextMenu, onCanvasDblClick, onEdgeClick, onEdgeContextMenu, onNavigateTo, onNodeClick, onNodeContextMenu, onOpenSource, onLogoClick, onLayoutTypeChange, onRelationshipBrowserScopeChange, onInitialized, view, className, controls = true, fitView = true, initialZoom, fitViewPadding: _fitViewPadding = controls ? FitViewPaddings.withControls : FitViewPaddings.default, pannable = true, zoomable = true, background = "dots", enableElementTags = false, enableFocusMode = false, enableElementDetails = false, enableRelationshipDetails = false, enableRelationshipBrowser = false, relationshipBrowserScope = "view", enableCompareWithLatest = !!onLayoutTypeChange, nodesSelectable, enableNotations = false, showNavigationButtons = !!onNavigateTo, enableDynamicViewWalkthrough = false, dynamicViewVariant, enableSearch = false, enableNotes = true, initialWidth, initialHeight, reduceGraphics = "auto", renderIcon, where, reactFlowProps, renderNodes, minZoom = MinZoom, maxZoom = 3, children } = props;
|
|
38
|
+
const id = useId$1();
|
|
37
39
|
const initialRef = useRef(null);
|
|
38
40
|
const optionalLikeC4Model = useOptionalLikeC4Model();
|
|
39
41
|
enableCompareWithLatest = enableCompareWithLatest && !!onLayoutTypeChange && !!optionalLikeC4Model && !isEmptyish(optionalLikeC4Model.$data.manualLayouts);
|
|
40
42
|
const hasLikeC4Model = !!optionalLikeC4Model;
|
|
41
43
|
const editor = useOptionalLikeC4Editor();
|
|
42
|
-
const hasEditor = !!editor;
|
|
44
|
+
const hasEditor = !!editor && hasLikeC4Model;
|
|
43
45
|
const readonly = !hasEditor;
|
|
44
46
|
nodesSelectable ??= hasEditor || enableFocusMode || !!onNavigateTo || !!onNodeClick;
|
|
45
47
|
const bounds = pickViewBounds(view, dynamicViewVariant);
|
|
@@ -48,7 +50,7 @@ function LikeC4Diagram({ onCanvasClick, onCanvasContextMenu, onCanvasDblClick, o
|
|
|
48
50
|
if (initialRef.current == null) {
|
|
49
51
|
const { xynodes, xyedges } = convertToXYFlow({
|
|
50
52
|
view,
|
|
51
|
-
dynamicViewVariant: dynamicViewVariant ?? "diagram",
|
|
53
|
+
dynamicViewVariant: dynamicViewVariant ?? (view._type === "dynamic" ? view.variant : "diagram"),
|
|
52
54
|
elementViewVariant: "diagram",
|
|
53
55
|
where: where ?? null,
|
|
54
56
|
currentViewId: view.id,
|
|
@@ -150,7 +152,7 @@ function LikeC4Diagram({ onCanvasClick, onCanvasContextMenu, onCanvasDblClick, o
|
|
|
150
152
|
})
|
|
151
153
|
}) })
|
|
152
154
|
});
|
|
153
|
-
}
|
|
155
|
+
});
|
|
154
156
|
const toLiteralPaddingWithUnit = (value) => {
|
|
155
157
|
if (typeof value === "number") return `${value}px`;
|
|
156
158
|
return value;
|
|
@@ -169,5 +171,4 @@ function useNormalizedViewPadding(raw) {
|
|
|
169
171
|
}, [raw], deepEqual);
|
|
170
172
|
}
|
|
171
173
|
|
|
172
|
-
//#endregion
|
|
173
174
|
export { LikeC4Diagram };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import
|
|
2
|
+
import "./hooks/useDiagram.mjs";
|
|
3
3
|
import { XYFlowInstance } from "./hooks/useXYFlow.mjs";
|
|
4
4
|
import { DiagramApi } from "./likec4diagram/state/diagram-api.mjs";
|
|
5
|
-
import "./
|
|
5
|
+
import { Types } from "./likec4diagram/types.mjs";
|
|
6
6
|
import { MouseEvent, ReactNode } from "react";
|
|
7
7
|
import { ReactFlowProps } from "@xyflow/react";
|
|
8
8
|
import * as t from "@likec4/core/types";
|
|
9
9
|
import { DiagramEdge, DiagramNode, DynamicViewDisplayVariant, LayoutType, LayoutedView, WhereOperator as WhereOperator$1 } from "@likec4/core/types";
|
|
10
10
|
import { CamelCasedProperties, SetRequired } from "type-fest";
|
|
11
|
-
|
|
12
|
-
type
|
|
13
|
-
type Unknown = t.aux.UnknownLayouted;
|
|
11
|
+
type Any$1 = t.Any;
|
|
12
|
+
type Unknown = t.UnknownLayouted;
|
|
14
13
|
type ViewId$1<A> = t.aux.ViewId<A>;
|
|
15
14
|
type Fqn$1<A> = t.aux.Fqn<A>;
|
|
16
15
|
type RelationId$1 = t.aux.RelationId;
|
|
@@ -160,7 +159,7 @@ export interface LikeC4DiagramProperties<A extends Any$1 = Unknown> {
|
|
|
160
159
|
*/
|
|
161
160
|
enableSearch?: boolean | undefined;
|
|
162
161
|
/**
|
|
163
|
-
* Enable modal with element details
|
|
162
|
+
* Enable modal with logical element, deployment node, and deployed instance details.
|
|
164
163
|
* @default false
|
|
165
164
|
*/
|
|
166
165
|
enableElementDetails?: boolean | undefined;
|
|
@@ -293,5 +292,4 @@ export interface LikeC4DiagramEventHandlers<A extends Any$1 = Unknown> {
|
|
|
293
292
|
onLayoutTypeChange?: OnLayoutTypeChange | null | undefined;
|
|
294
293
|
onRelationshipBrowserScopeChange?: OnRelationshipBrowserScopeChange | null | undefined;
|
|
295
294
|
}
|
|
296
|
-
//#endregion
|
|
297
295
|
export type { WhereOperator$1 as WhereOperator };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { JSX } from "react";
|
|
3
3
|
import { DefaultMantineColor, MantineColorsTuple, MantineProviderProps } from "@mantine/core";
|
|
4
|
-
//#region src/LikeC4MantineProvider.d.ts
|
|
5
4
|
type LikeC4MantineProviderProps = MantineProviderProps;
|
|
6
5
|
/**
|
|
7
6
|
* LikeC4 Mantine provider with custom theme and CSS variables resolver
|
|
@@ -23,4 +22,4 @@ declare module '@mantine/core' {
|
|
|
23
22
|
colors: Record<ExtendedCustomColors, MantineColorsTuple>;
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
|
|
25
|
+
export {};
|
|
@@ -3,10 +3,10 @@ import { css } from "@likec4/styles/css";
|
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { map } from "remeda";
|
|
6
|
-
import { Card, Code, MantineProvider, Menu, Paper, Popover, SegmentedControl, Table, Title, Tooltip, createTheme, mergeThemeOverrides } from "@mantine/core";
|
|
6
|
+
import { ActionBar, Card, Code, MantineProvider, Menu, Paper, Popover, SegmentedControl, Table, Title, Tooltip, createTheme, mergeThemeOverrides } from "@mantine/core";
|
|
7
7
|
import { token } from "@likec4/styles/tokens";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/LikeC4MantineProvider.tsx
|
|
10
10
|
function t(name) {
|
|
11
11
|
return token.var(name);
|
|
12
12
|
}
|
|
@@ -94,14 +94,26 @@ const likec4Theme = createTheme({
|
|
|
94
94
|
textTransform: "uppercase",
|
|
95
95
|
letterSpacing: "caps.sm"
|
|
96
96
|
}) } }),
|
|
97
|
-
Tooltip: Tooltip.extend({
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
Tooltip: Tooltip.extend({
|
|
98
|
+
defaultProps: {
|
|
99
|
+
color: "dark",
|
|
100
|
+
fz: "xs",
|
|
101
|
+
withArrow: false,
|
|
102
|
+
openDelay: 600,
|
|
103
|
+
closeDelay: 120,
|
|
104
|
+
offset: 8
|
|
105
|
+
},
|
|
106
|
+
classNames: { tooltip: css({
|
|
107
|
+
shadow: {
|
|
108
|
+
base: "sm",
|
|
109
|
+
_dark: "lg"
|
|
110
|
+
},
|
|
111
|
+
_dark: {
|
|
112
|
+
bg: "surface.canvas",
|
|
113
|
+
border: "subtle"
|
|
114
|
+
}
|
|
115
|
+
}) }
|
|
116
|
+
}),
|
|
105
117
|
SegmentedControl: SegmentedControl.extend({ vars: (theme, props) => ({ root: { "--sc-font-size": theme.fontSizes[props.fz ?? props.size] } }) }),
|
|
106
118
|
Popover: Popover.extend({ defaultProps: {
|
|
107
119
|
withArrow: false,
|
|
@@ -111,6 +123,10 @@ const likec4Theme = createTheme({
|
|
|
111
123
|
Menu: Menu.extend({ defaultProps: {
|
|
112
124
|
radius: "sm",
|
|
113
125
|
shadow: "lg"
|
|
126
|
+
} }),
|
|
127
|
+
ActionBar: ActionBar.extend({ defaultProps: {
|
|
128
|
+
radius: "sm",
|
|
129
|
+
shadow: "lg"
|
|
114
130
|
} })
|
|
115
131
|
}
|
|
116
132
|
});
|
|
@@ -154,5 +170,4 @@ function LikeC4MantineProvider({ children, defaultColorScheme = "auto", theme, .
|
|
|
154
170
|
*/
|
|
155
171
|
const DefaultMantineProvider = LikeC4MantineProvider;
|
|
156
172
|
|
|
157
|
-
//#endregion
|
|
158
173
|
export { DefaultMantineProvider, LikeC4MantineProvider };
|
|
@@ -2,12 +2,10 @@ import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
3
|
import { JSX as JSX$1 } from "react/jsx-runtime";
|
|
4
4
|
import { LikeC4Model } from "@likec4/core/model";
|
|
5
|
-
//#region src/LikeC4ModelProvider.d.ts
|
|
6
5
|
export interface LikeC4ModelProviderProps {
|
|
7
6
|
likec4model: LikeC4Model<any>;
|
|
8
7
|
}
|
|
9
8
|
/**
|
|
10
9
|
* Ensures LikeC4Model context
|
|
11
10
|
*/
|
|
12
|
-
export declare function LikeC4ModelProvider({ children, likec4model }: PropsWithChildren<LikeC4ModelProviderProps>): JSX$1.Element;
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare function LikeC4ModelProvider({ children, likec4model }: PropsWithChildren<LikeC4ModelProviderProps>): JSX$1.Element;
|
|
@@ -2,7 +2,7 @@ import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { LikeC4ModelContextProvider } from "./context/LikeC4ModelContext.mjs";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/LikeC4ModelProvider.tsx
|
|
6
6
|
/**
|
|
7
7
|
* Ensures LikeC4Model context
|
|
8
8
|
*/
|
|
@@ -13,5 +13,4 @@ function LikeC4ModelProvider({ children, likec4model }) {
|
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
16
|
export { LikeC4ModelProvider };
|
|
@@ -3,10 +3,8 @@ import { ProjectsOverviewProps } from "./projects-overview/ProjectsOverview.mjs"
|
|
|
3
3
|
import "./projects-overview/index.mjs";
|
|
4
4
|
import { JSX } from "react/jsx-runtime";
|
|
5
5
|
import { Simplify } from "type-fest";
|
|
6
|
-
//#region src/LikeC4ProjectsOverview.d.ts
|
|
7
6
|
export type LikeC4ProjectsOverviewProps = Simplify<ProjectsOverviewProps & {
|
|
8
7
|
className?: string;
|
|
9
8
|
onSelectProject?: ProjectsOverviewProps['onNavigateToProject'];
|
|
10
9
|
}>;
|
|
11
|
-
export declare function LikeC4ProjectsOverview({ view, className, onNavigateToProject, ...props }: LikeC4ProjectsOverviewProps): JSX.Element;
|
|
12
|
-
//#endregion
|
|
10
|
+
export declare function LikeC4ProjectsOverview({ view, className, onNavigateToProject, ...props }: LikeC4ProjectsOverviewProps): JSX.Element;
|
|
@@ -8,7 +8,7 @@ import { LikeC4Styles } from "./LikeC4Styles.mjs";
|
|
|
8
8
|
import { ProjectsOverview } from "./projects-overview/ProjectsOverview.mjs";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// src/LikeC4ProjectsOverview.tsx
|
|
12
12
|
function LikeC4ProjectsOverview({ view, className, onNavigateToProject, ...props }) {
|
|
13
13
|
const onChangeLikeC4Project = useChangeLikeC4Project();
|
|
14
14
|
const id = useId();
|
|
@@ -24,5 +24,4 @@ function LikeC4ProjectsOverview({ view, className, onNavigateToProject, ...props
|
|
|
24
24
|
})] }) });
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
//#endregion
|
|
28
27
|
export { LikeC4ProjectsOverview };
|
|
@@ -2,7 +2,6 @@ import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
3
|
import { JSX as JSX$1 } from "react/jsx-runtime";
|
|
4
4
|
import { ProjectId } from "@likec4/core/types";
|
|
5
|
-
//#region src/LikeC4ProjectsProvider.d.ts
|
|
6
5
|
type LandingPageConfig = {
|
|
7
6
|
redirect: true;
|
|
8
7
|
} | {
|
|
@@ -32,4 +31,4 @@ export interface LikeC4ProjectsProviderProps {
|
|
|
32
31
|
* Ensures LikeC4Projects context
|
|
33
32
|
*/
|
|
34
33
|
export declare function LikeC4ProjectsProvider({ children, projects, onProjectChange: _onProjectChange }: PropsWithChildren<LikeC4ProjectsProviderProps>): JSX$1.Element;
|
|
35
|
-
|
|
34
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { useCallbackRef } from "./hooks/useCallbackRef.mjs";
|
|
3
2
|
import { LikeC4ProjectsContextProvider, useOptionalProjectsContext } from "./context/LikeC4ProjectsContext.mjs";
|
|
3
|
+
import { useCallbackRef } from "./hooks/useCallbackRef.mjs";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { deepEqual } from "fast-equals";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/LikeC4ProjectsProvider.tsx
|
|
9
9
|
/**
|
|
10
10
|
* Ensures LikeC4Projects context
|
|
11
11
|
*/
|
|
@@ -33,5 +33,4 @@ function LikeC4ProjectsProvider({ children, projects, onProjectChange: _onProjec
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
//#endregion
|
|
37
36
|
export { LikeC4ProjectsProvider };
|
package/dist/LikeC4Styles.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { JSX } from "react/jsx-runtime";
|
|
3
|
-
//#region src/LikeC4Styles.d.ts
|
|
4
3
|
interface LikeC4StylesProps {
|
|
5
4
|
/**
|
|
6
5
|
* Root element selector to scope the styles to (e.g., "#diagram-root")
|
|
@@ -13,4 +12,4 @@ interface LikeC4StylesProps {
|
|
|
13
12
|
* scoped to the provided root selector
|
|
14
13
|
*/
|
|
15
14
|
export declare function LikeC4Styles({ rootSelector }: LikeC4StylesProps): JSX.Element;
|
|
16
|
-
|
|
15
|
+
export {};
|
package/dist/LikeC4Styles.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { useLikeC4Styles } from "./hooks/useLikeC4Styles.mjs";
|
|
3
3
|
import { memo, useMemo } from "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { entries, join, map, pipe } from "remeda";
|
|
6
6
|
import { useMantineStyleNonce } from "@mantine/core";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/LikeC4Styles.tsx
|
|
9
9
|
const scheme = (scheme) => `[data-mantine-color-scheme="${scheme}"]`;
|
|
10
10
|
const whenDark = scheme("dark");
|
|
11
11
|
const generateCompoundColors = (rootSelector, name, colors, depth) => {
|
|
@@ -55,19 +55,24 @@ function LikeC4Styles({ rootSelector }) {
|
|
|
55
55
|
return /* @__PURE__ */ jsx(MemoizedStyle, {
|
|
56
56
|
id: $styles.fingerprint,
|
|
57
57
|
nonce,
|
|
58
|
-
colorsStyles
|
|
58
|
+
colorsStyles,
|
|
59
|
+
customCss: $styles.customCssContent
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
62
|
/**
|
|
62
63
|
* @internal Memoized styles gives a performance boost during development
|
|
63
64
|
*/
|
|
64
|
-
const MemoizedStyle = memo(({ id, nonce, colorsStyles }) => /* @__PURE__ */ jsx("style", {
|
|
65
|
+
const MemoizedStyle = memo(({ id, nonce, colorsStyles, customCss }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("style", {
|
|
65
66
|
type: "text/css",
|
|
66
67
|
"data-likec4-colors": id,
|
|
67
68
|
nonce: nonce || void 0,
|
|
68
69
|
children: colorsStyles
|
|
69
|
-
})
|
|
70
|
+
}), customCss && /* @__PURE__ */ jsx("style", {
|
|
71
|
+
type: "text/css",
|
|
72
|
+
"data-likec4-custom-css": id,
|
|
73
|
+
nonce: nonce || void 0,
|
|
74
|
+
children: customCss
|
|
75
|
+
})] }));
|
|
70
76
|
MemoizedStyle.displayName = "MemoizedStyle";
|
|
71
77
|
|
|
72
|
-
//#endregion
|
|
73
78
|
export { LikeC4Styles };
|
package/dist/LikeC4View.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { Customizable } from "./customization/customization-types.mjs";
|
|
2
3
|
import { ElementIconRenderer, NodeRenderers, OverrideReactFlowProps, PaddingWithUnit, ViewPadding } from "./LikeC4Diagram.props.mjs";
|
|
3
4
|
import { CSSProperties, ReactNode } from "react";
|
|
4
|
-
import { JSX as JSX$1 } from "react/jsx-runtime";
|
|
5
5
|
import * as t from "@likec4/core/types";
|
|
6
|
-
|
|
7
|
-
export interface LikeC4ViewProps<A extends t.aux.Any = t.aux.UnknownLayouted> {
|
|
6
|
+
export interface LikeC4ViewProps<A extends t.Any = t.Any> {
|
|
8
7
|
/**
|
|
9
8
|
* View to display.
|
|
10
9
|
*/
|
|
@@ -283,5 +282,4 @@ export interface LikeC4BrowserProps {
|
|
|
283
282
|
*
|
|
284
283
|
* Component is wrapped in ShadowRoot to isolate styles.
|
|
285
284
|
*/
|
|
286
|
-
export declare
|
|
287
|
-
//#endregion
|
|
285
|
+
export declare const LikeC4View: Customizable<(<A extends t.Any = t.Any>(properties: LikeC4ViewProps<A>) => import("react").JSX.Element), "LikeC4View">;
|
package/dist/LikeC4View.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import IconX from "./node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.
|
|
2
|
+
import IconX from "./node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs";
|
|
3
3
|
import { FitViewPaddings } from "./base/const.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { ErrorMessage } from "./components/ViewNotFound.mjs";
|
|
5
|
+
import { customizable } from "./customization/customizable.mjs";
|
|
5
6
|
import { useOptionalLikeC4Model } from "./context/LikeC4ModelContext.mjs";
|
|
6
|
-
import { pickViewBounds } from "./utils/view-bounds.mjs";
|
|
7
|
-
import { Overlay } from "./overlays/overlay/Overlay.mjs";
|
|
8
7
|
import { LikeC4Diagram } from "./LikeC4Diagram.mjs";
|
|
9
|
-
import {
|
|
8
|
+
import { Overlay } from "./overlays/overlay/Overlay.mjs";
|
|
10
9
|
import { ShadowRoot } from "./shadowroot/ShadowRoot.mjs";
|
|
10
|
+
import { stopPropagation } from "./utils/xyflow.mjs";
|
|
11
|
+
import { pickViewBounds } from "./utils/view-bounds.mjs";
|
|
11
12
|
import { css, cx } from "@likec4/styles/css";
|
|
12
13
|
import { useState } from "react";
|
|
13
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -15,7 +16,7 @@ import { isBoolean } from "remeda";
|
|
|
15
16
|
import { ActionIcon } from "@mantine/core";
|
|
16
17
|
import { Box as Box$1 } from "@likec4/styles/jsx";
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
// src/LikeC4View.tsx
|
|
19
20
|
const cssInteractive = css({
|
|
20
21
|
cursor: "pointer",
|
|
21
22
|
["--mantine-cursor-pointer"]: "pointer",
|
|
@@ -29,7 +30,8 @@ const cssInteractive = css({
|
|
|
29
30
|
*
|
|
30
31
|
* Component is wrapped in ShadowRoot to isolate styles.
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
|
+
const LikeC4View = customizable("LikeC4View")((properties) => {
|
|
34
|
+
let { viewId, className, pannable = false, zoomable = false, keepAspectRatio = true, colorScheme, injectFontCss = true, controls = false, layoutType: initialLayoutType = "manual", background = "transparent", browser = true, showNavigationButtons = false, enableNotations, enableFocusMode = false, enableDynamicViewWalkthrough = false, enableElementDetails = false, enableRelationshipDetails = false, enableRelationshipBrowser = enableRelationshipDetails, enableNotes = false, reduceGraphics = "auto", mantineTheme, styleNonce, style, reactFlowProps, renderNodes, children, ...props } = properties;
|
|
33
35
|
const likec4model = useOptionalLikeC4Model();
|
|
34
36
|
const [layoutType, setLayoutType] = useState(initialLayoutType);
|
|
35
37
|
const [browserViewId, _onNavigateTo] = useState(null);
|
|
@@ -60,9 +62,9 @@ function LikeC4View({ viewId, className, pannable = false, zoomable = false, kee
|
|
|
60
62
|
/* @__PURE__ */ jsx("br", {}),
|
|
61
63
|
"Make sure you have LikeC4ModelProvider with layouted model."
|
|
62
64
|
] });
|
|
63
|
-
const view = initialLayoutType
|
|
65
|
+
const view = initialLayoutType !== "auto" ? viewModel.$layouted : viewModel.$view;
|
|
64
66
|
const browserViewModel = browserViewId ? likec4model.findView(browserViewId) : null;
|
|
65
|
-
const browserView = layoutType
|
|
67
|
+
const browserView = layoutType !== "auto" ? browserViewModel?.$layouted : browserViewModel?.$view;
|
|
66
68
|
const hasNotations = !!enableNotations && (view.notation?.nodes?.length ?? 0) > 0;
|
|
67
69
|
const browserViewHasNotations = (browserView?.notation?.nodes?.length ?? 0) > 0;
|
|
68
70
|
const isBrowserEnabled = browser !== false;
|
|
@@ -147,7 +149,6 @@ function LikeC4View({ viewId, className, pannable = false, zoomable = false, kee
|
|
|
147
149
|
})]
|
|
148
150
|
})]
|
|
149
151
|
});
|
|
150
|
-
}
|
|
152
|
+
});
|
|
151
153
|
|
|
152
|
-
//#endregion
|
|
153
154
|
export { LikeC4View };
|
package/dist/ReactLikeC4.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { __name } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { Customizable } from "./customization/customization-types.mjs";
|
|
2
3
|
import { LikeC4DiagramEventHandlers, LikeC4DiagramProperties } from "./LikeC4Diagram.props.mjs";
|
|
3
4
|
import { CSSProperties, ReactNode } from "react";
|
|
4
|
-
import { JSX as JSX$1 } from "react/jsx-runtime";
|
|
5
5
|
import * as t from "@likec4/core/types";
|
|
6
|
-
|
|
7
|
-
export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = {
|
|
6
|
+
export type ReactLikeC4Props<A extends t.Any = t.Any> = {
|
|
8
7
|
viewId: t.aux.ViewId<A>;
|
|
9
8
|
/**
|
|
10
9
|
* Layout to display
|
|
@@ -46,5 +45,4 @@ export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = {
|
|
|
46
45
|
*
|
|
47
46
|
* Component is wrapped in ShadowRoot to isolate styles.
|
|
48
47
|
*/
|
|
49
|
-
export declare
|
|
50
|
-
//#endregion
|
|
48
|
+
export declare const ReactLikeC4: Customizable<(<A extends t.Any = t.Any>(properties: ReactLikeC4Props<A>) => import("react").JSX.Element), "ReactLikeC4">;
|