@likec4/diagram 1.43.0 → 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 +5746 -4674
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +13 -10
- package/dist/LikeC4Diagram.props.d.ts +16 -7
- package/dist/LikeC4ProjectsProvider.js +1 -1
- package/dist/LikeC4View.d.ts +5 -0
- package/dist/LikeC4View.js +22 -11
- package/dist/ReactLikeC4.js +2 -2
- package/dist/StaticLikeC4Diagram.js +1 -1
- 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/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 +5 -4
- 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 +7 -5
- package/dist/overlays/element-details/MetadataValue.js +2 -2
- 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 +17 -3
- 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/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 +1 -1
- 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 +19 -18
- package/panda.buildinfo.json +107 -66
- 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/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,
|
|
@@ -1,47 +1,64 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { css } from '@likec4/styles/css';
|
|
3
|
+
import { HStack, VStack } from '@likec4/styles/jsx';
|
|
4
|
+
import { ThemeIcon, Text, ScrollAreaAutosize, Button } from '@mantine/core';
|
|
5
|
+
import { useRef, useEffect } from 'react';
|
|
4
6
|
import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
|
|
5
|
-
import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
7
|
+
import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
6
8
|
|
|
7
9
|
function ErrorFallback({ error, resetErrorBoundary }) {
|
|
8
10
|
const errorString = error instanceof Error ? error.message : "Unknown error";
|
|
11
|
+
const dialogRef = useRef(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
dialogRef.current?.showModal();
|
|
14
|
+
}, []);
|
|
9
15
|
return /* @__PURE__ */ jsx(
|
|
10
|
-
|
|
16
|
+
"dialog",
|
|
11
17
|
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
left: "0",
|
|
16
|
-
width: "100%",
|
|
17
|
-
height: "100%",
|
|
18
|
+
ref: dialogRef,
|
|
19
|
+
className: css({
|
|
20
|
+
margin: "0",
|
|
18
21
|
padding: "0",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
]
|
|
22
|
+
position: "fixed",
|
|
23
|
+
top: "10",
|
|
24
|
+
left: "10",
|
|
25
|
+
width: "[calc(100vw - ({spacing.10} * 2))]",
|
|
26
|
+
height: "max-content",
|
|
27
|
+
maxHeight: "[calc(100vh - ({spacing.10} * 3))]",
|
|
28
|
+
background: `likec4.overlay.body`,
|
|
29
|
+
rounded: "sm",
|
|
30
|
+
borderWidth: 3,
|
|
31
|
+
borderColor: `likec4.overlay.border`,
|
|
32
|
+
shadow: "xl",
|
|
33
|
+
outline: "none",
|
|
34
|
+
_backdrop: {
|
|
35
|
+
cursor: "zoom-out",
|
|
36
|
+
backdropFilter: `blur(18px)`,
|
|
37
|
+
bg: "[color-mix(in oklab, {colors.likec4.overlay.backdrop} 60%, transparent)]"
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
onClick: (e) => {
|
|
41
|
+
e.stopPropagation();
|
|
42
|
+
if (e.target?.nodeName?.toUpperCase() === "DIALOG") {
|
|
43
|
+
dialogRef.current?.close();
|
|
44
|
+
return;
|
|
43
45
|
}
|
|
44
|
-
|
|
46
|
+
},
|
|
47
|
+
onClose: (e) => {
|
|
48
|
+
e.stopPropagation();
|
|
49
|
+
resetErrorBoundary();
|
|
50
|
+
},
|
|
51
|
+
children: /* @__PURE__ */ jsxs(HStack, { p: "xl", gap: "lg", alignItems: "flex-start", flexWrap: "nowrap", children: [
|
|
52
|
+
/* @__PURE__ */ jsx(ThemeIcon, { size: "md", radius: "xl", color: "red", children: /* @__PURE__ */ jsx(IconX, { style: { width: 20, height: 20 } }) }),
|
|
53
|
+
/* @__PURE__ */ jsxs(VStack, { flex: "1", children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Text, { fz: "md", children: "Oops, something went wrong" }),
|
|
55
|
+
/* @__PURE__ */ jsx(ScrollAreaAutosize, { maw: "100%", mah: 400, type: "auto", children: /* @__PURE__ */ jsx(Text, { fz: "md", c: "red", style: { whiteSpace: "pre-wrap", userSelect: "all" }, children: errorString }) }),
|
|
56
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "md", mt: "md", children: [
|
|
57
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "default", onClick: () => resetErrorBoundary(), children: "Reset" }),
|
|
58
|
+
/* @__PURE__ */ jsx(Text, { fz: "sm", c: "dimmed", children: "See console for more details and report the issue if it persists." })
|
|
59
|
+
] })
|
|
60
|
+
] })
|
|
61
|
+
] })
|
|
45
62
|
}
|
|
46
63
|
);
|
|
47
64
|
}
|
package/dist/components/Link.js
CHANGED
|
@@ -4,8 +4,8 @@ import { styled } from '@likec4/styles/jsx';
|
|
|
4
4
|
import { Badge, CopyButton, ActionIcon } from '@mantine/core';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import { GithubIcon } from './GithubIcon.js';
|
|
7
|
-
import IconCheck from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
8
|
-
import IconCopy from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
7
|
+
import IconCheck from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
|
|
8
|
+
import IconCopy from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js';
|
|
9
9
|
|
|
10
10
|
const GITHUB_PREFIX = "https://github.com/";
|
|
11
11
|
const Link = forwardRef(
|
|
@@ -15,7 +15,8 @@ const defaultHandlers = {
|
|
|
15
15
|
onCanvasDblClick: null,
|
|
16
16
|
onBurgerMenuClick: null,
|
|
17
17
|
onOpenSource: null,
|
|
18
|
-
onInitialized: null
|
|
18
|
+
onInitialized: null,
|
|
19
|
+
onLayoutTypeChange: null
|
|
19
20
|
};
|
|
20
21
|
const HandlerNames = keys(defaultHandlers);
|
|
21
22
|
const DiagramEventHandlersReactContext = createContext({
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { ExclusiveUnion } from '@likec4/core/types';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
declare const FeatureNames: readonly ["Controls", "ReadOnly", "FocusMode", "NavigateTo", "ElementDetails", "RelationshipDetails", "RelationshipBrowser", "Search", "NavigationButtons", "Notations", "DynamicViewWalkthrough", "
|
|
3
|
+
declare const FeatureNames: readonly ["Controls", "ReadOnly", "FocusMode", "NavigateTo", "ElementDetails", "RelationshipDetails", "RelationshipBrowser", "Search", "NavigationButtons", "Notations", "DynamicViewWalkthrough", "FitView", "CompareWithLatest", "Vscode", "ElementTags"];
|
|
4
4
|
export type FeatureName = typeof FeatureNames[number];
|
|
5
|
-
type CustomFeatures = {
|
|
6
|
-
enableControls: 'next' | boolean;
|
|
7
|
-
};
|
|
8
5
|
export type EnabledFeatures = {
|
|
9
|
-
[P in `enable${FeatureName}`]:
|
|
6
|
+
[P in `enable${FeatureName}`]: boolean;
|
|
10
7
|
};
|
|
11
|
-
export declare const
|
|
8
|
+
export declare const DefaultFeatures: EnabledFeatures;
|
|
12
9
|
export declare function DiagramFeatures({ children, features, overrides, }: PropsWithChildren<ExclusiveUnion<{
|
|
13
10
|
features: {
|
|
14
11
|
features: EnabledFeatures;
|
|
@@ -21,6 +18,27 @@ export declare namespace DiagramFeatures {
|
|
|
21
18
|
var Overlays: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
22
19
|
}
|
|
23
20
|
export declare function useEnabledFeatures(): EnabledFeatures;
|
|
21
|
+
export type IfEnabledProps = PropsWithChildren<{
|
|
22
|
+
feature: FeatureName;
|
|
23
|
+
/**
|
|
24
|
+
* Additional AND condition
|
|
25
|
+
* @default true
|
|
26
|
+
* @example
|
|
27
|
+
* <IfEnabled feature="ReadOnly" and={isSomething}>
|
|
28
|
+
* ...
|
|
29
|
+
* </IfEnabled>
|
|
30
|
+
*/
|
|
31
|
+
and?: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Renders children only if the specified feature is enabled
|
|
35
|
+
* @param feature Feature name
|
|
36
|
+
* @param and Additional AND condition
|
|
37
|
+
* @example
|
|
38
|
+
* <IfEnabled feature="ReadOnly" and={isSomething}>
|
|
39
|
+
* ...
|
|
40
|
+
* </IfEnabled>
|
|
41
|
+
*/
|
|
24
42
|
export declare function IfEnabled({ feature, children, and, }: PropsWithChildren<{
|
|
25
43
|
feature: FeatureName;
|
|
26
44
|
and?: boolean;
|