@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
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BBox } from '@likec4/core/geometry';
|
|
2
|
+
import { DiagramEdge, DynamicViewDisplayVariant, LayoutedView } from '@likec4/core/types';
|
|
2
3
|
/**
|
|
3
4
|
* Picks appropriate bounds from the view,
|
|
4
5
|
* depending on its type and dynamic variant
|
|
5
6
|
*/
|
|
6
7
|
export declare function pickViewBounds(view: LayoutedView, dynamicVariant?: DynamicViewDisplayVariant): BBox;
|
|
7
|
-
export declare function calcEdgeBounds({ points, controlPoints, labelBBox }: DiagramEdge): BBox;
|
|
8
|
+
export declare function calcEdgeBounds({ points, controlPoints, labelBBox }: Pick<DiagramEdge, 'points' | 'controlPoints' | 'labelBBox'>): BBox;
|
|
8
9
|
export declare function calcViewBounds({ nodes, edges }: Pick<LayoutedView, 'nodes' | 'edges'>): BBox;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { invariant } from '@likec4/core';
|
|
2
|
+
import { BBox } from '@likec4/core/geometry';
|
|
2
3
|
|
|
3
4
|
function pickViewBounds(view, dynamicVariant) {
|
|
4
5
|
if (view._type === "dynamic") {
|
|
5
6
|
try {
|
|
6
|
-
dynamicVariant
|
|
7
|
-
if (
|
|
7
|
+
const variant = dynamicVariant ?? view.variant;
|
|
8
|
+
if (variant === "sequence") {
|
|
9
|
+
invariant(view.sequenceLayout, "Sequence layout is not available");
|
|
10
|
+
invariant(view.sequenceLayout.bounds, "Sequence layout bounds are not available");
|
|
8
11
|
return view.sequenceLayout.bounds;
|
|
9
12
|
}
|
|
10
|
-
} catch {
|
|
13
|
+
} catch (error) {
|
|
14
|
+
console.error(error);
|
|
11
15
|
}
|
|
12
16
|
}
|
|
13
17
|
return view.bounds;
|
|
@@ -49,9 +53,9 @@ function calcViewBounds({ nodes, edges }) {
|
|
|
49
53
|
return BBox.expand(
|
|
50
54
|
BBox.merge(
|
|
51
55
|
...nodes,
|
|
52
|
-
...edges.map(calcEdgeBounds)
|
|
56
|
+
...edges.map(calcEdgeBounds).filter((box) => isFinite(box.x) && isFinite(box.y))
|
|
53
57
|
),
|
|
54
|
-
|
|
58
|
+
20
|
|
55
59
|
);
|
|
56
60
|
}
|
|
57
61
|
|
package/dist/utils/xyflow.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { NonEmptyArray, Point
|
|
1
|
+
import { NonEmptyArray, Point } from '@likec4/core';
|
|
2
|
+
import { XYPoint, BBox } from '@likec4/core/geometry';
|
|
2
3
|
import { InternalNode, Rect, XYPosition, Position } from '@xyflow/react';
|
|
3
|
-
import { NodeHandle } from '@xyflow/system';
|
|
4
|
+
import { NodeHandle, Padding as XYFlowPadding } from '@xyflow/system';
|
|
4
5
|
import { MouseEvent as ReactMouseEvent } from 'react';
|
|
5
6
|
export declare function distance(a: XYPosition, b: XYPosition): number;
|
|
6
7
|
/**
|
|
@@ -29,7 +30,7 @@ export type MinimalInternalNode = {
|
|
|
29
30
|
export declare function extractMinimalInternalNode<N extends InternalNode>(nd: N): MinimalInternalNode;
|
|
30
31
|
export declare function isEqualMinimalInternalNodes(a: MinimalInternalNode, b: MinimalInternalNode): boolean;
|
|
31
32
|
export declare function isEqualRects(a: Rect, b: Rect): boolean;
|
|
32
|
-
export declare
|
|
33
|
+
export declare function nodeToRect(nd: MinimalInternalNode): Rect;
|
|
33
34
|
export declare function getNodeCenter(node: MinimalInternalNode): XYPosition;
|
|
34
35
|
/**
|
|
35
36
|
* Helper function returns the intersection point
|
|
@@ -40,7 +41,7 @@ export declare function getNodeCenter(node: MinimalInternalNode): XYPosition;
|
|
|
40
41
|
* @param nodeMargin the margin of the intersectionNode. The point will be placed at nodeMargin distance from the border of the node
|
|
41
42
|
* @returns coordinates of the intersection point
|
|
42
43
|
*/
|
|
43
|
-
export declare function getNodeIntersectionFromCenterToPoint(intersectionNode: BBox, target: XYPosition, nodeMargin?: number):
|
|
44
|
+
export declare function getNodeIntersectionFromCenterToPoint(intersectionNode: BBox, target: XYPosition, nodeMargin?: number): XYPosition;
|
|
44
45
|
/**
|
|
45
46
|
* Helper function returns the intersection point
|
|
46
47
|
* of the line between the center of the intersectionNode and the target
|
|
@@ -57,11 +58,31 @@ export declare function getNodeIntersection(intersectionNode: MinimalInternalNod
|
|
|
57
58
|
* @param target - The target rectangle.
|
|
58
59
|
* @returns `true` if the `test` rectangle is completely inside the `target` rectangle, otherwise `false`.
|
|
59
60
|
*/
|
|
60
|
-
export declare
|
|
61
|
-
export declare function bezierControlPoints(points: NonEmptyArray<Point>): NonEmptyArray<
|
|
61
|
+
export declare function isInside(test: Rect, target: Rect): boolean;
|
|
62
|
+
export declare function bezierControlPoints(points: NonEmptyArray<Point>): NonEmptyArray<XYPoint>;
|
|
63
|
+
/**
|
|
64
|
+
* Checks if two points are the same, considering both XYPoint (object ) and Point (tuple) formats.
|
|
65
|
+
* @returns `true` If points are within 2px
|
|
66
|
+
*/
|
|
62
67
|
export declare function isSamePoint(a: XYPosition | Point, b: XYPosition | Point): boolean;
|
|
63
68
|
export declare function distanceBetweenPoints(a: XYPosition, b: XYPosition): number;
|
|
64
69
|
export declare function stopPropagation(e: ReactMouseEvent): void;
|
|
65
70
|
export declare function bezierPath(bezierSpline: NonEmptyArray<Point>): string;
|
|
66
71
|
export declare function toXYFlowPosition(position: 'left' | 'right' | 'top' | 'bottom'): Position;
|
|
67
72
|
export declare function createXYFlowNodeNandles(bbox: BBox): NodeHandle[];
|
|
73
|
+
/**
|
|
74
|
+
* Parses the paddings to an object with top, right, bottom, left, x and y paddings
|
|
75
|
+
* @internal
|
|
76
|
+
* @param padding - Padding to parse
|
|
77
|
+
* @param width - Width of the viewport
|
|
78
|
+
* @param height - Height of the viewport
|
|
79
|
+
* @returns An object with the paddings in pixels
|
|
80
|
+
*/
|
|
81
|
+
export declare function parsePaddings(padding: XYFlowPadding, width: number, height: number): {
|
|
82
|
+
top: number;
|
|
83
|
+
bottom: number;
|
|
84
|
+
left: number;
|
|
85
|
+
right: number;
|
|
86
|
+
x: number;
|
|
87
|
+
y: number;
|
|
88
|
+
};
|
package/dist/utils/xyflow.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { BBox } from '@likec4/core';
|
|
2
|
-
import { vector } from '@likec4/core/geometry';
|
|
1
|
+
import { BBox, vector } from '@likec4/core/geometry';
|
|
3
2
|
import { invariant } from '@likec4/core/utils';
|
|
4
3
|
import '@xyflow/react';
|
|
5
4
|
import { getNodeDimensions } from '@xyflow/system';
|
|
6
5
|
import { Bezier } from 'bezier-js';
|
|
7
6
|
import { isArray, hasAtLeast } from 'remeda';
|
|
8
7
|
|
|
9
|
-
function
|
|
10
|
-
return
|
|
8
|
+
function nodeToRect(nd) {
|
|
9
|
+
return {
|
|
10
|
+
x: Math.trunc(nd.internals.positionAbsolute.x),
|
|
11
|
+
y: Math.trunc(nd.internals.positionAbsolute.y),
|
|
12
|
+
width: Math.round(nd.measured?.width ?? nd.width ?? nd.initialWidth ?? 0),
|
|
13
|
+
height: Math.round(nd.measured?.height ?? nd.height ?? nd.initialHeight ?? 0)
|
|
14
|
+
};
|
|
11
15
|
}
|
|
12
|
-
const nodeToRect = (nd) => ({
|
|
13
|
-
x: Math.round(nd.internals.positionAbsolute.x),
|
|
14
|
-
y: Math.round(nd.internals.positionAbsolute.y),
|
|
15
|
-
width: nd.measured?.width ?? nd.width ?? nd.initialWidth ?? 0,
|
|
16
|
-
height: nd.measured?.height ?? nd.height ?? nd.initialHeight ?? 0
|
|
17
|
-
});
|
|
18
16
|
function getNodeCenter(node) {
|
|
19
17
|
const { width, height } = getNodeDimensions(node);
|
|
20
18
|
const { x, y } = node.internals.positionAbsolute;
|
|
@@ -30,7 +28,7 @@ function getNodeIntersectionFromCenterToPoint(intersectionNode, target, nodeMarg
|
|
|
30
28
|
const xScale = (nodeMargin + width / 2) / v.x;
|
|
31
29
|
const yScale = (nodeMargin + height / 2) / v.y;
|
|
32
30
|
const scale = Math.min(Math.abs(xScale), Math.abs(yScale));
|
|
33
|
-
return vector(v).multiply(scale).add(nodeCenter).
|
|
31
|
+
return vector(v).multiply(scale).add(nodeCenter).trunc().toObject();
|
|
34
32
|
}
|
|
35
33
|
function bezierControlPoints(points) {
|
|
36
34
|
let [start, ...bezierPoints] = points;
|
|
@@ -48,8 +46,8 @@ function bezierControlPoints(points) {
|
|
|
48
46
|
inflections.forEach((t) => {
|
|
49
47
|
const { x, y } = bezier.get(t);
|
|
50
48
|
handles.push({
|
|
51
|
-
x: Math.
|
|
52
|
-
y: Math.
|
|
49
|
+
x: Math.trunc(x),
|
|
50
|
+
y: Math.trunc(y)
|
|
53
51
|
});
|
|
54
52
|
});
|
|
55
53
|
bezierPoints = rest;
|
|
@@ -60,27 +58,74 @@ function bezierControlPoints(points) {
|
|
|
60
58
|
return handles;
|
|
61
59
|
}
|
|
62
60
|
function isSamePoint(a, b) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return Math.hypot(
|
|
61
|
+
if (a === b) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
const [ax, ay] = isArray(a) ? a : [a.x, a.y];
|
|
65
|
+
const [bx, by] = isArray(b) ? b : [b.x, b.y];
|
|
66
|
+
return Math.hypot(bx - ax, by - ay) < 2.1;
|
|
69
67
|
}
|
|
70
68
|
function stopPropagation(e) {
|
|
71
|
-
|
|
69
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
70
|
+
e.stopPropagation();
|
|
72
71
|
}
|
|
72
|
+
const printPoint = (point) => {
|
|
73
|
+
return `${Math.trunc(point[0])},${Math.trunc(point[1])}`;
|
|
74
|
+
};
|
|
73
75
|
function bezierPath(bezierSpline) {
|
|
74
76
|
let [start, ...points] = bezierSpline;
|
|
75
77
|
invariant(start, "start should be defined");
|
|
76
|
-
let path = `M ${start
|
|
78
|
+
let path = `M ${printPoint(start)}`;
|
|
77
79
|
while (hasAtLeast(points, 3)) {
|
|
78
80
|
const [cp1, cp2, end, ...rest] = points;
|
|
79
|
-
path = path + ` C ${cp1
|
|
81
|
+
path = path + ` C ${printPoint(cp1)} ${printPoint(cp2)} ${printPoint(end)}`;
|
|
80
82
|
points = rest;
|
|
81
83
|
}
|
|
82
84
|
invariant(points.length === 0, "all points should be consumed");
|
|
83
85
|
return path;
|
|
84
86
|
}
|
|
87
|
+
function parsePadding(padding, viewport) {
|
|
88
|
+
if (typeof padding === "number") {
|
|
89
|
+
return Math.floor((viewport - viewport / (1 + padding)) * 0.5);
|
|
90
|
+
}
|
|
91
|
+
if (typeof padding === "string" && padding.endsWith("px")) {
|
|
92
|
+
const paddingValue = parseFloat(padding);
|
|
93
|
+
if (!Number.isNaN(paddingValue)) {
|
|
94
|
+
return Math.floor(paddingValue);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (typeof padding === "string" && padding.endsWith("%")) {
|
|
98
|
+
const paddingValue = parseFloat(padding);
|
|
99
|
+
if (!Number.isNaN(paddingValue)) {
|
|
100
|
+
return Math.floor(viewport * paddingValue * 0.01);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
console.error(
|
|
104
|
+
`[React Flow] The padding value "${padding}" is invalid. Please provide a number or a string with a valid unit (px or %).`
|
|
105
|
+
);
|
|
106
|
+
return 0;
|
|
107
|
+
}
|
|
108
|
+
function parsePaddings(padding, width, height) {
|
|
109
|
+
if (typeof padding === "string" || typeof padding === "number") {
|
|
110
|
+
const paddingY = parsePadding(padding, height);
|
|
111
|
+
const paddingX = parsePadding(padding, width);
|
|
112
|
+
return {
|
|
113
|
+
top: paddingY,
|
|
114
|
+
right: paddingX,
|
|
115
|
+
bottom: paddingY,
|
|
116
|
+
left: paddingX,
|
|
117
|
+
x: paddingX * 2,
|
|
118
|
+
y: paddingY * 2
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
if (typeof padding === "object") {
|
|
122
|
+
const top = parsePadding(padding.top ?? padding.y ?? 0, height);
|
|
123
|
+
const bottom = parsePadding(padding.bottom ?? padding.y ?? 0, height);
|
|
124
|
+
const left = parsePadding(padding.left ?? padding.x ?? 0, width);
|
|
125
|
+
const right = parsePadding(padding.right ?? padding.x ?? 0, width);
|
|
126
|
+
return { top, right, bottom, left, x: left + right, y: top + bottom };
|
|
127
|
+
}
|
|
128
|
+
return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 };
|
|
129
|
+
}
|
|
85
130
|
|
|
86
|
-
export { bezierControlPoints, bezierPath,
|
|
131
|
+
export { bezierControlPoints, bezierPath, getNodeCenter, getNodeIntersectionFromCenterToPoint, isSamePoint, nodeToRect, parsePaddings, stopPropagation };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/diagram",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.49.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
6
6
|
"homepage": "https://likec4.dev",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
19
|
-
"bundle",
|
|
20
19
|
"**/package.json",
|
|
21
20
|
"*.css",
|
|
22
21
|
"panda.buildinfo.json",
|
|
23
22
|
"!**/*.spec.*",
|
|
23
|
+
"!**/__*/**",
|
|
24
24
|
"!**/*.d.ts.map"
|
|
25
25
|
],
|
|
26
26
|
"sideEffects": false,
|
|
@@ -38,6 +38,14 @@
|
|
|
38
38
|
"default": "./dist/index.js"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
+
"./adhoc-editor": {
|
|
42
|
+
"sources": "./src/adhoc-editor/index.ts",
|
|
43
|
+
"default": {
|
|
44
|
+
"types": "./dist/adhoc-editor/index.d.ts",
|
|
45
|
+
"import": "./dist/adhoc-editor/index.js",
|
|
46
|
+
"default": "./dist/adhoc-editor/index.js"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
41
49
|
"./custom": {
|
|
42
50
|
"sources": "./src/custom/index.ts",
|
|
43
51
|
"default": {
|
|
@@ -46,14 +54,6 @@
|
|
|
46
54
|
"default": "./dist/custom/index.js"
|
|
47
55
|
}
|
|
48
56
|
},
|
|
49
|
-
"./bundle": {
|
|
50
|
-
"sources": "./src/index.ts",
|
|
51
|
-
"default": {
|
|
52
|
-
"types": "./dist/index.d.ts",
|
|
53
|
-
"import": "./bundle/index.js",
|
|
54
|
-
"default": "./bundle/index.js"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
57
|
"./panda.buildinfo.json": "./panda.buildinfo.json",
|
|
58
58
|
"./styles-min.css": "./styles-min.css",
|
|
59
59
|
"./styles-font.css": "./styles-font.css",
|
|
@@ -63,33 +63,37 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@dagrejs/dagre": "1.1.8",
|
|
66
|
-
"@floating-ui/dom": "^1.7.
|
|
66
|
+
"@floating-ui/dom": "^1.7.5",
|
|
67
67
|
"@lume/kiwi": "^0.4.4",
|
|
68
|
-
"@mantine/core": "8.3.
|
|
69
|
-
"@mantine/hooks": "8.3.
|
|
70
|
-
"@nanostores/react": "1.0.0",
|
|
68
|
+
"@mantine/core": "8.3.14",
|
|
69
|
+
"@mantine/hooks": "8.3.14",
|
|
71
70
|
"@nanostores/media-query": "0.1.2",
|
|
71
|
+
"@nanostores/react": "1.0.0",
|
|
72
72
|
"@react-hookz/web": "^25.2.0",
|
|
73
73
|
"@xstate/react": "6.0.0",
|
|
74
|
+
"@xstate/store": "3.14.0",
|
|
74
75
|
"@xyflow/react": "12.10.0",
|
|
75
76
|
"@xyflow/system": "0.0.74",
|
|
76
|
-
"
|
|
77
|
+
"@zag-js/collection": "^1.33.1",
|
|
78
|
+
"@zag-js/react": "^1.33.1",
|
|
79
|
+
"@zag-js/tree-view": "^1.33.1",
|
|
77
80
|
"bezier-js": "^6.1.4",
|
|
78
81
|
"d3-shape": "^3.2.0",
|
|
82
|
+
"defu": "^6.1.4",
|
|
79
83
|
"fast-equals": "^6.0.0",
|
|
80
|
-
"
|
|
81
|
-
"motion": "^12.
|
|
84
|
+
"immer": "^11.1.3",
|
|
85
|
+
"motion": "^12.33.0",
|
|
82
86
|
"nanostores": "1.1.0",
|
|
83
|
-
"react-error-boundary": "^6.
|
|
87
|
+
"react-error-boundary": "^6.1.0",
|
|
84
88
|
"react-shadow": "^20.6.0",
|
|
85
|
-
"remeda": "^2.
|
|
89
|
+
"remeda": "^2.33.5",
|
|
86
90
|
"type-fest": "^4.41.0",
|
|
87
91
|
"xstate": "5.24.0",
|
|
88
|
-
"@likec4/core": "1.
|
|
89
|
-
"@likec4/styles": "1.
|
|
92
|
+
"@likec4/core": "1.49.0",
|
|
93
|
+
"@likec4/styles": "1.49.0"
|
|
90
94
|
},
|
|
91
95
|
"peerDependencies": {
|
|
92
|
-
"@pandacss/dev": "^1.
|
|
96
|
+
"@pandacss/dev": "^1.8.1",
|
|
93
97
|
"@types/react": "^18.x || ^19.x",
|
|
94
98
|
"@types/react-dom": "^18.x || ^19.x",
|
|
95
99
|
"react": "^18.x || ^19.x",
|
|
@@ -107,33 +111,31 @@
|
|
|
107
111
|
}
|
|
108
112
|
},
|
|
109
113
|
"devDependencies": {
|
|
110
|
-
"@pandacss/dev": "^1.
|
|
114
|
+
"@pandacss/dev": "^1.8.1",
|
|
111
115
|
"@statelyai/inspect": "^0.4.0",
|
|
112
|
-
"@tabler/icons-react": "3.36.
|
|
116
|
+
"@tabler/icons-react": "3.36.1",
|
|
113
117
|
"@types/bezier-js": "^4.1.3",
|
|
114
|
-
"@types/d3-shape": "^3.1.
|
|
115
|
-
"@types/node": "~22.19.
|
|
116
|
-
"@types/react": "19.2.
|
|
118
|
+
"@types/d3-shape": "^3.1.8",
|
|
119
|
+
"@types/node": "~22.19.10",
|
|
120
|
+
"@types/react": "19.2.13",
|
|
117
121
|
"@types/react-dom": "19.2.3",
|
|
118
|
-
"@vitejs/plugin-react": "^5.1.
|
|
119
|
-
"oxlint": "1.
|
|
122
|
+
"@vitejs/plugin-react": "^5.1.3",
|
|
123
|
+
"oxlint": "1.43.0",
|
|
120
124
|
"postcss": "8.5.6",
|
|
121
|
-
"react": "19.2.
|
|
122
|
-
"react-dom": "19.2.
|
|
125
|
+
"react": "19.2.4",
|
|
126
|
+
"react-dom": "19.2.4",
|
|
123
127
|
"typescript": "5.9.3",
|
|
124
|
-
"vite": "^7.3.
|
|
128
|
+
"vite": "^7.3.1",
|
|
125
129
|
"vite-plugin-dts": "^4.5.4",
|
|
126
|
-
"vitest": "4.0.
|
|
130
|
+
"vitest": "4.0.18",
|
|
127
131
|
"wireit": "0.14.12",
|
|
128
132
|
"zx": "8.8.5",
|
|
129
|
-
"@likec4/tsconfig": "1.
|
|
133
|
+
"@likec4/tsconfig": "1.49.0",
|
|
130
134
|
"@likec4/devops": "1.42.0"
|
|
131
135
|
},
|
|
132
136
|
"scripts": {
|
|
133
137
|
"typecheck": "tsc --build --verbose",
|
|
134
|
-
"build
|
|
135
|
-
"build-bundle": "vite build -m bundle",
|
|
136
|
-
"build": "echo \"use pnpm turbo run build\" || true",
|
|
138
|
+
"build": "vite build -m production",
|
|
137
139
|
"pack": "pnpm pack",
|
|
138
140
|
"test": "vitest run --no-isolate",
|
|
139
141
|
"clean": "likec4ops clean",
|