@likec4/diagram 1.47.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/LICENSE +1 -1
- package/README.md +8 -10
- package/adhoc-editor/package.json +4 -0
- package/dist/LikeC4Diagram.d.ts +2 -1
- package/dist/LikeC4Diagram.js +85 -81
- package/dist/LikeC4Diagram.props.d.ts +10 -6
- 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 +10 -8
- package/dist/LikeC4Styles.d.ts +3 -6
- package/dist/LikeC4Styles.js +44 -43
- package/dist/LikeC4View.d.ts +22 -1
- package/dist/LikeC4View.js +40 -25
- package/dist/ReactLikeC4.d.ts +13 -2
- package/dist/ReactLikeC4.js +8 -4
- 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 +4 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +74 -0
- 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 +14 -0
- package/dist/adhoc-editor/hooks.js +29 -0
- package/dist/adhoc-editor/index.d.ts +2 -0
- package/dist/adhoc-editor/index.js +1 -0
- package/dist/adhoc-editor/state/ActorProvider.d.ts +5 -0
- package/dist/adhoc-editor/state/ActorProvider.js +40 -0
- package/dist/adhoc-editor/state/actor.d.ts +13 -0
- package/dist/adhoc-editor/state/actor.editor.d.ts +56 -0
- package/dist/adhoc-editor/state/actor.editor.js +205 -0
- package/dist/adhoc-editor/state/actor.js +16 -0
- package/dist/adhoc-editor/state/actor.layouter.d.ts +51 -0
- package/dist/adhoc-editor/state/actor.layouter.js +70 -0
- package/dist/adhoc-editor/state/actor.types.d.ts +63 -0
- package/dist/adhoc-editor/state/actor.types.js +29 -0
- 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 +6 -0
- package/dist/base/const.d.ts +2 -0
- package/dist/base/const.js +2 -1
- package/dist/base/updateEdges.js +26 -3
- package/dist/base/updateNodes.js +8 -5
- package/dist/base-primitives/Markdown.d.ts +1 -1
- package/dist/base-primitives/Markdown.js +1 -1
- package/dist/base-primitives/NodeHandles.d.ts +4 -2
- package/dist/base-primitives/NodeHandles.js +46 -19
- package/dist/base-primitives/compound/CompoundActionButton.js +28 -12
- package/dist/base-primitives/compound/CompoundDetailsButton.js +24 -9
- package/dist/base-primitives/compound/CompoundNodeContainer.js +11 -8
- package/dist/base-primitives/compound/CompoundTitle.js +1 -2
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +5 -2
- 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 +17 -20
- package/dist/base-primitives/element/ElementActionButtons.js +57 -59
- package/dist/base-primitives/element/ElementData.d.ts +7 -7
- package/dist/base-primitives/element/ElementData.js +61 -48
- package/dist/base-primitives/element/ElementDetailsButton.js +48 -18
- package/dist/base-primitives/element/ElementNodeContainer.d.ts +5 -5
- package/dist/base-primitives/element/ElementNodeContainer.js +24 -10
- package/dist/base-primitives/element/ElementShape.d.ts +2 -2
- package/dist/base-primitives/element/ElementShape.js +70 -7
- package/dist/base-primitives/element/ElementTags.d.ts +6 -2
- package/dist/base-primitives/element/ElementTags.js +55 -32
- package/dist/base-primitives/index.d.ts +1 -1
- package/dist/base-primitives/memoEdge.js +1 -1
- package/dist/base-primitives/memoNode.js +1 -1
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +3 -3
- package/dist/components/NavigationPanel.d.ts +2 -2
- package/dist/components/NavigationPanel.js +5 -26
- package/dist/components/PortalToContainer.js +3 -4
- package/dist/components/RootContainer.js +9 -19
- 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 +2 -0
- package/dist/context/DefaultMantineProvider.js +75 -0
- 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 +16 -13
- package/dist/context/EnsureMantine.d.ts +0 -3
- package/dist/context/EnsureMantine.js +3 -4
- package/dist/context/FramerMotionConfig.d.ts +1 -3
- package/dist/context/IconRenderer.d.ts +19 -4
- package/dist/context/IconRenderer.js +52 -25
- 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 +13 -5
- package/dist/custom/hooks.d.ts +2 -2
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +16 -15
- package/dist/editor/LikeC4EditorCallbacks.d.ts +18 -0
- package/dist/editor/LikeC4EditorCallbacks.js +5 -0
- package/dist/editor/LikeC4EditorProvider.d.ts +30 -18
- package/dist/editor/LikeC4EditorProvider.js +3 -3
- package/dist/editor/applyChangesToManualLayout.js +7 -6
- package/dist/editor/editorActor.actions.d.ts +25 -25
- package/dist/editor/editorActor.actions.js +22 -22
- package/dist/editor/editorActor.setup.d.ts +84 -0
- package/dist/editor/editorActor.setup.js +38 -0
- package/dist/editor/editorActor.states.d.ts +9 -0
- package/dist/editor/{editorActor.js → editorActor.states.js} +21 -72
- package/dist/editor/index.d.ts +4 -3
- package/dist/editor/useEditorActorLogic.d.ts +2 -565
- package/dist/editor/useEditorActorLogic.js +14 -21
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/safeContext.d.ts +4 -5
- package/dist/hooks/useCallbackRef.d.ts +6 -0
- package/dist/hooks/useCallbackRef.js +7 -6
- package/dist/hooks/useCurrentView.js +5 -10
- package/dist/hooks/useCurrentViewModel.d.ts +8 -2
- package/dist/hooks/useCurrentViewModel.js +3 -7
- package/dist/hooks/useDiagram.d.ts +9 -1
- package/dist/hooks/useDiagram.js +10 -4
- package/dist/hooks/useDiagramCompareLayout.d.ts +6 -6
- package/dist/hooks/useDiagramCompareLayout.js +1 -1
- package/dist/hooks/useLikeC4ElementsTree.d.ts +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +2 -2
- 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/hooks/useSetState.d.ts +6 -1
- package/dist/hooks/useSetState.js +7 -4
- package/dist/hooks/useXYFlow.d.ts +7 -1
- package/dist/hooks/useXYFlow.js +4 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +3 -1
- package/dist/likec4diagram/DiagramUI.js +1 -3
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -1
- package/dist/likec4diagram/DiagramXYFlow.js +29 -18
- package/dist/likec4diagram/convert-to-xyflow.d.ts +2 -1
- package/dist/likec4diagram/convert-to-xyflow.js +2 -6
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +34 -37
- package/dist/likec4diagram/custom/edges/edges.css.js +2 -1
- package/dist/likec4diagram/custom/edges/useControlPoints.js +3 -3
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +3 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +52 -34
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +7 -10
- 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 +10 -6
- package/dist/likec4diagram/custom/nodes/nodes.js +30 -8
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +5 -4
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +6 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +14 -9
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +4 -4
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +3 -3
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +16 -36
- package/dist/likec4diagram/relationship-popover/components.d.ts +7 -0
- package/dist/likec4diagram/relationship-popover/components.js +39 -0
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
- package/dist/likec4diagram/state/DiagramActorProvider.js +39 -66
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/createViewChange.js +16 -4
- 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 +92 -0
- package/dist/likec4diagram/state/machine.actions.js +127 -58
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +23 -2
- package/dist/likec4diagram/state/machine.actions.layout.js +68 -15
- package/dist/likec4diagram/state/machine.d.ts +1 -1
- package/dist/likec4diagram/state/machine.js +35 -31
- package/dist/likec4diagram/state/machine.setup.d.ts +40 -7
- package/dist/likec4diagram/state/machine.setup.js +13 -4
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +32 -2
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +1 -1
- package/dist/likec4diagram/state/machine.state.navigating.js +82 -50
- package/dist/likec4diagram/state/machine.state.ready.d.ts +565 -579
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +17 -148
- package/dist/likec4diagram/state/machine.state.ready.focused.js +6 -14
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +11 -96
- package/dist/likec4diagram/state/machine.state.ready.idle.js +7 -12
- package/dist/likec4diagram/state/machine.state.ready.js +89 -70
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +4 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +4 -3
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +145 -2
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +29 -21
- package/dist/likec4diagram/state/types.d.ts +1 -1
- package/dist/likec4diagram/state/utils.d.ts +14 -14
- package/dist/likec4diagram/state/utils.js +12 -4
- package/dist/likec4diagram/types.d.ts +11 -3
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +2 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.d.ts +12 -12
- package/dist/likec4diagram/useLayoutConstraints.js +126 -84
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +11 -3
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +7 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.d.ts +7 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +15 -8
- package/dist/navigationpanel/NavigationPanel.js +4 -3
- package/dist/navigationpanel/NavigationPanelControls.js +4 -2
- package/dist/navigationpanel/NavigationPanelDropdown.js +13 -13
- package/dist/navigationpanel/_common.d.ts +1 -1
- package/dist/navigationpanel/_common.js +2 -3
- 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/comparepanel/LayoutTypeSwitcher.js +4 -5
- package/dist/navigationpanel/controls/DetailsControls.js +7 -7
- package/dist/navigationpanel/controls/LayoutWarning.js +2 -2
- 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.d.ts +1 -2
- package/dist/navigationpanel/controls/SearchControl.js +8 -12
- package/dist/navigationpanel/controls/ToggleReadonly.js +5 -6
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +12 -6
- 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/editorpanel/styles.js +4 -4
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/styles.css.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +6 -6
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +77 -77
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @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.3 → @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.3 → @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 +15 -15
- package/dist/overlays/element-details/ElementDetailsCard.js +39 -40
- package/dist/overlays/element-details/MetadataValue.js +11 -12
- package/dist/overlays/element-details/TabPanelDeployments.js +8 -6
- package/dist/overlays/element-details/TabPanelRelationships.css.js +10 -30
- 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 +3 -2
- package/dist/overlays/overlaysActor.js +19 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +0 -5
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -4
- package/dist/overlays/relationship-details/SelectEdge.css.js +6 -6
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/compute.js +1 -1
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationship-details/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +0 -5
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +116 -21
- 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 +21 -6
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationships-browser/layout.d.ts +1 -1
- package/dist/overlays/relationships-browser/layout.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/actor.js +8 -31
- 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/projects-overview/panel/ProjectsOverviewPanel.js +1 -1
- package/dist/search/Search.d.ts +2 -4
- package/dist/search/Search.js +67 -44
- package/dist/search/components/ElementsColumn.css.js +6 -6
- package/dist/search/components/ElementsColumn.js +93 -60
- package/dist/search/components/PickView.d.ts +3 -1
- package/dist/search/components/PickView.js +12 -7
- 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.d.ts +1 -1
- package/dist/search/components/_shared.css.js +12 -12
- package/dist/search/components/utils.js +1 -4
- package/dist/search/hooks.d.ts +1 -6
- package/dist/search/hooks.js +15 -9
- 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 +25 -22
- package/dist/shadowroot/styles.css.d.ts +0 -2
- package/dist/shadowroot/styles.css.js +4 -36
- package/dist/styles-font.css2.js +1 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/view-bounds.d.ts +3 -2
- package/dist/utils/view-bounds.js +10 -6
- package/dist/utils/xyflow.d.ts +27 -6
- package/dist/utils/xyflow.js +68 -23
- package/package.json +39 -37
- package/panda.buildinfo.json +226 -161
- package/styles-font.css +1 -1
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/bundle/index.js +0 -51974
- package/bundle/package.json +0 -4
- package/dist/editor/__tests__/fixture.d.ts +0 -205
- package/dist/editor/editorActor.d.ts +0 -653
- package/dist/likec4diagram/relationship-popover/styles.css.d.ts +0 -2
- package/dist/likec4diagram/relationship-popover/styles.css.js +0 -28
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/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.3/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.3/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.3/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
- package/dist/overlays/relationships-browser/custom/styles.css.d.ts +0 -1
- package/dist/overlays/relationships-browser/custom/styles.css.js +0 -14
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",
|
|
@@ -32,6 +33,7 @@ function LikeC4View({
|
|
|
32
33
|
colorScheme,
|
|
33
34
|
injectFontCss = true,
|
|
34
35
|
controls = false,
|
|
36
|
+
layoutType: initialLayoutType = "manual",
|
|
35
37
|
background = "transparent",
|
|
36
38
|
browser = true,
|
|
37
39
|
showNavigationButtons = false,
|
|
@@ -41,6 +43,7 @@ function LikeC4View({
|
|
|
41
43
|
enableElementDetails = false,
|
|
42
44
|
enableRelationshipDetails = false,
|
|
43
45
|
enableRelationshipBrowser = enableRelationshipDetails,
|
|
46
|
+
enableNotes = false,
|
|
44
47
|
reduceGraphics = "auto",
|
|
45
48
|
mantineTheme,
|
|
46
49
|
styleNonce,
|
|
@@ -52,31 +55,44 @@ function LikeC4View({
|
|
|
52
55
|
}) {
|
|
53
56
|
const rootRef = useRef(null);
|
|
54
57
|
const likec4model = useOptionalLikeC4Model();
|
|
55
|
-
const [layoutType, setLayoutType] = useState(
|
|
58
|
+
const [layoutType, setLayoutType] = useState(initialLayoutType);
|
|
56
59
|
const [browserViewId, _onNavigateTo] = useState(null);
|
|
57
60
|
const onNavigateTo = useCallbackRef((viewId2) => {
|
|
58
61
|
if (viewId2 && viewId2 !== browserViewId) {
|
|
59
|
-
setLayoutType(
|
|
62
|
+
setLayoutType(initialLayoutType);
|
|
60
63
|
}
|
|
61
64
|
_onNavigateTo(viewId2);
|
|
62
65
|
});
|
|
63
66
|
const onNavigateToThisView = useCallbackRef(() => {
|
|
64
67
|
onNavigateTo(viewId);
|
|
65
68
|
});
|
|
69
|
+
const closeBrowser = useCallbackRef(() => {
|
|
70
|
+
onNavigateTo(null);
|
|
71
|
+
});
|
|
66
72
|
if (!likec4model) {
|
|
67
|
-
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." });
|
|
68
74
|
}
|
|
69
|
-
const
|
|
70
|
-
if (!
|
|
71
|
-
return /* @__PURE__ */
|
|
75
|
+
const viewModel = likec4model.findView(viewId);
|
|
76
|
+
if (!viewModel) {
|
|
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
|
+
] });
|
|
72
85
|
}
|
|
73
|
-
if (
|
|
86
|
+
if (!viewModel.isLayouted()) {
|
|
74
87
|
return /* @__PURE__ */ jsxs(ErrorMessage, { children: [
|
|
75
|
-
|
|
76
|
-
viewId,
|
|
77
|
-
|
|
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."
|
|
78
93
|
] });
|
|
79
94
|
}
|
|
95
|
+
const view = initialLayoutType === "manual" ? viewModel.$layouted : viewModel.$view;
|
|
80
96
|
const browserViewModel = browserViewId ? likec4model.findView(browserViewId) : null;
|
|
81
97
|
const browserView = layoutType === "manual" ? browserViewModel?.$layouted : browserViewModel?.$view;
|
|
82
98
|
const hasNotations = !!enableNotations && (view.notation?.nodes?.length ?? 0) > 0;
|
|
@@ -85,7 +101,7 @@ function LikeC4View({
|
|
|
85
101
|
const browserProps = isBoolean(browser) ? {} : browser;
|
|
86
102
|
const bounds = pickViewBounds(view, props.dynamicViewVariant);
|
|
87
103
|
const root = rootRef.current ? { root: rootRef.current } : void 0;
|
|
88
|
-
return /* @__PURE__ */
|
|
104
|
+
return /* @__PURE__ */ jsxs(
|
|
89
105
|
ShadowRoot,
|
|
90
106
|
{
|
|
91
107
|
ref: rootRef,
|
|
@@ -99,7 +115,7 @@ function LikeC4View({
|
|
|
99
115
|
className
|
|
100
116
|
),
|
|
101
117
|
style,
|
|
102
|
-
children:
|
|
118
|
+
children: [
|
|
103
119
|
/* @__PURE__ */ jsx(
|
|
104
120
|
LikeC4Diagram,
|
|
105
121
|
{
|
|
@@ -118,6 +134,7 @@ function LikeC4View({
|
|
|
118
134
|
enableElementDetails,
|
|
119
135
|
enableRelationshipBrowser,
|
|
120
136
|
enableElementTags: false,
|
|
137
|
+
enableNotes,
|
|
121
138
|
controls,
|
|
122
139
|
reduceGraphics,
|
|
123
140
|
className: cx(
|
|
@@ -131,11 +148,11 @@ function LikeC4View({
|
|
|
131
148
|
},
|
|
132
149
|
reactFlowProps,
|
|
133
150
|
renderNodes,
|
|
134
|
-
|
|
135
|
-
|
|
151
|
+
...props,
|
|
152
|
+
children
|
|
136
153
|
}
|
|
137
154
|
),
|
|
138
|
-
/* @__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: [
|
|
139
156
|
/* @__PURE__ */ jsx(
|
|
140
157
|
LikeC4Diagram,
|
|
141
158
|
{
|
|
@@ -152,6 +169,7 @@ function LikeC4View({
|
|
|
152
169
|
enableRelationshipDetails: true,
|
|
153
170
|
enableSearch: true,
|
|
154
171
|
enableElementTags: true,
|
|
172
|
+
enableNotes: true,
|
|
155
173
|
enableCompareWithLatest: true,
|
|
156
174
|
controls: true,
|
|
157
175
|
fitView: true,
|
|
@@ -163,20 +181,17 @@ function LikeC4View({
|
|
|
163
181
|
onLayoutTypeChange: setLayoutType
|
|
164
182
|
}
|
|
165
183
|
),
|
|
166
|
-
/* @__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(
|
|
167
185
|
ActionIcon,
|
|
168
186
|
{
|
|
169
187
|
variant: "default",
|
|
170
188
|
color: "gray",
|
|
171
|
-
onClick:
|
|
172
|
-
e.stopPropagation();
|
|
173
|
-
onNavigateTo(null);
|
|
174
|
-
},
|
|
189
|
+
onClick: closeBrowser,
|
|
175
190
|
children: /* @__PURE__ */ jsx(IconX, {})
|
|
176
191
|
}
|
|
177
192
|
) })
|
|
178
193
|
] }) })
|
|
179
|
-
]
|
|
194
|
+
]
|
|
180
195
|
}
|
|
181
196
|
);
|
|
182
197
|
}
|
package/dist/ReactLikeC4.d.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
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> = {
|
|
5
6
|
viewId: t.aux.ViewId<A>;
|
|
7
|
+
/**
|
|
8
|
+
* Layout to display
|
|
9
|
+
* - `auto`: auto-layouted from the current sources
|
|
10
|
+
* - `manual`: manually layouted (if available, falls back to `auto`)
|
|
11
|
+
*
|
|
12
|
+
* Uncontrolled initial value, use `onLayoutTypeChange` to control it.
|
|
13
|
+
*
|
|
14
|
+
* @default 'manual'
|
|
15
|
+
*/
|
|
16
|
+
layoutType?: t.LayoutType | undefined;
|
|
6
17
|
/**
|
|
7
18
|
* Keep aspect ratio of the diagram
|
|
8
19
|
*
|
|
@@ -14,7 +25,7 @@ export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = {
|
|
|
14
25
|
*/
|
|
15
26
|
colorScheme?: 'light' | 'dark' | undefined;
|
|
16
27
|
/**
|
|
17
|
-
* LikeC4 views are using 'IBM Plex Sans' font.
|
|
28
|
+
* LikeC4 views are using 'IBM Plex Sans Variable' font.
|
|
18
29
|
* By default, component injects the CSS to document head.
|
|
19
30
|
* Set to false if you want to handle the font yourself.
|
|
20
31
|
*
|
|
@@ -33,4 +44,4 @@ export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = {
|
|
|
33
44
|
*
|
|
34
45
|
* Component is wrapped in ShadowRoot to isolate styles.
|
|
35
46
|
*/
|
|
36
|
-
export declare function ReactLikeC4<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, 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,13 +1,16 @@
|
|
|
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';
|
|
8
10
|
|
|
9
11
|
function ReactLikeC4({
|
|
10
12
|
viewId,
|
|
13
|
+
layoutType: initialLayoutType = "manual",
|
|
11
14
|
className,
|
|
12
15
|
colorScheme,
|
|
13
16
|
injectFontCss = true,
|
|
@@ -22,17 +25,18 @@ function ReactLikeC4({
|
|
|
22
25
|
if (!likec4model) {
|
|
23
26
|
return /* @__PURE__ */ jsx(ErrorMessage, { children: "LikeC4Model not found. Make sure you provided LikeC4ModelProvider." });
|
|
24
27
|
}
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
28
|
+
const viewModel = likec4model.findView(viewId);
|
|
29
|
+
if (!viewModel) {
|
|
27
30
|
return /* @__PURE__ */ jsx(ViewNotFound, { viewId });
|
|
28
31
|
}
|
|
29
|
-
if (
|
|
32
|
+
if (!viewModel.isLayouted()) {
|
|
30
33
|
return /* @__PURE__ */ jsxs(ErrorMessage, { children: [
|
|
31
34
|
'LikeC4 View "$',
|
|
32
35
|
viewId,
|
|
33
36
|
'" is not layouted. Make sure you have LikeC4ModelProvider with layouted model.'
|
|
34
37
|
] });
|
|
35
38
|
}
|
|
39
|
+
const view = initialLayoutType === "manual" ? viewModel.$layouted : viewModel.$view;
|
|
36
40
|
const bounds = pickViewBounds(view, props.dynamicViewVariant);
|
|
37
41
|
const hasNotations = !!enableNotations && (view.notation?.nodes?.length ?? 0) > 0;
|
|
38
42
|
return /* @__PURE__ */ jsx(
|
|
@@ -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;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { VStack, HStack, Txt, Box } from '@likec4/styles/jsx';
|
|
3
|
+
import { ActionIcon, Input, CloseButton } from '@mantine/core';
|
|
4
|
+
import { AnimatePresence } from 'motion/react';
|
|
5
|
+
import { Suspense } from 'react';
|
|
6
|
+
import { prop } from 'remeda';
|
|
7
|
+
import { Logo } from '../components/Logo.js';
|
|
8
|
+
import { ElementsTree } from './ElementsTree.js';
|
|
9
|
+
import { EditorPanelStoreProvider, useEditorPanelState, useEditorPanelTrigger, selectEditorPanelState } from './state/panel.js';
|
|
10
|
+
import IconTrash from '../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js';
|
|
11
|
+
|
|
12
|
+
const EditorPanel = () => {
|
|
13
|
+
return /* @__PURE__ */ jsx(EditorPanelStoreProvider, { children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ jsxs(
|
|
14
|
+
VStack,
|
|
15
|
+
{
|
|
16
|
+
css: {
|
|
17
|
+
position: "fixed",
|
|
18
|
+
top: "0",
|
|
19
|
+
left: "0",
|
|
20
|
+
gap: "1",
|
|
21
|
+
bottom: "0",
|
|
22
|
+
height: "auto",
|
|
23
|
+
overflow: "hidden",
|
|
24
|
+
layerStyle: "likec4.panel",
|
|
25
|
+
width: "[300px]",
|
|
26
|
+
rounded: "0"
|
|
27
|
+
},
|
|
28
|
+
onClick: (e) => {
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
const input = document.getElementById("search-input");
|
|
31
|
+
if (input) {
|
|
32
|
+
input.focus();
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsxs(HStack, { p: "2", gap: "4", justifyItems: "stretch", children: [
|
|
37
|
+
/* @__PURE__ */ jsx(Logo, { style: { height: 16 } }),
|
|
38
|
+
/* @__PURE__ */ jsx(Txt, { size: "sm", fontWeight: "medium", flex: "1", children: "Explore" }),
|
|
39
|
+
/* @__PURE__ */ jsx(HStack, { gap: "1", children: /* @__PURE__ */ jsx(ActionIcon, { children: /* @__PURE__ */ jsx(IconTrash, {}) }) })
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(SearchInput, {}) }),
|
|
42
|
+
/* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(ElementsTree, {}) })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
) }) });
|
|
46
|
+
};
|
|
47
|
+
const selectInput = selectEditorPanelState(prop("searchInput"));
|
|
48
|
+
function SearchInput() {
|
|
49
|
+
const input = useEditorPanelState(selectInput);
|
|
50
|
+
const trigger = useEditorPanelTrigger();
|
|
51
|
+
const onChange = useEditorPanelTrigger((trigger2, event) => {
|
|
52
|
+
trigger2.inputChange({ value: event.currentTarget.value });
|
|
53
|
+
});
|
|
54
|
+
const clear = useEditorPanelTrigger((trigger2) => {
|
|
55
|
+
trigger2.inputChange({ value: "" });
|
|
56
|
+
});
|
|
57
|
+
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
58
|
+
Input,
|
|
59
|
+
{
|
|
60
|
+
id: "search-input",
|
|
61
|
+
size: "xs",
|
|
62
|
+
variant: "filled",
|
|
63
|
+
placeholder: "Search by title, description or start with # or kind:",
|
|
64
|
+
value: input,
|
|
65
|
+
onChange,
|
|
66
|
+
"data-likec4-search-input": true,
|
|
67
|
+
rightSectionPointerEvents: "all",
|
|
68
|
+
rightSection: /* @__PURE__ */ jsx(
|
|
69
|
+
CloseButton,
|
|
70
|
+
{
|
|
71
|
+
size: "sm",
|
|
72
|
+
"aria-label": "Clear input",
|
|
73
|
+
onClick: clear,
|
|
74
|
+
style: { display: input ? void 0 : "none" }
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
onKeyDownCapture: (e) => {
|
|
78
|
+
switch (e.key) {
|
|
79
|
+
case "Escape": {
|
|
80
|
+
e.stopPropagation();
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
clear();
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
case "Enter": {
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
case "ArrowDown": {
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
trigger.inputKeyDown();
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
default: {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
) });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { EditorPanel };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { invariant } from '@likec4/core/utils';
|
|
3
|
+
import { Box } from '@likec4/styles/jsx';
|
|
4
|
+
import { ScrollArea } from '@mantine/core';
|
|
5
|
+
import { mergeProps } from '@zag-js/react';
|
|
6
|
+
import { memo } from 'react';
|
|
7
|
+
import { Tree } from './components/Tree.js';
|
|
8
|
+
import { useEditorPanelTrigger } from './state/panel.js';
|
|
9
|
+
import { useElementsTree } from './useElementsTree.js';
|
|
10
|
+
|
|
11
|
+
const ElementsTree = memo(() => {
|
|
12
|
+
const api = useElementsTree();
|
|
13
|
+
const onClick = useEditorPanelTrigger((trigger, event) => {
|
|
14
|
+
const id = event.currentTarget.closest("[data-value]")?.getAttribute("data-value");
|
|
15
|
+
if (!id) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
event.stopPropagation();
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
api.expand([id]);
|
|
22
|
+
trigger.elementClick({ id });
|
|
23
|
+
} catch (err) {
|
|
24
|
+
console.error("Failed to handle element click", err);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const rootProps = mergeProps(api.getRootProps(), {
|
|
28
|
+
onKeyDown: (e) => {
|
|
29
|
+
switch (e.key) {
|
|
30
|
+
case "Escape": {
|
|
31
|
+
const input = document.getElementById("search-input");
|
|
32
|
+
if (input) {
|
|
33
|
+
e.stopPropagation();
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
input.focus();
|
|
36
|
+
}
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
case "ArrowUp": {
|
|
40
|
+
console.log("ArrowUp", {
|
|
41
|
+
selected: api.selectedValue
|
|
42
|
+
});
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
default: {
|
|
46
|
+
console.log(e.key);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// onClick: useCallbackRef((e: MouseEvent) => {
|
|
52
|
+
// const lastnd = last(api.getVisibleNodes())
|
|
53
|
+
// if (lastnd) {
|
|
54
|
+
// e.stopPropagation()
|
|
55
|
+
// api.focus(lastnd.node.id)
|
|
56
|
+
// }
|
|
57
|
+
// }),
|
|
58
|
+
});
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
ScrollArea,
|
|
61
|
+
{
|
|
62
|
+
flex: "1 1 100%",
|
|
63
|
+
scrollbars: "y",
|
|
64
|
+
type: "scroll",
|
|
65
|
+
scrollbarSize: "4px",
|
|
66
|
+
// className="arsars"
|
|
67
|
+
// styles={{
|
|
68
|
+
// content: {
|
|
69
|
+
// height: '100%',
|
|
70
|
+
// },
|
|
71
|
+
// }}
|
|
72
|
+
// viewportProps={{
|
|
73
|
+
// onClick: (e) => {
|
|
74
|
+
// const lastnd = api.getVisibleNodes().at(-1)?.node
|
|
75
|
+
// if (lastnd) {
|
|
76
|
+
// e.preventDefault()
|
|
77
|
+
// e.stopPropagation()
|
|
78
|
+
// setTimeout(() => {
|
|
79
|
+
// api.focus(lastnd.id)
|
|
80
|
+
// }, 50)
|
|
81
|
+
// }
|
|
82
|
+
// },
|
|
83
|
+
// }}
|
|
84
|
+
...rootProps,
|
|
85
|
+
children: /* @__PURE__ */ jsxs(Tree.Root, { ...api.getTreeProps(), children: [
|
|
86
|
+
api.collection.rootNode.children.map((node, index) => /* @__PURE__ */ jsx(
|
|
87
|
+
TreeNode,
|
|
88
|
+
{
|
|
89
|
+
node,
|
|
90
|
+
api,
|
|
91
|
+
onClick
|
|
92
|
+
},
|
|
93
|
+
node.id
|
|
94
|
+
)),
|
|
95
|
+
!api.collection.getFirstNode() && /* @__PURE__ */ jsx(
|
|
96
|
+
Box,
|
|
97
|
+
{
|
|
98
|
+
css: {
|
|
99
|
+
p: "4",
|
|
100
|
+
textAlign: "center"
|
|
101
|
+
},
|
|
102
|
+
children: "Nothing found"
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
] })
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
const TreeNode = ({ api, node, onClick }) => {
|
|
110
|
+
const indexPath = api.collection.getIndexPath(node.id);
|
|
111
|
+
invariant(indexPath, "Node not found in collection");
|
|
112
|
+
const nodeProps = { indexPath, node };
|
|
113
|
+
const state = api.getNodeState(nodeProps);
|
|
114
|
+
if (state.isBranch) {
|
|
115
|
+
return /* @__PURE__ */ jsxs(Tree.Branch, { ...api.getBranchProps(nodeProps), children: [
|
|
116
|
+
/* @__PURE__ */ jsxs(Tree.Control, { ...api.getBranchControlProps(nodeProps), children: [
|
|
117
|
+
/* @__PURE__ */ jsx(Tree.Icon, { element: node }),
|
|
118
|
+
/* @__PURE__ */ jsxs(Tree.Label, { ...api.getBranchTextProps(nodeProps), children: [
|
|
119
|
+
node.title,
|
|
120
|
+
/* @__PURE__ */ jsx(Tree.Indicator, { ...api.getBranchIndicatorProps(nodeProps) })
|
|
121
|
+
] }),
|
|
122
|
+
/* @__PURE__ */ jsx(Tree.State, { node, state: node.state, onClick })
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ jsx(Tree.Content, { ...api.getBranchContentProps(nodeProps), children: state.expanded && node.children.map((childNode, index) => /* @__PURE__ */ jsx(
|
|
125
|
+
TreeNode,
|
|
126
|
+
{
|
|
127
|
+
node: childNode,
|
|
128
|
+
api,
|
|
129
|
+
onClick
|
|
130
|
+
},
|
|
131
|
+
childNode.id
|
|
132
|
+
)) })
|
|
133
|
+
] });
|
|
134
|
+
}
|
|
135
|
+
return /* @__PURE__ */ jsxs(Tree.Item, { ...api.getItemProps(nodeProps), children: [
|
|
136
|
+
/* @__PURE__ */ jsx(Tree.Icon, { element: node }),
|
|
137
|
+
/* @__PURE__ */ jsx(Tree.Label, { ...api.getItemTextProps(nodeProps), children: node.title }),
|
|
138
|
+
/* @__PURE__ */ jsx(Tree.State, { node, state: node.state, onClick })
|
|
139
|
+
] });
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export { ElementsTree };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { ReactFlowProvider } from '@xyflow/react';
|
|
3
|
+
import { useRef, Profiler, memo, useEffect } from 'react';
|
|
4
|
+
import { mapValues } from 'remeda';
|
|
5
|
+
import { FitViewPaddings } from '../base/const.js';
|
|
6
|
+
import { RootContainer } from '../components/RootContainer.js';
|
|
7
|
+
import { DiagramFeatures, DefaultFeatures } from '../context/DiagramFeatures.js';
|
|
8
|
+
import { EnsureMantine } from '../context/EnsureMantine.js';
|
|
9
|
+
import { FramerMotionConfig } from '../context/FramerMotionConfig.js';
|
|
10
|
+
import { IconRendererProvider } from '../context/IconRenderer.js';
|
|
11
|
+
import { TagStylesProvider } from '../context/TagStylesContext.js';
|
|
12
|
+
import { useId } from '../hooks/useId.js';
|
|
13
|
+
import { LikeC4DiagramXYFlow } from '../likec4diagram/DiagramXYFlow.js';
|
|
14
|
+
import { DiagramActorProvider } from '../likec4diagram/state/DiagramActorProvider.js';
|
|
15
|
+
import { LikeC4Styles } from '../LikeC4Styles.js';
|
|
16
|
+
import { EditorPanel } from './EditorPanel.js';
|
|
17
|
+
import { useAdhocView, useAdhocEditorActor } from './hooks.js';
|
|
18
|
+
import { AdhocEditorActorProvider } from './state/ActorProvider.js';
|
|
19
|
+
import { useDiagram } from '../hooks/safeContext.js';
|
|
20
|
+
|
|
21
|
+
const noop = () => {
|
|
22
|
+
};
|
|
23
|
+
const defaultFeatures = {
|
|
24
|
+
...mapValues(DefaultFeatures, () => false),
|
|
25
|
+
enableFitView: true,
|
|
26
|
+
enableReadOnly: true
|
|
27
|
+
};
|
|
28
|
+
function LikeC4AdHocViewEditor({ service }) {
|
|
29
|
+
const id = useId();
|
|
30
|
+
const initialRef = useRef({
|
|
31
|
+
fitView: true,
|
|
32
|
+
defaultNodes: [],
|
|
33
|
+
defaultEdges: []
|
|
34
|
+
});
|
|
35
|
+
return /* @__PURE__ */ jsx(EnsureMantine, { children: /* @__PURE__ */ jsx(FramerMotionConfig, { children: /* @__PURE__ */ jsx(Profiler, { id: "LikeC4AdHocViewEditor", onRender: noop, children: /* @__PURE__ */ jsx(IconRendererProvider, { value: null, children: /* @__PURE__ */ jsx(AdhocEditorActorProvider, { service, children: /* @__PURE__ */ jsxs(DiagramFeatures, { features: defaultFeatures, children: [
|
|
36
|
+
/* @__PURE__ */ jsx(LikeC4Styles, { id }),
|
|
37
|
+
/* @__PURE__ */ jsx(TagStylesProvider, { rootSelector: `#${id}`, children: /* @__PURE__ */ jsx(RootContainer, { id, children: /* @__PURE__ */ jsxs(ReactFlowProvider, { ...initialRef.current, children: [
|
|
38
|
+
/* @__PURE__ */ jsx(LikeC4AdHocView, { id }),
|
|
39
|
+
/* @__PURE__ */ jsx(EditorPanel, {})
|
|
40
|
+
] }) }) })
|
|
41
|
+
] }) }) }) }) }) });
|
|
42
|
+
}
|
|
43
|
+
const LikeC4AdHocView = memo(({ id }) => {
|
|
44
|
+
const view = useAdhocView();
|
|
45
|
+
return /* @__PURE__ */ jsxs(
|
|
46
|
+
DiagramActorProvider,
|
|
47
|
+
{
|
|
48
|
+
id,
|
|
49
|
+
view,
|
|
50
|
+
zoomable: true,
|
|
51
|
+
pannable: true,
|
|
52
|
+
fitViewPadding: FitViewPaddings.withControls,
|
|
53
|
+
nodesDraggable: false,
|
|
54
|
+
nodesSelectable: true,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(LikeC4DiagramXYFlow, {}),
|
|
57
|
+
/* @__PURE__ */ jsx(LikeC4AdHocEditorEvents, {})
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
const LikeC4AdHocEditorEvents = memo(() => {
|
|
63
|
+
const actorRef = useAdhocEditorActor();
|
|
64
|
+
const diagram = useDiagram();
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const subscription = actorRef.on("click.element", ({ id }) => {
|
|
67
|
+
diagram.focusOnElement(id);
|
|
68
|
+
});
|
|
69
|
+
return () => subscription.unsubscribe();
|
|
70
|
+
}, [actorRef, diagram]);
|
|
71
|
+
return null;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export { LikeC4AdHocViewEditor };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RecipeVariantProps } from '@likec4/styles/css';
|
|
2
|
+
import { MouseEventHandler, PropsWithChildren, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
import { IconOrShapeRenderer } from '../../context/IconRenderer';
|
|
4
|
+
import { TreeNodeData } from '../useElementsTree';
|
|
5
|
+
import { RecipeRuntimeFn, SlotRecipeRuntimeFn } from '@likec4/styles';
|
|
6
|
+
import { StyleContextRootProvider, StyleContextConsumer } from '@likec4/styles/jsx';
|
|
7
|
+
import { IconProps } from '../../../@tabler/icons-react/dist/esm/icons/index.mjs';
|
|
8
|
+
declare const statebtn: RecipeRuntimeFn<{
|
|
9
|
+
state: {
|
|
10
|
+
"include-explicit": {
|
|
11
|
+
backgroundColor: "grass.6";
|
|
12
|
+
color: "text";
|
|
13
|
+
};
|
|
14
|
+
"include-implicit": {
|
|
15
|
+
backgroundColor: "grass.6";
|
|
16
|
+
color: "text";
|
|
17
|
+
};
|
|
18
|
+
exclude: {
|
|
19
|
+
backgroundColor: "red.6";
|
|
20
|
+
color: "text";
|
|
21
|
+
};
|
|
22
|
+
disabled: {
|
|
23
|
+
color: "text.dimmed";
|
|
24
|
+
};
|
|
25
|
+
'not-present': {
|
|
26
|
+
color: "text.dimmed";
|
|
27
|
+
backgroundColor: "default.hover/50";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
declare const tree: SlotRecipeRuntimeFn<"icon" | "label" | "content" | "item" | "indicator" | "branch" | "control" | "state", {}>;
|
|
32
|
+
export type TreeVariants = RecipeVariantProps<typeof tree>;
|
|
33
|
+
export declare const Tree: {
|
|
34
|
+
Root: StyleContextRootProvider<"div", SlotRecipeRuntimeFn<"icon" | "label" | "content" | "item" | "indicator" | "branch" | "control" | "state", {}>>;
|
|
35
|
+
Branch: StyleContextConsumer<"div">;
|
|
36
|
+
Item: StyleContextConsumer<"div">;
|
|
37
|
+
Control: StyleContextConsumer<"div">;
|
|
38
|
+
State: ({ node, state, onClick, className, ...props }: PropsWithChildren<RecipeVariantProps<typeof statebtn> & {
|
|
39
|
+
node: TreeNodeData;
|
|
40
|
+
className?: string;
|
|
41
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
42
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
Icon: typeof IconOrShapeRenderer;
|
|
44
|
+
Label: StyleContextConsumer<"div">;
|
|
45
|
+
Content: StyleContextConsumer<"div">;
|
|
46
|
+
Indicator: StyleContextConsumer<ForwardRefExoticComponent< IconProps & RefAttributes<SVGSVGElement>>>;
|
|
47
|
+
};
|
|
48
|
+
export {};
|