@likec4/diagram 1.42.1 → 1.44.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/bundle/index.js +6198 -4860
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +15 -12
- package/dist/LikeC4Diagram.props.d.ts +28 -14
- package/dist/LikeC4ProjectsProvider.js +1 -1
- package/dist/LikeC4View.d.ts +28 -4
- package/dist/LikeC4View.js +28 -17
- package/dist/ReactLikeC4.d.ts +1 -1
- package/dist/ReactLikeC4.js +5 -7
- package/dist/StaticLikeC4Diagram.js +2 -2
- package/dist/_virtual/_commonjsHelpers.js +3 -0
- package/dist/_virtual/assign-dea9f7c8.cjs.js +3 -0
- package/dist/_virtual/log-ec8d4df4.cjs.js +3 -0
- package/dist/_virtual/raise-da5b247f.cjs.js +3 -0
- package/dist/_virtual/xstate-actions.cjs.js +5 -0
- package/dist/_virtual/xstate-actions.cjs2.js +3 -0
- package/dist/_virtual/xstate-dev.cjs.js +3 -0
- package/dist/_virtual/xstate-guards.cjs.js +5 -0
- package/dist/_virtual/xstate-guards.cjs2.js +3 -0
- package/dist/base/Background.d.ts +2 -1
- package/dist/base/Background.js +11 -2
- package/dist/base/Base.d.ts +28 -0
- package/dist/base/BaseXYFlow.d.ts +5 -5
- package/dist/base/BaseXYFlow.js +38 -44
- package/dist/base/const.d.ts +1 -1
- package/dist/base/const.js +1 -1
- package/dist/base/index.d.ts +6 -2
- package/dist/base/types.d.ts +1 -28
- package/dist/base/updateEdges.js +4 -3
- package/dist/base/updateNodes.js +3 -2
- 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 +4 -0
- package/dist/base-primitives/edge/EdgeLabel.d.ts +1 -0
- package/dist/base-primitives/edge/EdgeLabel.js +2 -0
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +4 -0
- package/dist/base-primitives/edge/EdgePath.d.ts +4 -0
- package/dist/base-primitives/edge/EdgePath.js +9 -5
- package/dist/base-primitives/element/ElementActionButtons.d.ts +3 -2
- package/dist/base-primitives/element/ElementActionButtons.js +1 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +2 -5
- package/dist/base-primitives/element/ElementNodeContainer.css.js +15 -27
- package/dist/base-primitives/element/ElementTags.js +2 -1
- package/dist/base-primitives/memoEdge.js +4 -2
- package/dist/base-primitives/memoNode.d.ts +1 -1
- package/dist/base-primitives/memoNode.js +3 -3
- package/dist/components/ErrorFallback.js +52 -35
- package/dist/components/Link.js +2 -2
- package/dist/context/DiagramEventHandlers.js +2 -1
- package/dist/context/DiagramFeatures.d.ts +24 -6
- package/dist/context/DiagramFeatures.js +28 -56
- package/dist/context/IconRenderer.js +6 -6
- package/dist/context/LikeC4ModelContext.js +3 -10
- package/dist/context/TagStylesContext.js +2 -18
- package/dist/context/index.d.ts +1 -1
- package/dist/custom/customNodes.js +3 -2
- package/dist/custom/hooks.d.ts +1 -1
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +4 -4
- package/dist/editor/LikeC4EditorContext.d.ts +21 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/safeContext.d.ts +6 -3
- package/dist/hooks/safeContext.js +10 -3
- package/dist/hooks/useCallbackRef.d.ts +1 -0
- package/dist/hooks/useCallbackRef.js +13 -0
- package/dist/hooks/useCurrentView.d.ts +11 -0
- package/dist/hooks/{useCurrentViewId.js → useCurrentView.js} +7 -3
- package/dist/hooks/useCurrentViewModel.js +4 -1
- package/dist/hooks/useDiagram.d.ts +7 -113
- package/dist/hooks/useDiagram.js +7 -127
- package/dist/hooks/useDiagramCompareLayout.d.ts +35 -0
- package/dist/hooks/useDiagramCompareLayout.js +60 -0
- package/dist/hooks/useUpdateEffect.js +2 -4
- package/dist/hooks/useXYFlow.d.ts +1 -0
- package/dist/hooks/useXYFlow.js +4 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/dist/likec4diagram/DiagramUI.js +14 -7
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -2
- package/dist/likec4diagram/DiagramXYFlow.js +54 -51
- package/dist/likec4diagram/convert-to-xyflow.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +249 -220
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +7 -2
- package/dist/likec4diagram/custom/edges/edges.css.js +3 -4
- package/dist/likec4diagram/custom/edges/useControlPoints.d.ts +8 -0
- package/dist/likec4diagram/custom/edges/useControlPoints.js +58 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +7 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +60 -0
- package/dist/likec4diagram/custom/edges/utils.d.ts +0 -12
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +4 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.js +15 -10
- package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.d.ts +4 -0
- package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.js +46 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -1
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +9 -1
- package/dist/likec4diagram/custom/nodes/nodes.js +13 -9
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +4 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +1 -11
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +7 -51
- package/dist/likec4diagram/custom/nodes/toolbar/types.d.ts +5 -0
- package/dist/likec4diagram/custom/nodes/toolbar/types.js +7 -0
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.d.ts +8 -0
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.js +44 -0
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +5 -7
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +3 -2
- package/dist/likec4diagram/state/DiagramActorProvider.js +96 -70
- package/dist/likec4diagram/state/assign.d.ts +4 -2
- package/dist/likec4diagram/state/assign.js +39 -103
- package/dist/likec4diagram/state/createViewChange.d.ts +3 -0
- package/dist/likec4diagram/state/createViewChange.js +90 -0
- package/dist/likec4diagram/state/diagram-api.d.ts +113 -0
- package/dist/likec4diagram/state/diagram-api.js +134 -0
- package/dist/likec4diagram/state/hotkeyActor.d.ts +7 -0
- package/dist/likec4diagram/state/hotkeyActor.js +17 -1
- package/dist/likec4diagram/state/machine.actions.d.ts +2099 -0
- package/dist/likec4diagram/state/machine.actions.js +735 -0
- package/dist/likec4diagram/state/machine.d.ts +3717 -0
- package/dist/likec4diagram/state/machine.js +141 -0
- package/dist/likec4diagram/state/machine.setup.d.ts +284 -0
- package/dist/likec4diagram/state/machine.setup.js +71 -0
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +183 -0
- package/dist/likec4diagram/state/machine.state.initializing.js +55 -0
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +117 -0
- package/dist/likec4diagram/state/machine.state.navigating.js +45 -0
- package/dist/likec4diagram/state/machine.state.ready.d.ts +3666 -0
- package/dist/likec4diagram/state/machine.state.ready.js +437 -0
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +220 -63
- package/dist/likec4diagram/state/syncManualLayoutActor.js +218 -143
- package/dist/likec4diagram/state/types.d.ts +4 -7
- package/dist/likec4diagram/state/utils.d.ts +4 -2
- package/dist/likec4diagram/state/utils.js +4 -1
- package/dist/likec4diagram/types.d.ts +6 -1
- package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +2 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +66 -0
- package/dist/likec4diagram/ui/index.d.ts +1 -0
- package/dist/likec4diagram/ui/notation/NotationPanel.js +10 -12
- package/dist/likec4diagram/useLayoutConstraints.d.ts +10 -5
- package/dist/likec4diagram/useLayoutConstraints.js +225 -54
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +0 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +15 -15
- package/dist/navigationpanel/NavigationPanel.js +11 -7
- package/dist/navigationpanel/NavigationPanelControls.d.ts +2 -1
- package/dist/navigationpanel/NavigationPanelControls.js +23 -17
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +2 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +62 -42
- package/dist/navigationpanel/_common.d.ts +1 -1
- package/dist/navigationpanel/_common.js +4 -2
- package/dist/navigationpanel/actor.d.ts +11 -7
- package/dist/navigationpanel/actor.js +5 -4
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -0
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +59 -0
- package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +2 -0
- package/dist/navigationpanel/comparepanel/ComparePanel.js +42 -0
- package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -0
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +60 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +5 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +38 -0
- package/dist/navigationpanel/comparepanel/index.d.ts +1 -0
- package/dist/navigationpanel/controls/{ViewDetailsCard.d.ts → DetailsControls.d.ts} +1 -1
- package/dist/navigationpanel/controls/{ViewDetailsCard.js → DetailsControls.js} +18 -14
- package/dist/navigationpanel/controls/LayoutWarning.d.ts +2 -0
- package/dist/navigationpanel/controls/LayoutWarning.js +102 -0
- package/dist/navigationpanel/controls/NavigationButtons.js +4 -3
- package/dist/navigationpanel/controls/OpenSource.js +2 -2
- package/dist/navigationpanel/controls/SearchControl.d.ts +2 -1
- package/dist/navigationpanel/controls/SearchControl.js +15 -17
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +19 -16
- package/dist/navigationpanel/controls/index.d.ts +2 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -2
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +5 -5
- package/dist/navigationpanel/editorpanel/CenterCamera.js +5 -2
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +21 -20
- package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -2
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +16 -13
- package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -0
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +15 -0
- package/dist/navigationpanel/styles.css.d.ts +2 -2
- package/dist/navigationpanel/styles.css.js +4 -4
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +14 -8
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +10 -10
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +31 -14
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +2 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +66 -49
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/actions/dist/xstate-actions.cjs.js +37 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dev/dist/xstate-dev.cjs.js +59 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/assign-dea9f7c8.cjs.js +140 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/log-ec8d4df4.cjs.js +401 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/raise-da5b247f.cjs.js +2716 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/guards/dist/xstate-guards.cjs.js +26 -0
- package/dist/overlays/element-details/ElementDetails.js +7 -7
- package/dist/overlays/element-details/ElementDetailsCard.js +18 -88
- package/dist/overlays/element-details/MetadataValue.d.ts +9 -0
- package/dist/overlays/element-details/MetadataValue.js +261 -0
- package/dist/overlays/element-details/TabPanelDeployments.js +6 -4
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +3 -2
- package/dist/overlays/overlaysActor.d.ts +304 -62
- package/dist/overlays/overlaysActor.js +132 -131
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/actor.d.ts +14 -2
- package/dist/overlays/relationship-details/actor.js +23 -5
- package/dist/overlays/relationship-details/custom/ElementActions.js +8 -5
- package/dist/overlays/relationship-details/custom/edgeTypes.js +4 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.js +4 -1
- package/dist/overlays/relationship-details/hooks.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -4
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/actor.d.ts +239 -173
- package/dist/overlays/relationships-browser/actor.js +132 -110
- package/dist/overlays/relationships-browser/const.d.ts +3 -3
- package/dist/overlays/relationships-browser/const.js +3 -3
- package/dist/overlays/relationships-browser/custom/ElementActions.js +44 -37
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +4 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +4 -1
- package/dist/overlays/relationships-browser/hooks.js +7 -6
- package/dist/search/Search.js +2 -1
- package/dist/search/components/ElementsColumn.js +5 -3
- package/dist/search/components/PickView.js +1 -1
- package/dist/search/components/SearchByTags.js +21 -44
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +6 -4
- package/dist/shadowroot/ShadowRoot.js +53 -12
- package/dist/shadowroot/styles.css.d.ts +0 -4
- package/dist/shadowroot/styles.css.js +1 -41
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +4 -4
- package/dist/utils/vector.d.ts +78 -21
- package/dist/utils/vector.js +91 -24
- package/dist/utils/view-bounds.d.ts +8 -0
- package/dist/utils/view-bounds.js +57 -0
- package/dist/utils/xyflow.d.ts +49 -7
- package/dist/utils/xyflow.js +63 -11
- package/package.json +28 -27
- package/panda.buildinfo.json +140 -83
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/hooks/useCurrentViewId.d.ts +0 -6
- package/dist/likec4diagram/custom/edges/utils.js +0 -23
- package/dist/likec4diagram/state/diagram-machine.d.ts +0 -2590
- package/dist/likec4diagram/state/diagram-machine.js +0 -1180
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.d.ts +0 -1
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.js +0 -56
- package/dist/utils/get-view-bounds.d.ts +0 -3
- package/dist/utils/get-view-bounds.js +0 -14
- /package/dist/base/{types.js → Base.js} +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
package/dist/base/BaseXYFlow.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
3
|
import { useMantineColorScheme } from '@mantine/core';
|
|
4
|
-
import { useCallbackRef } from '@mantine/hooks';
|
|
5
4
|
import { ReactFlow, useStore } from '@xyflow/react';
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
import { useCallbackRef } from '../hooks/useCallbackRef.js';
|
|
6
7
|
import { useUpdateEffect } from '../hooks/useUpdateEffect.js';
|
|
7
8
|
import { useIsZoomTooSmall, useXYStoreApi } from '../hooks/useXYFlow.js';
|
|
8
9
|
import { roundDpr } from '../utils/roundDpr.js';
|
|
9
10
|
import { stopPropagation } from '../utils/xyflow.js';
|
|
10
11
|
import { Background } from './Background.js';
|
|
12
|
+
import { Base } from './Base.js';
|
|
11
13
|
import { MinZoom, MaxZoom } from './const.js';
|
|
12
|
-
import { Base } from './types.js';
|
|
13
14
|
|
|
14
15
|
function BaseXYFlow({
|
|
15
16
|
nodes,
|
|
@@ -35,6 +36,12 @@ function BaseXYFlow({
|
|
|
35
36
|
onEdgeMouseLeave,
|
|
36
37
|
...props
|
|
37
38
|
}) {
|
|
39
|
+
const fitViewOptions = useMemo(() => ({
|
|
40
|
+
minZoom: MinZoom,
|
|
41
|
+
maxZoom: 1,
|
|
42
|
+
padding: fitViewPadding,
|
|
43
|
+
includeHiddenNodes: false
|
|
44
|
+
}), [fitViewPadding]);
|
|
38
45
|
const isBgWithPattern = background !== "transparent" && background !== "solid";
|
|
39
46
|
const isZoomTooSmall = useIsZoomTooSmall();
|
|
40
47
|
const xystore = useXYStoreApi();
|
|
@@ -64,12 +71,7 @@ function BaseXYFlow({
|
|
|
64
71
|
maxZoom: zoomable ? MaxZoom : 1,
|
|
65
72
|
minZoom: zoomable ? MinZoom : 1,
|
|
66
73
|
fitView,
|
|
67
|
-
fitViewOptions
|
|
68
|
-
minZoom: MinZoom,
|
|
69
|
-
maxZoom: 1,
|
|
70
|
-
padding: fitViewPadding,
|
|
71
|
-
includeHiddenNodes: false
|
|
72
|
-
},
|
|
74
|
+
fitViewOptions,
|
|
73
75
|
preventScrolling: zoomable || pannable,
|
|
74
76
|
defaultMarkerColor: "var(--xy-edge-stroke)",
|
|
75
77
|
noDragClassName: "nodrag",
|
|
@@ -99,57 +101,49 @@ function BaseXYFlow({
|
|
|
99
101
|
}
|
|
100
102
|
onMoveEnd?.(event, { x: roundedX, y: roundedY, zoom });
|
|
101
103
|
}),
|
|
102
|
-
onNodeMouseEnter: useCallbackRef((
|
|
104
|
+
onNodeMouseEnter: useCallbackRef((event, node) => {
|
|
103
105
|
if (onNodeMouseEnter) {
|
|
104
|
-
onNodeMouseEnter(
|
|
106
|
+
onNodeMouseEnter(event, node);
|
|
105
107
|
return;
|
|
106
108
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}]);
|
|
113
|
-
}
|
|
109
|
+
onNodesChange([{
|
|
110
|
+
id: node.id,
|
|
111
|
+
type: "replace",
|
|
112
|
+
item: Base.setHovered(node, true)
|
|
113
|
+
}]);
|
|
114
114
|
}),
|
|
115
|
-
onNodeMouseLeave: useCallbackRef((
|
|
115
|
+
onNodeMouseLeave: useCallbackRef((event, node) => {
|
|
116
116
|
if (onNodeMouseLeave) {
|
|
117
|
-
onNodeMouseLeave(
|
|
117
|
+
onNodeMouseLeave(event, node);
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}]);
|
|
126
|
-
}
|
|
120
|
+
onNodesChange([{
|
|
121
|
+
id: node.id,
|
|
122
|
+
type: "replace",
|
|
123
|
+
item: Base.setHovered(node, false)
|
|
124
|
+
}]);
|
|
127
125
|
}),
|
|
128
|
-
onEdgeMouseEnter: useCallbackRef((
|
|
126
|
+
onEdgeMouseEnter: useCallbackRef((event, edge) => {
|
|
129
127
|
if (onEdgeMouseEnter) {
|
|
130
|
-
onEdgeMouseEnter(
|
|
128
|
+
onEdgeMouseEnter(event, edge);
|
|
131
129
|
return;
|
|
132
130
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}]);
|
|
139
|
-
}
|
|
131
|
+
onEdgesChange([{
|
|
132
|
+
id: edge.id,
|
|
133
|
+
type: "replace",
|
|
134
|
+
item: Base.setHovered(edge, true)
|
|
135
|
+
}]);
|
|
140
136
|
}),
|
|
141
|
-
onEdgeMouseLeave: useCallbackRef((
|
|
137
|
+
onEdgeMouseLeave: useCallbackRef((event, edge) => {
|
|
142
138
|
if (onEdgeMouseLeave) {
|
|
143
|
-
onEdgeMouseLeave(
|
|
139
|
+
onEdgeMouseLeave(event, edge);
|
|
144
140
|
return;
|
|
145
141
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}]);
|
|
152
|
-
}
|
|
142
|
+
onEdgesChange([{
|
|
143
|
+
id: edge.id,
|
|
144
|
+
type: "replace",
|
|
145
|
+
item: Base.setHovered(edge, false)
|
|
146
|
+
}]);
|
|
153
147
|
}),
|
|
154
148
|
onNodeDoubleClick: stopPropagation,
|
|
155
149
|
onEdgeDoubleClick: stopPropagation,
|
package/dist/base/const.d.ts
CHANGED
package/dist/base/const.js
CHANGED
package/dist/base/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
1
|
+
export { Background, type XYBackground, type XYBackgroundProps, type XYBackgroundVariant, } from './Background';
|
|
2
|
+
export { BaseXYFlow, type BaseXYFlowProps, } from './BaseXYFlow';
|
|
3
|
+
export * from './Base';
|
|
3
4
|
export * from './const';
|
|
5
|
+
export * from './types';
|
|
6
|
+
export { updateEdges } from './updateEdges';
|
|
7
|
+
export { updateNodes } from './updateNodes';
|
package/dist/base/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Edge, EdgeProps, Node, NodeProps } from '@xyflow/react';
|
|
2
2
|
import { OptionalKeysOf, SetRequired, Simplify } from 'type-fest';
|
|
3
|
+
import { Base } from './Base';
|
|
3
4
|
export type BaseNodeData = {
|
|
4
5
|
/**
|
|
5
6
|
* Whether the cursor is hovering over the node
|
|
@@ -41,33 +42,6 @@ export type BaseNodePropsWithData<Data extends Record<string, unknown>> = BaseNo
|
|
|
41
42
|
export interface BaseEdgeProps<E extends BaseEdge = BaseEdge> extends EdgeProps<E> {
|
|
42
43
|
}
|
|
43
44
|
export type BaseEdgePropsWithData<Data extends Record<string, unknown>> = BaseEdgeProps<BaseEdge<Data>>;
|
|
44
|
-
type WithDimmed = {
|
|
45
|
-
data: {
|
|
46
|
-
dimmed?: Base.Dimmed;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
type WithHovered = {
|
|
50
|
-
data: {
|
|
51
|
-
hovered?: boolean;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
declare function setDimmed<T extends WithDimmed>(value: T, dimmed: 'immediate' | boolean): T;
|
|
55
|
-
declare function setDimmed(dimmed: 'immediate' | boolean): <T extends WithDimmed>(value: T) => T;
|
|
56
|
-
declare function setHovered<T extends WithHovered>(value: T, hovered: boolean): T;
|
|
57
|
-
declare function setHovered(hovered: boolean): <T extends WithHovered>(value: T) => T;
|
|
58
|
-
type WithData<D> = {
|
|
59
|
-
data: D;
|
|
60
|
-
};
|
|
61
|
-
declare function setData<E extends WithData<any>>(value: E, state: Partial<E['data']>): E;
|
|
62
|
-
declare function setData<E extends WithData<any>>(state: Partial<E['data']>): (value: E) => E;
|
|
63
|
-
export declare const Base: {
|
|
64
|
-
setDimmed: typeof setDimmed;
|
|
65
|
-
setHovered: typeof setHovered;
|
|
66
|
-
setData: typeof setData;
|
|
67
|
-
};
|
|
68
|
-
export declare namespace Base {
|
|
69
|
-
type Dimmed = 'immediate' | boolean;
|
|
70
|
-
}
|
|
71
45
|
/**
|
|
72
46
|
* To cooperate with `exactOptionalPropertyTypes` in `tsconfig.json`
|
|
73
47
|
*
|
|
@@ -90,4 +64,3 @@ export type NonOptional<T extends object, Keys extends OptionalKeysOf<T> = Optio
|
|
|
90
64
|
} & {
|
|
91
65
|
[P in Keys]-?: T[P] | undefined;
|
|
92
66
|
}>;
|
|
93
|
-
export {};
|
package/dist/base/updateEdges.js
CHANGED
|
@@ -4,14 +4,15 @@ import { isDefined, omit } from 'remeda';
|
|
|
4
4
|
function _update(current, update) {
|
|
5
5
|
return update.map((next) => {
|
|
6
6
|
const existing = current.find((n) => n.id === next.id);
|
|
7
|
-
if (existing &&
|
|
8
|
-
|
|
7
|
+
if (existing && existing.type === next.type && existing.source === next.source && existing.target === next.target) {
|
|
8
|
+
const isSameData = deepEqual(existing.data, next.data);
|
|
9
|
+
if (isSameData && deepEqual(existing.hidden ?? false, next.hidden ?? false) && deepEqual(existing.selected ?? false, next.selected ?? false) && deepEqual(existing.animated ?? false, next.animated ?? false) && deepEqual(existing.sourceHandle ?? null, next.sourceHandle ?? null) && deepEqual(existing.targetHandle ?? null, next.targetHandle ?? null) && deepEqual(existing.zIndex ?? 0, next.zIndex ?? 0) && deepEqual(existing.label ?? null, next.label ?? null)) {
|
|
9
10
|
return existing;
|
|
10
11
|
}
|
|
11
12
|
return {
|
|
12
13
|
...omit(existing, ["hidden", "zIndex"]),
|
|
13
14
|
...next,
|
|
14
|
-
data: next.data
|
|
15
|
+
data: isSameData ? existing.data : next.data
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
18
|
return next;
|
package/dist/base/updateNodes.js
CHANGED
|
@@ -6,8 +6,9 @@ function _update(current, updated) {
|
|
|
6
6
|
return updated.map((update) => {
|
|
7
7
|
const existing = current.find((n) => n.id === update.id);
|
|
8
8
|
if (existing && deepEqual(existing.type, update.type)) {
|
|
9
|
+
const isSameData = deepEqual(existing.data, update.data);
|
|
9
10
|
const { width: existingWidth, height: existingHeight } = getNodeDimensions(existing);
|
|
10
|
-
if (deepEqual(existingWidth, update.initialWidth) && deepEqual(existingHeight, update.initialHeight) && deepEqual(existing.parentId ?? null, update.parentId ?? null) && deepEqual(existing.hidden ?? false, update.hidden ?? false) && deepEqual(existing.zIndex ?? 0, update.zIndex ?? 0) && deepEqual(existing.position, update.position)
|
|
11
|
+
if (isSameData && deepEqual(existingWidth, update.initialWidth) && deepEqual(existingHeight, update.initialHeight) && deepEqual(existing.parentId ?? null, update.parentId ?? null) && deepEqual(existing.hidden ?? false, update.hidden ?? false) && deepEqual(existing.zIndex ?? 0, update.zIndex ?? 0) && deepEqual(existing.position, update.position)) {
|
|
11
12
|
return existing;
|
|
12
13
|
}
|
|
13
14
|
return {
|
|
@@ -16,7 +17,7 @@ function _update(current, updated) {
|
|
|
16
17
|
// Force dimensions from update
|
|
17
18
|
width: update.initialWidth,
|
|
18
19
|
height: update.initialHeight,
|
|
19
|
-
data: update.data
|
|
20
|
+
data: isSameData ? existing.data : update.data
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
return update;
|
|
@@ -6,7 +6,7 @@ import { useDebouncedValue } from '@mantine/hooks';
|
|
|
6
6
|
import * as m from 'motion/react-m';
|
|
7
7
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
8
8
|
import { compoundActionBtn } from './actionbtns.css.js';
|
|
9
|
-
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
9
|
+
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
10
10
|
|
|
11
11
|
function CompoundActionButton({
|
|
12
12
|
data: {
|
|
@@ -6,7 +6,7 @@ import { useDebouncedValue } from '@mantine/hooks';
|
|
|
6
6
|
import * as m from 'motion/react-m';
|
|
7
7
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
8
8
|
import { compoundActionBtn } from './actionbtns.css.js';
|
|
9
|
-
import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
9
|
+
import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js';
|
|
10
10
|
|
|
11
11
|
function CompoundDetailsButton({
|
|
12
12
|
data: {
|
|
@@ -3,7 +3,7 @@ import { cx } from '@likec4/styles/css';
|
|
|
3
3
|
import { edgeActionBtn } from '@likec4/styles/recipes';
|
|
4
4
|
import { ActionIcon } from '@mantine/core';
|
|
5
5
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
6
|
-
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
6
|
+
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
7
7
|
|
|
8
8
|
function EdgeActionButton({ icon, onClick }) {
|
|
9
9
|
return /* @__PURE__ */ jsx(
|
|
@@ -7,5 +7,5 @@ type EdgeContainerProps = PropsWithChildren<BaseEdgePropsWithData<Data> & {
|
|
|
7
7
|
component?: 'g' | 'svg' | undefined;
|
|
8
8
|
className?: string | undefined;
|
|
9
9
|
}>;
|
|
10
|
-
export declare function EdgeContainer({ className, component, data: { color, hovered: isHovered, active: isActive, dimmed: isDimmed, ...data }, children, style, }: EdgeContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function EdgeContainer({ className, component, selected, data: { color, hovered: isHovered, active: isActive, dimmed: isDimmed, ...data }, children, style, }: EdgeContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -6,6 +6,7 @@ import { edgeContainer } from './edge.css.js';
|
|
|
6
6
|
function EdgeContainer({
|
|
7
7
|
className,
|
|
8
8
|
component = "g",
|
|
9
|
+
selected = false,
|
|
9
10
|
data: {
|
|
10
11
|
color = "gray",
|
|
11
12
|
hovered: isHovered = false,
|
|
@@ -27,6 +28,9 @@ function EdgeContainer({
|
|
|
27
28
|
"data-edge-active": isActive,
|
|
28
29
|
"data-edge-animated": isActive,
|
|
29
30
|
"data-likec4-hovered": isHovered,
|
|
31
|
+
...selected && {
|
|
32
|
+
"data-likec4-selected": selected
|
|
33
|
+
},
|
|
30
34
|
...isDimmed !== false && {
|
|
31
35
|
"data-likec4-dimmed": isDimmed
|
|
32
36
|
}
|
|
@@ -7,6 +7,7 @@ type Data = UndefinedOnPartialDeep<Pick<DiagramEdge, 'label' | 'technology'>>;
|
|
|
7
7
|
type EdgeLabelProps = HTMLMotionProps<'div'> & {
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
edgeProps: BaseEdgePropsWithData<Data>;
|
|
10
|
+
pointerEvents?: 'all' | 'none';
|
|
10
11
|
};
|
|
11
12
|
export declare const EdgeLabel: ForwardRefExoticComponent<Omit<EdgeLabelProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
12
13
|
export {};
|
|
@@ -18,6 +18,7 @@ const EdgeLabel = forwardRef(({
|
|
|
18
18
|
selected = false,
|
|
19
19
|
selectable = false
|
|
20
20
|
},
|
|
21
|
+
pointerEvents = "all",
|
|
21
22
|
className,
|
|
22
23
|
style: _style,
|
|
23
24
|
// omit
|
|
@@ -26,6 +27,7 @@ const EdgeLabel = forwardRef(({
|
|
|
26
27
|
}, ref) => {
|
|
27
28
|
const stepNum = isStepEdgeId(id) ? extractStep(id) : null;
|
|
28
29
|
const classes = edgeLabel({
|
|
30
|
+
pointerEvents,
|
|
29
31
|
isStepEdge: stepNum !== null,
|
|
30
32
|
cursor: selectable || stepNum !== null ? "pointer" : "default"
|
|
31
33
|
});
|
|
@@ -14,5 +14,5 @@ type EdgeLabelContainerProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
14
14
|
} | undefined;
|
|
15
15
|
edgeProps: BaseEdgePropsWithData<Data>;
|
|
16
16
|
};
|
|
17
|
-
export declare function EdgeLabelContainer({ edgeProps: { id, data: { hovered: isHovered, active: isActive, dimmed: isDimmed, labelBBox, color, }, }, labelPosition: labelXY, className, style, children, ...rest }: EdgeLabelContainerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export declare function EdgeLabelContainer({ edgeProps: { id, selected, data: { hovered: isHovered, active: isActive, dimmed: isDimmed, labelBBox, color, }, }, labelPosition: labelXY, className, style, children, ...rest }: EdgeLabelContainerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
18
18
|
export {};
|
|
@@ -13,6 +13,7 @@ const toCssVarValue = (value) => {
|
|
|
13
13
|
function EdgeLabelContainer({
|
|
14
14
|
edgeProps: {
|
|
15
15
|
id,
|
|
16
|
+
selected = false,
|
|
16
17
|
data: {
|
|
17
18
|
hovered: isHovered = false,
|
|
18
19
|
active: isActive = false,
|
|
@@ -53,6 +54,9 @@ function EdgeLabelContainer({
|
|
|
53
54
|
"data-likec4-color": color,
|
|
54
55
|
"data-edge-active": isActive,
|
|
55
56
|
"data-edge-animated": isActive,
|
|
57
|
+
...selected !== false && {
|
|
58
|
+
"data-likec4-selected": selected
|
|
59
|
+
},
|
|
56
60
|
...isDimmed !== false && {
|
|
57
61
|
"data-likec4-dimmed": isDimmed
|
|
58
62
|
},
|
|
@@ -6,6 +6,10 @@ type Data = UndefinedOnPartialDeep<Pick<DiagramEdge, 'line' | 'dir' | 'tail' | '
|
|
|
6
6
|
type EdgePathProps = {
|
|
7
7
|
edgeProps: BaseEdgePropsWithData<Data>;
|
|
8
8
|
svgPath: string;
|
|
9
|
+
/**
|
|
10
|
+
* If true, the edge is being dragged (used to disable animations)
|
|
11
|
+
*/
|
|
12
|
+
isDragging?: boolean;
|
|
9
13
|
strokeWidth?: number;
|
|
10
14
|
onEdgePointerDown?: PointerEventHandler<SVGGElement> | undefined;
|
|
11
15
|
};
|
|
@@ -17,6 +17,8 @@ const EdgePath = forwardRef(({
|
|
|
17
17
|
style,
|
|
18
18
|
interactionWidth
|
|
19
19
|
},
|
|
20
|
+
isDragging = false,
|
|
21
|
+
// omit
|
|
20
22
|
onEdgePointerDown,
|
|
21
23
|
strokeWidth,
|
|
22
24
|
svgPath
|
|
@@ -37,16 +39,16 @@ const EdgePath = forwardRef(({
|
|
|
37
39
|
strokeDasharray = "8,10";
|
|
38
40
|
}
|
|
39
41
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
|
-
selectable && /* @__PURE__ */ jsx(
|
|
42
|
+
selectable && !isDragging && /* @__PURE__ */ jsx(
|
|
41
43
|
"path",
|
|
42
44
|
{
|
|
43
45
|
className: cx(
|
|
44
46
|
"react-flow__edge-interaction",
|
|
45
|
-
"hide-on-reduced-graphics",
|
|
46
47
|
css({
|
|
47
48
|
fill: "none"
|
|
48
49
|
})
|
|
49
50
|
),
|
|
51
|
+
onPointerDown: onEdgePointerDown,
|
|
50
52
|
d: svgPath,
|
|
51
53
|
style: {
|
|
52
54
|
strokeWidth: interactionWidth ?? 10,
|
|
@@ -60,7 +62,7 @@ const EdgePath = forwardRef(({
|
|
|
60
62
|
MarkerStart && /* @__PURE__ */ jsx(MarkerStart, { id: "start" + id }),
|
|
61
63
|
MarkerEnd && /* @__PURE__ */ jsx(MarkerEnd, { id: "end" + id })
|
|
62
64
|
] }),
|
|
63
|
-
/* @__PURE__ */ jsx(
|
|
65
|
+
!isDragging && /* @__PURE__ */ jsx(
|
|
64
66
|
"path",
|
|
65
67
|
{
|
|
66
68
|
className: cx(
|
|
@@ -71,7 +73,8 @@ const EdgePath = forwardRef(({
|
|
|
71
73
|
d: svgPath,
|
|
72
74
|
style,
|
|
73
75
|
strokeLinecap: "round"
|
|
74
|
-
}
|
|
76
|
+
},
|
|
77
|
+
"edge-path-bg"
|
|
75
78
|
),
|
|
76
79
|
/* @__PURE__ */ jsx(
|
|
77
80
|
"path",
|
|
@@ -89,7 +92,8 @@ const EdgePath = forwardRef(({
|
|
|
89
92
|
strokeDasharray,
|
|
90
93
|
markerStart: MarkerStart ? `url(#start${id})` : void 0,
|
|
91
94
|
markerEnd: MarkerEnd ? `url(#end${id})` : void 0
|
|
92
|
-
}
|
|
95
|
+
},
|
|
96
|
+
"edge-path"
|
|
93
97
|
)
|
|
94
98
|
] })
|
|
95
99
|
] });
|
|
@@ -7,7 +7,7 @@ import { ActionIcon } from '@mantine/core';
|
|
|
7
7
|
import { useId } from '@mantine/hooks';
|
|
8
8
|
import * as m from 'motion/react-m';
|
|
9
9
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
10
|
-
import IconBolt from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
10
|
+
import IconBolt from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js';
|
|
11
11
|
|
|
12
12
|
const container = hstack({
|
|
13
13
|
position: "absolute",
|
|
@@ -3,10 +3,9 @@ import { cx, css } from '@likec4/styles/css';
|
|
|
3
3
|
import { Box } from '@likec4/styles/jsx';
|
|
4
4
|
import { actionBtn } from '@likec4/styles/recipes';
|
|
5
5
|
import { ActionIcon } from '@mantine/core';
|
|
6
|
-
import { useId } from '@mantine/hooks';
|
|
7
6
|
import * as m from 'motion/react-m';
|
|
8
7
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
9
|
-
import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
8
|
+
import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js';
|
|
10
9
|
|
|
11
10
|
const container = css({
|
|
12
11
|
position: "absolute",
|
|
@@ -38,7 +37,6 @@ function ElementDetailsButton({
|
|
|
38
37
|
icon,
|
|
39
38
|
onClick
|
|
40
39
|
}) {
|
|
41
|
-
const id = useId();
|
|
42
40
|
return /* @__PURE__ */ jsx(Box, { className: cx(container, "details-button"), children: /* @__PURE__ */ jsx(
|
|
43
41
|
ActionIcon,
|
|
44
42
|
{
|
|
@@ -64,8 +62,7 @@ function ElementDetailsButton({
|
|
|
64
62
|
onClick,
|
|
65
63
|
onDoubleClick: stopPropagation,
|
|
66
64
|
children: icon ?? /* @__PURE__ */ jsx(IconId, { stroke: 1.8, style: { width: "75%" } })
|
|
67
|
-
}
|
|
68
|
-
id
|
|
65
|
+
}
|
|
69
66
|
) });
|
|
70
67
|
}
|
|
71
68
|
|
|
@@ -2,42 +2,30 @@ import { css } from '@likec4/styles/css';
|
|
|
2
2
|
|
|
3
3
|
const container = css({
|
|
4
4
|
position: "relative",
|
|
5
|
-
width: "
|
|
6
|
-
height: "
|
|
5
|
+
width: "full",
|
|
6
|
+
height: "full",
|
|
7
7
|
padding: "0",
|
|
8
8
|
margin: "0",
|
|
9
9
|
display: "flex",
|
|
10
10
|
alignItems: "center",
|
|
11
11
|
justifyContent: "center",
|
|
12
12
|
pointerEvents: "none",
|
|
13
|
-
_before: {
|
|
14
|
-
content: '" "',
|
|
15
|
-
position: "absolute",
|
|
16
|
-
top: "[calc(100% - 4px)]",
|
|
17
|
-
left: "0",
|
|
18
|
-
width: "100%",
|
|
19
|
-
height: "24px",
|
|
20
|
-
background: "[transparent]",
|
|
21
|
-
pointerEvents: "all"
|
|
22
|
-
},
|
|
23
13
|
_focusVisible: {
|
|
24
14
|
outline: "none"
|
|
25
15
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// // filter: `grayscale(0.85) ${fallbackVar(vars.safariAnimationHook, 'blur(2px)')}`,
|
|
40
|
-
// },
|
|
16
|
+
_whenSelectable: {
|
|
17
|
+
pointerEvents: "all",
|
|
18
|
+
_before: {
|
|
19
|
+
content: '" "',
|
|
20
|
+
position: "absolute",
|
|
21
|
+
top: "[calc(100% - 4px)]",
|
|
22
|
+
left: "0",
|
|
23
|
+
width: "full",
|
|
24
|
+
height: "24px",
|
|
25
|
+
background: "transparent",
|
|
26
|
+
pointerEvents: "all"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
41
29
|
_reduceGraphicsOnPan: {
|
|
42
30
|
_before: {
|
|
43
31
|
display: "none"
|
|
@@ -9,7 +9,8 @@ import { NodeToolbar, Position } from '@xyflow/react';
|
|
|
9
9
|
import { deepEqual } from 'fast-equals';
|
|
10
10
|
import { forwardRef, memo, useEffect, useCallback } from 'react';
|
|
11
11
|
import { useTagSpecification } from '../../context/TagStylesContext.js';
|
|
12
|
-
import
|
|
12
|
+
import '@xstate/react';
|
|
13
|
+
import { useDiagram } from '../../hooks/safeContext.js';
|
|
13
14
|
import { useCurrentZoom } from '../../hooks/useXYFlow.js';
|
|
14
15
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
15
16
|
|
|
@@ -4,9 +4,11 @@ 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) && isSame(prev.sourceX, next.sourceX) && isSame(prev.sourceY, next.sourceY) && deepEqual(prev.sourceHandleId ?? null, next.sourceHandleId ?? null) && deepEqual(prev.sourcePosition, next.sourcePosition) && deepEqual(prev.target, next.target) && isSame(prev.targetY, next.targetY) && isSame(prev.targetX, next.targetX) && deepEqual(prev.targetHandleId ?? null, next.targetHandleId ?? null) && deepEqual(prev.targetPosition, next.targetPosition) && deepEqual(prev.data, next.data);
|
|
8
8
|
function memoEdge(Edge) {
|
|
9
|
-
|
|
9
|
+
const Memo = memo(Edge, edgePropsEqual);
|
|
10
|
+
Memo.displayName = `MemoEdge(${Edge.displayName || Edge.name})`;
|
|
11
|
+
return Memo;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export { memoEdge };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import { BaseNodeProps } from '../base/types';
|
|
3
|
-
export declare function memoNode<P extends BaseNodeProps>(Node: FunctionComponent<P
|
|
3
|
+
export declare function memoNode<P extends BaseNodeProps>(Node: FunctionComponent<P>, displayName?: string): FunctionComponent<P>;
|
|
@@ -2,10 +2,10 @@ 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.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.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 = Symbol.for("isMemoized");
|
|
8
|
-
function memoNode(Node) {
|
|
8
|
+
function memoNode(Node, displayName = "Node") {
|
|
9
9
|
if (Node.hasOwnProperty(isMemoized)) {
|
|
10
10
|
return Node;
|
|
11
11
|
}
|
|
@@ -13,7 +13,7 @@ function memoNode(Node) {
|
|
|
13
13
|
Node,
|
|
14
14
|
nodePropsEqual
|
|
15
15
|
);
|
|
16
|
-
NodeComponent.displayName =
|
|
16
|
+
NodeComponent.displayName = displayName;
|
|
17
17
|
Object.defineProperty(NodeComponent, isMemoized, {
|
|
18
18
|
enumerable: false,
|
|
19
19
|
writable: false,
|