@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getHotkeyHandler } from '@mantine/hooks';
|
|
2
2
|
import { last, isString, reverse } from 'remeda';
|
|
3
|
-
import { setup,
|
|
3
|
+
import { setup, fromCallback, assertEvent } from 'xstate';
|
|
4
4
|
import { elementDetailsLogic } from './element-details/actor.js';
|
|
5
5
|
import { relationshipDetailsLogic } from './relationship-details/actor.js';
|
|
6
6
|
import { relationshipsBrowserLogic } from './relationships-browser/actor.js';
|
|
@@ -19,7 +19,7 @@ const hotkeyLogic = fromCallback(({ sendBack }) => {
|
|
|
19
19
|
document.body.removeEventListener("keydown", handler, { capture: true });
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
|
-
const
|
|
22
|
+
const machine = setup({
|
|
23
23
|
types: {
|
|
24
24
|
context: {},
|
|
25
25
|
events: {},
|
|
@@ -32,119 +32,6 @@ const _overlaysActorLogic = setup({
|
|
|
32
32
|
relationshipsBrowser: relationshipsBrowserLogic,
|
|
33
33
|
hotkey: hotkeyLogic
|
|
34
34
|
},
|
|
35
|
-
actions: {
|
|
36
|
-
"closeLastOverlay": enqueueActions(({ context, enqueue }) => {
|
|
37
|
-
if (context.overlays.length === 0) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const lastOverlay = last(context.overlays)?.id;
|
|
41
|
-
if (!lastOverlay) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
enqueue.sendTo(lastOverlay, { type: "close" });
|
|
45
|
-
enqueue.stopChild(lastOverlay);
|
|
46
|
-
enqueue.assign({
|
|
47
|
-
overlays: context.overlays.filter((o) => o.id !== lastOverlay)
|
|
48
|
-
});
|
|
49
|
-
}),
|
|
50
|
-
"closeSpecificOverlay": enqueueActions(({ context, enqueue }, params) => {
|
|
51
|
-
const toClose = context.overlays.find((o) => o.id === params.actorId)?.id;
|
|
52
|
-
if (toClose) {
|
|
53
|
-
enqueue.sendTo(toClose, { type: "close" });
|
|
54
|
-
enqueue.stopChild(toClose);
|
|
55
|
-
enqueue.assign({
|
|
56
|
-
overlays: context.overlays.filter((o) => o.id !== toClose)
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}),
|
|
60
|
-
"closeAllOverlays": enqueueActions(({ context, enqueue }) => {
|
|
61
|
-
for (const { id } of reverse(context.overlays)) {
|
|
62
|
-
enqueue.sendTo(id, { type: "close" });
|
|
63
|
-
enqueue.stopChild(id);
|
|
64
|
-
}
|
|
65
|
-
enqueue.assign({ overlays: [] });
|
|
66
|
-
}),
|
|
67
|
-
"openElementDetails": enqueueActions(({ context, enqueue, event }) => {
|
|
68
|
-
assertEvent(event, "open.elementDetails");
|
|
69
|
-
if (context.overlays.some((o) => o.type === "elementDetails" && o.subject === event.subject)) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const id = `elementDetails-${context.seq}`;
|
|
73
|
-
enqueue.spawnChild("elementDetails", {
|
|
74
|
-
id,
|
|
75
|
-
input: event
|
|
76
|
-
});
|
|
77
|
-
enqueue.assign({
|
|
78
|
-
seq: context.seq + 1,
|
|
79
|
-
overlays: [
|
|
80
|
-
...context.overlays,
|
|
81
|
-
{
|
|
82
|
-
type: "elementDetails",
|
|
83
|
-
id,
|
|
84
|
-
subject: event.subject
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
});
|
|
88
|
-
}),
|
|
89
|
-
"openRelationshipDetails": enqueueActions(({ context, enqueue, event }) => {
|
|
90
|
-
assertEvent(event, "open.relationshipDetails");
|
|
91
|
-
const currentOverlay = last(context.overlays);
|
|
92
|
-
if (currentOverlay?.type === "relationshipDetails") {
|
|
93
|
-
enqueue.sendTo(currentOverlay.id, {
|
|
94
|
-
...event,
|
|
95
|
-
type: "navigate.to"
|
|
96
|
-
});
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const id = `relationshipDetails-${context.seq}`;
|
|
100
|
-
enqueue.spawnChild("relationshipDetails", {
|
|
101
|
-
id,
|
|
102
|
-
input: event
|
|
103
|
-
});
|
|
104
|
-
enqueue.assign({
|
|
105
|
-
seq: context.seq + 1,
|
|
106
|
-
overlays: [
|
|
107
|
-
...context.overlays,
|
|
108
|
-
{
|
|
109
|
-
type: "relationshipDetails",
|
|
110
|
-
id
|
|
111
|
-
}
|
|
112
|
-
]
|
|
113
|
-
});
|
|
114
|
-
}),
|
|
115
|
-
"openRelationshipsBrowser": enqueueActions(({ context, enqueue, event }) => {
|
|
116
|
-
assertEvent(event, "open.relationshipsBrowser");
|
|
117
|
-
const currentOverlay = last(context.overlays);
|
|
118
|
-
if (currentOverlay?.type === "relationshipsBrowser") {
|
|
119
|
-
enqueue.sendTo(currentOverlay.id, {
|
|
120
|
-
type: "navigate.to",
|
|
121
|
-
subject: event.subject,
|
|
122
|
-
viewId: event.viewId
|
|
123
|
-
});
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
const id = `relationshipsBrowser-${context.seq}`;
|
|
127
|
-
enqueue.spawnChild("relationshipsBrowser", {
|
|
128
|
-
id,
|
|
129
|
-
input: event
|
|
130
|
-
});
|
|
131
|
-
enqueue.assign({
|
|
132
|
-
seq: context.seq + 1,
|
|
133
|
-
overlays: [
|
|
134
|
-
...context.overlays,
|
|
135
|
-
{
|
|
136
|
-
type: "relationshipsBrowser",
|
|
137
|
-
id,
|
|
138
|
-
subject: event.subject
|
|
139
|
-
}
|
|
140
|
-
]
|
|
141
|
-
});
|
|
142
|
-
}),
|
|
143
|
-
"listenToEsc": spawnChild("hotkey", {
|
|
144
|
-
id: "hotkey"
|
|
145
|
-
}),
|
|
146
|
-
"stopListeningToEsc": stopChild("hotkey")
|
|
147
|
-
},
|
|
148
35
|
guards: {
|
|
149
36
|
"has overlays?": ({ context }) => context.overlays.length > 0,
|
|
150
37
|
"close specific overlay?": ({ context, event }) => {
|
|
@@ -160,7 +47,124 @@ const _overlaysActorLogic = setup({
|
|
|
160
47
|
return lastOverlay?.type === "relationshipsBrowser";
|
|
161
48
|
}
|
|
162
49
|
}
|
|
163
|
-
})
|
|
50
|
+
});
|
|
51
|
+
const closeLastOverlay = () => machine.enqueueActions(({ context, enqueue }) => {
|
|
52
|
+
if (context.overlays.length === 0) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const lastOverlay = last(context.overlays)?.id;
|
|
56
|
+
if (!lastOverlay) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
enqueue.sendTo(lastOverlay, { type: "close" });
|
|
60
|
+
enqueue.stopChild(lastOverlay);
|
|
61
|
+
enqueue.assign({
|
|
62
|
+
overlays: context.overlays.filter((o) => o.id !== lastOverlay)
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
const closeSpecificOverlay = () => machine.enqueueActions(({ context, enqueue, event }) => {
|
|
66
|
+
assertEvent(event, "close");
|
|
67
|
+
const actorId = event.actorId;
|
|
68
|
+
if (!isString(actorId)) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const toClose = context.overlays.find((o) => o.id === actorId)?.id;
|
|
72
|
+
if (toClose) {
|
|
73
|
+
enqueue.sendTo(toClose, { type: "close" });
|
|
74
|
+
enqueue.stopChild(toClose);
|
|
75
|
+
enqueue.assign({
|
|
76
|
+
overlays: context.overlays.filter((o) => o.id !== toClose)
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
const closeAllOverlays = () => machine.enqueueActions(({ context, enqueue }) => {
|
|
81
|
+
for (const { id } of reverse(context.overlays)) {
|
|
82
|
+
enqueue.sendTo(id, { type: "close" });
|
|
83
|
+
enqueue.stopChild(id);
|
|
84
|
+
}
|
|
85
|
+
enqueue.assign({ overlays: [] });
|
|
86
|
+
});
|
|
87
|
+
const openElementDetails = () => machine.enqueueActions(({ context, enqueue, event }) => {
|
|
88
|
+
assertEvent(event, "open.elementDetails");
|
|
89
|
+
if (context.overlays.some((o) => o.type === "elementDetails" && o.subject === event.subject)) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const id = `elementDetails-${context.seq}`;
|
|
93
|
+
enqueue.spawnChild("elementDetails", {
|
|
94
|
+
id,
|
|
95
|
+
input: event
|
|
96
|
+
});
|
|
97
|
+
enqueue.assign({
|
|
98
|
+
seq: context.seq + 1,
|
|
99
|
+
overlays: [
|
|
100
|
+
...context.overlays,
|
|
101
|
+
{
|
|
102
|
+
type: "elementDetails",
|
|
103
|
+
id,
|
|
104
|
+
subject: event.subject
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
const openRelationshipDetails = () => machine.enqueueActions(({ context, enqueue, event }) => {
|
|
110
|
+
assertEvent(event, "open.relationshipDetails");
|
|
111
|
+
const currentOverlay = last(context.overlays);
|
|
112
|
+
if (currentOverlay?.type === "relationshipDetails") {
|
|
113
|
+
enqueue.sendTo(currentOverlay.id, {
|
|
114
|
+
...event,
|
|
115
|
+
type: "navigate.to"
|
|
116
|
+
});
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const id = `relationshipDetails-${context.seq}`;
|
|
120
|
+
enqueue.spawnChild("relationshipDetails", {
|
|
121
|
+
id,
|
|
122
|
+
input: event
|
|
123
|
+
});
|
|
124
|
+
enqueue.assign({
|
|
125
|
+
seq: context.seq + 1,
|
|
126
|
+
overlays: [
|
|
127
|
+
...context.overlays,
|
|
128
|
+
{
|
|
129
|
+
type: "relationshipDetails",
|
|
130
|
+
id
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
const openRelationshipsBrowser = () => machine.enqueueActions(({ context, enqueue, event }) => {
|
|
136
|
+
assertEvent(event, "open.relationshipsBrowser");
|
|
137
|
+
const currentOverlay = last(context.overlays);
|
|
138
|
+
if (currentOverlay?.type === "relationshipsBrowser") {
|
|
139
|
+
enqueue.sendTo(currentOverlay.id, {
|
|
140
|
+
type: "navigate.to",
|
|
141
|
+
subject: event.subject,
|
|
142
|
+
viewId: event.viewId
|
|
143
|
+
});
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const id = `relationshipsBrowser-${context.seq}`;
|
|
147
|
+
enqueue.spawnChild("relationshipsBrowser", {
|
|
148
|
+
id,
|
|
149
|
+
input: event
|
|
150
|
+
});
|
|
151
|
+
enqueue.assign({
|
|
152
|
+
seq: context.seq + 1,
|
|
153
|
+
overlays: [
|
|
154
|
+
...context.overlays,
|
|
155
|
+
{
|
|
156
|
+
type: "relationshipsBrowser",
|
|
157
|
+
id,
|
|
158
|
+
subject: event.subject
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
const listenToEsc = () => machine.spawnChild("hotkey", {
|
|
164
|
+
id: "hotkey"
|
|
165
|
+
});
|
|
166
|
+
const stopListeningToEsc = () => machine.stopChild("hotkey");
|
|
167
|
+
const _overlaysActorLogic = machine.createMachine({
|
|
164
168
|
id: "overlays",
|
|
165
169
|
context: () => ({
|
|
166
170
|
seq: 1,
|
|
@@ -169,17 +173,17 @@ const _overlaysActorLogic = setup({
|
|
|
169
173
|
initial: "idle",
|
|
170
174
|
on: {
|
|
171
175
|
"open.elementDetails": {
|
|
172
|
-
actions:
|
|
176
|
+
actions: openElementDetails(),
|
|
173
177
|
target: ".active",
|
|
174
178
|
reenter: false
|
|
175
179
|
},
|
|
176
180
|
"open.relationshipDetails": {
|
|
177
|
-
actions:
|
|
181
|
+
actions: openRelationshipDetails(),
|
|
178
182
|
target: ".active",
|
|
179
183
|
reenter: false
|
|
180
184
|
},
|
|
181
185
|
"open.relationshipsBrowser": {
|
|
182
|
-
actions:
|
|
186
|
+
actions: openRelationshipsBrowser(),
|
|
183
187
|
target: ".active",
|
|
184
188
|
reenter: false
|
|
185
189
|
}
|
|
@@ -187,27 +191,24 @@ const _overlaysActorLogic = setup({
|
|
|
187
191
|
states: {
|
|
188
192
|
idle: {},
|
|
189
193
|
active: {
|
|
190
|
-
entry:
|
|
191
|
-
exit:
|
|
194
|
+
entry: listenToEsc(),
|
|
195
|
+
exit: stopListeningToEsc(),
|
|
192
196
|
on: {
|
|
193
197
|
"close": [
|
|
194
198
|
{
|
|
195
199
|
guard: "close specific overlay?",
|
|
196
|
-
actions:
|
|
197
|
-
type: "closeSpecificOverlay",
|
|
198
|
-
params: ({ event }) => ({ actorId: event.actorId })
|
|
199
|
-
},
|
|
200
|
+
actions: closeSpecificOverlay(),
|
|
200
201
|
target: "closing"
|
|
201
202
|
},
|
|
202
203
|
{
|
|
203
|
-
actions:
|
|
204
|
+
actions: closeLastOverlay(),
|
|
204
205
|
target: "closing"
|
|
205
206
|
}
|
|
206
207
|
],
|
|
207
208
|
"close.all": {
|
|
208
209
|
actions: [
|
|
209
|
-
|
|
210
|
-
|
|
210
|
+
closeAllOverlays(),
|
|
211
|
+
stopListeningToEsc()
|
|
211
212
|
],
|
|
212
213
|
target: "idle"
|
|
213
214
|
}
|
|
@@ -220,15 +221,15 @@ const _overlaysActorLogic = setup({
|
|
|
220
221
|
target: "active"
|
|
221
222
|
},
|
|
222
223
|
{
|
|
223
|
-
actions:
|
|
224
|
+
actions: stopListeningToEsc(),
|
|
224
225
|
target: "idle"
|
|
225
226
|
}
|
|
226
227
|
]
|
|
227
228
|
}
|
|
228
229
|
},
|
|
229
230
|
exit: [
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
stopListeningToEsc(),
|
|
232
|
+
closeAllOverlays()
|
|
232
233
|
]
|
|
233
234
|
});
|
|
234
235
|
const overlaysActorLogic = _overlaysActorLogic;
|
|
@@ -17,9 +17,9 @@ import { layoutRelationshipDetails } from './layout.js';
|
|
|
17
17
|
import { SelectEdge } from './SelectEdge.js';
|
|
18
18
|
import { RelationshipEdge } from './custom/edgeTypes.js';
|
|
19
19
|
import { CompoundNode, ElementNode } from './custom/nodeTypes.js';
|
|
20
|
-
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
21
|
-
import IconChevronLeft from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
22
|
-
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
20
|
+
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';
|
|
21
|
+
import IconChevronLeft from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js';
|
|
22
|
+
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
|
|
23
23
|
|
|
24
24
|
const nodeTypes = {
|
|
25
25
|
element: ElementNode,
|
|
@@ -148,6 +148,7 @@ const RelationshipDetailsInner = memo(() => {
|
|
|
148
148
|
browser.send({ type: "xyflow.selectionChange", ...params });
|
|
149
149
|
}),
|
|
150
150
|
nodesDraggable: false,
|
|
151
|
+
nodesSelectable: true,
|
|
151
152
|
fitView: false,
|
|
152
153
|
pannable: true,
|
|
153
154
|
zoomable: true,
|
|
@@ -3,8 +3,8 @@ import { Popover, PopoverTarget, Button, Box, Text, ThemeIcon, PopoverDropdown,
|
|
|
3
3
|
import { useRef } from 'react';
|
|
4
4
|
import { useRelationshipDetails } from './hooks.js';
|
|
5
5
|
import { edgeSource, edgeTarget, scrollArea, edgeGrid, edgeRow, edgeArrow, edgeLabel } from './SelectEdge.css.js';
|
|
6
|
-
import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
7
|
-
import IconSelector from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
6
|
+
import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js';
|
|
7
|
+
import IconSelector from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
|
|
8
8
|
|
|
9
9
|
const SelectEdge = ({
|
|
10
10
|
edge,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BBox, EdgeId, ExclusiveUnion, Fqn, ViewId } from '@likec4/core';
|
|
2
2
|
import { EdgeChange, NodeChange, ReactFlowInstance, ReactFlowState } from '@xyflow/react';
|
|
3
|
-
import {
|
|
3
|
+
import { ActorRefFromLogic, SnapshotFrom, StateMachine, Values, NonReducibleUnknown, EventObject, MetaObject, AnyActorLogic, ConditionalRequired, InputFrom, RequiredLogicInput, IsNotNever, ActorRef, MachineSnapshot, AnyActorRef, StateValue, AnyEventObject, ActionFunction, CancelAction } from 'xstate';
|
|
4
4
|
import { RelationshipDetailsTypes } from './_types';
|
|
5
5
|
import { LayoutResult } from './layout';
|
|
6
6
|
type XYFLowInstance = ReactFlowInstance<RelationshipDetailsTypes.AnyNode, RelationshipDetailsTypes.Edge>;
|
|
@@ -131,6 +131,10 @@ declare const _relationshipDetailsLogic: StateMachine<Readonly<{
|
|
|
131
131
|
type: "updateLayoutData";
|
|
132
132
|
params: NonReducibleUnknown;
|
|
133
133
|
};
|
|
134
|
+
"open relationship source": {
|
|
135
|
+
type: "open relationship source";
|
|
136
|
+
params: NonReducibleUnknown;
|
|
137
|
+
};
|
|
134
138
|
}>, Values<{
|
|
135
139
|
isReady: {
|
|
136
140
|
type: "isReady";
|
|
@@ -430,6 +434,10 @@ declare const _relationshipDetailsLogic: StateMachine<Readonly<{
|
|
|
430
434
|
type: "updateLayoutData";
|
|
431
435
|
params: NonReducibleUnknown;
|
|
432
436
|
};
|
|
437
|
+
"open relationship source": {
|
|
438
|
+
type: "open relationship source";
|
|
439
|
+
params: NonReducibleUnknown;
|
|
440
|
+
};
|
|
433
441
|
}>, Values<{
|
|
434
442
|
isReady: {
|
|
435
443
|
type: "isReady";
|
|
@@ -531,6 +539,9 @@ declare const _relationshipDetailsLogic: StateMachine<Readonly<{
|
|
|
531
539
|
readonly 'xyflow.paneDblClick': {
|
|
532
540
|
readonly actions: "xyflow:fitDiagram";
|
|
533
541
|
};
|
|
542
|
+
readonly 'xyflow.edgeClick': {
|
|
543
|
+
readonly actions: "open relationship source";
|
|
544
|
+
};
|
|
534
545
|
readonly 'navigate.to': {
|
|
535
546
|
readonly actions: ActionFunction<Readonly<{
|
|
536
547
|
subject: Subject;
|
|
@@ -644,7 +655,8 @@ declare const _relationshipDetailsLogic: StateMachine<Readonly<{
|
|
|
644
655
|
};
|
|
645
656
|
};
|
|
646
657
|
}>;
|
|
647
|
-
|
|
658
|
+
type InferredMachine = typeof _relationshipDetailsLogic;
|
|
659
|
+
export interface RelationshipDetailsLogic extends InferredMachine {
|
|
648
660
|
}
|
|
649
661
|
export declare const relationshipDetailsLogic: RelationshipDetailsLogic;
|
|
650
662
|
export interface RelationshipDetailsActorRef extends ActorRefFromLogic<RelationshipDetailsLogic> {
|
|
@@ -2,12 +2,13 @@ import { invariant } from '@likec4/core';
|
|
|
2
2
|
import { getViewportForBounds, applyEdgeChanges, applyNodeChanges } from '@xyflow/react';
|
|
3
3
|
import { shallowEqual } from 'fast-equals';
|
|
4
4
|
import { prop, isString } from 'remeda';
|
|
5
|
-
import { setup, assign, assertEvent, cancel, raise
|
|
5
|
+
import { setup, enqueueActions, assign, assertEvent, cancel, raise } from 'xstate';
|
|
6
6
|
import { MinZoom } from '../../base/const.js';
|
|
7
7
|
import { updateEdges } from '../../base/updateEdges.js';
|
|
8
8
|
import { updateNodes } from '../../base/updateNodes.js';
|
|
9
|
+
import { typedSystem } from '../../likec4diagram/state/utils.js';
|
|
9
10
|
import { layoutResultToXYFlow } from './layout-to-xyflow.js';
|
|
10
|
-
import { Base } from '../../base/
|
|
11
|
+
import { Base } from '../../base/Base.js';
|
|
11
12
|
|
|
12
13
|
function inputToSubject(input) {
|
|
13
14
|
if ("edgeId" in input) {
|
|
@@ -49,7 +50,7 @@ const _relationshipDetailsLogic = setup({
|
|
|
49
50
|
minZoom: MinZoom,
|
|
50
51
|
maxZoom,
|
|
51
52
|
padding: ViewPadding,
|
|
52
|
-
...duration > 0 && { duration }
|
|
53
|
+
...duration > 0 && { duration, interpolate: "smooth" }
|
|
53
54
|
}).catch(console.error);
|
|
54
55
|
}
|
|
55
56
|
},
|
|
@@ -100,6 +101,16 @@ const _relationshipDetailsLogic = setup({
|
|
|
100
101
|
xyedges: updateEdges(context.xyedges, xyedges),
|
|
101
102
|
bounds: shallowEqual(context.bounds, bounds) ? context.bounds : bounds
|
|
102
103
|
};
|
|
104
|
+
}),
|
|
105
|
+
"open relationship source": enqueueActions(({ system, event }) => {
|
|
106
|
+
if (event.type !== "xyflow.edgeClick") {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const diagramActor = typedSystem(system).diagramActorRef;
|
|
110
|
+
const relationId = event.edge.data.relationId;
|
|
111
|
+
if (relationId) {
|
|
112
|
+
diagramActor.send({ type: "open.source", relation: relationId });
|
|
113
|
+
}
|
|
103
114
|
})
|
|
104
115
|
},
|
|
105
116
|
guards: {
|
|
@@ -246,6 +257,9 @@ const _relationshipDetailsLogic = setup({
|
|
|
246
257
|
"xyflow.paneDblClick": {
|
|
247
258
|
actions: "xyflow:fitDiagram"
|
|
248
259
|
},
|
|
260
|
+
"xyflow.edgeClick": {
|
|
261
|
+
actions: "open relationship source"
|
|
262
|
+
},
|
|
249
263
|
"navigate.to": {
|
|
250
264
|
actions: assign({
|
|
251
265
|
subject: ({ event }) => inputToSubject(event.params),
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
3
|
-
import { useCurrentViewId } from '../../../hooks/
|
|
4
|
-
import
|
|
3
|
+
import { useCurrentViewId } from '../../../hooks/useCurrentView.js';
|
|
4
|
+
import '@xstate/react';
|
|
5
|
+
import 'fast-equals';
|
|
6
|
+
import 'react';
|
|
7
|
+
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
5
8
|
import { ElementActionButtons } from '../../../base-primitives/element/ElementActionButtons.js';
|
|
6
|
-
import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
7
|
-
import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
8
|
-
import IconFileSymlink 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
|
+
import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
|
|
11
|
+
import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
|
|
9
12
|
|
|
10
13
|
const ElementActions = (props) => {
|
|
11
14
|
const { enableNavigateTo, enableVscode } = useEnabledFeatures();
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { getBezierPath } from '@xyflow/system';
|
|
3
|
-
import
|
|
3
|
+
import '@xstate/react';
|
|
4
|
+
import 'fast-equals';
|
|
5
|
+
import 'react';
|
|
6
|
+
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
4
7
|
import { memoEdge } from '../../../base-primitives/memoEdge.js';
|
|
5
8
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
6
9
|
import { EdgeContainer } from '../../../base-primitives/edge/EdgeContainer.js';
|
|
@@ -3,7 +3,10 @@ import { ElementActions } from './ElementActions.js';
|
|
|
3
3
|
import { Handle } from '@xyflow/react';
|
|
4
4
|
import { Position } from '@xyflow/system';
|
|
5
5
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
6
|
-
import
|
|
6
|
+
import '@xstate/react';
|
|
7
|
+
import 'fast-equals';
|
|
8
|
+
import 'react';
|
|
9
|
+
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
7
10
|
import { memoNode } from '../../../base-primitives/memoNode.js';
|
|
8
11
|
import { CompoundNodeContainer } from '../../../base-primitives/compound/CompoundNodeContainer.js';
|
|
9
12
|
import { CompoundTitle } from '../../../base-primitives/compound/CompoundTitle.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { nonNullable } from '@likec4/core';
|
|
2
|
-
import { useCallbackRef } from '@mantine/hooks';
|
|
3
2
|
import { useSelector } from '@xstate/react';
|
|
4
3
|
import { shallowEqual } from 'fast-equals';
|
|
5
4
|
import { createContext, useMemo, useContext } from 'react';
|
|
5
|
+
import { useCallbackRef } from '../../hooks/useCallbackRef.js';
|
|
6
6
|
|
|
7
7
|
const RelationshipDetailsActorContext = createContext(null);
|
|
8
8
|
function useRelationshipDetailsActor() {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
3
|
import { ActionIcon, Group } from '@mantine/core';
|
|
4
|
-
import {
|
|
4
|
+
import { useStateHistory } from '@mantine/hooks';
|
|
5
5
|
import { useRafEffect } from '@react-hookz/web';
|
|
6
6
|
import { ReactFlowProvider, useStoreApi, useReactFlow, Panel } from '@xyflow/react';
|
|
7
7
|
import { shallowEqual } from 'fast-equals';
|
|
8
8
|
import { LayoutGroup, AnimatePresence, m } from 'motion/react';
|
|
9
9
|
import { useRef, memo, useEffect } from 'react';
|
|
10
10
|
import { BaseXYFlow } from '../../base/BaseXYFlow.js';
|
|
11
|
+
import { useCallbackRef } from '../../hooks/useCallbackRef.js';
|
|
11
12
|
import { RelationshipsBrowserActorContext, useRelationshipsBrowser, useRelationshipsBrowserState } from './hooks.js';
|
|
12
13
|
import { useRelationshipsView } from './layout.js';
|
|
13
14
|
import { SelectElement } from './SelectElement.js';
|
|
14
15
|
import { RelationshipEdge } from './custom/edgeTypes.js';
|
|
15
16
|
import { EmptyNode } from './custom/EmptyNode.js';
|
|
16
17
|
import { CompoundNode, ElementNode } from './custom/nodeTypes.js';
|
|
17
|
-
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
18
|
-
import IconChevronLeft from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
19
|
-
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
18
|
+
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';
|
|
19
|
+
import IconChevronLeft from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js';
|
|
20
|
+
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
|
|
20
21
|
|
|
21
22
|
const nodeTypes = {
|
|
22
23
|
element: ElementNode,
|
|
@@ -103,6 +104,7 @@ const RelationshipsBrowserXYFlow = memo(() => {
|
|
|
103
104
|
browser.send({ type: "xyflow.selectionChange", ...params });
|
|
104
105
|
}),
|
|
105
106
|
nodesDraggable: false,
|
|
107
|
+
nodesSelectable: true,
|
|
106
108
|
pannable: true,
|
|
107
109
|
zoomable: true,
|
|
108
110
|
children: /* @__PURE__ */ jsx(RelationshipsBrowserInner, {})
|
|
@@ -7,8 +7,8 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
|
7
7
|
import { useRelationshipsBrowser, useRelationshipsBrowserState } from './hooks.js';
|
|
8
8
|
import * as SelectElement_css from './SelectElement.css.js';
|
|
9
9
|
import { scrollArea } from './SelectElement.css.js';
|
|
10
|
-
import IconSelector from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
11
|
-
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
10
|
+
import IconSelector from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
|
|
11
|
+
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
|
|
12
12
|
|
|
13
13
|
const selector2 = (state) => {
|
|
14
14
|
const subjectExistsInScope = state.context.layouted?.subjectExistsInScope ?? false;
|