@likec4/diagram 1.47.0 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +8 -10
- package/adhoc-editor/package.json +4 -0
- package/dist/LikeC4Diagram.d.ts +2 -1
- package/dist/LikeC4Diagram.js +85 -81
- package/dist/LikeC4Diagram.props.d.ts +10 -6
- package/dist/LikeC4ModelProvider.d.ts +4 -4
- package/dist/LikeC4ModelProvider.js +2 -2
- package/dist/LikeC4ProjectsOverview.d.ts +3 -2
- package/dist/LikeC4ProjectsProvider.d.ts +2 -1
- package/dist/LikeC4ProjectsProvider.js +10 -8
- package/dist/LikeC4Styles.d.ts +3 -6
- package/dist/LikeC4Styles.js +44 -43
- package/dist/LikeC4View.d.ts +22 -1
- package/dist/LikeC4View.js +40 -25
- package/dist/ReactLikeC4.d.ts +13 -2
- package/dist/ReactLikeC4.js +8 -4
- package/dist/StaticLikeC4Diagram.d.ts +2 -1
- package/dist/StaticLikeC4Diagram.js +1 -0
- package/dist/_virtual/store-1b2fbb72.cjs.js +3 -0
- package/dist/_virtual/xstate-store-react.cjs.js +5 -0
- package/dist/_virtual/xstate-store-react.cjs2.js +3 -0
- package/dist/adhoc-editor/EditorPanel.d.ts +1 -0
- package/dist/adhoc-editor/EditorPanel.js +105 -0
- package/dist/adhoc-editor/ElementsTree.d.ts +2 -0
- package/dist/adhoc-editor/ElementsTree.js +142 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +4 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +74 -0
- package/dist/adhoc-editor/components/Tree.d.ts +48 -0
- package/dist/adhoc-editor/components/Tree.js +296 -0
- package/dist/adhoc-editor/hooks.d.ts +14 -0
- package/dist/adhoc-editor/hooks.js +29 -0
- package/dist/adhoc-editor/index.d.ts +2 -0
- package/dist/adhoc-editor/index.js +1 -0
- package/dist/adhoc-editor/state/ActorProvider.d.ts +5 -0
- package/dist/adhoc-editor/state/ActorProvider.js +40 -0
- package/dist/adhoc-editor/state/actor.d.ts +13 -0
- package/dist/adhoc-editor/state/actor.editor.d.ts +56 -0
- package/dist/adhoc-editor/state/actor.editor.js +205 -0
- package/dist/adhoc-editor/state/actor.js +16 -0
- package/dist/adhoc-editor/state/actor.layouter.d.ts +51 -0
- package/dist/adhoc-editor/state/actor.layouter.js +70 -0
- package/dist/adhoc-editor/state/actor.types.d.ts +63 -0
- package/dist/adhoc-editor/state/actor.types.js +29 -0
- package/dist/adhoc-editor/state/panel.d.ts +95 -0
- package/dist/adhoc-editor/state/panel.js +139 -0
- package/dist/adhoc-editor/state/utils.d.ts +17 -0
- package/dist/adhoc-editor/state/utils.js +32 -0
- package/dist/adhoc-editor/useElementsTree.d.ts +18 -0
- package/dist/adhoc-editor/useElementsTree.js +130 -0
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +6 -0
- package/dist/base/const.d.ts +2 -0
- package/dist/base/const.js +2 -1
- package/dist/base/updateEdges.js +26 -3
- package/dist/base/updateNodes.js +8 -5
- package/dist/base-primitives/Markdown.d.ts +1 -1
- package/dist/base-primitives/Markdown.js +1 -1
- package/dist/base-primitives/NodeHandles.d.ts +4 -2
- package/dist/base-primitives/NodeHandles.js +46 -19
- package/dist/base-primitives/compound/CompoundActionButton.js +28 -12
- package/dist/base-primitives/compound/CompoundDetailsButton.js +24 -9
- package/dist/base-primitives/compound/CompoundNodeContainer.js +11 -8
- package/dist/base-primitives/compound/CompoundTitle.js +1 -2
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +5 -2
- package/dist/base-primitives/edge/EdgeLabel.js +3 -4
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +2 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +17 -20
- package/dist/base-primitives/element/ElementActionButtons.js +57 -59
- package/dist/base-primitives/element/ElementData.d.ts +7 -7
- package/dist/base-primitives/element/ElementData.js +61 -48
- package/dist/base-primitives/element/ElementDetailsButton.js +48 -18
- package/dist/base-primitives/element/ElementNodeContainer.d.ts +5 -5
- package/dist/base-primitives/element/ElementNodeContainer.js +24 -10
- package/dist/base-primitives/element/ElementShape.d.ts +2 -2
- package/dist/base-primitives/element/ElementShape.js +70 -7
- package/dist/base-primitives/element/ElementTags.d.ts +6 -2
- package/dist/base-primitives/element/ElementTags.js +55 -32
- package/dist/base-primitives/index.d.ts +1 -1
- package/dist/base-primitives/memoEdge.js +1 -1
- package/dist/base-primitives/memoNode.js +1 -1
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +3 -3
- package/dist/components/NavigationPanel.d.ts +2 -2
- package/dist/components/NavigationPanel.js +5 -26
- package/dist/components/PortalToContainer.js +3 -4
- package/dist/components/RootContainer.js +9 -19
- package/dist/components/ViewNotFound.d.ts +3 -3
- package/dist/components/ViewNotFound.js +30 -26
- package/dist/context/CurrentViewModelProvider.d.ts +2 -0
- package/dist/context/CurrentViewModelProvider.js +12 -0
- package/dist/context/DefaultMantineProvider.d.ts +2 -0
- package/dist/context/DefaultMantineProvider.js +75 -0
- package/dist/context/DiagramEventHandlers.d.ts +5 -5
- package/dist/context/DiagramEventHandlers.js +10 -4
- package/dist/context/DiagramFeatures.d.ts +8 -7
- package/dist/context/DiagramFeatures.js +16 -13
- package/dist/context/EnsureMantine.d.ts +0 -3
- package/dist/context/EnsureMantine.js +3 -4
- package/dist/context/FramerMotionConfig.d.ts +1 -3
- package/dist/context/IconRenderer.d.ts +19 -4
- package/dist/context/IconRenderer.js +52 -25
- package/dist/context/LikeC4ModelContext.d.ts +10 -5
- package/dist/context/LikeC4ModelContext.js +11 -3
- package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
- package/dist/context/LikeC4ProjectsContext.js +6 -2
- package/dist/context/RootContainerContext.d.ts +10 -3
- package/dist/context/RootContainerContext.js +8 -3
- package/dist/context/TagStylesContext.js +13 -5
- package/dist/custom/hooks.d.ts +2 -2
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +16 -15
- package/dist/editor/LikeC4EditorCallbacks.d.ts +18 -0
- package/dist/editor/LikeC4EditorCallbacks.js +5 -0
- package/dist/editor/LikeC4EditorProvider.d.ts +30 -18
- package/dist/editor/LikeC4EditorProvider.js +3 -3
- package/dist/editor/applyChangesToManualLayout.js +7 -6
- package/dist/editor/editorActor.actions.d.ts +25 -25
- package/dist/editor/editorActor.actions.js +22 -22
- package/dist/editor/editorActor.setup.d.ts +84 -0
- package/dist/editor/editorActor.setup.js +38 -0
- package/dist/editor/editorActor.states.d.ts +9 -0
- package/dist/editor/{editorActor.js → editorActor.states.js} +21 -72
- package/dist/editor/index.d.ts +4 -3
- package/dist/editor/useEditorActorLogic.d.ts +2 -565
- package/dist/editor/useEditorActorLogic.js +14 -21
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/safeContext.d.ts +4 -5
- package/dist/hooks/useCallbackRef.d.ts +6 -0
- package/dist/hooks/useCallbackRef.js +7 -6
- package/dist/hooks/useCurrentView.js +5 -10
- package/dist/hooks/useCurrentViewModel.d.ts +8 -2
- package/dist/hooks/useCurrentViewModel.js +3 -7
- package/dist/hooks/useDiagram.d.ts +9 -1
- package/dist/hooks/useDiagram.js +10 -4
- package/dist/hooks/useDiagramCompareLayout.d.ts +6 -6
- package/dist/hooks/useDiagramCompareLayout.js +1 -1
- package/dist/hooks/useLikeC4ElementsTree.d.ts +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +2 -2
- package/dist/hooks/useLikeC4Model.d.ts +6 -2
- package/dist/hooks/useLikeC4Model.js +7 -9
- package/dist/hooks/useLikeC4Project.d.ts +4 -6
- package/dist/hooks/useLikeC4Project.js +19 -31
- package/dist/hooks/useLikeC4Styles.js +3 -9
- package/dist/hooks/useMantinePortalProps.d.ts +1 -1
- package/dist/hooks/useMediaPrint.d.ts +0 -2
- package/dist/hooks/useOverlaysActor.js +4 -4
- package/dist/hooks/useSearchActor.js +4 -4
- package/dist/hooks/useSetState.d.ts +6 -1
- package/dist/hooks/useSetState.js +7 -4
- package/dist/hooks/useXYFlow.d.ts +7 -1
- package/dist/hooks/useXYFlow.js +4 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +3 -1
- package/dist/likec4diagram/DiagramUI.js +1 -3
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -1
- package/dist/likec4diagram/DiagramXYFlow.js +29 -18
- package/dist/likec4diagram/convert-to-xyflow.d.ts +2 -1
- package/dist/likec4diagram/convert-to-xyflow.js +2 -6
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +34 -37
- package/dist/likec4diagram/custom/edges/edges.css.js +2 -1
- package/dist/likec4diagram/custom/edges/useControlPoints.js +3 -3
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +3 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +52 -34
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +7 -10
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +3 -20
- package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +286 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +10 -6
- package/dist/likec4diagram/custom/nodes/nodes.js +30 -8
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +5 -4
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +6 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +14 -9
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +4 -4
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +3 -3
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +16 -36
- package/dist/likec4diagram/relationship-popover/components.d.ts +7 -0
- package/dist/likec4diagram/relationship-popover/components.js +39 -0
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
- package/dist/likec4diagram/state/DiagramActorProvider.js +39 -66
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/createViewChange.js +16 -4
- package/dist/likec4diagram/state/diagram-api.d.ts +11 -0
- package/dist/likec4diagram/state/diagram-api.js +15 -0
- package/dist/likec4diagram/state/machine.actions.d.ts +92 -0
- package/dist/likec4diagram/state/machine.actions.js +127 -58
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +23 -2
- package/dist/likec4diagram/state/machine.actions.layout.js +68 -15
- package/dist/likec4diagram/state/machine.d.ts +1 -1
- package/dist/likec4diagram/state/machine.js +35 -31
- package/dist/likec4diagram/state/machine.setup.d.ts +40 -7
- package/dist/likec4diagram/state/machine.setup.js +13 -4
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +32 -2
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +1 -1
- package/dist/likec4diagram/state/machine.state.navigating.js +82 -50
- package/dist/likec4diagram/state/machine.state.ready.d.ts +565 -579
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +17 -148
- package/dist/likec4diagram/state/machine.state.ready.focused.js +6 -14
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +11 -96
- package/dist/likec4diagram/state/machine.state.ready.idle.js +7 -12
- package/dist/likec4diagram/state/machine.state.ready.js +89 -70
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +4 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +4 -3
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +145 -2
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +29 -21
- package/dist/likec4diagram/state/types.d.ts +1 -1
- package/dist/likec4diagram/state/utils.d.ts +14 -14
- package/dist/likec4diagram/state/utils.js +12 -4
- package/dist/likec4diagram/types.d.ts +11 -3
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +2 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.d.ts +12 -12
- package/dist/likec4diagram/useLayoutConstraints.js +126 -84
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +11 -3
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +7 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.d.ts +7 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +15 -8
- package/dist/navigationpanel/NavigationPanel.js +4 -3
- package/dist/navigationpanel/NavigationPanelControls.js +4 -2
- package/dist/navigationpanel/NavigationPanelDropdown.js +13 -13
- package/dist/navigationpanel/_common.d.ts +1 -1
- package/dist/navigationpanel/_common.js +2 -3
- package/dist/navigationpanel/actor.js +1 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
- package/dist/navigationpanel/comparepanel/ComparePanel.js +155 -29
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -0
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +264 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +4 -5
- package/dist/navigationpanel/controls/DetailsControls.js +7 -7
- package/dist/navigationpanel/controls/LayoutWarning.js +2 -2
- package/dist/navigationpanel/controls/LogoButton.js +1 -1
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.d.ts +1 -2
- package/dist/navigationpanel/controls/SearchControl.js +8 -12
- package/dist/navigationpanel/controls/ToggleReadonly.js +5 -6
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +12 -6
- package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
- package/dist/navigationpanel/editorpanel/styles.js +4 -4
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/styles.css.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +6 -6
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +77 -77
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
- package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/dist/store-1b2fbb72.cjs.js +742 -0
- package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/react/dist/xstate-store-react.cjs.js +175 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +15 -15
- package/dist/overlays/element-details/ElementDetailsCard.js +39 -40
- package/dist/overlays/element-details/MetadataValue.js +11 -12
- package/dist/overlays/element-details/TabPanelDeployments.js +8 -6
- package/dist/overlays/element-details/TabPanelRelationships.css.js +10 -30
- package/dist/overlays/element-details/TabPanelRelationships.js +4 -5
- package/dist/overlays/element-details/TabPanelStructure.css.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +3 -2
- package/dist/overlays/overlaysActor.js +19 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +0 -5
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -4
- package/dist/overlays/relationship-details/SelectEdge.css.js +6 -6
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/compute.js +1 -1
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationship-details/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +0 -5
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +116 -21
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/actor.js +1 -1
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +21 -6
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationships-browser/layout.d.ts +1 -1
- package/dist/overlays/relationships-browser/layout.js +1 -1
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -1
- package/dist/projects-overview/ProjectsOverview.js +2 -2
- package/dist/projects-overview/ProjectsOverviewXY.d.ts +1 -5
- package/dist/projects-overview/ProjectsOverviewXY.js +1 -1
- package/dist/projects-overview/actor.d.ts +1 -1
- package/dist/projects-overview/actor.js +8 -31
- package/dist/projects-overview/context.d.ts +2 -2
- package/dist/projects-overview/context.js +2 -1
- package/dist/projects-overview/custom/nodeTypes.js +1 -1
- package/dist/projects-overview/panel/ProjectsOverviewPanel.js +1 -1
- package/dist/search/Search.d.ts +2 -4
- package/dist/search/Search.js +67 -44
- package/dist/search/components/ElementsColumn.css.js +6 -6
- package/dist/search/components/ElementsColumn.js +93 -60
- package/dist/search/components/PickView.d.ts +3 -1
- package/dist/search/components/PickView.js +12 -7
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +2 -2
- package/dist/search/components/ViewsColum.d.ts +2 -1
- package/dist/search/components/ViewsColum.js +39 -35
- package/dist/search/components/ViewsColumn.css.js +1 -1
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/components/_shared.css.js +12 -12
- package/dist/search/components/utils.js +1 -4
- package/dist/search/hooks.d.ts +1 -6
- package/dist/search/hooks.js +15 -9
- package/dist/search/searchActor.d.ts +12 -2
- package/dist/search/searchActor.js +60 -4
- package/dist/shadowroot/ShadowRoot.d.ts +5 -2
- package/dist/shadowroot/ShadowRoot.js +25 -22
- package/dist/shadowroot/styles.css.d.ts +0 -2
- package/dist/shadowroot/styles.css.js +4 -36
- package/dist/styles-font.css2.js +1 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/view-bounds.d.ts +3 -2
- package/dist/utils/view-bounds.js +10 -6
- package/dist/utils/xyflow.d.ts +27 -6
- package/dist/utils/xyflow.js +68 -23
- package/package.json +39 -37
- package/panda.buildinfo.json +226 -161
- package/styles-font.css +1 -1
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/bundle/index.js +0 -51974
- package/bundle/package.json +0 -4
- package/dist/editor/__tests__/fixture.d.ts +0 -205
- package/dist/editor/editorActor.d.ts +0 -653
- package/dist/likec4diagram/relationship-popover/styles.css.d.ts +0 -2
- package/dist/likec4diagram/relationship-popover/styles.css.js +0 -28
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
- package/dist/overlays/relationships-browser/custom/styles.css.d.ts +0 -1
- package/dist/overlays/relationships-browser/custom/styles.css.js +0 -14
|
@@ -5,13 +5,12 @@ import { Box, HStack } from '@likec4/styles/jsx';
|
|
|
5
5
|
import { hstack } from '@likec4/styles/patterns';
|
|
6
6
|
import { likec4tag } from '@likec4/styles/recipes';
|
|
7
7
|
import { useHover, useDebouncedState } from '@mantine/hooks';
|
|
8
|
-
import { NodeToolbar, Position } from '@xyflow/react';
|
|
8
|
+
import { useStore, NodeToolbar, Position } from '@xyflow/react';
|
|
9
9
|
import { deepEqual } from 'fast-equals';
|
|
10
10
|
import { forwardRef, memo, useEffect, useCallback } from 'react';
|
|
11
|
+
import { hasAtLeast } from 'remeda';
|
|
11
12
|
import { useTagSpecification } from '../../context/TagStylesContext.js';
|
|
12
|
-
import '
|
|
13
|
-
import { useDiagram } from '../../hooks/safeContext.js';
|
|
14
|
-
import { useCurrentZoom } from '../../hooks/useXYFlow.js';
|
|
13
|
+
import { useCurrentZoomAtLeast } from '../../hooks/useXYFlow.js';
|
|
15
14
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
16
15
|
|
|
17
16
|
const ElementTag = forwardRef(
|
|
@@ -42,9 +41,38 @@ const ElementTag = forwardRef(
|
|
|
42
41
|
}
|
|
43
42
|
);
|
|
44
43
|
const propsAreEqual = (prev, next) => {
|
|
45
|
-
return prev.
|
|
44
|
+
return prev.id === next.id && prev.data.width === next.data.width && (prev.data.hovered ?? false) === (next.data.hovered ?? false) && deepEqual(prev.data.tags, next.data.tags);
|
|
46
45
|
};
|
|
47
|
-
const ElementTags = memo(
|
|
46
|
+
const ElementTags = memo(
|
|
47
|
+
({ id, data: { tags, width, hovered = false }, onTagClick, onTagMouseEnter, onTagMouseLeave }) => {
|
|
48
|
+
if (!tags || !hasAtLeast(tags, 1)) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */ jsx(
|
|
52
|
+
WithElementTags,
|
|
53
|
+
{
|
|
54
|
+
id,
|
|
55
|
+
tags,
|
|
56
|
+
width,
|
|
57
|
+
hovered,
|
|
58
|
+
onTagClick,
|
|
59
|
+
onTagMouseEnter,
|
|
60
|
+
onTagMouseLeave
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
},
|
|
64
|
+
propsAreEqual
|
|
65
|
+
);
|
|
66
|
+
ElementTags.displayName = "ElementTags";
|
|
67
|
+
function WithElementTags({
|
|
68
|
+
id,
|
|
69
|
+
tags,
|
|
70
|
+
width,
|
|
71
|
+
hovered,
|
|
72
|
+
onTagClick,
|
|
73
|
+
onTagMouseEnter,
|
|
74
|
+
onTagMouseLeave
|
|
75
|
+
}) {
|
|
48
76
|
const {
|
|
49
77
|
hovered: isTagsBarHovered,
|
|
50
78
|
ref: tagsBarRef
|
|
@@ -62,19 +90,13 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
|
|
|
62
90
|
return hovered || isTagsBarHovered || isTagsToolbarHovered;
|
|
63
91
|
});
|
|
64
92
|
}, [isTagsBarHovered, isTagsToolbarHovered, hovered]);
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
diagram.send({ type: "tag.unhighlight" });
|
|
73
|
-
}, []);
|
|
74
|
-
if (!tags || tags.length === 0) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
const maxWidth = Math.max(Math.round(width * zoom) - 10, 200);
|
|
93
|
+
const zoomIsLargeEnough = useCurrentZoomAtLeast(1.2);
|
|
94
|
+
const maxWidth = useStore(
|
|
95
|
+
useCallback(
|
|
96
|
+
(state) => Math.max(Math.round(width * state.transform[2]) - 10, 200),
|
|
97
|
+
[Math.round(width)]
|
|
98
|
+
)
|
|
99
|
+
);
|
|
78
100
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
79
101
|
/* @__PURE__ */ jsx(
|
|
80
102
|
"div",
|
|
@@ -115,11 +137,11 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
|
|
|
115
137
|
display: "flex",
|
|
116
138
|
alignItems: "center",
|
|
117
139
|
justifyContent: "center",
|
|
118
|
-
maxWidth:
|
|
119
|
-
height:
|
|
140
|
+
maxWidth: "50px",
|
|
141
|
+
height: "5px",
|
|
120
142
|
_whenHovered: {
|
|
121
|
-
height:
|
|
122
|
-
borderRadius:
|
|
143
|
+
height: "12px",
|
|
144
|
+
borderRadius: "sm",
|
|
123
145
|
transitionDelay: ".08s"
|
|
124
146
|
},
|
|
125
147
|
transition: "fast"
|
|
@@ -139,7 +161,9 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
|
|
|
139
161
|
flexWrap: "wrap",
|
|
140
162
|
pb: "sm",
|
|
141
163
|
translate: "auto",
|
|
142
|
-
x: "[-8px]"
|
|
164
|
+
x: "[-8px]"
|
|
165
|
+
},
|
|
166
|
+
style: {
|
|
143
167
|
maxWidth
|
|
144
168
|
},
|
|
145
169
|
children: tags.map((tag) => /* @__PURE__ */ jsx(
|
|
@@ -151,24 +175,23 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
|
|
|
151
175
|
userSelect: "none",
|
|
152
176
|
...zoomIsLargeEnough && {
|
|
153
177
|
fontSize: "lg",
|
|
154
|
-
borderRadius: "
|
|
178
|
+
borderRadius: "sm",
|
|
155
179
|
px: "1.5"
|
|
156
180
|
// 6px
|
|
157
181
|
}
|
|
158
182
|
}),
|
|
159
|
-
onClick: (e) => {
|
|
183
|
+
onClick: onTagClick ? ((e) => {
|
|
160
184
|
e.stopPropagation();
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
onMouseEnter: () =>
|
|
164
|
-
onMouseLeave:
|
|
185
|
+
onTagClick(`#${tag}`);
|
|
186
|
+
}) : void 0,
|
|
187
|
+
onMouseEnter: onTagMouseEnter ? () => onTagMouseEnter(`#${tag}`) : void 0,
|
|
188
|
+
onMouseLeave: onTagMouseLeave ? () => onTagMouseLeave(`#${tag}`) : void 0
|
|
165
189
|
},
|
|
166
190
|
tag
|
|
167
191
|
))
|
|
168
192
|
}
|
|
169
193
|
) })
|
|
170
194
|
] });
|
|
171
|
-
}
|
|
172
|
-
ElementTags.displayName = "ElementTags";
|
|
195
|
+
}
|
|
173
196
|
|
|
174
197
|
export { ElementTag, ElementTags };
|
|
@@ -13,7 +13,7 @@ export { ElementData } from './element/ElementData';
|
|
|
13
13
|
export { ElementDetailsButton } from './element/ElementDetailsButton';
|
|
14
14
|
export { ElementNodeContainer } from './element/ElementNodeContainer';
|
|
15
15
|
export { ElementShape } from './element/ElementShape';
|
|
16
|
-
export { ElementTag, ElementTags } from './element/ElementTags';
|
|
16
|
+
export { ElementTag, type ElementTagProps, ElementTags, type ElementTagsProps } from './element/ElementTags';
|
|
17
17
|
export { Markdown } from './Markdown';
|
|
18
18
|
export { memoEdge } from './memoEdge';
|
|
19
19
|
export { memoNode } from './memoNode';
|
|
@@ -4,7 +4,7 @@ import { memo } from 'react';
|
|
|
4
4
|
const isSame = (a, b) => {
|
|
5
5
|
return Math.abs(a - b) < 2.5;
|
|
6
6
|
};
|
|
7
|
-
const edgePropsEqual = (prev, next) => prev.id === next.id && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.animated ?? false, next.animated ?? false) && deepEqual(prev.source, next.source) &&
|
|
7
|
+
const edgePropsEqual = (prev, next) => prev.id === next.id && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.animated ?? false, next.animated ?? false) && deepEqual(prev.source, next.source) && deepEqual(prev.target, next.target) && isSame(prev.sourceX, next.sourceX) && isSame(prev.sourceY, next.sourceY) && isSame(prev.targetX, next.targetX) && isSame(prev.targetY, next.targetY) && deepEqual(prev.sourceHandleId ?? null, next.sourceHandleId ?? null) && deepEqual(prev.targetHandleId ?? null, next.targetHandleId ?? null) && deepEqual(prev.sourcePosition, next.sourcePosition) && deepEqual(prev.targetPosition, next.targetPosition) && deepEqual(prev.data, next.data);
|
|
8
8
|
function memoEdge(Edge) {
|
|
9
9
|
const Memo = memo(Edge, edgePropsEqual);
|
|
10
10
|
Memo.displayName = `MemoEdge(${Edge.displayName || Edge.name})`;
|
|
@@ -2,7 +2,7 @@ import { deepEqual } from 'fast-equals';
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
|
|
4
4
|
function nodePropsEqual(prev, next) {
|
|
5
|
-
return prev.id === next.id && deepEqual(prev.type, next.type) && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.dragging ?? false, next.dragging ?? false) && deepEqual(prev.width ?? 0, next.width ?? 0) && deepEqual(prev.height ?? 0, next.height ?? 0) && deepEqual(prev.zIndex ?? 0, next.zIndex ?? 0) && deepEqual(prev.data, next.data);
|
|
5
|
+
return prev.id === next.id && deepEqual(prev.type, next.type) && deepEqual(prev.parentId ?? "", next.parentId ?? "") && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.dragging ?? false, next.dragging ?? false) && deepEqual(prev.width ?? 0, next.width ?? 0) && deepEqual(prev.height ?? 0, next.height ?? 0) && deepEqual(prev.zIndex ?? 0, next.zIndex ?? 0) && deepEqual(prev.data, next.data);
|
|
6
6
|
}
|
|
7
7
|
const isMemoized = /* @__PURE__ */ Symbol.for("isMemoized");
|
|
8
8
|
function memoNode(Node, displayName = "Node") {
|
|
@@ -4,7 +4,7 @@ import { HStack, VStack } from '@likec4/styles/jsx';
|
|
|
4
4
|
import { ThemeIcon, Text, ScrollAreaAutosize, Button } from '@mantine/core';
|
|
5
5
|
import { useRef, useEffect } from 'react';
|
|
6
6
|
import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
|
|
7
|
-
import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
7
|
+
import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
8
8
|
|
|
9
9
|
function ErrorFallback({ error, resetErrorBoundary }) {
|
|
10
10
|
const errorString = error instanceof Error ? error.message : "Unknown error";
|
package/dist/components/Link.js
CHANGED
|
@@ -4,8 +4,8 @@ import { styled } from '@likec4/styles/jsx';
|
|
|
4
4
|
import { Badge, CopyButton, ActionIcon } from '@mantine/core';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import { GithubIcon } from './GithubIcon.js';
|
|
7
|
-
import IconCheck from '../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
8
|
-
import IconCopy from '../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
7
|
+
import IconCheck from '../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
|
|
8
|
+
import IconCopy from '../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js';
|
|
9
9
|
|
|
10
10
|
const GITHUB_PREFIX = "https://github.com/";
|
|
11
11
|
const Link = forwardRef(
|
|
@@ -63,7 +63,7 @@ const Link = forwardRef(
|
|
|
63
63
|
}),
|
|
64
64
|
section: css({
|
|
65
65
|
'&:is([data-position="left"])': {
|
|
66
|
-
color: "
|
|
66
|
+
color: "text.dimmed",
|
|
67
67
|
userSelect: "none",
|
|
68
68
|
pointerEvents: "none",
|
|
69
69
|
_groupHover: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ForwardRefComponent, HTMLMotionProps } from 'motion/react';
|
|
2
2
|
import { HTMLAttributes, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
-
import { StyleContextProvider, StyleContextConsumer } from '
|
|
4
|
-
import { NavigationPanelRecipe } from '
|
|
3
|
+
import { StyleContextProvider, StyleContextConsumer } from '@likec4/styles/jsx';
|
|
4
|
+
import { NavigationPanelRecipe } from '@likec4/styles/recipes';
|
|
5
5
|
export declare const NavigationPanel: {
|
|
6
6
|
Root: StyleContextProvider<ForwardRefComponent<"div", HTMLMotionProps<"div">>, NavigationPanelRecipe>;
|
|
7
7
|
Body: StyleContextConsumer<ForwardRefComponent<"div", HTMLMotionProps<"div">>>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { cx
|
|
2
|
+
import { cx } from '@likec4/styles/css';
|
|
3
3
|
import { createStyleContext, isCssProperty } from '@likec4/styles/jsx';
|
|
4
4
|
import { navigationPanel } from '@likec4/styles/recipes';
|
|
5
5
|
import { isValidMotionProp } from 'motion/react';
|
|
6
6
|
import * as m from 'motion/react-m';
|
|
7
7
|
import { forwardRef } from 'react';
|
|
8
|
-
import { Logo as Logo$1 } from './Logo.js';
|
|
8
|
+
import { LogoIcon, Logo as Logo$1 } from './Logo.js';
|
|
9
9
|
|
|
10
10
|
const { withProvider, withContext } = createStyleContext(navigationPanel);
|
|
11
|
-
const shouldForwardProp = (prop, variantKeys) =>
|
|
11
|
+
const shouldForwardProp = (prop, variantKeys) => !variantKeys.includes(prop) && (isValidMotionProp(prop) || !isCssProperty(prop));
|
|
12
12
|
const LogoButton = forwardRef(({ className, ...props }, ref) => {
|
|
13
13
|
return /* @__PURE__ */ jsxs(
|
|
14
14
|
"button",
|
|
@@ -20,29 +20,8 @@ const LogoButton = forwardRef(({ className, ...props }, ref) => {
|
|
|
20
20
|
className
|
|
21
21
|
),
|
|
22
22
|
children: [
|
|
23
|
-
/* @__PURE__ */ jsx("
|
|
24
|
-
/* @__PURE__ */ jsx(
|
|
25
|
-
Logo$1,
|
|
26
|
-
{
|
|
27
|
-
className: css({
|
|
28
|
-
display: {
|
|
29
|
-
base: "none",
|
|
30
|
-
"@/md": "block"
|
|
31
|
-
}
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
),
|
|
35
|
-
/* @__PURE__ */ jsx(
|
|
36
|
-
Logo$1,
|
|
37
|
-
{
|
|
38
|
-
className: css({
|
|
39
|
-
display: {
|
|
40
|
-
base: "block",
|
|
41
|
-
"@/md": "none"
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
}
|
|
45
|
-
)
|
|
23
|
+
/* @__PURE__ */ jsx(LogoIcon, { "data-logo-icon": true }),
|
|
24
|
+
/* @__PURE__ */ jsx(Logo$1, { "data-logo-full": true })
|
|
46
25
|
]
|
|
47
26
|
}
|
|
48
27
|
);
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Portal } from '@mantine/core';
|
|
3
|
-
import {
|
|
4
|
-
import { RootContainerContext } from '../context/RootContainerContext.js';
|
|
3
|
+
import { useRootContainerContext } from '../context/RootContainerContext.js';
|
|
5
4
|
|
|
6
5
|
function PortalToContainer({ children }) {
|
|
7
|
-
const ctx =
|
|
6
|
+
const ctx = useRootContainerContext();
|
|
8
7
|
if (!ctx) {
|
|
9
8
|
throw new Error("PortalToContainer must be used within RootContainer");
|
|
10
9
|
}
|
|
11
|
-
return /* @__PURE__ */ jsx(Portal, { target: ctx.ref.current ??
|
|
10
|
+
return /* @__PURE__ */ jsx(Portal, { target: ctx.ref.current ?? ctx.selector, children });
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
export { PortalToContainer };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
|
-
import {
|
|
3
|
+
import { useStore } from '@nanostores/react';
|
|
4
4
|
import { atom } from 'nanostores';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useRef, useState, useMemo } from 'react';
|
|
6
|
+
import { ReduceGraphicsModeProvider, PanningAtomSafeCtx, RootContainerContextProvider } from '../context/RootContainerContext.js';
|
|
7
7
|
|
|
8
8
|
function RootContainer({
|
|
9
9
|
id,
|
|
@@ -11,31 +11,21 @@ function RootContainer({
|
|
|
11
11
|
reduceGraphics = false,
|
|
12
12
|
children
|
|
13
13
|
}) {
|
|
14
|
-
const [mounted, setMounted] = useState(false);
|
|
15
14
|
const ref = useRef(null);
|
|
16
|
-
const $
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
useIsomorphicLayoutEffect(() => {
|
|
21
|
-
setMounted(true);
|
|
22
|
-
}, []);
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
return $isPanningRef.current?.subscribe((isPanning) => {
|
|
25
|
-
ref.current?.setAttribute("data-likec4-diagram-panning", isPanning ? "true" : "false");
|
|
26
|
-
});
|
|
27
|
-
}, []);
|
|
28
|
-
const ctx = useMemo(() => ({ id, ref }), [id, ref]);
|
|
29
|
-
return /* @__PURE__ */ jsx(PanningAtomSafeCtx, { value: $isPanningRef.current, children: /* @__PURE__ */ jsx(ReduceGraphicsModeCtx.Provider, { value: reduceGraphics, children: /* @__PURE__ */ jsx(
|
|
15
|
+
const [$isPanning] = useState(() => atom(false));
|
|
16
|
+
const isPanning = useStore($isPanning);
|
|
17
|
+
const ctx = useMemo(() => ({ id, ref, selector: `#${id}` }), [id, ref]);
|
|
18
|
+
return /* @__PURE__ */ jsx(ReduceGraphicsModeProvider, { value: reduceGraphics, children: /* @__PURE__ */ jsx(PanningAtomSafeCtx, { value: $isPanning, children: /* @__PURE__ */ jsx(
|
|
30
19
|
"div",
|
|
31
20
|
{
|
|
32
21
|
id,
|
|
33
22
|
className: cx("likec4-root", className),
|
|
34
23
|
ref,
|
|
24
|
+
"data-likec4-diagram-panning": isPanning,
|
|
35
25
|
...reduceGraphics && {
|
|
36
26
|
["data-likec4-reduced-graphics"]: true
|
|
37
27
|
},
|
|
38
|
-
children:
|
|
28
|
+
children: /* @__PURE__ */ jsx(RootContainerContextProvider, { value: ctx, children })
|
|
39
29
|
}
|
|
40
30
|
) }) });
|
|
41
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
export declare
|
|
3
|
-
export declare
|
|
2
|
+
export declare function ErrorMessage({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function ViewNotFound({ viewId }: {
|
|
4
4
|
viewId: string;
|
|
5
|
-
})
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
3
|
+
function ErrorMessage({ children }) {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
style: {
|
|
8
|
+
margin: "1em 0"
|
|
9
|
+
},
|
|
10
|
+
children: /* @__PURE__ */ jsx(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
style: {
|
|
14
|
+
margin: "0 auto",
|
|
15
|
+
display: "inline-block",
|
|
16
|
+
padding: "2em",
|
|
17
|
+
background: "rgba(250,82,82,.15)",
|
|
18
|
+
color: "#ffa8a8"
|
|
19
|
+
},
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function ViewNotFound({ viewId }) {
|
|
27
|
+
return /* @__PURE__ */ jsxs(ErrorMessage, { children: [
|
|
28
|
+
"View ",
|
|
29
|
+
/* @__PURE__ */ jsx("code", { children: viewId }),
|
|
30
|
+
" not found"
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
29
33
|
|
|
30
34
|
export { ErrorMessage, ViewNotFound };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useCurrentViewId } from '../hooks/useCurrentView.js';
|
|
3
|
+
import { useOptionalLikeC4Model, CurrentViewModelContext } from './LikeC4ModelContext.js';
|
|
4
|
+
|
|
5
|
+
function CurrentViewModelProvider({ children }) {
|
|
6
|
+
const viewId = useCurrentViewId();
|
|
7
|
+
const likec4model = useOptionalLikeC4Model();
|
|
8
|
+
const viewmodel = likec4model?.findView(viewId) ?? null;
|
|
9
|
+
return /* @__PURE__ */ jsx(CurrentViewModelContext, { value: viewmodel, children });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { CurrentViewModelProvider };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { MantineProvider, createTheme, Tooltip, Portal, SegmentedControl } from '@mantine/core';
|
|
3
|
+
|
|
4
|
+
const DefaultTheme = createTheme({
|
|
5
|
+
autoContrast: true,
|
|
6
|
+
primaryColor: "indigo",
|
|
7
|
+
cursorType: "pointer",
|
|
8
|
+
defaultRadius: "sm",
|
|
9
|
+
fontFamily: "var(--likec4-app-font, var(--likec4-app-font-default))",
|
|
10
|
+
headings: {
|
|
11
|
+
fontWeight: "medium",
|
|
12
|
+
sizes: {
|
|
13
|
+
h1: {
|
|
14
|
+
// fontSize: '2rem',
|
|
15
|
+
fontWeight: "bold"
|
|
16
|
+
},
|
|
17
|
+
h2: {
|
|
18
|
+
fontWeight: "medium"
|
|
19
|
+
// fontSize: '1.85rem',
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
fontSizes: {
|
|
24
|
+
xxs: "var(--font-sizes-xxs)",
|
|
25
|
+
xs: "var(--font-sizes-xs)",
|
|
26
|
+
sm: "var(--font-sizes-sm)",
|
|
27
|
+
md: "var(--font-sizes-md)",
|
|
28
|
+
lg: "var(--font-sizes-lg)",
|
|
29
|
+
xl: "var(--font-sizes-xl)"
|
|
30
|
+
},
|
|
31
|
+
spacing: {
|
|
32
|
+
xs: "var(--spacing-xs)",
|
|
33
|
+
sm: "var(--spacing-sm)",
|
|
34
|
+
md: "var(--spacing-md)",
|
|
35
|
+
lg: "var(--spacing-lg)",
|
|
36
|
+
xl: "var(--spacing-xl)"
|
|
37
|
+
},
|
|
38
|
+
components: {
|
|
39
|
+
SegmentedControl: SegmentedControl.extend({
|
|
40
|
+
vars: (theme, props) => ({
|
|
41
|
+
root: {
|
|
42
|
+
// @ts-expect-error
|
|
43
|
+
"--sc-font-size": theme.fontSizes[props.fz ?? props.size]
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}),
|
|
47
|
+
Portal: Portal.extend({
|
|
48
|
+
defaultProps: {
|
|
49
|
+
reuseTargetNode: true
|
|
50
|
+
}
|
|
51
|
+
}),
|
|
52
|
+
Tooltip: Tooltip.extend({
|
|
53
|
+
defaultProps: {
|
|
54
|
+
color: "dark"
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
function DefaultMantineProvider({
|
|
60
|
+
children,
|
|
61
|
+
theme,
|
|
62
|
+
...props
|
|
63
|
+
}) {
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
|
+
MantineProvider,
|
|
66
|
+
{
|
|
67
|
+
defaultColorScheme: "auto",
|
|
68
|
+
theme: theme ?? DefaultTheme,
|
|
69
|
+
...props,
|
|
70
|
+
children
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { DefaultMantineProvider };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { aux } from '@likec4/core/types';
|
|
2
1
|
import { PropsWithChildren, RefObject } from 'react';
|
|
3
2
|
import { LikeC4DiagramEventHandlers } from '../LikeC4Diagram.props';
|
|
4
3
|
type RequiredOrNull<T> = {
|
|
5
4
|
[P in keyof T]-?: NonNullable<T[P]> | null;
|
|
6
5
|
};
|
|
6
|
+
type DiagramEventHandlersRef = RefObject<Required<LikeC4DiagramEventHandlers>>;
|
|
7
7
|
export type DiagramEventHandlersContext = RequiredOrNull<LikeC4DiagramEventHandlers> & {
|
|
8
|
-
handlersRef:
|
|
8
|
+
handlersRef: DiagramEventHandlersRef;
|
|
9
9
|
};
|
|
10
|
-
export declare function DiagramEventHandlers
|
|
11
|
-
handlers: Required<LikeC4DiagramEventHandlers
|
|
10
|
+
export declare function DiagramEventHandlers({ handlers, children, }: PropsWithChildren<{
|
|
11
|
+
handlers: Required<LikeC4DiagramEventHandlers>;
|
|
12
12
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare function useDiagramEventHandlers(): DiagramEventHandlersContext;
|
|
14
|
-
export declare function useDiagramEventHandlersRef
|
|
14
|
+
export declare function useDiagramEventHandlersRef(): DiagramEventHandlersRef;
|
|
15
15
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useSyncedRef } from '@react-hookz/web';
|
|
3
|
-
import { useContext,
|
|
4
|
-
import {
|
|
3
|
+
import { useContext, useMemo, createContext } from 'react';
|
|
4
|
+
import { isFunction, mapToObj, keys } from 'remeda';
|
|
5
5
|
|
|
6
6
|
const defaultHandlers = {
|
|
7
7
|
onNavigateTo: null,
|
|
@@ -18,6 +18,9 @@ const defaultHandlers = {
|
|
|
18
18
|
onLayoutTypeChange: null
|
|
19
19
|
};
|
|
20
20
|
const HandlerNames = keys(defaultHandlers);
|
|
21
|
+
const DiagramEventHandlersRefContext = createContext({
|
|
22
|
+
current: defaultHandlers
|
|
23
|
+
});
|
|
21
24
|
const DiagramEventHandlersReactContext = createContext({
|
|
22
25
|
...mapToObj(HandlerNames, (name) => [name, null]),
|
|
23
26
|
handlersRef: {
|
|
@@ -41,10 +44,13 @@ function DiagramEventHandlers({
|
|
|
41
44
|
}),
|
|
42
45
|
handlersRef
|
|
43
46
|
}), [handlersRef, ...deps]);
|
|
44
|
-
return /* @__PURE__ */ jsx(DiagramEventHandlersReactContext.Provider, { value, children });
|
|
47
|
+
return /* @__PURE__ */ jsx(DiagramEventHandlersRefContext.Provider, { value: handlersRef, children: /* @__PURE__ */ jsx(DiagramEventHandlersReactContext.Provider, { value, children }) });
|
|
45
48
|
}
|
|
46
49
|
function useDiagramEventHandlers() {
|
|
47
50
|
return useContext(DiagramEventHandlersReactContext);
|
|
48
51
|
}
|
|
52
|
+
function useDiagramEventHandlersRef() {
|
|
53
|
+
return useContext(DiagramEventHandlersRefContext);
|
|
54
|
+
}
|
|
49
55
|
|
|
50
|
-
export { DiagramEventHandlers, useDiagramEventHandlers };
|
|
56
|
+
export { DiagramEventHandlers, useDiagramEventHandlers, useDiagramEventHandlersRef };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ExclusiveUnion } from '@likec4/core/types';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
declare const FeatureNames: readonly ["Controls", "Editor", "ReadOnly", "FocusMode", "NavigateTo", "ElementDetails", "RelationshipDetails", "RelationshipBrowser", "Search", "NavigationButtons", "Notations", "DynamicViewWalkthrough", "FitView", "CompareWithLatest", "Notes", "Vscode", "ElementTags"];
|
|
4
5
|
export type FeatureName = typeof FeatureNames[number];
|
|
5
6
|
export type TogglableFeature = ('ReadOnly' | 'CompareWithLatest') & FeatureName;
|
|
6
7
|
export type EnabledFeatures = {
|
|
@@ -14,9 +15,9 @@ export declare function DiagramFeatures({ children, features, overrides, }: Prop
|
|
|
14
15
|
overrides: {
|
|
15
16
|
overrides: Partial<EnabledFeatures>;
|
|
16
17
|
};
|
|
17
|
-
}>>):
|
|
18
|
+
}>>): JSX.Element;
|
|
18
19
|
export declare namespace DiagramFeatures {
|
|
19
|
-
var Overlays: ({ children }: PropsWithChildren) =>
|
|
20
|
+
var Overlays: ({ children }: PropsWithChildren) => JSX.Element;
|
|
20
21
|
}
|
|
21
22
|
export declare function useEnabledFeatures(): EnabledFeatures;
|
|
22
23
|
export type IfEnabledProps = PropsWithChildren<{
|
|
@@ -43,10 +44,10 @@ export type IfEnabledProps = PropsWithChildren<{
|
|
|
43
44
|
export declare function IfEnabled({ feature, children, and, }: PropsWithChildren<{
|
|
44
45
|
feature: FeatureName;
|
|
45
46
|
and?: boolean;
|
|
46
|
-
}>):
|
|
47
|
+
}>): JSX.Element | null;
|
|
47
48
|
export declare function IfNotEnabled({ feature, children }: PropsWithChildren<{
|
|
48
49
|
feature: FeatureName;
|
|
49
|
-
}>):
|
|
50
|
-
export declare function IfReadOnly({ children }: PropsWithChildren):
|
|
51
|
-
export declare function IfNotReadOnly({ children }: PropsWithChildren):
|
|
50
|
+
}>): JSX.Element | null;
|
|
51
|
+
export declare function IfReadOnly({ children }: PropsWithChildren): JSX.Element | null;
|
|
52
|
+
export declare function IfNotReadOnly({ children }: PropsWithChildren): JSX.Element | null;
|
|
52
53
|
export {};
|