@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
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
|
|
3
|
+
// src/components/markdown/markdown-refs.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a resolver of Markdown refs against the model.
|
|
6
|
+
* Without a model, every ref is rendered as is (fallback text), without links.
|
|
7
|
+
*/
|
|
8
|
+
function createMarkdownRefResolver(model, options) {
|
|
9
|
+
return (ref) => {
|
|
10
|
+
switch (true) {
|
|
11
|
+
case ref.kind === "element": {
|
|
12
|
+
if (!model) return {
|
|
13
|
+
state: "text",
|
|
14
|
+
text: ref.target
|
|
15
|
+
};
|
|
16
|
+
const element = model.findElement(ref.target);
|
|
17
|
+
if (!element) return {
|
|
18
|
+
state: "missing",
|
|
19
|
+
text: null,
|
|
20
|
+
message: `Element '${ref.target}' not found`
|
|
21
|
+
};
|
|
22
|
+
const text = element.title;
|
|
23
|
+
if (!options.elements) return {
|
|
24
|
+
state: "text",
|
|
25
|
+
text
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
state: "link",
|
|
29
|
+
kind: "element",
|
|
30
|
+
fqn: element.id,
|
|
31
|
+
icon: element.icon,
|
|
32
|
+
text,
|
|
33
|
+
preview: {
|
|
34
|
+
title: element.title,
|
|
35
|
+
meta: element.technology ? `${element.id} · ${element.technology}` : element.id,
|
|
36
|
+
body: element.summary
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
case ref.kind === "view": {
|
|
41
|
+
if (!model) return {
|
|
42
|
+
state: "text",
|
|
43
|
+
text: ref.target
|
|
44
|
+
};
|
|
45
|
+
const view = model.findView(ref.target);
|
|
46
|
+
if (!view) return {
|
|
47
|
+
state: "missing",
|
|
48
|
+
text: null,
|
|
49
|
+
message: `View '${ref.target}' not found`
|
|
50
|
+
};
|
|
51
|
+
const text = view.titleOrId;
|
|
52
|
+
if (!options.views) return {
|
|
53
|
+
state: "text",
|
|
54
|
+
text
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
state: "link",
|
|
58
|
+
kind: "view",
|
|
59
|
+
viewId: view.id,
|
|
60
|
+
viewType: view._type,
|
|
61
|
+
text,
|
|
62
|
+
preview: {
|
|
63
|
+
title: text,
|
|
64
|
+
meta: `${view._type} view`,
|
|
65
|
+
body: view.description
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
default: return {
|
|
70
|
+
state: "missing",
|
|
71
|
+
text: null,
|
|
72
|
+
message: ref.namespace !== null ? `Unknown link type '${ref.namespace}:'` : `Unknown link type for '${ref.target}'`
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Matches ref anchors in the sanitized HTML from `markdownToHtml`.
|
|
79
|
+
* Attribute values never contain `"` (encoded as `"`) and text never contains `<` (encoded as `<`).
|
|
80
|
+
* The anchor has only a text child: refs never contain markup.
|
|
81
|
+
*/
|
|
82
|
+
const refAnchorRe = /<a data-likec4-ref="([^"]*)" data-likec4-ref-kind="(element|view|unknown)"(?: data-likec4-ref-namespace="([^"]*)")?( data-likec4-ref-label)?>([^<]*)<\/a>/g;
|
|
83
|
+
const namedEntities = {
|
|
84
|
+
amp: "&",
|
|
85
|
+
lt: "<",
|
|
86
|
+
gt: ">",
|
|
87
|
+
quot: "\"",
|
|
88
|
+
apos: "'"
|
|
89
|
+
};
|
|
90
|
+
function decodeEntities(value) {
|
|
91
|
+
return value.replace(/&(#x[0-9a-f]+|#[0-9]+|[a-z]+);/gi, (match, entity) => {
|
|
92
|
+
switch (true) {
|
|
93
|
+
case entity[0] === "#": {
|
|
94
|
+
const codePoint = entity[1] === "x" || entity[1] === "X" ? Number.parseInt(entity.slice(2), 16) : Number.parseInt(entity.slice(1), 10);
|
|
95
|
+
return Number.isNaN(codePoint) ? match : String.fromCodePoint(codePoint);
|
|
96
|
+
}
|
|
97
|
+
default: return namedEntities[entity.toLowerCase()] ?? match;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function escapeHtml(value) {
|
|
102
|
+
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Parses the ref attributes of an element (used by event handlers).
|
|
106
|
+
*/
|
|
107
|
+
function parseMarkdownRefAnchor(el) {
|
|
108
|
+
const target = el.getAttribute("data-likec4-ref");
|
|
109
|
+
const kind = el.getAttribute("data-likec4-ref-kind");
|
|
110
|
+
if (target === null || kind !== "element" && kind !== "view" && kind !== "unknown") return null;
|
|
111
|
+
return {
|
|
112
|
+
target,
|
|
113
|
+
kind,
|
|
114
|
+
namespace: el.getAttribute("data-likec4-ref-namespace"),
|
|
115
|
+
hasLabel: el.hasAttribute("data-likec4-ref-label")
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Replaces ref anchors in the HTML rendered by `markdownToHtml` with resolved refs:
|
|
120
|
+
* - link: `<a role="link" tabindex="0" data-likec4-ref-state="link">title or label</a>`,
|
|
121
|
+
* view links also have `data-likec4-ref-view-type="<view type>"` (styles pick the icon by it)
|
|
122
|
+
* - text: `<span data-likec4-ref-state="text">title or label</span>`
|
|
123
|
+
* - missing: `<span data-likec4-ref-state="missing">label or target</span>`
|
|
124
|
+
*
|
|
125
|
+
* Original `data-likec4-ref*` attributes are kept, so event handlers can read the target.
|
|
126
|
+
* Titles are HTML-escaped; labels are kept as they were encoded by `markdownToHtml`.
|
|
127
|
+
*/
|
|
128
|
+
function resolveMarkdownRefs(html, resolve) {
|
|
129
|
+
if (!html.includes("data-likec4-ref")) return html;
|
|
130
|
+
return html.replace(refAnchorRe, (_match, rawTarget, kind, rawNamespace, label, rawText) => {
|
|
131
|
+
const hasLabel = !!label;
|
|
132
|
+
const resolved = resolve({
|
|
133
|
+
target: decodeEntities(rawTarget),
|
|
134
|
+
kind,
|
|
135
|
+
namespace: rawNamespace !== void 0 ? decodeEntities(rawNamespace) : null,
|
|
136
|
+
hasLabel
|
|
137
|
+
});
|
|
138
|
+
const text = hasLabel || resolved.text === null ? rawText : escapeHtml(resolved.text);
|
|
139
|
+
const attrs = `data-likec4-ref="${rawTarget}" data-likec4-ref-kind="${kind}"` + (rawNamespace !== void 0 ? ` data-likec4-ref-namespace="${rawNamespace}"` : "") + (hasLabel ? " data-likec4-ref-label" : "");
|
|
140
|
+
if (resolved.state === "link") return `<a ${attrs}${resolved.kind === "view" ? ` data-likec4-ref-view-type="${resolved.viewType}"` : ""} data-likec4-ref-state="link" role="link" tabindex="0">${text}</a>`;
|
|
141
|
+
return `<span ${attrs} data-likec4-ref-state="${resolved.state}">${text}</span>`;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export { createMarkdownRefResolver, parseMarkdownRefAnchor, resolveMarkdownRefs };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { useCallbackRef } from "../../hooks/useCallbackRef.mjs";
|
|
3
|
+
import { parseMarkdownRefAnchor } from "./markdown-refs.mjs";
|
|
4
|
+
import { useId, useMemo, useRef } from "react";
|
|
5
|
+
import { useSyncedRef, useUnmountEffect } from "@react-hookz/web";
|
|
6
|
+
import { shallowEqual } from "fast-equals";
|
|
7
|
+
import { nonexhaustive } from "@likec4/core";
|
|
8
|
+
import { createAtom } from "@xstate/store";
|
|
9
|
+
|
|
10
|
+
// src/components/markdown/useMarkdownRefsInteractivity.tsx
|
|
11
|
+
const interactiveRefSelector = "[data-likec4-ref-state=\"link\"], [data-likec4-ref-state=\"missing\"]";
|
|
12
|
+
const inactiveRefState = {
|
|
13
|
+
element: null,
|
|
14
|
+
resolved: null,
|
|
15
|
+
opened: false
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Delegated event handlers for refs: one set of listeners on the Markdown block for all refs in it.
|
|
19
|
+
* Activates links on click and Enter, shows a preview card on hover and focus.
|
|
20
|
+
* Handlers from props are composed (called for events that are not ref activations).
|
|
21
|
+
*/
|
|
22
|
+
function useMarkdownRefsInteractivity(actions2, resolver3) {
|
|
23
|
+
const actionsRef = useSyncedRef(actions2);
|
|
24
|
+
const resolve = useCallbackRef(resolver3);
|
|
25
|
+
const previewId = useId();
|
|
26
|
+
const timer = useRef(void 0);
|
|
27
|
+
const interactivity = useMemo(() => {
|
|
28
|
+
const $active = createAtom(inactiveRefState, { compare: shallowEqual });
|
|
29
|
+
const $activeElement = createAtom(() => $active.get().element, { compare: (a, b) => a === b });
|
|
30
|
+
const $opened = createAtom(() => {
|
|
31
|
+
const state = $active.get();
|
|
32
|
+
return state.opened && state.element.isConnected;
|
|
33
|
+
});
|
|
34
|
+
let animationFrame = null;
|
|
35
|
+
const clearTimer = () => {
|
|
36
|
+
clearTimeout(timer.current);
|
|
37
|
+
if (animationFrame) {
|
|
38
|
+
cancelAnimationFrame(animationFrame);
|
|
39
|
+
animationFrame = null;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const open = (target, delay = 0) => {
|
|
43
|
+
if (animationFrame) cancelAnimationFrame(animationFrame);
|
|
44
|
+
animationFrame = requestAnimationFrame(() => {
|
|
45
|
+
animationFrame = null;
|
|
46
|
+
const element = closestRef(target, interactiveRefSelector);
|
|
47
|
+
if (!element) return;
|
|
48
|
+
clearTimer();
|
|
49
|
+
const state = $active.get();
|
|
50
|
+
if (state.opened && state.element === element) return;
|
|
51
|
+
const anchor = parseMarkdownRefAnchor(element);
|
|
52
|
+
const resolved = anchor ? resolve(anchor) : null;
|
|
53
|
+
if (!resolved || resolved.state === "text") return;
|
|
54
|
+
const show = () => $active.set((s) => ({
|
|
55
|
+
...s,
|
|
56
|
+
element,
|
|
57
|
+
resolved,
|
|
58
|
+
opened: true
|
|
59
|
+
}));
|
|
60
|
+
if (delay === 0 || state.opened) show();
|
|
61
|
+
else timer.current = setTimeout(show, delay);
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const close = (delay = 0) => {
|
|
65
|
+
clearTimer();
|
|
66
|
+
const hide = () => $active.set((s) => ({
|
|
67
|
+
...s,
|
|
68
|
+
opened: false
|
|
69
|
+
}));
|
|
70
|
+
if (delay === 0) hide();
|
|
71
|
+
else timer.current = setTimeout(hide, delay);
|
|
72
|
+
};
|
|
73
|
+
const openRef = (resolved) => {
|
|
74
|
+
close();
|
|
75
|
+
switch (resolved.kind) {
|
|
76
|
+
case "element":
|
|
77
|
+
actionsRef.current?.openElement?.(resolved.fqn);
|
|
78
|
+
break;
|
|
79
|
+
case "view":
|
|
80
|
+
actionsRef.current?.openView?.(resolved.viewId);
|
|
81
|
+
break;
|
|
82
|
+
default: nonexhaustive(resolved);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* @returns true if the event activated a ref
|
|
87
|
+
*/
|
|
88
|
+
const activate = (e) => {
|
|
89
|
+
const element = closestRef(e.target, "[data-likec4-ref-state=\"link\"]");
|
|
90
|
+
const anchor = element ? parseMarkdownRefAnchor(element) : null;
|
|
91
|
+
const resolved = anchor ? resolve(anchor) : null;
|
|
92
|
+
if (resolved?.state !== "link") return false;
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
openRef(resolved);
|
|
96
|
+
return true;
|
|
97
|
+
};
|
|
98
|
+
const isInsidePreview = (node) => node instanceof Node && !!document.getElementById(previewId)?.contains(node);
|
|
99
|
+
return {
|
|
100
|
+
previewId,
|
|
101
|
+
$active,
|
|
102
|
+
$activeElement,
|
|
103
|
+
$opened,
|
|
104
|
+
open,
|
|
105
|
+
close,
|
|
106
|
+
openRef,
|
|
107
|
+
activate,
|
|
108
|
+
isInsidePreview,
|
|
109
|
+
clearTimer,
|
|
110
|
+
closestRef: (target) => closestRef(target, interactiveRefSelector),
|
|
111
|
+
reset: () => {
|
|
112
|
+
clearTimer();
|
|
113
|
+
$active.set(inactiveRefState);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}, [previewId]);
|
|
117
|
+
useUnmountEffect(interactivity.reset);
|
|
118
|
+
return interactivity;
|
|
119
|
+
}
|
|
120
|
+
function closestRef(target, selector) {
|
|
121
|
+
if (!(target instanceof Element)) return null;
|
|
122
|
+
const element = target.closest(selector);
|
|
123
|
+
return element instanceof HTMLElement ? element : null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export { closestRef, interactiveRefSelector, useMarkdownRefsInteractivity };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
|
|
4
|
+
// src/context/ComparingLayoutsContext.tsx
|
|
5
|
+
const ComparingLayoutsContext = createContext(false);
|
|
6
|
+
/**
|
|
7
|
+
* Provides whether the diagram is comparing manual layout with the latest auto layout
|
|
8
|
+
* (diagram actor is in `ready.comparing` state).
|
|
9
|
+
*
|
|
10
|
+
* Provided once by the diagram actor provider, so that nodes and edges
|
|
11
|
+
* don't need to subscribe to the actor.
|
|
12
|
+
*/
|
|
13
|
+
const ComparingLayoutsProvider = ComparingLayoutsContext.Provider;
|
|
14
|
+
/**
|
|
15
|
+
* Returns true if the diagram is comparing manual layout with the latest auto layout.
|
|
16
|
+
*
|
|
17
|
+
* Unlike `useEnabledFeatures().enableCompareWithLatest` (feature is available),
|
|
18
|
+
* this reflects whether comparing is active.
|
|
19
|
+
*/
|
|
20
|
+
function useIsComparingLayouts() {
|
|
21
|
+
return useContext(ComparingLayoutsContext);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { ComparingLayoutsProvider, useIsComparingLayouts };
|
|
@@ -3,7 +3,7 @@ import { useCurrentViewId } from "../hooks/useCurrentView.mjs";
|
|
|
3
3
|
import { CurrentViewModelContext, useOptionalLikeC4Model } from "./LikeC4ModelContext.mjs";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/context/CurrentViewModelProvider.tsx
|
|
7
7
|
function CurrentViewModelProvider({ children }) {
|
|
8
8
|
const viewId = useCurrentViewId();
|
|
9
9
|
const viewmodel = useOptionalLikeC4Model()?.findView(viewId) ?? null;
|
|
@@ -13,5 +13,4 @@ function CurrentViewModelProvider({ children }) {
|
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
16
|
export { CurrentViewModelProvider };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { createContext, useContext, useMemo, useRef } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useSyncedRef } from "@react-hookz/web";
|
|
4
5
|
import { isFunction, keys, mapToObj } from "remeda";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
// src/context/DiagramEventHandlers.tsx
|
|
7
8
|
const defaultHandlers = {
|
|
8
9
|
onNavigateTo: null,
|
|
9
10
|
onNodeClick: null,
|
|
@@ -25,8 +26,7 @@ const DiagramEventHandlersReactContext = createContext({
|
|
|
25
26
|
handlersRef: { current: defaultHandlers }
|
|
26
27
|
});
|
|
27
28
|
function DiagramEventHandlers({ handlers, children }) {
|
|
28
|
-
const handlersRef =
|
|
29
|
-
handlersRef.current = handlers;
|
|
29
|
+
const handlersRef = useSyncedRef(handlers);
|
|
30
30
|
const deps = HandlerNames.map((name) => isFunction(handlers[name]) ? name : "-").join(",");
|
|
31
31
|
const value = useMemo(() => ({
|
|
32
32
|
...mapToObj(HandlerNames, (name) => {
|
|
@@ -44,5 +44,4 @@ function useDiagramEventHandlers() {
|
|
|
44
44
|
return useContext(DiagramEventHandlersReactContext);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
//#endregion
|
|
48
47
|
export { DiagramEventHandlers, useDiagramEventHandlers };
|
|
@@ -2,10 +2,9 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
3
|
import { JSX as JSX$1 } from "react/jsx-runtime";
|
|
4
4
|
import { ExclusiveUnion } from "@likec4/core/types";
|
|
5
|
-
//#region src/context/DiagramFeatures.d.ts
|
|
6
5
|
declare const FeatureNames: readonly ["Controls", "Editor", "AISemanticLayout", "ReadOnly", "FocusMode", "NavigateTo", "ElementDetails", "RelationshipDetails", "RelationshipBrowser", "Search", "NavigationButtons", "Notations", "DynamicViewWalkthrough", "FitView", "CompareWithLatest", "Notes", "Vscode", "ElementTags"];
|
|
7
6
|
export type FeatureName = typeof FeatureNames[number];
|
|
8
|
-
export type TogglableFeature =
|
|
7
|
+
export type TogglableFeature = 'ReadOnly' & FeatureName;
|
|
9
8
|
export type EnabledFeatures = { [P in `enable${FeatureName}`]: boolean; };
|
|
10
9
|
export declare function useEnabledFeatures(): EnabledFeatures;
|
|
11
10
|
/**
|
|
@@ -26,4 +25,4 @@ export declare function IfNotEnabled({ feature, children }: PropsWithChildren<{
|
|
|
26
25
|
}>): JSX$1.Element | null;
|
|
27
26
|
export declare function IfReadOnly({ children }: PropsWithChildren): JSX$1.Element | null;
|
|
28
27
|
export declare function IfNotReadOnly({ children }: PropsWithChildren): JSX$1.Element | null;
|
|
29
|
-
|
|
28
|
+
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { useUpdateEffect } from "../hooks/useUpdateEffect.mjs";
|
|
3
2
|
import { useSetState } from "../hooks/useSetState.mjs";
|
|
3
|
+
import { useUpdateEffect } from "../hooks/useUpdateEffect.mjs";
|
|
4
|
+
import { ComparingLayoutsProvider } from "./ComparingLayoutsContext.mjs";
|
|
4
5
|
import { createContext, useContext } from "react";
|
|
5
6
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
// src/context/DiagramFeatures.tsx
|
|
8
9
|
const DefaultFeatures = {
|
|
9
10
|
enableEditor: false,
|
|
10
11
|
/**
|
|
@@ -62,7 +63,10 @@ const overridesForOverlays = {
|
|
|
62
63
|
DiagramFeatures.Overlays = ({ children }) => {
|
|
63
64
|
return /* @__PURE__ */ jsx(DiagramFeatures, {
|
|
64
65
|
overrides: overridesForOverlays,
|
|
65
|
-
children
|
|
66
|
+
children: /* @__PURE__ */ jsx(ComparingLayoutsProvider, {
|
|
67
|
+
value: false,
|
|
68
|
+
children
|
|
69
|
+
})
|
|
66
70
|
});
|
|
67
71
|
};
|
|
68
72
|
function useEnabledFeatures() {
|
|
@@ -78,18 +82,20 @@ function useEnabledFeatures() {
|
|
|
78
82
|
* </IfEnabled>
|
|
79
83
|
*/
|
|
80
84
|
function IfEnabled({ feature, children, and = true }) {
|
|
81
|
-
|
|
85
|
+
const enabled = useEnabledFeatures()[`enable${feature}`] === true;
|
|
86
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: enabled && and ? children : null });
|
|
82
87
|
}
|
|
83
88
|
function IfNotEnabled({ feature, children }) {
|
|
84
|
-
|
|
89
|
+
const notEnabled = useEnabledFeatures()[`enable${feature}`] !== true;
|
|
90
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: notEnabled ? children : null });
|
|
85
91
|
}
|
|
86
92
|
function IfReadOnly({ children }) {
|
|
87
|
-
|
|
93
|
+
const isReadOnly = useEnabledFeatures().enableReadOnly === true;
|
|
94
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: isReadOnly ? children : null });
|
|
88
95
|
}
|
|
89
96
|
function IfNotReadOnly({ children }) {
|
|
90
|
-
|
|
91
|
-
return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
97
|
+
const isReadOnly = useEnabledFeatures().enableReadOnly === true;
|
|
98
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: isReadOnly ? null : children });
|
|
92
99
|
}
|
|
93
100
|
|
|
94
|
-
//#endregion
|
|
95
101
|
export { DefaultFeatures, DiagramFeatures, IfEnabled, IfNotEnabled, IfNotReadOnly, IfReadOnly, useEnabledFeatures };
|
|
@@ -4,7 +4,7 @@ import { useContext, useEffect } from "react";
|
|
|
4
4
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
5
5
|
import { MantineContext } from "@mantine/core";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/context/EnsureMantine.tsx
|
|
8
8
|
function EnsureMantine({ children }) {
|
|
9
9
|
const mantineCtx = useContext(MantineContext);
|
|
10
10
|
useEffect(() => {
|
|
@@ -14,5 +14,4 @@ function EnsureMantine({ children }) {
|
|
|
14
14
|
return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
export { EnsureMantine };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
|
-
//#region src/context/FramerMotionConfig.d.ts
|
|
4
3
|
export declare function FramerMotionConfig({ reducedMotion, children }: PropsWithChildren<{
|
|
5
4
|
/**
|
|
6
5
|
* If true, will respect the device prefersReducedMotion setting by switching
|
|
7
6
|
* transform animations off.
|
|
8
7
|
*/
|
|
9
8
|
reducedMotion?: 'always' | 'never' | 'user' | undefined;
|
|
10
|
-
}>): import("react").JSX.Element;
|
|
11
|
-
//#endregion
|
|
9
|
+
}>): import("react").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useMantineStyleNonce } from "@mantine/core";
|
|
4
4
|
import { LazyMotion, MotionConfig, domMax } from "motion/react";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/context/FramerMotionConfig.tsx
|
|
7
7
|
function FramerMotionConfig({ reducedMotion = "user", children }) {
|
|
8
8
|
const nonce = useMantineStyleNonce()?.();
|
|
9
9
|
return /* @__PURE__ */ jsx(LazyMotion, {
|
|
@@ -17,5 +17,4 @@ function FramerMotionConfig({ reducedMotion = "user", children }) {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
//#endregion
|
|
21
20
|
export { FramerMotionConfig };
|
|
@@ -2,7 +2,6 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { ElementIconRenderer, ElementIconRendererProps } from "../LikeC4Diagram.props.mjs";
|
|
3
3
|
import { CSSProperties, PropsWithChildren, ReactNode } from "react";
|
|
4
4
|
import { ElementShape } from "@likec4/core";
|
|
5
|
-
//#region src/context/IconRenderer.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Provider for custom element icon renderers
|
|
8
7
|
*
|
|
@@ -20,5 +19,4 @@ import { ElementShape } from "@likec4/core";
|
|
|
20
19
|
export declare function IconRendererProvider({ value, children }: PropsWithChildren<{
|
|
21
20
|
value: ElementIconRenderer | null;
|
|
22
21
|
}>): import("react").JSX.Element;
|
|
23
|
-
export declare function DefaultIconRenderer({ node, ...props }: ElementIconRendererProps): import("react").JSX.Element | null;
|
|
24
|
-
//#endregion
|
|
22
|
+
export declare function DefaultIconRenderer({ node, ...props }: ElementIconRendererProps): import("react").JSX.Element | null;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import IconBrowser from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.
|
|
3
|
-
import IconCylinder from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.
|
|
4
|
-
import IconDeviceMobile from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.
|
|
5
|
-
import IconFileText from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.
|
|
6
|
-
import IconRectangularPrism from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.
|
|
7
|
-
import IconReorder from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.
|
|
8
|
-
import IconRobot from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.
|
|
9
|
-
import IconUser from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.
|
|
2
|
+
import IconBrowser from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.mjs";
|
|
3
|
+
import IconCylinder from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.mjs";
|
|
4
|
+
import IconDeviceMobile from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.mjs";
|
|
5
|
+
import IconFileText from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.mjs";
|
|
6
|
+
import IconRectangularPrism from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.mjs";
|
|
7
|
+
import IconReorder from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.mjs";
|
|
8
|
+
import IconRobot from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconRobot.mjs";
|
|
9
|
+
import IconUser from "../node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.mjs";
|
|
10
10
|
import { cx } from "@likec4/styles/css";
|
|
11
11
|
import { createContext, useContext, useMemo } from "react";
|
|
12
12
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
// src/context/IconRenderer.tsx
|
|
15
15
|
const IconRendererContext = createContext(null);
|
|
16
16
|
/**
|
|
17
17
|
* Provider for custom element icon renderers
|
|
@@ -139,8 +139,8 @@ function decodeSvgDataUrl(dataUrl) {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
const iconUrl = (group, name) => `https://icons.like-c4.dev/${encodeURIComponent(group)}/${encodeURIComponent(name)}.svg`;
|
|
142
|
-
function
|
|
143
|
-
const url = iconUrl(
|
|
142
|
+
function MaskedIcon({ name, group, ...props }) {
|
|
143
|
+
const url = iconUrl(group, name);
|
|
144
144
|
const style = {
|
|
145
145
|
display: "inline-block",
|
|
146
146
|
width: "100%",
|
|
@@ -165,9 +165,10 @@ function DefaultIconRenderer({ node, ...props }) {
|
|
|
165
165
|
if (!node.icon || node.icon === "none") return null;
|
|
166
166
|
const [group, name, ...rest] = node.icon.split(":");
|
|
167
167
|
if (!group || !name || rest.length > 0) return null;
|
|
168
|
-
if (group === "bootstrap") return /* @__PURE__ */ jsx(
|
|
168
|
+
if (group === "bootstrap" || group === "md") return /* @__PURE__ */ jsx(MaskedIcon, {
|
|
169
169
|
...props,
|
|
170
|
-
name
|
|
170
|
+
name,
|
|
171
|
+
group
|
|
171
172
|
});
|
|
172
173
|
return /* @__PURE__ */ jsx("img", {
|
|
173
174
|
...props,
|
|
@@ -175,5 +176,4 @@ function DefaultIconRenderer({ node, ...props }) {
|
|
|
175
176
|
});
|
|
176
177
|
}
|
|
177
178
|
|
|
178
|
-
//#endregion
|
|
179
179
|
export { DefaultIconRenderer, IconOrShapeRenderer, IconRenderer, IconRendererProvider };
|
|
@@ -3,7 +3,6 @@ import { PropsWithChildren } from "react";
|
|
|
3
3
|
import * as t from "@likec4/core/types";
|
|
4
4
|
import { LayoutedView } from "@likec4/core/types";
|
|
5
5
|
import { LikeC4Model, LikeC4ViewModel } from "@likec4/core/model";
|
|
6
|
-
//#region src/context/LikeC4ModelContext.d.ts
|
|
7
6
|
type UnknownLayouted$1 = t.aux.UnknownLayouted;
|
|
8
7
|
export type CurrentViewModel = LikeC4ViewModel<UnknownLayouted$1, LayoutedView<UnknownLayouted$1>>;
|
|
9
8
|
/**
|
|
@@ -11,4 +10,4 @@ export type CurrentViewModel = LikeC4ViewModel<UnknownLayouted$1, LayoutedView<U
|
|
|
11
10
|
*/
|
|
12
11
|
export declare function useOptionalLikeC4Model<A extends t.aux.Any = UnknownLayouted$1>(): LikeC4Model<A> | null;
|
|
13
12
|
export declare function useOptionalCurrentViewModel(): CurrentViewModel | null;
|
|
14
|
-
|
|
13
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
3
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/context/LikeC4ModelContext.tsx
|
|
6
6
|
const LikeC4ModelContext = createContext(null);
|
|
7
7
|
const LikeC4ModelContextProvider = LikeC4ModelContext.Provider;
|
|
8
8
|
const CurrentViewModelCtx = createContext(null);
|
|
@@ -17,5 +17,4 @@ function useOptionalCurrentViewModel() {
|
|
|
17
17
|
return useContext(CurrentViewModelCtx);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
//#endregion
|
|
21
20
|
export { CurrentViewModelContext, LikeC4ModelContextProvider, useOptionalCurrentViewModel, useOptionalLikeC4Model };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { LikeC4ProjectData } from "../LikeC4ProjectsProvider.mjs";
|
|
3
3
|
import { ProjectId } from "@likec4/core/types";
|
|
4
|
-
//#region src/context/LikeC4ProjectsContext.d.ts
|
|
5
4
|
export type LikeC4ProjectsContext = {
|
|
6
5
|
projects: ReadonlyArray<LikeC4ProjectData>;
|
|
7
6
|
onProjectChange: (id: ProjectId) => void;
|
|
8
|
-
};
|
|
9
|
-
//#endregion
|
|
7
|
+
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/context/LikeC4ProjectsContext.ts
|
|
5
5
|
const LikeC4ProjectsContext = createContext(null);
|
|
6
6
|
const LikeC4ProjectsContextProvider = LikeC4ProjectsContext.Provider;
|
|
7
7
|
function useOptionalProjectsContext() {
|
|
8
8
|
return useContext(LikeC4ProjectsContext);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
//#endregion
|
|
12
11
|
export { LikeC4ProjectsContextProvider, useOptionalProjectsContext };
|
|
@@ -2,7 +2,7 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
3
|
import { useStore } from "@nanostores/react";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/context/RootContainerContext.tsx
|
|
6
6
|
const RootContainerContext = createContext(null);
|
|
7
7
|
const RootContainerContextProvider = RootContainerContext.Provider;
|
|
8
8
|
function useRootContainerContext() {
|
|
@@ -20,5 +20,4 @@ function useRootContainerElement() {
|
|
|
20
20
|
return useRootContainer().ref.current;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
//#endregion
|
|
24
23
|
export { RootContainerContextProvider, useRootContainer, useRootContainerContext, useRootContainerElement, useRootContainerRef };
|
|
@@ -2,7 +2,6 @@ import { __name } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
3
|
import "@likec4/core";
|
|
4
4
|
import { LikeC4Styles } from "@likec4/core/styles";
|
|
5
|
-
//#region src/context/TagStylesContext.d.ts
|
|
6
5
|
type TagStylesProviderProps = PropsWithChildren<{
|
|
7
6
|
/**
|
|
8
7
|
* Root element selector to scope the tag styles to (e.g., "#diagram-root")
|
|
@@ -11,4 +10,4 @@ type TagStylesProviderProps = PropsWithChildren<{
|
|
|
11
10
|
rootSelector: string;
|
|
12
11
|
}>;
|
|
13
12
|
export declare function TagStylesProvider({ children, rootSelector }: TagStylesProviderProps): import("react").JSX.Element;
|
|
14
|
-
|
|
13
|
+
export {};
|