@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
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { ActorRefFromLogic, AnyActorLogic } from "xstate";
|
|
3
|
-
//#region src/utils/defineActors.d.ts
|
|
4
3
|
export type inferChildrenRef<A> = A extends Record<string, AnyActorLogic> ? { [K in keyof A & string]: ActorRefFromLogic<A[K]> | undefined; } : never;
|
|
5
4
|
export type inferProvidedActor<A> = A extends Record<string, AnyActorLogic> ? { [K in keyof A & string]: {
|
|
6
5
|
id: K;
|
|
7
6
|
logic: A[K];
|
|
8
7
|
src: K;
|
|
9
|
-
}; }[keyof A & string] : never;
|
|
10
|
-
//#endregion
|
|
8
|
+
}; }[keyof A & string] : never;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/utils/defineActors.ts
|
|
4
4
|
/**
|
|
5
5
|
* Helper function to define actors for use to mimize type inference issues
|
|
6
6
|
* with XState ActorSystem
|
|
@@ -11,5 +11,4 @@ function defineActors(actors) {
|
|
|
11
11
|
return actors;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { defineActors };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { bezierControlPoints } from "./xyflow.mjs";
|
|
3
2
|
import { inDrawingOrder, orthoPolyline } from "./edge-path.mjs";
|
|
3
|
+
import { bezierControlPoints } from "./xyflow.mjs";
|
|
4
4
|
import { isOrthoSpline, nearlyEqual, projectOnSegment, splineToPolyline } from "@likec4/core/geometry";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/utils/edge-corners.ts
|
|
7
7
|
/** Interior corners of an orthogonal Graphviz spline. */
|
|
8
8
|
function orthoCorners(points) {
|
|
9
9
|
const anchors = splineToPolyline(points).map((p) => ({
|
|
@@ -122,5 +122,4 @@ function insertCorner({ point, controlPoints, routing, ...edge }) {
|
|
|
122
122
|
return result;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
//#endregion
|
|
126
125
|
export { initialControlPoints, insertCorner, snapCorner };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { nodeToRect } from "./xyflow.mjs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/edge-endpoints.ts
|
|
5
5
|
/**
|
|
6
6
|
* Returns an edge endpoint from the node's actual bounds and handle center.
|
|
7
7
|
* Falls back to the node center when handle bounds are unavailable.
|
|
@@ -38,5 +38,4 @@ function edgeEndCenters(nodeLookup, edge) {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
//#endregion
|
|
42
41
|
export { edgeEndCenters, edgeEndFromNode };
|
|
@@ -2,7 +2,7 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { firstBy } from "remeda";
|
|
3
3
|
import { distanceBetween, placeLabelAlongSegments } from "@likec4/core/geometry";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/utils/edge-label.ts
|
|
6
6
|
/**
|
|
7
7
|
* Top-left position of the label of an edge being edited: centered at half the path length for
|
|
8
8
|
* splines; beside a straight run for ortho routing, avoiding obstacles unless the label is customized,
|
|
@@ -37,5 +37,4 @@ function centredAt(point, size) {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
//#endregion
|
|
41
40
|
export { edgeLabelPosition };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { Position, getBezierPath } from "@xyflow/system";
|
|
3
|
+
|
|
4
|
+
// src/utils/edge-path-through-label.ts
|
|
5
|
+
/**
|
|
6
|
+
* Returns the bezier edge path through the label placed by the layout (left to right):
|
|
7
|
+
* a curve to the left side of the label and a curve from its right side to the target,
|
|
8
|
+
* with a gap under the label, so the line does not show through the label background.
|
|
9
|
+
*
|
|
10
|
+
* Without label box, it is a single bezier curve with the label in the middle.
|
|
11
|
+
*/
|
|
12
|
+
function edgePathThroughLabel(params, labelBBox) {
|
|
13
|
+
if (!labelBBox) {
|
|
14
|
+
const [path, x, y] = getBezierPath({
|
|
15
|
+
sourceX: params.sourceX,
|
|
16
|
+
sourceY: params.sourceY,
|
|
17
|
+
sourcePosition: params.sourcePosition,
|
|
18
|
+
targetX: params.targetX,
|
|
19
|
+
targetY: params.targetY,
|
|
20
|
+
targetPosition: params.targetPosition
|
|
21
|
+
});
|
|
22
|
+
return [path, {
|
|
23
|
+
x,
|
|
24
|
+
y,
|
|
25
|
+
translate: "translate(-50%, 0)"
|
|
26
|
+
}];
|
|
27
|
+
}
|
|
28
|
+
const y = labelBBox.y + labelBBox.height / 2;
|
|
29
|
+
const [toLabel] = getBezierPath({
|
|
30
|
+
sourceX: params.sourceX,
|
|
31
|
+
sourceY: params.sourceY,
|
|
32
|
+
sourcePosition: params.sourcePosition,
|
|
33
|
+
targetX: labelBBox.x,
|
|
34
|
+
targetY: y,
|
|
35
|
+
targetPosition: Position.Left
|
|
36
|
+
});
|
|
37
|
+
const [fromLabel] = getBezierPath({
|
|
38
|
+
sourceX: labelBBox.x + labelBBox.width,
|
|
39
|
+
sourceY: y,
|
|
40
|
+
sourcePosition: Position.Right,
|
|
41
|
+
targetX: params.targetX,
|
|
42
|
+
targetY: params.targetY,
|
|
43
|
+
targetPosition: params.targetPosition
|
|
44
|
+
});
|
|
45
|
+
return [`${toLabel} ${fromLabel}`, {
|
|
46
|
+
x: labelBBox.x,
|
|
47
|
+
y: labelBBox.y
|
|
48
|
+
}];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { edgePathThroughLabel };
|
package/dist/utils/edge-path.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { continuesRun, distanceBetween, isOrthoSpline, nearlyEqual, polylineToSe
|
|
|
5
5
|
import { nonNullable } from "@likec4/core/utils";
|
|
6
6
|
import { curveCatmullRomOpen, line } from "d3-shape";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/utils/edge-path.ts
|
|
9
9
|
/** Endpoints in drawing order, reversed for `dir: 'back'`. */
|
|
10
10
|
function inDrawingOrder({ source, target, dir }) {
|
|
11
11
|
return dir === "back" ? [target, source] : [source, target];
|
|
@@ -242,5 +242,4 @@ function layoutedEdgePath({ points, routing, ...edge }) {
|
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
//#endregion
|
|
246
245
|
export { drawnFromRoute, editedEdgePath, editedEdgeRoute, inDrawingOrder, layoutedEdgePath, layoutedEdgeRoute, orthoPolyline };
|
|
@@ -2,7 +2,7 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { drawnFromRoute, editedEdgePath, editedEdgeRoute } from "./edge-path.mjs";
|
|
3
3
|
import { nearlyEqual } from "@likec4/core/geometry";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/utils/edge-tracks.ts
|
|
6
6
|
const TRACK_SPACING = 12;
|
|
7
7
|
const END_INSET = 8;
|
|
8
8
|
const SAME_TRACK = 4;
|
|
@@ -137,5 +137,4 @@ function trackedEdgePath({ id, controlPoints, routing, others, ...endpoints }) {
|
|
|
137
137
|
}, [...others]));
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
//#endregion
|
|
141
140
|
export { keepOwnTrack, trackedEdgePath };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { LikeC4ProjectData } from "../LikeC4ProjectsProvider.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Keeps the projects whose id, title or path match every term of the query.
|
|
5
|
+
*/
|
|
6
|
+
export declare function filterProjects<P extends Pick<LikeC4ProjectData, 'id' | 'title' | 'path'>>(projects: ReadonlyArray<P>, query: string): ReadonlyArray<P>;
|
|
7
|
+
/**
|
|
8
|
+
* Literal fragments of the query, to highlight in the matching projects.
|
|
9
|
+
*/
|
|
10
|
+
export declare function projectSearchHighlights(query: string): string[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
|
|
3
|
+
// src/utils/filterProjects.ts
|
|
4
|
+
function escapeRegExp(value) {
|
|
5
|
+
return value.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Splits a search query into lowercase terms; `*` inside a term matches any characters.
|
|
9
|
+
*/
|
|
10
|
+
function projectSearchTerms(query) {
|
|
11
|
+
return query.trim().toLowerCase().split(/\s+/).filter((term) => term.replaceAll("*", "").length > 0);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Keeps the projects whose id, title or path match every term of the query.
|
|
15
|
+
*/
|
|
16
|
+
function filterProjects(projects, query) {
|
|
17
|
+
const terms = projectSearchTerms(query);
|
|
18
|
+
if (terms.length === 0) return projects;
|
|
19
|
+
const matchers = terms.map((term) => new RegExp(term.split("*").map(escapeRegExp).join(".*")));
|
|
20
|
+
return projects.filter(({ id, title, path }) => {
|
|
21
|
+
const haystack = [
|
|
22
|
+
id,
|
|
23
|
+
title,
|
|
24
|
+
path
|
|
25
|
+
].filter(Boolean).join("\n").toLowerCase();
|
|
26
|
+
return matchers.every((matcher) => matcher.test(haystack));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Literal fragments of the query, to highlight in the matching projects.
|
|
31
|
+
*/
|
|
32
|
+
function projectSearchHighlights(query) {
|
|
33
|
+
return projectSearchTerms(query).flatMap((term) => term.split("*")).filter(Boolean);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { filterProjects, projectSearchHighlights, projectSearchTerms };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { roundDpr } from "./roundDpr.mjs";
|
|
2
2
|
import { bezierControlPoints, bezierPath, getNodeCenter, getNodeIntersectionFromCenterToPoint, isSamePoint, nodeToRect, stopPropagation } from "./xyflow.mjs";
|
|
3
3
|
import { readableText } from "./readableText.mjs";
|
|
4
|
+
import { isEventFromSearch } from "./search-event.mjs";
|
|
4
5
|
import { pickViewBounds } from "./view-bounds.mjs";
|
|
5
6
|
import { vector as vector$1 } from "@likec4/core/geometry";
|
|
6
7
|
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { DefaultFontFamily, EdgeLabelMetrics } from "@likec4/core/styles";
|
|
3
|
+
import { clearCache, layout, layoutWithLines, measureNaturalWidth, prepare, prepareWithSegments } from "@chenglou/pretext";
|
|
4
|
+
|
|
5
|
+
// src/utils/measure-edge-label.ts
|
|
6
|
+
/**
|
|
7
|
+
* Canvas font of the edge label (see `EdgeLabelMetrics` in the style preset)
|
|
8
|
+
*/
|
|
9
|
+
const edgeLabelFont = (size = EdgeLabelMetrics.label.fontSize) => `${size}px ${DefaultFontFamily}`;
|
|
10
|
+
/**
|
|
11
|
+
* Finds the narrowest width that keeps the same number of lines as at `maxWidth`,
|
|
12
|
+
* so lines are roughly equal (like CSS `text-wrap: balance`)
|
|
13
|
+
*/
|
|
14
|
+
function balancedWidth(paragraph, prepared, { maxWidth, lineHeight, font }) {
|
|
15
|
+
const lineCount = layout(prepared, maxWidth, lineHeight).lineCount;
|
|
16
|
+
if (lineCount <= 1) return maxWidth;
|
|
17
|
+
const longestWord = Math.max(...paragraph.split(/\s+/).map((word) => word ? measureNaturalWidth(prepare(word, font)) : 0));
|
|
18
|
+
if (longestWord >= maxWidth) return maxWidth;
|
|
19
|
+
let lo = longestWord;
|
|
20
|
+
let hi = maxWidth;
|
|
21
|
+
if (layout(prepared, lo, lineHeight).lineCount === lineCount) return lo;
|
|
22
|
+
while (hi - lo > 1) {
|
|
23
|
+
const mid = (lo + hi) / 2;
|
|
24
|
+
if (layout(prepared, mid, lineHeight).lineCount > lineCount) lo = mid;
|
|
25
|
+
else hi = mid;
|
|
26
|
+
}
|
|
27
|
+
return hi;
|
|
28
|
+
}
|
|
29
|
+
function wrapLabel(label, maxWidth) {
|
|
30
|
+
const font = edgeLabelFont();
|
|
31
|
+
const lineHeight = EdgeLabelMetrics.label.fontSize * EdgeLabelMetrics.label.lineHeight;
|
|
32
|
+
let lines = [];
|
|
33
|
+
for (const paragraph of label.trim().split(/\r?\n/)) {
|
|
34
|
+
if (!paragraph.trim()) {
|
|
35
|
+
lines.push("");
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const prepared = prepareWithSegments(paragraph, font);
|
|
39
|
+
const width = balancedWidth(paragraph, prepared, {
|
|
40
|
+
maxWidth,
|
|
41
|
+
lineHeight,
|
|
42
|
+
font
|
|
43
|
+
});
|
|
44
|
+
for (const line of layoutWithLines(prepared, width, lineHeight).lines) lines.push(line.text.trim());
|
|
45
|
+
}
|
|
46
|
+
lines = lines.slice(0, EdgeLabelMetrics.label.maxLines);
|
|
47
|
+
const width = Math.max(0, ...lines.map((line) => line ? measureNaturalWidth(prepare(line, font)) : 0));
|
|
48
|
+
return {
|
|
49
|
+
lines,
|
|
50
|
+
width
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Rough estimate, when there is no canvas to measure text (e.g. jsdom)
|
|
55
|
+
*/
|
|
56
|
+
function estimateLabel(label, maxWidth) {
|
|
57
|
+
const charWidth = EdgeLabelMetrics.label.fontSize * .55;
|
|
58
|
+
const maxChars = Math.max(1, Math.floor(maxWidth / charWidth));
|
|
59
|
+
const lines = [];
|
|
60
|
+
for (const paragraph of label.trim().split(/\r?\n/)) {
|
|
61
|
+
let line = "";
|
|
62
|
+
for (const word of paragraph.split(/\s+/).filter(Boolean)) {
|
|
63
|
+
if (line && line.length + 1 + word.length > maxChars) {
|
|
64
|
+
lines.push(line);
|
|
65
|
+
line = "";
|
|
66
|
+
}
|
|
67
|
+
let rest = line ? `${line} ${word}` : word;
|
|
68
|
+
while (rest.length > maxChars) {
|
|
69
|
+
lines.push(rest.slice(0, maxChars));
|
|
70
|
+
rest = rest.slice(maxChars);
|
|
71
|
+
}
|
|
72
|
+
line = rest;
|
|
73
|
+
}
|
|
74
|
+
lines.push(line);
|
|
75
|
+
}
|
|
76
|
+
const visible = lines.slice(0, EdgeLabelMetrics.label.maxLines);
|
|
77
|
+
return {
|
|
78
|
+
lines: visible,
|
|
79
|
+
width: Math.min(maxWidth, Math.max(0, ...visible.map((line) => line.length * charWidth)))
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Wraps and measures the edge label as it is rendered by `EdgeLabel`.
|
|
84
|
+
* Uses canvas of the browser, so the font must be loaded (see {@link loadEdgeLabelFont})
|
|
85
|
+
*/
|
|
86
|
+
function measureEdgeLabel({ label, technology, withActionButton = false, maxWidth = EdgeLabelMetrics.maxTextWidth }) {
|
|
87
|
+
const { label: labelStyle, technology: techStyle, gap, paddingBlock, paddingInline, actionButtonSize } = EdgeLabelMetrics;
|
|
88
|
+
let wrapped;
|
|
89
|
+
let techWidth = 0;
|
|
90
|
+
try {
|
|
91
|
+
wrapped = label?.trim() ? wrapLabel(label, maxWidth) : {
|
|
92
|
+
lines: [],
|
|
93
|
+
width: 0
|
|
94
|
+
};
|
|
95
|
+
if (technology) techWidth = measureNaturalWidth(prepare(`[ ${technology} ]`, edgeLabelFont(techStyle.fontSize)));
|
|
96
|
+
} catch {
|
|
97
|
+
wrapped = label?.trim() ? estimateLabel(label, maxWidth) : {
|
|
98
|
+
lines: [],
|
|
99
|
+
width: 0
|
|
100
|
+
};
|
|
101
|
+
techWidth = technology ? (technology.length + 4) * techStyle.fontSize * .55 : 0;
|
|
102
|
+
}
|
|
103
|
+
const rows = [];
|
|
104
|
+
if (wrapped.lines.length > 0) rows.push(wrapped.lines.length * labelStyle.fontSize * labelStyle.lineHeight);
|
|
105
|
+
if (technology) rows.push(techStyle.fontSize * techStyle.lineHeight);
|
|
106
|
+
if (withActionButton) rows.push(actionButtonSize);
|
|
107
|
+
const width = Math.max(wrapped.width, techWidth, withActionButton ? actionButtonSize : 0);
|
|
108
|
+
const height = rows.reduce((sum, h) => sum + h, 0) + Math.max(0, rows.length - 1) * gap;
|
|
109
|
+
return {
|
|
110
|
+
label: wrapped.lines.length > 0 ? wrapped.lines.join("\n") : null,
|
|
111
|
+
width: Math.ceil(width + 2 * paddingInline),
|
|
112
|
+
height: Math.ceil(height + 2 * paddingBlock)
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Loads faces of the edge label font required to render given texts.
|
|
117
|
+
* Resolves to `true` if something was loaded (measurements should be repeated)
|
|
118
|
+
*/
|
|
119
|
+
async function loadEdgeLabelFont(texts) {
|
|
120
|
+
if (typeof document === "undefined" || !document.fonts) return false;
|
|
121
|
+
const sample = texts.join(" ");
|
|
122
|
+
const font = edgeLabelFont();
|
|
123
|
+
if (document.fonts.check(font, sample)) return false;
|
|
124
|
+
await document.fonts.load(font, sample);
|
|
125
|
+
clearCache();
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { edgeLabelFont, loadEdgeLabelFont, measureEdgeLabel };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { RichText } from "@likec4/core";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/readableText.ts
|
|
5
5
|
const WHITESPACE = /\s+/g;
|
|
6
6
|
/**
|
|
7
7
|
* Flattens a markdown or plain string value into a single line of
|
|
@@ -16,5 +16,4 @@ function readableText(value) {
|
|
|
16
16
|
return RichText.from(value).text?.replace(WHITESPACE, " ").trim() || null;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
//#endregion
|
|
20
19
|
export { readableText };
|
package/dist/utils/roundDpr.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { clamp } from "remeda";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/roundDpr.ts
|
|
5
5
|
/**
|
|
6
6
|
* Returns the current device pixel ratio (DPR) given the passed options
|
|
7
7
|
*
|
|
@@ -22,5 +22,4 @@ function roundDpr(v) {
|
|
|
22
22
|
return Math.round(v * knownDpr) / knownDpr;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
//#endregion
|
|
26
25
|
export { roundDpr };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
|
|
3
|
+
// src/utils/search-event.ts
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the event comes from inside the search overlay (marked with `data-likec4-search`).
|
|
6
|
+
*
|
|
7
|
+
* Search can be opened on top of overlays and the diagram (e.g. by clicking a tag or metadata
|
|
8
|
+
* in element details). Global hotkey handlers must leave such events to the search:
|
|
9
|
+
* Escape closes the search, arrows move the caret in the search input.
|
|
10
|
+
*
|
|
11
|
+
* Uses `composedPath`, as the diagram may be rendered in a shadow root.
|
|
12
|
+
*/
|
|
13
|
+
function isEventFromSearch(event) {
|
|
14
|
+
return event.composedPath().some((target) => "dataset" in target && target.dataset["likec4Search"] === "true");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { isEventFromSearch };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { BBox } from "@likec4/core/geometry";
|
|
3
3
|
import { DiagramEdge, DynamicViewDisplayVariant, LayoutedView } from "@likec4/core/types";
|
|
4
|
-
//#region src/utils/view-bounds.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Picks appropriate bounds from the view,
|
|
7
6
|
* depending on its type and dynamic variant
|
|
8
7
|
*/
|
|
9
|
-
export declare function pickViewBounds(view: LayoutedView, dynamicVariant?: DynamicViewDisplayVariant): BBox;
|
|
10
|
-
//#endregion
|
|
8
|
+
export declare function pickViewBounds(view: LayoutedView, dynamicVariant?: DynamicViewDisplayVariant): BBox;
|
|
@@ -2,7 +2,7 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { invariant } from "@likec4/core";
|
|
3
3
|
import { BBox as BBox$1 } from "@likec4/core/geometry";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/utils/view-bounds.ts
|
|
6
6
|
/**
|
|
7
7
|
* Picks appropriate bounds from the view,
|
|
8
8
|
* depending on its type and dynamic variant
|
|
@@ -53,5 +53,4 @@ function calcViewBounds({ nodes, edges }) {
|
|
|
53
53
|
return BBox$1.expand(BBox$1.merge(...nodes, ...edges.map(calcEdgeBounds).filter((box) => isFinite(box.x) && isFinite(box.y))), 20);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
//#endregion
|
|
57
56
|
export { calcEdgeBounds, calcViewBounds, pickViewBounds };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/utils/view-routing.ts
|
|
4
4
|
/**
|
|
5
5
|
* Returns a view's resolved routing mode, defaulting to `spline` when omitted.
|
|
6
6
|
*/
|
|
@@ -8,5 +8,4 @@ function viewRouting(view) {
|
|
|
8
8
|
return view.routing ?? "spline";
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
//#endregion
|
|
12
11
|
export { viewRouting };
|
package/dist/utils/xyflow.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { Position } from "@xyflow/react";
|
|
3
3
|
import { flatMap, hasAtLeast, isArray, isNumber } from "remeda";
|
|
4
|
+
import { getNodeDimensions } from "@xyflow/system";
|
|
4
5
|
import { BBox, vector } from "@likec4/core/geometry";
|
|
5
6
|
import { invariant } from "@likec4/core/utils";
|
|
6
|
-
import { getNodeDimensions } from "@xyflow/system";
|
|
7
7
|
import { Bezier } from "bezier-js";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/utils/xyflow.ts
|
|
10
10
|
function isEqualRects(a, b) {
|
|
11
11
|
return Math.trunc(a.x) === Math.trunc(b.x) && Math.trunc(a.y) === Math.trunc(b.y) && Math.trunc(a.width) === Math.trunc(b.width) && Math.trunc(a.height) === Math.trunc(b.height);
|
|
12
12
|
}
|
|
@@ -170,5 +170,4 @@ function parsePaddings(padding, width, height) {
|
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
//#endregion
|
|
174
173
|
export { bezierControlPoints, bezierPath, getNodeCenter, getNodeIntersectionFromCenterToPoint, isEqualRects, isLeafNodeType, isSamePoint, leafNodeRects, nodeToRect$1 as nodeToRect, parsePaddings, stopPropagation };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { LikeC4ViewProps } from "../LikeC4View.mjs";
|
|
3
|
+
import { ProjectId } from "@likec4/core";
|
|
4
|
+
type LikeC4ViewComponent = (props: LikeC4ViewProps) => React.ReactElement;
|
|
5
|
+
/**
|
|
6
|
+
* Defines a custom element for a LikeC4 view component.
|
|
7
|
+
* Used by the LikeC4 Vite plugin.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function defineLikeC4Webcomponent(name: string, viewComponent: LikeC4ViewComponent, projectId: ProjectId): CustomElementConstructor;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createRoot } from "react-dom/client";
|
|
4
|
+
|
|
5
|
+
// src/webcomponent/defineWebcomponent.ts
|
|
6
|
+
const ObservedAttributes = [
|
|
7
|
+
"view-id",
|
|
8
|
+
"browser",
|
|
9
|
+
"dynamic-variant",
|
|
10
|
+
"color-scheme"
|
|
11
|
+
];
|
|
12
|
+
function readProps(element) {
|
|
13
|
+
function booleanAttribute(name, fallback) {
|
|
14
|
+
const value = element.getAttribute(name);
|
|
15
|
+
return value === null ? fallback : value.toLowerCase() !== "false";
|
|
16
|
+
}
|
|
17
|
+
function enumAttribute(name, values) {
|
|
18
|
+
const value = element.getAttribute(name);
|
|
19
|
+
return value !== null && values.includes(value) ? value : void 0;
|
|
20
|
+
}
|
|
21
|
+
const props = {
|
|
22
|
+
viewId: element.getAttribute("view-id") ?? "index",
|
|
23
|
+
browser: booleanAttribute("browser", true)
|
|
24
|
+
};
|
|
25
|
+
const dynamicViewVariant = enumAttribute("dynamic-variant", ["diagram", "sequence"]);
|
|
26
|
+
const colorScheme = enumAttribute("color-scheme", ["light", "dark"]);
|
|
27
|
+
if (dynamicViewVariant) props.dynamicViewVariant = dynamicViewVariant;
|
|
28
|
+
if (colorScheme) props.colorScheme = colorScheme;
|
|
29
|
+
return props;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The class is created on demand: this module is also imported where `HTMLElement` does not exist (SSR, node).
|
|
33
|
+
*/
|
|
34
|
+
function createLikeC4ViewElement(component) {
|
|
35
|
+
return class LikeC4ViewElement extends HTMLElement {
|
|
36
|
+
static observedAttributes = ObservedAttributes;
|
|
37
|
+
shadow;
|
|
38
|
+
mount;
|
|
39
|
+
root;
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
this.shadow = this.attachShadow({
|
|
43
|
+
mode: "open",
|
|
44
|
+
delegatesFocus: true
|
|
45
|
+
});
|
|
46
|
+
const style = document.createElement("style");
|
|
47
|
+
style.textContent = ":host { display: contents; background-color: transparent; margin: 0; padding: 0; }";
|
|
48
|
+
this.mount = document.createElement("div");
|
|
49
|
+
this.mount.style.display = "contents";
|
|
50
|
+
this.shadow.append(style, this.mount);
|
|
51
|
+
}
|
|
52
|
+
connectedCallback() {
|
|
53
|
+
this.root ??= createRoot(this.mount);
|
|
54
|
+
this.render();
|
|
55
|
+
}
|
|
56
|
+
disconnectedCallback() {
|
|
57
|
+
this.root?.unmount();
|
|
58
|
+
this.root = void 0;
|
|
59
|
+
}
|
|
60
|
+
attributeChangedCallback() {
|
|
61
|
+
if (this.root) this.render();
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
if (!this.root) return;
|
|
65
|
+
this.root.render(jsx(component, readProps(this)));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const projectIdSymbol = Symbol.for("likec4.webcomponent.projectId");
|
|
70
|
+
/**
|
|
71
|
+
* Defines a custom element for a LikeC4 view component.
|
|
72
|
+
* Used by the LikeC4 Vite plugin.
|
|
73
|
+
*
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
function defineLikeC4Webcomponent(name, viewComponent, projectId) {
|
|
77
|
+
if (typeof name !== "string" || name.trim().length === 0) throw new Error("name must be a non-empty string");
|
|
78
|
+
const existing = customElements.get(name);
|
|
79
|
+
if (existing) {
|
|
80
|
+
if (existing[projectIdSymbol] === projectId) return existing;
|
|
81
|
+
throw new Error("Custom element \"" + name + "\" is already defined");
|
|
82
|
+
}
|
|
83
|
+
const ViewElement = createLikeC4ViewElement(viewComponent);
|
|
84
|
+
Object.defineProperty(ViewElement, projectIdSymbol, {
|
|
85
|
+
enumerable: false,
|
|
86
|
+
writable: false,
|
|
87
|
+
value: projectId
|
|
88
|
+
});
|
|
89
|
+
customElements.define(name, ViewElement);
|
|
90
|
+
return ViewElement;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { defineLikeC4Webcomponent };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/diagram",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.61.0",
|
|
4
4
|
"description": "A React component library for rendering software architecture diagrams",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
@@ -47,59 +47,62 @@
|
|
|
47
47
|
"!**/*.d.ts.map"
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
|
+
"@chenglou/pretext": "1.0.0",
|
|
50
51
|
"@dagrejs/dagre": "1.1.8",
|
|
51
52
|
"@floating-ui/dom": "^1.8.0",
|
|
52
|
-
"@likec4/core": "1.
|
|
53
|
-
"@likec4/styles": "1.
|
|
53
|
+
"@likec4/core": "1.61.0",
|
|
54
|
+
"@likec4/styles": "1.61.0",
|
|
54
55
|
"@lume/kiwi": "^0.4.4",
|
|
55
|
-
"@mantine/core": "9.7.
|
|
56
|
-
"@mantine/hooks": "9.7.
|
|
56
|
+
"@mantine/core": "9.7.4",
|
|
57
|
+
"@mantine/hooks": "9.7.4",
|
|
57
58
|
"@nanostores/media-query": "0.1.2",
|
|
58
59
|
"@nanostores/react": "2.0.1",
|
|
59
|
-
"@react-hookz/web": "^
|
|
60
|
+
"@react-hookz/web": "^26.1.0",
|
|
60
61
|
"@xstate/react": "6.1.0",
|
|
61
62
|
"@xstate/store": "4.3.0",
|
|
62
63
|
"@xstate/store-react": "2.1.0",
|
|
63
|
-
"@xyflow/react": "12.12.
|
|
64
|
-
"@xyflow/system": "0.0.
|
|
64
|
+
"@xyflow/react": "12.12.1",
|
|
65
|
+
"@xyflow/system": "0.0.84",
|
|
65
66
|
"bezier-js": "^6.1.4",
|
|
66
67
|
"d3-force": "^3.0.0",
|
|
67
68
|
"d3-shape": "^3.2.0",
|
|
68
69
|
"defu": "^6.1.7",
|
|
69
|
-
"fast-equals": "^6.
|
|
70
|
+
"fast-equals": "^6.2.2",
|
|
71
|
+
"fuse.js": "^7.5.0",
|
|
70
72
|
"immer": "^11.1.21",
|
|
71
|
-
"motion": "^
|
|
73
|
+
"motion": "^14.10.1",
|
|
72
74
|
"nanostores": "1.5.5",
|
|
73
|
-
"react": "19.3.
|
|
74
|
-
"react-dom": "19.3.
|
|
75
|
+
"react": "19.3.1",
|
|
76
|
+
"react-dom": "19.3.1",
|
|
75
77
|
"react-error-boundary": "^6.1.6",
|
|
76
|
-
"
|
|
78
|
+
"react-resizable-panels": "^4.14.3",
|
|
79
|
+
"remeda": "^2.52.0",
|
|
77
80
|
"type-fest": "^4.41.0",
|
|
78
|
-
"xstate": "5.33.
|
|
81
|
+
"xstate": "5.33.3"
|
|
79
82
|
},
|
|
80
83
|
"devDependencies": {
|
|
81
84
|
"@likec4/devops": "1.59.4",
|
|
82
|
-
"@likec4/tsconfig": "1.
|
|
83
|
-
"@pandacss/dev": "^1.12.
|
|
84
|
-
"@statelyai/inspect": "^0.
|
|
85
|
+
"@likec4/tsconfig": "1.61.0",
|
|
86
|
+
"@pandacss/dev": "^1.12.2",
|
|
87
|
+
"@statelyai/inspect": "^0.7.2",
|
|
85
88
|
"@tabler/icons-react": "3.49.0",
|
|
86
|
-
"@tsdown/css": "^0.23.
|
|
89
|
+
"@tsdown/css": "^0.23.4",
|
|
87
90
|
"@types/bezier-js": "^4.1.3",
|
|
88
91
|
"@types/d3-force": "^3.0.10",
|
|
89
92
|
"@types/d3-shape": "^3.1.8",
|
|
90
|
-
"@types/node": "~22.
|
|
93
|
+
"@types/node": "~22.20.5",
|
|
91
94
|
"@types/react": "19.3.0",
|
|
92
95
|
"@types/react-dom": "19.3.0",
|
|
93
96
|
"@vitejs/plugin-react": "^6.1.2",
|
|
94
|
-
"oxc-transform-react": "^0.
|
|
95
|
-
"oxlint": "1.
|
|
96
|
-
"postcss": "8.5.
|
|
97
|
+
"oxc-transform-react": "^0.156.0",
|
|
98
|
+
"oxlint": "1.88.0",
|
|
99
|
+
"postcss": "8.5.30",
|
|
97
100
|
"postcss-import": "^17.0.0",
|
|
98
|
-
"tsdown": "^0.23.
|
|
101
|
+
"tsdown": "^0.23.4",
|
|
99
102
|
"typescript": "6.0.3",
|
|
100
|
-
"vite": "^8.3.
|
|
101
|
-
"vite-plugin-dts": "5.
|
|
102
|
-
"vitest": "4.1.
|
|
103
|
+
"vite": "^8.3.5",
|
|
104
|
+
"vite-plugin-dts": "5.1.2",
|
|
105
|
+
"vitest": "4.1.12",
|
|
103
106
|
"zx": "8.8.5"
|
|
104
107
|
},
|
|
105
108
|
"publishConfig": {
|