@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
|
@@ -5,7 +5,7 @@ import { isFunction } from "remeda";
|
|
|
5
5
|
import { useSelector } from "@xstate/react";
|
|
6
6
|
import { invariant } from "motion";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/hooks/safeContext.tsx
|
|
9
9
|
const DiagramApiSafeContext = createContext(null);
|
|
10
10
|
DiagramApiSafeContext.displayName = "DiagramApiSafeContext";
|
|
11
11
|
const DiagramApiContextProvider = DiagramApiSafeContext.Provider;
|
|
@@ -70,5 +70,4 @@ function createSafeContextForActor(name) {
|
|
|
70
70
|
}
|
|
71
71
|
const { ContextProvider: DiagramActorContextProvider, selectSnapshot: selectDiagramSnapshot, selectContext: selectDiagramContext, useActorSelector: useDiagramSelector, useActorRef: useDiagramActorRef } = createSafeContextForActor("DiagramActor");
|
|
72
72
|
|
|
73
|
-
//#endregion
|
|
74
73
|
export { DiagramActorContextProvider, DiagramApiContextProvider, createSafeContextForActor, selectDiagramContext, selectDiagramSnapshot, useDiagram, useDiagramActorRef, useDiagramSelector };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { useMemo, useRef } from "react";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/hooks/useCallbackRef.ts
|
|
5
5
|
/**
|
|
6
6
|
* Memoizes a callback function so that it will not be recreated on every render.
|
|
7
7
|
* The returned function is guaranteed to be the same reference across renders.
|
|
@@ -19,5 +19,4 @@ function useCallbackRef(callback) {
|
|
|
19
19
|
}, []);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
//#endregion
|
|
23
22
|
export { useCallbackRef };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { LayoutedView, ViewId } from "@likec4/core/types";
|
|
3
|
-
//#region src/hooks/useCurrentView.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Returns current view id
|
|
6
5
|
* Should be used only inside LikeC4Diagram
|
|
@@ -10,5 +9,4 @@ export declare function useCurrentViewId(): ViewId;
|
|
|
10
9
|
* Returns current view
|
|
11
10
|
* Should be used only inside LikeC4Diagram
|
|
12
11
|
*/
|
|
13
|
-
export declare function useCurrentView(): LayoutedView;
|
|
14
|
-
//#endregion
|
|
12
|
+
export declare function useCurrentView(): LayoutedView;
|
|
@@ -2,7 +2,7 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { viewRouting } from "../utils/view-routing.mjs";
|
|
3
3
|
import { selectDiagramContext, useDiagramSelector } from "./safeContext.mjs";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/hooks/useCurrentView.ts
|
|
6
6
|
const selectViewId = selectDiagramContext((s) => s.view.id);
|
|
7
7
|
/**
|
|
8
8
|
* Returns current view id
|
|
@@ -28,5 +28,4 @@ function useCurrentViewRouting() {
|
|
|
28
28
|
return useDiagramSelector(selectViewRouting);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
//#endregion
|
|
32
31
|
export { useCurrentView, useCurrentViewId, useCurrentViewRouting };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { CurrentViewModel, useOptionalCurrentViewModel } from "../context/LikeC4ModelContext.mjs";
|
|
3
|
-
//#region src/hooks/useCurrentViewModel.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Hook to get the current view model from the context.
|
|
6
5
|
* Throws an error if no view model is found in the context.
|
|
@@ -8,5 +7,4 @@ import { CurrentViewModel, useOptionalCurrentViewModel } from "../context/LikeC4
|
|
|
8
7
|
* @see useOptionalCurrentViewModel
|
|
9
8
|
*/
|
|
10
9
|
export declare function useCurrentViewModel(): CurrentViewModel;
|
|
11
|
-
//#endregion
|
|
12
10
|
export { type CurrentViewModel, useOptionalCurrentViewModel };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { useOptionalCurrentViewModel } from "../context/LikeC4ModelContext.mjs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/hooks/useCurrentViewModel.ts
|
|
5
5
|
/**
|
|
6
6
|
* Hook to get the current view model from the context.
|
|
7
7
|
* Throws an error if no view model is found in the context.
|
|
@@ -14,5 +14,4 @@ function useCurrentViewModel() {
|
|
|
14
14
|
return vm;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
export { useCurrentViewModel, useOptionalCurrentViewModel };
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { DiagramApi } from "../likec4diagram/state/diagram-api.mjs";
|
|
3
|
-
import { selectDiagramContext, selectDiagramSnapshot, useDiagram, useDiagramActorRef, useDiagramSelector } from "./safeContext.mjs";
|
|
4
2
|
import { Context, EmittedEvents } from "../likec4diagram/state/machine.setup.mjs";
|
|
3
|
+
import { DiagramApi } from "../likec4diagram/state/diagram-api.mjs";
|
|
5
4
|
import "../likec4diagram/state/types.mjs";
|
|
5
|
+
import { selectDiagramContext, selectDiagramSnapshot, useDiagram, useDiagramActorRef, useDiagramSelector } from "./safeContext.mjs";
|
|
6
6
|
import { DependencyList } from "react";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Read diagram context
|
|
10
|
-
* @deprecated use {@link useDiagramSelector}
|
|
11
|
-
*/
|
|
12
|
-
export declare function useDiagramContext<T = unknown>(selector: (context: Context) => T, compare?: (a: NoInfer<T>, b: NoInfer<T>) => boolean, deps?: DependencyList): T;
|
|
13
|
-
type PickEmittedEvent<T> = T extends EmittedEvents['type'] ? EmittedEvents & {
|
|
14
|
-
type: T;
|
|
15
|
-
} : unknown;
|
|
7
|
+
type PickEmittedEvent<T> = { [K in EmittedEvents as K['type']]: K['type'] extends T ? K : never; }[EmittedEvents['type']];
|
|
16
8
|
/**
|
|
17
9
|
* Subscribe to diagram emitted events
|
|
18
10
|
* @example
|
|
@@ -25,5 +17,4 @@ type PickEmittedEvent<T> = T extends EmittedEvents['type'] ? EmittedEvents & {
|
|
|
25
17
|
export declare function useOnDiagramEvent<T extends EmittedEvents['type'] | '*'>(event: T, callback: (event: PickEmittedEvent<T>) => void, options?: {
|
|
26
18
|
once?: boolean;
|
|
27
19
|
}): void;
|
|
28
|
-
//#endregion
|
|
29
20
|
export { type DiagramApi, type Context as DiagramContext, selectDiagramContext, selectDiagramSnapshot, useDiagram, useDiagramActorRef, useDiagramSelector };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { useCallbackRef } from "./useCallbackRef.mjs";
|
|
3
2
|
import { selectDiagramContext, selectDiagramSnapshot, useDiagram, useDiagramActorRef, useDiagramSelector } from "./safeContext.mjs";
|
|
3
|
+
import { useCallbackRef } from "./useCallbackRef.mjs";
|
|
4
4
|
import { useCallback, useEffect, useRef } from "react";
|
|
5
5
|
import { shallowEqual } from "fast-equals";
|
|
6
6
|
import { useSelector } from "@xstate/react";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/hooks/useDiagram.ts
|
|
9
9
|
/**
|
|
10
10
|
* Read diagram context
|
|
11
11
|
* @deprecated use {@link useDiagramSelector}
|
|
@@ -27,18 +27,20 @@ function useDiagramContext(selector, compare = shallowEqual, deps = []) {
|
|
|
27
27
|
*/
|
|
28
28
|
function useOnDiagramEvent(event, callback, options) {
|
|
29
29
|
const actorRef = useDiagramActorRef();
|
|
30
|
-
const callbackRef = useCallbackRef(callback);
|
|
31
30
|
const wasCalled = useRef(false);
|
|
32
31
|
const once = options?.once ?? false;
|
|
32
|
+
const callbackRef = useCallbackRef((event) => {
|
|
33
|
+
wasCalled.current = true;
|
|
34
|
+
try {
|
|
35
|
+
callback(event);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error(error);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
33
40
|
useEffect(() => {
|
|
34
41
|
if (once && wasCalled.current) return;
|
|
35
42
|
let subscription = actorRef.on(event, (payload) => {
|
|
36
|
-
|
|
37
|
-
callbackRef(payload);
|
|
38
|
-
} catch (error) {
|
|
39
|
-
console.error(error);
|
|
40
|
-
}
|
|
41
|
-
wasCalled.current = true;
|
|
43
|
+
callbackRef(payload);
|
|
42
44
|
if (once) {
|
|
43
45
|
subscription?.unsubscribe();
|
|
44
46
|
subscription = null;
|
|
@@ -55,5 +57,4 @@ function useOnDiagramEvent(event, callback, options) {
|
|
|
55
57
|
]);
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
//#endregion
|
|
59
60
|
export { selectDiagramContext, selectDiagramSnapshot, useDiagram, useDiagramActorRef, useDiagramContext, useDiagramSelector, useOnDiagramEvent };
|
|
@@ -2,8 +2,7 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { DiagramMachineSnapshot } from "../likec4diagram/state/machine.mjs";
|
|
3
3
|
import "../likec4diagram/state/types.mjs";
|
|
4
4
|
import * as t from "@likec4/core/types";
|
|
5
|
-
|
|
6
|
-
export declare function selectCompareLayoutState({ context }: DiagramMachineSnapshot): {
|
|
5
|
+
export declare function selectCompareLayoutState(snapshot: DiagramMachineSnapshot): {
|
|
7
6
|
isEnabled: false;
|
|
8
7
|
hasEditor: boolean;
|
|
9
8
|
isEditable: false;
|
|
@@ -50,5 +49,4 @@ export type DiagramCompareLayoutOps = {
|
|
|
50
49
|
*
|
|
51
50
|
* The hook must be called by a component rendered inside {@link LikeC4Diagram}.
|
|
52
51
|
*/
|
|
53
|
-
export declare function useDiagramCompareLayout(): [DiagramCompareLayoutState, DiagramCompareLayoutOps];
|
|
54
|
-
//#endregion
|
|
52
|
+
export declare function useDiagramCompareLayout(): [DiagramCompareLayoutState, DiagramCompareLayoutOps];
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { useDiagramActorRef } from "./safeContext.mjs";
|
|
2
|
+
import { deriveToggledFeatures, isComparingLayouts } from "../likec4diagram/state/machine.setup.mjs";
|
|
4
3
|
import { typedSystem } from "../likec4diagram/state/utils.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { useDiagramActorRef } from "./safeContext.mjs";
|
|
5
|
+
import { useCallbackRef } from "./useCallbackRef.mjs";
|
|
6
|
+
import { deepEqual } from "fast-equals";
|
|
7
7
|
import { nonNullable } from "@likec4/core";
|
|
8
8
|
import { useSelector } from "@xstate/react";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
function selectCompareLayoutState(
|
|
10
|
+
// src/hooks/useDiagramCompareLayout.ts
|
|
11
|
+
function selectCompareLayoutState(snapshot) {
|
|
12
|
+
const { context } = snapshot;
|
|
12
13
|
const hasEditor = context.features.enableEditor;
|
|
13
14
|
const drifts = context.view.drifts ?? null;
|
|
14
15
|
if (!context.features.enableCompareWithLatest || !drifts || drifts.length === 0) return {
|
|
@@ -20,12 +21,12 @@ function selectCompareLayoutState({ context }) {
|
|
|
20
21
|
canApplyLatest: false,
|
|
21
22
|
layout: context.view._layout ?? "auto"
|
|
22
23
|
};
|
|
23
|
-
const {
|
|
24
|
+
const { enableReadOnly } = deriveToggledFeatures(snapshot);
|
|
24
25
|
return {
|
|
25
26
|
hasEditor,
|
|
26
27
|
isEnabled: true,
|
|
27
28
|
isEditable: !enableReadOnly && hasEditor,
|
|
28
|
-
state:
|
|
29
|
+
state: isComparingLayouts(snapshot) ? "comparing" : "inactive",
|
|
29
30
|
drifts,
|
|
30
31
|
canApplyLatest: hasEditor && !drifts.includes("type-changed"),
|
|
31
32
|
layout: context.view._layout ?? "auto"
|
|
@@ -38,7 +39,7 @@ function selectCompareLayoutState({ context }) {
|
|
|
38
39
|
*/
|
|
39
40
|
function useDiagramCompareLayout() {
|
|
40
41
|
const actorRef = useDiagramActorRef();
|
|
41
|
-
const state = useSelector(actorRef, selectCompareLayoutState,
|
|
42
|
+
const state = useSelector(actorRef, selectCompareLayoutState, deepEqual);
|
|
42
43
|
const switchLayout = useCallbackRef((layoutType) => {
|
|
43
44
|
if (!state.isEnabled) {
|
|
44
45
|
console.warn("Compare with latest feature is not enabled");
|
|
@@ -56,12 +57,7 @@ function useDiagramCompareLayout() {
|
|
|
56
57
|
return;
|
|
57
58
|
}
|
|
58
59
|
const nextIsActive = force ? force === "on" : state.state === "inactive";
|
|
59
|
-
|
|
60
|
-
actorRef.send({
|
|
61
|
-
type: "toggle.feature",
|
|
62
|
-
feature: "CompareWithLatest",
|
|
63
|
-
forceValue: nextIsActive
|
|
64
|
-
});
|
|
60
|
+
actorRef.send({ type: nextIsActive ? "compare.start" : "compare.end" });
|
|
65
61
|
}),
|
|
66
62
|
switchLayout,
|
|
67
63
|
resetManualLayout: useCallbackRef(() => {
|
|
@@ -73,14 +69,9 @@ function useDiagramCompareLayout() {
|
|
|
73
69
|
return;
|
|
74
70
|
}
|
|
75
71
|
nonNullable(typedSystem(actorRef.system).editorActorRef, "editor actor not found").send({ type: "change.latest-to-manual" });
|
|
76
|
-
if (state.state === "comparing") actorRef.send({
|
|
77
|
-
type: "toggle.feature",
|
|
78
|
-
feature: "CompareWithLatest",
|
|
79
|
-
forceValue: false
|
|
80
|
-
});
|
|
72
|
+
if (state.state === "comparing") actorRef.send({ type: "compare.end" });
|
|
81
73
|
})
|
|
82
74
|
}];
|
|
83
75
|
}
|
|
84
76
|
|
|
85
|
-
//#endregion
|
|
86
77
|
export { selectCompareLayoutState, useDiagramCompareLayout };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { useEnabledFeatures } from "../context/DiagramFeatures.mjs";
|
|
3
|
+
import { useCallbackRef } from "./useCallbackRef.mjs";
|
|
4
|
+
import { useDiagram } from "./safeContext.mjs";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
|
|
7
|
+
// src/hooks/useDiagramMarkdownRefActions.ts
|
|
8
|
+
/**
|
|
9
|
+
* Default actions for refs in Markdown inside diagram overlays and panels:
|
|
10
|
+
* element ref opens element details, view ref navigates to the view.
|
|
11
|
+
* Actions of disabled features are `null`, so these refs render as plain text.
|
|
12
|
+
*
|
|
13
|
+
* @param overrides - replace default actions (still `null` if the feature is disabled)
|
|
14
|
+
*/
|
|
15
|
+
function useDiagramMarkdownRefActions(overrides) {
|
|
16
|
+
const diagram = useDiagram();
|
|
17
|
+
const { enableElementDetails, enableNavigateTo } = useEnabledFeatures();
|
|
18
|
+
const openElement = useCallbackRef((fqn) => {
|
|
19
|
+
if (overrides?.openElement) return overrides.openElement(fqn);
|
|
20
|
+
return diagram.openNodeDetails({
|
|
21
|
+
type: "element",
|
|
22
|
+
element: fqn
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
const openView = useCallbackRef((viewId) => {
|
|
26
|
+
if (overrides?.openView) return overrides.openView(viewId);
|
|
27
|
+
return diagram.navigateTo(viewId);
|
|
28
|
+
});
|
|
29
|
+
return useMemo(() => ({
|
|
30
|
+
openElement: enableElementDetails ? openElement : null,
|
|
31
|
+
openView: enableNavigateTo ? openView : null
|
|
32
|
+
}), [enableElementDetails, enableNavigateTo]);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { useDiagramMarkdownRefActions };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { loadEdgeLabelFont } from "../utils/measure-edge-label.mjs";
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
+
|
|
5
|
+
// src/hooks/useEdgeLabelFontLoader.ts
|
|
6
|
+
/**
|
|
7
|
+
* Edge labels are measured with the canvas, so font faces must be loaded first
|
|
8
|
+
* (e.g. cyrillic subset is loaded only when it is used).
|
|
9
|
+
*
|
|
10
|
+
* Returns a version, that is incremented when required font faces are loaded (use it as a dependency
|
|
11
|
+
* of the layout to measure labels again), and a function to request font faces for given labels.
|
|
12
|
+
*/
|
|
13
|
+
function useEdgeLabelFontLoader() {
|
|
14
|
+
const [version, setVersion] = useState(0);
|
|
15
|
+
const mounted = useRef(true);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
mounted.current = true;
|
|
18
|
+
return () => {
|
|
19
|
+
mounted.current = false;
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
return [version, useCallback((labels) => {
|
|
23
|
+
loadEdgeLabelFont(labels).then((loaded) => {
|
|
24
|
+
if (loaded && mounted.current) setVersion((v) => v + 1);
|
|
25
|
+
}).catch(() => {});
|
|
26
|
+
}, [])];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { useEdgeLabelFontLoader };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { useXYStore } from "./useXYFlow.mjs";
|
|
3
2
|
import { edgeEndFromNode } from "../utils/edge-endpoints.mjs";
|
|
4
3
|
import { drawnFromRoute, editedEdgePath, editedEdgeRoute, layoutedEdgeRoute } from "../utils/edge-path.mjs";
|
|
5
4
|
import { keepOwnTrack } from "../utils/edge-tracks.mjs";
|
|
5
|
+
import { useXYStore } from "./useXYFlow.mjs";
|
|
6
6
|
import { polylineToSegments } from "@likec4/core/geometry";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/hooks/useEdgeTracks.ts
|
|
9
9
|
const none = /* @__PURE__ */ new Map();
|
|
10
10
|
const cache = /* @__PURE__ */ new WeakMap();
|
|
11
11
|
/**
|
|
@@ -87,5 +87,4 @@ function useTrackRoutes(routing, enabled) {
|
|
|
87
87
|
return useXYStore(enabled && routing === "ortho" ? selectTrackRoutes : selectNone);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
//#endregion
|
|
91
90
|
export { selectLabelRoutes, selectTrackRoutes, useTrackRoutes };
|
|
@@ -3,7 +3,7 @@ import { selectDiagramSnapshot, useDiagramSelector } from "./safeContext.mjs";
|
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { useDebouncedState } from "@mantine/hooks";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/hooks/useEditorActor.ts
|
|
7
7
|
const select = selectDiagramSnapshot((s) => s.children.editor ?? null, Object.is);
|
|
8
8
|
function useEditorActorRef() {
|
|
9
9
|
return useDiagramSelector(select);
|
|
@@ -23,5 +23,4 @@ function useEditorActorStateHasTag(tag) {
|
|
|
23
23
|
return hasTag;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
//#endregion
|
|
27
26
|
export { useEditorActorRef, useEditorActorStateHasTag };
|
package/dist/hooks/useId.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { useId } from "@mantine/hooks";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/hooks/useId.ts
|
|
5
5
|
function useId$1() {
|
|
6
6
|
return useId().replace("mantine-", "likec4-");
|
|
7
7
|
}
|
|
8
8
|
__name(useId$1, "useId");
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { useId$1 as useId };
|
|
@@ -3,7 +3,7 @@ import { useLikeC4Model } from "./useLikeC4Model.mjs";
|
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { compareNatural } from "@likec4/core/utils";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/hooks/useLikeC4ElementsTree.ts
|
|
7
7
|
const sortByLabel = (a, b) => compareNatural(a.label, b.label);
|
|
8
8
|
function buildNode(element) {
|
|
9
9
|
const children = [...element.children()].map(buildNode).sort(sortByLabel);
|
|
@@ -26,5 +26,4 @@ function useLikeC4ElementsTree(viewId) {
|
|
|
26
26
|
}, [model, viewId]);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { sortByLabel, useLikeC4ElementsTree };
|
|
@@ -2,7 +2,6 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { useOptionalLikeC4Model } from "../context/LikeC4ModelContext.mjs";
|
|
3
3
|
import * as t from "@likec4/core/types";
|
|
4
4
|
import { LikeC4Model, LikeC4ViewModel } from "@likec4/core/model";
|
|
5
|
-
//#region src/hooks/useLikeC4Model.d.ts
|
|
6
5
|
type Any$1 = t.aux.Any;
|
|
7
6
|
/**
|
|
8
7
|
* @returns The LikeC4Model from context.
|
|
@@ -11,5 +10,4 @@ type Any$1 = t.aux.Any;
|
|
|
11
10
|
export declare function useLikeC4Model<A extends Any$1 = t.aux.UnknownLayouted>(): LikeC4Model<A>;
|
|
12
11
|
export declare function useLikeC4ViewModel<A extends Any$1 = t.aux.UnknownLayouted>(viewId: t.aux.ViewId<A>): LikeC4ViewModel<A>;
|
|
13
12
|
export declare function useLikeC4Specification(): t.Specification<t.aux.UnknownLayouted>;
|
|
14
|
-
//#endregion
|
|
15
13
|
export { useOptionalLikeC4Model };
|
|
@@ -3,7 +3,7 @@ import { useOptionalLikeC4Model } from "../context/LikeC4ModelContext.mjs";
|
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { deepEqual } from "fast-equals";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/hooks/useLikeC4Model.ts
|
|
7
7
|
/**
|
|
8
8
|
* @returns The LikeC4Model from context.
|
|
9
9
|
* @throws If no LikeC4ModelProvider is found.
|
|
@@ -30,5 +30,4 @@ function useLikeC4Specification() {
|
|
|
30
30
|
return specification;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
//#endregion
|
|
34
33
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel, useOptionalLikeC4Model };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { LikeC4ProjectData } from "../LikeC4ProjectsProvider.mjs";
|
|
3
2
|
import { LikeC4ProjectsContext } from "../context/LikeC4ProjectsContext.mjs";
|
|
3
|
+
import { LikeC4ProjectData } from "../LikeC4ProjectsProvider.mjs";
|
|
4
4
|
import { ProjectId } from "@likec4/core/types";
|
|
5
|
-
//#region src/hooks/useLikeC4Project.d.ts
|
|
6
5
|
export declare function useLikeC4ProjectsContext(): LikeC4ProjectsContext;
|
|
7
6
|
/**
|
|
8
7
|
* @returns The list of available projects, or empty array if no projects are available.
|
|
@@ -25,5 +24,4 @@ export declare function useLikeC4ProjectId(): ProjectId;
|
|
|
25
24
|
* Requires LikeC4ModelProvider in the tree.
|
|
26
25
|
* Falls back to model's project if LikeC4ProjectsProvider is not available.
|
|
27
26
|
*/
|
|
28
|
-
export declare function useLikeC4Project(): LikeC4ProjectData;
|
|
29
|
-
//#endregion
|
|
27
|
+
export declare function useLikeC4Project(): LikeC4ProjectData;
|
|
@@ -2,7 +2,7 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { useOptionalLikeC4Model } from "../context/LikeC4ModelContext.mjs";
|
|
3
3
|
import { useOptionalProjectsContext } from "../context/LikeC4ProjectsContext.mjs";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/hooks/useLikeC4Project.ts
|
|
6
6
|
const emptyProjects = [];
|
|
7
7
|
function onProjectChange(id) {
|
|
8
8
|
console.warn(`Triggered callback to change project to ${id}, but no <LikeC4ProjectsProvider/> found`);
|
|
@@ -54,5 +54,4 @@ function useLikeC4Project() {
|
|
|
54
54
|
return projectsCtx?.projects.find((p) => p.id === modelCtx.projectId) ?? modelCtx.project;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
//#endregion
|
|
58
57
|
export { useChangeLikeC4Project, useHasProjects, useLikeC4Project, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { LikeC4Styles } from "@likec4/core/styles";
|
|
3
|
-
|
|
4
|
-
export declare function useLikeC4Styles(): LikeC4Styles;
|
|
5
|
-
//#endregion
|
|
3
|
+
export declare function useLikeC4Styles(): LikeC4Styles;
|
|
@@ -2,10 +2,9 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { useOptionalLikeC4Model } from "../context/LikeC4ModelContext.mjs";
|
|
3
3
|
import { LikeC4Styles } from "@likec4/core/styles";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/hooks/useLikeC4Styles.ts
|
|
6
6
|
function useLikeC4Styles() {
|
|
7
7
|
return useOptionalLikeC4Model()?.$styles ?? LikeC4Styles.DEFAULT;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { useLikeC4Styles };
|
|
@@ -2,7 +2,7 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { useRootContainerElement } from "../context/RootContainerContext.mjs";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/hooks/useMantinePortalProps.ts
|
|
6
6
|
function useMantinePortalProps() {
|
|
7
7
|
const target = useRootContainerElement();
|
|
8
8
|
return useMemo(() => target ? {
|
|
@@ -11,5 +11,4 @@ function useMantinePortalProps() {
|
|
|
11
11
|
} : { withinPortal: false }, [target]);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { useMantinePortalProps };
|
|
@@ -2,7 +2,7 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { useCallback, useRef, useState } from "react";
|
|
3
3
|
import { shallowEqual } from "fast-equals";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/hooks/useSetState.ts
|
|
6
6
|
/**
|
|
7
7
|
* Differs from useState in that:
|
|
8
8
|
* - it uses custom equal function (shallowEqual by default) to determine whether the state has changed.
|
|
@@ -22,5 +22,4 @@ function useSetState(initialState, equal) {
|
|
|
22
22
|
}), [_setState])];
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
//#endregion
|
|
26
25
|
export { useSetState };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { DependencyList, EffectCallback } from "react";
|
|
3
3
|
import { DependenciesComparator, EffectHook } from "@react-hookz/web";
|
|
4
|
-
//#region src/hooks/useUpdateEffect.d.ts
|
|
5
4
|
declare function useUpdateEffect$1<Callback extends EffectCallback = EffectCallback, Deps extends DependencyList = DependencyList>(callback: Callback, deps: Deps, equalityFn?: DependenciesComparator<Deps>, effectHook?: EffectHook<Callback, Deps>): void;
|
|
6
|
-
//#endregion
|
|
7
5
|
export { useUpdateEffect$1 as useUpdateEffect };
|
|
@@ -2,7 +2,7 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { useCustomCompareEffect, useFirstMountState } from "@react-hookz/web";
|
|
3
3
|
import { shallowEqual } from "fast-equals";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/hooks/useUpdateEffect.ts
|
|
6
6
|
const noop = () => {};
|
|
7
7
|
const depsShallowEqual = (d1, d2) => {
|
|
8
8
|
if (d1 === d2) return true;
|
|
@@ -19,5 +19,4 @@ function useUpdateEffect$1(callback, deps, equalityFn, effectHook) {
|
|
|
19
19
|
}
|
|
20
20
|
__name(useUpdateEffect$1, "useUpdateEffect");
|
|
21
21
|
|
|
22
|
-
//#endregion
|
|
23
22
|
export { depsShallowEqual, useUpdateEffect$1 as useUpdateEffect };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { Types } from "../likec4diagram/types.mjs";
|
|
3
3
|
import { ReactFlowInstance, ReactFlowState } from "@xyflow/react";
|
|
4
|
-
//#region src/hooks/useXYFlow.d.ts
|
|
5
4
|
export type XYFlowInstance = ReactFlowInstance<Types.AnyNode, Types.AnyEdge>;
|
|
6
5
|
export type XYStoreState = ReactFlowState<Types.AnyNode, Types.AnyEdge>;
|
|
7
6
|
export type XYStoreApi = {
|
|
8
7
|
getState: () => XYStoreState;
|
|
9
8
|
setState: (state: Partial<XYStoreState> | ((state: XYStoreState) => Partial<XYStoreState>)) => void;
|
|
10
9
|
subscribe: (listener: (state: XYStoreState, prevState: XYStoreState) => void) => () => void;
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
10
|
+
};
|
package/dist/hooks/useXYFlow.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { useCallback } from "react";
|
|
|
3
3
|
import { useReactFlow, useStore, useStoreApi } from "@xyflow/react";
|
|
4
4
|
import { shallowEqual } from "fast-equals";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/hooks/useXYFlow.ts
|
|
7
7
|
function useXYFlow() {
|
|
8
8
|
return useReactFlow();
|
|
9
9
|
}
|
|
@@ -24,5 +24,4 @@ function useIsZoomTooSmall() {
|
|
|
24
24
|
return useStore(selectZoom);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
//#endregion
|
|
28
27
|
export { selectXYStore, useCurrentZoomAtLeast, useIsZoomTooSmall, useXYFlow, useXYStore, useXYStoreApi };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { DiagramApi } from "./likec4diagram/state/diagram-api.mjs";
|
|
5
|
-
import { selectDiagramContext, selectDiagramSnapshot, useDiagram, useDiagramSelector } from "./hooks/safeContext.mjs";
|
|
6
|
-
import { useOnDiagramEvent } from "./hooks/useDiagram.mjs";
|
|
1
|
+
import { DefaultIconRenderer, IconRendererProvider } from "./context/IconRenderer.mjs";
|
|
2
|
+
import { MaxZoom, MinZoom } from "./base/const.mjs";
|
|
3
|
+
import { LikeC4Diagram, LikeC4DiagramProps } from "./LikeC4Diagram.mjs";
|
|
7
4
|
import { ElementIconRenderer, ElementIconRendererProps, LikeC4ColorScheme, NodeRenderers, OnCanvasClick, OnEdgeClick, OnInitialized, OnNavigateTo, OnNodeClick, OnOpenSource, PaddingWithUnit, ViewPadding, ViewPaddings, WhereOperator } from "./LikeC4Diagram.props.mjs";
|
|
8
5
|
import { Context } from "./likec4diagram/state/machine.setup.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { DiagramApi } from "./likec4diagram/state/diagram-api.mjs";
|
|
7
|
+
import { selectDiagramContext, selectDiagramSnapshot, useDiagram, useDiagramActorRef, useDiagramSelector } from "./hooks/safeContext.mjs";
|
|
8
|
+
import { LikeC4ModelProvider, LikeC4ModelProviderProps } from "./LikeC4ModelProvider.mjs";
|
|
9
|
+
import { LikeC4EditorProvider, LikeC4EditorProviderProps } from "./editor/LikeC4EditorProvider.mjs";
|
|
10
|
+
import { LikeC4EditorCallbacks, LikeC4EditorChangeResult, createLikeC4Editor } from "./editor/LikeC4EditorCallbacks.mjs";
|
|
13
11
|
import { LikeC4ProjectsProvider, LikeC4ProjectsProviderProps } from "./LikeC4ProjectsProvider.mjs";
|
|
12
|
+
import { useOnDiagramEvent } from "./hooks/useDiagram.mjs";
|
|
13
|
+
import { DiagramCompareLayoutOps, DiagramCompareLayoutState, useDiagramCompareLayout } from "./hooks/useDiagramCompareLayout.mjs";
|
|
14
|
+
import { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from "./hooks/useLikeC4Model.mjs";
|
|
15
|
+
import { useCurrentViewModel } from "./hooks/useCurrentViewModel.mjs";
|
|
14
16
|
import { useChangeLikeC4Project, useHasProjects, useLikeC4Project, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext } from "./hooks/useLikeC4Project.mjs";
|
|
15
17
|
import { useLikeC4Styles } from "./hooks/useLikeC4Styles.mjs";
|
|
18
|
+
import { filterProjects, projectSearchHighlights } from "./utils/filterProjects.mjs";
|
|
16
19
|
import { useUpdateEffect } from "./hooks/useUpdateEffect.mjs";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { DefaultIconRenderer, IconRendererProvider } from "./context/IconRenderer.mjs";
|
|
20
|
-
import { MaxZoom, MinZoom } from "./base/const.mjs";
|
|
21
|
-
import { LikeC4Diagram, LikeC4DiagramProps } from "./LikeC4Diagram.mjs";
|
|
22
|
-
import { LikeC4ModelProvider, LikeC4ModelProviderProps } from "./LikeC4ModelProvider.mjs";
|
|
23
|
-
import { DiagramCompareLayoutOps, DiagramCompareLayoutState, useDiagramCompareLayout } from "./hooks/useDiagramCompareLayout.mjs";
|
|
20
|
+
import { CurrentViewModel, useOptionalCurrentViewModel, useOptionalLikeC4Model } from "./context/LikeC4ModelContext.mjs";
|
|
21
|
+
import { Types } from "./likec4diagram/types.mjs";
|
|
24
22
|
import { StaticLikeC4Diagram } from "./StaticLikeC4Diagram.mjs";
|
|
25
23
|
import { LikeC4BrowserProps, LikeC4View, LikeC4ViewProps } from "./LikeC4View.mjs";
|
|
26
24
|
import { ReactLikeC4, ReactLikeC4Props } from "./ReactLikeC4.mjs";
|
|
25
|
+
import { useCurrentView, useCurrentViewId } from "./hooks/useCurrentView.mjs";
|
|
27
26
|
import { pickViewBounds } from "./utils/view-bounds.mjs";
|
|
28
27
|
import { LikeC4ProjectsOverview, LikeC4ProjectsOverviewProps } from "./LikeC4ProjectsOverview.mjs";
|
|
29
28
|
import { SearchContext, SearchContextValue, normalizeSearch, useSearchContext } from "./search/SearchContext.mjs";
|
|
30
29
|
import { SearchPanelContent, bodyCss, dialogCss } from "./search/Search.mjs";
|
|
31
30
|
import { SearchControl } from "./components/SearchControl.mjs";
|
|
31
|
+
import { DefaultMantineProvider, LikeC4MantineProvider } from "./LikeC4MantineProvider.mjs";
|
|
32
|
+
import { FramerMotionConfig } from "./context/FramerMotionConfig.mjs";
|
|
32
33
|
import { Logo, LogoIcon } from "./components/Logo.mjs";
|
|
33
|
-
|
|
34
|
+
import { defineLikeC4Webcomponent } from "./webcomponent/defineWebcomponent.mjs";
|
|
35
|
+
export { type CurrentViewModel, DefaultIconRenderer, DefaultMantineProvider, type DiagramApi, type DiagramCompareLayoutOps, type DiagramCompareLayoutState, type Context as DiagramContext, type ElementIconRenderer, type ElementIconRendererProps, FramerMotionConfig, IconRendererProvider, type LikeC4BrowserProps, type LikeC4ColorScheme, LikeC4Diagram, type LikeC4DiagramProps, type LikeC4EditorCallbacks, type LikeC4EditorChangeResult, LikeC4EditorProvider, type LikeC4EditorProviderProps, LikeC4MantineProvider, LikeC4ModelProvider, type LikeC4ModelProviderProps, LikeC4ProjectsOverview, type LikeC4ProjectsOverviewProps, LikeC4ProjectsProvider, type LikeC4ProjectsProviderProps, LikeC4View, type LikeC4ViewProps, Logo, LogoIcon, MaxZoom, MinZoom, type NodeRenderers, type OnCanvasClick, type OnEdgeClick, type OnInitialized, type OnNavigateTo, type OnNodeClick, type OnOpenSource, type PaddingWithUnit, ReactLikeC4, type ReactLikeC4Props, SearchContext, type SearchContextValue, SearchControl, SearchPanelContent, StaticLikeC4Diagram, type Types, type ViewPadding, type ViewPaddings, type WhereOperator, createLikeC4Editor, defineLikeC4Webcomponent, filterProjects, normalizeSearch, pickViewBounds, projectSearchHighlights, bodyCss as searchBodyCss, dialogCss as searchDialogCss, selectDiagramContext, selectDiagramSnapshot, useChangeLikeC4Project, useCurrentView, useCurrentViewId, useCurrentViewModel, useDiagram, useDiagramActorRef, useDiagramCompareLayout, useDiagramSelector, useHasProjects, useLikeC4Model, useLikeC4Project, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext, useLikeC4Specification, useLikeC4Styles, useLikeC4ViewModel, useOnDiagramEvent, useOptionalCurrentViewModel, useOptionalLikeC4Model, useSearchContext, useUpdateEffect };
|