@likec4/diagram 1.45.0 → 1.46.2
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/bundle/index.js +2488 -1959
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +8 -7
- package/dist/LikeC4Diagram.props.d.ts +4 -12
- package/dist/LikeC4ProjectsProvider.js +8 -4
- package/dist/LikeC4View.js +1 -5
- package/dist/ReactLikeC4.d.ts +1 -4
- package/dist/StaticLikeC4Diagram.js +0 -2
- package/dist/base-primitives/NodeHandles.d.ts +2 -1
- package/dist/base-primitives/NodeHandles.js +22 -18
- package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +2 -3
- package/dist/base-primitives/edge/EdgeLabel.js +16 -16
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +5 -4
- package/dist/base-primitives/edge/EdgePath.js +13 -18
- package/dist/base-primitives/element/ElementActionButtons.js +1 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +1 -1
- package/dist/base-primitives/memoNode.js +1 -1
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +2 -2
- package/dist/context/DiagramEventHandlers.js +0 -1
- package/dist/context/DiagramFeatures.d.ts +1 -1
- package/dist/context/DiagramFeatures.js +1 -0
- package/dist/context/EnsureMantine.js +2 -1
- package/dist/context/IconRenderer.js +6 -6
- package/dist/editor/LikeC4EditorProvider.d.ts +22 -0
- package/dist/editor/LikeC4EditorProvider.js +12 -0
- package/dist/editor/__tests__/fixture.d.ts +205 -0
- package/dist/editor/applyChangesToManualLayout.d.ts +8 -0
- package/dist/editor/applyChangesToManualLayout.js +182 -0
- package/dist/editor/editorActor.actions.d.ts +201 -0
- package/dist/editor/editorActor.actions.js +149 -0
- package/dist/editor/editorActor.d.ts +653 -0
- package/dist/editor/editorActor.js +324 -0
- package/dist/editor/hotkeyActor.d.ts +7 -0
- package/dist/editor/hotkeyActor.js +19 -0
- package/dist/editor/index.d.ts +3 -2
- package/dist/editor/useEditorActorLogic.d.ts +565 -0
- package/dist/editor/useEditorActorLogic.js +54 -0
- package/dist/hooks/safeContext.d.ts +3 -2
- package/dist/hooks/safeContext.js +7 -4
- package/dist/hooks/useDiagram.d.ts +4 -2
- package/dist/hooks/useDiagram.js +19 -8
- package/dist/hooks/useDiagramCompareLayout.d.ts +8 -0
- package/dist/hooks/useDiagramCompareLayout.js +22 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/likec4diagram/DiagramXYFlow.js +1 -2
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +1 -5
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +74 -48
- package/dist/likec4diagram/custom/edges/edges.css.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/edges.css.js +30 -24
- package/dist/likec4diagram/custom/edges/useControlPoints.js +2 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +4 -9
- package/dist/likec4diagram/custom/nodes/nodes.js +3 -6
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +127 -14
- package/dist/likec4diagram/state/DiagramActorProvider.js +63 -71
- package/dist/likec4diagram/state/assign.d.ts +4 -1
- package/dist/likec4diagram/state/assign.js +11 -8
- package/dist/likec4diagram/state/createViewChange.js +13 -9
- package/dist/likec4diagram/state/diagram-api.d.ts +20 -2
- package/dist/likec4diagram/state/diagram-api.js +58 -44
- package/dist/likec4diagram/state/hotkeyActor.d.ts +1 -1
- package/dist/likec4diagram/state/hotkeyActor.js +12 -0
- package/dist/likec4diagram/state/machine.actions.d.ts +774 -195
- package/dist/likec4diagram/state/machine.actions.js +185 -74
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +93 -31
- package/dist/likec4diagram/state/machine.actions.layout.js +16 -4
- package/dist/likec4diagram/state/machine.d.ts +5 -4
- package/dist/likec4diagram/state/machine.js +11 -6
- package/dist/likec4diagram/state/machine.setup.d.ts +20 -9
- package/dist/likec4diagram/state/machine.setup.js +18 -3
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +34 -18
- package/dist/likec4diagram/state/machine.state.initializing.js +10 -10
- package/dist/likec4diagram/state/machine.state.navigating.js +28 -9
- package/dist/likec4diagram/state/machine.state.ready.d.ts +1368 -434
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +363 -39
- package/dist/likec4diagram/state/machine.state.ready.focused.js +17 -4
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +104 -38
- package/dist/likec4diagram/state/machine.state.ready.idle.js +14 -5
- package/dist/likec4diagram/state/machine.state.ready.js +13 -90
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +18 -6
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +204 -31
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +14 -1
- package/dist/likec4diagram/state/types.d.ts +6 -2
- package/dist/likec4diagram/state/utils.d.ts +33 -7
- package/dist/likec4diagram/state/utils.js +23 -7
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.js +5 -9
- package/dist/navigationpanel/NavigationPanel.js +6 -9
- package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
- package/dist/navigationpanel/_common.js +1 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +40 -14
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +6 -4
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +2 -2
- package/dist/navigationpanel/controls/DetailsControls.js +2 -2
- package/dist/navigationpanel/controls/LayoutWarning.js +2 -1
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.js +2 -2
- package/dist/navigationpanel/controls/ToggleReadonly.js +25 -17
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- 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/walkthrough/ActiveWalkthroughControls.js +3 -3
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +66 -66
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
- package/dist/overlays/Overlays.js +23 -11
- package/dist/overlays/element-details/ElementDetailsCard.css.js +8 -11
- package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
- package/dist/overlays/element-details/MetadataValue.js +4 -6
- package/dist/overlays/element-details/TabPanelDeployments.js +3 -3
- package/dist/overlays/element-details/TabPanelRelationships.js +12 -7
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/overlaysActor.js +6 -5
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +3 -3
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/search/components/ElementsColumn.js +16 -11
- package/dist/search/components/PickView.js +3 -1
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.d.ts +3 -1
- package/dist/search/components/ViewsColum.js +14 -9
- package/dist/search/components/utils.d.ts +6 -0
- package/dist/search/components/utils.js +4 -1
- package/dist/shadowroot/styles.css.js +6 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/xyflow.d.ts +2 -3
- package/dist/utils/xyflow.js +9 -8
- package/package.json +22 -22
- package/panda.buildinfo.json +61 -80
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/base-primitives/edge/edge.css.d.ts +0 -4
- package/dist/base-primitives/edge/edge.css.js +0 -71
- package/dist/editor/LikeC4EditorContext.d.ts +0 -21
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +0 -46
- package/dist/likec4diagram/state/syncManualLayoutActor.js +0 -309
- package/dist/utils/vector.d.ts +0 -86
- package/dist/utils/vector.js +0 -127
package/dist/hooks/useDiagram.js
CHANGED
|
@@ -3,6 +3,7 @@ import { shallowEqual } from 'fast-equals';
|
|
|
3
3
|
import { useCallback, useRef, useEffect } from 'react';
|
|
4
4
|
import { useDiagramActorRef } from './safeContext.js';
|
|
5
5
|
export { useDiagram } from './safeContext.js';
|
|
6
|
+
import { useCallbackRef } from './useCallbackRef.js';
|
|
6
7
|
|
|
7
8
|
function useDiagramActorSnapshot(selector, compare = shallowEqual) {
|
|
8
9
|
const actorRef = useDiagramActorRef();
|
|
@@ -10,21 +11,31 @@ function useDiagramActorSnapshot(selector, compare = shallowEqual) {
|
|
|
10
11
|
}
|
|
11
12
|
function useDiagramContext(selector, compare = shallowEqual, deps) {
|
|
12
13
|
const actorRef = useDiagramActorRef();
|
|
13
|
-
const
|
|
14
|
+
const selectorRef = useCallbackRef(selector);
|
|
15
|
+
const select = useCallback((s) => selectorRef(s.context), deps ?? []);
|
|
14
16
|
return useSelector(actorRef, select, compare);
|
|
15
17
|
}
|
|
16
|
-
function useOnDiagramEvent(event, callback) {
|
|
18
|
+
function useOnDiagramEvent(event, callback, options) {
|
|
17
19
|
const actorRef = useDiagramActorRef();
|
|
18
|
-
const callbackRef =
|
|
19
|
-
|
|
20
|
+
const callbackRef = useCallbackRef(callback);
|
|
21
|
+
const wasCalled = useRef(false);
|
|
22
|
+
const once = options?.once ?? false;
|
|
20
23
|
useEffect(() => {
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
if (once && wasCalled.current) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
let subscription = actorRef.on(event, (payload) => {
|
|
28
|
+
callbackRef(payload);
|
|
29
|
+
wasCalled.current = true;
|
|
30
|
+
if (once) {
|
|
31
|
+
subscription?.unsubscribe();
|
|
32
|
+
subscription = null;
|
|
33
|
+
}
|
|
23
34
|
});
|
|
24
35
|
return () => {
|
|
25
|
-
subscription
|
|
36
|
+
subscription?.unsubscribe();
|
|
26
37
|
};
|
|
27
|
-
}, [actorRef, event]);
|
|
38
|
+
}, [actorRef, event, once]);
|
|
28
39
|
}
|
|
29
40
|
|
|
30
41
|
export { useDiagramActorRef, useDiagramActorSnapshot, useDiagramContext, useOnDiagramEvent };
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { DiagramActorSnapshot } from '../likec4diagram/state/types';
|
|
2
2
|
import type * as t from '@likec4/core/types';
|
|
3
3
|
declare const selectCompareLayoutState: ({ context }: DiagramActorSnapshot) => {
|
|
4
|
+
hasEditor: false;
|
|
4
5
|
isEnabled: false;
|
|
5
6
|
isEditable: false;
|
|
6
7
|
isActive: false;
|
|
7
8
|
drifts: never[];
|
|
9
|
+
canApplyLatest: boolean;
|
|
8
10
|
layout: t.LayoutType;
|
|
9
11
|
} | {
|
|
12
|
+
hasEditor: boolean;
|
|
10
13
|
isEnabled: true;
|
|
11
14
|
isEditable: boolean;
|
|
12
15
|
isActive: boolean;
|
|
13
16
|
drifts: t.NonEmptyReadonlyArray<t.LayoutedViewDriftReason>;
|
|
17
|
+
canApplyLatest: boolean;
|
|
14
18
|
layout: t.LayoutType;
|
|
15
19
|
};
|
|
16
20
|
type DiagramCompareLayoutState = ReturnType<typeof selectCompareLayoutState>;
|
|
@@ -23,6 +27,10 @@ type DiagramCompareLayoutOps = {
|
|
|
23
27
|
* Switches the layout type between 'auto' and 'manual'.
|
|
24
28
|
*/
|
|
25
29
|
switchLayout: (layoutType: t.LayoutType) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Merges the latest layout into the manual layout.
|
|
32
|
+
*/
|
|
33
|
+
applyLatestToManual: () => void;
|
|
26
34
|
/**
|
|
27
35
|
* Resets the manual layout to its default state.
|
|
28
36
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { nonNullable } from '@likec4/core';
|
|
1
2
|
import { useSelector } from '@xstate/react';
|
|
2
3
|
import { shallowEqual } from 'fast-equals';
|
|
3
4
|
import { deriveToggledFeatures } from '../likec4diagram/state/machine.setup.js';
|
|
@@ -6,12 +7,14 @@ import { useCallbackRef } from './useCallbackRef.js';
|
|
|
6
7
|
|
|
7
8
|
const selectCompareLayoutState = ({ context }) => {
|
|
8
9
|
const drifts = context.view.drifts ?? null;
|
|
9
|
-
if (!context.features.enableCompareWithLatest || !drifts) {
|
|
10
|
+
if (!context.features.enableCompareWithLatest || !drifts || drifts.length === 0) {
|
|
10
11
|
return {
|
|
12
|
+
hasEditor: false,
|
|
11
13
|
isEnabled: false,
|
|
12
14
|
isEditable: false,
|
|
13
15
|
isActive: false,
|
|
14
16
|
drifts: [],
|
|
17
|
+
canApplyLatest: false,
|
|
15
18
|
layout: context.view._layout ?? "auto"
|
|
16
19
|
};
|
|
17
20
|
}
|
|
@@ -20,10 +23,12 @@ const selectCompareLayoutState = ({ context }) => {
|
|
|
20
23
|
enableReadOnly
|
|
21
24
|
} = deriveToggledFeatures(context);
|
|
22
25
|
return {
|
|
26
|
+
hasEditor: context.features.enableEditor,
|
|
23
27
|
isEnabled: true,
|
|
24
28
|
isEditable: !enableReadOnly,
|
|
25
29
|
isActive: enableCompareWithLatest === true,
|
|
26
30
|
drifts,
|
|
31
|
+
canApplyLatest: !drifts.includes("type-changed"),
|
|
27
32
|
layout: context.view._layout ?? "auto"
|
|
28
33
|
};
|
|
29
34
|
};
|
|
@@ -59,7 +64,22 @@ function useDiagramCompareLayout() {
|
|
|
59
64
|
}
|
|
60
65
|
actorRef.send({ type: "layout.resetManualLayout" });
|
|
61
66
|
});
|
|
62
|
-
|
|
67
|
+
const applyLatestToManual = useCallbackRef(() => {
|
|
68
|
+
if (!state.isEnabled) {
|
|
69
|
+
console.warn("Compare with latest feature is not enabled");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const editor = nonNullable(actorRef.system?.get("editor"), "editor actor not found");
|
|
73
|
+
editor.send({ type: "applyLatestToManual" });
|
|
74
|
+
if (state.isActive) {
|
|
75
|
+
actorRef.send({
|
|
76
|
+
type: "toggle.feature",
|
|
77
|
+
feature: "CompareWithLatest",
|
|
78
|
+
forceValue: false
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return [state, { toggleCompare, switchLayout, resetManualLayout, applyLatestToManual }];
|
|
63
83
|
}
|
|
64
84
|
|
|
65
85
|
export { useDiagramCompareLayout };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { IconRendererProvider } from './context/IconRenderer';
|
|
|
2
2
|
export { LikeC4Diagram, type LikeC4DiagramProps, } from './LikeC4Diagram';
|
|
3
3
|
export type { ElementIconRenderer, ElementIconRendererProps, LikeC4ColorScheme, NodeRenderers, OnCanvasClick, OnChange, OnEdgeClick, OnInitialized, OnNavigateTo, OnNodeClick, OnOpenSource, PaddingWithUnit, ViewPadding, WhereOperator, } from './LikeC4Diagram.props';
|
|
4
4
|
export { LikeC4ModelProvider, type LikeC4ModelProviderProps, } from './LikeC4ModelProvider';
|
|
5
|
+
export { type LikeC4EditorPort, LikeC4EditorProvider, type LikeC4EditorProviderProps, } from './editor/LikeC4EditorProvider';
|
|
5
6
|
export { LikeC4ProjectsProvider, type LikeC4ProjectsProviderProps, } from './LikeC4ProjectsProvider';
|
|
6
7
|
export { type DiagramApi, type DiagramContext, useDiagram, useDiagramContext, useOnDiagramEvent, } from './hooks/useDiagram';
|
|
7
8
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel, } from './hooks/useLikeC4Model';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { IconRendererProvider } from './context/IconRenderer.js';
|
|
2
2
|
export { LikeC4Diagram } from './LikeC4Diagram.js';
|
|
3
3
|
export { LikeC4ModelProvider } from './LikeC4ModelProvider.js';
|
|
4
|
+
export { LikeC4EditorProvider } from './editor/LikeC4EditorProvider.js';
|
|
4
5
|
export { LikeC4ProjectsProvider } from './LikeC4ProjectsProvider.js';
|
|
5
6
|
export { useDiagramContext, useOnDiagramEvent } from './hooks/useDiagram.js';
|
|
6
7
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from './hooks/useLikeC4Model.js';
|
|
@@ -45,9 +45,8 @@ function prepareNodeTypes(nodeTypes) {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
const selectXYProps = ({ context: ctx, children }) => {
|
|
48
|
-
ctx.toggledFeatures;
|
|
49
48
|
const { enableReadOnly } = deriveToggledFeatures(ctx);
|
|
50
|
-
const isNotEditingEdge = enableReadOnly || children.
|
|
49
|
+
const isNotEditingEdge = enableReadOnly || children.editor?.getSnapshot().context.editing !== "edge";
|
|
51
50
|
return {
|
|
52
51
|
enableReadOnly,
|
|
53
52
|
initialized: ctx.initialized.xydata && ctx.initialized.xyflow,
|
|
@@ -18,15 +18,11 @@ function EdgeDrifts({
|
|
|
18
18
|
pointerEvents: "none",
|
|
19
19
|
stroke: "likec4.compare.manual.outline",
|
|
20
20
|
fill: "none",
|
|
21
|
-
mixBlendMode: "plus-lighter",
|
|
22
21
|
strokeWidth: {
|
|
23
22
|
base: "8px",
|
|
24
23
|
_whenHovered: "12px"
|
|
25
24
|
},
|
|
26
|
-
strokeOpacity:
|
|
27
|
-
base: 0.3,
|
|
28
|
-
_whenHovered: 0.5
|
|
29
|
-
}
|
|
25
|
+
strokeOpacity: 0.5
|
|
30
26
|
})
|
|
31
27
|
),
|
|
32
28
|
d: svgPath,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { cx } from '@likec4/styles/css';
|
|
2
|
+
import { css, cx } from '@likec4/styles/css';
|
|
3
3
|
import { EdgeLabelRenderer } from '@xyflow/react';
|
|
4
4
|
import { useState, useRef, useEffect } from 'react';
|
|
5
|
-
import { ZIndexes } from '../../../base/const.js';
|
|
6
5
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
7
6
|
import { useCallbackRef } from '../../../hooks/useCallbackRef.js';
|
|
8
7
|
import '@xstate/react';
|
|
@@ -12,7 +11,7 @@ import { useUpdateEffect } from '../../../hooks/useUpdateEffect.js';
|
|
|
12
11
|
import { useXYFlow, useXYStoreApi } from '../../../hooks/useXYFlow.js';
|
|
13
12
|
import { isSamePoint } from '../../../utils/xyflow.js';
|
|
14
13
|
import { EdgeDrifts } from './EdgeDrifts.js';
|
|
15
|
-
import {
|
|
14
|
+
import { controlPointsContainer, controlPoint } from './edges.css.js';
|
|
16
15
|
import { useControlPoints } from './useControlPoints.js';
|
|
17
16
|
import { useRelationshipEdgePath } from './useRelationshipEdgePath.js';
|
|
18
17
|
import { memoEdge } from '../../../base-primitives/memoEdge.js';
|
|
@@ -45,14 +44,12 @@ const RelationshipEdge = memoEdge((props) => {
|
|
|
45
44
|
id,
|
|
46
45
|
selected = false,
|
|
47
46
|
data: {
|
|
48
|
-
hovered = false,
|
|
49
|
-
active = false,
|
|
50
47
|
labelBBox,
|
|
51
48
|
labelXY,
|
|
52
49
|
...data
|
|
53
50
|
}
|
|
54
51
|
} = props;
|
|
55
|
-
const navigateTo = enableNavigateTo ? data.navigateTo : void 0;
|
|
52
|
+
const navigateTo = enableNavigateTo && !isControlPointDragging ? data.navigateTo : void 0;
|
|
56
53
|
const {
|
|
57
54
|
controlPoints,
|
|
58
55
|
setControlPoints,
|
|
@@ -127,7 +124,7 @@ const RelationshipEdge = memoEdge((props) => {
|
|
|
127
124
|
if (e.pointerType !== "mouse") {
|
|
128
125
|
return;
|
|
129
126
|
}
|
|
130
|
-
if (e.button !== 2) {
|
|
127
|
+
if (e.button !== 2 && !selected) {
|
|
131
128
|
return;
|
|
132
129
|
}
|
|
133
130
|
e.stopPropagation();
|
|
@@ -155,53 +152,65 @@ const RelationshipEdge = memoEdge((props) => {
|
|
|
155
152
|
};
|
|
156
153
|
}
|
|
157
154
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
158
|
-
/* @__PURE__ */ jsxs(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
isDragging: isControlPointDragging,
|
|
166
|
-
...enabledEditing && {
|
|
167
|
-
onEdgePointerDown
|
|
155
|
+
/* @__PURE__ */ jsxs(
|
|
156
|
+
EdgeContainer,
|
|
157
|
+
{
|
|
158
|
+
...props,
|
|
159
|
+
className: css({
|
|
160
|
+
"& .react-flow__edge-interaction": {
|
|
161
|
+
cursor: enabledEditing && selected ? "copy" : void 0
|
|
168
162
|
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
163
|
+
}),
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ jsx(
|
|
166
|
+
EdgePath,
|
|
167
|
+
{
|
|
168
|
+
edgeProps: props,
|
|
169
|
+
svgPath: edgePath,
|
|
170
|
+
ref: svgPathRef,
|
|
171
|
+
isDragging: isControlPointDragging,
|
|
172
|
+
...enabledEditing && {
|
|
173
|
+
onEdgePointerDown
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
enableCompareWithLatest && /* @__PURE__ */ jsx(
|
|
178
|
+
EdgeDrifts,
|
|
179
|
+
{
|
|
180
|
+
edgeProps: props,
|
|
181
|
+
svgPath: edgePath
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
labelBBox && /* @__PURE__ */ jsx(
|
|
185
|
+
EdgeLabelContainer,
|
|
185
186
|
{
|
|
186
|
-
pointerEvents: enabledEditing ? "none" : "all",
|
|
187
187
|
edgeProps: props,
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
labelPosition: isControlPointDragging ? labelPos : { x: labelX, y: labelY },
|
|
189
|
+
children: /* @__PURE__ */ jsx(
|
|
190
|
+
EdgeLabel,
|
|
190
191
|
{
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
pointerEvents: enabledEditing ? "none" : "all",
|
|
193
|
+
edgeProps: props,
|
|
194
|
+
children: navigateTo && /* @__PURE__ */ jsx(
|
|
195
|
+
EdgeActionButton,
|
|
196
|
+
{
|
|
197
|
+
onClick: (e) => {
|
|
198
|
+
e.stopPropagation();
|
|
199
|
+
diagram.navigateTo(navigateTo);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
)
|
|
195
203
|
}
|
|
196
204
|
)
|
|
197
205
|
}
|
|
198
206
|
)
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
enabledEditing && controlPoints.length > 0 &&
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
),
|
|
210
|
+
enabledEditing && controlPoints.length > 0 && /* @__PURE__ */ jsx(
|
|
203
211
|
ControlPoints,
|
|
204
212
|
{
|
|
213
|
+
isControlPointDragging,
|
|
205
214
|
edgeProps: props,
|
|
206
215
|
controlPoints,
|
|
207
216
|
onMove: setControlPoints,
|
|
@@ -209,13 +218,14 @@ const RelationshipEdge = memoEdge((props) => {
|
|
|
209
218
|
onCancelMove: onControlPointerCancelMove,
|
|
210
219
|
onFinishMove: onControlPointerFinishMove,
|
|
211
220
|
onDelete: onControlPointerDelete,
|
|
212
|
-
zIndex:
|
|
221
|
+
zIndex: 9999
|
|
213
222
|
}
|
|
214
223
|
)
|
|
215
224
|
] });
|
|
216
225
|
});
|
|
217
226
|
RelationshipEdge.displayName = "RelationshipEdge";
|
|
218
227
|
function ControlPoints({
|
|
228
|
+
isControlPointDragging,
|
|
219
229
|
edgeProps,
|
|
220
230
|
controlPoints,
|
|
221
231
|
onMove,
|
|
@@ -296,7 +306,7 @@ function ControlPoints({
|
|
|
296
306
|
}, 10);
|
|
297
307
|
};
|
|
298
308
|
const onControlPointerDown = useCallbackRef((e) => {
|
|
299
|
-
const { domNode, addSelectedEdges } = xyflowStore.getState();
|
|
309
|
+
const { domNode, addSelectedEdges, edges, unselectNodesAndEdges } = xyflowStore.getState();
|
|
300
310
|
if (!domNode || e.pointerType !== "mouse") {
|
|
301
311
|
return;
|
|
302
312
|
}
|
|
@@ -307,6 +317,9 @@ function ControlPoints({
|
|
|
307
317
|
switch (e.button) {
|
|
308
318
|
case 0: {
|
|
309
319
|
e.stopPropagation();
|
|
320
|
+
unselectNodesAndEdges({
|
|
321
|
+
edges: edges.filter((ed) => ed.selected && ed.id !== edgeId)
|
|
322
|
+
});
|
|
310
323
|
addSelectedEdges([edgeId]);
|
|
311
324
|
onLmbControlPointerDown(index, e, domNode);
|
|
312
325
|
break;
|
|
@@ -316,6 +329,17 @@ function ControlPoints({
|
|
|
316
329
|
break;
|
|
317
330
|
}
|
|
318
331
|
});
|
|
332
|
+
const onControlPointerDblClick = useCallbackRef((e) => {
|
|
333
|
+
const { domNode } = xyflowStore.getState();
|
|
334
|
+
if (!domNode || e.pointerType !== "mouse") {
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
const index = parseFloat(e.currentTarget.getAttribute("data-control-point-index") || "");
|
|
338
|
+
if (isNaN(index)) {
|
|
339
|
+
throw new Error("data-control-point-index is not a number");
|
|
340
|
+
}
|
|
341
|
+
onRmbControlPointerDown(index, e);
|
|
342
|
+
});
|
|
319
343
|
return /* @__PURE__ */ jsx(EdgeLabelRenderer, { children: /* @__PURE__ */ jsx(
|
|
320
344
|
EdgeContainer,
|
|
321
345
|
{
|
|
@@ -329,16 +353,18 @@ function ControlPoints({
|
|
|
329
353
|
children: /* @__PURE__ */ jsx(
|
|
330
354
|
"g",
|
|
331
355
|
{
|
|
356
|
+
"data-active": isControlPointDragging ? true : void 0,
|
|
357
|
+
className: "group",
|
|
332
358
|
onContextMenu: stopAndPrevent,
|
|
333
359
|
children: controlPoints.map((p, i) => /* @__PURE__ */ jsx(
|
|
334
360
|
"circle",
|
|
335
361
|
{
|
|
336
362
|
"data-control-point-index": i,
|
|
337
363
|
onPointerDownCapture: onControlPointerDown,
|
|
364
|
+
onDoubleClick: onControlPointerDblClick,
|
|
338
365
|
className: cx("nodrag nopan", controlPoint),
|
|
339
366
|
cx: p.x,
|
|
340
|
-
cy: p.y
|
|
341
|
-
r: 3
|
|
367
|
+
cy: p.y
|
|
342
368
|
},
|
|
343
369
|
"controlPoints" + edgeId + "#" + i
|
|
344
370
|
))
|
|
@@ -6,38 +6,44 @@ const controlPointsContainer = css({
|
|
|
6
6
|
pointerEvents: "none",
|
|
7
7
|
top: "0",
|
|
8
8
|
left: "0",
|
|
9
|
-
mixBlendMode:
|
|
9
|
+
mixBlendMode: {
|
|
10
|
+
_dark: "screen",
|
|
11
|
+
_light: "multiply"
|
|
12
|
+
}
|
|
10
13
|
});
|
|
11
14
|
const controlPoint = css({
|
|
12
|
-
fill: `var(--
|
|
13
|
-
stroke: `
|
|
14
|
-
fillOpacity: 0.
|
|
15
|
-
strokeWidth:
|
|
15
|
+
fill: `[var(--xy-edge-stroke)]`,
|
|
16
|
+
stroke: `transparent`,
|
|
17
|
+
fillOpacity: 0.5,
|
|
18
|
+
strokeWidth: 10,
|
|
19
|
+
r: 4,
|
|
16
20
|
cursor: "grab",
|
|
17
|
-
pointerEvents: "
|
|
21
|
+
pointerEvents: "all",
|
|
18
22
|
visibility: "hidden",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
transition: "stroke 100ms ease-out, stroke-width 100ms ease-out"
|
|
24
|
-
},
|
|
23
|
+
transitionDuration: "120ms",
|
|
24
|
+
transitionProperty: "visibility, fill, fill-opacity, r",
|
|
25
|
+
transitionTimingFunction: "inOut",
|
|
26
|
+
transitionDelay: "20ms",
|
|
25
27
|
[`:where([data-likec4-selected='true'], [data-likec4-hovered='true']) &`]: {
|
|
26
28
|
visibility: "visible",
|
|
27
|
-
transition: "fill-opacity 150ms ease-out, stroke 150ms ease-out, stroke-width 150ms ease-out",
|
|
28
|
-
transitionDelay: "50ms",
|
|
29
29
|
fillOpacity: 1,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
transitionTimingFunction: "out",
|
|
31
|
+
transitionDelay: "0ms"
|
|
32
|
+
},
|
|
33
|
+
[`:where([data-likec4-selected='true']) &`]: {
|
|
34
|
+
r: 6
|
|
35
|
+
},
|
|
36
|
+
[`:is([data-likec4-hovered='true']) &`]: {
|
|
37
|
+
r: 8
|
|
38
|
+
},
|
|
39
|
+
_hover: {
|
|
40
|
+
fill: "mantine.colors.primary.filledHover",
|
|
41
|
+
r: 10,
|
|
42
|
+
transitionDuration: "100ms"
|
|
37
43
|
},
|
|
38
|
-
|
|
39
|
-
cursor: "grabbing
|
|
44
|
+
_groupActive: {
|
|
45
|
+
cursor: "grabbing"
|
|
40
46
|
}
|
|
41
47
|
});
|
|
42
48
|
|
|
43
|
-
export {
|
|
49
|
+
export { controlPoint, controlPointsContainer };
|
|
@@ -2,7 +2,7 @@ import { deepEqual } from 'fast-equals';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { useCallbackRef } from '../../../hooks/useCallbackRef.js';
|
|
4
4
|
import { useUpdateEffect } from '../../../hooks/useUpdateEffect.js';
|
|
5
|
-
import { vector } from '
|
|
5
|
+
import { vector } from '@likec4/core/geometry';
|
|
6
6
|
import { bezierControlPoints } from '../../../utils/xyflow.js';
|
|
7
7
|
|
|
8
8
|
function useControlPoints({
|
|
@@ -36,7 +36,7 @@ function useControlPoints({
|
|
|
36
36
|
for (let i = 0; i < points.length - 1; i++) {
|
|
37
37
|
const a = points[i], b = points[i + 1], fromCurrentToNext = b.subtract(a), fromCurrentToNew = newPointV.subtract(a), fromNextToNew = newPointV.subtract(b);
|
|
38
38
|
if (fromCurrentToNext.dot(fromCurrentToNew) * fromCurrentToNext.dot(fromNextToNew) < 0) {
|
|
39
|
-
const distanceToEdge = Math.abs(fromCurrentToNext.cross(fromCurrentToNew)
|
|
39
|
+
const distanceToEdge = Math.abs(fromCurrentToNext.cross(fromCurrentToNew)) / fromCurrentToNext.length();
|
|
40
40
|
if (distanceToEdge < minDistance) {
|
|
41
41
|
minDistance = distanceToEdge;
|
|
42
42
|
insertionIndex = i;
|
|
@@ -5,8 +5,8 @@ import { hasAtLeast } from 'remeda';
|
|
|
5
5
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
6
6
|
import '@xstate/react';
|
|
7
7
|
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
8
|
-
import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
9
|
-
import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
8
|
+
import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
9
|
+
import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
|
|
10
10
|
import { ElementActionButtons } from '../../../base-primitives/element/ElementActionButtons.js';
|
|
11
11
|
|
|
12
12
|
const compareElementActionsProps = (a, b) => {
|
|
@@ -17,17 +17,12 @@ function NodeDrifts({
|
|
|
17
17
|
{
|
|
18
18
|
className: "likec4-node-drifts",
|
|
19
19
|
css: {
|
|
20
|
-
|
|
21
|
-
inset: "0",
|
|
22
|
-
pointerEvents: "none",
|
|
20
|
+
display: "contents",
|
|
23
21
|
"& + .likec4-element-shape": {
|
|
24
22
|
outlineColor: "likec4.compare.manual.outline",
|
|
25
|
-
outlineWidth:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
outlineStyle: "solid",
|
|
30
|
-
outlineOffset: "1"
|
|
23
|
+
outlineWidth: "4px",
|
|
24
|
+
outlineStyle: "dashed",
|
|
25
|
+
outlineOffset: "1.5"
|
|
31
26
|
}
|
|
32
27
|
},
|
|
33
28
|
children: /* @__PURE__ */ jsx(NodeToolbar, { isVisible: data.hovered === true, align: "start", position: toolbarPosition, children: /* @__PURE__ */ jsx(
|
|
@@ -78,12 +78,9 @@ function DeploymentNode(props) {
|
|
|
78
78
|
}
|
|
79
79
|
const compoundHasDrifts = css({
|
|
80
80
|
outlineColor: "likec4.compare.manual.outline",
|
|
81
|
-
outlineWidth:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
outlineStyle: "solid",
|
|
86
|
-
outlineOffset: "1"
|
|
81
|
+
outlineWidth: "4px",
|
|
82
|
+
outlineStyle: "dashed",
|
|
83
|
+
outlineOffset: "1.5"
|
|
87
84
|
});
|
|
88
85
|
const hasDrifts = (props) => {
|
|
89
86
|
return props.data.drifts && props.data.drifts.length > 0;
|
|
@@ -7,8 +7,8 @@ import { GoToSourceButton, BrowseRelationshipsButton } from './_shared.js';
|
|
|
7
7
|
import { ColorButton } from './ColorButton.js';
|
|
8
8
|
import { Toolbar } from './Toolbar.js';
|
|
9
9
|
import { useHandlers } from './useHandlers.js';
|
|
10
|
-
import IconSelector from '../../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
11
|
-
import IconCheck from '../../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
10
|
+
import IconSelector from '../../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
|
|
11
|
+
import IconCheck from '../../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
|
|
12
12
|
|
|
13
13
|
function ElementToolbar(props) {
|
|
14
14
|
const { enableVscode, enableRelationshipBrowser } = useEnabledFeatures();
|
|
@@ -5,8 +5,8 @@ import 'fast-equals';
|
|
|
5
5
|
import 'react';
|
|
6
6
|
import { useDiagram } from '../../../../hooks/safeContext.js';
|
|
7
7
|
import { useDiagramEventHandlers } from '../../../../context/DiagramEventHandlers.js';
|
|
8
|
-
import IconFileSymlink from '../../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
9
|
-
import IconTransform from '../../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
8
|
+
import IconFileSymlink from '../../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
|
|
9
|
+
import IconTransform from '../../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
|
|
10
10
|
|
|
11
11
|
const Tooltip = Tooltip$1.withProps({
|
|
12
12
|
color: "dark",
|